@ark-ui/react 5.0.1 → 5.1.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.
- package/dist/components/field/index.cjs +2 -0
- package/dist/components/field/index.d.cts +1 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/index.cjs +2 -0
- package/dist/components/index.js +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/utils/compose-refs.cjs +16 -8
- package/dist/utils/compose-refs.d.cts +2 -1
- package/dist/utils/compose-refs.d.ts +2 -1
- package/dist/utils/compose-refs.js +16 -8
- package/package.json +63 -63
|
@@ -13,6 +13,7 @@ const fieldRootProvider = require('./field-root-provider.cjs');
|
|
|
13
13
|
const fieldSelect = require('./field-select.cjs');
|
|
14
14
|
const fieldTextarea = require('./field-textarea.cjs');
|
|
15
15
|
const field_anatomy = require('./field.anatomy.cjs');
|
|
16
|
+
const useField = require('./use-field.cjs');
|
|
16
17
|
const useFieldContext = require('./use-field-context.cjs');
|
|
17
18
|
const field = require('./field.cjs');
|
|
18
19
|
|
|
@@ -29,5 +30,6 @@ exports.FieldRootProvider = fieldRootProvider.FieldRootProvider;
|
|
|
29
30
|
exports.FieldSelect = fieldSelect.FieldSelect;
|
|
30
31
|
exports.FieldTextarea = fieldTextarea.FieldTextarea;
|
|
31
32
|
exports.fieldAnatomy = field_anatomy.fieldAnatomy;
|
|
33
|
+
exports.useField = useField.useField;
|
|
32
34
|
exports.useFieldContext = useFieldContext.useFieldContext;
|
|
33
35
|
exports.Field = field;
|
|
@@ -9,5 +9,6 @@ export { FieldRootProvider, type FieldRootProviderBaseProps, type FieldRootProvi
|
|
|
9
9
|
export { FieldSelect, type FieldSelectBaseProps, type FieldSelectProps } from './field-select';
|
|
10
10
|
export { FieldTextarea, type FieldTextareaBaseProps, type FieldTextareaProps } from './field-textarea';
|
|
11
11
|
export { fieldAnatomy } from './field.anatomy';
|
|
12
|
+
export { useField, type UseFieldProps, type UseFieldReturn } from './use-field';
|
|
12
13
|
export { useFieldContext, type UseFieldContext } from './use-field-context';
|
|
13
14
|
export * as Field from './field';
|
|
@@ -9,5 +9,6 @@ export { FieldRootProvider, type FieldRootProviderBaseProps, type FieldRootProvi
|
|
|
9
9
|
export { FieldSelect, type FieldSelectBaseProps, type FieldSelectProps } from './field-select';
|
|
10
10
|
export { FieldTextarea, type FieldTextareaBaseProps, type FieldTextareaProps } from './field-textarea';
|
|
11
11
|
export { fieldAnatomy } from './field.anatomy';
|
|
12
|
+
export { useField, type UseFieldProps, type UseFieldReturn } from './use-field';
|
|
12
13
|
export { useFieldContext, type UseFieldContext } from './use-field-context';
|
|
13
14
|
export * as Field from './field';
|
|
@@ -9,6 +9,7 @@ export { FieldRootProvider } from './field-root-provider.js';
|
|
|
9
9
|
export { FieldSelect } from './field-select.js';
|
|
10
10
|
export { FieldTextarea } from './field-textarea.js';
|
|
11
11
|
export { fieldAnatomy } from './field.anatomy.js';
|
|
12
|
+
export { useField } from './use-field.js';
|
|
12
13
|
export { useFieldContext } from './use-field-context.js';
|
|
13
14
|
import * as field from './field.js';
|
|
14
15
|
export { field as Field };
|
|
@@ -197,6 +197,7 @@ const fieldRootProvider = require('./field/field-root-provider.cjs');
|
|
|
197
197
|
const fieldSelect = require('./field/field-select.cjs');
|
|
198
198
|
const fieldTextarea = require('./field/field-textarea.cjs');
|
|
199
199
|
const field_anatomy = require('./field/field.anatomy.cjs');
|
|
200
|
+
const useField = require('./field/use-field.cjs');
|
|
200
201
|
const useFieldContext = require('./field/use-field-context.cjs');
|
|
201
202
|
const field = require('./field/field.cjs');
|
|
202
203
|
const fieldsetContext = require('./fieldset/fieldset-context.cjs');
|
|
@@ -844,6 +845,7 @@ exports.FieldRootProvider = fieldRootProvider.FieldRootProvider;
|
|
|
844
845
|
exports.FieldSelect = fieldSelect.FieldSelect;
|
|
845
846
|
exports.FieldTextarea = fieldTextarea.FieldTextarea;
|
|
846
847
|
exports.fieldAnatomy = field_anatomy.fieldAnatomy;
|
|
848
|
+
exports.useField = useField.useField;
|
|
847
849
|
exports.useFieldContext = useFieldContext.useFieldContext;
|
|
848
850
|
exports.Field = field;
|
|
849
851
|
exports.FieldsetContext = fieldsetContext.FieldsetContext;
|
package/dist/components/index.js
CHANGED
|
@@ -204,6 +204,7 @@ export { FieldRootProvider } from './field/field-root-provider.js';
|
|
|
204
204
|
export { FieldSelect } from './field/field-select.js';
|
|
205
205
|
export { FieldTextarea } from './field/field-textarea.js';
|
|
206
206
|
export { fieldAnatomy } from './field/field.anatomy.js';
|
|
207
|
+
export { useField } from './field/use-field.js';
|
|
207
208
|
export { useFieldContext } from './field/use-field-context.js';
|
|
208
209
|
import * as field from './field/field.js';
|
|
209
210
|
export { field as Field };
|
package/dist/index.cjs
CHANGED
|
@@ -197,6 +197,7 @@ const fieldRootProvider = require('./components/field/field-root-provider.cjs');
|
|
|
197
197
|
const fieldSelect = require('./components/field/field-select.cjs');
|
|
198
198
|
const fieldTextarea = require('./components/field/field-textarea.cjs');
|
|
199
199
|
const field_anatomy = require('./components/field/field.anatomy.cjs');
|
|
200
|
+
const useField = require('./components/field/use-field.cjs');
|
|
200
201
|
const useFieldContext = require('./components/field/use-field-context.cjs');
|
|
201
202
|
const field = require('./components/field/field.cjs');
|
|
202
203
|
const fieldsetContext = require('./components/fieldset/fieldset-context.cjs');
|
|
@@ -848,6 +849,7 @@ exports.FieldRootProvider = fieldRootProvider.FieldRootProvider;
|
|
|
848
849
|
exports.FieldSelect = fieldSelect.FieldSelect;
|
|
849
850
|
exports.FieldTextarea = fieldTextarea.FieldTextarea;
|
|
850
851
|
exports.fieldAnatomy = field_anatomy.fieldAnatomy;
|
|
852
|
+
exports.useField = useField.useField;
|
|
851
853
|
exports.useFieldContext = useFieldContext.useFieldContext;
|
|
852
854
|
exports.Field = field;
|
|
853
855
|
exports.FieldsetContext = fieldsetContext.FieldsetContext;
|
package/dist/index.js
CHANGED
|
@@ -204,6 +204,7 @@ export { FieldRootProvider } from './components/field/field-root-provider.js';
|
|
|
204
204
|
export { FieldSelect } from './components/field/field-select.js';
|
|
205
205
|
export { FieldTextarea } from './components/field/field-textarea.js';
|
|
206
206
|
export { fieldAnatomy } from './components/field/field.anatomy.js';
|
|
207
|
+
export { useField } from './components/field/use-field.js';
|
|
207
208
|
export { useFieldContext } from './components/field/use-field-context.js';
|
|
208
209
|
import * as field from './components/field/field.js';
|
|
209
210
|
export { field as Field };
|
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
function setRef(ref, value) {
|
|
6
|
-
if (typeof ref === "function") {
|
|
7
|
-
ref(value);
|
|
8
|
-
} else if (ref !== null && ref !== void 0) {
|
|
9
|
-
ref.current = value;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
5
|
function composeRefs(...refs) {
|
|
13
6
|
return (node) => {
|
|
7
|
+
const cleanUps = [];
|
|
14
8
|
for (const ref of refs) {
|
|
15
|
-
|
|
9
|
+
if (typeof ref === "function") {
|
|
10
|
+
const cb = ref(node);
|
|
11
|
+
if (typeof cb === "function") {
|
|
12
|
+
cleanUps.push(cb);
|
|
13
|
+
}
|
|
14
|
+
} else if (ref) {
|
|
15
|
+
ref.current = node;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (cleanUps.length) {
|
|
19
|
+
return () => {
|
|
20
|
+
for (const cleanUp of cleanUps) {
|
|
21
|
+
cleanUp();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
16
24
|
}
|
|
17
25
|
};
|
|
18
26
|
}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
function setRef(ref, value) {
|
|
2
|
-
if (typeof ref === "function") {
|
|
3
|
-
ref(value);
|
|
4
|
-
} else if (ref !== null && ref !== void 0) {
|
|
5
|
-
ref.current = value;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
1
|
function composeRefs(...refs) {
|
|
9
2
|
return (node) => {
|
|
3
|
+
const cleanUps = [];
|
|
10
4
|
for (const ref of refs) {
|
|
11
|
-
|
|
5
|
+
if (typeof ref === "function") {
|
|
6
|
+
const cb = ref(node);
|
|
7
|
+
if (typeof cb === "function") {
|
|
8
|
+
cleanUps.push(cb);
|
|
9
|
+
}
|
|
10
|
+
} else if (ref) {
|
|
11
|
+
ref.current = node;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (cleanUps.length) {
|
|
15
|
+
return () => {
|
|
16
|
+
for (const cleanUp of cleanUps) {
|
|
17
|
+
cleanUp();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
12
20
|
}
|
|
13
21
|
};
|
|
14
22
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0
|
|
4
|
+
"version": "5.1.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",
|
|
@@ -147,66 +147,66 @@
|
|
|
147
147
|
"sideEffects": false,
|
|
148
148
|
"dependencies": {
|
|
149
149
|
"@internationalized/date": "3.7.0",
|
|
150
|
-
"@zag-js/accordion": "1.
|
|
151
|
-
"@zag-js/anatomy": "1.
|
|
152
|
-
"@zag-js/auto-resize": "1.
|
|
153
|
-
"@zag-js/avatar": "1.
|
|
154
|
-
"@zag-js/carousel": "1.
|
|
155
|
-
"@zag-js/checkbox": "1.
|
|
156
|
-
"@zag-js/clipboard": "1.
|
|
157
|
-
"@zag-js/collapsible": "1.
|
|
158
|
-
"@zag-js/collection": "1.
|
|
159
|
-
"@zag-js/color-picker": "1.
|
|
160
|
-
"@zag-js/color-utils": "1.
|
|
161
|
-
"@zag-js/combobox": "1.
|
|
162
|
-
"@zag-js/core": "1.
|
|
163
|
-
"@zag-js/date-picker": "1.
|
|
164
|
-
"@zag-js/date-utils": "1.
|
|
165
|
-
"@zag-js/dialog": "1.
|
|
166
|
-
"@zag-js/dom-query": "1.
|
|
167
|
-
"@zag-js/editable": "1.
|
|
168
|
-
"@zag-js/file-upload": "1.
|
|
169
|
-
"@zag-js/file-utils": "1.
|
|
170
|
-
"@zag-js/focus-trap": "1.
|
|
171
|
-
"@zag-js/highlight-word": "1.
|
|
172
|
-
"@zag-js/hover-card": "1.
|
|
173
|
-
"@zag-js/i18n-utils": "1.
|
|
174
|
-
"@zag-js/menu": "1.
|
|
175
|
-
"@zag-js/number-input": "1.
|
|
176
|
-
"@zag-js/pagination": "1.
|
|
177
|
-
"@zag-js/pin-input": "1.
|
|
178
|
-
"@zag-js/popover": "1.
|
|
179
|
-
"@zag-js/presence": "1.
|
|
180
|
-
"@zag-js/progress": "1.
|
|
181
|
-
"@zag-js/qr-code": "1.
|
|
182
|
-
"@zag-js/radio-group": "1.
|
|
183
|
-
"@zag-js/rating-group": "1.
|
|
184
|
-
"@zag-js/react": "1.
|
|
185
|
-
"@zag-js/select": "1.
|
|
186
|
-
"@zag-js/signature-pad": "1.
|
|
187
|
-
"@zag-js/slider": "1.
|
|
188
|
-
"@zag-js/splitter": "1.
|
|
189
|
-
"@zag-js/steps": "1.
|
|
190
|
-
"@zag-js/switch": "1.
|
|
191
|
-
"@zag-js/tabs": "1.
|
|
192
|
-
"@zag-js/tags-input": "1.
|
|
193
|
-
"@zag-js/time-picker": "1.
|
|
194
|
-
"@zag-js/timer": "1.
|
|
195
|
-
"@zag-js/toast": "1.
|
|
196
|
-
"@zag-js/toggle": "1.
|
|
197
|
-
"@zag-js/toggle-group": "1.
|
|
198
|
-
"@zag-js/tooltip": "1.
|
|
199
|
-
"@zag-js/tour": "1.
|
|
200
|
-
"@zag-js/tree-view": "1.
|
|
201
|
-
"@zag-js/types": "1.
|
|
150
|
+
"@zag-js/accordion": "1.4.1",
|
|
151
|
+
"@zag-js/anatomy": "1.4.1",
|
|
152
|
+
"@zag-js/auto-resize": "1.4.1",
|
|
153
|
+
"@zag-js/avatar": "1.4.1",
|
|
154
|
+
"@zag-js/carousel": "1.4.1",
|
|
155
|
+
"@zag-js/checkbox": "1.4.1",
|
|
156
|
+
"@zag-js/clipboard": "1.4.1",
|
|
157
|
+
"@zag-js/collapsible": "1.4.1",
|
|
158
|
+
"@zag-js/collection": "1.4.1",
|
|
159
|
+
"@zag-js/color-picker": "1.4.1",
|
|
160
|
+
"@zag-js/color-utils": "1.4.1",
|
|
161
|
+
"@zag-js/combobox": "1.4.1",
|
|
162
|
+
"@zag-js/core": "1.4.1",
|
|
163
|
+
"@zag-js/date-picker": "1.4.1",
|
|
164
|
+
"@zag-js/date-utils": "1.4.1",
|
|
165
|
+
"@zag-js/dialog": "1.4.1",
|
|
166
|
+
"@zag-js/dom-query": "1.4.1",
|
|
167
|
+
"@zag-js/editable": "1.4.1",
|
|
168
|
+
"@zag-js/file-upload": "1.4.1",
|
|
169
|
+
"@zag-js/file-utils": "1.4.1",
|
|
170
|
+
"@zag-js/focus-trap": "1.4.1",
|
|
171
|
+
"@zag-js/highlight-word": "1.4.1",
|
|
172
|
+
"@zag-js/hover-card": "1.4.1",
|
|
173
|
+
"@zag-js/i18n-utils": "1.4.1",
|
|
174
|
+
"@zag-js/menu": "1.4.1",
|
|
175
|
+
"@zag-js/number-input": "1.4.1",
|
|
176
|
+
"@zag-js/pagination": "1.4.1",
|
|
177
|
+
"@zag-js/pin-input": "1.4.1",
|
|
178
|
+
"@zag-js/popover": "1.4.1",
|
|
179
|
+
"@zag-js/presence": "1.4.1",
|
|
180
|
+
"@zag-js/progress": "1.4.1",
|
|
181
|
+
"@zag-js/qr-code": "1.4.1",
|
|
182
|
+
"@zag-js/radio-group": "1.4.1",
|
|
183
|
+
"@zag-js/rating-group": "1.4.1",
|
|
184
|
+
"@zag-js/react": "1.4.1",
|
|
185
|
+
"@zag-js/select": "1.4.1",
|
|
186
|
+
"@zag-js/signature-pad": "1.4.1",
|
|
187
|
+
"@zag-js/slider": "1.4.1",
|
|
188
|
+
"@zag-js/splitter": "1.4.1",
|
|
189
|
+
"@zag-js/steps": "1.4.1",
|
|
190
|
+
"@zag-js/switch": "1.4.1",
|
|
191
|
+
"@zag-js/tabs": "1.4.1",
|
|
192
|
+
"@zag-js/tags-input": "1.4.1",
|
|
193
|
+
"@zag-js/time-picker": "1.4.1",
|
|
194
|
+
"@zag-js/timer": "1.4.1",
|
|
195
|
+
"@zag-js/toast": "1.4.1",
|
|
196
|
+
"@zag-js/toggle": "1.4.1",
|
|
197
|
+
"@zag-js/toggle-group": "1.4.1",
|
|
198
|
+
"@zag-js/tooltip": "1.4.1",
|
|
199
|
+
"@zag-js/tour": "1.4.1",
|
|
200
|
+
"@zag-js/tree-view": "1.4.1",
|
|
201
|
+
"@zag-js/types": "1.4.1"
|
|
202
202
|
},
|
|
203
203
|
"devDependencies": {
|
|
204
204
|
"@biomejs/biome": "1.9.4",
|
|
205
205
|
"@release-it/keep-a-changelog": "6.0.0",
|
|
206
|
-
"@storybook/addon-a11y": "8.6.
|
|
207
|
-
"@storybook/addon-essentials": "8.6.
|
|
208
|
-
"@storybook/react": "8.6.
|
|
209
|
-
"@storybook/react-vite": "8.6.
|
|
206
|
+
"@storybook/addon-a11y": "8.6.7",
|
|
207
|
+
"@storybook/addon-essentials": "8.6.7",
|
|
208
|
+
"@storybook/react": "8.6.7",
|
|
209
|
+
"@storybook/react-vite": "8.6.7",
|
|
210
210
|
"@testing-library/dom": "10.4.0",
|
|
211
211
|
"@testing-library/jest-dom": "6.6.3",
|
|
212
212
|
"@testing-library/react": "16.2.0",
|
|
@@ -215,22 +215,22 @@
|
|
|
215
215
|
"@types/react": "19.0.10",
|
|
216
216
|
"@types/react-dom": "19.0.4",
|
|
217
217
|
"@vitejs/plugin-react": "4.3.4",
|
|
218
|
-
"@zag-js/stringify-state": "1.
|
|
218
|
+
"@zag-js/stringify-state": "1.4.1",
|
|
219
219
|
"clean-package": "2.2.0",
|
|
220
220
|
"globby": "14.1.0",
|
|
221
|
-
"happy-dom": "17.4.
|
|
222
|
-
"lucide-react": "0.
|
|
221
|
+
"happy-dom": "17.4.4",
|
|
222
|
+
"lucide-react": "0.482.0",
|
|
223
223
|
"react": "19.0.0",
|
|
224
224
|
"react-dom": "19.0.0",
|
|
225
225
|
"react-frame-component": "5.2.7",
|
|
226
226
|
"react-hook-form": "7.54.2",
|
|
227
227
|
"release-it": "18.1.2",
|
|
228
228
|
"resize-observer-polyfill": "1.5.1",
|
|
229
|
-
"storybook": "8.6.
|
|
229
|
+
"storybook": "8.6.7",
|
|
230
230
|
"typescript": "5.8.2",
|
|
231
|
-
"vite": "6.2.
|
|
231
|
+
"vite": "6.2.2",
|
|
232
232
|
"vite-plugin-dts": "4.5.3",
|
|
233
|
-
"vitest": "3.0.
|
|
233
|
+
"vitest": "3.0.9",
|
|
234
234
|
"vitest-axe": "1.0.0-pre.5"
|
|
235
235
|
},
|
|
236
236
|
"peerDependencies": {
|