@ark-ui/react 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/accordion/accordion-context.d.ts +2 -9
  3. package/accordion/accordion.cjs +3 -2
  4. package/accordion/accordion.d.ts +2 -2
  5. package/accordion/accordion.mjs +3 -2
  6. package/accordion/index.cjs +1 -0
  7. package/accordion/index.d.ts +4 -4
  8. package/accordion/index.mjs +1 -0
  9. package/accordion/use-accordion.d.ts +2 -7
  10. package/avatar/avatar-context.d.ts +2 -9
  11. package/avatar/index.cjs +1 -0
  12. package/avatar/index.mjs +1 -0
  13. package/avatar/use-avatar.d.ts +2 -7
  14. package/carousel/carousel-context.d.ts +2 -9
  15. package/carousel/carousel.d.ts +3 -3
  16. package/carousel/index.cjs +1 -0
  17. package/carousel/index.d.ts +7 -12
  18. package/carousel/index.mjs +1 -0
  19. package/carousel/use-carousel.d.ts +2 -7
  20. package/checkbox/checkbox-context.d.ts +2 -9
  21. package/checkbox/checkbox.d.ts +3 -3
  22. package/checkbox/index.cjs +1 -0
  23. package/checkbox/index.d.ts +7 -13
  24. package/checkbox/index.mjs +1 -0
  25. package/checkbox/use-checkbox.d.ts +2 -7
  26. package/color-picker/color-picker-context.d.ts +2 -9
  27. package/color-picker/index.cjs +1 -0
  28. package/color-picker/index.mjs +1 -0
  29. package/color-picker/use-color-picker.d.ts +2 -7
  30. package/combobox/combobox-context.d.ts +2 -9
  31. package/combobox/combobox.cjs +0 -1
  32. package/combobox/combobox.d.ts +1 -1
  33. package/combobox/combobox.mjs +0 -1
  34. package/combobox/index.cjs +1 -0
  35. package/combobox/index.d.ts +7 -12
  36. package/combobox/index.mjs +1 -0
  37. package/combobox/use-combobox.d.ts +2 -7
  38. package/compose-refs.cjs +0 -1
  39. package/compose-refs.mjs +0 -1
  40. package/date-picker/date-picker-context.d.ts +2 -9
  41. package/date-picker/index.cjs +1 -0
  42. package/date-picker/index.mjs +1 -0
  43. package/date-picker/use-date-picker.d.ts +2 -7
  44. package/dialog/dialog-context.d.ts +2 -9
  45. package/dialog/index.cjs +1 -0
  46. package/dialog/index.mjs +1 -0
  47. package/dialog/use-dialog.d.ts +2 -7
  48. package/editable/editable-context.d.ts +2 -9
  49. package/editable/editable.d.ts +3 -3
  50. package/editable/index.cjs +1 -0
  51. package/editable/index.d.ts +7 -12
  52. package/editable/index.mjs +1 -0
  53. package/editable/use-editable.d.ts +2 -7
  54. package/environment/index.cjs +1 -0
  55. package/environment/index.mjs +1 -0
  56. package/factory.cjs +2 -3
  57. package/factory.mjs +1 -2
  58. package/hover-card/hover-card-context.d.ts +2 -9
  59. package/hover-card/index.cjs +1 -0
  60. package/hover-card/index.mjs +1 -0
  61. package/hover-card/use-hover-card.d.ts +2 -7
  62. package/index.cjs +0 -2
  63. package/index.mjs +0 -1
  64. package/menu/index.cjs +1 -0
  65. package/menu/index.d.ts +2 -2
  66. package/menu/index.mjs +1 -0
  67. package/menu/menu-item.d.ts +5 -8
  68. package/menu/use-menu.d.ts +1 -1
  69. package/number-input/index.cjs +1 -0
  70. package/number-input/index.d.ts +2 -2
  71. package/number-input/index.mjs +1 -0
  72. package/number-input/number-input-context.d.ts +2 -9
  73. package/number-input/number-input.d.ts +1 -1
  74. package/number-input/use-number-input.d.ts +2 -7
  75. package/package.json +49 -48
  76. package/pagination/index.cjs +1 -0
  77. package/pagination/index.d.ts +5 -11
  78. package/pagination/index.mjs +1 -0
  79. package/pagination/pagination-context.d.ts +2 -9
  80. package/pagination/pagination.d.ts +2 -2
  81. package/pagination/use-pagination.d.ts +2 -7
  82. package/pin-input/index.cjs +1 -0
  83. package/pin-input/index.d.ts +2 -2
  84. package/pin-input/index.mjs +1 -0
  85. package/pin-input/pin-input-context.d.ts +2 -9
  86. package/pin-input/pin-input.d.ts +1 -1
  87. package/pin-input/use-pin-input.d.ts +2 -7
  88. package/popover/index.cjs +1 -0
  89. package/popover/index.mjs +1 -0
  90. package/popover/popover-context.d.ts +2 -9
  91. package/popover/use-popover.d.ts +2 -7
  92. package/presence/index.cjs +1 -0
  93. package/presence/index.mjs +1 -0
  94. package/presence/use-presence.d.ts +1 -1
  95. package/pressable/index.cjs +1 -0
  96. package/pressable/index.mjs +1 -0
  97. package/pressable/use-pressable.d.ts +2 -7
  98. package/radio-group/index.cjs +1 -0
  99. package/radio-group/index.d.ts +2 -2
  100. package/radio-group/index.mjs +1 -0
  101. package/radio-group/radio-group-context.d.ts +2 -9
  102. package/radio-group/radio-group.d.ts +1 -1
  103. package/radio-group/use-radio-group.d.ts +2 -7
  104. package/range-slider/index.cjs +1 -0
  105. package/range-slider/index.d.ts +8 -16
  106. package/range-slider/index.mjs +1 -0
  107. package/range-slider/range-slider-context.d.ts +2 -9
  108. package/range-slider/range-slider.cjs +3 -0
  109. package/range-slider/range-slider.d.ts +1 -1
  110. package/range-slider/range-slider.mjs +3 -0
  111. package/range-slider/use-range-slider.d.ts +2 -7
  112. package/rating-group/index.cjs +1 -0
  113. package/rating-group/index.d.ts +6 -8
  114. package/rating-group/index.mjs +1 -0
  115. package/rating-group/rating-group-context.d.ts +2 -9
  116. package/rating-group/rating-group-control.d.ts +2 -2
  117. package/rating-group/rating-group.d.ts +1 -1
  118. package/rating-group/use-rating-group.d.ts +2 -7
  119. package/segment-group/index.cjs +1 -0
  120. package/segment-group/index.d.ts +2 -2
  121. package/segment-group/index.mjs +1 -0
  122. package/segment-group/segment-group-context.d.ts +2 -9
  123. package/segment-group/segment-group.d.ts +1 -1
  124. package/segment-group/use-segment-group.d.ts +2 -7
  125. package/select/index.cjs +1 -0
  126. package/select/index.mjs +1 -0
  127. package/select/select-context.d.ts +2 -9
  128. package/select/use-select.d.ts +2 -7
  129. package/slider/index.cjs +1 -0
  130. package/slider/index.d.ts +5 -15
  131. package/slider/index.mjs +1 -0
  132. package/slider/slider-context.d.ts +2 -9
  133. package/slider/slider.cjs +2 -0
  134. package/slider/slider.mjs +2 -0
  135. package/slider/use-slider.d.ts +2 -7
  136. package/splitter/index.cjs +1 -0
  137. package/splitter/index.d.ts +7 -12
  138. package/splitter/index.mjs +1 -0
  139. package/splitter/splitter-context.d.ts +2 -9
  140. package/splitter/splitter.d.ts +1 -1
  141. package/splitter/use-splitter.d.ts +2 -7
  142. package/switch/index.cjs +1 -3
  143. package/switch/index.d.ts +6 -19
  144. package/switch/index.mjs +2 -3
  145. package/switch/switch-context.d.ts +2 -9
  146. package/switch/switch-control.cjs +5 -2
  147. package/switch/switch-control.mjs +6 -3
  148. package/switch/switch.d.ts +2 -2
  149. package/switch/use-switch.d.ts +2 -7
  150. package/tabs/index.cjs +1 -0
  151. package/tabs/index.d.ts +2 -2
  152. package/tabs/index.mjs +1 -0
  153. package/tabs/tabs-context.d.ts +2 -9
  154. package/tabs/tabs.d.ts +1 -1
  155. package/tabs/use-tabs.cjs +21 -2
  156. package/tabs/use-tabs.d.ts +5 -10
  157. package/tabs/use-tabs.mjs +3 -3
  158. package/tags-input/index.cjs +1 -0
  159. package/tags-input/index.d.ts +2 -2
  160. package/tags-input/index.mjs +1 -0
  161. package/tags-input/tags-input-context.d.ts +2 -9
  162. package/tags-input/tags-input.cjs +1 -2
  163. package/tags-input/tags-input.d.ts +2 -2
  164. package/tags-input/tags-input.mjs +1 -2
  165. package/tags-input/use-tags-input.d.ts +2 -7
  166. package/toast/index.cjs +1 -0
  167. package/toast/index.d.ts +1 -1
  168. package/toast/index.mjs +1 -0
  169. package/toast/toast-group.d.ts +2 -2
  170. package/toast/toast-item-context.d.ts +2 -9
  171. package/toast/toast-provider.d.ts +2 -57
  172. package/toast/use-toast-item.d.ts +2 -7
  173. package/tooltip/index.cjs +1 -0
  174. package/tooltip/index.mjs +1 -0
  175. package/tooltip/tooltip-context.d.ts +2 -9
  176. package/tooltip/use-tooltip.d.ts +2 -7
  177. package/switch/switch-input.cjs +0 -19
  178. package/switch/switch-input.d.ts +0 -8
  179. package/switch/switch-input.mjs +0 -15
