Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .changeset/use-download-hook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@ark-ui/react': patch
'@ark-ui/solid': patch
'@ark-ui/svelte': patch
'@ark-ui/vue': patch
---

- **DownloadTrigger**: Extract the download logic into a `useDownload` hook. The `DownloadTrigger` component now simply
consumes this hook, making the browser-download behavior reusable outside of the trigger component.
20 changes: 16 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/react/src/components/accordion/accordion-context.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ReactNode } from 'react'
import { type UseAccordionContext, useAccordionContext } from './use-accordion-context'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ReactNode } from 'react'
import { type UseAccordionItemContext, useAccordionItemContext } from './use-accordion-item-context'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { useCollapsibleContext } from '../collapsible'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/accordion/accordion-item.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ItemProps } from '@zag-js/accordion'
import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/accordion/accordion-root.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import type { Assign } from '../../types'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/accordion/accordion.anatomy.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use client'

export { anatomy as accordionAnatomy } from '@zag-js/accordion'
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { createContext } from '../../utils/create-context'
import type { UseAccordionReturn } from './use-accordion'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ItemState } from '@zag-js/accordion'
import { createContext } from '../../utils/create-context'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ItemProps } from '@zag-js/accordion'
import { createContext } from '../../utils/create-context'

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/accordion/use-accordion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import * as accordion from '@zag-js/accordion'
import { type PropTypes, normalizeProps, useMachine } from '@zag-js/react'
import { useId } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ReactNode } from 'react'
import { type UseAngleSliderContext, useAngleSliderContext } from './use-angle-slider-context'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { MarkerProps } from '@zag-js/angle-slider'
import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import type { Assign } from '../../types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
import { useAngleSliderContext } from './use-angle-slider-context'
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use client'

export { anatomy as angleSliderAnatomy } from '@zag-js/angle-slider'
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { createContext } from '../../utils/create-context'
import type { UseAngleSliderReturn } from './use-angle-slider'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import * as angleSlider from '@zag-js/angle-slider'
import { type PropTypes, normalizeProps, useMachine } from '@zag-js/react'
import { useId } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/avatar-context.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ReactNode } from 'react'
import { type UseAvatarContext, useAvatarContext } from './use-avatar-context'

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/avatar-fallback.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/avatar-image.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/avatar-root-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/avatar-root.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/avatar.anatomy.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use client'

export { anatomy as avatarAnatomy } from '@zag-js/avatar'
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/use-avatar-context.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { createContext } from '../../utils/create-context'
import type { UseAvatarReturn } from './use-avatar'

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/avatar/use-avatar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import * as avatar from '@zag-js/avatar'
import { type PropTypes, normalizeProps, useMachine } from '@zag-js/react'
import { useId } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
import { carouselAnatomy } from './carousel.anatomy'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/carousel-context.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ReactNode } from 'react'
import { type UseCarouselContext, useCarouselContext } from './use-carousel-context'

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/carousel-control.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/carousel-indicator.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { IndicatorProps } from '@zag-js/carousel'
import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/carousel-item.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ItemProps } from '@zag-js/carousel'
import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { forwardRef, useMemo } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
import { carouselAnatomy } from './carousel.anatomy'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/carousel-root.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/carousel.anatomy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { anatomy } from '@zag-js/carousel'

export const carouselAnatomy = anatomy.extendWith('progressText', 'autoplayIndicator')
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { createContext } from '../../utils/create-context'
import type { UseCarouselReturn } from './use-carousel'

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/carousel/use-carousel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import * as carousel from '@zag-js/carousel'
import { type PropTypes, normalizeProps, useMachine } from '@zag-js/react'
import { useId } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/checkbox/checkbox-context.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { ReactNode } from 'react'
import { type UseCheckboxContext, useCheckboxContext } from './use-checkbox-context'

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/checkbox/checkbox-control.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { mergeProps } from '@zag-js/react'
import { forwardRef } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { forwardRef } from 'react'
import type { Assign } from '../../types'
import { createSplitProps } from '../../utils/create-split-props'
Expand Down
Loading