@spark-ui/components 13.0.1 → 13.0.3-beta.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/DialogTrigger-8oDlAJjU.d.mts +142 -0
- package/dist/DialogTrigger-8oDlAJjU.d.ts +142 -0
- package/dist/DialogTrigger-woU7vsJi.d.mts +142 -0
- package/dist/DialogTrigger-woU7vsJi.d.ts +142 -0
- package/dist/avatar/index.mjs +2 -2
- package/dist/carousel/index.mjs +2 -2
- package/dist/chunk-2BSBKLHG.mjs +358 -0
- package/dist/chunk-2BSBKLHG.mjs.map +1 -0
- package/dist/chunk-D7YBYT5H.mjs +308 -0
- package/dist/chunk-D7YBYT5H.mjs.map +1 -0
- package/dist/chunk-HEKSVWYW.mjs +800 -0
- package/dist/chunk-HEKSVWYW.mjs.map +1 -0
- package/dist/chunk-TKAU6SMC.mjs +197 -0
- package/dist/chunk-TKAU6SMC.mjs.map +1 -0
- package/dist/chunk-WA56YHV3.mjs +358 -0
- package/dist/chunk-WA56YHV3.mjs.map +1 -0
- package/dist/chunk-WLI4EPS6.mjs +358 -0
- package/dist/chunk-WLI4EPS6.mjs.map +1 -0
- package/dist/chunk-XYK6V3JF.mjs +53 -0
- package/dist/chunk-XYK6V3JF.mjs.map +1 -0
- package/dist/combobox/index.mjs +3 -3
- package/dist/dialog/index.mjs +2 -2
- package/dist/docgen.json +3036 -2846
- package/dist/drawer/index.d.mts +37 -29
- package/dist/drawer/index.d.ts +37 -29
- package/dist/drawer/index.js +125 -89
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +127 -89
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown/index.mjs +2 -2
- package/dist/file-upload/index.mjs +3 -3
- package/dist/index-BRKaV3lI.d.mts +93 -0
- package/dist/index-BRKaV3lI.d.ts +93 -0
- package/dist/index-Cw_DIfiq.d.mts +93 -0
- package/dist/index-Cw_DIfiq.d.ts +93 -0
- package/dist/pagination/index.mjs +3 -3
- package/dist/popover/index.mjs +1 -1
- package/dist/scrolling-list/index.mjs +3 -3
- package/dist/snackbar/index.mjs +3 -3
- package/dist/spinner/index.d.mts +1 -1
- package/dist/spinner/index.d.ts +1 -1
- package/dist/stepper/index.mjs +2 -2
- package/dist/tabs/index.mjs +3 -3
- package/dist/toast/index.js +2 -2
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +5 -5
- package/dist/toast/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/drawer/index.d.mts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Dialog } from '
|
|
2
|
-
import { ReactElement, ReactNode, Ref, ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { Dialog } from '@base-ui-components/react/dialog';
|
|
2
|
+
import { ComponentProps, ReactElement, ReactNode, Ref, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import { IconButtonProps } from '../icon-button/index.mjs';
|
|
7
7
|
import '../button/index.mjs';
|
|
8
8
|
|
|
9
|
-
interface DrawerProps {
|
|
10
|
-
/**
|
|
11
|
-
* Children of the component.
|
|
12
|
-
*/
|
|
13
|
-
children?: Dialog.DialogProps['children'];
|
|
9
|
+
interface DrawerProps extends Omit<ComponentProps<typeof Dialog.Root>, 'onOpenChange' | 'render'> {
|
|
14
10
|
/**
|
|
15
11
|
* Specifies if the dialog is open or not.
|
|
16
12
|
*/
|
|
17
|
-
open?:
|
|
13
|
+
open?: boolean;
|
|
18
14
|
/**
|
|
19
15
|
* Default open state.
|
|
20
16
|
*/
|
|
21
|
-
defaultOpen?:
|
|
17
|
+
defaultOpen?: boolean;
|
|
22
18
|
/**
|
|
23
19
|
* Handler executed on every dialog open state change.
|
|
24
20
|
*/
|
|
25
|
-
onOpenChange?:
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
26
22
|
/**
|
|
27
23
|
* Specifies if the dialog is a modal.
|
|
28
24
|
*/
|
|
29
|
-
modal?:
|
|
25
|
+
modal?: boolean;
|
|
30
26
|
/**
|
|
31
27
|
* Specifies if the drawer should have a fade animation on its body (in case it is scrollable).
|
|
32
28
|
*/
|
|
33
29
|
withFade?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
32
|
+
*/
|
|
33
|
+
asChild?: boolean;
|
|
34
34
|
}
|
|
35
35
|
declare const Drawer$1: {
|
|
36
|
-
({
|
|
36
|
+
({ onOpenChange, withFade, ...props }: DrawerProps): ReactElement;
|
|
37
37
|
displayName: string;
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -52,9 +52,13 @@ declare const DrawerBody: {
|
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
interface DrawerCloseProps extends Omit<ComponentProps<typeof Dialog.Close>, 'render'> {
|
|
56
|
+
/**
|
|
57
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
58
|
+
*/
|
|
59
|
+
asChild?: boolean;
|
|
56
60
|
ref?: Ref<HTMLButtonElement>;
|
|
57
|
-
}
|
|
61
|
+
}
|
|
58
62
|
|
|
59
63
|
type DrawerCloseButtonProps = DrawerCloseProps & Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>;
|
|
60
64
|
declare const DrawerCloseButton: {
|
|
@@ -68,17 +72,21 @@ declare const drawerContentStyles: (props?: ({
|
|
|
68
72
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
69
73
|
type DrawerContentStylesProps = VariantProps<typeof drawerContentStyles>;
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
interface DrawerContentProps extends Omit<ComponentProps<typeof Dialog.Popup>, 'render' | 'onInteractOutside'>, DrawerContentStylesProps {
|
|
72
76
|
ref?: Ref<HTMLDivElement>;
|
|
73
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Handler called when the user clicks outside the drawer.
|
|
79
|
+
*/
|
|
80
|
+
onInteractOutside?: (event: PointerEvent) => void;
|
|
81
|
+
}
|
|
74
82
|
declare const DrawerContent: {
|
|
75
83
|
({ className, size, side, onInteractOutside, ref, ...rest }: DrawerContentProps): react_jsx_runtime.JSX.Element;
|
|
76
84
|
displayName: string;
|
|
77
85
|
};
|
|
78
86
|
|
|
79
|
-
|
|
87
|
+
interface DrawerDescriptionProps extends Omit<ComponentProps<typeof Dialog.Description>, 'render'> {
|
|
80
88
|
ref?: Ref<HTMLParagraphElement>;
|
|
81
|
-
}
|
|
89
|
+
}
|
|
82
90
|
declare const DrawerDescription: {
|
|
83
91
|
(props: DrawerDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
84
92
|
displayName: string;
|
|
@@ -102,37 +110,37 @@ declare const DrawerHeader: {
|
|
|
102
110
|
displayName: string;
|
|
103
111
|
};
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
interface DrawerOverlayProps extends Omit<ComponentProps<typeof Dialog.Backdrop>, 'render'> {
|
|
106
114
|
ref?: Ref<HTMLDivElement>;
|
|
107
|
-
}
|
|
115
|
+
}
|
|
108
116
|
declare const DrawerOverlay: {
|
|
109
|
-
({ className,
|
|
117
|
+
({ className, ...props }: DrawerOverlayProps): react_jsx_runtime.JSX.Element;
|
|
110
118
|
displayName: string;
|
|
111
119
|
};
|
|
112
120
|
|
|
113
|
-
type DrawerPortalProps = Dialog.
|
|
121
|
+
type DrawerPortalProps = ComponentProps<typeof Dialog.Portal>;
|
|
114
122
|
declare const DrawerPortal: {
|
|
115
|
-
(
|
|
123
|
+
(props: DrawerPortalProps): react_jsx_runtime.JSX.Element;
|
|
116
124
|
displayName: string;
|
|
117
125
|
};
|
|
118
126
|
|
|
119
|
-
|
|
127
|
+
interface DrawerTitleProps extends Omit<ComponentProps<typeof Dialog.Title>, 'render'> {
|
|
120
128
|
ref?: Ref<HTMLHeadingElement>;
|
|
121
|
-
}
|
|
129
|
+
}
|
|
122
130
|
declare const DrawerTitle: {
|
|
123
|
-
({ className,
|
|
131
|
+
({ className, ...props }: DrawerTitleProps): react_jsx_runtime.JSX.Element;
|
|
124
132
|
displayName: string;
|
|
125
133
|
};
|
|
126
134
|
|
|
127
|
-
interface DrawerTriggerProps extends Dialog.
|
|
135
|
+
interface DrawerTriggerProps extends Omit<ComponentProps<typeof Dialog.Trigger>, 'render'> {
|
|
128
136
|
/**
|
|
129
|
-
* Change the
|
|
137
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
130
138
|
*/
|
|
131
139
|
asChild?: boolean;
|
|
132
140
|
ref?: Ref<HTMLButtonElement>;
|
|
133
141
|
}
|
|
134
142
|
declare const DrawerTrigger: {
|
|
135
|
-
(props: DrawerTriggerProps):
|
|
143
|
+
({ asChild, ...props }: DrawerTriggerProps): react_jsx_runtime.JSX.Element;
|
|
136
144
|
displayName: string;
|
|
137
145
|
};
|
|
138
146
|
|
package/dist/drawer/index.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Dialog } from '
|
|
2
|
-
import { ReactElement, ReactNode, Ref, ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { Dialog } from '@base-ui-components/react/dialog';
|
|
2
|
+
import { ComponentProps, ReactElement, ReactNode, Ref, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import { IconButtonProps } from '../icon-button/index.js';
|
|
7
7
|
import '../button/index.js';
|
|
8
8
|
|
|
9
|
-
interface DrawerProps {
|
|
10
|
-
/**
|
|
11
|
-
* Children of the component.
|
|
12
|
-
*/
|
|
13
|
-
children?: Dialog.DialogProps['children'];
|
|
9
|
+
interface DrawerProps extends Omit<ComponentProps<typeof Dialog.Root>, 'onOpenChange' | 'render'> {
|
|
14
10
|
/**
|
|
15
11
|
* Specifies if the dialog is open or not.
|
|
16
12
|
*/
|
|
17
|
-
open?:
|
|
13
|
+
open?: boolean;
|
|
18
14
|
/**
|
|
19
15
|
* Default open state.
|
|
20
16
|
*/
|
|
21
|
-
defaultOpen?:
|
|
17
|
+
defaultOpen?: boolean;
|
|
22
18
|
/**
|
|
23
19
|
* Handler executed on every dialog open state change.
|
|
24
20
|
*/
|
|
25
|
-
onOpenChange?:
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
26
22
|
/**
|
|
27
23
|
* Specifies if the dialog is a modal.
|
|
28
24
|
*/
|
|
29
|
-
modal?:
|
|
25
|
+
modal?: boolean;
|
|
30
26
|
/**
|
|
31
27
|
* Specifies if the drawer should have a fade animation on its body (in case it is scrollable).
|
|
32
28
|
*/
|
|
33
29
|
withFade?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
32
|
+
*/
|
|
33
|
+
asChild?: boolean;
|
|
34
34
|
}
|
|
35
35
|
declare const Drawer$1: {
|
|
36
|
-
({
|
|
36
|
+
({ onOpenChange, withFade, ...props }: DrawerProps): ReactElement;
|
|
37
37
|
displayName: string;
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -52,9 +52,13 @@ declare const DrawerBody: {
|
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
interface DrawerCloseProps extends Omit<ComponentProps<typeof Dialog.Close>, 'render'> {
|
|
56
|
+
/**
|
|
57
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
58
|
+
*/
|
|
59
|
+
asChild?: boolean;
|
|
56
60
|
ref?: Ref<HTMLButtonElement>;
|
|
57
|
-
}
|
|
61
|
+
}
|
|
58
62
|
|
|
59
63
|
type DrawerCloseButtonProps = DrawerCloseProps & Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>;
|
|
60
64
|
declare const DrawerCloseButton: {
|
|
@@ -68,17 +72,21 @@ declare const drawerContentStyles: (props?: ({
|
|
|
68
72
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
69
73
|
type DrawerContentStylesProps = VariantProps<typeof drawerContentStyles>;
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
interface DrawerContentProps extends Omit<ComponentProps<typeof Dialog.Popup>, 'render' | 'onInteractOutside'>, DrawerContentStylesProps {
|
|
72
76
|
ref?: Ref<HTMLDivElement>;
|
|
73
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Handler called when the user clicks outside the drawer.
|
|
79
|
+
*/
|
|
80
|
+
onInteractOutside?: (event: PointerEvent) => void;
|
|
81
|
+
}
|
|
74
82
|
declare const DrawerContent: {
|
|
75
83
|
({ className, size, side, onInteractOutside, ref, ...rest }: DrawerContentProps): react_jsx_runtime.JSX.Element;
|
|
76
84
|
displayName: string;
|
|
77
85
|
};
|
|
78
86
|
|
|
79
|
-
|
|
87
|
+
interface DrawerDescriptionProps extends Omit<ComponentProps<typeof Dialog.Description>, 'render'> {
|
|
80
88
|
ref?: Ref<HTMLParagraphElement>;
|
|
81
|
-
}
|
|
89
|
+
}
|
|
82
90
|
declare const DrawerDescription: {
|
|
83
91
|
(props: DrawerDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
84
92
|
displayName: string;
|
|
@@ -102,37 +110,37 @@ declare const DrawerHeader: {
|
|
|
102
110
|
displayName: string;
|
|
103
111
|
};
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
interface DrawerOverlayProps extends Omit<ComponentProps<typeof Dialog.Backdrop>, 'render'> {
|
|
106
114
|
ref?: Ref<HTMLDivElement>;
|
|
107
|
-
}
|
|
115
|
+
}
|
|
108
116
|
declare const DrawerOverlay: {
|
|
109
|
-
({ className,
|
|
117
|
+
({ className, ...props }: DrawerOverlayProps): react_jsx_runtime.JSX.Element;
|
|
110
118
|
displayName: string;
|
|
111
119
|
};
|
|
112
120
|
|
|
113
|
-
type DrawerPortalProps = Dialog.
|
|
121
|
+
type DrawerPortalProps = ComponentProps<typeof Dialog.Portal>;
|
|
114
122
|
declare const DrawerPortal: {
|
|
115
|
-
(
|
|
123
|
+
(props: DrawerPortalProps): react_jsx_runtime.JSX.Element;
|
|
116
124
|
displayName: string;
|
|
117
125
|
};
|
|
118
126
|
|
|
119
|
-
|
|
127
|
+
interface DrawerTitleProps extends Omit<ComponentProps<typeof Dialog.Title>, 'render'> {
|
|
120
128
|
ref?: Ref<HTMLHeadingElement>;
|
|
121
|
-
}
|
|
129
|
+
}
|
|
122
130
|
declare const DrawerTitle: {
|
|
123
|
-
({ className,
|
|
131
|
+
({ className, ...props }: DrawerTitleProps): react_jsx_runtime.JSX.Element;
|
|
124
132
|
displayName: string;
|
|
125
133
|
};
|
|
126
134
|
|
|
127
|
-
interface DrawerTriggerProps extends Dialog.
|
|
135
|
+
interface DrawerTriggerProps extends Omit<ComponentProps<typeof Dialog.Trigger>, 'render'> {
|
|
128
136
|
/**
|
|
129
|
-
* Change the
|
|
137
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
130
138
|
*/
|
|
131
139
|
asChild?: boolean;
|
|
132
140
|
ref?: Ref<HTMLButtonElement>;
|
|
133
141
|
}
|
|
134
142
|
declare const DrawerTrigger: {
|
|
135
|
-
(props: DrawerTriggerProps):
|
|
143
|
+
({ asChild, ...props }: DrawerTriggerProps): react_jsx_runtime.JSX.Element;
|
|
136
144
|
displayName: string;
|
|
137
145
|
};
|
|
138
146
|
|
package/dist/drawer/index.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(drawer_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(drawer_exports);
|
|
26
26
|
|
|
27
27
|
// src/drawer/Drawer.tsx
|
|
28
|
-
var
|
|
28
|
+
var import_dialog = require("@base-ui-components/react/dialog");
|
|
29
29
|
|
|
30
30
|
// src/drawer/DrawerContext.tsx
|
|
31
31
|
var import_react = require("react");
|
|
@@ -55,7 +55,12 @@ var useDrawer = () => {
|
|
|
55
55
|
|
|
56
56
|
// src/drawer/Drawer.tsx
|
|
57
57
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
58
|
-
var Drawer = ({
|
|
58
|
+
var Drawer = ({ onOpenChange, withFade = false, ...props }) => {
|
|
59
|
+
const handleOpenChange = onOpenChange ? (open, _eventDetails) => {
|
|
60
|
+
onOpenChange(open);
|
|
61
|
+
} : void 0;
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DrawerProvider, { withFade, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog.Dialog.Root, { "data-spark-component": "drawer", onOpenChange: handleOpenChange, ...props }) });
|
|
63
|
+
};
|
|
59
64
|
Drawer.displayName = "Drawer.Root";
|
|
60
65
|
|
|
61
66
|
// src/drawer/DrawerBody.tsx
|
|
@@ -121,12 +126,12 @@ var import_class_variance_authority7 = require("class-variance-authority");
|
|
|
121
126
|
var import_react4 = require("react");
|
|
122
127
|
|
|
123
128
|
// src/slot/Slot.tsx
|
|
124
|
-
var
|
|
129
|
+
var import_radix_ui = require("radix-ui");
|
|
125
130
|
var import_react3 = require("react");
|
|
126
131
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
127
|
-
var Slottable =
|
|
132
|
+
var Slottable = import_radix_ui.Slot.Slottable;
|
|
128
133
|
var Slot = ({ ref, ...props }) => {
|
|
129
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
130
135
|
};
|
|
131
136
|
var wrapPolymorphicSlot = (asChild, children, callback) => {
|
|
132
137
|
if (!asChild) return callback(children);
|
|
@@ -1128,23 +1133,35 @@ var IconButton = ({
|
|
|
1128
1133
|
IconButton.displayName = "IconButton";
|
|
1129
1134
|
|
|
1130
1135
|
// src/drawer/DrawerClose.tsx
|
|
1131
|
-
var
|
|
1136
|
+
var import_dialog2 = require("@base-ui-components/react/dialog");
|
|
1137
|
+
|
|
1138
|
+
// src/drawer/useRenderSlot.tsx
|
|
1132
1139
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1133
|
-
|
|
1140
|
+
function useRenderSlot(asChild, defaultTag) {
|
|
1141
|
+
const Component = asChild ? Slot : defaultTag;
|
|
1142
|
+
return asChild ? ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Component, { ...props }) : void 0;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// src/drawer/DrawerClose.tsx
|
|
1146
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1147
|
+
var DrawerClose = ({ asChild = false, ...props }) => {
|
|
1148
|
+
const renderSlot = useRenderSlot(asChild, "button");
|
|
1149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dialog2.Dialog.Close, { "data-spark-component": "drawer-close", render: renderSlot, ...props });
|
|
1150
|
+
};
|
|
1134
1151
|
DrawerClose.displayName = "Drawer.Close";
|
|
1135
1152
|
|
|
1136
1153
|
// src/drawer/DrawerCloseButton.tsx
|
|
1137
|
-
var
|
|
1154
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1138
1155
|
var DrawerCloseButton = ({
|
|
1139
1156
|
"aria-label": ariaLabel,
|
|
1140
1157
|
className,
|
|
1141
1158
|
size = "md",
|
|
1142
1159
|
intent = "neutral",
|
|
1143
1160
|
design = "ghost",
|
|
1144
|
-
children = /* @__PURE__ */ (0,
|
|
1161
|
+
children = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Close.Close, {}),
|
|
1145
1162
|
ref,
|
|
1146
1163
|
...rest
|
|
1147
|
-
}) => /* @__PURE__ */ (0,
|
|
1164
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1148
1165
|
DrawerClose,
|
|
1149
1166
|
{
|
|
1150
1167
|
"data-spark-component": "drawer-close-button",
|
|
@@ -1152,20 +1169,22 @@ var DrawerCloseButton = ({
|
|
|
1152
1169
|
className: (0, import_class_variance_authority7.cx)(["absolute", "top-sm", "right-xl"], className),
|
|
1153
1170
|
asChild: true,
|
|
1154
1171
|
...rest,
|
|
1155
|
-
children: /* @__PURE__ */ (0,
|
|
1172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { intent, size, design, "aria-label": ariaLabel, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { children }) })
|
|
1156
1173
|
}
|
|
1157
1174
|
);
|
|
1158
1175
|
DrawerCloseButton.displayName = "Drawer.CloseButton";
|
|
1159
1176
|
|
|
1160
1177
|
// src/drawer/DrawerContent.tsx
|
|
1161
|
-
var
|
|
1178
|
+
var import_dialog3 = require("@base-ui-components/react/dialog");
|
|
1179
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1162
1180
|
|
|
1163
1181
|
// src/drawer/DrawerContent.styles.tsx
|
|
1164
1182
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1165
1183
|
var drawerContentStyles = (0, import_class_variance_authority8.cva)(
|
|
1166
1184
|
[
|
|
1167
1185
|
"fixed z-modal flex flex-col bg-surface shadow-md",
|
|
1168
|
-
|
|
1186
|
+
// Base UI uses data-open and data-closed for transitions
|
|
1187
|
+
"data-open:animation-duration-400 data-closed:animation-duration-200"
|
|
1169
1188
|
],
|
|
1170
1189
|
{
|
|
1171
1190
|
variants: {
|
|
@@ -1179,25 +1198,25 @@ var drawerContentStyles = (0, import_class_variance_authority8.cva)(
|
|
|
1179
1198
|
side: {
|
|
1180
1199
|
right: [
|
|
1181
1200
|
"inset-y-0 right-0",
|
|
1182
|
-
"data-
|
|
1183
|
-
"data-
|
|
1201
|
+
"data-open:animate-slide-in-right ",
|
|
1202
|
+
"data-closed:animate-slide-out-right"
|
|
1184
1203
|
],
|
|
1185
1204
|
left: [
|
|
1186
1205
|
"inset-y-0 left-0",
|
|
1187
|
-
"data-
|
|
1188
|
-
"data-
|
|
1206
|
+
"data-open:animate-slide-in-left",
|
|
1207
|
+
"data-closed:animate-slide-out-left"
|
|
1189
1208
|
],
|
|
1190
1209
|
top: [
|
|
1191
1210
|
"top-0 left-0",
|
|
1192
1211
|
"w-screen",
|
|
1193
|
-
"data-
|
|
1194
|
-
"data-
|
|
1212
|
+
"data-open:animate-slide-in-top",
|
|
1213
|
+
"data-closed:animate-slide-out-top"
|
|
1195
1214
|
],
|
|
1196
1215
|
bottom: [
|
|
1197
1216
|
"bottom-0 left-0",
|
|
1198
1217
|
"w-screen",
|
|
1199
|
-
"data-
|
|
1200
|
-
"data-
|
|
1218
|
+
"data-open:animate-slide-in-bottom",
|
|
1219
|
+
"data-closed:animate-slide-out-bottom"
|
|
1201
1220
|
]
|
|
1202
1221
|
}
|
|
1203
1222
|
},
|
|
@@ -1251,7 +1270,7 @@ var drawerContentStyles = (0, import_class_variance_authority8.cva)(
|
|
|
1251
1270
|
);
|
|
1252
1271
|
|
|
1253
1272
|
// src/drawer/DrawerContent.tsx
|
|
1254
|
-
var
|
|
1273
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1255
1274
|
var DrawerContent = ({
|
|
1256
1275
|
className,
|
|
1257
1276
|
size = "md",
|
|
@@ -1259,62 +1278,71 @@ var DrawerContent = ({
|
|
|
1259
1278
|
onInteractOutside,
|
|
1260
1279
|
ref,
|
|
1261
1280
|
...rest
|
|
1262
|
-
}) =>
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
"
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
)
|
|
1281
|
+
}) => {
|
|
1282
|
+
const handleInteractOutside = onInteractOutside ? (event) => {
|
|
1283
|
+
const e = event;
|
|
1284
|
+
const isForegroundElement = e.target?.closest(".z-toast, .z-popover");
|
|
1285
|
+
if (isForegroundElement) {
|
|
1286
|
+
e.preventDefault();
|
|
1287
|
+
}
|
|
1288
|
+
onInteractOutside?.(e);
|
|
1289
|
+
} : void 0;
|
|
1290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1291
|
+
import_dialog3.Dialog.Popup,
|
|
1292
|
+
{
|
|
1293
|
+
ref,
|
|
1294
|
+
"data-spark-component": "drawer-content",
|
|
1295
|
+
role: "dialog",
|
|
1296
|
+
className: (state) => (0, import_class_variance_authority9.cx)(
|
|
1297
|
+
drawerContentStyles({
|
|
1298
|
+
size,
|
|
1299
|
+
side,
|
|
1300
|
+
className: typeof className === "function" ? className(state) : className
|
|
1301
|
+
})
|
|
1302
|
+
),
|
|
1303
|
+
...handleInteractOutside && { onInteractOutside: handleInteractOutside },
|
|
1304
|
+
...rest
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
};
|
|
1282
1308
|
DrawerContent.displayName = "Drawer.Content";
|
|
1283
1309
|
|
|
1284
1310
|
// src/drawer/DrawerDescription.tsx
|
|
1285
|
-
var
|
|
1286
|
-
var
|
|
1287
|
-
var DrawerDescription = (props) =>
|
|
1311
|
+
var import_dialog4 = require("@base-ui-components/react/dialog");
|
|
1312
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1313
|
+
var DrawerDescription = (props) => {
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dialog4.Dialog.Description, { "data-spark-component": "drawer-description", ...props });
|
|
1315
|
+
};
|
|
1288
1316
|
DrawerDescription.displayName = "Drawer.Description";
|
|
1289
1317
|
|
|
1290
1318
|
// src/drawer/DrawerFooter.tsx
|
|
1291
|
-
var
|
|
1292
|
-
var
|
|
1293
|
-
var DrawerFooter = ({ className, ref, ...rest }) => /* @__PURE__ */ (0,
|
|
1319
|
+
var import_class_variance_authority10 = require("class-variance-authority");
|
|
1320
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1321
|
+
var DrawerFooter = ({ className, ref, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1294
1322
|
"footer",
|
|
1295
1323
|
{
|
|
1296
1324
|
"data-spark-component": "drawer-footer",
|
|
1297
1325
|
ref,
|
|
1298
|
-
className: (0,
|
|
1326
|
+
className: (0, import_class_variance_authority10.cx)(["px-xl", "py-lg"], className),
|
|
1299
1327
|
...rest
|
|
1300
1328
|
}
|
|
1301
1329
|
);
|
|
1302
1330
|
DrawerFooter.displayName = "Drawer.Footer";
|
|
1303
1331
|
|
|
1304
1332
|
// src/drawer/DrawerHeader.tsx
|
|
1305
|
-
var
|
|
1306
|
-
var
|
|
1333
|
+
var import_class_variance_authority11 = require("class-variance-authority");
|
|
1334
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1307
1335
|
var DrawerHeader = ({
|
|
1308
1336
|
children,
|
|
1309
1337
|
className,
|
|
1310
1338
|
ref,
|
|
1311
1339
|
...rest
|
|
1312
|
-
}) => /* @__PURE__ */ (0,
|
|
1340
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1313
1341
|
"header",
|
|
1314
1342
|
{
|
|
1315
1343
|
"data-spark-component": "drawer-header",
|
|
1316
1344
|
ref,
|
|
1317
|
-
className: (0,
|
|
1345
|
+
className: (0, import_class_variance_authority11.cx)(["px-xl", "py-lg"], className),
|
|
1318
1346
|
...rest,
|
|
1319
1347
|
children
|
|
1320
1348
|
}
|
|
@@ -1322,51 +1350,59 @@ var DrawerHeader = ({
|
|
|
1322
1350
|
DrawerHeader.displayName = "Dialog.Header";
|
|
1323
1351
|
|
|
1324
1352
|
// src/drawer/DrawerOverlay.tsx
|
|
1325
|
-
var
|
|
1326
|
-
var
|
|
1327
|
-
var
|
|
1328
|
-
var DrawerOverlay = ({ className,
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1353
|
+
var import_dialog5 = require("@base-ui-components/react/dialog");
|
|
1354
|
+
var import_class_variance_authority12 = require("class-variance-authority");
|
|
1355
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1356
|
+
var DrawerOverlay = ({ className, ...props }) => {
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1358
|
+
import_dialog5.Dialog.Backdrop,
|
|
1359
|
+
{
|
|
1360
|
+
"data-spark-component": "drawer-overlay",
|
|
1361
|
+
className: (state) => (0, import_class_variance_authority12.cx)(
|
|
1362
|
+
"z-overlay fixed top-0 left-0 h-screen w-screen",
|
|
1363
|
+
"bg-overlay/dim-1",
|
|
1364
|
+
// Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
|
|
1365
|
+
"data-[starting-style]:animate-fade-in",
|
|
1366
|
+
"data-[ending-style]:animate-fade-out",
|
|
1367
|
+
typeof className === "function" ? className(state) : className
|
|
1368
|
+
),
|
|
1369
|
+
...props
|
|
1370
|
+
}
|
|
1371
|
+
);
|
|
1372
|
+
};
|
|
1343
1373
|
DrawerOverlay.displayName = "Drawer.Overlay";
|
|
1344
1374
|
|
|
1345
1375
|
// src/drawer/DrawerPortal.tsx
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
1348
|
-
var DrawerPortal = (
|
|
1376
|
+
var import_dialog6 = require("@base-ui-components/react/dialog");
|
|
1377
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1378
|
+
var DrawerPortal = (props) => {
|
|
1379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dialog6.Dialog.Portal, { "data-spark-component": "drawer-portal", ...props });
|
|
1380
|
+
};
|
|
1349
1381
|
DrawerPortal.displayName = "Drawer.Portal";
|
|
1350
1382
|
|
|
1351
1383
|
// src/drawer/DrawerTitle.tsx
|
|
1352
|
-
var
|
|
1353
|
-
var
|
|
1354
|
-
var
|
|
1355
|
-
var DrawerTitle = ({ className,
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
);
|
|
1384
|
+
var import_dialog7 = require("@base-ui-components/react/dialog");
|
|
1385
|
+
var import_class_variance_authority13 = require("class-variance-authority");
|
|
1386
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1387
|
+
var DrawerTitle = ({ className, ...props }) => {
|
|
1388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1389
|
+
import_dialog7.Dialog.Title,
|
|
1390
|
+
{
|
|
1391
|
+
"data-spark-component": "drawer-title",
|
|
1392
|
+
className: (0, import_class_variance_authority13.cx)("text-headline-2 text-on-surface", className),
|
|
1393
|
+
...props
|
|
1394
|
+
}
|
|
1395
|
+
);
|
|
1396
|
+
};
|
|
1364
1397
|
DrawerTitle.displayName = "Drawer.Title";
|
|
1365
1398
|
|
|
1366
1399
|
// src/drawer/DrawerTrigger.tsx
|
|
1367
|
-
var
|
|
1368
|
-
var
|
|
1369
|
-
var DrawerTrigger = (
|
|
1400
|
+
var import_dialog8 = require("@base-ui-components/react/dialog");
|
|
1401
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1402
|
+
var DrawerTrigger = ({ asChild = false, ...props }) => {
|
|
1403
|
+
const renderSlot = useRenderSlot(asChild, "button");
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dialog8.Dialog.Trigger, { "data-spark-component": "drawer-trigger", render: renderSlot, ...props });
|
|
1405
|
+
};
|
|
1370
1406
|
DrawerTrigger.displayName = "Drawer.Trigger";
|
|
1371
1407
|
|
|
1372
1408
|
// src/drawer/index.ts
|