@ark-ui/react 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.
- package/dist/components/checkbox/checkbox-group-provider.cjs +19 -0
- package/dist/components/checkbox/checkbox-group-provider.d.cts +13 -0
- package/dist/components/checkbox/checkbox-group-provider.d.ts +13 -0
- package/dist/components/checkbox/checkbox-group-provider.js +15 -0
- package/dist/components/checkbox/checkbox.cjs +2 -0
- package/dist/components/checkbox/checkbox.d.cts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +1 -0
- package/dist/components/checkbox/checkbox.js +1 -0
- package/dist/components/checkbox/index.cjs +2 -0
- package/dist/components/checkbox/index.d.cts +1 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/client-only/client-only.cjs +1 -1
- package/dist/components/client-only/client-only.d.cts +1 -1
- package/dist/components/client-only/client-only.d.ts +1 -1
- package/dist/components/client-only/client-only.js +1 -1
- package/dist/components/collection/index.d.cts +1 -1
- package/dist/components/collection/index.d.ts +1 -1
- package/dist/components/collection/use-list-collection.cjs +56 -33
- package/dist/components/collection/use-list-collection.d.cts +57 -4
- package/dist/components/collection/use-list-collection.d.ts +57 -4
- package/dist/components/collection/use-list-collection.js +57 -34
- package/dist/components/color-picker/color-picker-value-text.cjs +3 -3
- package/dist/components/color-picker/color-picker-value-text.js +3 -3
- package/dist/components/field/use-field.cjs +2 -1
- package/dist/components/field/use-field.js +2 -1
- package/dist/components/fieldset/use-fieldset.cjs +2 -1
- package/dist/components/fieldset/use-fieldset.js +2 -1
- package/dist/components/file-upload/file-upload.d.cts +1 -1
- package/dist/components/file-upload/file-upload.d.ts +1 -1
- package/dist/components/file-upload/index.d.cts +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- 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/package.json +67 -67
|
@@ -0,0 +1,19 @@
|
|
|
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 = require('react');
|
|
8
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const checkbox_anatomy = require('./checkbox.anatomy.cjs');
|
|
11
|
+
const useCheckboxGroupContext = require('./use-checkbox-group-context.cjs');
|
|
12
|
+
|
|
13
|
+
const CheckboxGroupProvider = react.forwardRef((props, ref) => {
|
|
14
|
+
const [localProps, restProps] = createSplitProps.createSplitProps()(props, ["value"]);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useCheckboxGroupContext.CheckboxGroupContextProvider, { value: localProps.value, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ref, role: "group", ...restProps, ...checkbox_anatomy.checkboxAnatomy.build().group.attrs }) });
|
|
16
|
+
});
|
|
17
|
+
CheckboxGroupProvider.displayName = "CheckboxGroupProvider";
|
|
18
|
+
|
|
19
|
+
exports.CheckboxGroupProvider = CheckboxGroupProvider;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Assign } from '../../types';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { UseCheckboxGroupContext } from './use-checkbox-group-context';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
interface ProviderProps {
|
|
6
|
+
value: UseCheckboxGroupContext;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckboxGroupProviderBaseProps extends ProviderProps, PolymorphicProps {
|
|
9
|
+
}
|
|
10
|
+
export interface CheckboxGroupProviderProps extends Assign<HTMLProps<'div'>, CheckboxGroupProviderBaseProps> {
|
|
11
|
+
}
|
|
12
|
+
export declare const CheckboxGroupProvider: ForwardRefExoticComponent<CheckboxGroupProviderProps & RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Assign } from '../../types';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { UseCheckboxGroupContext } from './use-checkbox-group-context';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
interface ProviderProps {
|
|
6
|
+
value: UseCheckboxGroupContext;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckboxGroupProviderBaseProps extends ProviderProps, PolymorphicProps {
|
|
9
|
+
}
|
|
10
|
+
export interface CheckboxGroupProviderProps extends Assign<HTMLProps<'div'>, CheckboxGroupProviderBaseProps> {
|
|
11
|
+
}
|
|
12
|
+
export declare const CheckboxGroupProvider: ForwardRefExoticComponent<CheckboxGroupProviderProps & RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { checkboxAnatomy } from './checkbox.anatomy.js';
|
|
7
|
+
import { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';
|
|
8
|
+
|
|
9
|
+
const CheckboxGroupProvider = forwardRef((props, ref) => {
|
|
10
|
+
const [localProps, restProps] = createSplitProps()(props, ["value"]);
|
|
11
|
+
return /* @__PURE__ */ jsx(CheckboxGroupContextProvider, { value: localProps.value, children: /* @__PURE__ */ jsx(ark.div, { ref, role: "group", ...restProps, ...checkboxAnatomy.build().group.attrs }) });
|
|
12
|
+
});
|
|
13
|
+
CheckboxGroupProvider.displayName = "CheckboxGroupProvider";
|
|
14
|
+
|
|
15
|
+
export { CheckboxGroupProvider };
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const checkboxContext = require('./checkbox-context.cjs');
|
|
6
6
|
const checkboxControl = require('./checkbox-control.cjs');
|
|
7
7
|
const checkboxGroup = require('./checkbox-group.cjs');
|
|
8
|
+
const checkboxGroupProvider = require('./checkbox-group-provider.cjs');
|
|
8
9
|
const checkboxHiddenInput = require('./checkbox-hidden-input.cjs');
|
|
9
10
|
const checkboxIndicator = require('./checkbox-indicator.cjs');
|
|
10
11
|
const checkboxLabel = require('./checkbox-label.cjs');
|
|
@@ -16,6 +17,7 @@ const checkboxRootProvider = require('./checkbox-root-provider.cjs');
|
|
|
16
17
|
exports.Context = checkboxContext.CheckboxContext;
|
|
17
18
|
exports.Control = checkboxControl.CheckboxControl;
|
|
18
19
|
exports.Group = checkboxGroup.CheckboxGroup;
|
|
20
|
+
exports.GroupProvider = checkboxGroupProvider.CheckboxGroupProvider;
|
|
19
21
|
exports.HiddenInput = checkboxHiddenInput.CheckboxHiddenInput;
|
|
20
22
|
exports.Indicator = checkboxIndicator.CheckboxIndicator;
|
|
21
23
|
exports.Label = checkboxLabel.CheckboxLabel;
|
|
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails, CheckedState } from '@zag-js/checkbox';
|
|
|
2
2
|
export { CheckboxContext as Context, type CheckboxContextProps as ContextProps } from './checkbox-context';
|
|
3
3
|
export { CheckboxControl as Control, type CheckboxControlBaseProps as ControlBaseProps, type CheckboxControlProps as ControlProps, } from './checkbox-control';
|
|
4
4
|
export { CheckboxGroup as Group, type CheckboxGroupBaseProps as GroupBaseProps, type CheckboxGroupProps as GroupProps, } from './checkbox-group';
|
|
5
|
+
export { CheckboxGroupProvider as GroupProvider, type CheckboxGroupProviderBaseProps as GroupProviderBaseProps, type CheckboxGroupProviderProps as GroupProviderProps, } from './checkbox-group-provider';
|
|
5
6
|
export { CheckboxHiddenInput as HiddenInput, type CheckboxHiddenInputBaseProps as HiddenInputBaseProps, type CheckboxHiddenInputProps as HiddenInputProps, } from './checkbox-hidden-input';
|
|
6
7
|
export { CheckboxIndicator as Indicator, type CheckboxIndicatorBaseProps as IndicatorBaseProps, type CheckboxIndicatorProps as IndicatorProps, } from './checkbox-indicator';
|
|
7
8
|
export { CheckboxLabel as Label, type CheckboxLabelBaseProps as LabelBaseProps, type CheckboxLabelProps as LabelProps, } from './checkbox-label';
|
|
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails, CheckedState } from '@zag-js/checkbox';
|
|
|
2
2
|
export { CheckboxContext as Context, type CheckboxContextProps as ContextProps } from './checkbox-context';
|
|
3
3
|
export { CheckboxControl as Control, type CheckboxControlBaseProps as ControlBaseProps, type CheckboxControlProps as ControlProps, } from './checkbox-control';
|
|
4
4
|
export { CheckboxGroup as Group, type CheckboxGroupBaseProps as GroupBaseProps, type CheckboxGroupProps as GroupProps, } from './checkbox-group';
|
|
5
|
+
export { CheckboxGroupProvider as GroupProvider, type CheckboxGroupProviderBaseProps as GroupProviderBaseProps, type CheckboxGroupProviderProps as GroupProviderProps, } from './checkbox-group-provider';
|
|
5
6
|
export { CheckboxHiddenInput as HiddenInput, type CheckboxHiddenInputBaseProps as HiddenInputBaseProps, type CheckboxHiddenInputProps as HiddenInputProps, } from './checkbox-hidden-input';
|
|
6
7
|
export { CheckboxIndicator as Indicator, type CheckboxIndicatorBaseProps as IndicatorBaseProps, type CheckboxIndicatorProps as IndicatorProps, } from './checkbox-indicator';
|
|
7
8
|
export { CheckboxLabel as Label, type CheckboxLabelBaseProps as LabelBaseProps, type CheckboxLabelProps as LabelProps, } from './checkbox-label';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { CheckboxContext as Context } from './checkbox-context.js';
|
|
2
2
|
export { CheckboxControl as Control } from './checkbox-control.js';
|
|
3
3
|
export { CheckboxGroup as Group } from './checkbox-group.js';
|
|
4
|
+
export { CheckboxGroupProvider as GroupProvider } from './checkbox-group-provider.js';
|
|
4
5
|
export { CheckboxHiddenInput as HiddenInput } from './checkbox-hidden-input.js';
|
|
5
6
|
export { CheckboxIndicator as Indicator } from './checkbox-indicator.js';
|
|
6
7
|
export { CheckboxLabel as Label } from './checkbox-label.js';
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const checkboxContext = require('./checkbox-context.cjs');
|
|
6
6
|
const checkboxControl = require('./checkbox-control.cjs');
|
|
7
7
|
const checkboxGroup = require('./checkbox-group.cjs');
|
|
8
|
+
const checkboxGroupProvider = require('./checkbox-group-provider.cjs');
|
|
8
9
|
const checkboxHiddenInput = require('./checkbox-hidden-input.cjs');
|
|
9
10
|
const checkboxIndicator = require('./checkbox-indicator.cjs');
|
|
10
11
|
const checkboxLabel = require('./checkbox-label.cjs');
|
|
@@ -22,6 +23,7 @@ const checkbox = require('./checkbox.cjs');
|
|
|
22
23
|
exports.CheckboxContext = checkboxContext.CheckboxContext;
|
|
23
24
|
exports.CheckboxControl = checkboxControl.CheckboxControl;
|
|
24
25
|
exports.CheckboxGroup = checkboxGroup.CheckboxGroup;
|
|
26
|
+
exports.CheckboxGroupProvider = checkboxGroupProvider.CheckboxGroupProvider;
|
|
25
27
|
exports.CheckboxHiddenInput = checkboxHiddenInput.CheckboxHiddenInput;
|
|
26
28
|
exports.CheckboxIndicator = checkboxIndicator.CheckboxIndicator;
|
|
27
29
|
exports.CheckboxLabel = checkboxLabel.CheckboxLabel;
|
|
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails as CheckboxCheckedChangeDetails, CheckedState
|
|
|
2
2
|
export { CheckboxContext, type CheckboxContextProps } from './checkbox-context';
|
|
3
3
|
export { CheckboxControl, type CheckboxControlBaseProps, type CheckboxControlProps } from './checkbox-control';
|
|
4
4
|
export { CheckboxGroup, type CheckboxGroupBaseProps, type CheckboxGroupProps } from './checkbox-group';
|
|
5
|
+
export { CheckboxGroupProvider, type CheckboxGroupProviderBaseProps, type CheckboxGroupProviderProps, } from './checkbox-group-provider';
|
|
5
6
|
export { CheckboxHiddenInput, type CheckboxHiddenInputBaseProps, type CheckboxHiddenInputProps, } from './checkbox-hidden-input';
|
|
6
7
|
export { CheckboxIndicator, type CheckboxIndicatorBaseProps, type CheckboxIndicatorProps } from './checkbox-indicator';
|
|
7
8
|
export { CheckboxLabel, type CheckboxLabelBaseProps, type CheckboxLabelProps } from './checkbox-label';
|
|
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails as CheckboxCheckedChangeDetails, CheckedState
|
|
|
2
2
|
export { CheckboxContext, type CheckboxContextProps } from './checkbox-context';
|
|
3
3
|
export { CheckboxControl, type CheckboxControlBaseProps, type CheckboxControlProps } from './checkbox-control';
|
|
4
4
|
export { CheckboxGroup, type CheckboxGroupBaseProps, type CheckboxGroupProps } from './checkbox-group';
|
|
5
|
+
export { CheckboxGroupProvider, type CheckboxGroupProviderBaseProps, type CheckboxGroupProviderProps, } from './checkbox-group-provider';
|
|
5
6
|
export { CheckboxHiddenInput, type CheckboxHiddenInputBaseProps, type CheckboxHiddenInputProps, } from './checkbox-hidden-input';
|
|
6
7
|
export { CheckboxIndicator, type CheckboxIndicatorBaseProps, type CheckboxIndicatorProps } from './checkbox-indicator';
|
|
7
8
|
export { CheckboxLabel, type CheckboxLabelBaseProps, type CheckboxLabelProps } from './checkbox-label';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { CheckboxContext } from './checkbox-context.js';
|
|
2
2
|
export { CheckboxControl } from './checkbox-control.js';
|
|
3
3
|
export { CheckboxGroup } from './checkbox-group.js';
|
|
4
|
+
export { CheckboxGroupProvider } from './checkbox-group-provider.js';
|
|
4
5
|
export { CheckboxHiddenInput } from './checkbox-hidden-input.js';
|
|
5
6
|
export { CheckboxIndicator } from './checkbox-indicator.js';
|
|
6
7
|
export { CheckboxLabel } from './checkbox-label.js';
|
|
@@ -17,7 +17,7 @@ const ClientOnly = (props) => {
|
|
|
17
17
|
if (!isClient) {
|
|
18
18
|
return fallback;
|
|
19
19
|
}
|
|
20
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: typeof children === "function" ? children() : children });
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
exports.ClientOnly = ClientOnly;
|
|
@@ -13,7 +13,7 @@ const ClientOnly = (props) => {
|
|
|
13
13
|
if (!isClient) {
|
|
14
14
|
return fallback;
|
|
15
15
|
}
|
|
16
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
16
|
+
return /* @__PURE__ */ jsx(Fragment, { children: typeof children === "function" ? children() : children });
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { ClientOnly };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createGridCollection, type GridCollection, type GridCollectionOptions } from './grid-collection';
|
|
2
2
|
export { createListCollection, type CollectionItem, type CollectionOptions, type ListCollection, } from './list-collection';
|
|
3
3
|
export { createFileTreeCollection, createTreeCollection, type FilePathTreeNode, type FlatTreeNode, type TreeCollection, type TreeCollectionOptions, type TreeNode, } from './tree-collection';
|
|
4
|
-
export { useListCollection, type UseListCollectionProps } from './use-list-collection';
|
|
4
|
+
export { useListCollection, type UseListCollectionProps, type UseListCollectionReturn } from './use-list-collection';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createGridCollection, type GridCollection, type GridCollectionOptions } from './grid-collection';
|
|
2
2
|
export { createListCollection, type CollectionItem, type CollectionOptions, type ListCollection, } from './list-collection';
|
|
3
3
|
export { createFileTreeCollection, createTreeCollection, type FilePathTreeNode, type FlatTreeNode, type TreeCollection, type TreeCollectionOptions, type TreeNode, } from './tree-collection';
|
|
4
|
-
export { useListCollection, type UseListCollectionProps } from './use-list-collection';
|
|
4
|
+
export { useListCollection, type UseListCollectionProps, type UseListCollectionReturn } from './use-list-collection';
|
|
@@ -9,63 +9,86 @@ const listCollection = require('./list-collection.cjs');
|
|
|
9
9
|
|
|
10
10
|
function useListCollection(props) {
|
|
11
11
|
const { initialItems = [], filter, limit, ...collectionOptions } = props;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
()
|
|
17
|
-
);
|
|
18
|
-
const setCollection = useEvent.useEvent((collection2) => {
|
|
19
|
-
setCollectionImpl(limit == null ? collection2 : collection2.copy(collection2.items.slice(0, limit)));
|
|
12
|
+
const [items, setItemsImpl] = react.useState(initialItems);
|
|
13
|
+
const [filterText, setFilterText] = react.useState("");
|
|
14
|
+
const setItems = useEvent.useEvent((items2) => {
|
|
15
|
+
setItemsImpl(items2);
|
|
16
|
+
setFilterText("");
|
|
20
17
|
});
|
|
18
|
+
const collectionOptionsRef = react.useRef(collectionOptions);
|
|
19
|
+
collectionOptionsRef.current = collectionOptions;
|
|
20
|
+
const create = react.useCallback((items2) => {
|
|
21
|
+
return listCollection.createListCollection({ ...collectionOptionsRef.current, items: items2 });
|
|
22
|
+
}, []);
|
|
23
|
+
const collection = react.useMemo(() => {
|
|
24
|
+
let activeItems = items;
|
|
25
|
+
if (filterText && filter) {
|
|
26
|
+
activeItems = create(items).filter((itemString, _index, item) => filter(itemString, filterText, item)).items;
|
|
27
|
+
}
|
|
28
|
+
const limitedItems = limit == null ? activeItems : activeItems.slice(0, limit);
|
|
29
|
+
return listCollection.createListCollection({ ...collectionOptionsRef.current, items: limitedItems });
|
|
30
|
+
}, [items, filterText, filter, limit, create]);
|
|
21
31
|
return {
|
|
22
32
|
collection,
|
|
23
|
-
filter: (inputValue) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
set: useEvent.useEvent((items) => {
|
|
29
|
-
setCollection(create(items));
|
|
33
|
+
filter: useEvent.useEvent((inputValue) => {
|
|
34
|
+
setFilterText(inputValue || "");
|
|
35
|
+
}),
|
|
36
|
+
set: useEvent.useEvent((newItems) => {
|
|
37
|
+
setItems(newItems);
|
|
30
38
|
}),
|
|
31
39
|
reset: useEvent.useEvent(() => {
|
|
32
|
-
|
|
40
|
+
setItems(initialItems);
|
|
33
41
|
}),
|
|
34
42
|
clear: useEvent.useEvent(() => {
|
|
35
|
-
|
|
43
|
+
setItems([]);
|
|
36
44
|
}),
|
|
37
|
-
insert: useEvent.useEvent((index, ...
|
|
38
|
-
|
|
45
|
+
insert: useEvent.useEvent((index, ...itemsToInsert) => {
|
|
46
|
+
const newItems = create(items).insert(index, ...itemsToInsert).items;
|
|
47
|
+
setItems(newItems);
|
|
39
48
|
}),
|
|
40
|
-
insertBefore: useEvent.useEvent((value, ...
|
|
41
|
-
|
|
49
|
+
insertBefore: useEvent.useEvent((value, ...itemsToInsert) => {
|
|
50
|
+
const newItems = create(items).insertBefore(value, ...itemsToInsert).items;
|
|
51
|
+
setItems(newItems);
|
|
42
52
|
}),
|
|
43
|
-
insertAfter: useEvent.useEvent((value, ...
|
|
44
|
-
|
|
53
|
+
insertAfter: useEvent.useEvent((value, ...itemsToInsert) => {
|
|
54
|
+
const newItems = create(items).insertAfter(value, ...itemsToInsert).items;
|
|
55
|
+
setItems(newItems);
|
|
45
56
|
}),
|
|
46
57
|
remove: useEvent.useEvent((...itemOrValues) => {
|
|
47
|
-
|
|
58
|
+
const newItems = create(items).remove(...itemOrValues).items;
|
|
59
|
+
setItems(newItems);
|
|
48
60
|
}),
|
|
49
61
|
move: useEvent.useEvent((value, to) => {
|
|
50
|
-
|
|
62
|
+
const newItems = create(items).move(value, to).items;
|
|
63
|
+
setItems(newItems);
|
|
51
64
|
}),
|
|
52
65
|
moveBefore: useEvent.useEvent((value, ...values) => {
|
|
53
|
-
|
|
66
|
+
const newItems = create(items).moveBefore(value, ...values).items;
|
|
67
|
+
setItems(newItems);
|
|
54
68
|
}),
|
|
55
69
|
moveAfter: useEvent.useEvent((value, ...values) => {
|
|
56
|
-
|
|
70
|
+
const newItems = create(items).moveAfter(value, ...values).items;
|
|
71
|
+
setItems(newItems);
|
|
57
72
|
}),
|
|
58
73
|
reorder: useEvent.useEvent((from, to) => {
|
|
59
|
-
|
|
74
|
+
const newItems = create(items).reorder(from, to).items;
|
|
75
|
+
setItems(newItems);
|
|
76
|
+
}),
|
|
77
|
+
append: useEvent.useEvent((...itemsToAppend) => {
|
|
78
|
+
const newItems = create(items).append(...itemsToAppend).items;
|
|
79
|
+
setItems(newItems);
|
|
60
80
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
81
|
+
upsert: useEvent.useEvent((value, item, mode = "append") => {
|
|
82
|
+
const newItems = create(items).upsert(value, item, mode).items;
|
|
83
|
+
setItems(newItems);
|
|
63
84
|
}),
|
|
64
|
-
prepend: useEvent.useEvent((...
|
|
65
|
-
|
|
85
|
+
prepend: useEvent.useEvent((...itemsToPrepend) => {
|
|
86
|
+
const newItems = create(items).prepend(...itemsToPrepend).items;
|
|
87
|
+
setItems(newItems);
|
|
66
88
|
}),
|
|
67
89
|
update: useEvent.useEvent((value, item) => {
|
|
68
|
-
|
|
90
|
+
const newItems = create(items).update(value, item).items;
|
|
91
|
+
setItems(newItems);
|
|
69
92
|
})
|
|
70
93
|
};
|
|
71
94
|
}
|
|
@@ -7,28 +7,81 @@ export interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>, 'i
|
|
|
7
7
|
/**
|
|
8
8
|
* The filter function to use to filter the items.
|
|
9
9
|
*/
|
|
10
|
-
filter?: (itemText: string, filterText: string) => boolean;
|
|
10
|
+
filter?: (itemText: string, filterText: string, item: T) => boolean;
|
|
11
11
|
/**
|
|
12
12
|
* The maximum number of items to display in the collection.
|
|
13
13
|
* Useful for performance when you have a large number of items.
|
|
14
14
|
*/
|
|
15
15
|
limit?: number;
|
|
16
16
|
}
|
|
17
|
-
export declare function useListCollection<T>(props: UseListCollectionProps<T>):
|
|
17
|
+
export declare function useListCollection<T>(props: UseListCollectionProps<T>): UseListCollectionReturn<T>;
|
|
18
|
+
export interface UseListCollectionReturn<T> {
|
|
19
|
+
/**
|
|
20
|
+
* The collection of items.
|
|
21
|
+
*/
|
|
18
22
|
collection: ListCollection<T>;
|
|
23
|
+
/**
|
|
24
|
+
* The function to filter the items.
|
|
25
|
+
*/
|
|
19
26
|
filter: (inputValue: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* The function to set the items.
|
|
29
|
+
*/
|
|
20
30
|
set: (items: T[]) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The function to reset the items.
|
|
33
|
+
*/
|
|
21
34
|
reset: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* The function to clear the items.
|
|
37
|
+
*/
|
|
22
38
|
clear: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* The function to insert items at a specific index.
|
|
41
|
+
*/
|
|
23
42
|
insert: (index: number, ...items: T[]) => void;
|
|
43
|
+
/**
|
|
44
|
+
* The function to insert items before a specific value.
|
|
45
|
+
*/
|
|
24
46
|
insertBefore: (value: string, ...items: T[]) => void;
|
|
47
|
+
/**
|
|
48
|
+
* The function to insert items after a specific value.
|
|
49
|
+
*/
|
|
25
50
|
insertAfter: (value: string, ...items: T[]) => void;
|
|
26
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The function to remove items.
|
|
53
|
+
*/
|
|
54
|
+
remove: (...itemOrValues: Array<T | string>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* The function to move an item to a specific index.
|
|
57
|
+
*/
|
|
27
58
|
move: (value: string, to: number) => void;
|
|
59
|
+
/**
|
|
60
|
+
* The function to move an item before a specific value.
|
|
61
|
+
*/
|
|
28
62
|
moveBefore: (value: string, ...values: string[]) => void;
|
|
63
|
+
/**
|
|
64
|
+
* The function to move an item after a specific value.
|
|
65
|
+
*/
|
|
29
66
|
moveAfter: (value: string, ...values: string[]) => void;
|
|
67
|
+
/**
|
|
68
|
+
* The function to reorder items.
|
|
69
|
+
*/
|
|
30
70
|
reorder: (from: number, to: number) => void;
|
|
71
|
+
/**
|
|
72
|
+
* The function to append items.
|
|
73
|
+
*/
|
|
31
74
|
append: (...items: T[]) => void;
|
|
75
|
+
/**
|
|
76
|
+
* The function to upsert an item.
|
|
77
|
+
*/
|
|
78
|
+
upsert: (value: string, item: T, mode?: 'append' | 'prepend') => void;
|
|
79
|
+
/**
|
|
80
|
+
* The function to prepend items.
|
|
81
|
+
*/
|
|
32
82
|
prepend: (...items: T[]) => void;
|
|
83
|
+
/**
|
|
84
|
+
* The function to update an item.
|
|
85
|
+
*/
|
|
33
86
|
update: (value: string, item: T) => void;
|
|
34
|
-
}
|
|
87
|
+
}
|
|
@@ -7,28 +7,81 @@ export interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>, 'i
|
|
|
7
7
|
/**
|
|
8
8
|
* The filter function to use to filter the items.
|
|
9
9
|
*/
|
|
10
|
-
filter?: (itemText: string, filterText: string) => boolean;
|
|
10
|
+
filter?: (itemText: string, filterText: string, item: T) => boolean;
|
|
11
11
|
/**
|
|
12
12
|
* The maximum number of items to display in the collection.
|
|
13
13
|
* Useful for performance when you have a large number of items.
|
|
14
14
|
*/
|
|
15
15
|
limit?: number;
|
|
16
16
|
}
|
|
17
|
-
export declare function useListCollection<T>(props: UseListCollectionProps<T>):
|
|
17
|
+
export declare function useListCollection<T>(props: UseListCollectionProps<T>): UseListCollectionReturn<T>;
|
|
18
|
+
export interface UseListCollectionReturn<T> {
|
|
19
|
+
/**
|
|
20
|
+
* The collection of items.
|
|
21
|
+
*/
|
|
18
22
|
collection: ListCollection<T>;
|
|
23
|
+
/**
|
|
24
|
+
* The function to filter the items.
|
|
25
|
+
*/
|
|
19
26
|
filter: (inputValue: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* The function to set the items.
|
|
29
|
+
*/
|
|
20
30
|
set: (items: T[]) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The function to reset the items.
|
|
33
|
+
*/
|
|
21
34
|
reset: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* The function to clear the items.
|
|
37
|
+
*/
|
|
22
38
|
clear: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* The function to insert items at a specific index.
|
|
41
|
+
*/
|
|
23
42
|
insert: (index: number, ...items: T[]) => void;
|
|
43
|
+
/**
|
|
44
|
+
* The function to insert items before a specific value.
|
|
45
|
+
*/
|
|
24
46
|
insertBefore: (value: string, ...items: T[]) => void;
|
|
47
|
+
/**
|
|
48
|
+
* The function to insert items after a specific value.
|
|
49
|
+
*/
|
|
25
50
|
insertAfter: (value: string, ...items: T[]) => void;
|
|
26
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The function to remove items.
|
|
53
|
+
*/
|
|
54
|
+
remove: (...itemOrValues: Array<T | string>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* The function to move an item to a specific index.
|
|
57
|
+
*/
|
|
27
58
|
move: (value: string, to: number) => void;
|
|
59
|
+
/**
|
|
60
|
+
* The function to move an item before a specific value.
|
|
61
|
+
*/
|
|
28
62
|
moveBefore: (value: string, ...values: string[]) => void;
|
|
63
|
+
/**
|
|
64
|
+
* The function to move an item after a specific value.
|
|
65
|
+
*/
|
|
29
66
|
moveAfter: (value: string, ...values: string[]) => void;
|
|
67
|
+
/**
|
|
68
|
+
* The function to reorder items.
|
|
69
|
+
*/
|
|
30
70
|
reorder: (from: number, to: number) => void;
|
|
71
|
+
/**
|
|
72
|
+
* The function to append items.
|
|
73
|
+
*/
|
|
31
74
|
append: (...items: T[]) => void;
|
|
75
|
+
/**
|
|
76
|
+
* The function to upsert an item.
|
|
77
|
+
*/
|
|
78
|
+
upsert: (value: string, item: T, mode?: 'append' | 'prepend') => void;
|
|
79
|
+
/**
|
|
80
|
+
* The function to prepend items.
|
|
81
|
+
*/
|
|
32
82
|
prepend: (...items: T[]) => void;
|
|
83
|
+
/**
|
|
84
|
+
* The function to update an item.
|
|
85
|
+
*/
|
|
33
86
|
update: (value: string, item: T) => void;
|
|
34
|
-
}
|
|
87
|
+
}
|
|
@@ -1,67 +1,90 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useState, useRef, useCallback, useMemo } from 'react';
|
|
3
3
|
import { useEvent } from '../../utils/use-event.js';
|
|
4
4
|
import { createListCollection } from './list-collection.js';
|
|
5
5
|
|
|
6
6
|
function useListCollection(props) {
|
|
7
7
|
const { initialItems = [], filter, limit, ...collectionOptions } = props;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
()
|
|
13
|
-
);
|
|
14
|
-
const setCollection = useEvent((collection2) => {
|
|
15
|
-
setCollectionImpl(limit == null ? collection2 : collection2.copy(collection2.items.slice(0, limit)));
|
|
8
|
+
const [items, setItemsImpl] = useState(initialItems);
|
|
9
|
+
const [filterText, setFilterText] = useState("");
|
|
10
|
+
const setItems = useEvent((items2) => {
|
|
11
|
+
setItemsImpl(items2);
|
|
12
|
+
setFilterText("");
|
|
16
13
|
});
|
|
14
|
+
const collectionOptionsRef = useRef(collectionOptions);
|
|
15
|
+
collectionOptionsRef.current = collectionOptions;
|
|
16
|
+
const create = useCallback((items2) => {
|
|
17
|
+
return createListCollection({ ...collectionOptionsRef.current, items: items2 });
|
|
18
|
+
}, []);
|
|
19
|
+
const collection = useMemo(() => {
|
|
20
|
+
let activeItems = items;
|
|
21
|
+
if (filterText && filter) {
|
|
22
|
+
activeItems = create(items).filter((itemString, _index, item) => filter(itemString, filterText, item)).items;
|
|
23
|
+
}
|
|
24
|
+
const limitedItems = limit == null ? activeItems : activeItems.slice(0, limit);
|
|
25
|
+
return createListCollection({ ...collectionOptionsRef.current, items: limitedItems });
|
|
26
|
+
}, [items, filterText, filter, limit, create]);
|
|
17
27
|
return {
|
|
18
28
|
collection,
|
|
19
|
-
filter: (inputValue) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
set: useEvent((items) => {
|
|
25
|
-
setCollection(create(items));
|
|
29
|
+
filter: useEvent((inputValue) => {
|
|
30
|
+
setFilterText(inputValue || "");
|
|
31
|
+
}),
|
|
32
|
+
set: useEvent((newItems) => {
|
|
33
|
+
setItems(newItems);
|
|
26
34
|
}),
|
|
27
35
|
reset: useEvent(() => {
|
|
28
|
-
|
|
36
|
+
setItems(initialItems);
|
|
29
37
|
}),
|
|
30
38
|
clear: useEvent(() => {
|
|
31
|
-
|
|
39
|
+
setItems([]);
|
|
32
40
|
}),
|
|
33
|
-
insert: useEvent((index, ...
|
|
34
|
-
|
|
41
|
+
insert: useEvent((index, ...itemsToInsert) => {
|
|
42
|
+
const newItems = create(items).insert(index, ...itemsToInsert).items;
|
|
43
|
+
setItems(newItems);
|
|
35
44
|
}),
|
|
36
|
-
insertBefore: useEvent((value, ...
|
|
37
|
-
|
|
45
|
+
insertBefore: useEvent((value, ...itemsToInsert) => {
|
|
46
|
+
const newItems = create(items).insertBefore(value, ...itemsToInsert).items;
|
|
47
|
+
setItems(newItems);
|
|
38
48
|
}),
|
|
39
|
-
insertAfter: useEvent((value, ...
|
|
40
|
-
|
|
49
|
+
insertAfter: useEvent((value, ...itemsToInsert) => {
|
|
50
|
+
const newItems = create(items).insertAfter(value, ...itemsToInsert).items;
|
|
51
|
+
setItems(newItems);
|
|
41
52
|
}),
|
|
42
53
|
remove: useEvent((...itemOrValues) => {
|
|
43
|
-
|
|
54
|
+
const newItems = create(items).remove(...itemOrValues).items;
|
|
55
|
+
setItems(newItems);
|
|
44
56
|
}),
|
|
45
57
|
move: useEvent((value, to) => {
|
|
46
|
-
|
|
58
|
+
const newItems = create(items).move(value, to).items;
|
|
59
|
+
setItems(newItems);
|
|
47
60
|
}),
|
|
48
61
|
moveBefore: useEvent((value, ...values) => {
|
|
49
|
-
|
|
62
|
+
const newItems = create(items).moveBefore(value, ...values).items;
|
|
63
|
+
setItems(newItems);
|
|
50
64
|
}),
|
|
51
65
|
moveAfter: useEvent((value, ...values) => {
|
|
52
|
-
|
|
66
|
+
const newItems = create(items).moveAfter(value, ...values).items;
|
|
67
|
+
setItems(newItems);
|
|
53
68
|
}),
|
|
54
69
|
reorder: useEvent((from, to) => {
|
|
55
|
-
|
|
70
|
+
const newItems = create(items).reorder(from, to).items;
|
|
71
|
+
setItems(newItems);
|
|
72
|
+
}),
|
|
73
|
+
append: useEvent((...itemsToAppend) => {
|
|
74
|
+
const newItems = create(items).append(...itemsToAppend).items;
|
|
75
|
+
setItems(newItems);
|
|
56
76
|
}),
|
|
57
|
-
|
|
58
|
-
|
|
77
|
+
upsert: useEvent((value, item, mode = "append") => {
|
|
78
|
+
const newItems = create(items).upsert(value, item, mode).items;
|
|
79
|
+
setItems(newItems);
|
|
59
80
|
}),
|
|
60
|
-
prepend: useEvent((...
|
|
61
|
-
|
|
81
|
+
prepend: useEvent((...itemsToPrepend) => {
|
|
82
|
+
const newItems = create(items).prepend(...itemsToPrepend).items;
|
|
83
|
+
setItems(newItems);
|
|
62
84
|
}),
|
|
63
85
|
update: useEvent((value, item) => {
|
|
64
|
-
|
|
86
|
+
const newItems = create(items).update(value, item).items;
|
|
87
|
+
setItems(newItems);
|
|
65
88
|
})
|
|
66
89
|
};
|
|
67
90
|
}
|
|
@@ -10,11 +10,11 @@ const factory = require('../factory.cjs');
|
|
|
10
10
|
const useColorPickerContext = require('./use-color-picker-context.cjs');
|
|
11
11
|
|
|
12
12
|
const ColorPickerValueText = react.forwardRef((props, ref) => {
|
|
13
|
-
const { children, format, ...
|
|
13
|
+
const { children, format, ...localProps } = props;
|
|
14
14
|
const colorPicker = useColorPickerContext.useColorPickerContext();
|
|
15
|
-
const mergedProps = react$1.mergeProps(colorPicker.getValueTextProps(),
|
|
15
|
+
const mergedProps = react$1.mergeProps(colorPicker.getValueTextProps(), localProps);
|
|
16
16
|
const valueAsString = format ? colorPicker.value.toString(format) : colorPicker.valueAsString;
|
|
17
|
-
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children:
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children: children || valueAsString });
|
|
18
18
|
});
|
|
19
19
|
ColorPickerValueText.displayName = "ColorPickerValueText";
|
|
20
20
|
|
|
@@ -6,11 +6,11 @@ import { ark } from '../factory.js';
|
|
|
6
6
|
import { useColorPickerContext } from './use-color-picker-context.js';
|
|
7
7
|
|
|
8
8
|
const ColorPickerValueText = forwardRef((props, ref) => {
|
|
9
|
-
const { children, format, ...
|
|
9
|
+
const { children, format, ...localProps } = props;
|
|
10
10
|
const colorPicker = useColorPickerContext();
|
|
11
|
-
const mergedProps = mergeProps(colorPicker.getValueTextProps(),
|
|
11
|
+
const mergedProps = mergeProps(colorPicker.getValueTextProps(), localProps);
|
|
12
12
|
const valueAsString = format ? colorPicker.value.toString(format) : colorPicker.valueAsString;
|
|
13
|
-
return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children:
|
|
13
|
+
return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: children || valueAsString });
|
|
14
14
|
});
|
|
15
15
|
ColorPickerValueText.displayName = "ColorPickerValueText";
|
|
16
16
|
|
|
@@ -16,7 +16,8 @@ const useField = (props = {}) => {
|
|
|
16
16
|
const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;
|
|
17
17
|
const [hasErrorText, setHasErrorText] = react.useState(false);
|
|
18
18
|
const [hasHelperText, setHasHelperText] = react.useState(false);
|
|
19
|
-
const
|
|
19
|
+
const uid = react.useId();
|
|
20
|
+
const id = props.id ?? uid;
|
|
20
21
|
const rootRef = react.useRef(null);
|
|
21
22
|
const rootId = ids?.control ?? `field::${id}`;
|
|
22
23
|
const errorTextId = ids?.errorText ?? `field::${id}::error-text`;
|
|
@@ -12,7 +12,8 @@ const useField = (props = {}) => {
|
|
|
12
12
|
const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;
|
|
13
13
|
const [hasErrorText, setHasErrorText] = useState(false);
|
|
14
14
|
const [hasHelperText, setHasHelperText] = useState(false);
|
|
15
|
-
const
|
|
15
|
+
const uid = useId();
|
|
16
|
+
const id = props.id ?? uid;
|
|
16
17
|
const rootRef = useRef(null);
|
|
17
18
|
const rootId = ids?.control ?? `field::${id}`;
|
|
18
19
|
const errorTextId = ids?.errorText ?? `field::${id}::error-text`;
|
|
@@ -14,7 +14,8 @@ const useFieldset = (props = {}) => {
|
|
|
14
14
|
const env = useEnvironmentContext.useEnvironmentContext();
|
|
15
15
|
const hasErrorText = react.useRef(false);
|
|
16
16
|
const hasHelperText = react.useRef(false);
|
|
17
|
-
const
|
|
17
|
+
const uid = react.useId();
|
|
18
|
+
const id = props.id ?? uid;
|
|
18
19
|
const rootRef = react.useRef(null);
|
|
19
20
|
const errorTextId = `fieldset::${id}::error-text`;
|
|
20
21
|
const helperTextId = `fieldset::${id}::helper-text`;
|
|
@@ -10,7 +10,8 @@ const useFieldset = (props = {}) => {
|
|
|
10
10
|
const env = useEnvironmentContext();
|
|
11
11
|
const hasErrorText = useRef(false);
|
|
12
12
|
const hasHelperText = useRef(false);
|
|
13
|
-
const
|
|
13
|
+
const uid = useId();
|
|
14
|
+
const id = props.id ?? uid;
|
|
14
15
|
const rootRef = useRef(null);
|
|
15
16
|
const errorTextId = `fieldset::${id}::error-text`;
|
|
16
17
|
const helperTextId = `fieldset::${id}::helper-text`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileValidateDetails } from '@zag-js/file-upload';
|
|
1
|
+
export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileValidateDetails, FileError, FileMimeType, FileRejection, } from '@zag-js/file-upload';
|
|
2
2
|
export { FileUploadClearTrigger as ClearTrigger, type FileUploadClearTriggerBaseProps as ClearTriggerBaseProps, type FileUploadClearTriggerProps as ClearTriggerProps, } from './file-upload-clear-trigger';
|
|
3
3
|
export { FileUploadContext as Context, type FileUploadContextProps as ContextProps } from './file-upload-context';
|
|
4
4
|
export { FileUploadDropzone as Dropzone, type FileUploadDropzoneBaseProps as DropzoneBaseProps, type FileUploadDropzoneProps as DropzoneProps, } from './file-upload-dropzone';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileValidateDetails } from '@zag-js/file-upload';
|
|
1
|
+
export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileValidateDetails, FileError, FileMimeType, FileRejection, } from '@zag-js/file-upload';
|
|
2
2
|
export { FileUploadClearTrigger as ClearTrigger, type FileUploadClearTriggerBaseProps as ClearTriggerBaseProps, type FileUploadClearTriggerProps as ClearTriggerProps, } from './file-upload-clear-trigger';
|
|
3
3
|
export { FileUploadContext as Context, type FileUploadContextProps as ContextProps } from './file-upload-context';
|
|
4
4
|
export { FileUploadDropzone as Dropzone, type FileUploadDropzoneBaseProps as DropzoneBaseProps, type FileUploadDropzoneProps as DropzoneProps, } from './file-upload-dropzone';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { FileAcceptDetails as FileUploadFileAcceptDetails, FileChangeDetails as FileUploadFileChangeDetails, FileRejectDetails as FileUploadFileRejectDetails, FileValidateDetails as FileUploadFileValidateDetails, } from '@zag-js/file-upload';
|
|
1
|
+
export type { FileAcceptDetails as FileUploadFileAcceptDetails, FileChangeDetails as FileUploadFileChangeDetails, FileRejectDetails as FileUploadFileRejectDetails, FileValidateDetails as FileUploadFileValidateDetails, FileError as FileUploadFileError, FileMimeType as FileUploadFileMimeType, FileRejection as FileUploadFileRejection, } from '@zag-js/file-upload';
|
|
2
2
|
export { FileUploadClearTrigger, type FileUploadClearTriggerBaseProps, type FileUploadClearTriggerProps, } from './file-upload-clear-trigger';
|
|
3
3
|
export { FileUploadContext, type FileUploadContextProps } from './file-upload-context';
|
|
4
4
|
export { FileUploadDropzone, type FileUploadDropzoneBaseProps, type FileUploadDropzoneProps, } from './file-upload-dropzone';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { FileAcceptDetails as FileUploadFileAcceptDetails, FileChangeDetails as FileUploadFileChangeDetails, FileRejectDetails as FileUploadFileRejectDetails, FileValidateDetails as FileUploadFileValidateDetails, } from '@zag-js/file-upload';
|
|
1
|
+
export type { FileAcceptDetails as FileUploadFileAcceptDetails, FileChangeDetails as FileUploadFileChangeDetails, FileRejectDetails as FileUploadFileRejectDetails, FileValidateDetails as FileUploadFileValidateDetails, FileError as FileUploadFileError, FileMimeType as FileUploadFileMimeType, FileRejection as FileUploadFileRejection, } from '@zag-js/file-upload';
|
|
2
2
|
export { FileUploadClearTrigger, type FileUploadClearTriggerBaseProps, type FileUploadClearTriggerProps, } from './file-upload-clear-trigger';
|
|
3
3
|
export { FileUploadContext, type FileUploadContextProps } from './file-upload-context';
|
|
4
4
|
export { FileUploadDropzone, type FileUploadDropzoneBaseProps, type FileUploadDropzoneProps, } from './file-upload-dropzone';
|
|
@@ -52,6 +52,7 @@ const carousel$1 = require('./carousel/carousel.cjs');
|
|
|
52
52
|
const checkboxContext = require('./checkbox/checkbox-context.cjs');
|
|
53
53
|
const checkboxControl = require('./checkbox/checkbox-control.cjs');
|
|
54
54
|
const checkboxGroup = require('./checkbox/checkbox-group.cjs');
|
|
55
|
+
const checkboxGroupProvider = require('./checkbox/checkbox-group-provider.cjs');
|
|
55
56
|
const checkboxHiddenInput = require('./checkbox/checkbox-hidden-input.cjs');
|
|
56
57
|
const checkboxIndicator = require('./checkbox/checkbox-indicator.cjs');
|
|
57
58
|
const checkboxLabel = require('./checkbox/checkbox-label.cjs');
|
|
@@ -763,6 +764,7 @@ exports.Carousel = carousel$1;
|
|
|
763
764
|
exports.CheckboxContext = checkboxContext.CheckboxContext;
|
|
764
765
|
exports.CheckboxControl = checkboxControl.CheckboxControl;
|
|
765
766
|
exports.CheckboxGroup = checkboxGroup.CheckboxGroup;
|
|
767
|
+
exports.CheckboxGroupProvider = checkboxGroupProvider.CheckboxGroupProvider;
|
|
766
768
|
exports.CheckboxHiddenInput = checkboxHiddenInput.CheckboxHiddenInput;
|
|
767
769
|
exports.CheckboxIndicator = checkboxIndicator.CheckboxIndicator;
|
|
768
770
|
exports.CheckboxLabel = checkboxLabel.CheckboxLabel;
|
package/dist/components/index.js
CHANGED
|
@@ -52,6 +52,7 @@ export { carousel as Carousel };
|
|
|
52
52
|
export { CheckboxContext } from './checkbox/checkbox-context.js';
|
|
53
53
|
export { CheckboxControl } from './checkbox/checkbox-control.js';
|
|
54
54
|
export { CheckboxGroup } from './checkbox/checkbox-group.js';
|
|
55
|
+
export { CheckboxGroupProvider } from './checkbox/checkbox-group-provider.js';
|
|
55
56
|
export { CheckboxHiddenInput } from './checkbox/checkbox-hidden-input.js';
|
|
56
57
|
export { CheckboxIndicator } from './checkbox/checkbox-indicator.js';
|
|
57
58
|
export { CheckboxLabel } from './checkbox/checkbox-label.js';
|
package/dist/index.cjs
CHANGED
|
@@ -52,6 +52,7 @@ const carousel$1 = require('./components/carousel/carousel.cjs');
|
|
|
52
52
|
const checkboxContext = require('./components/checkbox/checkbox-context.cjs');
|
|
53
53
|
const checkboxControl = require('./components/checkbox/checkbox-control.cjs');
|
|
54
54
|
const checkboxGroup = require('./components/checkbox/checkbox-group.cjs');
|
|
55
|
+
const checkboxGroupProvider = require('./components/checkbox/checkbox-group-provider.cjs');
|
|
55
56
|
const checkboxHiddenInput = require('./components/checkbox/checkbox-hidden-input.cjs');
|
|
56
57
|
const checkboxIndicator = require('./components/checkbox/checkbox-indicator.cjs');
|
|
57
58
|
const checkboxLabel = require('./components/checkbox/checkbox-label.cjs');
|
|
@@ -768,6 +769,7 @@ exports.Carousel = carousel$1;
|
|
|
768
769
|
exports.CheckboxContext = checkboxContext.CheckboxContext;
|
|
769
770
|
exports.CheckboxControl = checkboxControl.CheckboxControl;
|
|
770
771
|
exports.CheckboxGroup = checkboxGroup.CheckboxGroup;
|
|
772
|
+
exports.CheckboxGroupProvider = checkboxGroupProvider.CheckboxGroupProvider;
|
|
771
773
|
exports.CheckboxHiddenInput = checkboxHiddenInput.CheckboxHiddenInput;
|
|
772
774
|
exports.CheckboxIndicator = checkboxIndicator.CheckboxIndicator;
|
|
773
775
|
exports.CheckboxLabel = checkboxLabel.CheckboxLabel;
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ export { carousel as Carousel };
|
|
|
52
52
|
export { CheckboxContext } from './components/checkbox/checkbox-context.js';
|
|
53
53
|
export { CheckboxControl } from './components/checkbox/checkbox-control.js';
|
|
54
54
|
export { CheckboxGroup } from './components/checkbox/checkbox-group.js';
|
|
55
|
+
export { CheckboxGroupProvider } from './components/checkbox/checkbox-group-provider.js';
|
|
55
56
|
export { CheckboxHiddenInput } from './components/checkbox/checkbox-hidden-input.js';
|
|
56
57
|
export { CheckboxIndicator } from './components/checkbox/checkbox-indicator.js';
|
|
57
58
|
export { CheckboxLabel } from './components/checkbox/checkbox-label.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.17.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,68 +141,68 @@
|
|
|
141
141
|
"sideEffects": false,
|
|
142
142
|
"dependencies": {
|
|
143
143
|
"@internationalized/date": "3.8.2",
|
|
144
|
-
"@zag-js/accordion": "1.18.
|
|
145
|
-
"@zag-js/angle-slider": "1.18.
|
|
146
|
-
"@zag-js/anatomy": "1.18.
|
|
147
|
-
"@zag-js/auto-resize": "1.18.
|
|
148
|
-
"@zag-js/avatar": "1.18.
|
|
149
|
-
"@zag-js/carousel": "1.18.
|
|
150
|
-
"@zag-js/checkbox": "1.18.
|
|
151
|
-
"@zag-js/clipboard": "1.18.
|
|
152
|
-
"@zag-js/collapsible": "1.18.
|
|
153
|
-
"@zag-js/collection": "1.18.
|
|
154
|
-
"@zag-js/color-picker": "1.18.
|
|
155
|
-
"@zag-js/color-utils": "1.18.
|
|
156
|
-
"@zag-js/combobox": "1.18.
|
|
157
|
-
"@zag-js/core": "1.18.
|
|
158
|
-
"@zag-js/date-picker": "1.18.
|
|
159
|
-
"@zag-js/date-utils": "1.18.
|
|
160
|
-
"@zag-js/dialog": "1.18.
|
|
161
|
-
"@zag-js/dom-query": "1.18.
|
|
162
|
-
"@zag-js/editable": "1.18.
|
|
163
|
-
"@zag-js/file-upload": "1.18.
|
|
164
|
-
"@zag-js/file-utils": "1.18.
|
|
165
|
-
"@zag-js/focus-trap": "1.18.
|
|
166
|
-
"@zag-js/floating-panel": "1.18.
|
|
167
|
-
"@zag-js/highlight-word": "1.18.
|
|
168
|
-
"@zag-js/hover-card": "1.18.
|
|
169
|
-
"@zag-js/i18n-utils": "1.18.
|
|
170
|
-
"@zag-js/listbox": "1.18.
|
|
171
|
-
"@zag-js/menu": "1.18.
|
|
172
|
-
"@zag-js/number-input": "1.18.
|
|
173
|
-
"@zag-js/pagination": "1.18.
|
|
174
|
-
"@zag-js/password-input": "1.18.
|
|
175
|
-
"@zag-js/pin-input": "1.18.
|
|
176
|
-
"@zag-js/popover": "1.18.
|
|
177
|
-
"@zag-js/presence": "1.18.
|
|
178
|
-
"@zag-js/progress": "1.18.
|
|
179
|
-
"@zag-js/qr-code": "1.18.
|
|
180
|
-
"@zag-js/radio-group": "1.18.
|
|
181
|
-
"@zag-js/rating-group": "1.18.
|
|
182
|
-
"@zag-js/react": "1.18.
|
|
183
|
-
"@zag-js/select": "1.18.
|
|
184
|
-
"@zag-js/signature-pad": "1.18.
|
|
185
|
-
"@zag-js/slider": "1.18.
|
|
186
|
-
"@zag-js/splitter": "1.18.
|
|
187
|
-
"@zag-js/steps": "1.18.
|
|
188
|
-
"@zag-js/switch": "1.18.
|
|
189
|
-
"@zag-js/tabs": "1.18.
|
|
190
|
-
"@zag-js/tags-input": "1.18.
|
|
191
|
-
"@zag-js/time-picker": "1.18.
|
|
192
|
-
"@zag-js/timer": "1.18.
|
|
193
|
-
"@zag-js/toast": "1.18.
|
|
194
|
-
"@zag-js/toggle": "1.18.
|
|
195
|
-
"@zag-js/toggle-group": "1.18.
|
|
196
|
-
"@zag-js/tooltip": "1.18.
|
|
197
|
-
"@zag-js/tour": "1.18.
|
|
198
|
-
"@zag-js/tree-view": "1.18.
|
|
199
|
-
"@zag-js/types": "1.18.
|
|
200
|
-
"@zag-js/utils": "1.18.
|
|
144
|
+
"@zag-js/accordion": "1.18.4",
|
|
145
|
+
"@zag-js/angle-slider": "1.18.4",
|
|
146
|
+
"@zag-js/anatomy": "1.18.4",
|
|
147
|
+
"@zag-js/auto-resize": "1.18.4",
|
|
148
|
+
"@zag-js/avatar": "1.18.4",
|
|
149
|
+
"@zag-js/carousel": "1.18.4",
|
|
150
|
+
"@zag-js/checkbox": "1.18.4",
|
|
151
|
+
"@zag-js/clipboard": "1.18.4",
|
|
152
|
+
"@zag-js/collapsible": "1.18.4",
|
|
153
|
+
"@zag-js/collection": "1.18.4",
|
|
154
|
+
"@zag-js/color-picker": "1.18.4",
|
|
155
|
+
"@zag-js/color-utils": "1.18.4",
|
|
156
|
+
"@zag-js/combobox": "1.18.4",
|
|
157
|
+
"@zag-js/core": "1.18.4",
|
|
158
|
+
"@zag-js/date-picker": "1.18.4",
|
|
159
|
+
"@zag-js/date-utils": "1.18.4",
|
|
160
|
+
"@zag-js/dialog": "1.18.4",
|
|
161
|
+
"@zag-js/dom-query": "1.18.4",
|
|
162
|
+
"@zag-js/editable": "1.18.4",
|
|
163
|
+
"@zag-js/file-upload": "1.18.4",
|
|
164
|
+
"@zag-js/file-utils": "1.18.4",
|
|
165
|
+
"@zag-js/focus-trap": "1.18.4",
|
|
166
|
+
"@zag-js/floating-panel": "1.18.4",
|
|
167
|
+
"@zag-js/highlight-word": "1.18.4",
|
|
168
|
+
"@zag-js/hover-card": "1.18.4",
|
|
169
|
+
"@zag-js/i18n-utils": "1.18.4",
|
|
170
|
+
"@zag-js/listbox": "1.18.4",
|
|
171
|
+
"@zag-js/menu": "1.18.4",
|
|
172
|
+
"@zag-js/number-input": "1.18.4",
|
|
173
|
+
"@zag-js/pagination": "1.18.4",
|
|
174
|
+
"@zag-js/password-input": "1.18.4",
|
|
175
|
+
"@zag-js/pin-input": "1.18.4",
|
|
176
|
+
"@zag-js/popover": "1.18.4",
|
|
177
|
+
"@zag-js/presence": "1.18.4",
|
|
178
|
+
"@zag-js/progress": "1.18.4",
|
|
179
|
+
"@zag-js/qr-code": "1.18.4",
|
|
180
|
+
"@zag-js/radio-group": "1.18.4",
|
|
181
|
+
"@zag-js/rating-group": "1.18.4",
|
|
182
|
+
"@zag-js/react": "1.18.4",
|
|
183
|
+
"@zag-js/select": "1.18.4",
|
|
184
|
+
"@zag-js/signature-pad": "1.18.4",
|
|
185
|
+
"@zag-js/slider": "1.18.4",
|
|
186
|
+
"@zag-js/splitter": "1.18.4",
|
|
187
|
+
"@zag-js/steps": "1.18.4",
|
|
188
|
+
"@zag-js/switch": "1.18.4",
|
|
189
|
+
"@zag-js/tabs": "1.18.4",
|
|
190
|
+
"@zag-js/tags-input": "1.18.4",
|
|
191
|
+
"@zag-js/time-picker": "1.18.4",
|
|
192
|
+
"@zag-js/timer": "1.18.4",
|
|
193
|
+
"@zag-js/toast": "1.18.4",
|
|
194
|
+
"@zag-js/toggle": "1.18.4",
|
|
195
|
+
"@zag-js/toggle-group": "1.18.4",
|
|
196
|
+
"@zag-js/tooltip": "1.18.4",
|
|
197
|
+
"@zag-js/tour": "1.18.4",
|
|
198
|
+
"@zag-js/tree-view": "1.18.4",
|
|
199
|
+
"@zag-js/types": "1.18.4",
|
|
200
|
+
"@zag-js/utils": "1.18.4"
|
|
201
201
|
},
|
|
202
202
|
"devDependencies": {
|
|
203
203
|
"@biomejs/biome": "1.9.4",
|
|
204
|
-
"@storybook/addon-a11y": "9.0.
|
|
205
|
-
"@storybook/react-vite": "9.0.
|
|
204
|
+
"@storybook/addon-a11y": "9.0.17",
|
|
205
|
+
"@storybook/react-vite": "9.0.17",
|
|
206
206
|
"@testing-library/dom": "10.4.0",
|
|
207
207
|
"@testing-library/jest-dom": "6.6.3",
|
|
208
208
|
"@testing-library/react": "16.3.0",
|
|
@@ -210,24 +210,24 @@
|
|
|
210
210
|
"@types/jsdom": "21.1.7",
|
|
211
211
|
"@types/react": "19.1.8",
|
|
212
212
|
"@types/react-dom": "19.1.6",
|
|
213
|
-
"@vitejs/plugin-react": "4.
|
|
213
|
+
"@vitejs/plugin-react": "4.6.0",
|
|
214
214
|
"clean-package": "2.2.0",
|
|
215
215
|
"globby": "14.1.0",
|
|
216
216
|
"happy-dom": "18.0.1",
|
|
217
|
-
"lucide-react": "0.
|
|
217
|
+
"lucide-react": "0.525.0",
|
|
218
218
|
"react": "19.1.0",
|
|
219
219
|
"react-dom": "19.1.0",
|
|
220
220
|
"react-shadow": "20.6.0",
|
|
221
221
|
"react-use": "17.6.0",
|
|
222
222
|
"react-frame-component": "5.2.7",
|
|
223
|
-
"react-hook-form": "7.
|
|
223
|
+
"react-hook-form": "7.60.0",
|
|
224
224
|
"resize-observer-polyfill": "1.5.1",
|
|
225
|
-
"storybook": "9.0.
|
|
225
|
+
"storybook": "9.0.17",
|
|
226
226
|
"typescript": "5.8.3",
|
|
227
|
-
"vite": "
|
|
227
|
+
"vite": "7.0.5",
|
|
228
228
|
"vite-plugin-dts": "4.5.4",
|
|
229
|
-
"vitest": "3.2.
|
|
230
|
-
"@vitest/coverage-v8": "3.2.
|
|
229
|
+
"vitest": "3.2.4",
|
|
230
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
231
231
|
"vitest-axe": "1.0.0-pre.5"
|
|
232
232
|
},
|
|
233
233
|
"peerDependencies": {
|