ui-ingredients 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (307) hide show
  1. package/README.md +2 -2
  2. package/dist/accordion/create-accordion.svelte.js +4 -4
  3. package/dist/accordion/item-content.svelte +2 -3
  4. package/dist/accordion/item-indicator.svelte +2 -3
  5. package/dist/accordion/item-trigger.svelte +2 -3
  6. package/dist/accordion/item.svelte +3 -4
  7. package/dist/accordion/root.svelte +5 -5
  8. package/dist/avatar/create-avatar.svelte.js +4 -4
  9. package/dist/avatar/fallback.svelte +2 -2
  10. package/dist/avatar/image.svelte +2 -2
  11. package/dist/avatar/root.svelte +5 -5
  12. package/dist/carousel/create-carousel.svelte.js +4 -4
  13. package/dist/carousel/indicator-group.svelte +2 -2
  14. package/dist/carousel/indicator.svelte +2 -2
  15. package/dist/carousel/item-group.svelte +2 -2
  16. package/dist/carousel/item.svelte +3 -3
  17. package/dist/carousel/next-trigger.svelte +2 -2
  18. package/dist/carousel/prev-trigger.svelte +2 -2
  19. package/dist/carousel/root.svelte +5 -5
  20. package/dist/carousel/viewport.svelte +2 -2
  21. package/dist/checkbox/control.svelte +2 -2
  22. package/dist/checkbox/create-checkbox.svelte.js +4 -4
  23. package/dist/checkbox/hidden-input.svelte +2 -2
  24. package/dist/checkbox/indicator.svelte +2 -2
  25. package/dist/checkbox/label.svelte +2 -2
  26. package/dist/checkbox/root.svelte +5 -5
  27. package/dist/clipboard/control.svelte +2 -2
  28. package/dist/clipboard/create-clipboard.svelte.js +2 -2
  29. package/dist/clipboard/indicator.svelte +2 -2
  30. package/dist/clipboard/input.svelte +2 -2
  31. package/dist/clipboard/label.svelte +2 -2
  32. package/dist/clipboard/root.svelte +5 -5
  33. package/dist/clipboard/trigger.svelte +2 -2
  34. package/dist/collapsible/content.svelte +2 -2
  35. package/dist/collapsible/create-collapsible.svelte.js +4 -4
  36. package/dist/collapsible/root.svelte +4 -4
  37. package/dist/collapsible/trigger.svelte +2 -2
  38. package/dist/combobox/clear-trigger.svelte +2 -2
  39. package/dist/combobox/content.svelte +2 -2
  40. package/dist/combobox/control.svelte +2 -2
  41. package/dist/combobox/create-combobox.svelte.js +4 -4
  42. package/dist/combobox/input.svelte +2 -2
  43. package/dist/combobox/item-group-label.svelte +2 -3
  44. package/dist/combobox/item-group.svelte +2 -2
  45. package/dist/combobox/item-indicator.svelte +2 -3
  46. package/dist/combobox/item-text.svelte +3 -4
  47. package/dist/combobox/item.svelte +3 -4
  48. package/dist/combobox/label.svelte +2 -2
  49. package/dist/combobox/list.svelte +2 -2
  50. package/dist/combobox/positioner.svelte +2 -2
  51. package/dist/combobox/root.svelte +5 -5
  52. package/dist/combobox/trigger.svelte +2 -2
  53. package/dist/date-picker/clear-trigger.svelte +2 -2
  54. package/dist/date-picker/content.svelte +2 -2
  55. package/dist/date-picker/control.svelte +2 -2
  56. package/dist/date-picker/create-date-picker.svelte.d.ts +1 -1
  57. package/dist/date-picker/create-date-picker.svelte.js +5 -5
  58. package/dist/date-picker/day-table-cell-trigger.svelte +2 -3
  59. package/dist/date-picker/day-table-cell.svelte +3 -4
  60. package/dist/date-picker/input.svelte +2 -2
  61. package/dist/date-picker/label.svelte +2 -2
  62. package/dist/date-picker/month-select.svelte +2 -2
  63. package/dist/date-picker/month-table-cell-trigger.svelte +2 -3
  64. package/dist/date-picker/month-table-cell.svelte +3 -4
  65. package/dist/date-picker/next-trigger.svelte +2 -3
  66. package/dist/date-picker/positioner.svelte +2 -2
  67. package/dist/date-picker/preset-trigger.svelte +2 -2
  68. package/dist/date-picker/prev-trigger.svelte +2 -3
  69. package/dist/date-picker/range-text.svelte +3 -3
  70. package/dist/date-picker/root.svelte +7 -5
  71. package/dist/date-picker/table-body.svelte +2 -3
  72. package/dist/date-picker/table-head.svelte +2 -3
  73. package/dist/date-picker/table-header.svelte +2 -3
  74. package/dist/date-picker/table-row.svelte +2 -3
  75. package/dist/date-picker/table.svelte +2 -4
  76. package/dist/date-picker/trigger.svelte +2 -2
  77. package/dist/date-picker/view-control.svelte +2 -3
  78. package/dist/date-picker/view.svelte +2 -2
  79. package/dist/date-picker/year-select.svelte +2 -2
  80. package/dist/date-picker/year-table-cell-trigger.svelte +2 -3
  81. package/dist/date-picker/year-table-cell.svelte +3 -4
  82. package/dist/dialog/backdrop.svelte +2 -2
  83. package/dist/dialog/close-trigger.svelte +2 -2
  84. package/dist/dialog/content.svelte +2 -2
  85. package/dist/dialog/create-dialog.svelte.js +4 -4
  86. package/dist/dialog/description.svelte +2 -2
  87. package/dist/dialog/positioner.svelte +2 -2
  88. package/dist/dialog/root.svelte +4 -4
  89. package/dist/dialog/title.svelte +2 -2
  90. package/dist/dialog/trigger.svelte +2 -2
  91. package/dist/editable/area.svelte +2 -2
  92. package/dist/editable/cancel-trigger.svelte +2 -2
  93. package/dist/editable/control.svelte +2 -2
  94. package/dist/editable/create-editable.svelte.js +4 -4
  95. package/dist/editable/edit-trigger.svelte +2 -2
  96. package/dist/editable/input.svelte +2 -2
  97. package/dist/editable/label.svelte +2 -2
  98. package/dist/editable/preview.svelte +3 -3
  99. package/dist/editable/root.svelte +4 -4
  100. package/dist/editable/submit-trigger.svelte +2 -2
  101. package/dist/environment-provider/root.svelte +2 -2
  102. package/dist/file-upload/context.svelte.d.ts +5 -8
  103. package/dist/file-upload/context.svelte.js +3 -14
  104. package/dist/file-upload/create-file-upload.svelte.d.ts +7 -0
  105. package/dist/file-upload/create-file-upload.svelte.js +18 -0
  106. package/dist/file-upload/dropzone.svelte +19 -2
  107. package/dist/file-upload/dropzone.svelte.d.ts +3 -3
  108. package/dist/file-upload/hidden-input.svelte +17 -2
  109. package/dist/file-upload/hidden-input.svelte.d.ts +3 -3
  110. package/dist/file-upload/index.d.ts +13 -0
  111. package/dist/file-upload/index.js +1 -0
  112. package/dist/file-upload/item-delete-trigger.svelte +20 -2
  113. package/dist/file-upload/item-delete-trigger.svelte.d.ts +3 -3
  114. package/dist/file-upload/item-group.svelte +19 -2
  115. package/dist/file-upload/item-group.svelte.d.ts +3 -3
  116. package/dist/file-upload/item-name.svelte +24 -2
  117. package/dist/file-upload/item-name.svelte.d.ts +3 -3
  118. package/dist/file-upload/item-preview-image.svelte +26 -2
  119. package/dist/file-upload/item-preview-image.svelte.d.ts +3 -3
  120. package/dist/file-upload/item-preview.svelte +20 -2
  121. package/dist/file-upload/item-preview.svelte.d.ts +3 -3
  122. package/dist/file-upload/item-size-text.svelte +24 -2
  123. package/dist/file-upload/item-size-text.svelte.d.ts +3 -3
  124. package/dist/file-upload/item.svelte +25 -2
  125. package/dist/file-upload/item.svelte.d.ts +3 -3
  126. package/dist/file-upload/label.svelte +19 -2
  127. package/dist/file-upload/label.svelte.d.ts +3 -3
  128. package/dist/file-upload/root.svelte +67 -2
  129. package/dist/file-upload/root.svelte.d.ts +3 -3
  130. package/dist/file-upload/trigger.svelte +19 -2
  131. package/dist/file-upload/trigger.svelte.d.ts +3 -3
  132. package/dist/hover-card/arrow-tip.svelte +2 -2
  133. package/dist/hover-card/arrow.svelte +2 -2
  134. package/dist/hover-card/content.svelte +2 -2
  135. package/dist/hover-card/create-hover-card.svelte.js +4 -4
  136. package/dist/hover-card/positioner.svelte +2 -2
  137. package/dist/hover-card/root.svelte +4 -4
  138. package/dist/hover-card/trigger.svelte +2 -2
  139. package/dist/locale-provider/root.svelte +2 -2
  140. package/dist/menu/arrow-tip.svelte +2 -2
  141. package/dist/menu/arrow.svelte +2 -2
  142. package/dist/menu/context-trigger.svelte +2 -2
  143. package/dist/menu/create-menu.svelte.js +4 -4
  144. package/dist/menu/indicator.svelte +2 -2
  145. package/dist/menu/item-group-label.svelte +2 -3
  146. package/dist/menu/item-group.svelte +2 -2
  147. package/dist/menu/item.svelte +3 -4
  148. package/dist/menu/option-item-indicator.svelte +2 -3
  149. package/dist/menu/option-item-text.svelte +2 -3
  150. package/dist/menu/option-item.svelte +3 -4
  151. package/dist/menu/positioner.svelte +2 -2
  152. package/dist/menu/root.svelte +4 -4
  153. package/dist/menu/separator.svelte +2 -2
  154. package/dist/menu/trigger-item.svelte +2 -2
  155. package/dist/menu/trigger.svelte +2 -2
  156. package/dist/number-input/control.svelte +2 -2
  157. package/dist/number-input/create-number-input.svelte.d.ts +1 -1
  158. package/dist/number-input/create-number-input.svelte.js +5 -5
  159. package/dist/number-input/decrement-trigger.svelte +2 -2
  160. package/dist/number-input/increment-trigger.svelte +2 -2
  161. package/dist/number-input/input.svelte +2 -2
  162. package/dist/number-input/label.svelte +2 -2
  163. package/dist/number-input/root.svelte +7 -5
  164. package/dist/number-input/scrubber.svelte +2 -2
  165. package/dist/pagination/create-pagination.svelte.js +4 -4
  166. package/dist/pagination/ellipsis.svelte +2 -2
  167. package/dist/pagination/item.svelte +2 -2
  168. package/dist/pagination/next-trigger.svelte +2 -2
  169. package/dist/pagination/prev-trigger.svelte +2 -2
  170. package/dist/pagination/root.svelte +5 -5
  171. package/dist/pin-input/clear-trigger.svelte +2 -2
  172. package/dist/pin-input/create-pin-input.svelte.js +4 -4
  173. package/dist/pin-input/hidden-input.svelte +2 -2
  174. package/dist/pin-input/input.svelte +2 -2
  175. package/dist/pin-input/label.svelte +2 -2
  176. package/dist/pin-input/root.svelte +5 -5
  177. package/dist/popover/arrow-tip.svelte +2 -2
  178. package/dist/popover/arrow.svelte +2 -2
  179. package/dist/popover/close-trigger.svelte +2 -2
  180. package/dist/popover/content.svelte +2 -2
  181. package/dist/popover/create-popover.svelte.js +4 -4
  182. package/dist/popover/description.svelte +2 -2
  183. package/dist/popover/positioner.svelte +2 -2
  184. package/dist/popover/root.svelte +4 -4
  185. package/dist/popover/title.svelte +2 -2
  186. package/dist/popover/trigger.svelte +2 -2
  187. package/dist/portal/root.svelte +2 -4
  188. package/dist/presence/create-presence.svelte.d.ts +10 -0
  189. package/dist/presence/create-presence.svelte.js +19 -0
  190. package/dist/presence/root.svelte +11 -20
  191. package/dist/progress/circle-range.svelte +2 -2
  192. package/dist/progress/circle-track.svelte +2 -2
  193. package/dist/progress/circle.svelte +2 -2
  194. package/dist/progress/create-progress.svelte.js +4 -4
  195. package/dist/progress/label.svelte +2 -2
  196. package/dist/progress/range.svelte +2 -2
  197. package/dist/progress/root.svelte +5 -5
  198. package/dist/progress/track.svelte +2 -2
  199. package/dist/progress/value-text.svelte +3 -3
  200. package/dist/qr-code/create-qr-code.svelte.js +4 -4
  201. package/dist/qr-code/frame.svelte +2 -2
  202. package/dist/qr-code/overlay.svelte +2 -2
  203. package/dist/qr-code/pattern.svelte +2 -2
  204. package/dist/qr-code/root.svelte +5 -5
  205. package/dist/radio-group/create-radio-group.svelte.js +4 -4
  206. package/dist/radio-group/indicator.svelte +2 -2
  207. package/dist/radio-group/item-control.svelte +2 -3
  208. package/dist/radio-group/item-hidden-input.svelte +2 -3
  209. package/dist/radio-group/item-text.svelte +2 -3
  210. package/dist/radio-group/item.svelte +3 -4
  211. package/dist/radio-group/label.svelte +2 -2
  212. package/dist/radio-group/root.svelte +5 -5
  213. package/dist/rating-group/control.svelte +2 -2
  214. package/dist/rating-group/create-rating-group.svelte.js +4 -4
  215. package/dist/rating-group/hidden-input.svelte +2 -2
  216. package/dist/rating-group/item.svelte +3 -4
  217. package/dist/rating-group/label.svelte +2 -2
  218. package/dist/rating-group/root.svelte +5 -5
  219. package/dist/segment-group/create-segment-group.svelte.js +4 -4
  220. package/dist/segment-group/indicator.svelte +2 -2
  221. package/dist/segment-group/item-control.svelte +2 -3
  222. package/dist/segment-group/item-hidden-input.svelte +2 -3
  223. package/dist/segment-group/item-text.svelte +2 -3
  224. package/dist/segment-group/item.svelte +3 -4
  225. package/dist/segment-group/label.svelte +2 -2
  226. package/dist/segment-group/root.svelte +5 -5
  227. package/dist/select/clear-trigger.svelte +2 -2
  228. package/dist/select/content.svelte +2 -2
  229. package/dist/select/control.svelte +2 -2
  230. package/dist/select/create-select.svelte.js +4 -4
  231. package/dist/select/hidden-select.svelte +2 -2
  232. package/dist/select/indicator.svelte +2 -2
  233. package/dist/select/item-group-label.svelte +2 -3
  234. package/dist/select/item-group.svelte +2 -2
  235. package/dist/select/item-indicator.svelte +2 -3
  236. package/dist/select/item-text.svelte +3 -4
  237. package/dist/select/item.svelte +3 -4
  238. package/dist/select/label.svelte +2 -2
  239. package/dist/select/list.svelte +2 -2
  240. package/dist/select/positioner.svelte +2 -2
  241. package/dist/select/root.svelte +5 -5
  242. package/dist/select/trigger.svelte +2 -2
  243. package/dist/select/value-text.svelte +4 -4
  244. package/dist/slider/control.svelte +2 -2
  245. package/dist/slider/create-slider.svelte.js +4 -4
  246. package/dist/slider/hidden-input.svelte +2 -3
  247. package/dist/slider/label.svelte +2 -2
  248. package/dist/slider/marker-group.svelte +2 -2
  249. package/dist/slider/marker.svelte +2 -2
  250. package/dist/slider/range.svelte +2 -2
  251. package/dist/slider/root.svelte +5 -5
  252. package/dist/slider/thumb.svelte +2 -3
  253. package/dist/slider/track.svelte +2 -2
  254. package/dist/slider/value-text.svelte +3 -3
  255. package/dist/steps/content.svelte +2 -2
  256. package/dist/steps/create-steps.svelte.js +4 -4
  257. package/dist/steps/indicator.svelte +2 -3
  258. package/dist/steps/item.svelte +3 -4
  259. package/dist/steps/list.svelte +2 -2
  260. package/dist/steps/next-trigger.svelte +2 -2
  261. package/dist/steps/prev-trigger.svelte +2 -2
  262. package/dist/steps/progress.svelte +2 -2
  263. package/dist/steps/root.svelte +5 -5
  264. package/dist/steps/separator.svelte +2 -3
  265. package/dist/steps/trigger.svelte +2 -3
  266. package/dist/switch/control.svelte +2 -2
  267. package/dist/switch/create-switch.svelte.js +4 -4
  268. package/dist/switch/hidden-input.svelte +2 -2
  269. package/dist/switch/label.svelte +2 -2
  270. package/dist/switch/root.svelte +5 -5
  271. package/dist/switch/thumb.svelte +2 -2
  272. package/dist/tabs/content.svelte +2 -2
  273. package/dist/tabs/create-tabs.svelte.js +4 -4
  274. package/dist/tabs/list.svelte +2 -2
  275. package/dist/tabs/root.svelte +5 -5
  276. package/dist/tabs/trigger.svelte +2 -2
  277. package/dist/tags-input/clear-trigger.svelte +2 -2
  278. package/dist/tags-input/control.svelte +2 -2
  279. package/dist/tags-input/create-tags-input.svelte.js +4 -4
  280. package/dist/tags-input/hidden-input.svelte +2 -2
  281. package/dist/tags-input/input.svelte +2 -2
  282. package/dist/tags-input/item-delete-trigger.svelte +2 -3
  283. package/dist/tags-input/item-input.svelte +2 -3
  284. package/dist/tags-input/item-preview.svelte +2 -3
  285. package/dist/tags-input/item-text.svelte +2 -3
  286. package/dist/tags-input/item.svelte +3 -4
  287. package/dist/tags-input/label.svelte +2 -2
  288. package/dist/tags-input/root.svelte +5 -5
  289. package/dist/timer/action-trigger.svelte +2 -2
  290. package/dist/timer/create-timer.svelte.js +2 -2
  291. package/dist/timer/item-label.svelte +2 -3
  292. package/dist/timer/item-value.svelte +3 -4
  293. package/dist/timer/item.svelte +2 -3
  294. package/dist/timer/root.svelte +5 -5
  295. package/dist/timer/separator.svelte +2 -2
  296. package/dist/toast/create-toaster.svelte.js +4 -4
  297. package/dist/toggle-group/create-toggle-group.svelte.js +4 -4
  298. package/dist/toggle-group/item.svelte +3 -4
  299. package/dist/toggle-group/root.svelte +4 -4
  300. package/dist/tooltip/arrow-tip.svelte +2 -2
  301. package/dist/tooltip/arrow.svelte +2 -2
  302. package/dist/tooltip/content.svelte +2 -2
  303. package/dist/tooltip/create-tooltip.svelte.js +4 -4
  304. package/dist/tooltip/positioner.svelte +2 -2
  305. package/dist/tooltip/root.svelte +4 -4
  306. package/dist/tooltip/trigger.svelte +2 -2
  307. package/package.json +2 -1
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxClearTriggerProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getClearTriggerProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getClearTriggerProps()));
16
16
  </script>
