@ark-ui/solid 5.16.0 → 5.17.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 (107) hide show
  1. package/dist/chunk/{AUVF4L3Q.jsx → 3WT7Q753.jsx} +10 -0
  2. package/dist/chunk/AQUEJK4Z.jsx +122 -0
  3. package/dist/chunk/{VL4J24YY.js → NEP3K5KL.js} +2 -2
  4. package/dist/chunk/XL4VFEPW.js +104 -0
  5. package/dist/chunk/{72JQEDEW.js → XZJYSF6N.js} +16 -2
  6. package/dist/chunk/{SWUMYWUU.js → ZLUEV2MH.js} +2 -2
  7. package/dist/components/accordion/index.js +1 -1
  8. package/dist/components/angle-slider/index.js +1 -1
  9. package/dist/components/avatar/index.js +1 -1
  10. package/dist/components/carousel/index.js +1 -1
  11. package/dist/components/checkbox/index.d.ts +16 -7
  12. package/dist/components/checkbox/index.js +1 -1
  13. package/dist/components/checkbox/index.jsx +3 -1
  14. package/dist/components/collapsible/index.js +1 -1
  15. package/dist/components/collection/index.d.ts +2 -2
  16. package/dist/components/collection/index.js +1 -1
  17. package/dist/components/collection/index.jsx +1 -1
  18. package/dist/components/color-picker/index.js +1 -1
  19. package/dist/components/combobox/index.d.ts +1 -1
  20. package/dist/components/combobox/index.js +2 -2
  21. package/dist/components/combobox/index.jsx +3 -3
  22. package/dist/components/date-picker/index.js +1 -1
  23. package/dist/components/dialog/index.js +1 -1
  24. package/dist/components/editable/index.js +1 -1
  25. package/dist/components/file-upload/index.d.ts +6 -3
  26. package/dist/components/file-upload/index.js +1 -1
  27. package/dist/components/floating-panel/index.js +1 -1
  28. package/dist/components/hover-card/index.js +1 -1
  29. package/dist/components/index.d.ts +3 -3
  30. package/dist/components/index.js +43 -43
  31. package/dist/components/index.jsx +341 -339
  32. package/dist/components/listbox/index.js +2 -2
  33. package/dist/components/listbox/index.jsx +1 -1
  34. package/dist/components/menu/index.js +1 -1
  35. package/dist/components/number-input/index.js +1 -1
  36. package/dist/components/pagination/index.js +1 -1
  37. package/dist/components/password-input/index.js +1 -1
  38. package/dist/components/pin-input/index.js +1 -1
  39. package/dist/components/popover/index.js +1 -1
  40. package/dist/components/progress/index.js +1 -1
  41. package/dist/components/qr-code/index.js +1 -1
  42. package/dist/components/radio-group/index.js +1 -1
  43. package/dist/components/rating-group/index.js +1 -1
  44. package/dist/components/segment-group/index.js +1 -1
  45. package/dist/components/select/index.d.ts +1 -1
  46. package/dist/components/select/index.js +2 -2
  47. package/dist/components/select/index.jsx +3 -3
  48. package/dist/components/signature-pad/index.js +1 -1
  49. package/dist/components/slider/index.js +1 -1
  50. package/dist/components/splitter/index.js +1 -1
  51. package/dist/components/steps/index.js +1 -1
  52. package/dist/components/switch/index.js +1 -1
  53. package/dist/components/tabs/index.js +1 -1
  54. package/dist/components/tags-input/index.js +1 -1
  55. package/dist/components/time-picker/index.js +1 -1
  56. package/dist/components/toast/index.js +1 -1
  57. package/dist/components/toggle-group/index.js +1 -1
  58. package/dist/components/tooltip/index.js +1 -1
  59. package/dist/components/tour/index.js +1 -1
  60. package/dist/components/tree-view/index.js +2 -2
  61. package/dist/components/tree-view/index.jsx +1 -1
  62. package/dist/index.d.ts +3 -3
  63. package/dist/index.js +44 -44
  64. package/dist/index.jsx +341 -339
  65. package/dist/providers/index.js +1 -1
  66. package/dist/use-list-collection-Dk2gVdQ2.d.ts +91 -0
  67. package/package.json +68 -68
  68. package/dist/chunk/FBAKX74S.js +0 -86
  69. package/dist/chunk/XEXZI6CD.jsx +0 -104
  70. package/dist/use-list-collection-FJyPsrh3.d.ts +0 -39
  71. package/dist/chunk/{DAORON6X.js → 25PYT2EL.js} +1 -1
  72. package/dist/chunk/{OF23HNNE.js → 4B42LT3B.js} +1 -1
  73. package/dist/chunk/{VQ3I3Z7G.js → 4B53AHD6.js} +1 -1
  74. package/dist/chunk/{I6UGYR2R.js → 4V2VMH2Z.js} +1 -1
  75. package/dist/chunk/{QKDU2AEK.js → 5UKLBKNF.js} +2 -2
  76. package/dist/chunk/{OEQFRTGI.js → 6ATAHZBX.js} +1 -1
  77. package/dist/chunk/{WI6PP4EF.js → 74W4D3KY.js} +1 -1
  78. package/dist/chunk/{NQSCRM4A.js → 7E5K2JFP.js} +1 -1
  79. package/dist/chunk/{OKT2RIHV.js → 7YHVIYNP.js} +1 -1
  80. package/dist/chunk/{AD6K3UTR.js → ASBQTDT2.js} +1 -1
  81. package/dist/chunk/{UK24ZAUL.js → CDA7SUTE.js} +1 -1
  82. package/dist/chunk/{MTVQZNY6.js → D65IYCJS.js} +1 -1
  83. package/dist/chunk/{2MXPLL4O.js → EJDY3MNV.js} +1 -1
  84. package/dist/chunk/{WZ75PULC.js → FQGMWBGA.js} +1 -1
  85. package/dist/chunk/{BOR6VUN5.js → GAB5O55Q.js} +1 -1
  86. package/dist/chunk/{LORIOKHL.js → HKFF76YQ.js} +1 -1
  87. package/dist/chunk/{RVCD7KQA.js → JBKKVPLG.js} +2 -2
  88. package/dist/chunk/{T7GUEJBF.js → JXJHXSF4.js} +1 -1
  89. package/dist/chunk/{364QFYBV.js → LNLL2OTD.js} +1 -1
  90. package/dist/chunk/{IWBBR7PD.js → N65DCNIH.js} +1 -1
  91. package/dist/chunk/{4HQIDBKB.js → O5A5KQPC.js} +1 -1
  92. package/dist/chunk/{HWMA3X7B.js → O6D2QF5I.js} +1 -1
  93. package/dist/chunk/{T4JGZ7KR.js → OA4CU2PL.js} +1 -1
  94. package/dist/chunk/{H5DXY5W4.js → OVFUGKNG.js} +1 -1
  95. package/dist/chunk/{6PUHRDVU.js → P5BHXVYK.js} +1 -1
  96. package/dist/chunk/{74TH35IC.js → P7WR6WX5.js} +1 -1
  97. package/dist/chunk/{FJ5JNMAY.js → QJQKZL6X.js} +1 -1
  98. package/dist/chunk/{OPAESICE.js → SFEMNN6F.js} +1 -1
  99. package/dist/chunk/{ROUJC6XC.js → SGY2KGDL.js} +1 -1
  100. package/dist/chunk/{5MOOYXRU.js → TBR4XVH2.js} +1 -1
  101. package/dist/chunk/{LDOGINY6.js → TECDLRTB.js} +1 -1
  102. package/dist/chunk/{DPP7XCXL.js → UAANHQJZ.js} +1 -1
  103. package/dist/chunk/{3IJ5QLEM.js → UU6XEYFI.js} +1 -1
  104. package/dist/chunk/{RVK7FAUI.js → VEV5HF3M.js} +1 -1
  105. package/dist/chunk/{LB3LJBHI.js → WTNRGPVN.js} +1 -1
  106. package/dist/chunk/{LRA73ZZJ.js → XQNGFJ2M.js} +1 -1
  107. package/dist/chunk/{KBANDL4M.js → ZRSPQAUK.js} +2 -2
