ui-ingredients 0.0.29 → 0.0.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. package/dist/accordion/accordion.d.ts +0 -1
  2. package/dist/accordion/accordion.js +0 -1
  3. package/dist/accordion/create-accordion.svelte.js +2 -2
  4. package/dist/accordion/index.d.ts +1 -0
  5. package/dist/accordion/index.js +1 -0
  6. package/dist/accordion/root.svelte +3 -1
  7. package/dist/avatar/avatar.d.ts +0 -1
  8. package/dist/avatar/avatar.js +0 -1
  9. package/dist/avatar/create-avatar.svelte.js +2 -2
  10. package/dist/avatar/index.d.ts +1 -0
  11. package/dist/avatar/index.js +1 -0
  12. package/dist/avatar/root.svelte +2 -1
  13. package/dist/carousel/carousel.d.ts +0 -1
  14. package/dist/carousel/carousel.js +0 -1
  15. package/dist/carousel/create-carousel.svelte.js +2 -2
  16. package/dist/carousel/index.d.ts +1 -0
  17. package/dist/carousel/index.js +1 -0
  18. package/dist/carousel/root.svelte +2 -1
  19. package/dist/checkbox/checkbox.d.ts +0 -1
  20. package/dist/checkbox/checkbox.js +0 -1
  21. package/dist/checkbox/create-checkbox.svelte.js +2 -2
  22. package/dist/checkbox/index.d.ts +1 -0
  23. package/dist/checkbox/index.js +1 -0
  24. package/dist/checkbox/root.svelte +3 -1
  25. package/dist/clipboard/clipboard.d.ts +0 -1
  26. package/dist/clipboard/clipboard.js +0 -1
  27. package/dist/clipboard/create-clipboard.svelte.js +2 -2
  28. package/dist/clipboard/index.d.ts +1 -0
  29. package/dist/clipboard/index.js +1 -0
  30. package/dist/clipboard/root.svelte +2 -1
  31. package/dist/collapsible/collapsible.d.ts +0 -1
  32. package/dist/collapsible/collapsible.js +0 -1
  33. package/dist/collapsible/create-collapsible.svelte.js +2 -2
  34. package/dist/collapsible/index.d.ts +1 -0
  35. package/dist/collapsible/index.js +1 -0
  36. package/dist/collapsible/root.svelte +2 -1
  37. package/dist/color-picker/color-picker.d.ts +1 -1
  38. package/dist/color-picker/color-picker.js +1 -1
  39. package/dist/color-picker/create-color-picker.svelte.js +2 -2
  40. package/dist/color-picker/index.d.ts +1 -0
  41. package/dist/color-picker/index.js +1 -0
  42. package/dist/combobox/combobox.d.ts +0 -1
  43. package/dist/combobox/combobox.js +0 -1
  44. package/dist/combobox/create-combobox.svelte.js +2 -2
  45. package/dist/combobox/index.d.ts +1 -0
  46. package/dist/combobox/index.js +1 -0
  47. package/dist/combobox/item-group.svelte +3 -3
  48. package/dist/combobox/root.svelte +2 -1
  49. package/dist/date-picker/anatomy.d.ts +2 -0
  50. package/dist/date-picker/create-date-picker.svelte.js +2 -2
  51. package/dist/date-picker/date-picker.d.ts +0 -1
  52. package/dist/date-picker/date-picker.js +0 -1
  53. package/dist/date-picker/index.d.ts +1 -0
  54. package/dist/date-picker/index.js +1 -0
  55. package/dist/date-picker/input.svelte +1 -1
  56. package/dist/date-picker/range-text.svelte +1 -1
  57. package/dist/date-picker/root.svelte +2 -1
  58. package/dist/dialog/create-dialog.svelte.js +2 -2
  59. package/dist/dialog/dialog.d.ts +0 -1
  60. package/dist/dialog/dialog.js +0 -1
  61. package/dist/dialog/index.d.ts +1 -0
  62. package/dist/dialog/index.js +1 -0
  63. package/dist/editable/create-editable.svelte.js +2 -2
  64. package/dist/editable/editable.d.ts +0 -1
  65. package/dist/editable/editable.js +0 -1
  66. package/dist/editable/index.d.ts +1 -0
  67. package/dist/editable/index.js +1 -0
  68. package/dist/editable/root.svelte +2 -1
  69. package/dist/field/anatomy.d.ts +2 -0
  70. package/dist/field/anatomy.js +3 -0
  71. package/dist/field/context.svelte.d.ts +3 -0
  72. package/dist/field/context.svelte.js +2 -0
  73. package/dist/field/create-field.svelte.d.ts +28 -0
  74. package/dist/field/create-field.svelte.js +142 -0
  75. package/dist/field/error-text.svelte +26 -0
  76. package/dist/field/error-text.svelte.d.ts +18 -0
  77. package/dist/field/field.d.ts +7 -0
  78. package/dist/field/field.js +7 -0
  79. package/dist/field/helper-text.svelte +26 -0
  80. package/dist/field/helper-text.svelte.d.ts +18 -0
  81. package/dist/field/index.d.ts +9 -0
  82. package/dist/field/index.js +2 -0
  83. package/dist/field/input.svelte +24 -0
  84. package/dist/field/input.svelte.d.ts +18 -0
  85. package/dist/field/label.svelte +26 -0
  86. package/dist/field/label.svelte.d.ts +18 -0
  87. package/dist/field/root.svelte +44 -0
  88. package/dist/field/root.svelte.d.ts +18 -0
  89. package/dist/field/select.svelte +24 -0
  90. package/dist/field/select.svelte.d.ts +18 -0
  91. package/dist/field/textarea.svelte +24 -0
  92. package/dist/field/textarea.svelte.d.ts +18 -0
  93. package/dist/file-upload/create-file-upload.svelte.js +2 -2
  94. package/dist/file-upload/file-upload.d.ts +0 -1
  95. package/dist/file-upload/file-upload.js +0 -1
  96. package/dist/file-upload/index.d.ts +1 -0
  97. package/dist/file-upload/index.js +1 -0
  98. package/dist/file-upload/root.svelte +2 -1
  99. package/dist/hover-card/create-hover-card.svelte.js +2 -2
  100. package/dist/hover-card/hover-card.d.ts +0 -1
  101. package/dist/hover-card/hover-card.js +0 -1
  102. package/dist/hover-card/index.d.ts +1 -0
  103. package/dist/hover-card/index.js +1 -0
  104. package/dist/index.d.ts +1 -0
  105. package/dist/index.js +1 -0
  106. package/dist/menu/create-menu.svelte.js +2 -2
  107. package/dist/menu/index.d.ts +1 -0
  108. package/dist/menu/index.js +1 -0
  109. package/dist/menu/item-group.svelte +3 -3
  110. package/dist/menu/menu.d.ts +0 -1
  111. package/dist/menu/menu.js +0 -1
  112. package/dist/number-input/create-number-input.svelte.js +2 -2
  113. package/dist/number-input/index.d.ts +1 -0
  114. package/dist/number-input/index.js +1 -0
  115. package/dist/number-input/number-input.d.ts +0 -1
  116. package/dist/number-input/number-input.js +0 -1
  117. package/dist/number-input/root.svelte +2 -1
  118. package/dist/pagination/create-pagination.svelte.js +2 -2
  119. package/dist/pagination/index.d.ts +1 -0
  120. package/dist/pagination/index.js +1 -0
  121. package/dist/pagination/pagination.d.ts +0 -1
  122. package/dist/pagination/pagination.js +0 -1
  123. package/dist/pagination/root.svelte +2 -1
  124. package/dist/pin-input/anatomy.d.ts +2 -0
  125. package/dist/pin-input/clear-trigger.svelte +1 -2
  126. package/dist/pin-input/create-pin-input.svelte.js +2 -2
  127. package/dist/pin-input/index.d.ts +1 -0
  128. package/dist/pin-input/index.js +1 -0
  129. package/dist/pin-input/pin-input.d.ts +0 -1
  130. package/dist/pin-input/pin-input.js +0 -1
  131. package/dist/pin-input/root.svelte +2 -1
  132. package/dist/popover/create-popover.svelte.js +2 -2
  133. package/dist/popover/popover.d.ts +1 -1
  134. package/dist/popover/popover.js +1 -1
  135. package/dist/presence/root.svelte +2 -1
  136. package/dist/progress/create-progress.svelte.js +2 -2
  137. package/dist/progress/index.d.ts +1 -0
  138. package/dist/progress/index.js +1 -0
  139. package/dist/progress/progress.d.ts +0 -1
  140. package/dist/progress/progress.js +0 -1
  141. package/dist/progress/root.svelte +2 -1
  142. package/dist/qr-code/create-qr-code.svelte.js +2 -2
  143. package/dist/qr-code/index.d.ts +1 -0
  144. package/dist/qr-code/index.js +1 -0
  145. package/dist/qr-code/qr-code.d.ts +0 -1
  146. package/dist/qr-code/qr-code.js +0 -1
  147. package/dist/qr-code/root.svelte +2 -1
  148. package/dist/radio-group/create-radio-group.svelte.js +2 -2
  149. package/dist/radio-group/index.d.ts +1 -0
  150. package/dist/radio-group/index.js +1 -0
  151. package/dist/radio-group/radio-group.d.ts +0 -1
  152. package/dist/radio-group/radio-group.js +0 -1
  153. package/dist/radio-group/root.svelte +2 -1
  154. package/dist/rating-group/create-rating-group.svelte.js +2 -2
  155. package/dist/rating-group/index.d.ts +1 -0
  156. package/dist/rating-group/index.js +1 -0
  157. package/dist/rating-group/item.svelte +2 -2
  158. package/dist/rating-group/rating-group.d.ts +0 -1
  159. package/dist/rating-group/rating-group.js +0 -1
  160. package/dist/rating-group/root.svelte +2 -1
  161. package/dist/segment-group/anatomy.d.ts +2 -0
  162. package/dist/segment-group/create-segment-group.svelte.js +2 -2
  163. package/dist/segment-group/index.d.ts +1 -0
  164. package/dist/segment-group/index.js +1 -0
  165. package/dist/segment-group/root.svelte +2 -1
  166. package/dist/segment-group/segment-group.d.ts +0 -1
  167. package/dist/segment-group/segment-group.js +0 -1
  168. package/dist/select/create-select.svelte.js +2 -2
  169. package/dist/select/index.d.ts +1 -0
  170. package/dist/select/index.js +1 -0
  171. package/dist/select/item-group.svelte +3 -3
  172. package/dist/select/root.svelte +2 -1
  173. package/dist/select/select.d.ts +0 -1
  174. package/dist/select/select.js +0 -1
  175. package/dist/signature-pad/create-signature-pad.svelte.js +2 -2
  176. package/dist/signature-pad/current-segment-path.svelte +1 -1
  177. package/dist/signature-pad/index.d.ts +1 -0
  178. package/dist/signature-pad/index.js +1 -0
  179. package/dist/signature-pad/root.svelte +2 -1
  180. package/dist/signature-pad/signature-pad.d.ts +0 -1
  181. package/dist/signature-pad/signature-pad.js +0 -1
  182. package/dist/slider/create-slider.svelte.js +2 -2
  183. package/dist/slider/index.d.ts +1 -0
  184. package/dist/slider/index.js +1 -0
  185. package/dist/slider/root.svelte +2 -1
  186. package/dist/slider/slider.d.ts +0 -1
  187. package/dist/slider/slider.js +0 -1
  188. package/dist/splitter/create-splitter.svelte.js +2 -2
  189. package/dist/splitter/index.d.ts +1 -0
  190. package/dist/splitter/index.js +1 -0
  191. package/dist/splitter/root.svelte +2 -1
  192. package/dist/splitter/splitter.d.ts +0 -1
  193. package/dist/splitter/splitter.js +0 -1
  194. package/dist/steps/create-steps.svelte.js +2 -2
  195. package/dist/steps/index.d.ts +1 -0
  196. package/dist/steps/index.js +1 -0
  197. package/dist/steps/root.svelte +2 -1
  198. package/dist/steps/steps.d.ts +0 -1
  199. package/dist/steps/steps.js +0 -1
  200. package/dist/switch/create-switch.svelte.js +2 -2
  201. package/dist/switch/index.d.ts +1 -0
  202. package/dist/switch/index.js +1 -0
  203. package/dist/switch/root.svelte +2 -1
  204. package/dist/switch/switch.d.ts +0 -1
  205. package/dist/switch/switch.js +0 -1
  206. package/dist/tabs/create-tabs.svelte.js +2 -2
  207. package/dist/tabs/index.d.ts +1 -0
  208. package/dist/tabs/index.js +1 -0
  209. package/dist/tabs/root.svelte +2 -1
  210. package/dist/tabs/tabs.d.ts +0 -1
  211. package/dist/tabs/tabs.js +0 -1
  212. package/dist/tags-input/create-tags-input.svelte.js +2 -2
  213. package/dist/tags-input/index.d.ts +1 -0
  214. package/dist/tags-input/index.js +1 -0
  215. package/dist/tags-input/root.svelte +2 -1
  216. package/dist/tags-input/tags-input.d.ts +0 -1
  217. package/dist/tags-input/tags-input.js +0 -1
  218. package/dist/time-picker/create-time-picker.svelte.js +2 -2
  219. package/dist/time-picker/index.d.ts +1 -0
  220. package/dist/time-picker/index.js +1 -0
  221. package/dist/time-picker/input.svelte +1 -1
  222. package/dist/time-picker/root.svelte +2 -1
  223. package/dist/time-picker/time-picker.d.ts +1 -1
  224. package/dist/time-picker/time-picker.js +1 -1
  225. package/dist/timer/create-timer.svelte.js +2 -2
  226. package/dist/timer/index.d.ts +2 -2
  227. package/dist/timer/index.js +1 -1
  228. package/dist/timer/root.svelte +2 -1
  229. package/dist/toast/create-toaster.svelte.js +2 -2
  230. package/dist/toast/index.d.ts +1 -0
  231. package/dist/toast/index.js +1 -0
  232. package/dist/toast/toast.d.ts +0 -1
  233. package/dist/toast/toast.js +0 -1
  234. package/dist/toggle-group/create-toggle-group.svelte.js +2 -2
  235. package/dist/toggle-group/index.d.ts +1 -0
  236. package/dist/toggle-group/index.js +1 -0
  237. package/dist/toggle-group/root.svelte +2 -1
  238. package/dist/toggle-group/toggle-group.d.ts +0 -1
  239. package/dist/toggle-group/toggle-group.js +0 -1
  240. package/dist/tooltip/create-tooltip.svelte.js +2 -2
  241. package/dist/tooltip/index.d.ts +1 -0
  242. package/dist/tooltip/index.js +1 -0
  243. package/dist/tooltip/tooltip.d.ts +0 -1
  244. package/dist/tooltip/tooltip.js +0 -1
  245. package/dist/tree-view/create-tree-view.svelte.js +2 -2
  246. package/dist/tree-view/index.d.ts +1 -0
  247. package/dist/tree-view/index.js +1 -0
  248. package/dist/tree-view/root.svelte +2 -1
  249. package/dist/tree-view/tree-view.d.ts +0 -1
  250. package/dist/tree-view/tree-view.js +0 -1
  251. package/package.json +2 -2
  252. package/dist/create-unique-id.d.ts +0 -1
  253. package/dist/create-unique-id.js +0 -4
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/rating-group';
2
1
  export { default as Control } from './control.svelte';