17
17
 
18
18
  <button type="button" {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxContentProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getContentProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getContentProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxControlProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getControlProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getControlProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -10,14 +10,14 @@ export function createCombobox(props) {
10
10
  itemToString: (item) => (props.itemToString ? props.itemToString(item) : String(item)),
11
11
  isItemDisabled: (item) => (props.isItemDisabled ? props.isItemDisabled(item) : false),
12
12
  }));
13
- const localeContext = getLocaleContext();
14
- const environmentContext = getEnvironmentContext();
13
+ const locale = getLocaleContext();
14
+ const environment = getEnvironmentContext();
15
15
  const [state, send] = useMachine(combobox.machine({
16
16
  ...props,
17
17
  id: props.id ?? createUniqueId(),
18
- dir: localeContext?.dir,
18
+ dir: locale?.dir,
19
19
  open: props.defaultOpen,
20
- getRootNode: environmentContext?.getRootNode,
20
+ getRootNode: environment?.getRootNode,
21
21
  'open.controlled': props.open != null,
22
22
  collection,
23
23
  }));
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {...props}: ComboboxInputProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getInputProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getInputProps()));
16
16
  </script>
17
17
 
18
18
  <input {...attrs} />
@@ -10,14 +10,13 @@
10
10
 
