@adea-ai/ui 0.159.2 → 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.
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +4 -0
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/lib/overlay.d.ts +5 -2
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +5 -2
- package/dist/lib/overlay.js.map +1 -1
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +8 -0
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +2 -2
- package/dist/r/src/lib/overlay.ts +5 -2
- package/package.json +1 -1
- package/src/components/layout/split-layout/split-layout.tsx +8 -0
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +2 -2
- package/src/lib/overlay.ts +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,QAAQ,EACb,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAQjB,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAA;AAM5D,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAI5C,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAA;AAuBhB,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,eAAe,IAAI;IACxD,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,8D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,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAAA;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA+HD,wHAAwH;AACxH,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,eAkdhF"}
|
|
@@ -145,6 +145,7 @@ function SplitLayout(props) {
|
|
|
145
145
|
let resizeLoadGeneration = 0;
|
|
146
146
|
let resizeControllerEntry = 0;
|
|
147
147
|
let focusAfterResizeLoad = false;
|
|
148
|
+
let focusMoves = 0;
|
|
148
149
|
let pendingFocusFrame;
|
|
149
150
|
let pendingFocusRetryTimer;
|
|
150
151
|
const refs = /* @__PURE__ */ new Map();
|
|
@@ -188,6 +189,7 @@ function SplitLayout(props) {
|
|
|
188
189
|
};
|
|
189
190
|
const trackFocusChange = (event) => {
|
|
190
191
|
if (event.target === document.body) return;
|
|
192
|
+
focusMoves += 1;
|
|
191
193
|
focusAfterResizeLoad = false;
|
|
192
194
|
cancelPendingFocusRestore();
|
|
193
195
|
};
|
|
@@ -291,7 +293,9 @@ function SplitLayout(props) {
|
|
|
291
293
|
end: field.selectionEnd,
|
|
292
294
|
direction: field.selectionDirection
|
|
293
295
|
} : void 0;
|
|
296
|
+
const moves = focusMoves;
|
|
294
297
|
schedule(() => {
|
|
298
|
+
if (focusMoves !== moves) return;
|
|
295
299
|
if (!active.isConnected || !root?.contains(active)) return;
|
|
296
300
|
const current = active.ownerDocument.activeElement;
|
|
297
301
|
if (current !== active && current !== active.ownerDocument.body) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-layout.js","names":["For","createEffect","createComputed","createMemo","createUniqueId","createSignal","onMount","onCleanup","on","Show","Dynamic","X","LucideX","GripVertical","LucideGripVertical","ActionButton","Button","resizeSeparatorClass","cn","computeLayoutFrames","paneDropIntent","fastIcon","PANE_DRAG_TYPE","DRAG_PREVIEW_MAX_WIDTH","DRAG_PREVIEW_MAX_HEIGHT","listLeaves","MAX_SPLIT_RATIO","MIN_SPLIT_RATIO","props","resizeControllerEntries","state","label","labelForLeaf","leaf","renderLeaf","renderPaneLabel","paneTabIndex","labelForSeparator","branch","onResize","ratio","onFocus","onClose","onMove","intent","renderPaneActions","class","rectStyle","rect","left","x","top","y","width","height","separatorPlaceholderStyle","horizontal","direction","transform","dragPreviewPlaceholder","source","HTMLElement","message","placeholder","document","createElement","className","getAttribute","setAttribute","localName","textContent","boundedSnapshotSize","sourceWidth","Math","max","sourceHeight","scale","min","round","cloneDragPreviewNode","Node","nodeType","TEXT_NODE","cloneNode","SVGElement","includes","undefined","HTMLImageElement","snapshot","size","naturalWidth","naturalHeight","complete","Error","context","getContext","drawImage","children","createDocumentFragment","child","childNodes","clone","append","length","attribute","removeAttribute","Array","from","attributes","test","name","HTMLCanvasElement","childClone","SplitLayout","root","pendingFrame","disposed","resizeLoadGeneration","resizeControllerEntry","focusAfterResizeLoad","pendingFocusFrame","pendingFocusRetryTimer","refs","Map","domIds","prefix","resizeReloadWarningId","nextDomId","nextDragId","dragPreview","drag","setDrag","id","token","drop","setDrop","resizeController","setResizeController","reloadRequired","cancelPendingFocusRestore","cancelAnimationFrame","clearTimeout","focusAfterRender","selector","preserveCurrentFocus","attemptFocus","retries","currentFocus","ownerDocument","activeElement","body","target","querySelector","focus","preventScroll","window","setTimeout","requestAnimationFrame","trackFocusChange","event","addEventListener","removeEventListener","clearDrag","remove","createDragPreview","preview","inert","domId","existing","get","created","set","leaves","center","leafMap","map","frames","branches","values","flatMap","frame","node","kind","generation","entry","then","default","Controller","shouldFocusHandle","current","has","allowedTarget","transfer","types","dropLabel","placement","branchMap","schedule","action","active","contains","field","HTMLTextAreaElement","HTMLInputElement","selection","start","selectionStart","end","selectionEnd","selectionDirection","isConnected","setSelectionRange","clear","close","next","_el$","_tmpl$","_el$2","firstChild","_$use","el","_$insert","_$createComponent","each","initial","content","paneLabel","actions","delete","_el$3","_tmpl$2","_el$4","_el$5","_el$6","_el$7","nextSibling","$$focusin","dataTransfer","clientX","clientY","currentTarget","getBoundingClientRect","accepted","getData","preventDefault","relatedTarget","dropEffect","_$setAttribute","setData","effectAllowed","setDragImage","previewFrame","scaleX","scaleY","_c$2","_$memo","_c$3","variant","tooltip","onClick","_c$4","_el$8","_tmpl$3","_$effect","_$className","_p$","_v$4","_v$5","_v$6","_v$7","focusedLeafId","_v$8","_v$9","_v$0","_v$1","_v$10","Boolean","_v$11","_v$12","e","t","a","o","i","n","s","h","_$style","r","d","l","when","fallback","_el$9","_tmpl$4","_v$13","_v$14","_v$15","join","_v$16","_v$17","_v$18","_v$19","_v$20","component","_c$","_el$0","_tmpl$5","_c$5","_el$1","_tmpl$6","location","reload","_v$","_v$2","_v$3","_$delegateEvents"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import {\n For,\n createEffect,\n createComputed,\n createMemo,\n createUniqueId,\n createSignal,\n onMount,\n onCleanup,\n on,\n Show,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { X as LucideX, GripVertical as LucideGripVertical } from 'lucide-solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../../ui/button'\nimport { resizeSeparatorClass } from '#lib/resize-separator'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\nconst GripVertical = fastIcon(LucideGripVertical)\nexport type { PaneDropIntent } from './drop'\nconst PANE_DRAG_TYPE = 'application/x-adea-pane-move'\nconst DRAG_PREVIEW_MAX_WIDTH = 384\nconst DRAG_PREVIEW_MAX_HEIGHT = 256\nimport {\n listLeaves,\n MAX_SPLIT_RATIO,\n MIN_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\nimport type { SplitLayoutResizeControllerProps } from './resize-controller-core'\n\ntype ResizeController<L extends SplitLayoutLeaf> = (\n props: SplitLayoutResizeControllerProps<L>\n) => JSX.Element\ntype ResizeControllerState<L extends SplitLayoutLeaf> = ResizeController<L> | false | 'error'\n\n/*\n * Browsers cache a failed module import under its URL, failed static\n * dependencies included, so retrying the same specifier fails again without a\n * request. Each attempt therefore takes the next entry: a second facade over\n * the same implementation (a failed facade request recovers without fetching\n * the implementation twice), then a facade over a byte-identical copy of the\n * implementation (a failed implementation chunk recovers). After the last one\n * only a reload can fetch the controller.\n */\nconst resizeControllerEntries = [\n () => import('./resize-controller'),\n () => import('./resize-controller-retry'),\n () => import('./resize-controller-retry-2'),\n]\n\nexport type SplitLayoutProps<L extends SplitLayoutLeaf> = {\n state: SplitLayoutState<L>\n label: string\n /** Accessible name for a pane region and its close button. */\n labelForLeaf: (leaf: L) => string\n /** Called once per stable leaf owner; the accessor tracks opaque payload replacement. */\n renderLeaf: (leaf: Accessor<L>) => JSX.Element\n /** Inline visible header composition, separate from the region and close-button name. */\n renderPaneLabel?: (leaf: Accessor<L>) => JSX.Element\n /** Whether pane regions participate in sequential keyboard navigation; defaults to programmatic focus only. */\n paneTabIndex?: 0 | -1\n /** Accessible splitter name; defaults to the current orientation-specific label. */\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n onFocus?: (leafId: string) => void\n /** Host performs the model transition and returns the surviving focus destination. */\n onClose?: (leafId: string) => string | undefined\n /** Pointer placement only; the host supplies keyboard commands and performs the model transition. */\n onMove?: (leafId: string, targetId: string, intent: PaneDropIntent) => void\n /** Stable header composition for host-owned keyboard actions/capability feedback. */\n renderPaneActions?: (leaf: Accessor<L>) => JSX.Element\n class?: string\n}\nfunction rectStyle(rect: LayoutRect): JSX.CSSProperties {\n return {\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n }\n}\nfunction separatorPlaceholderStyle(branch: SplitLayoutBranch, rect: LayoutRect): JSX.CSSProperties {\n const horizontal = branch.direction === 'row'\n return {\n left: `${(rect.x + (horizontal ? rect.width * branch.ratio : 0)) * 100}%`,\n top: `${(rect.y + (horizontal ? 0 : rect.height * branch.ratio)) * 100}%`,\n width: horizontal ? '1px' : `${rect.width * 100}%`,\n height: horizontal ? `${rect.height * 100}%` : '1px',\n transform: horizontal ? 'translateX(-50%)' : 'translateY(-50%)',\n }\n}\nfunction dragPreviewPlaceholder(source: HTMLElement, message: string) {\n const placeholder = document.createElement('div')\n placeholder.className = cn(\n source.getAttribute('class'),\n 'flex min-h-8 min-w-0 items-center justify-center bg-muted px-2 text-center text-xs text-muted-foreground'\n )\n placeholder.setAttribute('data-split-drag-placeholder', source.localName)\n placeholder.textContent = message\n return placeholder\n}\nfunction boundedSnapshotSize(width: number, height: number) {\n const sourceWidth = Math.max(1, width)\n const sourceHeight = Math.max(1, height)\n const scale = Math.min(\n 1,\n DRAG_PREVIEW_MAX_WIDTH / sourceWidth,\n DRAG_PREVIEW_MAX_HEIGHT / sourceHeight\n )\n return {\n width: Math.max(1, Math.round(sourceWidth * scale)),\n height: Math.max(1, Math.round(sourceHeight * scale)),\n }\n}\nfunction cloneDragPreviewNode(source: Node): Node | undefined {\n if (source.nodeType === Node.TEXT_NODE) return source.cloneNode(false)\n if (!(source instanceof HTMLElement || source instanceof SVGElement))\n return source.cloneNode(false)\n\n if (['script', 'style', 'link', 'source', 'track', 'meta'].includes(source.localName))\n return undefined\n if (['iframe', 'video', 'audio', 'object', 'embed'].includes(source.localName))\n return dragPreviewPlaceholder(\n source as HTMLElement,\n 'Embedded content unavailable while moving'\n )\n if (source instanceof HTMLImageElement) {\n const snapshot = document.createElement('canvas')\n const size = boundedSnapshotSize(\n source.naturalWidth || source.width,\n source.naturalHeight || source.height\n )\n snapshot.width = size.width\n snapshot.height = size.height\n snapshot.className = source.getAttribute('class') ?? ''\n snapshot.setAttribute('data-split-drag-image', '')\n try {\n if (!source.complete || source.naturalWidth === 0)\n throw new Error('image has no decoded pixels')\n const context = snapshot.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, snapshot.width, snapshot.height)\n return snapshot\n } catch {\n return dragPreviewPlaceholder(source, 'Image preview unavailable')\n }\n }\n\n // Copying a defined custom element can run its constructor; inserting it can\n // also reconnect a stream or terminal session. Flatten its display tree.\n if (source instanceof HTMLElement && source.localName.includes('-')) {\n const children = document.createDocumentFragment()\n for (const child of source.childNodes) {\n const clone = cloneDragPreviewNode(child)\n if (clone) children.append(clone)\n }\n return children.childNodes.length > 0\n ? children\n : dragPreviewPlaceholder(source, 'Live component preview unavailable while moving')\n }\n\n const clone = source.cloneNode(false) as HTMLElement | SVGElement\n for (const attribute of [\n 'id',\n 'style',\n 'draggable',\n 'data-pane-drag-handle',\n 'data-pane-id',\n 'src',\n 'srcset',\n 'href',\n 'xlink:href',\n 'data',\n 'poster',\n ])\n clone.removeAttribute(attribute)\n for (const attribute of Array.from(clone.attributes))\n if (/^on/i.test(attribute.name)) clone.removeAttribute(attribute.name)\n\n if (source instanceof HTMLCanvasElement && clone instanceof HTMLCanvasElement) {\n const size = boundedSnapshotSize(source.width, source.height)\n clone.width = size.width\n clone.height = size.height\n try {\n const context = clone.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, clone.width, clone.height)\n } catch {\n return dragPreviewPlaceholder(source, 'Canvas preview unavailable while moving')\n }\n return clone\n }\n\n for (const child of source.childNodes) {\n const childClone = cloneDragPreviewNode(child)\n if (childClone) clone.append(childClone)\n }\n return clone\n}\n/** Muxy frame geometry keeps leaf owners stable; the lazy resize controller owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n let disposed = false\n let resizeLoadGeneration = 0\n let resizeControllerEntry = 0\n let focusAfterResizeLoad = false\n let pendingFocusFrame: number | undefined\n let pendingFocusRetryTimer: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\n const resizeReloadWarningId = `${prefix}-resize-reload-warning`\n let nextDomId = 0\n let nextDragId = 0\n let dragPreview: HTMLElement | undefined\n const [drag, setDrag] = createSignal<{ id: string; token: string }>()\n const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()\n const [resizeController, setResizeController] = createSignal<ResizeControllerState<L>>()\n const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length\n const cancelPendingFocusRestore = () => {\n if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)\n pendingFocusFrame = undefined\n if (pendingFocusRetryTimer !== undefined) clearTimeout(pendingFocusRetryTimer)\n pendingFocusRetryTimer = undefined\n }\n const focusAfterRender = (selector: string, preserveCurrentFocus = false) => {\n const attemptFocus = (retries: number) => {\n if (preserveCurrentFocus) {\n const currentFocus = root?.ownerDocument.activeElement\n if (currentFocus && currentFocus !== root?.ownerDocument.body && currentFocus !== root)\n return\n }\n const target = root?.querySelector<HTMLElement>(selector)\n if (target) {\n target.focus({ preventScroll: true })\n return\n }\n // A Solid state update can commit the replacement control after the\n // first frame. Retry in bounded tasks so a backgrounded page's paused\n // animation frames cannot strand keyboard focus.\n if (retries > 0)\n pendingFocusRetryTimer = window.setTimeout(() => {\n pendingFocusRetryTimer = undefined\n attemptFocus(retries - 1)\n }, 0)\n }\n cancelPendingFocusRestore()\n pendingFocusFrame = requestAnimationFrame(() => {\n pendingFocusFrame = undefined\n attemptFocus(2)\n })\n }\n const trackFocusChange = (event: FocusEvent) => {\n if (event.target === document.body) return\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n }\n onMount(() => {\n document.addEventListener('focusin', trackFocusChange)\n onCleanup(() => document.removeEventListener('focusin', trackFocusChange))\n })\n const clearDrag = () => {\n setDrag(undefined)\n setDrop(undefined)\n dragPreview?.remove()\n dragPreview = undefined\n }\n const createDragPreview = (source: HTMLElement) => {\n dragPreview?.remove()\n const preview = cloneDragPreviewNode(source) as HTMLElement\n preview.className =\n 'pointer-events-none fixed -left-full top-0 z-(--z-dialog) flex h-64 max-h-screen w-96 max-w-screen min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-xl'\n preview.removeAttribute('id')\n preview.removeAttribute('style')\n preview.removeAttribute('role')\n preview.removeAttribute('aria-label')\n preview.removeAttribute('data-pane-id')\n preview.removeAttribute('data-focused')\n preview.removeAttribute('data-drag-source')\n preview.removeAttribute('data-drop-direction')\n preview.removeAttribute('data-drop-placement')\n preview.setAttribute('data-split-drag-preview', '')\n preview.setAttribute('aria-hidden', 'true')\n preview.inert = true\n document.body.append(preview)\n dragPreview = preview\n return preview\n }\n const domId = (id: string) => {\n const existing = domIds.get(id)\n if (existing) return existing\n const created = `${prefix}-pane-${nextDomId++}`\n domIds.set(id, created)\n return created\n }\n const leaves = createMemo(() => listLeaves(props.state.center))\n const leafMap = createMemo(() => new Map(leaves().map((leaf) => [leaf.id, leaf])))\n const frames = createMemo(() => computeLayoutFrames(props.state.center))\n const branches = createMemo(() =>\n Array.from(frames().values()).flatMap((frame) =>\n frame.node.kind === 'split' ? [frame.node] : []\n )\n )\n createEffect(() => {\n if (branches().length === 0) {\n resizeLoadGeneration += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n // Keep a loaded controller so a later split does not re-import an entry\n // that may have failed before recovery. Clear only transient UI state.\n if (resizeController() === false || resizeController() === 'error')\n setResizeController(undefined)\n return\n }\n if (resizeController() !== undefined) return\n const generation = ++resizeLoadGeneration\n const entry = Math.min(resizeControllerEntry, resizeControllerEntries.length - 1)\n cancelPendingFocusRestore()\n setResizeController(false)\n void resizeControllerEntries[entry]!().then(\n ({ default: Controller }) => {\n if (disposed || generation !== resizeLoadGeneration || branches().length === 0) return\n const shouldFocusHandle = focusAfterResizeLoad\n focusAfterResizeLoad = false\n setResizeController(() => Controller)\n if (shouldFocusHandle) focusAfterRender('[data-split-layout-handle]', true)\n },\n () => {\n // The next split must start from the next entry as well.\n resizeControllerEntry = Math.max(resizeControllerEntry, entry + 1)\n if (!disposed && generation === resizeLoadGeneration && branches().length > 0) {\n setResizeController('error')\n if (focusAfterResizeLoad) focusAfterRender('[data-resize-retry]')\n }\n }\n )\n })\n createComputed(() => {\n const current = drag()\n if (current && (!props.onMove || !leafMap().has(current.id))) clearDrag()\n const target = drop()\n if (target && !leafMap().has(target.id)) setDrop(undefined)\n })\n const allowedTarget = (id: string, transfer: DataTransfer | null) => {\n const current = drag()\n return props.onMove &&\n current &&\n current.id !== id &&\n leafMap().has(current.id) &&\n leafMap().has(id) &&\n transfer?.types.includes(PANE_DRAG_TYPE)\n ? current\n : undefined\n }\n const dropLabel = createMemo(() => {\n const target = drop()\n const leaf = target ? leafMap().get(target.id) : undefined\n return target && leaf\n ? `Drop to place pane ${target.intent.placement} ${props.labelForLeaf(leaf)}`\n : ''\n })\n const branchMap = createMemo(() => new Map(branches().map((branch) => [branch.id, branch])))\n const schedule = (action: () => void) => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n pendingFrame = requestAnimationFrame(() => {\n pendingFrame = undefined\n action()\n })\n }\n // Register before keyed children update: capture a focused editor before an\n // ordered DOM move can blur it. Never override a newer focus outside this root.\n createComputed(\n on(\n () => props.state.center,\n () => {\n const active = root?.ownerDocument.activeElement\n if (!root || !(active instanceof HTMLElement) || !root.contains(active)) return\n const field =\n active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement\n ? active\n : undefined\n const selection = field\n ? {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n : undefined\n schedule(() => {\n if (!active.isConnected || !root?.contains(active)) return\n const current = active.ownerDocument.activeElement\n if (current !== active && current !== active.ownerDocument.body) return\n active.focus({ preventScroll: true })\n if (field && selection?.start !== null && selection?.end !== null && selection)\n field.setSelectionRange(\n selection.start,\n selection.end,\n selection.direction ?? undefined\n )\n })\n }\n )\n )\n onCleanup(() => {\n disposed = true\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n clearDrag()\n refs.clear()\n domIds.clear()\n })\n const close = (id: string) => {\n const next = props.onClose?.(id)\n if (next) schedule(() => refs.get(next)?.focus({ preventScroll: true }))\n }\n return (\n <div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n const initial = leafMap().get(id)!\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n const leaf = createMemo(() => leafMap().get(id) ?? initial)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabIndex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) setDrop(undefined)\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={Boolean(props.onMove)}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={clearDrag}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel() ||\n (resizeController() === 'error'\n ? reloadRequired()\n ? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'\n : 'Resize controls did not load.'\n : '')}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const initial = branchMap().get(id)!\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n () => branchMap().get(id) ?? initial\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabIndex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>\n {resizeController() === 'error' ? (\n <div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAMW,MAAIU,SAAST,CAAO;AAC1B,IAAMC,iBAAeQ,SAASP,YAAkB;AAEhD,IAAMQ,iBAAiB;AACvB,IAAMC,yBAAyB;AAC/B,IAAMC,0BAA0B;AAyBhC,IA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AAA,EAAA,CAAA,IAMzB;IAAI,EAAA,CAAA,GAAA,IAAA;IAAAxF,OAAAqF,OAAApF,gBACP9M,QAAM;KACLiP,SAAO;KACPxK,MAAI;KAAA,qBAAA;KAAA,KAAA,sBAAA;MAAA,OAEciD,eAAe,IAAIZ,wBAAwBxC,KAAAA;KAAS;KACtE6K,UAAUpG,UAAU;MAClB,IAAIrB,eAAe,GAAG;OACpBiB,OAAO4J,SAASC,OAAO;OACvB;MACF;MACAjM,uBAAuBvD,SAASqF,kBAAkBU,MAAMiF;MACxDvG,oBAAoBnD,KAAAA,CAAS;KAC/B;KAAC,IAAAW,WAAA;MAAA,OAEAyC,eAAe,IAAI,kCAAkC;KAAqB;IAAA,CAAA,GAAA,IAAA;IAAA,OAAAwK;GAAA,EAAA,CAAA,IAG7E;EAAI,EAAA,CAAA,GAAA,IAAA;EAAA3C,QAAAE,QAAA;GAAA,IAAAgD,MAxOI7R,MAAMG,OAAK2R,OAERxL,KAAK,IAAI,KAAK5C,KAAAA,GAASqO,OAC/BzS,GAAG,sEAAsEU,MAAMkB,KAAK;GAAC2Q,QAAAhD,IAAAc,KAAAhC,aAAAhC,MAAA,cAAAkD,IAAAc,IAAAkC,GAAA;GAAAC,SAAAjD,IAAAe,KAAAjC,aAAAhC,MAAA,iBAAAkD,IAAAe,IAAAkC,IAAA;GAAAC,SAAAlD,IAAAgB,KAAAjB,UAAAjD,MAAAkD,IAAAgB,IAAAkC,IAAA;GAAA,OAAAlD;EAAA,GAAA;GAAAc,GAAAjM,KAAAA;GAAAkM,GAAAlM,KAAAA;GAAAmM,GAAAnM,KAAAA;EAAA,CAAA;EAAA,OAAAiI;CAAA,EAAA,CAAA;AAwOlG;AAACqG,eAAA,CAAA,SAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"split-layout.js","names":["For","createEffect","createComputed","createMemo","createUniqueId","createSignal","onMount","onCleanup","on","Show","Dynamic","X","LucideX","GripVertical","LucideGripVertical","ActionButton","Button","resizeSeparatorClass","cn","computeLayoutFrames","paneDropIntent","fastIcon","PANE_DRAG_TYPE","DRAG_PREVIEW_MAX_WIDTH","DRAG_PREVIEW_MAX_HEIGHT","listLeaves","MAX_SPLIT_RATIO","MIN_SPLIT_RATIO","props","resizeControllerEntries","state","label","labelForLeaf","leaf","renderLeaf","renderPaneLabel","paneTabIndex","labelForSeparator","branch","onResize","ratio","onFocus","onClose","onMove","intent","renderPaneActions","class","rectStyle","rect","left","x","top","y","width","height","separatorPlaceholderStyle","horizontal","direction","transform","dragPreviewPlaceholder","source","HTMLElement","message","placeholder","document","createElement","className","getAttribute","setAttribute","localName","textContent","boundedSnapshotSize","sourceWidth","Math","max","sourceHeight","scale","min","round","cloneDragPreviewNode","Node","nodeType","TEXT_NODE","cloneNode","SVGElement","includes","undefined","HTMLImageElement","snapshot","size","naturalWidth","naturalHeight","complete","Error","context","getContext","drawImage","children","createDocumentFragment","child","childNodes","clone","append","length","attribute","removeAttribute","Array","from","attributes","test","name","HTMLCanvasElement","childClone","SplitLayout","root","pendingFrame","disposed","resizeLoadGeneration","resizeControllerEntry","focusAfterResizeLoad","focusMoves","pendingFocusFrame","pendingFocusRetryTimer","refs","Map","domIds","prefix","resizeReloadWarningId","nextDomId","nextDragId","dragPreview","drag","setDrag","id","token","drop","setDrop","resizeController","setResizeController","reloadRequired","cancelPendingFocusRestore","cancelAnimationFrame","clearTimeout","focusAfterRender","selector","preserveCurrentFocus","attemptFocus","retries","currentFocus","ownerDocument","activeElement","body","target","querySelector","focus","preventScroll","window","setTimeout","requestAnimationFrame","trackFocusChange","event","addEventListener","removeEventListener","clearDrag","remove","createDragPreview","preview","inert","domId","existing","get","created","set","leaves","center","leafMap","map","frames","branches","values","flatMap","frame","node","kind","generation","entry","then","default","Controller","shouldFocusHandle","current","has","allowedTarget","transfer","types","dropLabel","placement","branchMap","schedule","action","active","contains","field","HTMLTextAreaElement","HTMLInputElement","selection","start","selectionStart","end","selectionEnd","selectionDirection","moves","isConnected","setSelectionRange","clear","close","next","_el$","_tmpl$","_el$2","firstChild","_$use","el","_$insert","_$createComponent","each","initial","content","paneLabel","actions","delete","_el$3","_tmpl$2","_el$4","_el$5","_el$6","_el$7","nextSibling","$$focusin","dataTransfer","clientX","clientY","currentTarget","getBoundingClientRect","accepted","getData","preventDefault","relatedTarget","dropEffect","_$setAttribute","setData","effectAllowed","setDragImage","previewFrame","scaleX","scaleY","_c$2","_$memo","_c$3","variant","tooltip","onClick","_c$4","_el$8","_tmpl$3","_$effect","_$className","_p$","_v$4","_v$5","_v$6","_v$7","focusedLeafId","_v$8","_v$9","_v$0","_v$1","_v$10","Boolean","_v$11","_v$12","e","t","a","o","i","n","s","h","_$style","r","d","l","when","fallback","_el$9","_tmpl$4","_v$13","_v$14","_v$15","join","_v$16","_v$17","_v$18","_v$19","_v$20","component","_c$","_el$0","_tmpl$5","_c$5","_el$1","_tmpl$6","location","reload","_v$","_v$2","_v$3","_$delegateEvents"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import {\n For,\n createEffect,\n createComputed,\n createMemo,\n createUniqueId,\n createSignal,\n onMount,\n onCleanup,\n on,\n Show,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { X as LucideX, GripVertical as LucideGripVertical } from 'lucide-solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../../ui/button'\nimport { resizeSeparatorClass } from '#lib/resize-separator'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\nconst GripVertical = fastIcon(LucideGripVertical)\nexport type { PaneDropIntent } from './drop'\nconst PANE_DRAG_TYPE = 'application/x-adea-pane-move'\nconst DRAG_PREVIEW_MAX_WIDTH = 384\nconst DRAG_PREVIEW_MAX_HEIGHT = 256\nimport {\n listLeaves,\n MAX_SPLIT_RATIO,\n MIN_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\nimport type { SplitLayoutResizeControllerProps } from './resize-controller-core'\n\ntype ResizeController<L extends SplitLayoutLeaf> = (\n props: SplitLayoutResizeControllerProps<L>\n) => JSX.Element\ntype ResizeControllerState<L extends SplitLayoutLeaf> = ResizeController<L> | false | 'error'\n\n/*\n * Browsers cache a failed module import under its URL, failed static\n * dependencies included, so retrying the same specifier fails again without a\n * request. Each attempt therefore takes the next entry: a second facade over\n * the same implementation (a failed facade request recovers without fetching\n * the implementation twice), then a facade over a byte-identical copy of the\n * implementation (a failed implementation chunk recovers). After the last one\n * only a reload can fetch the controller.\n */\nconst resizeControllerEntries = [\n () => import('./resize-controller'),\n () => import('./resize-controller-retry'),\n () => import('./resize-controller-retry-2'),\n]\n\nexport type SplitLayoutProps<L extends SplitLayoutLeaf> = {\n state: SplitLayoutState<L>\n label: string\n /** Accessible name for a pane region and its close button. */\n labelForLeaf: (leaf: L) => string\n /** Called once per stable leaf owner; the accessor tracks opaque payload replacement. */\n renderLeaf: (leaf: Accessor<L>) => JSX.Element\n /** Inline visible header composition, separate from the region and close-button name. */\n renderPaneLabel?: (leaf: Accessor<L>) => JSX.Element\n /** Whether pane regions participate in sequential keyboard navigation; defaults to programmatic focus only. */\n paneTabIndex?: 0 | -1\n /** Accessible splitter name; defaults to the current orientation-specific label. */\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n onFocus?: (leafId: string) => void\n /** Host performs the model transition and returns the surviving focus destination. */\n onClose?: (leafId: string) => string | undefined\n /** Pointer placement only; the host supplies keyboard commands and performs the model transition. */\n onMove?: (leafId: string, targetId: string, intent: PaneDropIntent) => void\n /** Stable header composition for host-owned keyboard actions/capability feedback. */\n renderPaneActions?: (leaf: Accessor<L>) => JSX.Element\n class?: string\n}\nfunction rectStyle(rect: LayoutRect): JSX.CSSProperties {\n return {\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n }\n}\nfunction separatorPlaceholderStyle(branch: SplitLayoutBranch, rect: LayoutRect): JSX.CSSProperties {\n const horizontal = branch.direction === 'row'\n return {\n left: `${(rect.x + (horizontal ? rect.width * branch.ratio : 0)) * 100}%`,\n top: `${(rect.y + (horizontal ? 0 : rect.height * branch.ratio)) * 100}%`,\n width: horizontal ? '1px' : `${rect.width * 100}%`,\n height: horizontal ? `${rect.height * 100}%` : '1px',\n transform: horizontal ? 'translateX(-50%)' : 'translateY(-50%)',\n }\n}\nfunction dragPreviewPlaceholder(source: HTMLElement, message: string) {\n const placeholder = document.createElement('div')\n placeholder.className = cn(\n source.getAttribute('class'),\n 'flex min-h-8 min-w-0 items-center justify-center bg-muted px-2 text-center text-xs text-muted-foreground'\n )\n placeholder.setAttribute('data-split-drag-placeholder', source.localName)\n placeholder.textContent = message\n return placeholder\n}\nfunction boundedSnapshotSize(width: number, height: number) {\n const sourceWidth = Math.max(1, width)\n const sourceHeight = Math.max(1, height)\n const scale = Math.min(\n 1,\n DRAG_PREVIEW_MAX_WIDTH / sourceWidth,\n DRAG_PREVIEW_MAX_HEIGHT / sourceHeight\n )\n return {\n width: Math.max(1, Math.round(sourceWidth * scale)),\n height: Math.max(1, Math.round(sourceHeight * scale)),\n }\n}\nfunction cloneDragPreviewNode(source: Node): Node | undefined {\n if (source.nodeType === Node.TEXT_NODE) return source.cloneNode(false)\n if (!(source instanceof HTMLElement || source instanceof SVGElement))\n return source.cloneNode(false)\n\n if (['script', 'style', 'link', 'source', 'track', 'meta'].includes(source.localName))\n return undefined\n if (['iframe', 'video', 'audio', 'object', 'embed'].includes(source.localName))\n return dragPreviewPlaceholder(\n source as HTMLElement,\n 'Embedded content unavailable while moving'\n )\n if (source instanceof HTMLImageElement) {\n const snapshot = document.createElement('canvas')\n const size = boundedSnapshotSize(\n source.naturalWidth || source.width,\n source.naturalHeight || source.height\n )\n snapshot.width = size.width\n snapshot.height = size.height\n snapshot.className = source.getAttribute('class') ?? ''\n snapshot.setAttribute('data-split-drag-image', '')\n try {\n if (!source.complete || source.naturalWidth === 0)\n throw new Error('image has no decoded pixels')\n const context = snapshot.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, snapshot.width, snapshot.height)\n return snapshot\n } catch {\n return dragPreviewPlaceholder(source, 'Image preview unavailable')\n }\n }\n\n // Copying a defined custom element can run its constructor; inserting it can\n // also reconnect a stream or terminal session. Flatten its display tree.\n if (source instanceof HTMLElement && source.localName.includes('-')) {\n const children = document.createDocumentFragment()\n for (const child of source.childNodes) {\n const clone = cloneDragPreviewNode(child)\n if (clone) children.append(clone)\n }\n return children.childNodes.length > 0\n ? children\n : dragPreviewPlaceholder(source, 'Live component preview unavailable while moving')\n }\n\n const clone = source.cloneNode(false) as HTMLElement | SVGElement\n for (const attribute of [\n 'id',\n 'style',\n 'draggable',\n 'data-pane-drag-handle',\n 'data-pane-id',\n 'src',\n 'srcset',\n 'href',\n 'xlink:href',\n 'data',\n 'poster',\n ])\n clone.removeAttribute(attribute)\n for (const attribute of Array.from(clone.attributes))\n if (/^on/i.test(attribute.name)) clone.removeAttribute(attribute.name)\n\n if (source instanceof HTMLCanvasElement && clone instanceof HTMLCanvasElement) {\n const size = boundedSnapshotSize(source.width, source.height)\n clone.width = size.width\n clone.height = size.height\n try {\n const context = clone.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, clone.width, clone.height)\n } catch {\n return dragPreviewPlaceholder(source, 'Canvas preview unavailable while moving')\n }\n return clone\n }\n\n for (const child of source.childNodes) {\n const childClone = cloneDragPreviewNode(child)\n if (childClone) clone.append(childClone)\n }\n return clone\n}\n/** Muxy frame geometry keeps leaf owners stable; the lazy resize controller owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n let disposed = false\n let resizeLoadGeneration = 0\n let resizeControllerEntry = 0\n let focusAfterResizeLoad = false\n // Counts focus moves to a real target. A deferred restore checks it so it\n // never pulls focus back after the user (or code) deliberately moved it.\n let focusMoves = 0\n let pendingFocusFrame: number | undefined\n let pendingFocusRetryTimer: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\n const resizeReloadWarningId = `${prefix}-resize-reload-warning`\n let nextDomId = 0\n let nextDragId = 0\n let dragPreview: HTMLElement | undefined\n const [drag, setDrag] = createSignal<{ id: string; token: string }>()\n const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()\n const [resizeController, setResizeController] = createSignal<ResizeControllerState<L>>()\n const reloadRequired = () => resizeControllerEntry >= resizeControllerEntries.length\n const cancelPendingFocusRestore = () => {\n if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)\n pendingFocusFrame = undefined\n if (pendingFocusRetryTimer !== undefined) clearTimeout(pendingFocusRetryTimer)\n pendingFocusRetryTimer = undefined\n }\n const focusAfterRender = (selector: string, preserveCurrentFocus = false) => {\n const attemptFocus = (retries: number) => {\n if (preserveCurrentFocus) {\n const currentFocus = root?.ownerDocument.activeElement\n if (currentFocus && currentFocus !== root?.ownerDocument.body && currentFocus !== root)\n return\n }\n const target = root?.querySelector<HTMLElement>(selector)\n if (target) {\n target.focus({ preventScroll: true })\n return\n }\n // A Solid state update can commit the replacement control after the\n // first frame. Retry in bounded tasks so a backgrounded page's paused\n // animation frames cannot strand keyboard focus.\n if (retries > 0)\n pendingFocusRetryTimer = window.setTimeout(() => {\n pendingFocusRetryTimer = undefined\n attemptFocus(retries - 1)\n }, 0)\n }\n cancelPendingFocusRestore()\n pendingFocusFrame = requestAnimationFrame(() => {\n pendingFocusFrame = undefined\n attemptFocus(2)\n })\n }\n const trackFocusChange = (event: FocusEvent) => {\n if (event.target === document.body) return\n focusMoves += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n }\n onMount(() => {\n document.addEventListener('focusin', trackFocusChange)\n onCleanup(() => document.removeEventListener('focusin', trackFocusChange))\n })\n const clearDrag = () => {\n setDrag(undefined)\n setDrop(undefined)\n dragPreview?.remove()\n dragPreview = undefined\n }\n const createDragPreview = (source: HTMLElement) => {\n dragPreview?.remove()\n const preview = cloneDragPreviewNode(source) as HTMLElement\n preview.className =\n 'pointer-events-none fixed -left-full top-0 z-(--z-dialog) flex h-64 max-h-screen w-96 max-w-screen min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-xl'\n preview.removeAttribute('id')\n preview.removeAttribute('style')\n preview.removeAttribute('role')\n preview.removeAttribute('aria-label')\n preview.removeAttribute('data-pane-id')\n preview.removeAttribute('data-focused')\n preview.removeAttribute('data-drag-source')\n preview.removeAttribute('data-drop-direction')\n preview.removeAttribute('data-drop-placement')\n preview.setAttribute('data-split-drag-preview', '')\n preview.setAttribute('aria-hidden', 'true')\n preview.inert = true\n document.body.append(preview)\n dragPreview = preview\n return preview\n }\n const domId = (id: string) => {\n const existing = domIds.get(id)\n if (existing) return existing\n const created = `${prefix}-pane-${nextDomId++}`\n domIds.set(id, created)\n return created\n }\n const leaves = createMemo(() => listLeaves(props.state.center))\n const leafMap = createMemo(() => new Map(leaves().map((leaf) => [leaf.id, leaf])))\n const frames = createMemo(() => computeLayoutFrames(props.state.center))\n const branches = createMemo(() =>\n Array.from(frames().values()).flatMap((frame) =>\n frame.node.kind === 'split' ? [frame.node] : []\n )\n )\n createEffect(() => {\n if (branches().length === 0) {\n resizeLoadGeneration += 1\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n // Keep a loaded controller so a later split does not re-import an entry\n // that may have failed before recovery. Clear only transient UI state.\n if (resizeController() === false || resizeController() === 'error')\n setResizeController(undefined)\n return\n }\n if (resizeController() !== undefined) return\n const generation = ++resizeLoadGeneration\n const entry = Math.min(resizeControllerEntry, resizeControllerEntries.length - 1)\n cancelPendingFocusRestore()\n setResizeController(false)\n void resizeControllerEntries[entry]!().then(\n ({ default: Controller }) => {\n if (disposed || generation !== resizeLoadGeneration || branches().length === 0) return\n const shouldFocusHandle = focusAfterResizeLoad\n focusAfterResizeLoad = false\n setResizeController(() => Controller)\n if (shouldFocusHandle) focusAfterRender('[data-split-layout-handle]', true)\n },\n () => {\n // The next split must start from the next entry as well.\n resizeControllerEntry = Math.max(resizeControllerEntry, entry + 1)\n if (!disposed && generation === resizeLoadGeneration && branches().length > 0) {\n setResizeController('error')\n if (focusAfterResizeLoad) focusAfterRender('[data-resize-retry]')\n }\n }\n )\n })\n createComputed(() => {\n const current = drag()\n if (current && (!props.onMove || !leafMap().has(current.id))) clearDrag()\n const target = drop()\n if (target && !leafMap().has(target.id)) setDrop(undefined)\n })\n const allowedTarget = (id: string, transfer: DataTransfer | null) => {\n const current = drag()\n return props.onMove &&\n current &&\n current.id !== id &&\n leafMap().has(current.id) &&\n leafMap().has(id) &&\n transfer?.types.includes(PANE_DRAG_TYPE)\n ? current\n : undefined\n }\n const dropLabel = createMemo(() => {\n const target = drop()\n const leaf = target ? leafMap().get(target.id) : undefined\n return target && leaf\n ? `Drop to place pane ${target.intent.placement} ${props.labelForLeaf(leaf)}`\n : ''\n })\n const branchMap = createMemo(() => new Map(branches().map((branch) => [branch.id, branch])))\n const schedule = (action: () => void) => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n pendingFrame = requestAnimationFrame(() => {\n pendingFrame = undefined\n action()\n })\n }\n // Register before keyed children update: capture a focused editor before an\n // ordered DOM move can blur it. Never override a newer focus outside this root.\n createComputed(\n on(\n () => props.state.center,\n () => {\n const active = root?.ownerDocument.activeElement\n if (!root || !(active instanceof HTMLElement) || !root.contains(active)) return\n const field =\n active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement\n ? active\n : undefined\n const selection = field\n ? {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n : undefined\n const moves = focusMoves\n schedule(() => {\n // Focus went somewhere else on purpose (for example the resize retry\n // action) before this frame ran: that focus, not this one, is current.\n if (focusMoves !== moves) return\n if (!active.isConnected || !root?.contains(active)) return\n const current = active.ownerDocument.activeElement\n if (current !== active && current !== active.ownerDocument.body) return\n active.focus({ preventScroll: true })\n if (field && selection?.start !== null && selection?.end !== null && selection)\n field.setSelectionRange(\n selection.start,\n selection.end,\n selection.direction ?? undefined\n )\n })\n }\n )\n )\n onCleanup(() => {\n disposed = true\n focusAfterResizeLoad = false\n cancelPendingFocusRestore()\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n clearDrag()\n refs.clear()\n domIds.clear()\n })\n const close = (id: string) => {\n const next = props.onClose?.(id)\n if (next) schedule(() => refs.get(next)?.focus({ preventScroll: true }))\n }\n return (\n <div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n const initial = leafMap().get(id)!\n // A memo: the map is rebuilt on every resize tick, but the leaf object\n // only changes when the leaf does, so the host's renderers stay quiet.\n const leaf = createMemo(() => leafMap().get(id) ?? initial)\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabIndex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) setDrop(undefined)\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={Boolean(props.onMove)}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={clearDrag}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n tooltip={`Close ${props.labelForLeaf(leaf())}.`}\n onClick={() => close(id)}\n >\n <X />\n </ActionButton>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel() ||\n (resizeController() === 'error'\n ? reloadRequired()\n ? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'\n : 'Resize controls did not load.'\n : '')}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const initial = branchMap().get(id)!\n const branch: Accessor<SplitLayoutBranch<L>> = createMemo(\n () => branchMap().get(id) ?? initial\n )\n const rect = () => frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 }\n return (\n <Show\n when={typeof resizeController() === 'function'}\n fallback={\n <div\n role=\"separator\"\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={Math.round(MIN_SPLIT_RATIO * 100)}\n aria-valuemax={Math.round(MAX_SPLIT_RATIO * 100)}\n aria-valuenow={Math.round(branch().ratio * 100)}\n aria-disabled=\"true\"\n tabIndex={-1}\n data-direction={branch().direction}\n style={separatorPlaceholderStyle(branch(), rect())}\n class=\"pointer-events-none absolute bg-border\"\n />\n }\n >\n <Dynamic\n component={resizeController() as ResizeController<L>}\n branch={branch}\n rect={() => rectStyle(rect())}\n domId={domId}\n root={() => root}\n labelForSeparator={props.labelForSeparator}\n class={cn(resizeSeparatorClass(), 'pointer-events-auto absolute cursor-pointer')}\n onResize={props.onResize}\n />\n </Show>\n )\n }}\n </For>\n {resizeController() === 'error' ? (\n <div class=\"absolute top-2 right-2 z-(--z-menu) flex max-w-sm flex-col items-end gap-2\">\n {reloadRequired() ? (\n <p\n id={resizeReloadWarningId}\n role=\"alert\"\n class=\"rounded-md border bg-background p-2 text-sm shadow-md\"\n >\n Reloading may discard unsaved pane content.\n </p>\n ) : null}\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-resize-retry\n aria-describedby={reloadRequired() ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (reloadRequired()) {\n window.location.reload()\n return\n }\n focusAfterResizeLoad = document.activeElement === event.currentTarget\n setResizeController(undefined)\n }}\n >\n {reloadRequired() ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\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c,GAAAnM,KAAAA;GAAAoM,GAAApM,KAAAA;GAAAqM,GAAArM,KAAAA;EAAA,CAAA;EAAA,OAAAmI;CAAA,EAAA,CAAA;AAwOlG;AAACqG,eAAA,CAAA,SAAA,CAAA"}
|
|
@@ -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
|
|
19
|
-
*
|
|
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
|
|
27
|
-
*
|
|
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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AK,CAAA,CAAA,KACxBrG,gBAGCxB,aAAoBqJ,OAAK;MAAA,eAAA;MAAA,SAAA;KAAuC,CAAA,CAClE,GAAAD,WACAjI,MAAMQ,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,aA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;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"}
|
package/dist/lib/overlay.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
87
|
-
|
|
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,CAAA;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,4EACiD,CAAA;AAE3E;;;GAGG;AACH,eAAO,MAAM,YAAY,wDAAwD,CAAA;AAEjF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,6DAA6D,CAAA;AAE3F,gDAAgD;AAChD,eAAO,MAAM,YAAY,yFAC+D,CAAA;AAExF,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,oGACoE,CAAA;AAEnG,gDAAgD;AAChD,eAAO,MAAM,aAAa,qCAAqC,CAAA;AAE/D,+FAA+F;AAC/F,eAAO,MAAM,aAAa,2DAA2D,CAAA;AAErF,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,kCAAkC,CAAA;AAEjE,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,QAGkE,CAAA;AAEjG;;;;;GAKG;AACH,eAAO,MAAM,UAAU,iEAAiE,CAAA;AAExF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,QAEkD,CAAA;AAE1E,yDAAyD;AACzD,eAAO,MAAM,aAAa,yMAAuE,CAAA;AAEjG,sEAAsE;AACtE,eAAO,MAAM,aAAa,yMAAuE,CAAA;AAEjG;qCACqC;AACrC,eAAO,MAAM,aAAa,QAE6B,CAAA;AAEvD,+DAA+D;AAC/D,eAAO,MAAM,YAAY,+BAA+B,CAAA;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,QAO+D,CAAA;AAEpF
|
|
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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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"}
|
package/dist/lib/overlay.js
CHANGED
|
@@ -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
|
-
/**
|
|
88
|
-
|
|
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. */
|
package/dist/lib/overlay.js.map
CHANGED
|
@@ -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"}
|
|
@@ -216,6 +216,9 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
216
216
|
let resizeLoadGeneration = 0
|
|
217
217
|
let resizeControllerEntry = 0
|
|
218
218
|
let focusAfterResizeLoad = false
|
|
219
|
+
// Counts focus moves to a real target. A deferred restore checks it so it
|
|
220
|
+
// never pulls focus back after the user (or code) deliberately moved it.
|
|
221
|
+
let focusMoves = 0
|
|
219
222
|
let pendingFocusFrame: number | undefined
|
|
220
223
|
let pendingFocusRetryTimer: number | undefined
|
|
221
224
|
const refs = new Map<string, HTMLElement>()
|
|
@@ -264,6 +267,7 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
264
267
|
}
|
|
265
268
|
const trackFocusChange = (event: FocusEvent) => {
|
|
266
269
|
if (event.target === document.body) return
|
|
270
|
+
focusMoves += 1
|
|
267
271
|
focusAfterResizeLoad = false
|
|
268
272
|
cancelPendingFocusRestore()
|
|
269
273
|
}
|
|
@@ -398,7 +402,11 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
398
402
|
direction: field.selectionDirection,
|
|
399
403
|
}
|
|
400
404
|
: undefined
|
|
405
|
+
const moves = focusMoves
|
|
401
406
|
schedule(() => {
|
|
407
|
+
// Focus went somewhere else on purpose (for example the resize retry
|
|
408
|
+
// action) before this frame ran: that focus, not this one, is current.
|
|
409
|
+
if (focusMoves !== moves) return
|
|
402
410
|
if (!active.isConnected || !root?.contains(active)) return
|
|
403
411
|
const current = active.ownerDocument.activeElement
|
|
404
412
|
if (current !== active && current !== active.ownerDocument.body) return
|
|
@@ -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
|
|
45
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
'
|
|
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
|
@@ -216,6 +216,9 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
216
216
|
let resizeLoadGeneration = 0
|
|
217
217
|
let resizeControllerEntry = 0
|
|
218
218
|
let focusAfterResizeLoad = false
|
|
219
|
+
// Counts focus moves to a real target. A deferred restore checks it so it
|
|
220
|
+
// never pulls focus back after the user (or code) deliberately moved it.
|
|
221
|
+
let focusMoves = 0
|
|
219
222
|
let pendingFocusFrame: number | undefined
|
|
220
223
|
let pendingFocusRetryTimer: number | undefined
|
|
221
224
|
const refs = new Map<string, HTMLElement>()
|
|
@@ -264,6 +267,7 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
264
267
|
}
|
|
265
268
|
const trackFocusChange = (event: FocusEvent) => {
|
|
266
269
|
if (event.target === document.body) return
|
|
270
|
+
focusMoves += 1
|
|
267
271
|
focusAfterResizeLoad = false
|
|
268
272
|
cancelPendingFocusRestore()
|
|
269
273
|
}
|
|
@@ -398,7 +402,11 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
398
402
|
direction: field.selectionDirection,
|
|
399
403
|
}
|
|
400
404
|
: undefined
|
|
405
|
+
const moves = focusMoves
|
|
401
406
|
schedule(() => {
|
|
407
|
+
// Focus went somewhere else on purpose (for example the resize retry
|
|
408
|
+
// action) before this frame ran: that focus, not this one, is current.
|
|
409
|
+
if (focusMoves !== moves) return
|
|
402
410
|
if (!active.isConnected || !root?.contains(active)) return
|
|
403
411
|
const current = active.ownerDocument.activeElement
|
|
404
412
|
if (current !== active && current !== active.ownerDocument.body) return
|
|
@@ -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
|
|
45
|
-
*
|
|
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
|
package/src/lib/overlay.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
-
'
|
|
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 =
|