package/select/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
package/select/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Select as Select$1 } from './select.mjs';
2
3
  import { SelectContent } from './select-content.mjs';
3
4
  export { useSelectContext } from './select-context.mjs';
@@ -1,12 +1,5 @@
1
- import { PublicApi } from '@zag-js/select';
2
- import { Provider, HTMLAttributes, CSSProperties } from 'react';
1
+ import { Provider } from 'react';
3
2
  /// <reference types="react" />
4
3
  import { type UseSelectReturn } from './use-select';
5
4
  export type SelectContext = UseSelectReturn;
6
- export declare const SelectProvider: Provider<PublicApi<JSX.IntrinsicElements & {
7
- element: HTMLAttributes<HTMLElement>;
8
- style: CSSProperties;
9
- }>>, useSelectContext: () => PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
5
+ export declare const SelectProvider: Provider<UseSelectReturn>, useSelectContext: () => UseSelectReturn;
@@ -1,12 +1,7 @@
1
- import { HTMLAttributes, CSSProperties } from 'react';
2
- /// <reference types="react" />
3
1
  import * as select from '@zag-js/select';
4
2
  import { type Optional } from '../types';
5
3
  export type UseSelectProps = Optional<select.Context, 'id'> & {
6
4
  defaultValue?: select.Context['selectedOption'];
7
5
  };
