@adea-ai/ui 0.159.3 → 0.159.4

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.
@@ -15,8 +15,8 @@ import type { ComponentProps } from 'solid-js';
15
15
  * invalid direct children of the ARIA menu. Set `modal` explicitly when the
16
16
  * surrounding interaction needs modal containment.
17
17
  *
18
- * The `destructive` variant marks the row with a status-coloured edge and
19
- * highlighted tint while keeping its label on the body foreground. Pairing it
18
+ * The `destructive` variant colours the row's icon with the destructive status
19
+ * and tints its highlight while keeping its label on the body foreground. Pairing it
20
20
  * with an AlertDialog is the caller's job.
21
21
  *
22
22
  * An item that opens something else, a dialog, a sheet, passes it as
@@ -23,8 +23,8 @@ var DropdownMenuScopeContext = createContext();
23
23
  * invalid direct children of the ARIA menu. Set `modal` explicitly when the
24
24
  * surrounding interaction needs modal containment.
25
25
  *
26
- * The `destructive` variant marks the row with a status-coloured edge and
27
- * highlighted tint while keeping its label on the body foreground. Pairing it
26
+ * The `destructive` variant colours the row's icon with the destructive status
27
+ * and tints its highlight while keeping its label on the body foreground. Pairing it
28
28
  * with an AlertDialog is the caller's job.
29
29
  *