11
11
  let {children, ...props}: ComboboxItemGroupLabelProps = $props();
12
12
 
13
- let context = comboboxContext.get();
14
-
13
+ let combobox = comboboxContext.get();
15
14
  let itemGroupProps = comboboxItemGroupPropsContext.get();
16
15
 
17
16
  let attrs = $derived(
18
17
  mergeProps(
19
18
  props,
20
- context.getItemGroupLabelProps({
19
+ combobox.getItemGroupLabelProps({
21
20
  htmlFor: itemGroupProps.id,
22
21
  }),
23
22
  ),
@@ -13,7 +13,7 @@
13
13
 
14
14
  let {id, children, ...props}: ComboboxItemGroupProps = $props();
15
15
 
16
- let context = comboboxContext.get();
16
+ let combobox = comboboxContext.get();
17
17
 
18
18
  let uid = createUniqueId();
19
19
 
@@ -21,7 +21,7 @@
21
21
  id: id ?? uid,
22
22
  });
23
23
 
24
- let attrs = $derived(mergeProps(props, context.getItemGroupProps(comboboxItemGroupProps)));
24
+ let attrs = $derived(mergeProps(props, combobox.getItemGroupProps(comboboxItemGroupProps)));
25
25
 
26
26
  comboboxItemGroupPropsContext.set(() => comboboxItemGroupProps);
27
27
  </script>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: ComboboxItemIndicatorProps = $props();
12
12
 
13
- let context = comboboxContext.get();
14
-
13
+ let combobox = comboboxContext.get();
15
14
  let itemProps = comboboxItemPropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getItemIndicatorProps(itemProps)));
