@ark-ui/solid 5.16.0 → 5.16.1

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 (189) hide show
  1. package/dist/chunk/{PPQSRJ6X.jsx → 5PKZLVXE.jsx} +7 -7
  2. package/dist/chunk/{U5CBLW6U.jsx → ACABJNIJ.jsx} +4 -4
  3. package/dist/chunk/AQUEJK4Z.jsx +122 -0
  4. package/dist/chunk/{XKBIT7L5.jsx → BBWRZLB6.jsx} +4 -4
  5. package/dist/chunk/{AHH5Z3VJ.jsx → C46RVY7A.jsx} +7 -7
  6. package/dist/chunk/{ZTNABPZL.jsx → EIA3BZ33.jsx} +7 -7
  7. package/dist/chunk/{ZSMY7WCA.jsx → FC67EFPW.jsx} +4 -4
  8. package/dist/chunk/{S4OS4UYL.jsx → FRSNRGQK.jsx} +7 -7
  9. package/dist/chunk/{L64MXP66.jsx → G3JCG6HD.jsx} +4 -4
  10. package/dist/chunk/{KAYDBHSW.jsx → IDNDLSEV.jsx} +4 -4
  11. package/dist/chunk/{WOUVNHGI.jsx → JPJUQ5CI.jsx} +4 -4
  12. package/dist/chunk/{XUH2TAUG.jsx → KIDL2HC3.jsx} +7 -7
  13. package/dist/chunk/{VL4J24YY.js → NEP3K5KL.js} +2 -2
  14. package/dist/chunk/{RC4UV6HP.jsx → NVETRSKA.jsx} +4 -4
  15. package/dist/chunk/{NCRPFSNO.jsx → VR5BNKL7.jsx} +4 -4
  16. package/dist/chunk/{2WR5J3OZ.jsx → WBYGZCTU.jsx} +7 -7
  17. package/dist/chunk/XL4VFEPW.js +104 -0
  18. package/dist/chunk/{WG67YHCV.jsx → ZB7AEDAJ.jsx} +4 -4
  19. package/dist/chunk/{SWUMYWUU.js → ZLUEV2MH.js} +2 -2
  20. package/dist/components/accordion/index.js +1 -1
  21. package/dist/components/accordion/index.jsx +3 -3
  22. package/dist/components/angle-slider/index.js +1 -1
  23. package/dist/components/angle-slider/index.jsx +2 -2
  24. package/dist/components/avatar/index.js +1 -1
  25. package/dist/components/avatar/index.jsx +2 -2
  26. package/dist/components/carousel/index.js +1 -1
  27. package/dist/components/carousel/index.jsx +2 -2
  28. package/dist/components/checkbox/index.js +1 -1
  29. package/dist/components/checkbox/index.jsx +2 -2
  30. package/dist/components/clipboard/index.jsx +1 -1
  31. package/dist/components/collapsible/index.js +1 -1
  32. package/dist/components/collapsible/index.jsx +2 -2
  33. package/dist/components/collection/index.d.ts +2 -2
  34. package/dist/components/collection/index.js +1 -1
  35. package/dist/components/collection/index.jsx +1 -1
  36. package/dist/components/color-picker/index.js +1 -1
  37. package/dist/components/color-picker/index.jsx +4 -4
  38. package/dist/components/combobox/index.d.ts +1 -1
  39. package/dist/components/combobox/index.js +2 -2
  40. package/dist/components/combobox/index.jsx +5 -5
  41. package/dist/components/date-picker/index.js +1 -1
  42. package/dist/components/date-picker/index.jsx +4 -4
  43. package/dist/components/dialog/index.js +1 -1
  44. package/dist/components/dialog/index.jsx +4 -4
  45. package/dist/components/download-trigger/index.jsx +1 -1
  46. package/dist/components/editable/index.js +1 -1
  47. package/dist/components/editable/index.jsx +2 -2
  48. package/dist/components/field/index.jsx +1 -1
  49. package/dist/components/fieldset/index.jsx +1 -1
  50. package/dist/components/file-upload/index.js +1 -1
  51. package/dist/components/file-upload/index.jsx +2 -2
  52. package/dist/components/floating-panel/index.js +1 -1
  53. package/dist/components/floating-panel/index.jsx +4 -4
  54. package/dist/components/format/index.jsx +1 -1
  55. package/dist/components/frame/index.jsx +1 -1
  56. package/dist/components/hover-card/index.js +1 -1
  57. package/dist/components/hover-card/index.jsx +4 -4
  58. package/dist/components/index.d.ts +1 -1
  59. package/dist/components/index.js +45 -45
  60. package/dist/components/index.jsx +343 -343
  61. package/dist/components/listbox/index.js +2 -2
  62. package/dist/components/listbox/index.jsx +3 -3
  63. package/dist/components/menu/index.js +1 -1
  64. package/dist/components/menu/index.jsx +4 -4
  65. package/dist/components/number-input/index.js +1 -1
  66. package/dist/components/number-input/index.jsx +2 -2
  67. package/dist/components/pagination/index.js +1 -1
  68. package/dist/components/pagination/index.jsx +2 -2
  69. package/dist/components/password-input/index.js +1 -1
  70. package/dist/components/password-input/index.jsx +2 -2
  71. package/dist/components/pin-input/index.js +1 -1
  72. package/dist/components/pin-input/index.jsx +2 -2
  73. package/dist/components/popover/index.js +1 -1
  74. package/dist/components/popover/index.jsx +4 -4
  75. package/dist/components/presence/index.jsx +2 -2
  76. package/dist/components/progress/index.js +1 -1
  77. package/dist/components/progress/index.jsx +2 -2
  78. package/dist/components/qr-code/index.js +1 -1
  79. package/dist/components/qr-code/index.jsx +2 -2
  80. package/dist/components/radio-group/index.js +1 -1
  81. package/dist/components/radio-group/index.jsx +2 -2
  82. package/dist/components/rating-group/index.js +1 -1
  83. package/dist/components/rating-group/index.jsx +2 -2
  84. package/dist/components/segment-group/index.js +1 -1
  85. package/dist/components/segment-group/index.jsx +2 -2
  86. package/dist/components/select/index.d.ts +1 -1
  87. package/dist/components/select/index.js +2 -2
  88. package/dist/components/select/index.jsx +5 -5
  89. package/dist/components/signature-pad/index.js +1 -1
  90. package/dist/components/signature-pad/index.jsx +2 -2
  91. package/dist/components/slider/index.js +1 -1
  92. package/dist/components/slider/index.jsx +2 -2
  93. package/dist/components/splitter/index.js +1 -1
  94. package/dist/components/splitter/index.jsx +2 -2
  95. package/dist/components/steps/index.js +1 -1
  96. package/dist/components/steps/index.jsx +2 -2
  97. package/dist/components/switch/index.js +1 -1
  98. package/dist/components/switch/index.jsx +2 -2
  99. package/dist/components/tabs/index.js +1 -1
  100. package/dist/components/tabs/index.jsx +4 -4
  101. package/dist/components/tags-input/index.js +1 -1
  102. package/dist/components/tags-input/index.jsx +2 -2
  103. package/dist/components/time-picker/index.js +1 -1
  104. package/dist/components/time-picker/index.jsx +4 -4
  105. package/dist/components/timer/index.jsx +1 -1
  106. package/dist/components/toast/index.js +1 -1
  107. package/dist/components/toast/index.jsx +2 -2
  108. package/dist/components/toggle-group/index.js +1 -1
  109. package/dist/components/toggle-group/index.jsx +2 -2
  110. package/dist/components/tooltip/index.js +1 -1
  111. package/dist/components/tooltip/index.jsx +4 -4
  112. package/dist/components/tour/index.js +1 -1
  113. package/dist/components/tour/index.jsx +4 -4
  114. package/dist/components/tree-view/index.js +2 -2
  115. package/dist/components/tree-view/index.jsx +4 -4
  116. package/dist/index.d.ts +1 -1
  117. package/dist/index.js +46 -46
  118. package/dist/index.jsx +346 -346
  119. package/dist/providers/index.js +1 -1
  120. package/dist/providers/index.jsx +4 -4
  121. package/dist/use-list-collection-C2rvMTSM.d.ts +91 -0
  122. package/package.json +68 -68
  123. package/dist/chunk/FBAKX74S.js +0 -86
  124. package/dist/chunk/XEXZI6CD.jsx +0 -104
  125. package/dist/use-list-collection-FJyPsrh3.d.ts +0 -39
  126. package/dist/chunk/{DAORON6X.js → 25PYT2EL.js} +1 -1
  127. package/dist/chunk/{OF23HNNE.js → 4B42LT3B.js} +1 -1
  128. package/dist/chunk/{VQ3I3Z7G.js → 4B53AHD6.js} +1 -1
  129. package/dist/chunk/{AKYIM67Z.jsx → 4T2T3PMU.jsx} +3 -3
  130. package/dist/chunk/{I6UGYR2R.js → 4V2VMH2Z.js} +1 -1
  131. package/dist/chunk/{QKDU2AEK.js → 5UKLBKNF.js} +2 -2
  132. package/dist/chunk/{OEQFRTGI.js → 6ATAHZBX.js} +1 -1
  133. package/dist/chunk/{WI6PP4EF.js → 74W4D3KY.js} +1 -1
  134. package/dist/chunk/{NQSCRM4A.js → 7E5K2JFP.js} +1 -1
  135. package/dist/chunk/{HP3ZGMDZ.jsx → 7FASJWDK.jsx} +3 -3
  136. package/dist/chunk/{YAOPG62Z.jsx → 7RYPC5LL.jsx} +3 -3
  137. package/dist/chunk/{4FUKCXPR.jsx → 7UNWOGPT.jsx} +3 -3
  138. package/dist/chunk/{OKT2RIHV.js → 7YHVIYNP.js} +1 -1
  139. package/dist/chunk/{AD6K3UTR.js → ASBQTDT2.js} +1 -1
  140. package/dist/chunk/{UK24ZAUL.js → CDA7SUTE.js} +1 -1
  141. package/dist/chunk/{35XSFKD5.jsx → CINP4S7J.jsx} +3 -3
  142. package/dist/chunk/{MTVQZNY6.js → D65IYCJS.js} +1 -1
  143. package/dist/chunk/{2MXPLL4O.js → EJDY3MNV.js} +1 -1
  144. package/dist/chunk/{4UNGYCFT.jsx → FG427CLW.jsx} +3 -3
  145. package/dist/chunk/{2UVDYZIY.jsx → FOIEK72O.jsx} +3 -3
  146. package/dist/chunk/{WZ75PULC.js → FQGMWBGA.js} +1 -1
  147. package/dist/chunk/{BOR6VUN5.js → GAB5O55Q.js} +1 -1
  148. package/dist/chunk/{HDKSS6KE.jsx → GLN6WFQR.jsx} +3 -3
  149. package/dist/chunk/{WC2HBDLJ.jsx → H6ODLFPJ.jsx} +3 -3
  150. package/dist/chunk/{LORIOKHL.js → HKFF76YQ.js} +1 -1
  151. package/dist/chunk/{CBGZAFEX.jsx → I7VQFKYT.jsx} +3 -3
  152. package/dist/chunk/{RVCD7KQA.js → JBKKVPLG.js} +2 -2
  153. package/dist/chunk/{3DOPQCHJ.jsx → JK6QXH6B.jsx} +3 -3
  154. package/dist/chunk/{UW5WJ2LL.jsx → JKM73NGJ.jsx} +3 -3
  155. package/dist/chunk/{T7GUEJBF.js → JXJHXSF4.js} +1 -1
  156. package/dist/chunk/{JEPST7BN.jsx → KJ353BY6.jsx} +3 -3
  157. package/dist/chunk/{AUVF4L3Q.jsx → KNVMVQG6.jsx} +3 -3
  158. package/dist/chunk/{72JQEDEW.js → L4PQJRRA.js} +1 -1
  159. package/dist/chunk/{364QFYBV.js → LNLL2OTD.js} +1 -1
  160. package/dist/chunk/{NPHS6PVV.jsx → MJTOTU2A.jsx} +3 -3
  161. package/dist/chunk/{IWBBR7PD.js → N65DCNIH.js} +1 -1
  162. package/dist/chunk/{4HQIDBKB.js → O5A5KQPC.js} +1 -1
  163. package/dist/chunk/{HWMA3X7B.js → O6D2QF5I.js} +1 -1
  164. package/dist/chunk/{T4JGZ7KR.js → OA4CU2PL.js} +1 -1
  165. package/dist/chunk/{OKNWZYMH.jsx → OM7DNJ6L.jsx} +3 -3
  166. package/dist/chunk/{JUBTXT4B.jsx → OM7V7VVC.jsx} +3 -3
  167. package/dist/chunk/{H5DXY5W4.js → OVFUGKNG.js} +1 -1
  168. package/dist/chunk/{6PUHRDVU.js → P5BHXVYK.js} +1 -1
  169. package/dist/chunk/{74TH35IC.js → P7WR6WX5.js} +1 -1
  170. package/dist/chunk/{5U4KEVIU.jsx → PRA2XFQE.jsx} +3 -3
  171. package/dist/chunk/{FJ5JNMAY.js → QJQKZL6X.js} +1 -1
  172. package/dist/chunk/{MM6NNI6M.jsx → QXYWHKF7.jsx} +3 -3
  173. package/dist/chunk/{OPAESICE.js → SFEMNN6F.js} +1 -1
  174. package/dist/chunk/{ROUJC6XC.js → SGY2KGDL.js} +1 -1
  175. package/dist/chunk/{5MOOYXRU.js → TBR4XVH2.js} +1 -1
  176. package/dist/chunk/{LDOGINY6.js → TECDLRTB.js} +1 -1
  177. package/dist/chunk/{DPP7XCXL.js → UAANHQJZ.js} +1 -1
  178. package/dist/chunk/{3IJ5QLEM.js → UU6XEYFI.js} +1 -1
  179. package/dist/chunk/{QC5C6JJA.jsx → V6S3C3U7.jsx} +3 -3
  180. package/dist/chunk/{LKPEYZZO.jsx → V75EMOIC.jsx} +3 -3
  181. package/dist/chunk/{RVK7FAUI.js → VEV5HF3M.js} +1 -1
  182. package/dist/chunk/{ZNBZTQ46.jsx → WBLWV2L4.jsx} +3 -3
  183. package/dist/chunk/{LB3LJBHI.js → WTNRGPVN.js} +1 -1
  184. package/dist/chunk/{POJRD725.jsx → X5GWQYGE.jsx} +3 -3
  185. package/dist/chunk/{LRA73ZZJ.js → XQNGFJ2M.js} +1 -1
  186. package/dist/chunk/{N3H47LNB.jsx → XSGHIZ6Q.jsx} +3 -3
  187. package/dist/chunk/{WHXDBQDP.jsx → Z2BXVXSV.jsx} +3 -3
  188. package/dist/chunk/{3B7I46SI.jsx → ZHLQWQXX.jsx} +3 -3
  189. package/dist/chunk/{KBANDL4M.js → ZRSPQAUK.js} +2 -2