30
30
  * An item that opens something else, a dialog, a sheet, passes it as
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","useMenuContext","createContext","onCleanup","splitProps","useContext","callHandler","topLayerProps","cn","createMenuParts","menuPanel","orientation","setAfterClose","callback","takeAfterClose","disposed","DropdownMenuScopeContext","Trigger","props","local","rest","afterClose","undefined","scope","_$createComponent","Provider","value","children","_$mergeProps","modal","onOpenChange","open","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","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","includes","key","Portal","TAB_STOP_SELECTOR","isTabStop","tabIndex","matches","getClientRects","tabStopAt","target","control","adjacentTabStop","from","backwards","dialog","ownerDocument","body","stops","querySelectorAll","filter","ordered","toSorted","a","b","index","indexOf","step","at","MENU_ROW_SELECTOR","Content","hideArrow","portalMount","tabKey","DropdownMenuContent","menu","leaveTarget","onTab","isComposing","panel","stopPropagation","rows","row","active","activeElement","triggerRef","close","onCloseAutoFocus","isOpen","mount","class","ref","addEventListener","removeEventListener","_$memo","Arrow","parts","DropdownMenuItem","Item","onSelectAfterClose","onSelect","DropdownMenuShortcut","Shortcut","DropdownMenuCheckboxItem","CheckboxItem","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","Label","DropdownMenuSeparator","Separator","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { useMenuContext } from '@kobalte/core/menu'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, onCleanup, splitProps, useContext } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { popoverArrow, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createMenuParts, menuPanel } from './menu-parts'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\ntype DropdownMenuScope = {\n orientation: Accessor<MenuOrientation | undefined>\n /** Queue work for after the menu has closed and focus has settled. */\n setAfterClose: (callback: (() => void) | undefined) => void\n takeAfterClose: () => (() => void) | undefined\n disposed: () => boolean\n}\nconst DropdownMenuScopeContext = createContext<DropdownMenuScope>()\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 *\n * An item that opens something else, a dialog, a sheet, passes it as\n * `onSelectAfterClose`, which runs once the menu has closed and returned focus\n * to its trigger, so the next layer captures the trigger as the control to\n * return to.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation', 'onOpenChange'])\n let afterClose: (() => void) | undefined\n let disposed = false\n onCleanup(() => {\n disposed = true\n afterClose = undefined\n })\n const scope: DropdownMenuScope = {\n orientation: () => local.orientation,\n setAfterClose: (callback) => (afterClose = callback),\n takeAfterClose: () => {\n const callback = afterClose\n afterClose = undefined\n return callback\n },\n disposed: () => disposed,\n }\n return (\n <DropdownMenuScopeContext.Provider value={scope}>\n <KobalteDropdownMenu\n modal={local.modal ?? false}\n orientation={local.orientation}\n onOpenChange={(open) => {\n if (open) afterClose = undefined\n local.onOpenChange?.(open)\n }}\n {...rest}\n />\n </DropdownMenuScopeContext.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 0.13.14's keyboard open path synchronously walks scroll parents\n // and never terminates when the root scroller is `overflow: hidden`.\n // Clipping only non-root scroll ancestors makes that walk stop at the locked\n // viewport. Restore those declarations once the event handler finishes, and\n // 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(DropdownMenuScopeContext)?.orientation\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n callHandler(local.onPointerDown, 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 callHandler(local.onKeyDown, 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 { Portal as DropdownMenuPortal } from '@kobalte/core/dropdown-menu'\n\n/** The controls a pointer press can focus. */\nconst TAB_STOP_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\n/** Whether Tab can land on the element as the page stands now. */\nexport function isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\n/** The focusable control under a pointer press, if Tab could reach it. */\nexport function tabStopAt(target: Element): HTMLElement | undefined {\n const control = target.closest<HTMLElement>(TAB_STOP_SELECTOR)\n return control && isTabStop(control) ? control : undefined\n}\n\n/**\n * The tab stop before or after `from` inside the enclosing dialog (wrapping,\n * as the dialog's focus trap does) or the document (not wrapping), skipping\n * any open menu.\n */\nfunction adjacentTabStop(from: HTMLElement, backwards: boolean): HTMLElement | undefined {\n const dialog = from.closest<HTMLElement>('[role=\"dialog\"]')\n const scope = dialog ?? from.ownerDocument.body\n // Every element, not just TAB_STOP_SELECTOR: the native tabIndex decides,\n // which keeps details summaries and explicit tabindex overrides in order.\n const stops = Array.from(scope.querySelectorAll<HTMLElement>('*')).filter(\n (element) => isTabStop(element) && element.closest('[role=\"menu\"]') === null\n )\n const ordered = [\n ...stops.filter((element) => element.tabIndex > 0).toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...stops.filter((element) => element.tabIndex <= 0),\n ]\n const index = ordered.indexOf(from)\n if (index < 0) return undefined\n const step = backwards ? -1 : 1\n return ordered[index + step] ?? (dialog ? (backwards ? ordered.at(-1) : ordered[0]) : undefined)\n}\n\nconst MENU_ROW_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]'\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 * What Tab does while the menu is open. Kobalte 0.13.14 swallows it and\n * leaves focus where it was; `leave` closes the menu and moves on to the tab\n * stop after (or, with Shift, before) the trigger, inside an enclosing\n * dialog or the page; `cycle` moves between the menu's enabled rows.\n */\n tabKey?: 'leave' | 'cycle'\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'hideArrow',\n 'children',\n 'portalMount',\n 'tabKey',\n 'ref',\n 'onCloseAutoFocus',\n ])\n const scope = useContext(DropdownMenuScopeContext)\n const menu = useMenuContext()\n let leaveTarget: HTMLElement | undefined\n\n // A capture listener on the panel, because Kobalte's list handler moves focus\n // on Tab itself and runs whatever a caller's `onKeyDown` does.\n const onTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing || !local.tabKey) return\n const panel = event.currentTarget as HTMLElement\n event.preventDefault()\n event.stopPropagation()\n if (local.tabKey === 'cycle') {\n const rows = Array.from(panel.querySelectorAll<HTMLElement>(MENU_ROW_SELECTOR)).filter(\n (row) => row.getAttribute('aria-disabled') !== 'true'\n )\n if (!rows.length) return\n const active = document.activeElement\n const index = active instanceof HTMLElement ? rows.indexOf(active) : -1\n const step = event.shiftKey ? -1 : 1\n const next =\n index < 0\n ? event.shiftKey\n ? rows.length - 1\n : 0\n : (index + step + rows.length) % rows.length\n rows[next]?.focus()\n return\n }\n const trigger = menu.triggerRef()\n leaveTarget = trigger ? adjacentTabStop(trigger, event.shiftKey) : undefined\n // Focus first, so a nonmodal menu sees the focus leave and skips its own\n // return-to-trigger; then close in case it did not dismiss itself.\n leaveTarget?.focus({ preventScroll: true })\n menu.close(true)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n local.onCloseAutoFocus?.(event)\n const target = leaveTarget\n leaveTarget = undefined\n if (target) {\n event.preventDefault()\n // Kobalte's focus scope restores its stale mount-time focus after this\n // callback; land on the Tab destination once that has run.\n queueMicrotask(() => {\n if (!menu.isOpen() && target.isConnected && document.activeElement !== target) {\n target.focus({ preventScroll: true })\n }\n })\n }\n const afterClose = scope?.takeAfterClose()\n // Kobalte returns focus to the trigger and releases its focus scope after\n // this callback; the queued work runs once that has finished.\n if (afterClose) queueMicrotask(() => scope?.disposed() || afterClose())\n }\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(menuPanel, 'min-w-[10rem]', local.class)}\n {...rest}\n ref={(element: HTMLDivElement) => {\n element.addEventListener('keydown', onTab, true)\n onCleanup(() => element.removeEventListener('keydown', onTab, true))\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onCloseAutoFocus={onCloseAutoFocus}\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\nconst parts = createMenuParts(KobalteDropdownMenu, 'dropdown-menu')\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof parts.Item> & {\n /**\n * Runs after the menu has closed and returned focus to its trigger, the\n * place to open a dialog or sheet, which then returns focus to the trigger.\n */\n onSelectAfterClose?: () => void\n }\n) {\n const scope = useContext(DropdownMenuScopeContext)\n const [local, rest] = splitProps(props, ['onSelectAfterClose', 'onSelect'])\n return (\n <parts.Item\n {...rest}\n onSelect={() => {\n scope?.setAfterClose(local.onSelectAfterClose)\n local.onSelect?.()\n }}\n />\n )\n}\n\nexport const DropdownMenuShortcut = parts.Shortcut\nexport const DropdownMenuCheckboxItem = parts.CheckboxItem\nexport const DropdownMenuRadioItem = parts.RadioItem\nexport const DropdownMenuLabel = parts.Label\nexport const DropdownMenuSeparator = parts.Separator\nexport const DropdownMenuSubTrigger = parts.SubTrigger\nexport const DropdownMenuSubContent = parts.SubContent\nexport {\n Group as DropdownMenuGroup,\n RadioGroup as DropdownMenuRadioGroup,\n Sub as DropdownMenuSub,\n} from '@kobalte/core/dropdown-menu'\n"],"mappings":";;;;;;;;;AAiBA,IAAMiB,2BAA2Bd,cAAiC;;;;;;;;;;;;;;;;;;;;;;;;;AAmClE,SAAgBH,eAAamB,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EAAC;EAAS;EAAe;CAAc,CAAC;CAChF,IAAIG;CACJ,IAAIN,WAAW;CACfZ,gBAAgB;EACdY,WAAW;EACXM,aAAaC,KAAAA;CACf,CAAC;CAWD,OAAAE,gBACGR,yBAAyBS,UAAQ;EAACC,OAAOH;GAV1CZ,mBAAmBQ,MAAMR;GACzBC,gBAAgBC,aAAcQ,aAAaR;GAC3CC,sBAAsB;IACpB,MAAMD,WAAWQ;IACjBA,aAAaC,KAAAA;IACb,OAAOT;GACT;GACAE,gBAAgBA;EAG0BQ;EAAK,IAAAI,WAAA;GAAA,OAAAH,gBAC5CxB,cAAmB4B,WAAA;IAAA,IAClBC,QAAK;KAAA,OAAEV,MAAMU,SAAS;IAAK;IAAA,IAC3BlB,cAAW;KAAA,OAAEQ,MAAMR;IAAW;IAC9BmB,eAAeC,SAAS;KACtB,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MQ,QAAQ,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAIvB;AAEA,IAAM2H,QAAQ7I,gBAAgBT,cAAqB,eAAe;AAElE,SAAgBuJ,iBACdrI,OAOA;CACA,MAAMK,QAAQlB,WAAWW,wBAAwB;CACjD,MAAM,CAACG,OAAOC,QAAQhB,WAAWc,OAAO,CAAC,sBAAsB,UAAU,CAAC;CAC1E,OAAAM,gBACG8H,MAAME,MAAI5H,WACLR,MAAI,EACRsI,gBAAgB;EACdnI,OAAOX,cAAcO,MAAMsI,kBAAkB;EAC7CtI,MAAMuI,WAAW;CACnB,EAAC,CAAA,CAAA;AAGP;AAEA,IAAaC,uBAAuBL,MAAMM;AAC1C,IAAaC,2BAA2BP,MAAMQ;AAC9C,IAAaC,wBAAwBT,MAAMU;AAC3C,IAAaC,oBAAoBX,MAAMY;AACvC,IAAaC,wBAAwBb,MAAMc;AAC3C,IAAaC,yBAAyBf,MAAMgB;AAC5C,IAAaC,yBAAyBjB,MAAMkB"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","useMenuContext","createContext","onCleanup","splitProps","useContext","callHandler","topLayerProps","cn","createMenuParts","menuPanel","orientation","setAfterClose","callback","takeAfterClose","disposed","DropdownMenuScopeContext","Trigger","props","local","rest","afterClose","undefined","scope","_$createComponent","Provider","value","children","_$mergeProps","modal","onOpenChange","open","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","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","includes","key","Portal","TAB_STOP_SELECTOR","isTabStop","tabIndex","matches","getClientRects","tabStopAt","target","control","adjacentTabStop","from","backwards","dialog","ownerDocument","body","stops","querySelectorAll","filter","ordered","toSorted","a","b","index","indexOf","step","at","MENU_ROW_SELECTOR","Content","hideArrow","portalMount","tabKey","DropdownMenuContent","menu","leaveTarget","onTab","isComposing","panel","stopPropagation","rows","row","active","activeElement","triggerRef","close","onCloseAutoFocus","isOpen","mount","class","ref","addEventListener","removeEventListener","_$memo","Arrow","parts","DropdownMenuItem","Item","onSelectAfterClose","onSelect","DropdownMenuShortcut","Shortcut","DropdownMenuCheckboxItem","CheckboxItem","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","Label","DropdownMenuSeparator","Separator","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { useMenuContext } from '@kobalte/core/menu'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, onCleanup, splitProps, useContext } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { popoverArrow, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createMenuParts, menuPanel } from './menu-parts'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\ntype DropdownMenuScope = {\n orientation: Accessor<MenuOrientation | undefined>\n /** Queue work for after the menu has closed and focus has settled. */\n setAfterClose: (callback: (() => void) | undefined) => void\n takeAfterClose: () => (() => void) | undefined\n disposed: () => boolean\n}\nconst DropdownMenuScopeContext = createContext<DropdownMenuScope>()\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 colours the row's icon with the destructive status\n * and tints its highlight while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n *\n * An item that opens something else, a dialog, a sheet, passes it as\n * `onSelectAfterClose`, which runs once the menu has closed and returned focus\n * to its trigger, so the next layer captures the trigger as the control to\n * return to.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation', 'onOpenChange'])\n let afterClose: (() => void) | undefined\n let disposed = false\n onCleanup(() => {\n disposed = true\n afterClose = undefined\n })\n const scope: DropdownMenuScope = {\n orientation: () => local.orientation,\n setAfterClose: (callback) => (afterClose = callback),\n takeAfterClose: () => {\n const callback = afterClose\n afterClose = undefined\n return callback\n },\n disposed: () => disposed,\n }\n return (\n <DropdownMenuScopeContext.Provider value={scope}>\n <KobalteDropdownMenu\n modal={local.modal ?? false}\n orientation={local.orientation}\n onOpenChange={(open) => {\n if (open) afterClose = undefined\n local.onOpenChange?.(open)\n }}\n {...rest}\n />\n </DropdownMenuScopeContext.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 0.13.14's keyboard open path synchronously walks scroll parents\n // and never terminates when the root scroller is `overflow: hidden`.\n // Clipping only non-root scroll ancestors makes that walk stop at the locked\n // viewport. Restore those declarations once the event handler finishes, and\n // 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(DropdownMenuScopeContext)?.orientation\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n callHandler(local.onPointerDown, 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 callHandler(local.onKeyDown, 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 { Portal as DropdownMenuPortal } from '@kobalte/core/dropdown-menu'\n\n/** The controls a pointer press can focus. */\nconst TAB_STOP_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\n/** Whether Tab can land on the element as the page stands now. */\nexport function isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\n/** The focusable control under a pointer press, if Tab could reach it. */\nexport function tabStopAt(target: Element): HTMLElement | undefined {\n const control = target.closest<HTMLElement>(TAB_STOP_SELECTOR)\n return control && isTabStop(control) ? control : undefined\n}\n\n/**\n * The tab stop before or after `from` inside the enclosing dialog (wrapping,\n * as the dialog's focus trap does) or the document (not wrapping), skipping\n * any open menu.\n */\nfunction adjacentTabStop(from: HTMLElement, backwards: boolean): HTMLElement | undefined {\n const dialog = from.closest<HTMLElement>('[role=\"dialog\"]')\n const scope = dialog ?? from.ownerDocument.body\n // Every element, not just TAB_STOP_SELECTOR: the native tabIndex decides,\n // which keeps details summaries and explicit tabindex overrides in order.\n const stops = Array.from(scope.querySelectorAll<HTMLElement>('*')).filter(\n (element) => isTabStop(element) && element.closest('[role=\"menu\"]') === null\n )\n const ordered = [\n ...stops.filter((element) => element.tabIndex > 0).toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...stops.filter((element) => element.tabIndex <= 0),\n ]\n const index = ordered.indexOf(from)\n if (index < 0) return undefined\n const step = backwards ? -1 : 1\n return ordered[index + step] ?? (dialog ? (backwards ? ordered.at(-1) : ordered[0]) : undefined)\n}\n\nconst MENU_ROW_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]'\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 * What Tab does while the menu is open. Kobalte 0.13.14 swallows it and\n * leaves focus where it was; `leave` closes the menu and moves on to the tab\n * stop after (or, with Shift, before) the trigger, inside an enclosing\n * dialog or the page; `cycle` moves between the menu's enabled rows.\n */\n tabKey?: 'leave' | 'cycle'\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'hideArrow',\n 'children',\n 'portalMount',\n 'tabKey',\n 'ref',\n 'onCloseAutoFocus',\n ])\n const scope = useContext(DropdownMenuScopeContext)\n const menu = useMenuContext()\n let leaveTarget: HTMLElement | undefined\n\n // A capture listener on the panel, because Kobalte's list handler moves focus\n // on Tab itself and runs whatever a caller's `onKeyDown` does.\n const onTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing || !local.tabKey) return\n const panel = event.currentTarget as HTMLElement\n event.preventDefault()\n event.stopPropagation()\n if (local.tabKey === 'cycle') {\n const rows = Array.from(panel.querySelectorAll<HTMLElement>(MENU_ROW_SELECTOR)).filter(\n (row) => row.getAttribute('aria-disabled') !== 'true'\n )\n if (!rows.length) return\n const active = document.activeElement\n const index = active instanceof HTMLElement ? rows.indexOf(active) : -1\n const step = event.shiftKey ? -1 : 1\n const next =\n index < 0\n ? event.shiftKey\n ? rows.length - 1\n : 0\n : (index + step + rows.length) % rows.length\n rows[next]?.focus()\n return\n }\n const trigger = menu.triggerRef()\n leaveTarget = trigger ? adjacentTabStop(trigger, event.shiftKey) : undefined\n // Focus first, so a nonmodal menu sees the focus leave and skips its own\n // return-to-trigger; then close in case it did not dismiss itself.\n leaveTarget?.focus({ preventScroll: true })\n menu.close(true)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n local.onCloseAutoFocus?.(event)\n const target = leaveTarget\n leaveTarget = undefined\n if (target) {\n event.preventDefault()\n // Kobalte's focus scope restores its stale mount-time focus after this\n // callback; land on the Tab destination once that has run.\n queueMicrotask(() => {\n if (!menu.isOpen() && target.isConnected && document.activeElement !== target) {\n target.focus({ preventScroll: true })\n }\n })\n }\n const afterClose = scope?.takeAfterClose()\n // Kobalte returns focus to the trigger and releases its focus scope after\n // this callback; the queued work runs once that has finished.\n if (afterClose) queueMicrotask(() => scope?.disposed() || afterClose())\n }\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(menuPanel, 'min-w-[10rem]', local.class)}\n {...rest}\n ref={(element: HTMLDivElement) => {\n element.addEventListener('keydown', onTab, true)\n onCleanup(() => element.removeEventListener('keydown', onTab, true))\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onCloseAutoFocus={onCloseAutoFocus}\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\nconst parts = createMenuParts(KobalteDropdownMenu, 'dropdown-menu')\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof parts.Item> & {\n /**\n * Runs after the menu has closed and returned focus to its trigger, the\n * place to open a dialog or sheet, which then returns focus to the trigger.\n */\n onSelectAfterClose?: () => void\n }\n) {\n const scope = useContext(DropdownMenuScopeContext)\n const [local, rest] = splitProps(props, ['onSelectAfterClose', 'onSelect'])\n return (\n <parts.Item\n {...rest}\n onSelect={() => {\n scope?.setAfterClose(local.onSelectAfterClose)\n local.onSelect?.()\n }}\n />\n )\n}\n\nexport const DropdownMenuShortcut = parts.Shortcut\nexport const DropdownMenuCheckboxItem = parts.CheckboxItem\nexport const DropdownMenuRadioItem = parts.RadioItem\nexport const DropdownMenuLabel = parts.Label\nexport const DropdownMenuSeparator = parts.Separator\nexport const DropdownMenuSubTrigger = parts.SubTrigger\nexport const DropdownMenuSubContent = parts.SubContent\nexport {\n Group as DropdownMenuGroup,\n RadioGroup as DropdownMenuRadioGroup,\n Sub as DropdownMenuSub,\n} from '@kobalte/core/dropdown-menu'\n"],"mappings":";;;;;;;;;AAiBA,IAAMiB,2BAA2Bd,cAAiC;;;;;;;;;;;;;;;;;;;;;;;;;AAmClE,SAAgBH,eAAamB,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EAAC;EAAS;EAAe;CAAc,CAAC;CAChF,IAAIG;CACJ,IAAIN,WAAW;CACfZ,gBAAgB;EACdY,WAAW;EACXM,aAAaC,KAAAA;CACf,CAAC;CAWD,OAAAE,gBACGR,yBAAyBS,UAAQ;EAACC,OAAOH;GAV1CZ,mBAAmBQ,MAAMR;GACzBC,gBAAgBC,aAAcQ,aAAaR;GAC3CC,sBAAsB;IACpB,MAAMD,WAAWQ;IACjBA,aAAaC,KAAAA;IACb,OAAOT;GACT;GACAE,gBAAgBA;EAG0BQ;EAAK,IAAAI,WAAA;GAAA,OAAAH,gBAC5CxB,cAAmB4B,WAAA;IAAA,IAClBC,QAAK;KAAA,OAAEV,MAAMU,SAAS;IAAK;IAAA,IAC3BlB,cAAW;KAAA,OAAEQ,MAAMR;IAAW;IAC9BmB,eAAeC,SAAS;KACtB,IAAIA,MAAMV,aAAaC,KAAAA;KACvBH,MAAMW,eAAeC,IAAI;IAC3B;GAAC,GACGX,IAAI,CAAA;EAAA;CAAA,CAAA;AAIhB;AAEA,IAAMY,sBAAsB;A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rI,OAOA;CACA,MAAMK,QAAQlB,WAAWW,wBAAwB;CACjD,MAAM,CAACG,OAAOC,QAAQhB,WAAWc,OAAO,CAAC,sBAAsB,UAAU,CAAC;CAC1E,OAAAM,gBACG8H,MAAME,MAAI5H,WACLR,MAAI,EACRsI,gBAAgB;EACdnI,OAAOX,cAAcO,MAAMsI,kBAAkB;EAC7CtI,MAAMuI,WAAW;CACnB,EAAC,CAAA,CAAA;AAGP;AAEA,IAAaC,uBAAuBL,MAAMM;AAC1C,IAAaC,2BAA2BP,MAAMQ;AAC9C,IAAaC,wBAAwBT,MAAMU;AAC3C,IAAaC,oBAAoBX,MAAMY;AACvC,IAAaC,wBAAwBb,MAAMc;AAC3C,IAAaC,yBAAyBf,MAAMgB;AAC5C,IAAaC,yBAAyBjB,MAAMkB"}
@@ -83,8 +83,11 @@ export declare const popoverArrow = "fill-popover stroke-border";
83
83
  * indicator's accent.
