@adea-ai/ui 0.149.7 → 0.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  2. package/dist/components/composites/appearance-editor/appearance-editor.js +2 -1
  3. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  4. package/dist/components/composites/appearance-editor/appearance-rows.js +3 -3
  5. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  6. package/dist/components/composites/appearance-editor/appearance-types.d.ts +7 -0
  7. package/dist/components/composites/appearance-editor/appearance-types.d.ts.map +1 -1
  8. package/dist/components/composites/appearance-editor/index.d.ts +1 -0
  9. package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
  10. package/dist/components/composites/appearance-editor/index.js +2 -1
  11. package/dist/components/composites/settings/settings-layout.d.ts.map +1 -1
  12. package/dist/components/composites/settings/settings-layout.js +1 -1
  13. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  14. package/dist/index.js +3 -2
  15. package/dist/lib/tooltip-focus-gate.d.ts.map +1 -1
  16. package/dist/lib/tooltip-focus-gate.js +3 -2
  17. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  18. package/dist/r/appearance-editor.json +1 -1
  19. package/dist/r/lib.json +1 -1
  20. package/dist/r/registry.json +3 -3
  21. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +9 -2
  22. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +2 -2
  23. package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +7 -0
  24. package/dist/r/src/components/composites/appearance-editor/index.ts +1 -0
  25. package/dist/r/src/components/composites/settings/settings-layout.tsx +4 -1
  26. package/dist/r/src/lib/tooltip-focus-gate.ts +5 -2
  27. package/dist/r/theming.json +1 -1
  28. package/package.json +2 -2
  29. package/registry.json +3 -3
  30. package/src/components/composites/appearance-editor/appearance-editor.tsx +9 -2
  31. package/src/components/composites/appearance-editor/appearance-rows.tsx +2 -2
  32. package/src/components/composites/appearance-editor/appearance-types.ts +7 -0
  33. package/src/components/composites/appearance-editor/index.ts +1 -0
  34. package/src/components/composites/settings/settings-layout.tsx +4 -1
  35. package/src/lib/tooltip-focus-gate.ts +5 -2
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-editor.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAIvF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,kCAuJ5D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,kCA6CnE;AAED;;4EAE4E;AAC5E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCAsC9D"}
1
+ {"version":3,"file":"appearance-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-editor.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAIvF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,kCA8J5D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,kCA6CnE;AAED;;4EAE4E;AAC5E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCAsC9D"}
@@ -16,7 +16,7 @@ var _tmpl$ = /*#__PURE__*/ template(`<p role=status class="px-4 py-2 text-sm tex
16
16
  var _tmpl$2 = /*#__PURE__*/ template(`<p role=alert class="mt-1 text-xs text-foreground">`);
17
17
  var _tmpl$3 = /*#__PURE__*/ template(`<div class="px-4 py-3"><label class="mb-2 block text-xs font-medium">Custom accent`);
18
18
  var _tmpl$4 = /*#__PURE__*/ template(`<p role=status class="px-4 py-2 text-xs text-muted-foreground">`);
19
- var _tmpl$5 = /*#__PURE__*/ template(`<div class="sticky bottom-0 z-10 mt-2 border-t bg-background px-4 py-3">`);
19
+ var _tmpl$5 = /*#__PURE__*/ template(`<div class="sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3">`);
20
20
  var _tmpl$6 = /*#__PURE__*/ template(`<div data-appearance-editor><div class="divide-y divide-border rounded-lg border">`);
21
21
  var _tmpl$7 = /*#__PURE__*/ template(`<p role=status class="text-xs text-muted-foreground">`);
22
22
  var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex w-full flex-col gap-2"><div class="global-appearance-editor-actions flex flex-wrap items-center gap-2"><div class="ml-auto flex gap-2">`);
@@ -256,6 +256,7 @@ function AppearanceEditor(props) {
256
256
  });
257
257
  }
258
258
  }), null);