@@ -1,2 +1,2 @@
1
- export { EnvironmentProvider, useEnvironmentContext } from '../chunk/YO2MCGXO.js';
2
1
  export { LocaleProvider, useFilter, useLocaleContext } from '../chunk/OKZ64GSY.js';
2
+ export { EnvironmentProvider, useEnvironmentContext } from '../chunk/YO2MCGXO.js';
@@ -0,0 +1,91 @@
1
+ import { M as MaybeAccessor } from './types-Bc0WfPsv.js';
2
+ import { CollectionOptions, ListCollection } from '@zag-js/collection';
3
+
4
+ interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>, 'items'> {
5
+ /**
6
+ * The initial items to display in the collection.
7
+ */
8
+ initialItems: T[];
9
+ /**
10
+ * The filter function to use to filter the items.
11
+ */
12
+ filter?: (itemText: string, filterText: string, item: T) => boolean;
13
+ /**
14
+ * The maximum number of items to display in the collection.
15
+ * Useful for performance when you have a large number of items.
16
+ */
17
+ limit?: number;
18
+ }
19
+ declare function useListCollection<T>(props: MaybeAccessor<UseListCollectionProps<T>>): UseListCollectionReturn<T>;
20
+ interface UseListCollectionReturn<T> {
21
+ /**
22
+ * The collection of items.
23
+ */
24
+ collection: () => ListCollection<T>;
25
+ /**
26
+ * The function to filter the items.
27
+ */
28
+ filter: (inputValue: string) => void;
29
+ /**
30
+ * The function to set the items.
31
+ */
32
+ set: (items: T[]) => void;
33
+ /**
34
+ * The function to reset the items.
35
+ */
36
+ reset: () => void;
37
+ /**
38
+ * The function to clear the items.
39
+ */
40
+ clear: () => void;
41
+ /**
42
+ * The function to insert items at a specific index.
43
+ */
44
+ insert: (index: number, ...items: T[]) => void;
45
+ /**
46
+ * The function to insert items before a specific value.
47
+ */
48
+ insertBefore: (value: string, ...items: T[]) => void;
49
+ /**
50
+ * The function to insert items after a specific value.
51
+ */
52
+ insertAfter: (value: string, ...items: T[]) => void;
53
+ /**
54
+ * The function to remove items.
55
+ */
56
+ remove: (...itemOrValues: Array<T | string>) => void;
57
+ /**
58
+ * The function to move an item to a specific index.
59
+ */
60
+ move: (value: string, to: number) => void;
61
+ /**
62
+ * The function to move an item before a specific value.
63
+ */
64
+ moveBefore: (value: string, ...values: string[]) => void;
65
+ /**
66
+ * The function to move an item after a specific value.
67
+ */
68
+ moveAfter: (value: string, ...values: string[]) => void;
69
+ /**
70
+ * The function to reorder items.
71
+ */
72
+ reorder: (from: number, to: number) => void;
73
+ /**
74
+ * The function to append items.
75
+ */
76
+ append: (...items: T[]) => void;
77
+ /**
78
+ * The function to upsert an item.
79
+ */
80
+ upsert: (value: string, item: T, mode?: 'append' | 'prepend') => void;
81
+ /**
82
+ * The function to prepend items.
83
+ */
84
+ prepend: (...items: T[]) => void;
85
+ /**
86
+ * The function to update an item.
87
+ */
88
+ update: (value: string, item: T) => void;
89
+ }
90
+
91
+ export { type UseListCollectionProps as U, type UseListCollectionReturn as a, useListCollection as u };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ark-ui/solid",
3
3
  "type": "module",
