@spark-ui/components 13.2.0 → 14.0.0-beta.2

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 (51) hide show
  1. package/dist/DialogContent.styles-BSfXHt21.mjs +61 -0
  2. package/dist/DialogContent.styles-BSfXHt21.mjs.map +1 -0
  3. package/dist/DialogContent.styles-bBs6l8Cy.js +2 -0
  4. package/dist/DialogContent.styles-bBs6l8Cy.js.map +1 -0
  5. package/dist/alert-dialog/AlertDialogPortal.d.ts +1 -1
  6. package/dist/alert-dialog/index.js +1 -1
  7. package/dist/alert-dialog/index.js.map +1 -1
  8. package/dist/alert-dialog/index.mjs +14 -7
  9. package/dist/alert-dialog/index.mjs.map +1 -1
  10. package/dist/dialog/Dialog.d.ts +13 -13
  11. package/dist/dialog/DialogClose.d.ts +9 -8
  12. package/dist/dialog/DialogContent.d.ts +4 -4
  13. package/dist/dialog/DialogDescription.d.ts +3 -3
  14. package/dist/dialog/DialogOverlay.d.ts +5 -5
  15. package/dist/dialog/DialogPortal.d.ts +4 -4
  16. package/dist/dialog/DialogTitle.d.ts +3 -3
  17. package/dist/dialog/DialogTrigger.d.ts +5 -9
  18. package/dist/dialog/index.js +1 -1
  19. package/dist/dialog/index.js.map +1 -1
  20. package/dist/dialog/index.mjs +148 -158
  21. package/dist/dialog/index.mjs.map +1 -1
  22. package/dist/drawer/Drawer.d.ts +12 -19
  23. package/dist/drawer/DrawerClose.d.ts +9 -5
  24. package/dist/drawer/DrawerContent.d.ts +5 -5
  25. package/dist/drawer/DrawerDescription.d.ts +4 -4
  26. package/dist/drawer/DrawerOverlay.d.ts +5 -5
  27. package/dist/drawer/DrawerPortal.d.ts +4 -4
  28. package/dist/drawer/DrawerTitle.d.ts +5 -5
  29. package/dist/drawer/DrawerTrigger.d.ts +5 -5
  30. package/dist/drawer/index.d.mts +2 -0
  31. package/dist/drawer/index.d.ts +2 -0
  32. package/dist/drawer/index.js +1 -1
  33. package/dist/drawer/index.js.map +1 -1
  34. package/dist/drawer/index.mjs +143 -114
  35. package/dist/drawer/index.mjs.map +1 -1
  36. package/dist/drawer/useRenderSlot.d.ts +3 -0
  37. package/dist/slider/Slider.d.ts +1 -6
  38. package/dist/slider/SliderContext.d.ts +1 -4
  39. package/dist/slider/index.js +1 -1
  40. package/dist/slider/index.js.map +1 -1
  41. package/dist/slider/index.mjs +69 -93
  42. package/dist/slider/index.mjs.map +1 -1
  43. package/dist/useRenderSlot-DATwjgpo.js +2 -0
  44. package/dist/useRenderSlot-DATwjgpo.js.map +1 -0
  45. package/dist/useRenderSlot-LwWj8QbC.mjs +10 -0
  46. package/dist/useRenderSlot-LwWj8QbC.mjs.map +1 -0
  47. package/package.json +4 -4
  48. package/dist/DialogContent.styles-B5pR8ECK.js +0 -2
  49. package/dist/DialogContent.styles-B5pR8ECK.js.map +0 -1
  50. package/dist/DialogContent.styles-_lRDsl8c.mjs +0 -48
  51. package/dist/DialogContent.styles-_lRDsl8c.mjs.map +0 -1