259
+ insert(_el$3, () => props.extraRows, null);
259
260
  insert(_el$, createComponent(Show, {
260
261
  get when() {
261
262
  return !props.hideActions;
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-editor.js","names":["EyeOff","Palette","PanelsTopLeft","SlidersHorizontal","Show","createSignal","createUniqueId","cn","ActionButton","Button","Input","AppearanceFontSettingsGroup","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","Switch","Sheet","SheetBody","SheetContent","SheetDescription","SheetFooter","SheetHeader","SheetTitle","SheetTrigger","AppearanceEditorProps","AppearancePopoverProps","ModeChoices","AccentChoices","GlassChoices","isCustomAccent","SettingsRow","TerminalRow","ThemeRow","AppearanceEditor","props","errorId","custom","accentDescription","draft","accent","preset","accentOptions","find","option","id","label","offered","themeAccentOptions","toLowerCase","glassDescription","surface","surfaceCapability","themeDefaultDescription","_el$","_tmpl$6","_el$3","firstChild","_$insert","_$createComponent","when","recoveryNotice","children","_el$2","_tmpl$","appearance","selectedId","lightThemeId","preview","lightTheme","themes","disabled","saving","onSelect","onChange","darkThemeId","darkTheme","terminalThemeId","undefined","_$memo","resolvedAppearance","title","icon","description","_el$4","_tmpl$3","_el$5","_$setAttribute","value","aria-invalid","customAccentError","aria-describedby","onInput","event","currentTarget","_el$6","_tmpl$2","fontSettingsPlacement","settings","fonts","menuPortalMount","frosted","reason","_el$7","_tmpl$4","checked","reduceTransparency","onManageThemes","type","size","variant","onClick","hideActions","_el$8","_tmpl$5","AppearanceEditorActions","_$effect","_$className","class","saveReasonId","_el$9","_tmpl$8","_el$1","_el$10","saveDisabledReason","_el$0","_tmpl$7","onReset","onCancel","aria-busy","onSave","AppearancePopover","setMenuPortalMount","HTMLElement","open","onOpenChange","onOpen","onDismiss","as","triggerVariant","tooltip","tooltipIcon","side","closeLabel","ref","_$mergeProps","_$createComponent","_$memo","Switch","_$className","_$mergeProps"],"sources":["../../../../src/components/composites/appearance-editor/appearance-editor.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/*\n * Composition substantially translated from Zeron settings/appearance.rs and\n * settings/widgets.rs, pinned at 30a9a9537c5ec96226c87f4bf349b6f77c5dfb59,\n * preserving Adea's existing appearance-surface.tsx port: System/Light/Dark\n * miniatures, compact independent theme rows, accent swatches and helper copy,\n * glass chips, and theme library affordance. Kobalte replaces the port's manual\n * radio keyboard model. The controlled draft and explicit action ports replace\n * GPUI globals and app-specific storage/native authority. Save/Cancel/Reset and\n * custom accent/reduced-transparency are accepted Adea divergences (#425).\n */\nimport { EyeOff, Palette, PanelsTopLeft, SlidersHorizontal } from 'lucide-solid'\nimport { Show, createSignal, createUniqueId } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../action-button'\nimport { Button } from '../../ui/button/button'\nimport { Input } from '../../ui/input/input'\nimport { AppearanceFontSettingsGroup } from './font-settings-group'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\n\nimport { Switch } from '../../ui/switch/switch'\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from '../../ui/sheet/sheet'\nimport type { AppearanceEditorProps, AppearancePopoverProps } from './appearance-types'\nimport { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'\nimport { SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'\n\n/**\n * A live editor whose persistence and preview authority belong to its host.\n * No ThemeProvider is required, and no catalogue, renderer engine or storage is\n * imported. Hosts normalize unknown IDs and custom colors, report recovery,\n * snapshot on open, preview on changes, commit on Save, and restore on dismissal.\n * Both theme rows remain mounted when mode changes. Density remains outside the\n * accepted appearance surface; typeface settings are shared and host-persisted.\n */\nexport function AppearanceEditor(props: AppearanceEditorProps) {\n const errorId = createUniqueId()\n const custom = () => isCustomAccent(props)\n const accentDescription = () => {\n if (props.draft.accent === 'theme') return \"Theme default · Uses the palette's intended color.\"\n const preset = props.accentOptions.find((option) => option.id === props.draft.accent)\n if (preset) return `${preset.label} · Controls, glyphs, selections, code, and activity.`\n if (custom()) return 'Custom · Controls, glyphs, selections, code, and activity.'\n const offered = props.themeAccentOptions?.find((option) => option.id === props.draft.accent)\n // A stored theme accent survives a theme switch by id; when the new pair\n // cannot offer that slot the host falls back to the theme's own primary,\n // and the description says so rather than naming a colour not on screen.\n return offered\n ? `Theme ${offered.label.toLowerCase()} · The theme's own color, on controls and activity.`\n : \"Theme default · This theme does not carry that accent, so it uses the palette's intended color.\"\n }\n const glassDescription = () =>\n props.draft.surface === 'opaque'\n ? 'Solid surfaces for every theme.'\n : props.draft.surface === 'frosted'\n ? 'Theme-colored glass where supported.'\n : (props.surfaceCapability.themeDefaultDescription ?? \"Uses this theme's default surface.\")\n return (\n <div data-appearance-editor class={cn('min-w-0', props.class)}>\n <Show when={props.recoveryNotice}>\n <p role=\"status\" class=\"px-4 py-2 text-sm text-muted-foreground\">\n {props.recoveryNotice}\n </p>\n </Show>\n <ModeChoices {...props} />\n <div class=\"divide-y divide-border rounded-lg border\">\n <ThemeRow\n appearance=\"light\"\n selectedId={props.draft.lightThemeId}\n preview={props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(lightThemeId) => props.onChange({ lightThemeId })}\n />\n <ThemeRow\n appearance=\"dark\"\n selectedId={props.draft.darkThemeId}\n preview={props.darkTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(darkThemeId) => props.onChange({ darkThemeId })}\n />\n {/* The row exists only when the host carries a terminal preference:\n the draft field is the show/hide switch, so the editor can never\n render a terminal row that writes nothing. */}\n <Show when={props.draft.terminalThemeId !== undefined}>\n <TerminalRow\n selectedId={props.draft.terminalThemeId ?? 'theme'}\n preview={props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(terminalThemeId) => props.onChange({ terminalThemeId })}\n />\n </Show>\n <SettingsRow title=\"Accent\" icon={<SlidersHorizontal />} description={accentDescription()}>\n <AccentChoices {...props} />\n </SettingsRow>\n <Show when={custom()}>\n <div class=\"px-4 py-3\">\n <label class=\"mb-2 block text-xs font-medium\" for={`${errorId}-input`}>\n Custom accent\n </label>\n <Input\n id={`${errorId}-input`}\n value={props.draft.accent}\n disabled={props.saving}\n aria-invalid={!!props.customAccentError}\n aria-describedby={props.customAccentError ? errorId : undefined}\n onInput={(event) => props.onChange({ accent: event.currentTarget.value })}\n />\n <Show when={props.customAccentError}>\n <p id={errorId} role=\"alert\" class=\"mt-1 text-xs text-foreground\">\n {props.customAccentError}\n </p>\n </Show>\n </div>\n </Show>\n {/* Inline, the typefaces read as one more palette choice; `end` hands\n the closing slot to them for hosts whose order is palette and\n surface first, text last. */}\n <Show when={props.fontSettingsPlacement !== 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n <SettingsRow title=\"Glass\" icon={<PanelsTopLeft />} description={glassDescription()}>\n <GlassChoices {...props} />\n </SettingsRow>\n <Show when={!props.surfaceCapability.frosted && props.surfaceCapability.reason}>\n <p role=\"status\" class=\"px-4 py-2 text-xs text-muted-foreground\">\n {props.surfaceCapability.reason}\n </p>\n </Show>\n <SettingsRow\n title=\"Reduce transparency\"\n icon={<EyeOff />}\n description=\"Prefer solid surfaces, including during live preview.\"\n >\n <Switch\n checked={props.draft.reduceTransparency}\n disabled={props.saving}\n onChange={(reduceTransparency: boolean) => props.onChange({ reduceTransparency })}\n aria-label=\"Reduce transparency\"\n />\n </SettingsRow>\n <SettingsRow\n title=\"Theme library\"\n icon={<Palette />}\n description={\n props.onManageThemes\n ? 'Manage themes through the application.'\n : 'Theme import is unavailable.'\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!props.onManageThemes || props.saving}\n onClick={() => props.onManageThemes?.()}\n >\n Manage themes\n </Button>\n </SettingsRow>\n <Show when={props.fontSettingsPlacement === 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n </div>\n <Show when={!props.hideActions}>\n {/* Sticky so Save/Cancel stay reachable in a tall scroll container: the\n editor scrolls with its host panel, and actions parked at the bottom\n of a long form were unreachable without scrolling past every row. */}\n <div class=\"sticky bottom-0 z-10 mt-2 border-t bg-background px-4 py-3\">\n <AppearanceEditorActions {...props} />\n </div>\n </Show>\n </div>\n )\n}\n\n/**\n * Reset, Cancel and Save, with the reason Save is unavailable. Rendered by the\n * editor itself, or — with `hideActions` — by a host that pins them in its own\n * footer, as `AppearancePopover` does.\n */\nexport function AppearanceEditorActions(props: AppearanceEditorProps) {\n const saveReasonId = createUniqueId()\n return (\n <div class=\"flex w-full flex-col gap-2\">\n <Show when={props.saveDisabledReason}>\n <p id={saveReasonId} role=\"status\" class=\"text-xs text-muted-foreground\">\n {props.saveDisabledReason}\n </p>\n </Show>\n {/* `global-appearance-editor-actions` lets these buttons grow with the UI\n font preference, like the rest of Appearance's own controls. */}\n <div class=\"global-appearance-editor-actions flex flex-wrap items-center gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n disabled={props.saving}\n onClick={() => props.onReset()}\n >\n Reset\n </Button>\n <div class=\"ml-auto flex gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={props.saving}\n onClick={() => props.onCancel()}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={props.saving || !!props.customAccentError || !!props.saveDisabledReason}\n aria-busy={props.saving}\n aria-describedby={props.saveDisabledReason ? saveReasonId : undefined}\n onClick={() => props.onSave()}\n >\n {props.saving ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n\n/** The editor in an inset Sheet docked beside the main view: the body scrolls and\n * Reset/Cancel/Save sit in the panel's full-width footer, always reachable.\n * Dismissal (Escape, the close button, an outside click) is `onDismiss`. */\nexport function AppearancePopover(props: AppearancePopoverProps) {\n const [menuPortalMount, setMenuPortalMount] = createSignal<HTMLElement>()\n\n return (\n <Sheet open={props.open} onOpenChange={(open) => (open ? props.onOpen() : props.onDismiss())}>\n {/* The trigger is an icon-only action, so it explains itself through the\n shared ActionButton's tooltip (keyboard focus included) rather than a\n bare aria-label. `toolbar` also holds the pressed rung while Kobalte\n marks the trigger `data-expanded`, and repeats the glyph in the\n tooltip like the other toolbar actions. */}\n <SheetTrigger\n as={ActionButton}\n variant={props.triggerVariant === 'toolbar' ? 'toolbar' : 'ghost'}\n size=\"icon-sm\"\n tooltip=\"Open appearance settings\"\n tooltipIcon={\n props.triggerVariant === 'toolbar' ? <Palette aria-hidden=\"true\" /> : undefined\n }\n aria-label=\"Appearance settings\"\n >\n <Palette />\n </SheetTrigger>\n <SheetContent side=\"end\" closeLabel=\"Close appearance settings\" ref={setMenuPortalMount}>\n <SheetHeader>\n <SheetTitle>Appearance</SheetTitle>\n <SheetDescription>\n Changes preview immediately. Save keeps them; Cancel restores the previous appearance.\n </SheetDescription>\n </SheetHeader>\n <SheetBody>\n <AppearanceEditor {...props} menuPortalMount={menuPortalMount()} hideActions />\n </SheetBody>\n <SheetFooter>\n <AppearanceEditorActions {...props} />\n </SheetFooter>\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,SAAgB+B,iBAAiBC,OAA8B;CAC7D,MAAMC,UAAU3B,eAAe;CAC/B,MAAM4B,eAAeP,eAAeK,KAAK;CACzC,MAAMG,0BAA0B;EAC9B,IAAIH,MAAMI,MAAMC,WAAW,SAAS,OAAO;EAC3C,MAAMC,SAASN,MAAMO,cAAcC,MAAMC,WAAWA,OA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,cAAW;KAAA,OACT9D,WAAA5C,MAAMwG,mBAAmB,SAAS,CAAA,CAAA,IAAAhF,gBAAIvD,SAAO,EAAA,eAAA,OAAA,CAAA,IAAyB0E,KAAAA;IAAS;IAAA,cAAA;IAAA,IAAAhB,WAAA;KAAA,OAAAH,gBAIhFvD,SAAO,CAAA,CAAA;IAAA;GAAA,CAAA,GAAAuD,gBAETxC,cAAY;IAAC2H,MAAI;IAAOC,YAAU;IAAAC,KAAkCZ;IAAkB,IAAAtE,WAAA;KAAA,OAAA;MAAAH,gBACpFrC,aAAW,EAAA,IAAAwC,WAAA;OAAA,OAAA,CAAAH,gBACTpC,YAAU,EAAAuC,UAAA,aAAA,CAAA,GAAAH,gBACVvC,kBAAgB,EAAA0C,UAAA,yFAAA,CAAA,CAAA;MAAA,EAAA,CAAA;MAAAH,gBAIlBzC,WAAS,EAAA,IAAA4C,WAAA;OAAA,OAAAH,gBACPzB,kBAAgB+G,WAAK9G,OAAK;QAAA,IAAEiE,kBAAe;SAAA,OAAEA,gBAAgB;QAAC;QAAEY,aAAW;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;MAAArD,gBAE7EtC,aAAW,EAAA,IAAAyC,WAAA;OAAA,OAAAH,gBACTwD,yBAA4BhF,KAAK;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAK5C"}
1
+ {"version":3,"file":"appearance-editor.js","names":["EyeOff","Palette","PanelsTopLeft","SlidersHorizontal","Show","createSignal","createUniqueId","cn","ActionButton","Button","Input","AppearanceFontSettingsGroup","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","Switch","Sheet","SheetBody","SheetContent","SheetDescription","SheetFooter","SheetHeader","SheetTitle","SheetTrigger","AppearanceEditorProps","AppearancePopoverProps","ModeChoices","AccentChoices","GlassChoices","isCustomAccent","SettingsRow","TerminalRow","ThemeRow","AppearanceEditor","props","errorId","custom","accentDescription","draft","accent","preset","accentOptions","find","option","id","label","offered","themeAccentOptions","toLowerCase","glassDescription","surface","surfaceCapability","themeDefaultDescription","_el$","_tmpl$6","_el$3","firstChild","_$insert","_$createComponent","when","recoveryNotice","children","_el$2","_tmpl$","appearance","selectedId","lightThemeId","preview","lightTheme","themes","disabled","saving","onSelect","onChange","darkThemeId","darkTheme","terminalThemeId","undefined","_$memo","resolvedAppearance","title","icon","description","_el$4","_tmpl$3","_el$5","_$setAttribute","value","aria-invalid","customAccentError","aria-describedby","onInput","event","currentTarget","_el$6","_tmpl$2","fontSettingsPlacement","settings","fonts","menuPortalMount","frosted","reason","_el$7","_tmpl$4","checked","reduceTransparency","onManageThemes","type","size","variant","onClick","extraRows","hideActions","_el$8","_tmpl$5","AppearanceEditorActions","_$effect","_$className","class","saveReasonId","_el$9","_tmpl$8","_el$1","_el$10","saveDisabledReason","_el$0","_tmpl$7","onReset","onCancel","aria-busy","onSave","AppearancePopover","setMenuPortalMount","HTMLElement","open","onOpenChange","onOpen","onDismiss","as","triggerVariant","tooltip","tooltipIcon","side","closeLabel","ref","_$mergeProps","_$createComponent","_$memo","Switch","_$className","_$mergeProps"],"sources":["../../../../src/components/composites/appearance-editor/appearance-editor.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/*\n * Composition substantially translated from Zeron settings/appearance.rs and\n * settings/widgets.rs, pinned at 30a9a9537c5ec96226c87f4bf349b6f77c5dfb59,\n * preserving Adea's existing appearance-surface.tsx port: System/Light/Dark\n * miniatures, compact independent theme rows, accent swatches and helper copy,\n * glass chips, and theme library affordance. Kobalte replaces the port's manual\n * radio keyboard model. The controlled draft and explicit action ports replace\n * GPUI globals and app-specific storage/native authority. Save/Cancel/Reset and\n * custom accent/reduced-transparency are accepted Adea divergences (#425).\n */\nimport { EyeOff, Palette, PanelsTopLeft, SlidersHorizontal } from 'lucide-solid'\nimport { Show, createSignal, createUniqueId } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../action-button'\nimport { Button } from '../../ui/button/button'\nimport { Input } from '../../ui/input/input'\nimport { AppearanceFontSettingsGroup } from './font-settings-group'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\n\nimport { Switch } from '../../ui/switch/switch'\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from '../../ui/sheet/sheet'\nimport type { AppearanceEditorProps, AppearancePopoverProps } from './appearance-types'\nimport { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'\nimport { SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'\n\n/**\n * A live editor whose persistence and preview authority belong to its host.\n * No ThemeProvider is required, and no catalogue, renderer engine or storage is\n * imported. Hosts normalize unknown IDs and custom colors, report recovery,\n * snapshot on open, preview on changes, commit on Save, and restore on dismissal.\n * Both theme rows remain mounted when mode changes. Density remains outside the\n * accepted appearance surface; typeface settings are shared and host-persisted.\n */\nexport function AppearanceEditor(props: AppearanceEditorProps) {\n const errorId = createUniqueId()\n const custom = () => isCustomAccent(props)\n const accentDescription = () => {\n if (props.draft.accent === 'theme') return \"Theme default · Uses the palette's intended color.\"\n const preset = props.accentOptions.find((option) => option.id === props.draft.accent)\n if (preset) return `${preset.label} · Controls, glyphs, selections, code, and activity.`\n if (custom()) return 'Custom · Controls, glyphs, selections, code, and activity.'\n const offered = props.themeAccentOptions?.find((option) => option.id === props.draft.accent)\n // A stored theme accent survives a theme switch by id; when the new pair\n // cannot offer that slot the host falls back to the theme's own primary,\n // and the description says so rather than naming a colour not on screen.\n return offered\n ? `Theme ${offered.label.toLowerCase()} · The theme's own color, on controls and activity.`\n : \"Theme default · This theme does not carry that accent, so it uses the palette's intended color.\"\n }\n const glassDescription = () =>\n props.draft.surface === 'opaque'\n ? 'Solid surfaces for every theme.'\n : props.draft.surface === 'frosted'\n ? 'Theme-colored glass where supported.'\n : (props.surfaceCapability.themeDefaultDescription ?? \"Uses this theme's default surface.\")\n return (\n <div data-appearance-editor class={cn('min-w-0', props.class)}>\n <Show when={props.recoveryNotice}>\n <p role=\"status\" class=\"px-4 py-2 text-sm text-muted-foreground\">\n {props.recoveryNotice}\n </p>\n </Show>\n <ModeChoices {...props} />\n <div class=\"divide-y divide-border rounded-lg border\">\n <ThemeRow\n appearance=\"light\"\n selectedId={props.draft.lightThemeId}\n preview={props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(lightThemeId) => props.onChange({ lightThemeId })}\n />\n <ThemeRow\n appearance=\"dark\"\n selectedId={props.draft.darkThemeId}\n preview={props.darkTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(darkThemeId) => props.onChange({ darkThemeId })}\n />\n {/* The row exists only when the host carries a terminal preference:\n the draft field is the show/hide switch, so the editor can never\n render a terminal row that writes nothing. */}\n <Show when={props.draft.terminalThemeId !== undefined}>\n <TerminalRow\n selectedId={props.draft.terminalThemeId ?? 'theme'}\n preview={props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(terminalThemeId) => props.onChange({ terminalThemeId })}\n />\n </Show>\n <SettingsRow title=\"Accent\" icon={<SlidersHorizontal />} description={accentDescription()}>\n <AccentChoices {...props} />\n </SettingsRow>\n <Show when={custom()}>\n <div class=\"px-4 py-3\">\n <label class=\"mb-2 block text-xs font-medium\" for={`${errorId}-input`}>\n Custom accent\n </label>\n <Input\n id={`${errorId}-input`}\n value={props.draft.accent}\n disabled={props.saving}\n aria-invalid={!!props.customAccentError}\n aria-describedby={props.customAccentError ? errorId : undefined}\n onInput={(event) => props.onChange({ accent: event.currentTarget.value })}\n />\n <Show when={props.customAccentError}>\n <p id={errorId} role=\"alert\" class=\"mt-1 text-xs text-foreground\">\n {props.customAccentError}\n </p>\n </Show>\n </div>\n </Show>\n {/* Inline, the typefaces read as one more palette choice; `end` hands\n the closing slot to them for hosts whose order is palette and\n surface first, text last. */}\n <Show when={props.fontSettingsPlacement !== 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n <SettingsRow title=\"Glass\" icon={<PanelsTopLeft />} description={glassDescription()}>\n <GlassChoices {...props} />\n </SettingsRow>\n <Show when={!props.surfaceCapability.frosted && props.surfaceCapability.reason}>\n <p role=\"status\" class=\"px-4 py-2 text-xs text-muted-foreground\">\n {props.surfaceCapability.reason}\n </p>\n </Show>\n <SettingsRow\n title=\"Reduce transparency\"\n icon={<EyeOff />}\n description=\"Prefer solid surfaces, including during live preview.\"\n >\n <Switch\n checked={props.draft.reduceTransparency}\n disabled={props.saving}\n onChange={(reduceTransparency: boolean) => props.onChange({ reduceTransparency })}\n aria-label=\"Reduce transparency\"\n />\n </SettingsRow>\n <SettingsRow\n title=\"Theme library\"\n icon={<Palette />}\n description={\n props.onManageThemes\n ? 'Manage themes through the application.'\n : 'Theme import is unavailable.'\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!props.onManageThemes || props.saving}\n onClick={() => props.onManageThemes?.()}\n >\n Manage themes\n </Button>\n </SettingsRow>\n <Show when={props.fontSettingsPlacement === 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n {props.extraRows}\n </div>\n <Show when={!props.hideActions}>\n {/* Sticky so Save/Cancel stay reachable in a tall scroll container: the\n editor scrolls with its host panel, and actions parked at the bottom\n of a long form were unreachable without scrolling past every row. The\n bar is a band on the subtle-fill rung, like a sheet footer. It bleeds\n through the host panel's padding (`--settings-panel-padding`, set by\n SettingsLayout) so it sits flush with the panel's bottom and side\n edges with no strip of page under it; a sticky offset is measured\n inside a scroll container's padding, so `bottom` is pulled out by the\n same amount. */}\n <div class=\"sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3\">\n <AppearanceEditorActions {...props} />\n </div>\n </Show>\n </div>\n )\n}\n\n/**\n * Reset, Cancel and Save, with the reason Save is unavailable. Rendered by the\n * editor itself, or — with `hideActions` — by a host that pins them in its own\n * footer, as `AppearancePopover` does.\n */\nexport function AppearanceEditorActions(props: AppearanceEditorProps) {\n const saveReasonId = createUniqueId()\n return (\n <div class=\"flex w-full flex-col gap-2\">\n <Show when={props.saveDisabledReason}>\n <p id={saveReasonId} role=\"status\" class=\"text-xs text-muted-foreground\">\n {props.saveDisabledReason}\n </p>\n </Show>\n {/* `global-appearance-editor-actions` lets these buttons grow with the UI\n font preference, like the rest of Appearance's own controls. */}\n <div class=\"global-appearance-editor-actions flex flex-wrap items-center gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n disabled={props.saving}\n onClick={() => props.onReset()}\n >\n Reset\n </Button>\n <div class=\"ml-auto flex gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={props.saving}\n onClick={() => props.onCancel()}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={props.saving || !!props.customAccentError || !!props.saveDisabledReason}\n aria-busy={props.saving}\n aria-describedby={props.saveDisabledReason ? saveReasonId : undefined}\n onClick={() => props.onSave()}\n >\n {props.saving ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n\n/** The editor in an inset Sheet docked beside the main view: the body scrolls and\n * Reset/Cancel/Save sit in the panel's full-width footer, always reachable.\n * Dismissal (Escape, the close button, an outside click) is `onDismiss`. */\nexport function AppearancePopover(props: AppearancePopoverProps) {\n const [menuPortalMount, setMenuPortalMount] = createSignal<HTMLElement>()\n\n return (\n <Sheet open={props.open} onOpenChange={(open) => (open ? props.onOpen() : props.onDismiss())}>\n {/* The trigger is an icon-only action, so it explains itself through the\n shared ActionButton's tooltip (keyboard focus included) rather than a\n bare aria-label. `toolbar` also holds the pressed rung while Kobalte\n marks the trigger `data-expanded`, and repeats the glyph in the\n tooltip like the other toolbar actions. */}\n <SheetTrigger\n as={ActionButton}\n variant={props.triggerVariant === 'toolbar' ? 'toolbar' : 'ghost'}\n size=\"icon-sm\"\n tooltip=\"Open appearance settings\"\n tooltipIcon={\n props.triggerVariant === 'toolbar' ? <Palette aria-hidden=\"true\" /> : undefined\n }\n aria-label=\"Appearance settings\"\n >\n <Palette />\n </SheetTrigger>\n <SheetContent side=\"end\" closeLabel=\"Close appearance settings\" ref={setMenuPortalMount}>\n <SheetHeader>\n <SheetTitle>Appearance</SheetTitle>\n <SheetDescription>\n Changes preview immediately. Save keeps them; Cancel restores the previous appearance.\n </SheetDescription>\n </SheetHeader>\n <SheetBody>\n <AppearanceEditor {...props} menuPortalMount={menuPortalMount()} hideActions />\n </SheetBody>\n <SheetFooter>\n <AppearanceEditorActions {...props} />\n </SheetFooter>\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,SAAgB+B,iBAAiBC,OAA8B;CAC7D,MAAMC,UAAU3B,eAAe;CAC/B,MAAM4B,eAAeP,eAAeK,KAAK;CACzC,MAAMG,0BAA0B;EAC9B,IAAIH,MAAMI,MAAMC,WAAW,SAAS,OAAO;EAC3C,MAAMC,SAASN,MAAMO,cAAcC,MAAMC,WAAWA,OAAOC,OAAOV,MAAMI,MAAMC,MAAM;EACpF,IAAIC,QAAQ,OAAO,GAAGA,OAAOK,MAAK;EAClC,IAAIT,OAAO,GAAG,OAAO;EACrB,MAAMU,UAAUZ,MAAMa,oBAAoBL,MAAMC,WAAWA,OAAOC,OAAOV,MAAMI,MAAMC,MAAM;EAI3F,OAAOO,UACH,SAASA,QAAQD,MAAMG,YAAY,EAAC,uDACpC;CACN;CACA,MAAMC,yBACJf,MAAMI,MAAMY,YAAY,WACpB,oCACAhB,MAAMI,MAAMY,YAAY,YACtB,yCACChB,MAAMiB,kBAAkBC,2BAA2B;CAC5D,cAAA;EAAA,IAAAC,OAAAC,QAAA,GAAAC,QAAAF,KAAAG;EAAAC,OAAAJ,MAAAK,gBAEKpD,MAAI;GAAA,IAACqD,OAAI;IAAA,OAAEzB,MAAM0B;GAAc;GAAA,IAAAC,WAAA;IAAA,IAAAC,QAAAC,OAAA;IAAAN,OAAAK,aAE3B5B,MAAM0B,cAAc;IAAA,OAAAE;GAAA;EAAA,CAAA,GAAAP,KAAA;EAAAE,OAAAJ,MAAAK,gBAGxBhC,aAAgBQ,KAAK,GAAAqB,KAAA;EAAAE,OAAAF,OAAAG,gBAEnB1B,UAAQ;GACPgC,YAAU;GAAA,IACVC,aAAU;IAAA,OAAE/B,MAAMI,MAAM4B;GAAY;GAAA,IACpC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AA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAK5C"}
@@ -2,8 +2,8 @@ import { cn } from "../../../lib/utils.js";
2
2
  import { Button } from "../../ui/button/button.js";
3
3
  import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "../../ui/dropdown-menu/dropdown-menu.js";
4
4
  import { PalettePreview, ThemeMenuPreview } from "./theme-preview.js";
5
- import { className, createComponent, effect, insert, template, use } from "solid-js/web";
6
- import { ChevronDown, Palette, SquareTerminal } from "lucide-solid";
5
+ import { className, createComponent, effect, insert, memo, template, use } from "solid-js/web";
6
+ import { ChevronDown, Moon, SquareTerminal, Sun } from "lucide-solid";
7
7
  import { For, Show, createMemo, createSignal, onCleanup } from "solid-js";
8
8
  // src/components/composites/appearance-editor/appearance-rows.tsx
9
9
  var _tmpl$ = /*#__PURE__*/ template(`<div class="mt-0.5 text-xs text-muted-foreground">`);
@@ -274,7 +274,7 @@ function ThemeRow(props) {
274
274
  return label();
275
275
  },
276
276
  get icon() {
277
- return createComponent(Palette, {});
277
+ return memo(() => props.appearance === "light")() ? createComponent(Sun, {}) : createComponent(Moon, {});
278
278
  },
279
279
  get children() {
280
280
  return createComponent(ThemeSelectMenu, {
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-rows.js","names":["AdeaTheme","AdeaThemeRecord","For","Show","createMemo","createSignal","onCleanup","JSX","ChevronDown","Palette","SquareTerminal","cn","Button","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","PalettePreview","ThemeMenuPreview","POINTER_FOCUS_TARGET_SELECTOR","isTabStop","element","HTMLElement","tabIndex","matches","hasAttribute","getAttribute","closest","getClientRects","length","SettingsRow","props","title","icon","Element","description","stacked","children","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$7","_$insert","_$createComponent","when","_el$6","_tmpl$","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","ThemeOption","id","name","preview","ThemeSelectMenu","label","selectedId","triggerPreview","options","disabled","onSelect","portalMount","setPortalMount","HTMLDivElement","triggerElement","setTriggerElement","HTMLButtonElement","menuOpen","setMenuOpen","focusOutsideTarget","setFocusOutsideTarget","restoreTriggerFocus","setRestoreTriggerFocus","focusTargetAfterTab","focusLifecycleVersion","selected","find","option","selectedName","closeMenu","moveFocusOnTab","event","KeyboardEvent","key","isComposing","trigger","parentDialog","focusScope","ownerDocument","body","focusStops","Array","from","querySelectorAll","filter","orderedFocusStops","toSorted","a","b","triggerIndex","indexOf","direction","shiftKey","adjacent","at","stopPropagation","preventDefault","focus","preventScroll","_el$8","_tmpl$4","_$use","modal","open","onOpenChange","ref","as","variant","size","aria-label","_el$9","_tmpl$3","_el$0","theme","onInteractOutside","detail","originalEvent","type","target","contains","focusTarget","onFocusOutside","onEscapeKeyDown","onCloseAutoFocus","lifecycleVersion","shouldRestore","isConnected","queueMicrotask","activeElement","document","isMenuFocus","isTriggerFocus","value","onChange","each","textValue","closeOnSelect","_el$1","_tmpl$6","_el$10","_el$11","_tmpl$5","ThemeRow","appearance","themes","map","TerminalRow","selectedOption","_$createComponent","_$className"],"sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n// Retains the compact divided row and palette-preview selector from the pinned\n// Zeron/Adea composition; Kobalte owns option navigation and nested dismissal.\n// One shared menu serves the light, dark, and terminal rows: each option is a\n// compact theme preview with its name and one-line description beside it, and\n// the menu sizes to that content instead of clipping it at the trigger width.\nimport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'\nimport { ChevronDown, Palette, SquareTerminal } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview, ThemeMenuPreview } from './theme-preview'\n\nconst POINTER_FOCUS_TARGET_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\nfunction isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\nexport function SettingsRow(props: {\n title: string\n icon: JSX.Element\n description?: JSX.Element\n stacked?: boolean\n children: JSX.Element\n}) {\n return (\n <section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}>\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{props.description}</div>\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>\n )\n}\n\n/** One selectable palette in a theme menu. */\nexport type ThemeOption = {\n id: string\n name: string\n description?: string\n preview: AdeaTheme\n}\n\n/**\n * The shared theme picker. Kobalte handles menu navigation and dismissal;\n * this component moves Tab to the adjacent browser-reported stop because\n * menus consume Tab by default. Enumerating elements and checking their native\n * tabIndex keeps details summaries in the order while preserving explicit\n * tabindex overrides. The menu width follows its content (bounded by the\n * popper's available width) so a long theme name and its description render\n * fully instead of truncating at the trigger's width.\n */\nfunction ThemeSelectMenu(props: {\n /** Row title; prefixes the trigger's accessible name and labels the group. */\n label: string\n selectedId: string\n /** Palette shown on the trigger; hosts pass the accent-applied preview. */\n triggerPreview: AdeaTheme\n options: readonly ThemeOption[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const [portalMount, setPortalMount] = createSignal<HTMLDivElement>()\n const [triggerElement, setTriggerElement] = createSignal<HTMLButtonElement>()\n const [menuOpen, setMenuOpen] = createSignal(false)\n const [focusOutsideTarget, setFocusOutsideTarget] = createSignal<HTMLElement>()\n const [restoreTriggerFocus, setRestoreTriggerFocus] = createSignal(false)\n let focusTargetAfterTab: HTMLElement | undefined\n let focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const selected = createMemo(\n () =>\n props.options.find((option) => option.id === props.selectedId) ??\n props.options.find((option) => option.id === props.triggerPreview.id)\n )\n const selectedName = () => selected()?.name ?? props.triggerPreview.name\n const closeMenu = () => {\n if (menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(false)\n }\n const moveFocusOnTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing) return\n\n const trigger = triggerElement()\n if (!trigger) return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (!focusScope) return\n\n const focusStops = Array.from(focusScope.querySelectorAll<HTMLElement>('*')).filter(\n (element) =>\n isTabStop(element) &&\n element.closest('[role=\"menu\"], [hidden], [inert], [aria-hidden=\"true\"]') === null\n )\n const orderedFocusStops = [\n ...focusStops\n .filter((element) => element.tabIndex > 0)\n .toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...focusStops.filter((element) => element.tabIndex <= 0),\n ]\n const triggerIndex = orderedFocusStops.indexOf(trigger)\n const direction = event.shiftKey ? -1 : 1\n const adjacent =\n orderedFocusStops[triggerIndex + direction] ??\n (parentDialog ? (direction > 0 ? orderedFocusStops[0] : orderedFocusStops.at(-1)) : undefined)\n\n event.stopPropagation()\n setRestoreTriggerFocus(false)\n if (adjacent) {\n event.preventDefault()\n focusTargetAfterTab = adjacent\n setFocusOutsideTarget(adjacent)\n closeMenu()\n adjacent.focus({ preventScroll: true })\n } else {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n closeMenu()\n }\n }\n return (\n <div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(open) => {\n if (open !== menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(open)\n if (open) {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--kb-popper-anchor-width) max-w-(--kb-popper-content-available-width) overflow-x-hidden overflow-y-auto\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = target.closest<HTMLElement>(POINTER_FOCUS_TARGET_SELECTOR)\n if (focusTarget && isTabStop(focusTarget)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(focusTarget)\n } else {\n setRestoreTriggerFocus(true)\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(target)\n }\n }}\n onEscapeKeyDown={() => setRestoreTriggerFocus(true)}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (menuOpen()) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus()\n const focusTarget = focusTargetAfterTab ?? focusOutsideTarget()\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // Kobalte's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || menuOpen()) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so Kobalte must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n on:keydown={moveFocusOnTab}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n onSelect={() => setRestoreTriggerFocus(true)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n}\n\n/**\n * A compact persistent theme choice for one appearance.\n */\nexport function ThemeRow(props: {\n appearance: 'light' | 'dark'\n selectedId: string\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const label = () => (props.appearance === 'light' ? 'Light theme' : 'Dark theme')\n const options = createMemo<ThemeOption[]>(() =>\n props.themes\n .filter((theme) => theme.appearance === props.appearance)\n .map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n }))\n )\n return (\n <SettingsRow title={label()} icon={<Palette />}>\n <ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n\n/**\n * A terminal palette choice independent of the light/dark rows. The first\n * option (`'theme'`) follows the interface theme, painted with the resolved\n * preview; every catalogue record follows, both appearances, because the\n * terminal paints one fixed ANSI palette rather than an appearance axis.\n */\nexport function TerminalRow(props: {\n selectedId: string\n /** Resolved interface theme: the `theme` option's palette and the fallback. */\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const options = createMemo<ThemeOption[]>(() => [\n {\n id: 'theme',\n name: 'UI theme',\n description: 'Uses the interface theme.',\n preview: props.preview,\n },\n ...props.themes.map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n })),\n ])\n const selectedOption = () => options().find((option) => option.id === props.selectedId)\n const description = () =>\n selectedOption() && selectedOption()?.id !== 'theme'\n ? `The terminal follows ${selectedOption()?.name}.`\n : 'The terminal follows the interface theme.'\n return (\n <SettingsRow title=\"Terminal\" icon={<SquareTerminal />} description={description()}>\n <ThemeSelectMenu\n label=\"Terminal\"\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA0CA,IAAMoB,gCACJ;AAEF,SAASC,UAAUC,SAAsB;CACvC,QACGA,QAAQE,YAAY,KAClBF,QAAQG,QAAQ,iCAAiC,KAAK,CAACH,QAAQI,aAAa,UAAU,MACzF,CAACJ,QAAQG,QAAQ,WAAW,KAC5BH,QAAQK,aAAa,eAAe,MAAM,UAC1CL,QAAQM,QAAQ,2CAAyC,MAAM,QAC/DN,QAAQO,eAAe,CAAC,CAACC,SAAS;AAEtC;AAEA,SAAgBC,YAAYC,OAMzB;CACD,cAAA;EAAA,IAAAO,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAE,aAAAC,QAAAF,MAAAF,YAAAK,QAAAN,MAAAI;EAAAG,OAAAL,aAeSX,MAAME,IAAI;EAAAc,OAAAF,aAGsBd,MAAMC,KAAK;EAAAe,OAAAJ,OAAAK,gBAC3C9C,MAAI;GAAA,IAAC+C,OAAI;IAAA,OAAElB,MAAMI;GAAW;GAAA,IAAAE,WAAA;IAAA,IAAAa,QAAAC,OAAA;IAAAJ,OAAAG,aACwBnB,MAAMI,WAAW;IAAA,OAAAe;GAAA;EAAA,CAAA,GA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YAAYvI,OAOzB;CACD,MAAMqC,UAAUjE,iBAAgC,CAC9C;EACE0D,IAAI;EACJC,MAAM;EACN3B,aAAa;EACb4B,SAAShC,MAAMgC;CACjB,GACA,GAAGhC,MAAMqI,OAAOC,KAAKhC,WAAW;EAC9BxE,IAAIwE,MAAMxE;EACVC,MAAMuE,MAAMvE;EACZ3B,aAAakG,MAAMlG;EACnB4B,SAASsE;CACX,EAAE,CAAC,CACJ;CACD,MAAMkC,uBAAuBnG,QAAQ,CAAC,CAACkB,MAAMC,WAAWA,OAAO1B,OAAO9B,MAAMmC,UAAU;CACtF,MAAM/B,oBACJoI,eAAe,KAAKA,eAAe,CAAC,EAAE1G,OAAO,UACzC,wBAAwB0G,eAAe,CAAC,EAAEzG,KAAI,KAC9C;CACN,OAAAd,gBACGlB,aAAW;EAACE,OAAK;EAAA,IAAYC,OAAI;GAAA,OAAAe,gBAAGvC,gBAAc,CAAA,CAAA;EAAA;EAAA,IAAK0B,cAAW;GAAA,OAAEA,YAAY;EAAC;EAAA,IAAAE,WAAA;GAAA,OAAAW,gBAC/EgB,iBAAe;IACdC,OAAK;IAAA,IACLC,aAAU;KAAA,OAAEnC,MAAMmC;IAAU;IAAA,IAC5BC,iBAAc;KAAA,OAAEoG,eAAe,CAAC,EAAExG,WAAWhC,MAAMgC;IAAO;IAAA,IAC1DK,UAAO;KAAA,OAAEA,QAAQ;IAAC;IAAA,IAClBC,WAAQ;KAAA,OAAEtC,MAAMsC;IAAQ;IAAA,IACxBC,WAAQ;KAAA,OAAEvC,MAAMuC;IAAQ;GAAA,CAAA;EAAA;CAAA,CAAA;AAIhC"}
1
+ {"version":3,"file":"appearance-rows.js","names":["AdeaTheme","AdeaThemeRecord","For","Show","createMemo","createSignal","onCleanup","JSX","ChevronDown","Moon","SquareTerminal","Sun","cn","Button","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","PalettePreview","ThemeMenuPreview","POINTER_FOCUS_TARGET_SELECTOR","isTabStop","element","HTMLElement","tabIndex","matches","hasAttribute","getAttribute","closest","getClientRects","length","SettingsRow","props","title","icon","Element","description","stacked","children","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$7","_$insert","_$createComponent","when","_el$6","_tmpl$","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","ThemeOption","id","name","preview","ThemeSelectMenu","label","selectedId","triggerPreview","options","disabled","onSelect","portalMount","setPortalMount","HTMLDivElement","triggerElement","setTriggerElement","HTMLButtonElement","menuOpen","setMenuOpen","focusOutsideTarget","setFocusOutsideTarget","restoreTriggerFocus","setRestoreTriggerFocus","focusTargetAfterTab","focusLifecycleVersion","selected","find","option","selectedName","closeMenu","moveFocusOnTab","event","KeyboardEvent","key","isComposing","trigger","parentDialog","focusScope","ownerDocument","body","focusStops","Array","from","querySelectorAll","filter","orderedFocusStops","toSorted","a","b","triggerIndex","indexOf","direction","shiftKey","adjacent","at","stopPropagation","preventDefault","focus","preventScroll","_el$8","_tmpl$4","_$use","modal","open","onOpenChange","ref","as","variant","size","aria-label","_el$9","_tmpl$3","_el$0","theme","onInteractOutside","detail","originalEvent","type","target","contains","focusTarget","onFocusOutside","onEscapeKeyDown","onCloseAutoFocus","lifecycleVersion","shouldRestore","isConnected","queueMicrotask","activeElement","document","isMenuFocus","isTriggerFocus","value","onChange","each","textValue","closeOnSelect","_el$1","_tmpl$6","_el$10","_el$11","_tmpl$5","ThemeRow","appearance","themes","map","_$memo","TerminalRow","selectedOption","_$createComponent","_$className","_$memo"],"sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n// Retains the compact divided row and palette-preview selector from the pinned\n// Zeron/Adea composition; Kobalte owns option navigation and nested dismissal.\n// One shared menu serves the light, dark, and terminal rows: each option is a\n// compact theme preview with its name and one-line description beside it, and\n// the menu sizes to that content instead of clipping it at the trigger width.\nimport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'\nimport { ChevronDown, Moon, SquareTerminal, Sun } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview, ThemeMenuPreview } from './theme-preview'\n\nconst POINTER_FOCUS_TARGET_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\nfunction isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\nexport function SettingsRow(props: {\n title: string\n icon: JSX.Element\n description?: JSX.Element\n stacked?: boolean\n children: JSX.Element\n}) {\n return (\n <section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}>\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{props.description}</div>\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>\n )\n}\n\n/** One selectable palette in a theme menu. */\nexport type ThemeOption = {\n id: string\n name: string\n description?: string\n preview: AdeaTheme\n}\n\n/**\n * The shared theme picker. Kobalte handles menu navigation and dismissal;\n * this component moves Tab to the adjacent browser-reported stop because\n * menus consume Tab by default. Enumerating elements and checking their native\n * tabIndex keeps details summaries in the order while preserving explicit\n * tabindex overrides. The menu width follows its content (bounded by the\n * popper's available width) so a long theme name and its description render\n * fully instead of truncating at the trigger's width.\n */\nfunction ThemeSelectMenu(props: {\n /** Row title; prefixes the trigger's accessible name and labels the group. */\n label: string\n selectedId: string\n /** Palette shown on the trigger; hosts pass the accent-applied preview. */\n triggerPreview: AdeaTheme\n options: readonly ThemeOption[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const [portalMount, setPortalMount] = createSignal<HTMLDivElement>()\n const [triggerElement, setTriggerElement] = createSignal<HTMLButtonElement>()\n const [menuOpen, setMenuOpen] = createSignal(false)\n const [focusOutsideTarget, setFocusOutsideTarget] = createSignal<HTMLElement>()\n const [restoreTriggerFocus, setRestoreTriggerFocus] = createSignal(false)\n let focusTargetAfterTab: HTMLElement | undefined\n let focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const selected = createMemo(\n () =>\n props.options.find((option) => option.id === props.selectedId) ??\n props.options.find((option) => option.id === props.triggerPreview.id)\n )\n const selectedName = () => selected()?.name ?? props.triggerPreview.name\n const closeMenu = () => {\n if (menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(false)\n }\n const moveFocusOnTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing) return\n\n const trigger = triggerElement()\n if (!trigger) return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (!focusScope) return\n\n const focusStops = Array.from(focusScope.querySelectorAll<HTMLElement>('*')).filter(\n (element) =>\n isTabStop(element) &&\n element.closest('[role=\"menu\"], [hidden], [inert], [aria-hidden=\"true\"]') === null\n )\n const orderedFocusStops = [\n ...focusStops\n .filter((element) => element.tabIndex > 0)\n .toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...focusStops.filter((element) => element.tabIndex <= 0),\n ]\n const triggerIndex = orderedFocusStops.indexOf(trigger)\n const direction = event.shiftKey ? -1 : 1\n const adjacent =\n orderedFocusStops[triggerIndex + direction] ??\n (parentDialog ? (direction > 0 ? orderedFocusStops[0] : orderedFocusStops.at(-1)) : undefined)\n\n event.stopPropagation()\n setRestoreTriggerFocus(false)\n if (adjacent) {\n event.preventDefault()\n focusTargetAfterTab = adjacent\n setFocusOutsideTarget(adjacent)\n closeMenu()\n adjacent.focus({ preventScroll: true })\n } else {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n closeMenu()\n }\n }\n return (\n <div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(open) => {\n if (open !== menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(open)\n if (open) {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--kb-popper-anchor-width) max-w-(--kb-popper-content-available-width) overflow-x-hidden overflow-y-auto\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = target.closest<HTMLElement>(POINTER_FOCUS_TARGET_SELECTOR)\n if (focusTarget && isTabStop(focusTarget)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(focusTarget)\n } else {\n setRestoreTriggerFocus(true)\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(target)\n }\n }}\n onEscapeKeyDown={() => setRestoreTriggerFocus(true)}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (menuOpen()) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus()\n const focusTarget = focusTargetAfterTab ?? focusOutsideTarget()\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // Kobalte's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || menuOpen()) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so Kobalte must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n on:keydown={moveFocusOnTab}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n onSelect={() => setRestoreTriggerFocus(true)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n}\n\n/**\n * A compact persistent theme choice for one appearance.\n */\nexport function ThemeRow(props: {\n appearance: 'light' | 'dark'\n selectedId: string\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const label = () => (props.appearance === 'light' ? 'Light theme' : 'Dark theme')\n const options = createMemo<ThemeOption[]>(() =>\n props.themes\n .filter((theme) => theme.appearance === props.appearance)\n .map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n }))\n )\n return (\n <SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>\n <ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n\n/**\n * A terminal palette choice independent of the light/dark rows. The first\n * option (`'theme'`) follows the interface theme, painted with the resolved\n * preview; every catalogue record follows, both appearances, because the\n * terminal paints one fixed ANSI palette rather than an appearance axis.\n */\nexport function TerminalRow(props: {\n selectedId: string\n /** Resolved interface theme: the `theme` option's palette and the fallback. */\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const options = createMemo<ThemeOption[]>(() => [\n {\n id: 'theme',\n name: 'UI theme',\n description: 'Uses the interface theme.',\n preview: props.preview,\n },\n ...props.themes.map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n })),\n ])\n const selectedOption = () => options().find((option) => option.id === props.selectedId)\n const description = () =>\n selectedOption() && selectedOption()?.id !== 'theme'\n ? `The terminal follows ${selectedOption()?.name}.`\n : 'The terminal follows the interface theme.'\n return (\n <SettingsRow title=\"Terminal\" icon={<SquareTerminal />} description={description()}>\n <ThemeSelectMenu\n label=\"Terminal\"\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA0CA,IAAMqB,gCACJ;AAEF,SAASC,UAAUC,SAAsB;CACvC,QACGA,QAAQE,YAAY,KAClBF,QAAQG,QAAQ,iCAAiC,KAAK,CAACH,QAAQI,aAAa,UAAU,MACzF,CAACJ,QAAQG,QAAQ,WAAW,KAC5BH,QAAQK,aAAa,eAAe,MAAM,UAC1CL,QAAQM,QAAQ,2CAAyC,MAAM,QAC/DN,QAAQO,eAAe,CAAC,CAACC,SAAS;AAEtC;AAEA,SAAgBC,YAAYC,OAMzB;CACD,cAAA;EAAA,IAAAO,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAE,aAAAC,QAAAF,MAAAF,YAAAK,QAAAN,MAAAI;EAAAG,OAAAL,aAeSX,MAAME,IAAI;E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;IAAQ;IAAA,IACxBC,WAAQ;KAAA,OAAEvC,MAAMuC;IAAQ;GAAA,CAAA;EAAA;CAAA,CAAA;AAIhC"}
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'solid-js';
1
2
  import type { AccentPreset, AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes';
2
3
  import type { AppearanceEditorFontSettings } from '#lib/appearance-font-settings';
3
4
  export type AppearanceDraft = Readonly<{
@@ -57,6 +58,12 @@ export type AppearanceEditorProps = {
57
58
  /** Mount nested font menus inside the containing overlay when one exists. */
58
59
  menuPortalMount?: HTMLElement;
59
60
  class?: string;
61
+ /**
62
+ * Host rows closing the option list, inside the same bordered group as the
63
+ * built-in rows. Compose them with `AppearanceSettingsRow` so they share the
64
+ * row anatomy (glyph tile, title, description, trailing control).
65
+ */
66
+ extraRows?: JSX.Element;
60
67
  /** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */
61
68
  hideActions?: boolean;
62
69
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-types.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAA;AAEjF,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,4BAA4B,CAAA;IACpC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;IACvC,kBAAkB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AAK,CAAA;IAChD;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG;IAC3D,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACrC,CAAA"}
1
+ {"version":3,"file":"appearance-types.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAA;AAEjF,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,4BAA4B,CAAA;IACpC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;IACvC,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,eAAe,CAAA;IACtB,8EAA8E;IAC9E,UAAU,EAAE,SAAS,CAAA;IACrB,SAAS,EA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EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG;IAC3D,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACrC,CAAA"}
@@ -1,3 +1,4 @@
1
+ export { SettingsRow as AppearanceSettingsRow } from './appearance-rows';
1
2
  export { AppearanceEditor, AppearanceEditorActions, AppearancePopover } from './appearance-editor';
2
3
  export { AppearanceFontSettingsGroup, type AppearanceFontSettingsGroupProps, } from './font-settings-group';
3
4
  export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, applyAppearanceFontSettings, fontSettingsBootstrapScript, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, type AppearanceEditorFontAxis, type AppearanceEditorFontFamilyId, type AppearanceEditorFontSetting, type AppearanceEditorFontSettings, type NormalizedAppearanceEditorFontSettings, } from '#lib/appearance-font-settings';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,2BAA2B,EAC3B,KAAK,gCAAgC,GACtC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,EAC/B,uCAAuC,EACvC,2BAA2B,EAC3B,2BAA2B,EAC3B,qCAAqC,EACrC,iCAAiC,EACjC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,sCAAsC,GAC5C,MAAM,+BAA+B,CAAA;AACtC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,2BAA2B,EAC3B,KAAK,gCAAgC,GACtC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,EAC/B,uCAAuC,EACvC,2BAA2B,EAC3B,2BAA2B,EAC3B,qCAAqC,EACrC,iCAAiC,EACjC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,sCAAsC,GAC5C,MAAM,+BAA+B,CAAA;AACtC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAA"}
@@ -1,5 +1,6 @@
1
+ import { SettingsRow } from "./appearance-rows.js";
1
2
  import { AppearanceEditor, AppearanceEditorActions, AppearancePopover } from "./appearance-editor.js";
2
3
  import { AppearanceFontSettingsGroup } from "./font-settings-group.js";
3
4
  import { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, applyAppearanceFontSettings, fontSettingsBootstrapScript, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize } from "../../../lib/appearance-font-settings.js";
4
5
  import { PalettePreview, ThemeMiniature, ThemeMiniatureSplit } from "./theme-preview.js";
5
- export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePopover, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, PalettePreview, ThemeMiniature, ThemeMiniatureSplit, applyAppearanceFontSettings, fontSettingsBootstrapScript, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize };
6
+ export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePopover, SettingsRow as AppearanceSettingsRow, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, PalettePreview, ThemeMiniature, ThemeMiniatureSplit, applyAppearanceFontSettings, fontSettingsBootstrapScript, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize };
@@ -1 +1 @@
1
- {"version":3,"file":"settings-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/settings/settings-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAExF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,cAAc,CAAC,OAAO,IAAI,CAAC,EAC3B,UAAU,GAAG,aAAa,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CACnE,GAAG;IACF,gFAAgF;IAChF,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC1C,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAA;IACpB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,+FAA+F;IAC/F,cAAc,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC,CAAA;IAC7E;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,wBAAwB,CAAA;IAC3C,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAWhE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAgDxD"}
1
+ {"version":3,"file":"settings-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/settings/settings-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAExF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,cAAc,CAAC,OAAO,IAAI,CAAC,EAC3B,UAAU,GAAG,aAAa,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CACnE,GAAG;IACF,gFAAgF;IAChF,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC1C,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAA;IACpB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,+FAA+F;IAC/F,cAAc,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC,CAAA;IAC7E;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,wBAAwB,CAAA;IAC3C,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAWhE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAmDxD"}
@@ -4,7 +4,7 @@ import { SettingsNavigation } from "./settings-navigation.js";
4
4
  import { createComponent, insert, mergeProps, template } from "solid-js/web";
5
5
  import { createSignal, onCleanup, onMount, splitProps } from "solid-js";
6
6
  // src/components/composites/settings/settings-layout.tsx
7
- var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=settings-layout-panels class="min-h-0 min-w-0 flex-1 overflow-y-auto p-4">`);
7
+ var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=settings-layout-panels class="min-h-0 min-w-0 flex-1 overflow-y-auto p-(--settings-panel-padding) [--settings-panel-padding:--spacing(4)]">`);
8
8
  /** The `md` breakpoint the rail has always widened at; below it the rail becomes a strip. */
9
9
  var RAIL_MEDIA_QUERY = "(min-width: 48rem)";
10
10
  function railQuery() {
@@ -1 +1 @@
1
- {"version":3,"file":"settings-layout.js","names":["ComponentProps","JSX","createSignal","onCleanup","onMount","splitProps","cn","Tabs","SettingsNavigation","SettingsNavigationGroup","SettingsLayoutProps","Omit","groups","value","onChange","onReselect","revealSelected","trigger","HTMLButtonElement","navigationLayout","SettingsNavigationLayout","children","Element","RAIL_MEDIA_QUERY","railQuery","MediaQueryList","window","matchMedia","undefined","SettingsLayout","props","local","rest","wide","setWide","matches","query","update","addEventListener","removeEventListener","layout","requested","_$createComponent","_$mergeProps","orientation","data-navigation-layout","class","aria-label","_el$","_tmpl$","_$insert","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/composites/settings/settings-layout.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { createSignal, onCleanup, onMount, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Tabs } from '../../ui/tabs'\nimport { SettingsNavigation, type SettingsNavigationGroup } from './settings-navigation'\n\nexport type SettingsLayoutProps = Omit<\n ComponentProps<typeof Tabs>,\n 'children' | 'orientation' | 'value' | 'defaultValue' | 'onChange'\n> & {\n /** Grouped navigation entries; the host owns their values and panel content. */\n groups: readonly SettingsNavigationGroup[]\n /** Accessible name for the tab list. */\n 'aria-label': string\n /** The host-controlled selected destination. */\n value: string\n /** Updates the host-controlled selected destination. */\n onChange: (value: string) => void\n /** Called when the already-selected destination is activated again. */\n onReselect?: (value: string) => void\n /** Reveal the selected row on value changes and window resizes. Defaults to nearest scroll. */\n revealSelected?: boolean | ((trigger: HTMLButtonElement | undefined) => void)\n /**\n * How the section navigation sits beside the panels. `auto` (the default) is\n * the vertical rail from 48rem of viewport width up and a horizontal,\n * scrollable strip of tabs above the panels below it. `rail` and `strip` pin\n * one shape at every width.\n */\n navigationLayout?: SettingsNavigationLayout\n /** Panels must be rendered as `TabsContent` descendants. */\n children?: JSX.Element\n}\n\nexport type SettingsNavigationLayout = 'auto' | 'rail' | 'strip'\n\n/** The `md` breakpoint the rail has always widened at; below it the rail becomes a strip. */\nconst RAIL_MEDIA_QUERY = '(min-width: 48rem)'\n\nfunction railQuery(): MediaQueryList | undefined {\n return typeof window === 'undefined' || typeof window.matchMedia !== 'function'\n ? undefined\n : window.matchMedia(RAIL_MEDIA_QUERY)\n}\n\n/**\n * SettingsLayout.\n *\n * A controlled, vertical settings rail beside its scrollable panel viewport.\n * The host keeps ownership of selection, URL/hash state and panel content.\n *\n * Below 48rem the rail becomes a horizontal strip of tabs above the panels.\n * A 6rem rail at phone width clips every label, so this is the default rather\n * than an opt-in. It changes the tab root's orientation, not just its\n * styling: the list's `aria-orientation` and Kobalte's arrow keys (Up/Down on\n * the rail, Left/Right on the strip) follow the axis the reader sees. The\n * breakpoint is the viewport's, like CatalogBrowser's and ContextualSidebar's,\n * and is read before the first render so a phone never paints the rail. A\n * server render, which has no viewport, renders the rail.\n */\nexport function SettingsLayout(props: SettingsLayoutProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'groups',\n 'aria-label',\n 'value',\n 'onReselect',\n 'revealSelected',\n 'navigationLayout',\n ])\n\n const [wide, setWide] = createSignal(railQuery()?.matches ?? true)\n onMount(() => {\n const query = railQuery()\n if (!query) return\n const update = () => setWide(query.matches)\n update()\n query.addEventListener('change', update)\n onCleanup(() => query.removeEventListener('change', update))\n })\n const layout = (): 'rail' | 'strip' => {\n const requested = local.navigationLayout ?? 'auto'\n if (requested !== 'auto') return requested\n return wide() ? 'rail' : 'strip'\n }\n\n return (\n <Tabs\n {...rest}\n orientation={layout() === 'rail' ? 'vertical' : 'horizontal'}\n data-navigation-layout={layout()}\n value={local.value}\n class={cn('min-h-0 min-w-0 flex-1 gap-0', local.class)}\n >\n <SettingsNavigation\n aria-label={local['aria-label']}\n groups={local.groups}\n value={local.value}\n onReselect={local.onReselect}\n revealSelected={local.revealSelected}\n class={layout() === 'rail' ? 'w-24 md:w-sidebar' : undefined}\n />\n <div data-slot=\"settings-layout-panels\" class=\"min-h-0 min-w-0 flex-1 overflow-y-auto p-4\">\n {local.children}\n </div>\n </Tabs>\n )\n}\n"],"mappings":";;;;;;;;AAoCA,IAAMuB,mBAAmB;AAEzB,SA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OAAEe,MAAMf;IAAc;IAAA,KAAA,WAAA;KAAA,OAC7BwB,OAAO,MAAM,SAAS,sBAAsBZ,KAAAA;IAAS;GAAA,CAAA,UAAA;IAAA,IAAAoB,OAAAC,OAAA;IAAAC,OAAAF,YAG3DjB,MAAMV,QAAQ;IAAA,OAAA2B;GAAA,EAAA,CAAA,CAAA;EAAA;CAAA,CAAA,CAAA;AAIvB"}
1
+ {"version":3,"file":"settings-layout.js","names":["ComponentProps","JSX","createSignal","onCleanup","onMount","splitProps","cn","Tabs","SettingsNavigation","SettingsNavigationGroup","SettingsLayoutProps","Omit","groups","value","onChange","onReselect","revealSelected","trigger","HTMLButtonElement","navigationLayout","SettingsNavigationLayout","children","Element","RAIL_MEDIA_QUERY","railQuery","MediaQueryList","window","matchMedia","undefined","SettingsLayout","props","local","rest","wide","setWide","matches","query","update","addEventListener","removeEventListener","layout","requested","_$createComponent","_$mergeProps","orientation","data-navigation-layout","class","aria-label","_el$","_tmpl$","_$insert","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/composites/settings/settings-layout.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { createSignal, onCleanup, onMount, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Tabs } from '../../ui/tabs'\nimport { SettingsNavigation, type SettingsNavigationGroup } from './settings-navigation'\n\nexport type SettingsLayoutProps = Omit<\n ComponentProps<typeof Tabs>,\n 'children' | 'orientation' | 'value' | 'defaultValue' | 'onChange'\n> & {\n /** Grouped navigation entries; the host owns their values and panel content. */\n groups: readonly SettingsNavigationGroup[]\n /** Accessible name for the tab list. */\n 'aria-label': string\n /** The host-controlled selected destination. */\n value: string\n /** Updates the host-controlled selected destination. */\n onChange: (value: string) => void\n /** Called when the already-selected destination is activated again. */\n onReselect?: (value: string) => void\n /** Reveal the selected row on value changes and window resizes. Defaults to nearest scroll. */\n revealSelected?: boolean | ((trigger: HTMLButtonElement | undefined) => void)\n /**\n * How the section navigation sits beside the panels. `auto` (the default) is\n * the vertical rail from 48rem of viewport width up and a horizontal,\n * scrollable strip of tabs above the panels below it. `rail` and `strip` pin\n * one shape at every width.\n */\n navigationLayout?: SettingsNavigationLayout\n /** Panels must be rendered as `TabsContent` descendants. */\n children?: JSX.Element\n}\n\nexport type SettingsNavigationLayout = 'auto' | 'rail' | 'strip'\n\n/** The `md` breakpoint the rail has always widened at; below it the rail becomes a strip. */\nconst RAIL_MEDIA_QUERY = '(min-width: 48rem)'\n\nfunction railQuery(): MediaQueryList | undefined {\n return typeof window === 'undefined' || typeof window.matchMedia !== 'function'\n ? undefined\n : window.matchMedia(RAIL_MEDIA_QUERY)\n}\n\n/**\n * SettingsLayout.\n *\n * A controlled, vertical settings rail beside its scrollable panel viewport.\n * The host keeps ownership of selection, URL/hash state and panel content.\n *\n * Below 48rem the rail becomes a horizontal strip of tabs above the panels.\n * A 6rem rail at phone width clips every label, so this is the default rather\n * than an opt-in. It changes the tab root's orientation, not just its\n * styling: the list's `aria-orientation` and Kobalte's arrow keys (Up/Down on\n * the rail, Left/Right on the strip) follow the axis the reader sees. The\n * breakpoint is the viewport's, like CatalogBrowser's and ContextualSidebar's,\n * and is read before the first render so a phone never paints the rail. A\n * server render, which has no viewport, renders the rail.\n */\nexport function SettingsLayout(props: SettingsLayoutProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'groups',\n 'aria-label',\n 'value',\n 'onReselect',\n 'revealSelected',\n 'navigationLayout',\n ])\n\n const [wide, setWide] = createSignal(railQuery()?.matches ?? true)\n onMount(() => {\n const query = railQuery()\n if (!query) return\n const update = () => setWide(query.matches)\n update()\n query.addEventListener('change', update)\n onCleanup(() => query.removeEventListener('change', update))\n })\n const layout = (): 'rail' | 'strip' => {\n const requested = local.navigationLayout ?? 'auto'\n if (requested !== 'auto') return requested\n return wide() ? 'rail' : 'strip'\n }\n\n return (\n <Tabs\n {...rest}\n orientation={layout() === 'rail' ? 'vertical' : 'horizontal'}\n data-navigation-layout={layout()}\n value={local.value}\n class={cn('min-h-0 min-w-0 flex-1 gap-0', local.class)}\n >\n <SettingsNavigation\n aria-label={local['aria-label']}\n groups={local.groups}\n value={local.value}\n onReselect={local.onReselect}\n revealSelected={local.revealSelected}\n class={layout() === 'rail' ? 'w-24 md:w-sidebar' : undefined}\n />\n <div\n data-slot=\"settings-layout-panels\"\n class=\"min-h-0 min-w-0 flex-1 overflow-y-auto p-(--settings-panel-padding) [--settings-panel-padding:--spacing(4)]\"\n >\n {local.children}\n </div>\n </Tabs>\n )\n}\n"],"mappings":";;;;;;;;AAoCA,IAAMuB,mBAAmB;AAEzB,SAASC,YAAwC;CAC/C,OAAO,OAAOE,WAAW,eAAe,OAAOA,OAAOC,eAAe,aACjEC,KAAAA,IACAF,OAAOC,WAAWJ,gBAAgB;AACxC;;;;;;;;;;;;;;;;AAiBA,SAAgBM,eAAeC,OAA4B;CACzD,MAAM,CAACC,OAAOC,QAAQ3B,WAAWyB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CAED,MAAM,CAACG,MAAMC,WAAWhC,aAAasB,UAAU,CAAC,EAAEW,WAAW,IAAI;CACjE/B,cAAc;EACZ,MAAMgC,QAAQZ,UAAU;EACxB,IAAI,CAACY,OAAO;EACZ,MAAMC,eAAeH,QAAQE,MAAMD,OAAO;EAC1CE,OAAO;EACPD,MAAME,iBAAiB,UAAUD,MAAM;EACvClC,gBAAgBiC,MAAMG,oBAAoB,UAAUF,MAAM,CAAC;CAC7D,CAAC;CACD,MAAMG,eAAiC;EACrC,MAAMC,YAAYV,MAAMZ,oBAAoB;EAC5C,IAAIsB,cAAc,QAAQ,OAAOA;EACjC,OAAOR,KAAK,IAAI,SAAS;CAC3B;CAEA,OAAAS,gBACGnC,MAAIoC,WACCX,MAAI;EAAA,IACRY,cAAW;GAAA,OAAEJ,OAAO,MAAM,SAAS,aAAa;EAAY;EAAA,KAAA,4BAAA;GAAA,OACpCA,OAAO;EAAC;EAAA,IAChC3B,QAAK;GAAA,OAAEkB,MAAMlB;EAAK;EAAA,KAAA,WAAA;GAAA,OACXP,GAAG,gCAAgCyB,MAAMe,KAAK;EAAC;EAAA,IAAAzB,WAAA;GAAA,OAAA,CAAAqB,gBAErDlC,oBAAkB;IAAA,KAAA,gBAAA;KAAA,OACLuB,MAAM;IAAa;IAAA,IAC/BnB,SAAM;KAAA,OAAEmB,MAAMnB;IAAM;IAAA,IACpBC,QAAK;KAAA,OAAEkB,MAAMlB;IAAK;IAAA,IAClBE,aAAU;KAAA,OAAEgB,MAAMhB;IAAU;IAAA,IAC5BC,iBAAc;KAAA,OAAEe,MAAMf;IAAc;IAAA,KAAA,WAAA;KAAA,OAC7BwB,OAAO,MAAM,SAAS,sBAAsBZ,KAAAA;IAAS;GAAA,CAAA,UAAA;IAAA,IAAAoB,OAAAC,OAAA;IAAAC,OAAAF,YAM3DjB,MAAMV,QAAQ;IAAA,OAAA2B;GAAA,EAAA,CAAA,CAAA;EAAA;CAAA,CAAA,CAAA;AAIvB"}
package/dist/index.js CHANGED
@@ -176,12 +176,13 @@ import { describeCount, firstFailureKey, formatDuration as formatDuration$1, lis
176
176
  import { TEST_RESULTS_LIST_LIMIT, TestResults } from "./components/composites/test-results/test-results.js";
177
177
  import { TOOL_VALUE_MAX_CHARS, formatToolValue } from "./components/composites/tool/format-tool-value.js";
178
178
  import { TOOL_STATUS_LABELS, Tool } from "./components/composites/tool/tool.js";
179
- import { SettingsField, SettingsPage, SettingsRow, SettingsSection } from "./components/composites/settings/settings.js";
179
+ import { SettingsField, SettingsPage, SettingsRow as SettingsRow$1, SettingsSection } from "./components/composites/settings/settings.js";
180
180
  import { SettingsNavigation } from "./components/composites/settings/settings-navigation.js";
181
181
  import { SettingsLayout } from "./components/composites/settings/settings-layout.js";
182
182
  import { SceneControls } from "./components/composites/scene-controls/scene-controls.js";
183
183
  import { PropertyList, PropertyRow, PropertyTerm, PropertyValue, Stat, StatGroup } from "./components/composites/stat/stat.js";
184
184
  import { PalettePreview, ThemeMiniature, ThemeMiniatureSplit } from "./components/composites/appearance-editor/theme-preview.js";
185
+ import { SettingsRow } from "./components/composites/appearance-editor/appearance-rows.js";
185
186
  import { AppearanceEditor, AppearanceEditorActions, AppearancePopover } from "./components/composites/appearance-editor/appearance-editor.js";
186
187
  import { allTokens, colorTokens, densityTokens, designTokens, elevationTokens, motionTokens, radiusTokens, typographyTokens, undocumentedTokenAliases, zIndexTokens } from "./lib/tokens.js";
187
188
  import { UpdateDialog } from "./components/composites/update-dialog/update-dialog.js";
@@ -196,4 +197,4 @@ import { MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE
196
197
  import { isShellIconKey, resolveShellIcon, shellIconEntries, shellIconLabel } from "./components/composites/icon-picker/shell-icons.js";
197
198
  import { IconPicker, IconPickerDropdown } from "./components/composites/icon-picker/icon-picker.js";
198
199
  import { AccentPicker } from "./components/composites/accent-picker/accent-picker.js";
199
- export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceLine, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
200
+ export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, SettingsRow as AppearanceSettingsRow, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow$1 as SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceLine, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-focus-gate.d.ts","sourceRoot":"","sources":["../../src/lib/tooltip-focus-gate.ts"],"names":[],"mappings":"AA6EA;;;2BAG2B;AAC3B,eAAO,MAAM,8BAA8B,MAAM,CAAA;AAiBjD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,YAAY,EAAE,OAAO,CAAA;IACrB,oBAAoB,EAAE,OAAO,CAAA;CAC9B,GAAG,OAAO,CAEV;AAID;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,QAAmB,GAAG,MAAM,IAAI,CA2E5E;AAWD,wBAAgB,uBAAuB,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,IAAI,CAMlE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,IAAI,CAYlE"}
1
+ {"version":3,"file":"tooltip-focus-gate.d.ts","sourceRoot":"","sources":["../../src/lib/tooltip-focus-gate.ts"],"names":[],"mappings":"AA6EA;;;2BAG2B;AAC3B,eAAO,MAAM,8BAA8B,MAAM,CAAA;AAiBjD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,YAAY,EAAE,OAAO,CAAA;IACrB,oBAAoB,EAAE,OAAO,CAAA;CAC9B,GAAG,OAAO,CAEV;AAID;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,QAAmB,GAAG,MAAM,IAAI,CA8E5E;AAWD,wBAAgB,uBAAuB,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,IAAI,CAMlE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,IAAI,CAYlE"}
@@ -46,7 +46,7 @@ var installedDocuments = /* @__PURE__ */ new WeakSet();
46
46
  */
47
47
  function installTooltipFocusGate(doc = document) {
48
48
  if (installedDocuments.has(doc)) return () => {};
49
- let lastTabKeyDownAt = 0;
49
+ let lastTabKeyDownAt = Number.NEGATIVE_INFINITY;
50
50
  /** True between a pointerdown and its pointerup/pointercancel: focus events
51
51
  * inside that window belong to a pointer gesture (drag bootstrap, press)
52
52
  * and must reach their element untouched. */
@@ -61,9 +61,10 @@ function installTooltipFocusGate(doc = document) {
61
61
  * that is live for a few hundred milliseconds at most. */
62
62
  let phantomReleaseAttached = false;
63
63
  const onKeyDown = (event) => {
64
- if (event.key === "Tab") lastTabKeyDownAt = Date.now();
64
+ lastTabKeyDownAt = event.key === "Tab" ? Date.now() : Number.NEGATIVE_INFINITY;
65
65
  };
66
66
  const onPointerDown = () => {
67
+ lastTabKeyDownAt = Number.NEGATIVE_INFINITY;
67
68
  pointerGestureActive = true;
68
69
  releasePhantomFocus();
69
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-focus-gate.js","names":[],"sources":["../../src/lib/tooltip-focus-gate.ts"],"sourcesContent":["/*\n * Tooltips open on active hover over the control, or on keyboard focus that\n * follows a Tab key press. They must never open from programmatic focus: the\n * autofocus a dialog or sheet gives its first control, and the focus a closing\n * overlay restores to its opener, both land on buttons that carry tooltips —\n * and the tooltip primitive opens immediately on focus and pins the tooltip\n * until blur. That is the \"tooltip auto-displays when a sheet opens\" report,\n * and the pinned tooltip is the \"tooltip gets stuck and never disappears\"\n * report: the pointer is nowhere near the control, so no pointer leave ever\n * closes it.\n *\n * The trigger listens for the native `focus` event on the trigger element, and\n * composites build tooltips internally (ActionButton renders one from its\n * `tooltip` prop), so the single interception point that covers every tooltip\n * is a capture-phase `focus` listener on `document`. When focus lands without a\n * keyboard-intent signal on a button-like element, the event is stopped before\n * any element listener runs: the tooltip never learns about the focus. Hover\n * opens are untouched (they ride pointer events), and the separate `focusin`\n * event still flows, so dialog focus-cycle tracking, `:focus-visible` styling,\n * and focus restoration all keep working. Focus still lands — only the event\n * is stopped — so `document.activeElement` and scripted `.blur()` behave.\n *\n * The keyboard-intent signal is a Tab key press immediately before the focus —\n * the only key that moves focus natively. Enter and Space open overlays too,\n * so any \"recent key\" window wide enough for those would let an overlay's own\n * autofocus back through; Tab-only keeps autofocus suppressed no matter how\n * the overlay was opened, while normal Tab navigation still announces each\n * control's tooltip (hover descriptions stay reachable from the keyboard).\n *\n * Suppression is scoped to button-like targets (`button`, `a[href]`,\n * `[role=\"button\"]`, `[role=\"link\"]`). Composite widgets that move focus\n * programmatically — menu items, listbox options, grid cells — are other\n * element types whose roving-focus highlighting must keep receiving focus\n * events, and text controls keep their own focus behaviour (select on focus,\n * caret placement).\n *\n * Suppressed focus is real as far as the DOM is concerned (`activeElement`\n * moves; only the event was stopped), and the tooltip interaction model treats\n * a trigger that is `activeElement` as keyboard-held: while a tooltip on it is\n * open, pointer movement away only *requests* a close and the request is\n * refused for as long as the pointer keeps moving. Left alone, a later real\n * hover on that control would open the tip and never let it leave — the\n * residual \"stuck\" case. The gate therefore treats a suppressed focus as a\n * phantom and releases it: the first pointer activity after the focus (a\n * pointer session taking over from a script) blurs the element. Keyboard\n * sessions never release it and never need to — keyboard focus moves by Tab,\n * which is never suppressed, so nothing pins; and the release only runs for\n * elements still holding `activeElement`, so a Tab already taken from the\n * phantom is left alone.\n *\n * Focus that arrives while a pointer button is held belongs to a pointer\n * gesture, not to a tooltip: the pixel resize handle focuses its handle when a\n * drag starts and cancels the drag on blur, so a gesture focus must pass\n * through untouched (no suppression, no phantom, no release). A gesture's own\n * click behaviour already keeps tooltips closed, and the autofocus cases this\n * gate exists for all happen with the pointer up.\n *\n * A tab in a roving-focus tab list is the one button-like element whose\n * programmatic focus is the widget working as designed: a dialog's focus scope\n * and the tab list both put focus on the selected tab, and the tab list scrolls\n * it into view on every focus-in. Releasing that focus would hand it straight\n * back (the scope restores it), so every pointer move would re-suppress,\n * re-release and re-scroll the rail to the top, and a tab below the fold of a\n * large-font or short-window rail could not be clicked. A focus on `role=\"tab\"`\n * is therefore still hidden from the tooltip, so no tooltip opens from it, but\n * it is not tracked as a phantom and the pointer never blurs it.\n *\n * Independently of the gesture window, resize grips render as\n * `<button role=\"separator\">` and carry no tooltip, so they are excluded from\n * the button-like scope entirely (see `isButtonLikeFocusTarget`).\n *\n * The gate is installed by the `Tooltip` root for the lifetime of the first\n * tooltip in a document and removed when the last one unmounts, so every\n * consumer of the primitive — including composites that build their own\n * tooltips — inherits the contract without wiring of its own.\n */\n\n/** How long after a Tab key press a resulting focus event still counts as\n * keyboard navigation. The native focus move follows the key press\n * immediately; the window only has to bridge that dispatch, not a later\n * script-driven focus. */\nexport const TOOLTIP_FOCUS_INTENT_WINDOW_MS = 250\n\n/** Elements a tooltip-bearing control is rendered as. Everything else keeps\n * its native focus behaviour, and so do resize grips (see below). */\nconst BUTTON_LIKE_SELECTOR = 'button, a[href], [role=\"button\"], [role=\"link\"]'\n\n/**\n * Whether a focus event landing on this target could open a tooltip on a\n * button-like control. Accepts any Element (an SVG glyph inside a control,\n * for instance) and duck-types so the decision is testable without a DOM.\n */\nfunction buttonLikeControl(target: unknown): Element | null {\n const element = target as Element | null | undefined\n if (typeof element?.closest !== 'function') return null\n return element.closest(BUTTON_LIKE_SELECTOR)\n}\n\n/**\n * Whether the focus target is a tab of a roving-focus tab list. Its focus is\n * hidden from tooltips like any other programmatic focus, but it is never\n * released by the pointer (see the header).\n */\nexport function isTabFocusTarget(target: unknown): boolean {\n return buttonLikeControl(target)?.getAttribute?.('role') === 'tab'\n}\n\nexport function isButtonLikeFocusTarget(target: unknown): boolean {\n const control = buttonLikeControl(target)\n if (control === null) return false\n // Resize grips render as `<button role=\"separator\">` and focus themselves\n // when a pointer drag starts. They carry no tooltip, and the blur that\n // releases a suppressed focus would end the drag on its first move.\n return control.getAttribute?.('role') !== 'separator'\n}\n\n/**\n * The suppression decision: a button-like focus target hides a tooltip only\n * when no keyboard navigation is in flight. Anything else — a Tab-driven\n * focus, or focus on a non-button element — passes through untouched.\n */\nexport function shouldSuppressTooltipFocus(input: {\n isButtonLike: boolean\n keyboardIntentActive: boolean\n}): boolean {\n return input.isButtonLike && !input.keyboardIntentActive\n}\n\nconst installedDocuments = new WeakSet<Document>()\n\n/**\n * Install the gate on a document. Idempotent per document; returns a disposer\n * that removes the listeners (used by tests and by the tooltip root, which\n * releases the gate when its document's last tooltip unmounts).\n */\nexport function installTooltipFocusGate(doc: Document = document): () => void {\n if (installedDocuments.has(doc)) return () => {}\n\n let lastTabKeyDownAt = 0\n /** True between a pointerdown and its pointerup/pointercancel: focus events\n * inside that window belong to a pointer gesture (drag bootstrap, press)\n * and must reach their element untouched. */\n let pointerGestureActive = false\n /** The element holding a suppressed programmatic focus, if it still holds\n * `activeElement`. One slot: a newer suppressed focus replaces an older\n * one, and anything that already lost focus needs no release. */\n let phantomFocusTarget: Element | undefined\n /** The phantom-release `pointermove` listener exists only while a phantom\n * does: a gate that parks a permanent pointer listener on every document\n * with a tooltip in it costs every page a standing listener for a state\n * that is live for a few hundred milliseconds at most. */\n let phantomReleaseAttached = false\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') lastTabKeyDownAt = Date.now()\n }\n const onPointerDown = () => {\n pointerGestureActive = true\n releasePhantomFocus()\n }\n const onPointerGestureEnd = () => {\n pointerGestureActive = false\n }\n const dropPhantom = () => {\n phantomFocusTarget = undefined\n if (phantomReleaseAttached) {\n phantomReleaseAttached = false\n doc.removeEventListener('pointermove', onPointerMove, true)\n }\n }\n const onFocus = (event: FocusEvent) => {\n // Focus that moves on retires the phantom: there is nothing left to\n // release, so the parked pointer listener goes with it.\n if (phantomFocusTarget && event.target !== phantomFocusTarget) dropPhantom()\n if (pointerGestureActive) return\n if (!isButtonLikeFocusTarget(event.target)) return\n const keyboardIntentActive = Date.now() - lastTabKeyDownAt <= TOOLTIP_FOCUS_INTENT_WINDOW_MS\n if (!shouldSuppressTooltipFocus({ isButtonLike: true, keyboardIntentActive })) return\n event.stopPropagation()\n if (isTabFocusTarget(event.target)) return\n phantomFocusTarget = event.target as Element\n if (!phantomReleaseAttached) {\n phantomReleaseAttached = true\n doc.addEventListener('pointermove', onPointerMove, true)\n }\n }\n const releasePhantomFocus = () => {\n if (pointerGestureActive) return\n if (!phantomFocusTarget) return\n const phantom = phantomFocusTarget\n dropPhantom()\n if ((doc as Document).activeElement !== phantom) return\n if (typeof (phantom as HTMLElement).blur === 'function') (phantom as HTMLElement).blur()\n }\n const onPointerMove = () => releasePhantomFocus()\n\n doc.addEventListener('keydown', onKeyDown, true)\n doc.addEventListener('focus', onFocus, true)\n doc.addEventListener('pointerdown', onPointerDown, true)\n doc.addEventListener('pointerup', onPointerGestureEnd, true)\n doc.addEventListener('pointercancel', onPointerGestureEnd, true)\n installedDocuments.add(doc)\n return () => {\n doc.removeEventListener('keydown', onKeyDown, true)\n doc.removeEventListener('focus', onFocus, true)\n doc.removeEventListener('pointerdown', onPointerDown, true)\n doc.removeEventListener('pointerup', onPointerGestureEnd, true)\n doc.removeEventListener('pointercancel', onPointerGestureEnd, true)\n doc.removeEventListener('pointermove', onPointerMove, true)\n installedDocuments.delete(doc)\n }\n}\n\n/**\n * Reference-counted install for the tooltip root: the first tooltip in a\n * document acquires the gate, the last one to unmount releases it. The document\n * parameter exists so tests can drive the counter without a global DOM; the\n * production call site guards on the server render before calling.\n */\nconst gateHolders = new WeakMap<Document, number>()\nconst gateDisposers = new WeakMap<Document, () => void>()\n\nexport function acquireTooltipFocusGate(targetDoc?: Document): void {\n if (typeof document === 'undefined' && !targetDoc) return\n const doc = targetDoc ?? document\n const holders = gateHolders.get(doc) ?? 0\n gateHolders.set(doc, holders + 1)\n if (holders === 0) gateDisposers.set(doc, installTooltipFocusGate(doc))\n}\n\nexport function releaseTooltipFocusGate(targetDoc?: Document): void {\n if (typeof document === 'undefined' && !targetDoc) return\n const doc = targetDoc ?? document\n const holders = gateHolders.get(doc) ?? 0\n if (holders === 0) return\n if (holders === 1) {\n gateHolders.delete(doc)\n gateDisposers.get(doc)?.()\n gateDisposers.delete(doc)\n return\n }\n gateHolders.set(doc, holders - 1)\n}\n"],"mappings":";;;;;AAiFA,IAAa,iCAAiC;;;AAI9C,IAAM,uBAAuB;;;;;;AAO7B,SAAS,kBAAkB,QAAiC;CAC1D,MAAM,UAAU;CAChB,IAAI,OAAO,SAAS,YAAY,YAAY,OAAO;CACnD,OAAO,QAAQ,QAAQ,oBAAoB;AAC7C;;;;;;AAOA,SAAgB,iBAAiB,QAA0B;CACzD,OAAO,kBAAkB,MAAM,CAAC,EAAE,eAAe,MAAM,MAAM;AAC/D;AAEA,SAAgB,wBAAwB,QAA0B;CAChE,MAAM,UAAU,kBAAkB,MAAM;CACxC,IAAI,YAAY,MAAM,OAAO;CAI7B,OAAO,QAAQ,eAAe,MAAM,MAAM;AAC5C;;;;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cesContent":["/*\n * Tooltips open on active hover over the control, or on keyboard focus that\n * follows a Tab key press. They must never open from programmatic focus: the\n * autofocus a dialog or sheet gives its first control, and the focus a closing\n * overlay restores to its opener, both land on buttons that carry tooltips —\n * and the tooltip primitive opens immediately on focus and pins the tooltip\n * until blur. That is the \"tooltip auto-displays when a sheet opens\" report,\n * and the pinned tooltip is the \"tooltip gets stuck and never disappears\"\n * report: the pointer is nowhere near the control, so no pointer leave ever\n * closes it.\n *\n * The trigger listens for the native `focus` event on the trigger element, and\n * composites build tooltips internally (ActionButton renders one from its\n * `tooltip` prop), so the single interception point that covers every tooltip\n * is a capture-phase `focus` listener on `document`. When focus lands without a\n * keyboard-intent signal on a button-like element, the event is stopped before\n * any element listener runs: the tooltip never learns about the focus. Hover\n * opens are untouched (they ride pointer events), and the separate `focusin`\n * event still flows, so dialog focus-cycle tracking, `:focus-visible` styling,\n * and focus restoration all keep working. Focus still lands — only the event\n * is stopped — so `document.activeElement` and scripted `.blur()` behave.\n *\n * The keyboard-intent signal is a Tab key press immediately before the focus —\n * the only key that moves focus natively. Enter and Space open overlays too,\n * so any \"recent key\" window wide enough for those would let an overlay's own\n * autofocus back through; Tab-only keeps autofocus suppressed no matter how\n * the overlay was opened, while normal Tab navigation still announces each\n * control's tooltip (hover descriptions stay reachable from the keyboard).\n *\n * Suppression is scoped to button-like targets (`button`, `a[href]`,\n * `[role=\"button\"]`, `[role=\"link\"]`). Composite widgets that move focus\n * programmatically — menu items, listbox options, grid cells — are other\n * element types whose roving-focus highlighting must keep receiving focus\n * events, and text controls keep their own focus behaviour (select on focus,\n * caret placement).\n *\n * Suppressed focus is real as far as the DOM is concerned (`activeElement`\n * moves; only the event was stopped), and the tooltip interaction model treats\n * a trigger that is `activeElement` as keyboard-held: while a tooltip on it is\n * open, pointer movement away only *requests* a close and the request is\n * refused for as long as the pointer keeps moving. Left alone, a later real\n * hover on that control would open the tip and never let it leave — the\n * residual \"stuck\" case. The gate therefore treats a suppressed focus as a\n * phantom and releases it: the first pointer activity after the focus (a\n * pointer session taking over from a script) blurs the element. Keyboard\n * sessions never release it and never need to — keyboard focus moves by Tab,\n * which is never suppressed, so nothing pins; and the release only runs for\n * elements still holding `activeElement`, so a Tab already taken from the\n * phantom is left alone.\n *\n * Focus that arrives while a pointer button is held belongs to a pointer\n * gesture, not to a tooltip: the pixel resize handle focuses its handle when a\n * drag starts and cancels the drag on blur, so a gesture focus must pass\n * through untouched (no suppression, no phantom, no release). A gesture's own\n * click behaviour already keeps tooltips closed, and the autofocus cases this\n * gate exists for all happen with the pointer up.\n *\n * A tab in a roving-focus tab list is the one button-like element whose\n * programmatic focus is the widget working as designed: a dialog's focus scope\n * and the tab list both put focus on the selected tab, and the tab list scrolls\n * it into view on every focus-in. Releasing that focus would hand it straight\n * back (the scope restores it), so every pointer move would re-suppress,\n * re-release and re-scroll the rail to the top, and a tab below the fold of a\n * large-font or short-window rail could not be clicked. A focus on `role=\"tab\"`\n * is therefore still hidden from the tooltip, so no tooltip opens from it, but\n * it is not tracked as a phantom and the pointer never blurs it.\n *\n * Independently of the gesture window, resize grips render as\n * `<button role=\"separator\">` and carry no tooltip, so they are excluded from\n * the button-like scope entirely (see `isButtonLikeFocusTarget`).\n *\n * The gate is installed by the `Tooltip` root for the lifetime of the first\n * tooltip in a document and removed when the last one unmounts, so every\n * consumer of the primitive — including composites that build their own\n * tooltips — inherits the contract without wiring of its own.\n */\n\n/** How long after a Tab key press a resulting focus event still counts as\n * keyboard navigation. The native focus move follows the key press\n * immediately; the window only has to bridge that dispatch, not a later\n * script-driven focus. */\nexport const TOOLTIP_FOCUS_INTENT_WINDOW_MS = 250\n\n/** Elements a tooltip-bearing control is rendered as. Everything else keeps\n * its native focus behaviour, and so do resize grips (see below). */\nconst BUTTON_LIKE_SELECTOR = 'button, a[href], [role=\"button\"], [role=\"link\"]'\n\n/**\n * Whether a focus event landing on this target could open a tooltip on a\n * button-like control. Accepts any Element (an SVG glyph inside a control,\n * for instance) and duck-types so the decision is testable without a DOM.\n */\nfunction buttonLikeControl(target: unknown): Element | null {\n const element = target as Element | null | undefined\n if (typeof element?.closest !== 'function') return null\n return element.closest(BUTTON_LIKE_SELECTOR)\n}\n\n/**\n * Whether the focus target is a tab of a roving-focus tab list. Its focus is\n * hidden from tooltips like any other programmatic focus, but it is never\n * released by the pointer (see the header).\n */\nexport function isTabFocusTarget(target: unknown): boolean {\n return buttonLikeControl(target)?.getAttribute?.('role') === 'tab'\n}\n\nexport function isButtonLikeFocusTarget(target: unknown): boolean {\n const control = buttonLikeControl(target)\n if (control === null) return false\n // Resize grips render as `<button role=\"separator\">` and focus themselves\n // when a pointer drag starts. They carry no tooltip, and the blur that\n // releases a suppressed focus would end the drag on its first move.\n return control.getAttribute?.('role') !== 'separator'\n}\n\n/**\n * The suppression decision: a button-like focus target hides a tooltip only\n * when no keyboard navigation is in flight. Anything else — a Tab-driven\n * focus, or focus on a non-button element — passes through untouched.\n */\nexport function shouldSuppressTooltipFocus(input: {\n isButtonLike: boolean\n keyboardIntentActive: boolean\n}): boolean {\n return input.isButtonLike && !input.keyboardIntentActive\n}\n\nconst installedDocuments = new WeakSet<Document>()\n\n/**\n * Install the gate on a document. Idempotent per document; returns a disposer\n * that removes the listeners (used by tests and by the tooltip root, which\n * releases the gate when its document's last tooltip unmounts).\n */\nexport function installTooltipFocusGate(doc: Document = document): () => void {\n if (installedDocuments.has(doc)) return () => {}\n\n let lastTabKeyDownAt = Number.NEGATIVE_INFINITY\n /** True between a pointerdown and its pointerup/pointercancel: focus events\n * inside that window belong to a pointer gesture (drag bootstrap, press)\n * and must reach their element untouched. */\n let pointerGestureActive = false\n /** The element holding a suppressed programmatic focus, if it still holds\n * `activeElement`. One slot: a newer suppressed focus replaces an older\n * one, and anything that already lost focus needs no release. */\n let phantomFocusTarget: Element | undefined\n /** The phantom-release `pointermove` listener exists only while a phantom\n * does: a gate that parks a permanent pointer listener on every document\n * with a tooltip in it costs every page a standing listener for a state\n * that is live for a few hundred milliseconds at most. */\n let phantomReleaseAttached = false\n const onKeyDown = (event: KeyboardEvent) => {\n // A later activation key starts a different interaction: its overlay\n // autofocus must not inherit the preceding Tab navigation window.\n lastTabKeyDownAt = event.key === 'Tab' ? Date.now() : Number.NEGATIVE_INFINITY\n }\n const onPointerDown = () => {\n lastTabKeyDownAt = Number.NEGATIVE_INFINITY\n pointerGestureActive = true\n releasePhantomFocus()\n }\n const onPointerGestureEnd = () => {\n pointerGestureActive = false\n }\n const dropPhantom = () => {\n phantomFocusTarget = undefined\n if (phantomReleaseAttached) {\n phantomReleaseAttached = false\n doc.removeEventListener('pointermove', onPointerMove, true)\n }\n }\n const onFocus = (event: FocusEvent) => {\n // Focus that moves on retires the phantom: there is nothing left to\n // release, so the parked pointer listener goes with it.\n if (phantomFocusTarget && event.target !== phantomFocusTarget) dropPhantom()\n if (pointerGestureActive) return\n if (!isButtonLikeFocusTarget(event.target)) return\n const keyboardIntentActive = Date.now() - lastTabKeyDownAt <= TOOLTIP_FOCUS_INTENT_WINDOW_MS\n if (!shouldSuppressTooltipFocus({ isButtonLike: true, keyboardIntentActive })) return\n event.stopPropagation()\n if (isTabFocusTarget(event.target)) return\n phantomFocusTarget = event.target as Element\n if (!phantomReleaseAttached) {\n phantomReleaseAttached = true\n doc.addEventListener('pointermove', onPointerMove, true)\n }\n }\n const releasePhantomFocus = () => {\n if (pointerGestureActive) return\n if (!phantomFocusTarget) return\n const phantom = phantomFocusTarget\n dropPhantom()\n if ((doc as Document).activeElement !== phantom) return\n if (typeof (phantom as HTMLElement).blur === 'function') (phantom as HTMLElement).blur()\n }\n const onPointerMove = () => releasePhantomFocus()\n\n doc.addEventListener('keydown', onKeyDown, true)\n doc.addEventListener('focus', onFocus, true)\n doc.addEventListener('pointerdown', onPointerDown, true)\n doc.addEventListener('pointerup', onPointerGestureEnd, true)\n doc.addEventListener('pointercancel', onPointerGestureEnd, true)\n installedDocuments.add(doc)\n return () => {\n doc.removeEventListener('keydown', onKeyDown, true)\n doc.removeEventListener('focus', onFocus, true)\n doc.removeEventListener('pointerdown', onPointerDown, true)\n doc.removeEventListener('pointerup', onPointerGestureEnd, true)\n doc.removeEventListener('pointercancel', onPointerGestureEnd, true)\n doc.removeEventListener('pointermove', onPointerMove, true)\n installedDocuments.delete(doc)\n }\n}\n\n/**\n * Reference-counted install for the tooltip root: the first tooltip in a\n * document acquires the gate, the last one to unmount releases it. The document\n * parameter exists so tests can drive the counter without a global DOM; the\n * production call site guards on the server render before calling.\n */\nconst gateHolders = new WeakMap<Document, number>()\nconst gateDisposers = new WeakMap<Document, () => void>()\n\nexport function acquireTooltipFocusGate(targetDoc?: Document): void {\n if (typeof document === 'undefined' && !targetDoc) return\n const doc = targetDoc ?? document\n const holders = gateHolders.get(doc) ?? 0\n gateHolders.set(doc, holders + 1)\n if (holders === 0) gateDisposers.set(doc, installTooltipFocusGate(doc))\n}\n\nexport function releaseTooltipFocusGate(targetDoc?: Document): void {\n if (typeof document === 'undefined' && !targetDoc) return\n const doc = targetDoc ?? document\n const holders = gateHolders.get(doc) ?? 0\n if (holders === 0) return\n if (holders === 1) {\n gateHolders.delete(doc)\n gateDisposers.get(doc)?.()\n gateDisposers.delete(doc)\n return\n }\n gateHolders.set(doc, holders - 1)\n}\n"],"mappings":";;;;;AAiFA,IAAa,iCAAiC;;;AAI9C,IAAM,uBAAuB;;;;;;AAO7B,SAAS,kBAAkB,QAAiC;CAC1D,MAAM,UAAU;CAChB,IAAI,OAAO,SAAS,YAAY,YAAY,OAAO;CACnD,OAAO,QAAQ,QAAQ,oBAAoB;AAC7C;;;;;;AAOA,SAAgB,iBAAiB,QAA0B;CACzD,OAAO,kBAAkB,MAAM,CAAC,EAAE,eAAe,MAAM,MAAM;AAC/D;AAEA,SAAgB,wBAAwB,QAA0B;CAChE,MAAM,UAAU,kBAAkB,MAAM;CACxC,IAAI,YAAY,MAAM,OAAO;CAI7B,OAAO,QAAQ,eAAe,MAAM,MAAM;AAC5C;;;;;;AAOA,SAAgB,2BAA2B,OAG/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": [
7
- "@adea-ai/themes@^0.11.5",
7
+ "@adea-ai/themes@^0.11.6",
8
8
  "@kobalte/core@^0.13.14",
9
9
  "lucide-solid@^1.65.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.11.5",
7
+ "@adea-ai/themes@^0.11.6",
8
8
  "class-variance-authority@^0.7.1",
9
9
  "cn@^0.5.1"
10
10
  ],
@@ -2298,7 +2298,7 @@
2298
2298
  "title": "Appearance Editor",
2299
2299
  "description": "",
2300
2300
  "dependencies": [
2301
- "@adea-ai/themes@^0.11.5",
2301
+ "@adea-ai/themes@^0.11.6",
2302
2302
  "@kobalte/core@^0.13.14",
2303
2303
  "lucide-solid@^1.65.0"
2304
2304
  ],
@@ -3458,7 +3458,7 @@
3458
3458
  "title": "Theming",
3459
3459
  "description": "",
3460
3460
  "dependencies": [
3461
- "@adea-ai/themes@^0.11.5",
3461
+ "@adea-ai/themes@^0.11.6",
3462
3462
  "@kobalte/core@^0.13.14",
3463
3463
  "lucide-solid@^1.65.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.11.5",
3646
+ "@adea-ai/themes@^0.11.6",
3647
3647
  "class-variance-authority@^0.7.1",
3648
3648
  "cn@^0.5.1"
3649
3649
  ],
@@ -203,12 +203,19 @@ export function AppearanceEditor(props: AppearanceEditorProps) {
203
203
  onChange={(fonts) => props.onChange({ fonts })}
204
204
  />
205
205
  </Show>
206
+ {props.extraRows}
206
207
  </div>
207
208
  <Show when={!props.hideActions}>
208
209
  {/* Sticky so Save/Cancel stay reachable in a tall scroll container: the
209
210
  editor scrolls with its host panel, and actions parked at the bottom
210
- of a long form were unreachable without scrolling past every row. */}
211
- <div class="sticky bottom-0 z-10 mt-2 border-t bg-background px-4 py-3">
211
+ of a long form were unreachable without scrolling past every row. The
212
+ bar is a band on the subtle-fill rung, like a sheet footer. It bleeds
213
+ through the host panel's padding (`--settings-panel-padding`, set by
214
+ SettingsLayout) so it sits flush with the panel's bottom and side
215
+ edges with no strip of page under it; a sticky offset is measured
216
+ inside a scroll container's padding, so `bottom` is pulled out by the
217
+ same amount. */}
218
+ <div class="sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3">
212
219
  <AppearanceEditorActions {...props} />
213
220
  </div>
214
221
  </Show>
@@ -28,7 +28,7 @@
28
28
  // the menu sizes to that content instead of clipping it at the trigger width.
29
29
  import type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
30
30
  import { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'
31
- import { ChevronDown, Palette, SquareTerminal } from 'lucide-solid'
31
+ import { ChevronDown, Moon, SquareTerminal, Sun } from 'lucide-solid'
32
32
  import { cn } from '../../../lib/utils'
33
33
  import { Button } from '../../ui/button/button'
34
34
  import {
@@ -377,7 +377,7 @@ export function ThemeRow(props: {
377
377
  }))
378
378
  )
379
379
  return (
380
- <SettingsRow title={label()} icon={<Palette />}>
380
+ <SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>
381
381
  <ThemeSelectMenu
382
382
  label={label()}
383
383
  selectedId={props.selectedId}
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'solid-js'
1
2
  import type { AccentPreset, AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
2
3
  import type { AppearanceEditorFontSettings } from '../../../lib/appearance-font-settings'
3
4
 
@@ -55,6 +56,12 @@ export type AppearanceEditorProps = {
55
56
  /** Mount nested font menus inside the containing overlay when one exists. */
56
57
  menuPortalMount?: HTMLElement
57
58
  class?: string
59
+ /**
60
+ * Host rows closing the option list, inside the same bordered group as the
61
+ * built-in rows. Compose them with `AppearanceSettingsRow` so they share the
62
+ * row anatomy (glyph tile, title, description, trailing control).
63
+ */
64
+ extraRows?: JSX.Element
58
65
  /** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */
59
66
  hideActions?: boolean
60
67
  /**
@@ -1,3 +1,4 @@
1
+ export { SettingsRow as AppearanceSettingsRow } from './appearance-rows'
1
2
  export { AppearanceEditor, AppearanceEditorActions, AppearancePopover } from './appearance-editor'
2
3
  export {
3
4
  AppearanceFontSettingsGroup,
@@ -100,7 +100,10 @@ export function SettingsLayout(props: SettingsLayoutProps) {
100
100
  revealSelected={local.revealSelected}
101
101
  class={layout() === 'rail' ? 'w-24 md:w-sidebar' : undefined}
102
102
  />
103
- <div data-slot="settings-layout-panels" class="min-h-0 min-w-0 flex-1 overflow-y-auto p-4">
103
+ <div
104
+ data-slot="settings-layout-panels"
105
+ class="min-h-0 min-w-0 flex-1 overflow-y-auto p-(--settings-panel-padding) [--settings-panel-padding:--spacing(4)]"
106
+ >
104
107
  {local.children}
105
108
  </div>
106
109
  </Tabs>
@@ -136,7 +136,7 @@ const installedDocuments = new WeakSet<Document>()
136
136
  export function installTooltipFocusGate(doc: Document = document): () => void {
137
137
  if (installedDocuments.has(doc)) return () => {}
138
138
 
139
- let lastTabKeyDownAt = 0
139
+ let lastTabKeyDownAt = Number.NEGATIVE_INFINITY
140
140
  /** True between a pointerdown and its pointerup/pointercancel: focus events
141
141
  * inside that window belong to a pointer gesture (drag bootstrap, press)
142
142
  * and must reach their element untouched. */
@@ -151,9 +151,12 @@ export function installTooltipFocusGate(doc: Document = document): () => void {
151
151
  * that is live for a few hundred milliseconds at most. */
152
152
  let phantomReleaseAttached = false
153
153
  const onKeyDown = (event: KeyboardEvent) => {
154
- if (event.key === 'Tab') lastTabKeyDownAt = Date.now()
154
+ // A later activation key starts a different interaction: its overlay
155
+ // autofocus must not inherit the preceding Tab navigation window.
156
+ lastTabKeyDownAt = event.key === 'Tab' ? Date.now() : Number.NEGATIVE_INFINITY
155
157
  }
156
158
  const onPointerDown = () => {
159
+ lastTabKeyDownAt = Number.NEGATIVE_INFINITY
157
160
  pointerGestureActive = true
158
161
  releasePhantomFocus()
159
162
  }
@@ -4,7 +4,7 @@
4
4
  "title": "Theming",
5
5
  "description": "",
6
6
  "dependencies": [
7
- "@adea-ai/themes@^0.11.5",
7
+ "@adea-ai/themes@^0.11.6",
8
8
  "@kobalte/core@^0.13.14",
9
9
  "lucide-solid@^1.65.0"
10
10
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.149.7",
3
+ "version": "0.150.0",
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",
@@ -150,7 +150,7 @@
150
150
  "check:packed-paste-model": "node scripts/check-packed-paste-model.mjs"
151
151
  },
152
152
  "dependencies": {
153
- "@adea-ai/themes": "^0.11.5",
153
+ "@adea-ai/themes": "^0.11.6",
154
154
  "@corvu/calendar": "^0.1.2",
155
155
  "@corvu/drawer": "^0.2.4",
156
156
  "@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.11.5",
2301
+ "@adea-ai/themes@^0.11.6",
2302
2302
  "@kobalte/core@^0.13.14",
2303
2303
  "lucide-solid@^1.65.0"
2304
2304
  ],
@@ -3458,7 +3458,7 @@
3458
3458
  "title": "Theming",
3459
3459
  "description": "",
3460
3460
  "dependencies": [
3461
- "@adea-ai/themes@^0.11.5",
3461
+ "@adea-ai/themes@^0.11.6",
3462
3462
  "@kobalte/core@^0.13.14",
3463
3463
  "lucide-solid@^1.65.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.11.5",
3646
+ "@adea-ai/themes@^0.11.6",
3647
3647
  "class-variance-authority@^0.7.1",
3648
3648
  "cn@^0.5.1"
3649
3649
  ],
@@ -203,12 +203,19 @@ export function AppearanceEditor(props: AppearanceEditorProps) {
203
203
  onChange={(fonts) => props.onChange({ fonts })}
204
204
  />
205
205
  </Show>
206
+ {props.extraRows}
206
207
  </div>
207
208
  <Show when={!props.hideActions}>
208
209
  {/* Sticky so Save/Cancel stay reachable in a tall scroll container: the
209
210
  editor scrolls with its host panel, and actions parked at the bottom
210
- of a long form were unreachable without scrolling past every row. */}
211
- <div class="sticky bottom-0 z-10 mt-2 border-t bg-background px-4 py-3">
211
+ of a long form were unreachable without scrolling past every row. The
212
+ bar is a band on the subtle-fill rung, like a sheet footer. It bleeds
213
+ through the host panel's padding (`--settings-panel-padding`, set by
214
+ SettingsLayout) so it sits flush with the panel's bottom and side
215
+ edges with no strip of page under it; a sticky offset is measured
216
+ inside a scroll container's padding, so `bottom` is pulled out by the
217
+ same amount. */}
218
+ <div class="sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3">
212
219
  <AppearanceEditorActions {...props} />
213
220
  </div>
214
221
  </Show>
@@ -28,7 +28,7 @@
28
28
  // the menu sizes to that content instead of clipping it at the trigger width.
29
29
  import type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
30
30
  import { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'
31
- import { ChevronDown, Palette, SquareTerminal } from 'lucide-solid'
31
+ import { ChevronDown, Moon, SquareTerminal, Sun } from 'lucide-solid'
32
32
  import { cn } from '#lib/utils'
33
33
  import { Button } from '../../ui/button/button'
34
34
  import {
@@ -377,7 +377,7 @@ export function ThemeRow(props: {
377
377
  }))
378
378
  )
379
379
  return (
380
- <SettingsRow title={label()} icon={<Palette />}>
380
+ <SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>
381
381
  <ThemeSelectMenu
382
382
  label={label()}
383
383
  selectedId={props.selectedId}
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'solid-js'
1
2
  import type { AccentPreset, AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
2
3
  import type { AppearanceEditorFontSettings } from '#lib/appearance-font-settings'
3
4
 
@@ -55,6 +56,12 @@ export type AppearanceEditorProps = {
55
56
  /** Mount nested font menus inside the containing overlay when one exists. */
56
57
  menuPortalMount?: HTMLElement
57
58
  class?: string
59
+ /**
60
+ * Host rows closing the option list, inside the same bordered group as the
61
+ * built-in rows. Compose them with `AppearanceSettingsRow` so they share the
62
+ * row anatomy (glyph tile, title, description, trailing control).
63
+ */
64
+ extraRows?: JSX.Element
58
65
  /** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */
59
66
  hideActions?: boolean
60
67
  /**
@@ -1,3 +1,4 @@
1
+ export { SettingsRow as AppearanceSettingsRow } from './appearance-rows'
1
2
  export { AppearanceEditor, AppearanceEditorActions, AppearancePopover } from './appearance-editor'
2
3
  export {
3
4
  AppearanceFontSettingsGroup,
@@ -100,7 +100,10 @@ export function SettingsLayout(props: SettingsLayoutProps) {
100
100
  revealSelected={local.revealSelected}
101
101
  class={layout() === 'rail' ? 'w-24 md:w-sidebar' : undefined}
102
102
  />
103
- <div data-slot="settings-layout-panels" class="min-h-0 min-w-0 flex-1 overflow-y-auto p-4">
103
+ <div
104
+ data-slot="settings-layout-panels"
105
+ class="min-h-0 min-w-0 flex-1 overflow-y-auto p-(--settings-panel-padding) [--settings-panel-padding:--spacing(4)]"
106
+ >
104
107
  {local.children}
105
108
  </div>
106
109
  </Tabs>
@@ -136,7 +136,7 @@ const installedDocuments = new WeakSet<Document>()
136
136
  export function installTooltipFocusGate(doc: Document = document): () => void {
137
137
  if (installedDocuments.has(doc)) return () => {}
138
138
 
139
- let lastTabKeyDownAt = 0
139
+ let lastTabKeyDownAt = Number.NEGATIVE_INFINITY
140
140
  /** True between a pointerdown and its pointerup/pointercancel: focus events
141
141
  * inside that window belong to a pointer gesture (drag bootstrap, press)
142
142
  * and must reach their element untouched. */
@@ -151,9 +151,12 @@ export function installTooltipFocusGate(doc: Document = document): () => void {
151
151
  * that is live for a few hundred milliseconds at most. */
152
152
  let phantomReleaseAttached = false
153
153
  const onKeyDown = (event: KeyboardEvent) => {
154
- if (event.key === 'Tab') lastTabKeyDownAt = Date.now()
154
+ // A later activation key starts a different interaction: its overlay
155
+ // autofocus must not inherit the preceding Tab navigation window.
156
+ lastTabKeyDownAt = event.key === 'Tab' ? Date.now() : Number.NEGATIVE_INFINITY
155
157
  }
156
158
  const onPointerDown = () => {
159
+ lastTabKeyDownAt = Number.NEGATIVE_INFINITY
157
160
  pointerGestureActive = true
158
161
  releasePhantomFocus()
159
162
  }