4
- "version": "5.16.0",
4
+ "version": "5.17.0",
5
5
  "description": "A collection of unstyled, accessible UI components for Solid, utilizing state machines for seamless interaction.",
6
6
  "keywords": [
7
7
  "accordion",
@@ -110,70 +110,71 @@
110
110
  "sideEffects": false,
111
111
  "dependencies": {
112
112
  "@internationalized/date": "3.8.2",
113
- "@zag-js/accordion": "1.18.0",
114
- "@zag-js/angle-slider": "1.18.0",
115
- "@zag-js/anatomy": "1.18.0",
116
- "@zag-js/auto-resize": "1.18.0",
117
- "@zag-js/avatar": "1.18.0",
118
- "@zag-js/carousel": "1.18.0",
119
- "@zag-js/checkbox": "1.18.0",
120
- "@zag-js/clipboard": "1.18.0",
121
- "@zag-js/collapsible": "1.18.0",
122
- "@zag-js/collection": "1.18.0",
123
- "@zag-js/color-picker": "1.18.0",
124
- "@zag-js/color-utils": "1.18.0",
125
- "@zag-js/combobox": "1.18.0",
126
- "@zag-js/core": "1.18.0",
127
- "@zag-js/date-picker": "1.18.0",
128
- "@zag-js/date-utils": "1.18.0",
129
- "@zag-js/dialog": "1.18.0",
130
- "@zag-js/dom-query": "1.18.0",
131
- "@zag-js/editable": "1.18.0",
132
- "@zag-js/file-upload": "1.18.0",
133
- "@zag-js/file-utils": "1.18.0",
134
- "@zag-js/focus-trap": "1.18.0",
135
- "@zag-js/floating-panel": "1.18.0",
136
- "@zag-js/highlight-word": "1.18.0",
137
- "@zag-js/hover-card": "1.18.0",
138
- "@zag-js/i18n-utils": "1.18.0",
139
- "@zag-js/listbox": "1.18.0",
140
- "@zag-js/menu": "1.18.0",
141
- "@zag-js/number-input": "1.18.0",
142
- "@zag-js/pagination": "1.18.0",
143
- "@zag-js/password-input": "1.18.0",
144
- "@zag-js/pin-input": "1.18.0",
145
- "@zag-js/popover": "1.18.0",
146
- "@zag-js/presence": "1.18.0",
147
- "@zag-js/progress": "1.18.0",
148
- "@zag-js/qr-code": "1.18.0",
149
- "@zag-js/radio-group": "1.18.0",
150
- "@zag-js/rating-group": "1.18.0",
151
- "@zag-js/select": "1.18.0",
152
- "@zag-js/signature-pad": "1.18.0",
153
- "@zag-js/slider": "1.18.0",
154
- "@zag-js/solid": "1.18.0",
155
- "@zag-js/splitter": "1.18.0",
156
- "@zag-js/steps": "1.18.0",
157
- "@zag-js/switch": "1.18.0",
158
- "@zag-js/tabs": "1.18.0",
159
- "@zag-js/tags-input": "1.18.0",
160
- "@zag-js/time-picker": "1.18.0",
161
- "@zag-js/timer": "1.18.0",
162
- "@zag-js/toast": "1.18.0",
163
- "@zag-js/toggle": "1.18.0",
164
- "@zag-js/toggle-group": "1.18.0",
165
- "@zag-js/tooltip": "1.18.0",
166
- "@zag-js/tour": "1.18.0",
167
- "@zag-js/tree-view": "1.18.0",
168
- "@zag-js/types": "1.18.0",
169
- "@zag-js/utils": "1.18.0"
113
+ "@zag-js/accordion": "1.18.4",
114
+ "@zag-js/angle-slider": "1.18.4",
115
+ "@zag-js/anatomy": "1.18.4",
116
+ "@zag-js/auto-resize": "1.18.4",
117
+ "@zag-js/avatar": "1.18.4",
118
+ "@zag-js/carousel": "1.18.4",
119
+ "@zag-js/checkbox": "1.18.4",
120
+ "@zag-js/clipboard": "1.18.4",
121
+ "@zag-js/collapsible": "1.18.4",
122
+ "@zag-js/collection": "1.18.4",
123
+ "@zag-js/color-picker": "1.18.4",
124
+ "@zag-js/color-utils": "1.18.4",
125
+ "@zag-js/combobox": "1.18.4",
126
+ "@zag-js/core": "1.18.4",
127
+ "@zag-js/date-picker": "1.18.4",
128
+ "@zag-js/date-utils": "1.18.4",
129
+ "@zag-js/dialog": "1.18.4",
130
+ "@zag-js/dom-query": "1.18.4",
131
+ "@zag-js/editable": "1.18.4",
132
+ "@zag-js/file-upload": "1.18.4",
133
+ "@zag-js/file-utils": "1.18.4",
134
+ "@zag-js/focus-trap": "1.18.4",
135
+ "@zag-js/floating-panel": "1.18.4",
136
+ "@zag-js/highlight-word": "1.18.4",
137
+ "@zag-js/hover-card": "1.18.4",
138
+ "@zag-js/i18n-utils": "1.18.4",
139
+ "@zag-js/listbox": "1.18.4",
140
+ "@zag-js/menu": "1.18.4",
141
+ "@zag-js/number-input": "1.18.4",
142
+ "@zag-js/pagination": "1.18.4",
143
+ "@zag-js/password-input": "1.18.4",
144
+ "@zag-js/pin-input": "1.18.4",
145
+ "@zag-js/popover": "1.18.4",
146
+ "@zag-js/presence": "1.18.4",
147
+ "@zag-js/progress": "1.18.4",
148
+ "@zag-js/qr-code": "1.18.4",
149
+ "@zag-js/radio-group": "1.18.4",
150
+ "@zag-js/rating-group": "1.18.4",
151
+ "@zag-js/select": "1.18.4",
152
+ "@zag-js/signature-pad": "1.18.4",
153
+ "@zag-js/slider": "1.18.4",
154
+ "@zag-js/solid": "1.18.4",
155
+ "@zag-js/splitter": "1.18.4",
156
+ "@zag-js/steps": "1.18.4",
157
+ "@zag-js/switch": "1.18.4",
158
+ "@zag-js/tabs": "1.18.4",
159
+ "@zag-js/tags-input": "1.18.4",
160
+ "@zag-js/time-picker": "1.18.4",
161
+ "@zag-js/timer": "1.18.4",
162
+ "@zag-js/toast": "1.18.4",
163
+ "@zag-js/toggle": "1.18.4",
164
+ "@zag-js/toggle-group": "1.18.4",
165
+ "@zag-js/tooltip": "1.18.4",
166
+ "@zag-js/tour": "1.18.4",
167
+ "@zag-js/tree-view": "1.18.4",
168
+ "@zag-js/types": "1.18.4",
169
+ "@zag-js/utils": "1.18.4"
170
170
  },
171
171
  "devDependencies": {
172
172
  "@biomejs/biome": "1.9.4",
173
173
  "@modular-forms/solid": "0.25.1",
174
174
  "@solidjs/testing-library": "0.8.10",
175
- "@storybook/addon-a11y": "9.0.10",
176
- "@storybook/addon-links": "9.0.10",
175
+ "@storybook/addon-a11y": "9.0.17",
176
+ "@storybook/addon-links": "9.0.17",
177
+ "@storybook/addon-vitest": "9.0.17",
177
178
  "@testing-library/dom": "10.4.0",
178
179
  "@testing-library/jest-dom": "6.6.3",
179
180
  "@testing-library/user-event": "14.6.1",
@@ -182,18 +183,17 @@
182
183
  "esbuild-plugin-solid": "0.6.0",
183
184
  "globby": "14.1.0",
184
185
  "jsdom": "26.1.0",
185
- "lucide-solid": "0.515.0",
186
+ "lucide-solid": "0.525.0",
186
187
  "resize-observer-polyfill": "1.5.1",
187
188
  "solid-js": "1.9.7",
188
- "storybook": "9.0.10",
189
- "storybook-solidjs": "1.0.0-beta.6",
190
- "storybook-solidjs-vite": "1.0.0-beta.6",
189
+ "storybook": "9.0.17",
190
+ "storybook-solidjs-vite": "9.0.2",
191
191
  "tsup": "8.5.0",
192
192
  "typescript": "5.8.3",
193
- "vite": "6.3.5",
194
- "vite-plugin-solid": "2.11.6",
195
- "vitest": "3.2.3",
196
- "@vitest/coverage-v8": "3.2.3",
193
+ "vite": "7.0.5",
194
+ "vite-plugin-solid": "2.11.7",
195
+ "vitest": "3.2.4",
196
+ "@vitest/coverage-v8": "3.2.4",
197
197
  "vitest-axe": "1.0.0-pre.5"
198
198
  },
199
199
  "peerDependencies": {
@@ -1,86 +0,0 @@
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 create = (items) => {
15
- const [, collectionProps] = splittedProps();
16
- return createListCollection({ ...collectionProps, items });
17
- };
18
- const init = () => {
19
- const [localProps] = splittedProps();
20
- return create(
21
- localProps.limit != null ? localProps.initialItems.slice(0, localProps.limit) : localProps.initialItems
22
- );
23
- };
24
- const [collection, setCollectionImpl] = createSignal(init());
25
- const setCollection = (collection2) => {
26
- const [localProps] = splittedProps();
27
- setCollectionImpl(
28
- localProps.limit == null ? collection2 : collection2.copy(collection2.items.slice(0, localProps.limit))
29
- );
30
- };
31
- return {
32
- collection,
33
- filter: (inputValue) => {
34
- const [localProps] = splittedProps();
35
- const filter = localProps.filter;
36
- if (!filter) return;
37
- const filtered = create(localProps.initialItems).filter((itemString) => filter(itemString, inputValue));
38
- setCollection(filtered);
39
- },
40
- set: (items) => {
41
- setCollection(create(items));
42
- },
43
- reset: () => {
44
- const [localProps] = splittedProps();
45
- setCollection(create(localProps.initialItems));
46
- },
47
- clear: () => {
48
- setCollection(create([]));
49
- },
50
- insert: (index, ...items) => {
51
- setCollection(collection().insert(index, ...items));
52
- },
53
- insertBefore: (value, ...items) => {
54
- setCollection(collection().insertBefore(value, ...items));
55
- },
56
- insertAfter: (value, ...items) => {
57
- setCollection(collection().insertAfter(value, ...items));
58
- },
59
- remove: (...itemOrValues) => {
60
- setCollection(collection().remove(...itemOrValues));
61
- },
62
- move: (value, to) => {
63
- setCollection(collection().move(value, to));
64
- },
65
- moveBefore: (value, ...values) => {
66
- setCollection(collection().moveBefore(value, ...values));
67
- },
68
- moveAfter: (value, ...values) => {
69
- setCollection(collection().moveAfter(value, ...values));
70
- },
71
- reorder: (from, to) => {
72
- setCollection(collection().reorder(from, to));
73
- },
74
- append: (...items) => {
75
- setCollection(collection().append(...items));
76
- },
77
- prepend: (...items) => {
78
- setCollection(collection().prepend(...items));
79
- },
80
- update: (value, item) => {
81
- setCollection(collection().update(value, item));
82
- }
83
- };
84
- }
85
-
86
- export { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useListCollection };
@@ -1,104 +0,0 @@
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 create = (items) => {
27
- const [, collectionProps] = splittedProps();
28
- return createListCollection({ ...collectionProps, items });
29
- };
30
- const init = () => {
31
- const [localProps] = splittedProps();
32
- return create(
33
- localProps.limit != null ? localProps.initialItems.slice(0, localProps.limit) : localProps.initialItems
34
- );
35
- };
36
- const [collection, setCollectionImpl] = createSignal(init());
37
- const setCollection = (collection2) => {
38
- const [localProps] = splittedProps();
39
- setCollectionImpl(
40
- localProps.limit == null ? collection2 : collection2.copy(collection2.items.slice(0, localProps.limit))
41
- );
42
- };
43
- return {
44
- collection,
45
- filter: (inputValue) => {
46
- const [localProps] = splittedProps();
47
- const filter = localProps.filter;
48
- if (!filter) return;
49
- const filtered = create(localProps.initialItems).filter((itemString) => filter(itemString, inputValue));
50
- setCollection(filtered);
51
- },
52
- set: (items) => {
53
- setCollection(create(items));
54
- },
55
- reset: () => {
56
- const [localProps] = splittedProps();
57
- setCollection(create(localProps.initialItems));
58
- },
59
- clear: () => {
60
- setCollection(create([]));
61
- },
62
- insert: (index, ...items) => {
63
- setCollection(collection().insert(index, ...items));
64
- },
65
- insertBefore: (value, ...items) => {
66
- setCollection(collection().insertBefore(value, ...items));
67
- },
68
- insertAfter: (value, ...items) => {
69
- setCollection(collection().insertAfter(value, ...items));
70
- },
71
- remove: (...itemOrValues) => {
72
- setCollection(collection().remove(...itemOrValues));
73
- },
74
- move: (value, to) => {
75
- setCollection(collection().move(value, to));
76
- },
77
- moveBefore: (value, ...values) => {
78
- setCollection(collection().moveBefore(value, ...values));
79
- },
80
- moveAfter: (value, ...values) => {
81
- setCollection(collection().moveAfter(value, ...values));
82
- },
83
- reorder: (from, to) => {
84
- setCollection(collection().reorder(from, to));
85
- },
86
- append: (...items) => {
87
- setCollection(collection().append(...items));
88
- },
89
- prepend: (...items) => {
90
- setCollection(collection().prepend(...items));
91
- },
92
- update: (value, item) => {
93
- setCollection(collection().update(value, item));
94
- }
95
- };
96
- }
97
-
98
- export {
99
- createGridCollection,
100
- createListCollection,
101
- createTreeCollection,
102
- createFileTreeCollection,
103
- useListCollection
104
- };
@@ -1,39 +0,0 @@
1
- import * as solid_js from 'solid-js';
2
- import { M as MaybeAccessor } from './types-Bc0WfPsv.js';
3
- import { CollectionOptions, ListCollection } from '@zag-js/collection';
4
-
5
- interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>, 'items'> {
6
- /**
7
- * The initial items to display in the collection.
8
- */
9
- initialItems: T[];
10
- /**
11
- * The filter function to use to filter the items.
12
- */
13
- filter?: (itemText: string, filterText: string) => boolean;
14
- /**
15
- * The maximum number of items to display in the collection.
16
- * Useful for performance when you have a large number of items.
17
- */
18
- limit?: number;
19
- }
20
- declare function useListCollection<T>(props: MaybeAccessor<UseListCollectionProps<T>>): {
21
- collection: solid_js.Accessor<ListCollection<T>>;
22
- filter: (inputValue: string) => void;
23
- set: (items: T[]) => void;
24
- reset: () => void;
25
- clear: () => void;
26
- insert: (index: number, ...items: T[]) => void;
27
- insertBefore: (value: string, ...items: T[]) => void;
28
- insertAfter: (value: string, ...items: T[]) => void;
29
- remove: (...itemOrValues: T[]) => void;
30
- move: (value: string, to: number) => void;
31
- moveBefore: (value: string, ...values: string[]) => void;
32
- moveAfter: (value: string, ...values: string[]) => void;
33
- reorder: (from: number, to: number) => void;
34
- append: (...items: T[]) => void;
35
- prepend: (...items: T[]) => void;
36
- update: (value: string, item: T) => void;
37
- };
38
-
39
- export { type UseListCollectionProps as U, useListCollection as u };
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';
@@ -3,8 +3,8 @@ import { composeRefs } from './XN6EERRM.js';
3
3
  import { splitRenderStrategyProps, RenderStrategyProvider, useRenderStrategyContext } from './QFAL6GWC.js';