16
+ let attrs = $derived(mergeProps(props, combobox.getItemIndicatorProps(itemProps)));
18
17
  </script>
19
18
 
20
19
  <span {...attrs}>
@@ -10,17 +10,16 @@
10
10
 
11
11
  let {children, ...props}: ComboboxItemTextProps = $props();
12
12
 
13
- let context = comboboxContext.get();
14
-
13
+ let combobox = comboboxContext.get();
15
14
  let itemProps = comboboxItemPropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getItemTextProps(itemProps)));
16
+ let attrs = $derived(mergeProps(props, combobox.getItemTextProps(itemProps)));
18
17
  </script>
19
18
 
20
19
  <span {...attrs}>
21
20
  {#if children}
22
21
  {@render children?.()}
23
22
  {:else}
24
- {context.collection.stringifyItem(itemProps.item)}
23
+ {combobox.collection.stringifyItem(itemProps.item)}
25
24
  {/if}
26
25
  </span>
@@ -14,15 +14,14 @@
14
14
 
15
15
  let {children, item, persistFocus, ...props}: ComboboxItemProps = $props();
16
16
 
17
- let context = comboboxContext.get();
18
-
17
+ let combobox = comboboxContext.get();
19
18
  let itemProps = $derived({
20
19
  item,
21
20
  persistFocus,
22
21
  });
23
22
 
24
- let state = $derived(context.getItemState(itemProps));
25
- let attrs = $derived(mergeProps(props, context.getItemProps(itemProps)));
23
+ let state = $derived(combobox.getItemState(itemProps));
24
+ let attrs = $derived(mergeProps(props, combobox.getItemProps(itemProps)));
26
25
 
27
26
  comboboxItemPropsContext.set(() => itemProps);
28
27
  </script>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxLabelProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getLabelProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getLabelProps()));
