themelia-react-ui 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +17 -7
  2. package/README.md +9 -13
  3. package/THIRD_PARTY_NOTICES.md +6 -12
  4. package/dist/{auth-ax2BqjrI.js → auth-BGua8ouh.js} +2 -2
  5. package/dist/{auth-ax2BqjrI.js.map → auth-BGua8ouh.js.map} +1 -1
  6. package/dist/base/cascader.js +1 -1
  7. package/dist/base/combobox.js +2 -2
  8. package/dist/base/date-pickers.js +2 -2
  9. package/dist/base/popover-menu.js +1 -1
  10. package/dist/base/popover.js +1 -1
  11. package/dist/base/sheet.js +1 -1
  12. package/dist/base/sidebar.js +1 -1
  13. package/dist/base/value-inputs.js +1 -1
  14. package/dist/blocks/commerce.js +1 -1
  15. package/dist/{combobox-xCQ2RMNE.js → combobox-DaHESuiL.js} +154 -108
  16. package/dist/combobox-DaHESuiL.js.map +1 -0
  17. package/dist/{combobox-C0EQW6dr.js → combobox-Dxo2fAYQ.js} +342 -340
  18. package/dist/combobox-Dxo2fAYQ.js.map +1 -0
  19. package/dist/{comments-BYYlTA8E.js → comments-DD0DUPwJ.js} +4 -4
  20. package/dist/{comments-BYYlTA8E.js.map → comments-DD0DUPwJ.js.map} +1 -1
  21. package/dist/components/base/combobox/combobox-field.d.ts +16 -0
  22. package/dist/components/ui/combobox-dismiss.d.ts +16 -0
  23. package/dist/components/ui/combobox.d.ts +11 -6
  24. package/dist/components/ui/dialog.d.ts +1 -1
  25. package/dist/components/ui/popover.d.ts +1 -1
  26. package/dist/components/ui/sheet.d.ts +1 -1
  27. package/dist/{date-picker-ay0Pha_a.js → date-picker-B2K3ucWn.js} +2 -2
  28. package/dist/{date-picker-ay0Pha_a.js.map → date-picker-B2K3ucWn.js.map} +1 -1
  29. package/dist/{date-pickers-Ccw8DL2b.js → date-pickers-Ds8gLaoP.js} +3 -3
  30. package/dist/{date-pickers-Ccw8DL2b.js.map → date-pickers-Ds8gLaoP.js.map} +1 -1
  31. package/dist/features/activities.js +2 -2
  32. package/dist/features/async-preview.js +1 -1
  33. package/dist/features/combobox.js +1 -1
  34. package/dist/features/comments.js +1 -1
  35. package/dist/features/data-view.js +2 -2
  36. package/dist/features/email-composer.js +2 -2
  37. package/dist/features/event-calendar.js +1 -1
  38. package/dist/features/filters.js +1 -1
  39. package/dist/features/global-search.js +1 -1
  40. package/dist/features/map.js +1 -1
  41. package/dist/features/media-library.js +1 -1
  42. package/dist/features/mentions.js +1 -1
  43. package/dist/features/overlays.js +1 -1
  44. package/dist/features/products.js +1 -1
  45. package/dist/features/resource-assignment.js +1 -1
  46. package/dist/features/schema-form.js +1 -1
  47. package/dist/features/suggestions.js +1 -1
  48. package/dist/features/theme-tweaker.js +2 -2
  49. package/dist/{filters-BGfvjP4d.js → filters-DJVAveHA.js} +4 -4
  50. package/dist/{filters-BGfvjP4d.js.map → filters-DJVAveHA.js.map} +1 -1
  51. package/dist/{header-CGXuhcRm.js → header-BSfIEWbI.js} +4 -4
  52. package/dist/{header-CGXuhcRm.js.map → header-BSfIEWbI.js.map} +1 -1
  53. package/dist/{hooks-Dkz0K2WT.js → hooks-ClH9thn4.js} +2 -2
  54. package/dist/{hooks-Dkz0K2WT.js.map → hooks-ClH9thn4.js.map} +1 -1
  55. package/dist/layout/auth.js +1 -1
  56. package/dist/layout/header.js +1 -1
  57. package/dist/layout/hooks.js +1 -1
  58. package/dist/layout/page.js +1 -1
  59. package/dist/layout/sidebar.js +2 -2
  60. package/dist/layout/workspace.js +1 -1
  61. package/dist/layout.js +6 -6
  62. package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
  63. package/dist/{mentions-utuUvH1K.js → mentions-CGlEJ15c.js} +2 -2
  64. package/dist/{mentions-utuUvH1K.js.map → mentions-CGlEJ15c.js.map} +1 -1
  65. package/dist/{overlays-DNWmZrJ4.js → overlays-tMkF-VAN.js} +270 -268
  66. package/dist/overlays-tMkF-VAN.js.map +1 -0
  67. package/dist/{page-Bgl1F560.js → page-CL9YeH_V.js} +2 -2
  68. package/dist/{page-Bgl1F560.js.map → page-CL9YeH_V.js.map} +1 -1
  69. package/dist/{popover-7_m66eYW.js → popover-gnTOhbFM.js} +62 -60
  70. package/dist/popover-gnTOhbFM.js.map +1 -0
  71. package/dist/{popover-menu-B9WWygpa.js → popover-menu-Cn9rUkdc.js} +2 -2
  72. package/dist/{popover-menu-B9WWygpa.js.map → popover-menu-Cn9rUkdc.js.map} +1 -1
  73. package/dist/services/actions.js +1 -1
  74. package/dist/{sheet-CGpB3omz.js → sheet-ijlsjq-n.js} +70 -68
  75. package/dist/sheet-ijlsjq-n.js.map +1 -0
  76. package/dist/{sidebar-CPx_7YBa.js → sidebar-Db6gkh3U.js} +2 -2
  77. package/dist/{sidebar-CPx_7YBa.js.map → sidebar-Db6gkh3U.js.map} +1 -1
  78. package/dist/{sidebar-A0ElHINE.js → sidebar-DkTO4VTO.js} +3 -3
  79. package/dist/{sidebar-A0ElHINE.js.map → sidebar-DkTO4VTO.js.map} +1 -1
  80. package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
  81. package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
  82. package/dist/{value-inputs-DXPDjvBU.js → value-inputs-TaX4OjNk.js} +3 -3
  83. package/dist/{value-inputs-DXPDjvBU.js.map → value-inputs-TaX4OjNk.js.map} +1 -1
  84. package/dist/{workspace-Cdrg7k9f.js → workspace-B-OEm3Kf.js} +2 -2
  85. package/dist/{workspace-Cdrg7k9f.js.map → workspace-B-OEm3Kf.js.map} +1 -1
  86. package/docs/consumer-skill/SKILL.md +1 -1
  87. package/docs/consumer-skill/references/agents-md.md +1 -1
  88. package/docs/consumer-skill/references/installation.md +6 -0
  89. package/docs/consumer-skill/references/public-api.json +2 -2
  90. package/docs/consumer-skill/references/tokens.json +1 -1
  91. package/docs/consumer-skill/references/workflows.md +5 -4
  92. package/package.json +3 -3
  93. package/dist/combobox-C0EQW6dr.js.map +0 -1
  94. package/dist/combobox-xCQ2RMNE.js.map +0 -1
  95. package/dist/overlays-DNWmZrJ4.js.map +0 -1
  96. package/dist/popover-7_m66eYW.js.map +0 -1
  97. package/dist/sheet-CGpB3omz.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"overlays-DNWmZrJ4.js","names":["Dialog","DialogPrimitive","DialogTrigger","DialogClose","DialogContent","Button","DialogHeader","DialogFooter","DialogTitle","DialogDescription","isSimpleText","titleTypography","Dialog","DialogPrimitive","React","DialogTriggerPrimitive","DialogClosePrimitive","DialogContentPrimitive","DialogHeaderPrimitive","DialogFooterPrimitive","DialogTitlePrimitive","DialogDescriptionPrimitive","BaseDialog","AlertDialog","AlertDialogPrimitive","AlertDialogTrigger","AlertDialogContent","AlertDialogFooter","AlertDialogMedia","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","Button","AlertDialogCancel","AlertDialog","AlertDialogPrimitive","React","AlertDialogTriggerPrimitive","AlertDialogContentPrimitive","AlertDialogFooterPrimitive","AlertDialogTitlePrimitive","AlertDialogDescriptionPrimitive","AlertDialogMediaPrimitive","AlertDialogActionPrimitive","AlertDialogCancelPrimitive","BaseAlertDialog","useOverlayConfig","useThemePortalContainer","cn","SheetDescription","SheetTitle","SheetContent","SheetTrigger","SheetBody","SheetFooter","SheetClose","SheetHeader","Sheet","overlayAnatomyRecipes","Button","Text","textSizes","textLineHeights","textWeights","motionRecipes","Slot","Button$1","Stack","toneRecipes","AlertDescription","Alert","surfaceDividerRecipes","modalRegionRecipes","modalBackdropRecipe","interactionRecipes","React$1","Dialog$2","props","Dialog","DialogTrigger$1","renderSlot","asChild","DialogPortal","resolvedContainer","container","DialogClose$1","DialogOverlay","className","DialogContent$1","children","showCloseButton","XIcon","DialogHeader$1","DialogFooter$1","DialogTitle$1","DialogDescription$1","isSimpleText$1","value","titleTypography$1","Dialog$1","DialogTrigger","DialogClose","DialogContent","DialogHeader","textGap","DialogBody","DialogFooter","DialogTitle","DialogDescription","defaultOverlayStrings","defaultAlertDialogStrings","useOverlayActions","strings","useStrings","customStrings","isExecuting","setIsExecuting","useState","executingRef","useRef","handleConfirm","useCallback","onConfirm","closeDialog","onAsyncConfirm","closeOnAsyncComplete","error","onError","loading","handleCancel","onCancel","handleFormSubmit","formId","form","useMemo","emphasis","tone","confirmTone","resolveOpenValue","nextOpen","currentOpen","normalizeGroupState","result","key","keys","state","hasGroupStateChanged","previous","next","useOverlayVisibility","controlledOpen","internalOpen","setInternalOpen","defaultOpen","isControlled","open","openRef","setOpen","resolvedOpen","changed","onOpenChange","onOpen","onClose","useOverlayVisibilityGroup","keyList","stateRef","setKeyOpen","previousState","nextState","closeOthersOnOpen","item","usePendingOverlayFocus","popupRef","useLayoutEffect","popup","pending","modal","active","overlayToneGlyphs","HelpCircle","AlertCircle","AlertTriangle","Info","CheckCircle","OverlayToneIcon","Glyph","color","SIZE_CLASSES","ActionDialogImpl","centered","align","defaultDialogAlign","visibility","pendingFocusRef","effectiveLoading","hasContent","alertMessage","hasFooter","showCancel","showConfirm","footer","closeOnBackdropClick","details","closeOnEscape","trigger","isValidElement","surfaceStyle","initialFocusRef","title","size","description","visuallyHideHeader","showIcon","contentClassName","finalConfirmTone","confirmStyle","confirmButtonOnClick","X","ActionDialog","memo","WIDTH_CLASSES","ActionDrawerImpl","isHorizontal","direction","showFooter","width","ActionDrawer","AlertDialog$2","AlertDialog","AlertDialogTrigger$1","AlertDialogPortal","AlertDialogOverlay","AlertDialogContent$1","AlertDialogFooter$1","AlertDialogMedia$1","AlertDialogTitle$1","AlertDialogDescription$1","AlertDialogAction$1","AlertDialogCancel$1","isSimpleText","titleTypography","AlertDialog$1","AlertDialogTrigger","AlertDialogContent","AlertDialogHeader","AlertDialogBody","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogMedia","AlertDialogAction","AlertDialogCancel","ConfirmDialogImpl","resolvedAlign","defaultConfirmAlign","mergedStrings","resolvedConfirmTone","destructive","resolvedTone","toneGlyph","hasHeading","ConfirmDialog"],"sources":["../src/components/ui/dialog.tsx","../src/components/base/display/dialog.tsx","../src/components/features/overlays/overlays.strings.ts","../src/components/features/overlays/hooks/use-overlay-actions.ts","../src/components/features/overlays/hooks/use-overlay-visibility.ts","../src/components/features/overlays/hooks/use-pending-overlay-focus.ts","../src/components/features/overlays/overlay-tone-icon.tsx","../src/components/features/overlays/dialog.tsx","../src/components/features/overlays/drawer.tsx","../src/components/ui/alert-dialog.tsx","../src/components/base/display/alert-dialog.tsx","../src/components/features/overlays/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { overlayAnatomyRecipes } from '../../lib/overlay-anatomy-recipes';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\n\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\"\nimport { XIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Dialog({ ...props }: DialogPrimitive.Root.Props) {\n return <DialogPrimitive.Root data-slot=\"dialog\" modal=\"trap-focus\" {...props} />\n}\n\nfunction DialogTrigger({\n asChild = false,\n ...props\n}: DialogPrimitive.Trigger.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <DialogPrimitive.Trigger\n data-slot=\"dialog-trigger\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction DialogPortal({ container, ...props }: DialogPrimitive.Portal.Props) {\n const resolvedContainer = useThemePortalContainer(container)\n return <DialogPrimitive.Portal container={resolvedContainer} data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ ...props }: DialogPrimitive.Close.Props) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: DialogPrimitive.Backdrop.Props) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(modalBackdropRecipe, motionRecipes.backdrop, \"isolate\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n container,\n children,\n showCloseButton = true,\n ...props\n}: DialogPrimitive.Popup.Props & {\n showCloseButton?: boolean\n} & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <DialogPortal container={resolvedContainer}>\n <DialogOverlay />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n motionRecipes.dialog,\n \"bg-background grid max-w-[calc(100%-2rem)] gap-space-xl rounded-radius p-surface text-sm sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none\",\n className\n )}\n {...props}\n >\n {children}\n {!!showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n render={\n <Button\n variant=\"ghost\"\n data-overlay-close=\"\"\n className={overlayAnatomyRecipes.close}\n size=\"icon-sm\"\n />\n }\n >\n <XIcon\n />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n >\n {children}\n {!!showCloseButton && (\n <DialogPrimitive.Close render={<Button variant=\"outline\" />}>\n Close\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({\n className,\n asChild = false,\n ...props\n}: DialogPrimitive.Title.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n render={renderSlot}\n className={cn(\"leading-none font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n asChild = false,\n ...props\n}: DialogPrimitive.Description.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n render={renderSlot}\n className={cn(\"text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","import { modalRegionRecipes, surfaceDividerRecipes } from '../../../lib/surface-recipes';\nimport { overlayAnatomyRecipes } from '../../../lib/overlay-anatomy-recipes';\nimport type { TextGap } from '../structure';\n/**\n * Dialog — internal modal anatomy behind `ActionDialog`.\n *\n * Not published from any entrypoint: applications use `ActionDialog` (or\n * `ConfirmDialog`) from `themelia-react-ui/features/overlays`, which owns the\n * lifecycle, focus, dismissal and action contract. This wrapper supplies the\n * modal geometry those features share: one framed popover surface whose\n * header, scrolling body and footer each own their inset, with exactly one rule\n * between adjacent visible regions (`modalRegionRecipes`).\n */\nimport * as React from 'react';\n\nimport {\n\tDialog as DialogPrimitive,\n\tDialogClose as DialogClosePrimitive,\n\tDialogContent as DialogContentPrimitive,\n\tDialogDescription as DialogDescriptionPrimitive,\n\tDialogFooter as DialogFooterPrimitive,\n\tDialogHeader as DialogHeaderPrimitive,\n\tDialogOverlay,\n\tDialogPortal,\n\tDialogTitle as DialogTitlePrimitive,\n\tDialogTrigger as DialogTriggerPrimitive,\n} from '../../ui/dialog';\nimport { Text } from '../../typography';\nimport { textLineHeights, textSizes, textWeights } from '../../typography/text.styles';\nimport { cn } from '../../../lib/utils';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/**\n * The title element carries the canonical title role, so custom title nodes\n * match scalar titles and its line box never differs from the Text inside.\n * Descriptions keep the configurable Text default instead.\n */\nconst titleTypography = cn(textSizes.base, textWeights.semibold, textLineHeights.snug);\n\nexport const Dialog = DialogPrimitive;\n\nexport const DialogTrigger = React.forwardRef<\n\tReact.ElementRef<typeof DialogTriggerPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof DialogTriggerPrimitive>\n>(function DialogTrigger({ className, ...props }, ref) {\n\treturn (\n\t\t<DialogTriggerPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('dialog-trigger--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nDialogTrigger.displayName = 'DialogTrigger';\n\nexport const DialogClose = React.forwardRef<\n\tReact.ElementRef<typeof DialogClosePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof DialogClosePrimitive>\n>(function DialogClose({ className, ...props }, ref) {\n\treturn (\n\t\t<DialogClosePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('dialog-close--component active:translate-y-0!', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nDialogClose.displayName = 'DialogClose';\n\nexport const DialogContent = React.forwardRef<\n\tReact.ElementRef<typeof DialogContentPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof DialogContentPrimitive>\n>(function DialogContent({ className, ...props }, ref) {\n\treturn (\n\t\t<DialogContentPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t// The shell is flush: each region owns its inset once and the rules\n\t\t\t\t// between regions run edge to edge.\n\t\t\t\t'dialog-content--component flex max-h-[min(90vh,48rem)] flex-col gap-0 overflow-hidden rounded-radius bg-popover p-0 text-popover-foreground shadow-xl sm:max-w-lg [&_[data-slot=dialog-close]]:active:translate-y-0!', surfaceDividerRecipes.modal.shell,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nDialogContent.displayName = 'DialogContent';\n\nexport const DialogHeader = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof DialogHeaderPrimitive> & { textGap?: TextGap }\n>(function DialogHeader({ className, textGap = 'normal', ...props }, ref) {\n\treturn (\n\t\t<DialogHeaderPrimitive\n\t\t\tref={ref}\n\t\t\tdata-modal-region=\"\"\n\t\t\tclassName={cn(\n\t\t\t\t'dialog-header--component', modalRegionRecipes.header,\n\t\t\t\toverlayAnatomyRecipes.header,\n\t\t\t\ttextGap === 'dense' ? 'gap-dense' : 'gap-normal',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nDialogHeader.displayName = 'DialogHeader';\n\n/** Scroll-owning content region between the pinned dialog header and footer. */\nexport const DialogBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n\tfunction DialogBody({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"dialog-body\"\n\t\t\t\tdata-modal-region=\"\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'dialog-body--component', modalRegionRecipes.body,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nDialogBody.displayName = 'DialogBody';\n\nexport const DialogFooter = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof DialogFooterPrimitive>\n>(function DialogFooter({ className, ...props }, ref) {\n\treturn (\n\t\t<DialogFooterPrimitive\n\t\t\tref={ref}\n\t\t\tdata-modal-region=\"\"\n\t\t\tclassName={cn(\n\t\t\t\t'dialog-footer--component', modalRegionRecipes.footer,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nDialogFooter.displayName = 'DialogFooter';\n\nexport const DialogTitle = React.forwardRef<\n\tReact.ElementRef<typeof DialogTitlePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof DialogTitlePrimitive>\n>(function DialogTitle({ children, className, ...props }, ref) {\n\treturn (\n\t\t<DialogTitlePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('dialog-title--component m-0', titleTypography, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"inherit\"\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"dialog-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</DialogTitlePrimitive>\n\t);\n});\n\nDialogTitle.displayName = 'DialogTitle';\n\nexport const DialogDescription = React.forwardRef<\n\tReact.ElementRef<typeof DialogDescriptionPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof DialogDescriptionPrimitive>\n>(function DialogDescription({ children, className, ...props }, ref) {\n\treturn (\n\t\t<DialogDescriptionPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('dialog-description--component m-0', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\tlineHeight=\"relaxed\"\n\t\t\t\t\tclassName=\"dialog-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</DialogDescriptionPrimitive>\n\t);\n});\n\nDialogDescription.displayName = 'DialogDescription';\n\nexport { DialogOverlay, DialogPortal };\n","/**\n * Default user-facing strings shared by ActionDialog, ActionDrawer, and\n * ConfirmDialog recipes.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <ActionDialog strings={{ confirm: t('common.confirm') }} … />\n */\n\nexport interface OverlayStrings {\n\tconfirm: string;\n\tcancel: string;\n\tclose: string;\n\tloading: string;\n\tdialogLabel: string;\n\tdrawerLabel: string;\n\talertDialogLabel: string;\n}\n\nexport const defaultOverlayStrings: OverlayStrings = {\n\tconfirm: 'Confirm',\n\tcancel: 'Cancel',\n\tclose: 'Close',\n\tloading: 'Loading...',\n\tdialogLabel: 'Dialog',\n\tdrawerLabel: 'Drawer',\n\talertDialogLabel: 'Confirmation',\n};\n\nexport const defaultAlertDialogStrings: OverlayStrings = {\n\tconfirm: 'Continue',\n\tcancel: 'Cancel',\n\tclose: 'Close',\n\tloading: 'Loading...',\n\tdialogLabel: 'Dialog',\n\tdrawerLabel: 'Drawer',\n\talertDialogLabel: 'Confirmation',\n};\n","import { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\n\nimport {\n\tdefaultOverlayStrings,\n\ttype OverlayStrings,\n} from '../overlays.strings';\nimport type {\n\tOverlayButtonTone,\n\tOverlayActionProps,\n\tOverlayTone,\n} from '../overlays.types';\n\nexport interface UseOverlayActionsOptions\n\textends Pick<\n\t\tOverlayActionProps,\n\t\t| 'onConfirm'\n\t\t| 'onAsyncConfirm'\n\t\t| 'closeOnAsyncComplete'\n\t\t| 'confirmTone'\n\t\t| 'loading'\n\t\t| 'formId'\n\t> {\n\tcloseDialog: () => void;\n\tonCancel?: () => void;\n\tcustomStrings?: StringsProp<OverlayStrings>;\n\temphasis?: boolean;\n\ttone?: OverlayTone;\n\t/** Called when `onAsyncConfirm` throws; the consumer reports or retries.\n\t * Without it the library logs the rejection in development only. */\n\tonError?: (error: unknown) => void;\n}\n\nexport interface UseOverlayActionsReturn {\n\t/** Overrides this surface's own copy. */\n\tstrings: OverlayStrings;\n\tisExecuting: boolean;\n\thandleConfirm: () => Promise<void>;\n\thandleCancel: () => void;\n\tfinalConfirmTone: OverlayButtonTone;\n\tconfirmButtonOnClick: (() => Promise<void>) | undefined;\n\teffectiveLoading: boolean;\n}\n\nexport function useOverlayActions({\n\tcloseDialog,\n\tonConfirm,\n\tonAsyncConfirm,\n\tcloseOnAsyncComplete = true,\n\tconfirmTone = 'primary',\n\tloading = false,\n\tformId,\n\tonCancel,\n\tcustomStrings,\n\temphasis = false,\n\ttone = 'neutral',\n\tonError,\n}: UseOverlayActionsOptions): UseOverlayActionsReturn {\n\tconst strings = useStrings(defaultOverlayStrings, customStrings);\n\n\tconst [isExecuting, setIsExecuting] = useState(false);\n\tconst executingRef = useRef(false);\n\n\tconst handleConfirm = useCallback(async () => {\n\t\tif (loading || executingRef.current) return;\n\t\tif (onConfirm) {\n\t\t\tonConfirm();\n\t\t\tcloseDialog();\n\t\t\treturn;\n\t\t}\n\n\t\tif (onAsyncConfirm) {\n\t\t\texecutingRef.current = true;\n\t\t\tsetIsExecuting(true);\n\t\t\ttry {\n\t\t\t\tawait onAsyncConfirm();\n\t\t\t\tif (closeOnAsyncComplete) {\n\t\t\t\t\tcloseDialog();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// A consumer that handles the failure owns its reporting; only an\n\t\t\t\t// unhandled rejection is surfaced in development.\n\t\t\t\tif (onError) onError(error);\n\t\t\t\telse if (import.meta.env?.DEV) console.error('Overlay async confirm failed:', error);\n\t\t\t} finally {\n\t\t\t\texecutingRef.current = false;\n\t\t\t\tsetIsExecuting(false);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tcloseDialog();\n\t}, [loading, onConfirm, onAsyncConfirm, closeOnAsyncComplete, closeDialog, onError]);\n\n\tconst handleCancel = useCallback(() => {\n\t\tif (loading || executingRef.current) return;\n\t\tonCancel?.();\n\t\tcloseDialog();\n\t}, [loading, onCancel, closeDialog]);\n\n\tconst handleFormSubmit = useCallback(async () => {\n\t\tif (!formId || loading || executingRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst form = document.getElementById(formId);\n\n\t\tif (!(form instanceof HTMLFormElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tform.requestSubmit();\n\t}, [formId, loading]);\n\n\tconst finalConfirmTone = useMemo<OverlayButtonTone>(() => {\n\t\tif (!emphasis) return confirmTone ?? 'primary';\n\t\tif (tone === 'destructive') return 'destructive';\n\t\tif (tone === 'warning') return 'warning';\n\t\tif (tone === 'success') return 'success';\n\t\treturn confirmTone ?? 'primary';\n\t}, [emphasis, tone, confirmTone]);\n\n\tconst confirmButtonOnClick = formId ? handleFormSubmit : handleConfirm;\n\n\treturn {\n\t\tstrings,\n\t\tisExecuting,\n\t\thandleConfirm,\n\t\thandleCancel,\n\t\tfinalConfirmTone,\n\t\tconfirmButtonOnClick,\n\t\teffectiveLoading: isExecuting || loading,\n\t};\n}\n","import {\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\ttype Dispatch,\n\ttype SetStateAction,\n} from 'react';\n\nexport type OverlayOpenSetter = Dispatch<SetStateAction<boolean>>;\n\nexport interface OverlayVisibilityProps {\n\t/** Current visibility. */\n\topen: boolean;\n\t/** Requests a visibility change; spread both onto an overlay. */\n\tonOpenChange: (open: boolean) => void;\n}\n\nexport interface UseOverlayVisibilityOptions {\n\t/** Initial visibility when uncontrolled. Default: `false`. */\n\tdefaultOpen?: boolean;\n\t/** Controlled visibility. Omit to let the hook own it. */\n\topen?: boolean;\n\t/** Fired once for every actual visibility change. */\n\tonOpenChange?: (open: boolean) => void;\n\t/** Fired after a change to open. */\n\tonOpen?: () => void;\n\t/** Fired after a change to closed, whatever dismissed the overlay. */\n\tonClose?: () => void;\n}\n\nexport interface UseOverlayVisibilityReturn {\n\topen: boolean;\n\tisOpen: boolean;\n\tsetOpen: OverlayOpenSetter;\n\tshow: () => void;\n\thide: () => void;\n\ttoggle: () => void;\n\toverlayProps: OverlayVisibilityProps;\n}\n\nexport type OverlayVisibilityGroupState<TKey extends string = string> = Record<TKey, boolean>;\n\nexport interface UseOverlayVisibilityGroupOptions<TKey extends string = string> {\n\t/** Initial visibility per key when uncontrolled. */\n\tdefaultOpen?: Partial<Record<TKey, boolean>>;\n\t/** Controlled visibility per key. */\n\topen?: Partial<Record<TKey, boolean>>;\n\t/** Fired once for every actual change, with the key, its visibility and the next group state. */\n\tonOpenChange?: (\n\t\tkey: TKey,\n\t\topen: boolean,\n\t\tstate: OverlayVisibilityGroupState<TKey>,\n\t) => void;\n\t/** Opening one key closes the others, for one-at-a-time overlays. Default: `false`. */\n\tcloseOthersOnOpen?: boolean;\n}\n\nexport type UseOverlayVisibilityGroupReturn<TKey extends string = string> = Record<\n\tTKey,\n\tUseOverlayVisibilityReturn\n>;\n\nfunction resolveOpenValue(\n\tnextOpen: SetStateAction<boolean>,\n\tcurrentOpen: boolean,\n): boolean {\n\tif (typeof nextOpen === 'function') {\n\t\treturn (nextOpen as (open: boolean) => boolean)(currentOpen);\n\t}\n\treturn nextOpen;\n}\n\nfunction normalizeGroupState<TKey extends string>(\n\tkeys: readonly TKey[],\n\tstate?: Partial<Record<TKey, boolean>>,\n): OverlayVisibilityGroupState<TKey> {\n\tconst result = {} as OverlayVisibilityGroupState<TKey>;\n\tfor (const key of keys) {\n\t\tresult[key] = Boolean(state?.[key]);\n\t}\n\treturn result;\n}\n\nfunction hasGroupStateChanged<TKey extends string>(\n\tprevious: OverlayVisibilityGroupState<TKey>,\n\tnext: OverlayVisibilityGroupState<TKey>,\n\tkeys: readonly TKey[],\n): boolean {\n\treturn keys.some((key) => previous[key] !== next[key]);\n}\n\nexport function useOverlayVisibility({\n\tdefaultOpen = false,\n\topen: controlledOpen,\n\tonOpenChange,\n\tonOpen,\n\tonClose,\n}: UseOverlayVisibilityOptions = {}): UseOverlayVisibilityReturn {\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : internalOpen;\n\tconst openRef = useRef(open);\n\topenRef.current = open;\n\n\tconst setOpen = useCallback<OverlayOpenSetter>(\n\t\t(nextOpen) => {\n\t\t\tconst resolvedOpen = resolveOpenValue(nextOpen, openRef.current);\n\t\t\tconst changed = openRef.current !== resolvedOpen;\n\n\t\t\tif (!isControlled) {\n\t\t\t\tsetInternalOpen(resolvedOpen);\n\t\t\t}\n\n\t\t\tif (!changed) return;\n\n\t\t\topenRef.current = resolvedOpen;\n\t\t\tonOpenChange?.(resolvedOpen);\n\t\t\tif (resolvedOpen) {\n\t\t\t\tonOpen?.();\n\t\t\t} else {\n\t\t\t\tonClose?.();\n\t\t\t}\n\t\t},\n\t\t[isControlled, onClose, onOpen, onOpenChange],\n\t);\n\n\tconst show = useCallback(() => {\n\t\tsetOpen(true);\n\t}, [setOpen]);\n\n\tconst hide = useCallback(() => {\n\t\tsetOpen(false);\n\t}, [setOpen]);\n\n\tconst toggle = useCallback(() => {\n\t\tsetOpen((currentOpen) => !currentOpen);\n\t}, [setOpen]);\n\n\tconst overlayProps = useMemo(\n\t\t() => ({\n\t\t\topen,\n\t\t\tonOpenChange: setOpen,\n\t\t}),\n\t\t[open, setOpen],\n\t);\n\n\treturn {\n\t\topen,\n\t\tisOpen: open,\n\t\tsetOpen,\n\t\tshow,\n\t\thide,\n\t\ttoggle,\n\t\toverlayProps,\n\t};\n}\n\nexport function useOverlayVisibilityGroup<const TKeys extends readonly string[]>(\n\tkeys: TKeys,\n\t{\n\t\tdefaultOpen,\n\t\topen: controlledOpen,\n\t\tonOpenChange,\n\t\tcloseOthersOnOpen = false,\n\t}: UseOverlayVisibilityGroupOptions<TKeys[number] & string> = {},\n): UseOverlayVisibilityGroupReturn<TKeys[number] & string> {\n\ttype TKey = TKeys[number] & string;\n\n\tconst keyList = keys as readonly TKey[];\n\tconst [internalOpen, setInternalOpen] = useState<OverlayVisibilityGroupState<TKey>>(\n\t\t() => normalizeGroupState(keyList, defaultOpen),\n\t);\n\tconst isControlled = controlledOpen !== undefined;\n\tconst state = normalizeGroupState(keyList, isControlled ? controlledOpen : internalOpen);\n\tconst stateRef = useRef(state);\n\tstateRef.current = state;\n\n\tconst setKeyOpen = useCallback(\n\t\t(key: TKey, nextOpen: SetStateAction<boolean>) => {\n\t\t\tconst previousState = stateRef.current;\n\t\t\tconst resolvedOpen = resolveOpenValue(nextOpen, previousState[key]);\n\t\t\tconst nextState = {\n\t\t\t\t...previousState,\n\t\t\t\t[key]: resolvedOpen,\n\t\t\t} as OverlayVisibilityGroupState<TKey>;\n\n\t\t\tif (closeOthersOnOpen && resolvedOpen) {\n\t\t\t\tfor (const item of keyList) {\n\t\t\t\t\tif (item !== key) {\n\t\t\t\t\t\tnextState[item] = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst changed = hasGroupStateChanged(previousState, nextState, keyList);\n\n\t\t\tif (!isControlled) {\n\t\t\t\tsetInternalOpen(nextState);\n\t\t\t}\n\n\t\t\tif (!changed) return;\n\n\t\t\tstateRef.current = nextState;\n\t\t\tonOpenChange?.(key, resolvedOpen, nextState);\n\t\t},\n\t\t[closeOthersOnOpen, isControlled, keyList, onOpenChange],\n\t);\n\n\treturn useMemo(() => {\n\t\tconst result = {} as UseOverlayVisibilityGroupReturn<TKey>;\n\n\t\tfor (const key of keyList) {\n\t\t\tconst open = state[key];\n\t\t\tconst setOpen: OverlayOpenSetter = (nextOpen) => {\n\t\t\t\tsetKeyOpen(key, nextOpen);\n\t\t\t};\n\n\t\t\tresult[key] = {\n\t\t\t\topen,\n\t\t\t\tisOpen: open,\n\t\t\t\tsetOpen,\n\t\t\t\tshow: () => setKeyOpen(key, true),\n\t\t\t\thide: () => setKeyOpen(key, false),\n\t\t\t\ttoggle: () => setKeyOpen(key, (currentOpen) => !currentOpen),\n\t\t\t\toverlayProps: {\n\t\t\t\t\topen,\n\t\t\t\t\tonOpenChange: setOpen,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn result;\n\t}, [keyList, setKeyOpen, state]);\n}\n","import { useLayoutEffect, useRef } from 'react';\n\n/** Keep modal focus anchored when its focused action becomes disabled. */\nexport function usePendingOverlayFocus(pending: boolean, modal: boolean | 'trap-focus' = true) {\n\tconst popupRef = useRef<HTMLDivElement>(null);\n\tuseLayoutEffect(() => {\n\t\tconst popup = popupRef.current;\n\t\tif (!pending || !modal || !popup) return;\n\t\tconst active = popup.ownerDocument.activeElement;\n\t\t// Preserve enabled fields and consumer-owned custom footer controls.\n\t\tif (active === popup.ownerDocument.body || (active && popup.contains(active) && active.matches(':disabled'))) {\n\t\t\tpopup.focus({ preventScroll: true });\n\t\t}\n\t}, [pending, modal]);\n\treturn popupRef;\n}\n","import { AlertCircle, AlertTriangle, CheckCircle, HelpCircle, Info } from 'lucide-react';\n\nimport { textLineHeights, textSizes } from '../../typography/text.styles';\nimport { cn } from '../../../lib/utils';\n\nimport type { OverlayTone } from './overlays.types';\nimport { toneRecipes } from '../../../lib/tone-recipes';\n\n/** One glyph and colour per tone, shared by every overlay's opt-in `showIcon`. */\nexport const overlayToneGlyphs = {\n\tneutral: { Glyph: HelpCircle, color: 'text-muted-foreground', surface: 'bg-muted' },\n\tdestructive: { Glyph: AlertCircle, color: 'text-destructive', surface: toneRecipes.destructive.tint },\n\twarning: { Glyph: AlertTriangle, color: 'text-warning-accent', surface: toneRecipes.warning.tint },\n\tinfo: { Glyph: Info, color: 'text-info', surface: toneRecipes.info.tint },\n\tsuccess: { Glyph: CheckCircle, color: 'text-success', surface: toneRecipes.success.tint },\n} as const satisfies Record<OverlayTone, { Glyph: typeof Info; color: string; surface: string }>;\n\n/**\n * Inline tone glyph for a heading row. The wrapper takes the title's own line\n * box (base size, snug leading, `h-lh`), so the glyph centres on the first title\n * line at any density instead of relying on an optical offset.\n */\nexport function OverlayToneIcon({ tone }: { tone: OverlayTone }) {\n\tconst { Glyph, color } = overlayToneGlyphs[tone];\n\treturn (\n\t\t<span aria-hidden=\"true\" className={cn('overlay-tone-icon--component flex h-lh shrink-0 items-center', textSizes.base, textLineHeights.snug)}>\n\t\t\t<Glyph className={cn('size-icon', color)} />\n\t\t</span>\n\t);\n}\n","import { overlayAnatomyRecipes } from '../../../lib/overlay-anatomy-recipes';\nimport { X } from 'lucide-react';\nimport { isValidElement, memo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { Alert, AlertDescription } from '../../base/feedback';\nimport {\n\tDialog as BaseDialog,\n\tDialogBody,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from '../../base/display/dialog';\nimport { Stack } from '../../base/structure';\nimport { useOverlayConfig } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\n\nimport { useOverlayActions, useOverlayVisibility } from './hooks';\nimport { usePendingOverlayFocus } from './hooks/use-pending-overlay-focus';\nimport { OverlayToneIcon } from './overlay-tone-icon';\nimport type { ActionDialogProps, OverlaySize } from './overlays.types';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nconst SIZE_CLASSES: Record<OverlaySize, string> = {\n\txs: 'sm:max-w-xs',\n\tsm: 'sm:max-w-sm',\n\tmd: 'sm:max-w-md',\n\tlg: 'sm:max-w-lg',\n\txl: 'sm:max-w-xl',\n\t'2xl': 'sm:max-w-2xl',\n\t'3xl': 'sm:max-w-3xl',\n\t'4xl': 'sm:max-w-4xl',\n\t'5xl': 'sm:max-w-5xl',\n\tfull: 'sm:max-w-[calc(100vw-2rem)]',\n};\n\nfunction ActionDialogImpl({\n\topen,\n\tonOpenChange,\n\tonClose,\n\tchildren,\n\ttitle,\n\tdescription,\n\tvisuallyHideHeader = false,\n\tclassName,\n\tcontentClassName,\n\tshowCloseButton = true,\n\tsurfaceStyle,\n\tinitialFocusRef,\n\tcloseOnEscape = true,\n\tcloseOnBackdropClick = true,\n\tstrings: customStrings,\n\tshowCancel = true,\n\tshowConfirm = true,\n\tonCancel,\n\tonConfirm,\n\tonAsyncConfirm,\n\tonError,\n\tcloseOnAsyncComplete = true,\n\tconfirmTone = 'primary',\n\tconfirmStyle = 'solid',\n\tloading = false,\n\tformId,\n\tfooter,\n\temphasis = false,\n\ttone = 'neutral',\n\tshowIcon = false,\n\talertMessage,\n\tsize = 'lg',\n\ttrigger,\n\talign,\n}: ActionDialogProps) {\n\tconst { defaultDialogAlign } = useOverlayConfig();\n\tconst centered = (align ?? defaultDialogAlign ?? 'start') === 'center';\n\tconst visibility = useOverlayVisibility({ open, onOpenChange, onClose });\n\tconst {\n\t\tstrings,\n\t\tfinalConfirmTone,\n\t\tconfirmButtonOnClick,\n\t\teffectiveLoading,\n\t\thandleCancel,\n\t} = useOverlayActions({\n\t\tcloseDialog: visibility.hide,\n\t\tonConfirm,\n\t\tonAsyncConfirm,\n\t\tonError,\n\t\tcloseOnAsyncComplete,\n\t\tconfirmTone,\n\t\tloading,\n\t\tformId,\n\t\tonCancel,\n\t\tcustomStrings,\n\t\temphasis,\n\t\ttone,\n\t});\n\n\tconst pendingFocusRef = usePendingOverlayFocus(effectiveLoading);\n\tconst hasContent = Boolean(children || alertMessage);\n\tconst hasFooter = showCancel || showConfirm || footer;\n\n\treturn (\n\t\t<BaseDialog\n\t\t\topen={visibility.open}\n\t\t\tmodal\n\t\t\tdisablePointerDismissal={effectiveLoading || !closeOnBackdropClick}\n\t\t\tonOpenChange={(nextOpen, details) => {\n\t\t\t\tif (!nextOpen && (effectiveLoading || (details.reason === 'escape-key' && !closeOnEscape))) {\n\t\t\t\t\tdetails.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvisibility.setOpen(nextOpen);\n\t\t\t}}\n\t\t>\n\t\t\t{!!trigger && (isValidElement(trigger) ? (\n\t\t\t\t<DialogTrigger render={trigger} />\n\t\t\t) : (\n\t\t\t\t<DialogTrigger render={<Button type=\"button\" tone=\"secondary\" buttonStyle=\"outline\" />} className=\"overlay-trigger--fallback\">\n\t\t\t\t\t{trigger}\n\t\t\t\t</DialogTrigger>\n\t\t\t))}\n\n\t\t\t<DialogContent\n\t\t\t\tref={pendingFocusRef}\n\t\t\t\tshowCloseButton={false}\n\t\t\t\tstyle={surfaceStyle}\n\t\t\t\tinitialFocus={initialFocusRef}\n\t\t\t\taria-label={title ? undefined : strings.dialogLabel}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'action-dialog--component dialog--component',\n\t\t\t\t\tSIZE_CLASSES[size],\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{!!(title || description) && (\n\t\t\t\t\t<DialogHeader\n\t\t\t\t\t\tdata-align={centered ? 'center' : 'start'}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'dialog--header',\n\t\t\t\t\t\t\tcentered && cn('text-center', overlayAnatomyRecipes.headerCentered),\n\t\t\t\t\t\t\tvisuallyHideHeader && 'sr-only',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack direction={centered ? 'vertical' : 'horizontal'} gap=\"sm\" align={centered ? 'center' : 'start'} wrap={false}>\n\t\t\t\t\t\t\t{!!showIcon && <OverlayToneIcon tone={tone} />}\n\t\t\t\t\t\t\t<Stack gap=\"normal\" align={centered ? 'center' : undefined} className={cn('min-w-0', centered ? 'w-full' : 'flex-1')}>\n\t\t\t\t\t\t\t\t{!!title && <DialogTitle>{title}</DialogTitle>}\n\t\t\t\t\t\t\t\t{!!description && <DialogDescription>{description}</DialogDescription>}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</DialogHeader>\n\t\t\t\t)}\n\n\t\t\t\t{!!hasContent && (\n\t\t\t\t\t<DialogBody className={cn('dialog--body', contentClassName)}>\n\t\t\t\t\t\t{!!alertMessage && (\n\t\t\t\t\t\t\t<Alert tone={tone} className=\"mb-space-md\">\n\t\t\t\t\t\t\t\t<AlertDescription>{alertMessage}</AlertDescription>\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</DialogBody>\n\t\t\t\t)}\n\n\t\t\t\t{!!hasFooter && (\n\t\t\t\t\t<DialogFooter className=\"dialog--footer\">\n\t\t\t\t\t\t{footer ?? (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\t\t\tjustify={centered ? 'center' : 'end'}\n\t\t\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!!showCancel && (\n\t\t\t\t\t\t\t\t\t<Button type=\"button\" tone=\"secondary\" buttonStyle=\"outline\" onClick={handleCancel} disabled={effectiveLoading}>\n\t\t\t\t\t\t\t\t\t\t{strings.cancel}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!showConfirm && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\ttone={finalConfirmTone}\n\t\t\t\t\t\t\t\t\t\tbuttonStyle={confirmStyle}\n\t\t\t\t\t\t\t\t\t\tonClick={confirmButtonOnClick}\n\t\t\t\t\t\t\t\t\t\tdisabled={effectiveLoading}\n\t\t\t\t\t\t\t\t\t\tloading={effectiveLoading}\n\t\t\t\t\t\t\t\t\t\tstrings={{ loading: strings.loading }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{strings.confirm}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DialogFooter>\n\t\t\t\t)}\n\n\t\t\t\t{/*\n\t\t\t\t * Last in the DOM, drawn in the corner: opening focuses the first\n\t\t\t\t * field or action rather than the dismiss control, and the reading\n\t\t\t\t * order stays title → content → actions.\n\t\t\t\t */}\n\t\t\t\t{!!showCloseButton && (\n\t\t\t\t\t<DialogClose\n\t\t\t\t\t\tdisabled={effectiveLoading}\n\t\t\t\t\t\trender={(\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\t\t\tdata-overlay-close=\"\"\n\t\t\t\t\t\t\t\tclassName={cn(overlayAnatomyRecipes.close, `z-10 text-muted-foreground ${interactionRecipes.rowHover}`)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\taria-label={strings.close}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</DialogContent>\n\t\t</BaseDialog>\n\t);\n}\n\nexport const ActionDialog = memo(ActionDialogImpl);\nActionDialog.displayName = 'ActionDialog';\n","import { overlayAnatomyRecipes } from '../../../lib/overlay-anatomy-recipes';\nimport { X } from 'lucide-react';\nimport { isValidElement, memo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { Alert, AlertDescription } from '../../base/feedback';\nimport {\n\tSheet,\n\tSheetBody,\n\tSheetClose,\n\tSheetContent,\n\tSheetDescription,\n\tSheetFooter,\n\tSheetHeader,\n\tSheetTitle,\n\tSheetTrigger,\n} from '../../base/sheet/sheet';\nimport { Stack } from '../../base/structure';\nimport { cn } from '../../../lib/utils';\n\nimport { useOverlayActions, useOverlayVisibility } from './hooks';\nimport { usePendingOverlayFocus } from './hooks/use-pending-overlay-focus';\nimport { OverlayToneIcon } from './overlay-tone-icon';\nimport type { ActionDrawerProps, OverlaySize } from './overlays.types';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nconst WIDTH_CLASSES: Record<OverlaySize, string> = {\n\txs: 'data-[side=left]:sm:max-w-xs data-[side=right]:sm:max-w-xs',\n\tsm: 'data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',\n\tmd: 'data-[side=left]:sm:max-w-md data-[side=right]:sm:max-w-md',\n\tlg: 'data-[side=left]:sm:max-w-lg data-[side=right]:sm:max-w-lg',\n\txl: 'data-[side=left]:sm:max-w-xl data-[side=right]:sm:max-w-xl',\n\t'2xl': 'data-[side=left]:sm:max-w-2xl data-[side=right]:sm:max-w-2xl',\n\t'3xl': 'data-[side=left]:sm:max-w-3xl data-[side=right]:sm:max-w-3xl',\n\t'4xl': 'data-[side=left]:sm:max-w-4xl data-[side=right]:sm:max-w-4xl',\n\t'5xl': 'data-[side=left]:sm:max-w-5xl data-[side=right]:sm:max-w-5xl',\n\tfull: 'data-[side=left]:sm:max-w-[calc(100vw-2rem)] data-[side=right]:sm:max-w-[calc(100vw-2rem)]',\n};\n\nfunction ActionDrawerImpl({\n\topen,\n\tonOpenChange,\n\tonClose,\n\tchildren,\n\ttitle,\n\tdescription,\n\tvisuallyHideHeader = false,\n\tshowCloseButton = true,\n\tclassName,\n\tcontentClassName,\n\tsurfaceStyle,\n\tinitialFocusRef,\n\tcloseOnEscape = true,\n\tcloseOnBackdropClick = true,\n\tstrings: customStrings,\n\tshowCancel = true,\n\tshowConfirm = true,\n\tonCancel,\n\tonConfirm,\n\tonAsyncConfirm,\n\tonError,\n\tcloseOnAsyncComplete = true,\n\tconfirmTone = 'primary',\n\tconfirmStyle = 'solid',\n\tloading = false,\n\tformId,\n\tfooter,\n\temphasis = false,\n\ttone = 'neutral',\n\tshowIcon = false,\n\talertMessage,\n\tdirection = 'right',\n\twidth = 'lg',\n\tshowFooter = true,\n\tmodal = true,\n\ttrigger,\n}: ActionDrawerProps) {\n\tconst visibility = useOverlayVisibility({ open, onOpenChange, onClose });\n\tconst {\n\t\tstrings,\n\t\tfinalConfirmTone,\n\t\tconfirmButtonOnClick,\n\t\teffectiveLoading,\n\t\thandleCancel,\n\t} = useOverlayActions({\n\t\tcloseDialog: visibility.hide,\n\t\tonConfirm,\n\t\tonAsyncConfirm,\n\t\tonError,\n\t\tcloseOnAsyncComplete,\n\t\tconfirmTone,\n\t\tloading,\n\t\tformId,\n\t\tonCancel,\n\t\tcustomStrings,\n\t\temphasis,\n\t\ttone,\n\t});\n\n\tconst isHorizontal = direction === 'left' || direction === 'right';\n\tconst pendingFocusRef = usePendingOverlayFocus(effectiveLoading, modal);\n\tconst hasContent = Boolean(children || alertMessage);\n\tconst hasFooter = showFooter && (showCancel || showConfirm || footer);\n\n\treturn (\n\t\t<Sheet\n\t\t\topen={visibility.open}\n\t\t\tmodal={modal}\n\t\t\t// A non-modal panel sits beside the page you keep working in, so a page\n\t\t\t// press must not dismiss it; it closes from its own controls or Escape.\n\t\t\tdisablePointerDismissal={effectiveLoading || !closeOnBackdropClick || modal === false}\n\t\t\tonOpenChange={(nextOpen, details) => {\n\t\t\t\tif (!nextOpen && (effectiveLoading || (details.reason === 'escape-key' && !closeOnEscape))) {\n\t\t\t\t\tdetails.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvisibility.setOpen(nextOpen);\n\t\t\t}}\n\t\t>\n\t\t\t{!!trigger && (isValidElement(trigger) ? (\n\t\t\t\t<SheetTrigger render={trigger} />\n\t\t\t) : (\n\t\t\t\t<SheetTrigger render={<Button type=\"button\" tone=\"secondary\" buttonStyle=\"outline\" />} className=\"overlay-trigger--fallback\">\n\t\t\t\t\t{trigger}\n\t\t\t\t</SheetTrigger>\n\t\t\t))}\n\n\t\t\t<SheetContent\n\t\t\t\tref={pendingFocusRef}\n\t\t\t\tside={direction}\n\t\t\t\tshowCloseButton={false}\n\t\t\t\tstyle={surfaceStyle}\n\t\t\t\tinitialFocus={initialFocusRef}\n\t\t\t\taria-label={title ? undefined : strings.drawerLabel}\n\t\t\t\t// The vendored SheetContent renders its backdrop unconditionally,\n\t\t\t\t// so a non-modal drawer would still sit behind a full-viewport\n\t\t\t\t// scrim. This marks the panel so the token layer can drop it.\n\t\t\t\tdata-modal={modal === false ? 'false' : undefined}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'action-drawer--component drawer--component',\n\t\t\t\t\tisHorizontal && 'data-[side=left]:w-full data-[side=right]:w-full',\n\t\t\t\t\tisHorizontal && WIDTH_CLASSES[width],\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{!!(title || description) && (\n\t\t\t\t\t<SheetHeader className={cn('drawer--header', visuallyHideHeader && 'sr-only')}>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"start\" wrap={false}>\n\t\t\t\t\t\t\t{!!showIcon && <OverlayToneIcon tone={tone} />}\n\t\t\t\t\t\t\t<Stack gap=\"normal\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t{!!title && <SheetTitle>{title}</SheetTitle>}\n\t\t\t\t\t\t\t\t{!!description && <SheetDescription>{description}</SheetDescription>}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</SheetHeader>\n\t\t\t\t)}\n\n\t\t\t\t{!!hasContent && (\n\t\t\t\t\t<SheetBody className={cn('drawer--body', contentClassName)}>\n\t\t\t\t\t\t{!!alertMessage && (\n\t\t\t\t\t\t\t<Alert tone={tone} className=\"mb-space-md\">\n\t\t\t\t\t\t\t\t<AlertDescription>{alertMessage}</AlertDescription>\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SheetBody>\n\t\t\t\t)}\n\n\t\t\t\t{!!hasFooter && (\n\t\t\t\t\t<SheetFooter className=\"drawer--footer\">\n\t\t\t\t\t\t{footer ?? (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\t\t\tjustify=\"end\"\n\t\t\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!!showCancel && (\n\t\t\t\t\t\t\t\t\t<Button type=\"button\" tone=\"secondary\" buttonStyle=\"outline\" onClick={handleCancel} disabled={effectiveLoading}>\n\t\t\t\t\t\t\t\t\t\t{strings.cancel}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!showConfirm && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\ttone={finalConfirmTone}\n\t\t\t\t\t\t\t\t\t\tbuttonStyle={confirmStyle}\n\t\t\t\t\t\t\t\t\t\tonClick={confirmButtonOnClick}\n\t\t\t\t\t\t\t\t\t\tdisabled={effectiveLoading}\n\t\t\t\t\t\t\t\t\t\tloading={effectiveLoading}\n\t\t\t\t\t\t\t\t\t\tstrings={{ loading: strings.loading }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{strings.confirm}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SheetFooter>\n\t\t\t\t)}\n\n\t\t\t\t{/*\n\t\t\t\t * Last in the DOM, drawn in the corner: opening focuses the first\n\t\t\t\t * field or action rather than the dismiss control, and the reading\n\t\t\t\t * order stays title → content → actions.\n\t\t\t\t */}\n\t\t\t\t{!!showCloseButton && (\n\t\t\t\t\t<SheetClose\n\t\t\t\t\t\tdisabled={effectiveLoading}\n\t\t\t\t\t\trender={(\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\t\t\tdata-overlay-close=\"\"\n\t\t\t\t\t\t\t\tclassName={cn(overlayAnatomyRecipes.close, `z-10 text-muted-foreground ${interactionRecipes.rowHover}`)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\taria-label={strings.close}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</SheetContent>\n\t\t</Sheet>\n\t);\n}\n\nexport const ActionDrawer = memo(ActionDrawerImpl);\nActionDrawer.displayName = 'ActionDrawer';\n","\"use client\";\n\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\n\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\n\nimport * as React from \"react\"\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"./button\"\n\nfunction AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({ container, ...props }: AlertDialogPrimitive.Portal.Props) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <AlertDialogPrimitive.Portal container={resolvedContainer} data-slot=\"alert-dialog-portal\" {...props} />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: AlertDialogPrimitive.Backdrop.Props) {\n return (\n <AlertDialogPrimitive.Backdrop\n data-slot=\"alert-dialog-overlay\"\n className={cn(modalBackdropRecipe, motionRecipes.backdrop,\n \"isolate\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n container,\n size = \"default\",\n ...props\n}: AlertDialogPrimitive.Popup.Props & {\n size?: \"default\" | \"sm\"\n} & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <AlertDialogPortal container={resolvedContainer}>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Popup\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={cn(\n motionRecipes.dialog,\n \"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-space-xl rounded-radius bg-popover p-surface text-popover-foreground shadow-xl outline-none data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n \"grid grid-rows-[auto_1fr] place-items-center text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-space-2xl sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"flex flex-col-reverse group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogMedia({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-space-md inline-flex size-16 items-center justify-center rounded-full bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\n \"text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\n \"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof Button>) {\n return (\n <Button\n data-slot=\"alert-dialog-action\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n variant = \"outline\",\n size = \"default\",\n ...props\n}: AlertDialogPrimitive.Close.Props &\n Pick<React.ComponentProps<typeof Button>, \"variant\" | \"size\">) {\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-cancel\"\n className={cn(className)}\n render={<Button variant={variant} size={size} />}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n}\n","import { modalRegionRecipes, surfaceDividerRecipes } from '../../../lib/surface-recipes';\nimport type { TextGap } from '../structure';\n/**\n * AlertDialog — internal confirmation anatomy behind `ConfirmDialog`.\n *\n * Not published from any entrypoint: applications use `ConfirmDialog` from\n * `themelia-react-ui/features/overlays`, which owns the decision lifecycle.\n * The surface shares the modal shell, region, rule and typography geometry of\n * the internal Dialog wrapper: a pinned heading region, an optional scrolling\n * body and pinned answers, with one rule between adjacent visible regions.\n */\nimport * as React from 'react';\n\nimport {\n\tAlertDialog as AlertDialogPrimitive,\n\tAlertDialogAction as AlertDialogActionPrimitive,\n\tAlertDialogCancel as AlertDialogCancelPrimitive,\n\tAlertDialogContent as AlertDialogContentPrimitive,\n\tAlertDialogDescription as AlertDialogDescriptionPrimitive,\n\tAlertDialogFooter as AlertDialogFooterPrimitive,\n\tAlertDialogMedia as AlertDialogMediaPrimitive,\n\tAlertDialogOverlay,\n\tAlertDialogPortal,\n\tAlertDialogTitle as AlertDialogTitlePrimitive,\n\tAlertDialogTrigger as AlertDialogTriggerPrimitive,\n} from '../../ui/alert-dialog';\nimport { Text } from '../../typography';\nimport { textLineHeights, textSizes, textWeights } from '../../typography/text.styles';\nimport { cn } from '../../../lib/utils';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/** Same title role as Dialog, set on the element so its line box matches the Text inside. */\nconst titleTypography = cn(textSizes.base, textWeights.semibold, textLineHeights.snug);\n\nexport const AlertDialog = AlertDialogPrimitive;\n\nexport const AlertDialogTrigger = React.forwardRef<\n\tReact.ElementRef<typeof AlertDialogTriggerPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogTriggerPrimitive>\n>(function AlertDialogTrigger({ className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogTriggerPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('alert-dialog-trigger--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogTrigger.displayName = 'AlertDialogTrigger';\n\nexport const AlertDialogContent = React.forwardRef<\n\tReact.ElementRef<typeof AlertDialogContentPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogContentPrimitive>\n>(function AlertDialogContent({ className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogContentPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t// Same flush shell as Dialog: regions own their insets and the rules between them.\n\t\t\t\t'alert-dialog-content--component flex max-h-[min(90vh,48rem)] flex-col gap-0 overflow-hidden rounded-radius bg-popover p-0 text-popover-foreground sm:max-w-md', surfaceDividerRecipes.modal.shell,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogContent.displayName = 'AlertDialogContent';\n\nexport const AlertDialogHeader = React.forwardRef<\n\tHTMLDivElement,\n\tReact.HTMLAttributes<HTMLDivElement> & { textGap?: TextGap; align?: 'start' | 'center' }\n>(function AlertDialogHeader({ className, textGap = 'normal', align = 'start', ...props }, ref) {\n\t// Owned here rather than by the raw header, whose responsive variants force\n\t// start alignment from `sm`; a confirmation chooses its own alignment.\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tdata-slot=\"alert-dialog-header\"\n\t\t\tdata-modal-region=\"\"\n\t\t\tdata-align={align}\n\t\t\tclassName={cn(\n\t\t\t\t'alert-dialog-header--component flex flex-col',\n\t\t\t\tmodalRegionRecipes.header,\n\t\t\t\talign === 'center' ? 'items-center text-center' : 'items-start text-start',\n\t\t\t\ttextGap === 'dense' ? 'gap-dense' : 'gap-normal',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogHeader.displayName = 'AlertDialogHeader';\n\n/** Scroll-owning region between the pinned heading and the pinned answers. */\nexport const AlertDialogBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n\tfunction AlertDialogBody({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"alert-dialog-body\"\n\t\t\t\tdata-modal-region=\"\"\n\t\t\t\tclassName={cn('alert-dialog-body--component', modalRegionRecipes.body, className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nAlertDialogBody.displayName = 'AlertDialogBody';\n\nexport const AlertDialogFooter = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogFooterPrimitive>\n>(function AlertDialogFooter({ className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogFooterPrimitive\n\t\t\tref={ref}\n\t\t\tdata-modal-region=\"\"\n\t\t\tclassName={cn(\n\t\t\t\t'alert-dialog-footer--component', modalRegionRecipes.footer,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogFooter.displayName = 'AlertDialogFooter';\n\nexport const AlertDialogTitle = React.forwardRef<\n\tReact.ElementRef<typeof AlertDialogTitlePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogTitlePrimitive>\n>(function AlertDialogTitle({ children, className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogTitlePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('alert-dialog-title--component m-0', titleTypography, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" type=\"inherit\" size=\"base\" weight=\"semibold\" lineHeight=\"snug\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</AlertDialogTitlePrimitive>\n\t);\n});\n\nAlertDialogTitle.displayName = 'AlertDialogTitle';\n\nexport const AlertDialogDescription = React.forwardRef<\n\tReact.ElementRef<typeof AlertDialogDescriptionPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogDescriptionPrimitive>\n>(function AlertDialogDescription({ children, className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogDescriptionPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('alert-dialog-description--component m-0', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" type=\"secondary\" lineHeight=\"relaxed\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</AlertDialogDescriptionPrimitive>\n\t);\n});\n\nAlertDialogDescription.displayName = 'AlertDialogDescription';\n\nexport const AlertDialogMedia = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogMediaPrimitive>\n>(function AlertDialogMedia({ className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogMediaPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('alert-dialog-media--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogMedia.displayName = 'AlertDialogMedia';\n\nexport const AlertDialogAction = React.forwardRef<\n\tReact.ElementRef<typeof AlertDialogActionPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogActionPrimitive>\n>(function AlertDialogAction({ className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogActionPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('alert-dialog-action--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogAction.displayName = 'AlertDialogAction';\n\nexport const AlertDialogCancel = React.forwardRef<\n\tReact.ElementRef<typeof AlertDialogCancelPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof AlertDialogCancelPrimitive>\n>(function AlertDialogCancel({ className, ...props }, ref) {\n\treturn (\n\t\t<AlertDialogCancelPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('alert-dialog-cancel--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nAlertDialogCancel.displayName = 'AlertDialogCancel';\n\nexport { AlertDialogOverlay, AlertDialogPortal };\n","import { isValidElement, memo, useMemo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { Alert, AlertDescription } from '../../base/feedback';\nimport {\n\tAlertDialog as BaseAlertDialog,\n\tAlertDialogBody,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n} from '../../base/display/alert-dialog';\nimport { Stack } from '../../base/structure';\nimport { useStrings } from '../../../lib/strings';\nimport { useOverlayConfig } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\n\nimport { useOverlayActions, useOverlayVisibility } from './hooks';\nimport { usePendingOverlayFocus } from './hooks/use-pending-overlay-focus';\nimport { overlayToneGlyphs } from './overlay-tone-icon';\nimport { defaultAlertDialogStrings } from './overlays.strings';\nimport type { ConfirmDialogProps } from './overlays.types';\n\nfunction ConfirmDialogImpl({\n\topen,\n\tonOpenChange,\n\tonClose,\n\tchildren,\n\ttitle,\n\tdescription,\n\tvisuallyHideHeader = false,\n\tclassName,\n\tcontentClassName,\n\tsurfaceStyle,\n\tinitialFocusRef,\n\tcloseOnEscape = true,\n\tstrings: customStrings,\n\tshowCancel = true,\n\tshowConfirm = true,\n\tonCancel,\n\tonConfirm,\n\tonAsyncConfirm,\n\tonError,\n\tcloseOnAsyncComplete = true,\n\tconfirmTone,\n\tconfirmStyle = 'solid',\n\tloading = false,\n\tformId,\n\tfooter,\n\ttone = 'neutral',\n\tshowIcon = false,\n\talertMessage,\n\ttrigger,\n\tdestructive = false,\n\talign,\n}: ConfirmDialogProps) {\n\tconst { defaultConfirmAlign } = useOverlayConfig();\n\tconst resolvedAlign = align ?? defaultConfirmAlign ?? 'center';\n\tconst visibility = useOverlayVisibility({ open, onOpenChange, onClose });\n\tconst mergedStrings = useStrings(defaultAlertDialogStrings, customStrings);\n\tconst resolvedConfirmTone = useMemo(() => {\n\t\tif (destructive) return 'destructive' as const;\n\t\tif (confirmTone) return confirmTone;\n\t\tconst toneMap = {\n\t\t\tneutral: 'primary',\n\t\t\tdestructive: 'destructive',\n\t\t\twarning: 'warning',\n\t\t\tinfo: 'primary',\n\t\t\tsuccess: 'success',\n\t\t} as const;\n\t\treturn toneMap[tone];\n\t}, [destructive, confirmTone, tone]);\n\n\tconst { strings, confirmButtonOnClick, effectiveLoading, handleCancel } =\n\t\tuseOverlayActions({\n\t\t\tcloseDialog: visibility.hide,\n\t\t\tonConfirm,\n\t\t\tonAsyncConfirm,\n\t\t\tonError,\n\t\t\tcloseOnAsyncComplete,\n\t\t\tconfirmTone: resolvedConfirmTone,\n\t\t\tloading,\n\t\t\tformId,\n\t\t\tonCancel,\n\t\t\tcustomStrings: mergedStrings,\n\t\t});\n\n\t/*\n\t * `destructive` is documented as the destructive *presentation*, but it only\n\t * ever reached the confirm button — the icon and the inline alert still came\n\t * from `tone`, which defaults to neutral. The result was a red confirm button\n\t * beside a grey question mark: two signals disagreeing about how serious the\n\t * action is. An explicit `tone` still wins, so this only fills the gap.\n\t */\n\tconst resolvedTone = destructive && tone === 'neutral' ? ('destructive' as const) : tone;\n\tconst toneGlyph = overlayToneGlyphs[resolvedTone];\n\tconst pendingFocusRef = usePendingOverlayFocus(effectiveLoading);\n\tconst hasHeading = Boolean(title || description || (showIcon && !visuallyHideHeader));\n\tconst hasContent = Boolean(children || alertMessage);\n\n\treturn (\n\t\t<BaseAlertDialog\n\t\t\topen={visibility.open}\n\t\t\tonOpenChange={(nextOpen, details) => {\n\t\t\t\tif (!nextOpen && (effectiveLoading || (details.reason === 'escape-key' && !closeOnEscape))) {\n\t\t\t\t\tdetails.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvisibility.setOpen(nextOpen);\n\t\t\t}}\n\t\t>\n\t\t\t{!!trigger && (isValidElement(trigger) ? (\n\t\t\t\t<AlertDialogTrigger render={trigger} />\n\t\t\t) : (\n\t\t\t\t<AlertDialogTrigger render={<Button type=\"button\" tone=\"secondary\" buttonStyle=\"outline\" />} className=\"overlay-trigger--fallback\">\n\t\t\t\t\t{trigger}\n\t\t\t\t</AlertDialogTrigger>\n\t\t\t))}\n\n\t\t\t<AlertDialogContent\n\t\t\t\tref={pendingFocusRef}\n\t\t\t\tstyle={surfaceStyle}\n\t\t\t\tinitialFocus={initialFocusRef}\n\t\t\t\taria-label={title ? undefined : strings.alertDialogLabel}\n\t\t\t\tclassName={cn('confirm-dialog--component alert-dialog--component', className)}\n\t\t\t>\n\t\t\t\t{!!hasHeading && (\n\t\t\t\t\t<AlertDialogHeader\n\t\t\t\t\t\talign={resolvedAlign}\n\t\t\t\t\t\tclassName={cn('alert-dialog--header', visuallyHideHeader && 'sr-only')}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!showIcon && !visuallyHideHeader && (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'mb-space-sm flex size-avatar-lg shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\t\t\t\t\ttoneGlyph.surface,\n\t\t\t\t\t\t\t\t\ttoneGlyph.color,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<toneGlyph.Glyph className=\"size-icon-lg\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!title && <AlertDialogTitle>{title}</AlertDialogTitle>}\n\t\t\t\t\t\t{!!description && <AlertDialogDescription>{description}</AlertDialogDescription>}\n\t\t\t\t\t</AlertDialogHeader>\n\t\t\t\t)}\n\n\t\t\t\t{!!hasContent && (\n\t\t\t\t\t<AlertDialogBody className={cn('alert-dialog--body', contentClassName)}>\n\t\t\t\t\t\t{!!alertMessage && (\n\t\t\t\t\t\t\t<Alert tone={resolvedTone} className={cn(!!children && 'mb-space-md')}>\n\t\t\t\t\t\t\t\t<AlertDescription>{alertMessage}</AlertDescription>\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</AlertDialogBody>\n\t\t\t\t)}\n\n\t\t\t\t{!!(showCancel || showConfirm || footer) && (\n\t\t\t\t\t<AlertDialogFooter className=\"alert-dialog--footer\">\n\t\t\t\t\t\t{footer ?? (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\t\t\tjustify={resolvedAlign === 'center' ? 'center' : 'end'}\n\t\t\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!!showCancel && (\n\t\t\t\t\t\t\t\t\t<Button type=\"button\" tone=\"secondary\" buttonStyle=\"outline\" onClick={handleCancel} disabled={effectiveLoading}>\n\t\t\t\t\t\t\t\t\t\t{strings.cancel}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!showConfirm && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\ttone={resolvedConfirmTone}\n\t\t\t\t\t\t\t\t\t\tbuttonStyle={confirmStyle}\n\t\t\t\t\t\t\t\t\t\tonClick={confirmButtonOnClick}\n\t\t\t\t\t\t\t\t\t\tdisabled={effectiveLoading}\n\t\t\t\t\t\t\t\t\t\tloading={effectiveLoading}\n\t\t\t\t\t\t\t\t\t\tstrings={{ loading: strings.loading }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{strings.confirm}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</AlertDialogFooter>\n\t\t\t\t)}\n\t\t\t</AlertDialogContent>\n\t\t</BaseAlertDialog>\n\t);\n}\n\nexport const ConfirmDialog = memo(ConfirmDialogImpl);\nConfirmDialog.displayName = 'ConfirmDialog';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAASA,EAAO,EAAE,GAAG6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Ac"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-7_m66eYW.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","motionRecipes","Slot","Stack","surfaceDividerRecipes","surfaceInsetClasses","popoverRecipes","React$1","Popover$1","props","Popover","PopoverTrigger","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","inferredNativeButton","children","resolvedNativeButton","nativeButton","PopoverAnchor","PopoverContent$1","disablePortal","resolvedContainer","container","inlineHost","setInlineHost","content","cn","className","PopoverHeader$1","PopoverTitle$1","PopoverDescription$1","isSimpleText","value","PopoverSurfaceContext","PopoverContent","resolvedType","type","inset","PopoverHeader","surface","copyGap","textGap","band","menu","hasStart","start","PopoverTitle","compact","PopoverDescription","PopoverFooter","childrenAsCaption","caption"],"sources":["../src/components/ui/popover.tsx","../src/components/base/popover/popover.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport * as React from \"react\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Popover({ ...props }: PopoverPrimitive.Root.Props) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n asChild = false,\n nativeButton,\n render,\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props & { asChild?: boolean; nativeButton?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: PopoverPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n let inferredNativeButton = true\n if (asChild && React.isValidElement(children)) {\n if (typeof children.type === \"string\") {\n inferredNativeButton = children.type === \"button\"\n } else {\n const childProps = (children.props ?? {}) as Record<string, unknown>\n inferredNativeButton = !(\"href\" in childProps)\n }\n }\n const resolvedNativeButton = nativeButton ?? (asChild ? inferredNativeButton : true)\n return (\n <PopoverPrimitive.Trigger\n data-slot=\"popover-trigger\"\n render={slotRender ?? safeRender}\n nativeButton={resolvedNativeButton}\n {...props}\n >\n {children}\n </PopoverPrimitive.Trigger>\n )\n}\n\nfunction PopoverAnchor({\n asChild = false,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\"> & { asChild?: boolean }) {\n if (asChild) {\n return <Slot {...props} />\n }\n\n return <span data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n container,\n anchor,\n align = \"center\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n disablePortal = false,\n positionMethod = disablePortal ? \"absolute\" : anchoredPositionMethod,\n onOpenAutoFocus,\n onInteractOutside,\n ...props\n}: PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n \"anchor\" | \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"positionMethod\"\n > & {\n disablePortal?: boolean\n onOpenAutoFocus?: (event: Event) => void\n onInteractOutside?: (event: Event) => void\n } & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n const [inlineHost, setInlineHost] = React.useState<HTMLDivElement | null>(null)\n void onOpenAutoFocus\n void onInteractOutside\n\n const content = (\n <PopoverPrimitive.Positioner\n anchor={anchor}\n positionMethod={positionMethod}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n motionRecipes.popup,\n \"bg-popover text-popover-foreground ring-foreground/10 flex flex-col gap-space-xl rounded-radius p-surface text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n )\n\n if (disablePortal) {\n // Base UI requires Portal context; a local host preserves inline DOM locality.\n return <div data-popover-inline-host=\"\" className=\"contents\" ref={setInlineHost}>\n <PopoverPrimitive.Portal container={inlineHost}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"inherit\"\n\t\t\t\t\tsize={compact ? undefined : 'base'}\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"popover-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverTitlePrimitive>\n\t);\n}\n\ntype PopoverDescriptionBaseProps = React.ComponentProps<typeof PopoverDescriptionPrimitive>;\n\nfunction PopoverDescription({ children, className, ...props }: PopoverDescriptionBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverDescriptionPrimitive\n\t\t\tclassName={cn('popover-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,SAASA,EAAQ,EAAE,GAAGuB,KAAsC;CAC1D,OAAO,kBAACtB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIsB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACX,GAAD,CAAO,CAAA,IAAI,KAAA,GAClCY,IAAuD,OAAOC,KAAW,eACzE,GAAa,MAAU;EACzB,IAAM,EAAE,cAAcC,GAAe,GAAGC,MAASC;EAEjD,OAAOH,EAAOE,GAA4BE,CAAK;CACjD,KACEJ,GACAK,IAAuB;CAC3B,AAAIP,KAAWzB,EAAM,eAA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kC,EAAc,EAAE,cAAW,aAAU,YAAS,GAAG9C,KAA6B;CACtF,IAAMoC,IAAUpD,EAAM,WAAW8C,CAAqB,GAChDiB,IAAoBC,KAAW,QAAQpB,EAAahB,CAAQ,GAC5DU,IAAU0B,MAAYD,IAAoBnC,IAAW,KAAA;CAC3D,OACC,kBAAClB,GAAD;EACC,WAAU;EACV,KAAI;EACJ,SAAQ;EACR,MAAA;EACA,WAAW6B,EACV,yCAAyC5B,EAAsB,SAAS,QACxEyC,EAAQ,SAAS,CAACA,EAAQ,gBAAgBA,EAAQ,SAAS,SAASvC,EAAe,aAAaA,EAAe,UAE/G2B,CACD;EACA,GAAIxB;EAEJ,UAAA,kBAAC8B,EAAsB,UAAvB;GAAgC,OAAO;IAAE,GAAGM;IAAS,aAAa;GAAK;GAAvE,UAAA,CACEd,KAAW,QAAQ,kBAAC,OAAD;IAAK,WAAWC,EAAG,sDAAsDa,EAAQ,SAAS,UAAU,CAACA,EAAQ,eAAe,UAAU;IACxJ,UAAAR,EAAaN,CAAO,IAAI,kBAAChC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAgC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBnC,CACQ;;CAC1B,CAAA;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet-CGpB3omz.js","names":["Sheet","SheetPrimitive","SheetTrigger","SheetClose","SheetContent","SheetHeader","SheetFooter","SheetTitle","SheetDescription","SheetPrimitive","React","SheetTriggerPrimitive","SheetClosePrimitive","SheetContentPrimitive","SheetHeaderPrimitive","SheetFooterPrimitive","SheetTitlePrimitive","SheetDescriptionPrimitive","useThemePortalContainer","affordanceGeometry","Text","textSizes","textLineHeights","textWeights","motionRecipes","Slot","Button","surfaceDividerRecipes","modalRegionRecipes","modalBackdropRecipe","React$1","overlayAnatomyRecipes","Sheet$1","props","Dialog","SheetTrigger$1","renderSlot","asChild","SheetClose$1","SheetPortal","resolvedContainer","container","SheetOverlay","cn","className","SheetContent$1","side","children","showCloseButton","XIcon","SheetHeader$1","SheetFooter$1","SheetTitle$1","SheetDescription$1","isSimpleText","value","titleTypography","Sheet","SheetTrigger","SheetClose","SheetContent","SheetHeader","textGap","SheetBody","SheetFooter","SheetTitle","SheetDescription"],"sources":["../src/lib/overlay-anatomy-recipes.ts","../src/components/ui/sheet.tsx","../src/components/base/sheet/sheet.tsx"],"sourcesContent":["import { affordanceGeometry } from './affordance-geometry.generated';\n/** Dismiss controls follow the surface's logical inset; headers reserve the\n * actual small-action width plus an action gap only when a close control exists.\n * These are derived recipes, not additional theme settings.\n */\nexport const overlayAnatomyRecipes = {\n\tclose: affordanceGeometry.overlayClose,\n\theader: affordanceGeometry.overlayHeader,\n\theaderCentered: affordanceGeometry.overlayHeaderCentered,\n} as const;\n","\"use client\";\n\nimport { overlayAnatomyRecipes } from '../../lib/overlay-anatomy-recipes';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\n\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\nimport { XIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" modal=\"trap-focus\" {...props} />\n}\n\nfunction SheetTrigger({\n asChild = false,\n ...props\n}: SheetPrimitive.Trigger.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Trigger\n data-slot=\"sheet-trigger\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction SheetClose({\n asChild = false,\n ...props\n}: SheetPrimitive.Close.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction SheetPortal({ container, ...props }: SheetPrimitive.Portal.Props) {\n const resolvedContainer = useThemePortalContainer(container)\n return <SheetPrimitive.Portal container={resolvedContainer} data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(modalBackdropRecipe, motionRecipes.backdrop, className)}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n container,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n} & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <SheetPortal container={resolvedContainer}>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n motionRecipes.drawer,\n \"border-border bg-background fixed z-50 flex flex-col gap-space-xl bg-clip-padding text-sm shadow-lg data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n {!!showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n data-overlay-close=\"\"\n className={overlayAnatomyRecipes.close}\n size=\"icon-sm\"\n />\n }\n >\n <XIcon\n />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({\n className,\n asChild = false,\n ...props\n}: SheetPrimitive.Title.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n render={renderSlot}\n className={cn(\"text-foreground font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n asChild = false,\n ...props\n}: SheetPrimitive.Description.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n render={renderSlot}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n","import { modalRegionRecipes, surfaceDividerRecipes } from '../../../lib/surface-recipes';\nimport { overlayAnatomyRecipes } from '../../../lib/overlay-anatomy-recipes';\nimport type { TextGap } from '../structure';\n/**\n * Sheet — internal edge-anchored modal anatomy behind `ActionDrawer` and the\n * mobile sidebar drawer.\n *\n * Applications use `ActionDrawer` from `themelia-react-ui/features/overlays`,\n * which owns the lifecycle, focus, dismissal and action contract; the\n * `themelia-react-ui/base/sheet` entrypoint remains only as a deprecated\n * compatibility surface. The panel shares the modal geometry of the internal\n * Dialog wrapper: header, scrolling body and footer each own their inset, one\n * rule separates adjacent visible regions, and one edge rule separates the\n * panel from the page.\n */\nimport * as React from 'react';\n\nimport {\n\tSheet as SheetPrimitive,\n\tSheetClose as SheetClosePrimitive,\n\tSheetContent as SheetContentPrimitive,\n\tSheetDescription as SheetDescriptionPrimitive,\n\tSheetFooter as SheetFooterPrimitive,\n\tSheetHeader as SheetHeaderPrimitive,\n\tSheetTitle as SheetTitlePrimitive,\n\tSheetTrigger as SheetTriggerPrimitive,\n} from '../../ui/sheet';\nimport { Text } from '../../typography';\nimport { textLineHeights, textSizes, textWeights } from '../../typography/text.styles';\nimport { cn } from '../../../lib/utils';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/** Same title role as Dialog, set on the element so its line box matches the Text inside. */\nconst titleTypography = cn(textSizes.base, textWeights.semibold, textLineHeights.snug);\n\nexport const Sheet = SheetPrimitive;\n\nexport const SheetTrigger = React.forwardRef<\n\tReact.ElementRef<typeof SheetTriggerPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetTriggerPrimitive>\n>(function SheetTrigger({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetTriggerPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-trigger--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetTrigger.displayName = 'SheetTrigger';\n\nexport const SheetClose = React.forwardRef<\n\tReact.ElementRef<typeof SheetClosePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetClosePrimitive>\n>(function SheetClose({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetClosePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-close--component active:translate-y-0!', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetClose.displayName = 'SheetClose';\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof SheetContentPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetContentPrimitive>\n>(function SheetContent({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetContentPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t// The shell is flush: each region owns its inset once and the rules\n\t\t\t\t// between regions run edge to edge. One rule marks the open edge.\n\t\t\t\t'sheet-content--component min-h-0 gap-0 overflow-hidden bg-popover p-0 text-popover-foreground [&_[data-slot=sheet-close]]:active:translate-y-0!',\n\t\t\t\tsurfaceDividerRecipes.modal.edge,\n\t\t\t\t'data-[side=top]:max-h-[85vh] data-[side=bottom]:max-h-[85vh]',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetContent.displayName = 'SheetContent';\n\nexport const SheetHeader = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof SheetHeaderPrimitive> & { textGap?: TextGap }\n>(function SheetHeader({ className, textGap = 'normal', ...props }, ref) {\n\treturn (\n\t\t<SheetHeaderPrimitive\n\t\t\tref={ref}\n\t\t\tdata-modal-region=\"\"\n\t\t\tclassName={cn(\n\t\t\t\t'sheet-header--component', modalRegionRecipes.header,\n\t\t\t\toverlayAnatomyRecipes.header,\n\t\t\t\ttextGap === 'dense' ? 'gap-dense' : 'gap-normal',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetHeader.displayName = 'SheetHeader';\n\n/** Scroll-owning content region between the pinned sheet header and footer. */\nexport const SheetBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n\tfunction SheetBody({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"sheet-body\"\n\t\t\t\tdata-modal-region=\"\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'sheet-body--component', modalRegionRecipes.body,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nSheetBody.displayName = 'SheetBody';\n\nexport const SheetFooter = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof SheetFooterPrimitive>\n>(function SheetFooter({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetFooterPrimitive\n\t\t\tref={ref}\n\t\t\tdata-modal-region=\"\"\n\t\t\tclassName={cn(\n\t\t\t\t'sheet-footer--component mt-auto flex-row items-center justify-end', modalRegionRecipes.footer,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof SheetTitlePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetTitlePrimitive>\n>(function SheetTitle({ children, className, ...props }, ref) {\n\treturn (\n\t\t<SheetTitlePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-title--component m-0 text-inherit', titleTypography, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"inherit\"\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"sheet-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</SheetTitlePrimitive>\n\t);\n});\n\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof SheetDescriptionPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetDescriptionPrimitive>\n>(function SheetDescription({ children, className, ...props }, ref) {\n\treturn (\n\t\t<SheetDescriptionPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-description--component m-0', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\tlineHeight=\"relaxed\"\n\t\t\t\t\tclassName=\"sheet-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</SheetDescriptionPrimitive>\n\t);\n});\n\nSheetDescription.displayName = 'SheetDescription';\n"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAa+B,IAAwB;CACpC,OAAOZ,EAAmB;CAC1B,QAAQA,EAAmB;CAC3B,gBAAgBA,EAAmB;AACpC;;;ACOA,SAASnB,EAAM,EAAE,GAAGiC,KAAoC;CACtD,OAAO,kBAAChC,EAAe,MAAhB;EAAqB,aAAU;EAAQ,OAAM;EAAa,GAAIgC;CAAQ,CAAA;AAC/E;AAEA,SAAS/B,EAAa,EACpB,aAAU,IACV,GAAG+B,KACoD;CACvD,IAAMG,IAAaC,IAAU,kBAACZ,GAAD,CAAO,CAAA,IAAI,KAAA;CAExC,OACE,kBAACxB,EAAe,SAAhB;EACE,aAAU;EACV,QAAQmC;EACR,GAAIH;CACL,CAAA;AAEL;AAEA,SAAS9B,EAAW,EAClB,aAAU,IACV,GAAG8B,KACkD;CACrD,IAAMG,IAAaC,IAAU,kBAACZ,GAAD,CAAO,CAAA,IAAI,KAAA;CAExC,OACE,kBAACxB,EAAe,OAAhB;EACE,aAAU;EACV,QAAQmC;EACR,GAAIH;CACL,CAAA;AAEL;AAEA,SAASM,EAAY,EAAE,cAAW,GAAGN,KAAsC;CACzE,IAAMO,IAAoBtB,EAAwBuB,CAAS;CAC3D,OAAO,kBAACxC,EAAe,QAAhB;EAAuB,WAAWuC;EAAmB,aAAU;EAAe,GAAIP;CAAQ,CAAA;AACnG;AAEA,SAASS,EAAa,EAAE,cAAW,GAAGT,KAAwC;CAC5E,OACE,kBAAChC,EAAe,UAAhB;EACE,aAAU;EACV,WAAW0C,EAAGd,GAAqBL,EAAc,UAAUoB,CAAS;EACpE,GAAIX;CACL,CAAA;AAEL;AAEA,SAAS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