@ark-ui/react 5.20.0 → 5.22.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 (89) hide show
  1. package/dist/components/collection/examples/async-list/dependencies.d.cts +1 -0
  2. package/dist/components/collection/examples/async-list/dependencies.d.ts +1 -0
  3. package/dist/components/collection/examples/async-list/filter.d.cts +1 -0
  4. package/dist/components/collection/examples/async-list/filter.d.ts +1 -0
  5. package/dist/components/collection/examples/async-list/infinite-loading.d.cts +1 -0
  6. package/dist/components/collection/examples/async-list/infinite-loading.d.ts +1 -0
  7. package/dist/components/collection/examples/async-list/reload.d.cts +1 -0
  8. package/dist/components/collection/examples/async-list/reload.d.ts +1 -0
  9. package/dist/components/collection/examples/async-list/sort-client-side.d.cts +1 -0
  10. package/dist/components/collection/examples/async-list/sort-client-side.d.ts +1 -0
  11. package/dist/components/collection/examples/async-list/sort-server-side.d.cts +1 -0
  12. package/dist/components/collection/examples/async-list/sort-server-side.d.ts +1 -0
  13. package/dist/components/collection/examples/list-selection/basic.d.cts +1 -0
  14. package/dist/components/collection/examples/list-selection/basic.d.ts +1 -0
  15. package/dist/components/collection/examples/list-selection/multiple.d.cts +1 -0
  16. package/dist/components/collection/examples/list-selection/multiple.d.ts +1 -0
  17. package/dist/components/collection/examples/list-selection/range.d.cts +1 -0
  18. package/dist/components/collection/examples/list-selection/range.d.ts +1 -0
  19. package/dist/components/collection/index.cjs +2 -0
  20. package/dist/components/collection/index.d.cts +1 -0
  21. package/dist/components/collection/index.d.ts +1 -0
  22. package/dist/components/collection/index.js +1 -0
  23. package/dist/components/collection/use-async-list.cjs +33 -0
  24. package/dist/components/collection/use-async-list.d.cts +6 -0
  25. package/dist/components/collection/use-async-list.d.ts +6 -0
  26. package/dist/components/collection/use-async-list.js +10 -0
  27. package/dist/components/combobox/combobox-empty.cjs +22 -0
  28. package/dist/components/combobox/combobox-empty.d.cts +7 -0
  29. package/dist/components/combobox/combobox-empty.d.ts +7 -0
  30. package/dist/components/combobox/combobox-empty.js +18 -0
  31. package/dist/components/combobox/combobox.anatomy.cjs +10 -0
  32. package/dist/components/combobox/combobox.anatomy.d.cts +2 -1
  33. package/dist/components/combobox/combobox.anatomy.d.ts +2 -1
  34. package/dist/components/combobox/combobox.anatomy.js +6 -0
  35. package/dist/components/combobox/combobox.cjs +2 -0
  36. package/dist/components/combobox/combobox.d.cts +1 -0
  37. package/dist/components/combobox/combobox.d.ts +1 -0
  38. package/dist/components/combobox/combobox.js +1 -0
  39. package/dist/components/combobox/index.cjs +6 -7
  40. package/dist/components/combobox/index.d.cts +1 -0
  41. package/dist/components/combobox/index.d.ts +1 -0
  42. package/dist/components/combobox/index.js +2 -1
  43. package/dist/components/fieldset/fieldset-legend.cjs +1 -1
  44. package/dist/components/fieldset/fieldset-legend.d.cts +2 -2
  45. package/dist/components/fieldset/fieldset-legend.d.ts +2 -2
  46. package/dist/components/fieldset/fieldset-legend.js +1 -1
  47. package/dist/components/fieldset/use-fieldset.cjs +5 -2
  48. package/dist/components/fieldset/use-fieldset.js +5 -2
  49. package/dist/components/index.cjs +12 -14
  50. package/dist/components/index.js +4 -2
  51. package/dist/components/listbox/index.cjs +6 -7
  52. package/dist/components/listbox/index.d.cts +1 -0
  53. package/dist/components/listbox/index.d.ts +1 -0
  54. package/dist/components/listbox/index.js +2 -1
  55. package/dist/components/listbox/listbox-empty.cjs +22 -0
  56. package/dist/components/listbox/listbox-empty.d.cts +7 -0
  57. package/dist/components/listbox/listbox-empty.d.ts +7 -0
  58. package/dist/components/listbox/listbox-empty.js +18 -0
  59. package/dist/components/listbox/listbox.anatomy.cjs +10 -0
  60. package/dist/components/listbox/listbox.anatomy.d.cts +2 -1
  61. package/dist/components/listbox/listbox.anatomy.d.ts +2 -1
  62. package/dist/components/listbox/listbox.anatomy.js +6 -0
  63. package/dist/components/listbox/listbox.cjs +2 -0
  64. package/dist/components/listbox/listbox.d.cts +1 -0
  65. package/dist/components/listbox/listbox.d.ts +1 -0
  66. package/dist/components/listbox/listbox.js +1 -0
  67. package/dist/components/menu/menu-root.cjs +1 -0
  68. package/dist/components/menu/menu-root.js +1 -0
  69. package/dist/components/segment-group/segment-group.anatomy.d.cts +2 -2
  70. package/dist/components/segment-group/segment-group.anatomy.d.ts +2 -2
  71. package/dist/components/tabs/tab-content.cjs +1 -2
  72. package/dist/components/tabs/tab-content.js +1 -2
  73. package/dist/components/toast/index.d.cts +1 -0
  74. package/dist/components/toast/index.d.ts +1 -0
  75. package/dist/index.cjs +14 -14
  76. package/dist/index.js +5 -2
  77. package/dist/providers/index.cjs +2 -0
  78. package/dist/providers/index.js +1 -0
  79. package/dist/providers/locale/index.cjs +2 -0
  80. package/dist/providers/locale/index.d.cts +1 -0
  81. package/dist/providers/locale/index.d.ts +1 -0
  82. package/dist/providers/locale/index.js +1 -0
  83. package/dist/providers/locale/use-collator.cjs +19 -0
  84. package/dist/providers/locale/use-collator.d.cts +4 -0
  85. package/dist/providers/locale/use-collator.d.ts +4 -0
  86. package/dist/providers/locale/use-collator.js +15 -0
  87. package/package.json +70 -69
  88. package/dist/utils/use-debounce.cjs +0 -21
  89. package/dist/utils/use-debounce.js +0 -17