8
- export type UseSelectReturn = ReturnType<typeof useSelect>;
9
- export declare const useSelect: (props: UseSelectProps) => select.PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
6
+ export type UseSelectReturn = select.Api;
7
+ export declare const useSelect: (props: UseSelectProps) => UseSelectReturn;
package/slider/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
package/slider/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { PublicApi } from '@zag-js/slider';
2
- import { UseSliderProps } from './use-slider';
1
+ import { UseSliderProps, UseSliderReturn } from './use-slider';
3
2
  import { Assign } from '../types';
4
- import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode, CSSProperties, RefAttributes, LabelHTMLAttributes, OutputHTMLAttributes } from 'react';
3
+ import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode, RefAttributes, LabelHTMLAttributes, OutputHTMLAttributes } from 'react';
5
4
  /// <reference types="react" />
6
5
  import { type SliderProps } from './slider';
7
6
  import { useSliderContext } from './slider-context';
@@ -19,20 +18,14 @@ declare const Slider: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHT
19
18
  } & {
20
19
  asChild?: boolean | undefined;
21
20
  }, "ref">, UseSliderProps>, "children"> & {
22
- children?: ReactNode | ((context: PublicApi<JSX.IntrinsicElements & {
23
- element: HTMLAttributes<HTMLElement>;
24
- style: CSSProperties;
25
- }>) => ReactNode);
21
+ children?: ReactNode | ((context: UseSliderReturn) => ReactNode);
26
22
  } & RefAttributes<HTMLDivElement>> & {
27
23
  Root: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
28
24
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
29
25
  } & {
30
26
  asChild?: boolean | undefined;
31
27
  }, "ref">, UseSliderProps>, "children"> & {
32
- children?: ReactNode | ((context: PublicApi<JSX.IntrinsicElements & {
33
- element: HTMLAttributes<HTMLElement>;
34
- style: CSSProperties;
35
- }>) => ReactNode);
28
+ children?: ReactNode | ((context: UseSliderReturn) => ReactNode);
36
29
  } & RefAttributes<HTMLDivElement>>;
37
30
  Control: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
38
31
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
@@ -61,10 +54,7 @@ declare const Slider: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHT
61
54
  } & {
62
55
  asChild?: boolean | undefined;
63
56
  }, "ref">, "children"> & {
64
- children?: ReactNode | ((context: PublicApi<JSX.IntrinsicElements & {
65
- element: HTMLAttributes<HTMLElement>;
66
- style: CSSProperties;
67
- }>) => ReactNode);
57
+ children?: ReactNode | ((context: UseSliderReturn) => ReactNode);
68
58
  } & RefAttributes<HTMLOutputElement>>;
69
59
  Range: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
70
60
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
package/slider/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Slider as Slider$1 } from './slider.mjs';
2
3
  export { useSliderContext } from './slider-context.mjs';
3
4
  import { SliderControl } from './slider-control.mjs';
@@ -1,12 +1,5 @@
1
- import { PublicApi } from '@zag-js/slider';
2
- import { Provider, HTMLAttributes, CSSProperties } from 'react';
1
+ import { Provider } from 'react';
3
2
  /// <reference types="react" />
4
3
  import { type UseSliderReturn } from './use-slider';
5
4
  export type SliderContext = UseSliderReturn;
6
- export declare const SliderProvider: Provider<PublicApi<JSX.IntrinsicElements & {
7
- element: HTMLAttributes<HTMLElement>;
8
- style: CSSProperties;
9
- }>>, useSliderContext: () => PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
5
+ export declare const SliderProvider: Provider<UseSliderReturn>, useSliderContext: () => UseSliderReturn;
package/slider/slider.cjs CHANGED
@@ -38,6 +38,8 @@ const Slider = react.forwardRef((props, ref) => {
38
38
  "readOnly",
39
39
  "step",
40
40
  "thumbAlignment",
41
+ "thumbAlignment",
42
+ "thumbSize",
41
43
  "value"
42
44
  ]);