@@ -1,12 +1,12 @@
1
- import {
2
- useFieldContext
3
- } from "./HQOIDGRU.jsx";
4
1
  import {
5
2
  PresenceProvider,
6
3
  splitPresenceProps,
7
4
  usePresence,
8
5
  usePresenceContext
9
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
+ import {
8
+ useFieldContext
9
+ } from "./HQOIDGRU.jsx";
10
10
  import {
11
11
  composeRefs
12
12
  } from "./DOBZPYAN.jsx";
@@ -16,12 +16,12 @@ import {
16
16
  import {
17
17
  ark
18
18
  } from "./UFYZ7HLU.jsx";
19
- import {
20
- useEnvironmentContext
21
- } from "./E2L62MKC.jsx";
22
19
  import {
23
20
  useLocaleContext
24
21
  } from "./YUC6JE7K.jsx";
22
+ import {
23
+ useEnvironmentContext
24
+ } from "./E2L62MKC.jsx";
25
25
  import {
26
26
  createContext
27
27
  } from "./TVCIHLER.jsx";
@@ -3,19 +3,19 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  createSplitProps
9
9
  } from "./6WEDGJKQ.jsx";
10
10
  import {
11
11
  ark
12
12
  } from "./UFYZ7HLU.jsx";
13
- import {
14
- useEnvironmentContext
15
- } from "./E2L62MKC.jsx";
16
13
  import {
17
14
  useLocaleContext
18
15
  } from "./YUC6JE7K.jsx";
16
+ import {
17
+ useEnvironmentContext
18
+ } from "./E2L62MKC.jsx";
19
19
  import {
20
20
  createContext
21
21
  } from "./TVCIHLER.jsx";
@@ -0,0 +1,122 @@
1
+ // src/components/collection/grid-collection.ts
2
+ import {
3
+ GridCollection
4
+ } from "@zag-js/collection";
5
+ var createGridCollection = (options) => new GridCollection(options);
6
+
7
+ // src/components/collection/list-collection.ts
8
+ import { ListCollection } from "@zag-js/collection";
9
+ var createListCollection = (options) => new ListCollection(options);
10
+
11
+ // src/components/collection/tree-collection.ts
12
+ import {
13
+ TreeCollection,
14
+ filePathToTree
15
+ } from "@zag-js/collection";
16
+ var createTreeCollection = (options) => new TreeCollection(options);
17
+ var createFileTreeCollection = (paths) => filePathToTree(paths);
18
+
19
+ // src/components/collection/use-list-collection.ts
20
+ import { createMemo, createSignal, splitProps } from "solid-js";
21
+ function useListCollection(props) {
22
+ const splittedProps = createMemo(() => {
23
+ const rawProps = typeof props === "function" ? props() : props;
24
+ return splitProps(rawProps, ["initialItems", "filter", "limit"]);
25
+ });
26
+ const init = () => {
27
+ const [localProps] = splittedProps();
28
+ return localProps.initialItems;
29
+ };
30
+ const [items, setItemsImpl] = createSignal(init());
31
+ const [filterText, setFilterText] = createSignal("");
32
+ const setItems = (newItems) => {
33
+ setItemsImpl(newItems);
34
+ setFilterText("");
35
+ };
36
+ const create = (itemsToCreate) => {
37
+ const [, collectionOptions] = splittedProps();
38
+ return createListCollection({ ...collectionOptions, items: itemsToCreate });
39
+ };
40
+ const collection = createMemo(() => {
41
+ const [localProps, collectionOptions] = splittedProps();
42
+ const filter = localProps.filter;
43
+ let activeItems = items();
44
+ if (filterText() && filter) {
45
+ activeItems = create(items()).filter((itemString, _index, item) => filter(itemString, filterText(), item)).items;
46
+ }
47
+ const limitedItems = localProps.limit == null ? activeItems : activeItems.slice(0, localProps.limit);
48
+ return createListCollection({ ...collectionOptions, items: limitedItems });
49
+ });
50
+ return {
51
+ collection,
52
+ filter: (inputValue = "") => {
53
+ setFilterText(inputValue);
54
+ },
55
+ set: (newItems) => {
56
+ setItems(newItems);
57
+ },
58
+ reset: () => {
59
+ const [localProps] = splittedProps();
60
+ setItems(localProps.initialItems);
61
+ },
62
+ clear: () => {
63
+ setItems([]);
64
+ },
65
+ insert: (index, ...itemsToInsert) => {
66
+ const newItems = create(items()).insert(index, ...itemsToInsert).items;
67
+ setItems(newItems);
68
+ },
69
+ insertBefore: (value, ...itemsToInsert) => {
70
+ const newItems = create(items()).insertBefore(value, ...itemsToInsert).items;
71
+ setItems(newItems);
72
+ },
73
+ insertAfter: (value, ...itemsToInsert) => {
74
+ const newItems = create(items()).insertAfter(value, ...itemsToInsert).items;
75
+ setItems(newItems);
76
+ },
77
+ remove: (...itemOrValues) => {
78
+ const newItems = create(items()).remove(...itemOrValues).items;
79
+ setItems(newItems);
80
+ },
81
+ move: (value, to) => {
82
+ const newItems = create(items()).move(value, to).items;
83
+ setItems(newItems);
84
+ },
85
+ moveBefore: (value, ...values) => {
86
+ const newItems = create(items()).moveBefore(value, ...values).items;
87
+ setItems(newItems);
88
+ },
89
+ moveAfter: (value, ...values) => {
90
+ const newItems = create(items()).moveAfter(value, ...values).items;
91
+ setItems(newItems);
92
+ },
93
+ reorder: (from, to) => {
94
+ const newItems = create(items()).reorder(from, to).items;
95
+ setItems(newItems);
96
+ },
97
+ append: (...itemsToAppend) => {
98
+ const newItems = create(items()).append(...itemsToAppend).items;
99
+ setItems(newItems);
100
+ },
101
+ upsert: (value, item, mode = "append") => {
102
+ const newItems = create(items()).upsert(value, item, mode).items;
103
+ setItems(newItems);
104
+ },
105
+ prepend: (...itemsToPrepend) => {
106
+ const newItems = create(items()).prepend(...itemsToPrepend).items;
107
+ setItems(newItems);
108
+ },
109
+ update: (value, item) => {
110
+ const newItems = create(items()).update(value, item).items;
111
+ setItems(newItems);
112
+ }
113
+ };
114
+ }
115
+
116
+ export {
117
+ createGridCollection,
118
+ createListCollection,
119
+ createTreeCollection,
120
+ createFileTreeCollection,
121
+ useListCollection
122
+ };
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -1,12 +1,12 @@
1
- import {
2
- useFieldContext
3
- } from "./HQOIDGRU.jsx";
4
1
  import {
5
2
  PresenceProvider,
6
3
  splitPresenceProps,
7
4
  usePresence,
8
5
  usePresenceContext
9
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
+ import {
8
+ useFieldContext
9
+ } from "./HQOIDGRU.jsx";
10
10
  import {
11
11
  composeRefs
12
12
  } from "./DOBZPYAN.jsx";
@@ -16,12 +16,12 @@ import {
16
16
  import {
17
17
  ark
18
18
  } from "./UFYZ7HLU.jsx";
19
- import {
20
- useEnvironmentContext
21
- } from "./E2L62MKC.jsx";
22
19
  import {
23
20
  useLocaleContext
24
21
  } from "./YUC6JE7K.jsx";
22
+ import {
23
+ useEnvironmentContext
24
+ } from "./E2L62MKC.jsx";
25
25
  import {
26
26
  createContext
27
27
  } from "./TVCIHLER.jsx";
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  PresenceProvider,
3
3
  usePresence
4
- } from "./WC2HBDLJ.jsx";
5
- import {
6
- composeRefs
7
- } from "./DOBZPYAN.jsx";
4
+ } from "./H6ODLFPJ.jsx";
8
5
  import {
9
6
  RenderStrategyProvider,
10
7
  splitRenderStrategyProps,
11
8
  useRenderStrategyContext
12
9
  } from "./NEBB7COJ.jsx";
10
+ import {
11
+ composeRefs
12
+ } from "./DOBZPYAN.jsx";
13
13
  import {
14
14
  createSplitProps
15
15
  } from "./6WEDGJKQ.jsx";
16
16
  import {
17
17
  ark
18
18
  } from "./UFYZ7HLU.jsx";
19
- import {
20
- useEnvironmentContext
21
- } from "./E2L62MKC.jsx";
22
19
  import {
23
20
  useLocaleContext
24
21
  } from "./YUC6JE7K.jsx";
22
+ import {
23
+ useEnvironmentContext
24
+ } from "./E2L62MKC.jsx";
25
25
  import {
26
26
  createContext
27
27
  } from "./TVCIHLER.jsx";
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -3,27 +3,27 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
7
- import {
8
- composeRefs
9
- } from "./DOBZPYAN.jsx";
6
+ } from "./H6ODLFPJ.jsx";
10
7
  import {
11
8
  RenderStrategyProvider,
12
9
  splitRenderStrategyProps,
13
10
  useRenderStrategyContext
14
11
  } from "./NEBB7COJ.jsx";
