@ark-ui/solid 4.10.2 → 5.1.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 (261) hide show
  1. package/README.md +6 -9
  2. package/dist/chunk/{ATMUKDFF.js → 26K66CRD.js} +11 -12
  3. package/dist/chunk/{U3XJZI3X.jsx → 2LZKFXR5.jsx} +19 -26
  4. package/dist/chunk/{H4RSHLA7.jsx → 3FYZXSQZ.jsx} +14 -15
  5. package/dist/chunk/{MQDN267C.jsx → 3VO34CGN.jsx} +13 -13
  6. package/dist/chunk/{YV5BACLX.js → 46YZVE6D.js} +12 -11
  7. package/dist/chunk/{MBQQASZE.js → 4QFED3VE.js} +12 -12
  8. package/dist/chunk/{SWUA2VFC.js → 4UD3WT4B.js} +10 -12
  9. package/dist/chunk/{IQJBNZOX.jsx → 5T73FAJY.jsx} +13 -8
  10. package/dist/chunk/{IZC6PKGT.jsx → 65SQKHCI.jsx} +15 -16
  11. package/dist/chunk/{WM2IZOYM.jsx → 72UBZBQP.jsx} +53 -82
  12. package/dist/chunk/{F3QPTRGW.jsx → 7IHVZWMT.jsx} +32 -36
  13. package/dist/chunk/{X34KVQNW.js → 7KGMTGCS.js} +3 -2
  14. package/dist/chunk/{34MDPAG6.js → 7RR233CD.js} +30 -12
  15. package/dist/chunk/{7S43DIPW.js → 7S7524Q3.js} +15 -26
  16. package/dist/chunk/{E72NMPSK.jsx → A4744EEE.jsx} +9 -14
  17. package/dist/chunk/{BY62F4IV.jsx → AD2EIGNX.jsx} +13 -13
  18. package/dist/chunk/{3HMZSTYX.js → B246J3FR.js} +10 -11
  19. package/dist/chunk/{K54W24N6.jsx → B2KZ5VSW.jsx} +15 -17
  20. package/dist/chunk/{2GATVLPK.js → C4PG7WMU.js} +9 -9
  21. package/dist/chunk/{3LRXHWW2.js → C745EVQO.js} +32 -27
  22. package/dist/chunk/{TOVWS5LG.jsx → CA4LWAR2.jsx} +20 -26
  23. package/dist/chunk/{WKVZFHUH.jsx → CABZW4BQ.jsx} +19 -27
  24. package/dist/chunk/{Y4LH2CR6.jsx → CGBS64C2.jsx} +13 -13
  25. package/dist/chunk/{2HTNQLGP.jsx → CHLRHJV2.jsx} +13 -14
  26. package/dist/chunk/{SJSLQDBZ.jsx → CSDXHOTM.jsx} +15 -20
  27. package/dist/chunk/{5O4RWSWO.jsx → D2Z5BEON.jsx} +3 -3
  28. package/dist/chunk/{CPMYIT5J.jsx → D6BC5RCX.jsx} +16 -14
  29. package/dist/chunk/{6MXKM4GA.js → E4A5DGUC.js} +12 -12
  30. package/dist/chunk/{2J42A7KM.js → E5BXBABH.js} +2 -2
  31. package/dist/chunk/{U7SPBSDD.jsx → EEG3DZXG.jsx} +13 -15
  32. package/dist/chunk/{M2FICVVI.js → EI7I4DR6.js} +12 -13
  33. package/dist/chunk/{5CYHETDY.js → EWPKE75H.js} +10 -9
  34. package/dist/chunk/{2W32Z6JZ.js → F5GOQFKX.js} +12 -12
  35. package/dist/chunk/{CIPYIXIW.js → F7JP3DGZ.js} +11 -12
  36. package/dist/chunk/{PRMWTLUY.jsx → FUS6GOJL.jsx} +13 -11
  37. package/dist/chunk/{ASCGEGA5.jsx → GCDTOEZN.jsx} +16 -17
  38. package/dist/chunk/{G2WIACWP.js → GJSXT6PD.js} +11 -11
  39. package/dist/chunk/{LVPQ6GR4.js → GMNTJ5KE.js} +9 -9
  40. package/dist/chunk/{WPFSEVTX.js → I2RQ2435.js} +14 -16
  41. package/dist/chunk/{AIQFNVCU.jsx → IKA3JJFV.jsx} +14 -20
  42. package/dist/chunk/{3O5VTKDF.jsx → IYMTFLF3.jsx} +20 -33
  43. package/dist/chunk/{EHJDQTTW.jsx → JRMTU7C7.jsx} +3 -16
  44. package/dist/chunk/{VARNCRUN.js → JUYBJNX6.js} +19 -20
  45. package/dist/chunk/{FNEB2RAF.js → JWXGONCE.js} +12 -12
  46. package/dist/chunk/{SN5TXTB6.jsx → JZ7ZQZT4.jsx} +17 -54
  47. package/dist/chunk/{WQQVH7YG.jsx → KBHIJYMD.jsx} +34 -19
  48. package/dist/chunk/{MMS6MJ72.js → KFJJXGK6.js} +11 -13
  49. package/dist/chunk/{X3BMEEJH.js → KVVYU5Z3.js} +34 -14
  50. package/dist/chunk/{T4NRAKVA.jsx → KZCXBFHA.jsx} +14 -12
  51. package/dist/chunk/{5EVN6V64.js → LK5627GR.js} +15 -17
  52. package/dist/chunk/{5JS7LFUQ.js → LTZUX6NG.js} +12 -10
  53. package/dist/chunk/{NK4T7LIZ.jsx → MA35L6TV.jsx} +12 -13
  54. package/dist/chunk/{ZC6KWJ4T.jsx → MDJAL2LV.jsx} +12 -14
  55. package/dist/chunk/{CCA5XJM6.jsx → MERJALY6.jsx} +23 -38
  56. package/dist/chunk/MOG4V2NQ.jsx +15 -0
  57. package/dist/chunk/{2H4WHODR.js → MSLAT5GQ.js} +10 -12
  58. package/dist/chunk/{5ONYCKM3.jsx → NEBB7COJ.jsx} +1 -1
  59. package/dist/chunk/{DU4TY3XA.jsx → NEYCBIOW.jsx} +16 -17
  60. package/dist/chunk/{DXYB7RYX.js → NF3HZO6T.js} +12 -10
  61. package/dist/chunk/{5XD5ZSBX.js → NZEL4233.js} +15 -18
  62. package/dist/chunk/OAPCRIL5.js +8 -0
  63. package/dist/chunk/{LCESUDZB.js → OY4ARTMM.js} +7 -14
  64. package/dist/chunk/{Q7NPTAJI.js → QBFJVUX3.js} +10 -10
  65. package/dist/chunk/{HPDOBQ3V.js → QEMQBM6W.js} +1 -1
  66. package/dist/chunk/{L7OSYHVR.js → QFAL6GWC.js} +1 -1
  67. package/dist/chunk/{34OZO53S.js → QTSWXPKO.js} +12 -14
  68. package/dist/chunk/{JVXNYKNA.js → R5NPBVOA.js} +11 -12
  69. package/dist/chunk/{3QQZKR3F.jsx → RCXMZN3G.jsx} +1 -1
  70. package/dist/chunk/{5SRZ3YYC.js → ROXCI3ZP.js} +10 -10
  71. package/dist/chunk/{GZVCPLKK.jsx → RY6GW37O.jsx} +14 -12
  72. package/dist/chunk/SDD2HKR3.js +71 -0
  73. package/dist/chunk/{RAEDLHD3.js → TKGOCHK5.js} +14 -16
  74. package/dist/chunk/{I5UG2QUO.js → TROPIN4C.js} +1 -7
  75. package/dist/chunk/{AX5SMQMA.js → TRUQMF25.js} +19 -19
  76. package/dist/chunk/{NMGUCD2L.jsx → TVCIHLER.jsx} +2 -11
  77. package/dist/chunk/{YCYZZGN2.jsx → TZDLUIKR.jsx} +14 -10
  78. package/dist/chunk/{QGV2SUTQ.jsx → U3J33PVO.jsx} +21 -21
  79. package/dist/chunk/{P7I44WC4.jsx → UCYPIMZC.jsx} +21 -22
  80. package/dist/chunk/{GXWVYON6.js → UODFV2GS.js} +11 -12
  81. package/dist/chunk/{7YIHAT7J.jsx → V564AMKR.jsx} +39 -18
  82. package/dist/chunk/{PSLLOEMD.js → VLQWCBZM.js} +16 -29
  83. package/dist/chunk/{3WGLTS6O.js → VNK2NPTS.js} +10 -10
  84. package/dist/chunk/{WIVXL7HJ.jsx → WDXH3NHK.jsx} +14 -15
  85. package/dist/chunk/{QQUR4MWN.js → WGFUGTWA.js} +18 -19
  86. package/dist/chunk/{B7LE23PE.jsx → WNIFZKTJ.jsx} +13 -14
  87. package/dist/chunk/{IOTZAUDA.jsx → WUTUKX4C.jsx} +1 -1
  88. package/dist/chunk/{XUVXUPEH.js → XN3MSM3M.js} +14 -18
  89. package/dist/chunk/{MYMGOYXH.js → XR4WJDUT.js} +2 -2
  90. package/dist/chunk/{DOPROT6M.jsx → XZZ6TULR.jsx} +15 -10
  91. package/dist/chunk/{QZYE5W7T.jsx → Y7EY3OTU.jsx} +16 -21
  92. package/dist/chunk/{MRQ2UYM4.jsx → YIVTZ7BP.jsx} +12 -11
  93. package/dist/chunk/{QODB3C3M.js → YMMMHJJS.js} +3 -3
  94. package/dist/chunk/{HU7FZMJI.jsx → YPH7FBUN.jsx} +14 -16
  95. package/dist/chunk/{TC2QHQ47.jsx → Z254KIAA.jsx} +22 -44
  96. package/dist/chunk/{W43X4SNE.js → Z2TDX72A.js} +9 -8
  97. package/dist/chunk/{6YQ3EF2J.js → ZGXZNLX2.js} +12 -13
  98. package/dist/chunk/{R6RE56DG.jsx → ZJM2GZS7.jsx} +4 -1
  99. package/dist/chunk/{UGKLUHKU.js → ZOGAU3AQ.js} +11 -13
  100. package/dist/chunk/{7PKUSZKY.jsx → ZPSBF7S2.jsx} +14 -11
  101. package/dist/chunk/{RZBYC7DR.jsx → ZYF7GVNI.jsx} +21 -27
  102. package/dist/components/accordion/index.d.ts +4 -9
  103. package/dist/components/accordion/index.js +1 -1
  104. package/dist/components/accordion/index.jsx +7 -7
  105. package/dist/components/avatar/index.d.ts +4 -4
  106. package/dist/components/avatar/index.js +1 -1
  107. package/dist/components/avatar/index.jsx +5 -5
  108. package/dist/components/carousel/index.d.ts +4 -9
  109. package/dist/components/carousel/index.js +1 -1
  110. package/dist/components/carousel/index.jsx +5 -5
  111. package/dist/components/checkbox/index.d.ts +5 -10
  112. package/dist/components/checkbox/index.js +1 -1
  113. package/dist/components/checkbox/index.jsx +8 -8
  114. package/dist/components/clipboard/index.d.ts +4 -4
  115. package/dist/components/clipboard/index.js +1 -1
  116. package/dist/components/clipboard/index.jsx +5 -5
  117. package/dist/components/collapsible/index.d.ts +4 -9
  118. package/dist/components/collapsible/index.js +1 -1
  119. package/dist/components/collapsible/index.jsx +6 -6
  120. package/dist/components/collection.d.ts +3 -3
  121. package/dist/components/collection.js +1 -1
  122. package/dist/components/collection.jsx +1 -1
  123. package/dist/components/color-picker/index.d.ts +6 -16
  124. package/dist/components/color-picker/index.js +1 -1
  125. package/dist/components/color-picker/index.jsx +10 -9
  126. package/dist/components/combobox/index.d.ts +5 -15
  127. package/dist/components/combobox/index.js +2 -2
  128. package/dist/components/combobox/index.jsx +12 -11
  129. package/dist/components/date-picker/index.d.ts +6 -18
  130. package/dist/components/date-picker/index.js +1 -1
  131. package/dist/components/date-picker/index.jsx +7 -7
  132. package/dist/components/dialog/index.d.ts +5 -10
  133. package/dist/components/dialog/index.js +1 -1
  134. package/dist/components/dialog/index.jsx +7 -7
  135. package/dist/components/editable/index.d.ts +4 -14
  136. package/dist/components/editable/index.js +1 -1
  137. package/dist/components/editable/index.jsx +8 -7
  138. package/dist/components/factory.d.ts +1 -1
  139. package/dist/components/field/index.d.ts +4 -4
  140. package/dist/components/field/index.js +1 -1
  141. package/dist/components/field/index.jsx +5 -3
  142. package/dist/components/fieldset/index.d.ts +4 -4
  143. package/dist/components/fieldset/index.js +1 -1
  144. package/dist/components/fieldset/index.jsx +3 -2
  145. package/dist/components/file-upload/index.d.ts +4 -4
  146. package/dist/components/file-upload/index.js +1 -1
  147. package/dist/components/file-upload/index.jsx +8 -7
  148. package/dist/components/focus-trap/index.d.ts +2 -2
  149. package/dist/components/format/index.js +1 -1
  150. package/dist/components/format/index.jsx +4 -4
  151. package/dist/components/frame/index.d.ts +1 -1
  152. package/dist/components/frame/index.js +1 -1
  153. package/dist/components/frame/index.jsx +4 -4
  154. package/dist/components/highlight/index.d.ts +2 -2
  155. package/dist/components/highlight/index.js +1 -1
  156. package/dist/components/highlight/index.jsx +2 -1
  157. package/dist/components/hover-card/index.d.ts +5 -10
  158. package/dist/components/hover-card/index.js +1 -1
  159. package/dist/components/hover-card/index.jsx +7 -7
  160. package/dist/components/index.d.ts +3 -2
  161. package/dist/components/index.js +46 -46
  162. package/dist/components/index.jsx +289 -290
  163. package/dist/components/menu/index.d.ts +6 -11
  164. package/dist/components/menu/index.js +1 -1
  165. package/dist/components/menu/index.jsx +7 -7
  166. package/dist/components/number-input/index.d.ts +4 -9
  167. package/dist/components/number-input/index.js +1 -1
  168. package/dist/components/number-input/index.jsx +8 -7
  169. package/dist/components/pagination/index.d.ts +4 -9
  170. package/dist/components/pagination/index.js +1 -1
  171. package/dist/components/pagination/index.jsx +5 -5
  172. package/dist/components/pin-input/index.d.ts +4 -9
  173. package/dist/components/pin-input/index.js +1 -1
  174. package/dist/components/pin-input/index.jsx +8 -7
  175. package/dist/components/popover/index.d.ts +5 -10
  176. package/dist/components/popover/index.js +1 -1
  177. package/dist/components/popover/index.jsx +7 -7
  178. package/dist/components/presence/index.d.ts +3 -3
  179. package/dist/components/presence/index.js +1 -1
  180. package/dist/components/presence/index.jsx +4 -3
  181. package/dist/components/progress/index.d.ts +4 -9
  182. package/dist/components/progress/index.js +1 -1
  183. package/dist/components/progress/index.jsx +5 -5
  184. package/dist/components/qr-code/index.d.ts +4 -9
  185. package/dist/components/qr-code/index.js +1 -1
  186. package/dist/components/qr-code/index.jsx +5 -5
  187. package/dist/components/radio-group/index.d.ts +4 -9
  188. package/dist/components/radio-group/index.js +1 -1
  189. package/dist/components/radio-group/index.jsx +5 -5
  190. package/dist/components/rating-group/index.d.ts +6 -11
  191. package/dist/components/rating-group/index.js +1 -1
  192. package/dist/components/rating-group/index.jsx +8 -7
  193. package/dist/components/segment-group/index.d.ts +5 -10
  194. package/dist/components/segment-group/index.js +1 -1
  195. package/dist/components/segment-group/index.jsx +5 -5
  196. package/dist/components/select/index.d.ts +5 -15
  197. package/dist/components/select/index.js +2 -2
  198. package/dist/components/select/index.jsx +12 -11
  199. package/dist/components/signature-pad/index.d.ts +4 -4
  200. package/dist/components/signature-pad/index.js +1 -1
  201. package/dist/components/signature-pad/index.jsx +8 -7
  202. package/dist/components/slider/index.d.ts +4 -9
  203. package/dist/components/slider/index.js +1 -1
  204. package/dist/components/slider/index.jsx +5 -5
  205. package/dist/components/splitter/index.d.ts +4 -9
  206. package/dist/components/splitter/index.js +1 -1
  207. package/dist/components/splitter/index.jsx +5 -5
  208. package/dist/components/steps/index.d.ts +8 -12
  209. package/dist/components/steps/index.js +1 -1
  210. package/dist/components/steps/index.jsx +5 -5
  211. package/dist/components/switch/index.d.ts +4 -9
  212. package/dist/components/switch/index.js +1 -1
  213. package/dist/components/switch/index.jsx +8 -7
  214. package/dist/components/tabs/index.d.ts +4 -9
  215. package/dist/components/tabs/index.js +1 -1
  216. package/dist/components/tabs/index.jsx +7 -7
  217. package/dist/components/tags-input/index.d.ts +4 -9
  218. package/dist/components/tags-input/index.js +1 -1
  219. package/dist/components/tags-input/index.jsx +8 -7
  220. package/dist/components/time-picker/index.d.ts +5 -15
  221. package/dist/components/time-picker/index.js +1 -1
  222. package/dist/components/time-picker/index.jsx +7 -7
  223. package/dist/components/timer/index.d.ts +4 -4
  224. package/dist/components/timer/index.js +1 -1
  225. package/dist/components/timer/index.jsx +5 -5
  226. package/dist/components/toast/index.d.ts +6 -7
  227. package/dist/components/toast/index.js +1 -1
  228. package/dist/components/toast/index.jsx +6 -2
  229. package/dist/components/toggle/index.d.ts +7 -36
  230. package/dist/components/toggle/index.js +1 -1
  231. package/dist/components/toggle/index.jsx +2 -4
  232. package/dist/components/toggle-group/index.d.ts +4 -9
  233. package/dist/components/toggle-group/index.js +1 -1
  234. package/dist/components/toggle-group/index.jsx +5 -5
  235. package/dist/components/tooltip/index.d.ts +5 -10
  236. package/dist/components/tooltip/index.js +1 -1
  237. package/dist/components/tooltip/index.jsx +7 -7
  238. package/dist/components/tour/index.d.ts +6 -6
  239. package/dist/components/tour/index.js +1 -1
  240. package/dist/components/tour/index.jsx +7 -7
  241. package/dist/components/tree-view/index.d.ts +7 -17
  242. package/dist/components/tree-view/index.js +2 -2
  243. package/dist/components/tree-view/index.jsx +9 -9
  244. package/dist/index.d.ts +3 -2
  245. package/dist/index.js +48 -48
  246. package/dist/index.jsx +290 -291
  247. package/dist/providers/environment/index.js +1 -1
  248. package/dist/providers/environment/index.jsx +2 -2
  249. package/dist/providers/index.js +2 -2
  250. package/dist/providers/index.jsx +4 -4
  251. package/dist/providers/locale/index.js +1 -1
  252. package/dist/providers/locale/index.jsx +2 -2
  253. package/dist/types-CxryXVkR.d.ts +8 -0
  254. package/dist/{use-presence-Ct1onT3-.d.ts → use-presence-B6QV_j94.d.ts} +3 -3
  255. package/package.json +71 -78
  256. package/dist/chunk/52WUF3CY.jsx +0 -26
  257. package/dist/chunk/BSPFGETO.js +0 -21
  258. package/dist/chunk/CTTG4GSG.js +0 -30
  259. package/dist/chunk/JHG4EID2.jsx +0 -233
  260. package/dist/chunk/MV3KTL7M.js +0 -107
  261. package/dist/types-B277wCdv.d.ts +0 -5