43
45
  const slider = useSlider.useSlider(useSliderProps);
package/slider/slider.mjs CHANGED
@@ -34,6 +34,8 @@ const Slider = forwardRef((props, ref) => {
34
34
  "readOnly",
35
35
  "step",
36
36
  "thumbAlignment",
37
+ "thumbAlignment",
38
+ "thumbSize",
37
39
  "value"
38
40
  ]);
39
41
  const slider = useSlider(useSliderProps);
@@ -1,12 +1,7 @@
1
- import { HTMLAttributes, CSSProperties } from 'react';
2
- /// <reference types="react" />
3
1
  import * as slider from '@zag-js/slider';
4
2
  import { type Optional } from '../types';
5
3
  export type UseSliderProps = Optional<slider.Context, 'id'> & {
6
4
  defaultValue?: slider.Context['value'];
7
5
  };
8
- export type UseSliderReturn = ReturnType<typeof useSlider>;
9
- export declare const useSlider: (props: UseSliderProps) => slider.PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
6
+ export type UseSliderReturn = slider.Api;
7
+ export declare const useSlider: (props: UseSliderProps) => UseSliderReturn;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -1,5 +1,6 @@
1
- import { Context, PublicApi, PanelProps, ResizeTriggerProps } from '@zag-js/splitter';
2
- import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode, CSSProperties, RefAttributes, ButtonHTMLAttributes } from 'react';
1
+ import { UseSplitterReturn } from './use-splitter';
2
+ import { Context, PanelProps, ResizeTriggerProps } from '@zag-js/splitter';
3
+ import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode, RefAttributes, ButtonHTMLAttributes } from 'react';
3
4
  /// <reference types="react" />
4
5
  import { type SplitterProps } from './splitter';
5
6
  import { useSplitterContext } from './splitter-context';
@@ -10,7 +11,7 @@ declare const Splitter: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLPro
10
11
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
11
12
  } & {
12
13
  asChild?: boolean | undefined;
13
- }, "ref">, "children" | "getRootNode" | "id" | "ids" | "orientation" | "onResize" | "dir" | "size" | "onResizeStart" | "onResizeEnd" | "defaultSize"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
14
+ }, "ref">, "children" | "getRootNode" | "id" | "ids" | "dir" | "onResize" | "size" | "orientation" | "onResizeStart" | "onResizeEnd" | "defaultSize"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
14
15
  defaultSize?: {
15
16
  id: string | number;
16
17
  size?: number | undefined;
@@ -18,16 +19,13 @@ declare const Splitter: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLPro
18
19
  maxSize?: number | undefined;
19
20
  }[] | undefined;
20
21
  } & {
21
- children?: ReactNode | ((state: PublicApi<JSX.IntrinsicElements & {
22
- element: HTMLAttributes<HTMLElement>;
23
- style: CSSProperties;
24
- }>) => ReactNode);
22
+ children?: ReactNode | ((state: UseSplitterReturn) => ReactNode);
25
23
  } & RefAttributes<HTMLDivElement>> & {
26
24
  Root: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
27
25
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
28
26
  } & {
29
27
  asChild?: boolean | undefined;
30
- }, "ref">, "children" | "getRootNode" | "id" | "ids" | "orientation" | "onResize" | "dir" | "size" | "onResizeStart" | "onResizeEnd" | "defaultSize"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
28
+ }, "ref">, "children" | "getRootNode" | "id" | "ids" | "dir" | "onResize" | "size" | "orientation" | "onResizeStart" | "onResizeEnd" | "defaultSize"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
31
29
  defaultSize?: {
32
30
  id: string | number;
33
31
  size?: number | undefined;
@@ -35,10 +33,7 @@ declare const Splitter: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLPro
35
33
  maxSize?: number | undefined;
36
34
  }[] | undefined;
37
35
  } & {
38
- children?: ReactNode | ((state: PublicApi<JSX.IntrinsicElements & {
39
- element: HTMLAttributes<HTMLElement>;
40
- style: CSSProperties;
41
- }>) => ReactNode);
36
+ children?: ReactNode | ((state: UseSplitterReturn) => ReactNode);
42
37
  } & RefAttributes<HTMLDivElement>>;
43
38
  Panel: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
44
39
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Splitter as Splitter$1 } from './splitter.mjs';
2
3
  export { useSplitterContext } from './splitter-context.mjs';
3
4
  import { SplitterPanel } from './splitter-panel.mjs';
@@ -1,12 +1,5 @@
1
- import { PublicApi } from '@zag-js/splitter';
2
- import { Provider, HTMLAttributes, CSSProperties } from 'react';
1
+ import { Provider } from 'react';
3
2
  /// <reference types="react" />
4
3
  import { type UseSplitterReturn } from './use-splitter';
5
4
  export type SplitterContext = UseSplitterReturn;