12
+ import {
13
+ composeRefs
14
+ } from "./DOBZPYAN.jsx";
15
15
  import {
16
16
  createSplitProps
17
17
  } from "./6WEDGJKQ.jsx";
18
18
  import {
19
19
  ark
20
20
  } from "./UFYZ7HLU.jsx";
21
- import {
22
- useEnvironmentContext
23
- } from "./E2L62MKC.jsx";
24
21
  import {
25
22
  useLocaleContext
26
23
  } from "./YUC6JE7K.jsx";
24
+ import {
25
+ useEnvironmentContext
26
+ } from "./E2L62MKC.jsx";
27
27
  import {
28
28
  createContext
29
29
  } from "./TVCIHLER.jsx";
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  collapsible_exports,
3
3
  useCollapsibleContext
4
- } from "./WHXDBQDP.jsx";
4
+ } from "./Z2BXVXSV.jsx";
5
5
  import {
6
6
  RenderStrategyProvider,
7
7
  splitRenderStrategyProps,
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -3,27 +3,27 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
7
- import {
8
- composeRefs
9
- } from "./DOBZPYAN.jsx";
6
+ } from "./H6ODLFPJ.jsx";
10
7
  import {
11
8
  RenderStrategyProvider,
12
9
  splitRenderStrategyProps,
13
10
  useRenderStrategyContext
14
11
  } from "./NEBB7COJ.jsx";
