@ark-ui/solid 5.16.1 → 5.18.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 (78) hide show
  1. package/dist/chunk/{KIDL2HC3.jsx → 4L4266PL.jsx} +4 -4
  2. package/dist/chunk/{WBYGZCTU.jsx → 6XAZQVOY.jsx} +4 -4
  3. package/dist/chunk/7HON4OS6.js +217 -0
  4. package/dist/chunk/{EIA3BZ33.jsx → 7OXBQSIZ.jsx} +4 -4
  5. package/dist/chunk/{FC67EFPW.jsx → D2MI7N5P.jsx} +1 -1
  6. package/dist/chunk/{5PKZLVXE.jsx → DLZTFD37.jsx} +4 -4
  7. package/dist/chunk/{JPJUQ5CI.jsx → H4MJ4254.jsx} +1 -1
  8. package/dist/chunk/{P7WR6WX5.js → HJFJPRY5.js} +1 -1
  9. package/dist/chunk/{FQGMWBGA.js → HSBJVWHB.js} +1 -1
  10. package/dist/chunk/{KNVMVQG6.jsx → L22RABDV.jsx} +10 -0
  11. package/dist/chunk/{ACABJNIJ.jsx → L5XYJCAK.jsx} +1 -1
  12. package/dist/chunk/{KJ353BY6.jsx → LBI4ZRKN.jsx} +2 -0
  13. package/dist/chunk/{4T2T3PMU.jsx → UYFUB47A.jsx} +2 -0
  14. package/dist/chunk/{FRSNRGQK.jsx → VXQNQSLM.jsx} +4 -4
  15. package/dist/chunk/{ZB7AEDAJ.jsx → XENPQFEN.jsx} +1 -1
  16. package/dist/chunk/XFW6RT6G.js +321 -0
  17. package/dist/chunk/{C46RVY7A.jsx → XOIHVYJ7.jsx} +4 -4
  18. package/dist/chunk/{L4PQJRRA.js → XZJYSF6N.js} +15 -1
  19. package/dist/chunk/{G3JCG6HD.jsx → Y2LC36B4.jsx} +1 -1
  20. package/dist/chunk/{BBWRZLB6.jsx → YJX4W6VT.jsx} +1 -1
  21. package/dist/chunk/{NVETRSKA.jsx → YM35RFYG.jsx} +1 -1
  22. package/dist/chunk/YRHUWQ7U.jsx +237 -0
  23. package/dist/chunk/ZHSHZ7SJ.jsx +240 -0
  24. package/dist/components/checkbox/index.d.ts +17 -8
  25. package/dist/components/checkbox/index.js +1 -1
  26. package/dist/components/checkbox/index.jsx +3 -1
  27. package/dist/components/collection/index.d.ts +106 -4
  28. package/dist/components/collection/index.js +1 -1
  29. package/dist/components/collection/index.jsx +5 -3
  30. package/dist/components/color-picker/index.d.ts +1 -1
  31. package/dist/components/color-picker/index.jsx +3 -3
  32. package/dist/components/combobox/index.d.ts +1 -1
  33. package/dist/components/combobox/index.js +1 -1
  34. package/dist/components/combobox/index.jsx +6 -6
  35. package/dist/components/date-picker/index.d.ts +1 -1
  36. package/dist/components/date-picker/index.jsx +3 -3
  37. package/dist/components/dialog/index.jsx +3 -3
  38. package/dist/components/field/index.d.ts +1 -1
  39. package/dist/components/fieldset/index.d.ts +1 -1
  40. package/dist/components/file-upload/index.d.ts +6 -3
  41. package/dist/components/file-upload/index.js +1 -1
  42. package/dist/components/file-upload/index.jsx +1 -1
  43. package/dist/components/floating-panel/index.jsx +3 -3
  44. package/dist/components/hover-card/index.jsx +3 -3
  45. package/dist/components/index.d.ts +7 -4
  46. package/dist/components/index.js +26 -25
  47. package/dist/components/index.jsx +416 -402
  48. package/dist/components/json-tree-view/index.d.ts +69 -0
  49. package/dist/components/json-tree-view/index.js +1 -0
  50. package/dist/components/json-tree-view/index.jsx +26 -0
  51. package/dist/components/listbox/index.js +1 -1
  52. package/dist/components/listbox/index.jsx +1 -1
  53. package/dist/components/menu/index.jsx +3 -3
  54. package/dist/components/popover/index.jsx +3 -3
  55. package/dist/components/presence/index.jsx +2 -2
  56. package/dist/components/select/index.d.ts +1 -1
  57. package/dist/components/select/index.js +1 -1
  58. package/dist/components/select/index.jsx +6 -6
  59. package/dist/components/signature-pad/index.js +1 -1
  60. package/dist/components/signature-pad/index.jsx +1 -1
  61. package/dist/components/tabs/index.jsx +3 -3
  62. package/dist/components/time-picker/index.jsx +3 -3
  63. package/dist/components/tooltip/index.jsx +3 -3
  64. package/dist/components/tour/index.jsx +3 -3
  65. package/dist/components/tree-view/index.d.ts +9 -39
  66. package/dist/components/tree-view/index.js +1 -1
  67. package/dist/components/tree-view/index.jsx +1 -1
  68. package/dist/index.d.ts +8 -5
  69. package/dist/index.js +26 -25
  70. package/dist/index.jsx +416 -402
  71. package/dist/tree-view-tree-CbBeWSwi.d.ts +41 -0
  72. package/dist/{use-list-collection-C2rvMTSM.d.ts → use-list-collection-Dk2gVdQ2.d.ts} +1 -1
  73. package/package.json +65 -64
  74. package/dist/chunk/AQUEJK4Z.jsx +0 -122
  75. package/dist/chunk/XL4VFEPW.js +0 -104
  76. package/dist/chunk/{BJ3QT4LE.jsx → H7TJLB3R.jsx} +0 -0
  77. package/dist/chunk/{QBN5FEQF.js → NWXJCBMN.js} +0 -0
  78. package/dist/chunk/{H6ODLFPJ.jsx → WC2HBDLJ.jsx} +3 -3
