@karakuri-ui/react 0.3.11 → 0.3.12

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 (85) hide show
  1. package/dist/components/ui/alert.d.mts +4 -2
  2. package/dist/components/ui/alert.d.ts +4 -2
  3. package/dist/components/ui/alert.js +2 -1
  4. package/dist/components/ui/alert.js.map +1 -1
  5. package/dist/components/ui/alert.mjs +2 -1
  6. package/dist/components/ui/alert.mjs.map +1 -1
  7. package/dist/components/ui/avatar.d.mts +2 -2
  8. package/dist/components/ui/avatar.d.ts +2 -2
  9. package/dist/components/ui/badge.d.mts +1 -1
  10. package/dist/components/ui/badge.d.ts +1 -1
  11. package/dist/components/ui/button.d.mts +3 -3
  12. package/dist/components/ui/button.d.ts +3 -3
  13. package/dist/components/ui/card.d.mts +1 -1
  14. package/dist/components/ui/card.d.ts +1 -1
  15. package/dist/components/ui/checkbox.d.mts +1 -1
  16. package/dist/components/ui/checkbox.d.ts +1 -1
  17. package/dist/components/ui/divider.d.mts +1 -1
  18. package/dist/components/ui/divider.d.ts +1 -1
  19. package/dist/components/ui/drawer.d.mts +2 -0
  20. package/dist/components/ui/drawer.d.ts +2 -0
  21. package/dist/components/ui/drawer.js +2 -2
  22. package/dist/components/ui/drawer.js.map +1 -1
  23. package/dist/components/ui/drawer.mjs +2 -2
  24. package/dist/components/ui/drawer.mjs.map +1 -1
  25. package/dist/components/ui/dropdown.js +35 -18
  26. package/dist/components/ui/dropdown.js.map +1 -1
  27. package/dist/components/ui/dropdown.mjs +35 -18
  28. package/dist/components/ui/dropdown.mjs.map +1 -1
  29. package/dist/components/ui/field.d.mts +1 -1
  30. package/dist/components/ui/field.d.ts +1 -1
  31. package/dist/components/ui/icon-button.d.mts +2 -2
  32. package/dist/components/ui/icon-button.d.ts +2 -2
  33. package/dist/components/ui/input.d.mts +3 -3
  34. package/dist/components/ui/input.d.ts +3 -3
  35. package/dist/components/ui/metric-card.d.mts +2 -2
  36. package/dist/components/ui/metric-card.d.ts +2 -2
  37. package/dist/components/ui/modal.d.mts +2 -0
  38. package/dist/components/ui/modal.d.ts +2 -0
  39. package/dist/components/ui/modal.js +2 -2
  40. package/dist/components/ui/modal.js.map +1 -1
  41. package/dist/components/ui/modal.mjs +2 -2
  42. package/dist/components/ui/modal.mjs.map +1 -1
  43. package/dist/components/ui/popover.d.mts +3 -1
  44. package/dist/components/ui/popover.d.ts +3 -1
  45. package/dist/components/ui/popover.js +2 -2
  46. package/dist/components/ui/popover.js.map +1 -1
  47. package/dist/components/ui/popover.mjs +2 -2
  48. package/dist/components/ui/popover.mjs.map +1 -1
  49. package/dist/components/ui/progress.d.mts +1 -1
  50. package/dist/components/ui/progress.d.ts +1 -1
  51. package/dist/components/ui/radio-group.d.mts +1 -1
  52. package/dist/components/ui/radio-group.d.ts +1 -1
  53. package/dist/components/ui/segmented.d.mts +5 -5
  54. package/dist/components/ui/segmented.d.ts +5 -5
  55. package/dist/components/ui/segmented.js +3 -1
  56. package/dist/components/ui/segmented.js.map +1 -1
  57. package/dist/components/ui/segmented.mjs +3 -1
  58. package/dist/components/ui/segmented.mjs.map +1 -1
  59. package/dist/components/ui/select.js +16 -1
  60. package/dist/components/ui/select.js.map +1 -1
  61. package/dist/components/ui/select.mjs +16 -1
  62. package/dist/components/ui/select.mjs.map +1 -1
  63. package/dist/components/ui/slider.d.mts +1 -1
  64. package/dist/components/ui/slider.d.ts +1 -1
  65. package/dist/components/ui/spinner.d.mts +1 -1
  66. package/dist/components/ui/spinner.d.ts +1 -1
  67. package/dist/components/ui/switch.d.mts +1 -1
  68. package/dist/components/ui/switch.d.ts +1 -1
  69. package/dist/components/ui/tabs.d.mts +1 -1
  70. package/dist/components/ui/tabs.d.ts +1 -1
  71. package/dist/components/ui/textarea.d.mts +2 -2
  72. package/dist/components/ui/textarea.d.ts +2 -2
  73. package/dist/components/ui/toast.d.mts +4 -2
  74. package/dist/components/ui/toast.d.ts +4 -2
  75. package/dist/components/ui/toast.js +4 -1
  76. package/dist/components/ui/toast.js.map +1 -1
  77. package/dist/components/ui/toast.mjs +4 -1
  78. package/dist/components/ui/toast.mjs.map +1 -1
  79. package/dist/components/ui/toggle-group.d.mts +2 -2
  80. package/dist/components/ui/toggle-group.d.ts +2 -2
  81. package/dist/components/ui/toggle.d.mts +2 -2
  82. package/dist/components/ui/toggle.d.ts +2 -2
  83. package/dist/components/ui/tooltip.d.mts +1 -1
  84. package/dist/components/ui/tooltip.d.ts +1 -1
  85. package/package.json +1 -1
@@ -106,24 +106,41 @@ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
106
106
  const DropdownMenuGroup = DropdownMenuPrimitive.Group;