3
2
  export { default as HiddenInput } from './hidden-input.svelte';
4
3
  export { default as Item } from './item.svelte';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {ratingGroupContext} from './context.svelte.js';
20
21
  import {createRatingGroup} from './create-rating-group.svelte.js';
@@ -40,7 +41,7 @@
40
41
  ])(props),
41
42
  );
42
43
 
43
- let ratingGroup = createRatingGroup(ratingGroupProps);
44
+ let ratingGroup = createRatingGroup(reflect(() => ratingGroupProps));
44
45
 
45
46
  let mergedProps = $derived(
46
47
  mergeProps(otherProps, ratingGroup.getRootProps()),
@@ -0,0 +1,2 @@
1
+ export declare const anatomy: import("@zag-js/anatomy").Anatomy<"label" | "item" | "root" | "itemText" | "itemControl" | "indicator">;
2
+ export declare const parts: Record<"label" | "item" | "root" | "itemText" | "itemControl" | "indicator", import("@zag-js/anatomy").AnatomyPart>;
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import * as segmentGroup from '@zag-js/radio-group';
5
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import { uid } from 'uid';
6
6
  export function createSegmentGroup(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(segmentGroup.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -6,3 +6,4 @@ export type { SegmentGroupItemTextProps } from './item-text.svelte';
6
6
  export type { SegmentGroupItemProps } from './item.svelte';
7
7
  export type { SegmentGroupLabelProps } from './label.svelte';
8
8
  export type { SegmentGroupProps } from './root.svelte';
9
+ export { anatomy as segmentGroupAnatomy } from './anatomy.js';
@@ -1 +1,2 @@
1
1
  export * as SegmentGroup from './segment-group.js';
2
+ export { anatomy as segmentGroupAnatomy } from './anatomy.js';
@@ -18,6 +18,7 @@
18
18
 
19
19
  <script lang="ts">
20
20
  import {mergeProps} from '../merge-props.js';
21
+ import {reflect} from '@zag-js/svelte';
21
22
  import {createSplitProps} from '@zag-js/utils';
22
23
  import {parts} from './anatomy.js';
23
24
  import {segmentGroupContext} from './context.svelte.js';
@@ -39,7 +40,7 @@
39
40
  ])(props),
40
41
  );