@@ -3,15 +3,15 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
6
+ } from "./WC2HBDLJ.jsx";
7
+ import {
8
+ composeRefs
9
+ } from "./DOBZPYAN.jsx";
7
10
  import {
8
11
  RenderStrategyProvider,
9
12
  splitRenderStrategyProps,
10
13
  useRenderStrategyContext
11
14
  } from "./NEBB7COJ.jsx";
12
- import {
13
- composeRefs
14
- } from "./DOBZPYAN.jsx";
15
15
  import {
16
16
  createSplitProps
17
17
  } from "./6WEDGJKQ.jsx";
@@ -1,12 +1,12 @@
1
+ import {
2
+ useFieldContext
3
+ } from "./HQOIDGRU.jsx";
1
4
  import {
2
5
  PresenceProvider,
3
6
  splitPresenceProps,
4
7
  usePresence,
5
8
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
7
- import {
8
- useFieldContext
9
- } from "./HQOIDGRU.jsx";
9
+ } from "./WC2HBDLJ.jsx";
10
10
  import {
11
11
  composeRefs
12
12
  } from "./DOBZPYAN.jsx";
@@ -0,0 +1,217 @@
1
+ import { GridCollection, ListCollection, TreeCollection, filePathToTree, Selection } from '@zag-js/collection';
2
+ import { createMemo, splitProps, createSignal, createEffect, on } 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
+ function useListSelection(props) {
104
+ const splittedProps = createMemo(() => {
105
+ const rawProps = typeof props === "function" ? props() : props;
106
+ return splitProps(rawProps, [
107
+ "collection",
108
+ "selectionMode",
109
+ "deselectable",
110
+ "initialSelectedValues",
111
+ "resetOnCollectionChange"
112
+ ]);
113
+ });
114
+ const createSelection = (values = []) => {
115
+ const [localProps] = splittedProps();
116
+ const selection2 = new Selection(values);
117
+ selection2.selectionMode = localProps.selectionMode ?? "single";
118
+ selection2.deselectable = localProps.deselectable ?? true;
119
+ return selection2;
120
+ };
121
+ const init = () => {
122
+ const [localProps] = splittedProps();
123
+ return createSelection(localProps.initialSelectedValues ?? []);
124
+ };
125
+ const [selection, setSelection] = createSignal(init());
126
+ const watchDeps = () => {
127
+ const [{ collection, resetOnCollectionChange }] = splittedProps();
128
+ return [collection.getValues(), resetOnCollectionChange];
129
+ };
130
+ createEffect(
131
+ on(
132
+ watchDeps,
133
+ ([, resetOnCollectionChange]) => {
134
+ if (resetOnCollectionChange) {
135
+ setSelection(createSelection());
136
+ }
137
+ },
138
+ { defer: true }
139
+ )
140
+ );
141
+ const selectedValues = createMemo(() => Array.from(selection()));
142
+ const isEmpty = createMemo(() => selection().isEmpty());
143
+ const firstSelectedValue = createMemo(() => {
144
+ const [localProps] = splittedProps();
145
+ return selection().firstSelectedValue(localProps.collection);
146
+ });
147
+ const lastSelectedValue = createMemo(() => {
148
+ const [localProps] = splittedProps();
149
+ return selection().lastSelectedValue(localProps.collection);
150
+ });
151
+ return {
152
+ selectedValues,
153
+ isEmpty,
154
+ firstSelectedValue,
155
+ lastSelectedValue,
156
+ isSelected: (value) => {
157
+ return selection().isSelected(value);
158
+ },
159
+ isAllSelected: () => {
160
+ const [localProps] = splittedProps();
161
+ const allValues = localProps.collection.getValues();
162
+ return allValues.length > 0 && allValues.every((value) => selection().isSelected(value));
163
+ },
164
+ isSomeSelected: () => {
165
+ const [localProps] = splittedProps();
166
+ const allValues = localProps.collection.getValues();
167
+ return allValues.some((value) => selection().isSelected(value));
168
+ },
169
+ canSelect: (value) => {
170
+ const [localProps] = splittedProps();
171
+ return selection().canSelect(localProps.collection, value);
172
+ },
173
+ select: (value, forceToggle) => {
174
+ const [localProps] = splittedProps();
175
+ setSelection(selection().select(localProps.collection, value, forceToggle));
176
+ },
177
+ deselect: (value) => {
178
+ setSelection(selection().deselect(value));
179
+ },
180
+ toggle: (value) => {
181
+ const [localProps] = splittedProps();
182
+ setSelection(selection().toggleSelection(localProps.collection, value));
183
+ },
184
+ replace: (value) => {
185
+ const [localProps] = splittedProps();
186
+ setSelection(selection().replaceSelection(localProps.collection, value));
187
+ },
188
+ extend: (anchorValue, targetValue) => {
189
+ const [localProps] = splittedProps();
190
+ setSelection(selection().extendSelection(localProps.collection, anchorValue, targetValue));
191
+ },
192
+ setSelectedValues: (values) => {
193
+ setSelection(selection().setSelection(values));
194
+ },
195
+ clear: () => {
196
+ setSelection(selection().clearSelection());
197
+ },
198
+ resetSelection: () => {
199
+ setSelection(createSelection());
200
+ },
201
+ setSelection: (newSelection) => {
202
+ setSelection(selection().setSelection(newSelection));
203
+ },
204
+ setSelectionMode: (mode) => {
205
+ const newSelection = selection().copy();
206
+ newSelection.selectionMode = mode;
207
+ setSelection(newSelection);
208
+ },
209
+ setDeselectable: (deselectable) => {
210
+ const newSelection = selection().copy();
211
+ newSelection.deselectable = deselectable;
212
+ setSelection(newSelection);
213
+ }
214
+ };
215
+ }
216
+
217
+ export { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useListCollection, useListSelection };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  PresenceProvider,
3
3
  usePresence