84
84
  */
85
85
  export declare const menuItem: string;
86
- /** A destructive action keeps readable text and marks its row with a status edge. */
87
- export declare const destructiveMenuItem = "border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle";
86
+ /**
87
+ * A destructive action keeps readable body text; its icon takes the status colour and the
88
+ * highlight a destructive tint. No edge bar: the row lines up with its neighbours.
89
+ */
90
+ export declare const destructiveMenuItem = "text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!";
88
91
  /** The label above a group of menu rows. */
89
92
  export declare const menuLabel = "px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase";
90
93
  /** The chord drawn at a row's trailing edge: menus and the command palette. */
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/lib/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD;+EAC+E;AAC/E,eAAO,MAAM,cAAc,iFACqD,CA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6B,CAAA;AAEvD,+DAA+D;AAC/D,eAAO,MAAM,YAAY,+BAA+B,CAAA;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,QAO+D,CAAA;AAEpF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sHACqF,CAAA;AAErH,4CAA4C;AAC5C,eAAO,MAAM,SAAS,mFAC4D,CAAA;AAElF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,0DAA0D,CAAA;AAEnF,oCAAoC;AACpC,eAAO,MAAM,aAAa,8BAA8B,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;8EAYzB,CAAA;AAEF,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAErF,iDAAiD;AACjD,eAAO,MAAM,kBAAkB,QAAQ,CAAA;AAEvC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa;aAAK,mBAAmB,EAAE,EAAE;CAAW,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,8BAA8B,CAAA"}
@@ -84,8 +84,11 @@ var popoverArrow = "fill-popover stroke-border";
84
84
  * indicator's accent.