41
42
 
42
- let segmentGroup = createSegmentGroup(segmentGroupProps);
43
+ let segmentGroup = createSegmentGroup(reflect(() => segmentGroupProps));
43
44
 
44
45
  let mergedProps = $derived(
45
46
  mergeProps(otherProps, segmentGroup.getRootProps(), parts.root.attrs),
@@ -1,4 +1,3 @@
1
- export { anatomy } from './anatomy.js';
2
1
  export { default as Indicator } from './indicator.svelte';
3
2
  export { default as ItemControl } from './item-control.svelte';
4
3
  export { default as ItemHiddenInput } from './item-hidden-input.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from './anatomy.js';
2
1
  export { default as Indicator } from './indicator.svelte';
3
2
  export { default as ItemControl } from './item-control.svelte';
4
3
  export { default as ItemHiddenInput } from './item-hidden-input.svelte';
@@ -1,8 +1,8 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import * as select from '@zag-js/select';
5
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import { uid } from 'uid';
6
6
  export function createSelect(props) {
7
7
  const collection = $derived(select.collection({
8
8
  items: props.items,
@@ -14,7 +14,7 @@ export function createSelect(props) {
14
14
  const environment = getEnvironmentContext();
15
15
  const [state, send] = useMachine(select.machine({
16
16
  ...props,
17
- id: props.id ?? createUniqueId(),
17
+ id: props.id ?? uid(),
18
18
  dir: locale?.dir,
19
19
  open: props.defaultOpen ?? props.open,
20
20
  getRootNode: environment?.getRootNode,
@@ -15,3 +15,4 @@ export type { SelectPositionerProps } from './positioner.svelte';
15
15
  export type { SelectProps } from './root.svelte';
16
16
  export type { SelectTriggerProps } from './trigger.svelte';
17
17
  export type { SelectValueTextProps } from './value-text.svelte';
18
+ export { anatomy as selectAnatomy } from '@zag-js/select';
@@ -1 +1,2 @@
1
1
  export * as Select from './select.js';
2
+ export { anatomy as selectAnatomy } from '@zag-js/select';
@@ -7,8 +7,8 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import {createUniqueId} from '../create-unique-id.js';
11
10
  import {mergeProps} from '../merge-props.js';
11
+ import {uid} from 'uid';
12
12
  import {
13
13
  selectContext,
14
14
  selectItemGroupPropsContext,
@@ -18,10 +18,10 @@
18
18
 
19
19
  let select = selectContext.get();
20
20
 
21
- let uid = createUniqueId();
21
+ let id_ = uid();
22
22
 
23
23
  let itemGroupProps = $derived({
24
- id: id ?? uid,
24
+ id: id ?? id_,
25
25
  });
26
26
 
27
27
  let mergedProps = $derived(
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts" generics="T">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {selectContext} from './context.svelte.js';
20
21
  import {createSelect} from './create-select.svelte.js';
@@ -54,7 +55,7 @@
54
55
  ])(props),
55
56
  );
56
57
 
57
- let select = createSelect(selectProps);
58
+ let select = createSelect(reflect(() => selectProps));
58
59
 
59
60
  let mergedProps = $derived(mergeProps(otherProps, select.getRootProps()));
60
61
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/select';
2
1
  export { default as ClearTrigger } from './clear-trigger.svelte';
3
2
  export { default as Content } from './content.svelte';
4
3
  export { default as Control } from './control.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/select';
2
1
  export { default as ClearTrigger } from './clear-trigger.svelte';
3
2
  export { default as Content } from './content.svelte';
4
3
  export { default as Control } from './control.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import * as signaturePad from '@zag-js/signature-pad';
5
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import { uid } from 'uid';
6
6
  export function createSignaturePad(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(signaturePad.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -11,7 +11,7 @@
11
11
  import {mergeProps} from '../merge-props.js';
12
12
  import {signaturePadContext} from './context.svelte.js';
13
13
 
14
- let {path, asChild, children, ...props}: SignaturePadCurrentSegmentPathProps =
14
+ let {asChild, children, ...props}: SignaturePadCurrentSegmentPathProps =
15
15
  $props();
16
16
 
17
17
  let signaturePad = signaturePadContext.get();
@@ -8,3 +8,4 @@ export type { SignaturePadLabelProps } from './label.svelte';
8
8
  export type { SignaturePadProps } from './root.svelte';
9
9
  export type { SignaturePadSegmentPathProps } from './segment-path.svelte';
10
10
  export type { SignaturePadSegmentProps } from './segment.svelte';
11
+ export { anatomy as signaturePadAnatomy } from '@zag-js/signature-pad';
@@ -1 +1,2 @@
1
1
  export * as SignaturePad from './signature-pad.js';
2
+ export { anatomy as signaturePadAnatomy } from '@zag-js/signature-pad';
@@ -18,6 +18,7 @@
18
18
 
19
19
  <script lang="ts">
20
20
  import {mergeProps} from '../merge-props.js';
21
+ import {reflect} from '@zag-js/svelte';
21
22
  import {createSplitProps} from '@zag-js/utils';
22
23
  import {signaturePadContext} from './context.svelte.js';
23
24
  import {createSignaturePad} from './create-signature-pad.svelte.js';
@@ -39,7 +40,7 @@
39
40
  ])(props),
40
41
  );
41
42
 
42
- let signaturePad = createSignaturePad(signaturePadProps);
43
+ let signaturePad = createSignaturePad(reflect(() => signaturePadProps));
43
44
 
44
45
  let mergedProps = $derived(
45
46
  mergeProps(otherProps, signaturePad.getRootProps()),
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/signature-pad';
2
1
  export { default as ClearTrigger } from './clear-trigger.svelte';
3
2
  export { default as Control } from './control.svelte';
4
3
  export { default as CurrentSegmentPath } from './current-segment-path.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/signature-pad';
2
1
  export { default as ClearTrigger } from './clear-trigger.svelte';
3
2
  export { default as Control } from './control.svelte';
4
3
  export { default as CurrentSegmentPath } from './current-segment-path.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import * as slider from '@zag-js/slider';
5
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import { uid } from 'uid';
6
6
  export function createSlider(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(slider.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -9,3 +9,4 @@ export type { SliderProps } from './root.svelte';
9
9
  export type { SliderThumbProps } from './thumb.svelte';
10
10
  export type { SliderTrackProps } from './track.svelte';
11
11
  export type { SliderValueTextProps } from './value-text.svelte';
12
+ export { anatomy as sliderAnatomy } from '@zag-js/slider';
@@ -1 +1,2 @@
1
1
  export * as Slider from './slider.js';
2
+ export { anatomy as sliderAnatomy } from '@zag-js/slider';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {sliderContext} from './context.svelte.js';
20
21
  import {createSlider} from './create-slider.svelte.js';
@@ -48,7 +49,7 @@
48
49
  ])(props),
49
50
  );
50
51
 
51
- let slider = createSlider(sliderProps);
52
+ let slider = createSlider(reflect(() => sliderProps));
52
53
 
53
54
  let mergedProps = $derived(mergeProps(otherProps, slider.getRootProps()));
54
55
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/slider';
2
1
  export { default as Control } from './control.svelte';
3
2
  export { default as HiddenInput } from './hidden-input.svelte';
4
3
  export { default as Label } from './label.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/slider';
2
1
  export { default as Control } from './control.svelte';
3
2
  export { default as HiddenInput } from './hidden-input.svelte';
4
3
  export { default as Label } from './label.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import * as splitter from '@zag-js/splitter';
5
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import { uid } from 'uid';
6
6
  export function createSplitter(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(splitter.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -2,3 +2,4 @@ export * as Splitter from './splitter.js';
2
2
  export type { SplitterPanelProps } from './panel.svelte';
3
3
  export type { SplitterResizeTriggerProps } from './resize-trigger.svelte';
4
4
  export type { SplitterProps } from './root.svelte';
5
+ export { anatomy as splitterAnatomy } from '@zag-js/splitter';
@@ -1 +1,2 @@
1
1
  export * as Splitter from './splitter.js';
2
+ export { anatomy as splitterAnatomy } from '@zag-js/splitter';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {splitterContext} from './context.svelte.js';
20
21
  import {createSplitter} from './create-splitter.svelte.js';
@@ -32,7 +33,7 @@
32
33
  ])(props),
33
34
  );
34
35
 
35
- let splitter = createSplitter(splitterProps);
36
+ let splitter = createSplitter(reflect(() => splitterProps));
36
37
 
37
38
  let mergedProps = $derived(mergeProps(otherProps, splitter.getRootProps()));
38
39
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/splitter';
2
1
  export { default as Panel } from './panel.svelte';
3
2
  export { default as ResizeTrigger } from './resize-trigger.svelte';
4
3
  export { default as Root } from './root.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/splitter';
2
1
  export { default as Panel } from './panel.svelte';
3
2
  export { default as ResizeTrigger } from './resize-trigger.svelte';
4
3
  export { default as Root } from './root.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import * as steps from '@zag-js/steps';
5
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import { uid } from 'uid';
6
6
  export function createSteps(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(steps.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -10,3 +10,4 @@ export type { StepsProgressProps } from './progress.svelte';
10
10
  export type { StepsProps } from './root.svelte';
11
11
  export type { StepsSeparatorProps } from './separator.svelte';
12
12
  export type { StepsTriggerProps } from './trigger.svelte';
13
+ export { anatomy as stepsAnatomy } from '@zag-js/steps';
@@ -1 +1,2 @@
1
1
  export * as Steps from './steps.js';
2
+ export { anatomy as stepsAnatomy } from '@zag-js/steps';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {stepsContext} from './context.svelte.js';
20
21
  import {createSteps} from './create-steps.svelte.js';
@@ -34,7 +35,7 @@
34
35
  ])(props),
35
36
  );
36
37
 
37
- let steps = createSteps(stepsProps);
38
+ let steps = createSteps(reflect(() => stepsProps));
38
39
 
39
40
  let mergedProps = $derived(mergeProps(otherProps, steps.getRootProps()));
40
41
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/steps';
2
1
  export { default as CompletedContent } from './completed-content.svelte';
3
2
  export { default as Content } from './content.svelte';
4
3
  export { default as Indicator } from './indicator.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/steps';
2
1
  export { default as CompletedContent } from './completed-content.svelte';
3
2
  export { default as Content } from './content.svelte';
4
3
  export { default as Indicator } from './indicator.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
4
  import * as switch$ from '@zag-js/switch';
5
+ import { uid } from 'uid';
6
6
  export function createSwitch(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(switch$.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -4,3 +4,4 @@ export type { SwitchHiddenInputProps } from './hidden-input.svelte';
4
4
  export type { SwitchLabelProps } from './label.svelte';
5
5
  export type { SwitchProps } from './root.svelte';
6
6
  export type { SwitchThumbProps } from './thumb.svelte';
7
+ export { anatomy as switchAnatomy } from '@zag-js/switch';
@@ -1 +1,2 @@
1
1
  export * as Switch from './switch.js';
2
+ export { anatomy as switchAnatomy } from '@zag-js/switch';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {switchContext} from './context.svelte.js';
20
21
  import {createSwitch} from './create-switch.svelte.js';
@@ -38,7 +39,7 @@
38
39
  ])(props),
39
40
  );
40
41
 
41
- let switch$ = createSwitch(switchProps);
42
+ let switch$ = createSwitch(reflect(() => switchProps));
42
43
 
43
44
  let mergedProps = $derived(mergeProps(otherProps, switch$.getRootProps()));
44
45
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/switch';
2
1
  export { default as Control } from './control.svelte';
3
2
  export { default as HiddenInput } from './hidden-input.svelte';
4
3
  export { default as Label } from './label.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/switch';
2
1
  export { default as Control } from './control.svelte';
3
2
  export { default as HiddenInput } from './hidden-input.svelte';
4
3
  export { default as Label } from './label.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
4
  import * as tabs from '@zag-js/tabs';
5
+ import { uid } from 'uid';
6
6
  export function createTabs(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(tabs.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -3,3 +3,4 @@ export type { TabsContentProps } from './content.svelte';
3
3
  export type { TabsListProps } from './list.svelte';
4
4
  export type { TabsProps } from './root.svelte';
5
5
  export type { TabsTriggerProps } from './trigger.svelte';
6
+ export { anatomy as tabsAnatomy } from '@zag-js/tabs';
@@ -1 +1,2 @@
1
1
  export * as Tabs from './tabs.js';
2
+ export { anatomy as tabsAnatomy } from '@zag-js/tabs';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {tabsContext} from './context.svelte.js';
20
21
  import {createTabs} from './create-tabs.svelte.js';
@@ -36,7 +37,7 @@
36
37
  ])(props),
37
38
  );
38
39
 
39
- let tabs = createTabs(tabsProps);
40
+ let tabs = createTabs(reflect(() => tabsProps));
40
41
 
41
42
  let mergedProps = $derived(mergeProps(otherProps, tabs.getRootProps()));
42
43
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/tabs';
2
1
  export { default as Content } from './content.svelte';
3
2
  export { default as List } from './list.svelte';
4
3
  export { default as Root } from './root.svelte';
package/dist/tabs/tabs.js CHANGED
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/tabs';
2
1
  export { default as Content } from './content.svelte';
3
2
  export { default as List } from './list.svelte';
4
3
  export { default as Root } from './root.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
4
  import * as tagsInput from '@zag-js/tags-input';
5
+ import { uid } from 'uid';
6
6
  export function createTagsInput(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(tagsInput.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
14
  }));
@@ -10,3 +10,4 @@ export type { TagsInputItemTextProps } from './item-text.svelte';
10
10
  export type { TagsInputItemProps } from './item.svelte';
11
11
  export type { TagsInputLabelProps } from './label.svelte';
12
12
  export type { TagsInputProps } from './root.svelte';
13
+ export { anatomy as tagsInputAnatomy } from '@zag-js/tags-input';
@@ -1 +1,2 @@
1
1
  export * as TagsInput from './tags-input.js';
2
+ export { anatomy as tagsInputAnatomy } from '@zag-js/tags-input';
@@ -15,6 +15,7 @@
15
15
 
16
16
  <script lang="ts">
17
17
  import {mergeProps} from '../merge-props.js';
18
+ import {reflect} from '@zag-js/svelte';
18
19
  import {createSplitProps} from '@zag-js/utils';
19
20
  import {tagsInputContext} from './context.svelte.js';
20
21
  import {createTagsInput} from './create-tags-input.svelte.js';
@@ -53,7 +54,7 @@
53
54
  ])(props),