16
16
  </script>
17
17
 
18
18
  <label {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxListProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getListProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getListProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxPositionerProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getPositionerProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getPositionerProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -5,7 +5,7 @@
5
5
 
6
6
  export interface ComboboxProps<T>
7
7
  extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateComboboxProps<T>> {
8
- children?: Snippet<[api: CreateComboboxReturn]>;
8
+ children?: Snippet<[combobox: CreateComboboxReturn]>;
9
9
  }
10
10
  </script>
11
11
 
@@ -60,7 +60,7 @@
60
60
  ...props
61
61
  }: ComboboxProps<T> = $props();
62
62
 
63
- let context = createCombobox({
63
+ let combobox = createCombobox({
64
64
  id,
65
65
  ids,
66
66
  name,
@@ -104,11 +104,11 @@
104
104
  scrollToIndexFn,
105
105
  });
106
106
 
107
- let attrs = $derived(mergeProps(props, context.getRootProps()));
107
+ let attrs = $derived(mergeProps(props, combobox.getRootProps()));
108
108
 
109
- comboboxContext.set(context);
109
+ comboboxContext.set(combobox);
110
110
  </script>
111
111
 
112
112
  <div {...attrs}>
113
- {@render children?.(context)}
113
+ {@render children?.(combobox)}
114
114
  </div>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: ComboboxTriggerProps = $props();
12
12
 
13
- let context = comboboxContext.get();
13
+ let combobox = comboboxContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getTriggerProps()));
15
+ let attrs = $derived(mergeProps(props, combobox.getTriggerProps()));
16
16
  </script>
