@spark-ui/components 13.0.3-beta.0 → 13.0.4

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