@ark-ui/react 5.31.0 → 5.32.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/anatomy.cjs +7 -5
- package/dist/components/anatomy.d.cts +2 -1
- package/dist/components/anatomy.d.ts +2 -1
- package/dist/components/anatomy.js +2 -1
- package/dist/components/angle-slider/angle-slider-label.d.cts +1 -1
- package/dist/components/angle-slider/angle-slider-label.d.ts +1 -1
- package/dist/components/checkbox/checkbox-group.cjs +2 -1
- package/dist/components/checkbox/checkbox-group.js +2 -1
- package/dist/components/checkbox/use-checkbox-group.cjs +7 -3
- package/dist/components/checkbox/use-checkbox-group.d.cts +4 -0
- package/dist/components/checkbox/use-checkbox-group.d.ts +4 -0
- package/dist/components/checkbox/use-checkbox-group.js +7 -3
- package/dist/components/date-picker/date-picker-root.cjs +4 -1
- package/dist/components/date-picker/date-picker-root.js +4 -1
- package/dist/components/date-picker/date-picker-week-number-cell.cjs +24 -0
- package/dist/components/date-picker/date-picker-week-number-cell.d.cts +10 -0
- package/dist/components/date-picker/date-picker-week-number-cell.d.ts +10 -0
- package/dist/components/date-picker/date-picker-week-number-cell.js +20 -0
- package/dist/components/date-picker/date-picker-week-number-header-cell.cjs +23 -0
- package/dist/components/date-picker/date-picker-week-number-header-cell.d.cts +7 -0
- package/dist/components/date-picker/date-picker-week-number-header-cell.d.ts +7 -0
- package/dist/components/date-picker/date-picker-week-number-header-cell.js +19 -0
- package/dist/components/date-picker/date-picker.cjs +4 -0
- package/dist/components/date-picker/date-picker.d.cts +3 -1
- package/dist/components/date-picker/date-picker.d.ts +3 -1
- package/dist/components/date-picker/date-picker.js +2 -0
- package/dist/components/date-picker/index.cjs +4 -0
- package/dist/components/date-picker/index.d.cts +3 -1
- package/dist/components/date-picker/index.d.ts +3 -1
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/{bottom-sheet/bottom-sheet-backdrop.cjs → drawer/drawer-backdrop.cjs} +7 -7
- package/dist/components/drawer/drawer-backdrop.d.cts +7 -0
- package/dist/components/drawer/drawer-backdrop.d.ts +7 -0
- package/dist/components/{bottom-sheet/bottom-sheet-backdrop.js → drawer/drawer-backdrop.js} +7 -7
- package/dist/components/drawer/drawer-close-trigger.cjs +19 -0
- package/dist/components/drawer/drawer-close-trigger.d.cts +7 -0
- package/dist/components/drawer/drawer-close-trigger.d.ts +7 -0
- package/dist/components/drawer/drawer-close-trigger.js +15 -0
- package/dist/components/{bottom-sheet/bottom-sheet-content.cjs → drawer/drawer-content.cjs} +6 -6
- package/dist/components/drawer/drawer-content.d.cts +8 -0
- package/dist/components/drawer/drawer-content.d.ts +8 -0
- package/dist/components/{bottom-sheet/bottom-sheet-content.js → drawer/drawer-content.js} +6 -6
- package/dist/components/drawer/drawer-context.cjs +10 -0
- package/dist/components/drawer/drawer-context.d.cts +6 -0
- package/dist/components/drawer/drawer-context.d.ts +6 -0
- package/dist/components/drawer/drawer-context.js +6 -0
- package/dist/components/drawer/drawer-grabber-indicator.cjs +19 -0
- package/dist/components/drawer/drawer-grabber-indicator.d.cts +7 -0
- package/dist/components/drawer/drawer-grabber-indicator.d.ts +7 -0
- package/dist/components/drawer/drawer-grabber-indicator.js +15 -0
- package/dist/components/drawer/drawer-grabber.cjs +19 -0
- package/dist/components/drawer/drawer-grabber.d.cts +7 -0
- package/dist/components/drawer/drawer-grabber.d.ts +7 -0
- package/dist/components/drawer/drawer-grabber.js +15 -0
- package/dist/components/drawer/drawer-indent-background.cjs +19 -0
- package/dist/components/drawer/drawer-indent-background.d.cts +7 -0
- package/dist/components/drawer/drawer-indent-background.d.ts +7 -0
- package/dist/components/drawer/drawer-indent-background.js +15 -0
- package/dist/components/drawer/drawer-indent.cjs +19 -0
- package/dist/components/drawer/drawer-indent.d.cts +7 -0
- package/dist/components/drawer/drawer-indent.d.ts +7 -0
- package/dist/components/drawer/drawer-indent.js +15 -0
- package/dist/components/drawer/drawer-positioner.cjs +24 -0
- package/dist/components/drawer/drawer-positioner.d.cts +7 -0
- package/dist/components/drawer/drawer-positioner.d.ts +7 -0
- package/dist/components/drawer/drawer-positioner.js +20 -0
- package/dist/components/drawer/drawer-root-provider.cjs +21 -0
- package/dist/components/drawer/drawer-root-provider.d.cts +14 -0
- package/dist/components/drawer/drawer-root-provider.d.ts +14 -0
- package/dist/components/drawer/drawer-root-provider.js +17 -0
- package/dist/components/{bottom-sheet/bottom-sheet-root.cjs → drawer/drawer-root.cjs} +7 -7
- package/dist/components/drawer/drawer-root.d.cts +9 -0
- package/dist/components/drawer/drawer-root.d.ts +9 -0
- package/dist/components/drawer/drawer-root.js +19 -0
- package/dist/components/drawer/drawer-stack.cjs +40 -0
- package/dist/components/drawer/drawer-stack.d.cts +5 -0
- package/dist/components/drawer/drawer-stack.d.ts +5 -0
- package/dist/components/drawer/drawer-stack.js +17 -0
- package/dist/components/drawer/drawer-title.cjs +19 -0
- package/dist/components/drawer/drawer-title.d.cts +7 -0
- package/dist/components/drawer/drawer-title.d.ts +7 -0
- package/dist/components/drawer/drawer-title.js +15 -0
- package/dist/components/{bottom-sheet/bottom-sheet-trigger.cjs → drawer/drawer-trigger.cjs} +7 -7
- package/dist/components/drawer/drawer-trigger.d.cts +7 -0
- package/dist/components/drawer/drawer-trigger.d.ts +7 -0
- package/dist/components/{bottom-sheet/bottom-sheet-trigger.js → drawer/drawer-trigger.js} +7 -7
- package/dist/components/drawer/drawer.anatomy.d.cts +1 -0
- package/dist/components/drawer/drawer.anatomy.d.ts +1 -0
- package/dist/components/drawer/drawer.cjs +35 -0
- package/dist/components/drawer/drawer.d.cts +15 -0
- package/dist/components/drawer/drawer.d.ts +15 -0
- package/dist/components/drawer/drawer.js +14 -0
- package/dist/components/drawer/index.cjs +48 -0
- package/dist/components/drawer/index.d.cts +20 -0
- package/dist/components/drawer/index.d.ts +20 -0
- package/dist/components/drawer/index.js +20 -0
- package/dist/components/drawer/use-drawer-context.cjs +15 -0
- package/dist/components/drawer/use-drawer-context.d.cts +5 -0
- package/dist/components/drawer/use-drawer-context.d.ts +5 -0
- package/dist/components/drawer/use-drawer-context.js +10 -0
- package/dist/components/drawer/use-drawer-stack-context.cjs +15 -0
- package/dist/components/drawer/use-drawer-stack-context.d.cts +6 -0
- package/dist/components/drawer/use-drawer-stack-context.d.ts +6 -0
- package/dist/components/drawer/use-drawer-stack-context.js +10 -0
- package/dist/components/drawer/use-drawer-stack-store.cjs +13 -0
- package/dist/components/drawer/use-drawer-stack-store.d.cts +4 -0
- package/dist/components/drawer/use-drawer-stack-store.d.ts +4 -0
- package/dist/components/drawer/use-drawer-stack-store.js +8 -0
- package/dist/components/{bottom-sheet/use-bottom-sheet.cjs → drawer/use-drawer.cjs} +9 -6
- package/dist/components/drawer/use-drawer.d.cts +9 -0
- package/dist/components/drawer/use-drawer.d.ts +9 -0
- package/dist/components/{bottom-sheet/use-bottom-sheet.js → drawer/use-drawer.js} +8 -5
- package/dist/components/index.cjs +59 -31
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +30 -15
- package/dist/components/select/select-root.cjs +1 -0
- package/dist/components/select/select-root.js +1 -0
- package/dist/components/swap/index.cjs +21 -0
- package/dist/components/swap/index.d.cts +7 -0
- package/dist/components/swap/index.d.ts +7 -0
- package/dist/components/swap/index.js +8 -0
- package/dist/components/swap/swap-indicator.cjs +23 -0
- package/dist/components/swap/swap-indicator.d.cts +8 -0
- package/dist/components/swap/swap-indicator.d.ts +8 -0
- package/dist/components/swap/swap-indicator.js +19 -0
- package/dist/components/swap/swap-root-provider.cjs +19 -0
- package/dist/components/swap/swap-root-provider.d.cts +9 -0
- package/dist/components/swap/swap-root-provider.d.ts +9 -0
- package/dist/components/swap/swap-root-provider.js +15 -0
- package/dist/components/swap/swap-root.cjs +21 -0
- package/dist/components/swap/swap-root.d.cts +8 -0
- package/dist/components/swap/swap-root.d.ts +8 -0
- package/dist/components/swap/swap-root.js +17 -0
- package/dist/components/swap/swap.anatomy.cjs +12 -0
- package/dist/components/swap/swap.anatomy.d.cts +3 -0
- package/dist/components/swap/swap.anatomy.d.ts +3 -0
- package/dist/components/swap/swap.anatomy.js +7 -0
- package/dist/components/swap/swap.cjs +15 -0
- package/dist/components/swap/swap.d.cts +4 -0
- package/dist/components/swap/swap.d.ts +4 -0
- package/dist/components/swap/swap.js +4 -0
- package/dist/components/swap/use-swap-context.cjs +15 -0
- package/dist/components/swap/use-swap-context.d.cts +5 -0
- package/dist/components/swap/use-swap-context.d.ts +5 -0
- package/dist/components/swap/use-swap-context.js +10 -0
- package/dist/components/swap/use-swap.cjs +37 -0
- package/dist/components/swap/use-swap.d.cts +36 -0
- package/dist/components/swap/use-swap.d.ts +36 -0
- package/dist/components/swap/use-swap.js +33 -0
- package/dist/index.cjs +61 -31
- package/dist/index.js +31 -15
- package/dist/providers/index.cjs +2 -0
- package/dist/providers/index.js +1 -0
- package/dist/providers/locale/index.cjs +2 -0
- package/dist/providers/locale/index.d.cts +1 -0
- package/dist/providers/locale/index.d.ts +1 -0
- package/dist/providers/locale/index.js +1 -0
- package/dist/providers/locale/use-date-formatter.cjs +19 -0
- package/dist/providers/locale/use-date-formatter.d.cts +5 -0
- package/dist/providers/locale/use-date-formatter.d.ts +5 -0
- package/dist/providers/locale/use-date-formatter.js +15 -0
- package/package.json +79 -78
- package/dist/components/bottom-sheet/bottom-sheet-backdrop.d.cts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-backdrop.d.ts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-close-trigger.cjs +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-close-trigger.d.cts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-close-trigger.d.ts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-close-trigger.js +0 -15
- package/dist/components/bottom-sheet/bottom-sheet-content.d.cts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-content.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-context.cjs +0 -10
- package/dist/components/bottom-sheet/bottom-sheet-context.d.cts +0 -6
- package/dist/components/bottom-sheet/bottom-sheet-context.d.ts +0 -6
- package/dist/components/bottom-sheet/bottom-sheet-context.js +0 -6
- package/dist/components/bottom-sheet/bottom-sheet-grabber-indicator.cjs +0 -21
- package/dist/components/bottom-sheet/bottom-sheet-grabber-indicator.d.cts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-grabber-indicator.d.ts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-grabber-indicator.js +0 -17
- package/dist/components/bottom-sheet/bottom-sheet-grabber.cjs +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-grabber.d.cts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-grabber.d.ts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-grabber.js +0 -15
- package/dist/components/bottom-sheet/bottom-sheet-root-provider.cjs +0 -21
- package/dist/components/bottom-sheet/bottom-sheet-root-provider.d.cts +0 -14
- package/dist/components/bottom-sheet/bottom-sheet-root-provider.d.ts +0 -14
- package/dist/components/bottom-sheet/bottom-sheet-root-provider.js +0 -17
- package/dist/components/bottom-sheet/bottom-sheet-root.d.cts +0 -9
- package/dist/components/bottom-sheet/bottom-sheet-root.d.ts +0 -9
- package/dist/components/bottom-sheet/bottom-sheet-root.js +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-title.cjs +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-title.d.cts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-title.d.ts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-title.js +0 -15
- package/dist/components/bottom-sheet/bottom-sheet-trigger.d.cts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet-trigger.d.ts +0 -7
- package/dist/components/bottom-sheet/bottom-sheet.anatomy.d.cts +0 -1
- package/dist/components/bottom-sheet/bottom-sheet.anatomy.d.ts +0 -1
- package/dist/components/bottom-sheet/bottom-sheet.cjs +0 -27
- package/dist/components/bottom-sheet/bottom-sheet.d.cts +0 -11
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -11
- package/dist/components/bottom-sheet/bottom-sheet.js +0 -10
- package/dist/components/bottom-sheet/index.cjs +0 -38
- package/dist/components/bottom-sheet/index.d.cts +0 -15
- package/dist/components/bottom-sheet/index.d.ts +0 -15
- package/dist/components/bottom-sheet/index.js +0 -15
- package/dist/components/bottom-sheet/use-bottom-sheet-context.cjs +0 -15
- package/dist/components/bottom-sheet/use-bottom-sheet-context.d.cts +0 -5
- package/dist/components/bottom-sheet/use-bottom-sheet-context.d.ts +0 -5
- package/dist/components/bottom-sheet/use-bottom-sheet-context.js +0 -10
- package/dist/components/bottom-sheet/use-bottom-sheet.d.cts +0 -8
- package/dist/components/bottom-sheet/use-bottom-sheet.d.ts +0 -8
|
@@ -0,0 +1,40 @@
|
|
|
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 drawer = require('@zag-js/drawer');
|
|
8
|
+
const react$1 = require('@zag-js/react');
|
|
9
|
+
const react = require('react');
|
|
10
|
+
const useDrawerStackContext = require('./use-drawer-stack-context.cjs');
|
|
11
|
+
const useDrawerStackStore = require('./use-drawer-stack-store.cjs');
|
|
12
|
+
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
15
|
+
if (e) {
|
|
16
|
+
for (const k in e) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: () => e[k]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const drawer__namespace = /*#__PURE__*/_interopNamespaceDefault(drawer);
|
|
31
|
+
|
|
32
|
+
const DrawerStack = (props) => {
|
|
33
|
+
const { children } = props;
|
|
34
|
+
const [stack] = react.useState(() => drawer__namespace.createStack());
|
|
35
|
+
const snapshot = react.useSyncExternalStore(stack.subscribe, stack.getSnapshot, stack.getSnapshot);
|
|
36
|
+
const stackApi = react.useMemo(() => drawer__namespace.connectStack(snapshot, react$1.normalizeProps), [snapshot]);
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useDrawerStackStore.DrawerStackStoreProvider, { value: stack, children: /* @__PURE__ */ jsxRuntime.jsx(useDrawerStackContext.DrawerStackProvider, { value: stackApi, children }) });
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.DrawerStack = DrawerStack;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as drawer from '@zag-js/drawer';
|
|
4
|
+
import { normalizeProps } from '@zag-js/react';
|
|
5
|
+
import { useState, useSyncExternalStore, useMemo } from 'react';
|
|
6
|
+
import { DrawerStackProvider } from './use-drawer-stack-context.js';
|
|
7
|
+
import { DrawerStackStoreProvider } from './use-drawer-stack-store.js';
|
|
8
|
+
|
|
9
|
+
const DrawerStack = (props) => {
|
|
10
|
+
const { children } = props;
|
|
11
|
+
const [stack] = useState(() => drawer.createStack());
|
|
12
|
+
const snapshot = useSyncExternalStore(stack.subscribe, stack.getSnapshot, stack.getSnapshot);
|
|
13
|
+
const stackApi = useMemo(() => drawer.connectStack(snapshot, normalizeProps), [snapshot]);
|
|
14
|
+
return /* @__PURE__ */ jsx(DrawerStackStoreProvider, { value: stack, children: /* @__PURE__ */ jsx(DrawerStackProvider, { value: stackApi, children }) });
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { DrawerStack };
|
|
@@ -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$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
11
|
+
|
|
12
|
+
const DrawerTitle = react.forwardRef((props, ref) => {
|
|
13
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(drawer.getTitleProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.h2, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
DrawerTitle.displayName = "DrawerTitle";
|
|
18
|
+
|
|
19
|
+
exports.DrawerTitle = DrawerTitle;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerTitleBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerTitleProps extends HTMLProps<'h2'>, DrawerTitleBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerTitle: ForwardRefExoticComponent<DrawerTitleProps & RefAttributes<HTMLHeadingElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerTitleBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerTitleProps extends HTMLProps<'h2'>, DrawerTitleBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerTitle: ForwardRefExoticComponent<DrawerTitleProps & RefAttributes<HTMLHeadingElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { useDrawerContext } from './use-drawer-context.js';
|
|
7
|
+
|
|
8
|
+
const DrawerTitle = forwardRef((props, ref) => {
|
|
9
|
+
const drawer = useDrawerContext();
|
|
10
|
+
const mergedProps = mergeProps(drawer.getTitleProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.h2, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
DrawerTitle.displayName = "DrawerTitle";
|
|
14
|
+
|
|
15
|
+
export { DrawerTitle };
|
|
@@ -8,20 +8,20 @@ const react$1 = require('@zag-js/react');
|
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
10
|
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
11
|
-
const
|
|
11
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const DrawerTrigger = react.forwardRef((props, ref) => {
|
|
14
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
15
15
|
const presence = usePresenceContext.usePresenceContext();
|
|
16
16
|
const mergedProps = react$1.mergeProps(
|
|
17
17
|
{
|
|
18
|
-
...
|
|
19
|
-
"aria-controls": presence.unmounted ? void 0 :
|
|
18
|
+
...drawer.getTriggerProps(),
|
|
19
|
+
"aria-controls": presence.unmounted ? void 0 : drawer.getTriggerProps()["aria-controls"]
|
|
20
20
|
},
|
|
21
21
|
props
|
|
22
22
|
);
|
|
23
23
|
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
DrawerTrigger.displayName = "DrawerTrigger";
|
|
26
26
|
|
|
27
|
-
exports.
|
|
27
|
+
exports.DrawerTrigger = DrawerTrigger;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerTriggerBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerTriggerProps extends HTMLProps<'button'>, DrawerTriggerBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerTrigger: ForwardRefExoticComponent<DrawerTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerTriggerBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerTriggerProps extends HTMLProps<'button'>, DrawerTriggerBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerTrigger: ForwardRefExoticComponent<DrawerTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,20 +4,20 @@ import { mergeProps } from '@zag-js/react';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.js';
|
|
6
6
|
import { usePresenceContext } from '../presence/use-presence-context.js';
|
|
7
|
-
import {
|
|
7
|
+
import { useDrawerContext } from './use-drawer-context.js';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const DrawerTrigger = forwardRef((props, ref) => {
|
|
10
|
+
const drawer = useDrawerContext();
|
|
11
11
|
const presence = usePresenceContext();
|
|
12
12
|
const mergedProps = mergeProps(
|
|
13
13
|
{
|
|
14
|
-
...
|
|
15
|
-
"aria-controls": presence.unmounted ? void 0 :
|
|
14
|
+
...drawer.getTriggerProps(),
|
|
15
|
+
"aria-controls": presence.unmounted ? void 0 : drawer.getTriggerProps()["aria-controls"]
|
|
16
16
|
},
|
|
17
17
|
props
|
|
18
18
|
);
|
|
19
19
|
return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
DrawerTrigger.displayName = "DrawerTrigger";
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { DrawerTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as drawerAnatomy } from '@zag-js/drawer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as drawerAnatomy } from '@zag-js/drawer';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const drawerBackdrop = require('./drawer-backdrop.cjs');
|
|
6
|
+
const drawerCloseTrigger = require('./drawer-close-trigger.cjs');
|
|
7
|
+
const drawerContent = require('./drawer-content.cjs');
|
|
8
|
+
const drawerContext = require('./drawer-context.cjs');
|
|
9
|
+
const drawerIndent = require('./drawer-indent.cjs');
|
|
10
|
+
const drawerIndentBackground = require('./drawer-indent-background.cjs');
|
|
11
|
+
const drawerPositioner = require('./drawer-positioner.cjs');
|
|
12
|
+
const drawerGrabber = require('./drawer-grabber.cjs');
|
|
13
|
+
const drawerGrabberIndicator = require('./drawer-grabber-indicator.cjs');
|
|
14
|
+
const drawerRoot = require('./drawer-root.cjs');
|
|
15
|
+
const drawerRootProvider = require('./drawer-root-provider.cjs');
|
|
16
|
+
const drawerStack = require('./drawer-stack.cjs');
|
|
17
|
+
const drawerTitle = require('./drawer-title.cjs');
|
|
18
|
+
const drawerTrigger = require('./drawer-trigger.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.Backdrop = drawerBackdrop.DrawerBackdrop;
|
|
23
|
+
exports.CloseTrigger = drawerCloseTrigger.DrawerCloseTrigger;
|
|
24
|
+
exports.Content = drawerContent.DrawerContent;
|
|
25
|
+
exports.Context = drawerContext.DrawerContext;
|
|
26
|
+
exports.Indent = drawerIndent.DrawerIndent;
|
|
27
|
+
exports.IndentBackground = drawerIndentBackground.DrawerIndentBackground;
|
|
28
|
+
exports.Positioner = drawerPositioner.DrawerPositioner;
|
|
29
|
+
exports.Grabber = drawerGrabber.DrawerGrabber;
|
|
30
|
+
exports.GrabberIndicator = drawerGrabberIndicator.DrawerGrabberIndicator;
|
|
31
|
+
exports.Root = drawerRoot.DrawerRoot;
|
|
32
|
+
exports.RootProvider = drawerRootProvider.DrawerRootProvider;
|
|
33
|
+
exports.Stack = drawerStack.DrawerStack;
|
|
34
|
+
exports.Title = drawerTitle.DrawerTitle;
|
|
35
|
+
exports.Trigger = drawerTrigger.DrawerTrigger;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { OpenChangeDetails, SnapPointChangeDetails } from '@zag-js/drawer';
|
|
2
|
+
export { DrawerBackdrop as Backdrop, type DrawerBackdropBaseProps as BackdropBaseProps, type DrawerBackdropProps as BackdropProps, } from './drawer-backdrop';
|
|
3
|
+
export { DrawerCloseTrigger as CloseTrigger, type DrawerCloseTriggerBaseProps as CloseTriggerBaseProps, type DrawerCloseTriggerProps as CloseTriggerProps, } from './drawer-close-trigger';
|
|
4
|
+
export { DrawerContent as Content, type DrawerContentBaseProps as ContentBaseProps, type DrawerContentProps as ContentProps, } from './drawer-content';
|
|
5
|
+
export { DrawerContext as Context, type DrawerContextProps as ContextProps } from './drawer-context';
|
|
6
|
+
export { DrawerIndent as Indent, type DrawerIndentBaseProps as IndentBaseProps, type DrawerIndentProps as IndentProps, } from './drawer-indent';
|
|
7
|
+
export { DrawerIndentBackground as IndentBackground, type DrawerIndentBackgroundBaseProps as IndentBackgroundBaseProps, type DrawerIndentBackgroundProps as IndentBackgroundProps, } from './drawer-indent-background';
|
|
8
|
+
export { DrawerPositioner as Positioner, type DrawerPositionerBaseProps as PositionerBaseProps, type DrawerPositionerProps as PositionerProps, } from './drawer-positioner';
|
|
9
|
+
export { DrawerGrabber as Grabber, type DrawerGrabberBaseProps as GrabberBaseProps, type DrawerGrabberProps as GrabberProps, } from './drawer-grabber';
|
|
10
|
+
export { DrawerGrabberIndicator as GrabberIndicator, type DrawerGrabberIndicatorBaseProps as GrabberIndicatorBaseProps, type DrawerGrabberIndicatorProps as GrabberIndicatorProps, } from './drawer-grabber-indicator';
|
|
11
|
+
export { DrawerRoot as Root, type DrawerRootBaseProps as RootBaseProps, type DrawerRootProps as RootProps, } from './drawer-root';
|
|
12
|
+
export { DrawerRootProvider as RootProvider, type DrawerRootProviderBaseProps as RootProviderBaseProps, type DrawerRootProviderProps as RootProviderProps, } from './drawer-root-provider';
|
|
13
|
+
export { DrawerStack as Stack, type DrawerStackProps as StackProps } from './drawer-stack';
|
|
14
|
+
export { DrawerTitle as Title, type DrawerTitleBaseProps as TitleBaseProps, type DrawerTitleProps as TitleProps, } from './drawer-title';
|
|
15
|
+
export { DrawerTrigger as Trigger, type DrawerTriggerBaseProps as TriggerBaseProps, type DrawerTriggerProps as TriggerProps, } from './drawer-trigger';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { OpenChangeDetails, SnapPointChangeDetails } from '@zag-js/drawer';
|
|
2
|
+
export { DrawerBackdrop as Backdrop, type DrawerBackdropBaseProps as BackdropBaseProps, type DrawerBackdropProps as BackdropProps, } from './drawer-backdrop';
|
|
3
|
+
export { DrawerCloseTrigger as CloseTrigger, type DrawerCloseTriggerBaseProps as CloseTriggerBaseProps, type DrawerCloseTriggerProps as CloseTriggerProps, } from './drawer-close-trigger';
|
|
4
|
+
export { DrawerContent as Content, type DrawerContentBaseProps as ContentBaseProps, type DrawerContentProps as ContentProps, } from './drawer-content';
|
|
5
|
+
export { DrawerContext as Context, type DrawerContextProps as ContextProps } from './drawer-context';
|
|
6
|
+
export { DrawerIndent as Indent, type DrawerIndentBaseProps as IndentBaseProps, type DrawerIndentProps as IndentProps, } from './drawer-indent';
|
|
7
|
+
export { DrawerIndentBackground as IndentBackground, type DrawerIndentBackgroundBaseProps as IndentBackgroundBaseProps, type DrawerIndentBackgroundProps as IndentBackgroundProps, } from './drawer-indent-background';
|
|
8
|
+
export { DrawerPositioner as Positioner, type DrawerPositionerBaseProps as PositionerBaseProps, type DrawerPositionerProps as PositionerProps, } from './drawer-positioner';
|
|
9
|
+
export { DrawerGrabber as Grabber, type DrawerGrabberBaseProps as GrabberBaseProps, type DrawerGrabberProps as GrabberProps, } from './drawer-grabber';
|
|
10
|
+
export { DrawerGrabberIndicator as GrabberIndicator, type DrawerGrabberIndicatorBaseProps as GrabberIndicatorBaseProps, type DrawerGrabberIndicatorProps as GrabberIndicatorProps, } from './drawer-grabber-indicator';
|
|
11
|
+
export { DrawerRoot as Root, type DrawerRootBaseProps as RootBaseProps, type DrawerRootProps as RootProps, } from './drawer-root';
|
|
12
|
+
export { DrawerRootProvider as RootProvider, type DrawerRootProviderBaseProps as RootProviderBaseProps, type DrawerRootProviderProps as RootProviderProps, } from './drawer-root-provider';
|
|
13
|
+
export { DrawerStack as Stack, type DrawerStackProps as StackProps } from './drawer-stack';
|
|
14
|
+
export { DrawerTitle as Title, type DrawerTitleBaseProps as TitleBaseProps, type DrawerTitleProps as TitleProps, } from './drawer-title';
|
|
15
|
+
export { DrawerTrigger as Trigger, type DrawerTriggerBaseProps as TriggerBaseProps, type DrawerTriggerProps as TriggerProps, } from './drawer-trigger';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { DrawerBackdrop as Backdrop } from './drawer-backdrop.js';
|
|
2
|
+
export { DrawerCloseTrigger as CloseTrigger } from './drawer-close-trigger.js';
|
|
3
|
+
export { DrawerContent as Content } from './drawer-content.js';
|
|
4
|
+
export { DrawerContext as Context } from './drawer-context.js';
|
|
5
|
+
export { DrawerIndent as Indent } from './drawer-indent.js';
|
|
6
|
+
export { DrawerIndentBackground as IndentBackground } from './drawer-indent-background.js';
|
|
7
|
+
export { DrawerPositioner as Positioner } from './drawer-positioner.js';
|
|
8
|
+
export { DrawerGrabber as Grabber } from './drawer-grabber.js';
|
|
9
|
+
export { DrawerGrabberIndicator as GrabberIndicator } from './drawer-grabber-indicator.js';
|
|
10
|
+
export { DrawerRoot as Root } from './drawer-root.js';
|
|
11
|
+
export { DrawerRootProvider as RootProvider } from './drawer-root-provider.js';
|
|
12
|
+
export { DrawerStack as Stack } from './drawer-stack.js';
|
|
13
|
+
export { DrawerTitle as Title } from './drawer-title.js';
|
|
14
|
+
export { DrawerTrigger as Trigger } from './drawer-trigger.js';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const drawerBackdrop = require('./drawer-backdrop.cjs');
|
|
6
|
+
const drawerCloseTrigger = require('./drawer-close-trigger.cjs');
|
|
7
|
+
const drawerContent = require('./drawer-content.cjs');
|
|
8
|
+
const drawerContext = require('./drawer-context.cjs');
|
|
9
|
+
const drawerPositioner = require('./drawer-positioner.cjs');
|
|
10
|
+
const drawerGrabber = require('./drawer-grabber.cjs');
|
|
11
|
+
const drawerGrabberIndicator = require('./drawer-grabber-indicator.cjs');
|
|
12
|
+
const drawerRoot = require('./drawer-root.cjs');
|
|
13
|
+
const drawerRootProvider = require('./drawer-root-provider.cjs');
|
|
14
|
+
const drawerTitle = require('./drawer-title.cjs');
|
|
15
|
+
const drawerTrigger = require('./drawer-trigger.cjs');
|
|
16
|
+
const drawerIndent = require('./drawer-indent.cjs');
|
|
17
|
+
const drawerIndentBackground = require('./drawer-indent-background.cjs');
|
|
18
|
+
const drawerStack = require('./drawer-stack.cjs');
|
|
19
|
+
const useDrawer = require('./use-drawer.cjs');
|
|
20
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
21
|
+
const useDrawerStackContext = require('./use-drawer-stack-context.cjs');
|
|
22
|
+
const drawer = require('./drawer.cjs');
|
|
23
|
+
const drawer$1 = require('@zag-js/drawer');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.DrawerBackdrop = drawerBackdrop.DrawerBackdrop;
|
|
28
|
+
exports.DrawerCloseTrigger = drawerCloseTrigger.DrawerCloseTrigger;
|
|
29
|
+
exports.DrawerContent = drawerContent.DrawerContent;
|
|
30
|
+
exports.DrawerContext = drawerContext.DrawerContext;
|
|
31
|
+
exports.DrawerPositioner = drawerPositioner.DrawerPositioner;
|
|
32
|
+
exports.DrawerGrabber = drawerGrabber.DrawerGrabber;
|
|
33
|
+
exports.DrawerGrabberIndicator = drawerGrabberIndicator.DrawerGrabberIndicator;
|
|
34
|
+
exports.DrawerRoot = drawerRoot.DrawerRoot;
|
|
35
|
+
exports.DrawerRootProvider = drawerRootProvider.DrawerRootProvider;
|
|
36
|
+
exports.DrawerTitle = drawerTitle.DrawerTitle;
|
|
37
|
+
exports.DrawerTrigger = drawerTrigger.DrawerTrigger;
|
|
38
|
+
exports.DrawerIndent = drawerIndent.DrawerIndent;
|
|
39
|
+
exports.DrawerIndentBackground = drawerIndentBackground.DrawerIndentBackground;
|
|
40
|
+
exports.DrawerStack = drawerStack.DrawerStack;
|
|
41
|
+
exports.useDrawer = useDrawer.useDrawer;
|
|
42
|
+
exports.useDrawerContext = useDrawerContext.useDrawerContext;
|
|
43
|
+
exports.useDrawerStackContext = useDrawerStackContext.useDrawerStackContext;
|
|
44
|
+
exports.Drawer = drawer;
|
|
45
|
+
Object.defineProperty(exports, "drawerAnatomy", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: () => drawer$1.anatomy
|
|
48
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { OpenChangeDetails as DrawerOpenChangeDetails, SnapPointChangeDetails as DrawerSnapPointChangeDetails, } from '@zag-js/drawer';
|
|
2
|
+
export { DrawerBackdrop, type DrawerBackdropBaseProps, type DrawerBackdropProps } from './drawer-backdrop';
|
|
3
|
+
export { DrawerCloseTrigger, type DrawerCloseTriggerBaseProps, type DrawerCloseTriggerProps, } from './drawer-close-trigger';
|
|
4
|
+
export { DrawerContent, type DrawerContentBaseProps, type DrawerContentProps } from './drawer-content';
|
|
5
|
+
export { DrawerContext, type DrawerContextProps } from './drawer-context';
|
|
6
|
+
export { DrawerPositioner, type DrawerPositionerBaseProps, type DrawerPositionerProps } from './drawer-positioner';
|
|
7
|
+
export { DrawerGrabber, type DrawerGrabberBaseProps, type DrawerGrabberProps } from './drawer-grabber';
|
|
8
|
+
export { DrawerGrabberIndicator, type DrawerGrabberIndicatorBaseProps, type DrawerGrabberIndicatorProps, } from './drawer-grabber-indicator';
|
|
9
|
+
export { DrawerRoot, type DrawerRootBaseProps, type DrawerRootProps } from './drawer-root';
|
|
10
|
+
export { DrawerRootProvider, type DrawerRootProviderBaseProps, type DrawerRootProviderProps, } from './drawer-root-provider';
|
|
11
|
+
export { DrawerTitle, type DrawerTitleBaseProps, type DrawerTitleProps } from './drawer-title';
|
|
12
|
+
export { DrawerTrigger, type DrawerTriggerBaseProps, type DrawerTriggerProps } from './drawer-trigger';
|
|
13
|
+
export { DrawerIndent, type DrawerIndentBaseProps, type DrawerIndentProps } from './drawer-indent';
|
|
14
|
+
export { DrawerIndentBackground, type DrawerIndentBackgroundBaseProps, type DrawerIndentBackgroundProps, } from './drawer-indent-background';
|
|
15
|
+
export { DrawerStack, type DrawerStackProps } from './drawer-stack';
|
|
16
|
+
export { drawerAnatomy } from './drawer.anatomy';
|
|
17
|
+
export { useDrawer, type UseDrawerProps, type UseDrawerReturn } from './use-drawer';
|
|
18
|
+
export { useDrawerContext, type UseDrawerContext } from './use-drawer-context';
|
|
19
|
+
export { useDrawerStackContext, type UseDrawerStackContext } from './use-drawer-stack-context';
|
|
20
|
+
export * as Drawer from './drawer';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { OpenChangeDetails as DrawerOpenChangeDetails, SnapPointChangeDetails as DrawerSnapPointChangeDetails, } from '@zag-js/drawer';
|
|
2
|
+
export { DrawerBackdrop, type DrawerBackdropBaseProps, type DrawerBackdropProps } from './drawer-backdrop';
|
|
3
|
+
export { DrawerCloseTrigger, type DrawerCloseTriggerBaseProps, type DrawerCloseTriggerProps, } from './drawer-close-trigger';
|
|
4
|
+
export { DrawerContent, type DrawerContentBaseProps, type DrawerContentProps } from './drawer-content';
|
|
5
|
+
export { DrawerContext, type DrawerContextProps } from './drawer-context';
|
|
6
|
+
export { DrawerPositioner, type DrawerPositionerBaseProps, type DrawerPositionerProps } from './drawer-positioner';
|
|
7
|
+
export { DrawerGrabber, type DrawerGrabberBaseProps, type DrawerGrabberProps } from './drawer-grabber';
|
|
8
|
+
export { DrawerGrabberIndicator, type DrawerGrabberIndicatorBaseProps, type DrawerGrabberIndicatorProps, } from './drawer-grabber-indicator';
|
|
9
|
+
export { DrawerRoot, type DrawerRootBaseProps, type DrawerRootProps } from './drawer-root';
|
|
10
|
+
export { DrawerRootProvider, type DrawerRootProviderBaseProps, type DrawerRootProviderProps, } from './drawer-root-provider';
|
|
11
|
+
export { DrawerTitle, type DrawerTitleBaseProps, type DrawerTitleProps } from './drawer-title';
|
|
12
|
+
export { DrawerTrigger, type DrawerTriggerBaseProps, type DrawerTriggerProps } from './drawer-trigger';
|
|
13
|
+
export { DrawerIndent, type DrawerIndentBaseProps, type DrawerIndentProps } from './drawer-indent';
|
|
14
|
+
export { DrawerIndentBackground, type DrawerIndentBackgroundBaseProps, type DrawerIndentBackgroundProps, } from './drawer-indent-background';
|
|
15
|
+
export { DrawerStack, type DrawerStackProps } from './drawer-stack';
|
|
16
|
+
export { drawerAnatomy } from './drawer.anatomy';
|
|
17
|
+
export { useDrawer, type UseDrawerProps, type UseDrawerReturn } from './use-drawer';
|
|
18
|
+
export { useDrawerContext, type UseDrawerContext } from './use-drawer-context';
|
|
19
|
+
export { useDrawerStackContext, type UseDrawerStackContext } from './use-drawer-stack-context';
|
|
20
|
+
export * as Drawer from './drawer';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { DrawerBackdrop } from './drawer-backdrop.js';
|
|
2
|
+
export { DrawerCloseTrigger } from './drawer-close-trigger.js';
|
|
3
|
+
export { DrawerContent } from './drawer-content.js';
|
|
4
|
+
export { DrawerContext } from './drawer-context.js';
|
|
5
|
+
export { DrawerPositioner } from './drawer-positioner.js';
|
|
6
|
+
export { DrawerGrabber } from './drawer-grabber.js';
|
|
7
|
+
export { DrawerGrabberIndicator } from './drawer-grabber-indicator.js';
|
|
8
|
+
export { DrawerRoot } from './drawer-root.js';
|
|
9
|
+
export { DrawerRootProvider } from './drawer-root-provider.js';
|
|
10
|
+
export { DrawerTitle } from './drawer-title.js';
|
|
11
|
+
export { DrawerTrigger } from './drawer-trigger.js';
|
|
12
|
+
export { DrawerIndent } from './drawer-indent.js';
|
|
13
|
+
export { DrawerIndentBackground } from './drawer-indent-background.js';
|
|
14
|
+
export { DrawerStack } from './drawer-stack.js';
|
|
15
|
+
export { useDrawer } from './use-drawer.js';
|
|
16
|
+
export { useDrawerContext } from './use-drawer-context.js';
|
|
17
|
+
export { useDrawerStackContext } from './use-drawer-stack-context.js';
|
|
18
|
+
import * as drawer from './drawer.js';
|
|
19
|
+
export { drawer as Drawer };
|
|
20
|
+
export { anatomy as drawerAnatomy } from '@zag-js/drawer';
|
|
@@ -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 [DrawerProvider, useDrawerContext] = createContext.createContext({
|
|
9
|
+
name: "DrawerContext",
|
|
10
|
+
hookName: "useDrawerContext",
|
|
11
|
+
providerName: "<DrawerProvider />"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.DrawerProvider = DrawerProvider;
|
|
15
|
+
exports.useDrawerContext = useDrawerContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from '../../utils/create-context.js';
|
|
3
|
+
|
|
4
|
+
const [DrawerProvider, useDrawerContext] = createContext({
|
|
5
|
+
name: "DrawerContext",
|
|
6
|
+
hookName: "useDrawerContext",
|
|
7
|
+
providerName: "<DrawerProvider />"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { DrawerProvider, useDrawerContext };
|
|
@@ -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 [DrawerStackProvider, useDrawerStackContext] = createContext.createContext({
|
|
9
|
+
name: "DrawerStackContext",
|
|
10
|
+
hookName: "useDrawerStackContext",
|
|
11
|
+
providerName: "<DrawerStackProvider />"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.DrawerStackProvider = DrawerStackProvider;
|
|
15
|
+
exports.useDrawerStackContext = useDrawerStackContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DrawerStackApi } from '@zag-js/drawer';
|
|
2
|
+
import { PropTypes } from '@zag-js/react';
|
|
3
|
+
import { Provider } from 'react';
|
|
4
|
+
export interface UseDrawerStackContext extends DrawerStackApi<PropTypes> {
|
|
5
|
+
}
|
|
6
|
+
export declare const DrawerStackProvider: Provider<UseDrawerStackContext>, useDrawerStackContext: () => UseDrawerStackContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DrawerStackApi } from '@zag-js/drawer';
|
|
2
|
+
import { PropTypes } from '@zag-js/react';
|
|
3
|
+
import { Provider } from 'react';
|
|
4
|
+
export interface UseDrawerStackContext extends DrawerStackApi<PropTypes> {
|
|
5
|
+
}
|
|
6
|
+
export declare const DrawerStackProvider: Provider<UseDrawerStackContext>, useDrawerStackContext: () => UseDrawerStackContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from '../../utils/create-context.js';
|
|
3
|
+
|
|
4
|
+
const [DrawerStackProvider, useDrawerStackContext] = createContext({
|
|
5
|
+
name: "DrawerStackContext",
|
|
6
|
+
hookName: "useDrawerStackContext",
|
|
7
|
+
providerName: "<DrawerStackProvider />"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { DrawerStackProvider, useDrawerStackContext };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const react = require('react');
|
|
7
|
+
|
|
8
|
+
const DrawerStackStoreContext = react.createContext(void 0);
|
|
9
|
+
const DrawerStackStoreProvider = DrawerStackStoreContext.Provider;
|
|
10
|
+
const useDrawerStackStore = () => react.useContext(DrawerStackStoreContext);
|
|
11
|
+
|
|
12
|
+
exports.DrawerStackStoreProvider = DrawerStackStoreProvider;
|
|
13
|
+
exports.useDrawerStackStore = useDrawerStackStore;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const DrawerStackStoreContext = createContext(void 0);
|
|
5
|
+
const DrawerStackStoreProvider = DrawerStackStoreContext.Provider;
|
|
6
|
+
const useDrawerStackStore = () => useContext(DrawerStackStoreContext);
|
|
7
|
+
|
|
8
|
+
export { DrawerStackStoreProvider, useDrawerStackStore };
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const drawer = require('@zag-js/drawer');
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
10
10
|
const useLocaleContext = require('../../providers/locale/use-locale-context.cjs');
|
|
11
|
+
const useDrawerStackStore = require('./use-drawer-stack-store.cjs');
|
|
11
12
|
|
|
12
13
|
function _interopNamespaceDefault(e) {
|
|
13
14
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -26,20 +27,22 @@ function _interopNamespaceDefault(e) {
|
|
|
26
27
|
return Object.freeze(n);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const
|
|
30
|
+
const drawer__namespace = /*#__PURE__*/_interopNamespaceDefault(drawer);
|
|
30
31
|
|
|
31
|
-
const
|
|
32
|
+
const useDrawer = (props) => {
|
|
32
33
|
const id = react.useId();
|
|
33
34
|
const { getRootNode } = useEnvironmentContext.useEnvironmentContext();
|
|
34
35
|
const { dir } = useLocaleContext.useLocaleContext();
|
|
36
|
+
const stack = useDrawerStackStore.useDrawerStackStore();
|
|
35
37
|
const context = {
|
|
36
38
|
id,
|
|
37
39
|
dir,
|
|
38
40
|
getRootNode,
|
|
41
|
+
stack,
|
|
39
42
|
...props
|
|
40
43
|
};
|
|
41
|
-
const service = react$1.useMachine(
|
|
42
|
-
return
|
|
44
|
+
const service = react$1.useMachine(drawer__namespace.machine, context);
|
|
45
|
+
return drawer__namespace.connect(service, react$1.normalizeProps);
|
|
43
46
|
};
|
|
44
47
|
|
|
45
|
-
exports.
|
|
48
|
+
exports.useDrawer = useDrawer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropTypes } from '@zag-js/react';
|
|
2
|
+
import { Optional } from '../../types';
|
|
3
|
+
import * as drawer from '@zag-js/drawer';
|
|
4
|
+
export interface UseDrawerProps extends Optional<Omit<drawer.Props, 'dir' | 'getRootNode' | 'defaultSnapPoint'>, 'id'> {
|
|
5
|
+
defaultSnapPoint?: drawer.SnapPoint | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface UseDrawerReturn extends drawer.Api<PropTypes> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useDrawer: (props?: UseDrawerProps) => UseDrawerReturn;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropTypes } from '@zag-js/react';
|
|
2
|
+
import { Optional } from '../../types';
|
|
3
|
+
import * as drawer from '@zag-js/drawer';
|
|
4
|
+
export interface UseDrawerProps extends Optional<Omit<drawer.Props, 'dir' | 'getRootNode' | 'defaultSnapPoint'>, 'id'> {
|
|
5
|
+
defaultSnapPoint?: drawer.SnapPoint | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface UseDrawerReturn extends drawer.Api<PropTypes> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useDrawer: (props?: UseDrawerProps) => UseDrawerReturn;
|