@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,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 DrawerCloseTrigger = react.forwardRef((props, ref) => {
|
|
13
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(drawer.getCloseTriggerProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
DrawerCloseTrigger.displayName = "DrawerCloseTrigger";
|
|
18
|
+
|
|
19
|
+
exports.DrawerCloseTrigger = DrawerCloseTrigger;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerCloseTriggerBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerCloseTriggerProps extends HTMLProps<'button'>, DrawerCloseTriggerBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerCloseTrigger: ForwardRefExoticComponent<DrawerCloseTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerCloseTriggerBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerCloseTriggerProps extends HTMLProps<'button'>, DrawerCloseTriggerBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerCloseTrigger: ForwardRefExoticComponent<DrawerCloseTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -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 DrawerCloseTrigger = forwardRef((props, ref) => {
|
|
9
|
+
const drawer = useDrawerContext();
|
|
10
|
+
const mergedProps = mergeProps(drawer.getCloseTriggerProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
DrawerCloseTrigger.displayName = "DrawerCloseTrigger";
|
|
14
|
+
|
|
15
|
+
export { DrawerCloseTrigger };
|
|
@@ -9,16 +9,16 @@ const react = require('react');
|
|
|
9
9
|
const composeRefs = require('../../utils/compose-refs.cjs');
|
|
10
10
|
const factory = require('../factory.cjs');
|
|
11
11
|
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
12
|
-
const
|
|
12
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
13
13
|
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
14
14
|
|
|
15
15
|
const splitContentProps = createSplitProps.createSplitProps();
|
|
16
|
-
const
|
|
16
|
+
const DrawerContent = react.forwardRef((props, ref) => {
|
|
17
17
|
const [contentProps, localProps] = splitContentProps(props, ["draggable"]);
|
|
18
|
-
const
|
|
18
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
19
19
|
const presence = usePresenceContext.usePresenceContext();
|
|
20
20
|
const mergedProps = react$1.mergeProps(
|
|
21
|
-
|
|
21
|
+
drawer.getContentProps({ draggable: true, ...contentProps }),
|
|
22
22
|
presence.getPresenceProps(),
|
|
23
23
|
localProps
|
|
24
24
|
);
|
|
@@ -27,6 +27,6 @@ const BottomSheetContent = react.forwardRef((props, ref) => {
|
|
|
27
27
|
}
|
|
28
28
|
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref: composeRefs.composeRefs(presence.ref, ref) });
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
DrawerContent.displayName = "DrawerContent";
|
|
31
31
|
|
|
32
|
-
exports.
|
|
32
|
+
exports.DrawerContent = DrawerContent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContentProps } from '@zag-js/drawer';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface DrawerContentBaseProps extends PolymorphicProps, ContentProps {
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerContentProps extends Omit<HTMLProps<'div'>, 'draggable'>, DrawerContentBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const DrawerContent: ForwardRefExoticComponent<DrawerContentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContentProps } from '@zag-js/drawer';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface DrawerContentBaseProps extends PolymorphicProps, ContentProps {
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerContentProps extends Omit<HTMLProps<'div'>, 'draggable'>, DrawerContentBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const DrawerContent: ForwardRefExoticComponent<DrawerContentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -5,16 +5,16 @@ import { forwardRef } from 'react';
|
|
|
5
5
|
import { composeRefs } from '../../utils/compose-refs.js';
|
|
6
6
|
import { ark } from '../factory.js';
|
|
7
7
|
import { usePresenceContext } from '../presence/use-presence-context.js';
|
|
8
|
-
import {
|
|
8
|
+
import { useDrawerContext } from './use-drawer-context.js';
|
|
9
9
|
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
10
10
|
|
|
11
11
|
const splitContentProps = createSplitProps();
|
|
12
|
-
const
|
|
12
|
+
const DrawerContent = forwardRef((props, ref) => {
|
|
13
13
|
const [contentProps, localProps] = splitContentProps(props, ["draggable"]);
|
|
14
|
-
const
|
|
14
|
+
const drawer = useDrawerContext();
|
|
15
15
|
const presence = usePresenceContext();
|
|
16
16
|
const mergedProps = mergeProps(
|
|
17
|
-
|
|
17
|
+
drawer.getContentProps({ draggable: true, ...contentProps }),
|
|
18
18
|
presence.getPresenceProps(),
|
|
19
19
|
localProps
|
|
20
20
|
);
|
|
@@ -23,6 +23,6 @@ const BottomSheetContent = forwardRef((props, ref) => {
|
|
|
23
23
|
}
|
|
24
24
|
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
DrawerContent.displayName = "DrawerContent";
|
|
27
27
|
|
|
28
|
-
export {
|
|
28
|
+
export { DrawerContent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
7
|
+
|
|
8
|
+
const DrawerContext = (props) => props.children(useDrawerContext.useDrawerContext());
|
|
9
|
+
|
|
10
|
+
exports.DrawerContext = DrawerContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseDrawerContext } from './use-drawer-context';
|
|
3
|
+
export interface DrawerContextProps {
|
|
4
|
+
children: (context: UseDrawerContext) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const DrawerContext: (props: DrawerContextProps) => ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseDrawerContext } from './use-drawer-context';
|
|
3
|
+
export interface DrawerContextProps {
|
|
4
|
+
children: (context: UseDrawerContext) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const DrawerContext: (props: DrawerContextProps) => ReactNode;
|
|
@@ -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 DrawerGrabberIndicator = react.forwardRef((props, ref) => {
|
|
13
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(drawer.getGrabberIndicatorProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
DrawerGrabberIndicator.displayName = "DrawerGrabberIndicator";
|
|
18
|
+
|
|
19
|
+
exports.DrawerGrabberIndicator = DrawerGrabberIndicator;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerGrabberIndicatorBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerGrabberIndicatorProps extends HTMLProps<'div'>, DrawerGrabberIndicatorBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerGrabberIndicator: ForwardRefExoticComponent<DrawerGrabberIndicatorProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerGrabberIndicatorBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerGrabberIndicatorProps extends HTMLProps<'div'>, DrawerGrabberIndicatorBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerGrabberIndicator: ForwardRefExoticComponent<DrawerGrabberIndicatorProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -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 DrawerGrabberIndicator = forwardRef((props, ref) => {
|
|
9
|
+
const drawer = useDrawerContext();
|
|
10
|
+
const mergedProps = mergeProps(drawer.getGrabberIndicatorProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
DrawerGrabberIndicator.displayName = "DrawerGrabberIndicator";
|
|
14
|
+
|
|
15
|
+
export { DrawerGrabberIndicator };
|
|
@@ -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 DrawerGrabber = react.forwardRef((props, ref) => {
|
|
13
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(drawer.getGrabberProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
DrawerGrabber.displayName = "DrawerGrabber";
|
|
18
|
+
|
|
19
|
+
exports.DrawerGrabber = DrawerGrabber;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerGrabberBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerGrabberProps extends HTMLProps<'div'>, DrawerGrabberBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerGrabber: ForwardRefExoticComponent<DrawerGrabberProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerGrabberBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerGrabberProps extends HTMLProps<'div'>, DrawerGrabberBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerGrabber: ForwardRefExoticComponent<DrawerGrabberProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -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 DrawerGrabber = forwardRef((props, ref) => {
|
|
9
|
+
const drawer = useDrawerContext();
|
|
10
|
+
const mergedProps = mergeProps(drawer.getGrabberProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
DrawerGrabber.displayName = "DrawerGrabber";
|
|
14
|
+
|
|
15
|
+
export { DrawerGrabber };
|
|
@@ -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 useDrawerStackContext = require('./use-drawer-stack-context.cjs');
|
|
11
|
+
|
|
12
|
+
const DrawerIndentBackground = react.forwardRef((props, ref) => {
|
|
13
|
+
const stackApi = useDrawerStackContext.useDrawerStackContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(stackApi.getIndentBackgroundProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
DrawerIndentBackground.displayName = "DrawerIndentBackground";
|
|
18
|
+
|
|
19
|
+
exports.DrawerIndentBackground = DrawerIndentBackground;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerIndentBackgroundBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerIndentBackgroundProps extends HTMLProps<'div'>, DrawerIndentBackgroundBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerIndentBackground: ForwardRefExoticComponent<DrawerIndentBackgroundProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerIndentBackgroundBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerIndentBackgroundProps extends HTMLProps<'div'>, DrawerIndentBackgroundBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerIndentBackground: ForwardRefExoticComponent<DrawerIndentBackgroundProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -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 { useDrawerStackContext } from './use-drawer-stack-context.js';
|
|
7
|
+
|
|
8
|
+
const DrawerIndentBackground = forwardRef((props, ref) => {
|
|
9
|
+
const stackApi = useDrawerStackContext();
|
|
10
|
+
const mergedProps = mergeProps(stackApi.getIndentBackgroundProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
DrawerIndentBackground.displayName = "DrawerIndentBackground";
|
|
14
|
+
|
|
15
|
+
export { DrawerIndentBackground };
|
|
@@ -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 useDrawerStackContext = require('./use-drawer-stack-context.cjs');
|
|
11
|
+
|
|
12
|
+
const DrawerIndent = react.forwardRef((props, ref) => {
|
|
13
|
+
const stackApi = useDrawerStackContext.useDrawerStackContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(stackApi.getIndentProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
DrawerIndent.displayName = "DrawerIndent";
|
|
18
|
+
|
|
19
|
+
exports.DrawerIndent = DrawerIndent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerIndentBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerIndentProps extends HTMLProps<'div'>, DrawerIndentBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerIndent: ForwardRefExoticComponent<DrawerIndentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerIndentBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerIndentProps extends HTMLProps<'div'>, DrawerIndentBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerIndent: ForwardRefExoticComponent<DrawerIndentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -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 { useDrawerStackContext } from './use-drawer-stack-context.js';
|
|
7
|
+
|
|
8
|
+
const DrawerIndent = forwardRef((props, ref) => {
|
|
9
|
+
const stackApi = useDrawerStackContext();
|
|
10
|
+
const mergedProps = mergeProps(stackApi.getIndentProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
DrawerIndent.displayName = "DrawerIndent";
|
|
14
|
+
|
|
15
|
+
export { DrawerIndent };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
11
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
12
|
+
|
|
13
|
+
const DrawerPositioner = react.forwardRef((props, ref) => {
|
|
14
|
+
const drawer = useDrawerContext.useDrawerContext();
|
|
15
|
+
const presence = usePresenceContext.usePresenceContext();
|
|
16
|
+
const mergedProps = react$1.mergeProps(drawer.getPositionerProps(), props);
|
|
17
|
+
if (presence.unmounted) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
21
|
+
});
|
|
22
|
+
DrawerPositioner.displayName = "DrawerPositioner";
|
|
23
|
+
|
|
24
|
+
exports.DrawerPositioner = DrawerPositioner;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerPositionerBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerPositionerProps extends HTMLProps<'div'>, DrawerPositionerBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerPositioner: ForwardRefExoticComponent<DrawerPositionerProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface DrawerPositionerBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerPositionerProps extends HTMLProps<'div'>, DrawerPositionerBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const DrawerPositioner: ForwardRefExoticComponent<DrawerPositionerProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { usePresenceContext } from '../presence/use-presence-context.js';
|
|
7
|
+
import { useDrawerContext } from './use-drawer-context.js';
|
|
8
|
+
|
|
9
|
+
const DrawerPositioner = forwardRef((props, ref) => {
|
|
10
|
+
const drawer = useDrawerContext();
|
|
11
|
+
const presence = usePresenceContext();
|
|
12
|
+
const mergedProps = mergeProps(drawer.getPositionerProps(), props);
|
|
13
|
+
if (presence.unmounted) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
17
|
+
});
|
|
18
|
+
DrawerPositioner.displayName = "DrawerPositioner";
|
|
19
|
+
|
|
20
|
+
export { DrawerPositioner };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const react = require('@zag-js/react');
|
|
8
|
+
const renderStrategy = require('../../utils/render-strategy.cjs');
|
|
9
|
+
const splitPresenceProps = require('../presence/split-presence-props.cjs');
|
|
10
|
+
const usePresence = require('../presence/use-presence.cjs');
|
|
11
|
+
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
12
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
13
|
+
|
|
14
|
+
const DrawerRootProvider = (props) => {
|
|
15
|
+
const [presenceProps, { value: drawer, children }] = splitPresenceProps.splitPresenceProps(props);
|
|
16
|
+
const [renderStrategyProps] = renderStrategy.splitRenderStrategyProps(presenceProps);
|
|
17
|
+
const presence = usePresence.usePresence(react.mergeProps({ present: drawer.open }, presenceProps));
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useDrawerContext.DrawerProvider, { value: drawer, children: /* @__PURE__ */ jsxRuntime.jsx(renderStrategy.RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsxRuntime.jsx(usePresenceContext.PresenceProvider, { value: presence, children }) }) });
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.DrawerRootProvider = DrawerRootProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PolymorphicProps } from '../factory';
|
|
3
|
+
import { UsePresenceProps } from '../presence';
|
|
4
|
+
import { UseDrawerReturn } from './use-drawer';
|
|
5
|
+
interface RootProviderProps {
|
|
6
|
+
value: UseDrawerReturn;
|
|
7
|
+
}
|
|
8
|
+
export interface DrawerRootProviderBaseProps extends RootProviderProps, UsePresenceProps, PolymorphicProps {
|
|
9
|
+
}
|
|
10
|
+
export interface DrawerRootProviderProps extends DrawerRootProviderBaseProps {
|
|
11
|
+
children?: ReactNode | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare const DrawerRootProvider: (props: DrawerRootProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PolymorphicProps } from '../factory';
|
|
3
|
+
import { UsePresenceProps } from '../presence';
|
|
4
|
+
import { UseDrawerReturn } from './use-drawer';
|
|
5
|
+
interface RootProviderProps {
|
|
6
|
+
value: UseDrawerReturn;
|
|
7
|
+
}
|
|
8
|
+
export interface DrawerRootProviderBaseProps extends RootProviderProps, UsePresenceProps, PolymorphicProps {
|
|
9
|
+
}
|
|
10
|
+
export interface DrawerRootProviderProps extends DrawerRootProviderBaseProps {
|
|
11
|
+
children?: ReactNode | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare const DrawerRootProvider: (props: DrawerRootProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';
|
|
5
|
+
import { splitPresenceProps } from '../presence/split-presence-props.js';
|
|
6
|
+
import { usePresence } from '../presence/use-presence.js';
|
|
7
|
+
import { PresenceProvider } from '../presence/use-presence-context.js';
|
|
8
|
+
import { DrawerProvider } from './use-drawer-context.js';
|
|
9
|
+
|
|
10
|
+
const DrawerRootProvider = (props) => {
|
|
11
|
+
const [presenceProps, { value: drawer, children }] = splitPresenceProps(props);
|
|
12
|
+
const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);
|
|
13
|
+
const presence = usePresence(mergeProps({ present: drawer.open }, presenceProps));
|
|
14
|
+
return /* @__PURE__ */ jsx(DrawerProvider, { value: drawer, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) }) });
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { DrawerRootProvider };
|
|
@@ -9,15 +9,15 @@ const renderStrategy = require('../../utils/render-strategy.cjs');
|
|
|
9
9
|
const splitPresenceProps = require('../presence/split-presence-props.cjs');
|
|
10
10
|
const usePresence = require('../presence/use-presence.cjs');
|
|
11
11
|
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const useDrawer = require('./use-drawer.cjs');
|
|
13
|
+
const useDrawerContext = require('./use-drawer-context.cjs');
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const DrawerRoot = (props) => {
|
|
16
16
|
const [presenceProps, { children, ...localProps }] = splitPresenceProps.splitPresenceProps(props);
|
|
17
17
|
const [renderStrategyProps] = renderStrategy.splitRenderStrategyProps(presenceProps);
|
|
18
|
-
const
|
|
19
|
-
const presence = usePresence.usePresence(react.mergeProps({ present:
|
|
20
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
const drawer = useDrawer.useDrawer(localProps);
|
|
19
|
+
const presence = usePresence.usePresence(react.mergeProps({ present: drawer.open }, presenceProps));
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useDrawerContext.DrawerProvider, { value: drawer, children: /* @__PURE__ */ jsxRuntime.jsx(renderStrategy.RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsxRuntime.jsx(usePresenceContext.PresenceProvider, { value: presence, children }) }) });
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
exports.
|
|
23
|
+
exports.DrawerRoot = DrawerRoot;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UsePresenceProps } from '../presence';
|
|
3
|
+
import { UseDrawerProps } from './use-drawer';
|
|
4
|
+
export interface DrawerRootBaseProps extends UseDrawerProps, UsePresenceProps {
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerRootProps extends DrawerRootBaseProps {
|
|
7
|
+
children?: ReactNode | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const DrawerRoot: (props: DrawerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UsePresenceProps } from '../presence';
|
|
3
|
+
import { UseDrawerProps } from './use-drawer';
|
|
4
|
+
export interface DrawerRootBaseProps extends UseDrawerProps, UsePresenceProps {
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerRootProps extends DrawerRootBaseProps {
|
|
7
|
+
children?: ReactNode | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const DrawerRoot: (props: DrawerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';
|
|
5
|
+
import { splitPresenceProps } from '../presence/split-presence-props.js';
|
|
6
|
+
import { usePresence } from '../presence/use-presence.js';
|
|
7
|
+
import { PresenceProvider } from '../presence/use-presence-context.js';
|
|
8
|
+
import { useDrawer } from './use-drawer.js';
|
|
9
|
+
import { DrawerProvider } from './use-drawer-context.js';
|
|
10
|
+
|
|
11
|
+
const DrawerRoot = (props) => {
|
|
12
|
+
const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
|
|
13
|
+
const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);
|
|
14
|
+
const drawer = useDrawer(localProps);
|
|
15
|
+
const presence = usePresence(mergeProps({ present: drawer.open }, presenceProps));
|
|
16
|
+
return /* @__PURE__ */ jsx(DrawerProvider, { value: drawer, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) }) });
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { DrawerRoot };
|