6
- export declare const SplitterProvider: Provider<PublicApi<JSX.IntrinsicElements & {
7
- element: HTMLAttributes<HTMLElement>;
8
- style: CSSProperties;
9
- }>>, useSplitterContext: () => PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
5
+ export declare const SplitterProvider: Provider<UseSplitterReturn>, useSplitterContext: () => UseSplitterReturn;
@@ -11,7 +11,7 @@ export declare const Splitter: ForwardRefExoticComponent<Omit<Omit<Omit<Detailed
11
11
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
12
12
  } & {
13
13
  asChild?: boolean | undefined;
14
- }, "ref">, "children" | "getRootNode" | "id" | "ids" | "orientation" | "onResize" | "dir" | "size" | "onResizeStart" | "onResizeEnd" | "defaultSize"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
14
+ }, "ref">, "children" | "getRootNode" | "id" | "ids" | "dir" | "onResize" | "size" | "orientation" | "onResizeStart" | "onResizeEnd" | "defaultSize"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
15
15
  defaultSize?: {
16
16
  id: string | number;
17
17
  size?: number | undefined;
@@ -1,12 +1,7 @@
1
- import { HTMLAttributes, CSSProperties } from 'react';
2
- /// <reference types="react" />
3
1
  import * as splitter from '@zag-js/splitter';
4
2
  import { type Optional } from '../types';
5
3
  export type UseSplitterProps = Optional<splitter.Context, 'id'> & {
6
4
  defaultSize?: splitter.Context['size'];
7
5
  };
8
- export type UseSplitterReturn = ReturnType<typeof useSplitter>;
9
- export declare const useSplitter: (props: UseSplitterProps) => splitter.PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
6
+ export type UseSplitterReturn = splitter.Api;
7
+ export declare const useSplitter: (props: UseSplitterProps) => UseSplitterReturn;
package/switch/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -5,7 +6,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
6
  const _switch = require('./switch.cjs');
6
7
  const switchContext = require('./switch-context.cjs');
7
8
  const switchControl = require('./switch-control.cjs');
8
- const switchInput = require('./switch-input.cjs');
9
9
  const switchLabel = require('./switch-label.cjs');
10
10
  const switchThumb = require('./switch-thumb.cjs');
11
11
  const zagSwitch = require('@zag-js/switch');
@@ -13,14 +13,12 @@ const zagSwitch = require('@zag-js/switch');
13
13
  const Switch = Object.assign(_switch.Switch, {
14
14
  Root: _switch.Switch,
15
15
  Control: switchControl.SwitchControl,
16
- Input: switchInput.SwitchInput,
17
16
  Label: switchLabel.SwitchLabel,
18
17
  Thumb: switchThumb.SwitchThumb
19
18
  });
20
19
 
21
20
  exports.useSwitchContext = switchContext.useSwitchContext;
22
21
  exports.SwitchControl = switchControl.SwitchControl;
23
- exports.SwitchInput = switchInput.SwitchInput;
24
22
  exports.SwitchLabel = switchLabel.SwitchLabel;
25
23
  exports.SwitchThumb = switchThumb.SwitchThumb;
26
24
  Object.defineProperty(exports, 'switchAnatomy', {
package/switch/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- import { PublicApi } from '@zag-js/switch';
2
- import { UseSwitchProps } from './use-switch';
1
+ import { UseSwitchProps, UseSwitchReturn } from './use-switch';
3
2
  import { Assign } from '../types';
4
- import { ForwardRefExoticComponent, DetailedHTMLProps, LabelHTMLAttributes, RefObject, ReactNode, HTMLAttributes, CSSProperties, RefAttributes, InputHTMLAttributes } from 'react';
3
+ import { ForwardRefExoticComponent, DetailedHTMLProps, LabelHTMLAttributes, RefObject, ReactNode, RefAttributes, HTMLAttributes } from 'react';
5
4
  /// <reference types="react" />
6
5
  import { type SwitchProps } from './switch';
7
6
  import { useSwitchContext } from './switch-context';
8
7
  import { SwitchControl, type SwitchControlProps } from './switch-control';
9
- import { SwitchInput, type SwitchInputProps } from './switch-input';
10
8
  import { SwitchLabel, type SwitchLabelProps } from './switch-label';
11
9
  import { SwitchThumb, type SwitchThumbProps } from './switch-thumb';
12
10
  import { switchAnatomy } from './switch.anatomy';
@@ -15,31 +13,20 @@ declare const Switch: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHT
15
13
  } & {
16
14
  asChild?: boolean | undefined;
17
15
  }, "ref">, UseSwitchProps>, "children"> & {
18
- children: ReactNode | ((pages: PublicApi<JSX.IntrinsicElements & {
19
- element: HTMLAttributes<HTMLElement>;
20
- style: CSSProperties;
21
- }>) => ReactNode);
16
+ children?: ReactNode | ((pages: UseSwitchReturn) => ReactNode);
22
17
  } & RefAttributes<HTMLLabelElement>> & {
23
18
  Root: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
24
19
  ref?: ((instance: HTMLLabelElement | null) => void) | RefObject<HTMLLabelElement> | null | undefined;
25
20
  } & {
26
21
  asChild?: boolean | undefined;
27
22
  }, "ref">, UseSwitchProps>, "children"> & {
28
- children: ReactNode | ((pages: PublicApi<JSX.IntrinsicElements & {
29
- element: HTMLAttributes<HTMLElement>;
30
- style: CSSProperties;
31
- }>) => ReactNode);
23
+ children?: ReactNode | ((pages: UseSwitchReturn) => ReactNode);
32
24
  } & RefAttributes<HTMLLabelElement>>;
33
25
  Control: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
34
26
  ref?: RefObject<HTMLSpanElement> | ((instance: HTMLSpanElement | null) => void) | null | undefined;
35
27
  } & {
36
28
  asChild?: boolean | undefined;
37
29
  }, "ref"> & RefAttributes<HTMLSpanElement>>;
38
- Input: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
39
- ref?: ((instance: HTMLInputElement | null) => void) | RefObject<HTMLInputElement> | null | undefined;
40
- } & {
41
- asChild?: boolean | undefined;
42
- }, "ref"> & RefAttributes<HTMLInputElement>>;
43
30
  Label: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
