@adea-ai/ui 0.156.0 → 0.158.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.
- package/README.md +3 -3
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +305 -172
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts +6 -0
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +2 -2
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +26 -0
- package/dist/components/composites/appearance-editor/appearance-types.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.js +10 -0
- package/dist/components/composites/appearance-editor/appearance-types.js.map +1 -0
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts +13 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +51 -15
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/index.d.ts +2 -1
- package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.js +3 -2
- package/dist/components/theme/theme-document.d.ts +1 -1
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-provider-value.d.ts +1 -1
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/button.js +3 -3
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +4 -18
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/appearance-font-settings.d.ts +18 -4
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.js +24 -6
- package/dist/lib/appearance-font-settings.js.map +1 -1
- package/dist/lib/fast-icon.d.ts +2 -1
- package/dist/lib/fast-icon.d.ts.map +1 -1
- package/dist/lib/fast-icon.js +4 -3
- package/dist/lib/fast-icon.js.map +1 -1
- package/dist/lib/font-catalog.d.ts +5 -0
- package/dist/lib/font-catalog.d.ts.map +1 -1
- package/dist/lib/font-catalog.js +10 -5
- package/dist/lib/font-catalog.js.map +1 -1
- package/dist/lib/font-zoom.d.ts +1 -1
- package/dist/lib/font-zoom.d.ts.map +1 -1
- package/dist/lib/font-zoom.js +5 -1
- package/dist/lib/font-zoom.js.map +1 -1
- package/dist/lib/theme-defaults.generated.d.ts.map +1 -1
- package/dist/lib/theme-defaults.generated.js +88 -60
- package/dist/lib/theme-defaults.generated.js.map +1 -1
- package/dist/lib/theme-projection.d.ts +2 -0
- package/dist/lib/theme-projection.d.ts.map +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-projection.js.map +1 -1
- package/dist/lib/theme-types.d.ts +7 -0
- package/dist/lib/theme-types.d.ts.map +1 -1
- package/dist/lib/theme-types.js +7 -0
- package/dist/lib/theme-types.js.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +17 -2
- package/dist/lib/tokens.js.map +1 -1
- package/dist/r/appearance-editor.json +2 -1
- package/dist/r/lib.json +1 -1
- package/dist/r/registry.json +4 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +202 -110
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +11 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +27 -0
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +50 -10
- package/dist/r/src/components/composites/appearance-editor/index.ts +3 -0
- package/dist/r/src/components/theme/theme-document.ts +1 -1
- package/dist/r/src/components/theme/theme-provider-value.ts +1 -1
- package/dist/r/src/components/ui/button/button.tsx +12 -3
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +9 -18
- package/dist/r/src/lib/appearance-font-settings.ts +43 -7
- package/dist/r/src/lib/fast-icon.ts +11 -4
- package/dist/r/src/lib/font-catalog.ts +5 -0
- package/dist/r/src/lib/font-zoom.ts +3 -0
- package/dist/r/src/lib/theme-defaults.generated.ts +88 -60
- package/dist/r/src/lib/theme-projection.ts +2 -0
- package/dist/r/src/lib/theme-types.ts +7 -0
- package/dist/r/src/lib/tokens.ts +17 -2
- package/dist/r/src/styles/appearance-font-settings.css +2 -0
- package/dist/r/src/styles/theme-variants.css +608 -370
- package/dist/r/src/styles/theme.css +4 -4
- package/dist/r/theming.json +1 -1
- package/package.json +2 -2
- package/registry.json +4 -3
- package/src/components/composites/appearance-editor/appearance-editor.tsx +202 -110
- package/src/components/composites/appearance-editor/appearance-rows.tsx +11 -1
- package/src/components/composites/appearance-editor/appearance-types.ts +27 -0
- package/src/components/composites/appearance-editor/font-settings-group.tsx +50 -10
- package/src/components/composites/appearance-editor/index.ts +3 -0
- package/src/components/theme/theme-document.ts +1 -1
- package/src/components/theme/theme-provider-value.ts +1 -1
- package/src/components/ui/button/button.tsx +12 -3
- package/src/components/ui/tooltip/tooltip.tsx +9 -18
- package/src/lib/appearance-font-settings.ts +43 -7
- package/src/lib/fast-icon.ts +11 -4
- package/src/lib/font-catalog.ts +5 -0
- package/src/lib/font-zoom.ts +3 -0
- package/src/lib/theme-defaults.generated.ts +88 -60
- package/src/lib/theme-projection.ts +2 -0
- package/src/lib/theme-types.ts +7 -0
- package/src/lib/tokens.ts +17 -2
- package/src/styles/appearance-font-settings.css +2 -0
- package/src/styles/theme-variants.css +608 -370
- package/src/styles/theme.css +4 -4
- package/src/styles/themes/aardvark-blue.css +7 -0
- package/src/styles/themes/aardvark-ink.css +7 -0
- package/src/styles/themes/adea-dark-colorblind.css +22 -15
- package/src/styles/themes/adea-dark-high-contrast.css +22 -15
- package/src/styles/themes/adea-dark.css +22 -15
- package/src/styles/themes/adea-light-colorblind.css +21 -14
- package/src/styles/themes/adea-light-high-contrast.css +21 -14
- package/src/styles/themes/adea-light.css +22 -15
- package/src/styles/themes/ayu-light.css +20 -13
- package/src/styles/themes/ayu-mirage.css +21 -14
- package/src/styles/themes/ayu.css +22 -15
- package/src/styles/themes/catppuccin-frappe.css +16 -9
- package/src/styles/themes/catppuccin-latte.css +15 -8
- package/src/styles/themes/catppuccin-macchiato.css +16 -9
- package/src/styles/themes/catppuccin-mocha.css +16 -9
- package/src/styles/themes/dracula.css +16 -9
- package/src/styles/themes/everforest-dark.css +19 -12
- package/src/styles/themes/everforest-light.css +21 -14
- package/src/styles/themes/gruvbox-dark.css +21 -14
- package/src/styles/themes/gruvbox-light.css +20 -13
- package/src/styles/themes/kanagawa.css +18 -11
- package/src/styles/themes/monokai.css +19 -12
- package/src/styles/themes/nord-light.css +7 -0
- package/src/styles/themes/nord.css +19 -12
- package/src/styles/themes/one-dark.css +16 -9
- package/src/styles/themes/rosepine-dawn.css +19 -12
- package/src/styles/themes/rosepine-moon.css +20 -13
- package/src/styles/themes/rosepine.css +20 -13
- package/src/styles/themes/solarized-dark.css +19 -12
- package/src/styles/themes/solarized-light.css +19 -12
- package/src/styles/themes/tokyonight-day.css +7 -0
- package/src/styles/themes/tokyonight-night.css +18 -11
- package/src/styles/themes/tokyonight-storm.css +18 -11
- package/src/styles/themes/vesper.css +22 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-editor.js","names":["EyeOff","LucideEyeOff","Palette","LucidePalette","PanelsTopLeft","LucidePanelsTopLeft","SlidersHorizontal","LucideSlidersHorizontal","Show","createSignal","createUniqueId","cn","ActionButton","Button","Input","AppearanceFontSettingsGroup","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","Switch","Sheet","SheetBody","SheetContent","SheetDescription","SheetFooter","SheetHeader","SheetTitle","SheetTrigger","ModeChoices","AccentChoices","GlassChoices","isCustomAccent","CodeRow","SettingsRow","TerminalRow","ThemeRow","fastIcon","AppearanceEditor","props","errorId","custom","accentDescription","draft","accent","preset","accentOptions","find","option","id","label","offered","themeAccentOptions","toLowerCase","glassDescription","surface","surfaceCapability","themeDefaultDescription","_el$","_tmpl$4","_el$2","firstChild","_$insert","_$createComponent","when","recoveryNotice","children","recoveryNoticeSlot","_el$7","_tmpl$5","appearance","selectedId","lightThemeId","preview","lightTheme","themes","disabled","saving","onSelect","onChange","darkThemeId","darkTheme","terminalThemeId","undefined","_$memo","resolvedAppearance","codeThemeId","title","icon","description","_el$3","_tmpl$","_el$4","_$setAttribute","value","customAccentError","onInput","event","currentTarget","customAccentErrorSlot","_el$8","_tmpl$6","fontSettingsPlacement","settings","fonts","menuPortalMount","frosted","reason","_el$5","_tmpl$2","checked","reduceTransparency","onManageThemes","type","size","variant","onClick","extraRows","hideActions","_el$6","_tmpl$3","AppearanceEditorActions","_$effect","_$className","class","saveReasonId","_el$9","_tmpl$7","_el$0","_el$1","saveDisabledReason","saveDisabledReasonSlot","_el$10","_tmpl$8","onReset","onCancel","onSave","AppearancePopover","setMenuPortalMount","open","onOpenChange","onOpen","onDismiss","as","triggerVariant","tooltip","tooltipIcon","side","closeLabel","ref","_$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 {\n EyeOff as LucideEyeOff,\n Palette as LucidePalette,\n PanelsTopLeft as LucidePanelsTopLeft,\n SlidersHorizontal as LucideSlidersHorizontal,\n} 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'\nimport { Input } from '../../ui/input'\nimport { AppearanceFontSettingsGroup } from './font-settings-group'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\n\nimport { Switch } from '../../ui/switch'\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from '../../ui/sheet'\nimport type { AppearanceEditorProps, AppearancePopoverProps } from './appearance-types'\nimport { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'\nimport { CodeRow, SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst EyeOff = fastIcon(LucideEyeOff)\nconst Palette = fastIcon(LucidePalette)\nconst PanelsTopLeft = fastIcon(LucidePanelsTopLeft)\nconst SlidersHorizontal = fastIcon(LucideSlidersHorizontal)\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_DEFAULT_ID)\n 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, selections and code.`\n if (custom()) return 'Custom · Controls, selections and code.'\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.`\n : 'Theme default · This theme has no such accent.'\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 {(recoveryNoticeSlot) => (\n <p role=\"status\" class=\"px-4 py-2 text-sm text-muted-foreground\">\n {recoveryNoticeSlot()}\n </p>\n )}\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_DEFAULT_ID}\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 {/* The same switch for code: the row exists only when the host stores it. */}\n <Show when={props.draft.codeThemeId !== undefined}>\n <CodeRow\n selectedId={props.draft.codeThemeId ?? THEME_DEFAULT_ID}\n preview={props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(codeThemeId) => props.onChange({ codeThemeId })}\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 {(customAccentErrorSlot) => (\n <p id={errorId} role=\"alert\" class=\"mt-1 text-xs text-foreground\">\n {customAccentErrorSlot()}\n </p>\n )}\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 {(saveDisabledReasonSlot) => (\n <p id={saveReasonId} role=\"status\" class=\"text-xs text-muted-foreground\">\n {saveDisabledReasonSlot()}\n </p>\n )}\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,IAAMA,WAASkC,SAASjC,MAAY;AACpC,IAAMC,YAAUgC,SAAS/B,OAAa;AACtC,IAAMC,kBAAgB8B,SAAS7B,aAAmB;AAClD,IAAMC,sBAAoB4B,SAAS3B,iBAAuB;;;;;;;;;AAU1D,SAAgB4B,iBAAiBC,OAA8B;CAC7D,MAAMC,UAAU3B,eAAe;CAC/B,MAAM4B,eAAeT,eAAeO,KAAK;CACzC,MAAMG,0BAA0B;EAC9B,IAAIH,MAAMI,MAAMC,WAAAA,SACd,OAAO;EACT,MAAMC,SAASN,MA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e;SAAA,OAAEA,gBAAgB;QAAC;QAAEa,aAAW;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;MAAAvD,gBAE7EtC,aAAW,EAAA,IAAAyC,WAAA;OAAA,OAAAH,gBACT0D,yBAA4BlF,KAAK;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAK5C"}
|
|
1
|
+
{"version":3,"file":"appearance-editor.js","names":["EyeOff","LucideEyeOff","Palette","LucidePalette","PanelsTopLeft","LucidePanelsTopLeft","SlidersHorizontal","LucideSlidersHorizontal","For","Show","createSignal","createUniqueId","cn","ActionButton","Button","Input","AppearanceFontSettingsGroup","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","Switch","Sheet","SheetBody","SheetContent","SheetDescription","SheetFooter","SheetHeader","SheetTitle","SheetTrigger","APPEARANCE_EDITOR_TABS","ModeChoices","AccentChoices","GlassChoices","isCustomAccent","CodeRow","SettingsRow","TerminalRow","ThemeRow","fastIcon","Tabs","TabsContent","TabsList","TabsTrigger","AppearanceEditor","props","errorId","custom","accentDescription","draft","accent","preset","accentOptions","find","option","id","label","offered","themeAccentOptions","toLowerCase","glassDescription","surface","surfaceCapability","themeDefaultDescription","shows","section","undefined","sectionFonts","fontRows","_$createComponent","settings","fonts","menuPortalMount","disabled","saving","axes","sectioned","onChange","previewTheme","resolvedAppearance","darkTheme","lightTheme","_el$","_tmpl$4","_el$2","firstChild","_$insert","when","recoveryNotice","children","recoveryNoticeSlot","_el$7","_tmpl$5","appearance","selectedId","lightThemeId","preview","themes","onSelect","darkThemeId","_$memo","terminalThemeId","terminalRows","codeThemeId","codeRows","title","icon","description","_el$3","_tmpl$","_el$4","_$setAttribute","value","customAccentError","onInput","event","currentTarget","customAccentErrorSlot","_el$8","_tmpl$6","fontSettingsPlacement","frosted","reason","_el$5","_tmpl$2","checked","reduceTransparency","onManageThemes","type","size","variant","onClick","extraRows","hideActions","_el$6","_tmpl$3","AppearanceEditorActions","_$effect","_p$","_v$","_v$2","class","e","t","_$className","saveReasonId","_el$9","_tmpl$7","_el$0","_el$1","saveDisabledReason","saveDisabledReasonSlot","_el$10","_tmpl$8","onReset","onCancel","onSave","TAB_LABELS","global","terminal","code","AppearancePopover","setMenuPortalMount","ownTab","setOwnTab","tabbed","tabs","tab","selectTab","next","candidate","onTabChange","open","onOpenChange","onOpen","onDismiss","as","triggerVariant","tooltip","tooltipIcon","side","closeLabel","ref","fallback","_$mergeProps","_el$11","_tmpl$9","fill","each"],"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 {\n EyeOff as LucideEyeOff,\n Palette as LucidePalette,\n PanelsTopLeft as LucidePanelsTopLeft,\n SlidersHorizontal as LucideSlidersHorizontal,\n} from 'lucide-solid'\nimport { For, Show, createSignal, createUniqueId } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../action-button'\nimport { Button } from '../../ui/button'\nimport { Input } from '../../ui/input'\nimport { AppearanceFontSettingsGroup } from './font-settings-group'\nimport {\n DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n type AppearanceEditorFontAxis,\n} from '#lib/appearance-font-settings'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\n\nimport { Switch } from '../../ui/switch'\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from '../../ui/sheet'\nimport {\n APPEARANCE_EDITOR_TABS,\n type AppearanceEditorProps,\n type AppearanceEditorTab,\n type AppearancePopoverProps,\n} from './appearance-types'\nimport { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'\nimport { CodeRow, SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'\nimport { fastIcon } from '#lib/fast-icon'\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../ui/tabs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst EyeOff = fastIcon(LucideEyeOff)\nconst Palette = fastIcon(LucidePalette)\nconst PanelsTopLeft = fastIcon(LucidePanelsTopLeft)\nconst SlidersHorizontal = fastIcon(LucideSlidersHorizontal)\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_DEFAULT_ID)\n 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, selections and code.`\n if (custom()) return 'Custom · Controls, selections and code.'\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.`\n : 'Theme default · This theme has no such accent.'\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 // One list when no section is asked for; otherwise only that section's rows.\n const shows = (section: AppearanceEditorTab) =>\n props.section === undefined || props.section === section\n const sectionFonts = (): readonly AppearanceEditorFontAxis[] =>\n props.section === 'global'\n ? ['ui', 'content']\n : props.section === 'terminal'\n ? ['terminal']\n : props.section === 'code'\n ? ['code']\n : ['ui', 'content', 'code']\n const fontRows = () => (\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n axes={sectionFonts()}\n sectioned={props.section === 'terminal' || props.section === 'code'}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n )\n const previewTheme = () =>\n props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme\n return (\n <div\n data-appearance-editor\n data-appearance-section={props.section}\n class={cn('min-w-0', props.class)}\n >\n <Show when={props.recoveryNotice}>\n {(recoveryNoticeSlot) => (\n <p role=\"status\" class=\"px-4 py-2 text-sm text-muted-foreground\">\n {recoveryNoticeSlot()}\n </p>\n )}\n </Show>\n <Show when={shows('global')}>\n <ModeChoices {...props} />\n </Show>\n <div class=\"divide-y divide-border rounded-lg border\">\n <Show when={shows('global')}>\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 </Show>\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={shows('terminal') && props.draft.terminalThemeId !== undefined}>\n <TerminalRow\n sectioned={props.section !== undefined}\n selectedId={props.draft.terminalThemeId ?? THEME_DEFAULT_ID}\n preview={previewTheme()}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(terminalThemeId) => props.onChange({ terminalThemeId })}\n />\n </Show>\n <Show when={props.section === 'terminal'}>\n {fontRows()}\n {props.terminalRows}\n </Show>\n {/* The same switch for code: the row exists only when the host stores it. */}\n <Show when={shows('code') && props.draft.codeThemeId !== undefined}>\n <CodeRow\n sectioned={props.section !== undefined}\n selectedId={props.draft.codeThemeId ?? THEME_DEFAULT_ID}\n preview={previewTheme()}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(codeThemeId) => props.onChange({ codeThemeId })}\n />\n </Show>\n <Show when={props.section === 'code'}>\n {fontRows()}\n {props.codeRows}\n </Show>\n <Show when={shows('global')}>\n <SettingsRow\n title=\"Accent\"\n icon={<SlidersHorizontal />}\n description={accentDescription()}\n >\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 {(customAccentErrorSlot) => (\n <p id={errorId} role=\"alert\" class=\"mt-1 text-xs text-foreground\">\n {customAccentErrorSlot()}\n </p>\n )}\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'}>{fontRows()}</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'}>{fontRows()}</Show>\n {props.extraRows}\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. 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 {(saveDisabledReasonSlot) => (\n <p id={saveReasonId} role=\"status\" class=\"text-xs text-muted-foreground\">\n {saveDisabledReasonSlot()}\n </p>\n )}\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\nconst TAB_LABELS: Readonly<Record<AppearanceEditorTab, string>> = {\n global: 'Global',\n terminal: 'Terminal',\n code: 'Code',\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 const [ownTab, setOwnTab] = createSignal<AppearanceEditorTab>('global')\n const tabbed = () => props.tabs === true || props.tab !== undefined\n const tab = () => props.tab ?? ownTab()\n const selectTab = (value: string) => {\n const next = APPEARANCE_EDITOR_TABS.find((candidate) => candidate === value)\n if (!next) return\n setOwnTab(next)\n props.onTabChange?.(next)\n }\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 {/* One short line on the caption rung, the size other panel headers\n use for their detail line. */}\n <SheetDescription class=\"truncate text-xs\">\n {props.description ?? 'Changes preview live. Save keeps them.'}\n </SheetDescription>\n </SheetHeader>\n <Show\n when={tabbed()}\n fallback={\n <SheetBody>\n <AppearanceEditor {...props} menuPortalMount={menuPortalMount()} hideActions />\n </SheetBody>\n }\n >\n <Tabs value={tab()} onChange={selectTab} class=\"min-h-0 flex-1 gap-0\">\n <div class=\"shrink-0 border-b border-border px-4 py-2\">\n <TabsList appearance=\"segmented\" fill aria-label=\"Appearance section\">\n <For each={APPEARANCE_EDITOR_TABS}>\n {(value) => (\n <TabsTrigger appearance=\"segmented\" value={value} class=\"flex-1\">\n {TAB_LABELS[value]}\n </TabsTrigger>\n )}\n </For>\n </TabsList>\n </div>\n <SheetBody>\n <For each={APPEARANCE_EDITOR_TABS}>\n {(value) => (\n <TabsContent value={value}>\n <AppearanceEditor\n {...props}\n section={value}\n menuPortalMount={menuPortalMount()}\n hideActions\n />\n </TabsContent>\n )}\n </For>\n </SheetBody>\n </Tabs>\n </Show>\n <SheetFooter>\n <AppearanceEditorActions {...props} />\n </SheetFooter>\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,IAAMA,WAASoC,SAASnC,MAAY;AACpC,IAAMC,YAAUkC,SAASjC,OAAa;AACtC,IAAMC,kBAAgBgC,SAAS/B,aAAmB;AAClD,IAAMC,sBAAoB8B,SAAS7B,iBAAuB;;;;;;;;;AAU1D,SAAgBkC,iBAAiBC,OAA8B;CAC7D,MAAMC,UAAUhC,eAAe;CAC/B,MAAMiC,eAAeb,eAAeW,KAAK;CACzC,MAAMG,0BAA0B;EAC9B,IAAIH,MAAMI,MAAMC,WAAAA,SACd,OAAO;EACT,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,6BACpC;CACN;CACA,MAAMC,yBACJf,MAAMI,MAAMY,YAAY,WACpB,oCACAhB,MAAMI,MAAMY,YAAY,YACtB,yC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BACTmE,yBAA4B3F,KAAK;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAK5C"}
|
|
@@ -44,6 +44,12 @@ type PinnedThemeRowProps = {
|
|
|
44
44
|
preview: AdeaTheme;
|
|
45
45
|
themes: readonly AdeaThemeRecord[];
|
|
46
46
|
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The row sits under a tab that already names its subject, so it is titled
|
|
49
|
+
* for what it sets ("Theme") and carries no description. The menu keeps the
|
|
50
|
+
* subject in its accessible name.
|
|
51
|
+
*/
|
|
52
|
+
sectioned?: boolean;
|
|
47
53
|
onSelect: (id: string) => void;
|
|
48
54
|
};
|
|
49
55
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAkD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AA6BnF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;CACtB,eA8BA;AAED,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,SAAS,CAAA;CACnB,CAAA;AAqND;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,eAwBA;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,eAIrD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,mBAAmB,eAEjD;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,+EAA+E;IAC/E,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,CAAA"}
|
|
1
|
+
{"version":3,"file":"appearance-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAkD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AA6BnF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;CACtB,eA8BA;AAED,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,SAAS,CAAA;CACnB,CAAA;AAqND;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,eAwBA;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,eAIrD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,mBAAmB,eAEjD;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,+EAA+E;IAC/E,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,CAAA"}
|
|
@@ -326,13 +326,13 @@ function PinnedThemeRow(props) {
|
|
|
326
326
|
};
|
|
327
327
|
return createComponent(SettingsRow, {
|
|
328
328
|
get title() {
|
|
329
|
-
return props.title;
|
|
329
|
+
return memo(() => !!props.sectioned)() ? "Theme" : props.title;
|
|
330
330
|
},
|
|
331
331
|
get icon() {
|
|
332
332
|
return props.icon;
|
|
333
333
|
},
|
|
334
334
|
get description() {
|
|
335
|
-
return description();
|
|
335
|
+
return memo(() => !!props.sectioned)() ? void 0 : description();
|
|
336
336
|
},
|
|
337
337
|
get children() {
|
|
338
338
|
return createComponent(ThemeSelectMenu, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-rows.js","names":["For","Show","createMemo","createSignal","onCleanup","ChevronDown","LucideChevronDown","Code","LucideCode","Moon","LucideMoon","SquareTerminal","LucideSquareTerminal","Sun","LucideSun","cn","THEME_DEFAULT_ID","Button","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","tabStopAt","PalettePreview","ThemeMenuPreview","fastIcon","SettingsRow","props","title","icon","Element","description","stacked","children","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","_$insert","_$createComponent","when","descriptionSlot","_el$7","_tmpl$2","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","id","name","preview","ThemeSelectMenu","label","selectedId","triggerPreview","options","disabled","onSelect","portalMount","setPortalMount","triggerElement","setTriggerElement","menuOpen","setMenuOpen","focusOutsideTarget","setFocusOutsideTarget","HTMLElement","restoreTriggerFocus","setRestoreTriggerFocus","focusLifecycleVersion","selected","matched","find","option","previewId","selectedName","_el$8","_tmpl$4","_$use","modal","open","onOpenChange","ref","as","variant","size","length","_el$9","_tmpl$3","_el$0","theme","tabKey","onInteractOutside","event","detail","originalEvent","type","closest","focusScope","ownerDocument","body","target","contains","focusTarget","onFocusOutside","preventDefault","onEscapeKeyDown","onCloseAutoFocus","lifecycleVersion","shouldRestore","focus","preventScroll","isConnected","queueMicrotask","activeElement","document","isMenuFocus","isTriggerFocus","value","onChange","each","textValue","closeOnSelect","_el$1","_tmpl$6","_el$10","_el$11","_tmpl$5","ThemeRow","appearance","themes","filter","map","_$memo","TerminalRow","PinnedThemeRow","_$mergeProps","subject","CodeRow","selectedOption"],"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 {\n ChevronDown as LucideChevronDown,\n Code as LucideCode,\n Moon as LucideMoon,\n SquareTerminal as LucideSquareTerminal,\n Sun as LucideSun,\n} from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport { Button } from '../../ui/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n tabStopAt,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview, ThemeMenuPreview } from './theme-preview'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst Code = fastIcon(LucideCode)\nconst Moon = fastIcon(LucideMoon)\nconst SquareTerminal = fastIcon(LucideSquareTerminal)\nconst Sun = fastIcon(LucideSun)\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 {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\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; Tab\n * leaves the menu for the adjacent stop (`tabKey=\"leave\"`). The menu width\n * follows its content (bounded by the popper's available width) so a long\n * theme name and its description render fully instead of truncating at the\n * 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 focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const selected = createMemo(() => {\n const options = props.options\n const selectedId = props.selectedId\n const matched = options.find((option) => option.id === selectedId)\n if (matched) return matched\n const previewId = props.triggerPreview.id\n return options.find((option) => option.id === previewId)\n })\n const selectedName = () => selected()?.name ?? props.triggerPreview.name\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 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 tabKey=\"leave\"\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 = tabStopAt(target)\n if (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 = focusOutsideTarget()\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 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: PinnedThemeRowProps) {\n return (\n <PinnedThemeRow {...props} title=\"Terminal\" subject=\"The terminal\" icon={<SquareTerminal />} />\n )\n}\n\n/**\n * The code palette (editor, diff and file views), chosen the same way as the\n * terminal: `'theme'` follows the interface theme, any catalogue record pins\n * that theme's syntax colours and the canvas they were measured on.\n */\nexport function CodeRow(props: PinnedThemeRowProps) {\n return <PinnedThemeRow {...props} title=\"Code\" subject=\"Code\" icon={<Code />} />\n}\n\ntype PinnedThemeRowProps = {\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\nfunction PinnedThemeRow(\n props: PinnedThemeRowProps & { title: string; subject: string; icon: JSX.Element }\n) {\n const options = createMemo<ThemeOption[]>(() => [\n {\n id: THEME_DEFAULT_ID,\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 = createMemo(() => {\n const selectedId = props.selectedId\n return options().find((option) => option.id === selectedId)\n })\n const description = () => {\n const option = selectedOption()\n return option && option.id !== THEME_DEFAULT_ID\n ? `${props.subject} follows ${option.name}.`\n : `${props.subject} follows the interface theme.`\n }\n return (\n <SettingsRow title={props.title} icon={props.icon} description={description()}>\n <ThemeSelectMenu\n label={props.title}\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":";;;;;;;;;;;;;;;;AAoDA,IAAMK,gBAAcqB,SAASpB,WAAiB;AAC9C,IAAMC,SAAOmB,SAASlB,IAAU;AAChC,IAAMC,SAAOiB,SAAShB,IAAU;AAChC,IAAMC,mBAAiBe,SAASd,cAAoB;AACpD,IAAMC,QAAMa,SAASZ,GAAS;AAE9B,SAAgBa,YAAYC,OAMzB;CACD,cAAA;EAAA,IAAAO,OAAAC,OAAA,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,gBAC3C5C,MAAI;GAAA,IAAC6C,OAAI;IAAA,OAAElB,MAAMI;GAAW;GAAAE,WACzBa,2BAAe;IAAA,IAAAC,QAAAC,QAAA;IAAAL,OAAAI,OACoCD,eAAe;IAAA,OAAAC;GAAA,EAAA,CAAA;EACnE,CAAA,GAAA,IAAA;EAAAJ,OAAAD,aAImCf,MAAMM,QAAQ;EAAAgB,QAAAC,QAAA;GAAA,IAAAC,MAxBjDrC,GAAG,wBAAwB;IAChC,YAAYa,MAAMK;IAClB,0BAA0B,CAACL,MAAMK;GACnC,CAAC,GAACoB,OAKUtC,GAAG,0CAA0C,EAAE,YAAY,CAACa,MAAMK,QAAQ,CAAC;GAACmB,QAAAD,IAAAG,KAAAC,UAAApB,MAAAgB,IAAAG,IAAAF,GAAA;GAAAC,SAAAF,IAAAK,KAAAD,UAAAlB,OAAAc,IAAAK,IAAAH,IAAA;GAAA,OAAAF;EAAA,GAAA;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AA;AAIhC"}
|
|
1
|
+
{"version":3,"file":"appearance-rows.js","names":["For","Show","createMemo","createSignal","onCleanup","ChevronDown","LucideChevronDown","Code","LucideCode","Moon","LucideMoon","SquareTerminal","LucideSquareTerminal","Sun","LucideSun","cn","THEME_DEFAULT_ID","Button","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","tabStopAt","PalettePreview","ThemeMenuPreview","fastIcon","SettingsRow","props","title","icon","Element","description","stacked","children","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","_$insert","_$createComponent","when","descriptionSlot","_el$7","_tmpl$2","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","id","name","preview","ThemeSelectMenu","label","selectedId","triggerPreview","options","disabled","onSelect","portalMount","setPortalMount","triggerElement","setTriggerElement","menuOpen","setMenuOpen","focusOutsideTarget","setFocusOutsideTarget","HTMLElement","restoreTriggerFocus","setRestoreTriggerFocus","focusLifecycleVersion","selected","matched","find","option","previewId","selectedName","_el$8","_tmpl$4","_$use","modal","open","onOpenChange","ref","as","variant","size","length","_el$9","_tmpl$3","_el$0","theme","tabKey","onInteractOutside","event","detail","originalEvent","type","closest","focusScope","ownerDocument","body","target","contains","focusTarget","onFocusOutside","preventDefault","onEscapeKeyDown","onCloseAutoFocus","lifecycleVersion","shouldRestore","focus","preventScroll","isConnected","queueMicrotask","activeElement","document","isMenuFocus","isTriggerFocus","value","onChange","each","textValue","closeOnSelect","_el$1","_tmpl$6","_el$10","_el$11","_tmpl$5","ThemeRow","appearance","themes","filter","map","_$memo","TerminalRow","PinnedThemeRow","_$mergeProps","subject","CodeRow","sectioned","selectedOption"],"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 {\n ChevronDown as LucideChevronDown,\n Code as LucideCode,\n Moon as LucideMoon,\n SquareTerminal as LucideSquareTerminal,\n Sun as LucideSun,\n} from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport { Button } from '../../ui/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n tabStopAt,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview, ThemeMenuPreview } from './theme-preview'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst Code = fastIcon(LucideCode)\nconst Moon = fastIcon(LucideMoon)\nconst SquareTerminal = fastIcon(LucideSquareTerminal)\nconst Sun = fastIcon(LucideSun)\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 {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\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; Tab\n * leaves the menu for the adjacent stop (`tabKey=\"leave\"`). The menu width\n * follows its content (bounded by the popper's available width) so a long\n * theme name and its description render fully instead of truncating at the\n * 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 focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const selected = createMemo(() => {\n const options = props.options\n const selectedId = props.selectedId\n const matched = options.find((option) => option.id === selectedId)\n if (matched) return matched\n const previewId = props.triggerPreview.id\n return options.find((option) => option.id === previewId)\n })\n const selectedName = () => selected()?.name ?? props.triggerPreview.name\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 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 tabKey=\"leave\"\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 = tabStopAt(target)\n if (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 = focusOutsideTarget()\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 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: PinnedThemeRowProps) {\n return (\n <PinnedThemeRow {...props} title=\"Terminal\" subject=\"The terminal\" icon={<SquareTerminal />} />\n )\n}\n\n/**\n * The code palette (editor, diff and file views), chosen the same way as the\n * terminal: `'theme'` follows the interface theme, any catalogue record pins\n * that theme's syntax colours and the canvas they were measured on.\n */\nexport function CodeRow(props: PinnedThemeRowProps) {\n return <PinnedThemeRow {...props} title=\"Code\" subject=\"Code\" icon={<Code />} />\n}\n\ntype PinnedThemeRowProps = {\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 /**\n * The row sits under a tab that already names its subject, so it is titled\n * for what it sets (\"Theme\") and carries no description. The menu keeps the\n * subject in its accessible name.\n */\n sectioned?: boolean\n onSelect: (id: string) => void\n}\n\nfunction PinnedThemeRow(\n props: PinnedThemeRowProps & { title: string; subject: string; icon: JSX.Element }\n) {\n const options = createMemo<ThemeOption[]>(() => [\n {\n id: THEME_DEFAULT_ID,\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 = createMemo(() => {\n const selectedId = props.selectedId\n return options().find((option) => option.id === selectedId)\n })\n const description = () => {\n const option = selectedOption()\n return option && option.id !== THEME_DEFAULT_ID\n ? `${props.subject} follows ${option.name}.`\n : `${props.subject} follows the interface theme.`\n }\n return (\n <SettingsRow\n title={props.sectioned ? 'Theme' : props.title}\n icon={props.icon}\n description={props.sectioned ? undefined : description()}\n >\n <ThemeSelectMenu\n label={props.title}\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":";;;;;;;;;;;;;;;;AAoDA,IAAMK,gBAAcqB,SAASpB,WAAiB;AAC9C,IAAMC,SAAOmB,SAASlB,IAAU;AAChC,IAAMC,SAAOiB,SAAShB,IAAU;AAChC,IAAMC,mBAAiBe,SAASd,cAAoB;AACpD,IAAMC,QAAMa,SAASZ,GAAS;AAE9B,SAAgBa,YAAYC,OAMzB;CACD,cAAA;EAAA,IAAAO,OAAAC,OAAA,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,gBAC3C5C,MAAI;GAAA,IAAC6C,OAAI;IAAA,OAAElB,MAAMI;GAAW;GAAAE,WACzBa,2BAAe;IAAA,IAAAC,QAAAC,QAAA;IAAAL,OAAAI,OACoCD,eAAe;IAAA,OAAAC;GAAA,EAAA,CAAA;EACnE,CAAA,GAAA,IAAA;EAAAJ,OAAAD,aAImCf,MAAMM,QAAQ;EAAAgB,QAAAC,QAAA;GAAA,IAAAC,MAxBjDrC,GAAG,wBAAwB;IAChC,YAAYa,MAAMK;IAClB,0BAA0B,CAACL,MAAMK;GACnC,CAAC,GAACoB,OAKUtC,GAAG,0CAA0C,EAAE,YA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OAAElC,MAAMC;IAAK;IAAA,IAClBkC,aAAU;KAAA,OAAEnC,MAAMmC;IAAU;IAAA,IAC5BC,iBAAc;KAAA,OAAEsF,eAAe,CAAC,EAAE1F,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"}
|
|
@@ -29,6 +29,9 @@ export type AppearanceDraft = Readonly<{
|
|
|
29
29
|
surface: 'theme' | 'frosted' | 'opaque';
|
|
30
30
|
reduceTransparency: boolean;
|
|
31
31
|
}>;
|
|
32
|
+
/** The sections a tabbed appearance surface splits its rows into. */
|
|
33
|
+
export declare const APPEARANCE_EDITOR_TABS: readonly ['global', 'terminal', 'code'];
|
|
34
|
+
export type AppearanceEditorTab = (typeof APPEARANCE_EDITOR_TABS)[number];
|
|
32
35
|
export type AppearanceEditorProps = {
|
|
33
36
|
draft: AppearanceDraft;
|
|
34
37
|
/** Resolved preview themes, including the host's validated accent overlay. */
|
|
@@ -70,6 +73,19 @@ export type AppearanceEditorProps = {
|
|
|
70
73
|
* row anatomy (glyph tile, title, description, trailing control).
|
|
71
74
|
*/
|
|
72
75
|
extraRows?: JSX.Element;
|
|
76
|
+
/**
|
|
77
|
+
* Draw one section of the option list instead of all of it. `global` holds
|
|
78
|
+
* the mode, the light and dark themes, accent, glass, reduced transparency,
|
|
79
|
+
* the theme library and the UI and Content typefaces. `terminal` holds the
|
|
80
|
+
* terminal palette and typeface, then `terminalRows`. `code` holds the code
|
|
81
|
+
* palette and typeface, then `codeRows`. Omitted, every row is drawn in one
|
|
82
|
+
* list as before, with no Terminal typeface row.
|
|
83
|
+
*/
|
|
84
|
+
section?: AppearanceEditorTab;
|
|
85
|
+
/** Host rows closing the Terminal section, composed like `extraRows`. */
|
|
86
|
+
terminalRows?: JSX.Element;
|
|
87
|
+
/** Host rows closing the Code section, composed like `extraRows`. */
|
|
88
|
+
codeRows?: JSX.Element;
|
|
73
89
|
/** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */
|
|
74
90
|
hideActions?: boolean;
|
|
75
91
|
/**
|
|
@@ -122,5 +138,15 @@ export type AppearancePopoverProps = AppearanceEditorProps & {
|
|
|
122
138
|
* the palette glyph the other toolbar actions carry.
|
|
123
139
|
*/
|
|
124
140
|
triggerVariant?: 'ghost' | 'toolbar';
|
|
141
|
+
/**
|
|
142
|
+
* Split the sheet into Global, Terminal and Code tabs under its header.
|
|
143
|
+
* `tab` selects one; with `tabs` set and no `tab`, the sheet keeps its own
|
|
144
|
+
* selection and opens on Global.
|
|
145
|
+
*/
|
|
146
|
+
tabs?: boolean;
|
|
147
|
+
tab?: AppearanceEditorTab;
|
|
148
|
+
onTabChange?: (tab: AppearanceEditorTab) => void;
|
|
149
|
+
/** Replaces the line under the title. */
|
|
150
|
+
description?: JSX.Element;
|
|
125
151
|
};
|
|
126
152
|
//# sourceMappingURL=appearance-types.d.ts.map
|
|
@@ -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,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;;;;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E,MAAM,CAAA;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACvB,oFAAoF;IACpF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IACxC;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,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;
|
|
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;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+EAA+E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
1
|
+
// src/components/composites/appearance-editor/appearance-types.ts
|
|
2
|
+
/** The sections a tabbed appearance surface splits its rows into. */
|
|
3
|
+
var APPEARANCE_EDITOR_TABS = [
|
|
4
|
+
"global",
|
|
5
|
+
"terminal",
|
|
6
|
+
"code"
|
|
7
|
+
];
|
|
8
|
+
export { APPEARANCE_EDITOR_TABS };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=appearance-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance-types.js","names":[],"sources":["../../../../src/components/composites/appearance-editor/appearance-types.ts"],"sourcesContent":["import type { JSX } from 'solid-js'\nimport type { AccentPreset, AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport type { AppearanceEditorFontSettings } from '#lib/appearance-font-settings'\n\nexport type AppearanceDraft = Readonly<{\n mode: 'system' | 'light' | 'dark'\n lightThemeId: string\n darkThemeId: string\n /**\n * The terminal palette: `'theme'` follows the interface theme, a theme id\n * pins that theme's terminal colours. Optional so a host without a terminal\n * preference renders no terminal row, the row's presence is this field's\n * presence, not a second prop that could disagree with the draft.\n */\n terminalThemeId?: string\n /**\n * The code palette (editor, diff, file views), on the same rule as\n * `terminalThemeId`: `'theme'` follows the interface theme, a theme id pins\n * that theme's syntax colours and canvas. Optional; absent renders no row.\n */\n codeThemeId?: string\n /** Theme default, a canonical preset id, or the host's custom accent draft. */\n accent: string\n /**\n * The UI, content and code typeface axes. Optional for compatibility with\n * hosts upgrading from the earlier appearance contract; omitted means the\n * shared System defaults.\n */\n fonts?: AppearanceEditorFontSettings\n surface: 'theme' | 'frosted' | 'opaque'\n reduceTransparency: boolean\n}>\n\n/** The sections a tabbed appearance surface splits its rows into. */\nexport const APPEARANCE_EDITOR_TABS = ['global', 'terminal', 'code'] as const\nexport type AppearanceEditorTab = (typeof APPEARANCE_EDITOR_TABS)[number]\n\nexport type AppearanceEditorProps = {\n draft: AppearanceDraft\n /** Resolved preview themes, including the host's validated accent overlay. */\n lightTheme: AdeaTheme\n darkTheme: AdeaTheme\n resolvedAppearance: 'light' | 'dark'\n themes: readonly AdeaThemeRecord[]\n accentOptions: readonly AccentPreset[]\n /**\n * The accents the previewed light/dark pair carries itself, offered after\n * `accentOptions`, `themeAccentsFor(lightThemeId, darkThemeId)` from\n * `@adea-ai/ui`. Supplied by the host because computing them measures through\n * the catalogue's normalization, which the editor does not load. Omitted, the\n * row offers the presets only.\n */\n themeAccentOptions?: readonly AccentPreset[]\n onChange: (patch: Partial<AppearanceDraft>) => void\n onSave: () => void\n onCancel: () => void\n onReset: () => void\n customAccentError?: string\n customAccentValue?: string\n saveDisabledReason?: string\n saving?: boolean\n recoveryNotice?: string\n surfaceCapability: { frosted: boolean; reason?: string; themeDefaultDescription?: string }\n /** Undefined means theme import is unavailable, never a working-looking action. */\n onManageThemes?: () => void\n /** Mount nested font menus inside the containing overlay when one exists. */\n menuPortalMount?: HTMLElement\n class?: string\n /**\n * Host rows closing the option list, inside the same bordered group as the\n * built-in rows. Compose them with `AppearanceSettingsRow` so they share the\n * row anatomy (glyph tile, title, description, trailing control).\n */\n extraRows?: JSX.Element\n /**\n * Draw one section of the option list instead of all of it. `global` holds\n * the mode, the light and dark themes, accent, glass, reduced transparency,\n * the theme library and the UI and Content typefaces. `terminal` holds the\n * terminal palette and typeface, then `terminalRows`. `code` holds the code\n * palette and typeface, then `codeRows`. Omitted, every row is drawn in one\n * list as before, with no Terminal typeface row.\n */\n section?: AppearanceEditorTab\n /** Host rows closing the Terminal section, composed like `extraRows`. */\n terminalRows?: JSX.Element\n /** Host rows closing the Code section, composed like `extraRows`. */\n codeRows?: JSX.Element\n /** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */\n hideActions?: boolean\n /**\n * Where the typeface settings sit in the option list. `inline`, the default\n * renders them between the accent and glass rows, where they read as one\n * more palette choice. `end` closes the list with them: hosts whose option\n * order is palette-and-surface first, text last, pass `end` instead of\n * recomposing the editor.\n */\n fontSettingsPlacement?: 'inline' | 'end'\n /**\n * How the accent row renders its choices. `swatches`, the default, paints\n * each choice as a colour circle in a wrapping grid, with Custom as one more\n * chip. `labels` renders every choice as a named chip, for hosts whose accent\n * contract is textual rather than chromatic. `row` draws the circles in ONE\n * equally spaced line, which holds at a narrow panel width where the grid\n * would wrap, and turns Custom into a button that opens the native colour\n * selector: choosing a colour there is the only thing that changes the draft,\n * so dismissing the selector leaves the accent as it was. The caption flag\n * has no effect on `row`, which has nothing to caption.\n */\n accentEntryStyle?: 'swatches' | 'labels' | 'row'\n /**\n * Whether the accent row leads with a \"Theme default\" swatch. Default on.\n * Hosts whose default accent already is one of the catalogue presets pass\n * `false`: the extra entry would duplicate the preset's own colour.\n */\n showThemeDefaultAccent?: boolean\n /**\n * Whether the swatch accent style captions its custom-colour entry. Default\n * on. `false` leaves the custom chip to name itself, for hosts where the\n * caption reads as a second \"Custom\" label on the control.\n */\n showCustomAccentCaption?: boolean\n /**\n * Whether each mode card names its axis with a sun, moon or monitor glyph\n * beside the label, as `ThemeModeToggle` does. Default off.\n */\n showModeIcons?: boolean\n}\n\nexport type AppearancePopoverProps = AppearanceEditorProps & {\n open: boolean\n onOpen: () => void\n onDismiss: () => void\n /**\n * The trigger's treatment. `ghost`, the default, is a quiet icon action.\n * `toolbar` is the variant for a control that opens a surface: it holds the\n * pressed rung while the sheet is open, so the one control that owns the\n * visible sheet never reads like its idle neighbours, and its tooltip repeats\n * the palette glyph the other toolbar actions carry.\n */\n triggerVariant?: 'ghost' | 'toolbar'\n /**\n * Split the sheet into Global, Terminal and Code tabs under its header.\n * `tab` selects one; with `tabs` set and no `tab`, the sheet keeps its own\n * selection and opens on Global.\n */\n tabs?: boolean\n tab?: AppearanceEditorTab\n onTabChange?: (tab: AppearanceEditorTab) => void\n /** Replaces the line under the title. */\n description?: JSX.Element\n}\n"],"mappings":";;AAkCA,IAAa,yBAAyB;CAAC;CAAU;CAAY;AAAM"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { type AppearanceEditorFontSettings } from '#lib/appearance-font-settings';
|
|
1
|
+
import { type AppearanceEditorFontAxis, type AppearanceEditorFontSettings } from '#lib/appearance-font-settings';
|
|
2
2
|
export type AppearanceFontSettingsGroupProps = {
|
|
3
3
|
settings: AppearanceEditorFontSettings;
|
|
4
4
|
menuPortalMount?: HTMLElement;
|
|
5
5
|
onChange: (settings: AppearanceEditorFontSettings) => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The axes to draw, in the catalogue's order. The default is UI, Content and
|
|
9
|
+
* Code: with no terminal row the terminal keeps following Code. A host that
|
|
10
|
+
* lists `terminal` lets it be set apart; until it is, the row shows Code's value.
|
|
11
|
+
*/
|
|
12
|
+
axes?: readonly AppearanceEditorFontAxis[];
|
|
13
|
+
/**
|
|
14
|
+
* The rows sit under a tab that already names their subject: each is titled
|
|
15
|
+
* "Font" and carries no description. Controls keep the axis in their
|
|
16
|
+
* accessible names.
|
|
17
|
+
*/
|
|
18
|
+
sectioned?: boolean;
|
|
7
19
|
};
|
|
8
20
|
/** Controlled font controls shared by AppearanceEditor and host-owned settings. */
|
|
9
21
|
export declare function AppearanceFontSettingsGroup(props: AppearanceFontSettingsGroupProps): import("solid-js").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-settings-group.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/font-settings-group.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"font-settings-group.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/font-settings-group.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAML,KAAK,wBAAwB,EAE7B,KAAK,4BAA4B,EAClC,MAAM,+BAA+B,CAAA;AAUtC,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,EAAE,4BAA4B,CAAA;IACtC,eAAe,CAAC,EAAE,WAAW,CAAA;IAC7B,QAAQ,EAAE,CAAC,QAAQ,EAAE,4BAA4B,KAAK,IAAI,CAAA;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,wBAAwB,EAAE,CAAA;IAC1C;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AA2KD,mFAAmF;AACnF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,kCA0HlF"}
|
|
@@ -2,24 +2,32 @@ import { DEFAULT_FONT_ID, fontOptions } from "../../../lib/font-catalog.js";
|
|
|
2
2
|
import { Button } from "../../ui/button/button.js";
|
|
3
3
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, tabStopAt } from "../../ui/dropdown-menu/dropdown-menu.js";
|
|
4
4
|
import { InputControl } from "../../ui/input/input-control.js";
|
|
5
|
-
import { normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize } from "../../../lib/appearance-font-settings.js";
|
|
5
|
+
import { normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, resolveAppearanceEditorFontSettings } from "../../../lib/appearance-font-settings.js";
|
|
6
6
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
7
|
-
import { createComponent, effect, insert, setAttribute, template } from "solid-js/web";
|
|
8
|
-
import { BookOpen, ChevronDown, Code2, PanelsTopLeft } from "lucide-solid";
|
|
9
|
-
import { For, createMemo, createSignal, createUniqueId } from "solid-js";
|
|
7
|
+
import { createComponent, effect, insert, memo, setAttribute, setStyleProperty, template } from "solid-js/web";
|
|
8
|
+
import { BookOpen, ChevronDown, Code2, PanelsTopLeft, SquareTerminal } from "lucide-solid";
|
|
9
|
+
import { For, Show, createMemo, createSignal, createUniqueId } from "solid-js";
|
|
10
10
|
// src/components/composites/appearance-editor/font-settings-group.tsx
|
|
11
11
|
var _tmpl$ = /*#__PURE__*/ template(`<span class=truncate>`);
|
|
12
12
|
var _tmpl$2 = /*#__PURE__*/ template(`<div class=global-appearance-font-settings>`);
|
|
13
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<
|
|
13
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div class="mt-0.5 truncate text-xs text-muted-foreground">`);
|
|
14
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<section class="flex items-center gap-3 px-4 py-4"><span class="flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4"aria-hidden=true></span><div class="min-w-0 flex-1"><h3 class="text-sm font-medium"></h3></div><div class="flex shrink-0 items-center gap-2"><div class="flex items-center gap-1"><span aria-hidden=true class="text-xs text-muted-foreground">px</span></div><span class=sr-only>Enter a whole number from <!> to <!> pixels.`);
|
|
14
15
|
var BookOpen$1 = fastIcon(BookOpen);
|
|
15
16
|
var ChevronDown$1 = fastIcon(ChevronDown);
|
|
16
17
|
var Code2$1 = fastIcon(Code2);
|
|
18
|
+
var PanelsTopLeft$1 = fastIcon(PanelsTopLeft);
|
|
19
|
+
var SquareTerminal$1 = fastIcon(SquareTerminal);
|
|
20
|
+
var DEFAULT_FONT_ROW_AXES = [
|
|
21
|
+
"ui",
|
|
22
|
+
"content",
|
|
23
|
+
"code"
|
|
24
|
+
];
|
|
17
25
|
var FONT_ROWS = [
|
|
18
26
|
{
|
|
19
27
|
axis: "ui",
|
|
20
28
|
label: "UI",
|
|
21
29
|
description: "Controls and interface labels.",
|
|
22
|
-
icon:
|
|
30
|
+
icon: PanelsTopLeft$1
|
|
23
31
|
},
|
|
24
32
|
{
|
|
25
33
|
axis: "content",
|
|
@@ -30,8 +38,14 @@ var FONT_ROWS = [
|
|
|
30
38
|
{
|
|
31
39
|
axis: "code",
|
|
32
40
|
label: "Code",
|
|
33
|
-
description: "Code,
|
|
41
|
+
description: "Code, diffs, and file paths.",
|
|
34
42
|
icon: Code2$1
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
axis: "terminal",
|
|
46
|
+
label: "Terminal",
|
|
47
|
+
description: "Terminals and agent CLIs.",
|
|
48
|
+
icon: SquareTerminal$1
|
|
35
49
|
}
|
|
36
50
|
];
|
|
37
51
|
var catalogFontOptions = fontOptions.filter((option) => option.id !== DEFAULT_FONT_ID);
|
|
@@ -40,6 +54,7 @@ function FontFamilyMenu(props) {
|
|
|
40
54
|
const [restoreTriggerFocus, setRestoreTriggerFocus] = createSignal(false);
|
|
41
55
|
const [triggerElement, setTriggerElement] = createSignal();
|
|
42
56
|
const selectedLabel = () => fontOptions.find((option) => option.id === props.family)?.label ?? fontOptions.find((option) => option.id === "system")?.label ?? "System";
|
|
57
|
+
const selectedFamilyVariable = () => (fontOptions.find((option) => option.id === props.family) ?? fontOptions.find((option) => option.id === "system"))?.familyVariables[props.axis] ?? "--font-family-system";
|
|
43
58
|
return createComponent(DropdownMenu, {
|
|
44
59
|
modal: false,
|
|
45
60
|
get open() {
|
|
@@ -66,6 +81,7 @@ function FontFamilyMenu(props) {
|
|
|
66
81
|
return [(() => {
|
|
67
82
|
var _el$ = _tmpl$();
|
|
68
83
|
insert(_el$, selectedLabel);
|
|
84
|
+
effect((_$p) => setStyleProperty(_el$, "font-family", `var(${selectedFamilyVariable()})`));
|
|
69
85
|
return _el$;
|
|
70
86
|
})(), createComponent(ChevronDown$1, {
|
|
71
87
|
"aria-hidden": "true",
|
|
@@ -162,12 +178,15 @@ function AppearanceFontSettingsGroup(props) {
|
|
|
162
178
|
const [sizeDrafts, setSizeDrafts] = createSignal({});
|
|
163
179
|
const sizeHintPrefix = createUniqueId();
|
|
164
180
|
const settings = createMemo(() => normalizeAppearanceEditorFontSettings(props.settings).settings);
|
|
181
|
+
const resolved = createMemo(() => resolveAppearanceEditorFontSettings(settings()));
|
|
182
|
+
const axes = () => props.axes ?? DEFAULT_FONT_ROW_AXES;
|
|
183
|
+
const rows = createMemo(() => FONT_ROWS.filter((row) => axes().includes(row.axis)));
|
|
165
184
|
const updateAxis = (axis, patch) => {
|
|
166
185
|
const current = settings();
|
|
167
186
|
props.onChange({
|
|
168
187
|
...current,
|
|
169
188
|
[axis]: {
|
|
170
|
-
...
|
|
189
|
+
...resolved()[axis],
|
|
171
190
|
...patch
|
|
172
191
|
}
|
|
173
192
|
});
|
|
@@ -175,21 +194,23 @@ function AppearanceFontSettingsGroup(props) {
|
|
|
175
194
|
const commitSize = (axis) => {
|
|
176
195
|
const input = sizeDrafts()[axis];
|
|
177
196
|
if (input === void 0) return;
|
|
178
|
-
const size = normalizeAppearanceEditorFontSize(input,
|
|
197
|
+
const size = normalizeAppearanceEditorFontSize(input, resolved()[axis].size);
|
|
179
198
|
setSizeDrafts((current) => {
|
|
180
199
|
const next = { ...current };
|
|
181
200
|
delete next[axis];
|
|
182
201
|
return next;
|
|
183
202
|
});
|
|
184
|
-
if (size !==
|
|
203
|
+
if (size !== resolved()[axis].size) updateAxis(axis, { size });
|
|
185
204
|
};
|
|
186
205
|
return (() => {
|
|
187
206
|
var _el$2 = _tmpl$2();
|
|
188
207
|
insert(_el$2, createComponent(For, {
|
|
189
|
-
each
|
|
208
|
+
get each() {
|
|
209
|
+
return rows();
|
|
210
|
+
},
|
|
190
211
|
children: (row) => {
|
|
191
212
|
const Icon = row.icon;
|
|
192
|
-
const value = () =>
|
|
213
|
+
const value = () => resolved()[row.axis];
|
|
193
214
|
const inputValue = () => sizeDrafts()[row.axis] ?? String(value().size);
|
|
194
215
|
const sizeHintId = `${sizeHintPrefix}-${row.axis}-font-size-help`;
|
|
195
216
|
const sizeIsInvalid = () => {
|
|
@@ -199,15 +220,30 @@ function AppearanceFontSettingsGroup(props) {
|
|
|
199
220
|
return !Number.isFinite(parsed) || !Number.isInteger(parsed) || parsed < 10 || parsed > 32;
|
|
200
221
|
};
|
|
201
222
|
return (() => {
|
|
202
|
-
var _el$3 = _tmpl$
|
|
223
|
+
var _el$3 = _tmpl$4(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$9.nextSibling, _el$14 = _el$1.firstChild.nextSibling, _el$15 = _el$14.nextSibling.nextSibling;
|
|
203
224
|
_el$15.nextSibling;
|
|
204
225
|
insert(_el$4, createComponent(Icon, {}));
|
|
205
|
-
insert(_el$6, () =>
|
|
206
|
-
|
|
226
|
+
insert(_el$6, (() => {
|
|
227
|
+
var _c$ = memo(() => !!props.sectioned);
|
|
228
|
+
return () => _c$() ? "Font" : row.label;
|
|
229
|
+
})());
|
|
230
|
+
insert(_el$5, createComponent(Show, {
|
|
231
|
+
get when() {
|
|
232
|
+
return !props.sectioned;
|
|
233
|
+
},
|
|
234
|
+
get children() {
|
|
235
|
+
var _el$7 = _tmpl$3();
|
|
236
|
+
insert(_el$7, () => row.description);
|
|
237
|
+
return _el$7;
|
|
238
|
+
}
|
|
239
|
+
}), null);
|
|
207
240
|
insert(_el$8, createComponent(FontFamilyMenu, {
|
|
208
241
|
get label() {
|
|
209
242
|
return row.label;
|
|
210
243
|
},
|
|
244
|
+
get axis() {
|
|
245
|
+
return row.axis;
|
|
246
|
+
},
|
|
211
247
|
get family() {
|
|
212
248
|
return value().family;
|
|
213
249
|
},
|