17
17
 
18
18
  <button type="button" {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: DatePickerClearTriggerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getClearTriggerProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getClearTriggerProps()));
16
16
  </script>
17
17
 
18
18
  <button type="button" {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: DatePickerContentProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getContentProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getContentProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: DatePickerControlProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getControlProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getControlProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -1,5 +1,5 @@
1
1
  import * as datePicker from '@zag-js/date-picker';
2
- type Omitted = 'id' | 'dir' | 'min' | 'max' | 'value' | 'focusedValue' | 'locale' | 'getRootNode' | 'open.controlled';
2
+ type Omitted = 'id' | 'dir' | 'min' | 'max' | 'value' | 'focusedValue' | 'getRootNode' | 'open.controlled';
3
3
  export interface CreateDatePickerProps extends Omit<datePicker.Context, Omitted> {
4
4
  id?: string | null;
5
5
  min?: string | Date;
@@ -4,20 +4,20 @@ import { createUniqueId } from '../utils.svelte.js';
4
4
  import * as datePicker from '@zag-js/date-picker';
5
5
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
6
6
  export function createDatePicker(props) {
7
- const localeContext = getLocaleContext();
8
- const environmentContext = getEnvironmentContext();
7
+ const locale = getLocaleContext();
8
+ const environment = getEnvironmentContext();
9
9
  const [state, send] = useMachine(datePicker.machine({
10
10
  ...props,
11
11
  id: props.id ?? createUniqueId(),
12
- dir: localeContext?.dir,
12
+ dir: locale?.dir,
13
13
  min: props.min ? datePicker.parse(props.min) : undefined,
14
14
  max: props.max ? datePicker.parse(props.max) : undefined,
15
15
  value: props.value ? datePicker.parse(props.value) : undefined,
16
16
  focusedValue: props.focusedValue ? datePicker.parse(props.focusedValue) : undefined,
17
17
  open: props.defaultOpen,
18
18
  'open.controlled': props.open != null,
19
- locale: localeContext?.locale,
20
- getRootNode: environmentContext?.getRootNode,
19
+ locale: props.locale ?? locale?.locale,
20
+ getRootNode: environment?.getRootNode,
21
21
  }));
22
22
  const api = $derived(reflect(() => datePicker.connect(state, send, normalizeProps)));
23
23
  return api;
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerDayTableCellTriggerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let tableCellProps = datePickerDayTableCellPropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getDayTableCellTriggerProps(tableCellProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getDayTableCellTriggerProps(tableCellProps)));
18
17
  </script>
19
18
 
20
19
  <button type="button" {...attrs}>
@@ -22,16 +22,15 @@
22
22
  ...props
23
23
  }: DatePickerDayTableCellProps = $props();
24
24
 
25
- let context = datePickerContext.get();
26
-
25
+ let datePicker = datePickerContext.get();
27
26
  let tableCellProps: DayTableCellProps = $derived({
28
27
  value,
29
28
  disabled,
30
29
  visibleRange,
31
30
  });
32
31
 
33
- let state = $derived(context.getDayTableCellState(tableCellProps));
34
- let attrs = $derived(mergeProps(props, context.getDayTableCellProps(tableCellProps)));
32
+ let state = $derived(datePicker.getDayTableCellState(tableCellProps));
33
+ let attrs = $derived(mergeProps(props, datePicker.getDayTableCellProps(tableCellProps)));
35
34
 
36
35
  datePickerDayTableCellPropsContext.set(() => tableCellProps);
37
36
  </script>
@@ -11,9 +11,9 @@
11
11
 
12
12
  let {index, children, ...props}: DatePickerInputProps = $props();
13
13
 
14
- let context = datePickerContext.get();
14
+ let datePicker = datePickerContext.get();
15
15
 
16
- let attrs = $derived(mergeProps(props, context.getInputProps({index})));
16
+ let attrs = $derived(mergeProps(props, datePicker.getInputProps({index})));
17
17
  </script>
18
18
 
19
19
  <input {...attrs} />
@@ -11,9 +11,9 @@
11
11
 
12
12
  let {index, children, ...props}: DatePickerLabelProps = $props();
13
13
 
14
- let context = datePickerContext.get();
14
+ let datePicker = datePickerContext.get();
15
15
 
16
- let attrs = $derived(mergeProps(props, context.getLabelProps({index})));
16
+ let attrs = $derived(mergeProps(props, datePicker.getLabelProps({index})));
17
17
  </script>
18
18
 
19
19
  <label {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: DatePickerMonthSelectProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getMonthSelectProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getMonthSelectProps()));
