@spark-ui/components 12.2.0 → 13.0.1-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.
@@ -1,13 +1,316 @@
1
1
  import {
2
- Dialog
3
- } from "../chunk-WLI4EPS6.mjs";
4
- import "../chunk-DCXWGQVZ.mjs";
5
- import "../chunk-UMUMFMFB.mjs";
2
+ dialogContentStyles
3
+ } from "../chunk-XZ47F6TP.mjs";
4
+ import {
5
+ IconButton
6
+ } from "../chunk-DCXWGQVZ.mjs";
7
+ import {
8
+ Icon
9
+ } from "../chunk-UMUMFMFB.mjs";
6
10
  import "../chunk-2YM6GKWW.mjs";
7
11
  import "../chunk-GAK4SC2F.mjs";
8
12
  import "../chunk-KEGAAGJW.mjs";
9
13
  import "../chunk-6QCEPQ3U.mjs";
14
+
15
+ // src/dialog/Dialog.tsx
16
+ import { Dialog as RadixDialog } from "radix-ui";
17
+ import { useEffect, useRef } from "react";
18
+
19
+ // src/dialog/DialogContext.tsx
20
+ import { createContext, useContext, useState } from "react";
21
+ import { jsx } from "react/jsx-runtime";
22
+ var DialogContext = createContext(null);
23
+ var DialogProvider = ({
24
+ children: childrenProp,
25
+ withFade = false
26
+ }) => {
27
+ const [isFullScreen, setIsFullScreen] = useState(false);
28
+ return /* @__PURE__ */ jsx(
29
+ DialogContext.Provider,
30
+ {
31
+ value: {
32
+ isFullScreen,
33
+ setIsFullScreen,
34
+ withFade
35
+ },
36
+ children: childrenProp
37
+ }
38
+ );
39
+ };
40
+ var useDialog = () => {
41
+ const context = useContext(DialogContext);
42
+ if (!context) {
43
+ throw Error("useDialog must be used within a Dialog provider");
44
+ }
45
+ return context;
46
+ };
47
+
48
+ // src/dialog/Dialog.tsx
49
+ import { jsx as jsx2 } from "react/jsx-runtime";
50
+ var Dialog = ({ children, withFade = false, ...rest }) => {
51
+ const open = rest.open;
52
+ const activeElementRef = useRef(null);
53
+ function handleActiveElementFocus() {
54
+ if (open && document.activeElement) {
55
+ activeElementRef.current = document.activeElement;
56
+ }
57
+ if (!open) {
58
+ setTimeout(() => {
59
+ if (!(activeElementRef.current instanceof HTMLElement)) return;
60
+ activeElementRef.current.focus();
61
+ }, 0);
62
+ }
63
+ }
64
+ useEffect(handleActiveElementFocus, [open]);
65
+ return /* @__PURE__ */ jsx2(DialogProvider, { withFade, children: /* @__PURE__ */ jsx2(RadixDialog.Root, { ...rest, children }) });
66
+ };
67
+ Dialog.displayName = "Dialog.Root";
68
+
69
+ // src/dialog/DialogBody.tsx
70
+ import { useMergeRefs } from "@spark-ui/hooks/use-merge-refs";
71
+ import { useScrollOverflow } from "@spark-ui/hooks/use-scroll-overflow";
72
+ import { cx } from "class-variance-authority";
73
+ import { useRef as useRef2 } from "react";
74
+ import { jsx as jsx3 } from "react/jsx-runtime";
75
+ var Body = ({
76
+ children,
77
+ className,
78
+ inset = false,
79
+ ref: forwardedRef,
80
+ ...rest
81
+ }) => {
82
+ const scrollAreaRef = useRef2(null);
83
+ const ref = useMergeRefs(forwardedRef, scrollAreaRef);
84
+ const { withFade } = useDialog();
85
+ const { overflow } = useScrollOverflow(scrollAreaRef);
86
+ return /* @__PURE__ */ jsx3(
87
+ "div",
88
+ {
89
+ "data-spark-component": "dialog-body",
90
+ ref,
91
+ className: cx(
92
+ "focus-visible:u-outline relative grow overflow-y-auto outline-hidden",
93
+ "transition-all duration-300",
94
+ {
95
+ ["px-xl py-lg"]: !inset
96
+ },
97
+ className
98
+ ),
99
+ style: {
100
+ ...withFade && {
101
+ maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
102
+ maskSize: `100% calc(100% + ${overflow.top ? "0px" : "44px"} + ${overflow.bottom ? "0px" : "44px"})`,
103
+ maskPosition: `0 ${overflow.top ? "0px" : "-44px"}`
104
+ }
105
+ },
106
+ ...rest,
107
+ children
108
+ }
109
+ );
110
+ };
111
+ Body.displayName = "Dialog.Body";
112
+
113
+ // src/dialog/DialogClose.tsx
114
+ import { Dialog as RadixDialog2 } from "radix-ui";
115
+ import { jsx as jsx4 } from "react/jsx-runtime";
116
+ var Close = (props) => /* @__PURE__ */ jsx4(RadixDialog2.Close, { ...props });
117
+ Close.displayName = "Dialog.Close";
118
+
119
+ // src/dialog/DialogCloseButton.tsx
120
+ import { Close as CloseSVG } from "@spark-ui/icons/Close";
121
+ import { cx as cx2 } from "class-variance-authority";
122
+ import { jsx as jsx5 } from "react/jsx-runtime";
123
+ var Root = ({
124
+ "aria-label": ariaLabel,
125
+ className,
126
+ size = "md",
127
+ intent = "neutral",
128
+ design = "ghost",
129
+ children = /* @__PURE__ */ jsx5(CloseSVG, {}),
130
+ ref,
131
+ ...rest
132
+ }) => {
133
+ return /* @__PURE__ */ jsx5(
134
+ Close,
135
+ {
136
+ "data-spark-component": "dialog-close-button",
137
+ "data-part": "close",
138
+ ref,
139
+ className: cx2(["absolute", "top-md", "right-xl"], className),
140
+ asChild: true,
141
+ ...rest,
142
+ children: /* @__PURE__ */ jsx5(IconButton, { intent, size, design, "aria-label": ariaLabel, children: /* @__PURE__ */ jsx5(Icon, { children }) })
143
+ }
144
+ );
145
+ };
146
+ var CloseButton = Object.assign(Root, {
147
+ id: "CloseButton"
148
+ });
149
+ Root.displayName = "Dialog.CloseButton";
150
+
151
+ // src/dialog/DialogContent.tsx
152
+ import { Dialog as RadixDialog3 } from "radix-ui";
153
+ import { useEffect as useEffect2 } from "react";
154
+ import { jsx as jsx6 } from "react/jsx-runtime";
155
+ var Content = ({
156
+ children,
157
+ className,
158
+ isNarrow = false,
159
+ size = "md",
160
+ onInteractOutside,
161
+ ref,
162
+ ...rest
163
+ }) => {
164
+ const { setIsFullScreen } = useDialog();
165
+ useEffect2(() => {
166
+ if (size === "fullscreen") setIsFullScreen(true);
167
+ return () => setIsFullScreen(false);
168
+ }, [setIsFullScreen, size]);
169
+ return /* @__PURE__ */ jsx6(
170
+ RadixDialog3.Content,
171
+ {
172
+ "data-spark-component": "dialog-content",
173
+ ref,
174
+ className: dialogContentStyles({
175
+ className,
176
+ isNarrow,
177
+ size
178
+ }),
179
+ onInteractOutside: (e) => {
180
+ const isForegroundElement = e.target.closest(".z-toast, .z-popover");
181
+ if (isForegroundElement) {
182
+ e.preventDefault();
183
+ }
184
+ onInteractOutside?.(e);
185
+ },
186
+ ...rest,
187
+ children
188
+ }
189
+ );
190
+ };
191
+ Content.displayName = "Dialog.Content";
192
+
193
+ // src/dialog/DialogDescription.tsx
194
+ import { Dialog as RadixDialog4 } from "radix-ui";
195
+ import { jsx as jsx7 } from "react/jsx-runtime";
196
+ var Description = (props) => /* @__PURE__ */ jsx7(RadixDialog4.Description, { "data-spark-component": "dialog-description", ...props });
197
+ Description.displayName = "Dialog.Description";
198
+
199
+ // src/dialog/DialogFooter.tsx
200
+ import { cx as cx3 } from "class-variance-authority";
201
+ import { jsx as jsx8 } from "react/jsx-runtime";
202
+ var Footer = ({ children, className, ref, ...rest }) => /* @__PURE__ */ jsx8(
203
+ "footer",
204
+ {
205
+ "data-spark-component": "dialog-footer",
206
+ ref,
207
+ className: cx3(className, ["px-xl", "py-lg"]),
208
+ ...rest,
209
+ children
210
+ }
211
+ );
212
+ Footer.displayName = "Dialog.Footer";
213
+
214
+ // src/dialog/DialogHeader.tsx
215
+ import { cx as cx4 } from "class-variance-authority";
216
+ import { jsx as jsx9 } from "react/jsx-runtime";
217
+ var Header = ({ children, className, ref, ...rest }) => /* @__PURE__ */ jsx9(
218
+ "header",
219
+ {
220
+ "data-spark-component": "dialog-header",
221
+ ref,
222
+ className: cx4(className, ["px-xl", "py-lg"]),
223
+ ...rest,
224
+ children
225
+ }
226
+ );
227
+ Header.displayName = "Dialog.Header";
228
+
229
+ // src/dialog/DialogOverlay.tsx
230
+ import { cx as cx5 } from "class-variance-authority";
231
+ import { Dialog as RadixDialog5 } from "radix-ui";
232
+ import { jsx as jsx10 } from "react/jsx-runtime";
233
+ var Overlay = ({ className, ref, ...rest }) => {
234
+ const { isFullScreen } = useDialog();
235
+ return /* @__PURE__ */ jsx10(
236
+ RadixDialog5.Overlay,
237
+ {
238
+ "data-spark-component": "dialog-overlay",
239
+ ref,
240
+ className: cx5(
241
+ isFullScreen ? "hidden" : "fixed",
242
+ ["top-0", "left-0", "w-screen", "h-screen", "z-overlay"],
243
+ ["bg-overlay/dim-1"],
244
+ ["data-[state=open]:animate-fade-in"],
245
+ ["data-[state=closed]:animate-fade-out"],
246
+ className
247
+ ),
248
+ ...rest
249
+ }
250
+ );
251
+ };
252
+ Overlay.displayName = "Dialog.Overlay";
253
+
254
+ // src/dialog/DialogPortal.tsx
255
+ import { Dialog as RadixDialog6 } from "radix-ui";
256
+ import { jsx as jsx11 } from "react/jsx-runtime";
257
+ var Portal = ({ children, ...rest }) => /* @__PURE__ */ jsx11(RadixDialog6.Portal, { ...rest, children });
258
+ Portal.displayName = "Dialog.Portal";
259
+
260
+ // src/dialog/DialogTitle.tsx
261
+ import { cx as cx6 } from "class-variance-authority";
262
+ import { Dialog as RadixDialog7 } from "radix-ui";
263
+ import { jsx as jsx12 } from "react/jsx-runtime";
264
+ var Title = ({ className, ref, ...others }) => {
265
+ return /* @__PURE__ */ jsx12(
266
+ RadixDialog7.Title,
267
+ {
268
+ "data-spark-component": "dialog-title",
269
+ ref,
270
+ className: cx6(
271
+ "text-headline-1 text-on-surface",
272
+ "group-has-data-[part=close]:pr-3xl",
273
+ className
274
+ ),
275
+ ...others
276
+ }
277
+ );
278
+ };
279
+ Title.displayName = "Dialog.Title";
280
+
281
+ // src/dialog/DialogTrigger.tsx
282
+ import { Dialog as RadixDialog8 } from "radix-ui";
283
+ import { jsx as jsx13 } from "react/jsx-runtime";
284
+ var Trigger = (props) => /* @__PURE__ */ jsx13(RadixDialog8.Trigger, { "data-spark-component": "dialog-trigger", ...props });
285
+ Trigger.displayName = "Dialog.Trigger";
286
+
287
+ // src/dialog/index.ts
288
+ var Dialog2 = Object.assign(Dialog, {
289
+ Trigger,
290
+ Portal,
291
+ Overlay,
292
+ Content,
293
+ Header,
294
+ Body,
295
+ Footer,
296
+ Close,
297
+ CloseButton,
298
+ Title,
299
+ Description
300
+ });
301
+ Dialog2.displayName = "Dialog";
302
+ Dialog2.Trigger.displayName = "Dialog.Trigger";
303
+ Trigger.displayName = "Dialog.Trigger";
304
+ Portal.displayName = "Dialog.Portal";
305
+ Overlay.displayName = "Dialog.Overlay";
306
+ Content.displayName = "Dialog.Content";
307
+ Header.displayName = "Dialog.Header";
308
+ Body.displayName = "Dialog.Body";
309
+ Footer.displayName = "Dialog.Footer";
310
+ CloseButton.displayName = "Dialog.CloseButton";
311
+ Title.displayName = "Dialog.Title";
312
+ Description.displayName = "Dialog.Description";
10
313
  export {
11
- Dialog
314
+ Dialog2 as Dialog
12
315
  };
