@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,146 +1,291 @@
1
1
  import {
2
- Dialog
3
- } from "../chunk-WLI4EPS6.mjs";
4
- import "../chunk-DCXWGQVZ.mjs";
5
- import "../chunk-UMUMFMFB.mjs";
6
- import "../chunk-2YM6GKWW.mjs";
7
- import "../chunk-GAK4SC2F.mjs";
8
- import "../chunk-KEGAAGJW.mjs";
9
- import "../chunk-6QCEPQ3U.mjs";
2
+ dialogContentStyles
3
+ } from "../chunk-XZ47F6TP.mjs";
4
+ import {
5
+ Slot
6
+ } from "../chunk-6QCEPQ3U.mjs";
10
7
 
11
8
  // src/alert-dialog/AlertDialog.tsx
9
+ import { AlertDialog as BaseAlertDialog } from "@base-ui-components/react/alert-dialog";
10
+ import { useRef } from "react";
11
+
12
+ // src/alert-dialog/AlertDialogContext.tsx
13
+ import { createContext, useContext } from "react";
12
14
  import { jsx } from "react/jsx-runtime";
13
- var AlertDialog = (props) => {
14
- return /* @__PURE__ */ jsx(Dialog, { "data-spark-component": "alert-dialog", ...props, modal: true });
15
+ var AlertDialogContext = createContext(null);
16
+ var AlertDialogProvider = ({
17
+ children,
18
+ withFade = false,
19
+ cancelRef
20
+ }) => {
21
+ return /* @__PURE__ */ jsx(
22
+ AlertDialogContext.Provider,
23
+ {
24
+ value: {
25
+ cancelRef,
26
+ withFade
27
+ },
28
+ children
29
+ }
30
+ );
31
+ };
32
+ var useAlertDialog = () => {
33
+ const context = useContext(AlertDialogContext);
34
+ if (!context) {
35
+ throw Error("useAlertDialog must be used within an AlertDialog provider");
36
+ }
37
+ return context;
15
38
  };
16
- AlertDialog.displayName = "AlertDialog";
17
39
 
18
- // src/alert-dialog/AlertDialogAction.tsx
40
+ // src/alert-dialog/AlertDialog.tsx
19
41
  import { jsx as jsx2 } from "react/jsx-runtime";
20
- var AlertDialogAction = (props) => {
21
- return /* @__PURE__ */ jsx2(Dialog.Close, { "data-spark-component": "alert-dialog-action", ...props });
42
+ var AlertDialog = ({ onOpenChange, withFade = false, ...props }) => {
43
+ const cancelRef = useRef(null);
44
+ const handleOpenChange = onOpenChange ? (open, _eventDetails) => {
45
+ onOpenChange(open);
46
+ } : void 0;
47
+ return /* @__PURE__ */ jsx2(AlertDialogProvider, { withFade, cancelRef, children: /* @__PURE__ */ jsx2(
48
+ BaseAlertDialog.Root,
49
+ {
50
+ "data-spark-component": "alert-dialog",
51
+ onOpenChange: handleOpenChange,
52
+ ...props
53
+ }
54
+ ) });
22
55
  };
23
- AlertDialogAction.displayName = "AlertDialog.Action";
56
+ AlertDialog.displayName = "AlertDialog";
24
57
 
25
- // src/alert-dialog/AlertDialogBody.tsx
58
+ // src/alert-dialog/AlertDialogAction.tsx
59
+ import { AlertDialog as BaseAlertDialog2 } from "@base-ui-components/react/alert-dialog";
60
+
61
+ // src/alert-dialog/useRenderSlot.tsx
26
62
  import { jsx as jsx3 } from "react/jsx-runtime";
27
- var AlertDialogBody = (props) => {
28
- return /* @__PURE__ */ jsx3(Dialog.Body, { "data-spark-component": "alert-dialog-body", ...props });
63
+ function useRenderSlot(asChild, defaultTag) {
64
+ const Component = asChild ? Slot : defaultTag;
65
+ return asChild ? ({ ...props }) => /* @__PURE__ */ jsx3(Component, { ...props }) : void 0;
66
+ }
67
+
68
+ // src/alert-dialog/AlertDialogAction.tsx
69
+ import { jsx as jsx4 } from "react/jsx-runtime";
70
+ var AlertDialogAction = ({ asChild = false, ...props }) => {
71
+ const renderSlot = useRenderSlot(asChild, "button");
72
+ return /* @__PURE__ */ jsx4(
73
+ BaseAlertDialog2.Close,
74
+ {
75
+ "data-spark-component": "alert-dialog-action",
76
+ render: renderSlot,
77
+ ...props
78
+ }
79
+ );
29
80
  };
30
- AlertDialogBody.displayName = "AlertDialog.Body";
81
+ AlertDialogAction.displayName = "AlertDialog.Action";
31
82
 
32
- // src/alert-dialog/AlertDialogCancel.tsx
83
+ // src/alert-dialog/AlertDialogBody.tsx
33
84
  import { useMergeRefs } from "@spark-ui/hooks/use-merge-refs";
34
-
35
- // src/alert-dialog/AlertDialogContext.ts
36
- import { createContext, useContext } from "react";
37
- var AlertDialogContext = createContext(null);
38
- var useAlertDialog = () => {
39
- const context = useContext(AlertDialogContext);
40
- if (!context) {
41
- throw Error("useAlertDialog must be used within a RadioGroup provider");
42
- }
43
- return context;
85
+ import { useScrollOverflow } from "@spark-ui/hooks/use-scroll-overflow";
86
+ import { cx } from "class-variance-authority";
87
+ import { useRef as useRef2 } from "react";
88
+ import { jsx as jsx5 } from "react/jsx-runtime";
89
+ var AlertDialogBody = ({
90
+ children,
91
+ className,
92
+ inset = false,
93
+ ref: forwardedRef,
94
+ ...rest
95
+ }) => {
96
+ const scrollAreaRef = useRef2(null);
97
+ const ref = useMergeRefs(forwardedRef, scrollAreaRef);
98
+ const { withFade } = useAlertDialog();
99
+ const { overflow } = useScrollOverflow(scrollAreaRef);
100
+ return /* @__PURE__ */ jsx5(
101
+ "div",
102
+ {
103
+ "data-spark-component": "alert-dialog-body",
104
+ ref,
105
+ className: cx(
106
+ "focus-visible:u-outline relative grow overflow-y-auto outline-hidden",
107
+ "transition-all duration-300",
108
+ {
109
+ ["px-xl py-lg"]: !inset
110
+ },
111
+ className
112
+ ),
113
+ style: {
114
+ ...withFade && {
115
+ 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))",
116
+ maskSize: `100% calc(100% + ${overflow.top ? "0px" : "44px"} + ${overflow.bottom ? "0px" : "44px"})`,
117
+ maskPosition: `0 ${overflow.top ? "0px" : "-44px"}`
118
+ }
119
+ },
120
+ ...rest,
121
+ children
122
+ }
123
+ );
44
124
  };
125
+ AlertDialogBody.displayName = "AlertDialog.Body";
45
126
 
46
127
  // src/alert-dialog/AlertDialogCancel.tsx
47
- import { jsx as jsx4 } from "react/jsx-runtime";
48
- var AlertDialogCancel = ({ ref: forwardedRef, ...props }) => {
128
+ import { AlertDialog as BaseAlertDialog3 } from "@base-ui-components/react/alert-dialog";
129
+ import { useMergeRefs as useMergeRefs2 } from "@spark-ui/hooks/use-merge-refs";
130
+ import { jsx as jsx6 } from "react/jsx-runtime";
131
+ var AlertDialogCancel = ({
132
+ asChild = false,
133
+ ref: forwardedRef,
134
+ ...props
135
+ }) => {
49
136
  const { cancelRef } = useAlertDialog();
50
- const ref = useMergeRefs(forwardedRef, cancelRef);
51
- return /* @__PURE__ */ jsx4(Dialog.Close, { ref, "data-spark-component": "alert-dialog-cancel", ...props });
137
+ const ref = useMergeRefs2(forwardedRef, cancelRef);
138
+ const renderSlot = useRenderSlot(asChild, "button");
139
+ return /* @__PURE__ */ jsx6(
140
+ BaseAlertDialog3.Close,
141
+ {
142
+ ref,
143
+ "data-spark-component": "alert-dialog-cancel",
144
+ render: renderSlot,
145
+ ...props
146
+ }
147
+ );
52
148
  };
53
149
  AlertDialogCancel.displayName = "AlertDialog.Cancel";
54
150
 
55
151
  // src/alert-dialog/AlertDialogContent.tsx
56
- import { cx } from "class-variance-authority";
57
- import { composeEventHandlers } from "radix-ui/internal";
58
- import { useMemo, useRef } from "react";
59
- import { jsx as jsx5 } from "react/jsx-runtime";
60
- var AlertDialogContent = ({
61
- className,
62
- onOpenAutoFocus,
63
- ref,
64
- ...others
65
- }) => {
66
- const cancelRef = useRef(null);
67
- const value = useMemo(() => {
68
- return { cancelRef };
69
- }, []);
70
- const handleOpenAutoFocus = (event) => {
71
- event.preventDefault();
72
- cancelRef.current?.focus({ preventScroll: true });
73
- };
74
- const handlePointerDownOutside = (event) => {
75
- event.preventDefault();
76
- };
77
- const handleInteractOutside = (event) => {
78
- event.preventDefault();
79
- };
80
- return /* @__PURE__ */ jsx5(AlertDialogContext.Provider, { value, children: /* @__PURE__ */ jsx5(
81
- Dialog.Content,
152
+ import { AlertDialog as BaseAlertDialog4 } from "@base-ui-components/react/alert-dialog";
153
+ import { cx as cx2 } from "class-variance-authority";
154
+ import { jsx as jsx7 } from "react/jsx-runtime";
155
+ var AlertDialogContent = ({ className, ref, initialFocus, ...others }) => {
156
+ const { cancelRef } = useAlertDialog();
157
+ const handleInitialFocus = initialFocus !== void 0 ? initialFocus : () => cancelRef.current;
158
+ return /* @__PURE__ */ jsx7(
159
+ BaseAlertDialog4.Popup,
82
160
  {
83
161
  ref,
84
162
  "data-spark-component": "alert-dialog-content",
85
- ...others,
86
- className: cx(className, "min-w-sz-288"),
87
163
  role: "alertdialog",
88
- size: "md",
89
- onOpenAutoFocus: composeEventHandlers(onOpenAutoFocus, handleOpenAutoFocus),
90
- onPointerDownOutside: handlePointerDownOutside,
91
- onInteractOutside: handleInteractOutside,
92
- isNarrow: true
164
+ className: (state) => cx2(
165
+ dialogContentStyles({ size: "md", isNarrow: true }),
166
+ "min-w-sz-288",
167
+ // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
168
+ // Transition with opacity and scale for smooth open/close animations
169
+ "transition-all duration-150",
170
+ "data-starting-style:scale-90 data-starting-style:opacity-0",
171
+ "data-ending-style:scale-90 data-ending-style:opacity-0",
172
+ typeof className === "function" ? className(state) : className
173
+ ),
174
+ initialFocus: handleInitialFocus,
175
+ ...others
93
176
  }
94
- ) });
177
+ );
95
178
  };
96
179
  AlertDialogContent.displayName = "AlertDialog.Content";
97
180
 
98
181
  // src/alert-dialog/AlertDialogDescription.tsx
99
- import { jsx as jsx6 } from "react/jsx-runtime";
182
+ import { AlertDialog as BaseAlertDialog5 } from "@base-ui-components/react/alert-dialog";
183
+ import { jsx as jsx8 } from "react/jsx-runtime";
100
184
  var AlertDialogDescription = (props) => {
101
- return /* @__PURE__ */ jsx6(Dialog.Description, { "data-spark-component": "alert-dialog-description", ...props });
185
+ return /* @__PURE__ */ jsx8(BaseAlertDialog5.Description, { "data-spark-component": "alert-dialog-description", ...props });
102
186
  };
103
187
  AlertDialogDescription.displayName = "AlertDialog.Description";
104
188
 
105
189
  // src/alert-dialog/AlertDialogFooter.tsx
106
- import { jsx as jsx7 } from "react/jsx-runtime";
107
- var AlertDialogFooter = (props) => {
108
- return /* @__PURE__ */ jsx7(Dialog.Footer, { "data-spark-component": "alert-dialog-footer", ...props });
109
- };
190
+ import { cx as cx3 } from "class-variance-authority";
191
+ import { jsx as jsx9 } from "react/jsx-runtime";
192
+ var AlertDialogFooter = ({
193
+ children,
194
+ className,
195
+ ref,
196
+ ...rest
197
+ }) => /* @__PURE__ */ jsx9(
198
+ "footer",
199
+ {
200
+ "data-spark-component": "alert-dialog-footer",
201
+ ref,
202
+ className: cx3(className, ["px-xl", "py-lg"]),
203
+ ...rest,
204
+ children
205
+ }
206
+ );
110
207
  AlertDialogFooter.displayName = "AlertDialog.Footer";
111
208
 
112
209
  // src/alert-dialog/AlertDialogHeader.tsx
113
- import { jsx as jsx8 } from "react/jsx-runtime";
114
- var AlertDialogHeader = (props) => {
115
- return /* @__PURE__ */ jsx8(Dialog.Header, { "data-spark-component": "alert-dialog-header", ...props });
116
- };
210
+ import { cx as cx4 } from "class-variance-authority";
211
+ import { jsx as jsx10 } from "react/jsx-runtime";
212
+ var AlertDialogHeader = ({
213
+ children,
214
+ className,
215
+ ref,
216
+ ...rest
217
+ }) => /* @__PURE__ */ jsx10(
218
+ "header",
219
+ {
220
+ "data-spark-component": "alert-dialog-header",
221
+ ref,
222
+ className: cx4(className, ["px-xl", "py-lg"]),
223
+ ...rest,
224
+ children
225
+ }
226
+ );
117
227
  AlertDialogHeader.displayName = "AlertDialog.Header";
118
228
 
119
229
  // src/alert-dialog/AlertDialogOverlay.tsx
120
- import { jsx as jsx9 } from "react/jsx-runtime";
121
- var AlertDialogOverlay = (props) => {
122
- return /* @__PURE__ */ jsx9(Dialog.Overlay, { "data-spark-component": "alert-dialog-overlay", ...props });
230
+ import { AlertDialog as BaseAlertDialog6 } from "@base-ui-components/react/alert-dialog";
231
+ import { cx as cx5 } from "class-variance-authority";
232
+ import { jsx as jsx11 } from "react/jsx-runtime";
233
+ var AlertDialogOverlay = ({ className, ...props }) => {
234
+ return /* @__PURE__ */ jsx11(
235
+ BaseAlertDialog6.Backdrop,
236
+ {
237
+ "data-spark-component": "alert-dialog-overlay",
238
+ className: (state) => cx5(
239
+ "z-overlay fixed top-0 left-0 h-screen w-screen",
240
+ "bg-overlay/dim-1",
241
+ // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
242
+ "data-[starting-style]:animate-fade-in",
243
+ "data-[ending-style]:animate-fade-out",
244
+ typeof className === "function" ? className(state) : className
245
+ ),
246
+ ...props
247
+ }
248
+ );
123
249
  };
124
250
  AlertDialogOverlay.displayName = "AlertDialog.Overlay";
125
251
 
126
252
  // src/alert-dialog/AlertDialogPortal.tsx
127
- import { jsx as jsx10 } from "react/jsx-runtime";
253
+ import { AlertDialog as BaseAlertDialog7 } from "@base-ui-components/react/alert-dialog";
254
+ import { jsx as jsx12 } from "react/jsx-runtime";
128
255
  var AlertDialogPortal = (props) => {
129
- return /* @__PURE__ */ jsx10(Dialog.Portal, { "data-spark-component": "alert-dialog-portal", ...props });
256
+ return /* @__PURE__ */ jsx12(BaseAlertDialog7.Portal, { "data-spark-component": "alert-dialog-portal", ...props });
130
257
  };
131
258
  AlertDialogPortal.displayName = "AlertDialog.Portal";
132
259
 
133
260
  // src/alert-dialog/AlertDialogTitle.tsx
134
- import { jsx as jsx11 } from "react/jsx-runtime";
135
- var AlertDialogTitle = (props) => {
136
- return /* @__PURE__ */ jsx11(Dialog.Title, { "data-spark-component": "alert-dialog-title", ...props });
261
+ import { AlertDialog as BaseAlertDialog8 } from "@base-ui-components/react/alert-dialog";
262
+ import { cx as cx6 } from "class-variance-authority";
263
+ import { jsx as jsx13 } from "react/jsx-runtime";
264
+ var AlertDialogTitle = ({ className, ...props }) => {
265
+ return /* @__PURE__ */ jsx13(
266
+ BaseAlertDialog8.Title,
267
+ {
268
+ "data-spark-component": "alert-dialog-title",
269
+ className: cx6("text-headline-1 text-on-surface", className),
270
+ ...props
271
+ }
272
+ );
137
273
  };
138
274
  AlertDialogTitle.displayName = "AlertDialog.Title";
139
275
 
140
276
  // src/alert-dialog/AlertDialogTrigger.tsx
141
- import { jsx as jsx12 } from "react/jsx-runtime";
142
- var AlertDialogTrigger = (props) => {
143
- return /* @__PURE__ */ jsx12(Dialog.Trigger, { "data-spark-component": "alert-dialog-title", ...props });
277
+ import { AlertDialog as BaseAlertDialog9 } from "@base-ui-components/react/alert-dialog";
278
+ import { jsx as jsx14 } from "react/jsx-runtime";
279
+ var AlertDialogTrigger = ({ asChild = false, ...props }) => {
280
+ const renderSlot = useRenderSlot(asChild, "button");
281
+ return /* @__PURE__ */ jsx14(
282
+ BaseAlertDialog9.Trigger,
283
+ {
284
+ "data-spark-component": "alert-dialog-trigger",
285
+ render: renderSlot,
286
+ ...props
287
+ }
288
+ );
144
289
  };
145
290
  AlertDialogTrigger.displayName = "AlertDialog.Trigger";
146
291
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/alert-dialog/AlertDialog.tsx","../../src/alert-dialog/AlertDialogAction.tsx","../../src/alert-dialog/AlertDialogBody.tsx","../../src/alert-dialog/AlertDialogCancel.tsx","../../src/alert-dialog/AlertDialogContext.ts","../../src/alert-dialog/AlertDialogContent.tsx","../../src/alert-dialog/AlertDialogDescription.tsx","../../src/alert-dialog/AlertDialogFooter.tsx","../../src/alert-dialog/AlertDialogHeader.tsx","../../src/alert-dialog/AlertDialogOverlay.tsx","../../src/alert-dialog/AlertDialogPortal.tsx","../../src/alert-dialog/AlertDialogTitle.tsx","../../src/alert-dialog/AlertDialogTrigger.tsx","../../src/alert-dialog/index.ts"],"sourcesContent":["import { Dialog, DialogProps } from '../dialog'\n\nexport type AlertDialogProps = Omit<DialogProps, 'modal'>\n\nexport const AlertDialog = (props: AlertDialogProps) => {\n return <Dialog data-spark-component=\"alert-dialog\" {...props} modal={true} />\n}\n\nAlertDialog.displayName = 'AlertDialog'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogCloseProps } from '../dialog'\n\nexport type AlertDialogActionProps = DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const AlertDialogAction = (props: AlertDialogActionProps) => {\n return <Dialog.Close data-spark-component=\"alert-dialog-action\" {...props} />\n}\n\nAlertDialogAction.displayName = 'AlertDialog.Action'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogBodyProps } from '../dialog'\n\nexport type AlertDialogBodyProps = DialogBodyProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogBody = (props: AlertDialogBodyProps) => {\n return <Dialog.Body data-spark-component=\"alert-dialog-body\" {...props} />\n}\n\nAlertDialogBody.displayName = 'AlertDialog.Body'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { Ref } from 'react'\n\nimport { Dialog, DialogCloseProps } from '../dialog'\nimport { useAlertDialog } from './AlertDialogContext'\n\nexport type AlertDialogCancelProps = DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const AlertDialogCancel = ({ ref: forwardedRef, ...props }: AlertDialogCancelProps) => {\n const { cancelRef } = useAlertDialog()\n const ref = useMergeRefs(forwardedRef, cancelRef)\n\n return <Dialog.Close ref={ref} data-spark-component=\"alert-dialog-cancel\" {...props} />\n}\n\nAlertDialogCancel.displayName = 'AlertDialog.Cancel'\n","import { createContext, useContext, MutableRefObject } from 'react'\n\nexport interface AlertDialogContextValue {\n cancelRef: MutableRefObject<HTMLButtonElement | null>\n}\n\nexport const AlertDialogContext = createContext<AlertDialogContextValue | null>(null)\n\nexport const useAlertDialog = () => {\n const context = useContext(AlertDialogContext)\n\n if (!context) {\n throw Error('useAlertDialog must be used within a RadioGroup provider')\n }\n\n return context\n}\n","import { cx } from 'class-variance-authority'\nimport { composeEventHandlers } from 'radix-ui/internal'\nimport { Ref, useMemo, useRef } from 'react'\n\nimport { Dialog, DialogContentProps } from '../dialog'\nimport { AlertDialogContext } from './AlertDialogContext'\n\nexport type AlertDialogContentProps = Omit<\n DialogContentProps,\n 'size' | 'isNarrow' | 'onPointerDownOutside' | 'onInteractOutside'\n> & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogContent = ({\n className,\n onOpenAutoFocus,\n ref,\n ...others\n}: AlertDialogContentProps) => {\n const cancelRef = useRef<HTMLButtonElement | null>(null)\n\n const value = useMemo(() => {\n return { cancelRef }\n }, [])\n\n const handleOpenAutoFocus = (event: Event) => {\n event.preventDefault()\n cancelRef.current?.focus({ preventScroll: true })\n }\n\n const handlePointerDownOutside = (event: Event) => {\n event.preventDefault()\n }\n\n const handleInteractOutside = (event: Event) => {\n event.preventDefault()\n }\n\n return (\n <AlertDialogContext.Provider value={value}>\n <Dialog.Content\n ref={ref}\n data-spark-component=\"alert-dialog-content\"\n {...others}\n className={cx(className, 'min-w-sz-288')}\n role=\"alertdialog\"\n size=\"md\"\n onOpenAutoFocus={composeEventHandlers(onOpenAutoFocus, handleOpenAutoFocus)}\n onPointerDownOutside={handlePointerDownOutside}\n onInteractOutside={handleInteractOutside}\n isNarrow\n />\n </AlertDialogContext.Provider>\n )\n}\n\nAlertDialogContent.displayName = 'AlertDialog.Content'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogDescriptionProps } from '../dialog'\n\nexport type AlertDialogDescriptionProps = DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const AlertDialogDescription = (props: AlertDialogDescriptionProps) => {\n return <Dialog.Description data-spark-component=\"alert-dialog-description\" {...props} />\n}\n\nAlertDialogDescription.displayName = 'AlertDialog.Description'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogFooterProps } from '../dialog'\n\nexport type AlertDialogFooterProps = DialogFooterProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogFooter = (props: AlertDialogFooterProps) => {\n return <Dialog.Footer data-spark-component=\"alert-dialog-footer\" {...props} />\n}\n\nAlertDialogFooter.displayName = 'AlertDialog.Footer'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogHeaderProps } from '../dialog'\n\nexport type AlertDialogHeaderProps = DialogHeaderProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogHeader = (props: AlertDialogHeaderProps) => {\n return <Dialog.Header data-spark-component=\"alert-dialog-header\" {...props} />\n}\n\nAlertDialogHeader.displayName = 'AlertDialog.Header'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogOverlayProps } from '../dialog'\n\nexport type AlertDialogOverlayProps = DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogOverlay = (props: AlertDialogOverlayProps) => {\n return <Dialog.Overlay data-spark-component=\"alert-dialog-overlay\" {...props} />\n}\n\nAlertDialogOverlay.displayName = 'AlertDialog.Overlay'\n","import { Dialog, DialogPortalProps } from '../dialog'\n\nexport type AlertDialogPortalProps = DialogPortalProps\n\nexport const AlertDialogPortal = (props: AlertDialogPortalProps) => {\n return <Dialog.Portal data-spark-component=\"alert-dialog-portal\" {...props} />\n}\n\nAlertDialogPortal.displayName = 'AlertDialog.Portal'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogTitleProps } from '../dialog'\n\nexport type AlertDialogTitleProps = DialogTitleProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const AlertDialogTitle = (props: AlertDialogTitleProps) => {\n return <Dialog.Title data-spark-component=\"alert-dialog-title\" {...props} />\n}\n\nAlertDialogTitle.displayName = 'AlertDialog.Title'\n","import { Ref } from 'react'\n\nimport { Dialog, DialogTriggerProps } from '../dialog'\n\nexport type AlertDialogTriggerProps = DialogTriggerProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const AlertDialogTrigger = (props: AlertDialogTriggerProps) => {\n return <Dialog.Trigger data-spark-component=\"alert-dialog-title\" {...props} />\n}\n\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger'\n","import { AlertDialog as Root } from './AlertDialog'\nimport { AlertDialogAction } from './AlertDialogAction'\nimport { AlertDialogBody } from './AlertDialogBody'\nimport { AlertDialogCancel } from './AlertDialogCancel'\nimport { AlertDialogContent } from './AlertDialogContent'\nimport { AlertDialogDescription } from './AlertDialogDescription'\nimport { AlertDialogFooter } from './AlertDialogFooter'\nimport { AlertDialogHeader } from './AlertDialogHeader'\nimport { AlertDialogOverlay } from './AlertDialogOverlay'\nimport { AlertDialogPortal } from './AlertDialogPortal'\nimport { AlertDialogTitle } from './AlertDialogTitle'\nimport { AlertDialogTrigger } from './AlertDialogTrigger'\n\nexport * from './AlertDialog'\nexport { useAlertDialog } from './AlertDialogContext'\nexport { type AlertDialogActionProps } from './AlertDialogAction'\nexport { type AlertDialogBodyProps } from './AlertDialogBody'\nexport { type AlertDialogCancelProps } from './AlertDialogCancel'\nexport { type AlertDialogContentProps } from './AlertDialogContent'\nexport { type AlertDialogDescriptionProps } from './AlertDialogDescription'\nexport { type AlertDialogFooterProps } from './AlertDialogFooter'\nexport { type AlertDialogHeaderProps } from './AlertDialogHeader'\nexport { type AlertDialogOverlayProps } from './AlertDialogOverlay'\nexport { type AlertDialogPortalProps } from './AlertDialogPortal'\nexport { type AlertDialogTitleProps } from './AlertDialogTitle'\nexport { type AlertDialogTriggerProps } from './AlertDialogTrigger'\n\nexport const AlertDialog: typeof Root & {\n Action: typeof AlertDialogAction\n Body: typeof AlertDialogBody\n Cancel: typeof AlertDialogCancel\n Content: typeof AlertDialogContent\n Description: typeof AlertDialogDescription\n Footer: typeof AlertDialogFooter\n Header: typeof AlertDialogHeader\n Overlay: typeof AlertDialogOverlay\n Portal: typeof AlertDialogPortal\n Title: typeof AlertDialogTitle\n Trigger: typeof AlertDialogTrigger\n} = Object.assign(Root, {\n Action: AlertDialogAction,\n Body: AlertDialogBody,\n Cancel: AlertDialogCancel,\n Content: AlertDialogContent,\n Description: AlertDialogDescription,\n Footer: AlertDialogFooter,\n Header: AlertDialogHeader,\n Overlay: AlertDialogOverlay,\n Portal: AlertDialogPortal,\n Title: AlertDialogTitle,\n Trigger: AlertDialogTrigger,\n})\n\nAlertDialog.displayName = 'AlertDialog'\nAlertDialog.Action.displayName = 'AlertDialog.Action'\nAlertDialog.Body.displayName = 'AlertDialog.Body'\nAlertDialog.Cancel.displayName = 'AlertDialog.Cancel'\nAlertDialog.Content.displayName = 'AlertDialog.Content'\nAlertDialog.Description.displayName = 'AlertDialog.Description'\nAlertDialog.Footer.displayName = 'AlertDialog.Footer'\nAlertDialog.Header.displayName = 'AlertDialog.Header'\nAlertDialog.Overlay.displayName = 'AlertDialog.Overlay'\nAlertDialog.Portal.displayName = 'AlertDialog.Portal'\nAlertDialog.Title.displayName = 'AlertDialog.Title'\nAlertDialog.Trigger.displayName = 'AlertDialog.Trigger'\n"],"mappings":";;;;;;;;;;;AAKS;AADF,IAAM,cAAc,CAAC,UAA4B;AACtD,SAAO,oBAAC,UAAO,wBAAqB,gBAAgB,GAAG,OAAO,OAAO,MAAM;AAC7E;AAEA,YAAY,cAAc;;;ACCjB,gBAAAA,YAAA;AADF,IAAM,oBAAoB,CAAC,UAAkC;AAClE,SAAO,gBAAAA,KAAC,OAAO,OAAP,EAAa,wBAAqB,uBAAuB,GAAG,OAAO;AAC7E;AAEA,kBAAkB,cAAc;;;ACHvB,gBAAAC,YAAA;AADF,IAAM,kBAAkB,CAAC,UAAgC;AAC9D,SAAO,gBAAAA,KAAC,OAAO,MAAP,EAAY,wBAAqB,qBAAqB,GAAG,OAAO;AAC1E;AAEA,gBAAgB,cAAc;;;ACZ9B,SAAS,oBAAoB;;;ACA7B,SAAS,eAAe,kBAAoC;AAMrD,IAAM,qBAAqB,cAA8C,IAAI;AAE7E,IAAM,iBAAiB,MAAM;AAClC,QAAM,UAAU,WAAW,kBAAkB;AAE7C,MAAI,CAAC,SAAS;AACZ,UAAM,MAAM,0DAA0D;AAAA,EACxE;AAEA,SAAO;AACT;;;ADFS,gBAAAC,YAAA;AAJF,IAAM,oBAAoB,CAAC,EAAE,KAAK,cAAc,GAAG,MAAM,MAA8B;AAC5F,QAAM,EAAE,UAAU,IAAI,eAA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KAAK,cAAc;AAC/BA,aAAY,OAAO,cAAc;AACjCA,aAAY,QAAQ,cAAc;AAClCA,aAAY,YAAY,cAAc;AACtCA,aAAY,OAAO,cAAc;AACjCA,aAAY,OAAO,cAAc;AACjCA,aAAY,QAAQ,cAAc;AAClCA,aAAY,OAAO,cAAc;AACjCA,aAAY,MAAM,cAAc;AAChCA,aAAY,QAAQ,cAAc;","names":["jsx","jsx","jsx","jsx","jsx","jsx","jsx","jsx","jsx","jsx","jsx","AlertDialog"]}
1
+ {"version":3,"sources":["../../src/alert-dialog/AlertDialog.tsx","../../src/alert-dialog/AlertDialogContext.tsx","../../src/alert-dialog/AlertDialogAction.tsx","../../src/alert-dialog/useRenderSlot.tsx","../../src/alert-dialog/AlertDialogBody.tsx","../../src/alert-dialog/AlertDialogCancel.tsx","../../src/alert-dialog/AlertDialogContent.tsx","../../src/alert-dialog/AlertDialogDescription.tsx","../../src/alert-dialog/AlertDialogFooter.tsx","../../src/alert-dialog/AlertDialogHeader.tsx","../../src/alert-dialog/AlertDialogOverlay.tsx","../../src/alert-dialog/AlertDialogPortal.tsx","../../src/alert-dialog/AlertDialogTitle.tsx","../../src/alert-dialog/AlertDialogTrigger.tsx","../../src/alert-dialog/index.ts"],"sourcesContent":["import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { ComponentProps, Ref, useRef } from 'react'\n\nimport { AlertDialogProvider } from './AlertDialogContext'\n\nexport interface AlertDialogProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Root>, 'onOpenChange' | 'render'> {\n /**\n * Specifies if the dialog is open or not.\n */\n open?: boolean\n /**\n * Default open state.\n */\n defaultOpen?: boolean\n /**\n * Handler executed on every dialog open state change.\n */\n onOpenChange?: (open: boolean) => void\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 * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialog = ({ onOpenChange, withFade = false, ...props }: AlertDialogProps) => {\n const cancelRef = useRef<HTMLButtonElement | null>(null)\n\n const handleOpenChange = onOpenChange\n ? (open: boolean, _eventDetails: unknown) => {\n onOpenChange(open)\n }\n : undefined\n\n return (\n <AlertDialogProvider withFade={withFade} cancelRef={cancelRef}>\n <BaseAlertDialog.Root\n data-spark-component=\"alert-dialog\"\n onOpenChange={handleOpenChange}\n {...props}\n />\n </AlertDialogProvider>\n )\n}\n\nAlertDialog.displayName = 'AlertDialog'\n","import { createContext, MutableRefObject, type ReactNode, useContext } from 'react'\n\nexport interface AlertDialogContextValue {\n cancelRef: MutableRefObject<HTMLButtonElement | null>\n withFade: boolean\n}\n\nexport const AlertDialogContext = createContext<AlertDialogContextValue | null>(null)\n\nexport const AlertDialogProvider = ({\n children,\n withFade = false,\n cancelRef,\n}: {\n children: ReactNode\n withFade?: boolean\n cancelRef: MutableRefObject<HTMLButtonElement | null>\n}) => {\n return (\n <AlertDialogContext.Provider\n value={{\n cancelRef,\n withFade,\n }}\n >\n {children}\n </AlertDialogContext.Provider>\n )\n}\n\nexport const useAlertDialog = () => {\n const context = useContext(AlertDialogContext)\n\n if (!context) {\n throw Error('useAlertDialog must be used within an AlertDialog provider')\n }\n\n return context\n}\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { ComponentProps, Ref } from 'react'\n\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface AlertDialogActionProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Close>, 'render'> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const AlertDialogAction = ({ asChild = false, ...props }: AlertDialogActionProps) => {\n const renderSlot = useRenderSlot(asChild, 'button')\n\n return (\n <BaseAlertDialog.Close\n data-spark-component=\"alert-dialog-action\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nAlertDialogAction.displayName = 'AlertDialog.Action'\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean, defaultTag: string) {\n const Component = asChild ? Slot : defaultTag\n\n return asChild ? ({ ...props }) => <Component {...props} /> : undefined\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 { useAlertDialog } from './AlertDialogContext'\n\nexport interface AlertDialogBodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const AlertDialogBody = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: AlertDialogBodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useAlertDialog()\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"alert-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\nAlertDialogBody.displayName = 'AlertDialog.Body'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { ComponentProps, Ref } from 'react'\n\nimport { useAlertDialog } from './AlertDialogContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface AlertDialogCancelProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Close>, 'render'> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const AlertDialogCancel = ({\n asChild = false,\n ref: forwardedRef,\n ...props\n}: AlertDialogCancelProps) => {\n const { cancelRef } = useAlertDialog()\n const ref = useMergeRefs(forwardedRef, cancelRef)\n const renderSlot = useRenderSlot(asChild, 'button')\n\n return (\n <BaseAlertDialog.Close\n ref={ref}\n data-spark-component=\"alert-dialog-cancel\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nAlertDialogCancel.displayName = 'AlertDialog.Cancel'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, Ref } from 'react'\n\nimport { dialogContentStyles } from '../dialog/DialogContent.styles'\nimport { useAlertDialog } from './AlertDialogContext'\n\nexport interface AlertDialogContentProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Popup>, 'render'> {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogContent = ({ className, ref, initialFocus, ...others }: AlertDialogContentProps) => {\n const { cancelRef } = useAlertDialog()\n\n // Default: focus the cancel button when dialog opens\n // Users can override by passing their own initialFocus prop (RefObject, false, true, or function)\n const handleInitialFocus = initialFocus !== undefined ? initialFocus : () => cancelRef.current\n\n return (\n <BaseAlertDialog.Popup\n ref={ref}\n data-spark-component=\"alert-dialog-content\"\n role=\"alertdialog\"\n className={state =>\n cx(\n dialogContentStyles({ size: 'md', isNarrow: true }),\n 'min-w-sz-288',\n // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes\n // Transition with opacity and scale for smooth open/close animations\n 'transition-all duration-150',\n 'data-starting-style:scale-90 data-starting-style:opacity-0',\n 'data-ending-style:scale-90 data-ending-style:opacity-0',\n typeof className === 'function' ? className(state) : className\n )\n }\n initialFocus={handleInitialFocus}\n {...others}\n />\n )\n}\n\nAlertDialogContent.displayName = 'AlertDialog.Content'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { ComponentProps, Ref } from 'react'\n\nexport interface AlertDialogDescriptionProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Description>, 'render'> {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const AlertDialogDescription = (props: AlertDialogDescriptionProps) => {\n return <BaseAlertDialog.Description data-spark-component=\"alert-dialog-description\" {...props} />\n}\n\nAlertDialogDescription.displayName = 'AlertDialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface AlertDialogFooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogFooter = ({\n children,\n className,\n ref,\n ...rest\n}: AlertDialogFooterProps): ReactElement => (\n <footer\n data-spark-component=\"alert-dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nAlertDialogFooter.displayName = 'AlertDialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface AlertDialogHeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogHeader = ({\n children,\n className,\n ref,\n ...rest\n}: AlertDialogHeaderProps): ReactElement => (\n <header\n data-spark-component=\"alert-dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nAlertDialogHeader.displayName = 'AlertDialog.Header'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, Ref } from 'react'\n\nexport interface AlertDialogOverlayProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Backdrop>, 'render'> {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const AlertDialogOverlay = ({ className, ...props }: AlertDialogOverlayProps) => {\n return (\n <BaseAlertDialog.Backdrop\n data-spark-component=\"alert-dialog-overlay\"\n className={state =>\n cx(\n 'z-overlay fixed top-0 left-0 h-screen w-screen',\n 'bg-overlay/dim-1',\n // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes\n 'data-[starting-style]:animate-fade-in',\n 'data-[ending-style]:animate-fade-out',\n typeof className === 'function' ? className(state) : className\n )\n }\n {...props}\n />\n )\n}\n\nAlertDialogOverlay.displayName = 'AlertDialog.Overlay'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { ComponentProps } from 'react'\n\nexport type AlertDialogPortalProps = ComponentProps<typeof BaseAlertDialog.Portal>\n\nexport const AlertDialogPortal = (props: AlertDialogPortalProps) => {\n return <BaseAlertDialog.Portal data-spark-component=\"alert-dialog-portal\" {...props} />\n}\n\nAlertDialogPortal.displayName = 'AlertDialog.Portal'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, Ref } from 'react'\n\nexport interface AlertDialogTitleProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Title>, 'render'> {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const AlertDialogTitle = ({ className, ...props }: AlertDialogTitleProps) => {\n return (\n <BaseAlertDialog.Title\n data-spark-component=\"alert-dialog-title\"\n className={cx('text-headline-1 text-on-surface', className)}\n {...props}\n />\n )\n}\n\nAlertDialogTitle.displayName = 'AlertDialog.Title'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui-components/react/alert-dialog'\nimport { ComponentProps, Ref } from 'react'\n\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface AlertDialogTriggerProps\n extends Omit<ComponentProps<typeof BaseAlertDialog.Trigger>, 'render'> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const AlertDialogTrigger = ({ asChild = false, ...props }: AlertDialogTriggerProps) => {\n const renderSlot = useRenderSlot(asChild, 'button')\n\n return (\n <BaseAlertDialog.Trigger\n data-spark-component=\"alert-dialog-trigger\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger'\n","import { AlertDialog as Root } from './AlertDialog'\nimport { AlertDialogAction } from './AlertDialogAction'\nimport { AlertDialogBody } from './AlertDialogBody'\nimport { AlertDialogCancel } from './AlertDialogCancel'\nimport { AlertDialogContent } from './AlertDialogContent'\nimport { AlertDialogDescription } from './AlertDialogDescription'\nimport { AlertDialogFooter } from './AlertDialogFooter'\nimport { AlertDialogHeader } from './AlertDialogHeader'\nimport { AlertDialogOverlay } from './AlertDialogOverlay'\nimport { AlertDialogPortal } from './AlertDialogPortal'\nimport { AlertDialogTitle } from './AlertDialogTitle'\nimport { AlertDialogTrigger } from './AlertDialogTrigger'\n\nexport * from './AlertDialog'\nexport { useAlertDialog } from './AlertDialogContext'\nexport { type AlertDialogActionProps } from './AlertDialogAction'\nexport { type AlertDialogBodyProps } from './AlertDialogBody'\nexport { type AlertDialogCancelProps } from './AlertDialogCancel'\nexport { type AlertDialogContentProps } from './AlertDialogContent'\nexport { type AlertDialogDescriptionProps } from './AlertDialogDescription'\nexport { type AlertDialogFooterProps } from './AlertDialogFooter'\nexport { type AlertDialogHeaderProps } from './AlertDialogHeader'\nexport { type AlertDialogOverlayProps } from './AlertDialogOverlay'\nexport { type AlertDialogPortalProps } from './AlertDialogPortal'\nexport { type AlertDialogTitleProps } from './AlertDialogTitle'\nexport { type AlertDialogTriggerProps } from './AlertDialogTrigger'\n\nexport const AlertDialog: typeof Root & {\n Action: typeof AlertDialogAction\n Body: typeof AlertDialogBody\n Cancel: typeof AlertDialogCancel\n Content: typeof AlertDialogContent\n Description: typeof AlertDialogDescription\n Footer: typeof AlertDialogFooter\n Header: typeof AlertDialogHeader\n Overlay: typeof AlertDialogOverlay\n Portal: typeof AlertDialogPortal\n Title: typeof AlertDialogTitle\n Trigger: typeof AlertDialogTrigger\n} = Object.assign(Root, {\n Action: AlertDialogAction,\n Body: AlertDialogBody,\n Cancel: AlertDialogCancel,\n Content: AlertDialogContent,\n Description: AlertDialogDescription,\n Footer: AlertDialogFooter,\n Header: AlertDialogHeader,\n Overlay: AlertDialogOverlay,\n Portal: AlertDialogPortal,\n Title: AlertDialogTitle,\n Trigger: AlertDialogTrigger,\n})\n\nAlertDialog.displayName = 'AlertDialog'\nAlertDialog.Action.displayName = 'AlertDialog.Action'\nAlertDialog.Body.displayName = 'AlertDialog.Body'\nAlertDialog.Cancel.displayName = 'AlertDialog.Cancel'\nAlertDialog.Content.displayName = 'AlertDialog.Content'\nAlertDialog.Description.displayName = 'AlertDialog.Description'\nAlertDialog.Footer.displayName = 'AlertDialog.Footer'\nAlertDialog.Header.displayName = 'AlertDialog.Header'\nAlertDialog.Overlay.displayName = 'AlertDialog.Overlay'\nAlertDialog.Portal.displayName = 'AlertDialog.Portal'\nAlertDialog.Title.displayName = 'AlertDialog.Title'\nAlertDialog.Trigger.displayName = 'AlertDialog.Trigger'\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe,uBAAuB;AAC/C,SAA8B,cAAc;;;ACD5C,SAAS,eAAiD,kBAAkB;AAmBxE;AAZG,IAAM,qBAAqB,cAA8C,IAAI;AAE7E,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA,WAAW;AAAA,EACX;AACF,MAIM;AACJ,SACE;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAEO,IAAM,iBAAiB,MAAM;AAClC,QAAM,UAAU,WAAW,kBAAkB;AAE7C,MAAI,CAAC,SAAS;AACZ,UAAM,MAAM,4DAA4D;AAAA,EAC1E;AAEA,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ACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AACX,CAAC;AAEDA,aAAY,cAAc;AAC1BA,aAAY,OAAO,cAAc;AACjCA,aAAY,KAAK,cAAc;AAC/BA,aAAY,OAAO,cAAc;AACjCA,aAAY,QAAQ,cAAc;AAClCA,aAAY,YAAY,cAAc;AACtCA,aAAY,OAAO,cAAc;AACjCA,aAAY,OAAO,cAAc;AACjCA,aAAY,QAAQ,cAAc;AAClCA,aAAY,OAAO,cAAc;AACjCA,aAAY,MAAM,cAAc;AAChCA,aAAY,QAAQ,cAAc;","names":["jsx","BaseAlertDialog","jsx","jsx","BaseAlertDialog","useRef","jsx","useRef","BaseAlertDialog","useMergeRefs","jsx","useMergeRefs","BaseAlertDialog","BaseAlertDialog","cx","jsx","BaseAlertDialog","cx","BaseAlertDialog","jsx","cx","jsx","cx","jsx","BaseAlertDialog","cx","jsx","BaseAlertDialog","jsx","BaseAlertDialog","cx","jsx","BaseAlertDialog","jsx","BaseAlertDialog","AlertDialog"]}