4
4
  import { createSplitProps } from './ZMHI4GDJ.js';
5
5
  import { ark } from './EPLBB4QN.js';
6
- import { useEnvironmentContext } from './YO2MCGXO.js';
7
6
  import { useLocaleContext } from './OKZ64GSY.js';
7
+ import { useEnvironmentContext } from './YO2MCGXO.js';
8
8
  import { createContext } from './TROPIN4C.js';
9
9
  import { runIfFn } from './DT73WLR4.js';
10
10
  import { __export } from './ESLJRKWD.js';
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';
@@ -1,10 +1,10 @@
1
- import { splitPresenceProps, usePresence, PresenceProvider, usePresenceContext } from './7S3N5UQH.js';
2
1
  import { useFieldContext } from './NC7W2KIE.js';
2
+ import { splitPresenceProps, usePresence, PresenceProvider, usePresenceContext } from './7S3N5UQH.js';
3
3
  import { composeRefs } from './XN6EERRM.js';
4
4
  import { createSplitProps } from './ZMHI4GDJ.js';
5
5
  import { ark } from './EPLBB4QN.js';
6
- import { useEnvironmentContext } from './YO2MCGXO.js';
7
6
  import { useLocaleContext } from './OKZ64GSY.js';
7
+ import { useEnvironmentContext } from './YO2MCGXO.js';
8
8
  import { createContext } from './TROPIN4C.js';
