@adea-ai/ui 0.147.10 → 0.147.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"shell-top-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/shell-top-bar/shell-top-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC1E,kEAAkE;IAClE,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACxB,iCAAiC;IACjC,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAC3B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACxB,yBAAyB;IACzB,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,gDAAgD;IAChD,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAiHlD"}
1
+ {"version":3,"file":"shell-top-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/shell-top-bar/shell-top-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC1E,kEAAkE;IAClE,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACxB,iCAAiC;IACjC,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAC3B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACxB,yBAAyB;IACzB,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,gDAAgD;IAChD,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAoHlD"}
@@ -6,10 +6,10 @@ import { Show, children, splitProps } from "solid-js";
6
6
  var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-navigation class="flex shrink-0 items-center gap-2">`);
7
7
  var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-toggle class="flex shrink-0 items-center">`);
8
8
  var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-workspace class="flex min-w-0 items-center">`);
9
- var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-breadcrumb class="window-no-drag flex h-topbar min-w-0 flex-1 items-center truncate ps-3 text-sm [&amp;_:is(a,button)]:window-no-drag">`);
9
+ var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-breadcrumb class="window-no-drag flex h-[calc(var(--topbar-height)-1px)] min-w-0 flex-1 items-center truncate ps-3 text-sm [&amp;_:is(a,button)]:window-no-drag">`);
10
10
  var _tmpl$5 = /*#__PURE__*/ template(`<div class="min-w-0 flex-1"aria-hidden=true>`);
11
11
  var _tmpl$6 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-search class="window-no-drag min-w-0 max-w-md shrink basis-72 px-3 @max-[34rem]/shell-top-bar:order-last @max-[34rem]/shell-top-bar:max-w-none @max-[34rem]/shell-top-bar:basis-full @max-[34rem]/shell-top-bar:pb-2">`);