@@ -1,20 +1,23 @@
1
1
  import {
2
2
  ark
3
3
  } from "./UFYZ7HLU.jsx";
4
+ import {
5
+ useEnvironmentContext
6
+ } from "./D2Z5BEON.jsx";
7
+ import {
8
+ useLocaleContext
9
+ } from "./RCXMZN3G.jsx";
4
10
  import {
5
11
  createContext
6
- } from "./NMGUCD2L.jsx";
12
+ } from "./TVCIHLER.jsx";
7
13
  import {
8
14
  __export
9
15
  } from "./7IUG3E2V.jsx";
10
16
 
11
17
  // src/components/toast/create-toaster.tsx
12
- import { normalizeProps } from "@zag-js/solid";
13
18
  import * as toast from "@zag-js/toast";
14
19
  var createToaster = (props) => {
15
- const machine = toast.group.machine({ id: "1", ...props });
16
- const api = toast.group.connect(machine, machine.send, normalizeProps);
17
- return { ...api, machine };
20
+ return toast.createStore(props);
18
21
  };
19
22
 
20
23
  // src/components/toast/toast-action-trigger.tsx
@@ -76,27 +79,39 @@ var ToastTitle = (props) => {
76
79
  import { anatomy } from "@zag-js/toast";
77
80
 
78
81
  // src/components/toast/toaster.tsx
79
- import { mergeProps as mergeProps6, normalizeProps as normalizeProps2, useActor, useMachine } from "@zag-js/solid";
82
+ import { Key, mergeProps as mergeProps6, normalizeProps, useMachine } from "@zag-js/solid";
80
83
  import * as toast2 from "@zag-js/toast";
81
- import { For, createMemo, splitProps } from "solid-js";
84
+ import { createMemo, createUniqueId, splitProps } from "solid-js";
82
85
  var Toaster = (props) => {
83
86
  const [toasterProps, localProps] = splitProps(props, ["toaster", "children"]);
84
- const [state, send] = useMachine(toasterProps.toaster.machine);
85
- const placement = state.context.placement;
86
- const api = createMemo(() => toast2.group.connect(state, send, normalizeProps2));
87
- const toasts = createMemo(() => api().getToastsByPlacement(placement));
88
- const mergedProps = mergeProps6(api().getGroupProps({ placement }), localProps);
87
+ const locale = useLocaleContext();
88
+ const env = useEnvironmentContext();
89
+ const service = useMachine(toast2.group.machine, () => ({
90
+ store: toasterProps.toaster,
91
+ id: createUniqueId(),
92
+ dir: locale()?.dir,
93
+ getRootNode: () => env()?.getDocument()
94
+ }));
95
+ const api = createMemo(() => toast2.group.connect(service, normalizeProps));
96
+ const toasts = createMemo(() => api().getToasts());
97
+ const mergedProps = mergeProps6(api().getGroupProps(), localProps);
89
98
  return <ark.div {...mergedProps}>
90
- <For each={toasts()}>
91
- {(toast3) => <ToastActor value={toast3}>{(ctx) => toasterProps.children(ctx)}</ToastActor>}
92
- </For>
99
+ <Key each={toasts()} by="id">
100
+ {(toast3, index) => <ToastActor value={toast3} index={index} parent={service}>
101
+ {(ctx) => toasterProps.children(ctx)}
102
+ </ToastActor>}
103
+ </Key>
93
104
  </ark.div>;
94
105
  };
95
106
  var ToastActor = (props) => {
96
- const [state, send] = useActor(props.value);
97
- const api = createMemo(() => toast2.connect(state, send, normalizeProps2));
98
- const ctx = createMemo(() => state.context);
99
- return <ToastProvider value={api}>{props.children(ctx)}</ToastProvider>;
107
+ const localProps = createMemo(() => ({
108
+ ...props.value(),
109
+ parent: props.parent,
110
+ index: props.index
111
+ }));
112
+ const service = useMachine(toast2.machine, localProps);
113
+ const api = createMemo(() => toast2.connect(service, normalizeProps));
114
+ return <ToastProvider value={api}>{props.children(props.value)}</ToastProvider>;
100
115
  };
101
116
 
102
117
  // src/components/toast/toast.ts
@@ -1,9 +1,10 @@
1
- import { useFieldContext } from './X3BMEEJH.js';
1
+ import { useFieldContext } from './KVVYU5Z3.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './QODB3C3M.js';
5
- import { useLocaleContext } from './HPDOBQ3V.js';
6
- import { createContext } from './I5UG2QUO.js';
4
+ import { useEnvironmentContext } from './YMMMHJJS.js';
5
+ import { useLocaleContext } from './QEMQBM6W.js';
6
+ import { createContext } from './TROPIN4C.js';
7
+ import { runIfFn } from './DT73WLR4.js';
7
8
  import { __export } from './ESLJRKWD.js';
8
9
  import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
9
10
  import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
@@ -61,12 +62,12 @@ var EditablePreview = (props) => {
61
62
  const mergedProps = mergeProps(() => api().getPreviewProps(), props);
62
63
  return createComponent(ark.span, mergedProps);
63
64
  };
64
- var useEditable = (props = {}) => {
65
+ var useEditable = (props) => {
66
+ const id = createUniqueId();
65
67
  const locale = useLocaleContext();
66
68
  const environment = useEnvironmentContext();
67
- const id = createUniqueId();
68
69
  const field = useFieldContext();
69
- const context = createMemo(() => ({
70
+ const machineProps = createMemo(() => ({
70
71
  id,
71
72
  ids: {
72
73
  label: field?.().ids.label,
@@ -78,13 +79,10 @@ var useEditable = (props = {}) => {
78
79
  readOnly: field?.().readOnly,
79
80
  required: field?.().required,
80
81
  getRootNode: environment().getRootNode,
81
- edit: props.defaultEdit,
82
- value: props.defaultValue,
83
- "edit.controlled": props.edit !== void 0,
84
- ...props
82
+ ...runIfFn(props)
85
83
  }));
86
- const [state, send] = useMachine(editable.machine(context()), { context });
87
- return createMemo(() => editable.connect(state, send, normalizeProps));
84
+ const service = useMachine(editable.machine, machineProps);
85
+ return createMemo(() => editable.connect(service, normalizeProps));
88
86
  };
89
87
 
90
88
  // src/components/editable/editable-root.tsx
@@ -1,12 +1,13 @@
1
- import { useFieldsetContext } from './XUVXUPEH.js';
1
+ import { useFieldsetContext } from './XN3MSM3M.js';
2
+ import { composeRefs } from './XN6EERRM.js';
2
3
  import { createSplitProps } from './ZMHI4GDJ.js';
3
4
  import { ark } from './EPLBB4QN.js';
4
- import { createContext } from './I5UG2QUO.js';
5
+ import { createContext } from './TROPIN4C.js';
5
6
  import { __export } from './ESLJRKWD.js';
6
7
  import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
7
8
  import { mergeProps } from '@zag-js/solid';
8
- import { Show, createEffect, mergeProps as mergeProps$2, createSignal, createUniqueId, createMemo } from 'solid-js';
9
- import { dataAttr, ariaAttr } from '@zag-js/dom-query';
9
+ import { createEffect, Show, mergeProps as mergeProps$2, createSignal, createUniqueId, onMount, onCleanup, createMemo } from 'solid-js';
10
+ import { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';
10
11
  import { createAnatomy } from '@zag-js/anatomy';
11
12
  import { autoresizeTextarea } from '@zag-js/auto-resize';
12
13
 
@@ -87,13 +88,24 @@ var useField = (props) => {
87
88
  const [hasErrorText, setHasErrorText] = createSignal(false);
88
89
  const [hasHelperText, setHasHelperText] = createSignal(false);
89
90
  const id = fieldProps.id ?? createUniqueId();
90
- let rootRef;
91
+ const [rootRef, setRootRef] = createSignal(void 0);
91
92
  const rootId = fieldProps.ids?.control ?? `field::${id}`;
92
93
  const errorTextId = fieldProps.ids?.errorText ?? `field::${id}::error-text`;
93
94
  const helperTextId = fieldProps.ids?.helperText ?? `field::${id}::helper-text`;
94
95
  const labelId = fieldProps.ids?.label ?? `field::${id}::label`;
95
- createEffect(() => {
96
- return;
96
+ onMount(() => {
97
+ const rootNode = rootRef();
98
+ if (!rootNode) return;
99
+ const win = getWindow(rootNode);
100
+ const doc = win.document;
101
+ const checkTextElements = () => {
102
+ setHasErrorText(!!doc.getElementById(errorTextId));
103
+ setHasHelperText(!!doc.getElementById(helperTextId));
104
+ };
105
+ checkTextElements();
106
+ const observer = new win.MutationObserver(checkTextElements);
107
+ observer.observe(rootNode, { childList: true, subtree: true });
108
+ onCleanup(() => observer.disconnect());
97
109
  });
98
110
  const getRootProps = () => ({
99
111
  ...parts.root.attrs,
@@ -111,11 +123,14 @@ var useField = (props) => {
111
123
  "data-readonly": dataAttr(fieldProps.readOnly),
112
124
  htmlFor: id
113
125
  });
114
- const labelIds = [];
115
- if (hasErrorText() && fieldProps.invalid) labelIds.push(errorTextId);
116
- if (hasHelperText()) labelIds.push(helperTextId);
126
+ const labelIds = createMemo(() => {
127
+ const ids = [];
128
+ if (hasErrorText() && fieldProps.invalid) ids.push(errorTextId);
129
+ if (hasHelperText()) ids.push(helperTextId);
130
+ return ids;
131
+ });
117
132
  const getControlProps = () => ({
118
- "aria-describedby": labelIds.join(" ") || void 0,
133
+ "aria-describedby": labelIds().join(" ") || void 0,
119
134
  "aria-invalid": ariaAttr(fieldProps.invalid),
120
135
  "data-invalid": dataAttr(fieldProps.invalid),
121
136
  "data-required": dataAttr(fieldProps.required),
@@ -152,7 +167,7 @@ var useField = (props) => {
152
167
  ...parts.requiredIndicator.attrs
153
168
  });
154
169
  return createMemo(() => ({
155
- ariaDescribedby: labelIds.join(" "),
170
+ ariaDescribedby: labelIds().join(" "),
156
171
  ids: {
157
172
  control: id,
158
173
  label: labelId,
@@ -160,7 +175,7 @@ var useField = (props) => {
160
175
  helperText: helperTextId
161
176
  },
162
177
  refs: {
163
- rootRef
178
+ rootRef: setRootRef
164
179
  },
165
180
  disabled: fieldProps.disabled,
166
181
  invalid: fieldProps.invalid,
@@ -185,7 +200,12 @@ var FieldRoot = (props) => {
185
200
  return createComponent(FieldProvider, {
186
201
  value: field,
187
202
  get children() {
188
- return createComponent(ark.div, mergedProps);
203
+ return createComponent(ark.div, mergeProps$1(mergedProps, {
204
+ ref(r$) {
205
+ var _ref$ = composeRefs(field().refs.rootRef, props.ref);
206
+ typeof _ref$ === "function" && _ref$(r$);
207
+ }
208
+ }));
189
209
  }
190
210
  });
191
211
  };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  PresenceProvider,
3
3
  usePresence
4
- } from "./E72NMPSK.jsx";
4
+ } from "./A4744EEE.jsx";
5
5
  import {
6
6
  RenderStrategyProvider,
7
7
  splitRenderStrategyProps,
8
8
  useRenderStrategyContext
9
- } from "./5ONYCKM3.jsx";
9
+ } from "./NEBB7COJ.jsx";
10
10
  import {
11
11
  createSplitProps
12
12
  } from "./6WEDGJKQ.jsx";
@@ -15,13 +15,16 @@ import {
15
15
  } from "./UFYZ7HLU.jsx";
16
16
  import {
17
17
  useEnvironmentContext
18
- } from "./5O4RWSWO.jsx";
18
+ } from "./D2Z5BEON.jsx";
19
19
  import {
20
20
  useLocaleContext
21
- } from "./3QQZKR3F.jsx";
21
+ } from "./RCXMZN3G.jsx";
22
22
  import {
23
23
  createContext
24
- } from "./NMGUCD2L.jsx";
24
+ } from "./TVCIHLER.jsx";
25
+ import {
26
+ runIfFn
27
+ } from "./KGOB2IMX.jsx";
25
28
  import {
26
29
  __export
27
30
  } from "./7IUG3E2V.jsx";
@@ -94,19 +97,18 @@ import { mergeProps as mergeProps5 } from "@zag-js/solid";
94
97
  import { normalizeProps, useMachine } from "@zag-js/solid";
95
98
  import * as tabs from "@zag-js/tabs";
96
99
  import { createMemo, createUniqueId } from "solid-js";
97
- var useTabs = (props = {}) => {
100
+ var useTabs = (props) => {
101
+ const id = createUniqueId();
98
102
  const locale = useLocaleContext();
99
103
  const environment = useEnvironmentContext();
100
- const id = createUniqueId();
101
- const context = createMemo(() => ({
104
+ const machineProps = createMemo(() => ({
102
105
  id,
103
106
  dir: locale().dir,
104
107
  getRootNode: environment().getRootNode,
105
- value: props.defaultValue,
106
- ...props
108
+ ...runIfFn(props)
107
109
  }));
108
- const [state, send] = useMachine(tabs.machine(context()), { context });
109
- return createMemo(() => tabs.connect(state, send, normalizeProps));
110
+ const service = useMachine(tabs.machine, machineProps);
111
+ return createMemo(() => tabs.connect(service, normalizeProps));
110
112
  };
111
113
 
112
114
  // src/components/tabs/tabs-root.tsx
@@ -1,16 +1,17 @@
1
- import { usePresenceContext, splitPresenceProps, usePresence, PresenceProvider } from './LCESUDZB.js';
1
+ import { splitPresenceProps, usePresence, PresenceProvider, usePresenceContext } from './OY4ARTMM.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './QODB3C3M.js';
5
- import { useLocaleContext } from './HPDOBQ3V.js';
6
- import { createContext } from './I5UG2QUO.js';
4
+ import { useEnvironmentContext } from './YMMMHJJS.js';
5
+ import { useLocaleContext } from './QEMQBM6W.js';
6
+ import { createContext } from './TROPIN4C.js';
7
+ import { runIfFn } from './DT73WLR4.js';
7
8
  import { __export } from './ESLJRKWD.js';
8
9
  import * as datePicker from '@zag-js/date-picker';
9
10
  import { anatomy } from '@zag-js/date-picker';
10
11
  export { parse } from '@zag-js/date-picker';
11
- import { createComponent, mergeProps as mergeProps$1, insert, effect, template } from 'solid-js/web';
12
+ import { createComponent, mergeProps as mergeProps$1, template, insert, effect } from 'solid-js/web';
12
13
  import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
13
- import { Show, Index, createUniqueId, createMemo } from 'solid-js';
14
+ import { Index, createMemo, createUniqueId, Show } from 'solid-js';
14
15
 
15
16
  // src/components/date-picker/use-date-picker-context.ts
16
17
  var [DatePickerProvider, useDatePickerContext] = createContext({
@@ -126,28 +127,25 @@ var DatePickerRangeText = (props) => {
126
127
  }
127
128
  }));
128
129
  };
129
- var useDatePicker = (props = {}) => {
130
+ var useDatePicker = (props) => {
131
+ const id = createUniqueId();
130
132
  const locale = useLocaleContext();
131
133
  const environment = useEnvironmentContext();
132
- const id = createUniqueId();
133
- const context = createMemo(() => ({
134
+ const machineProps = createMemo(() => ({
134
135
  id,
135
136
  dir: locale().dir,
137
+ locale: locale().locale,
136
138
  getRootNode: environment().getRootNode,
137
- open: props.defaultOpen,
138
- "open.controlled": props.open !== void 0,
139
- value: props.defaultValue,
140
- view: props.defaultView,
141
- ...props
139
+ ...runIfFn(props)
142
140
  }));
143
- const [state, send] = useMachine(datePicker.machine(context()), { context });
144
- return createMemo(() => datePicker.connect(state, send, normalizeProps));
141
+ const service = useMachine(datePicker.machine, machineProps);
142
+ return createMemo(() => datePicker.connect(service, normalizeProps));
145
143
  };
146
144
 
147
145
  // src/components/date-picker/date-picker-root.tsx
148
146
  var DatePickerRoot = (props) => {
149
147
  const [presenceProps, datePickerProps] = splitPresenceProps(props);
150
- const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "defaultView", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "maxView", "min", "minView", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "parse", "placeholder", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
148
+ const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultFocusedValue", "defaultOpen", "defaultValue", "defaultView", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "maxView", "min", "minView", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "parse", "placeholder", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
151
149
  const api = useDatePicker(useDatePickerProps);
152
150
  const apiPresence = usePresence(mergeProps(presenceProps, () => ({
153
151
  present: api().open
@@ -1,7 +1,8 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './QODB3C3M.js';
4
- import { createContext } from './I5UG2QUO.js';
3
+ import { useEnvironmentContext } from './YMMMHJJS.js';
4
+ import { createContext } from './TROPIN4C.js';
5
+ import { runIfFn } from './DT73WLR4.js';
5
6
  import { __export } from './ESLJRKWD.js';
6
7
  import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
7
8
  import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
@@ -17,8 +18,9 @@ var [TimerProvider, useTimerContext] = createContext({
17
18
 
18
19
  // src/components/timer/timer-action-trigger.tsx
19
20
  var TimerActionTrigger = (props) => {
21
+ const [actionTriggerProps, localProps] = createSplitProps()(props, ["action"]);
20
22
  const timer2 = useTimerContext();
21
- const mergedProps = mergeProps(() => timer2().getActionTriggerProps(props), props);
23
+ const mergedProps = mergeProps(() => timer2().getActionTriggerProps(actionTriggerProps), localProps);
22
24
  return createComponent(ark.button, mergedProps);
23
25
  };
24
26
  var TimerArea = (props) => {
@@ -44,16 +46,16 @@ var TimerItem = (props) => {
44
46
  }
45
47
  }));
46
48
  };
47
- var useTimer = (props = {}) => {
48
- const env = useEnvironmentContext();
49
+ var useTimer = (props) => {
49
50
  const id = createUniqueId();
50
- const context = createMemo(() => ({
51
+ const environment = useEnvironmentContext();
52
+ const machineProps = createMemo(() => ({
51
53
  id,
52
- getRootNode: env().getRootNode,
53
- ...props
54
+ getRootNode: environment().getRootNode,
55
+ ...runIfFn(props)
54
56
  }));
55
- const [state, send] = useMachine(timer.machine(context()), { context });
56
- return createMemo(() => timer.connect(state, send, normalizeProps));
57
+ const service = useMachine(timer.machine, machineProps);
58
+ return createMemo(() => timer.connect(service, normalizeProps));
57
59
  };
58
60
 
59
61
  // src/components/timer/timer-root.tsx
@@ -6,13 +6,16 @@ import {
6
6
  } from "./UFYZ7HLU.jsx";
7
7
  import {
8
8
  useEnvironmentContext
9
- } from "./5O4RWSWO.jsx";
9
+ } from "./D2Z5BEON.jsx";
10
10
  import {
11
11
  useLocaleContext
12
- } from "./3QQZKR3F.jsx";
12
+ } from "./RCXMZN3G.jsx";
13
13
  import {
14
14
  createContext
15
- } from "./NMGUCD2L.jsx";
15
+ } from "./TVCIHLER.jsx";
16
+ import {
17
+ runIfFn
18
+ } from "./KGOB2IMX.jsx";
16
19
  import {
17
20
  __export
18
21
  } from "./7IUG3E2V.jsx";
@@ -49,27 +52,23 @@ import { mergeProps as mergeProps3 } from "@zag-js/solid";
49
52
  import * as avatar from "@zag-js/avatar";
50
53
  import { normalizeProps, useMachine } from "@zag-js/solid";
51
54
  import { createMemo, createUniqueId } from "solid-js";
52
- var useAvatar = (props = {}) => {
55
+ var useAvatar = (props) => {
53
56
  const locale = useLocaleContext();
54
57
  const environment = useEnvironmentContext();
55
58
  const id = createUniqueId();
56
- const context = createMemo(() => ({
59
+ const machineProps = createMemo(() => ({
57
60
  id,
58
61
  dir: locale().dir,
59
62
  getRootNode: environment().getRootNode,
60
- ...props
63
+ ...runIfFn(props)
61
64
  }));
62
- const [state, send] = useMachine(avatar.machine(context()), { context });
63
- return createMemo(() => avatar.connect(state, send, normalizeProps));
65
+ const service = useMachine(avatar.machine, machineProps);
66
+ return createMemo(() => avatar.connect(service, normalizeProps));
64
67
  };
65
68
 
66
69
  // src/components/avatar/avatar-root.tsx
67
70
  var AvatarRoot = (props) => {
68
- const [useAvatarProps, localProps] = createSplitProps()(props, [
69
- "id",
70
- "ids",
71
- "onStatusChange"
72
- ]);
71
+ const [useAvatarProps, localProps] = createSplitProps()(props, ["id", "ids", "onStatusChange"]);
73
72
  const context = useAvatar(useAvatarProps);
74
73
  const mergedProps = mergeProps3(() => context().getRootProps(), localProps);
75
74
  return <AvatarProvider value={context}>
@@ -6,13 +6,16 @@ import {
6
6
  } from "./UFYZ7HLU.jsx";
7
7
  import {
8
8
  useEnvironmentContext
9
- } from "./5O4RWSWO.jsx";
9
+ } from "./D2Z5BEON.jsx";
10
10
  import {
11
11
  useLocaleContext
12
- } from "./3QQZKR3F.jsx";
12
+ } from "./RCXMZN3G.jsx";
13
13
  import {
14
14
  createContext
15
- } from "./NMGUCD2L.jsx";
15
+ } from "./TVCIHLER.jsx";
16
+ import {
17
+ runIfFn
18
+ } from "./KGOB2IMX.jsx";
16
19
  import {
17
20
  __export
18
21
  } from "./7IUG3E2V.jsx";
@@ -38,11 +41,7 @@ var SplitterPanel = (props) => {
38
41
  // src/components/splitter/splitter-resize-trigger.tsx
39
42
  import { mergeProps as mergeProps2 } from "@zag-js/solid";
40
43
  var SplitterResizeTrigger = (props) => {
41
- const [resizeTriggerProps, restProps] = createSplitProps()(props, [
42
- "disabled",
43
- "id",
44
- "step"
45
- ]);
44
+ const [resizeTriggerProps, restProps] = createSplitProps()(props, ["disabled", "id", "step"]);
46
45
  const api = useSplitterContext();
47
46
  const mergedProps = mergeProps2(() => api().getResizeTriggerProps(resizeTriggerProps), restProps);
48
47
  return <ark.button {...mergedProps} />;
@@ -55,19 +54,18 @@ import { mergeProps as mergeProps3 } from "@zag-js/solid";
55
54
  import { normalizeProps, useMachine } from "@zag-js/solid";
56
55
  import * as splitter from "@zag-js/splitter";
57
56
  import { createMemo, createUniqueId } from "solid-js";
58
- var useSplitter = (props = {}) => {
57
+ var useSplitter = (props) => {
59
58
  const locale = useLocaleContext();
60
59
  const environment = useEnvironmentContext();
61
60
  const id = createUniqueId();
62
- const context = createMemo(() => ({
61
+ const machineProps = createMemo(() => ({
63
62
  id,
64
63
  dir: locale().dir,
65
64
  getRootNode: environment().getRootNode,
66
- size: props.defaultSize,
67
- ...props
65
+ ...runIfFn(props)
68
66
  }));
69
- const [state, send] = useMachine(splitter.machine(context()), { context });
70
- return createMemo(() => splitter.connect(state, send, normalizeProps));
67
+ const service = useMachine(splitter.machine, machineProps);
68
+ return createMemo(() => splitter.connect(service, normalizeProps));
71
69
  };
72
70
 
73
71
  // src/components/splitter/splitter-root.tsx
@@ -1,12 +1,12 @@
1
+ import {
2
+ useFieldContext
3
+ } from "./UCYPIMZC.jsx";
1
4
  import {
2
5
  PresenceProvider,
3
6
  splitPresenceProps,
4
7
  usePresence,
5
8
  usePresenceContext
6
- } from "./E72NMPSK.jsx";
7
- import {
8
- useFieldContext
9
- } from "./P7I44WC4.jsx";
9
+ } from "./A4744EEE.jsx";
10
10
  import {
11
11
  createSplitProps
12
12
  } from "./6WEDGJKQ.jsx";
@@ -15,13 +15,16 @@ import {
15
15
  } from "./UFYZ7HLU.jsx";
16
16
  import {
17
17
  useEnvironmentContext
18
- } from "./5O4RWSWO.jsx";
18
+ } from "./D2Z5BEON.jsx";
19
19
  import {
20
20
  useLocaleContext
21
- } from "./3QQZKR3F.jsx";
21
+ } from "./RCXMZN3G.jsx";
22
22
  import {
23
23
  createContext
24
- } from "./NMGUCD2L.jsx";
24
+ } from "./TVCIHLER.jsx";
25
+ import {
26
+ runIfFn
27
+ } from "./KGOB2IMX.jsx";
25
28
  import {
26
29
  __export
27
30
  } from "./7IUG3E2V.jsx";
@@ -83,12 +86,10 @@ import { mergeProps as mergeProps5 } from "@zag-js/solid";
83
86
  import { createMemo } from "solid-js";
84
87
 
85
88
  // src/components/combobox/use-combobox-item-context.ts
86
- var [ComboboxItemProvider, useComboboxItemContext] = createContext(
87
- {
88
- hookName: "useComboboxItemContext",
89
- providerName: "<ComboboxItemProvider />"
90
- }
91
- );
89
+ var [ComboboxItemProvider, useComboboxItemContext] = createContext({
90
+ hookName: "useComboboxItemContext",
91
+ providerName: "<ComboboxItemProvider />"
92
+ });
92
93
 
93
94
  // src/components/combobox/use-combobox-item-props-context.ts
94
95
  var [ComboboxItemPropsProvider, useComboboxItemPropsContext] = createContext({
@@ -138,10 +139,7 @@ import { mergeProps as mergeProps7 } from "@zag-js/solid";
138
139
  var ComboboxItemGroupLabel = (props) => {
139
140
  const combobox2 = useComboboxContext();
140
141
  const itemGroupProps = useComboboxItemGroupPropsContext();
141
- const mergedProps = mergeProps7(
142
- () => combobox2().getItemGroupLabelProps({ htmlFor: itemGroupProps.id }),
143
- props
144
- );
142
+ const mergedProps = mergeProps7(() => combobox2().getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);
145
143
  return <ark.div {...mergedProps} />;
146
144
  };
147
145
 
@@ -197,13 +195,13 @@ import { mergeProps as mergeProps13 } from "@zag-js/solid";
197
195
  // src/components/combobox/use-combobox.ts
198
196
  import * as combobox from "@zag-js/combobox";
199
197
  import { normalizeProps, useMachine } from "@zag-js/solid";
200
- import { createEffect, createMemo as createMemo2, createUniqueId as createUniqueId2, splitProps } from "solid-js";
198
+ import { createMemo as createMemo2, createUniqueId as createUniqueId2 } from "solid-js";
201
199
  var useCombobox = (props) => {
202
200
  const locale = useLocaleContext();
203
201
  const environment = useEnvironmentContext();
204
202
  const id = createUniqueId2();
205
203
  const field = useFieldContext();
206
- const initialContext = createMemo2(() => ({
204
+ const machineProps = createMemo2(() => ({
207
205
  id,
208
206
  ids: {
209
207
  label: field?.().ids.label,
@@ -215,22 +213,10 @@ var useCombobox = (props) => {
215
213
  invalid: field?.().invalid,
216
214
  dir: locale().dir,
217
215
  getRootNode: environment().getRootNode,
218
- open: props.defaultOpen,
219
- value: props.defaultValue,
220
- "open.controlled": props.open !== void 0,
221
- ...props
216
+ ...runIfFn(props)
222
217
  }));
223
- const context = createMemo2(() => {
224
- const [, restProps] = splitProps(initialContext(), ["collection"]);
225
- return restProps;
226
- });
227
- const [state, send, service] = useMachine(combobox.machine(initialContext()), {
228
- context
229
- });
230
- createEffect(() => {
231
- service.setContext({ collection: props.collection });
232
- });
233
- return createMemo2(() => combobox.connect(state, send, normalizeProps));
218
+ const service = useMachine(combobox.machine, machineProps);
219
+ return createMemo2(() => combobox.connect(service, normalizeProps));
234
220
  };
235
221
 
236
222
  // src/components/combobox/combobox-root.tsx
@@ -242,6 +228,8 @@ var ComboboxRoot = (props) => {
242
228
  "closeOnSelect",
243
229
  "collection",
244
230
  "composite",
231
+ "defaultHighlightedValue",
232
+ "defaultInputValue",
245
233
  "defaultOpen",
246
234
  "defaultValue",
247
235
  "disabled",
@@ -292,10 +280,7 @@ var ComboboxRoot = (props) => {
292
280
  import { mergeProps as mergeProps14 } from "@zag-js/solid";
293
281
  var ComboboxRootProvider = (props) => {
294
282
  const [presenceProps, comboboxProps] = splitPresenceProps(props);
295
- const [{ value: combobox2 }, localProps] = createSplitProps()(
296
- comboboxProps,
297
- ["value"]
298
- );
283
+ const [{ value: combobox2 }, localProps] = createSplitProps()(comboboxProps, ["value"]);
299
284
  const apiPresence = usePresence(mergeProps14(presenceProps, () => ({ present: combobox2().open })));
300
285
  const mergedProps = mergeProps14(() => combobox2().getRootProps(), localProps);
301
286
  return <ComboboxProvider value={combobox2}>
@@ -0,0 +1,15 @@
1
+ // src/components/collection.ts
2
+ import {
3
+ ListCollection,
4
+ TreeCollection,
5
+ filePathToTree
6
+ } from "@zag-js/collection";
7
+ var createListCollection = (options) => new ListCollection(options);
8
+ var createTreeCollection = (options) => new TreeCollection(options);
9
+ var createFileTreeCollection = (paths) => filePathToTree(paths);
10
+
11
+ export {
12
+ createListCollection,
13
+ createTreeCollection,
14
+ createFileTreeCollection
15
+ };