85
85
  */
86
86
  var menuItem = "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors ease-out data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([data-slot$=-indicator]_*)]:size-4 [&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground";
87
- /** A destructive action keeps readable text and marks its row with a status edge. */
88
- var destructiveMenuItem = "border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle";
87
+ /**
88
+ * A destructive action keeps readable body text; its icon takes the status colour and the
89
+ * highlight a destructive tint. No edge bar: the row lines up with its neighbours.
90
+ */
91
+ var destructiveMenuItem = "text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!";
89
92
  /** The label above a group of menu rows. */
90
93
  var menuLabel = "px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase";
91
94
  /** The chord drawn at a row's trailing edge: menus and the command palette. */
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\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 * The tip: shadcn's inverted chip, foreground on background, so an explanation\n * never reads as a popover that could hold controls. The side rail draws it\n * flush to a collapsed row and every floating tooltip composes the same fill\n * and type, so a control never explains itself in two visual languages.\n */\nexport const tooltipTip = 'bg-foreground text-background rounded-md text-xs font-medium'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are Kobalte's; `data-side-*` come from its\n * popper positioning and let a menu slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:duration-150 data-closed:duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/** A destructive action keeps readable text and marks its row with a status edge. */\nexport const destructiveMenuItem =\n 'border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto text-xs tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempts nodes carrying this attribute\n * from both, so every floating layer carries it.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walks body children added after its layer\n * opened and aria-hides them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aAAa;;;;;;;;;;AAW1B,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;AAI5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;AASF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;AAclC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IAAa,qBAAqB"}
1
+ {"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\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 * The tip: shadcn's inverted chip, foreground on background, so an explanation\n * never reads as a popover that could hold controls. The side rail draws it\n * flush to a collapsed row and every floating tooltip composes the same fill\n * and type, so a control never explains itself in two visual languages.\n */\nexport const tooltipTip = 'bg-foreground text-background rounded-md text-xs font-medium'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are Kobalte's; `data-side-*` come from its\n * popper positioning and let a menu slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:duration-150 data-closed:duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/**\n * A destructive action keeps readable body text; its icon takes the status colour and the\n * highlight a destructive tint. No edge bar: the row lines up with its neighbours.\n */\nexport const destructiveMenuItem =\n 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto text-xs tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempts nodes carrying this attribute\n * from both, so every floating layer carries it.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walks body children added after its layer\n * opened and aria-hides them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aAAa;;;;;;;;;;AAW1B,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;AAI5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;;;;AAYF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;AAclC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IAAa,qBAAqB"}
@@ -41,8 +41,8 @@ type DropdownMenuTriggerPointerEvent = HandlerEvent<
41
41
  * invalid direct children of the ARIA menu. Set `modal` explicitly when the
