@kushagradhawan/kookie-ui 0.1.47 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,oBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC;CAAG;AAC7E,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAEnD,CAAC;AAIF,UAAU,uBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,OAAO,EAAE,YAAY,CAAC;CAAG;AACrF,QAAA,MAAM,kBAAkB,mGAMvB,CAAC;AAIF,UAAU,uBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,OAAO,EAAE,YAAY,CAAC,EAC9E,0BAA0B;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC;CAC7F;AACD,QAAA,MAAM,kBAAkB,gGAmIvB,CAAC;AAIF,KAAK,qBAAqB,GAAG,qBAAqB,CAAC,OAAO,OAAO,EAAE,SAAS,CAAC,CAAC;AAC9E,QAAA,MAAM,gBAAgB,kGAMrB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AAM,EAC3B,iBAAiB,IAAI,MAAM,GAC5B,CAAC;AAEF,YAAY,EACV,oBAAoB,IAAI,SAAS,EACjC,uBAAuB,IAAI,YAAY,EACvC,uBAAuB,IAAI,YAAY,EACvC,qBAAqB,IAAI,UAAU,EACnC,2BAA2B,IAAI,gBAAgB,EAC/C,sBAAsB,IAAI,WAAW,EACrC,sBAAsB,IAAI,WAAW,GACtC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var z=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},N=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!V.call(e,a)&&a!==r&&m(e,a,{get:()=>t[a],enumerable:!(s=F(t,a))||s.enumerable});return e};var b=(e,t,r)=>(r=e!=null?z(U(e)):{},N(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),G=e=>N(m({},"__esModule",{value:!0}),e);var J={};$(J,{Action:()=>y,Cancel:()=>v,Content:()=>P,Description:()=>C,Root:()=>f,Title:()=>u,Trigger:()=>d});module.exports=G(J);var o=b(require("react")),k=b(require("classnames")),i=require("radix-ui"),B=require("./alert-dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),W=require("./theme.js"),n=require("../helpers/extract-props.js"),c=require("../helpers/require-react-element.js");const f=e=>o.createElement(i.AlertDialog.Root,{...e});f.displayName="AlertDialog.Root";const d=o.forwardRef(({children:e,...t},r)=>o.createElement(i.AlertDialog.Trigger,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));d.displayName="AlertDialog.Trigger";const P=o.forwardRef(({align:e,...t},r)=>{const{align:s,panelBackground:a,material:H,...L}=B.alertDialogContentPropDefs,{className:O}=(0,n.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,n.extractProps)({panelBackground:t.panelBackground},{panelBackground:a}),{material:D}=(0,n.extractProps)({material:t.material},{material:H}),E=o.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:S,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,n.extractProps)(t,L),h=o.useRef(null),q=o.useMemo(()=>l=>{h.current=l,typeof r=="function"?r(l):r&&(r.current=l)},[r]);return o.useEffect(()=>{if(typeof window>"u")return;const l=h.current;if(!l)return;const p=l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const A=p[0],R=p[p.length-1],x=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===A&&(g.preventDefault(),R.focus()):document.activeElement===R&&(g.preventDefault(),A.focus()))};return l.addEventListener("keydown",x),A.focus(),()=>{l.removeEventListener("keydown",x)}},[]),o.createElement(i.AlertDialog.Portal,{container:_,forceMount:K},o.createElement(W.Theme,{asChild:!0},o.createElement(i.AlertDialog.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},o.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},o.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${O}`},o.createElement(i.AlertDialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-AlertDialogContent",S),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description"}),o.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});P.displayName="AlertDialog.Content";const u=o.forwardRef((e,t)=>o.createElement(i.AlertDialog.Title,{asChild:!0},o.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));u.displayName="AlertDialog.Title";const C=o.forwardRef((e,t)=>o.createElement(i.AlertDialog.Description,{asChild:!0},o.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:t})));C.displayName="AlertDialog.Description";const y=o.forwardRef(({children:e,...t},r)=>o.createElement(i.AlertDialog.Action,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));y.displayName="AlertDialog.Action";const v=o.forwardRef(({children:e,...t},r)=>o.createElement(i.AlertDialog.Cancel,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));v.displayName="AlertDialog.Cancel";
1
+ "use strict";var z=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},N=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!V.call(e,a)&&a!==r&&m(e,a,{get:()=>t[a],enumerable:!(s=F(t,a))||s.enumerable});return e};var b=(e,t,r)=>(r=e!=null?z(U(e)):{},N(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),G=e=>N(m({},"__esModule",{value:!0}),e);var J={};$(J,{Action:()=>y,Cancel:()=>v,Content:()=>P,Description:()=>C,Root:()=>f,Title:()=>u,Trigger:()=>d});module.exports=G(J);var o=b(require("react")),k=b(require("classnames")),l=require("radix-ui"),B=require("./alert-dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),W=require("./theme.js"),n=require("../helpers/extract-props.js"),c=require("../helpers/require-react-element.js");const f=e=>o.createElement(l.AlertDialog.Root,{...e});f.displayName="AlertDialog.Root";const d=o.forwardRef(({children:e,...t},r)=>o.createElement(l.AlertDialog.Trigger,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));d.displayName="AlertDialog.Trigger";const P=o.forwardRef(({align:e,...t},r)=>{const{align:s,panelBackground:a,material:H,...L}=B.alertDialogContentPropDefs,{className:O}=(0,n.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,n.extractProps)({panelBackground:t.panelBackground},{panelBackground:a}),{material:D}=(0,n.extractProps)({material:t.material},{material:H}),E=o.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:S,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,n.extractProps)(t,L),h=o.useRef(null),q=o.useMemo(()=>i=>{h.current=i,typeof r=="function"?r(i):r&&(r.current=i)},[r]);return o.useEffect(()=>{if(typeof window>"u")return;const i=h.current;if(!i)return;const p=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const A=p[0],R=p[p.length-1],x=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===A&&(g.preventDefault(),R.focus()):document.activeElement===R&&(g.preventDefault(),A.focus()))};return i.addEventListener("keydown",x),A.focus(),()=>{i.removeEventListener("keydown",x)}},[]),o.createElement(l.AlertDialog.Portal,{container:_,forceMount:K},o.createElement(W.Theme,{asChild:!0},o.createElement(l.AlertDialog.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},o.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},o.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${O}`},o.createElement(l.AlertDialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-AlertDialogContent",S),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description",onCloseAutoFocus:i=>{i.preventDefault(),document.body.style.pointerEvents=""}}),o.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});P.displayName="AlertDialog.Content";const u=o.forwardRef((e,t)=>o.createElement(l.AlertDialog.Title,{asChild:!0},o.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));u.displayName="AlertDialog.Title";const C=o.forwardRef((e,t)=>o.createElement(l.AlertDialog.Description,{asChild:!0},o.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:t})));C.displayName="AlertDialog.Description";const y=o.forwardRef(({children:e,...t},r)=>o.createElement(l.AlertDialog.Action,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));y.displayName="AlertDialog.Action";const v=o.forwardRef(({children:e,...t},r)=>o.createElement(l.AlertDialog.Cancel,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));v.displayName="AlertDialog.Cancel";
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/alert-dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (\n <AlertDialogPrimitive.Root {...props} />\n);\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n ),\n);\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,\n AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = alertDialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <AlertDialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-AlertDialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-AlertDialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${alignClassName}`}\n >\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-AlertDialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-describedby=\"alert-dialog-description\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"alert-dialog-announcement\"\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </Theme>\n </AlertDialogPrimitive.Portal>\n );\n },\n);\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n ),\n);\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n ),\n);\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n ),\n);\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,WAAAC,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAT,GAAA,IAAAU,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAoD,oBAEpDC,EAA2C,mCAC3CC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CAWpC,MAAMZ,EAAmDa,GACvDT,EAAA,cAAC,EAAAU,YAAqB,KAArB,CAA2B,GAAGD,EAAO,EAExCb,EAAgB,YAAc,mBAK9B,MAAME,EAAqBE,EAAM,WAC/B,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,YAAqB,QAArB,CAA8B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAChE,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAb,EAAmB,YAAc,sBAQjC,MAAMJ,EAAqBM,EAAM,WAC/B,CAAC,CAAE,MAAAa,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,6BAEE,CAAE,UAAWC,CAAe,KAAI,gBAAa,CAAE,MAAAL,CAAM,EAAG,CAAE,MAAOC,CAAa,CAAC,EAG/E,CAAE,gBAAiBK,CAAyB,KAAI,gBACpD,CAAE,gBAAiBV,EAAM,eAAgB,EACzC,CAAE,gBAAiBM,CAAuB,CAC5C,EAEM,CAAE,SAAUK,CAAkB,KAAI,gBACtC,CAAE,SAAUX,EAAM,QAAS,EAC3B,CAAE,SAAUO,CAAgB,CAC9B,EAGMK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,CAC/B,CAEJ,EACAlB,EAAkB,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (\n <AlertDialogPrimitive.Root {...props} />\n);\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n ),\n);\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,\n AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = alertDialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <AlertDialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-AlertDialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-AlertDialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${alignClassName}`}\n >\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-AlertDialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-describedby=\"alert-dialog-description\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"alert-dialog-announcement\"\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </Theme>\n </AlertDialogPrimitive.Portal>\n );\n },\n);\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n ),\n);\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n ),\n);\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n ),\n);\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,WAAAC,EAAA,YAAAC,EAAA,gBAAAC,EAAA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,2BACjB,iBAAmBe,GAAU,CAE3BA,EAAM,eAAe,EAErB,SAAS,KAAK,MAAM,cAAgB,EACtC,EACF,EAEApC,EAAA,cAAC,OACC,YAAU,YACV,cAAY,OACZ,UAAU,aACV,GAAG,4BACL,CACF,CACF,CACF,CACF,CACF,CAEJ,CACF,EACAN,EAAmB,YAAc,sBAIjC,MAAMG,EAAmBG,EAAM,WAC7B,CAACS,EAAOG,IACNZ,EAAA,cAAC,EAAAU,YAAqB,MAArB,CAA2B,QAAO,IACjCV,EAAA,cAAC,WAAQ,KAAK,IAAI,GAAG,IAAI,KAAK,QAAS,GAAGS,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtF,CAEJ,EACAf,EAAiB,YAAc,oBAI/B,MAAMF,EAAyBK,EAAM,WAGnC,CAACS,EAAOG,IACRZ,EAAA,cAAC,EAAAU,YAAqB,YAArB,CAAiC,QAAO,IACvCV,EAAA,cAAC,QAAK,GAAG,IAAI,KAAK,IAAK,GAAGS,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtE,CACD,EACDjB,EAAuB,YAAc,0BAKrC,MAAMH,EAAoBQ,EAAM,WAC9B,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,YAAqB,OAArB,CAA6B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC/D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAnB,EAAkB,YAAc,qBAKhC,MAAMC,EAAoBO,EAAM,WAC9B,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,YAAqB,OAArB,CAA6B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC/D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAlB,EAAkB,YAAc",
6
6
  "names": ["alert_dialog_exports", "__export", "AlertDialogAction", "AlertDialogCancel", "AlertDialogContent", "AlertDialogDescription", "AlertDialogRoot", "AlertDialogTitle", "AlertDialogTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_alert_dialog_props", "import_heading", "import_text", "import_theme", "import_extract_props", "import_require_react_element", "props", "AlertDialogPrimitive", "children", "forwardedRef", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "_", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "classNames"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAMjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,eAAgB,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC;CAAG;AAChG,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAwD,CAAC;AAInG,UAAU,kBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC;CAAG;AAChF,QAAA,MAAM,aAAa,8FAMlB,CAAC;AAIF,UAAU,kBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EACzE,qBAAqB;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,WAA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 +1,2 @@
1
- "use strict";var z=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,o)=>{for(var i in o)m(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of I(o))!V.call(e,n)&&n!==i&&m(e,n,{get:()=>o[n],enumerable:!(s=F(o,n))||s.enumerable});return e};var B=(e,o,i)=>(i=e!=null?z(U(e)):{},N(o||!e||!e.__esModule?m(i,"default",{value:e,enumerable:!0}):i,e)),G=e=>N(m({},"__esModule",{value:!0}),e);var J={};$(J,{Close:()=>v,Content:()=>u,Description:()=>y,Root:()=>d,Title:()=>C,Trigger:()=>P});module.exports=G(J);var t=B(require("react")),k=B(require("classnames")),a=require("radix-ui"),b=require("./dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),H=require("./theme.js"),l=require("../helpers/extract-props.js"),f=require("../helpers/require-react-element.js"),W=require("../hooks/use-body-pointer-events-cleanup.js");const d=e=>t.createElement(a.Dialog.Root,{...e,modal:!0});d.displayName="Dialog.Root";const P=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Trigger,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));P.displayName="Dialog.Trigger";const u=t.forwardRef(({align:e,...o},i)=>{const{align:s,panelBackground:n,material:L,...O}=b.dialogContentPropDefs,{className:S}=(0,l.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,l.extractProps)({panelBackground:o.panelBackground},{panelBackground:n}),{material:D}=(0,l.extractProps)({material:o.material},{material:L}),E=t.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:A,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,l.extractProps)(o,O),h=t.useRef(null),q=t.useMemo(()=>r=>{h.current=r,typeof i=="function"?i(r):i&&(i.current=r)},[i]);return(0,W.useBodyPointerEventsCleanup)(),t.useEffect(()=>{if(typeof window>"u")return;const r=h.current;if(!r)return;const p=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const c=p[0],R=p[p.length-1],x=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===c&&(g.preventDefault(),R.focus()):document.activeElement===R&&(g.preventDefault(),c.focus()))};return r.addEventListener("keydown",x),c.focus(),()=>{r.removeEventListener("keydown",x)}},[]),t.createElement(a.Dialog.Portal,{container:_,forceMount:K},t.createElement(H.Theme,{asChild:!0},t.createElement(a.Dialog.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},t.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},t.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${S}`},t.createElement(a.Dialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-DialogContent",A),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"dialog","aria-modal":"true"}),t.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});u.displayName="Dialog.Content";const C=t.forwardRef((e,o)=>t.createElement(a.Dialog.Title,{asChild:!0},t.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:o})));C.displayName="Dialog.Title";const y=t.forwardRef((e,o)=>t.createElement(a.Dialog.Description,{asChild:!0},t.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:o})));y.displayName="Dialog.Description";const v=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Close,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));v.displayName="Dialog.Close";
1
+ "use strict";var z=Object.create;var g=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,o)=>{for(var i in o)g(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of I(o))!V.call(e,n)&&n!==i&&g(e,n,{get:()=>o[n],enumerable:!(s=F(o,n))||s.enumerable});return e};var B=(e,o,i)=>(i=e!=null?z(U(e)):{},N(o||!e||!e.__esModule?g(i,"default",{value:e,enumerable:!0}):i,e)),G=e=>N(g({},"__esModule",{value:!0}),e);var J={};$(J,{Close:()=>v,Content:()=>u,Description:()=>y,Root:()=>d,Title:()=>C,Trigger:()=>P});module.exports=G(J);var t=B(require("react")),k=B(require("classnames")),a=require("radix-ui"),b=require("./dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),H=require("./theme.js"),l=require("../helpers/extract-props.js"),f=require("../helpers/require-react-element.js"),W=require("../hooks/use-body-pointer-events-cleanup.js");const d=e=>t.createElement(a.Dialog.Root,{...e,modal:!0});d.displayName="Dialog.Root";const P=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Trigger,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));P.displayName="Dialog.Trigger";const u=t.forwardRef(({align:e,...o},i)=>{const{align:s,panelBackground:n,material:L,...O}=b.dialogContentPropDefs,{className:S}=(0,l.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,l.extractProps)({panelBackground:o.panelBackground},{panelBackground:n}),{material:D}=(0,l.extractProps)({material:o.material},{material:L}),E=t.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:A,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,l.extractProps)(o,O),h=t.useRef(null),q=t.useMemo(()=>r=>{h.current=r,typeof i=="function"?i(r):i&&(i.current=r)},[i]);return(0,W.useBodyPointerEventsCleanup)(),t.useEffect(()=>{if(typeof window>"u")return;const r=h.current;if(!r)return;const p=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const c=p[0],R=p[p.length-1],x=m=>{m.key==="Tab"&&(m.shiftKey?document.activeElement===c&&(m.preventDefault(),R.focus()):document.activeElement===R&&(m.preventDefault(),c.focus()))};return r.addEventListener("keydown",x),c.focus(),()=>{r.removeEventListener("keydown",x)}},[]),t.createElement(a.Dialog.Portal,{container:_,forceMount:K},t.createElement(H.Theme,{asChild:!0},t.createElement(a.Dialog.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},t.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},t.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${S}`},t.createElement(a.Dialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-DialogContent",A),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"dialog","aria-modal":"true",onCloseAutoFocus:r=>{r.preventDefault(),document.body.style.pointerEvents=""}}),t.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});u.displayName="Dialog.Content";const C=t.forwardRef((e,o)=>t.createElement(a.Dialog.Title,{asChild:!0},t.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:o})));C.displayName="Dialog.Title";const y=t.forwardRef((e,o)=>t.createElement(a.Dialog.Description,{asChild:!0},t.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:o})));y.displayName="Dialog.Description";const v=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Close,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));v.displayName="Dialog.Close";
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBAE1CC,EAAsC,6BACtCC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CACpCC,EAA4C,uDAU5C,MAAMb,EAAyCc,GAAUV,EAAA,cAAC,EAAAW,OAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EAChGd,EAAW,YAAc,cAKzB,MAAME,EAAgBE,EAAM,WAC1B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC3D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAd,EAAc,YAAc,iBAQ5B,MAAMJ,EAAgBM,EAAM,WAC1B,CAAC,CAAE,MAAAc,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,wBAEE,CAAE,UAAWC,CAAe,KAAI,gBAAa,CAAE,MAAAL,CAAM,EAAG,CAAE,MAAOC,CAAa,CAAC,EAG/E,CAAE,gBAAiBK,CAAyB,KAAI,gBACpD,CAAE,gBAAiBV,EAAM,eAAgB,EACzC,CAAE,gBAAiBM,CAAuB,CAC5C,EAEM,CAAE,SAAUK,CAAkB,KAAI,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,cAAC,EAAAW,OAAgB,QAAhB,CAAwB,UAAU,yCACjCX,EAAA,cAAC,OAAI,UAAU,uCACbA,EAAA,cAAC,OACC,UAAW,qDAAqDmB,CAAc,IAE9EnB,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CACE,GAAGiB,EACJ,IAAKE,EACL,aAAW,EAAAQ,SAAW,uBAAwB,mBAAoBf,CAAS,EAC3E,gBAAeD,EACf,wBAAuBA,EACvB,SAAU,GACV,KAAK,SACL,aAAW,OACb,EAEAtB,EAAA,cAAC,OACC,YAAU,SACV,cAAY,OACZ,UAAU,aACV,GAAG,sBACL,CACF,CACF,CACF,CACF,CACF,CAEJ,CACF,EACAN,EAAc,YAAc,iBAI5B,MAAMG,EAAcG,EAAM,WACxB,CAACU,EAAOG,IACNb,EAAA,cAAC,EAAAW,OAAgB,MAAhB,CAAsB,QAAO,IAC5BX,EAAA,cAAC,WAAQ,KAAK,IAAI,GAAG,IAAI,KAAK,QAAS,GAAGU,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtF,CAEJ,EACAhB,EAAY,YAAc,eAI1B,MAAMF,EAAoBK,EAAM,WAC9B,CAACU,EAAOG,IACNb,EAAA,cAAC,EAAAW,OAAgB,YAAhB,CAA4B,QAAO,IAClCX,EAAA,cAAC,QAAK,GAAG,IAAI,KAAK,IAAK,GAAGU,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtE,CAEJ,EACAlB,EAAkB,YAAc,qBAKhC,MAAMF,EAAcO,EAAM,WACxB,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OACzD,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAnB,EAAY,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBAE1CC,EAAsC,6BACtCC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CACpCC,EAA4C,uDAU5C,MAAMb,EAAyCc,GAAUV,EAAA,cAAC,EAAAW,OAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EAChGd,EAAW,YAAc,cAKzB,MAAME,EAAgBE,EAAM,WAC1B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC3D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAd,EAAc,YAAc,iBAQ5B,MAAMJ,EAAgBM,EAAM,WAC1B,CAAC,CAAE,MAAAc,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,wBAEE,CAAE,UAAWC,CAAe,KAAI,gBAAa,CAAE,MAAAL,CAAM,EAAG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cAAC,EAAAW,OAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OACzD,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAnB,EAAY,YAAc",
6
6
  "names": ["dialog_exports", "__export", "DialogClose", "DialogContent", "DialogDescription", "DialogRoot", "DialogTitle", "DialogTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_dialog_props", "import_heading", "import_text", "import_theme", "import_extract_props", "import_require_react_element", "import_use_body_pointer_events_cleanup", "props", "DialogPrimitive", "children", "forwardedRef", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "_", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "classNames"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,oBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC;CAAG;AAC7E,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAEnD,CAAC;AAIF,UAAU,uBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,OAAO,EAAE,YAAY,CAAC;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sBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;CAAG;AACpF,QAAA,MAAM,iBAAiB,kGAMtB,CAAC;AAIF,UAAU,sBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;CAAG;AACpF,QAAA,MAAM,iBAAiB,kGAMtB,CAAC;AAGF,OAAO,EACL,eAAe,IAAI,IAAI,EACvB,kBAAkB,IAAI,OAAO,EAC7B,kBAAkB,IAAI,OAAO,EAC7B,gBAAgB,IAAI,KAAK,EACzB,sBAAsB,IAAI,WAAW,EACrC,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,IAAI,MAAM,GAC5B,CAAC;AAEF,YAAY,EACV,oBAAoB,IAAI,SAAS,EACjC,uBAAuB,IAAI,YAAY,EACvC,uBAAuB,IAAI,YAAY,EACvC,qBAAqB,IAAI,UAAU,EACnC,2BAA2B,IAAI,gBAAgB,EAC/C,sBAAsB,IAAI,WAAW,EACrC,sBAAsB,IAAI,WAAW,GACtC,CAAC"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import H from"classnames";import{AlertDialog as i}from"radix-ui";import{alertDialogContentPropDefs as L}from"./alert-dialog.props.js";import{Heading as O}from"./heading.js";import{Text as S}from"./text.js";import{Theme as K}from"./theme.js";import{extractProps as s}from"../helpers/extract-props.js";import{requireReactElement as m}from"../helpers/require-react-element.js";const P=t=>e.createElement(i.Root,{...t});P.displayName="AlertDialog.Root";const u=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Trigger,{...o,ref:r,asChild:!0},m(t)));u.displayName="AlertDialog.Trigger";const C=e.forwardRef(({align:t,...o},r)=>{const{align:h,panelBackground:R,material:x,...N}=L,{className:b}=s({align:t},{align:h}),{panelBackground:c}=s({panelBackground:o.panelBackground},{panelBackground:R}),{material:p}=s({material:o.material},{material:x}),D=e.useMemo(()=>(p!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),p??c),[p,c]),{className:k,forceMount:B,container:w,panelBackground:_,material:j,...M}=s(o,N),A=e.useRef(null),W=e.useMemo(()=>l=>{A.current=l,typeof r=="function"?r(l):r&&(r.current=l)},[r]);return e.useEffect(()=>{if(typeof window>"u")return;const l=A.current;if(!l)return;const a=l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length===0)return;const g=a[0],f=a[a.length-1],d=n=>{n.key==="Tab"&&(n.shiftKey?document.activeElement===g&&(n.preventDefault(),f.focus()):document.activeElement===f&&(n.preventDefault(),g.focus()))};return l.addEventListener("keydown",d),g.focus(),()=>{l.removeEventListener("keydown",d)}},[]),e.createElement(i.Portal,{container:w,forceMount:B},e.createElement(K,{asChild:!0},e.createElement(i.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},e.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},e.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${b}`},e.createElement(i.Content,{...M,ref:W,className:H("rt-BaseDialogContent","rt-AlertDialogContent",k),"data-material":D,"data-panel-background":D,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description"}),e.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});C.displayName="AlertDialog.Content";const y=e.forwardRef((t,o)=>e.createElement(i.Title,{asChild:!0},e.createElement(O,{size:"5",mb:"3",trim:"start",...t,asChild:!1,ref:o})));y.displayName="AlertDialog.Title";const v=e.forwardRef((t,o)=>e.createElement(i.Description,{asChild:!0},e.createElement(S,{as:"p",size:"3",...t,asChild:!1,ref:o})));v.displayName="AlertDialog.Description";const T=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Action,{...o,ref:r,asChild:!0},m(t)));T.displayName="AlertDialog.Action";const E=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Cancel,{...o,ref:r,asChild:!0},m(t)));E.displayName="AlertDialog.Cancel";export{T as Action,E as Cancel,C as Content,v as Description,P as Root,y as Title,u as Trigger};