9
9
  import { runIfFn } from './DT73WLR4.js';
10
10
  import { __export } from './ESLJRKWD.js';
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';
@@ -1,8 +1,8 @@
1
1
  import { useFieldContext } from './NC7W2KIE.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './YO2MCGXO.js';
5
4
  import { useLocaleContext } from './OKZ64GSY.js';
5
+ import { useEnvironmentContext } from './YO2MCGXO.js';
6
6
  import { createContext } from './TROPIN4C.js';
7
7
  import { runIfFn } from './DT73WLR4.js';
8
8
  import { __export } from './ESLJRKWD.js';
@@ -1,8 +1,8 @@
1
1
  import { useFieldContext } from './NC7W2KIE.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './YO2MCGXO.js';
5
4
  import { useLocaleContext } from './OKZ64GSY.js';
5
+ import { useEnvironmentContext } from './YO2MCGXO.js';
6
6
  import { createContext } from './TROPIN4C.js';
7
7
  import { runIfFn } from './DT73WLR4.js';
8
8
  import { __export } from './ESLJRKWD.js';
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';
@@ -3,8 +3,8 @@ import { composeRefs } from './XN6EERRM.js';
3
3
  import { splitRenderStrategyProps, RenderStrategyProvider, useRenderStrategyContext } from './QFAL6GWC.js';