44
31
  ref?: RefObject<HTMLSpanElement> | ((instance: HTMLSpanElement | null) => void) | null | undefined;
45
32
  } & {
@@ -51,5 +38,5 @@ declare const Switch: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHT
51
38
  asChild?: boolean | undefined;
52
39
  }, "ref"> & RefAttributes<HTMLSpanElement>>;
53
40
  };
54
- export { Switch, SwitchControl, SwitchInput, SwitchLabel, SwitchThumb, switchAnatomy, useSwitchContext, };
55
- export type { SwitchControlProps, SwitchInputProps, SwitchLabelProps, SwitchProps, SwitchThumbProps, };
41
+ export { Switch, SwitchControl, SwitchLabel, SwitchThumb, switchAnatomy, useSwitchContext };
42
+ export type { SwitchControlProps, SwitchLabelProps, SwitchProps, SwitchThumbProps };
package/switch/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
+ 'use client';
1
2
  import { Switch as Switch$1 } from './switch.mjs';
2
3
  export { useSwitchContext } from './switch-context.mjs';
3
4
  import { SwitchControl } from './switch-control.mjs';
4
- import { SwitchInput } from './switch-input.mjs';
5
5
  import { SwitchLabel } from './switch-label.mjs';
6
6
  import { SwitchThumb } from './switch-thumb.mjs';
7
7
  export { anatomy as switchAnatomy } from '@zag-js/switch';
@@ -9,9 +9,8 @@ export { anatomy as switchAnatomy } from '@zag-js/switch';
9
9
  const Switch = Object.assign(Switch$1, {
10
10
  Root: Switch$1,
11
11
  Control: SwitchControl,
12
- Input: SwitchInput,
13
12
  Label: SwitchLabel,
14
13
  Thumb: SwitchThumb
15
14
  });
16
15
 
17
- export { Switch, SwitchControl, SwitchInput, SwitchLabel, SwitchThumb };
16
+ export { Switch, SwitchControl, SwitchLabel, SwitchThumb };
@@ -1,12 +1,5 @@
1
- import { PublicApi } from '@zag-js/switch';
2
- import { Provider, HTMLAttributes, CSSProperties } from 'react';
1
+ import { Provider } from 'react';
3
2
  /// <reference types="react" />
4
3
  import { type UseSwitchReturn } from './use-switch';
5
4
  export type SwitchContext = UseSwitchReturn;
6
- export declare const SwitchProvider: Provider<PublicApi<JSX.IntrinsicElements & {
7
- element: HTMLAttributes<HTMLElement>;
8
- style: CSSProperties;
9
- }>>, useSwitchContext: () => PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
5
+ export declare const SwitchProvider: Provider<UseSwitchReturn>, useSwitchContext: () => UseSwitchReturn;
@@ -10,9 +10,12 @@ const factory = require('../factory.cjs');
10
10
  const switchContext = require('./switch-context.cjs');
11
11
 
12
12
  const SwitchControl = react.forwardRef((props, ref) => {
13
- const { controlProps } = switchContext.useSwitchContext();
13
+ const { controlProps, hiddenInputProps } = switchContext.useSwitchContext();
14
14
  const mergedProps = react$1.mergeProps(controlProps, props);
15
- return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref });
15
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16
+ /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref }),
17
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ...hiddenInputProps })
18
+ ] });
16
19
  });
17
20
  SwitchControl.displayName = "SwitchControl";
18
21
 
@@ -1,14 +1,17 @@
1
1
  'use client';
2
- import { jsx } from 'react/jsx-runtime';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import { mergeProps } from '@zag-js/react';
4
4
  import { forwardRef } from 'react';
5
5
  import { ark } from '../factory.mjs';
6
6
  import { useSwitchContext } from './switch-context.mjs';
7
7
 