4
- } from "./H6ODLFPJ.jsx";
4
+ } from "./WC2HBDLJ.jsx";
5
+ import {
6
+ composeRefs
7
+ } from "./DOBZPYAN.jsx";
5
8
  import {
6
9
  RenderStrategyProvider,
7
10
  splitRenderStrategyProps,
8
11
  useRenderStrategyContext
9
12
  } from "./NEBB7COJ.jsx";
10
- import {
11
- composeRefs
12
- } from "./DOBZPYAN.jsx";
13
13
  import {
14
14
  createSplitProps
15
15
  } from "./6WEDGJKQ.jsx";
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
6
+ } from "./WC2HBDLJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -1,12 +1,12 @@
1
+ import {
2
+ useFieldContext
3
+ } from "./HQOIDGRU.jsx";
1
4
  import {
2
5
  PresenceProvider,
3
6
  splitPresenceProps,
4
7
  usePresence,
5
8
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
7
- import {
8
- useFieldContext
9
- } from "./HQOIDGRU.jsx";
9
+ } from "./WC2HBDLJ.jsx";
10
10
  import {
11
11
  composeRefs
12
12
  } from "./DOBZPYAN.jsx";
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
6
+ } from "./WC2HBDLJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";
@@ -77,7 +77,7 @@ var useSignaturePad = (props) => {
77
77
 
78
78
  // src/components/signature-pad/signature-pad-root.tsx
79
79
  var SignaturePadRoot = (props) => {
80
- const [useSignaturePadProps, localProps] = createSplitProps()(props, ["id", "ids", "drawing", "disabled", "readOnly", "name", "onDraw", "onDrawEnd", "readOnly", "required", "translations"]);
80
+ const [useSignaturePadProps, localProps] = createSplitProps()(props, ["id", "ids", "defaultPaths", "drawing", "disabled", "readOnly", "name", "onDraw", "onDrawEnd", "paths", "readOnly", "required", "translations"]);
81
81
  const signaturePad2 = useSignaturePad(useSignaturePadProps);
82
82
  const mergedProps = mergeProps(() => signaturePad2().getRootProps(), localProps);
83
83
  return createComponent(SignaturePadProvider, {
@@ -151,7 +151,7 @@ var useFileUpload = (props) => {
151
151
 
152
152
  // src/components/file-upload/file-upload-root.tsx
153
153
  var FileUploadRoot = (props) => {
154
- const [fileUploadProps, localProps] = createSplitProps()(props, ["accept", "allowDrop", "capture", "directory", "disabled", "id", "ids", "invalid", "locale", "maxFiles", "maxFileSize", "minFileSize", "name", "onFileAccept", "onFileChange", "onFileReject", "preventDocumentDrop", "required", "translations", "transformFiles", "validate"]);
154
+ const [fileUploadProps, localProps] = createSplitProps()(props, ["accept", "acceptedFiles", "allowDrop", "capture", "defaultAcceptedFiles", "directory", "disabled", "id", "ids", "invalid", "locale", "maxFiles", "maxFileSize", "minFileSize", "name", "onFileAccept", "onFileChange", "onFileReject", "preventDocumentDrop", "required", "translations", "transformFiles", "validate"]);
155
155
  const fileUpload2 = useFileUpload(fileUploadProps);
156
156
  const mergedProps = mergeProps(() => fileUpload2().getRootProps(), localProps);
157
157
  return createComponent(FileUploadProvider, {
@@ -143,6 +143,14 @@ var CheckboxGroup = (props) => {
143
143
  </CheckboxGroupContextProvider>;
144
144
  };
145
145
 
146
+ // src/components/checkbox/checkbox-group-provider.tsx
147
+ var CheckboxGroupProvider = (props) => {
148
+ const [localProps, restProps] = createSplitProps()(props, ["value"]);
149
+ return <CheckboxGroupContextProvider value={localProps.value}>
150
+ <ark.div role="group" {...restProps} {...checkboxAnatomy.build().group.attrs} />
151
+ </CheckboxGroupContextProvider>;
152
+ };
153
+
146
154
  // src/components/checkbox/checkbox-hidden-input.tsx
147
155
  import { mergeProps as mergeProps2 } from "@zag-js/solid";
148
156
  var CheckboxHiddenInput = (props) => {
@@ -246,6 +254,7 @@ __export(checkbox_exports, {
246
254
  Context: () => CheckboxContext,
247
255
  Control: () => CheckboxControl,
248
256
  Group: () => CheckboxGroup,
257
+ GroupProvider: () => CheckboxGroupProvider,
249
258
  HiddenInput: () => CheckboxHiddenInput,
250
259
  Indicator: () => CheckboxIndicator,
251
260
  Label: () => CheckboxLabel,
@@ -261,6 +270,7 @@ export {
261
270
  useCheckboxGroup,
262
271
  useCheckboxGroupContext,
263
272
  CheckboxGroup,
273
+ CheckboxGroupProvider,
264
274
  CheckboxHiddenInput,
265
275
  CheckboxIndicator,
266
276
  CheckboxLabel,
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
6
+ } from "./WC2HBDLJ.jsx";
7
7
  import {
8
8
  createSplitProps
9
9
  } from "./6WEDGJKQ.jsx";
@@ -110,12 +110,14 @@ var SignaturePadRoot = (props) => {
110
110
  const [useSignaturePadProps, localProps] = createSplitProps()(props, [
111
111
  "id",
112
112
  "ids",
113
+ "defaultPaths",
113
114
  "drawing",
114
115
  "disabled",
115
116
  "readOnly",
116
117
  "name",
117
118
  "onDraw",
118
119
  "onDrawEnd",
120
+ "paths",
119
121
  "readOnly",
120
122
  "required",
121
123
  "translations"
@@ -183,8 +183,10 @@ var useFileUpload = (props) => {
183
183
  var FileUploadRoot = (props) => {
184
184
  const [fileUploadProps, localProps] = createSplitProps()(props, [
185
185
  "accept",
186
+ "acceptedFiles",
186
187
  "allowDrop",
187
188
  "capture",
189
+ "defaultAcceptedFiles",
188
190
  "directory",
189
191
  "disabled",
190
192
  "id",
@@ -3,15 +3,15 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
6
+ } from "./WC2HBDLJ.jsx";
7
+ import {
8
+ composeRefs
9
+ } from "./DOBZPYAN.jsx";
7
10
  import {
8
11
  RenderStrategyProvider,
9
12
  splitRenderStrategyProps,
10
13
  useRenderStrategyContext
11
14
  } from "./NEBB7COJ.jsx";
12
- import {
13
- composeRefs
14
- } from "./DOBZPYAN.jsx";
15
15
  import {
16
16
  createSplitProps
17
17
  } from "./6WEDGJKQ.jsx";
@@ -3,7 +3,7 @@ import {
3
3
  splitPresenceProps,
4
4
  usePresence,
5
5
  usePresenceContext
6
- } from "./H6ODLFPJ.jsx";
6
+ } from "./WC2HBDLJ.jsx";
7
7
  import {
8
8
  composeRefs
9
9
  } from "./DOBZPYAN.jsx";