107
107
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
108
108
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
109
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, radius = "md", flush = false, size = "md", onCloseAutoFocus, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuStyleContext.Provider, { value: { radius, flush, size }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
- DropdownMenuPrimitive.Content,
111
- {
112
- ref,
113
- sideOffset,
114
- onCloseAutoFocus: (e) => {
115
- e.preventDefault();
116
- onCloseAutoFocus?.(e);
117
- },
118
- className: (0, import_utils.cn)(
119
- "z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg",
120
- flush ? "py-1" : "p-1",
121
- contentRadiusMap[radius],
122
- className
123
- ),
124
- ...props
125
- }
126
- ) }) }));
109
+ let lastInputWasKeyboard = false;
110
+ let inputTypeTrackerInstalled = false;
111
+ function useLastInputTypeTracker() {
112
+ React.useEffect(() => {
113
+ if (inputTypeTrackerInstalled) return;
114
+ inputTypeTrackerInstalled = true;
115
+ document.addEventListener("keydown", () => {
116
+ lastInputWasKeyboard = true;
117
+ }, true);
118
+ document.addEventListener("pointerdown", () => {
119
+ lastInputWasKeyboard = false;
120
+ }, true);
121
+ }, []);
122
+ }
123
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, radius = "md", flush = false, size = "md", onCloseAutoFocus, ...props }, ref) => {
124
+ useLastInputTypeTracker();
125
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuStyleContext.Provider, { value: { radius, flush, size }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
+ DropdownMenuPrimitive.Content,
127
+ {
128
+ ref,
129
+ sideOffset,
130
+ onCloseAutoFocus: (e) => {
131
+ if (!lastInputWasKeyboard) e.preventDefault();
132
+ onCloseAutoFocus?.(e);
133
+ },
134
+ className: (0, import_utils.cn)(
135
+ "z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg",
136
+ flush ? "py-1" : "p-1",
137
+ contentRadiusMap[radius],
138
+ className
139
+ ),
140
+ ...props
141
+ }
142
+ ) }) });
143
+ });
127
144
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
128
145
  const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => {
129
146
  const { radius, flush, size } = React.useContext(DropdownMenuStyleContext);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/dropdown.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { cn } from '../../lib/utils'\n\n// Radius variants for Content and Item (concentric rounded rectangles)\ntype DropdownMenuRadius = 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded-md', // 6px (default)\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded', // 4px — perceptual balance (67%)\n lg: 'rounded-md', // 6px — perceptual balance (75%)\n xl: 'rounded-lg', // 8px — perceptual balance (67%)\n}\n\n// Size variants\ntype DropdownMenuSize = 'sm' | 'md' | 'lg'\n\nconst itemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-sm',\n lg: 'px-3 py-2.5 text-md',\n}\n\nconst indicatorItemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'py-1.5 pl-6 pr-2 text-xs',\n md: 'py-1.5 pl-8 pr-2 text-sm',\n lg: 'py-2.5 pl-10 pr-3 text-md',\n}\n\nconst indicatorSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'left-2 h-3 w-3',\n md: 'left-2 h-3.5 w-3.5',\n lg: 'left-3 h-4 w-4',\n}\n\nconst labelSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2.5 text-xs',\n}\n\nconst flushItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'px-3',\n md: 'px-3',\n lg: 'px-4',\n}\n\nconst flushIndicatorItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-7 pr-3',\n md: 'pl-9 pr-3',\n lg: 'pl-11 pr-4',\n}\n\nconst insetSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-6',\n md: 'pl-8',\n lg: 'pl-10',\n}\n\n// Style context — propagates radius, flush, size from Content to children\nconst DropdownMenuStyleContext = React.createContext<{\n radius: DropdownMenuRadius\n flush: boolean\n size: DropdownMenuSize\n}>({ radius: 'md', flush: false, size: 'md' })\n\n// Root — state management (controlled / uncontrolled)\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\n// Trigger — the element that toggles the menu\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\n// Group — groups related items\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\n// Sub — submenu root\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\n// RadioGroup — radio selection group\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n// Content — the floating panel (rendered in a Portal)\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {\n radius?: DropdownMenuRadius\n flush?: boolean\n size?: DropdownMenuSize\n }\n>(({ className, sideOffset = 4, radius = 'md', flush = false, size = 'md', onCloseAutoFocus, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuStyleContext.Provider value={{ radius, flush, size }}>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n onCloseAutoFocus={(e) => {\n e.preventDefault()\n onCloseAutoFocus?.(e)\n }}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n </DropdownMenuStyleContext.Provider>\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Item — a single menu item\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\n// CheckboxItem — item with a checkbox indicator\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={3} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n})\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\n// RadioItem — item within a RadioGroup\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n})\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\n// Label — non-interactive group heading\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'font-semibold text-text-muted',\n labelSizeMap[size],\n flush && flushItemPaddingMap[size],\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\n// Separator — visual divider between groups\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n const { flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('h-px bg-border my-1', !flush && '-mx-1', className)}\n {...props}\n />\n )\n})\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\n// SubTrigger — item that opens a submenu\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'focus:bg-background-muted data-[state=open]:bg-background-muted',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n >\n {children}\n <svg className=\"ml-auto icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n )\n})\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\n// SubContent — the floating panel for a submenu\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => {\n const { radius, flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\n// Shortcut — keyboard shortcut hint text\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto pl-4 text-xs text-text-subtle tracking-widest', className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport type { DropdownMenuRadius, DropdownMenuSize }\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuShortcut,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmGM;AAjGN,YAAuB;AACvB,4BAAuC;AACvC,mBAAmB;AAKnB,MAAM,mBAAuD;AAAA,EAC3D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAEA,MAAM,gBAAoD;AAAA,EACxD,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAKA,MAAM,cAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,uBAAyD;AAAA,EAC7D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,mBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,sBAAwD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,+BAAiE;AAAA,EACrE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,MAAM,2BAA2B,MAAM,cAIpC,EAAE,QAAQ,MAAM,OAAO,OAAO,MAAM,KAAK,CAAC;AAG7C,MAAM,eAAe,sB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AS,oBAAoB,IAAI;AAAA,QACjC;AAAA,QACA,SAAS,aAAa,IAAI;AAAA,QAC1B;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,4CAAC,SAAI,WAAU,mBAAkB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,QACjH,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,gBAAe,GACtE;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAGtE,MAAM,yBAAyB,MAAM,WAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,QAAQ,MAAM,IAAI,MAAM,WAAW,wBAAwB;AACnE,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA,QAAQ,SAAS;AAAA,QACjB,iBAAiB,MAAM;AAAA,QACvB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAGtE,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,GAAG;AACL,GAA0C;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,iBAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/dropdown.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { cn } from '../../lib/utils'\n\n// Radius variants for Content and Item (concentric rounded rectangles)\ntype DropdownMenuRadius = 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded-md', // 6px (default)\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded', // 4px — perceptual balance (67%)\n lg: 'rounded-md', // 6px — perceptual balance (75%)\n xl: 'rounded-lg', // 8px — perceptual balance (67%)\n}\n\n// Size variants\ntype DropdownMenuSize = 'sm' | 'md' | 'lg'\n\nconst itemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-sm',\n lg: 'px-3 py-2.5 text-md',\n}\n\nconst indicatorItemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'py-1.5 pl-6 pr-2 text-xs',\n md: 'py-1.5 pl-8 pr-2 text-sm',\n lg: 'py-2.5 pl-10 pr-3 text-md',\n}\n\nconst indicatorSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'left-2 h-3 w-3',\n md: 'left-2 h-3.5 w-3.5',\n lg: 'left-3 h-4 w-4',\n}\n\nconst labelSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2.5 text-xs',\n}\n\nconst flushItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'px-3',\n md: 'px-3',\n lg: 'px-4',\n}\n\nconst flushIndicatorItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-7 pr-3',\n md: 'pl-9 pr-3',\n lg: 'pl-11 pr-4',\n}\n\nconst insetSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-6',\n md: 'pl-8',\n lg: 'pl-10',\n}\n\n// Style context — propagates radius, flush, size from Content to children\nconst DropdownMenuStyleContext = React.createContext<{\n radius: DropdownMenuRadius\n flush: boolean\n size: DropdownMenuSize\n}>({ radius: 'md', flush: false, size: 'md' })\n\n// Root — state management (controlled / uncontrolled)\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\n// Trigger — the element that toggles the menu\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\n// Group — groups related items\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\n// Sub — submenu root\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\n// RadioGroup — radio selection group\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n// Close focus: Radix returns focus to the trigger on close. Return it only when the menu was closed\n// from the keyboard — after a pointer close the programmatic focus would show a stray focus ring.\n// Tracks the last input type once per page.\nlet lastInputWasKeyboard = false\nlet inputTypeTrackerInstalled = false\nfunction useLastInputTypeTracker() {\n React.useEffect(() => {\n if (inputTypeTrackerInstalled) return\n inputTypeTrackerInstalled = true\n document.addEventListener('keydown', () => { lastInputWasKeyboard = true }, true)\n document.addEventListener('pointerdown', () => { lastInputWasKeyboard = false }, true)\n }, [])\n}\n\n// Content — the floating panel (rendered in a Portal)\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {\n radius?: DropdownMenuRadius\n flush?: boolean\n size?: DropdownMenuSize\n }\n>(({ className, sideOffset = 4, radius = 'md', flush = false, size = 'md', onCloseAutoFocus, ...props }, ref) => {\n useLastInputTypeTracker()\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuStyleContext.Provider value={{ radius, flush, size }}>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n onCloseAutoFocus={(e) => {\n if (!lastInputWasKeyboard) e.preventDefault()\n onCloseAutoFocus?.(e)\n }}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n </DropdownMenuStyleContext.Provider>\n </DropdownMenuPrimitive.Portal>\n )\n})\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Item — a single menu item\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\n// CheckboxItem — item with a checkbox indicator\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={3} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n})\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\n// RadioItem — item within a RadioGroup\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n})\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\n// Label — non-interactive group heading\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'font-semibold text-text-muted',\n labelSizeMap[size],\n flush && flushItemPaddingMap[size],\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\n// Separator — visual divider between groups\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n const { flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('h-px bg-border my-1', !flush && '-mx-1', className)}\n {...props}\n />\n )\n})\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\n// SubTrigger — item that opens a submenu\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'focus:bg-background-muted data-[state=open]:bg-background-muted',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n >\n {children}\n <svg className=\"ml-auto icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n )\n})\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\n// SubContent — the floating panel for a submenu\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => {\n const { radius, flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\n// Shortcut — keyboard shortcut hint text\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto pl-4 text-xs text-text-subtle tracking-widest', className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport type { DropdownMenuRadius, DropdownMenuSize }\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuShortcut,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmHM;AAjHN,YAAuB;AACvB,4BAAuC;AACvC,mBAAmB;AAKnB,MAAM,mBAAuD;AAAA,EAC3D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAEA,MAAM,gBAAoD;AAAA,EACxD,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAKA,MAAM,cAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,uBAAyD;AAAA,EAC7D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,mBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA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ClC,QAAM,EAAE,QAAQ,MAAM,IAAI,MAAM,WAAW,wBAAwB;AACnE,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA,QAAQ,SAAS;AAAA,QACjB,iBAAiB,MAAM;AAAA,QACvB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAGtE,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,GAAG;AACL,GAA0C;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,iBAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,qBAAqB,cAAc;","names":[]}
@@ -60,24 +60,41 @@ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
60
60
  const DropdownMenuGroup = DropdownMenuPrimitive.Group;
61
61
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
62
62
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
63
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, radius = "md", flush = false, size = "md", onCloseAutoFocus, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuStyleContext.Provider, { value: { radius, flush, size }, children: /* @__PURE__ */ jsx(
64
- DropdownMenuPrimitive.Content,
65
- {
66
- ref,
67
- sideOffset,
68
- onCloseAutoFocus: (e) => {
69
- e.preventDefault();
70
- onCloseAutoFocus?.(e);
71
- },
72
- className: cn(
73
- "z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg",
74
- flush ? "py-1" : "p-1",
75
- contentRadiusMap[radius],
76
- className
77
- ),
78
- ...props
79
- }
80
- ) }) }));
63
+ let lastInputWasKeyboard = false;
64
+ let inputTypeTrackerInstalled = false;
65
+ function useLastInputTypeTracker() {
66
+ React.useEffect(() => {
67
+ if (inputTypeTrackerInstalled) return;
68
+ inputTypeTrackerInstalled = true;
69
+ document.addEventListener("keydown", () => {
70
+ lastInputWasKeyboard = true;
71
+ }, true);
72
+ document.addEventListener("pointerdown", () => {
73
+ lastInputWasKeyboard = false;
74
+ }, true);
75
+ }, []);
76
+ }
77
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, radius = "md", flush = false, size = "md", onCloseAutoFocus, ...props }, ref) => {
78
+ useLastInputTypeTracker();
79
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuStyleContext.Provider, { value: { radius, flush, size }, children: /* @__PURE__ */ jsx(
80
+ DropdownMenuPrimitive.Content,
81
+ {
82
+ ref,
83
+ sideOffset,
84
+ onCloseAutoFocus: (e) => {
85
+ if (!lastInputWasKeyboard) e.preventDefault();
86
+ onCloseAutoFocus?.(e);
87
+ },
88
+ className: cn(
89
+ "z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg",
90
+ flush ? "py-1" : "p-1",
91
+ contentRadiusMap[radius],
92
+ className
93
+ ),
94
+ ...props
95
+ }
96
+ ) }) });
97
+ });
81
98
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
82
99
  const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => {
83
100
  const { radius, flush, size } = React.useContext(DropdownMenuStyleContext);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/dropdown.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { cn } from '../../lib/utils'\n\n// Radius variants for Content and Item (concentric rounded rectangles)\ntype DropdownMenuRadius = 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded-md', // 6px (default)\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded', // 4px — perceptual balance (67%)\n lg: 'rounded-md', // 6px — perceptual balance (75%)\n xl: 'rounded-lg', // 8px — perceptual balance (67%)\n}\n\n// Size variants\ntype DropdownMenuSize = 'sm' | 'md' | 'lg'\n\nconst itemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-sm',\n lg: 'px-3 py-2.5 text-md',\n}\n\nconst indicatorItemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'py-1.5 pl-6 pr-2 text-xs',\n md: 'py-1.5 pl-8 pr-2 text-sm',\n lg: 'py-2.5 pl-10 pr-3 text-md',\n}\n\nconst indicatorSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'left-2 h-3 w-3',\n md: 'left-2 h-3.5 w-3.5',\n lg: 'left-3 h-4 w-4',\n}\n\nconst labelSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2.5 text-xs',\n}\n\nconst flushItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'px-3',\n md: 'px-3',\n lg: 'px-4',\n}\n\nconst flushIndicatorItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-7 pr-3',\n md: 'pl-9 pr-3',\n lg: 'pl-11 pr-4',\n}\n\nconst insetSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-6',\n md: 'pl-8',\n lg: 'pl-10',\n}\n\n// Style context — propagates radius, flush, size from Content to children\nconst DropdownMenuStyleContext = React.createContext<{\n radius: DropdownMenuRadius\n flush: boolean\n size: DropdownMenuSize\n}>({ radius: 'md', flush: false, size: 'md' })\n\n// Root — state management (controlled / uncontrolled)\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\n// Trigger — the element that toggles the menu\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\n// Group — groups related items\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\n// Sub — submenu root\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\n// RadioGroup — radio selection group\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n// Content — the floating panel (rendered in a Portal)\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {\n radius?: DropdownMenuRadius\n flush?: boolean\n size?: DropdownMenuSize\n }\n>(({ className, sideOffset = 4, radius = 'md', flush = false, size = 'md', onCloseAutoFocus, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuStyleContext.Provider value={{ radius, flush, size }}>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n onCloseAutoFocus={(e) => {\n e.preventDefault()\n onCloseAutoFocus?.(e)\n }}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n </DropdownMenuStyleContext.Provider>\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Item — a single menu item\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\n// CheckboxItem — item with a checkbox indicator\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={3} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n})\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\n// RadioItem — item within a RadioGroup\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n})\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\n// Label — non-interactive group heading\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'font-semibold text-text-muted',\n labelSizeMap[size],\n flush && flushItemPaddingMap[size],\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\n// Separator — visual divider between groups\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n const { flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('h-px bg-border my-1', !flush && '-mx-1', className)}\n {...props}\n />\n )\n})\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\n// SubTrigger — item that opens a submenu\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'focus:bg-background-muted data-[state=open]:bg-background-muted',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n >\n {children}\n <svg className=\"ml-auto icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n )\n})\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\n// SubContent — the floating panel for a submenu\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => {\n const { radius, flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\n// Shortcut — keyboard shortcut hint text\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto pl-4 text-xs text-text-subtle tracking-widest', className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport type { DropdownMenuRadius, DropdownMenuSize }\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuShortcut,\n}\n"],"mappings":";AAmGM,cAuDF,YAvDE;AAjGN,YAAY,WAAW;AACvB,YAAY,2BAA2B;AACvC,SAAS,UAAU;AAKnB,MAAM,mBAAuD;AAAA,EAC3D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAEA,MAAM,gBAAoD;AAAA,EACxD,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAKA,MAAM,cAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,uBAAyD;AAAA,EAC7D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,mBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,sBAAwD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,+BAAiE;AAAA,EACrE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,MAAM,2BAA2B,MAAM,cAIpC,EAAE,QAAQ,MAAM,OAAO,OAAO,MAAM,KAAK,CAAC;AAG7C,MAAM,eAAe,sBAAsB;AAG3C,MAAM,sBAAsB,sBAAsB;AAGlD,MAAM,oBAAoB,sBAA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AC1B;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,SAAI,WAAU,mBAAkB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,QACjH,8BAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,gBAAe,GACtE;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAGtE,MAAM,yBAAyB,MAAM,WAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,QAAQ,MAAM,IAAI,MAAM,WAAW,wBAAwB;AACnE,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,QAAQ,SAAS;AAAA,QACjB,iBAAiB,MAAM;AAAA,QACvB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAGtE,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,GAAG;AACL,GAA0C;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/dropdown.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { cn } from '../../lib/utils'\n\n// Radius variants for Content and Item (concentric rounded rectangles)\ntype DropdownMenuRadius = 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded-md', // 6px (default)\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded', // 4px — perceptual balance (67%)\n lg: 'rounded-md', // 6px — perceptual balance (75%)\n xl: 'rounded-lg', // 8px — perceptual balance (67%)\n}\n\n// Size variants\ntype DropdownMenuSize = 'sm' | 'md' | 'lg'\n\nconst itemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-sm',\n lg: 'px-3 py-2.5 text-md',\n}\n\nconst indicatorItemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'py-1.5 pl-6 pr-2 text-xs',\n md: 'py-1.5 pl-8 pr-2 text-sm',\n lg: 'py-2.5 pl-10 pr-3 text-md',\n}\n\nconst indicatorSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'left-2 h-3 w-3',\n md: 'left-2 h-3.5 w-3.5',\n lg: 'left-3 h-4 w-4',\n}\n\nconst labelSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2.5 text-xs',\n}\n\nconst flushItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'px-3',\n md: 'px-3',\n lg: 'px-4',\n}\n\nconst flushIndicatorItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-7 pr-3',\n md: 'pl-9 pr-3',\n lg: 'pl-11 pr-4',\n}\n\nconst insetSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-6',\n md: 'pl-8',\n lg: 'pl-10',\n}\n\n// Style context — propagates radius, flush, size from Content to children\nconst DropdownMenuStyleContext = React.createContext<{\n radius: DropdownMenuRadius\n flush: boolean\n size: DropdownMenuSize\n}>({ radius: 'md', flush: false, size: 'md' })\n\n// Root — state management (controlled / uncontrolled)\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\n// Trigger — the element that toggles the menu\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\n// Group — groups related items\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\n// Sub — submenu root\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\n// RadioGroup — radio selection group\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n// Close focus: Radix returns focus to the trigger on close. Return it only when the menu was closed\n// from the keyboard — after a pointer close the programmatic focus would show a stray focus ring.\n// Tracks the last input type once per page.\nlet lastInputWasKeyboard = false\nlet inputTypeTrackerInstalled = false\nfunction useLastInputTypeTracker() {\n React.useEffect(() => {\n if (inputTypeTrackerInstalled) return\n inputTypeTrackerInstalled = true\n document.addEventListener('keydown', () => { lastInputWasKeyboard = true }, true)\n document.addEventListener('pointerdown', () => { lastInputWasKeyboard = false }, true)\n }, [])\n}\n\n// Content — the floating panel (rendered in a Portal)\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {\n radius?: DropdownMenuRadius\n flush?: boolean\n size?: DropdownMenuSize\n }\n>(({ className, sideOffset = 4, radius = 'md', flush = false, size = 'md', onCloseAutoFocus, ...props }, ref) => {\n useLastInputTypeTracker()\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuStyleContext.Provider value={{ radius, flush, size }}>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n onCloseAutoFocus={(e) => {\n if (!lastInputWasKeyboard) e.preventDefault()\n onCloseAutoFocus?.(e)\n }}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n </DropdownMenuStyleContext.Provider>\n </DropdownMenuPrimitive.Portal>\n )\n})\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Item — a single menu item\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\n// CheckboxItem — item with a checkbox indicator\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={3} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n})\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\n// RadioItem — item within a RadioGroup\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n})\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\n// Label — non-interactive group heading\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'font-semibold text-text-muted',\n labelSizeMap[size],\n flush && flushItemPaddingMap[size],\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\n// Separator — visual divider between groups\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n const { flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('h-px bg-border my-1', !flush && '-mx-1', className)}\n {...props}\n />\n )\n})\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\n// SubTrigger — item that opens a submenu\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'focus:bg-background-muted data-[state=open]:bg-background-muted',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n >\n {children}\n <svg className=\"ml-auto icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n )\n})\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\n// SubContent — the floating panel for a submenu\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => {\n const { radius, flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\n// Shortcut — keyboard shortcut hint text\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto pl-4 text-xs text-text-subtle tracking-widest', className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport type { DropdownMenuRadius, DropdownMenuSize }\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuShortcut,\n}\n"],"mappings":";AAmHM,cAwDF,YAxDE;AAjHN,YAAY,WAAW;AACvB,YAAY,2BAA2B;AACvC,SAAS,UAAU;AAKnB,MAAM,mBAAuD;AAAA,EAC3D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAEA,MAAM,gBAAoD;AAAA,EACxD,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAKA,MAAM,cAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,uBAAyD;AAAA,EAC7D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,mBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,sBAAwD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAE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AAM;AAAA,QACvB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAGtE,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,GAAG;AACL,GAA0C;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,qBAAqB,cAAc;","names":[]}
@@ -22,7 +22,7 @@ type FieldControlKind = 'single' | 'group' | 'labelled';
22
22
  declare function useFieldContext(): FieldContextValue | null;
23
23
  declare function useFieldControl(kind: FieldControlKind, enabled: boolean): void;
24
24
  declare const fieldVariants: (props?: ({
25
- gap?: "default" | "sm" | "lg" | "none" | "xs" | null | undefined;
25
+ gap?: "sm" | "default" | "lg" | "none" | "xs" | null | undefined;
26
26
  } & class_variance_authority_types.ClassProp) | undefined) => string;
27
27
  interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof fieldVariants> {
28
28
  error?: boolean;
@@ -22,7 +22,7 @@ type FieldControlKind = 'single' | 'group' | 'labelled';
22
22
  declare function useFieldContext(): FieldContextValue | null;
23
23
  declare function useFieldControl(kind: FieldControlKind, enabled: boolean): void;
24
24
  declare const fieldVariants: (props?: ({
25
- gap?: "default" | "sm" | "lg" | "none" | "xs" | null | undefined;
25
+ gap?: "sm" | "default" | "lg" | "none" | "xs" | null | undefined;
26
26
  } & class_variance_authority_types.ClassProp) | undefined) => string;
27
27
  interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof fieldVariants> {
28
28
  error?: boolean;
@@ -5,8 +5,8 @@ import { ButtonColor } from './button.mjs';
5
5
 
6
6
  declare const iconButtonVariants: (props?: ({
7
7
  variant?: "outline" | "solid" | "subtle" | "ghost" | null | undefined;
8
- size?: "default" | "sm" | "lg" | "md" | "xs" | null | undefined;
9
- radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
8
+ size?: "sm" | "default" | "lg" | "md" | "xs" | null | undefined;
9
+ radius?: "sm" | "default" | "lg" | "none" | "base" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButtonVariants> {
12
12
  /** Solid variant color */
@@ -5,8 +5,8 @@ import { ButtonColor } from './button.js';
5
5
 
6
6
  declare const iconButtonVariants: (props?: ({
7
7
  variant?: "outline" | "solid" | "subtle" | "ghost" | null | undefined;
8
- size?: "default" | "sm" | "lg" | "md" | "xs" | null | undefined;
9
- radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
8
+ size?: "sm" | "default" | "lg" | "md" | "xs" | null | undefined;
9
+ radius?: "sm" | "default" | "lg" | "none" | "base" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButtonVariants> {
12
12
  /** Solid variant color */
@@ -5,9 +5,9 @@ import { VariantProps } from 'class-variance-authority';
5
5
  declare const inputVariants: (props?: ({
6
6
  variant?: "default" | "filled" | null | undefined;
7
7
  focusRing?: boolean | null | undefined;
8
- size?: "default" | "sm" | "lg" | "xl" | "xs" | null | undefined;
9
- radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
- state?: "default" | "error" | null | undefined;
8
+ size?: "sm" | "default" | "lg" | "xl" | "xs" | null | undefined;
9
+ radius?: "sm" | "default" | "lg" | "none" | "base" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
+ state?: "error" | "default" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
13
13
  leftIcon?: React.ReactNode;
@@ -5,9 +5,9 @@ import { VariantProps } from 'class-variance-authority';
5
5
  declare const inputVariants: (props?: ({
6
6
  variant?: "default" | "filled" | null | undefined;
7
7
  focusRing?: boolean | null | undefined;
8
- size?: "default" | "sm" | "lg" | "xl" | "xs" | null | undefined;
9
- radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
- state?: "default" | "error" | null | undefined;
8
+ size?: "sm" | "default" | "lg" | "xl" | "xs" | null | undefined;
9
+ radius?: "sm" | "default" | "lg" | "none" | "base" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
+ state?: "error" | "default" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
13
13
  leftIcon?: React.ReactNode;
@@ -4,8 +4,8 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const metricCardVariants: (props?: ({
6
6
  variant?: "default" | "ghost" | "elevated" | null | undefined;
7
- size?: "default" | "sm" | "lg" | null | undefined;
8
- radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
7
+ size?: "sm" | "default" | "lg" | null | undefined;
8
+ radius?: "sm" | "default" | "lg" | "none" | "base" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  type MetricCardVariant = 'default' | 'elevated' | 'ghost';
11
11
  type MetricCardSize = 'sm' | 'default' | 'lg';
@@ -4,8 +4,8 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const metricCardVariants: (props?: ({
6
6
  variant?: "default" | "ghost" | "elevated" | null | undefined;
7
- size?: "default" | "sm" | "lg" | null | undefined;
8
- radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
7
+ size?: "sm" | "default" | "lg" | null | undefined;
8
+ radius?: "sm" | "default" | "lg" | "none" | "base" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  type MetricCardVariant = 'default' | 'elevated' | 'ghost';
11
11
  type MetricCardSize = 'sm' | 'default' | 'lg';
@@ -19,6 +19,8 @@ interface ModalContentProps extends React.ComponentPropsWithoutRef<typeof Dialog
19
19
  showCloseButton?: boolean;
20
20
  /** Custom close icon (replaces default X) */
21
21
  closeIcon?: React.ReactNode;
22
+ /** Accessible label for the close button (screen readers) — localize per page */
23
+ closeLabel?: string;
22
24
  }
23
25
  declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
24
26
  declare const ModalHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -19,6 +19,8 @@ interface ModalContentProps extends React.ComponentPropsWithoutRef<typeof Dialog
19
19
  showCloseButton?: boolean;
20
20
  /** Custom close icon (replaces default X) */
21
21
  closeIcon?: React.ReactNode;
22
+ /** Accessible label for the close button (screen readers) — localize per page */
23
+ closeLabel?: string;
22
24
  }
23
25
  declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
24
26
  declare const ModalHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -117,7 +117,7 @@ const modalContentVariants = (0, import_class_variance_authority.cva)("", {
117
117
  size: "sm"
118
118
  }
119
119
  });
120
- const ModalContent = React.forwardRef(({ className, children, size = "sm", scrollBehavior = "outside", showCloseButton = true, closeIcon, ...props }, ref) => {
120
+ const ModalContent = React.forwardRef(({ className, children, size = "sm", scrollBehavior = "outside", showCloseButton = true, closeIcon, closeLabel = "Close", ...props }, ref) => {
121
121
  const isInside = scrollBehavior === "inside";
122
122
  const isFull = size === "full";
123
123
  const useInsideScroll = isInside || isFull;
@@ -129,7 +129,7 @@ const ModalContent = React.forwardRef(({ className, children, size = "sm", scrol
129
129
  "disabled:pointer-events-none"
130
130
  ), children: [
131
131
  closeIcon || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultCloseIcon, { className: "icon-sm" }),
132
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Close" })
132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: closeLabel })
133
133
  ] });
134
134
  if (!useInsideScroll) {
135
135
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalPortal, { children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/modal.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\n\n// ─── Default Close Icon (built-in, no external dependency) ──\nconst DefaultCloseIcon = ({ className }: { className?: string }) => (\n <svg\n className={className}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\n// ─── Style Context ──────────────────────────────────────────\ntype ModalStyleContextValue = {\n scrollBehavior: 'inside' | 'outside'\n}\nconst ModalStyleContext = React.createContext<ModalStyleContextValue>({\n scrollBehavior: 'outside',\n})\n\n// ═══════════════════════════════════════════════════════════════\n// Modal (Dialog)\n// ═══════════════════════════════════════════════════════════════\n\n// ─── Modal (Root) — wrapper to keep our own component identity separate from DialogPrimitive.Root ──\nfunction Modal(props: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />\n}\n\n// ─── ModalTrigger ───────────────────────────────────────────\nconst ModalTrigger = DialogPrimitive.Trigger\n\n// ─── ModalPortal ────────────────────────────────────────────\nconst ModalPortal = DialogPrimitive.Portal\n\n// ─── ModalClose ─────────────────────────────────────────────\nconst ModalClose = DialogPrimitive.Close\n\n// ─── ModalOverlay ───────────────────────────────────────────\nconst ModalOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-overlay bg-black/50',\n 'data-[state=open]:animate-modal-overlay-enter data-[state=closed]:animate-modal-overlay-exit',\n className\n )}\n {...props}\n />\n))\nModalOverlay.displayName = 'ModalOverlay'\n\n// ─── ModalContent ───────────────────────────────────────────\nconst modalContentVariants = cva('', {\n variants: {\n size: {\n xs: 'max-w-[360px]', // 360px — simple confirmation\n sm: 'max-w-[480px]', // 480px — standard (default)\n md: 'max-w-[600px]', // 600px — standard form\n lg: 'max-w-[760px]', // 760px — complex form\n xl: 'max-w-[960px]', // 960px — table, dashboard\n full: 'max-w-none', // full width (constrained by wrapper padding)\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n})\n\nexport interface ModalContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof modalContentVariants> {\n /** Scroll behavior when content overflows */\n scrollBehavior?: 'inside' | 'outside'\n /** Show built-in close button */\n showCloseButton?: boolean\n /** Custom close icon (replaces default X) */\n closeIcon?: React.ReactNode\n}\n\nconst ModalContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n ModalContentProps\n>(({ className, children, size = 'sm', scrollBehavior = 'outside', showCloseButton = true, closeIcon, ...props }, ref) => {\n const isInside = scrollBehavior === 'inside'\n const isFull = size === 'full'\n const useInsideScroll = isInside || isFull\n\n const closeButton = showCloseButton && (\n <DialogPrimitive.Close className={cn(\n 'absolute right-4 top-4 rounded-md p-1',\n 'text-text-muted hover:text-foreground',\n 'transition-colors duration-fast',\n 'focus-visible:focus-ring focus-visible:outline-none',\n 'disabled:pointer-events-none'\n )}>\n {closeIcon || <DefaultCloseIcon className=\"icon-sm\" />}\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )\n\n if (!useInsideScroll) {\n // Outside scroll: DialogPrimitive.Content becomes the full-screen scrollable container.\n // Radix's internal RemoveScroll detects its own root element as scrollable,\n // allowing wheel/touch scroll events to pass through correctly.\n return (\n <ModalPortal>\n <ModalOverlay />\n <ModalStyleContext.Provider value={{ scrollBehavior: 'outside' }}>\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-0 z-modal overflow-y-auto',\n 'focus:outline-none',\n 'data-[state=open]:animate-modal-content-enter data-[state=closed]:animate-modal-content-exit',\n )}\n {...props}\n >\n {/* Backdrop click area: closes dialog when clicking outside the panel */}\n <DialogPrimitive.Close asChild>\n <div className=\"flex min-h-full items-center justify-center p-4\">\n <div\n className={cn(\n 'relative w-full rounded-xl bg-background text-foreground shadow-xl overflow-hidden',\n modalContentVariants({ size }),\n className,\n )}\n onClick={(e) => e.stopPropagation()}\n >\n {children}\n {closeButton}\n </div>\n </div>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </ModalStyleContext.Provider>\n </ModalPortal>\n )\n }\n\n // Inside scroll / full: DialogPrimitive.Content is the visual modal panel.\n return (\n <ModalPortal>\n <ModalOverlay />\n <ModalStyleContext.Provider value={{ scrollBehavior: 'inside' }}>\n <div className=\"fixed inset-0 z-modal flex items-center justify-center p-4\">\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'relative w-full rounded-xl bg-background text-foreground shadow-xl overflow-hidden',\n 'focus:outline-none',\n 'data-[state=open]:animate-modal-content-enter data-[state=closed]:animate-modal-content-exit',\n modalContentVariants({ size }),\n isInside && 'flex flex-col max-h-[85vh]',\n isFull && 'flex flex-col h-full',\n className,\n )}\n {...props}\n >\n {children}\n {closeButton}\n </DialogPrimitive.Content>\n </div>\n </ModalStyleContext.Provider>\n </ModalPortal>\n )\n})\nModalContent.displayName = 'ModalContent'\n\n// ─── ModalHeader ────────────────────────────────────────────\nconst ModalHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col gap-1.5 p-6 pb-0', className)}\n {...props}\n />\n))\nModalHeader.displayName = 'ModalHeader'\n\n// ─── ModalTitle ─────────────────────────────────────────────\nconst ModalTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n))\nModalTitle.displayName = 'ModalTitle'\n\n// ─── ModalDescription ───────────────────────────────────────\nconst ModalDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-md text-text-muted', className)}\n {...props}\n />\n))\nModalDescription.displayName = 'ModalDescription'\n\n// ─── ModalBody ──────────────────────────────────────────────\nconst ModalBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { scrollBehavior } = React.useContext(ModalStyleContext)\n return (\n <div\n ref={ref}\n className={cn(\n 'p-6',\n scrollBehavior === 'inside' && 'flex-1 overflow-y-auto',\n className\n )}\n {...props}\n />\n )\n})\nModalBody.displayName = 'ModalBody'\n\n// ─── ModalFooter ────────────────────────────────────────────\nconst ModalFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-end gap-3 p-6 pt-0',\n className\n )}\n {...props}\n />\n))\nModalFooter.displayName = 'ModalFooter'\n\n// ═══════════════════════════════════════════════════════════════\n// AlertModal (AlertDialog)\n// ═══════════════════════════════════════════════════════════════\n\n// ─── AlertModal (Root) ──────────────────────────────────────\nconst AlertModal = AlertDialogPrimitive.Root\n\n// ─── AlertModalTrigger ──────────────────────────────────────\nconst AlertModalTrigger = AlertDialogPrimitive.Trigger\n\n// ─── AlertModalPortal ───────────────────────────────────────\nconst AlertModalPortal = AlertDialogPrimitive.Portal\n\n// ─── AlertModalOverlay ──────────────────────────────────────\nconst AlertModalOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-overlay bg-black/50',\n 'data-[state=open]:animate-modal-overlay-enter data-[state=closed]:animate-modal-overlay-exit',\n className\n )}\n {...props}\n />\n))\nAlertModalOverlay.displayName = 'AlertModalOverlay'\n\n// ─── AlertModalContent ──────────────────────────────────────\nconst alertModalContentVariants = cva('', {\n variants: {\n size: {\n xs: 'max-w-[360px]', // 360px\n sm: 'max-w-[480px]', // 480px (default)\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n})\n\nexport interface AlertModalContentProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>,\n VariantProps<typeof alertModalContentVariants> {}\n\nconst AlertModalContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n AlertModalContentProps\n>(({ className, children, size = 'sm', ...props }, ref) => (\n <AlertModalPortal>\n <AlertModalOverlay />\n <div className=\"fixed inset-0 z-modal flex items-center justify-center p-4\">\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n 'relative w-full rounded-xl bg-background text-foreground shadow-xl',\n 'focus:outline-none',\n 'data-[state=open]:animate-modal-content-enter data-[state=closed]:animate-modal-content-exit',\n alertModalContentVariants({ size }),\n className\n )}\n {...props}\n >\n {children}\n </AlertDialogPrimitive.Content>\n </div>\n </AlertModalPortal>\n))\nAlertModalContent.displayName = 'AlertModalContent'\n\n// ─── AlertModalHeader ───────────────────────────────────────\nconst AlertModalHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col gap-1.5 p-6 pb-0', className)}\n {...props}\n />\n))\nAlertModalHeader.displayName = 'AlertModalHeader'\n\n// ─── AlertModalTitle ────────────────────────────────────────\nconst AlertModalTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n))\nAlertModalTitle.displayName = 'AlertModalTitle'\n\n// ─── AlertModalDescription ──────────────────────────────────\nconst AlertModalDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-md text-text-muted', className)}\n {...props}\n />\n))\nAlertModalDescription.displayName = 'AlertModalDescription'\n\n// ─── AlertModalBody ─────────────────────────────────────────\nconst AlertModalBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('p-6', className)}\n {...props}\n />\n))\nAlertModalBody.displayName = 'AlertModalBody'\n\n// ─── AlertModalFooter ───────────────────────────────────────\nconst AlertModalFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-end gap-3 p-6 pt-0',\n className\n )}\n {...props}\n />\n))\nAlertModalFooter.displayName = 'AlertModalFooter'\n\n// ─── AlertModalAction ───────────────────────────────────────\nconst AlertModalAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={className}\n {...props}\n />\n))\nAlertModalAction.displayName = 'AlertModalAction'\n\n// ─── AlertModalCancel ───────────────────────────────────────\nconst AlertModalCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={className}\n {...props}\n />\n))\nAlertModalCancel.displayName = 'AlertModalCancel'\n\n// ─── Exports ────────────────────────────────────────────────\nexport {\n Modal,\n ModalTrigger,\n ModalPortal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalTitle,\n ModalDescription,\n ModalBody,\n ModalFooter,\n ModalClose,\n modalContentVariants,\n AlertModal,\n AlertModalTrigger,\n AlertModalPortal,\n AlertModalOverlay,\n AlertModalContent,\n AlertModalHeader,\n AlertModalTitle,\n AlertModalDescription,\n AlertModalBody,\n AlertModalFooter,\n AlertModalAction,\n AlertModalCancel,\n alertModalContentVariants,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBI;AAhBJ,YAAuB;AACvB,sBAAiC;AACjC,2BAAsC;AACtC,sCAAuC;AACvC,mBAAmB;AAGnB,MAAM,mBAAmB,CAAC,EAAE,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Ac;AAG9B,MAAM,wBAAwB,MAAM,WAGlC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,qBAAqB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,2BAA2B,SAAS;AAAA,IACjD,GAAG;AAAA;AACN,CACD;AACD,sBAAsB,cAAc;AAGpC,MAAM,iBAAiB,MAAM,WAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,OAAO,SAAS;AAAA,IAC7B,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAAc;AAG7B,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;AAG/B,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,qBAAqB;AAAA,EAArB;AAAA,IACC;AAAA,IACA;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;AAG/B,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,qBAAqB;AAAA,EAArB;AAAA,IACC;AAAA,IACA;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/modal.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\n\n// ─── Default Close Icon (built-in, no external dependency) ──\nconst DefaultCloseIcon = ({ className }: { className?: string }) => (\n <svg\n className={className}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\n// ─── Style Context ──────────────────────────────────────────\ntype ModalStyleContextValue = {\n scrollBehavior: 'inside' | 'outside'\n}\nconst ModalStyleContext = React.createContext<ModalStyleContextValue>({\n scrollBehavior: 'outside',\n})\n\n// ═══════════════════════════════════════════════════════════════\n// Modal (Dialog)\n// ═══════════════════════════════════════════════════════════════\n\n// ─── Modal (Root) — wrapper to keep our own component identity separate from DialogPrimitive.Root ──\nfunction Modal(props: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />\n}\n\n// ─── ModalTrigger ───────────────────────────────────────────\nconst ModalTrigger = DialogPrimitive.Trigger\n\n// ─── ModalPortal ────────────────────────────────────────────\nconst ModalPortal = DialogPrimitive.Portal\n\n// ─── ModalClose ─────────────────────────────────────────────\nconst ModalClose = DialogPrimitive.Close\n\n// ─── ModalOverlay ───────────────────────────────────────────\nconst ModalOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-overlay bg-black/50',\n 'data-[state=open]:animate-modal-overlay-enter data-[state=closed]:animate-modal-overlay-exit',\n className\n )}\n {...props}\n />\n))\nModalOverlay.displayName = 'ModalOverlay'\n\n// ─── ModalContent ───────────────────────────────────────────\nconst modalContentVariants = cva('', {\n variants: {\n size: {\n xs: 'max-w-[360px]', // 360px — simple confirmation\n sm: 'max-w-[480px]', // 480px — standard (default)\n md: 'max-w-[600px]', // 600px — standard form\n lg: 'max-w-[760px]', // 760px — complex form\n xl: 'max-w-[960px]', // 960px — table, dashboard\n full: 'max-w-none', // full width (constrained by wrapper padding)\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n})\n\nexport interface ModalContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof modalContentVariants> {\n /** Scroll behavior when content overflows */\n scrollBehavior?: 'inside' | 'outside'\n /** Show built-in close button */\n showCloseButton?: boolean\n /** Custom close icon (replaces default X) */\n closeIcon?: React.ReactNode\n /** Accessible label for the close button (screen readers) — localize per page */\n closeLabel?: string\n}\n\nconst ModalContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n ModalContentProps\n>(({ className, children, size = 'sm', scrollBehavior = 'outside', showCloseButton = true, closeIcon, closeLabel = 'Close', ...props }, ref) => {\n const isInside = scrollBehavior === 'inside'\n const isFull = size === 'full'\n const useInsideScroll = isInside || isFull\n\n const closeButton = showCloseButton && (\n <DialogPrimitive.Close className={cn(\n 'absolute right-4 top-4 rounded-md p-1',\n 'text-text-muted hover:text-foreground',\n 'transition-colors duration-fast',\n 'focus-visible:focus-ring focus-visible:outline-none',\n 'disabled:pointer-events-none'\n )}>\n {closeIcon || <DefaultCloseIcon className=\"icon-sm\" />}\n <span className=\"sr-only\">{closeLabel}</span>\n </DialogPrimitive.Close>\n )\n\n if (!useInsideScroll) {\n // Outside scroll: DialogPrimitive.Content becomes the full-screen scrollable container.\n // Radix's internal RemoveScroll detects its own root element as scrollable,\n // allowing wheel/touch scroll events to pass through correctly.\n return (\n <ModalPortal>\n <ModalOverlay />\n <ModalStyleContext.Provider value={{ scrollBehavior: 'outside' }}>\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-0 z-modal overflow-y-auto',\n 'focus:outline-none',\n 'data-[state=open]:animate-modal-content-enter data-[state=closed]:animate-modal-content-exit',\n )}\n {...props}\n >\n {/* Backdrop click area: closes dialog when clicking outside the panel */}\n <DialogPrimitive.Close asChild>\n <div className=\"flex min-h-full items-center justify-center p-4\">\n <div\n className={cn(\n 'relative w-full rounded-xl bg-background text-foreground shadow-xl overflow-hidden',\n modalContentVariants({ size }),\n className,\n )}\n onClick={(e) => e.stopPropagation()}\n >\n {children}\n {closeButton}\n </div>\n </div>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </ModalStyleContext.Provider>\n </ModalPortal>\n )\n }\n\n // Inside scroll / full: DialogPrimitive.Content is the visual modal panel.\n return (\n <ModalPortal>\n <ModalOverlay />\n <ModalStyleContext.Provider value={{ scrollBehavior: 'inside' }}>\n <div className=\"fixed inset-0 z-modal flex items-center justify-center p-4\">\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'relative w-full rounded-xl bg-background text-foreground shadow-xl overflow-hidden',\n 'focus:outline-none',\n 'data-[state=open]:animate-modal-content-enter data-[state=closed]:animate-modal-content-exit',\n modalContentVariants({ size }),\n isInside && 'flex flex-col max-h-[85vh]',\n isFull && 'flex flex-col h-full',\n className,\n )}\n {...props}\n >\n {children}\n {closeButton}\n </DialogPrimitive.Content>\n </div>\n </ModalStyleContext.Provider>\n </ModalPortal>\n )\n})\nModalContent.displayName = 'ModalContent'\n\n// ─── ModalHeader ────────────────────────────────────────────\nconst ModalHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col gap-1.5 p-6 pb-0', className)}\n {...props}\n />\n))\nModalHeader.displayName = 'ModalHeader'\n\n// ─── ModalTitle ─────────────────────────────────────────────\nconst ModalTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n))\nModalTitle.displayName = 'ModalTitle'\n\n// ─── ModalDescription ───────────────────────────────────────\nconst ModalDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-md text-text-muted', className)}\n {...props}\n />\n))\nModalDescription.displayName = 'ModalDescription'\n\n// ─── ModalBody ──────────────────────────────────────────────\nconst ModalBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { scrollBehavior } = React.useContext(ModalStyleContext)\n return (\n <div\n ref={ref}\n className={cn(\n 'p-6',\n scrollBehavior === 'inside' && 'flex-1 overflow-y-auto',\n className\n )}\n {...props}\n />\n )\n})\nModalBody.displayName = 'ModalBody'\n\n// ─── ModalFooter ────────────────────────────────────────────\nconst ModalFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-end gap-3 p-6 pt-0',\n className\n )}\n {...props}\n />\n))\nModalFooter.displayName = 'ModalFooter'\n\n// ═══════════════════════════════════════════════════════════════\n// AlertModal (AlertDialog)\n// ═══════════════════════════════════════════════════════════════\n\n// ─── AlertModal (Root) ──────────────────────────────────────\nconst AlertModal = AlertDialogPrimitive.Root\n\n// ─── AlertModalTrigger ──────────────────────────────────────\nconst AlertModalTrigger = AlertDialogPrimitive.Trigger\n\n// ─── AlertModalPortal ───────────────────────────────────────\nconst AlertModalPortal = AlertDialogPrimitive.Portal\n\n// ─── AlertModalOverlay ──────────────────────────────────────\nconst AlertModalOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-overlay bg-black/50',\n 'data-[state=open]:animate-modal-overlay-enter data-[state=closed]:animate-modal-overlay-exit',\n className\n )}\n {...props}\n />\n))\nAlertModalOverlay.displayName = 'AlertModalOverlay'\n\n// ─── AlertModalContent ──────────────────────────────────────\nconst alertModalContentVariants = cva('', {\n variants: {\n size: {\n xs: 'max-w-[360px]', // 360px\n sm: 'max-w-[480px]', // 480px (default)\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n})\n\nexport interface AlertModalContentProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>,\n VariantProps<typeof alertModalContentVariants> {}\n\nconst AlertModalContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n AlertModalContentProps\n>(({ className, children, size = 'sm', ...props }, ref) => (\n <AlertModalPortal>\n <AlertModalOverlay />\n <div className=\"fixed inset-0 z-modal flex items-center justify-center p-4\">\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n 'relative w-full rounded-xl bg-background text-foreground shadow-xl',\n 'focus:outline-none',\n 'data-[state=open]:animate-modal-content-enter data-[state=closed]:animate-modal-content-exit',\n alertModalContentVariants({ size }),\n className\n )}\n {...props}\n >\n {children}\n </AlertDialogPrimitive.Content>\n </div>\n </AlertModalPortal>\n))\nAlertModalContent.displayName = 'AlertModalContent'\n\n// ─── AlertModalHeader ───────────────────────────────────────\nconst AlertModalHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col gap-1.5 p-6 pb-0', className)}\n {...props}\n />\n))\nAlertModalHeader.displayName = 'AlertModalHeader'\n\n// ─── AlertModalTitle ────────────────────────────────────────\nconst AlertModalTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n))\nAlertModalTitle.displayName = 'AlertModalTitle'\n\n// ─── AlertModalDescription ──────────────────────────────────\nconst AlertModalDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-md text-text-muted', className)}\n {...props}\n />\n))\nAlertModalDescription.displayName = 'AlertModalDescription'\n\n// ─── AlertModalBody ─────────────────────────────────────────\nconst AlertModalBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('p-6', className)}\n {...props}\n />\n))\nAlertModalBody.displayName = 'AlertModalBody'\n\n// ─── AlertModalFooter ───────────────────────────────────────\nconst AlertModalFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-end gap-3 p-6 pt-0',\n className\n )}\n {...props}\n />\n))\nAlertModalFooter.displayName = 'AlertModalFooter'\n\n// ─── AlertModalAction ───────────────────────────────────────\nconst AlertModalAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={className}\n {...props}\n />\n))\nAlertModalAction.displayName = 'AlertModalAction'\n\n// ─── AlertModalCancel ───────────────────────────────────────\nconst AlertModalCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={className}\n {...props}\n />\n))\nAlertModalCancel.displayName = 'AlertModalCancel'\n\n// ─── Exports ────────────────────────────────────────────────\nexport {\n Modal,\n ModalTrigger,\n ModalPortal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalTitle,\n ModalDescription,\n ModalBody,\n ModalFooter,\n ModalClose,\n modalContentVariants,\n AlertModal,\n AlertModalTrigger,\n AlertModalPortal,\n AlertModalOverlay,\n AlertModalContent,\n AlertModalHeader,\n AlertModalTitle,\n AlertModalDescription,\n AlertModalBody,\n AlertModalFooter,\n AlertModalAction,\n AlertModalCancel,\n alertModalContentVariants,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBI;AAhBJ,YAAuB;AACvB,sBAAiC;AACjC,2BAAsC;AACtC,sCAAuC;AACvC,mBAAmB;AAGnB,MAAM,mBAAmB,CAAC,EAAE,UAAU,MACpC;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,QAAO;AAAA,IACP,aAAa;AAAA,IACb,eAAY;AAAA,IAEZ,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;AAOF,MAAM,oBAAoB,MAAM,cAAsC;AAAA,EACpE,gBAAgB;AAClB,CAAC;AAOD,SAAS,MAAM,OAAoE;AACjF,SAAO,4CAAC,gBAAgB,MAAhB,EAAsB,GAAG,OAAO;AAC1C;AAGA,MAAM,eAAe,gBAAgB;AAGrC,MAAM,cAAc,gBAAgB;AAGpC,MAAM,aAAa,gBAAgB;AAGnC,MAAM,eAAe,MAAM,WAGzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,eAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG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,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,qBAAqB;AAAA,EAArB;AAAA,IACC;AAAA,IACA;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;AAG/B,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,qBAAqB;AAAA,EAArB;AAAA,IACC;AAAA,IACA;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;","names":[]}
@@ -60,7 +60,7 @@ const modalContentVariants = cva("", {
60
60
  size: "sm"
61
61
  }
62
62
  });
63
- const ModalContent = React.forwardRef(({ className, children, size = "sm", scrollBehavior = "outside", showCloseButton = true, closeIcon, ...props }, ref) => {
63
+ const ModalContent = React.forwardRef(({ className, children, size = "sm", scrollBehavior = "outside", showCloseButton = true, closeIcon, closeLabel = "Close", ...props }, ref) => {
64
64
  const isInside = scrollBehavior === "inside";
65
65
  const isFull = size === "full";
66
66
  const useInsideScroll = isInside || isFull;
@@ -72,7 +72,7 @@ const ModalContent = React.forwardRef(({ className, children, size = "sm", scrol
72
72
  "disabled:pointer-events-none"
73
73
  ), children: [
74
74
  closeIcon || /* @__PURE__ */ jsx(DefaultCloseIcon, { className: "icon-sm" }),
75
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
75
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: closeLabel })
76
76
  ] });
77
77
  if (!useInsideScroll) {
78
78
  return /* @__PURE__ */ jsxs(ModalPortal, { children: [