12
- var _tmpl$7 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-actions class="window-no-drag flex h-topbar max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5">`);
12
+ var _tmpl$7 = /*#__PURE__*/ template(`<div data-slot=shell-top-bar-actions class="window-no-drag flex h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5">`);
13
13
  var _tmpl$8 = /*#__PURE__*/ template(`<header data-slot=shell-top-bar><div data-slot=shell-top-bar-leading>`);
14
14
  function ShellTopBar(props) {
15
15
  const [local, rest] = splitProps(props, [
@@ -118,7 +118,7 @@ function ShellTopBar(props) {
118
118
  }
119
119
  }), null);
120
120
  effect((_p$) => {
121
- var _v$ = local.sidebarOpen ? "true" : "false", _v$2 = cn("window-no-drag flex min-h-topbar max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3", local.sidebarOpen && "md:w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]");
121
+ var _v$ = local.sidebarOpen ? "true" : "false", _v$2 = cn("window-no-drag flex min-h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3", local.sidebarOpen && "md:w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]");
122
122
  _v$ !== _p$.e && setAttribute(_el$2, "data-sidebar-open", _p$.e = _v$);
123
123
  _v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
124
124
  return _p$;
@@ -1 +1 @@
1
- {"version":3,"file":"shell-top-bar.js","names":["ComponentProps","JSX","children","Show","splitProps","cn","Separator","ShellTopBarProps","Omit","navigation","Element","sidebarToggle","workspace","sidebarOpen","sidebarWidth","breadcrumb","search","actions","draggable","macosInset","windowsInset","glass","ShellTopBar","props","local","rest","_el$","_tmpl$8","_el$2","firstChild","_$spread","_$mergeProps","class","style","_$memo","undefined","_$insert","_$createComponent","when","_el$3","_tmpl$","_el$4","_tmpl$2","_el$5","_tmpl$3","orientation","_el$6","_tmpl$4","_tmpl$5","_el$8","_tmpl$6","_el$9","_tmpl$7","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","_$mergeProps","_$memo","_$createComponent","_$setAttribute","_$className"],"sources":["../../../../src/components/layout/shell-top-bar/shell-top-bar.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { children, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Separator } from '../../ui/separator'\n\n/**\n * ShellTopBar.\n *\n * The window's top bar as both applications draw it. It has two halves with a\n * vertical divider between them:\n *\n * - **Leading**: history arrows, the sidebar toggle and the workspace\n * switcher, in that order. This is the part that belongs to the window.\n * - **Content**: breadcrumbs, search and the view's actions. This is the part\n * that belongs to the view, and it always sits to the right of the divider.\n *\n * ## Why the divider tracks the sidebar\n *\n * With the sidebar open the divider lands on the sidebar's trailing edge, so the\n * bar reads as the rail and sidebar's header on one side and the content's\n * header on the other. The bar spans the rail and the sidebar (they sit under\n * it), so the leading half is as wide as `--rail-width` plus the sidebar's width\n * less the bar's own start padding. The host publishes the width as\n * `--shell-sidebar-width` on an ancestor; the fallback of 17rem matches the\n * default sidebar. Below the 48rem breakpoint the sidebar is a drawer and the\n * leading half is only as wide as its controls.\n *\n * ## Narrow windows\n *\n * The bar is its own container. Below 34rem the search drops to a row of its\n * own so the leading controls, the breadcrumb and the actions keep their room;\n * the breadcrumb is the first thing to truncate.\n *\n * The bar never spills past its window. When the leading controls are wider than\n * the window (a 320px viewport at 200% text), they wrap onto a second row inside\n * the leading half instead of being cut off or pushing the page sideways, and\n * the actions are capped to the bar and scroll if they are still too wide.\n *\n * On a frameless desktop window the bar is the drag region (`draggable`) and\n * every control opts back out; `macosInset` and `windowsInset` reserve the\n * native window controls.\n */\nexport type ShellTopBarProps = Omit<ComponentProps<'header'>, 'children'> & {\n /** History arrows. Rendered first, left of the sidebar toggle. */\n navigation?: JSX.Element\n /** The sidebar toggle button. */\n sidebarToggle?: JSX.Element\n /** The workspace switcher. */\n workspace?: JSX.Element\n /**\n * Whether the sidebar is open at wide widths. Open, the divider aligns with\n * the sidebar's edge; closed, the leading half hugs its controls.\n */\n sidebarOpen?: boolean\n /**\n * The open sidebar's width in pixels. Published as `--shell-sidebar-width` on\n * the bar so the divider tracks a resizable sidebar; leave it unset to use an\n * ancestor's variable or the 17rem default.\n */\n sidebarWidth?: number\n /** Breadcrumbs or the view's title. Takes the free space and truncates first. */\n breadcrumb?: JSX.Element\n /** The view's search. */\n search?: JSX.Element\n /** The view's actions, at the trailing edge. */\n actions?: JSX.Element\n /** Make the bar a drag region, for a frameless window. */\n draggable?: boolean\n /** Reserve space for the macOS traffic lights. */\n macosInset?: boolean\n /** Reserve space for the Windows caption buttons. */\n windowsInset?: boolean\n /** Blur the content scrolling under the bar. */\n glass?: boolean\n}\n\nexport function ShellTopBar(props: ShellTopBarProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'navigation',\n 'sidebarToggle',\n 'workspace',\n 'sidebarOpen',\n 'sidebarWidth',\n 'breadcrumb',\n 'search',\n 'actions',\n 'draggable',\n 'macosInset',\n 'windowsInset',\n 'glass',\n ])\n\n // Resolve each slot once: a JSX prop is a getter that builds its elements on\n // every read, so testing it with `Show` and then rendering it would build\n // (and run the refs of) two copies.\n const navigation = children(() => local.navigation)\n const sidebarToggle = children(() => local.sidebarToggle)\n const workspace = children(() => local.workspace)\n const breadcrumb = children(() => local.breadcrumb)\n const search = children(() => local.search)\n const actions = children(() => local.actions)\n\n return (\n <header\n data-slot=\"shell-top-bar\"\n class={cn(\n '@container/shell-top-bar relative z-(--z-sticky) flex min-h-topbar shrink-0 flex-wrap items-center border-b border-border bg-card text-card-foreground',\n local.glass && 'glass-panel',\n local.draggable && 'window-drag',\n /* Each edge gets exactly one inline-padding utility, for the reason the\n shared TopBar documents: two would tie-break by build order. The inset\n is also published as a variable so the leading half can subtract it. */\n local.macosInset\n ? 'window-inset-macos [--shell-top-bar-inset:84px]'\n : 'ps-3 [--shell-top-bar-inset:0.75rem]',\n local.windowsInset ? 'window-inset-windows' : 'pe-3',\n local.class\n )}\n style={\n local.sidebarWidth === undefined\n ? undefined\n : { '--shell-sidebar-width': `${local.sidebarWidth}px` }\n }\n {...rest}\n >\n <div\n data-slot=\"shell-top-bar-leading\"\n data-sidebar-open={local.sidebarOpen ? 'true' : 'false'}\n class={cn(\n 'window-no-drag flex min-h-topbar max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',\n /* Wide and open: span the rail and the sidebar so the divider lands on\n the sidebar's edge. The sidebar's own border is the 1px the divider\n overlaps, so no extra allowance is needed. */\n local.sidebarOpen &&\n 'md:w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]'\n )}\n >\n <Show when={navigation()}>\n <div data-slot=\"shell-top-bar-navigation\" class=\"flex shrink-0 items-center gap-2\">\n {navigation()}\n </div>\n </Show>\n <Show when={sidebarToggle()}>\n <div data-slot=\"shell-top-bar-toggle\" class=\"flex shrink-0 items-center\">\n {sidebarToggle()}\n </div>\n </Show>\n <Show when={workspace()}>\n <div data-slot=\"shell-top-bar-workspace\" class=\"flex min-w-0 items-center\">\n {workspace()}\n </div>\n </Show>\n </div>\n <Separator\n orientation=\"vertical\"\n data-slot=\"shell-top-bar-divider\"\n aria-hidden=\"true\"\n class=\"data-[orientation=vertical]:h-5\"\n />\n <Show when={breadcrumb()}>\n <div\n data-slot=\"shell-top-bar-breadcrumb\"\n class=\"window-no-drag flex h-topbar min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag\"\n >\n {breadcrumb()}\n </div>\n </Show>\n <Show when={!breadcrumb()}>\n <div class=\"min-w-0 flex-1\" aria-hidden=\"true\" />\n </Show>\n <Show when={search()}>\n <div\n data-slot=\"shell-top-bar-search\"\n class=\"window-no-drag min-w-0 max-w-md shrink basis-72 px-3 @max-[34rem]/shell-top-bar:order-last @max-[34rem]/shell-top-bar:max-w-none @max-[34rem]/shell-top-bar:basis-full @max-[34rem]/shell-top-bar:pb-2\"\n >\n {search()}\n </div>\n </Show>\n <Show when={actions()}>\n <div\n data-slot=\"shell-top-bar-actions\"\n class=\"window-no-drag flex h-topbar max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5\"\n >\n {actions()}\n </div>\n </Show>\n </header>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AA4EA,SAAgBsB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAKD,MAAMd,aA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AAA;GAAAwB,GAAAxB,KAAAA;EAAA,CAAA;EAAA,OAAAT;CAAA,EAAA,CAAA;AAqDT"}
1
+ {"version":3,"file":"shell-top-bar.js","names":["ComponentProps","JSX","children","Show","splitProps","cn","Separator","ShellTopBarProps","Omit","navigation","Element","sidebarToggle","workspace","sidebarOpen","sidebarWidth","breadcrumb","search","actions","draggable","macosInset","windowsInset","glass","ShellTopBar","props","local","rest","_el$","_tmpl$8","_el$2","firstChild","_$spread","_$mergeProps","class","style","_$memo","undefined","_$insert","_$createComponent","when","_el$3","_tmpl$","_el$4","_tmpl$2","_el$5","_tmpl$3","orientation","_el$6","_tmpl$4","_tmpl$5","_el$8","_tmpl$6","_el$9","_tmpl$7","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","_$mergeProps","_$memo","_$createComponent","_$setAttribute","_$className"],"sources":["../../../../src/components/layout/shell-top-bar/shell-top-bar.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { children, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Separator } from '../../ui/separator'\n\n/**\n * ShellTopBar.\n *\n * The window's top bar as both applications draw it. It has two halves with a\n * vertical divider between them:\n *\n * - **Leading**: history arrows, the sidebar toggle and the workspace\n * switcher, in that order. This is the part that belongs to the window.\n * - **Content**: breadcrumbs, search and the view's actions. This is the part\n * that belongs to the view, and it always sits to the right of the divider.\n *\n * ## Why the divider tracks the sidebar\n *\n * With the sidebar open the divider lands on the sidebar's trailing edge, so the\n * bar reads as the rail and sidebar's header on one side and the content's\n * header on the other. The bar spans the rail and the sidebar (they sit under\n * it), so the leading half is as wide as `--rail-width` plus the sidebar's width\n * less the bar's own start padding. The host publishes the width as\n * `--shell-sidebar-width` on an ancestor; the fallback of 17rem matches the\n * default sidebar. Below the 48rem breakpoint the sidebar is a drawer and the\n * leading half is only as wide as its controls.\n *\n * ## Narrow windows\n *\n * The bar is its own container. Below 34rem the search drops to a row of its\n * own so the leading controls, the breadcrumb and the actions keep their room;\n * the breadcrumb is the first thing to truncate.\n *\n * The bar never spills past its window. When the leading controls are wider than\n * the window (a 320px viewport at 200% text), they wrap onto a second row inside\n * the leading half instead of being cut off or pushing the page sideways, and\n * the actions are capped to the bar and scroll if they are still too wide.\n *\n * On a frameless desktop window the bar is the drag region (`draggable`) and\n * every control opts back out; `macosInset` and `windowsInset` reserve the\n * native window controls.\n */\nexport type ShellTopBarProps = Omit<ComponentProps<'header'>, 'children'> & {\n /** History arrows. Rendered first, left of the sidebar toggle. */\n navigation?: JSX.Element\n /** The sidebar toggle button. */\n sidebarToggle?: JSX.Element\n /** The workspace switcher. */\n workspace?: JSX.Element\n /**\n * Whether the sidebar is open at wide widths. Open, the divider aligns with\n * the sidebar's edge; closed, the leading half hugs its controls.\n */\n sidebarOpen?: boolean\n /**\n * The open sidebar's width in pixels. Published as `--shell-sidebar-width` on\n * the bar so the divider tracks a resizable sidebar; leave it unset to use an\n * ancestor's variable or the 17rem default.\n */\n sidebarWidth?: number\n /** Breadcrumbs or the view's title. Takes the free space and truncates first. */\n breadcrumb?: JSX.Element\n /** The view's search. */\n search?: JSX.Element\n /** The view's actions, at the trailing edge. */\n actions?: JSX.Element\n /** Make the bar a drag region, for a frameless window. */\n draggable?: boolean\n /** Reserve space for the macOS traffic lights. */\n macosInset?: boolean\n /** Reserve space for the Windows caption buttons. */\n windowsInset?: boolean\n /** Blur the content scrolling under the bar. */\n glass?: boolean\n}\n\nexport function ShellTopBar(props: ShellTopBarProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'navigation',\n 'sidebarToggle',\n 'workspace',\n 'sidebarOpen',\n 'sidebarWidth',\n 'breadcrumb',\n 'search',\n 'actions',\n 'draggable',\n 'macosInset',\n 'windowsInset',\n 'glass',\n ])\n\n // Resolve each slot once: a JSX prop is a getter that builds its elements on\n // every read, so testing it with `Show` and then rendering it would build\n // (and run the refs of) two copies.\n const navigation = children(() => local.navigation)\n const sidebarToggle = children(() => local.sidebarToggle)\n const workspace = children(() => local.workspace)\n const breadcrumb = children(() => local.breadcrumb)\n const search = children(() => local.search)\n const actions = children(() => local.actions)\n\n return (\n <header\n data-slot=\"shell-top-bar\"\n class={cn(\n /* Rows are one pixel short of the top bar height so the bottom border keeps\n the bar at exactly --topbar-height, like the shared TopBar: docked\n panels and sidebar headers measure from that edge. */\n '@container/shell-top-bar relative z-(--z-sticky) flex min-h-topbar shrink-0 flex-wrap items-center border-b border-border bg-card text-card-foreground',\n local.glass && 'glass-panel',\n local.draggable && 'window-drag',\n /* Each edge gets exactly one inline-padding utility, for the reason the\n shared TopBar documents: two would tie-break by build order. The inset\n is also published as a variable so the leading half can subtract it. */\n local.macosInset\n ? 'window-inset-macos [--shell-top-bar-inset:84px]'\n : 'ps-3 [--shell-top-bar-inset:0.75rem]',\n local.windowsInset ? 'window-inset-windows' : 'pe-3',\n local.class\n )}\n style={\n local.sidebarWidth === undefined\n ? undefined\n : { '--shell-sidebar-width': `${local.sidebarWidth}px` }\n }\n {...rest}\n >\n <div\n data-slot=\"shell-top-bar-leading\"\n data-sidebar-open={local.sidebarOpen ? 'true' : 'false'}\n class={cn(\n 'window-no-drag flex min-h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',\n /* Wide and open: span the rail and the sidebar so the divider lands on\n the sidebar's edge. The sidebar's own border is the 1px the divider\n overlaps, so no extra allowance is needed. */\n local.sidebarOpen &&\n 'md:w-[calc(var(--rail-width)+var(--shell-sidebar-width,17rem)-var(--shell-top-bar-inset))]'\n )}\n >\n <Show when={navigation()}>\n <div data-slot=\"shell-top-bar-navigation\" class=\"flex shrink-0 items-center gap-2\">\n {navigation()}\n </div>\n </Show>\n <Show when={sidebarToggle()}>\n <div data-slot=\"shell-top-bar-toggle\" class=\"flex shrink-0 items-center\">\n {sidebarToggle()}\n </div>\n </Show>\n <Show when={workspace()}>\n <div data-slot=\"shell-top-bar-workspace\" class=\"flex min-w-0 items-center\">\n {workspace()}\n </div>\n </Show>\n </div>\n <Separator\n orientation=\"vertical\"\n data-slot=\"shell-top-bar-divider\"\n aria-hidden=\"true\"\n class=\"data-[orientation=vertical]:h-5\"\n />\n <Show when={breadcrumb()}>\n <div\n data-slot=\"shell-top-bar-breadcrumb\"\n class=\"window-no-drag flex h-[calc(var(--topbar-height)-1px)] min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag\"\n >\n {breadcrumb()}\n </div>\n </Show>\n <Show when={!breadcrumb()}>\n <div class=\"min-w-0 flex-1\" aria-hidden=\"true\" />\n </Show>\n <Show when={search()}>\n <div\n data-slot=\"shell-top-bar-search\"\n class=\"window-no-drag min-w-0 max-w-md shrink basis-72 px-3 @max-[34rem]/shell-top-bar:order-last @max-[34rem]/shell-top-bar:max-w-none @max-[34rem]/shell-top-bar:basis-full @max-[34rem]/shell-top-bar:pb-2\"\n >\n {search()}\n </div>\n </Show>\n <Show when={actions()}>\n <div\n data-slot=\"shell-top-bar-actions\"\n class=\"window-no-drag flex h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5\"\n >\n {actions()}\n </div>\n </Show>\n </header>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AA4EA,SAAgBsB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAKD,MAAMd,aAAaP,eAAesB,MAAMf,UAAU;CAClD,MAAME,gBAAgBT,eAAesB,MAAMb,aAAa;CACxD,MAAMC,YAAYV,eAAesB,MAAMZ,SAAS;CAChD,MAAMG,aAAab,eAAesB,MAAMT,UAAU;CAClD,MAAMC,SAASd,eAAesB,MAAMR,MAAM;CAC1C,MAAMC,UAAUf,eAAesB,MAAMP,OAAO;CAE5C,cAA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;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC,EACrE,KAAK,EAAE,OAAO,GACb,sCAAsC,CAsBxC;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAajG"}
@@ -23,8 +23,6 @@ var DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS = Object.freeze({
23
23
  size: 12
24
24
  })
25
25
  });
26
- var fontFamilyIds = new Set(fontOptions.map((option) => option.id));
27
- var fontOptionsById = Object.freeze(Object.fromEntries(fontOptions.map((option) => [option.id, option])));
28
26
  var fontProjectionById = Object.freeze(Object.fromEntries(fontOptions.map((option) => [option.id, {
29
27
  familyVariables: option.familyVariables,
30
28
  uiTracking: option.uiTracking,
@@ -60,7 +58,7 @@ function hasOwn(value, key) {
60
58
  return Object.prototype.hasOwnProperty.call(value, key);
61
59
  }
62
60
  function normalizeFamily(value) {
63
- return typeof value === "string" && fontFamilyIds.has(value) ? value : void 0;
61
+ return typeof value === "string" && hasOwn(fontProjectionById, value) ? value : void 0;
64
62
  }
65
63
  function clampFontSize(value) {
66
64
  return Math.min(32, Math.max(10, Math.round(value)));
@@ -123,7 +121,7 @@ function applyAppearanceFontSettings(root, value) {
123
121
  for (const axis of APPEARANCE_EDITOR_FONT_AXES) {
124
122
  const projection = fontAxisProjection[axis];
125
123
  const setting = settings[axis];
126
- const option = fontOptionsById[setting.family];
124
+ const option = fontProjectionById[setting.family];
127
125
  if (setting.family === "system") root.removeAttribute(projection.familyAttribute);
128
126
  else root.setAttribute(projection.familyAttribute, setting.family);
129
127
  root.style.setProperty(projection.familyProperty, `var(${option.familyVariables[axis]})`);
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-font-settings.js","names":[],"sources":["../../src/lib/appearance-font-settings.ts"],"sourcesContent":["import { fontOptions, type FontOption } from '#lib/font-catalog'\nimport { safeScriptStringLiteral } from '#lib/safe-script'\n\nexport const APPEARANCE_EDITOR_FONT_AXES = ['ui', 'content', 'code'] as const\n\nexport type AppearanceEditorFontAxis = (typeof APPEARANCE_EDITOR_FONT_AXES)[number]\nexport type AppearanceEditorFontFamilyId = FontOption['id']\n\nexport type AppearanceEditorFontSetting = Readonly<{\n /** A stable id from the shared font catalogue, never a CSS family string. */\n family: AppearanceEditorFontFamilyId\n /** A pixel size, normalized to the supported range. */\n size: number\n}>\n\n/** The host-owned choices edited by the shared appearance composition. */\nexport type AppearanceEditorFontSettings = Readonly<\n Record<AppearanceEditorFontAxis, AppearanceEditorFontSetting>\n>\n\nexport const APPEARANCE_EDITOR_FONT_SIZE_MIN = 10\nexport const APPEARANCE_EDITOR_FONT_SIZE_MAX = 32\n\n/** New preferences use the platform face in each text role. */\nexport const DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS: AppearanceEditorFontSettings = Object.freeze({\n ui: Object.freeze({ family: 'system', size: 14 }),\n content: Object.freeze({ family: 'system', size: 14 }),\n code: Object.freeze({ family: 'system', size: 12 }),\n})\n\nexport type NormalizedAppearanceEditorFontSettings = Readonly<{\n settings: AppearanceEditorFontSettings\n /** Axes whose persisted family or size was unavailable or outside its limits. */\n recoveredAxes: readonly AppearanceEditorFontAxis[]\n}>\n\nconst fontFamilyIds: ReadonlySet<string> = new Set(fontOptions.map((option) => option.id))\nconst fontOptionsById = Object.freeze(\n Object.fromEntries(fontOptions.map((option) => [option.id, option])) as Record<\n AppearanceEditorFontFamilyId,\n FontOption\n >\n)\nconst fontProjectionById = Object.freeze(\n Object.fromEntries(\n fontOptions.map((option) => [\n option.id,\n {\n familyVariables: option.familyVariables,\n uiTracking: option.uiTracking,\n uiWordSpacing: option.uiWordSpacing,\n },\n ])\n ) as Record<\n AppearanceEditorFontFamilyId,\n Pick<FontOption, 'familyVariables' | 'uiTracking' | 'uiWordSpacing'>\n >\n)\nconst fontAxisProjection = Object.freeze({\n ui: Object.freeze({\n familyAttribute: 'data-ui-font',\n familyProperty: '--font-ui',\n sizeProperty: '--font-ui-size',\n scaleProperty: '--font-ui-scale',\n defaultSize: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS.ui.size,\n }),\n content: Object.freeze({\n familyAttribute: 'data-content-font',\n familyProperty: '--font-content',\n sizeProperty: '--font-content-size',\n scaleProperty: '--font-content-scale',\n defaultSize: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS.content.size,\n }),\n code: Object.freeze({\n familyAttribute: 'data-code-font',\n familyProperty: '--font-code',\n sizeProperty: '--font-code-size',\n scaleProperty: '--font-code-scale',\n defaultSize: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS.code.size,\n }),\n})\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction hasOwn(value: Record<string, unknown>, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(value, key)\n}\n\nfunction normalizeFamily(value: unknown): AppearanceEditorFontFamilyId | undefined {\n return typeof value === 'string' && fontFamilyIds.has(value)\n ? (value as AppearanceEditorFontFamilyId)\n : undefined\n}\n\nfunction clampFontSize(value: number): number {\n return Math.min(\n APPEARANCE_EDITOR_FONT_SIZE_MAX,\n Math.max(APPEARANCE_EDITOR_FONT_SIZE_MIN, Math.round(value))\n )\n}\n\n/** Normalize a single number-input value; invalid edits return the current size. */\nexport function normalizeAppearanceEditorFontSize(value: unknown, fallback: number): number {\n const parsed =\n typeof value === 'number'\n ? value\n : typeof value === 'string' && value.trim() !== ''\n ? Number(value)\n : Number.NaN\n return Number.isFinite(parsed) ? clampFontSize(parsed) : clampFontSize(fallback)\n}\n\n/**\n * Recover persisted font choices against the shared font catalogue.\n *\n * `legacyUiFamily` lets a host migrate its previous single font field into the\n * UI axis. Content and code remain on the new System defaults during that\n * migration. Missing settings are ordinary defaults; an unknown saved id or an\n * invalid size is reported through `recoveredAxes` for the host's notice.\n */\nexport function normalizeAppearanceEditorFontSettings(\n value: unknown,\n legacyUiFamily?: unknown\n): NormalizedAppearanceEditorFontSettings {\n const source = isRecord(value) ? value : undefined\n const malformedRoot = value !== undefined && value !== null && source === undefined\n const recovered = new Set<AppearanceEditorFontAxis>()\n const settings = {} as Record<AppearanceEditorFontAxis, AppearanceEditorFontSetting>\n\n for (const axis of APPEARANCE_EDITOR_FONT_AXES) {\n const axisPresent = source ? hasOwn(source, axis) : false\n const axisValue = source?.[axis]\n const axisSource = isRecord(axisValue) ? axisValue : undefined\n const fallback = DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS[axis]\n\n if (malformedRoot || (axisPresent && axisSource === undefined)) recovered.add(axis)\n\n const hasFamily = axisSource ? hasOwn(axisSource, 'family') : false\n const familyInput = hasFamily\n ? axisSource?.['family']\n : axis === 'ui' && legacyUiFamily !== undefined\n ? legacyUiFamily\n : undefined\n const family = normalizeFamily(familyInput) ?? fallback.family\n if (\n (hasFamily || (axis === 'ui' && legacyUiFamily !== undefined)) &&\n !normalizeFamily(familyInput)\n ) {\n recovered.add(axis)\n }\n\n const hasSize = axisSource ? hasOwn(axisSource, 'size') : false\n const sizeInput = axisSource?.['size']\n const size = hasSize\n ? normalizeAppearanceEditorFontSize(sizeInput, fallback.size)\n : fallback.size\n if (\n hasSize &&\n (typeof sizeInput !== 'number' || !Number.isFinite(sizeInput) || sizeInput !== size)\n ) {\n recovered.add(axis)\n }\n\n settings[axis] = Object.freeze({ family, size })\n }\n\n return Object.freeze({\n settings: Object.freeze(settings),\n recoveredAxes: Object.freeze(APPEARANCE_EDITOR_FONT_AXES.filter((axis) => recovered.has(axis))),\n })\n}\n\n/**\n * Project normalized font preferences onto a document root.\n *\n * This is shared by `ThemeProvider` and hosts that own their own appearance\n * persistence, so UI/content/code use the same catalogue ids, theme tokens,\n * sizes, and projected CSS variables. The marker activates the optional role\n * stylesheet and survives CSS import reordering.\n */\nexport function applyAppearanceFontSettings(\n root: Pick<HTMLElement, 'removeAttribute' | 'setAttribute' | 'style'>,\n value: unknown\n): NormalizedAppearanceEditorFontSettings {\n const normalized = normalizeAppearanceEditorFontSettings(value)\n const { settings } = normalized\n\n root.removeAttribute('data-font')\n root.setAttribute('data-font-settings', '')\n for (const axis of APPEARANCE_EDITOR_FONT_AXES) {\n const projection = fontAxisProjection[axis]\n const setting = settings[axis]\n const option = fontOptionsById[setting.family]\n if (setting.family === 'system') root.removeAttribute(projection.familyAttribute)\n else root.setAttribute(projection.familyAttribute, setting.family)\n root.style.setProperty(projection.familyProperty, `var(${option.familyVariables[axis]})`)\n root.style.setProperty(projection.sizeProperty, String(setting.size) + 'px')\n root.style.setProperty(projection.scaleProperty, String(setting.size / projection.defaultSize))\n if (axis === 'ui') {\n root.style.setProperty('--ui-tracking', option.uiTracking)\n root.style.setProperty('--ui-word-spacing', option.uiWordSpacing)\n }\n }\n\n return normalized\n}\n\n/**\n * Generate a safe inline prepaint script for a host-owned appearance record.\n *\n * The stored object is read from `localStorage[storageKey].fonts`. A legacy\n * top-level `font` family migrates into UI only; content/code use the shared\n * defaults. The script applies the same catalogue whitelist, limits, attributes,\n * and CSS properties as `applyAppearanceFontSettings` before styles paint. When\n * `persistedVersion` is supplied, only a record with that exact top-level version\n * is used; absent or mismatched records receive the System defaults.\n */\nexport function fontSettingsBootstrapScript(storageKey: string, persistedVersion?: number): string {\n if (persistedVersion !== undefined && !Number.isSafeInteger(persistedVersion)) {\n throw new RangeError('persistedVersion must be a safe integer')\n }\n const axisConfig = JSON.stringify(fontAxisProjection)\n const fontProjection = JSON.stringify(fontProjectionById)\n const fontIds = `[${fontOptions.map((option) => safeScriptStringLiteral(option.id)).join(',')}]`\n const persistedVersionGuard =\n persistedVersion === undefined\n ? ''\n : `&&parsed.version===Number(${safeScriptStringLiteral(String(persistedVersion))})`\n\n return `(function(){var r=document.documentElement;var axes=JSON.parse(${safeScriptStringLiteral(axisConfig)});var projection=JSON.parse(${safeScriptStringLiteral(fontProjection)});var ids=${fontIds};var has=function(v,k){return Object.prototype.hasOwnProperty.call(v,k)};var record=function(v){return typeof v==='object'&&v!==null&&!Array.isArray(v)};var p={};try{var raw=localStorage.getItem(${safeScriptStringLiteral(storageKey)});var parsed=raw?JSON.parse(raw):{};if(record(parsed)${persistedVersionGuard})p=parsed;}catch(e){}var saved=record(p.fonts)?p.fonts:{};var valid=function(v,d){return ids.indexOf(v)!==-1?v:d};var size=function(v,d){var n=typeof v==='number'?v:typeof v==='string'&&v.trim()!==''?Number(v):NaN;return Number.isFinite(n)?Math.min(${APPEARANCE_EDITOR_FONT_SIZE_MAX},Math.max(${APPEARANCE_EDITOR_FONT_SIZE_MIN},Math.round(n))):d};r.setAttribute('data-font-settings','');for(var axis in axes){if(!has(axes,axis))continue;var spec=axes[axis];var candidate=saved[axis];var value=record(candidate)?candidate:{};var legacyUi=axis==='ui'&&!has(value,'family');var family=legacyUi?valid(p.font,'system'):valid(value.family,'system');var font=projection[family];if(family==='system')r.removeAttribute(spec.familyAttribute);else r.setAttribute(spec.familyAttribute,family);r.style.setProperty(spec.familyProperty,'var('+font.familyVariables[axis]+')');var px=size(value.size,spec.defaultSize);r.style.setProperty(spec.sizeProperty,px+'px');r.style.setProperty(spec.scaleProperty,String(px/spec.defaultSize));if(axis==='ui'){r.style.setProperty('--ui-tracking',font.uiTracking);r.style.setProperty('--ui-word-spacing',font.uiWordSpacing);}}r.removeAttribute('data-font');})();`\n}\n"],"mappings":";;;AAGA,IAAa,8BAA8B;CAAC;CAAM;CAAW;AAAM;AAiBnE,IAAa,kCAAkC;AAC/C,IAAa,kCAAkC;;AAG/C,IAAa,0CAAwE,OAAO,OAAO;CACjG,IAAI,OAAO,OAAO;EAAE,QAAQ;EAAU,MAAM;CAAG,CAAC;CAChD,SAAS,OAAO,OAAO;EAAE,QAAQ;EAAU,MAAM;CAAG,CAAC;CACrD,MAAM,OAAO,OAAO;EAAE,QAAQ;EAAU,MAAM;CAAG,CAAC;AACpD,CAAC;AAQD,IAAM,gB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c,EAAE,YAAY,QAAQ,qMAAqM,wBAAwB,UAAU,EAAE,uDAAuD,sBAAsB;AAC/f"}
1
+ {"version":3,"file":"appearance-font-settings.js","names":[],"sources":["../../src/lib/appearance-font-settings.ts"],"sourcesContent":["import { fontOptions, type FontOption } from '#lib/font-catalog'\nimport { safeScriptStringLiteral } from '#lib/safe-script'\n\nexport const APPEARANCE_EDITOR_FONT_AXES = ['ui', 'content', 'code'] as const\n\nexport type AppearanceEditorFontAxis = (typeof APPEARANCE_EDITOR_FONT_AXES)[number]\nexport type AppearanceEditorFontFamilyId = FontOption['id']\n\nexport type AppearanceEditorFontSetting = Readonly<{\n /** A stable id from the shared font catalogue, never a CSS family string. */\n family: AppearanceEditorFontFamilyId\n /** A pixel size, normalized to the supported range. */\n size: number\n}>\n\n/** The host-owned choices edited by the shared appearance composition. */\nexport type AppearanceEditorFontSettings = Readonly<\n Record<AppearanceEditorFontAxis, AppearanceEditorFontSetting>\n>\n\nexport const APPEARANCE_EDITOR_FONT_SIZE_MIN = 10\nexport const APPEARANCE_EDITOR_FONT_SIZE_MAX = 32\n\n/** New preferences use the platform face in each text role. */\nexport const DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS: AppearanceEditorFontSettings = Object.freeze({\n ui: Object.freeze({ family: 'system', size: 14 }),\n content: Object.freeze({ family: 'system', size: 14 }),\n code: Object.freeze({ family: 'system', size: 12 }),\n})\n\nexport type NormalizedAppearanceEditorFontSettings = Readonly<{\n settings: AppearanceEditorFontSettings\n /** Axes whose persisted family or size was unavailable or outside its limits. */\n recoveredAxes: readonly AppearanceEditorFontAxis[]\n}>\n\nconst fontProjectionById = Object.freeze(\n Object.fromEntries(\n fontOptions.map((option) => [\n option.id,\n {\n familyVariables: option.familyVariables,\n uiTracking: option.uiTracking,\n uiWordSpacing: option.uiWordSpacing,\n },\n ])\n ) as Record<\n AppearanceEditorFontFamilyId,\n Pick<FontOption, 'familyVariables' | 'uiTracking' | 'uiWordSpacing'>\n >\n)\nconst fontAxisProjection = Object.freeze({\n ui: Object.freeze({\n familyAttribute: 'data-ui-font',\n familyProperty: '--font-ui',\n sizeProperty: '--font-ui-size',\n scaleProperty: '--font-ui-scale',\n defaultSize: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS.ui.size,\n }),\n content: Object.freeze({\n familyAttribute: 'data-content-font',\n familyProperty: '--font-content',\n sizeProperty: '--font-content-size',\n scaleProperty: '--font-content-scale',\n defaultSize: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS.content.size,\n }),\n code: Object.freeze({\n familyAttribute: 'data-code-font',\n familyProperty: '--font-code',\n sizeProperty: '--font-code-size',\n scaleProperty: '--font-code-scale',\n defaultSize: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS.code.size,\n }),\n})\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction hasOwn(value: Record<string, unknown>, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(value, key)\n}\n\nfunction normalizeFamily(value: unknown): AppearanceEditorFontFamilyId | undefined {\n return typeof value === 'string' && hasOwn(fontProjectionById, value)\n ? (value as AppearanceEditorFontFamilyId)\n : undefined\n}\n\nfunction clampFontSize(value: number): number {\n return Math.min(\n APPEARANCE_EDITOR_FONT_SIZE_MAX,\n Math.max(APPEARANCE_EDITOR_FONT_SIZE_MIN, Math.round(value))\n )\n}\n\n/** Normalize a single number-input value; invalid edits return the current size. */\nexport function normalizeAppearanceEditorFontSize(value: unknown, fallback: number): number {\n const parsed =\n typeof value === 'number'\n ? value\n : typeof value === 'string' && value.trim() !== ''\n ? Number(value)\n : Number.NaN\n return Number.isFinite(parsed) ? clampFontSize(parsed) : clampFontSize(fallback)\n}\n\n/**\n * Recover persisted font choices against the shared font catalogue.\n *\n * `legacyUiFamily` lets a host migrate its previous single font field into the\n * UI axis. Content and code remain on the new System defaults during that\n * migration. Missing settings are ordinary defaults; an unknown saved id or an\n * invalid size is reported through `recoveredAxes` for the host's notice.\n */\nexport function normalizeAppearanceEditorFontSettings(\n value: unknown,\n legacyUiFamily?: unknown\n): NormalizedAppearanceEditorFontSettings {\n const source = isRecord(value) ? value : undefined\n const malformedRoot = value !== undefined && value !== null && source === undefined\n const recovered = new Set<AppearanceEditorFontAxis>()\n const settings = {} as Record<AppearanceEditorFontAxis, AppearanceEditorFontSetting>\n\n for (const axis of APPEARANCE_EDITOR_FONT_AXES) {\n const axisPresent = source ? hasOwn(source, axis) : false\n const axisValue = source?.[axis]\n const axisSource = isRecord(axisValue) ? axisValue : undefined\n const fallback = DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS[axis]\n\n if (malformedRoot || (axisPresent && axisSource === undefined)) recovered.add(axis)\n\n const hasFamily = axisSource ? hasOwn(axisSource, 'family') : false\n const familyInput = hasFamily\n ? axisSource?.['family']\n : axis === 'ui' && legacyUiFamily !== undefined\n ? legacyUiFamily\n : undefined\n const family = normalizeFamily(familyInput) ?? fallback.family\n if (\n (hasFamily || (axis === 'ui' && legacyUiFamily !== undefined)) &&\n !normalizeFamily(familyInput)\n ) {\n recovered.add(axis)\n }\n\n const hasSize = axisSource ? hasOwn(axisSource, 'size') : false\n const sizeInput = axisSource?.['size']\n const size = hasSize\n ? normalizeAppearanceEditorFontSize(sizeInput, fallback.size)\n : fallback.size\n if (\n hasSize &&\n (typeof sizeInput !== 'number' || !Number.isFinite(sizeInput) || sizeInput !== size)\n ) {\n recovered.add(axis)\n }\n\n settings[axis] = Object.freeze({ family, size })\n }\n\n return Object.freeze({\n settings: Object.freeze(settings),\n recoveredAxes: Object.freeze(APPEARANCE_EDITOR_FONT_AXES.filter((axis) => recovered.has(axis))),\n })\n}\n\n/**\n * Project normalized font preferences onto a document root.\n *\n * This is shared by `ThemeProvider` and hosts that own their own appearance\n * persistence, so UI/content/code use the same catalogue ids, theme tokens,\n * sizes, and projected CSS variables. The marker activates the optional role\n * stylesheet and survives CSS import reordering.\n */\nexport function applyAppearanceFontSettings(\n root: Pick<HTMLElement, 'removeAttribute' | 'setAttribute' | 'style'>,\n value: unknown\n): NormalizedAppearanceEditorFontSettings {\n const normalized = normalizeAppearanceEditorFontSettings(value)\n const { settings } = normalized\n\n root.removeAttribute('data-font')\n root.setAttribute('data-font-settings', '')\n for (const axis of APPEARANCE_EDITOR_FONT_AXES) {\n const projection = fontAxisProjection[axis]\n const setting = settings[axis]\n const option = fontProjectionById[setting.family]\n if (setting.family === 'system') root.removeAttribute(projection.familyAttribute)\n else root.setAttribute(projection.familyAttribute, setting.family)\n root.style.setProperty(projection.familyProperty, `var(${option.familyVariables[axis]})`)\n root.style.setProperty(projection.sizeProperty, String(setting.size) + 'px')\n root.style.setProperty(projection.scaleProperty, String(setting.size / projection.defaultSize))\n if (axis === 'ui') {\n root.style.setProperty('--ui-tracking', option.uiTracking)\n root.style.setProperty('--ui-word-spacing', option.uiWordSpacing)\n }\n }\n\n return normalized\n}\n\n/**\n * Generate a safe inline prepaint script for a host-owned appearance record.\n *\n * The stored object is read from `localStorage[storageKey].fonts`. A legacy\n * top-level `font` family migrates into UI only; content/code use the shared\n * defaults. The script applies the same catalogue whitelist, limits, attributes,\n * and CSS properties as `applyAppearanceFontSettings` before styles paint. When\n * `persistedVersion` is supplied, only a record with that exact top-level version\n * is used; absent or mismatched records receive the System defaults.\n */\nexport function fontSettingsBootstrapScript(storageKey: string, persistedVersion?: number): string {\n if (persistedVersion !== undefined && !Number.isSafeInteger(persistedVersion)) {\n throw new RangeError('persistedVersion must be a safe integer')\n }\n const axisConfig = JSON.stringify(fontAxisProjection)\n const fontProjection = JSON.stringify(fontProjectionById)\n const fontIds = `[${fontOptions.map((option) => safeScriptStringLiteral(option.id)).join(',')}]`\n const persistedVersionGuard =\n persistedVersion === undefined\n ? ''\n : `&&parsed.version===Number(${safeScriptStringLiteral(String(persistedVersion))})`\n\n return `(function(){var r=document.documentElement;var axes=JSON.parse(${safeScriptStringLiteral(axisConfig)});var projection=JSON.parse(${safeScriptStringLiteral(fontProjection)});var ids=${fontIds};var has=function(v,k){return Object.prototype.hasOwnProperty.call(v,k)};var record=function(v){return typeof v==='object'&&v!==null&&!Array.isArray(v)};var p={};try{var raw=localStorage.getItem(${safeScriptStringLiteral(storageKey)});var parsed=raw?JSON.parse(raw):{};if(record(parsed)${persistedVersionGuard})p=parsed;}catch(e){}var saved=record(p.fonts)?p.fonts:{};var valid=function(v,d){return ids.indexOf(v)!==-1?v:d};var size=function(v,d){var n=typeof v==='number'?v:typeof v==='string'&&v.trim()!==''?Number(v):NaN;return Number.isFinite(n)?Math.min(${APPEARANCE_EDITOR_FONT_SIZE_MAX},Math.max(${APPEARANCE_EDITOR_FONT_SIZE_MIN},Math.round(n))):d};r.setAttribute('data-font-settings','');for(var axis in axes){if(!has(axes,axis))continue;var spec=axes[axis];var candidate=saved[axis];var value=record(candidate)?candidate:{};var legacyUi=axis==='ui'&&!has(value,'family');var family=legacyUi?valid(p.font,'system'):valid(value.family,'system');var font=projection[family];if(family==='system')r.removeAttribute(spec.familyAttribute);else r.setAttribute(spec.familyAttribute,family);r.style.setProperty(spec.familyProperty,'var('+font.familyVariables[axis]+')');var px=size(value.size,spec.defaultSize);r.style.setProperty(spec.sizeProperty,px+'px');r.style.setProperty(spec.scaleProperty,String(px/spec.defaultSize));if(axis==='ui'){r.style.setProperty('--ui-tracking',font.uiTracking);r.style.setProperty('--ui-word-spacing',font.uiWordSpacing);}}r.removeAttribute('data-font');})();`\n}\n"],"mappings":";;;AAGA,IAAa,8BAA8B;CAAC;CAAM;CAAW;AAAM;AAiBnE,IAAa,kCAAkC;AAC/C,IAAa,kCAAkC;;AAG/C,IAAa,0CAAwE,OAAO,OAAO;CACjG,IAAI,OAAO,OAAO;EAAE,QAAQ;EAAU,MAAM;CAAG,CAAC;CAChD,SAAS,OAAO,OAAO;EAAE,QAAQ;EAAU,MAAM;CAAG,CAAC;CACrD,MAAM,OAAO,OAAO;EAAE,QAAQ;EAAU,MAAM;CAAG,CAAC;AACpD,CAAC;AAQD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themes@^0.10.10",
7
+ "@adea-ai/themes@^0.11.2",
8
8
  "@kobalte/core@^0.13.14",
9
9
  "lucide-solid@^1.51.0"
10
10
  ],
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.10.10",
7
+ "@adea-ai/themes@^0.11.2",
8
8
  "class-variance-authority@^0.7.1",
9
9
  "cn@^0.4.0"
10
10
  ],
@@ -2298,7 +2298,7 @@
2298
2298
  "title": "Appearance Editor",
2299
2299
  "description": "",
2300
2300
  "dependencies": [
2301
- "@adea-ai/themes@^0.10.10",
2301
+ "@adea-ai/themes@^0.11.2",
2302
2302
  "@kobalte/core@^0.13.14",
2303
2303
  "lucide-solid@^1.51.0"
2304
2304
  ],
@@ -3458,7 +3458,7 @@
3458
3458
  "title": "Theming",
3459
3459
  "description": "",
3460
3460
  "dependencies": [
3461
- "@adea-ai/themes@^0.10.10",
3461
+ "@adea-ai/themes@^0.11.2",
3462
3462
  "@kobalte/core@^0.13.14",
3463
3463
  "lucide-solid@^1.51.0"
3464
3464
  ],
@@ -3643,7 +3643,7 @@
3643
3643
  "title": "Class-name and token helpers",
3644
3644
  "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.",
3645
3645
  "dependencies": [
3646
- "@adea-ai/themes@^0.10.10",
3646
+ "@adea-ai/themes@^0.11.2",
3647
3647
  "class-variance-authority@^0.7.1",
3648
3648
  "cn@^0.4.0"
3649
3649
  ],
@@ -105,6 +105,9 @@ export function ShellTopBar(props: ShellTopBarProps) {
105
105
  <header
106
106
  data-slot="shell-top-bar"
107
107
  class={cn(
108
+ /* Rows are one pixel short of the top bar height so the bottom border keeps
109
+ the bar at exactly --topbar-height, like the shared TopBar: docked
110
+ panels and sidebar headers measure from that edge. */
108
111
  '@container/shell-top-bar relative z-(--z-sticky) flex min-h-topbar shrink-0 flex-wrap items-center border-b border-border bg-card text-card-foreground',
109
112
  local.glass && 'glass-panel',
110
113
  local.draggable && 'window-drag',
@@ -128,7 +131,7 @@ export function ShellTopBar(props: ShellTopBarProps) {
128
131
  data-slot="shell-top-bar-leading"
129
132
  data-sidebar-open={local.sidebarOpen ? 'true' : 'false'}
130
133
  class={cn(
131
- 'window-no-drag flex min-h-topbar max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',
134
+ 'window-no-drag flex min-h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',
132
135
  /* Wide and open: span the rail and the sidebar so the divider lands on
133
136
  the sidebar's edge. The sidebar's own border is the 1px the divider
134
137
  overlaps, so no extra allowance is needed. */
@@ -161,7 +164,7 @@ export function ShellTopBar(props: ShellTopBarProps) {
161
164
  <Show when={breadcrumb()}>
162
165
  <div
163
166
  data-slot="shell-top-bar-breadcrumb"
164
- class="window-no-drag flex h-topbar min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag"
167
+ class="window-no-drag flex h-[calc(var(--topbar-height)-1px)] min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag"
165
168
  >
166
169
  {breadcrumb()}
167
170
  </div>
@@ -180,7 +183,7 @@ export function ShellTopBar(props: ShellTopBarProps) {
180
183
  <Show when={actions()}>
181
184
  <div
182
185
  data-slot="shell-top-bar-actions"
183
- class="window-no-drag flex h-topbar max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5"
186
+ class="window-no-drag flex h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5"
184
187
  >
185
188
  {actions()}
186
189
  </div>
@@ -34,13 +34,6 @@ export type NormalizedAppearanceEditorFontSettings = Readonly<{
34
34
  recoveredAxes: readonly AppearanceEditorFontAxis[]
35
35
  }>
36
36
 
37
- const fontFamilyIds: ReadonlySet<string> = new Set(fontOptions.map((option) => option.id))
38
- const fontOptionsById = Object.freeze(
39
- Object.fromEntries(fontOptions.map((option) => [option.id, option])) as Record<
40
- AppearanceEditorFontFamilyId,
41
- FontOption
42
- >
43
- )
44
37
  const fontProjectionById = Object.freeze(
45
38
  Object.fromEntries(
46
39
  fontOptions.map((option) => [
@@ -89,7 +82,7 @@ function hasOwn(value: Record<string, unknown>, key: string): boolean {
89
82
  }
90
83
 
91
84
  function normalizeFamily(value: unknown): AppearanceEditorFontFamilyId | undefined {
92
- return typeof value === 'string' && fontFamilyIds.has(value)
85
+ return typeof value === 'string' && hasOwn(fontProjectionById, value)
93
86
  ? (value as AppearanceEditorFontFamilyId)
94
87
  : undefined
95
88
  }
@@ -192,7 +185,7 @@ export function applyAppearanceFontSettings(
192
185
  for (const axis of APPEARANCE_EDITOR_FONT_AXES) {
193
186
  const projection = fontAxisProjection[axis]
194
187
  const setting = settings[axis]
195
- const option = fontOptionsById[setting.family]
188
+ const option = fontProjectionById[setting.family]
196
189
  if (setting.family === 'system') root.removeAttribute(projection.familyAttribute)
197
190
  else root.setAttribute(projection.familyAttribute, setting.family)
198
191
  root.style.setProperty(projection.familyProperty, `var(${option.familyVariables[axis]})`)
@@ -4,7 +4,7 @@
4
4
  "title": "Theming",
5
5
  "description": "",
6
6
  "dependencies": [
7
- "@adea-ai/themes@^0.10.10",
7
+ "@adea-ai/themes@^0.11.2",
8
8
  "@kobalte/core@^0.13.14",
9
9
  "lucide-solid@^1.51.0"
10
10
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.147.10",
3
+ "version": "0.147.12",
4
4
  "description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
5
5
  "keywords": [
6
6
  "adea",
@@ -145,7 +145,7 @@
145
145
  "check:packed-paste-model": "node scripts/check-packed-paste-model.mjs"
146
146
  },
147
147
  "dependencies": {
148
- "@adea-ai/themes": "^0.10.10",
148
+ "@adea-ai/themes": "^0.11.2",
149
149
  "@corvu/calendar": "^0.1.2",
150
150
  "@corvu/drawer": "^0.2.4",
151
151
  "@corvu/otp-field": "^0.1.4",
package/registry.json CHANGED
@@ -2298,7 +2298,7 @@
2298
2298
  "title": "Appearance Editor",
2299
2299
  "description": "",
2300
2300
  "dependencies": [
2301
- "@adea-ai/themes@^0.10.10",
2301
+ "@adea-ai/themes@^0.11.2",
2302
2302
  "@kobalte/core@^0.13.14",
2303
2303
  "lucide-solid@^1.51.0"
2304
2304
  ],
@@ -3458,7 +3458,7 @@
3458
3458
  "title": "Theming",
3459
3459
  "description": "",
3460
3460
  "dependencies": [
3461
- "@adea-ai/themes@^0.10.10",
3461
+ "@adea-ai/themes@^0.11.2",
3462
3462
  "@kobalte/core@^0.13.14",
3463
3463
  "lucide-solid@^1.51.0"
3464
3464
  ],
@@ -3643,7 +3643,7 @@
3643
3643
  "title": "Class-name and token helpers",
3644
3644
  "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.",
3645
3645
  "dependencies": [
3646
- "@adea-ai/themes@^0.10.10",
3646
+ "@adea-ai/themes@^0.11.2",
3647
3647
  "class-variance-authority@^0.7.1",
3648
3648
  "cn@^0.4.0"
3649
3649
  ],
@@ -105,6 +105,9 @@ export function ShellTopBar(props: ShellTopBarProps) {
105
105
  <header
106
106
  data-slot="shell-top-bar"
107
107
  class={cn(
108
+ /* Rows are one pixel short of the top bar height so the bottom border keeps
109
+ the bar at exactly --topbar-height, like the shared TopBar: docked
110
+ panels and sidebar headers measure from that edge. */
108
111
  '@container/shell-top-bar relative z-(--z-sticky) flex min-h-topbar shrink-0 flex-wrap items-center border-b border-border bg-card text-card-foreground',
109
112
  local.glass && 'glass-panel',
110
113
  local.draggable && 'window-drag',
@@ -128,7 +131,7 @@ export function ShellTopBar(props: ShellTopBarProps) {
128
131
  data-slot="shell-top-bar-leading"
129
132
  data-sidebar-open={local.sidebarOpen ? 'true' : 'false'}
130
133
  class={cn(
131
- 'window-no-drag flex min-h-topbar max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',
134
+ 'window-no-drag flex min-h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 pe-3',
132
135
  /* Wide and open: span the rail and the sidebar so the divider lands on
133
136
  the sidebar's edge. The sidebar's own border is the 1px the divider
134
137
  overlaps, so no extra allowance is needed. */
@@ -161,7 +164,7 @@ export function ShellTopBar(props: ShellTopBarProps) {
161
164
  <Show when={breadcrumb()}>
162
165
  <div
163
166
  data-slot="shell-top-bar-breadcrumb"
164
- class="window-no-drag flex h-topbar min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag"
167
+ class="window-no-drag flex h-[calc(var(--topbar-height)-1px)] min-w-0 flex-1 items-center truncate ps-3 text-sm [&_:is(a,button)]:window-no-drag"
165
168
  >
166
169
  {breadcrumb()}
167
170
  </div>
@@ -180,7 +183,7 @@ export function ShellTopBar(props: ShellTopBarProps) {
180
183
  <Show when={actions()}>
181
184
  <div
182
185
  data-slot="shell-top-bar-actions"
183
- class="window-no-drag flex h-topbar max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5"
186
+ class="window-no-drag flex h-[calc(var(--topbar-height)-1px)] max-w-full min-w-0 shrink-0 items-center gap-2 overflow-x-auto overflow-y-hidden ps-1 @max-[34rem]/shell-top-bar:mb-0.5"
184
187
  >
185
188
  {actions()}
186
189
  </div>
@@ -34,13 +34,6 @@ export type NormalizedAppearanceEditorFontSettings = Readonly<{
34
34
  recoveredAxes: readonly AppearanceEditorFontAxis[]
35
35
  }>
36
36
 
37
- const fontFamilyIds: ReadonlySet<string> = new Set(fontOptions.map((option) => option.id))
38
- const fontOptionsById = Object.freeze(
39
- Object.fromEntries(fontOptions.map((option) => [option.id, option])) as Record<
40
- AppearanceEditorFontFamilyId,
41
- FontOption
42
- >
43
- )
44
37
  const fontProjectionById = Object.freeze(
45
38
  Object.fromEntries(
46
39
  fontOptions.map((option) => [
@@ -89,7 +82,7 @@ function hasOwn(value: Record<string, unknown>, key: string): boolean {
89
82
  }
90
83
 
91
84
  function normalizeFamily(value: unknown): AppearanceEditorFontFamilyId | undefined {
92
- return typeof value === 'string' && fontFamilyIds.has(value)
85
+ return typeof value === 'string' && hasOwn(fontProjectionById, value)
93
86
  ? (value as AppearanceEditorFontFamilyId)
94
87
  : undefined
95
88
  }
@@ -192,7 +185,7 @@ export function applyAppearanceFontSettings(
192
185
  for (const axis of APPEARANCE_EDITOR_FONT_AXES) {
193
186
  const projection = fontAxisProjection[axis]
194
187
  const setting = settings[axis]
195
- const option = fontOptionsById[setting.family]
188
+ const option = fontProjectionById[setting.family]
196
189
  if (setting.family === 'system') root.removeAttribute(projection.familyAttribute)
197
190
  else root.setAttribute(projection.familyAttribute, setting.family)
198
191
  root.style.setProperty(projection.familyProperty, `var(${option.familyVariables[axis]})`)