42
42
  * surrounding interaction needs modal containment.
43
43
  *
44
- * The `destructive` variant marks the row with a status-coloured edge and
45
- * highlighted tint while keeping its label on the body foreground. Pairing it
44
+ * The `destructive` variant colours the row's icon with the destructive status
45
+ * and tints its highlight while keeping its label on the body foreground. Pairing it
46
46
  * with an AlertDialog is the caller's job.
47
47
  *
48
48
  * An item that opens something else, a dialog, a sheet, passes it as
@@ -120,9 +120,12 @@ export const menuItem =
120
120
  '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +
121
121
  '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'
122
122
 
123
- /** A destructive action keeps readable text and marks its row with a status edge. */
123
+ /**
124
+ * A destructive action keeps readable body text; its icon takes the status colour and the
125
+ * highlight a destructive tint. No edge bar: the row lines up with its neighbours.
126
+ */
124
127
  export const destructiveMenuItem =
125
- 'border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle'
128
+ 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'
126
129
 
127
130
  /** The label above a group of menu rows. */
128
131
  export const menuLabel =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.159.3",
3
+ "version": "0.159.4",
4
4
  "description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
5
5
  "keywords": [
6
6
  "adea",
@@ -41,8 +41,8 @@ type DropdownMenuTriggerPointerEvent = HandlerEvent<
41
41
  * invalid direct children of the ARIA menu. Set `modal` explicitly when the
42
42
  * surrounding interaction needs modal containment.
43
43
  *
44
- * The `destructive` variant marks the row with a status-coloured edge and
45
- * highlighted tint while keeping its label on the body foreground. Pairing it
44
+ * The `destructive` variant colours the row's icon with the destructive status
45
+ * and tints its highlight while keeping its label on the body foreground. Pairing it
46
46
  * with an AlertDialog is the caller's job.
47
47
  *
48
48
  * An item that opens something else, a dialog, a sheet, passes it as
@@ -120,9 +120,12 @@ export const menuItem =
120
120
  '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +
121
121
  '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'
122
122
 
123
- /** A destructive action keeps readable text and marks its row with a status edge. */
123
+ /**
124
+ * A destructive action keeps readable body text; its icon takes the status colour and the
125
+ * highlight a destructive tint. No edge bar: the row lines up with its neighbours.
126
+ */
124
127
  export const destructiveMenuItem =
125
- 'border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle'
128
+ 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'
126
129
 
127
130
  /** The label above a group of menu rows. */
128
131
  export const menuLabel =