@@ -0,0 +1,4 @@
1
+ export interface UseCollatorProps extends Intl.CollatorOptions {
2
+ locale?: string;
3
+ }
4
+ export declare function useCollator(props?: UseCollatorProps): Intl.Collator;
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+ import { createCollator } from '@zag-js/i18n-utils';
3
+ import { useLocaleContext } from './use-locale-context.js';
4
+ import { useMemo } from 'react';
5
+
6
+ function useCollator(props = {}) {
7
+ const env = useLocaleContext();
8
+ const locale = props.locale ?? env.locale;
9
+ return useMemo(() => {
10
+ const { locale: _, ...options } = props;
11
+ return createCollator(locale, options);
12
+ }, [locale, props]);
13
+ }
14
+
15
+ export { useCollator };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ark-ui/react",
3
3
  "type": "module",
4
- "version": "5.20.0",
4
+ "version": "5.22.0",
5
5
  "description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
6
6
  "keywords": [
7
7
  "accordion",
@@ -141,83 +141,84 @@
141
141
  "sideEffects": false,
142
142
  "dependencies": {
143
143
  "@internationalized/date": "3.8.2",
144
- "@zag-js/accordion": "1.21.7",
145
- "@zag-js/anatomy": "1.21.7",
146
- "@zag-js/angle-slider": "1.21.7",
147
- "@zag-js/auto-resize": "1.21.7",
148
- "@zag-js/avatar": "1.21.7",
149
- "@zag-js/carousel": "1.21.7",
150
- "@zag-js/checkbox": "1.21.7",
151
- "@zag-js/clipboard": "1.21.7",
152
- "@zag-js/collapsible": "1.21.7",
153
- "@zag-js/collection": "1.21.7",
154
- "@zag-js/color-picker": "1.21.7",
155
- "@zag-js/color-utils": "1.21.7",
156
- "@zag-js/combobox": "1.21.7",
157
- "@zag-js/core": "1.21.7",
158
- "@zag-js/date-picker": "1.21.7",
159
- "@zag-js/date-utils": "1.21.7",
160
- "@zag-js/dialog": "1.21.7",
161
- "@zag-js/dom-query": "1.21.7",
162
- "@zag-js/editable": "1.21.7",
163
- "@zag-js/file-upload": "1.21.7",
164
- "@zag-js/file-utils": "1.21.7",
165
- "@zag-js/floating-panel": "1.21.7",
166
- "@zag-js/focus-trap": "1.21.7",
167
- "@zag-js/highlight-word": "1.21.7",
168
- "@zag-js/hover-card": "1.21.7",
169
- "@zag-js/i18n-utils": "1.21.7",
170
- "@zag-js/json-tree-utils": "1.21.7",
171
- "@zag-js/listbox": "1.21.7",
172
- "@zag-js/menu": "1.21.7",
173
- "@zag-js/number-input": "1.21.7",
174
- "@zag-js/pagination": "1.21.7",
175
- "@zag-js/password-input": "1.21.7",
176
- "@zag-js/pin-input": "1.21.7",
177
- "@zag-js/popover": "1.21.7",
178
- "@zag-js/presence": "1.21.7",
179
- "@zag-js/progress": "1.21.7",
180
- "@zag-js/qr-code": "1.21.7",
181
- "@zag-js/radio-group": "1.21.7",
182
- "@zag-js/rating-group": "1.21.7",
183
- "@zag-js/react": "1.21.7",
184
- "@zag-js/scroll-area": "1.21.7",
185
- "@zag-js/select": "1.21.7",
186
- "@zag-js/signature-pad": "1.21.7",
187
- "@zag-js/slider": "1.21.7",
188
- "@zag-js/splitter": "1.21.7",
189
- "@zag-js/steps": "1.21.7",
190
- "@zag-js/switch": "1.21.7",
191
- "@zag-js/tabs": "1.21.7",
192
- "@zag-js/tags-input": "1.21.7",
193
- "@zag-js/time-picker": "1.21.7",
194
- "@zag-js/timer": "1.21.7",
195
- "@zag-js/toast": "1.21.7",
196
- "@zag-js/toggle": "1.21.7",
197
- "@zag-js/toggle-group": "1.21.7",
198
- "@zag-js/tooltip": "1.21.7",
199
- "@zag-js/tour": "1.21.7",
200
- "@zag-js/tree-view": "1.21.7",
201
- "@zag-js/types": "1.21.7",
202
- "@zag-js/utils": "1.21.7"
144
+ "@zag-js/accordion": "1.22.1",
145
+ "@zag-js/anatomy": "1.22.1",
146
+ "@zag-js/angle-slider": "1.22.1",
147
+ "@zag-js/async-list": "1.22.1",
148
+ "@zag-js/auto-resize": "1.22.1",
149
+ "@zag-js/avatar": "1.22.1",
150
+ "@zag-js/carousel": "1.22.1",
151
+ "@zag-js/checkbox": "1.22.1",
152
+ "@zag-js/clipboard": "1.22.1",
153
+ "@zag-js/collapsible": "1.22.1",
154
+ "@zag-js/collection": "1.22.1",
155
+ "@zag-js/color-picker": "1.22.1",
156
+ "@zag-js/color-utils": "1.22.1",
157
+ "@zag-js/combobox": "1.22.1",
158
+ "@zag-js/core": "1.22.1",
159
+ "@zag-js/date-picker": "1.22.1",
160
+ "@zag-js/date-utils": "1.22.1",
161
+ "@zag-js/dialog": "1.22.1",
162
+ "@zag-js/dom-query": "1.22.1",
163
+ "@zag-js/editable": "1.22.1",
164
+ "@zag-js/file-upload": "1.22.1",
165
+ "@zag-js/file-utils": "1.22.1",
166
+ "@zag-js/floating-panel": "1.22.1",
167
+ "@zag-js/focus-trap": "1.22.1",
168
+ "@zag-js/highlight-word": "1.22.1",
169
+ "@zag-js/hover-card": "1.22.1",
170
+ "@zag-js/i18n-utils": "1.22.1",
171
+ "@zag-js/json-tree-utils": "1.22.1",
172
+ "@zag-js/listbox": "1.22.1",
173
+ "@zag-js/menu": "1.22.1",
174
+ "@zag-js/number-input": "1.22.1",
175
+ "@zag-js/pagination": "1.22.1",
176
+ "@zag-js/password-input": "1.22.1",
177
+ "@zag-js/pin-input": "1.22.1",
178
+ "@zag-js/popover": "1.22.1",
179
+ "@zag-js/presence": "1.22.1",
180
+ "@zag-js/progress": "1.22.1",
181
+ "@zag-js/qr-code": "1.22.1",
182
+ "@zag-js/radio-group": "1.22.1",
183
+ "@zag-js/rating-group": "1.22.1",
184
+ "@zag-js/react": "1.22.1",
185
+ "@zag-js/scroll-area": "1.22.1",
186
+ "@zag-js/select": "1.22.1",
187
+ "@zag-js/signature-pad": "1.22.1",
188
+ "@zag-js/slider": "1.22.1",
189
+ "@zag-js/splitter": "1.22.1",
190
+ "@zag-js/steps": "1.22.1",
191
+ "@zag-js/switch": "1.22.1",
192
+ "@zag-js/tabs": "1.22.1",
193
+ "@zag-js/tags-input": "1.22.1",
194
+ "@zag-js/time-picker": "1.22.1",
195
+ "@zag-js/timer": "1.22.1",
196
+ "@zag-js/toast": "1.22.1",
197
+ "@zag-js/toggle": "1.22.1",
198
+ "@zag-js/toggle-group": "1.22.1",
199
+ "@zag-js/tooltip": "1.22.1",
200
+ "@zag-js/tour": "1.22.1",
201
+ "@zag-js/tree-view": "1.22.1",
202
+ "@zag-js/types": "1.22.1",
203
+ "@zag-js/utils": "1.22.1"
203
204
  },
204
205
  "devDependencies": {
205
- "@biomejs/biome": "2.2.0",
206
- "@storybook/addon-a11y": "9.1.2",
207
- "@storybook/react-vite": "9.1.2",
206
+ "@biomejs/biome": "2.2.2",
207
+ "@storybook/addon-a11y": "9.1.3",
208
+ "@storybook/react-vite": "9.1.3",
208
209
  "@testing-library/dom": "10.4.1",
209
- "@testing-library/jest-dom": "6.7.0",
210
+ "@testing-library/jest-dom": "6.8.0",
210
211
  "@testing-library/react": "16.3.0",
211
212
  "@testing-library/user-event": "14.6.1",
212
213
  "@types/jsdom": "21.1.7",
213
- "@types/react": "19.1.10",
214
+ "@types/react": "19.1.11",
214
215
  "@types/react-dom": "19.1.7",
215
- "@vitejs/plugin-react": "5.0.0",
216
+ "@vitejs/plugin-react": "5.0.1",
216
217
  "clean-package": "2.2.0",
217
218
  "image-conversion": "2.1.1",
218
219
  "globby": "14.1.0",
219
220
  "happy-dom": "18.0.1",
220
- "lucide-react": "0.540.0",
221
+ "lucide-react": "0.541.0",
221
222
  "react": "19.1.1",
222
223
  "react-dom": "19.1.1",
223
224
  "react-shadow": "20.6.0",
@@ -225,9 +226,9 @@
225
226
  "react-frame-component": "5.2.7",
226
227
  "react-hook-form": "7.62.0",
227
228
  "resize-observer-polyfill": "1.5.1",
228
- "storybook": "9.1.2",
229
+ "storybook": "9.1.3",
229
230
  "typescript": "5.9.2",
230
- "vite": "7.1.2",
231
+ "vite": "7.1.3",
231
232
  "vite-plugin-dts": "4.5.4",
232
233
  "vitest": "3.2.4",
233
234
  "@vitest/coverage-v8": "3.2.4",
@@ -1,21 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const react = require('react');
7
-
8
- function useDebounce(value, delay) {
9
- const [debouncedValue, setDebouncedValue] = react.useState(value);
10
- react.useEffect(() => {
11
- const timer = setTimeout(() => {
12
- setDebouncedValue(value);
13
- }, delay);
14
- return () => {
15
- clearTimeout(timer);
16
- };
17
- }, [value, delay]);
18
- return debouncedValue;
19
- }
20
-
21
- exports.useDebounce = useDebounce;
@@ -1,17 +0,0 @@
1
- 'use client';
2
- import { useState, useEffect } from 'react';
3
-
4
- function useDebounce(value, delay) {
5
- const [debouncedValue, setDebouncedValue] = useState(value);
6
- useEffect(() => {
7
- const timer = setTimeout(() => {
8
- setDebouncedValue(value);
9
- }, delay);
10
- return () => {
11
- clearTimeout(timer);
12
- };
13
- }, [value, delay]);
14
- return debouncedValue;
15
- }
16
-
17
- export { useDebounce };