@ark-ui/react 4.4.4 → 4.6.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 (79) hide show
  1. package/dist/components/carousel/carousel-autoplay-trigger.cjs +21 -0
  2. package/dist/components/carousel/carousel-autoplay-trigger.d.cts +7 -0
  3. package/dist/components/carousel/carousel-autoplay-trigger.d.ts +7 -0
  4. package/dist/components/carousel/carousel-autoplay-trigger.js +17 -0
  5. package/dist/components/carousel/carousel-control.cjs +7 -2
  6. package/dist/components/carousel/carousel-control.js +7 -2
  7. package/dist/components/carousel/carousel-item.cjs +1 -1
  8. package/dist/components/carousel/carousel-item.js +1 -1
  9. package/dist/components/carousel/carousel-root.cjs +15 -6
  10. package/dist/components/carousel/carousel-root.js +15 -6
  11. package/dist/components/carousel/carousel.anatomy.d.cts +1 -2
  12. package/dist/components/carousel/carousel.anatomy.d.ts +1 -2
  13. package/dist/components/carousel/carousel.cjs +2 -2
  14. package/dist/components/carousel/carousel.d.cts +11 -11
  15. package/dist/components/carousel/carousel.d.ts +11 -11
  16. package/dist/components/carousel/carousel.js +1 -1
  17. package/dist/components/carousel/index.cjs +9 -6
  18. package/dist/components/carousel/index.d.cts +2 -2
  19. package/dist/components/carousel/index.d.ts +2 -2
  20. package/dist/components/carousel/index.js +2 -2
  21. package/dist/components/carousel/use-carousel.cjs +3 -3
  22. package/dist/components/carousel/use-carousel.d.cts +2 -2
  23. package/dist/components/carousel/use-carousel.d.ts +2 -2
  24. package/dist/components/carousel/use-carousel.js +3 -3
  25. package/dist/components/checkbox/checkbox.anatomy.d.cts +1 -1
  26. package/dist/components/checkbox/checkbox.anatomy.d.ts +1 -1
  27. package/dist/components/checkbox/use-checkbox-group.cjs +3 -3
  28. package/dist/components/checkbox/use-checkbox-group.js +3 -3
  29. package/dist/components/collection.cjs +2 -0
  30. package/dist/components/collection.d.cts +1 -1
  31. package/dist/components/collection.d.ts +1 -1
  32. package/dist/components/collection.js +3 -2
  33. package/dist/components/color-picker/color-picker-root.cjs +2 -0
  34. package/dist/components/color-picker/color-picker-root.js +2 -0
  35. package/dist/components/color-picker/use-color-picker.cjs +1 -0
  36. package/dist/components/color-picker/use-color-picker.js +1 -0
  37. package/dist/components/date-picker/date-picker-root.cjs +0 -1
  38. package/dist/components/date-picker/date-picker-root.js +0 -1
  39. package/dist/components/date-picker/date-picker.anatomy.d.cts +1 -1
  40. package/dist/components/date-picker/date-picker.anatomy.d.ts +1 -1
  41. package/dist/components/file-upload/file-upload.d.cts +1 -1
  42. package/dist/components/file-upload/file-upload.d.ts +1 -1
  43. package/dist/components/file-upload/index.d.cts +1 -1
  44. package/dist/components/file-upload/index.d.ts +1 -1
  45. package/dist/components/index.cjs +14 -10
  46. package/dist/components/index.js +5 -5
  47. package/dist/components/number-input/use-number-input.cjs +2 -1
  48. package/dist/components/number-input/use-number-input.js +2 -1
  49. package/dist/components/presence/use-presence.cjs +3 -2
  50. package/dist/components/presence/use-presence.js +3 -2
  51. package/dist/components/segment-group/segment-group.anatomy.d.cts +2 -2
  52. package/dist/components/segment-group/segment-group.anatomy.d.ts +2 -2
  53. package/dist/components/tabs/tab-content.cjs +2 -1
  54. package/dist/components/tabs/tab-content.js +2 -1
  55. package/dist/components/timer/index.cjs +4 -4
  56. package/dist/components/timer/index.d.cts +2 -2
  57. package/dist/components/timer/index.d.ts +2 -2
  58. package/dist/components/timer/index.js +2 -2
  59. package/dist/components/tree-view/index.cjs +1 -0
  60. package/dist/components/tree-view/index.d.cts +5 -5
  61. package/dist/components/tree-view/index.d.ts +5 -5
  62. package/dist/components/tree-view/index.js +1 -1
  63. package/dist/index.cjs +14 -10
  64. package/dist/index.js +5 -5
  65. package/dist/providers/environment/index.d.cts +5 -1
  66. package/dist/providers/environment/index.d.ts +5 -1
  67. package/dist/providers/environment/use-environment-context.d.cts +2 -2
  68. package/dist/providers/environment/use-environment-context.d.ts +2 -2
  69. package/dist/utils/use-debounce.cjs +21 -0
  70. package/dist/utils/use-debounce.d.cts +1 -0
  71. package/dist/utils/use-debounce.d.ts +1 -0
  72. package/dist/utils/use-debounce.js +17 -0
  73. package/package.json +68 -67
  74. package/dist/components/carousel/carousel-viewport.cjs +0 -19
  75. package/dist/components/carousel/carousel-viewport.d.cts +0 -7
  76. package/dist/components/carousel/carousel-viewport.d.ts +0 -7
  77. package/dist/components/carousel/carousel-viewport.js +0 -15
  78. package/dist/components/carousel/carousel.anatomy.cjs +0 -10
  79. package/dist/components/carousel/carousel.anatomy.js +0 -6