8
8
  const SwitchControl = forwardRef((props, ref) => {
9
- const { controlProps } = useSwitchContext();
9
+ const { controlProps, hiddenInputProps } = useSwitchContext();
10
10
  const mergedProps = mergeProps(controlProps, props);
11
- return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });
11
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref }),
13
+ /* @__PURE__ */ jsx("input", { ...hiddenInputProps })
14
+ ] });
12
15
  });
13
16
  SwitchControl.displayName = "SwitchControl";
14
17
 
@@ -4,12 +4,12 @@ import { ark } from '../factory';
4
4
  import type { Assign } from '../types';
5
5
  import { type UseSwitchProps, type UseSwitchReturn } from './use-switch';
6
6
  export type SwitchProps = Assign<Assign<ComponentPropsWithoutRef<typeof ark.label>, UseSwitchProps>, {
7
- children: ReactNode | ((pages: UseSwitchReturn) => ReactNode);
7
+ children?: ReactNode | ((pages: UseSwitchReturn) => ReactNode);
8
8
  }>;
9
9
  export declare const Switch: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
10
10
  ref?: ((instance: HTMLLabelElement | null) => void) | RefObject<HTMLLabelElement> | null | undefined;
11
11
  } & {
12
12
  asChild?: boolean | undefined;
13
13
  }, "ref">, UseSwitchProps>, "children"> & {
14
- children: ReactNode | ((pages: UseSwitchReturn) => ReactNode);
14
+ children?: ReactNode | ((pages: UseSwitchReturn) => ReactNode);
15
15
  } & RefAttributes<HTMLLabelElement>>;
@@ -1,12 +1,7 @@
1
- import { HTMLAttributes, CSSProperties } from 'react';
2
- /// <reference types="react" />
3
1
  import * as zagSwitch from '@zag-js/switch';
4
2
  import { type Optional } from '../types';
5
3
  export type UseSwitchProps = Optional<zagSwitch.Context, 'id'> & {
6
4
  defaultChecked?: boolean;
7
5
  };
8
- export declare const useSwitch: (props: UseSwitchProps) => zagSwitch.PublicApi<JSX.IntrinsicElements & {
9
- element: HTMLAttributes<HTMLElement>;
10
- style: CSSProperties;
11
- }>;
12
- export type UseSwitchReturn = ReturnType<typeof useSwitch>;
6
+ export type UseSwitchReturn = zagSwitch.Api;
7
+ export declare const useSwitch: (props: UseSwitchProps) => UseSwitchReturn;
package/tabs/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
package/tabs/index.d.ts CHANGED
@@ -13,14 +13,14 @@ declare const Tabs: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<H
13
13
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
14
14
  } & {
15
15
  asChild?: boolean | undefined;
16
- }, "ref">, "value" | "getRootNode" | "id" | "ids" | "orientation" | "onFocus" | "onChange" | "defaultValue" | "dir" | "loop" | "translations" | "activationMode" | "onDelete"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
16
+ }, "ref">, "value" | "getRootNode" | "id" | "ids" | "defaultValue" | "dir" | "onFocus" | "onChange" | "orientation" | "loop" | "translations" | "activationMode" | "onDelete"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
17
17
  defaultValue?: string | null | undefined;
18
18
  } & RefAttributes<HTMLDivElement>> & {
19
19
  Root: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
20
20
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
21
21
  } & {
22
22
  asChild?: boolean | undefined;
23
- }, "ref">, "value" | "getRootNode" | "id" | "ids" | "orientation" | "onFocus" | "onChange" | "defaultValue" | "dir" | "loop" | "translations" | "activationMode" | "onDelete"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
23
+ }, "ref">, "value" | "getRootNode" | "id" | "ids" | "defaultValue" | "dir" | "onFocus" | "onChange" | "orientation" | "loop" | "translations" | "activationMode" | "onDelete"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
24
24
  defaultValue?: string | null | undefined;
25
25
  } & RefAttributes<HTMLDivElement>>;
26
26
  Content: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
package/tabs/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { TabContent } from './tab-content.mjs';
2
3
  import { TabIndicator } from './tab-indicator.mjs';
3
4
  import { TabList } from './tab-list.mjs';
@@ -1,12 +1,5 @@
1
- import { PublicApi } from '@zag-js/tabs';
2
- import { Provider, HTMLAttributes, CSSProperties } from 'react';
1
+ import { Provider } from 'react';
3
2
  /// <reference types="react" />
4
3
  import { type UseTabsReturn } from './use-tabs';
5
4
  export type TabsContext = UseTabsReturn;
6
- export declare const TabsProvider: Provider<PublicApi<JSX.IntrinsicElements & {
7
- element: HTMLAttributes<HTMLElement>;
8
- style: CSSProperties;
9
- }>>, useTabsContext: () => PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
5
+ export declare const TabsProvider: Provider<UseTabsReturn>, useTabsContext: () => UseTabsReturn;
package/tabs/tabs.d.ts CHANGED
@@ -8,6 +8,6 @@ export declare const Tabs: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTML
8
8
  ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