16
16
 
17
17
  const months = [
18
18
  'January',
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerMonthTableCellTriggerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let tableCellProps = datePickerTableCellPropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getMonthTableCellTriggerProps(tableCellProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getMonthTableCellTriggerProps(tableCellProps)));
18
17
  </script>
19
18
 
20
19
  <button type="button" {...attrs}>
@@ -22,16 +22,15 @@
22
22
  ...props
23
23
  }: DatePickerMonthTableCellProps = $props();
24
24
 
25
- let context = datePickerContext.get();
26
-
25
+ let datePicker = datePickerContext.get();
27
26
  let tableCellProps: TableCellProps = $derived({
28
27
  value,
29
28
  disabled,
30
29
  columns,
31
30
  });
32
31
 
33
- let state = $derived(context.getMonthTableCellState(tableCellProps));
34
- let attrs = $derived(mergeProps(props, context.getMonthTableCellProps(tableCellProps)));
32
+ let state = $derived(datePicker.getMonthTableCellState(tableCellProps));
33
+ let attrs = $derived(mergeProps(props, datePicker.getMonthTableCellProps(tableCellProps)));
35
34
 
36
35
  datePickerTableCellPropsContext.set(() => tableCellProps);
37
36
  </script>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerNextTriggerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let viewProps = datePickerViewPropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getNextTriggerProps(viewProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getNextTriggerProps(viewProps)));
18
17
  </script>
19
18
 
20
19
  <button type="button" {...attrs}>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: DatePickerPositionerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getPositionerProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getPositionerProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
@@ -12,9 +12,9 @@
12
12
 
13
13
  let {value, children, ...props}: DatePickerPresetTriggerProps = $props();
14
14
 
15
- let context = datePickerContext.get();
15
+ let datePicker = datePickerContext.get();
16
16
 
17
- let attrs = $derived(mergeProps(props, context.getPresetTriggerProps({value})));
17
+ let attrs = $derived(mergeProps(props, datePicker.getPresetTriggerProps({value})));
18
18
  </script>
19
19
 
20
20
  <button type="button" {...attrs}>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerPrevTriggerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let viewProps = datePickerViewPropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getPrevTriggerProps(viewProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getPrevTriggerProps(viewProps)));