54
55
  );
55
56
 
56
- let tagsInput = createTagsInput(tagsInputProps);
57
+ let tagsInput = createTagsInput(reflect(() => tagsInputProps));
57
58
 
58
59
  let mergedProps = $derived(mergeProps(otherProps, tagsInput.getRootProps()));
59
60
 
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/tags-input';
2
1
  export { default as ClearTrigger } from './clear-trigger.svelte';
3
2
  export { default as Control } from './control.svelte';
4
3
  export { default as HiddenInput } from './hidden-input.svelte';
@@ -1,4 +1,3 @@
1
- export { anatomy } from '@zag-js/tags-input';
2
1
  export { default as ClearTrigger } from './clear-trigger.svelte';
3
2
  export { default as Control } from './control.svelte';
4
3
  export { default as HiddenInput } from './hidden-input.svelte';
@@ -1,14 +1,14 @@
1
- import { createUniqueId } from '../create-unique-id.js';
2
1
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
3
2
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
3
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
4
  import * as timePicker from '@zag-js/time-picker';
5
+ import { uid } from 'uid';
6
6
  export function createTimePicker(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(timePicker.machine({
10
10
  ...props,
11
- id: props.id ?? createUniqueId(),
11
+ id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  open: props.defaultOpen ?? props.open,
14
14
  locale: props.locale ?? locale?.locale,
@@ -13,3 +13,4 @@ export type { TimePickerProps } from './root.svelte';
13
13
  export type { TimePickerSecondCellProps } from './second-cell.svelte';
14
14
  export type { TimePickerSpacerProps } from './spacer.svelte';
15
15
  export type { TimePickerTriggerProps } from './trigger.svelte';
16
+ export { anatomy as timePickerAnatomy } from '@zag-js/time-picker';
@@ -1 +1,2 @@
1
1
  export * as TimePicker from './time-picker.js';
2
+ export { anatomy as timePickerAnatomy } from '@zag-js/time-picker';