@adea-ai/ui 0.110.1 → 0.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/components/composites/action-button/action-button.d.ts +8 -0
  2. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  3. package/dist/components/composites/action-button/action-button.js +9 -3
  4. package/dist/components/composites/action-button/action-button.js.map +1 -1
  5. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +17 -2
  6. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
  7. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +47 -122
  8. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  9. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  10. package/dist/components/composites/appearance-editor/appearance-choices.js +0 -4
  11. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/appearance-editor.js +1 -1
  13. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/font-settings-group.js +60 -68
  15. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/index.js +1 -1
  17. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  18. package/dist/components/theme/appearance-panel.js +0 -3
  19. package/dist/components/theme/appearance-panel.js.map +1 -1
  20. package/dist/components/ui/alert-dialog/alert-dialog.js +2 -2
  21. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  22. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  23. package/dist/components/ui/combobox/combobox.js +1 -1
  24. package/dist/components/ui/combobox/combobox.js.map +1 -1
  25. package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
  26. package/dist/components/ui/context-menu/context-menu.js +2 -2
  27. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  28. package/dist/components/ui/dialog/dialog.js +2 -2
  29. package/dist/components/ui/dialog/dialog.js.map +1 -1
  30. package/dist/components/ui/drawer/drawer.js +1 -1
  31. package/dist/components/ui/drawer/drawer.js.map +1 -1
  32. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +22 -2
  33. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  34. package/dist/components/ui/dropdown-menu/dropdown-menu.js +79 -30
  35. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  36. package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
  37. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  38. package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
  39. package/dist/components/ui/menubar/menubar.js +2 -2
  40. package/dist/components/ui/menubar/menubar.js.map +1 -1
  41. package/dist/components/ui/select/index.d.ts +1 -0
  42. package/dist/components/ui/select/index.d.ts.map +1 -1
  43. package/dist/components/ui/select/select.d.ts +7 -1
  44. package/dist/components/ui/select/select.d.ts.map +1 -1
  45. package/dist/components/ui/select/select.js +34 -20
  46. package/dist/components/ui/select/select.js.map +1 -1
  47. package/dist/components/ui/sheet/sheet.js +1 -1
  48. package/dist/components/ui/sheet/sheet.js.map +1 -1
  49. package/dist/components/ui/tooltip/tooltip.d.ts +16 -6
  50. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  51. package/dist/components/ui/tooltip/tooltip.js +15 -4
  52. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/lib/overlay.d.ts +30 -1
  55. package/dist/lib/overlay.d.ts.map +1 -1
  56. package/dist/lib/overlay.js +37 -2
  57. package/dist/lib/overlay.js.map +1 -1
  58. package/dist/r/src/components/composites/action-button/action-button.tsx +10 -1
  59. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
  60. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
  61. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
  62. package/dist/r/src/components/theme/appearance-panel.tsx +0 -1
  63. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
  64. package/dist/r/src/components/ui/combobox/combobox.tsx +3 -1
  65. package/dist/r/src/components/ui/context-menu/context-menu.tsx +6 -2
  66. package/dist/r/src/components/ui/dialog/dialog.tsx +2 -2
  67. package/dist/r/src/components/ui/drawer/drawer.tsx +1 -1
  68. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
  69. package/dist/r/src/components/ui/dropdown-menu/index.ts +1 -0
  70. package/dist/r/src/components/ui/menubar/menubar.tsx +6 -2
  71. package/dist/r/src/components/ui/select/index.ts +1 -0
  72. package/dist/r/src/components/ui/select/select.tsx +31 -6
  73. package/dist/r/src/components/ui/sheet/sheet.tsx +1 -1
  74. package/dist/r/src/components/ui/tooltip/tooltip.tsx +28 -2
  75. package/dist/r/src/lib/overlay.ts +45 -1
  76. package/package.json +1 -1
  77. package/src/components/composites/action-button/action-button.tsx +10 -1
  78. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
  79. package/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
  80. package/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
  81. package/src/components/theme/appearance-panel.tsx +0 -1
  82. package/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
  83. package/src/components/ui/combobox/combobox.tsx +3 -1
  84. package/src/components/ui/context-menu/context-menu.tsx +6 -2
  85. package/src/components/ui/dialog/dialog.tsx +2 -2
  86. package/src/components/ui/drawer/drawer.tsx +1 -1
  87. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
  88. package/src/components/ui/dropdown-menu/index.ts +1 -0
  89. package/src/components/ui/menubar/menubar.tsx +6 -2
  90. package/src/components/ui/select/index.ts +1 -0
  91. package/src/components/ui/select/select.tsx +31 -6
  92. package/src/components/ui/sheet/sheet.tsx +1 -1
  93. package/src/components/ui/tooltip/tooltip.tsx +28 -2
  94. package/src/lib/overlay.ts +45 -1
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.js","names":["ContextMenu","KobalteContextMenu","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","topLayerProps","cn","props","_$createComponent","ContextMenuTrigger","Trigger","ContextMenuContent","Content","local","rest","Portal","children","_$mergeProps","class","ContextMenuItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_$memo","_el$","_tmpl$","_$insert","ContextMenuCheckboxItem","CheckboxItem","ItemIndicator","ContextMenuRadioGroup","RadioGroup","ContextMenuRadioItem","RadioItem","ContextMenuLabel","GroupLabel","ContextMenuGroup","Group","ContextMenuSeparator","Separator","ContextMenuSub","Sub","ContextMenuSubTrigger","SubTrigger","ContextMenuSubContent","SubContent","ContextMenu","_$createComponent","KobalteContextMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["import { ContextMenu as KobalteContextMenu } from '@kobalte/core/context-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * ContextMenu.\n *\n * The same actions as DropdownMenu, opened by right-click. The trigger is the\n * region the menu belongs to — a file row, a canvas, a code block — and the\n * menu opens at the pointer.\n *\n * The accessibility rule for this component is not about its own markup: a\n * context menu must never hold the *only* route to an action, because a\n * right-click is unavailable on touch and undiscoverable on a trackpad. Every\n * item here should also appear somewhere reachable, usually a DropdownMenu on\n * the same row.\n */\nexport function ContextMenu(props: ComponentProps<typeof KobalteContextMenu>) {\n return <KobalteContextMenu {...props} />\n}\n\nexport function ContextMenuTrigger(props: ComponentProps<typeof KobalteContextMenu.Trigger>) {\n return <KobalteContextMenu.Trigger {...props} />\n}\n\nexport function ContextMenuContent(props: ComponentProps<typeof KobalteContextMenu.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n\nexport function ContextMenuItem(\n props: ComponentProps<typeof KobalteContextMenu.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+C`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteContextMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteContextMenu.Item>\n )\n}\n\nexport function ContextMenuCheckboxItem(\n props: ComponentProps<typeof KobalteContextMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteContextMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteContextMenu.ItemIndicator>\n </KobalteContextMenu.CheckboxItem>\n )\n}\n\nexport function ContextMenuRadioGroup(props: ComponentProps<typeof KobalteContextMenu.RadioGroup>) {\n return <KobalteContextMenu.RadioGroup {...props} />\n}\n\nexport function ContextMenuRadioItem(props: ComponentProps<typeof KobalteContextMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteContextMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteContextMenu.ItemIndicator>\n </KobalteContextMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `ContextMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function ContextMenuLabel(props: ComponentProps<typeof KobalteContextMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteContextMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function ContextMenuGroup(props: ComponentProps<typeof KobalteContextMenu.Group>) {\n return <KobalteContextMenu.Group {...props} />\n}\n\nexport function ContextMenuSeparator(props: ComponentProps<typeof KobalteContextMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteContextMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function ContextMenuSub(props: ComponentProps<typeof KobalteContextMenu.Sub>) {\n return <KobalteContextMenu.Sub {...props} />\n}\n\nexport function ContextMenuSubTrigger(props: ComponentProps<typeof KobalteContextMenu.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteContextMenu.SubTrigger>\n )\n}\n\nexport function ContextMenuSubContent(props: ComponentProps<typeof KobalteContextMenu.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgBA,cAAYgB,OAAkD;CAC5E,OAAAC,gBAAQhB,aAAuBe,KAAK;AACtC;AAEA,SAAgBE,mBAAmBF,OAA0D;CAC3F,OAAAC,gBAAQhB,YAAmBkB,SAAYH,KAAK;AAC9C;AAEA,SAAgBI,mBAAmBJ,OAA0D;CAC3F,MAAM,CAACM,OAAOC,QAAQjB,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGhB,YAAmBuB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACvBhB,YAAmBoB,SAAOK,WACrBZ,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLF,gBACAD,eACA,0FAAA,OAEAU,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB;AAEA,SAAgBK,gBACdZ,OAWA;CACA,MAAM,CAACM,OAAOC,QAAQjB,WAAWU,OAAO;EACtC;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,OAAAC,gBACGhB,YAAmB4B,MAAIH,WAAA;EAAA,KAAA,WAAA;GAAA,OACfX,GACLN,UACA,GACGD,sBAAsBc,MAAMQ,YAAY,cAC3C,GACAR,MAAMK,KACR;EAAC;EAAA,KAAA,uBAAA;GAAA,OACkBL,MAAMU;EAAY;CAAA,GACjCT,MAAI,EAAA,IAAAE,WAAA;EAAA,OAAA,CAAAS,WAEPZ,MAAMG,QAAQ,GAAAS,WACdA,WA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U9B,WACxBZ,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLF,gBACAD,eACA,yFAAA,OAEAU,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
1
+ {"version":3,"file":"context-menu.js","names":["ContextMenu","KobalteContextMenu","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","topLayerProps","cn","props","_$createComponent","ContextMenuTrigger","Trigger","ContextMenuContent","Content","local","rest","Portal","children","_$mergeProps","class","ContextMenuItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_$memo","_el$","_tmpl$","_$insert","ContextMenuCheckboxItem","CheckboxItem","ItemIndicator","ContextMenuRadioGroup","RadioGroup","ContextMenuRadioItem","RadioItem","ContextMenuLabel","GroupLabel","ContextMenuGroup","Group","ContextMenuSeparator","Separator","ContextMenuSub","Sub","ContextMenuSubTrigger","SubTrigger","ContextMenuSubContent","SubContent","ContextMenu","_$createComponent","KobalteContextMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["import { ContextMenu as KobalteContextMenu } from '@kobalte/core/context-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * ContextMenu.\n *\n * The same actions as DropdownMenu, opened by right-click. The trigger is the\n * region the menu belongs to — a file row, a canvas, a code block — and the\n * menu opens at the pointer.\n *\n * The accessibility rule for this component is not about its own markup: a\n * context menu must never hold the *only* route to an action, because a\n * right-click is unavailable on touch and undiscoverable on a trackpad. Every\n * item here should also appear somewhere reachable, usually a DropdownMenu on\n * the same row.\n */\nexport function ContextMenu(props: ComponentProps<typeof KobalteContextMenu>) {\n return <KobalteContextMenu {...props} />\n}\n\nexport function ContextMenuTrigger(props: ComponentProps<typeof KobalteContextMenu.Trigger>) {\n return <KobalteContextMenu.Trigger {...props} />\n}\n\nexport function ContextMenuContent(props: ComponentProps<typeof KobalteContextMenu.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n\nexport function ContextMenuItem(\n props: ComponentProps<typeof KobalteContextMenu.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+C`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteContextMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteContextMenu.Item>\n )\n}\n\nexport function ContextMenuCheckboxItem(\n props: ComponentProps<typeof KobalteContextMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system. */}\n <KobalteContextMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center text-primary\">\n <Check class=\"size-4\" />\n </KobalteContextMenu.ItemIndicator>\n </KobalteContextMenu.CheckboxItem>\n )\n}\n\nexport function ContextMenuRadioGroup(props: ComponentProps<typeof KobalteContextMenu.RadioGroup>) {\n return <KobalteContextMenu.RadioGroup {...props} />\n}\n\nexport function ContextMenuRadioItem(props: ComponentProps<typeof KobalteContextMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system. */}\n <KobalteContextMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center text-primary\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteContextMenu.ItemIndicator>\n </KobalteContextMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `ContextMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function ContextMenuLabel(props: ComponentProps<typeof KobalteContextMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteContextMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function ContextMenuGroup(props: ComponentProps<typeof KobalteContextMenu.Group>) {\n return <KobalteContextMenu.Group {...props} />\n}\n\nexport function ContextMenuSeparator(props: ComponentProps<typeof KobalteContextMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteContextMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function ContextMenuSub(props: ComponentProps<typeof KobalteContextMenu.Sub>) {\n return <KobalteContextMenu.Sub {...props} />\n}\n\nexport function ContextMenuSubTrigger(props: ComponentProps<typeof KobalteContextMenu.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteContextMenu.SubTrigger>\n )\n}\n\nexport function ContextMenuSubContent(props: ComponentProps<typeof KobalteContextMenu.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgBA,cAAYgB,OAAkD;CAC5E,OAAAC,gBAAQhB,aAAuBe,KAAK;AACtC;AAEA,SAAgBE,mBAAmBF,OAA0D;CAC3F,OAAAC,gBAAQhB,YAAmBkB,SAAYH,KAAK;AAC9C;AAEA,SAAgBI,mBAAmBJ,OAA0D;CAC3F,MAAM,CAACM,OAAOC,QAAQjB,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGhB,YAAmBuB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACvBhB,YAAmBoB,SAAOK,WACrBZ,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLF,gBACAD,eACA,0FAAA,OAEAU,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB;AAEA,SAAgBK,gBACdZ,OAWA;CACA,MAAM,CAACM,OAAOC,QAAQjB,WAAWU,OAAO;EACtC;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,OAAAC,gBACGhB,YAAmB4B,MAAIH,WAAA;EAAA,KAAA,WAAA;GAAA,OACfX,GACLN,UACA,GACGD,sBAAsBc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AEA,SAAgBoD,sBAAsBvC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQjB,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGhB,YAAmBuB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACvBhB,YAAmBuD,YAAU9B,WACxBZ,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLF,gBACAD,eACA,yFAAA,OAEAU,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
@@ -1,5 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { overlayMotion, overlayPositioner, overlayScrim, overlaySurface, overlayTitle } from "../../../lib/overlay.js";
2
+ import { dialogSurface, overlayMotion, overlayPositioner, overlayScrim, overlayTitle } from "../../../lib/overlay.js";
3
3
  import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/tooltip.js";
4
4
  import { className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
5
5
  import { X } from "lucide-solid";
@@ -169,7 +169,7 @@ function DialogContent(props) {
169
169
  return [createComponent(DialogOverlay, {}), (() => {
170
170
  var _el$ = _tmpl$();
171
171
  insert(_el$, createComponent(Content, mergeProps({ get ["class"]() {
172
- return cn(overlaySurface, overlayMotion, "relative grid w-full max-w-lg gap-4 p-5", local.class);
172
+ return cn(dialogSurface, overlayMotion, "relative grid w-full max-w-lg gap-4 p-5", local.class);
173
173
  } }, rest, { get children() {
174
174
  return [memo(() => local.children), createComponent(Show, {
175
175
  get when() {
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","Overlay","KobalteDialogOverlay","X","Accessor","ComponentProps","JSX","createRenderEffect","onCleanup","Show","splitProps","overlayMotion","overlayPositioner","overlayScrim","overlaySurface","overlayTitle","cn","Tooltip","TooltipContent","TooltipTrigger","FocusCycle","content","HTMLElement","opener","openerEligible","closed","focusMovedOutside","closeAutoFocusScheduled","frame","fallbackTimer","observer","MutationObserver","onFocusIn","event","FocusEvent","canRestoreFocus","target","isConnected","document","body","documentElement","closest","matches","getClientRects","length","hasOtherOverlay","querySelectorAll","some","overlay","contains","DialogFocusRestorationOptions","open","restoreFocusRef","onOpenAutoFocus","onCloseAutoFocus","createDialogFocusRestoration","callerOnOpenAutoFocus","callerOnCloseAutoFocus","focusCycles","WeakMap","activeFocusCycle","pendingOpener","pendingOpenerEligible","active","activeElement","finishFocusCycle","cycle","undefined","window","cancelAnimationFrame","clearTimeout","disconnect","removeEventListener","scheduleFocusRestore","requestAnimationFrame","focusIsAvailable","Node","focus","preventScroll","Event","element","currentTarget","openerWasCaptured","focusEvent","set","addEventListener","get","defaultPrevented","observe","attributes","attributeFilter","childList","subtree","queueMicrotask","setTimeout","props","_$createComponent","DialogTrigger","Trigger","DialogPortal","Portal","DialogOverlay","local","rest","_$mergeProps","class","DialogContentProps","closeButton","Element","positioner","DialogContent","children","_el$","_tmpl$","_$insert","_$memo","when","as","CloseButton","_$effect","_$className","DialogHeader","_el$2","_tmpl$2","_$spread","DialogFooter","_el$3","_tmpl$3","DialogTitle","Title","DialogDescription","Description","DialogCloseButton","DialogClose","Dialog","_$createComponent","KobalteDialog","KobalteDialogOverlay","_$mergeProps","KobalteDialogContent","_$memo","_$className"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n Overlay as KobalteDialogOverlay,\n} from '@kobalte/core/dialog'\n// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { createRenderEffect, onCleanup, Show, splitProps } from 'solid-js'\nimport {\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlaySurface,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'\n\ntype FocusCycle = {\n content: HTMLElement\n opener: HTMLElement | null\n openerEligible: boolean\n closed: boolean\n focusMovedOutside: boolean\n closeAutoFocusScheduled: boolean\n frame?: number\n fallbackTimer?: number\n observer?: MutationObserver\n onFocusIn: (event: FocusEvent) => void\n}\n\nfunction canRestoreFocus(target: HTMLElement): boolean {\n return (\n target.isConnected &&\n target !== document.body &&\n target !== document.documentElement &&\n !target.closest('[inert], [aria-hidden=\"true\"]') &&\n !target.matches(':disabled') &&\n target.getClientRects().length > 0\n )\n}\n\nfunction hasOtherOverlay(content: HTMLElement, opener: HTMLElement): boolean {\n return [...document.querySelectorAll<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]')].some(\n (overlay) =>\n overlay !== content &&\n !content.contains(overlay) &&\n !overlay.contains(opener) &&\n !overlay.closest('[aria-hidden=\"true\"], [inert]') &&\n overlay.getClientRects().length > 0\n )\n}\n\ntype DialogFocusRestorationOptions = {\n open: Accessor<boolean>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n onOpenAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onOpenAutoFocus']\n onCloseAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onCloseAutoFocus']\n}\n\n/**\n * Adds guarded opener capture and restoration to a Kobalte dialog content.\n * Composed surfaces use this internal helper; it is omitted from the public\n * dialog barrel so the restoration policy stays with the dialog components.\n */\nexport function createDialogFocusRestoration({\n open,\n restoreFocusRef,\n onOpenAutoFocus: callerOnOpenAutoFocus,\n onCloseAutoFocus: callerOnCloseAutoFocus,\n}: DialogFocusRestorationOptions) {\n const focusCycles = new WeakMap<HTMLElement, FocusCycle>()\n let activeFocusCycle: FocusCycle | undefined\n let pendingOpener: HTMLElement | null = null\n let pendingOpenerEligible = false\n\n createRenderEffect(() => {\n if (!open() || typeof document === 'undefined') {\n pendingOpener = null\n pendingOpenerEligible = false\n return\n }\n const active = restoreFocusRef?.() ?? document.activeElement\n pendingOpener = active instanceof HTMLElement ? active : null\n pendingOpenerEligible = active instanceof HTMLElement && canRestoreFocus(active)\n })\n\n const finishFocusCycle = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) window.cancelAnimationFrame(cycle.frame)\n if (cycle.fallbackTimer !== undefined) window.clearTimeout(cycle.fallbackTimer)\n cycle.observer?.disconnect()\n document.removeEventListener('focusin', cycle.onFocusIn)\n if (activeFocusCycle === cycle) activeFocusCycle = undefined\n }\n\n const scheduleFocusRestore = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) return\n cycle.frame = window.requestAnimationFrame(() => {\n cycle.frame = undefined\n const opener = cycle.opener\n const active = document.activeElement\n const focusIsAvailable =\n active === document.body ||\n active === document.documentElement ||\n active === cycle.content ||\n (active instanceof Node && cycle.content.contains(active))\n if (\n activeFocusCycle !== cycle ||\n !cycle.closed ||\n cycle.focusMovedOutside ||\n !opener ||\n !opener.isConnected ||\n opener.matches(':disabled') ||\n opener.getClientRects().length === 0 ||\n !focusIsAvailable ||\n hasOtherOverlay(cycle.content, opener)\n ) {\n finishFocusCycle(cycle)\n return\n }\n\n // Inert and aria-hidden are removed by the dialog's containment cleanup.\n // Wait for that cleanup before returning focus to the original control.\n if (opener.closest('[inert], [aria-hidden=\"true\"]')) return\n if (cycle.openerEligible && canRestoreFocus(opener)) {\n opener.focus({ preventScroll: true })\n }\n finishFocusCycle(cycle)\n })\n }\n\n const onOpenAutoFocus = (event: Event) => {\n const element = event.currentTarget\n if (element instanceof HTMLElement) {\n if (activeFocusCycle) finishFocusCycle(activeFocusCycle)\n\n const openerWasCaptured = pendingOpener !== null\n const opener = pendingOpener ?? document.activeElement\n const openerEligible = openerWasCaptured\n ? pendingOpenerEligible\n : opener instanceof HTMLElement && canRestoreFocus(opener)\n pendingOpener = null\n pendingOpenerEligible = false\n const cycle: FocusCycle = {\n content: element,\n opener: opener instanceof HTMLElement ? opener : null,\n openerEligible,\n closed: false,\n focusMovedOutside: false,\n closeAutoFocusScheduled: false,\n onFocusIn: (focusEvent) => {\n const target = focusEvent.target\n if (\n !(target instanceof HTMLElement) ||\n target === document.body ||\n target === document.documentElement\n ) {\n return\n }\n if (\n target === element ||\n element.contains(target) ||\n target === (opener instanceof HTMLElement ? opener : null)\n ) {\n if (!cycle.closed) cycle.focusMovedOutside = false\n return\n }\n cycle.focusMovedOutside = true\n },\n }\n focusCycles.set(element, cycle)\n activeFocusCycle = cycle\n document.addEventListener('focusin', cycle.onFocusIn)\n }\n callerOnOpenAutoFocus?.(event)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n const element = event.currentTarget\n const cycle = element instanceof HTMLElement ? focusCycles.get(element) : undefined\n callerOnCloseAutoFocus?.(event)\n\n if (!cycle) return\n cycle.closed = true\n\n // A caller that prevents Kobalte's close autofocus owns the focus decision.\n if (event.defaultPrevented) {\n finishFocusCycle(cycle)\n return\n }\n\n if (cycle.fallbackTimer !== undefined) {\n window.clearTimeout(cycle.fallbackTimer)\n cycle.fallbackTimer = undefined\n }\n cycle.closeAutoFocusScheduled = true\n cycle.observer = new MutationObserver(() => scheduleFocusRestore(cycle))\n cycle.observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['aria-hidden', 'inert'],\n childList: true,\n subtree: true,\n })\n scheduleFocusRestore(cycle)\n }\n\n onCleanup(() => {\n const cycle = activeFocusCycle\n if (!cycle) return\n cycle.closed = true\n\n // Kobalte dispatches unmount autofocus from a timer. This fallback only\n // releases the scoped focus listener if the content did not dispatch it.\n queueMicrotask(() => {\n if (cycle.closeAutoFocusScheduled) return\n cycle.fallbackTimer = window.setTimeout(() => {\n cycle.fallbackTimer = undefined\n if (!cycle.closeAutoFocusScheduled) finishFocusCycle(cycle)\n }, 0)\n })\n })\n\n return { onOpenAutoFocus, onCloseAutoFocus }\n}\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task. `Dialog.Portal` keeps the\n * panel out of the app's stacking and overflow contexts, `Dialog.Overlay`\n * dims what is behind it, and Kobalte handles the focus trap, the escape key,\n * scroll locking and returning focus to the trigger on close.\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport function Dialog(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function DialogPortal(props: ComponentProps<typeof KobalteDialog.Portal>) {\n return <KobalteDialog.Portal {...props} />\n}\n\nexport function DialogOverlay(props: ComponentProps<typeof KobalteDialogOverlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialogOverlay\n class={cn(\n overlayScrim,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof KobalteDialogContent> & {\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n}\n\nexport function DialogContent(props: DialogContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'closeButton', 'positioner'])\n\n return (\n <KobalteDialog.Portal>\n <DialogOverlay />\n <div class={cn(overlayPositioner, local.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}>\n <KobalteDialogContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'relative grid w-full max-w-lg gap-4 p-5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment while its accessible name stays \"Close\". */}\n <Tooltip>\n <TooltipTrigger\n as={KobalteDialog.CloseButton}\n aria-label=\"Close\"\n class={cn(\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground',\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n )}\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>Close dialog.</TooltipContent>\n </Tooltip>\n </Show>\n </KobalteDialogContent>\n </div>\n </KobalteDialog.Portal>\n )\n}\n\nexport function DialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn('flex flex-col gap-1.5 pe-6 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-footer\"\n class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function DialogDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function DialogCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n\n/**\n * The close control, unstyled and polymorphic — for a footer's text \"Cancel\" or\n * \"Close\", which is a different control from the corner icon `DialogCloseButton`\n * draws. Take it as `as={Button}` so it carries the button's variants rather than\n * a copied class string.\n */\nexport function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;;AAgCA,SAASsC,gBAAgBC,QAA8B;CACrD,OACEA,O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OAAmD;CAC7E,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQlG,OAAcmI,OAAKzB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAGD,cAAcuF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAC5E;AAEA,SAAgB2B,kBAAkBnC,OAAyD;CACzF,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBACGlG,OAAcqI,aAAW3B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAG,iCAAiCsF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAEhG;AAEA,SAAgB6B,kBAAkBrC,OAAyD;CACzF,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQlG,OAAcwH,aAAWd,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAG,cAAcsF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF;;;;;;;AAQA,SAAgB8B,YAAYtC,OAAyD;CACnF,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQlG,OAAcwH,aAAWd,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAG,cAAcsF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF"}
1
+ {"version":3,"file":"dialog.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","Overlay","KobalteDialogOverlay","X","Accessor","ComponentProps","JSX","createRenderEffect","onCleanup","Show","splitProps","dialogSurface","overlayMotion","overlayPositioner","overlayScrim","overlayTitle","cn","Tooltip","TooltipContent","TooltipTrigger","FocusCycle","content","HTMLElement","opener","openerEligible","closed","focusMovedOutside","closeAutoFocusScheduled","frame","fallbackTimer","observer","MutationObserver","onFocusIn","event","FocusEvent","canRestoreFocus","target","isConnected","document","body","documentElement","closest","matches","getClientRects","length","hasOtherOverlay","querySelectorAll","some","overlay","contains","DialogFocusRestorationOptions","open","restoreFocusRef","onOpenAutoFocus","onCloseAutoFocus","createDialogFocusRestoration","callerOnOpenAutoFocus","callerOnCloseAutoFocus","focusCycles","WeakMap","activeFocusCycle","pendingOpener","pendingOpenerEligible","active","activeElement","finishFocusCycle","cycle","undefined","window","cancelAnimationFrame","clearTimeout","disconnect","removeEventListener","scheduleFocusRestore","requestAnimationFrame","focusIsAvailable","Node","focus","preventScroll","Event","element","currentTarget","openerWasCaptured","focusEvent","set","addEventListener","get","defaultPrevented","observe","attributes","attributeFilter","childList","subtree","queueMicrotask","setTimeout","props","_$createComponent","DialogTrigger","Trigger","DialogPortal","Portal","DialogOverlay","local","rest","_$mergeProps","class","DialogContentProps","closeButton","Element","positioner","DialogContent","children","_el$","_tmpl$","_$insert","_$memo","when","as","CloseButton","_$effect","_$className","DialogHeader","_el$2","_tmpl$2","_$spread","DialogFooter","_el$3","_tmpl$3","DialogTitle","Title","DialogDescription","Description","DialogCloseButton","DialogClose","Dialog","_$createComponent","KobalteDialog","KobalteDialogOverlay","_$mergeProps","KobalteDialogContent","_$memo","_$className"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n Overlay as KobalteDialogOverlay,\n} from '@kobalte/core/dialog'\n// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { createRenderEffect, onCleanup, Show, splitProps } from 'solid-js'\nimport {\n dialogSurface,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'\n\ntype FocusCycle = {\n content: HTMLElement\n opener: HTMLElement | null\n openerEligible: boolean\n closed: boolean\n focusMovedOutside: boolean\n closeAutoFocusScheduled: boolean\n frame?: number\n fallbackTimer?: number\n observer?: MutationObserver\n onFocusIn: (event: FocusEvent) => void\n}\n\nfunction canRestoreFocus(target: HTMLElement): boolean {\n return (\n target.isConnected &&\n target !== document.body &&\n target !== document.documentElement &&\n !target.closest('[inert], [aria-hidden=\"true\"]') &&\n !target.matches(':disabled') &&\n target.getClientRects().length > 0\n )\n}\n\nfunction hasOtherOverlay(content: HTMLElement, opener: HTMLElement): boolean {\n return [...document.querySelectorAll<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]')].some(\n (overlay) =>\n overlay !== content &&\n !content.contains(overlay) &&\n !overlay.contains(opener) &&\n !overlay.closest('[aria-hidden=\"true\"], [inert]') &&\n overlay.getClientRects().length > 0\n )\n}\n\ntype DialogFocusRestorationOptions = {\n open: Accessor<boolean>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n onOpenAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onOpenAutoFocus']\n onCloseAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onCloseAutoFocus']\n}\n\n/**\n * Adds guarded opener capture and restoration to a Kobalte dialog content.\n * Composed surfaces use this internal helper; it is omitted from the public\n * dialog barrel so the restoration policy stays with the dialog components.\n */\nexport function createDialogFocusRestoration({\n open,\n restoreFocusRef,\n onOpenAutoFocus: callerOnOpenAutoFocus,\n onCloseAutoFocus: callerOnCloseAutoFocus,\n}: DialogFocusRestorationOptions) {\n const focusCycles = new WeakMap<HTMLElement, FocusCycle>()\n let activeFocusCycle: FocusCycle | undefined\n let pendingOpener: HTMLElement | null = null\n let pendingOpenerEligible = false\n\n createRenderEffect(() => {\n if (!open() || typeof document === 'undefined') {\n pendingOpener = null\n pendingOpenerEligible = false\n return\n }\n const active = restoreFocusRef?.() ?? document.activeElement\n pendingOpener = active instanceof HTMLElement ? active : null\n pendingOpenerEligible = active instanceof HTMLElement && canRestoreFocus(active)\n })\n\n const finishFocusCycle = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) window.cancelAnimationFrame(cycle.frame)\n if (cycle.fallbackTimer !== undefined) window.clearTimeout(cycle.fallbackTimer)\n cycle.observer?.disconnect()\n document.removeEventListener('focusin', cycle.onFocusIn)\n if (activeFocusCycle === cycle) activeFocusCycle = undefined\n }\n\n const scheduleFocusRestore = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) return\n cycle.frame = window.requestAnimationFrame(() => {\n cycle.frame = undefined\n const opener = cycle.opener\n const active = document.activeElement\n const focusIsAvailable =\n active === document.body ||\n active === document.documentElement ||\n active === cycle.content ||\n (active instanceof Node && cycle.content.contains(active))\n if (\n activeFocusCycle !== cycle ||\n !cycle.closed ||\n cycle.focusMovedOutside ||\n !opener ||\n !opener.isConnected ||\n opener.matches(':disabled') ||\n opener.getClientRects().length === 0 ||\n !focusIsAvailable ||\n hasOtherOverlay(cycle.content, opener)\n ) {\n finishFocusCycle(cycle)\n return\n }\n\n // Inert and aria-hidden are removed by the dialog's containment cleanup.\n // Wait for that cleanup before returning focus to the original control.\n if (opener.closest('[inert], [aria-hidden=\"true\"]')) return\n if (cycle.openerEligible && canRestoreFocus(opener)) {\n opener.focus({ preventScroll: true })\n }\n finishFocusCycle(cycle)\n })\n }\n\n const onOpenAutoFocus = (event: Event) => {\n const element = event.currentTarget\n if (element instanceof HTMLElement) {\n if (activeFocusCycle) finishFocusCycle(activeFocusCycle)\n\n const openerWasCaptured = pendingOpener !== null\n const opener = pendingOpener ?? document.activeElement\n const openerEligible = openerWasCaptured\n ? pendingOpenerEligible\n : opener instanceof HTMLElement && canRestoreFocus(opener)\n pendingOpener = null\n pendingOpenerEligible = false\n const cycle: FocusCycle = {\n content: element,\n opener: opener instanceof HTMLElement ? opener : null,\n openerEligible,\n closed: false,\n focusMovedOutside: false,\n closeAutoFocusScheduled: false,\n onFocusIn: (focusEvent) => {\n const target = focusEvent.target\n if (\n !(target instanceof HTMLElement) ||\n target === document.body ||\n target === document.documentElement\n ) {\n return\n }\n if (\n target === element ||\n element.contains(target) ||\n target === (opener instanceof HTMLElement ? opener : null)\n ) {\n if (!cycle.closed) cycle.focusMovedOutside = false\n return\n }\n cycle.focusMovedOutside = true\n },\n }\n focusCycles.set(element, cycle)\n activeFocusCycle = cycle\n document.addEventListener('focusin', cycle.onFocusIn)\n }\n callerOnOpenAutoFocus?.(event)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n const element = event.currentTarget\n const cycle = element instanceof HTMLElement ? focusCycles.get(element) : undefined\n callerOnCloseAutoFocus?.(event)\n\n if (!cycle) return\n cycle.closed = true\n\n // A caller that prevents Kobalte's close autofocus owns the focus decision.\n if (event.defaultPrevented) {\n finishFocusCycle(cycle)\n return\n }\n\n if (cycle.fallbackTimer !== undefined) {\n window.clearTimeout(cycle.fallbackTimer)\n cycle.fallbackTimer = undefined\n }\n cycle.closeAutoFocusScheduled = true\n cycle.observer = new MutationObserver(() => scheduleFocusRestore(cycle))\n cycle.observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['aria-hidden', 'inert'],\n childList: true,\n subtree: true,\n })\n scheduleFocusRestore(cycle)\n }\n\n onCleanup(() => {\n const cycle = activeFocusCycle\n if (!cycle) return\n cycle.closed = true\n\n // Kobalte dispatches unmount autofocus from a timer. This fallback only\n // releases the scoped focus listener if the content did not dispatch it.\n queueMicrotask(() => {\n if (cycle.closeAutoFocusScheduled) return\n cycle.fallbackTimer = window.setTimeout(() => {\n cycle.fallbackTimer = undefined\n if (!cycle.closeAutoFocusScheduled) finishFocusCycle(cycle)\n }, 0)\n })\n })\n\n return { onOpenAutoFocus, onCloseAutoFocus }\n}\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task. `Dialog.Portal` keeps the\n * panel out of the app's stacking and overflow contexts, `Dialog.Overlay`\n * dims what is behind it, and Kobalte handles the focus trap, the escape key,\n * scroll locking and returning focus to the trigger on close.\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport function Dialog(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function DialogPortal(props: ComponentProps<typeof KobalteDialog.Portal>) {\n return <KobalteDialog.Portal {...props} />\n}\n\nexport function DialogOverlay(props: ComponentProps<typeof KobalteDialogOverlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialogOverlay\n class={cn(\n overlayScrim,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof KobalteDialogContent> & {\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n}\n\nexport function DialogContent(props: DialogContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'closeButton', 'positioner'])\n\n return (\n <KobalteDialog.Portal>\n <DialogOverlay />\n <div class={cn(overlayPositioner, local.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}>\n <KobalteDialogContent\n class={cn(\n dialogSurface,\n overlayMotion,\n 'relative grid w-full max-w-lg gap-4 p-5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n {/* The corner close is icon-only, so it carries the shared tooltip\n treatment while its accessible name stays \"Close\". */}\n <Tooltip>\n <TooltipTrigger\n as={KobalteDialog.CloseButton}\n aria-label=\"Close\"\n class={cn(\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground',\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n )}\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </TooltipTrigger>\n <TooltipContent>Close dialog.</TooltipContent>\n </Tooltip>\n </Show>\n </KobalteDialogContent>\n </div>\n </KobalteDialog.Portal>\n )\n}\n\nexport function DialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn('flex flex-col gap-1.5 pe-6 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-footer\"\n class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function DialogDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function DialogCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n\n/**\n * The close control, unstyled and polymorphic — for a footer's text \"Cancel\" or\n * \"Close\", which is a different control from the corner icon `DialogCloseButton`\n * draws. Take it as `as={Button}` so it carries the button's variants rather than\n * a copied class string.\n */\nexport function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;;AAgCA,SAASsC,gBAAgBC,QAA8B;CACrD,OACEA,OAAOC,eACPD,WAAWE,SAASC,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AOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQlG,OAAcmI,OAAKzB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAGD,cAAcuF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAC5E;AAEA,SAAgB2B,kBAAkBnC,OAAyD;CACzF,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBACGlG,OAAcqI,aAAW3B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAG,iCAAiCsF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAEhG;AAEA,SAAgB6B,kBAAkBrC,OAAyD;CACzF,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQlG,OAAcwH,aAAWd,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAG,cAAcsF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF;;;;;;;AAQA,SAAgB8B,YAAYtC,OAAyD;CACnF,MAAM,CAACO,OAAOC,QAAQ7F,WAAWqF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQlG,OAAcwH,aAAWd,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQxF,GAAG,cAAcsF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF"}
@@ -43,7 +43,7 @@ function DrawerContent(props) {
43
43
  ]);
44
44
  return createComponent(DrawerPrimitive.Portal, { get children() {
45
45
  return [createComponent(DrawerOverlay, {}), createComponent(DrawerPrimitive.Content, mergeProps({ get ["class"]() {
46
- return cn("group/drawer bg-popover text-popover-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg", "data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t", "data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b", "data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e", "data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s", local.class);
46
+ return cn("group/drawer bg-background text-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg", "data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t", "data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b", "data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e", "data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s", local.class);
47
47
  } }, rest, { get children() {
48
48
  return [memo(() => memo(() => !!local.withHandle)() ? (() => {
49
49
  var _el$ = _tmpl$();
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["DrawerPrimitive","ComponentProps","splitProps","cn","headingVariants","Drawer","props","_$createComponent","DrawerTrigger","Trigger","DrawerOverlay","Overlay","local","rest","_$mergeProps","class","DrawerContentProps","Omit","Content","side","withHandle","DrawerContent","Portal","children","_$memo","_el$","_tmpl$","_$effect","_$className","DrawerTitle","Label","size","leading","DrawerDescription","Description","DrawerCloseButton","Close","DrawerHeader","_el$2","_tmpl$2","_$spread","DrawerBody","_el$3","_tmpl$3","DrawerFooter","_el$4","_tmpl$4","_$createComponent","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/drawer/drawer.tsx"],"sourcesContent":["import DrawerPrimitive from '@corvu/drawer'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Drawer.\n *\n * A sheet the user can drag away: it opens from an edge, carries a handle, and\n * closes by swipe as well as by button. That drag affordance is the reason to\n * choose it over Sheet — the gesture is for content the user is *finishing*\n * with (a summary, a queue, a confirmation), not for browsing.\n *\n * On a large window a Drawer is usually the wrong control: dragging is a touch\n * idiom, and on a desktop the same content is better as a Sheet or a Dialog.\n * The exceptions are the surfaces a pointer also drags naturally — a bottom\n * console, a media panel.\n *\n * corvu supplies the drag physics, the snap points and the pointer capture.\n */\nexport function Drawer(props: ComponentProps<typeof DrawerPrimitive>) {\n return <DrawerPrimitive {...props} />\n}\n\nexport function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger {...props} />\n}\n\nexport function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <DrawerPrimitive.Overlay\n class={cn(\n 'fixed inset-0 z-(--z-drawer) bg-scrim/50',\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DrawerContentProps = Omit<ComponentProps<typeof DrawerPrimitive.Content>, 'side'> & {\n /**\n * Not accepted here. corvu reads the side from the root `Drawer`, which uses it\n * for the drag axis and publishes it as `data-side`; a `side` on the content\n * would type-check through the polymorphic props and be silently ignored,\n * leaving the drawer on the bottom edge. Set `<Drawer side=\"right\">` instead.\n */\n side?: never\n /**\n * Draw the grabber at the leading edge of the sheet.\n *\n * It is an affordance, not the drag target: corvu makes the whole sheet\n * draggable, exactly as the platform's own sheets behave. So this is\n * `aria-hidden` decoration that tells the user the sheet can be pulled — it\n * carries no behaviour and must not be the only thing that moves.\n */\n withHandle?: boolean\n}\n\nexport function DrawerContent(props: DrawerContentProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'children'])\n\n return (\n <DrawerPrimitive.Portal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n class={cn(\n 'group/drawer bg-popover text-popover-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg',\n 'data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t',\n 'data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b',\n 'data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e',\n 'data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <span\n aria-hidden=\"true\"\n class={cn(\n 'bg-muted shrink-0 self-center',\n 'group-data-[side=bottom]/drawer:mt-2 group-data-[side=bottom]/drawer:h-1.5 group-data-[side=bottom]/drawer:w-10 group-data-[side=bottom]/drawer:rounded-full'\n )}\n />\n ) : null}\n {local.children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n )\n}\n\nexport function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Label\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerCloseButton(props: ComponentProps<typeof DrawerPrimitive.Close>) {\n const [local, rest] = splitProps(props, ['class'])\n return <DrawerPrimitive.Close class={cn('focus-ring', local.class)} {...rest} />\n}\n\nexport function DrawerHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-header\"\n class={cn('flex flex-col gap-1.5 p-5 pb-3 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto px-5 pb-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-footer\"\n class={cn('flex flex-col-reverse gap-2 p-5 pt-3 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBK,OAAOC,OAA+C;CACpE,OAAAC,gBAAQP,iBAAoBM,KAAK;AACnC;AAEA,SAAgBE,cAAcF,OAAuD;CACnF,OAAAC,gBAAQP,gBAAgBS,SAAYH,KAAK;AAC3C;AAEA,SAAgBI,cAAcJ,OAAuD;CACnF,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGP,gBAAgBW,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfX,GACL,4CACA,mGACAS,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;AAqBA,SAAgBQ,cAAcf,OAA2B;CACvD,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO;EAAC;EAAS;EAAc;CAAU,CAAC;CAE3E,OAAAC,gBACGP,gBAAgBsB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAA,CAAAhB,gBACpBG,eAAa,CAAA,CAAA,GAAAH,gBACbP,gBAAgBkB,SAAOJ,WAAA,EAAA,KAAA,WAAA;GAAA,OACfX,GACL,8GACA,wJACA,sIACA,o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D,cAAA;EAAA,IAAAgC,QAAAC,QAAA;EAAAC,OAAAF,OAAAxB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWX,GAAG,6CAA6CS,MAAMG,KAAK;EAAC,EAAA,GAC/DF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAyB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBG,WAAWnC,OAA8B;CACvD,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAoC,QAAAC,QAAA;EAAAH,OAAAE,OAAA5B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWX,GAAG,4CAA4CS,MAAMG,KAAK;EAAC,EAAA,GAC9DF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA6B;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,aAAatC,OAA8B;CACzD,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAuC,QAAAC,QAAA;EAAAN,OAAAK,OAAA/B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWX,GAAG,mEAAmES,MAAMG,KAAK;EAAC,EAAA,GACrFF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAgC;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"drawer.js","names":["DrawerPrimitive","ComponentProps","splitProps","cn","headingVariants","Drawer","props","_$createComponent","DrawerTrigger","Trigger","DrawerOverlay","Overlay","local","rest","_$mergeProps","class","DrawerContentProps","Omit","Content","side","withHandle","DrawerContent","Portal","children","_$memo","_el$","_tmpl$","_$effect","_$className","DrawerTitle","Label","size","leading","DrawerDescription","Description","DrawerCloseButton","Close","DrawerHeader","_el$2","_tmpl$2","_$spread","DrawerBody","_el$3","_tmpl$3","DrawerFooter","_el$4","_tmpl$4","_$createComponent","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/drawer/drawer.tsx"],"sourcesContent":["import DrawerPrimitive from '@corvu/drawer'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Drawer.\n *\n * A sheet the user can drag away: it opens from an edge, carries a handle, and\n * closes by swipe as well as by button. That drag affordance is the reason to\n * choose it over Sheet — the gesture is for content the user is *finishing*\n * with (a summary, a queue, a confirmation), not for browsing.\n *\n * On a large window a Drawer is usually the wrong control: dragging is a touch\n * idiom, and on a desktop the same content is better as a Sheet or a Dialog.\n * The exceptions are the surfaces a pointer also drags naturally — a bottom\n * console, a media panel.\n *\n * corvu supplies the drag physics, the snap points and the pointer capture.\n */\nexport function Drawer(props: ComponentProps<typeof DrawerPrimitive>) {\n return <DrawerPrimitive {...props} />\n}\n\nexport function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger {...props} />\n}\n\nexport function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <DrawerPrimitive.Overlay\n class={cn(\n 'fixed inset-0 z-(--z-drawer) bg-scrim/50',\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DrawerContentProps = Omit<ComponentProps<typeof DrawerPrimitive.Content>, 'side'> & {\n /**\n * Not accepted here. corvu reads the side from the root `Drawer`, which uses it\n * for the drag axis and publishes it as `data-side`; a `side` on the content\n * would type-check through the polymorphic props and be silently ignored,\n * leaving the drawer on the bottom edge. Set `<Drawer side=\"right\">` instead.\n */\n side?: never\n /**\n * Draw the grabber at the leading edge of the sheet.\n *\n * It is an affordance, not the drag target: corvu makes the whole sheet\n * draggable, exactly as the platform's own sheets behave. So this is\n * `aria-hidden` decoration that tells the user the sheet can be pulled — it\n * carries no behaviour and must not be the only thing that moves.\n */\n withHandle?: boolean\n}\n\nexport function DrawerContent(props: DrawerContentProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'children'])\n\n return (\n <DrawerPrimitive.Portal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n class={cn(\n 'group/drawer bg-background text-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg',\n 'data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t',\n 'data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b',\n 'data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e',\n 'data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <span\n aria-hidden=\"true\"\n class={cn(\n 'bg-muted shrink-0 self-center',\n 'group-data-[side=bottom]/drawer:mt-2 group-data-[side=bottom]/drawer:h-1.5 group-data-[side=bottom]/drawer:w-10 group-data-[side=bottom]/drawer:rounded-full'\n )}\n />\n ) : null}\n {local.children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n )\n}\n\nexport function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Label\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerCloseButton(props: ComponentProps<typeof DrawerPrimitive.Close>) {\n const [local, rest] = splitProps(props, ['class'])\n return <DrawerPrimitive.Close class={cn('focus-ring', local.class)} {...rest} />\n}\n\nexport function DrawerHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-header\"\n class={cn('flex flex-col gap-1.5 p-5 pb-3 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto px-5 pb-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-footer\"\n class={cn('flex flex-col-reverse gap-2 p-5 pt-3 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBK,OAAOC,OAA+C;CACpE,OAAAC,gBAAQP,iBAAoBM,KAAK;AACnC;AAEA,SAAgBE,cAAcF,OAAuD;CACnF,OAAAC,gBAAQP,gBAAgBS,SAAYH,KAAK;AAC3C;AAEA,SAAgBI,cAAcJ,OAAuD;CACnF,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGP,gBAAgBW,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfX,GACL,4CACA,mGACAS,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;AAqBA,SAAgBQ,cAAcf,OAA2B;CACvD,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO;EAAC;EAAS;EAAc;CAAU,CAAC;CAE3E,OAAAC,gBACGP,gBAAgBsB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAA,CAAAhB,gBACpBG,eAAa,CAAA,CAAA,GAAAH,gBACbP,gBAAgBkB,SAAOJ,WAAA,EAAA,KAAA,WAAA;GAAA,OACfX,GACL,y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C,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAgC,QAAAC,QAAA;EAAAC,OAAAF,OAAAxB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWX,GAAG,6CAA6CS,MAAMG,KAAK;EAAC,EAAA,GAC/DF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAyB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBG,WAAWnC,OAA8B;CACvD,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAoC,QAAAC,QAAA;EAAAH,OAAAE,OAAA5B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWX,GAAG,4CAA4CS,MAAMG,KAAK;EAAC,EAAA,GAC9DF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA6B;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,aAAatC,OAA8B;CACzD,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAuC,QAAAC,QAAA;EAAAN,OAAAK,OAAA/B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWX,GAAG,mEAAmES,MAAMG,KAAK;EAAC,EAAA,GACrFF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAgC;CAAA,EAAA,CAAA;AAGd"}
@@ -1,5 +1,6 @@
1
1
  import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu';
2
2
  import type { ComponentProps } from 'solid-js';
3
+ import { type MenuSwatchTone } from '#lib/overlay';
3
4
  /**
4
5
  * DropdownMenu.
5
6
  *
@@ -23,6 +24,13 @@ export declare function DropdownMenu(props: ComponentProps<typeof KobalteDropdow
23
24
  export declare function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>): import("solid-js").JSX.Element;
24
25
  export declare function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>): import("solid-js").JSX.Element;
25
26
  export type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {
27
+ /**
28
+ * Kept for callers that hid the arrow explicitly; the arrow is now hidden by
29
+ * default. Pass `false` to draw one. The default flipped because Kobalte
30
+ * reserves half of the arrow's 30px box as popper gutter — a menu anchored to
31
+ * its trigger floated 15px off it, which read as a gap rather than as a
32
+ * pointer, and every anchored caller already passed `hideArrow`.
33
+ */
26
34
  hideArrow?: boolean;
27
35
  /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */
28
36
  portalMount?: HTMLElement;
@@ -40,6 +48,10 @@ export declare function DropdownMenuItem(props: ComponentProps<typeof KobalteDro
40
48
  * whenever `shortcut` is drawn.
41
49
  */
42
50
  keyshortcuts?: string;
51
+ /** Draw a leading colour dot from the shared tone ladder — the accent or
52
+ * status role the option's card badge carries. `aria-hidden`; the label
53
+ * carries the meaning. */
54
+ swatch?: MenuSwatchTone;
43
55
  }): import("solid-js").JSX.Element;
44
56
  /**
45
57
  * The chord drawn at a row's trailing edge.
@@ -53,9 +65,17 @@ export declare function DropdownMenuItem(props: ComponentProps<typeof KobalteDro
53
65
  * exactly its label.
54
66
  */
55
67
  export declare function DropdownMenuShortcut(props: ComponentProps<'span'>): import("solid-js").JSX.Element;
56
- export declare function DropdownMenuCheckboxItem(props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>): import("solid-js").JSX.Element;
68
+ export declare function DropdownMenuCheckboxItem(props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem> & {
69
+ /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;
70
+ * the label carries the meaning. */
71
+ swatch?: MenuSwatchTone;
72
+ }): import("solid-js").JSX.Element;
57
73
  export declare function DropdownMenuRadioGroup(props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>): import("solid-js").JSX.Element;
58
- export declare function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>): import("solid-js").JSX.Element;
74
+ export declare function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem> & {
75
+ /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;
76
+ * the label carries the meaning. */
77
+ swatch?: MenuSwatchTone;
78
+ }): import("solid-js").JSX.Element;
59
79
  /**
60
80
  * The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a
61
81
  * child of the group it names: Kobalte reads the group from context, so a label
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,UAAU,CAAA;AA2BxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,kCAQ7E;AAqED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,kCA8D5F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,kCAE1F;AAED,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC1F,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gGAAgG;IAChG,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,kCAqBlE;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG;IACvD,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;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AO,mBAAmB,CAAC,UAAU,CAAC,kCAG7D;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,GAAG;IAC5D;wCACoC;IACpC,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,kCAoBF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAG7F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,kCAExF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,kCAGhG;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,GAAG,CAAC,kCAEpF;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAU7D;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAmB7D"}
@@ -1,12 +1,13 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface, topLayerProps } from "../../../lib/overlay.js";
3
- import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
2
+ import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, menuSwatchTone, overlayMotion, overlaySurface, topLayerProps } from "../../../lib/overlay.js";
3
+ import { className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
4
4
  import { Check, ChevronRight, Circle } from "lucide-solid";
5
- import { createContext, splitProps, useContext } from "solid-js";
5
+ import { Show, createContext, splitProps, useContext } from "solid-js";
6
6
  import { DropdownMenu } from "@kobalte/core/dropdown-menu";
7
7
  //#region src/components/ui/dropdown-menu/dropdown-menu.tsx
8
- var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true class="text-muted-foreground ms-auto font-code text-code tracking-widest">`);
9
- var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=dropdown-menu-shortcut aria-hidden=true>`);
8
+ var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
9
+ var _tmpl$2 = /*#__PURE__*/ template(`<span aria-hidden=true class="text-muted-foreground ms-auto font-code text-code tracking-widest">`);
10
+ var _tmpl$3 = /*#__PURE__*/ template(`<span data-slot=dropdown-menu-shortcut aria-hidden=true>`);
10
11
  var DropdownMenuOrientationContext = createContext();
11
12
  /**
12
13
  * DropdownMenu.
@@ -149,7 +150,7 @@ function DropdownMenuContent(props) {
149
150
  return createComponent(DropdownMenu.Content, mergeProps(topLayerProps, { get ["class"]() {
150
151
  return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
151
152
  } }, rest, { get children() {
152
- return [memo(() => memo(() => !!!local.hideArrow)() && createComponent(DropdownMenu.Arrow, {
153
+ return [memo(() => memo(() => local.hideArrow === false)() && createComponent(DropdownMenu.Arrow, {
153
154
  "aria-hidden": "true",
154
155
  "class": "fill-popover stroke-border"
155
156
  })), memo(() => local.children)];
@@ -163,6 +164,7 @@ function DropdownMenuItem(props) {
163
164
  "variant",
164
165
  "shortcut",
165
166
  "keyshortcuts",
167
+ "swatch",
166
168
  "children"
167
169
  ]);
168
170
  return createComponent(DropdownMenu.Item, mergeProps({
@@ -173,11 +175,24 @@ function DropdownMenuItem(props) {
173
175
  return local.keyshortcuts;
174
176
  }
175
177
  }, rest, { get children() {
176
- return [memo(() => local.children), memo(() => memo(() => !!local.shortcut)() ? (() => {
177
- var _el$ = _tmpl$();
178
- insert(_el$, () => local.shortcut);
179
- return _el$;
180
- })() : null)];
178
+ return [
179
+ createComponent(Show, {
180
+ get when() {
181
+ return local.swatch;
182
+ },
183
+ get children() {
184
+ var _el$ = _tmpl$();
185
+ effect(() => className(_el$, menuSwatchTone({ tone: local.swatch })));
186
+ return _el$;
187
+ }
188
+ }),
189
+ memo(() => local.children),
190
+ memo(() => memo(() => !!local.shortcut)() ? (() => {
191
+ var _el$2 = _tmpl$2();
192
+ insert(_el$2, () => local.shortcut);
193
+ return _el$2;
194
+ })() : null)
195
+ ];
181
196
  } }));
182
197
  }
183
198
  /**
@@ -194,42 +209,76 @@ function DropdownMenuItem(props) {
194
209
  function DropdownMenuShortcut(props) {
195
210
  const [local, rest] = splitProps(props, ["class"]);
196
211
  return (() => {
197
- var _el$2 = _tmpl$2();
198
- spread(_el$2, mergeProps({ get ["class"]() {
212
+ var _el$3 = _tmpl$3();
213
+ spread(_el$3, mergeProps({ get ["class"]() {
199
214
  return cn("text-muted-foreground ms-auto font-code text-code tracking-widest", local.class);
200
215
  } }, rest), false, false);
201
- return _el$2;
216
+ return _el$3;
202
217
  })();
203
218
  }
204
219
  function DropdownMenuCheckboxItem(props) {
205
- const [local, rest] = splitProps(props, ["class", "children"]);
220
+ const [local, rest] = splitProps(props, [
221
+ "class",
222
+ "swatch",
223
+ "children"
224
+ ]);
206
225
  return createComponent(DropdownMenu.CheckboxItem, mergeProps({ get ["class"]() {
207
226
  return cn(menuItem, "pe-8", local.class);
208
227
  } }, rest, { get children() {
209
- return [memo(() => local.children), createComponent(DropdownMenu.ItemIndicator, {
210
- "data-slot": "dropdown-menu-indicator",
211
- "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
212
- get children() {
213
- return createComponent(Check, { "class": "size-4" });
214
- }
215
- })];
228
+ return [
229
+ createComponent(Show, {
230
+ get when() {
231
+ return local.swatch;
232
+ },
233
+ get children() {
234
+ var _el$4 = _tmpl$();
235
+ effect(() => className(_el$4, menuSwatchTone({ tone: local.swatch })));
236
+ return _el$4;
237
+ }
238
+ }),
239
+ memo(() => local.children),
240
+ createComponent(DropdownMenu.ItemIndicator, {
241
+ "data-slot": "dropdown-menu-indicator",
242
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
243
+ get children() {
244
+ return createComponent(Check, { "class": "size-4" });
245
+ }
246
+ })
247
+ ];
216
248
  } }));
217
249
  }
218
250
  function DropdownMenuRadioGroup(props) {
219
251
  return createComponent(DropdownMenu.RadioGroup, props);
220
252
  }
221
253
  function DropdownMenuRadioItem(props) {
222
- const [local, rest] = splitProps(props, ["class", "children"]);
254
+ const [local, rest] = splitProps(props, [
255
+ "class",
256
+ "swatch",
257
+ "children"
258
+ ]);
223
259
  return createComponent(DropdownMenu.RadioItem, mergeProps({ get ["class"]() {
224
260
  return cn(menuItem, "pe-8", local.class);
225
261
  } }, rest, { get children() {
226
- return [memo(() => local.children), createComponent(DropdownMenu.ItemIndicator, {
227
- "data-slot": "dropdown-menu-indicator",
228
- "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
229
- get children() {
230
- return createComponent(Circle, { "class": "size-2 fill-current" });
231
- }
232
- })];
262
+ return [
263
+ createComponent(Show, {
264
+ get when() {
265
+ return local.swatch;
266
+ },
267
+ get children() {
268
+ var _el$5 = _tmpl$();
269
+ effect(() => className(_el$5, menuSwatchTone({ tone: local.swatch })));
270
+ return _el$5;
271
+ }
272
+ }),
273
+ memo(() => local.children),
274
+ createComponent(DropdownMenu.ItemIndicator, {
275
+ "data-slot": "dropdown-menu-indicator",
276
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
277
+ get children() {
278
+ return createComponent(Circle, { "class": "size-2 fill-current" });
279
+ }
280
+ })
281
+ ];
233
282
  } }));
234
283
  }
235
284
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","Accessor","ComponentProps","createContext","splitProps","useContext","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","MenuOrientation","DropdownMenuOrientationContext","HandlerEvent","Handler","args","Arguments","DropdownMenuTriggerKeyEvent","NonNullable","Trigger","DropdownMenuTriggerPointerEvent","props","local","rest","orientation","_$createComponent","Provider","value","children","_$mergeProps","modal","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","const","OverflowProperty","OverflowDeclaration","Readonly","property","priority","readInlineOverflow","element","HTMLElement","map","style","getPropertyValue","getPropertyPriority","declarationsMatch","declarations","every","bypassUnboundedScrollLookup","trigger","scrollRoot","document","scrollingElement","documentElement","window","getComputedStyle","overflow","temporaryStyles","Array","original","applied","parent","parentElement","computed","overflowX","overflowY","test","setProperty","push","length","queueMicrotask","isConnected","removeProperty","DropdownMenuTrigger","inheritedOrientation","onPointerDown","event","disabled","defaultPrevented","isPrimary","button","altKey","ctrlKey","metaKey","shiftKey","currentTarget","isNativeLink","HTMLAnchorElement","hasAttribute","focus","preventScroll","pointerType","preventDefault","onKeyDown","menubarOrientation","closest","getAttribute","openingArrow","includes","key","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","DropdownMenuContent","mount","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","DropdownMenuShortcut","_el$2","_tmpl$2","_$spread","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, splitProps, useContext } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\nconst DropdownMenuOrientationContext = createContext<Accessor<MenuOrientation | undefined>>()\ntype HandlerEvent<Handler> = Handler extends (...args: infer Arguments) => void\n ? Arguments[0]\n : never\ntype DropdownMenuTriggerKeyEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onKeyDown']>\n>\ntype DropdownMenuTriggerPointerEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onPointerDown']>\n>\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation'])\n const orientation = () => local.orientation\n return (\n <DropdownMenuOrientationContext.Provider value={orientation}>\n <KobalteDropdownMenu modal={local.modal ?? false} orientation={local.orientation} {...rest} />\n </DropdownMenuOrientationContext.Provider>\n )\n}\n\nconst SCROLLABLE_OVERFLOW = /(auto|scroll)/\nconst OVERFLOW_PROPERTIES = ['overflow', 'overflow-x', 'overflow-y'] as const\n\ntype OverflowProperty = (typeof OVERFLOW_PROPERTIES)[number]\ntype OverflowDeclaration = Readonly<{\n property: OverflowProperty\n value: string\n priority: string\n}>\n\nfunction readInlineOverflow(element: HTMLElement): OverflowDeclaration[] {\n return OVERFLOW_PROPERTIES.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property),\n }))\n}\n\nfunction declarationsMatch(element: HTMLElement, declarations: OverflowDeclaration[]) {\n return declarations.every(\n ({ property, value, priority }) =>\n element.style.getPropertyValue(property) === value &&\n element.style.getPropertyPriority(property) === priority\n )\n}\n\nfunction bypassUnboundedScrollLookup(trigger: HTMLElement) {\n const scrollRoot = document.scrollingElement ?? document.documentElement\n if (window.getComputedStyle(scrollRoot).overflow !== 'hidden') return\n\n const temporaryStyles: Array<{\n element: HTMLElement\n original: OverflowDeclaration[]\n applied: OverflowDeclaration[]\n }> = []\n\n for (let element: HTMLElement | null = trigger; element;) {\n const parent: HTMLElement | null = element.parentElement\n if (element !== scrollRoot) {\n const computed = window.getComputedStyle(element)\n const overflow = `${computed.overflow} ${computed.overflowX} ${computed.overflowY}`\n if (SCROLLABLE_OVERFLOW.test(overflow)) {\n const original = readInlineOverflow(element)\n element.style.setProperty('overflow', 'clip', 'important')\n temporaryStyles.push({ element, original, applied: readInlineOverflow(element) })\n }\n }\n element = parent\n }\n\n if (temporaryStyles.length === 0) return\n\n // Kobalte's keyboard path synchronously walks scroll parents before it opens\n // the menu. Clipping only non-root scroll ancestors makes that walk stop at\n // the locked viewport. Restore those declarations once the event handler\n // finishes, and leave any newer owner write untouched.\n queueMicrotask(() => {\n for (const { element, original, applied } of temporaryStyles) {\n if (!element.isConnected || !declarationsMatch(element, applied)) continue\n for (const property of OVERFLOW_PROPERTIES) element.style.removeProperty(property)\n for (const { property, value, priority } of original) {\n if (value) element.style.setProperty(property, value, priority)\n }\n }\n })\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n const inheritedOrientation = useContext(DropdownMenuOrientationContext)\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n if (typeof local.onPointerDown === 'function') local.onPointerDown(event)\n else if (local.onPointerDown) local.onPointerDown[0](local.onPointerDown[1], event)\n\n // WebKit can leave focus on a previous control when a native button gets\n // a pointer click. Focus the trigger before Kobalte opens the menu so an\n // enclosing modal focus scope does not restore focus and dismiss the menu.\n if (\n local.disabled ||\n event.defaultPrevented ||\n !event.isPrimary ||\n event.button !== 0 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n const trigger = event.currentTarget\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (trigger instanceof HTMLElement && !isNativeLink) {\n trigger.focus({ preventScroll: true })\n // Focusing first is not enough in WebKit: the press's default mousedown\n // action runs afterwards and moves focus off a button to the nearest\n // focusable ancestor — inside a dialog, the dialog — so the menu that\n // just opened still reads focus leaving it and closes. Cancelling the\n // default keeps focus where it was put.\n if (event.pointerType !== 'touch') event.preventDefault()\n }\n }\n const onKeyDown = (event: DropdownMenuTriggerKeyEvent) => {\n // Kobalte's MenuTrigger does not consult defaultPrevented before its own\n // open-key handling. Preserve its existing callback behavior; this wrapper\n // only makes the pre-open scroll-parent lookup terminate.\n if (typeof local.onKeyDown === 'function') local.onKeyDown(event)\n else if (local.onKeyDown) local.onKeyDown[0](local.onKeyDown[1], event)\n\n if (local.disabled) return\n const trigger = event.currentTarget\n if (!(trigger instanceof HTMLElement)) return\n const menubarOrientation = trigger.closest('[role=\"menubar\"]')?.getAttribute('aria-orientation')\n const orientation =\n inheritedOrientation?.() ?? (menubarOrientation === 'vertical' ? 'vertical' : 'horizontal')\n const openingArrow = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight'\n if (!['Enter', ' ', openingArrow].includes(event.key)) return\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (isNativeLink && (event.key === 'Enter' || event.key === ' ')) return\n bypassUnboundedScrollLookup(trigger)\n }\n\n return (\n <KobalteDropdownMenu.Trigger\n {...rest}\n disabled={local.disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n )\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {!local.hideArrow && <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n *\n * The glyphs are decorative: the span is `aria-hidden` and the parseable chord\n * belongs in the row's `aria-keyshortcuts`, so the item's accessible name stays\n * exactly its label.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n aria-hidden=\"true\"\n class={cn('text-muted-foreground ms-auto font-code text-code tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system — a canvas-colored dot on a checked row reads as decoration. */}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAMqB,iCAAiCd,cAAqD;;;;;;;;;;;;;;;;;;;;AA8B5F,SAAgBP,eAAa8B,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAO,CAAC,SAAS,aAAa,CAAC;CAChE,MAAMG,oBAAoBF,MAAME;CAChC,OAAAC,gBACGb,+BAA+Bc,UAAQ;EAACC,OAAOH;EAAW,IAAAI,WAAA;GAAA,OAAAH,gBACxDjC,cAAmBqC,WAAA;IAAA,IAACC,QAAK;KAAA,OAAER,MAAMQ,SAAS;IAAK;IAAA,IAAEN,cAAW;KAAA,OAAEF,MAAME;IAAW;GAAA,GAAMD,IAAI,CAAA;EAAA;CAAA,CAAA;AAGhG;AAEA,IAAMQ,sBAAsB;AAC5B,IAAMC,sBAAsB;CAAC;CAAY;CAAc;AAAY;AASnE,SAASO,mBAAmBC,SAA6C;CACvE,OAAOR,oBAAoBU,KAAKL,cAAc;EAC5CA;EACAV,OAAOa,QAAQG,MAAMC,iBAAiBP,QAAQ;EAC9CC,UAAUE,QAAQG,MAAME,oBAAoBR,QAAQ;CACtD,EAAE;AACJ;AAEA,SAASS,kBAAkBN,SAAsBO,cAAqC;CACpF,OAAOA,aAAaC,OACjB,EAAEX,UAAUV,OAAOW,eAClBE,QAAQG,MAAMC,iBAAiBP,QAAQ,MAAMV,SAC7Ca,QAAQG,MAAME,oBAAoBR,QAAQ,MAAMC,QACpD;AACF;AAEA,SAASW,4BAA4BC,SAAsB;CACzD,MAAMC,aAAaC,SAASC,oBAAoBD,SAASE;CACzD,IAAIC,OAAOC,iBAAiBL,UAAU,CAAC,CAACM,aAA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AA,CAAA,CAAA;AAGnB;AAEA,SAAgBoJ,uBACdzH,OACA;CACA,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAI,gBACGjC,aAAoB8G,QAAM,EAAA,IAAA1E,WAAA;EAAA,OAAAH,gBACxBjC,aAAoBuJ,YAAUlH,WACzBpB,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLH,gBACAD,eACA,yFAAA,OAEAgB,MAAMuF,KACR;EAAC,EAAA,GACGtF,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","Accessor","ComponentProps","createContext","Show","splitProps","useContext","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSwatchTone","MenuSwatchTone","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","MenuOrientation","DropdownMenuOrientationContext","HandlerEvent","Handler","args","Arguments","DropdownMenuTriggerKeyEvent","NonNullable","Trigger","DropdownMenuTriggerPointerEvent","props","local","rest","orientation","_$createComponent","Provider","value","children","_$mergeProps","modal","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","const","OverflowProperty","OverflowDeclaration","Readonly","property","priority","readInlineOverflow","element","HTMLElement","map","style","getPropertyValue","getPropertyPriority","declarationsMatch","declarations","every","bypassUnboundedScrollLookup","trigger","scrollRoot","document","scrollingElement","documentElement","window","getComputedStyle","overflow","temporaryStyles","Array","original","applied","parent","parentElement","computed","overflowX","overflowY","test","setProperty","push","length","queueMicrotask","isConnected","removeProperty","DropdownMenuTrigger","inheritedOrientation","onPointerDown","event","disabled","defaultPrevented","isPrimary","button","altKey","ctrlKey","metaKey","shiftKey","currentTarget","isNativeLink","HTMLAnchorElement","hasAttribute","focus","preventScroll","pointerType","preventDefault","onKeyDown","menubarOrientation","closest","getAttribute","openingArrow","includes","key","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","DropdownMenuContent","mount","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","keyshortcuts","swatch","aria-keyshortcuts","when","_el$","_tmpl$","_$effect","_$className","tone","_el$2","_tmpl$2","_$insert","DropdownMenuShortcut","_el$3","_tmpl$3","_$spread","DropdownMenuCheckboxItem","CheckboxItem","_el$4","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","_el$5","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, Show, splitProps, useContext } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSwatchTone,\n type MenuSwatchTone,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\nconst DropdownMenuOrientationContext = createContext<Accessor<MenuOrientation | undefined>>()\ntype HandlerEvent<Handler> = Handler extends (...args: infer Arguments) => void\n ? Arguments[0]\n : never\ntype DropdownMenuTriggerKeyEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onKeyDown']>\n>\ntype DropdownMenuTriggerPointerEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onPointerDown']>\n>\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation'])\n const orientation = () => local.orientation\n return (\n <DropdownMenuOrientationContext.Provider value={orientation}>\n <KobalteDropdownMenu modal={local.modal ?? false} orientation={local.orientation} {...rest} />\n </DropdownMenuOrientationContext.Provider>\n )\n}\n\nconst SCROLLABLE_OVERFLOW = /(auto|scroll)/\nconst OVERFLOW_PROPERTIES = ['overflow', 'overflow-x', 'overflow-y'] as const\n\ntype OverflowProperty = (typeof OVERFLOW_PROPERTIES)[number]\ntype OverflowDeclaration = Readonly<{\n property: OverflowProperty\n value: string\n priority: string\n}>\n\nfunction readInlineOverflow(element: HTMLElement): OverflowDeclaration[] {\n return OVERFLOW_PROPERTIES.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property),\n }))\n}\n\nfunction declarationsMatch(element: HTMLElement, declarations: OverflowDeclaration[]) {\n return declarations.every(\n ({ property, value, priority }) =>\n element.style.getPropertyValue(property) === value &&\n element.style.getPropertyPriority(property) === priority\n )\n}\n\nfunction bypassUnboundedScrollLookup(trigger: HTMLElement) {\n const scrollRoot = document.scrollingElement ?? document.documentElement\n if (window.getComputedStyle(scrollRoot).overflow !== 'hidden') return\n\n const temporaryStyles: Array<{\n element: HTMLElement\n original: OverflowDeclaration[]\n applied: OverflowDeclaration[]\n }> = []\n\n for (let element: HTMLElement | null = trigger; element;) {\n const parent: HTMLElement | null = element.parentElement\n if (element !== scrollRoot) {\n const computed = window.getComputedStyle(element)\n const overflow = `${computed.overflow} ${computed.overflowX} ${computed.overflowY}`\n if (SCROLLABLE_OVERFLOW.test(overflow)) {\n const original = readInlineOverflow(element)\n element.style.setProperty('overflow', 'clip', 'important')\n temporaryStyles.push({ element, original, applied: readInlineOverflow(element) })\n }\n }\n element = parent\n }\n\n if (temporaryStyles.length === 0) return\n\n // Kobalte's keyboard path synchronously walks scroll parents before it opens\n // the menu. Clipping only non-root scroll ancestors makes that walk stop at\n // the locked viewport. Restore those declarations once the event handler\n // finishes, and leave any newer owner write untouched.\n queueMicrotask(() => {\n for (const { element, original, applied } of temporaryStyles) {\n if (!element.isConnected || !declarationsMatch(element, applied)) continue\n for (const property of OVERFLOW_PROPERTIES) element.style.removeProperty(property)\n for (const { property, value, priority } of original) {\n if (value) element.style.setProperty(property, value, priority)\n }\n }\n })\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n const inheritedOrientation = useContext(DropdownMenuOrientationContext)\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n if (typeof local.onPointerDown === 'function') local.onPointerDown(event)\n else if (local.onPointerDown) local.onPointerDown[0](local.onPointerDown[1], event)\n\n // WebKit can leave focus on a previous control when a native button gets\n // a pointer click. Focus the trigger before Kobalte opens the menu so an\n // enclosing modal focus scope does not restore focus and dismiss the menu.\n if (\n local.disabled ||\n event.defaultPrevented ||\n !event.isPrimary ||\n event.button !== 0 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n const trigger = event.currentTarget\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (trigger instanceof HTMLElement && !isNativeLink) {\n trigger.focus({ preventScroll: true })\n // Focusing first is not enough in WebKit: the press's default mousedown\n // action runs afterwards and moves focus off a button to the nearest\n // focusable ancestor — inside a dialog, the dialog — so the menu that\n // just opened still reads focus leaving it and closes. Cancelling the\n // default keeps focus where it was put.\n if (event.pointerType !== 'touch') event.preventDefault()\n }\n }\n const onKeyDown = (event: DropdownMenuTriggerKeyEvent) => {\n // Kobalte's MenuTrigger does not consult defaultPrevented before its own\n // open-key handling. Preserve its existing callback behavior; this wrapper\n // only makes the pre-open scroll-parent lookup terminate.\n if (typeof local.onKeyDown === 'function') local.onKeyDown(event)\n else if (local.onKeyDown) local.onKeyDown[0](local.onKeyDown[1], event)\n\n if (local.disabled) return\n const trigger = event.currentTarget\n if (!(trigger instanceof HTMLElement)) return\n const menubarOrientation = trigger.closest('[role=\"menubar\"]')?.getAttribute('aria-orientation')\n const orientation =\n inheritedOrientation?.() ?? (menubarOrientation === 'vertical' ? 'vertical' : 'horizontal')\n const openingArrow = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight'\n if (!['Enter', ' ', openingArrow].includes(event.key)) return\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (isNativeLink && (event.key === 'Enter' || event.key === ' ')) return\n bypassUnboundedScrollLookup(trigger)\n }\n\n return (\n <KobalteDropdownMenu.Trigger\n {...rest}\n disabled={local.disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n )\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n /**\n * Kept for callers that hid the arrow explicitly; the arrow is now hidden by\n * default. Pass `false` to draw one. The default flipped because Kobalte\n * reserves half of the arrow's 30px box as popper gutter — a menu anchored to\n * its trigger floated 15px off it, which read as a gap rather than as a\n * pointer, and every anchored caller already passed `hideArrow`.\n */\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {local.hideArrow === false && (\n /* Rendered only when a caller asks for it back: the popper folds half\n the arrow's box into the content's gutter, so an arrow and a flush\n menu have never been true at once. */\n <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />\n )}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n /** Draw a leading colour dot from the shared tone ladder — the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'swatch',\n 'children',\n ])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n *\n * The glyphs are decorative: the span is `aria-hidden` and the parseable chord\n * belongs in the row's `aria-keyshortcuts`, so the item's accessible name stays\n * exactly its label.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n aria-hidden=\"true\"\n class={cn('text-muted-foreground ms-auto font-code text-code tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem> & {\n /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;\n * the label carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'swatch', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioItem> & {\n /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;\n * the label carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'swatch', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system — a canvas-colored dot on a checked row reads as decoration. */}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;AAoBA,IAAMwB,iCAAiCjB,cAAqD;;;;;;;;;;;;;;;;;;;;AA8B5F,SAAgBP,eAAaiC,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQ1B,WAAWwB,OAAO,CAAC,SAAS,aAAa,CAAC;CAChE,MAAMG,oBAAoBF,MAAME;CAChC,OAAAC,gBACGb,+BAA+Bc,UAAQ;EAACC,OAAOH;EAAW,IAAAI,WAAA;GAAA,OAAAH,gBACxDpC,cAAmBwC,WAAA;IAAA,IAACC,QAAK;KAAA,OAAER,MAAMQ,SAAS;IAAK;IAAA,IAAEN,cAAW;KAAA,OAAEF,MAAME;IAAW;GAAA,GAAMD,IAAI,CAAA;EAAA;CAAA,CAAA;AAGhG;AAEA,IAAMQ,sBAAsB;AAC5B,IAAMC,sBAAsB;CAAC;CAAY;CAAc;AAAY;AASnE,SAASO,mBAAmBC,SAA6C;CACvE,OAAOR,oBAAoBU,KAAKL,cAAc;EAC5CA;EACAV,OAAOa,QAAQG,MAAMC,iBAAiBP,QAAQ;EAC9CC,UAAUE,QAAQG,MAAME,oBAAoBR,QAAQ;CACtD,EAAE;AACJ;AAEA,SAASS,kBAAkBN,SAAsBO,cAAqC;CACpF,OAAOA,aAAaC,OACjB,EAAEX,UAAUV,OAAOW,eACl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