@adea-ai/ui 0.122.3 → 0.123.1
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/resize-controller-core-retry.d.ts +13 -0
- package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -0
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +63 -0
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -0
- package/dist/components/layout/split-layout/resize-controller-core.d.ts +13 -0
- package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -0
- package/dist/components/layout/split-layout/resize-controller-core.js +63 -0
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -0
- package/dist/components/layout/split-layout/resize-controller-retry-2.d.ts +3 -0
- package/dist/components/layout/split-layout/resize-controller-retry-2.d.ts.map +1 -0
- package/dist/components/layout/split-layout/resize-controller-retry-2.js +2 -0
- package/dist/components/layout/split-layout/resize-controller-retry.d.ts +2 -0
- package/dist/components/layout/split-layout/resize-controller-retry.d.ts.map +1 -0
- package/dist/components/layout/split-layout/resize-controller-retry.js +2 -0
- package/dist/components/layout/split-layout/resize-controller.d.ts +2 -0
- package/dist/components/layout/split-layout/resize-controller.d.ts.map +1 -0
- package/dist/components/layout/split-layout/resize-controller.js +2 -0
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +171 -60
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/lib/themes.d.ts +8 -7
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/themes.js +53 -55
- package/dist/lib/themes.js.map +1 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/lib.json +1 -1
- package/dist/r/registry.json +29 -3
- package/dist/r/split-layout.json +26 -0
- package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +66 -0
- package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +66 -0
- package/dist/r/src/components/layout/split-layout/resize-controller-retry-2.tsx +2 -0
- package/dist/r/src/components/layout/split-layout/resize-controller-retry.tsx +1 -0
- package/dist/r/src/components/layout/split-layout/resize-controller.tsx +1 -0
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +197 -49
- package/dist/r/src/lib/themes.ts +56 -73
- package/dist/r/theming.json +1 -1
- package/package.json +2 -2
- package/registry.json +29 -3
- package/src/components/layout/split-layout/resize-controller-core-retry.tsx +66 -0
- package/src/components/layout/split-layout/resize-controller-core.tsx +66 -0
- package/src/components/layout/split-layout/resize-controller-retry-2.tsx +2 -0
- package/src/components/layout/split-layout/resize-controller-retry.tsx +1 -0
- package/src/components/layout/split-layout/resize-controller.tsx +1 -0
- package/src/components/layout/split-layout/split-layout.tsx +197 -49
- package/src/lib/themes.ts +56 -73
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-layout.js","names":["Resizable","For","createMemo","createComputed","createUniqueId","createSignal","onCleanup","on","Accessor","JSX","X","GripVertical","ActionButton","cn","computeLayoutFrames","LayoutRect","paneDropIntent","PaneDropIntent","PANE_DRAG_TYPE","DRAG_PREVIEW_MAX_WIDTH","DRAG_PREVIEW_MAX_HEIGHT","listLeaves","MIN_SPLIT_RATIO","MAX_SPLIT_RATIO","SplitLayoutBranch","SplitLayoutLeaf","SplitLayoutState","SplitLayoutProps","state","L","label","labelForLeaf","leaf","renderLeaf","Element","renderPaneLabel","paneTabIndex","labelForSeparator","branch","onResize","splitId","ratio","onFocus","leafId","onClose","onMove","targetId","intent","renderPaneActions","class","rectStyle","rect","CSSProperties","left","x","top","y","width","height","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","props","root","HTMLDivElement","pendingFrame","refs","Map","domIds","prefix","nextDomId","nextDragId","dragPreview","drag","setDrag","id","token","drop","setDrop","clearDrag","remove","createDragPreview","preview","inert","body","domId","existing","get","created","set","leaves","center","leafMap","map","frames","branches","values","flatMap","frame","node","kind","current","has","target","allowedTarget","transfer","DataTransfer","types","dropLabel","placement","branchMap","schedule","action","cancelAnimationFrame","requestAnimationFrame","active","ownerDocument","activeElement","contains","field","HTMLTextAreaElement","HTMLInputElement","selection","start","selectionStart","end","selectionEnd","direction","selectionDirection","isConnected","focus","preventScroll","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","addEventListener","event","dataTransfer","clientX","clientY","currentTarget","getBoundingClientRect","accepted","getData","preventDefault","relatedTarget","dropEffect","_$setAttribute","setData","effectAllowed","setDragImage","previewFrame","scaleX","scaleY","_c$","_$memo","_c$2","variant","aria-label","tooltip","onClick","_c$3","_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","orientation","sizes","keyboardDelta","onSizesChange","getClientRects","some","Number","isFinite","abs","style","Panel","minSize","maxSize","Handle","aria-orientation","aria-controls","join","aria-valuenow","_v$","_v$2","_v$3","_$delegateEvents","_$createComponent","_$memo","_$className","_$setAttribute","_$style","_$delegateEvents"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport {\n For,\n createMemo,\n createComputed,\n createUniqueId,\n createSignal,\n onCleanup,\n on,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport { X, GripVertical } from 'lucide-solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\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 MIN_SPLIT_RATIO,\n MAX_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\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 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; Corvu owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\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 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 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 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 const leaf = () => 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 </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const initial = branchMap().get(id)!\n const branch: Accessor<SplitLayoutBranch<L>> = () => branchMap().get(id) ?? initial\n return (\n <Resizable\n orientation={branch().direction === 'row' ? 'horizontal' : 'vertical'}\n sizes={[branch().ratio, 1 - branch().ratio]}\n keyboardDelta={0.05}\n onSizesChange={(sizes) => {\n // Corvu also reports panel registration/unregistration while\n // mounting or disposing a controller. Those incomplete or\n // hidden-host sizes are not user resize intent.\n if (!root?.isConnected || root.getClientRects().length === 0) return\n if (\n sizes.length !== 2 ||\n sizes.some((size) => !Number.isFinite(size)) ||\n Math.abs(sizes[0]! + sizes[1]! - 1) > 0.000001\n )\n return\n if (sizes[0] !== undefined && Math.abs(sizes[0] - branch().ratio) > 0.000001)\n props.onResize(id, sizes[0])\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"pointer-events-none absolute flex min-h-0 min-w-0 data-[orientation=vertical]:flex-col\"\n >\n <Resizable.Panel\n minSize={MIN_SPLIT_RATIO}\n maxSize={MAX_SPLIT_RATIO}\n aria-hidden=\"true\"\n />\n <Resizable.Handle\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={10}\n aria-valuemax={90}\n aria-valuenow={Math.round(branch().ratio * 100)}\n class=\"pointer-events-auto relative w-px shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full\"\n />\n <Resizable.Panel\n minSize={MIN_SPLIT_RATIO}\n maxSize={MAX_SPLIT_RATIO}\n aria-hidden=\"true\"\n />\n </Resizable>\n )\n }}\n </For>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMkB,iBAAiB;AACvB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,CAAA;OAAA0J,gBAGhDnM,UAAUqR,OAAK;QACdC,SAAShQ;QACTiQ,SAAShQ;QAAe,eAAA;OAAA,CAAA;MAAA;KAAA;IAAA,CAAA;GAKhC;EAAC,CAAA,GAAA,IAAA;EAAAwN,QAAAE,QAAA;GAAA,IAAA4C,MA3MS3K,MAAMpF,OAAKgQ,OAERjK,KAAK,IAAI,KAAKvC,KAAAA,GAASyM,OAC/BlR,GAAG,sEAAsEqG,MAAMjE,KAAK;GAAC4O,QAAA5C,IAAAc,KAAAjC,aAAAlC,MAAA,cAAAqD,IAAAc,IAAA8B,GAAA;GAAAC,SAAA7C,IAAAe,KAAAlC,aAAAlC,MAAA,iBAAAqD,IAAAe,IAAA8B,IAAA;GAAAC,SAAA9C,IAAAgB,KAAAjB,UAAApD,MAAAqD,IAAAgB,IAAA8B,IAAA;GAAA,OAAA9C;EAAA,GAAA;GAAAc,GAAAzK,KAAAA;GAAA0K,GAAA1K,KAAAA;GAAA2K,GAAA3K,KAAAA;EAAA,CAAA;EAAA,OAAAsG;CAAA,EAAA,CAAA;AA4MlG;AAACoG,eAAA,CAAA,SAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"split-layout.js","names":["For","createEffect","createComputed","createMemo","createUniqueId","createSignal","onMount","onCleanup","on","Show","Accessor","JSX","Dynamic","X","GripVertical","ActionButton","Button","cn","computeLayoutFrames","LayoutRect","paneDropIntent","PaneDropIntent","PANE_DRAG_TYPE","DRAG_PREVIEW_MAX_WIDTH","DRAG_PREVIEW_MAX_HEIGHT","listLeaves","SplitLayoutBranch","SplitLayoutLeaf","SplitLayoutState","SplitLayoutResizeControllerProps","ResizeController","props","L","Element","ResizeControllerState","SplitLayoutProps","state","label","labelForLeaf","leaf","renderLeaf","renderPaneLabel","paneTabIndex","labelForSeparator","branch","onResize","splitId","ratio","onFocus","leafId","onClose","onMove","targetId","intent","renderPaneActions","class","rectStyle","rect","CSSProperties","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","HTMLDivElement","pendingFrame","disposed","resizeLoadGeneration","retryWithAlternateImport","alternateImportAttempts","focusHandleAfterRetry","focusRecoveryButtonAfterError","focusRestoreEpoch","focusEpoch","pendingFocusFrame","refs","Map","domIds","prefix","resizeReloadWarningId","nextDomId","nextDragId","dragPreview","drag","setDrag","id","token","drop","setDrop","resizeController","setResizeController","cancelPendingFocusRestore","cancelAnimationFrame","trackFocusChange","event","FocusEvent","target","body","addEventListener","removeEventListener","clearDrag","remove","createDragPreview","preview","inert","domId","existing","get","created","set","leaves","center","leafMap","map","frames","branches","values","flatMap","frame","node","kind","retry","generation","controllerImport","then","default","Controller","shouldFocusHandle","requestAnimationFrame","currentFocus","ownerDocument","activeElement","querySelector","focus","preventScroll","shouldFocusRetry","HTMLButtonElement","current","has","allowedTarget","transfer","DataTransfer","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","aria-label","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","component","_c$","_el$0","_tmpl$5","_el$1","_tmpl$6","window","location","reload","ownsFocus","_v$","_v$2","_v$3","_$delegateEvents","_$createComponent","_$memo","_$className","_$setAttribute","_$style","_$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, GripVertical } from 'lucide-solid'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../../ui/button'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\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 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\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; Corvu 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 retryWithAlternateImport = false\n let alternateImportAttempts = 0\n let focusHandleAfterRetry = false\n let focusRecoveryButtonAfterError = false\n let focusRestoreEpoch = 0\n let focusEpoch = 0\n let pendingFocusFrame: 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 cancelPendingFocusRestore = () => {\n if (pendingFocusFrame !== undefined) cancelAnimationFrame(pendingFocusFrame)\n pendingFocusFrame = undefined\n }\n const trackFocusChange = (event: FocusEvent) => {\n if (event.target === document.body) return\n focusEpoch += 1\n focusHandleAfterRetry = false\n focusRecoveryButtonAfterError = 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 focusHandleAfterRetry = false\n focusRecoveryButtonAfterError = false\n cancelPendingFocusRestore()\n // Keep a loaded controller so a later split does not re-import a facade\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 retry = retryWithAlternateImport\n const generation = ++resizeLoadGeneration\n setResizeController(false)\n const controllerImport = retry\n ? alternateImportAttempts++ === 0\n ? import('./resize-controller-retry')\n : import('./resize-controller-retry-2')\n : import('./resize-controller')\n void controllerImport.then(\n ({ default: Controller }) => {\n if (disposed || generation !== resizeLoadGeneration || branches().length === 0) return\n const shouldFocusHandle = focusHandleAfterRetry && focusEpoch === focusRestoreEpoch\n focusHandleAfterRetry = false\n focusRecoveryButtonAfterError = false\n retryWithAlternateImport = false\n alternateImportAttempts = 0\n setResizeController(() => Controller)\n if (shouldFocusHandle)\n pendingFocusFrame = requestAnimationFrame(() => {\n pendingFocusFrame = undefined\n if (\n disposed ||\n generation !== resizeLoadGeneration ||\n branches().length === 0 ||\n focusEpoch !== focusRestoreEpoch\n )\n return\n const currentFocus = root?.ownerDocument.activeElement\n if (currentFocus && currentFocus !== root?.ownerDocument.body && currentFocus !== root)\n return\n root?.querySelector<HTMLElement>('[data-corvu-resizable-handle]')?.focus({\n preventScroll: true,\n })\n })\n },\n () => {\n // A rejected dynamic import can remain cached under its specifier.\n // The next split must start from the alternate module entry as well.\n retryWithAlternateImport = true\n if (!disposed && generation === resizeLoadGeneration && branches().length > 0) {\n setResizeController('error')\n const shouldFocusRetry = focusRecoveryButtonAfterError && focusEpoch === focusRestoreEpoch\n if (shouldFocusRetry)\n pendingFocusFrame = requestAnimationFrame(() => {\n pendingFocusFrame = undefined\n if (\n disposed ||\n generation !== resizeLoadGeneration ||\n branches().length === 0 ||\n focusEpoch !== focusRestoreEpoch\n )\n return\n root?.querySelector<HTMLButtonElement>('[data-resize-retry]')?.focus({\n preventScroll: true,\n })\n })\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 focusHandleAfterRetry = false\n focusRecoveryButtonAfterError = 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 const leaf = () => 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 ? alternateImportAttempts >= 2\n ? 'Resize controls did not load after repeated attempts. Reloading may discard 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>> = () => branchMap().get(id) ?? initial\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={10}\n aria-valuemax={90}\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 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 {alternateImportAttempts >= 2 ? (\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={alternateImportAttempts >= 2 ? resizeReloadWarningId : undefined}\n onClick={(event) => {\n if (alternateImportAttempts >= 2) {\n window.location.reload()\n return\n }\n const ownsFocus = document.activeElement === event.currentTarget\n focusHandleAfterRetry = ownsFocus\n focusRecoveryButtonAfterError = ownsFocus\n focusRestoreEpoch = focusEpoch\n retryWithAlternateImport = true\n setResizeController(undefined)\n }}\n >\n {alternateImportAttempts >= 2 ? 'Reload page to retry resizing' : 'Retry pane resizing'}\n </Button>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAMsB,iBAAiB;AACvB,IAAMC,yBAAyB;AAC/B,IAAMC,0BAA0B;AAqChC,SAASgC,UAAUC,MAAqC;CACtD,OAAO;EACLE,MAAM,GAAGF,KAAKG,IAAI,IAAG;EACrBC,KAAK,GAAGJ,KAAKK,IAAI,IAAG;EACpBC,OAAO,GAAGN,KAAKM,QAAQ,IAAG;EAC1BC,QAAQ,GAAGP,KAAKO,SAAS,IAAG;CAC9B;AACF;AACA,SAASC,0BAA0BrB,QAA2Ba,MAAqC;CACjG,MAAMS,aAAatB,OAAOuB,cAAc;CACxC,OAAO;EACLR,MAAM,IAAIF,KAAKG,KAAKM,aAAaT,KAAKM,QAAQnB,OAAOG,QAAQ,MAAM,IAAG;EACtEc,KAAK,IAAIJ,KAAKK,KAAKI,aAAa,IAAIT,KAAKO,SAASpB,OAAOG,UAAU,IAAG;EACtEgB,OAAOG,aAAa,QAAQ,GAAGT,KAAKM,QAAQ,IAAG;EAC/CC,QAAQE,aAAa,GAAGT,KAAKO,SAAS,IAAG,KAAM;EAC/CI,WAAWF,aAAa,qBAAqB;CAC/C;AACF;AACA,SAASG,uBAAuBC,QAAqBE,SAAiB;CACpE,MAAMC,cAAcC,SAASC,cAAc,KAAK;CAChDF,YAAYG,YAAY3D,GACtBqD,O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F,OAAAnF,gBACPxN,QAAM;KACL2P,SAAO;KACPxK,MAAI;KAAA,qBAAA;KAAA,oBAEc+B,2BAA2B,IAAIU,wBAAwB5C,KAAAA;KACzE8K,UAAUnH,UAAU;MAClB,IAAIzB,2BAA2B,GAAG;OAChC6L,OAAOC,SAASC,OAAO;OACvB;MACF;MACA,MAAMC,YAAYxP,SAASsH,kBAAkBrC,MAAM+F;MACnDvH,wBAAwB+L;MACxB9L,gCAAgC8L;MAChC7L,oBAAoBC;MACpBL,2BAA2B;MAC3BsB,oBAAoBvD,KAAAA,CAAS;KAC/B;KAACW,UAEAuB,2BAA2B,IAAI,kCAAkC;IAAqB,CAAA,GAAA,IAAA;IAAA,OAAAyL;GAAA,EAAA,CAAA,IAGzF;EAAI,EAAA,CAAA,GAAA,IAAA;EAAAzC,QAAAE,QAAA;GAAA,IAAA+C,MAvOIpS,MAAMM,OAAK+R,OAERpL,KAAK,IAAI,KAAKhD,KAAAA,GAASqO,OAC/BpT,GAAG,sEAAsEc,MAAMwB,KAAK;GAAC4Q,QAAA/C,IAAAc,KAAAjC,aAAAhC,MAAA,cAAAmD,IAAAc,IAAAiC,GAAA;GAAAC,SAAAhD,IAAAe,KAAAlC,aAAAhC,MAAA,iBAAAmD,IAAAe,IAAAiC,IAAA;GAAAC,SAAAjD,IAAAgB,KAAAjB,UAAAlD,MAAAmD,IAAAgB,IAAAiC,IAAA;GAAA,OAAAjD;EAAA,GAAA;GAAAc,GAAAlM,KAAAA;GAAAmM,GAAAnM,KAAAA;GAAAoM,GAAApM,KAAAA;EAAA,CAAA;EAAA,OAAAiI;CAAA,EAAA,CAAA;AAuOlG;AAACqG,eAAA,CAAA,SAAA,CAAA"}
|
package/dist/lib/themes.d.ts
CHANGED
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
*
|
|
25
25
|
* ## The mapping, and the entry that is not a rename
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
* entry will trip a reader: the catalogue's `accent`
|
|
29
|
-
* `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
-
* fill of a primary button, the thing a focus ring is drawn
|
|
31
|
-
* a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
-
* `--primary`, and `--accent` is filled from
|
|
33
|
-
* components actually use it for.
|
|
27
|
+
* The package-owned `shadcnVariables` adapter maps canonical roles onto this
|
|
28
|
+
* system's vocabulary. One entry will trip a reader: the catalogue's `accent`
|
|
29
|
+
* becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
+
* the action colour — the fill of a primary button, the thing a focus ring is drawn
|
|
31
|
+
* in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
+
* the former, so it goes to `--primary`, and `--accent` is filled from
|
|
33
|
+
* `surfaceHover`, which is what shadcn components actually use it for.
|
|
34
34
|
*/
|
|
35
35
|
import { type AccentPreset, type AdeaTheme, type AdeaThemeRecord } from '@adea-ai/themes';
|
|
36
36
|
export { isThemeAccentId } from './theme-accents';
|
|
@@ -79,6 +79,7 @@ export type ThemeColors = {
|
|
|
79
79
|
sidebarForeground: string;
|
|
80
80
|
sidebarAccent: string;
|
|
81
81
|
sidebarBorder: string;
|
|
82
|
+
sidebarMutedForeground: string;
|
|
82
83
|
};
|
|
83
84
|
/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */
|
|
84
85
|
export type ThemeTerminalPalette = {
|
package/dist/lib/themes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;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CAAC,CA6G7E;AAUD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAMD,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE,CAMjE;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,SAAS,YAAY,EAAkB,GAC9C,YAAY,EAAE,CAchB;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAA;AAC/C,eAAO,MAAM,kBAAkB,cAAc,CAAA;AAE7C,kFAAkF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/lib/themes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isThemeAccentId } from "./theme-accents.js";
|
|
2
2
|
import { accentForeground, accentRoles, chartSeries, contrastRatio, getAccent, getTheme, hasTheme, primaryHover, primarySubtleCss, shadcnDestructiveProjection, statusForeground, syntaxRoles, themeAccentPresets, themes, themesByAppearance, tint, validateCatalogue } from "@adea-ai/themes";
|
|
3
|
+
import { shadcnVariables } from "@adea-ai/themes/adapters/shadcn";
|
|
3
4
|
//#region src/lib/themes.ts
|
|
4
5
|
/**
|
|
5
6
|
* The theme registry, now a bridge.
|
|
@@ -27,64 +28,61 @@ import { accentForeground, accentRoles, chartSeries, contrastRatio, getAccent, g
|
|
|
27
28
|
*
|
|
28
29
|
* ## The mapping, and the entry that is not a rename
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
-
* entry will trip a reader: the catalogue's `accent`
|
|
32
|
-
* `primary`, because in the shadcn vocabulary `--primary` is
|
|
33
|
-
* fill of a primary button, the thing a focus ring is drawn
|
|
34
|
-
* a low-contrast hover wash. The catalogue's `accent` is
|
|
35
|
-
* `--primary`, and `--accent` is filled from
|
|
36
|
-
* components actually use it for.
|
|
31
|
+
* The package-owned `shadcnVariables` adapter maps canonical roles onto this
|
|
32
|
+
* system's vocabulary. One entry will trip a reader: the catalogue's `accent`
|
|
33
|
+
* becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
|
|
34
|
+
* the action colour — the fill of a primary button, the thing a focus ring is drawn
|
|
35
|
+
* in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
|
|
36
|
+
* the former, so it goes to `--primary`, and `--accent` is filled from
|
|
37
|
+
* `surfaceHover`, which is what shadcn components actually use it for.
|
|
37
38
|
*/
|
|
38
|
-
var ROLE_FOR = {
|
|
39
|
-
background: "background",
|
|
40
|
-
foreground: "text",
|
|
41
|
-
card: "surface",
|
|
42
|
-
cardForeground: "text",
|
|
43
|
-
popover: "surfaceElevated",
|
|
44
|
-
popoverForeground: "text",
|
|
45
|
-
primary: "accent",
|
|
46
|
-
primaryForeground: "accentForeground",
|
|
47
|
-
secondary: "surface",
|
|
48
|
-
secondaryForeground: "text",
|
|
49
|
-
muted: "surface",
|
|
50
|
-
mutedForeground: "textMuted",
|
|
51
|
-
accent: "surfaceHover",
|
|
52
|
-
accentForeground: "text",
|
|
53
|
-
destructive: "error",
|
|
54
|
-
destructiveForeground: "error",
|
|
55
|
-
destructiveSubtle: "error",
|
|
56
|
-
success: "success",
|
|
57
|
-
successForeground: "success",
|
|
58
|
-
successSubtle: "success",
|
|
59
|
-
warning: "warning",
|
|
60
|
-
warningForeground: "warning",
|
|
61
|
-
warningSubtle: "warning",
|
|
62
|
-
info: "info",
|
|
63
|
-
infoForeground: "info",
|
|
64
|
-
infoSubtle: "info",
|
|
65
|
-
border: "border",
|
|
66
|
-
input: "border",
|
|
67
|
-
ring: "accent",
|
|
68
|
-
sidebar: "surface",
|
|
69
|
-
sidebarForeground: "text",
|
|
70
|
-
sidebarAccent: "surfaceHover",
|
|
71
|
-
sidebarBorder: "border"
|
|
72
|
-
};
|
|
73
39
|
/** Builds the design system's view of one catalogue entry. */
|
|
74
40
|
function toVariant(theme) {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
41
|
+
const projected = shadcnVariables(theme);
|
|
42
|
+
const token = (name) => {
|
|
43
|
+
const value = projected[`--${name}`];
|
|
44
|
+
if (!value) throw new Error(`${theme.id} has no shared shadcn projection for --${name}`);
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
79
47
|
const destructiveAction = shadcnDestructiveProjection(theme);
|
|
80
|
-
colors
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
48
|
+
const colors = {
|
|
49
|
+
background: token("background"),
|
|
50
|
+
foreground: token("foreground"),
|
|
51
|
+
card: token("card"),
|
|
52
|
+
cardForeground: token("card-foreground"),
|
|
53
|
+
popover: token("popover"),
|
|
54
|
+
popoverForeground: token("popover-foreground"),
|
|
55
|
+
primary: token("primary"),
|
|
56
|
+
primaryForeground: token("primary-foreground"),
|
|
57
|
+
secondary: token("secondary"),
|
|
58
|
+
secondaryForeground: token("secondary-foreground"),
|
|
59
|
+
muted: token("muted"),
|
|
60
|
+
mutedForeground: token("muted-foreground"),
|
|
61
|
+
accent: token("accent"),
|
|
62
|
+
accentForeground: token("accent-foreground"),
|
|
63
|
+
destructive: theme.colors.error,
|
|
64
|
+
destructiveForeground: statusForeground(theme, "error"),
|
|
65
|
+
destructiveSubtle: tint(theme.colors.error, theme.colors.background),
|
|
66
|
+
destructiveAction: destructiveAction.fill,
|
|
67
|
+
destructiveActionForeground: destructiveAction.foreground,
|
|
68
|
+
success: token("success"),
|
|
69
|
+
successForeground: statusForeground(theme, "success"),
|
|
70
|
+
successSubtle: tint(theme.colors.success, theme.colors.background),
|
|
71
|
+
warning: token("warning"),
|
|
72
|
+
warningForeground: statusForeground(theme, "warning"),
|
|
73
|
+
warningSubtle: tint(theme.colors.warning, theme.colors.background),
|
|
74
|
+
info: token("info"),
|
|
75
|
+
infoForeground: statusForeground(theme, "info"),
|
|
76
|
+
infoSubtle: tint(theme.colors.info, theme.colors.background),
|
|
77
|
+
border: token("border"),
|
|
78
|
+
input: token("input"),
|
|
79
|
+
ring: token("ring"),
|
|
80
|
+
sidebar: token("sidebar"),
|
|
81
|
+
sidebarForeground: token("sidebar-foreground"),
|
|
82
|
+
sidebarAccent: token("sidebar-accent"),
|
|
83
|
+
sidebarBorder: token("sidebar-border"),
|
|
84
|
+
sidebarMutedForeground: token("sidebar-muted-foreground")
|
|
85
|
+
};
|
|
88
86
|
const syntax = syntaxRoles(theme);
|
|
89
87
|
return {
|
|
90
88
|
id: theme.id,
|
|
@@ -341,7 +339,7 @@ function themeCssVariables(theme) {
|
|
|
341
339
|
"--sidebar-primary": c.primary,
|
|
342
340
|
"--sidebar-primary-foreground": c.primaryForeground,
|
|
343
341
|
"--sidebar-ring": c.ring,
|
|
344
|
-
"--sidebar-muted-foreground": c.
|
|
342
|
+
"--sidebar-muted-foreground": c.sidebarMutedForeground,
|
|
345
343
|
"--surface-sunken": c.muted,
|
|
346
344
|
"--surface-hover": c.accent,
|
|
347
345
|
"--surface-active": c.border,
|
package/dist/lib/themes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","names":["catalogue","themes"],"sources":["../../src/lib/themes.ts"],"sourcesContent":["/**\n * The theme registry, now a bridge.\n *\n * The catalogue itself lives in `@adea-ai/themes`. This module is what is left in\n * the design system: the translation between the catalogue's **canonical** role\n * names and the **shadcn** vocabulary every component here is written against, plus\n * the handful of custom properties this system declares that are presentations of\n * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,\n * and `--chrome`.\n *\n * ## Why it is a bridge and not a copy\n *\n * This file used to hold thirteen themes as hand-written hex literal tables, with its\n * own contrast validator, its own terminal and editor palettes, and its own\n * provenance records. That is a lot of surface to maintain for one consumer of a\n * palette, and it meant every product that wanted the same themes — Adea, Cortana —\n * either imported this package or wrote its own. The catalogue moved out so that\n * there is one answer to \"what is Catppuccin Mocha\", and this file is the part that\n * genuinely belongs to the design system.\n *\n * It is deliberately thin. If you are looking for a colour, it is not here: see\n * `@adea-ai/themes`, whose README explains how the values are produced and whose\n * `NOTICE` records where every palette came from.\n *\n * ## The mapping, and the entry that is not a rename\n *\n * {@link ROLE_FOR} maps canonical roles onto this system's variable vocabulary. One\n * entry will trip a reader: the catalogue's `accent` becomes this system's\n * `primary`, because in the shadcn vocabulary `--primary` is the action colour — the\n * fill of a primary button, the thing a focus ring is drawn in — while `--accent` is\n * a low-contrast hover wash. The catalogue's `accent` is the former, so it goes to\n * `--primary`, and `--accent` is filled from `surfaceHover`, which is what shadcn\n * components actually use it for.\n */\n\nimport {\n ACCENTS,\n accentForeground,\n accentRoles,\n chartSeries,\n getAccent,\n getTheme,\n hasTheme,\n shadcnDestructiveProjection,\n statusForeground,\n tint,\n primaryHover,\n primarySubtleCss,\n syntaxRoles,\n themes as catalogue,\n themesByAppearance,\n themeAccentPresets,\n validateCatalogue,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n type ContrastFinding,\n} from '@adea-ai/themes'\nimport { isThemeAccentId } from './theme-accents'\n\nexport { isThemeAccentId } from './theme-accents'\n\nexport type ThemeAppearance = 'light' | 'dark'\n\n/**\n * The surface and text roles, in shadcn's vocabulary.\n *\n * Named to match the components below, which is why they differ from the\n * catalogue's: these are this system's variable names, and renaming them would mean\n * touching every component in the library for no gain.\n */\nexport type ThemeColors = {\n background: string\n foreground: string\n card: string\n cardForeground: string\n popover: string\n popoverForeground: string\n primary: string\n primaryForeground: string\n secondary: string\n secondaryForeground: string\n muted: string\n mutedForeground: string\n accent: string\n accentForeground: string\n destructive: string\n destructiveForeground: string\n destructiveSubtle: string\n /** Contrast-safe solid-action presentation, derived from the canonical error role. */\n destructiveAction: string\n destructiveActionForeground: string\n success: string\n successForeground: string\n successSubtle: string\n warning: string\n warningForeground: string\n warningSubtle: string\n info: string\n infoForeground: string\n infoSubtle: string\n border: string\n input: string\n ring: string\n sidebar: string\n sidebarForeground: string\n sidebarAccent: string\n sidebarBorder: string\n}\n\n/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */\nexport type ThemeTerminalPalette = {\n background: string\n foreground: string\n cursor: string\n selection: string\n black: string\n red: string\n green: string\n yellow: string\n blue: string\n magenta: string\n cyan: string\n white: string\n brightBlack: string\n brightRed: string\n brightGreen: string\n brightYellow: string\n brightBlue: string\n brightMagenta: string\n brightCyan: string\n brightWhite: string\n}\n\n/** The syntax roles a code view needs. */\nexport type ThemeEditorPalette = {\n keyword: string\n string: string\n number: string\n comment: string\n function: string\n variable: string\n type: string\n tag: string\n attribute: string\n operator: string\n heading: string\n link: string\n diffAdd: string\n diffDelete: string\n diffHunk: string\n searchMatch: string\n}\n\n/** Where a palette came from, and the terms it is used under. */\nexport type ThemeProvenance = {\n /** The project or person the palette belongs to. */\n source: string\n url: string\n /** An SPDX identifier. Every palette in this catalogue is permissive. */\n license: string\n}\n\nexport type ThemeVariant = {\n /** The `data-theme` value and the id a preference stores. */\n id: string\n /** Groups the variants that came from one project. */\n family: string\n familyLabel: string\n label: string\n appearance: ThemeAppearance\n /** One line, shown in a picker. */\n description: string\n colors: ThemeColors\n terminal: ThemeTerminalPalette\n editor: ThemeEditorPalette\n /** The categorical series, in order. */\n chart: readonly string[]\n provenance: ThemeProvenance\n}\n\n/**\n * Canonical role → this system's `ThemeColors` key.\n *\n * Read by {@link toVariant}. The two derived destructive-action presentation values\n * are intentionally excluded; the shared Themes adapter owns their color math.\n */\ntype ThemeRole = Exclude<keyof ThemeColors, 'destructiveAction' | 'destructiveActionForeground'>\n\nconst ROLE_FOR: Readonly<Record<ThemeRole, keyof AdeaThemeRecord['colors']>> = {\n background: 'background',\n foreground: 'text',\n card: 'surface',\n cardForeground: 'text',\n popover: 'surfaceElevated',\n popoverForeground: 'text',\n // Not a rename — see this module's header.\n primary: 'accent',\n primaryForeground: 'accentForeground',\n // shadcn's `secondary` and `muted` are both the first surface rung used as a fill.\n secondary: 'surface',\n secondaryForeground: 'text',\n muted: 'surface',\n mutedForeground: 'textMuted',\n // shadcn's `accent` is a hover wash, which is exactly `surfaceHover`.\n accent: 'surfaceHover',\n accentForeground: 'text',\n destructive: 'error',\n // Overwritten below from the measured pairing; nominal here so the table is total.\n destructiveForeground: 'error',\n destructiveSubtle: 'error',\n success: 'success',\n successForeground: 'success',\n successSubtle: 'success',\n warning: 'warning',\n warningForeground: 'warning',\n warningSubtle: 'warning',\n info: 'info',\n infoForeground: 'info',\n infoSubtle: 'info',\n border: 'border',\n input: 'border',\n ring: 'accent',\n sidebar: 'surface',\n sidebarForeground: 'text',\n sidebarAccent: 'surfaceHover',\n sidebarBorder: 'border',\n}\n\n/** Builds the design system's view of one catalogue entry. */\nfunction toVariant(theme: AdeaThemeRecord): ThemeVariant {\n const colors = {} as ThemeColors\n for (const key of Object.keys(ROLE_FOR) as ThemeRole[]) {\n colors[key] = theme.colors[ROLE_FOR[key]]\n }\n // Keep the semantic foreground paired with the canonical error role. Filled\n // destructive actions use the distinct projection below so their /90 hover state\n // remains readable without changing icons, borders, or tinted status surfaces.\n colors.destructiveForeground = statusForeground(theme, 'error')\n colors.destructiveSubtle = tint(theme.colors.error, theme.colors.background)\n const destructiveAction = shadcnDestructiveProjection(theme)\n colors.destructiveAction = destructiveAction.fill\n colors.destructiveActionForeground = destructiveAction.foreground\n colors.successForeground = statusForeground(theme, 'success')\n colors.successSubtle = tint(theme.colors.success, theme.colors.background)\n colors.warningForeground = statusForeground(theme, 'warning')\n colors.warningSubtle = tint(theme.colors.warning, theme.colors.background)\n colors.infoForeground = statusForeground(theme, 'info')\n colors.infoSubtle = tint(theme.colors.info, theme.colors.background)\n\n const syntax = syntaxRoles(theme)\n\n return {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n colors,\n terminal: {\n // The embedded terminal uses the theme's own canvas rather than a palette of its\n // own. The ANSI colours came from the palette that produced the canvas, so they\n // were chosen against it; a terminal on a different background would be the one\n // surface in the application not lit by the active theme.\n background: theme.colors.background,\n foreground: theme.colors.foreground,\n cursor: theme.cursor,\n selection: theme.selection,\n ...theme.ansi,\n },\n editor: {\n keyword: syntax.keyword,\n string: syntax.string,\n number: syntax.number,\n comment: syntax.comment,\n function: syntax.function,\n variable: syntax.variable,\n type: syntax.type,\n tag: syntax.tag,\n attribute: syntax.attribute,\n operator: syntax.operator,\n heading: syntax.heading,\n link: syntax.link,\n diffAdd: syntax.diffAdd,\n diffDelete: syntax.diffDelete,\n diffHunk: syntax.diffHunk,\n searchMatch: syntax.searchMatch,\n },\n chart: chartSeries(theme),\n provenance: {\n source: theme.provenance.project,\n url: theme.provenance.url,\n license: theme.provenance.license,\n },\n }\n}\n\n/**\n * A variant's `--primary-subtle`: the tint over `var(--primary)` at the strength its\n * catalogue record measures (`primarySubtleAlpha`). A variant that is not in the\n * catalogue has nothing to measure, and gets its appearance's ceiling.\n */\nexport function primarySubtleFor(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const record = getTheme(theme.id)\n return record ? primarySubtleCss(record) : primarySubtleCss(theme.appearance)\n}\n\n/** The catalogue, in catalogue order. */\nexport const builtinThemes: readonly ThemeVariant[] = Object.freeze(catalogue.map(toVariant))\n\nexport function themeById(id: string): ThemeVariant | undefined {\n if (!hasTheme(id)) return undefined\n return builtinThemes.find((theme) => theme.id === id)\n}\n\n/** The variants of one appearance, which is what a picker for that mode shows. */\nexport function themesForAppearance(appearance: ThemeAppearance): readonly ThemeVariant[] {\n const ids = new Set(themesByAppearance(appearance).map((theme) => theme.id))\n return builtinThemes.filter((theme) => ids.has(theme.id))\n}\n\n/** The families in the catalogue, in catalogue order. */\nexport function themeFamilies(): { family: string; label: string; themes: ThemeVariant[] }[] {\n const families = new Map<string, { family: string; label: string; themes: ThemeVariant[] }>()\n for (const theme of builtinThemes) {\n const entry = families.get(theme.family) ?? {\n family: theme.family,\n label: theme.familyLabel,\n themes: [],\n }\n entry.themes.push(theme)\n families.set(theme.family, entry)\n }\n return [...families.values()]\n}\n\n/** The accent presets, in the order a picker should show them. */\nexport const accents = ACCENTS\n\n/**\n * The canonical catalogue records, in catalogue order.\n *\n * {@link builtinThemes} is this system's projection of the catalogue onto the\n * shadcn vocabulary, which is what a document is painted with. A *preview* of a\n * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the\n * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),\n * several of which the projection folds together. These are those records, so a\n * consumer hands the editor exactly what it takes rather than reconstructing it\n * from the projection.\n */\nexport const themeRecords: readonly AdeaThemeRecord[] = catalogue\n\nexport function themeRecordById(id: string): AdeaThemeRecord | undefined {\n return getTheme(id)\n}\n\n/** A light/dark theme pair by id, with the defaults standing in for an unknown id. */\nfunction recordPair(lightThemeId: string, darkThemeId: string) {\n const light = getTheme(lightThemeId) ?? getTheme(defaultLightThemeId)!\n const dark = getTheme(darkThemeId) ?? getTheme(defaultDarkThemeId)!\n return { light, dark }\n}\n\n/**\n * The accents the selected light/dark pair carries — offered beside the presets.\n *\n * Computed per pair rather than per theme because a theme accent is a *pair* of\n * values, like a preset: a slot is offered only when both themes can offer it.\n */\nexport function themeAccentsFor(\n lightThemeId: string,\n darkThemeId: string\n): readonly AccentPreset[] {\n const { light, dark } = recordPair(lightThemeId, darkThemeId)\n return themeAccentPresets(light, dark)\n}\n\n/**\n * An accent id resolved against a theme pair: a preset, a theme accent the pair\n * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot\n * offer — each of which means \"use the theme's own primary\".\n *\n * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme\n * switch and resolves to the new theme's blue; when the new pair cannot offer the\n * slot it resolves to nothing, the same fallback a stale preset id gets.\n */\nexport function resolveAccentPreset(\n accentId: string,\n light: AdeaTheme,\n dark: AdeaTheme\n): AccentPreset | undefined {\n if (accentId === 'theme') return undefined\n const preset = getAccent(accentId)\n if (preset) return preset\n if (!isThemeAccentId(accentId)) return undefined\n return themeAccentPresets(light, dark).find((option) => option.id === accentId)\n}\n\n/**\n * A theme with an accent laid over it, in the catalogue's own shape.\n *\n * The accent replaces `accent` and its measured label, which is all an accent\n * changes about a theme; `undefined` returns the theme untouched. This is the\n * overlay a host needs for `AppearanceEditor`'s `lightTheme`/`darkTheme`.\n */\nexport function withAccent<T extends AdeaTheme>(theme: T, accent: AccentPreset | undefined): T {\n if (!accent) return theme\n const value = theme.appearance === 'dark' ? accent.dark : accent.light\n return {\n ...theme,\n colors: { ...theme.colors, accent: value, accentForeground: accentForeground(value) },\n }\n}\n\n/**\n * The two preview themes an appearance selection resolves to, accent applied.\n *\n * The adapter between a stored selection and `AppearanceEditor`: it takes ids —\n * what a preference holds — and returns the canonical records the editor's\n * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.\n * Unknown ids fall back to the defaults and an accent the pair cannot offer falls\n * back to the theme's own, exactly as `ThemeProvider` resolves them.\n */\nexport function appearancePreviewThemes(selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n}): { lightTheme: AdeaThemeRecord; darkTheme: AdeaThemeRecord } {\n const { light, dark } = recordPair(selection.lightThemeId, selection.darkThemeId)\n const accent = resolveAccentPreset(selection.accent, light, dark)\n return { lightTheme: withAccent(light, accent), darkTheme: withAccent(dark, accent) }\n}\n\n/**\n * The properties an accent selection overrides, as CSS custom properties.\n *\n * ## Why this exists rather than relying on the `[data-accent]` blocks\n *\n * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are\n * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's\n * whole role set onto `<html>` as *inline* custom properties, and an inline\n * declaration outranks any stylesheet selector regardless of specificity. The\n * attribute was set, the rules existed, the values were right, and every one of the\n * seven accents rendered as the same blue.\n *\n * The blocks are kept, because they are what styles the window between the document\n * arriving and the provider mounting — which is the whole reason `themeScript`\n * exists. But the authoritative value has to be applied by the same code that\n * applies the theme, from the same source, or the two can drift again. So both the\n * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and\n * `tests/appearance-axes.test.ts` asserts the two agree value for value.\n *\n * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,\n * so it is resolved against `pair` — the selection's light and dark theme ids —\n * and only ever applied here. Without a pair it resolves against the defaults.\n *\n * Returns `undefined` for `theme` — the variant's own primary — for an id the\n * catalogue does not have, and for a theme accent the pair does not offer, so a\n * stale stored preference falls back to the theme rather than blanking the primary.\n */\nexport function accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string } = {\n lightThemeId: defaultLightThemeId,\n darkThemeId: defaultDarkThemeId,\n }\n): Record<string, string> | undefined {\n if (accentId === 'theme') return undefined\n const { light, dark } = recordPair(pair.lightThemeId, pair.darkThemeId)\n const preset = resolveAccentPreset(accentId, light, dark)\n if (!preset) return undefined\n\n // `--primary-subtle` is deliberately not here. It is a `color-mix()` over\n // `var(--primary)`, so the theme's own declaration (`themeCssVariables`, or the\n // default block in `theme.css`) already follows the accent; and its strength is the\n // *theme's*, measured by `primarySubtleAlpha` to hold body text at 4.5:1 for every\n // accent the theme offers. Writing one here would replace that measured strength\n // with whatever this function was given, which is how an accent used to undo it.\n const roles = accentRoles(preset, appearance)\n return {\n '--primary': roles.primary,\n '--primary-foreground': roles.primaryForeground,\n '--primary-hover': roles.primaryHover,\n '--ring': roles.ring,\n }\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n */\nexport function themeCssVariables(theme: ThemeVariant): Record<string, string> {\n const c = theme.colors\n const t = theme.terminal\n const e = theme.editor\n return {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': primarySubtleFor(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.mutedForeground,\n '--surface-sunken': c.muted,\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n '--terminal-background': t.background,\n '--terminal-foreground': t.foreground,\n '--terminal-cursor': t.cursor,\n '--terminal-selection': t.selection,\n '--terminal-ansi-black': t.black,\n '--terminal-ansi-red': t.red,\n '--terminal-ansi-green': t.green,\n '--terminal-ansi-yellow': t.yellow,\n '--terminal-ansi-blue': t.blue,\n '--terminal-ansi-magenta': t.magenta,\n '--terminal-ansi-cyan': t.cyan,\n '--terminal-ansi-white': t.white,\n '--terminal-ansi-bright-black': t.brightBlack,\n '--terminal-ansi-bright-red': t.brightRed,\n '--terminal-ansi-bright-green': t.brightGreen,\n '--terminal-ansi-bright-yellow': t.brightYellow,\n '--terminal-ansi-bright-blue': t.brightBlue,\n '--terminal-ansi-bright-magenta': t.brightMagenta,\n '--terminal-ansi-bright-cyan': t.brightCyan,\n '--terminal-ansi-bright-white': t.brightWhite,\n '--editor-keyword': e.keyword,\n '--editor-string': e.string,\n '--editor-number': e.number,\n '--editor-comment': e.comment,\n '--editor-function': e.function,\n '--editor-variable': e.variable,\n '--editor-type': e.type,\n '--editor-tag': e.tag,\n '--editor-attribute': e.attribute,\n '--editor-operator': e.operator,\n '--editor-heading': e.heading,\n '--editor-link': e.link,\n '--editor-diff-add': e.diffAdd,\n '--editor-diff-delete': e.diffDelete,\n '--editor-diff-hunk': e.diffHunk,\n '--editor-search-match': e.searchMatch,\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n}\n\n/* ---------------------------------------------------------------------------\n * Validation\n *\n * Delegated. The floors are the catalogue's, because they are what makes the\n * catalogue able to hold other people's palettes at all, and a second set of floors\n * here would be a second answer to the same question — and the one that drifts.\n * ------------------------------------------------------------------------- */\n\nexport type ThemeFinding = {\n themeId: string\n role: string\n message: string\n}\n\nfunction toFinding(finding: ContrastFinding): ThemeFinding {\n return { themeId: finding.themeId, role: finding.role, message: finding.message }\n}\n\n/** Validates one variant. The floors, and the reasoning behind them, live in the catalogue. */\nexport function validateTheme(theme: ThemeVariant): ThemeFinding[] {\n const record = catalogue.find((entry) => entry.id === theme.id)\n if (!record) {\n return [{ themeId: theme.id, role: 'id', message: `${theme.id} is not in the catalogue` }]\n }\n return validateCatalogue([record]).map(toFinding)\n}\n\n/** Validates the whole registry, including the catalogue-level invariants. */\nexport function validateThemeRegistry(\n themes: readonly ThemeVariant[] = builtinThemes\n): ThemeFinding[] {\n const records = themes\n .map((theme) => catalogue.find((entry) => entry.id === theme.id))\n .filter((record): record is AdeaThemeRecord => !!record)\n\n const orphaned = themes\n .filter((theme) => !hasTheme(theme.id))\n .map((theme) => ({\n themeId: theme.id,\n role: 'id',\n message: `${theme.id} is in the registry but not in the catalogue`,\n }))\n\n return [...orphaned, ...validateCatalogue(records).map(toFinding)]\n}\n\nexport const defaultLightThemeId = 'adea-light'\nexport const defaultDarkThemeId = 'adea-dark'\n\n/** Re-exported so a consumer measuring a colour does not need a second import. */\nexport { contrastRatio } from '@adea-ai/themes'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6LA,IAAM,WAAyE;CAC7E,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,gBAAgB;CAChB,SAAS;CACT,mBAAmB;CAEnB,SAAS;CACT,mBAAmB;CAEnB,WAAW;CACX,qBAAqB;CACrB,OAAO;CACP,iBAAiB;CAEjB,QAAQ;CACR,kBAAkB;CAClB,aAAa;CAEb,uBAAuB;CACvB,mBAAmB;CACnB,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,MAAM;CACN,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,eAAe;AACjB;;AAGA,SAAS,UAAU,OAAsC;CACvD,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,OAAO,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CAAC,CAChE,QAAQ,WAAsC,CAAC,CAAC,MAAM;CAUzD,OAAO,CAAC,GARSC,SACd,QAAQ,UAAU,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC,CACtC,KAAK,WAAW;EACf,SAAS,MAAM;EACf,MAAM;EACN,SAAS,GAAG,MAAM,GAAG;CACvB,EAES,GAAU,GAAG,kBAAkB,OAAO,CAAC,CAAC,IAAI,SAAS,CAAC;AACnE;AAEA,IAAa,sBAAsB;AACnC,IAAa,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"themes.js","names":["catalogue","themes"],"sources":["../../src/lib/themes.ts"],"sourcesContent":["/**\n * The theme registry, now a bridge.\n *\n * The catalogue itself lives in `@adea-ai/themes`. This module is what is left in\n * the design system: the translation between the catalogue's **canonical** role\n * names and the **shadcn** vocabulary every component here is written against, plus\n * the handful of custom properties this system declares that are presentations of\n * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,\n * and `--chrome`.\n *\n * ## Why it is a bridge and not a copy\n *\n * This file used to hold thirteen themes as hand-written hex literal tables, with its\n * own contrast validator, its own terminal and editor palettes, and its own\n * provenance records. That is a lot of surface to maintain for one consumer of a\n * palette, and it meant every product that wanted the same themes — Adea, Cortana —\n * either imported this package or wrote its own. The catalogue moved out so that\n * there is one answer to \"what is Catppuccin Mocha\", and this file is the part that\n * genuinely belongs to the design system.\n *\n * It is deliberately thin. If you are looking for a colour, it is not here: see\n * `@adea-ai/themes`, whose README explains how the values are produced and whose\n * `NOTICE` records where every palette came from.\n *\n * ## The mapping, and the entry that is not a rename\n *\n * The package-owned `shadcnVariables` adapter maps canonical roles onto this\n * system's vocabulary. One entry will trip a reader: the catalogue's `accent`\n * becomes this system's `primary`, because in the shadcn vocabulary `--primary` is\n * the action colour — the fill of a primary button, the thing a focus ring is drawn\n * in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is\n * the former, so it goes to `--primary`, and `--accent` is filled from\n * `surfaceHover`, which is what shadcn components actually use it for.\n */\n\nimport {\n ACCENTS,\n accentForeground,\n accentRoles,\n chartSeries,\n getAccent,\n getTheme,\n hasTheme,\n shadcnDestructiveProjection,\n statusForeground,\n tint,\n primaryHover,\n primarySubtleCss,\n syntaxRoles,\n themes as catalogue,\n themesByAppearance,\n themeAccentPresets,\n validateCatalogue,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n type ContrastFinding,\n} from '@adea-ai/themes'\nimport { shadcnVariables } from '@adea-ai/themes/adapters/shadcn'\nimport { isThemeAccentId } from './theme-accents'\n\nexport { isThemeAccentId } from './theme-accents'\n\nexport type ThemeAppearance = 'light' | 'dark'\n\n/**\n * The surface and text roles, in shadcn's vocabulary.\n *\n * Named to match the components below, which is why they differ from the\n * catalogue's: these are this system's variable names, and renaming them would mean\n * touching every component in the library for no gain.\n */\nexport type ThemeColors = {\n background: string\n foreground: string\n card: string\n cardForeground: string\n popover: string\n popoverForeground: string\n primary: string\n primaryForeground: string\n secondary: string\n secondaryForeground: string\n muted: string\n mutedForeground: string\n accent: string\n accentForeground: string\n destructive: string\n destructiveForeground: string\n destructiveSubtle: string\n /** Contrast-safe solid-action presentation, derived from the canonical error role. */\n destructiveAction: string\n destructiveActionForeground: string\n success: string\n successForeground: string\n successSubtle: string\n warning: string\n warningForeground: string\n warningSubtle: string\n info: string\n infoForeground: string\n infoSubtle: string\n border: string\n input: string\n ring: string\n sidebar: string\n sidebarForeground: string\n sidebarAccent: string\n sidebarBorder: string\n sidebarMutedForeground: string\n}\n\n/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */\nexport type ThemeTerminalPalette = {\n background: string\n foreground: string\n cursor: string\n selection: string\n black: string\n red: string\n green: string\n yellow: string\n blue: string\n magenta: string\n cyan: string\n white: string\n brightBlack: string\n brightRed: string\n brightGreen: string\n brightYellow: string\n brightBlue: string\n brightMagenta: string\n brightCyan: string\n brightWhite: string\n}\n\n/** The syntax roles a code view needs. */\nexport type ThemeEditorPalette = {\n keyword: string\n string: string\n number: string\n comment: string\n function: string\n variable: string\n type: string\n tag: string\n attribute: string\n operator: string\n heading: string\n link: string\n diffAdd: string\n diffDelete: string\n diffHunk: string\n searchMatch: string\n}\n\n/** Where a palette came from, and the terms it is used under. */\nexport type ThemeProvenance = {\n /** The project or person the palette belongs to. */\n source: string\n url: string\n /** An SPDX identifier. Every palette in this catalogue is permissive. */\n license: string\n}\n\nexport type ThemeVariant = {\n /** The `data-theme` value and the id a preference stores. */\n id: string\n /** Groups the variants that came from one project. */\n family: string\n familyLabel: string\n label: string\n appearance: ThemeAppearance\n /** One line, shown in a picker. */\n description: string\n colors: ThemeColors\n terminal: ThemeTerminalPalette\n editor: ThemeEditorPalette\n /** The categorical series, in order. */\n chart: readonly string[]\n provenance: ThemeProvenance\n}\n\n/** Builds the design system's view of one catalogue entry. */\nfunction toVariant(theme: AdeaThemeRecord): ThemeVariant {\n const projected = shadcnVariables(theme)\n const token = (name: string): string => {\n const value = projected[`--${name}`]\n if (!value) throw new Error(`${theme.id} has no shared shadcn projection for --${name}`)\n return value\n }\n const destructiveAction = shadcnDestructiveProjection(theme)\n const colors: ThemeColors = {\n background: token('background'),\n foreground: token('foreground'),\n card: token('card'),\n cardForeground: token('card-foreground'),\n popover: token('popover'),\n popoverForeground: token('popover-foreground'),\n primary: token('primary'),\n primaryForeground: token('primary-foreground'),\n secondary: token('secondary'),\n secondaryForeground: token('secondary-foreground'),\n muted: token('muted'),\n mutedForeground: token('muted-foreground'),\n accent: token('accent'),\n accentForeground: token('accent-foreground'),\n // Preserve the UI's semantic error token. The Themes projection uses its\n // contrast-safe solid-action fill for --destructive; UI keeps that fill in\n // the separate destructiveAction pair below.\n destructive: theme.colors.error,\n destructiveForeground: statusForeground(theme, 'error'),\n destructiveSubtle: tint(theme.colors.error, theme.colors.background),\n destructiveAction: destructiveAction.fill,\n destructiveActionForeground: destructiveAction.foreground,\n success: token('success'),\n successForeground: statusForeground(theme, 'success'),\n successSubtle: tint(theme.colors.success, theme.colors.background),\n warning: token('warning'),\n warningForeground: statusForeground(theme, 'warning'),\n warningSubtle: tint(theme.colors.warning, theme.colors.background),\n info: token('info'),\n infoForeground: statusForeground(theme, 'info'),\n infoSubtle: tint(theme.colors.info, theme.colors.background),\n border: token('border'),\n input: token('input'),\n ring: token('ring'),\n sidebar: token('sidebar'),\n sidebarForeground: token('sidebar-foreground'),\n sidebarAccent: token('sidebar-accent'),\n sidebarBorder: token('sidebar-border'),\n sidebarMutedForeground: token('sidebar-muted-foreground'),\n }\n const syntax = syntaxRoles(theme)\n\n return {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n colors,\n terminal: {\n // The embedded terminal uses the theme's own canvas rather than a palette of its\n // own. The ANSI colours came from the palette that produced the canvas, so they\n // were chosen against it; a terminal on a different background would be the one\n // surface in the application not lit by the active theme.\n background: theme.colors.background,\n foreground: theme.colors.foreground,\n cursor: theme.cursor,\n selection: theme.selection,\n ...theme.ansi,\n },\n editor: {\n keyword: syntax.keyword,\n string: syntax.string,\n number: syntax.number,\n comment: syntax.comment,\n function: syntax.function,\n variable: syntax.variable,\n type: syntax.type,\n tag: syntax.tag,\n attribute: syntax.attribute,\n operator: syntax.operator,\n heading: syntax.heading,\n link: syntax.link,\n diffAdd: syntax.diffAdd,\n diffDelete: syntax.diffDelete,\n diffHunk: syntax.diffHunk,\n searchMatch: syntax.searchMatch,\n },\n chart: chartSeries(theme),\n provenance: {\n source: theme.provenance.project,\n url: theme.provenance.url,\n license: theme.provenance.license,\n },\n }\n}\n\n/**\n * A variant's `--primary-subtle`: the tint over `var(--primary)` at the strength its\n * catalogue record measures (`primarySubtleAlpha`). A variant that is not in the\n * catalogue has nothing to measure, and gets its appearance's ceiling.\n */\nexport function primarySubtleFor(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const record = getTheme(theme.id)\n return record ? primarySubtleCss(record) : primarySubtleCss(theme.appearance)\n}\n\n/** The catalogue, in catalogue order. */\nexport const builtinThemes: readonly ThemeVariant[] = Object.freeze(catalogue.map(toVariant))\n\nexport function themeById(id: string): ThemeVariant | undefined {\n if (!hasTheme(id)) return undefined\n return builtinThemes.find((theme) => theme.id === id)\n}\n\n/** The variants of one appearance, which is what a picker for that mode shows. */\nexport function themesForAppearance(appearance: ThemeAppearance): readonly ThemeVariant[] {\n const ids = new Set(themesByAppearance(appearance).map((theme) => theme.id))\n return builtinThemes.filter((theme) => ids.has(theme.id))\n}\n\n/** The families in the catalogue, in catalogue order. */\nexport function themeFamilies(): { family: string; label: string; themes: ThemeVariant[] }[] {\n const families = new Map<string, { family: string; label: string; themes: ThemeVariant[] }>()\n for (const theme of builtinThemes) {\n const entry = families.get(theme.family) ?? {\n family: theme.family,\n label: theme.familyLabel,\n themes: [],\n }\n entry.themes.push(theme)\n families.set(theme.family, entry)\n }\n return [...families.values()]\n}\n\n/** The accent presets, in the order a picker should show them. */\nexport const accents = ACCENTS\n\n/**\n * The canonical catalogue records, in catalogue order.\n *\n * {@link builtinThemes} is this system's projection of the catalogue onto the\n * shadcn vocabulary, which is what a document is painted with. A *preview* of a\n * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the\n * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),\n * several of which the projection folds together. These are those records, so a\n * consumer hands the editor exactly what it takes rather than reconstructing it\n * from the projection.\n */\nexport const themeRecords: readonly AdeaThemeRecord[] = catalogue\n\nexport function themeRecordById(id: string): AdeaThemeRecord | undefined {\n return getTheme(id)\n}\n\n/** A light/dark theme pair by id, with the defaults standing in for an unknown id. */\nfunction recordPair(lightThemeId: string, darkThemeId: string) {\n const light = getTheme(lightThemeId) ?? getTheme(defaultLightThemeId)!\n const dark = getTheme(darkThemeId) ?? getTheme(defaultDarkThemeId)!\n return { light, dark }\n}\n\n/**\n * The accents the selected light/dark pair carries — offered beside the presets.\n *\n * Computed per pair rather than per theme because a theme accent is a *pair* of\n * values, like a preset: a slot is offered only when both themes can offer it.\n */\nexport function themeAccentsFor(\n lightThemeId: string,\n darkThemeId: string\n): readonly AccentPreset[] {\n const { light, dark } = recordPair(lightThemeId, darkThemeId)\n return themeAccentPresets(light, dark)\n}\n\n/**\n * An accent id resolved against a theme pair: a preset, a theme accent the pair\n * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot\n * offer — each of which means \"use the theme's own primary\".\n *\n * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme\n * switch and resolves to the new theme's blue; when the new pair cannot offer the\n * slot it resolves to nothing, the same fallback a stale preset id gets.\n */\nexport function resolveAccentPreset(\n accentId: string,\n light: AdeaTheme,\n dark: AdeaTheme\n): AccentPreset | undefined {\n if (accentId === 'theme') return undefined\n const preset = getAccent(accentId)\n if (preset) return preset\n if (!isThemeAccentId(accentId)) return undefined\n return themeAccentPresets(light, dark).find((option) => option.id === accentId)\n}\n\n/**\n * A theme with an accent laid over it, in the catalogue's own shape.\n *\n * The accent replaces `accent` and its measured label, which is all an accent\n * changes about a theme; `undefined` returns the theme untouched. This is the\n * overlay a host needs for `AppearanceEditor`'s `lightTheme`/`darkTheme`.\n */\nexport function withAccent<T extends AdeaTheme>(theme: T, accent: AccentPreset | undefined): T {\n if (!accent) return theme\n const value = theme.appearance === 'dark' ? accent.dark : accent.light\n return {\n ...theme,\n colors: { ...theme.colors, accent: value, accentForeground: accentForeground(value) },\n }\n}\n\n/**\n * The two preview themes an appearance selection resolves to, accent applied.\n *\n * The adapter between a stored selection and `AppearanceEditor`: it takes ids —\n * what a preference holds — and returns the canonical records the editor's\n * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.\n * Unknown ids fall back to the defaults and an accent the pair cannot offer falls\n * back to the theme's own, exactly as `ThemeProvider` resolves them.\n */\nexport function appearancePreviewThemes(selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n}): { lightTheme: AdeaThemeRecord; darkTheme: AdeaThemeRecord } {\n const { light, dark } = recordPair(selection.lightThemeId, selection.darkThemeId)\n const accent = resolveAccentPreset(selection.accent, light, dark)\n return { lightTheme: withAccent(light, accent), darkTheme: withAccent(dark, accent) }\n}\n\n/**\n * The properties an accent selection overrides, as CSS custom properties.\n *\n * ## Why this exists rather than relying on the `[data-accent]` blocks\n *\n * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are\n * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's\n * whole role set onto `<html>` as *inline* custom properties, and an inline\n * declaration outranks any stylesheet selector regardless of specificity. The\n * attribute was set, the rules existed, the values were right, and every one of the\n * seven accents rendered as the same blue.\n *\n * The blocks are kept, because they are what styles the window between the document\n * arriving and the provider mounting — which is the whole reason `themeScript`\n * exists. But the authoritative value has to be applied by the same code that\n * applies the theme, from the same source, or the two can drift again. So both the\n * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and\n * `tests/appearance-axes.test.ts` asserts the two agree value for value.\n *\n * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,\n * so it is resolved against `pair` — the selection's light and dark theme ids —\n * and only ever applied here. Without a pair it resolves against the defaults.\n *\n * Returns `undefined` for `theme` — the variant's own primary — for an id the\n * catalogue does not have, and for a theme accent the pair does not offer, so a\n * stale stored preference falls back to the theme rather than blanking the primary.\n */\nexport function accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string } = {\n lightThemeId: defaultLightThemeId,\n darkThemeId: defaultDarkThemeId,\n }\n): Record<string, string> | undefined {\n if (accentId === 'theme') return undefined\n const { light, dark } = recordPair(pair.lightThemeId, pair.darkThemeId)\n const preset = resolveAccentPreset(accentId, light, dark)\n if (!preset) return undefined\n\n // `--primary-subtle` is deliberately not here. It is a `color-mix()` over\n // `var(--primary)`, so the theme's own declaration (`themeCssVariables`, or the\n // default block in `theme.css`) already follows the accent; and its strength is the\n // *theme's*, measured by `primarySubtleAlpha` to hold body text at 4.5:1 for every\n // accent the theme offers. Writing one here would replace that measured strength\n // with whatever this function was given, which is how an accent used to undo it.\n const roles = accentRoles(preset, appearance)\n return {\n '--primary': roles.primary,\n '--primary-foreground': roles.primaryForeground,\n '--primary-hover': roles.primaryHover,\n '--ring': roles.ring,\n }\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n */\nexport function themeCssVariables(theme: ThemeVariant): Record<string, string> {\n const c = theme.colors\n const t = theme.terminal\n const e = theme.editor\n return {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': primarySubtleFor(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.sidebarMutedForeground,\n '--surface-sunken': c.muted,\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n '--terminal-background': t.background,\n '--terminal-foreground': t.foreground,\n '--terminal-cursor': t.cursor,\n '--terminal-selection': t.selection,\n '--terminal-ansi-black': t.black,\n '--terminal-ansi-red': t.red,\n '--terminal-ansi-green': t.green,\n '--terminal-ansi-yellow': t.yellow,\n '--terminal-ansi-blue': t.blue,\n '--terminal-ansi-magenta': t.magenta,\n '--terminal-ansi-cyan': t.cyan,\n '--terminal-ansi-white': t.white,\n '--terminal-ansi-bright-black': t.brightBlack,\n '--terminal-ansi-bright-red': t.brightRed,\n '--terminal-ansi-bright-green': t.brightGreen,\n '--terminal-ansi-bright-yellow': t.brightYellow,\n '--terminal-ansi-bright-blue': t.brightBlue,\n '--terminal-ansi-bright-magenta': t.brightMagenta,\n '--terminal-ansi-bright-cyan': t.brightCyan,\n '--terminal-ansi-bright-white': t.brightWhite,\n '--editor-keyword': e.keyword,\n '--editor-string': e.string,\n '--editor-number': e.number,\n '--editor-comment': e.comment,\n '--editor-function': e.function,\n '--editor-variable': e.variable,\n '--editor-type': e.type,\n '--editor-tag': e.tag,\n '--editor-attribute': e.attribute,\n '--editor-operator': e.operator,\n '--editor-heading': e.heading,\n '--editor-link': e.link,\n '--editor-diff-add': e.diffAdd,\n '--editor-diff-delete': e.diffDelete,\n '--editor-diff-hunk': e.diffHunk,\n '--editor-search-match': e.searchMatch,\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n}\n\n/* ---------------------------------------------------------------------------\n * Validation\n *\n * Delegated. The floors are the catalogue's, because they are what makes the\n * catalogue able to hold other people's palettes at all, and a second set of floors\n * here would be a second answer to the same question — and the one that drifts.\n * ------------------------------------------------------------------------- */\n\nexport type ThemeFinding = {\n themeId: string\n role: string\n message: string\n}\n\nfunction toFinding(finding: ContrastFinding): ThemeFinding {\n return { themeId: finding.themeId, role: finding.role, message: finding.message }\n}\n\n/** Validates one variant. The floors, and the reasoning behind them, live in the catalogue. */\nexport function validateTheme(theme: ThemeVariant): ThemeFinding[] {\n const record = catalogue.find((entry) => entry.id === theme.id)\n if (!record) {\n return [{ themeId: theme.id, role: 'id', message: `${theme.id} is not in the catalogue` }]\n }\n return validateCatalogue([record]).map(toFinding)\n}\n\n/** Validates the whole registry, including the catalogue-level invariants. */\nexport function validateThemeRegistry(\n themes: readonly ThemeVariant[] = builtinThemes\n): ThemeFinding[] {\n const records = themes\n .map((theme) => catalogue.find((entry) => entry.id === theme.id))\n .filter((record): record is AdeaThemeRecord => !!record)\n\n const orphaned = themes\n .filter((theme) => !hasTheme(theme.id))\n .map((theme) => ({\n themeId: theme.id,\n role: 'id',\n message: `${theme.id} is in the registry but not in the catalogue`,\n }))\n\n return [...orphaned, ...validateCatalogue(records).map(toFinding)]\n}\n\nexport const defaultLightThemeId = 'adea-light'\nexport const defaultDarkThemeId = 'adea-dark'\n\n/** Re-exported so a consumer measuring a colour does not need a second import. */\nexport { contrastRatio } from '@adea-ai/themes'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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AE;EACvB,wBAAwB,EAAE;EAC1B,sBAAsB,EAAE;EACxB,yBAAyB,EAAE;EAC3B,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;CACnC;AACF;AAgBA,SAAS,UAAU,SAAwC;CACzD,OAAO;EAAE,SAAS,QAAQ;EAAS,MAAM,QAAQ;EAAM,SAAS,QAAQ;CAAQ;AAClF;;AAGA,SAAgB,cAAc,OAAqC;CACjE,MAAM,SAASA,OAAU,MAAM,UAAU,MAAM,OAAO,MAAM,EAAE;CAC9D,IAAI,CAAC,QACH,OAAO,CAAC;EAAE,SAAS,MAAM;EAAI,MAAM;EAAM,SAAS,GAAG,MAAM,GAAG;CAA0B,CAAC;CAE3F,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS;AAClD;;AAGA,SAAgB,sBACd,WAAkC,eAClB;CAChB,MAAM,UAAUC,SACb,KAAK,UAAUD,OAAU,MAAM,UAAU,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC,CAChE,QAAQ,WAAsC,CAAC,CAAC,MAAM;CAUzD,OAAO,CAAC,GARSC,SACd,QAAQ,UAAU,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC,CACtC,KAAK,WAAW;EACf,SAAS,MAAM;EACf,MAAM;EACN,SAAS,GAAG,MAAM,GAAG;CACvB,EAES,GAAU,GAAG,kBAAkB,OAAO,CAAC,CAAC,IAAI,SAAS,CAAC;AACnE;AAEA,IAAa,sBAAsB;AACnC,IAAa,qBAAqB"}
|
package/dist/r/lib.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Class-name and token helpers",
|
|
5
5
|
"description": "The private helpers the components import: the class-name merge, the variant recipes, the token manifest and the theme bridge. Installed automatically as a peer of any component that needs it.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"@adea-ai/themes@^0.
|
|
7
|
+
"@adea-ai/themes@^0.10.4",
|
|
8
8
|
"class-variance-authority@^0.7.1",
|
|
9
9
|
"cn@^0.4.0"
|
|
10
10
|
],
|