12
+ import {
13
+ composeRefs
14
+ } from "./DOBZPYAN.jsx";
15
15
  import {
16
16
  createSplitProps
17
17
  } from "./6WEDGJKQ.jsx";
18
18
  import {
19
19
  ark
20
20
  } from "./UFYZ7HLU.jsx";
21
- import {
22
- useEnvironmentContext
23
- } from "./E2L62MKC.jsx";
24
21
  import {
25
22
  useLocaleContext
26
23
  } from "./YUC6JE7K.jsx";
24
+ import {
25
+ useEnvironmentContext
26
+ } from "./E2L62MKC.jsx";
27
27
  import {
28
28
  createContext
29
29
  } from "./TVCIHLER.jsx";
@@ -1,9 +1,9 @@
1
- import { useCollapsibleContext, collapsible_exports } from './ROUJC6XC.js';
1
+ import { useCollapsibleContext, collapsible_exports } from './SGY2KGDL.js';
2
2
  import { splitRenderStrategyProps, RenderStrategyProvider, useRenderStrategyContext } from './QFAL6GWC.js';
3
3
  import { createSplitProps } from './ZMHI4GDJ.js';
4
4
  import { ark } from './EPLBB4QN.js';
5
- import { useEnvironmentContext } from './YO2MCGXO.js';
6
5
  import { useLocaleContext } from './OKZ64GSY.js';