@@ -0,0 +1,61 @@
1
+ import { cva as a } from "class-variance-authority";
2
+ const t = a(
3
+ [
4
+ "z-modal flex flex-col bg-surface group transition-all",
5
+ "focus-visible:outline-hidden focus-visible:u-outline",
6
+ "[&:not(:has(footer))]:pb-lg",
7
+ "[&:not(:has(header))]:pt-lg",
8
+ "data-open:animation-duration-400 data-closed:animation-duration-200",
9
+ "data-starting-style:scale-90 data-starting-style:opacity-0",
10
+ "data-ending-style:scale-90 data-ending-style:opacity-0",
11
+ // Nested dialog effect
12
+ "data-nested-dialog-open:scale-90",
13
+ "data-nested-dialog-open:after:pointer-events-none",
14
+ "after:bg-transparent",
15
+ "after:transition-all",
16
+ "after:duration-200",
17
+ "data-nested-dialog-open:after:inset-0",
18
+ "data-nested-dialog-open:after:absolute",
19
+ "data-nested-dialog-open:after:rounded-[inherit]",
20
+ "data-nested-dialog-open:after:bg-overlay/dim-3"
21
+ ],
22
+ {
23
+ variants: {
24
+ size: {
25
+ fullscreen: "fixed size-full top-0 left-0",
26
+ sm: "max-w-sz-480",
27
+ md: "max-w-sz-672",
28
+ lg: "max-w-sz-864"
29
+ },
30
+ isNarrow: {
31
+ true: [],
32
+ false: []
33
+ }
34
+ },
35
+ compoundVariants: [
36
+ {
37
+ size: ["sm", "md", "lg"],
38
+ class: [
39
+ "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
40
+ "max-h-[80%]",
41
+ "shadow-md rounded-lg",
42
+ "data-open:animate-fade-in",
43
+ "data-closed:animate-fade-out"
44
+ ]
45
+ },
46
+ {
47
+ size: ["sm", "md", "lg"],
48
+ isNarrow: !1,
49
+ class: ["w-full"]
50
+ }
51
+ ],
52
+ defaultVariants: {
53
+ size: "md",
54
+ isNarrow: !1
55
+ }
56
+ }
57
+ );
58
+ export {
59
+ t as d
60
+ };
61
+ //# sourceMappingURL=DialogContent.styles-BSfXHt21.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContent.styles-BSfXHt21.mjs","sources":["../src/dialog/DialogContent.styles.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority'\n\nexport const dialogContentStyles = cva(\n [\n 'z-modal flex flex-col bg-surface group transition-all',\n 'focus-visible:outline-hidden focus-visible:u-outline',\n '[&:not(:has(footer))]:pb-lg',\n '[&:not(:has(header))]:pt-lg',\n 'data-open:animation-duration-400 data-closed:animation-duration-200',\n 'data-starting-style:scale-90 data-starting-style:opacity-0',\n 'data-ending-style:scale-90 data-ending-style:opacity-0',\n // Nested dialog effect\n 'data-nested-dialog-open:scale-90',\n 'data-nested-dialog-open:after:pointer-events-none',\n 'after:bg-transparent',\n 'after:transition-all',\n 'after:duration-200',\n 'data-nested-dialog-open:after:inset-0',\n 'data-nested-dialog-open:after:absolute',\n 'data-nested-dialog-open:after:rounded-[inherit]',\n 'data-nested-dialog-open:after:bg-overlay/dim-3',\n ],\n {\n variants: {\n size: {\n fullscreen: 'fixed size-full top-0 left-0',\n sm: 'max-w-sz-480',\n md: 'max-w-sz-672',\n lg: 'max-w-sz-864',\n },\n isNarrow: {\n true: [],\n false: [],\n },\n },\n compoundVariants: [\n {\n size: ['sm', 'md', 'lg'],\n class: [\n 'fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',\n 'max-h-[80%]',\n 'shadow-md rounded-lg',\n 'data-open:animate-fade-in',\n 'data-closed:animate-fade-out',\n ],\n },\n {\n size: ['sm', 'md', 'lg'],\n isNarrow: false,\n class: ['w-full'],\n },\n ],\n defaultVariants: {\n size: 'md',\n isNarrow: false,\n },\n }\n)\n\nexport type DialogContentStylesProps = VariantProps<typeof dialogContentStyles>\n"],"names":["dialogContentStyles","cva"],"mappings":";AAEO,MAAMA,IAAsBC;AAAA,EACjC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,UAAU;AAAA,QACR,MAAM,CAAA;AAAA,QACN,OAAO,CAAA;AAAA,MAAC;AAAA,IACV;AAAA,IAEF,kBAAkB;AAAA,MAChB;AAAA,QACE,MAAM,CAAC,MAAM,MAAM,IAAI;AAAA,QACvB,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MACF;AAAA,MAEF;AAAA,QACE,MAAM,CAAC,MAAM,MAAM,IAAI;AAAA,QACvB,UAAU;AAAA,QACV,OAAO,CAAC,QAAQ;AAAA,MAAA;AAAA,IAClB;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,EACZ;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const a=require("class-variance-authority"),e=a.cva(["z-modal flex flex-col bg-surface group transition-all","focus-visible:outline-hidden focus-visible:u-outline","[&:not(:has(footer))]:pb-lg","[&:not(:has(header))]:pt-lg","data-open:animation-duration-400 data-closed:animation-duration-200","data-starting-style:scale-90 data-starting-style:opacity-0","data-ending-style:scale-90 data-ending-style:opacity-0","data-nested-dialog-open:scale-90","data-nested-dialog-open:after:pointer-events-none","after:bg-transparent","after:transition-all","after:duration-200","data-nested-dialog-open:after:inset-0","data-nested-dialog-open:after:absolute","data-nested-dialog-open:after:rounded-[inherit]","data-nested-dialog-open:after:bg-overlay/dim-3"],{variants:{size:{fullscreen:"fixed size-full top-0 left-0",sm:"max-w-sz-480",md:"max-w-sz-672",lg:"max-w-sz-864"},isNarrow:{true:[],false:[]}},compoundVariants:[{size:["sm","md","lg"],class:["fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","max-h-[80%]","shadow-md rounded-lg","data-open:animate-fade-in","data-closed:animate-fade-out"]},{size:["sm","md","lg"],isNarrow:!1,class:["w-full"]}],defaultVariants:{size:"md",isNarrow:!1}});exports.dialogContentStyles=e;
2
+ //# sourceMappingURL=DialogContent.styles-bBs6l8Cy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContent.styles-bBs6l8Cy.js","sources":["../src/dialog/DialogContent.styles.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority'\n\nexport const dialogContentStyles = cva(\n [\n 'z-modal flex flex-col bg-surface group transition-all',\n 'focus-visible:outline-hidden focus-visible:u-outline',\n '[&:not(:has(footer))]:pb-lg',\n '[&:not(:has(header))]:pt-lg',\n 'data-open:animation-duration-400 data-closed:animation-duration-200',\n 'data-starting-style:scale-90 data-starting-style:opacity-0',\n 'data-ending-style:scale-90 data-ending-style:opacity-0',\n // Nested dialog effect\n 'data-nested-dialog-open:scale-90',\n 'data-nested-dialog-open:after:pointer-events-none',\n 'after:bg-transparent',\n 'after:transition-all',\n 'after:duration-200',\n 'data-nested-dialog-open:after:inset-0',\n 'data-nested-dialog-open:after:absolute',\n 'data-nested-dialog-open:after:rounded-[inherit]',\n 'data-nested-dialog-open:after:bg-overlay/dim-3',\n ],\n {\n variants: {\n size: {\n fullscreen: 'fixed size-full top-0 left-0',\n sm: 'max-w-sz-480',\n md: 'max-w-sz-672',\n lg: 'max-w-sz-864',\n },\n isNarrow: {\n true: [],\n false: [],\n },\n },\n compoundVariants: [\n {\n size: ['sm', 'md', 'lg'],\n class: [\n 'fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',\n 'max-h-[80%]',\n 'shadow-md rounded-lg',\n 'data-open:animate-fade-in',\n 'data-closed:animate-fade-out',\n ],\n },\n {\n size: ['sm', 'md', 'lg'],\n isNarrow: false,\n class: ['w-full'],\n },\n ],\n defaultVariants: {\n size: 'md',\n isNarrow: false,\n },\n }\n)\n\nexport type DialogContentStylesProps = VariantProps<typeof dialogContentStyles>\n"],"names":["dialogContentStyles","cva"],"mappings":"yDAEaA,EAAsBC,EAAAA,IACjC,CACE,wDACA,uDACA,8BACA,8BACA,sEACA,6DACA,yDAEA,mCACA,oDACA,uBACA,uBACA,qBACA,wCACA,yCACA,kDACA,gDAAA,EAEF,CACE,SAAU,CACR,KAAM,CACJ,WAAY,+BACZ,GAAI,eACJ,GAAI,eACJ,GAAI,cAAA,EAEN,SAAU,CACR,KAAM,CAAA,EACN,MAAO,CAAA,CAAC,CACV,EAEF,iBAAkB,CAChB,CACE,KAAM,CAAC,KAAM,KAAM,IAAI,EACvB,MAAO,CACL,2DACA,cACA,uBACA,4BACA,8BAAA,CACF,EAEF,CACE,KAAM,CAAC,KAAM,KAAM,IAAI,EACvB,SAAU,GACV,MAAO,CAAC,QAAQ,CAAA,CAClB,EAEF,gBAAiB,CACf,KAAM,KACN,SAAU,EAAA,CACZ,CAEJ"}
@@ -2,6 +2,6 @@ import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';
2
2
  import { ComponentProps } from 'react';