1
+ import*as e from"react";import H from"classnames";import{AlertDialog as l}from"radix-ui";import{alertDialogContentPropDefs as L}from"./alert-dialog.props.js";import{Heading as O}from"./heading.js";import{Text as S}from"./text.js";import{Theme as K}from"./theme.js";import{extractProps as s}from"../helpers/extract-props.js";import{requireReactElement as m}from"../helpers/require-react-element.js";const P=t=>e.createElement(l.Root,{...t});P.displayName="AlertDialog.Root";const u=e.forwardRef(({children:t,...o},r)=>e.createElement(l.Trigger,{...o,ref:r,asChild:!0},m(t)));u.displayName="AlertDialog.Trigger";const C=e.forwardRef(({align:t,...o},r)=>{const{align:h,panelBackground:R,material:x,...N}=L,{className:b}=s({align:t},{align:h}),{panelBackground:c}=s({panelBackground:o.panelBackground},{panelBackground:R}),{material:p}=s({material:o.material},{material:x}),D=e.useMemo(()=>(p!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),p??c),[p,c]),{className:k,forceMount:B,container:w,panelBackground:_,material:j,...M}=s(o,N),A=e.useRef(null),W=e.useMemo(()=>i=>{A.current=i,typeof r=="function"?r(i):r&&(r.current=i)},[r]);return e.useEffect(()=>{if(typeof window>"u")return;const i=A.current;if(!i)return;const a=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length===0)return;const g=a[0],f=a[a.length-1],d=n=>{n.key==="Tab"&&(n.shiftKey?document.activeElement===g&&(n.preventDefault(),f.focus()):document.activeElement===f&&(n.preventDefault(),g.focus()))};return i.addEventListener("keydown",d),g.focus(),()=>{i.removeEventListener("keydown",d)}},[]),e.createElement(l.Portal,{container:w,forceMount:B},e.createElement(K,{asChild:!0},e.createElement(l.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},e.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},e.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${b}`},e.createElement(l.Content,{...M,ref:W,className:H("rt-BaseDialogContent","rt-AlertDialogContent",k),"data-material":D,"data-panel-background":D,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description",onCloseAutoFocus:i=>{i.preventDefault(),document.body.style.pointerEvents=""}}),e.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});C.displayName="AlertDialog.Content";const y=e.forwardRef((t,o)=>e.createElement(l.Title,{asChild:!0},e.createElement(O,{size:"5",mb:"3",trim:"start",...t,asChild:!1,ref:o})));y.displayName="AlertDialog.Title";const v=e.forwardRef((t,o)=>e.createElement(l.Description,{asChild:!0},e.createElement(S,{as:"p",size:"3",...t,asChild:!1,ref:o})));v.displayName="AlertDialog.Description";const T=e.forwardRef(({children:t,...o},r)=>e.createElement(l.Action,{...o,ref:r,asChild:!0},m(t)));T.displayName="AlertDialog.Action";const E=e.forwardRef(({children:t,...o},r)=>e.createElement(l.Cancel,{...o,ref:r,asChild:!0},m(t)));E.displayName="AlertDialog.Cancel";export{T as Action,E as Cancel,C as Content,v as Description,P as Root,y as Title,u as Trigger};
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/alert-dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (\n <AlertDialogPrimitive.Root {...props} />\n);\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n ),\n);\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,\n AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = alertDialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <AlertDialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-AlertDialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-AlertDialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${alignClassName}`}\n >\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-AlertDialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-describedby=\"alert-dialog-description\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"alert-dialog-announcement\"\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </Theme>\n </AlertDialogPrimitive.Portal>\n );\n },\n);\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n ),\n);\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n ),\n);\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n ),\n);\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n"],
5
- "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,eAAeC,MAA4B,WAEpD,OAAS,8BAAAC,MAAkC,0BAC3C,OAAS,WAAAC,MAAe,eACxB,OAAS,QAAAC,MAAY,YACrB,OAAS,SAAAC,MAAa,aACtB,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,uBAAAC,MAA2B,sCAWpC,MAAMC,EAAmDC,GACvDV,EAAA,cAACE,EAAqB,KAArB,CAA2B,GAAGQ,EAAO,EAExCD,EAAgB,YAAc,mBAK9B,MAAME,EAAqBX,EAAM,WAC/B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAACE,EAAqB,QAArB,CAA8B,GAAGQ,EAAO,IAAKG,EAAc,QAAO,IAChEL,EAAoBI,CAAQ,CAC/B,CAEJ,EACAD,EAAmB,YAAc,sBAQjC,MAAMG,EAAqBd,EAAM,WAC/B,CAAC,CAAE,MAAAe,EAAO,GAAGL,CAAM,EAAGG,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CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAACE,EAAqB,OAArB,CAA6B,GAAGQ,EAAO,IAAKG,EAAc,QAAO,IAC/DL,EAAoBI,CAAQ,CAC/B,CAEJ,EACA4B,EAAkB,YAAc,qBAKhC,MAAMC,EAAoBzC,EAAM,WAC9B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAACE,EAAqB,OAArB,CAA6B,GAAGQ,EAAO,IAAKG,EAAc,QAAO,IAC/DL,EAAoBI,CAAQ,CAC/B,CAEJ,EACA6B,EAAkB,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (\n <AlertDialogPrimitive.Root {...props} />\n);\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n ),\n);\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,\n AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = alertDialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <AlertDialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-AlertDialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-AlertDialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${alignClassName}`}\n >\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-AlertDialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-describedby=\"alert-dialog-description\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"alert-dialog-announcement\"\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </Theme>\n </AlertDialogPrimitive.Portal>\n );\n },\n);\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n ),\n);\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n ),\n);\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n ),\n);\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n"],
5
+ "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,eAAeC,MAA4B,WAEpD,OAAS,8BAAAC,MAAkC,0BAC3C,OAAS,WAAAC,MAAe,eACxB,OAAS,QAAAC,MAAY,YACrB,OAAS,SAAAC,MAAa,aACtB,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,uBAAAC,MAA2B,sCAWpC,MAAMC,EAAmDC,GACvDV,EAAA,cAACE,EAAqB,KAArB,CAA2B,GAAGQ,EAAO,EAExCD,EAAgB,YAAc,mBAK9B,MAAME,EAAqBX,EAAM,WAC/B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAACE,EAAqB,QAArB,CAA8B,GAAGQ,EAAO,IAAKG,EAAc,QAAO,IAChEL,EAAoBI,CAAQ,CAC/B,CAEJ,EACAD,EAAmB,YAAc,sBAQjC,MAAMG,EAAqBd,EAAM,WAC/B,CAAC,CAAE,MAAAe,EAAO,GAAGL,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOG,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAIhB,EAEE,CAAE,UAAWiB,CAAe,EAAIb,EAAa,CAAE,MAAAQ,CAAM,EAAG,CAAE,MAAOC,CAAa,CAAC,EAG/E,CAAE,gBAAiBK,CAAyB,EAAId,EACpD,CAAE,gBAAiBG,EAAM,eAAgB,EACzC,CAAE,gBAAiBO,CAAuB,CAC5C,EAEM,CAAE,SAAUK,CAAkB,EAAIf,EACtC,CAAE,SAAUG,EAAM,QA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,EAAA,cAACE,EAAqB,OAArB,CAA6B,GAAGQ,EAAO,IAAKG,EAAc,QAAO,IAC/DL,EAAoBI,CAAQ,CAC/B,CAEJ,EACA6B,EAAkB,YAAc",
6
6
  "names": ["React", "classNames", "AlertDialogPrimitive", "alertDialogContentPropDefs", "Heading", "Text", "Theme", "extractProps", "requireReactElement", "AlertDialogRoot", "props", "AlertDialogTrigger", "children", "forwardedRef", "AlertDialogContent", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "AlertDialogTitle", "AlertDialogDescription", "AlertDialogAction", "AlertDialogCancel"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAMjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,eAAgB,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC;CAAG;AAChG,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAwD,CAAC;AAInG,UAAU,kBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC;CAAG;AAChF,QAAA,MAAM,aAAa,8FAMlB,CAAC;AA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ACV,eAAe,IAAI,SAAS,EAC5B,kBAAkB,IAAI,YAAY,EAClC,kBAAkB,IAAI,YAAY,EAClC,gBAAgB,IAAI,UAAU,EAC9B,sBAAsB,IAAI,gBAAgB,EAC1C,gBAAgB,IAAI,UAAU,GAC/B,CAAC"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import W from"classnames";import{Dialog as r}from"radix-ui";import{dialogContentPropDefs as L}from"./dialog.props.js";import{Heading as O}from"./heading.js";import{Text as S}from"./text.js";import{Theme as A}from"./theme.js";import{extractProps as s}from"../helpers/extract-props.js";import{requireReactElement as P}from"../helpers/require-react-element.js";import{useBodyPointerEventsCleanup as K}from"../hooks/use-body-pointer-events-cleanup.js";const u=o=>e.createElement(r.Root,{...o,modal:!0});u.displayName="Dialog.Root";const C=e.forwardRef(({children:o,...t},i)=>e.createElement(r.Trigger,{...t,ref:i,asChild:!0},P(o)));C.displayName="Dialog.Trigger";const y=e.forwardRef(({align:o,...t},i)=>{const{align:h,panelBackground:R,material:x,...N}=L,{className:B}=s({align:o},{align:h}),{panelBackground:m}=s({panelBackground:t.panelBackground},{panelBackground:R}),{material:p}=s({material:t.material},{material:x}),D=e.useMemo(()=>(p!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),p??m),[p,m]),{className:k,forceMount:b,container:w,panelBackground:_,material:j,...M}=s(t,N),c=e.useRef(null),H=e.useMemo(()=>a=>{c.current=a,typeof i=="function"?i(a):i&&(i.current=a)},[i]);return K(),e.useEffect(()=>{if(typeof window>"u")return;const a=c.current;if(!a)return;const n=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(n.length===0)return;const g=n[0],f=n[n.length-1],d=l=>{l.key==="Tab"&&(l.shiftKey?document.activeElement===g&&(l.preventDefault(),f.focus()):document.activeElement===f&&(l.preventDefault(),g.focus()))};return a.addEventListener("keydown",d),g.focus(),()=>{a.removeEventListener("keydown",d)}},[]),e.createElement(r.Portal,{container:w,forceMount:b},e.createElement(A,{asChild:!0},e.createElement(r.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},e.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},e.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${B}`},e.createElement(r.Content,{...M,ref:H,className:W("rt-BaseDialogContent","rt-DialogContent",k),"data-material":D,"data-panel-background":D,tabIndex:-1,role:"dialog","aria-modal":"true"}),e.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});y.displayName="Dialog.Content";const v=e.forwardRef((o,t)=>e.createElement(r.Title,{asChild:!0},e.createElement(O,{size:"5",mb:"3",trim:"start",...o,asChild:!1,ref:t})));v.displayName="Dialog.Title";const T=e.forwardRef((o,t)=>e.createElement(r.Description,{asChild:!0},e.createElement(S,{as:"p",size:"3",...o,asChild:!1,ref:t})));T.displayName="Dialog.Description";const E=e.forwardRef(({children:o,...t},i)=>e.createElement(r.Close,{...t,ref:i,asChild:!0},P(o)));E.displayName="Dialog.Close";export{E as Close,y as Content,T as Description,u as Root,v as Title,C as Trigger};
1
+ import*as e from"react";import W from"classnames";import{Dialog as a}from"radix-ui";import{dialogContentPropDefs as L}from"./dialog.props.js";import{Heading as O}from"./heading.js";import{Text as S}from"./text.js";import{Theme as A}from"./theme.js";import{extractProps as s}from"../helpers/extract-props.js";import{requireReactElement as P}from"../helpers/require-react-element.js";import{useBodyPointerEventsCleanup as K}from"../hooks/use-body-pointer-events-cleanup.js";const u=o=>e.createElement(a.Root,{...o,modal:!0});u.displayName="Dialog.Root";const C=e.forwardRef(({children:o,...t},r)=>e.createElement(a.Trigger,{...t,ref:r,asChild:!0},P(o)));C.displayName="Dialog.Trigger";const y=e.forwardRef(({align:o,...t},r)=>{const{align:h,panelBackground:R,material:x,...N}=L,{className:B}=s({align:o},{align:h}),{panelBackground:g}=s({panelBackground:t.panelBackground},{panelBackground:R}),{material:p}=s({material:t.material},{material:x}),D=e.useMemo(()=>(p!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),p??g),[p,g]),{className:k,forceMount:b,container:w,panelBackground:_,material:j,...M}=s(t,N),c=e.useRef(null),H=e.useMemo(()=>i=>{c.current=i,typeof r=="function"?r(i):r&&(r.current=i)},[r]);return K(),e.useEffect(()=>{if(typeof window>"u")return;const i=c.current;if(!i)return;const n=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(n.length===0)return;const m=n[0],f=n[n.length-1],d=l=>{l.key==="Tab"&&(l.shiftKey?document.activeElement===m&&(l.preventDefault(),f.focus()):document.activeElement===f&&(l.preventDefault(),m.focus()))};return i.addEventListener("keydown",d),m.focus(),()=>{i.removeEventListener("keydown",d)}},[]),e.createElement(a.Portal,{container:w,forceMount:b},e.createElement(A,{asChild:!0},e.createElement(a.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},e.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},e.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${B}`},e.createElement(a.Content,{...M,ref:H,className:W("rt-BaseDialogContent","rt-DialogContent",k),"data-material":D,"data-panel-background":D,tabIndex:-1,role:"dialog","aria-modal":"true",onCloseAutoFocus:i=>{i.preventDefault(),document.body.style.pointerEvents=""}}),e.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});y.displayName="Dialog.Content";const v=e.forwardRef((o,t)=>e.createElement(a.Title,{asChild:!0},e.createElement(O,{size:"5",mb:"3",trim:"start",...o,asChild:!1,ref:t})));v.displayName="Dialog.Title";const T=e.forwardRef((o,t)=>e.createElement(a.Description,{asChild:!0},e.createElement(S,{as:"p",size:"3",...o,asChild:!1,ref:t})));T.displayName="Dialog.Description";const E=e.forwardRef(({children:o,...t},r)=>e.createElement(a.Close,{...t,ref:r,asChild:!0},P(o)));E.displayName="Dialog.Close";export{E as Close,y as Content,T as Description,u as Root,v as Title,C as Trigger};
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
- "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAE1C,OAAS,yBAAAC,MAA6B,oBACtC,OAAS,WAAAC,MAAe,eACxB,OAAS,QAAAC,MAAY,YACrB,OAAS,SAAAC,MAAa,aACtB,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,uBAAAC,MAA2B,sCACpC,OAAS,+BAAAC,MAAmC,8CAU5C,MAAMC,EAAyCC,GAAUX,EAAA,cAACE,EAAgB,KAAhB,CAAsB,GAAGS,EAAO,MAAK,GAAC,EAChGD,EAAW,YAAc,cAKzB,MAAME,EAAgBZ,EAAM,WAC1B,CAAC,CAAE,SAAAa,EAAU,GAAGF,CAAM,EAAGG,IACvBd,EAAA,cAACE,EAAgB,QAAhB,CAAyB,GAAGS,EAAO,IAAKG,EAAc,QAAO,IAC3DN,EAAoBK,CAAQ,CAC/B,CAEJ,EACAD,EAAc,YAAc,iBAQ5B,MAAMG,EAAgBf,EAAM,WAC1B,CAAC,CAAE,MAAAgB,EAAO,GAAGL,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOG,EACP,gBAAiBC,EACjB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EAAA,cAACE,EAAgB,MAAhB,CAAuB,GAAGS,EAAO,IAAKG,EAAc,QAAO,IACzDN,EAAoBK,CAAQ,CAC/B,CAEJ,EACA4B,EAAY,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
+ "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAE1C,OAAS,yBAAAC,MAA6B,oBACtC,OAAS,WAAAC,MAAe,eACxB,OAAS,QAAAC,MAAY,YACrB,OAAS,SAAAC,MAAa,aACtB,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,uBAAAC,MAA2B,sCACpC,OAAS,+BAAAC,MAAmC,8CAU5C,MAAMC,EAAyCC,GAAUX,EAAA,cAACE,EAAgB,KAAhB,CAAsB,GAAGS,EAAO,MAAK,GAAC,EAChGD,EAAW,YAAc,cAKzB,MAAME,EAAgBZ,EAAM,WAC1B,CAAC,CAAE,SAAAa,EAAU,GAAGF,CAAM,EAAGG,IACvBd,EAAA,cAACE,EAAgB,QAAhB,CAAyB,GAAGS,EAAO,IAAKG,EAAc,QAAO,IAC3DN,EAAoBK,CAAQ,CAC/B,CAEJ,EACAD,EAAc,YAAc,iBAQ5B,MAAMG,EAAgBf,EAAM,WAC1B,CAAC,C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AK,IAAK,GAAGM,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtE,CAEJ,EACA0B,EAAkB,YAAc,qBAKhC,MAAMC,EAAczC,EAAM,WACxB,CAAC,CAAE,SAAAa,EAAU,GAAGF,CAAM,EAAGG,IACvBd,EAAA,cAACE,EAAgB,MAAhB,CAAuB,GAAGS,EAAO,IAAKG,EAAc,QAAO,IACzDN,EAAoBK,CAAQ,CAC/B,CAEJ,EACA4B,EAAY,YAAc",
6
6
  "names": ["React", "classNames", "DialogPrimitive", "dialogContentPropDefs", "Heading", "Text", "Theme", "extractProps", "requireReactElement", "useBodyPointerEventsCleanup", "DialogRoot", "props", "DialogTrigger", "children", "forwardedRef", "DialogContent", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "DialogTitle", "DialogDescription", "DialogClose"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushagradhawan/kookie-ui",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "description": "A modern React component library with beautiful design tokens, flexible theming, and comprehensive docs",
5
5
  "keywords": [
6
6
  "react",
@@ -279,6 +279,6 @@
279
279
  "title": "Base-button Component Props",
280
280
  "description": "Props schema for the base-button component in Kookie UI",
281
281
  "version": "1.0.0",
282
- "generatedAt": "2025-09-10T16:59:14.159Z",
282
+ "generatedAt": "2025-09-10T17:52:54.984Z",
283
283
  "source": "Zod schema"
284
284
  }
@@ -530,6 +530,6 @@
530
530
  "title": "Button Component Props",
531
531
  "description": "Props schema for the button component in Kookie UI",
532
532
  "version": "1.0.0",
533
- "generatedAt": "2025-09-10T16:59:14.164Z",
533
+ "generatedAt": "2025-09-10T17:52:54.989Z",
534
534
  "source": "Zod schema"
535
535
  }
@@ -313,6 +313,6 @@
313
313
  "title": "Icon-button Component Props",
314
314
  "description": "Props schema for the icon-button component in Kookie UI",
315
315
  "version": "1.0.0",
316
- "generatedAt": "2025-09-10T16:59:14.185Z",
316
+ "generatedAt": "2025-09-10T17:52:54.991Z",
317
317
  "source": "Zod schema"
318
318
  }
@@ -3,7 +3,7 @@
3
3
  "title": "Kookie UI Button Components",
4
4
  "description": "Complete JSON Schema collection for all button components in Kookie UI",
5
5
  "version": "1.0.0",
6
- "generatedAt": "2025-09-10T16:59:14.189Z",
6
+ "generatedAt": "2025-09-10T17:52:54.994Z",
7
7
  "source": "Zod schemas",
8
8
  "components": {
9
9
  "base-button": {
@@ -287,7 +287,7 @@
287
287
  "title": "Base-button Component Props",
288
288
  "description": "Props schema for the base-button component in Kookie UI",
289
289
  "version": "1.0.0",
290
- "generatedAt": "2025-09-10T16:59:14.159Z",
290
+ "generatedAt": "2025-09-10T17:52:54.984Z",
291
291
  "source": "Zod schema"
292
292
  },
293
293
  "button": {
@@ -822,7 +822,7 @@
822
822
  "title": "Button Component Props",
823
823
  "description": "Props schema for the button component in Kookie UI",
824
824
  "version": "1.0.0",
825
- "generatedAt": "2025-09-10T16:59:14.164Z",
825
+ "generatedAt": "2025-09-10T17:52:54.989Z",
826
826
  "source": "Zod schema"
827
827
  },
828
828
  "icon-button": {
@@ -1140,7 +1140,7 @@
1140
1140
  "title": "Icon-button Component Props",
1141
1141
  "description": "Props schema for the icon-button component in Kookie UI",
1142
1142
  "version": "1.0.0",
1143
- "generatedAt": "2025-09-10T16:59:14.185Z",
1143
+ "generatedAt": "2025-09-10T17:52:54.991Z",
1144
1144
  "source": "Zod schema"
1145
1145
  },
1146
1146
  "toggle-button": {
@@ -1683,7 +1683,7 @@
1683
1683
  "title": "Toggle-button Component Props",
1684
1684
  "description": "Props schema for the toggle-button component in Kookie UI",
1685
1685
  "version": "1.0.0",
1686
- "generatedAt": "2025-09-10T16:59:14.187Z",
1686
+ "generatedAt": "2025-09-10T17:52:54.993Z",
1687
1687
  "source": "Zod schema"
1688
1688
  },
1689
1689
  "toggle-icon-button": {
@@ -2009,7 +2009,7 @@
2009
2009
  "title": "Toggle-icon-button Component Props",
2010
2010
  "description": "Props schema for the toggle-icon-button component in Kookie UI",
2011
2011
  "version": "1.0.0",
2012
- "generatedAt": "2025-09-10T16:59:14.188Z",
2012
+ "generatedAt": "2025-09-10T17:52:54.994Z",
2013
2013
  "source": "Zod schema"
2014
2014
  }
2015
2015
  }
@@ -538,6 +538,6 @@
538
538
  "title": "Toggle-button Component Props",
539
539
  "description": "Props schema for the toggle-button component in Kookie UI",
540
540
  "version": "1.0.0",
541
- "generatedAt": "2025-09-10T16:59:14.187Z",
541
+ "generatedAt": "2025-09-10T17:52:54.993Z",
542
542
  "source": "Zod schema"
543
543
  }
@@ -321,6 +321,6 @@
321
321
  "title": "Toggle-icon-button Component Props",
322
322
  "description": "Props schema for the toggle-icon-button component in Kookie UI",
323
323
  "version": "1.0.0",
324
- "generatedAt": "2025-09-10T16:59:14.188Z",
324
+ "generatedAt": "2025-09-10T17:52:54.994Z",
325
325
  "source": "Zod schema"
326
326
  }
@@ -157,6 +157,12 @@ const AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDial
157
157
  role="alertdialog"
158
158
  aria-modal="true"
159
159
  aria-describedby="alert-dialog-description"
160
+ onCloseAutoFocus={(event) => {
161
+ // Prevent default focus behavior
162
+ event.preventDefault();
163
+ // Restore pointer-events to body (Radix UI fix for issue #1241)
164
+ document.body.style.pointerEvents = '';
165
+ }}
160
166
  />
161
167
  {/* ARIA live region for screen reader announcements */}
162
168
  <div
@@ -157,6 +157,12 @@ const DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>
157
157
  tabIndex={-1}
158
158
  role="dialog"
159
159
  aria-modal="true"
160
+ onCloseAutoFocus={(event) => {
161
+ // Prevent default focus behavior
162
+ event.preventDefault();
163
+ // Restore pointer-events to body (Radix UI fix for issue #1241)
164
+ document.body.style.pointerEvents = '';
165
+ }}
160
166
  />
161
167
  {/* ARIA live region for screen reader announcements */}
162
168
  <div