@ark-ui/react 4.0.0 → 4.1.1
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/accordion/accordion-item.cjs +1 -0
- package/dist/components/accordion/accordion-item.js +1 -0
- package/dist/components/color-picker/color-picker-content.cjs +3 -2
- package/dist/components/color-picker/color-picker-content.js +3 -2
- package/dist/components/combobox/combobox-content.cjs +3 -2
- package/dist/components/combobox/combobox-content.js +3 -2
- package/dist/components/date-picker/date-picker-content.cjs +3 -6
- package/dist/components/date-picker/date-picker-content.js +3 -6
- package/dist/components/dialog/dialog-backdrop.cjs +3 -2
- package/dist/components/dialog/dialog-backdrop.js +3 -2
- package/dist/components/dialog/dialog-content.cjs +3 -2
- package/dist/components/dialog/dialog-content.js +3 -2
- package/dist/components/factory.cjs +12 -4
- package/dist/components/factory.js +12 -4
- package/dist/components/field/field-textarea.cjs +2 -2
- package/dist/components/field/field-textarea.js +1 -1
- package/dist/components/file-upload/file-upload-item-preview-image.cjs +1 -1
- package/dist/components/file-upload/file-upload-item-preview-image.js +1 -1
- package/dist/components/hover-card/hover-card-content.cjs +3 -2
- package/dist/components/hover-card/hover-card-content.js +3 -2
- package/dist/components/index.cjs +19 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/menu/menu-content.cjs +3 -2
- package/dist/components/menu/menu-content.js +3 -2
- package/dist/components/popover/popover-content.cjs +3 -2
- package/dist/components/popover/popover-content.js +3 -2
- package/dist/components/presence/presence.cjs +4 -2
- package/dist/components/presence/presence.js +4 -2
- package/dist/components/presence/use-presence.cjs +2 -3
- package/dist/components/presence/use-presence.d.cts +2 -3
- package/dist/components/presence/use-presence.d.ts +2 -3
- package/dist/components/presence/use-presence.js +2 -3
- package/dist/components/select/select-content.cjs +3 -2
- package/dist/components/select/select-content.js +3 -2
- package/dist/components/tabs/tab-content.cjs +3 -2
- package/dist/components/tabs/tab-content.js +3 -2
- package/dist/components/time-picker/index.cjs +5 -0
- package/dist/components/time-picker/index.d.cts +1 -0
- package/dist/components/time-picker/index.d.ts +1 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/time-picker/time-picker-content.cjs +3 -6
- package/dist/components/time-picker/time-picker-content.js +3 -6
- package/dist/components/time-picker/use-time-picker.cjs +3 -8
- package/dist/components/time-picker/use-time-picker.d.cts +2 -14
- package/dist/components/time-picker/use-time-picker.d.ts +2 -14
- package/dist/components/time-picker/use-time-picker.js +3 -8
- package/dist/components/toggle/index.cjs +21 -0
- package/dist/components/toggle/index.d.cts +7 -0
- package/dist/components/toggle/index.d.ts +7 -0
- package/dist/components/toggle/index.js +8 -0
- package/dist/components/toggle/toggle-context.cjs +10 -0
- package/dist/components/toggle/toggle-context.d.cts +6 -0
- package/dist/components/toggle/toggle-context.d.ts +6 -0
- package/dist/components/toggle/toggle-context.js +6 -0
- package/dist/components/toggle/toggle-indicator.cjs +20 -0
- package/dist/components/toggle/toggle-indicator.d.cts +11 -0
- package/dist/components/toggle/toggle-indicator.d.ts +11 -0
- package/dist/components/toggle/toggle-indicator.js +16 -0
- package/dist/components/toggle/toggle-root.cjs +27 -0
- package/dist/components/toggle/toggle-root.d.cts +8 -0
- package/dist/components/toggle/toggle-root.d.ts +8 -0
- package/dist/components/toggle/toggle-root.js +23 -0
- package/dist/components/toggle/toggle.anatomy.cjs +12 -0
- package/dist/components/toggle/toggle.anatomy.d.cts +3 -0
- package/dist/components/toggle/toggle.anatomy.d.ts +3 -0
- package/dist/components/toggle/toggle.anatomy.js +7 -0
- package/dist/components/toggle/toggle.cjs +15 -0
- package/dist/components/toggle/toggle.d.cts +4 -0
- package/dist/components/toggle/toggle.d.ts +4 -0
- package/dist/components/toggle/toggle.js +4 -0
- package/dist/components/toggle/use-toggle-context.cjs +15 -0
- package/dist/components/toggle/use-toggle-context.d.cts +5 -0
- package/dist/components/toggle/use-toggle-context.d.ts +5 -0
- package/dist/components/toggle/use-toggle-context.js +10 -0
- package/dist/components/toggle/use-toggle.cjs +48 -0
- package/dist/components/toggle/use-toggle.d.cts +35 -0
- package/dist/components/toggle/use-toggle.d.ts +35 -0
- package/dist/components/toggle/use-toggle.js +44 -0
- package/dist/components/tooltip/tooltip-content.cjs +3 -2
- package/dist/components/tooltip/tooltip-content.js +3 -2
- package/dist/index.cjs +19 -0
- package/dist/index.js +9 -0
- package/dist/utils/compose-refs.d.cts +2 -2
- package/dist/utils/compose-refs.d.ts +2 -2
- package/package.json +78 -71
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const toggleContext = require('./toggle-context.cjs');
|
|
6
|
+
const toggleIndicator = require('./toggle-indicator.cjs');
|
|
7
|
+
const toggleRoot = require('./toggle-root.cjs');
|
|
8
|
+
const toggle_anatomy = require('./toggle.anatomy.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.Context = toggleContext.ToggleContext;
|
|
13
|
+
exports.Indicator = toggleIndicator.ToggleIndicator;
|
|
14
|
+
exports.Root = toggleRoot.ToggleRoot;
|
|
15
|
+
exports.toggleAnatomy = toggle_anatomy.toggleAnatomy;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ToggleContext as Context, type ToggleContextProps as ContextProps } from './toggle-context';
|
|
2
|
+
export { ToggleIndicator as Indicator, type ToggleIndicatorProps as IndicatorProps, type ToggleIndicatorBaseProps as IndicatorBaseProps, } from './toggle-indicator';
|
|
3
|
+
export { ToggleRoot as Root, type ToggleRootBaseProps as RootBaseProps, type ToggleRootProps as RootProps, } from './toggle-root';
|
|
4
|
+
export { toggleAnatomy } from './toggle.anatomy';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ToggleContext as Context, type ToggleContextProps as ContextProps } from './toggle-context';
|
|
2
|
+
export { ToggleIndicator as Indicator, type ToggleIndicatorProps as IndicatorProps, type ToggleIndicatorBaseProps as IndicatorBaseProps, } from './toggle-indicator';
|
|
3
|
+
export { ToggleRoot as Root, type ToggleRootBaseProps as RootBaseProps, type ToggleRootProps as RootProps, } from './toggle-root';
|
|
4
|
+
export { toggleAnatomy } from './toggle.anatomy';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const createContext = require('../../utils/create-context.cjs');
|
|
7
|
+
|
|
8
|
+
const [ToggleProvider, useToggleContext] = createContext.createContext({
|
|
9
|
+
name: "ToggleContext",
|
|
10
|
+
hookName: "useToggleContext",
|
|
11
|
+
providerName: "<ToggleProvider />"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.ToggleProvider = ToggleProvider;
|
|
15
|
+
exports.useToggleContext = useToggleContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from '../../utils/create-context.js';
|
|
3
|
+
|
|
4
|
+
const [ToggleProvider, useToggleContext] = createContext({
|
|
5
|
+
name: "ToggleContext",
|
|
6
|
+
hookName: "useToggleContext",
|
|
7
|
+
providerName: "<ToggleProvider />"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { ToggleProvider, useToggleContext };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const domQuery = require('@zag-js/dom-query');
|
|
7
|
+
const useControllableState = require('../../utils/use-controllable-state.cjs');
|
|
8
|
+
const toggle_anatomy = require('./toggle.anatomy.cjs');
|
|
9
|
+
|
|
10
|
+
function useToggle(props) {
|
|
11
|
+
const { defaultPressed, pressed, onPressedChange, disabled } = props;
|
|
12
|
+
const [pressedState, setPressedState] = useControllableState.useControllableState({
|
|
13
|
+
defaultValue: !!defaultPressed,
|
|
14
|
+
value: pressed,
|
|
15
|
+
onChange: onPressedChange
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
pressed: pressedState,
|
|
19
|
+
disabled: !!disabled,
|
|
20
|
+
setPressed: setPressedState,
|
|
21
|
+
getRootProps() {
|
|
22
|
+
return {
|
|
23
|
+
...toggle_anatomy.parts.root.attrs,
|
|
24
|
+
type: "button",
|
|
25
|
+
disabled,
|
|
26
|
+
"aria-pressed": pressedState,
|
|
27
|
+
"data-state": pressedState ? "on" : "off",
|
|
28
|
+
"data-pressed": domQuery.dataAttr(pressedState),
|
|
29
|
+
"data-disabled": domQuery.dataAttr(disabled),
|
|
30
|
+
onClick(event) {
|
|
31
|
+
if (event.defaultPrevented) return;
|
|
32
|
+
if (disabled) return;
|
|
33
|
+
setPressedState(!pressedState);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
getIndicatorProps() {
|
|
38
|
+
return {
|
|
39
|
+
...toggle_anatomy.parts.indicator.attrs,
|
|
40
|
+
"data-disabled": domQuery.dataAttr(disabled),
|
|
41
|
+
"data-pressed": domQuery.dataAttr(pressedState),
|
|
42
|
+
"data-state": pressedState ? "on" : "off"
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports.useToggle = useToggle;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface UseToggleProps {
|
|
2
|
+
/**
|
|
3
|
+
* Whether the toggle is disabled.
|
|
4
|
+
*/
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The default pressed state of the toggle.
|
|
8
|
+
*/
|
|
9
|
+
defaultPressed?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The pressed state of the toggle.
|
|
12
|
+
*/
|
|
13
|
+
pressed?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Event handler called when the pressed state of the toggle changes.
|
|
16
|
+
*/
|
|
17
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface UseToggleReturn {
|
|
20
|
+
/**
|
|
21
|
+
* Whether the toggle is pressed.
|
|
22
|
+
*/
|
|
23
|
+
pressed: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the toggle is disabled.
|
|
26
|
+
*/
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the pressed state of the toggle.
|
|
30
|
+
*/
|
|
31
|
+
setPressed(pressed: boolean): void;
|
|
32
|
+
getRootProps(): React.ComponentProps<'button'>;
|
|
33
|
+
getIndicatorProps(): React.ComponentProps<'div'>;
|
|
34
|
+
}
|
|
35
|
+
export declare function useToggle(props: UseToggleProps): UseToggleReturn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface UseToggleProps {
|
|
2
|
+
/**
|
|
3
|
+
* Whether the toggle is disabled.
|
|
4
|
+
*/
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The default pressed state of the toggle.
|
|
8
|
+
*/
|
|
9
|
+
defaultPressed?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The pressed state of the toggle.
|
|
12
|
+
*/
|
|
13
|
+
pressed?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Event handler called when the pressed state of the toggle changes.
|
|
16
|
+
*/
|
|
17
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface UseToggleReturn {
|
|
20
|
+
/**
|
|
21
|
+
* Whether the toggle is pressed.
|
|
22
|
+
*/
|
|
23
|
+
pressed: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the toggle is disabled.
|
|
26
|
+
*/
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the pressed state of the toggle.
|
|
30
|
+
*/
|
|
31
|
+
setPressed(pressed: boolean): void;
|
|
32
|
+
getRootProps(): React.ComponentProps<'button'>;
|
|
33
|
+
getIndicatorProps(): React.ComponentProps<'div'>;
|
|
34
|
+
}
|
|
35
|
+
export declare function useToggle(props: UseToggleProps): UseToggleReturn;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { dataAttr } from '@zag-js/dom-query';
|
|
3
|
+
import { useControllableState } from '../../utils/use-controllable-state.js';
|
|
4
|
+
import { parts } from './toggle.anatomy.js';
|
|
5
|
+
|
|
6
|
+
function useToggle(props) {
|
|
7
|
+
const { defaultPressed, pressed, onPressedChange, disabled } = props;
|
|
8
|
+
const [pressedState, setPressedState] = useControllableState({
|
|
9
|
+
defaultValue: !!defaultPressed,
|
|
10
|
+
value: pressed,
|
|
11
|
+
onChange: onPressedChange
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
pressed: pressedState,
|
|
15
|
+
disabled: !!disabled,
|
|
16
|
+
setPressed: setPressedState,
|
|
17
|
+
getRootProps() {
|
|
18
|
+
return {
|
|
19
|
+
...parts.root.attrs,
|
|
20
|
+
type: "button",
|
|
21
|
+
disabled,
|
|
22
|
+
"aria-pressed": pressedState,
|
|
23
|
+
"data-state": pressedState ? "on" : "off",
|
|
24
|
+
"data-pressed": dataAttr(pressedState),
|
|
25
|
+
"data-disabled": dataAttr(disabled),
|
|
26
|
+
onClick(event) {
|
|
27
|
+
if (event.defaultPrevented) return;
|
|
28
|
+
if (disabled) return;
|
|
29
|
+
setPressedState(!pressedState);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
getIndicatorProps() {
|
|
34
|
+
return {
|
|
35
|
+
...parts.indicator.attrs,
|
|
36
|
+
"data-disabled": dataAttr(disabled),
|
|
37
|
+
"data-pressed": dataAttr(pressedState),
|
|
38
|
+
"data-state": pressedState ? "on" : "off"
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { useToggle };
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
6
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
|
+
const composeRefs = require('../../utils/compose-refs.cjs');
|
|
9
10
|
const factory = require('../factory.cjs');
|
|
10
11
|
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
11
12
|
const useTooltipContext = require('./use-tooltip-context.cjs');
|
|
@@ -13,11 +14,11 @@ const useTooltipContext = require('./use-tooltip-context.cjs');
|
|
|
13
14
|
const TooltipContent = react.forwardRef((props, ref) => {
|
|
14
15
|
const tooltip = useTooltipContext.useTooltipContext();
|
|
15
16
|
const presence = usePresenceContext.usePresenceContext();
|
|
16
|
-
const mergedProps = react$1.mergeProps(tooltip.getContentProps(), presence.getPresenceProps(
|
|
17
|
+
const mergedProps = react$1.mergeProps(tooltip.getContentProps(), presence.getPresenceProps(), props);
|
|
17
18
|
if (presence.unmounted) {
|
|
18
19
|
return null;
|
|
19
20
|
}
|
|
20
|
-
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps });
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref: composeRefs.composeRefs(presence.ref, ref) });
|
|
21
22
|
});
|
|
22
23
|
TooltipContent.displayName = "TooltipContent";
|
|
23
24
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
+
import { composeRefs } from '../../utils/compose-refs.js';
|
|
5
6
|
import { ark } from '../factory.js';
|
|
6
7
|
import { usePresenceContext } from '../presence/use-presence-context.js';
|
|
7
8
|
import { useTooltipContext } from './use-tooltip-context.js';
|
|
@@ -9,11 +10,11 @@ import { useTooltipContext } from './use-tooltip-context.js';
|
|
|
9
10
|
const TooltipContent = forwardRef((props, ref) => {
|
|
10
11
|
const tooltip = useTooltipContext();
|
|
11
12
|
const presence = usePresenceContext();
|
|
12
|
-
const mergedProps = mergeProps(tooltip.getContentProps(), presence.getPresenceProps(
|
|
13
|
+
const mergedProps = mergeProps(tooltip.getContentProps(), presence.getPresenceProps(), props);
|
|
13
14
|
if (presence.unmounted) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
16
|
-
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps });
|
|
17
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });
|
|
17
18
|
});
|
|
18
19
|
TooltipContent.displayName = "TooltipContent";
|
|
19
20
|
|
package/dist/index.cjs
CHANGED
|
@@ -498,6 +498,7 @@ const useTagsInput = require('./components/tags-input/use-tags-input.cjs');
|
|
|
498
498
|
const useTagsInputContext = require('./components/tags-input/use-tags-input-context.cjs');
|
|
499
499
|
const useTagsInputItemContext = require('./components/tags-input/use-tags-input-item-context.cjs');
|
|
500
500
|
const tagsInput$1 = require('./components/tags-input/tags-input.cjs');
|
|
501
|
+
const date = require('@internationalized/date');
|
|
501
502
|
const timePickerCell = require('./components/time-picker/time-picker-cell.cjs');
|
|
502
503
|
const timePickerClearTrigger = require('./components/time-picker/time-picker-clear-trigger.cjs');
|
|
503
504
|
const timePickerColumn = require('./components/time-picker/time-picker-column.cjs');
|
|
@@ -535,6 +536,13 @@ const toastTitle = require('./components/toast/toast-title.cjs');
|
|
|
535
536
|
const toaster = require('./components/toast/toaster.cjs');
|
|
536
537
|
const useToastContext = require('./components/toast/use-toast-context.cjs');
|
|
537
538
|
const toast$1 = require('./components/toast/toast.cjs');
|
|
539
|
+
const toggleContext = require('./components/toggle/toggle-context.cjs');
|
|
540
|
+
const toggleIndicator = require('./components/toggle/toggle-indicator.cjs');
|
|
541
|
+
const toggleRoot = require('./components/toggle/toggle-root.cjs');
|
|
542
|
+
const toggle_anatomy = require('./components/toggle/toggle.anatomy.cjs');
|
|
543
|
+
const useToggle = require('./components/toggle/use-toggle.cjs');
|
|
544
|
+
const useToggleContext = require('./components/toggle/use-toggle-context.cjs');
|
|
545
|
+
const toggle = require('./components/toggle/toggle.cjs');
|
|
538
546
|
const toggleGroupContext = require('./components/toggle-group/toggle-group-context.cjs');
|
|
539
547
|
const toggleGroupItem = require('./components/toggle-group/toggle-group-item.cjs');
|
|
540
548
|
const toggleGroupRoot = require('./components/toggle-group/toggle-group-root.cjs');
|
|
@@ -1114,6 +1122,10 @@ exports.useTagsInput = useTagsInput.useTagsInput;
|
|
|
1114
1122
|
exports.useTagsInputContext = useTagsInputContext.useTagsInputContext;
|
|
1115
1123
|
exports.useTagsInputItemContext = useTagsInputItemContext.useTagsInputItemContext;
|
|
1116
1124
|
exports.TagsInput = tagsInput$1;
|
|
1125
|
+
Object.defineProperty(exports, "parseTime", {
|
|
1126
|
+
enumerable: true,
|
|
1127
|
+
get: () => date.parseTime
|
|
1128
|
+
});
|
|
1117
1129
|
exports.TimePickerCell = timePickerCell.TimePickerCell;
|
|
1118
1130
|
exports.TimePickerClearTrigger = timePickerClearTrigger.TimePickerClearTrigger;
|
|
1119
1131
|
exports.TimePickerColumn = timePickerColumn.TimePickerColumn;
|
|
@@ -1151,6 +1163,13 @@ exports.ToastTitle = toastTitle.ToastTitle;
|
|
|
1151
1163
|
exports.Toaster = toaster.Toaster;
|
|
1152
1164
|
exports.useToastContext = useToastContext.useToastContext;
|
|
1153
1165
|
exports.Toast = toast$1;
|
|
1166
|
+
exports.ToggleContext = toggleContext.ToggleContext;
|
|
1167
|
+
exports.ToggleIndicator = toggleIndicator.ToggleIndicator;
|
|
1168
|
+
exports.ToggleRoot = toggleRoot.ToggleRoot;
|
|
1169
|
+
exports.toggleAnatomy = toggle_anatomy.toggleAnatomy;
|
|
1170
|
+
exports.useToggle = useToggle.useToggle;
|
|
1171
|
+
exports.useToggleContext = useToggleContext.useToggleContext;
|
|
1172
|
+
exports.Toggle = toggle;
|
|
1154
1173
|
exports.ToggleGroupContext = toggleGroupContext.ToggleGroupContext;
|
|
1155
1174
|
exports.ToggleGroupItem = toggleGroupItem.ToggleGroupItem;
|
|
1156
1175
|
exports.ToggleGroupRoot = toggleGroupRoot.ToggleGroupRoot;
|
package/dist/index.js
CHANGED
|
@@ -528,6 +528,7 @@ export { useTagsInputContext } from './components/tags-input/use-tags-input-cont
|
|
|
528
528
|
export { useTagsInputItemContext } from './components/tags-input/use-tags-input-item-context.js';
|
|
529
529
|
import * as tagsInput from './components/tags-input/tags-input.js';
|
|
530
530
|
export { tagsInput as TagsInput };
|
|
531
|
+
export { parseTime } from '@internationalized/date';
|
|
531
532
|
export { TimePickerCell } from './components/time-picker/time-picker-cell.js';
|
|
532
533
|
export { TimePickerClearTrigger } from './components/time-picker/time-picker-clear-trigger.js';
|
|
533
534
|
export { TimePickerColumn } from './components/time-picker/time-picker-column.js';
|
|
@@ -568,6 +569,14 @@ export { Toaster } from './components/toast/toaster.js';
|
|
|
568
569
|
export { useToastContext } from './components/toast/use-toast-context.js';
|
|
569
570
|
import * as toast from './components/toast/toast.js';
|
|
570
571
|
export { toast as Toast };
|
|
572
|
+
export { ToggleContext } from './components/toggle/toggle-context.js';
|
|
573
|
+
export { ToggleIndicator } from './components/toggle/toggle-indicator.js';
|
|
574
|
+
export { ToggleRoot } from './components/toggle/toggle-root.js';
|
|
575
|
+
export { toggleAnatomy } from './components/toggle/toggle.anatomy.js';
|
|
576
|
+
export { useToggle } from './components/toggle/use-toggle.js';
|
|
577
|
+
export { useToggleContext } from './components/toggle/use-toggle-context.js';
|
|
578
|
+
import * as toggle from './components/toggle/toggle.js';
|
|
579
|
+
export { toggle as Toggle };
|
|
571
580
|
export { ToggleGroupContext } from './components/toggle-group/toggle-group-context.js';
|
|
572
581
|
export { ToggleGroupItem } from './components/toggle-group/toggle-group-item.js';
|
|
573
582
|
export { ToggleGroupRoot } from './components/toggle-group/toggle-group-root.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
2
|
-
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T) => void;
|
|
1
|
+
type PossibleRef<T> = React.Ref<T | null> | undefined;
|
|
2
|
+
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
3
3
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
2
|
-
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T) => void;
|
|
1
|
+
type PossibleRef<T> = React.Ref<T | null> | undefined;
|
|
2
|
+
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
3
3
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accordion",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
],
|
|
63
63
|
"exports": {
|
|
64
64
|
".": {
|
|
65
|
-
"source": "./src/index.ts",
|
|
66
65
|
"import": {
|
|
67
66
|
"types": "./dist/index.d.ts",
|
|
68
67
|
"default": "./dist/index.js"
|
|
@@ -73,7 +72,6 @@
|
|
|
73
72
|
}
|
|
74
73
|
},
|
|
75
74
|
"./collection": {
|
|
76
|
-
"source": "./src/components/collection.ts",
|
|
77
75
|
"import": {
|
|
78
76
|
"types": "./dist/components/collection.d.ts",
|
|
79
77
|
"default": "./dist/components/collection.js"
|
|
@@ -84,7 +82,6 @@
|
|
|
84
82
|
}
|
|
85
83
|
},
|
|
86
84
|
"./factory": {
|
|
87
|
-
"source": "./src/components/factory.ts",
|
|
88
85
|
"import": {
|
|
89
86
|
"types": "./dist/components/factory.d.ts",
|
|
90
87
|
"default": "./dist/components/factory.js"
|
|
@@ -95,7 +92,6 @@
|
|
|
95
92
|
}
|
|
96
93
|
},
|
|
97
94
|
"./environment": {
|
|
98
|
-
"source": "./src/providers/environment/index.ts",
|
|
99
95
|
"import": {
|
|
100
96
|
"types": "./dist/providers/environment/index.d.ts",
|
|
101
97
|
"default": "./dist/providers/environment/index.js"
|
|
@@ -106,7 +102,6 @@
|
|
|
106
102
|
}
|
|
107
103
|
},
|
|
108
104
|
"./locale": {
|
|
109
|
-
"source": "./src/providers/locale/index.ts",
|
|
110
105
|
"import": {
|
|
111
106
|
"types": "./dist/providers/locale/index.d.ts",
|
|
112
107
|
"default": "./dist/providers/locale/index.js"
|
|
@@ -117,7 +112,6 @@
|
|
|
117
112
|
}
|
|
118
113
|
},
|
|
119
114
|
"./*": {
|
|
120
|
-
"source": "./src/components/*/index.ts",
|
|
121
115
|
"import": {
|
|
122
116
|
"types": "./dist/components/*/index.d.ts",
|
|
123
117
|
"default": "./dist/components/*/index.js"
|
|
@@ -135,93 +129,106 @@
|
|
|
135
129
|
"test:ci": "vitest --run",
|
|
136
130
|
"typecheck": "tsc",
|
|
137
131
|
"storybook": "storybook dev -p 6006",
|
|
138
|
-
"release-it": "release-it --config ../../release-it.json"
|
|
132
|
+
"release-it": "release-it --config ../../release-it.json",
|
|
133
|
+
"prepack": "clean-package",
|
|
134
|
+
"postpack": "clean-package restore"
|
|
135
|
+
},
|
|
136
|
+
"clean-package": {
|
|
137
|
+
"remove": [
|
|
138
|
+
"exports.\\..source",
|
|
139
|
+
"exports.\\./collection.source",
|
|
140
|
+
"exports.\\./factory.source",
|
|
141
|
+
"exports.\\./environment.source",
|
|
142
|
+
"exports.\\./locale.source",
|
|
143
|
+
"exports.\\./*.source"
|
|
144
|
+
]
|
|
139
145
|
},
|
|
140
146
|
"publishConfig": {
|
|
141
147
|
"access": "public"
|
|
142
148
|
},
|
|
143
149
|
"sideEffects": false,
|
|
144
150
|
"dependencies": {
|
|
145
|
-
"@internationalized/date": "3.5.
|
|
146
|
-
"@zag-js/accordion": "0.
|
|
147
|
-
"@zag-js/anatomy": "0.
|
|
148
|
-
"@zag-js/avatar": "0.
|
|
149
|
-
"@zag-js/carousel": "0.
|
|
150
|
-
"@zag-js/checkbox": "0.
|
|
151
|
-
"@zag-js/clipboard": "0.
|
|
152
|
-
"@zag-js/collapsible": "0.
|
|
153
|
-
"@zag-js/collection": "0.
|
|
154
|
-
"@zag-js/color-picker": "0.
|
|
155
|
-
"@zag-js/color-utils": "0.
|
|
156
|
-
"@zag-js/combobox": "0.
|
|
157
|
-
"@zag-js/core": "0.
|
|
158
|
-
"@zag-js/date-picker": "0.
|
|
159
|
-
"@zag-js/date-utils": "0.
|
|
160
|
-
"@zag-js/dialog": "0.
|
|
161
|
-
"@zag-js/dom-query": "0.
|
|
162
|
-
"@zag-js/editable": "0.
|
|
163
|
-
"@zag-js/file-upload": "0.
|
|
164
|
-
"@zag-js/file-utils": "0.
|
|
165
|
-
"@zag-js/highlight-word": "0.
|
|
166
|
-
"@zag-js/hover-card": "0.
|
|
167
|
-
"@zag-js/i18n-utils": "0.
|
|
168
|
-
"@zag-js/menu": "0.
|
|
169
|
-
"@zag-js/number-input": "0.
|
|
170
|
-
"@zag-js/pagination": "0.
|
|
171
|
-
"@zag-js/pin-input": "0.
|
|
172
|
-
"@zag-js/popover": "0.
|
|
173
|
-
"@zag-js/presence": "0.
|
|
174
|
-
"@zag-js/progress": "0.
|
|
175
|
-
"@zag-js/qr-code": "0.
|
|
176
|
-
"@zag-js/radio-group": "0.
|
|
177
|
-
"@zag-js/rating-group": "0.
|
|
178
|
-
"@zag-js/react": "0.
|
|
179
|
-
"@zag-js/select": "0.
|
|
180
|
-
"@zag-js/signature-pad": "0.
|
|
181
|
-
"@zag-js/slider": "0.
|
|
182
|
-
"@zag-js/splitter": "0.
|
|
183
|
-
"@zag-js/steps": "0.
|
|
184
|
-
"@zag-js/switch": "0.
|
|
185
|
-
"@zag-js/tabs": "0.
|
|
186
|
-
"@zag-js/tags-input": "0.
|
|
187
|
-
"@zag-js/time-picker": "0.
|
|
188
|
-
"@zag-js/timer": "0.
|
|
189
|
-
"@zag-js/toast": "0.
|
|
190
|
-
"@zag-js/toggle-group": "0.
|
|
191
|
-
"@zag-js/tooltip": "0.
|
|
192
|
-
"@zag-js/tree-view": "0.
|
|
193
|
-
"@zag-js/types": "0.
|
|
151
|
+
"@internationalized/date": "3.5.6",
|
|
152
|
+
"@zag-js/accordion": "0.74.2",
|
|
153
|
+
"@zag-js/anatomy": "0.74.2",
|
|
154
|
+
"@zag-js/avatar": "0.74.2",
|
|
155
|
+
"@zag-js/carousel": "0.74.2",
|
|
156
|
+
"@zag-js/checkbox": "0.74.2",
|
|
157
|
+
"@zag-js/clipboard": "0.74.2",
|
|
158
|
+
"@zag-js/collapsible": "0.74.2",
|
|
159
|
+
"@zag-js/collection": "0.74.2",
|
|
160
|
+
"@zag-js/color-picker": "0.74.2",
|
|
161
|
+
"@zag-js/color-utils": "0.74.2",
|
|
162
|
+
"@zag-js/combobox": "0.74.2",
|
|
163
|
+
"@zag-js/core": "0.74.2",
|
|
164
|
+
"@zag-js/date-picker": "0.74.2",
|
|
165
|
+
"@zag-js/date-utils": "0.74.2",
|
|
166
|
+
"@zag-js/dialog": "0.74.2",
|
|
167
|
+
"@zag-js/dom-query": "0.74.2",
|
|
168
|
+
"@zag-js/editable": "0.74.2",
|
|
169
|
+
"@zag-js/file-upload": "0.74.2",
|
|
170
|
+
"@zag-js/file-utils": "0.74.2",
|
|
171
|
+
"@zag-js/highlight-word": "0.74.2",
|
|
172
|
+
"@zag-js/hover-card": "0.74.2",
|
|
173
|
+
"@zag-js/i18n-utils": "0.74.2",
|
|
174
|
+
"@zag-js/menu": "0.74.2",
|
|
175
|
+
"@zag-js/number-input": "0.74.2",
|
|
176
|
+
"@zag-js/pagination": "0.74.2",
|
|
177
|
+
"@zag-js/pin-input": "0.74.2",
|
|
178
|
+
"@zag-js/popover": "0.74.2",
|
|
179
|
+
"@zag-js/presence": "0.74.2",
|
|
180
|
+
"@zag-js/progress": "0.74.2",
|
|
181
|
+
"@zag-js/qr-code": "0.74.2",
|
|
182
|
+
"@zag-js/radio-group": "0.74.2",
|
|
183
|
+
"@zag-js/rating-group": "0.74.2",
|
|
184
|
+
"@zag-js/react": "0.74.2",
|
|
185
|
+
"@zag-js/select": "0.74.2",
|
|
186
|
+
"@zag-js/signature-pad": "0.74.2",
|
|
187
|
+
"@zag-js/slider": "0.74.2",
|
|
188
|
+
"@zag-js/splitter": "0.74.2",
|
|
189
|
+
"@zag-js/steps": "0.74.2",
|
|
190
|
+
"@zag-js/switch": "0.74.2",
|
|
191
|
+
"@zag-js/tabs": "0.74.2",
|
|
192
|
+
"@zag-js/tags-input": "0.74.2",
|
|
193
|
+
"@zag-js/time-picker": "0.74.2",
|
|
194
|
+
"@zag-js/timer": "0.74.2",
|
|
195
|
+
"@zag-js/toast": "0.74.2",
|
|
196
|
+
"@zag-js/toggle-group": "0.74.2",
|
|
197
|
+
"@zag-js/tooltip": "0.74.2",
|
|
198
|
+
"@zag-js/tree-view": "0.74.2",
|
|
199
|
+
"@zag-js/types": "0.74.2"
|
|
194
200
|
},
|
|
195
201
|
"devDependencies": {
|
|
196
|
-
"@biomejs/biome": "1.9.
|
|
202
|
+
"@biomejs/biome": "1.9.3",
|
|
197
203
|
"@release-it/keep-a-changelog": "5.0.0",
|
|
198
|
-
"@storybook/addon-a11y": "8.3.
|
|
199
|
-
"@storybook/addon-essentials": "8.3.
|
|
200
|
-
"@storybook/react-vite": "8.3.
|
|
201
|
-
"@storybook/react": "8.3.
|
|
204
|
+
"@storybook/addon-a11y": "8.3.5",
|
|
205
|
+
"@storybook/addon-essentials": "8.3.5",
|
|
206
|
+
"@storybook/react-vite": "8.3.5",
|
|
207
|
+
"@storybook/react": "8.3.5",
|
|
202
208
|
"@testing-library/dom": "10.4.0",
|
|
203
209
|
"@testing-library/jest-dom": "6.5.0",
|
|
204
210
|
"@testing-library/react": "16.0.1",
|
|
205
211
|
"@testing-library/user-event": "14.5.2",
|
|
206
212
|
"@types/jsdom": "21.1.7",
|
|
207
|
-
"@types/react": "18.3.
|
|
213
|
+
"@types/react": "18.3.11",
|
|
208
214
|
"@types/react-dom": "18.3.0",
|
|
209
|
-
"@vitejs/plugin-react": "4.3.
|
|
210
|
-
"@zag-js/stringify-state": "0.
|
|
215
|
+
"@vitejs/plugin-react": "4.3.2",
|
|
216
|
+
"@zag-js/stringify-state": "0.74.2",
|
|
217
|
+
"clean-package": "2.2.0",
|
|
211
218
|
"globby": "14.0.2",
|
|
212
219
|
"jsdom": "25.0.1",
|
|
213
|
-
"lucide-react": "0.
|
|
220
|
+
"lucide-react": "0.451.0",
|
|
214
221
|
"react": "18.3.1",
|
|
215
222
|
"react-dom": "18.3.1",
|
|
216
223
|
"react-frame-component": "5.2.7",
|
|
217
224
|
"react-hook-form": "7.53.0",
|
|
218
|
-
"release-it": "17.
|
|
225
|
+
"release-it": "17.8.0",
|
|
219
226
|
"resize-observer-polyfill": "1.5.1",
|
|
220
|
-
"storybook": "8.3.
|
|
221
|
-
"typescript": "5.6.
|
|
227
|
+
"storybook": "8.3.5",
|
|
228
|
+
"typescript": "5.6.3",
|
|
222
229
|
"vite": "5.4.8",
|
|
223
|
-
"vite-plugin-dts": "4.2.
|
|
224
|
-
"vitest": "2.1.
|
|
230
|
+
"vite-plugin-dts": "4.2.3",
|
|
231
|
+
"vitest": "2.1.2",
|
|
225
232
|
"vitest-axe": "1.0.0-pre.3"
|
|
226
233
|
},
|
|
227
234
|
"peerDependencies": {
|