13
316
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../src/dialog/Dialog.tsx","../../src/dialog/DialogContext.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,UAAU,mBAAmB;AACtC,SAA4B,WAAW,cAAc;;;ACDrD,SAAS,eAA+B,YAAY,gBAAgB;AAoBhE;AAZJ,IAAM,gBAAgB,cAAyC,IAAI;AAE5D,IAAM,iBAAiB,CAAC;AAAA,EAC7B,UAAU;AAAA,EACV,WAAW;AACb,MAGM;AACJ,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AAEtD,SACE;AAAA,IAAC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AAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,cAAc;;;ACvBpB,SAAS,UAAUG,oBAAmB;AAgBpC,gBAAAC,aAAA;AADK,IAAM,UAAU,CAAC,UACtB,gBAAAA,MAACD,aAAY,SAAZ,EAAoB,wBAAqB,kBAAkB,GAAG,OAAO;AAGxE,QAAQ,cAAc;;;ACNf,IAAME,UAYT,OAAO,OAAO,QAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,QAAO,cAAc;AACrBA,QAAO,QAAQ,cAAc;AAC7B,QAAQ,cAAc;AACtB,OAAO,cAAc;AACrB,QAAQ,cAAc;AACtB,QAAQ,cAAc;AACtB,OAAO,cAAc;AACrB,KAAK,cAAc;AACnB,OAAO,cAAc;AACrB,YAAY,cAAc;AAC1B,MAAM,cAAc;AACpB,YAAY,cAAc;","names":["jsx","useRef","jsx","useRef","RadixDialog","jsx","cx","jsx","cx","RadixDialog","useEffect","jsx","useEffect","RadixDialog","RadixDialog","jsx","cx","jsx","cx","jsx","cx","RadixDialog","jsx","RadixDialog","cx","RadixDialog","jsx","cx","RadixDialog","jsx","RadixDialog","jsx","Dialog"]}