3
3
  export type AlertDialogPortalProps = ComponentProps<typeof BaseAlertDialog.Portal>;
4
4
  export declare const AlertDialogPortal: {
5
- (props: AlertDialogPortalProps): import("react/jsx-runtime").JSX.Element;
5
+ ({ className, ...props }: AlertDialogPortalProps): import("react/jsx-runtime").JSX.Element;
6
6
  displayName: string;
7
7
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("@base-ui/react/alert-dialog"),d=require("react"),w=require("../Slot-DQ8z2zsy.js"),A=require("@spark-ui/hooks/use-merge-refs"),P=require("@spark-ui/hooks/use-scroll-overflow"),c=require("class-variance-authority"),O=require("../DialogContent.styles-B5pR8ECK.js"),y=d.createContext(null),q=({children:e,withFade:t=!1,cancelRef:a})=>l.jsx(y.Provider,{value:{cancelRef:a,withFade:t},children:e}),p=()=>{const e=d.useContext(y);if(!e)throw Error("useAlertDialog must be used within an AlertDialog provider");return e},m=({onOpenChange:e,withFade:t=!1,...a})=>{const o=d.useRef(null),s=e?(n,g)=>{e(n)}:void 0;return l.jsx(q,{withFade:t,cancelRef:o,children:l.jsx(i.AlertDialog.Root,{"data-spark-component":"alert-dialog",onOpenChange:s,...a})})};m.displayName="AlertDialog";function D(e,t){const a=e?w.Slot:t;return e?({...o})=>l.jsx(a,{...o}):void 0}const x=({asChild:e=!1,...t})=>{const a=D(e,"button");return l.jsx(i.AlertDialog.Close,{"data-spark-component":"alert-dialog-action",render:a,...t})};x.displayName="AlertDialog.Action";const f=({children:e,className:t,inset:a=!1,ref:o,...s})=>{const n=d.useRef(null),g=A.useMergeRefs(o,n),{withFade:S}=p(),{overflow:u}=P.useScrollOverflow(n);return l.jsx("div",{"data-spark-component":"alert-dialog-body",ref:g,className:c.cx("focus-visible:u-outline relative grow overflow-y-auto outline-hidden","transition-all duration-300",{"px-xl py-lg":!a},t),style:{...S&&{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))",maskSize:`100% calc(100% + ${u.top?"0px":"44px"} + ${u.bottom?"0px":"44px"})`,maskPosition:`0 ${u.top?"0px":"-44px"}`}},...s,children:e})};f.displayName="AlertDialog.Body";const N=({asChild:e=!1,ref:t,...a})=>{const{cancelRef:o}=p(),s=A.useMergeRefs(t,o),n=D(e,"button");return l.jsx(i.AlertDialog.Close,{ref:s,"data-spark-component":"alert-dialog-cancel",render:n,...a})};N.displayName="AlertDialog.Cancel";const v=({className:e,ref:t,initialFocus:a,...o})=>{const{cancelRef:s}=p(),n=a!==void 0?a:()=>s.current;return l.jsx(i.AlertDialog.Popup,{ref:t,"data-spark-component":"alert-dialog-content",role:"alertdialog",className:g=>c.cx(O.dialogContentStyles({size:"md",isNarrow:!0}),"min-w-sz-288","transition-all duration-150","data-starting-style:scale-90 data-starting-style:opacity-0","data-ending-style:scale-90 data-ending-style:opacity-0",typeof e=="function"?e(g):e),initialFocus:n,...o})};v.displayName="AlertDialog.Content";const j=e=>l.jsx(i.AlertDialog.Description,{"data-spark-component":"alert-dialog-description",...e});j.displayName="AlertDialog.Description";const C=({children:e,className:t,ref:a,...o})=>l.jsx("footer",{"data-spark-component":"alert-dialog-footer",ref:a,className:c.cx(t,["px-xl","py-lg"]),...o,children:e});C.displayName="AlertDialog.Footer";const b=({children:e,className:t,ref:a,...o})=>l.jsx("header",{"data-spark-component":"alert-dialog-header",ref:a,className:c.cx(t,["px-xl","py-lg"]),...o,children:e});b.displayName="AlertDialog.Header";const k=({className:e,...t})=>l.jsx(i.AlertDialog.Backdrop,{"data-spark-component":"alert-dialog-overlay",className:a=>c.cx("z-overlay fixed top-0 left-0 h-screen w-screen","bg-overlay/dim-1","data-[starting-style]:animate-fade-in","data-[ending-style]:animate-fade-out",typeof e=="function"?e(a):e),...t});k.displayName="AlertDialog.Overlay";const R=e=>l.jsx(i.AlertDialog.Portal,{"data-spark-component":"alert-dialog-portal",...e});R.displayName="AlertDialog.Portal";const T=({className:e,...t})=>l.jsx(i.AlertDialog.Title,{"data-spark-component":"alert-dialog-title",className:c.cx("text-headline-1 text-on-surface",e),...t});T.displayName="AlertDialog.Title";const h=({asChild:e=!1,...t})=>{const a=D(e,"button");return l.jsx(i.AlertDialog.Trigger,{"data-spark-component":"alert-dialog-trigger",render:a,...t})};h.displayName="AlertDialog.Trigger";const r=Object.assign(m,{Action:x,Body:f,Cancel:N,Content:v,Description:j,Footer:C,Header:b,Overlay:k,Portal:R,Title:T,Trigger:h});r.displayName="AlertDialog";r.Action.displayName="AlertDialog.Action";r.Body.displayName="AlertDialog.Body";r.Cancel.displayName="AlertDialog.Cancel";r.Content.displayName="AlertDialog.Content";r.Description.displayName="AlertDialog.Description";r.Footer.displayName="AlertDialog.Footer";r.Header.displayName="AlertDialog.Header";r.Overlay.displayName="AlertDialog.Overlay";r.Portal.displayName="AlertDialog.Portal";r.Title.displayName="AlertDialog.Title";r.Trigger.displayName="AlertDialog.Trigger";exports.AlertDialog=r;exports.useAlertDialog=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("@base-ui/react/alert-dialog"),d=require("react"),w=require("../Slot-DQ8z2zsy.js"),A=require("@spark-ui/hooks/use-merge-refs"),P=require("@spark-ui/hooks/use-scroll-overflow"),c=require("class-variance-authority"),O=require("../DialogContent.styles-bBs6l8Cy.js"),y=d.createContext(null),q=({children:e,withFade:t=!1,cancelRef:a})=>l.jsx(y.Provider,{value:{cancelRef:a,withFade:t},children:e}),p=()=>{const e=d.useContext(y);if(!e)throw Error("useAlertDialog must be used within an AlertDialog provider");return e},m=({onOpenChange:e,withFade:t=!1,...a})=>{const o=d.useRef(null),s=e?(n,g)=>{e(n)}:void 0;return l.jsx(q,{withFade:t,cancelRef:o,children:l.jsx(i.AlertDialog.Root,{"data-spark-component":"alert-dialog",onOpenChange:s,...a})})};m.displayName="AlertDialog";function D(e,t){const a=e?w.Slot:t;return e?({...o})=>l.jsx(a,{...o}):void 0}const x=({asChild:e=!1,...t})=>{const a=D(e,"button");return l.jsx(i.AlertDialog.Close,{"data-spark-component":"alert-dialog-action",render:a,...t})};x.displayName="AlertDialog.Action";const f=({children:e,className:t,inset:a=!1,ref:o,...s})=>{const n=d.useRef(null),g=A.useMergeRefs(o,n),{withFade:S}=p(),{overflow:u}=P.useScrollOverflow(n);return l.jsx("div",{"data-spark-component":"alert-dialog-body",ref:g,className:c.cx("focus-visible:u-outline relative grow overflow-y-auto outline-hidden","transition-all duration-300",{"px-xl py-lg":!a},t),style:{...S&&{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))",maskSize:`100% calc(100% + ${u.top?"0px":"44px"} + ${u.bottom?"0px":"44px"})`,maskPosition:`0 ${u.top?"0px":"-44px"}`}},...s,children:e})};f.displayName="AlertDialog.Body";const N=({asChild:e=!1,ref:t,...a})=>{const{cancelRef:o}=p(),s=A.useMergeRefs(t,o),n=D(e,"button");return l.jsx(i.AlertDialog.Close,{ref:s,"data-spark-component":"alert-dialog-cancel",render:n,...a})};N.displayName="AlertDialog.Cancel";const v=({className:e,ref:t,initialFocus:a,...o})=>{const{cancelRef:s}=p(),n=a!==void 0?a:()=>s.current;return l.jsx(i.AlertDialog.Popup,{ref:t,"data-spark-component":"alert-dialog-content",role:"alertdialog",className:g=>c.cx(O.dialogContentStyles({size:"md",isNarrow:!0}),"min-w-sz-288","transition-all duration-150","data-starting-style:scale-90 data-starting-style:opacity-0","data-ending-style:scale-90 data-ending-style:opacity-0",typeof e=="function"?e(g):e),initialFocus:n,...o})};v.displayName="AlertDialog.Content";const j=e=>l.jsx(i.AlertDialog.Description,{"data-spark-component":"alert-dialog-description",...e});j.displayName="AlertDialog.Description";const C=({children:e,className:t,ref:a,...o})=>l.jsx("footer",{"data-spark-component":"alert-dialog-footer",ref:a,className:c.cx(t,["px-xl","py-lg"]),...o,children:e});C.displayName="AlertDialog.Footer";const b=({children:e,className:t,ref:a,...o})=>l.jsx("header",{"data-spark-component":"alert-dialog-header",ref:a,className:c.cx(t,["px-xl","py-lg"]),...o,children:e});b.displayName="AlertDialog.Header";const k=({className:e,...t})=>l.jsx(i.AlertDialog.Backdrop,{"data-spark-component":"alert-dialog-overlay",className:a=>c.cx("z-overlay fixed top-0 left-0 h-screen w-screen","bg-overlay/dim-1","data-starting-style:animate-fade-in","data-ending-style:animate-fade-out",typeof e=="function"?e(a):e),...t});k.displayName="AlertDialog.Overlay";const R=({className:e,...t})=>l.jsx(i.AlertDialog.Portal,{"data-spark-component":"alert-dialog-portal",className:c.cx(e,"z-modal absolute"),...t});R.displayName="AlertDialog.Portal";const T=({className:e,...t})=>l.jsx(i.AlertDialog.Title,{"data-spark-component":"alert-dialog-title",className:c.cx("text-headline-1 text-on-surface",e),...t});T.displayName="AlertDialog.Title";const h=({asChild:e=!1,...t})=>{const a=D(e,"button");return l.jsx(i.AlertDialog.Trigger,{"data-spark-component":"alert-dialog-trigger",render:a,...t})};h.displayName="AlertDialog.Trigger";const r=Object.assign(m,{Action:x,Body:f,Cancel:N,Content:v,Description:j,Footer:C,Header:b,Overlay:k,Portal:R,Title:T,Trigger:h});r.displayName="AlertDialog";r.Action.displayName="AlertDialog.Action";r.Body.displayName="AlertDialog.Body";r.Cancel.displayName="AlertDialog.Cancel";r.Content.displayName="AlertDialog.Content";r.Description.displayName="AlertDialog.Description";r.Footer.displayName="AlertDialog.Footer";r.Header.displayName="AlertDialog.Header";r.Overlay.displayName="AlertDialog.Overlay";r.Portal.displayName="AlertDialog.Portal";r.Title.displayName="AlertDialog.Title";r.Trigger.displayName="AlertDialog.Trigger";exports.AlertDialog=r;exports.useAlertDialog=p;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/alert-dialog/AlertDialogContext.tsx","../../src/alert-dialog/AlertDialog.tsx","../../src/alert-dialog/useRenderSlot.tsx","../../src/alert-dialog/AlertDialogAction.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 { 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/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 { 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 { AlertDialog as BaseAlertDialog } from '@base-ui/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 { 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/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/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 = ({\n className,\n ref,\n initialFocus,\n ...others\n}: 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/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/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/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/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/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"],"names":["AlertDialogContext","createContext","AlertDialogProvider","children","withFade","cancelRef","jsx","useAlertDialog","context","useContext","AlertDialog","onOpenChange","props","useRef","handleOpenChange","open","_eventDetails","BaseAlertDialog","useRenderSlot","asChild","defaultTag","Component","Slot","AlertDialogAction","renderSlot","AlertDialogBody","className","inset","forwardedRef","rest","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","AlertDialogCancel","AlertDialogContent","initialFocus","others","handleInitialFocus","state","dialogContentStyles","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogOverlay","AlertDialogPortal","AlertDialogTitle","AlertDialogTrigger","Root"],"mappings":"sYAOaA,EAAqBC,EAAAA,cAA8C,IAAI,EAEvEC,EAAsB,CAAC,CAClC,SAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,CACF,IAMIC,EAAAA,IAACN,EAAmB,SAAnB,CACC,MAAO,CACL,UAAAK,EACA,SAAAD,CAAA,EAGD,SAAAD,CAAA,CAAA,EAKMI,EAAiB,IAAM,CAClC,MAAMC,EAAUC,EAAAA,WAAWT,CAAkB,EAE7C,GAAI,CAACQ,EACH,MAAM,MAAM,4DAA4D,EAG1E,OAAOA,CACT,ECRaE,EAAc,CAAC,CAAE,aAAAC,EAAc,SAAAP,EAAW,GAAO,GAAGQ,KAA8B,CAC7F,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C,EAAmB,YAAc,sBCC1B,MAAMvC,EAYT,OAAO,OAAOwC,EAAM,CACtB,OAAQ3B,EACR,KAAME,EACN,OAAQW,EACR,QAASC,EACT,YAAaM,EACb,OAAQC,EACR,OAAQC,EACR,QAASC,EACT,OAAQC,EACR,MAAOC,EACP,QAASC,CACX,CAAC,EAEDvC,EAAY,YAAc,cAC1BA,EAAY,OAAO,YAAc,qBACjCA,EAAY,KAAK,YAAc,mBAC/BA,EAAY,OAAO,YAAc,qBACjCA,EAAY,QAAQ,YAAc,sBAClCA,EAAY,YAAY,YAAc,0BACtCA,EAAY,OAAO,YAAc,qBACjCA,EAAY,OAAO,YAAc,qBACjCA,EAAY,QAAQ,YAAc,sBAClCA,EAAY,OAAO,YAAc,qBACjCA,EAAY,MAAM,YAAc,oBAChCA,EAAY,QAAQ,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../src/alert-dialog/AlertDialogContext.tsx","../../src/alert-dialog/AlertDialog.tsx","../../src/alert-dialog/useRenderSlot.tsx","../../src/alert-dialog/AlertDialogAction.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 { 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/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 { 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 { AlertDialog as BaseAlertDialog } from '@base-ui/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 { 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/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/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 = ({\n className,\n ref,\n initialFocus,\n ...others\n}: 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/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/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/react/alert-dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps } from 'react'\n\nexport type AlertDialogPortalProps = ComponentProps<typeof BaseAlertDialog.Portal>\n\nexport const AlertDialogPortal = ({ className, ...props }: AlertDialogPortalProps) => {\n return (\n <BaseAlertDialog.Portal\n data-spark-component=\"alert-dialog-portal\"\n className={cx(className, 'z-modal absolute')}\n {...props}\n />\n )\n}\n\nAlertDialogPortal.displayName = 'AlertDialog.Portal'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui/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/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"],"names":["AlertDialogContext","createContext","AlertDialogProvider","children","withFade","cancelRef","jsx","useAlertDialog","context","useContext","AlertDialog","onOpenChange","props","useRef","handleOpenChange","open","_eventDetails","BaseAlertDialog","useRenderSlot","asChild","defaultTag","Component","Slot","AlertDialogAction","renderSlot","AlertDialogBody","className","inset","forwardedRef","rest","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","AlertDialogCancel","AlertDialogContent","initialFocus","others","handleInitialFocus","state","dialogContentStyles","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogOverlay","AlertDialogPortal","AlertDialogTitle","AlertDialogTrigger","Root"],"mappings":"sYAOaA,EAAqBC,EAAAA,cAA8C,IAAI,EAEvEC,EAAsB,CAAC,CAClC,SAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,CACF,IAMIC,EAAAA,IAACN,EAAmB,SAAnB,CACC,MAAO,CACL,UAAAK,EACA,SAAAD,CAAA,EAGD,SAAAD,CAAA,CAAA,EAKMI,EAAiB,IAAM,CAClC,MAAMC,EAAUC,EAAAA,WAAWT,CAAkB,EAE7C,GAAI,CAACQ,EACH,MAAM,MAAM,4DAA4D,EAG1E,OAAOA,CACT,ECRaE,EAAc,CAAC,CAAE,aAAAC,EAAc,SAAAP,EAAW,GAAO,GAAGQ,KAA8B,CAC7F,MAAMP,EAAYQ,EAAAA,OAAiC,IAAI,EAEjDC,EAAmBH,EACrB,CAACI,EAAeC,IAA2B,CACzCL,EAAaI,CAAI,CACnB,EACA,OAEJ,OACET,EAAAA,IAACJ,EAAA,CAAoB,SAAAE,EAAoB,UAAAC,EACvC,SAAAC,EAAAA,IAACW,EAAAA,YAAgB,KAAhB,CACC,uBAAqB,eACrB,aAAcH,EACb,GAAGF,CAAA,CAAA,EAER,CAEJ,EAEAF,EAAY,YAAc,cChDnB,SAASQ,EAAcC,EAAkBC,EAAoB,CAClE,MAAMC,EAAYF,EAAUG,EAAAA,KAAOF,EAEnC,OAAOD,EAAU,CAAC,CAAE,GAAGP,CAAA,IAAYN,MAACe,EAAA,CAAW,GAAGT,CAAA,CAAO,EAAK,MAChE,CCQO,MAAMW,EAAoB,CAAC,CAAE,QAAAJ,EAAU,GAAO,GAAGP,KAAoC,CAC1F,MAAMY,EAAaN,EAAcC,EAAS,QAAQ,EAElD,OACEb,EAAAA,IAACW,EA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5,8 @@ import { a as F } from "../Slot-D2Bbf8Gw.mjs";
5
5
  import { useMergeRefs as D } from "@spark-ui/hooks/use-merge-refs";
6
6
  import { useScrollOverflow as B } from "@spark-ui/hooks/use-scroll-overflow";
7
7
  import { cx as d } from "class-variance-authority";
8
- import { d as H } from "../DialogContent.styles-_lRDsl8c.mjs";
9
- const A = R(null), $ = ({
8
+ import { d as z } from "../DialogContent.styles-BSfXHt21.mjs";
9
+ const A = R(null), H = ({
10
10
  children: e,
11
11
  withFade: t = !1,
12
12
  cancelRef: a
@@ -28,7 +28,7 @@ const A = R(null), $ = ({
28
28
  const l = y(null), s = e ? (n, c) => {
29
29
  e(n);
30
30
  } : void 0;
31
- return /* @__PURE__ */ o($, { withFade: t, cancelRef: l, children: /* @__PURE__ */ o(
31
+ return /* @__PURE__ */ o(H, { withFade: t, cancelRef: l, children: /* @__PURE__ */ o(
32
32
  i.Root,
33
33
  {
34
34
  "data-spark-component": "alert-dialog",
@@ -119,7 +119,7 @@ const v = ({
119
119
  "data-spark-component": "alert-dialog-content",
120
120
  role: "alertdialog",
121
121
  className: (c) => d(
122
- H({ size: "md", isNarrow: !0 }),
122
+ z({ size: "md", isNarrow: !0 }),
123
123
  "min-w-sz-288",
124
124
  // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
125
125
  // Transition with opacity and scale for smooth open/close animations
@@ -176,15 +176,22 @@ const T = ({ className: e, ...t }) => /* @__PURE__ */ o(
176
176
  "z-overlay fixed top-0 left-0 h-screen w-screen",
177
177
  "bg-overlay/dim-1",
178
178
  // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
179
- "data-[starting-style]:animate-fade-in",
180
- "data-[ending-style]:animate-fade-out",
179
+ "data-starting-style:animate-fade-in",
180
+ "data-ending-style:animate-fade-out",
181
181
  typeof e == "function" ? e(a) : e
182
182
  ),
183
183
  ...t
184
184
  }
185
185
  );
186
186
  T.displayName = "AlertDialog.Overlay";
187
- const h = (e) => /* @__PURE__ */ o(i.Portal, { "data-spark-component": "alert-dialog-portal", ...e });
187
+ const h = ({ className: e, ...t }) => /* @__PURE__ */ o(
188
+ i.Portal,
189
+ {
190
+ "data-spark-component": "alert-dialog-portal",
191
+ className: d(e, "z-modal absolute"),
192
+ ...t
193
+ }
194
+ );
188
195
  h.displayName = "AlertDialog.Portal";
189
196
  const w = ({ className: e, ...t }) => /* @__PURE__ */ o(
190
197
  i.Title,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/alert-dialog/AlertDialogContext.tsx","../../src/alert-dialog/AlertDialog.tsx","../../src/alert-dialog/useRenderSlot.tsx","../../src/alert-dialog/AlertDialogAction.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 { 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/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 { 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 { AlertDialog as BaseAlertDialog } from '@base-ui/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 { 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/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/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 = ({\n className,\n ref,\n initialFocus,\n ...others\n}: 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/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/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/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/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/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"],"names":["AlertDialogContext","createContext","AlertDialogProvider","children","withFade","cancelRef","jsx","useAlertDialog","context","useContext","AlertDialog","onOpenChange","props","useRef","handleOpenChange","open","_eventDetails","BaseAlertDialog","useRenderSlot","asChild","defaultTag","Component","Slot","AlertDialogAction","renderSlot","AlertDialogBody","className","inset","forwardedRef","rest","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","AlertDialogCancel","AlertDialogContent","initialFocus","others","handleInitialFocus","state","dialogContentStyles","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogOverlay","AlertDialogPortal","AlertDialogTitle","AlertDialogTrigger","Root"],"mappings":";;;;;;;;AAOO,MAAMA,IAAqBC,EAA8C,IAAI,GAEvEC,IAAsB,CAAC;AAAA,EAClC,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAA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;AAEDvC,EAAY,cAAc;AAC1BA,EAAY,OAAO,cAAc;AACjCA,EAAY,KAAK,cAAc;AAC/BA,EAAY,OAAO,cAAc;AACjCA,EAAY,QAAQ,cAAc;AAClCA,EAAY,YAAY,cAAc;AACtCA,EAAY,OAAO,cAAc;AACjCA,EAAY,OAAO,cAAc;AACjCA,EAAY,QAAQ,cAAc;AAClCA,EAAY,OAAO,cAAc;AACjCA,EAAY,MAAM,cAAc;AAChCA,EAAY,QAAQ,cAAc;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/alert-dialog/AlertDialogContext.tsx","../../src/alert-dialog/AlertDialog.tsx","../../src/alert-dialog/useRenderSlot.tsx","../../src/alert-dialog/AlertDialogAction.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 { 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/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 { 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 { AlertDialog as BaseAlertDialog } from '@base-ui/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 { 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/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/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 = ({\n className,\n ref,\n initialFocus,\n ...others\n}: 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/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/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/react/alert-dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps } from 'react'\n\nexport type AlertDialogPortalProps = ComponentProps<typeof BaseAlertDialog.Portal>\n\nexport const AlertDialogPortal = ({ className, ...props }: AlertDialogPortalProps) => {\n return (\n <BaseAlertDialog.Portal\n data-spark-component=\"alert-dialog-portal\"\n className={cx(className, 'z-modal absolute')}\n {...props}\n />\n )\n}\n\nAlertDialogPortal.displayName = 'AlertDialog.Portal'\n","import { AlertDialog as BaseAlertDialog } from '@base-ui/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/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"],"names":["AlertDialogContext","createContext","AlertDialogProvider","children","withFade","cancelRef","jsx","useAlertDialog","context","useContext","AlertDialog","onOpenChange","props","useRef","handleOpenChange","open","_eventDetails","BaseAlertDialog","useRenderSlot","asChild","defaultTag","Component","Slot","AlertDialogAction","renderSlot","AlertDialogBody","className","inset","forwardedRef","rest","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","AlertDialogCancel","AlertDialogContent","initialFocus","others","handleInitialFocus","state","dialogContentStyles","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogOverlay","AlertDialogPortal","AlertDialogTitle","AlertDialogTrigger","Root"],"mappings":";;;;;;;;AAOO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OAAOwC,GAAM;AAAA,EACtB,QAAQ3B;AAAA,EACR,MAAME;AAAA,EACN,QAAQW;AAAA,EACR,SAASC;AAAA,EACT,aAAaM;AAAA,EACb,QAAQC;AAAA,EACR,QAAQC;AAAA,EACR,SAASC;AAAA,EACT,QAAQC;AAAA,EACR,OAAOC;AAAA,EACP,SAASC;AACX,CAAC;AAEDvC,EAAY,cAAc;AAC1BA,EAAY,OAAO,cAAc;AACjCA,EAAY,KAAK,cAAc;AAC/BA,EAAY,OAAO,cAAc;AACjCA,EAAY,QAAQ,cAAc;AAClCA,EAAY,YAAY,cAAc;AACtCA,EAAY,OAAO,cAAc;AACjCA,EAAY,OAAO,cAAc;AACjCA,EAAY,QAAQ,cAAc;AAClCA,EAAY,OAAO,cAAc;AACjCA,EAAY,MAAM,cAAc;AAChCA,EAAY,QAAQ,cAAc;"}
@@ -1,32 +1,32 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { ReactElement } from 'react';
3
- export interface DialogProps {
4
- /**
5
- * Children of the component.
6
- */
7
- children?: RadixDialog.DialogProps['children'];
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, ReactElement } from 'react';
3
+ export interface DialogProps extends Omit<ComponentProps<typeof BaseDialog.Root>, 'onOpenChange' | 'render'> {
8
4
  /**
9
5
  * Specifies if the dialog is open or not.
10
6
  */
11
- open?: RadixDialog.DialogProps['open'];
7
+ open?: boolean;
12
8
  /**
13
9
  * Default open state.
14
10
  */
15
- defaultOpen?: RadixDialog.DialogProps['defaultOpen'];
11
+ defaultOpen?: boolean;
16
12
  /**
17
- * Handler executen on every dialog open state change.
13
+ * Handler executed on every dialog open state change.
18
14
  */
19
- onOpenChange?: RadixDialog.DialogProps['onOpenChange'];
15
+ onOpenChange?: (open: boolean) => void;
20
16
  /**
21
17
  * Specifies if the dialog is a modal.
22
18
  */
23
- modal?: RadixDialog.DialogProps['modal'];
19
+ modal?: boolean;
24
20
  /**
25
21
  * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).
26
22
  */
27
23
  withFade?: boolean;
24
+ /**
25
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
26
+ */
27
+ asChild?: boolean;
28
28
  }
29
29
  export declare const Dialog: {
30
- ({ children, withFade, ...rest }: DialogProps): ReactElement;
30
+ ({ withFade, onOpenChange, ...props }: DialogProps): ReactElement;
31
31
  displayName: string;
32
32
  };
@@ -1,9 +1,10 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { Ref } from 'react';
3
- export type CloseProps = RadixDialog.DialogCloseProps & {
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, Ref } from 'react';
3
+ export interface CloseProps extends Omit<ComponentProps<typeof BaseDialog.Close>, 'render'> {
4
+ /**
5
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
6
+ */
7
+ asChild?: boolean;
4
8
  ref?: Ref<HTMLButtonElement>;
5
- };
6
- export declare const Close: {
7
- (props: CloseProps): import("react/jsx-runtime").JSX.Element;
8
- displayName: string;
9
- };
9
+ }
10
+ export declare const Close: ({ asChild, ...props }: CloseProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { ReactElement, Ref } from 'react';
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, Ref } from 'react';
3
3
  import { DialogContentStylesProps } from './DialogContent.styles';
4
- export interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {
4
+ export interface ContentProps extends Omit<ComponentProps<typeof BaseDialog.Popup>, 'render'>, DialogContentStylesProps {
5
5
  /**
6
6
  * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.
7
7
  */
@@ -9,6 +9,6 @@ export interface ContentProps extends RadixDialog.DialogContentProps, DialogCont
9
9
  ref?: Ref<HTMLDivElement>;
10
10
  }
11
11
  export declare const Content: {
12
- ({ children, className, isNarrow, size, onInteractOutside, ref, ...rest }: ContentProps): ReactElement;
12
+ ({ className, isNarrow, size, ref, ...rest }: ContentProps): import("react/jsx-runtime").JSX.Element;
13
13
  displayName: string;
14
14
  };
@@ -1,6 +1,6 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { Ref } from 'react';
3
- export type DescriptionProps = RadixDialog.DialogDescriptionProps & {
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, Ref } from 'react';
3
+ export type DescriptionProps = ComponentProps<typeof BaseDialog.Description> & {
4
4
  ref?: Ref<HTMLParagraphElement>;
5
5
  };
6
6
  export declare const Description: {
@@ -1,9 +1,9 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { ReactElement, Ref } from 'react';
3
- export type OverlayProps = RadixDialog.DialogOverlayProps & {
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, Ref } from 'react';
3
+ export interface OverlayProps extends Omit<ComponentProps<typeof BaseDialog.Backdrop>, 'render'> {
4
4
  ref?: Ref<HTMLDivElement>;
5
- };
5
+ }
6
6
  export declare const Overlay: {
7
- ({ className, ref, ...rest }: OverlayProps): ReactElement | null;
7
+ ({ className, ...props }: OverlayProps): import("react/jsx-runtime").JSX.Element;
8
8
  displayName: string;
9
9
  };
@@ -1,7 +1,7 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { ReactElement } from 'react';
3
- export type PortalProps = RadixDialog.DialogPortalProps;
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps } from 'react';
3
+ export type PortalProps = ComponentProps<typeof BaseDialog.Portal>;
4
4
  export declare const Portal: {
5
- ({ children, ...rest }: PortalProps): ReactElement;
5
+ ({ className, ...props }: PortalProps): import("react/jsx-runtime").JSX.Element;
6
6
  displayName: string;
7
7
  };
@@ -1,6 +1,6 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { Ref } from 'react';
3
- export type TitleProps = RadixDialog.DialogTitleProps & {
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, Ref } from 'react';
3
+ export type TitleProps = ComponentProps<typeof BaseDialog.Title> & {
4
4
  ref?: Ref<HTMLHeadingElement>;
5
5
  };
6
6
  export declare const Title: {
@@ -1,17 +1,13 @@
1
- import { Dialog as RadixDialog } from 'radix-ui';
2
- import { ReactElement, ReactNode, Ref } from 'react';
3
- export interface TriggerProps {
4
- /**
5
- * Children of the component.
6
- */
7
- children?: ReactNode;
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import { ComponentProps, Ref } from 'react';
3
+ export interface TriggerProps extends Omit<ComponentProps<typeof BaseDialog.Trigger>, 'render'> {
8
4
  /**
9
5
  * Change the component to the HTML tag or custom component of the only child.
10
6
  */
11
- asChild?: RadixDialog.DialogTriggerProps['asChild'];
7
+ asChild?: boolean;
12
8
  ref?: Ref<HTMLButtonElement>;
13
9
  }
14
10
  export declare const Trigger: {
15
- (props: TriggerProps): ReactElement;
11
+ ({ asChild, ...props }: TriggerProps): import("react/jsx-runtime").JSX.Element;
16
12
  displayName: string;
17
13
  };