@ark-ui/react 0.7.2 → 0.7.3
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/CHANGELOG.md +12 -3
- package/accordion/index.cjs +20 -0
- package/accordion/index.mjs +5 -0
- package/avatar/index.cjs +18 -0
- package/avatar/index.mjs +4 -0
- package/carousel/carousel.cjs +1 -0
- package/carousel/carousel.mjs +1 -0
- package/carousel/index.cjs +23 -0
- package/carousel/index.mjs +8 -0
- package/checkbox/checkbox.cjs +1 -0
- package/checkbox/checkbox.mjs +1 -0
- package/checkbox/index.cjs +20 -0
- package/checkbox/index.mjs +5 -0
- package/color-picker/color-picker.cjs +1 -0
- package/color-picker/color-picker.mjs +1 -0
- package/color-picker/index.cjs +35 -0
- package/color-picker/index.mjs +14 -0
- package/combobox/index.cjs +28 -0
- package/combobox/index.mjs +9 -0
- package/date-picker/date-picker.cjs +1 -0
- package/date-picker/date-picker.mjs +1 -0
- package/date-picker/index.cjs +53 -0
- package/date-picker/index.mjs +23 -0
- package/dialog/dialog.cjs +1 -0
- package/dialog/dialog.mjs +1 -0
- package/dialog/index.cjs +28 -0
- package/dialog/index.mjs +9 -0
- package/editable/editable-cancel-trigger.cjs +1 -0
- package/editable/editable-cancel-trigger.mjs +1 -0
- package/editable/editable-edit-trigger.cjs +1 -0
- package/editable/editable-edit-trigger.mjs +1 -0
- package/editable/editable-submit-trigger.cjs +1 -0
- package/editable/editable-submit-trigger.mjs +1 -0
- package/editable/editable.cjs +1 -0
- package/editable/editable.mjs +1 -0
- package/editable/index.cjs +30 -0
- package/editable/index.mjs +10 -0
- package/environment/environment-context.cjs +1 -0
- package/environment/environment-context.mjs +1 -0
- package/environment/index.cjs +11 -0
- package/environment/index.mjs +2 -0
- package/hover-card/hover-card.cjs +1 -0
- package/hover-card/hover-card.mjs +1 -0
- package/hover-card/index.cjs +24 -0
- package/hover-card/index.mjs +7 -0
- package/index.cjs +108 -108
- package/index.mjs +22 -22
- package/menu/index.cjs +38 -0
- package/menu/index.mjs +14 -0
- package/menu/menu-option-item.cjs +2 -0
- package/menu/menu-option-item.mjs +2 -0
- package/number-input/index.cjs +26 -0
- package/number-input/index.mjs +8 -0
- package/number-input/number-input-decrement-trigger.cjs +1 -0
- package/number-input/number-input-decrement-trigger.mjs +1 -0
- package/number-input/number-input-increment-trigger.cjs +1 -0
- package/number-input/number-input-increment-trigger.mjs +1 -0
- package/package.json +48 -47
- package/pagination/index.cjs +23 -0
- package/pagination/index.mjs +8 -0
- package/pagination/pagination.cjs +1 -0
- package/pagination/pagination.mjs +1 -0
- package/pin-input/index.cjs +20 -0
- package/pin-input/index.mjs +5 -0
- package/popover/index.cjs +32 -0
- package/popover/index.mjs +11 -0
- package/popover/popover.cjs +1 -0
- package/popover/popover.mjs +1 -0
- package/popover/use-popover.cjs +1 -1
- package/popover/use-popover.mjs +1 -1
- package/pressable/index.cjs +11 -0
- package/pressable/index.mjs +2 -0
- package/radio-group/index.cjs +24 -0
- package/radio-group/index.mjs +7 -0
- package/radio-group/radio-context.cjs +1 -0
- package/radio-group/radio-context.mjs +1 -0
- package/range-slider/index.cjs +30 -0
- package/range-slider/index.mjs +10 -0
- package/range-slider/range-slider-output.cjs +1 -0
- package/range-slider/range-slider-output.mjs +1 -0
- package/range-slider/range-slider.cjs +1 -0
- package/range-slider/range-slider.mjs +1 -0
- package/rating-group/index.cjs +20 -0
- package/rating-group/index.mjs +5 -0
- package/rating-group/rating-context.cjs +1 -0
- package/rating-group/rating-context.mjs +1 -0
- package/rating-group/rating-group-control.cjs +1 -0
- package/rating-group/rating-group-control.mjs +1 -0
- package/rating-group/rating.cjs +1 -0
- package/rating-group/rating.mjs +1 -0
- package/segment-group/index.cjs +23 -0
- package/segment-group/index.mjs +8 -0
- package/segment-group/segment-context.cjs +1 -0
- package/segment-group/segment-context.mjs +1 -0
- package/select/index.cjs +28 -0
- package/select/index.mjs +9 -0
- package/select/select.cjs +1 -0
- package/select/select.mjs +1 -0
- package/slider/index.cjs +30 -0
- package/slider/index.mjs +10 -0
- package/slider/slider.cjs +1 -0
- package/slider/slider.mjs +1 -0
- package/splitter/index.cjs +18 -0
- package/splitter/index.mjs +4 -0
- package/splitter/splitter-panel.cjs +1 -0
- package/splitter/splitter-panel.mjs +1 -0
- package/splitter/splitter-resize-trigger.cjs +1 -0
- package/splitter/splitter-resize-trigger.mjs +1 -0
- package/switch/index.cjs +22 -0
- package/switch/index.mjs +6 -0
- package/tabs/index.cjs +22 -0
- package/tabs/index.mjs +6 -0
- package/tabs/tab-content.cjs +1 -0
- package/tabs/tab-content.mjs +1 -0
- package/tags-input/index.cjs +28 -0
- package/tags-input/index.mjs +9 -0
- package/tags-input/tags-input.cjs +1 -0
- package/tags-input/tags-input.mjs +1 -0
- package/toast/index.cjs +27 -0
- package/toast/index.mjs +8 -0
- package/toast/toast-group.cjs +2 -0
- package/toast/toast-group.mjs +2 -0
- package/toast/toast-placements.cjs +2 -0
- package/toast/toast-placements.mjs +2 -0
- package/toast/toast.cjs +6 -2
- package/toast/toast.mjs +6 -2
- package/tooltip/index.cjs +24 -0
- package/tooltip/index.mjs +7 -0
- package/tooltip/tooltip.cjs +1 -0
- package/tooltip/tooltip.mjs +1 -0
- package/transition/index.cjs +11 -0
- package/transition/index.d.ts +2 -0
- package/transition/index.mjs +2 -0
- package/transition/transition.cjs +28 -0
- package/transition/transition.d.ts +12 -0
- package/transition/transition.mjs +24 -0
- package/transition/use-transition.cjs +37 -0
- package/transition/use-transition.d.ts +10 -0
- package/transition/use-transition.mjs +14 -0
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
require('@zag-js/toast');
|
|
7
|
+
require('react');
|
|
6
8
|
const runIfFn = require('../run-if-fn.cjs');
|
|
7
9
|
const toastProvider = require('./toast-provider.cjs');
|
|
8
10
|
|
package/toast/toast.cjs
CHANGED
|
@@ -11,10 +11,14 @@ const toastItemContext = require('./toast-item-context.cjs');
|
|
|
11
11
|
const useToastItem = require('./use-toast-item.cjs');
|
|
12
12
|
|
|
13
13
|
const Toast = forwardRef.forwardRef((props, ref) => {
|
|
14
|
-
const [useToastItemProps, divProps] = createSplitProps.createSplitProps()(
|
|
14
|
+
const [useToastItemProps, { children, ...divProps }] = createSplitProps.createSplitProps()(
|
|
15
|
+
props,
|
|
16
|
+
["toast"]
|
|
17
|
+
);
|
|
15
18
|
const api = useToastItem.useToastItem(useToastItemProps);
|
|
16
19
|
const mergedProps = react.mergeProps(api.rootProps, divProps);
|
|
17
|
-
|
|
20
|
+
const customToast = api.render();
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(toastItemContext.ToastItemProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref, children: customToast || children }) });
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
exports.Toast = Toast;
|
package/toast/toast.mjs
CHANGED
|
@@ -7,10 +7,14 @@ import { ToastItemProvider } from './toast-item-context.mjs';
|
|
|
7
7
|
import { useToastItem } from './use-toast-item.mjs';
|
|
8
8
|
|
|
9
9
|
const Toast = forwardRef((props, ref) => {
|
|
10
|
-
const [useToastItemProps, divProps] = createSplitProps()(
|
|
10
|
+
const [useToastItemProps, { children, ...divProps }] = createSplitProps()(
|
|
11
|
+
props,
|
|
12
|
+
["toast"]
|
|
13
|
+
);
|
|
11
14
|
const api = useToastItem(useToastItemProps);
|
|
12
15
|
const mergedProps = mergeProps(api.rootProps, divProps);
|
|
13
|
-
|
|
16
|
+
const customToast = api.render();
|
|
17
|
+
return /* @__PURE__ */ jsx(ToastItemProvider, { value: api, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref, children: customToast || children }) });
|
|
14
18
|
});
|
|
15
19
|
|
|
16
20
|
export { Toast };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const tooltip = require('./tooltip.cjs');
|
|
6
|
+
const tooltipArrow = require('./tooltip-arrow.cjs');
|
|
7
|
+
const tooltipArrowTip = require('./tooltip-arrow-tip.cjs');
|
|
8
|
+
const tooltipContent = require('./tooltip-content.cjs');
|
|
9
|
+
const tooltipPositioner = require('./tooltip-positioner.cjs');
|
|
10
|
+
const tooltipTrigger = require('./tooltip-trigger.cjs');
|
|
11
|
+
const tooltip$1 = require('@zag-js/tooltip');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.Tooltip = tooltip.Tooltip;
|
|
16
|
+
exports.TooltipArrow = tooltipArrow.TooltipArrow;
|
|
17
|
+
exports.TooltipArrowTip = tooltipArrowTip.TooltipArrowTip;
|
|
18
|
+
exports.TooltipContent = tooltipContent.TooltipContent;
|
|
19
|
+
exports.TooltipPositioner = tooltipPositioner.TooltipPositioner;
|
|
20
|
+
exports.TooltipTrigger = tooltipTrigger.TooltipTrigger;
|
|
21
|
+
Object.defineProperty(exports, 'tooltipAnatomy', {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: () => tooltip$1.anatomy
|
|
24
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Tooltip } from './tooltip.mjs';
|
|
2
|
+
export { TooltipArrow } from './tooltip-arrow.mjs';
|
|
3
|
+
export { TooltipArrowTip } from './tooltip-arrow-tip.mjs';
|
|
4
|
+
export { TooltipContent } from './tooltip-content.mjs';
|
|
5
|
+
export { TooltipPositioner } from './tooltip-positioner.mjs';
|
|
6
|
+
export { TooltipTrigger } from './tooltip-trigger.mjs';
|
|
7
|
+
export { anatomy as tooltipAnatomy } from '@zag-js/tooltip';
|
package/tooltip/tooltip.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
require('react');
|
|
6
7
|
const runIfFn = require('../run-if-fn.cjs');
|
|
7
8
|
const tooltipContext = require('./tooltip-context.cjs');
|
|
8
9
|
const useTooltip = require('./use-tooltip.cjs');
|
package/tooltip/tooltip.mjs
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const transition = require('./transition.cjs');
|
|
6
|
+
const useTransition = require('./use-transition.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.Transition = transition.Transition;
|
|
11
|
+
exports.useTransition = useTransition.useTransition;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const React = require('react');
|
|
6
|
+
const useTransition = require('./use-transition.cjs');
|
|
7
|
+
|
|
8
|
+
const Transition = (props) => {
|
|
9
|
+
const { unmountOnExit, children, ...useTransitionProps } = props;
|
|
10
|
+
const { style, hidden } = useTransition.useTransition(useTransitionProps);
|
|
11
|
+
const child = React.Children.only(children);
|
|
12
|
+
if (unmountOnExit && hidden) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (typeof child === "function") {
|
|
16
|
+
return child({ style, hidden });
|
|
17
|
+
}
|
|
18
|
+
const jsxChild = child;
|
|
19
|
+
return React.cloneElement(jsxChild, {
|
|
20
|
+
style: {
|
|
21
|
+
...jsxChild.props.style,
|
|
22
|
+
...style
|
|
23
|
+
},
|
|
24
|
+
hidden
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.Transition = Transition;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type UseTransitionProps } from './use-transition';
|
|
2
|
+
type RenderProps = {
|
|
3
|
+
hidden: boolean;
|
|
4
|
+
style: React.CSSProperties;
|
|
5
|
+
};
|
|
6
|
+
type TransitionChild = React.ReactNode | ((props: RenderProps) => JSX.Element);
|
|
7
|
+
export type TransitionProps = UseTransitionProps & {
|
|
8
|
+
unmountOnExit?: boolean;
|
|
9
|
+
children?: TransitionChild;
|
|
10
|
+
};
|
|
11
|
+
export declare const Transition: (props: TransitionProps) => JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Children, cloneElement } from 'react';
|
|
2
|
+
import { useTransition } from './use-transition.mjs';
|
|
3
|
+
|
|
4
|
+
const Transition = (props) => {
|
|
5
|
+
const { unmountOnExit, children, ...useTransitionProps } = props;
|
|
6
|
+
const { style, hidden } = useTransition(useTransitionProps);
|
|
7
|
+
const child = Children.only(children);
|
|
8
|
+
if (unmountOnExit && hidden) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (typeof child === "function") {
|
|
12
|
+
return child({ style, hidden });
|
|
13
|
+
}
|
|
14
|
+
const jsxChild = child;
|
|
15
|
+
return cloneElement(jsxChild, {
|
|
16
|
+
style: {
|
|
17
|
+
...jsxChild.props.style,
|
|
18
|
+
...style
|
|
19
|
+
},
|
|
20
|
+
hidden
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { Transition };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const react = require('@zag-js/react');
|
|
6
|
+
const transition = require('@zag-js/transition');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const transition__namespace = /*#__PURE__*/_interopNamespaceDefault(transition);
|
|
26
|
+
|
|
27
|
+
const useTransition = (props) => {
|
|
28
|
+
const { enter, exit, ...machineContext } = props;
|
|
29
|
+
const [state, send] = react.useMachine(transition__namespace.machine(machineContext), { context: machineContext });
|
|
30
|
+
const api = transition__namespace.connect(state, send, react.normalizeProps);
|
|
31
|
+
const style = api.transition({
|
|
32
|
+
variants: { enter, exit }
|
|
33
|
+
});
|
|
34
|
+
return { hidden: api.unmount, style };
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.useTransition = useTransition;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ClassAttributes, StyleHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
+
import * as transition from '@zag-js/transition';
|
|
3
|
+
export type UseTransitionProps = transition.Context & {
|
|
4
|
+
enter: React.CSSProperties;
|
|
5
|
+
exit: React.CSSProperties;
|
|
6
|
+
};
|
|
7
|
+
export declare const useTransition: (props: UseTransitionProps) => {
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
style: ClassAttributes<HTMLStyleElement> & StyleHTMLAttributes<HTMLStyleElement> & CSSProperties;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMachine, normalizeProps } from '@zag-js/react';
|
|
2
|
+
import * as transition from '@zag-js/transition';
|
|
3
|
+
|
|
4
|
+
const useTransition = (props) => {
|
|
5
|
+
const { enter, exit, ...machineContext } = props;
|
|
6
|
+
const [state, send] = useMachine(transition.machine(machineContext), { context: machineContext });
|
|
7
|
+
const api = transition.connect(state, send, normalizeProps);
|
|
8
|
+
const style = api.transition({
|
|
9
|
+
variants: { enter, exit }
|
|
10
|
+
});
|
|
11
|
+
return { hidden: api.unmount, style };
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { useTransition };
|