@@ -1,6 +1,6 @@
1
1
  import { Provider } from 'react';
2
2
  export type RootNode = ShadowRoot | Document | Node;
3
- export interface EnvironmentContext {
3
+ export interface UseEnvironmentContext {
4
4
  /**
5
5
  * The root node of the application.
6
6
  * This is used to determine the window and document objects.
@@ -15,4 +15,4 @@ export interface EnvironmentContext {
15
15
  */
16
16
  getWindow(): Window & typeof globalThis;
17
17
  }
18
- export declare const EnvironmentContextProvider: Provider<EnvironmentContext>, useEnvironmentContext: () => EnvironmentContext;
18
+ export declare const EnvironmentContextProvider: Provider<UseEnvironmentContext>, useEnvironmentContext: () => UseEnvironmentContext;
@@ -1,6 +1,6 @@
1
1
  import { Provider } from 'react';
2
2
  export type RootNode = ShadowRoot | Document | Node;
3
- export interface EnvironmentContext {
3
+ export interface UseEnvironmentContext {
4
4
  /**
5
5
  * The root node of the application.
6
6
  * This is used to determine the window and document objects.
@@ -15,4 +15,4 @@ export interface EnvironmentContext {
15
15
  */
16
16
  getWindow(): Window & typeof globalThis;
17
17
  }
18
- export declare const EnvironmentContextProvider: Provider<EnvironmentContext>, useEnvironmentContext: () => EnvironmentContext;
18
+ export declare const EnvironmentContextProvider: Provider<UseEnvironmentContext>, useEnvironmentContext: () => UseEnvironmentContext;
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1 @@
1
+ export declare function useDebounce<T>(value: T, delay: number): T;
@@ -0,0 +1 @@
1
+ export declare function useDebounce<T>(value: T, delay: number): T;
@@ -0,0 +1,17 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark-ui/react",
3
- "version": "4.4.4",
3
+ "version": "4.6.0",
4
4
  "description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
5
5
  "keywords": [
6
6
  "accordion",
@@ -134,6 +134,7 @@
134
134
  },
135
135
  "scripts": {
136
136
  "build": "vite build",
137
+ "dev": "bun run storybook",
137
138
  "lint": "biome lint ./src",
138
139
  "test": "vitest",
139
140
  "test:ci": "vitest --run",
@@ -159,88 +160,88 @@
159
160
  },
160
161
  "sideEffects": false,
161
162
  "dependencies": {
162
- "@internationalized/date": "3.5.6",
163
- "@zag-js/accordion": "0.77.1",
164
- "@zag-js/anatomy": "0.77.1",
165
- "@zag-js/auto-resize": "0.77.1",
166
- "@zag-js/avatar": "0.77.1",
167
- "@zag-js/carousel": "0.77.1",
168
- "@zag-js/checkbox": "0.77.1",
169
- "@zag-js/clipboard": "0.77.1",
170
- "@zag-js/collapsible": "0.77.1",
171
- "@zag-js/collection": "0.77.1",
172
- "@zag-js/color-picker": "0.77.1",
173
- "@zag-js/color-utils": "0.77.1",
174
- "@zag-js/combobox": "0.77.1",
175
- "@zag-js/core": "0.77.1",
176
- "@zag-js/date-picker": "0.77.1",
177
- "@zag-js/date-utils": "0.77.1",
178
- "@zag-js/dialog": "0.77.1",
179
- "@zag-js/dom-query": "0.77.1",
180
- "@zag-js/editable": "0.77.1",
181
- "@zag-js/file-upload": "0.77.1",
182
- "@zag-js/file-utils": "0.77.1",
183
- "@zag-js/highlight-word": "0.77.1",
184
- "@zag-js/hover-card": "0.77.1",
185
- "@zag-js/i18n-utils": "0.77.1",
186
- "@zag-js/menu": "0.77.1",
187
- "@zag-js/number-input": "0.77.1",
188
- "@zag-js/pagination": "0.77.1",
189
- "@zag-js/pin-input": "0.77.1",
190
- "@zag-js/popover": "0.77.1",
191
- "@zag-js/presence": "0.77.1",
192
- "@zag-js/progress": "0.77.1",
193
- "@zag-js/qr-code": "0.77.1",
194
- "@zag-js/radio-group": "0.77.1",
195
- "@zag-js/rating-group": "0.77.1",
196
- "@zag-js/react": "0.77.1",
197
- "@zag-js/select": "0.77.1",
198
- "@zag-js/signature-pad": "0.77.1",
199
- "@zag-js/slider": "0.77.1",
200
- "@zag-js/splitter": "0.77.1",
201
- "@zag-js/steps": "0.77.1",
202
- "@zag-js/switch": "0.77.1",
203
- "@zag-js/tabs": "0.77.1",
204
- "@zag-js/tags-input": "0.77.1",
205
- "@zag-js/time-picker": "0.77.1",
206
- "@zag-js/timer": "0.77.1",
207
- "@zag-js/toast": "0.77.1",
208
- "@zag-js/toggle-group": "0.77.1",
209
- "@zag-js/tooltip": "0.77.1",
210
- "@zag-js/tree-view": "0.77.1",
211
- "@zag-js/types": "0.77.1"
163
+ "@internationalized/date": "3.6.0",
164
+ "@zag-js/accordion": "0.79.1",
165
+ "@zag-js/anatomy": "0.79.1",
166
+ "@zag-js/auto-resize": "0.79.1",
167
+ "@zag-js/avatar": "0.79.1",
168
+ "@zag-js/carousel": "0.79.1",
169
+ "@zag-js/checkbox": "0.79.1",
170
+ "@zag-js/clipboard": "0.79.1",
171
+ "@zag-js/collapsible": "0.79.1",
172
+ "@zag-js/collection": "0.79.1",
173
+ "@zag-js/color-picker": "0.79.1",
174
+ "@zag-js/color-utils": "0.79.1",
175
+ "@zag-js/combobox": "0.79.1",
176
+ "@zag-js/core": "0.79.1",
177
+ "@zag-js/date-picker": "0.79.1",
178
+ "@zag-js/date-utils": "0.79.1",
179
+ "@zag-js/dialog": "0.79.1",
180
+ "@zag-js/dom-query": "0.79.1",
181
+ "@zag-js/editable": "0.79.1",
182
+ "@zag-js/file-upload": "0.79.1",
183
+ "@zag-js/file-utils": "0.79.1",
184
+ "@zag-js/highlight-word": "0.79.1",
185
+ "@zag-js/hover-card": "0.79.1",
186
+ "@zag-js/i18n-utils": "0.79.1",
187
+ "@zag-js/menu": "0.79.1",
188
+ "@zag-js/number-input": "0.79.1",
189
+ "@zag-js/pagination": "0.79.1",
190
+ "@zag-js/pin-input": "0.79.1",
191
+ "@zag-js/popover": "0.79.1",
192
+ "@zag-js/presence": "0.79.1",
193
+ "@zag-js/progress": "0.79.1",
194
+ "@zag-js/qr-code": "0.79.1",
195
+ "@zag-js/radio-group": "0.79.1",
196
+ "@zag-js/rating-group": "0.79.1",
197
+ "@zag-js/react": "0.79.1",
198
+ "@zag-js/select": "0.79.1",
199
+ "@zag-js/signature-pad": "0.79.1",
200
+ "@zag-js/slider": "0.79.1",
201
+ "@zag-js/splitter": "0.79.1",
202
+ "@zag-js/steps": "0.79.1",
203
+ "@zag-js/switch": "0.79.1",
204
+ "@zag-js/tabs": "0.79.1",
205
+ "@zag-js/tags-input": "0.79.1",
206
+ "@zag-js/time-picker": "0.79.1",
207
+ "@zag-js/timer": "0.79.1",
208
+ "@zag-js/toast": "0.79.1",
209
+ "@zag-js/toggle-group": "0.79.1",
210
+ "@zag-js/tooltip": "0.79.1",
211
+ "@zag-js/tree-view": "0.79.1",
212
+ "@zag-js/types": "0.79.1"
212
213
  },
213
214
  "devDependencies": {
214
215
  "@biomejs/biome": "1.9.4",
215
216
  "@release-it/keep-a-changelog": "5.0.0",
216
- "@storybook/addon-a11y": "8.4.4",
217
- "@storybook/addon-essentials": "8.4.4",
218
- "@storybook/react-vite": "8.4.4",
219
- "@storybook/react": "8.4.4",
217
+ "@storybook/addon-a11y": "8.4.7",
218
+ "@storybook/addon-essentials": "8.4.7",
219
+ "@storybook/react-vite": "8.4.7",
220
+ "@storybook/react": "8.4.7",
220
221
  "@testing-library/dom": "10.4.0",
221
- "@testing-library/jest-dom": "6.6.1",
222
+ "@testing-library/jest-dom": "6.6.3",
222
223
  "@testing-library/react": "16.0.1",
223
224
  "@testing-library/user-event": "14.5.2",
224
225
  "@types/jsdom": "21.1.7",
225
- "@types/react": "18.3.12",
226
- "@types/react-dom": "18.3.1",
227
- "@vitejs/plugin-react": "4.3.3",
228
- "@zag-js/stringify-state": "0.77.1",
226
+ "@types/react": "18.3.18",
227
+ "@types/react-dom": "18.3.5",
228
+ "@vitejs/plugin-react": "4.3.4",
229
+ "@zag-js/stringify-state": "0.79.1",
229
230
  "clean-package": "2.2.0",
230
231
  "globby": "14.0.2",
231
232
  "jsdom": "25.0.1",
232
- "lucide-react": "0.460.0",
233
+ "lucide-react": "0.469.0",
233
234
  "react": "18.3.1",
234
235
  "react-dom": "18.3.1",
235
236
  "react-frame-component": "5.2.7",
236
- "react-hook-form": "7.53.2",
237
- "release-it": "17.10.0",
237
+ "react-hook-form": "7.54.2",
238
+ "release-it": "17.11.0",
238
239
  "resize-observer-polyfill": "1.5.1",
239
- "storybook": "8.4.4",
240
- "typescript": "5.6.3",
240
+ "storybook": "8.4.7",
241
+ "typescript": "5.7.2",
241
242
  "vite": "5.4.11",
242
- "vite-plugin-dts": "4.3.0",
243
- "vitest": "2.1.5",
243
+ "vite-plugin-dts": "4.4.0",
244
+ "vitest": "2.1.8",
244
245
  "vitest-axe": "1.0.0-pre.3"
245
246
  },
246
247
  "peerDependencies": {
@@ -1,19 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const jsxRuntime = require('react/jsx-runtime');
7
- const react$1 = require('@zag-js/react');
8
- const react = require('react');
9
- const factory = require('../factory.cjs');
10
- const useCarouselContext = require('./use-carousel-context.cjs');
11
-
12
- const CarouselViewport = react.forwardRef((props, ref) => {
13
- const carousel = useCarouselContext.useCarouselContext();
14
- const mergedProps = react$1.mergeProps(carousel.getViewportProps(), props);
15
- return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
16
- });
17
- CarouselViewport.displayName = "CarouselViewport";
18
-
19
- exports.CarouselViewport = CarouselViewport;
@@ -1,7 +0,0 @@
1
- import { HTMLProps, PolymorphicProps } from '../factory';
2
- import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
- export interface CarouselViewportBaseProps extends PolymorphicProps {
4
- }
5
- export interface CarouselViewportProps extends HTMLProps<'div'>, CarouselViewportBaseProps {
6
- }
7
- export declare const CarouselViewport: ForwardRefExoticComponent<CarouselViewportProps & RefAttributes<HTMLDivElement>>;
@@ -1,7 +0,0 @@
1
- import { HTMLProps, PolymorphicProps } from '../factory';
2
- import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
- export interface CarouselViewportBaseProps extends PolymorphicProps {
4
- }
5
- export interface CarouselViewportProps extends HTMLProps<'div'>, CarouselViewportBaseProps {
6
- }
7
- export declare const CarouselViewport: ForwardRefExoticComponent<CarouselViewportProps & RefAttributes<HTMLDivElement>>;
@@ -1,15 +0,0 @@
1
- 'use client';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { mergeProps } from '@zag-js/react';
4
- import { forwardRef } from 'react';
5
- import { ark } from '../factory.js';
6
- import { useCarouselContext } from './use-carousel-context.js';
7
-
8
- const CarouselViewport = forwardRef((props, ref) => {
9
- const carousel = useCarouselContext();
10
- const mergedProps = mergeProps(carousel.getViewportProps(), props);
11
- return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
12
- });
13
- CarouselViewport.displayName = "CarouselViewport";
14
-
15
- export { CarouselViewport };
@@ -1,10 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const carousel = require('@zag-js/carousel');
7
-
8
- const carouselAnatomy = carousel.anatomy.extendWith("control");
9
-
10
- exports.carouselAnatomy = carouselAnatomy;
@@ -1,6 +0,0 @@
1
- 'use client';
2
- import { anatomy } from '@zag-js/carousel';
3
-
4
- const carouselAnatomy = anatomy.extendWith("control");
5
-
6
- export { carouselAnatomy };