9
9
  } & {
10
10
  asChild?: boolean | undefined;
11
- }, "ref">, "value" | "getRootNode" | "id" | "ids" | "orientation" | "onFocus" | "onChange" | "defaultValue" | "dir" | "loop" | "translations" | "activationMode" | "onDelete"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
11
+ }, "ref">, "value" | "getRootNode" | "id" | "ids" | "defaultValue" | "dir" | "onFocus" | "onChange" | "orientation" | "loop" | "translations" | "activationMode" | "onDelete"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
12
12
  defaultValue?: string | null | undefined;
13
13
  } & RefAttributes<HTMLDivElement>>;
package/tabs/use-tabs.cjs CHANGED
@@ -9,6 +9,25 @@ const react = require('react');
9
9
  require('../environment/index.cjs');
10
10
  const environmentContext = require('../environment/environment-context.cjs');
11
11
 
12
+ function _interopNamespaceDefault(e) {
13
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
14
+ if (e) {
15
+ for (const k in e) {
16
+ if (k !== 'default') {
17
+ const d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: () => e[k]
21
+ });
22
+ }
23
+ }
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ const tabs__namespace = /*#__PURE__*/_interopNamespaceDefault(tabs);
30
+
12
31
  const useTabs = (props) => {
13
32
  const getRootNode = environmentContext.useEnvironmentContext();
14
33
  const initialContext = {
@@ -21,8 +40,8 @@ const useTabs = (props) => {
21
40
  ...initialContext,
22
41
  value: props.value
23
42
  };
24
- const [state, send] = react$1.useMachine(tabs.machine(initialContext), { context });
25
- return tabs.connect(state, send, react$1.normalizeProps);
43
+ const [state, send] = react$1.useMachine(tabs__namespace.machine(initialContext), { context });
44
+ return tabs__namespace.connect(state, send, react$1.normalizeProps);
26
45
  };
27
46
 
28
47
  exports.useTabs = useTabs;
@@ -1,12 +1,7 @@
1
- import { HTMLAttributes, CSSProperties } from 'react';
2
- /// <reference types="react" />
3
- import { PublicApi, type Context } from '@zag-js/tabs';
1
+ import * as tabs from '@zag-js/tabs';
4
2
  import { type Optional } from '../types';
5
- export type UseTabsProps = Optional<Context, 'id'> & {
6
- defaultValue?: Context['value'];
3
+ export type UseTabsProps = Optional<tabs.Context, 'id'> & {
4
+ defaultValue?: tabs.Context['value'];
7
5
  };
8
- export type UseTabsReturn = ReturnType<typeof useTabs>;
9
- export declare const useTabs: (props: UseTabsProps) => PublicApi<JSX.IntrinsicElements & {
10
- element: HTMLAttributes<HTMLElement>;
11
- style: CSSProperties;
12
- }>;
6
+ export type UseTabsReturn = tabs.Api;
7
+ export declare const useTabs: (props: UseTabsProps) => UseTabsReturn;
package/tabs/use-tabs.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useMachine, normalizeProps } from '@zag-js/react';
3
- import { machine, connect } from '@zag-js/tabs';
3
+ import * as tabs from '@zag-js/tabs';
4
4
  import { useId } from 'react';
5
5
  import '../environment/index.mjs';
6
6
  import { useEnvironmentContext } from '../environment/environment-context.mjs';
@@ -17,8 +17,8 @@ const useTabs = (props) => {
17
17
  ...initialContext,
18
18
  value: props.value
19
19
  };
20
- const [state, send] = useMachine(machine(initialContext), { context });
21
- return connect(state, send, normalizeProps);
20
+ const [state, send] = useMachine(tabs.machine(initialContext), { context });
21
+ return tabs.connect(state, send, normalizeProps);
22
22
  };
23
23
 
24
24
  export { useTabs };
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -17,14 +17,14 @@ declare const TagsInput: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<Detaile
17
17
  } & {
18
18
  asChild?: boolean | undefined;
19
19
  }, "ref">, UseTagsInputProps>, "children"> & {
20
- children: ReactNode | ((pages: UseTagsInputProps) => ReactNode);
20
+ children?: ReactNode | ((pages: UseTagsInputProps) => ReactNode);
21
21
  } & RefAttributes<HTMLInputElement>> & {
22
22
  Root: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
23
23
  ref?: ((instance: HTMLInputElement | null) => void) | RefObject<HTMLInputElement> | null | undefined;
24
24
  } & {
25
25
  asChild?: boolean | undefined;
26
26
  }, "ref">, UseTagsInputProps>, "children"> & {
27
- children: ReactNode | ((pages: UseTagsInputProps) => ReactNode);
27
+ children?: ReactNode | ((pages: UseTagsInputProps) => ReactNode);
28
28
  } & RefAttributes<HTMLInputElement>>;
29
29
  ClearTrigger: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
30
30
  ref?: ((instance: HTMLButtonElement | null) => void) | RefObject<HTMLButtonElement> | null | undefined;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { Tag } from './tag.mjs';
2
3
  import { TagDeleteTrigger } from './tag-delete-trigger.mjs';
3
4
  import { TagInput } from './tag-input.mjs';