6
+ import { useEnvironmentContext } from './YO2MCGXO.js';
7
7
  import { createContext } from './TROPIN4C.js';
8
8
  import { runIfFn } from './DT73WLR4.js';
9
9
  import { __export } from './ESLJRKWD.js';
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  collapsible_exports
3
- } from "./WHXDBQDP.jsx";
3
+ } from "./Z2BXVXSV.jsx";
4
4
  import {
5
5
  RenderStrategyProvider,
6
6
  splitRenderStrategyProps,
@@ -12,12 +12,12 @@ import {
12
12
  import {
13
13
  ark
14
14
  } from "./UFYZ7HLU.jsx";
15
- import {
16
- useEnvironmentContext
17
- } from "./E2L62MKC.jsx";
18
15
  import {
19
16
  useLocaleContext
20
17
  } from "./YUC6JE7K.jsx";
18
+ import {
19
+ useEnvironmentContext
20
+ } from "./E2L62MKC.jsx";
21
21
  import {
22
22
  createContext
23
23
  } from "./TVCIHLER.jsx";
@@ -1,12 +1,12 @@
1
- import {
2
- useFieldContext
3
- } from "./HQOIDGRU.jsx";
4
1
  import {
5
2
  PresenceProvider,
6
3
  splitPresenceProps,
7
4
  usePresence,
8
5
  usePresenceContext
9
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
+ import {
8
+ useFieldContext
9
+ } from "./HQOIDGRU.jsx";
10
10
  import {
11
11
  composeRefs
12
12
  } from "./DOBZPYAN.jsx";
@@ -16,12 +16,12 @@ import {
16
16
  import {
17
17
  ark
18
18
  } from "./UFYZ7HLU.jsx";
19
- import {
20
- useEnvironmentContext
21
- } from "./E2L62MKC.jsx";
22
19
  import {
23
20
  useLocaleContext
24
21
  } from "./YUC6JE7K.jsx";
22
+ import {
23
+ useEnvironmentContext
24
+ } from "./E2L62MKC.jsx";
25
25
  import {
26
26
  createContext
27
27
  } from "./TVCIHLER.jsx";
@@ -0,0 +1,104 @@
1
+ import { GridCollection, ListCollection, TreeCollection, filePathToTree } from '@zag-js/collection';
2
+ import { createMemo, splitProps, createSignal } from 'solid-js';
3
+
4
+ // src/components/collection/grid-collection.ts
5
+ var createGridCollection = (options) => new GridCollection(options);
6
+ var createListCollection = (options) => new ListCollection(options);
7
+ var createTreeCollection = (options) => new TreeCollection(options);
8
+ var createFileTreeCollection = (paths) => filePathToTree(paths);
9
+ function useListCollection(props) {
10
+ const splittedProps = createMemo(() => {
11
+ const rawProps = typeof props === "function" ? props() : props;
12
+ return splitProps(rawProps, ["initialItems", "filter", "limit"]);
13
+ });
14
+ const init = () => {
15
+ const [localProps] = splittedProps();
16
+ return localProps.initialItems;
17
+ };
18
+ const [items, setItemsImpl] = createSignal(init());
19
+ const [filterText, setFilterText] = createSignal("");
20
+ const setItems = (newItems) => {
21
+ setItemsImpl(newItems);
22
+ setFilterText("");
23
+ };
24
+ const create = (itemsToCreate) => {
25
+ const [, collectionOptions] = splittedProps();
26
+ return createListCollection({ ...collectionOptions, items: itemsToCreate });
27
+ };
28
+ const collection = createMemo(() => {
29
+ const [localProps, collectionOptions] = splittedProps();
30
+ const filter = localProps.filter;
31
+ let activeItems = items();
32
+ if (filterText() && filter) {
33
+ activeItems = create(items()).filter((itemString, _index, item) => filter(itemString, filterText(), item)).items;
34
+ }
35
+ const limitedItems = localProps.limit == null ? activeItems : activeItems.slice(0, localProps.limit);
36
+ return createListCollection({ ...collectionOptions, items: limitedItems });
37
+ });
38
+ return {
39
+ collection,
40
+ filter: (inputValue = "") => {
41
+ setFilterText(inputValue);
42
+ },
43
+ set: (newItems) => {
44
+ setItems(newItems);
45
+ },
46
+ reset: () => {
47
+ const [localProps] = splittedProps();
48
+ setItems(localProps.initialItems);
49
+ },
50
+ clear: () => {
51
+ setItems([]);
52
+ },
53
+ insert: (index, ...itemsToInsert) => {
54
+ const newItems = create(items()).insert(index, ...itemsToInsert).items;
55
+ setItems(newItems);
56
+ },
57
+ insertBefore: (value, ...itemsToInsert) => {
58
+ const newItems = create(items()).insertBefore(value, ...itemsToInsert).items;
59
+ setItems(newItems);
60
+ },
61
+ insertAfter: (value, ...itemsToInsert) => {
62
+ const newItems = create(items()).insertAfter(value, ...itemsToInsert).items;
63
+ setItems(newItems);
64
+ },
65
+ remove: (...itemOrValues) => {
66
+ const newItems = create(items()).remove(...itemOrValues).items;
67
+ setItems(newItems);
68
+ },
69
+ move: (value, to) => {
70
+ const newItems = create(items()).move(value, to).items;
71
+ setItems(newItems);
72
+ },
73
+ moveBefore: (value, ...values) => {
74
+ const newItems = create(items()).moveBefore(value, ...values).items;
75
+ setItems(newItems);
76
+ },
77
+ moveAfter: (value, ...values) => {
78
+ const newItems = create(items()).moveAfter(value, ...values).items;
79
+ setItems(newItems);
80
+ },
81
+ reorder: (from, to) => {
82
+ const newItems = create(items()).reorder(from, to).items;
83
+ setItems(newItems);
84
+ },
85
+ append: (...itemsToAppend) => {
86
+ const newItems = create(items()).append(...itemsToAppend).items;
87
+ setItems(newItems);
88
+ },
89
+ upsert: (value, item, mode = "append") => {
90
+ const newItems = create(items()).upsert(value, item, mode).items;
91
+ setItems(newItems);
92
+ },
93
+ prepend: (...itemsToPrepend) => {
94
+ const newItems = create(items()).prepend(...itemsToPrepend).items;
95
+ setItems(newItems);
96
+ },
97
+ update: (value, item) => {
98
+ const newItems = create(items()).update(value, item).items;
99
+ setItems(newItems);
100
+ }
101
+ };
102
+ }
103
+
104
+ export { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useListCollection };
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./WC2HBDLJ.jsx";
6
+ } from "./H6ODLFPJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ark
15
15
  } from "./UFYZ7HLU.jsx";
16
- import {
17
- useEnvironmentContext
18
- } from "./E2L62MKC.jsx";
19
16
  import {
20
17
  useLocaleContext
21
18
  } from "./YUC6JE7K.jsx";
19
+ import {
20
+ useEnvironmentContext
21
+ } from "./E2L62MKC.jsx";
22
22
  import {
23
23
  createContext
24
24
  } from "./TVCIHLER.jsx";
@@ -1,9 +1,9 @@
1
- import { collapsible_exports } from './ROUJC6XC.js';
1
+ import { collapsible_exports } from './SGY2KGDL.js';
2
2
  import { splitRenderStrategyProps, RenderStrategyProvider, useRenderStrategyContext } from './QFAL6GWC.js';
3
3
  import { createSplitProps } from './ZMHI4GDJ.js';
4
4
  import { ark } from './EPLBB4QN.js';
5
- import { useEnvironmentContext } from './YO2MCGXO.js';
6
5
  import { useLocaleContext } from './OKZ64GSY.js';
6
+ import { useEnvironmentContext } from './YO2MCGXO.js';
7
7
  import { createContext } from './TROPIN4C.js';
8
8
  import { runIfFn } from './DT73WLR4.js';
9
9
  import { __export } from './ESLJRKWD.js';
@@ -1 +1 @@
1
- export { accordion_exports as Accordion, AccordionContext, AccordionItem, AccordionItemContent, AccordionItemContext, AccordionItemIndicator, AccordionItemTrigger, AccordionRoot, AccordionRootProvider, anatomy as accordionAnatomy, useAccordion, useAccordionContext, useAccordionItemContext } from '../../chunk/VL4J24YY.js';
1
+ export { accordion_exports as Accordion, AccordionContext, AccordionItem, AccordionItemContent, AccordionItemContext, AccordionItemIndicator, AccordionItemTrigger, AccordionRoot, AccordionRootProvider, anatomy as accordionAnatomy, useAccordion, useAccordionContext, useAccordionItemContext } from '../../chunk/NEP3K5KL.js';