4
4
  import { createSplitProps } from './ZMHI4GDJ.js';
5
5
  import { ark } from './EPLBB4QN.js';
6
- import { useEnvironmentContext } from './YO2MCGXO.js';
7
6
  import { useLocaleContext } from './OKZ64GSY.js';
7
+ import { useEnvironmentContext } from './YO2MCGXO.js';
8
8
  import { createContext } from './TROPIN4C.js';
9
9
  import { runIfFn } from './DT73WLR4.js';
10
10
  import { __export } from './ESLJRKWD.js';
@@ -1,8 +1,8 @@
1
1
  import { useFieldContext } from './NC7W2KIE.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './YO2MCGXO.js';
5
4
  import { useLocaleContext } from './OKZ64GSY.js';
5
+ import { useEnvironmentContext } from './YO2MCGXO.js';
6
6
  import { createContext } from './TROPIN4C.js';
7
7
  import { runIfFn } from './DT73WLR4.js';
8
8
  import { __export } from './ESLJRKWD.js';
@@ -1,8 +1,8 @@
1
1
  import { useFieldContext } from './NC7W2KIE.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './YO2MCGXO.js';
5
4
  import { useLocaleContext } from './OKZ64GSY.js';
5
+ import { useEnvironmentContext } from './YO2MCGXO.js';
6
6
  import { createContext } from './TROPIN4C.js';