18
17
  </script>
19
18
 
20
19
  <button type="button" {...attrs}>
@@ -10,15 +10,15 @@
10
10
 
11
11
  let {children, ...props}: DatePickerRangeTextProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getRangeTextProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getRangeTextProps()));
16
16
  </script>
17
17
 
18
18
  <div {...attrs}>
19
19
  {#if children}
20
20
  {@render children()}
21
21
  {:else}
22
- {context.visibleRangeText.formatted}
22
+ {datePicker.visibleRangeText.formatted}
23
23
  {/if}
24
24
  </div>
@@ -5,7 +5,7 @@
5
5
 
6
6
  export interface DatePickerProps
7
7
  extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateDatePickerProps> {
8
- children?: Snippet<[api: CreateDatePickerReturn]>;
8
+ children?: Snippet<[datePicker: CreateDatePickerReturn]>;
9
9
  }
10
10
  </script>
11
11
 
@@ -24,6 +24,7 @@
24
24
  view,
25
25
  value,
26
26
  modal,
27
+ locale,
27
28
  disabled,
28
29
  readOnly,
29
30
  timeZone,
@@ -46,7 +47,7 @@
46
47
  ...props
47
48
  }: DatePickerProps = $props();
48
49
 
49
- let context = createDatePicker({
50
+ let datePicker = createDatePicker({
50
51
  id,
51
52
  ids,
52
53
  min,
@@ -56,6 +57,7 @@
56
57
  view,
57
58
  value: $state.snapshot(value),
58
59
  modal,
60
+ locale,
59
61
  disabled,
60
62
  readOnly,
61
63
  timeZone,
@@ -76,11 +78,11 @@
76
78
  isDateUnavailable,
77
79
  });
78
80
 
79
- let attrs = $derived(mergeProps(props, context.getRootProps()));
81
+ let attrs = $derived(mergeProps(props, datePicker.getRootProps()));
80
82
 
81
- datePickerContext.set(context);
83
+ datePickerContext.set(datePicker);
82
84
  </script>
83
85
 
84
86
  <div {...attrs}>
85
- {@render children?.(context)}
87
+ {@render children?.(datePicker)}
86
88
  </div>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerTableBodyProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let tableProps = datePickerTablePropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getTableBodyProps(tableProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getTableBodyProps(tableProps)));
18
17
  </script>
19
18
 
20
19
  <div {...attrs}>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerTableHeadProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let tableProps = datePickerTablePropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getTableHeadProps(tableProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getTableHeadProps(tableProps)));
18
17
  </script>
19
18
 
20
19
  <div {...attrs}>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerTableHeaderProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let tableProps = datePickerTablePropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getTableHeaderProps(tableProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getTableHeaderProps(tableProps)));
18
17
  </script>
19
18
 
20
19
  <div {...attrs}>
@@ -10,11 +10,10 @@
10
10
 
11
11
  let {children, ...props}: DatePickerTableRowProps = $props();
12
12
 
13
- let context = datePickerContext.get();
14
-
13
+ let datePicker = datePickerContext.get();
15
14
  let tableProps = datePickerTablePropsContext.get();
16
15
 
17
- let attrs = $derived(mergeProps(props, context.getTableRowProps(tableProps)));
16
+ let attrs = $derived(mergeProps(props, datePicker.getTableRowProps(tableProps)));
18
17
  </script>
19
18
 
20
19
  <div {...attrs}>
@@ -16,13 +16,11 @@
16
16
 
17
17
  let {id, columns, children, ...props}: DatePickerTableProps = $props();
18
18
 
19
- let context = datePickerContext.get();
20
-
19
+ let datePicker = datePickerContext.get();
21
20
  let viewProps = datePickerViewPropsContext.get();
22
-
23
21
  let tableProps: TableProps = $derived({...viewProps, id, columns});
24
22
 
25
- let attrs = $derived(mergeProps(props, context.getTableProps(tableProps)));
23
+ let attrs = $derived(mergeProps(props, datePicker.getTableProps(tableProps)));
26
24
 
27
25
  datePickerTablePropsContext.set(() => tableProps);
28
26
  </script>
@@ -10,9 +10,9 @@
10
10
 
11
11
  let {children, ...props}: DatePickerTriggerProps = $props();
12
12
 
13
- let context = datePickerContext.get();
13
+ let datePicker = datePickerContext.get();
14
14
 
15
- let attrs = $derived(mergeProps(props, context.getTriggerProps()));
15
+ let attrs = $derived(mergeProps(props, datePicker.getTriggerProps()));
16
16
  </script>
17
17
 
18
18
  <button type="button" {...attrs}>