7
7
  import { runIfFn } from './DT73WLR4.js';
8
8
  import { __export } from './ESLJRKWD.js';
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';
@@ -1,8 +1,8 @@
1
1
  import { useFieldContext } from './NC7W2KIE.js';
2
2
  import { createSplitProps } from './ZMHI4GDJ.js';
3
3
  import { ark } from './EPLBB4QN.js';
4
- import { useEnvironmentContext } from './YO2MCGXO.js';
5
4
  import { useLocaleContext } from './OKZ64GSY.js';
5
+ import { useEnvironmentContext } from './YO2MCGXO.js';
6
6
  import { createContext } from './TROPIN4C.js';
7
7
  import { runIfFn } from './DT73WLR4.js';
8
8
  import { __export } from './ESLJRKWD.js';
@@ -1,7 +1,7 @@
1
1
  import { createSplitProps } from './ZMHI4GDJ.js';
2
2
  import { ark } from './EPLBB4QN.js';
3
- import { useEnvironmentContext } from './YO2MCGXO.js';
4
3
  import { useLocaleContext } from './OKZ64GSY.js';
4
+ import { useEnvironmentContext } from './YO2MCGXO.js';
5
5
  import { createContext } from './TROPIN4C.js';
6
6
  import { runIfFn } from './DT73WLR4.js';
7
7
  import { __export } from './ESLJRKWD.js';