@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
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
* dark one's and nearly none at all on the palest accent.
|
|
141
141
|
*
|
|
142
142
|
* Both values come from @adea-ai/themes, so the accent blocks below are the same
|
|
143
|
-
* rule rather than a matching one
|
|
143
|
+
* rule rather than a matching one — which is what they were not, before.
|
|
144
144
|
*/
|
|
145
145
|
--primary-hover: oklch(0.4643 0.1668 301.69);
|
|
146
146
|
/*
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
--chrome: var(--surface);
|
|
154
154
|
/*
|
|
155
155
|
* Below the canvas: a code well, an inset panel. Not a catalogue role, because
|
|
156
|
-
* the catalogue's ladder only goes *up* from the canvas
|
|
156
|
+
* the catalogue's ladder only goes *up* from the canvas — the four rungs it
|
|
157
157
|
* derives are all surfaces something sits on. This is the one value in the
|
|
158
158
|
* ladder that runs the other way, so it is computed rather than mapped.
|
|
159
159
|
*
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
* dark one's and nearly none at all on the palest accent.
|
|
285
285
|
*
|
|
286
286
|
* Both values come from @adea-ai/themes, so the accent blocks below are the same
|
|
287
|
-
* rule rather than a matching one
|
|
287
|
+
* rule rather than a matching one — which is what they were not, before.
|
|
288
288
|
*/
|
|
289
289
|
--primary-hover: oklch(0.7823 0.1668 301.69);
|
|
290
290
|
/*
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
--chrome: var(--surface);
|
|
298
298
|
/*
|
|
299
299
|
* Below the canvas: a code well, an inset panel. Not a catalogue role, because
|
|
300
|
-
* the catalogue's ladder only goes *up* from the canvas
|
|
300
|
+
* the catalogue's ladder only goes *up* from the canvas — the four rungs it
|
|
301
301
|
* derives are all surfaces something sits on. This is the one value in the
|
|
302
302
|
* ladder that runs the other way, so it is computed rather than mapped.
|
|
303
303
|
*
|
package/dist/r/theming.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.158.0",
|
|
4
4
|
"description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adea",
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"check:packed": "bun scripts/check-packed.ts"
|
|
172
172
|
},
|
|
173
173
|
"dependencies": {
|
|
174
|
-
"@adea-ai/themes": "
|
|
174
|
+
"@adea-ai/themes": ">=0.12.0 <0.13.0",
|
|
175
175
|
"@corvu/calendar": "^0.1.2",
|
|
176
176
|
"@corvu/drawer": "^0.2.4",
|
|
177
177
|
"@corvu/otp-field": "^0.1.4",
|
package/registry.json
CHANGED
|
@@ -2355,7 +2355,7 @@
|
|
|
2355
2355
|
"title": "Appearance Editor",
|
|
2356
2356
|
"description": "",
|
|
2357
2357
|
"dependencies": [
|
|
2358
|
-
"@adea-ai/themes
|
|
2358
|
+
"@adea-ai/themes@>=0.12.0 <0.13.0",
|
|
2359
2359
|
"@kobalte/core@^0.13.14",
|
|
2360
2360
|
"lucide-solid@^1.71.0"
|
|
2361
2361
|
],
|
|
@@ -2367,6 +2367,7 @@
|
|
|
2367
2367
|
"@adea-ai/ui/input",
|
|
2368
2368
|
"@adea-ai/ui/sheet",
|
|
2369
2369
|
"@adea-ai/ui/switch",
|
|
2370
|
+
"@adea-ai/ui/tabs",
|
|
2370
2371
|
"@adea-ai/ui/theme",
|
|
2371
2372
|
"lib"
|
|
2372
2373
|
],
|
|
@@ -3547,7 +3548,7 @@
|
|
|
3547
3548
|
"title": "Theming",
|
|
3548
3549
|
"description": "",
|
|
3549
3550
|
"dependencies": [
|
|
3550
|
-
"@adea-ai/themes
|
|
3551
|
+
"@adea-ai/themes@>=0.12.0 <0.13.0",
|
|
3551
3552
|
"@kobalte/core@^0.13.14",
|
|
3552
3553
|
"lucide-solid@^1.71.0"
|
|
3553
3554
|
],
|
|
@@ -3732,7 +3733,7 @@
|
|
|
3732
3733
|
"title": "Class-name and token helpers",
|
|
3733
3734
|
"description": "The private helpers the components import: the class-name merge, the variant recipes, the token manifest and the theme bridge. Installed automatically as a peer of any component that needs it.",
|
|
3734
3735
|
"dependencies": [
|
|
3735
|
-
"@adea-ai/themes
|
|
3736
|
+
"@adea-ai/themes@>=0.12.0 <0.13.0",
|
|
3736
3737
|
"class-variance-authority@^0.7.1",
|
|
3737
3738
|
"cn@^0.5.2"
|
|
3738
3739
|
],
|
|
@@ -37,13 +37,16 @@ import {
|
|
|
37
37
|
PanelsTopLeft as LucidePanelsTopLeft,
|
|
38
38
|
SlidersHorizontal as LucideSlidersHorizontal,
|
|
39
39
|
} from 'lucide-solid'
|
|
40
|
-
import { Show, createSignal, createUniqueId } from 'solid-js'
|
|
40
|
+
import { For, Show, createSignal, createUniqueId } from 'solid-js'
|
|
41
41
|
import { cn } from '#lib/utils'
|
|
42
42
|
import { ActionButton } from '../action-button'
|
|
43
43
|
import { Button } from '../../ui/button'
|
|
44
44
|
import { Input } from '../../ui/input'
|
|
45
45
|
import { AppearanceFontSettingsGroup } from './font-settings-group'
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,
|
|
48
|
+
type AppearanceEditorFontAxis,
|
|
49
|
+
} from '#lib/appearance-font-settings'
|
|
47
50
|
import { THEME_DEFAULT_ID } from '#lib/theme-defaults'
|
|
48
51
|
|
|
49
52
|
import { Switch } from '../../ui/switch'
|
|
@@ -57,10 +60,16 @@ import {
|
|
|
57
60
|
SheetTitle,
|
|
58
61
|
SheetTrigger,
|
|
59
62
|
} from '../../ui/sheet'
|
|
60
|
-
import
|
|
63
|
+
import {
|
|
64
|
+
APPEARANCE_EDITOR_TABS,
|
|
65
|
+
type AppearanceEditorProps,
|
|
66
|
+
type AppearanceEditorTab,
|
|
67
|
+
type AppearancePopoverProps,
|
|
68
|
+
} from './appearance-types'
|
|
61
69
|
import { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'
|
|
62
70
|
import { CodeRow, SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'
|
|
63
71
|
import { fastIcon } from '#lib/fast-icon'
|
|
72
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../ui/tabs'
|
|
64
73
|
|
|
65
74
|
// lucide icons drawn from a cloned template (see fastIcon).
|
|
66
75
|
const EyeOff = fastIcon(LucideEyeOff)
|
|
@@ -99,8 +108,35 @@ export function AppearanceEditor(props: AppearanceEditorProps) {
|
|
|
99
108
|
: props.draft.surface === 'frosted'
|
|
100
109
|
? 'Theme-colored glass where supported.'
|
|
101
110
|
: (props.surfaceCapability.themeDefaultDescription ?? "Uses this theme's default surface.")
|
|
111
|
+
// One list when no section is asked for; otherwise only that section's rows.
|
|
112
|
+
const shows = (section: AppearanceEditorTab) =>
|
|
113
|
+
props.section === undefined || props.section === section
|
|
114
|
+
const sectionFonts = (): readonly AppearanceEditorFontAxis[] =>
|
|
115
|
+
props.section === 'global'
|
|
116
|
+
? ['ui', 'content']
|
|
117
|
+
: props.section === 'terminal'
|
|
118
|
+
? ['terminal']
|
|
119
|
+
: props.section === 'code'
|
|
120
|
+
? ['code']
|
|
121
|
+
: ['ui', 'content', 'code']
|
|
122
|
+
const fontRows = () => (
|
|
123
|
+
<AppearanceFontSettingsGroup
|
|
124
|
+
settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}
|
|
125
|
+
menuPortalMount={props.menuPortalMount}
|
|
126
|
+
disabled={props.saving}
|
|
127
|
+
axes={sectionFonts()}
|
|
128
|
+
sectioned={props.section === 'terminal' || props.section === 'code'}
|
|
129
|
+
onChange={(fonts) => props.onChange({ fonts })}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
const previewTheme = () =>
|
|
133
|
+
props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme
|
|
102
134
|
return (
|
|
103
|
-
<div
|
|
135
|
+
<div
|
|
136
|
+
data-appearance-editor
|
|
137
|
+
data-appearance-section={props.section}
|
|
138
|
+
class={cn('min-w-0', props.class)}
|
|
139
|
+
>
|
|
104
140
|
<Show when={props.recoveryNotice}>
|
|
105
141
|
{(recoveryNoticeSlot) => (
|
|
106
142
|
<p role="status" class="px-4 py-2 text-sm text-muted-foreground">
|
|
@@ -108,130 +144,136 @@ export function AppearanceEditor(props: AppearanceEditorProps) {
|
|
|
108
144
|
</p>
|
|
109
145
|
)}
|
|
110
146
|
</Show>
|
|
111
|
-
<
|
|
147
|
+
<Show when={shows('global')}>
|
|
148
|
+
<ModeChoices {...props} />
|
|
149
|
+
</Show>
|
|
112
150
|
<div class="divide-y divide-border rounded-lg border">
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
151
|
+
<Show when={shows('global')}>
|
|
152
|
+
<ThemeRow
|
|
153
|
+
appearance="light"
|
|
154
|
+
selectedId={props.draft.lightThemeId}
|
|
155
|
+
preview={props.lightTheme}
|
|
156
|
+
themes={props.themes}
|
|
157
|
+
disabled={props.saving}
|
|
158
|
+
onSelect={(lightThemeId) => props.onChange({ lightThemeId })}
|
|
159
|
+
/>
|
|
160
|
+
<ThemeRow
|
|
161
|
+
appearance="dark"
|
|
162
|
+
selectedId={props.draft.darkThemeId}
|
|
163
|
+
preview={props.darkTheme}
|
|
164
|
+
themes={props.themes}
|
|
165
|
+
disabled={props.saving}
|
|
166
|
+
onSelect={(darkThemeId) => props.onChange({ darkThemeId })}
|
|
167
|
+
/>
|
|
168
|
+
</Show>
|
|
129
169
|
{/* The row exists only when the host carries a terminal preference:
|
|
130
170
|
the draft field is the show/hide switch, so the editor can never
|
|
131
171
|
render a terminal row that writes nothing. */}
|
|
132
|
-
<Show when={props.draft.terminalThemeId !== undefined}>
|
|
172
|
+
<Show when={shows('terminal') && props.draft.terminalThemeId !== undefined}>
|
|
133
173
|
<TerminalRow
|
|
174
|
+
sectioned={props.section !== undefined}
|
|
134
175
|
selectedId={props.draft.terminalThemeId ?? THEME_DEFAULT_ID}
|
|
135
|
-
preview={
|
|
176
|
+
preview={previewTheme()}
|
|
136
177
|
themes={props.themes}
|
|
137
178
|
disabled={props.saving}
|
|
138
179
|
onSelect={(terminalThemeId) => props.onChange({ terminalThemeId })}
|
|
139
180
|
/>
|
|
140
181
|
</Show>
|
|
182
|
+
<Show when={props.section === 'terminal'}>
|
|
183
|
+
{fontRows()}
|
|
184
|
+
{props.terminalRows}
|
|
185
|
+
</Show>
|
|
141
186
|
{/* The same switch for code: the row exists only when the host stores it. */}
|
|
142
|
-
<Show when={props.draft.codeThemeId !== undefined}>
|
|
187
|
+
<Show when={shows('code') && props.draft.codeThemeId !== undefined}>
|
|
143
188
|
<CodeRow
|
|
189
|
+
sectioned={props.section !== undefined}
|
|
144
190
|
selectedId={props.draft.codeThemeId ?? THEME_DEFAULT_ID}
|
|
145
|
-
preview={
|
|
191
|
+
preview={previewTheme()}
|
|
146
192
|
themes={props.themes}
|
|
147
193
|
disabled={props.saving}
|
|
148
194
|
onSelect={(codeThemeId) => props.onChange({ codeThemeId })}
|
|
149
195
|
/>
|
|
150
196
|
</Show>
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
197
|
+
<Show when={props.section === 'code'}>
|
|
198
|
+
{fontRows()}
|
|
199
|
+
{props.codeRows}
|
|
200
|
+
</Show>
|
|
201
|
+
<Show when={shows('global')}>
|
|
202
|
+
<SettingsRow
|
|
203
|
+
title="Accent"
|
|
204
|
+
icon={<SlidersHorizontal />}
|
|
205
|
+
description={accentDescription()}
|
|
206
|
+
>
|
|
207
|
+
<AccentChoices {...props} />
|
|
208
|
+
</SettingsRow>
|
|
209
|
+
<Show when={custom()}>
|
|
210
|
+
<div class="px-4 py-3">
|
|
211
|
+
<label class="mb-2 block text-xs font-medium" for={`${errorId}-input`}>
|
|
212
|
+
Custom accent
|
|
213
|
+
</label>
|
|
214
|
+
<Input
|
|
215
|
+
id={`${errorId}-input`}
|
|
216
|
+
value={props.draft.accent}
|
|
217
|
+
disabled={props.saving}
|
|
218
|
+
aria-invalid={!!props.customAccentError}
|
|
219
|
+
aria-describedby={props.customAccentError ? errorId : undefined}
|
|
220
|
+
onInput={(event) => props.onChange({ accent: event.currentTarget.value })}
|
|
221
|
+
/>
|
|
222
|
+
<Show when={props.customAccentError}>
|
|
223
|
+
{(customAccentErrorSlot) => (
|
|
224
|
+
<p id={errorId} role="alert" class="mt-1 text-xs text-foreground">
|
|
225
|
+
{customAccentErrorSlot()}
|
|
226
|
+
</p>
|
|
227
|
+
)}
|
|
228
|
+
</Show>
|
|
229
|
+
</div>
|
|
230
|
+
</Show>
|
|
231
|
+
{/* Inline, the typefaces read as one more palette choice; `end` hands
|
|
232
|
+
the closing slot to them for hosts whose order is palette and
|
|
233
|
+
surface first, text last. */}
|
|
234
|
+
<Show when={props.fontSettingsPlacement !== 'end'}>{fontRows()}</Show>
|
|
235
|
+
<SettingsRow title="Glass" icon={<PanelsTopLeft />} description={glassDescription()}>
|
|
236
|
+
<GlassChoices {...props} />
|
|
237
|
+
</SettingsRow>
|
|
238
|
+
<Show when={!props.surfaceCapability.frosted && props.surfaceCapability.reason}>
|
|
239
|
+
<p role="status" class="px-4 py-2 text-xs text-muted-foreground">
|
|
240
|
+
{props.surfaceCapability.reason}
|
|
241
|
+
</p>
|
|
242
|
+
</Show>
|
|
243
|
+
<SettingsRow
|
|
244
|
+
title="Reduce transparency"
|
|
245
|
+
icon={<EyeOff />}
|
|
246
|
+
description="Prefer solid surfaces, including during live preview."
|
|
247
|
+
>
|
|
248
|
+
<Switch
|
|
249
|
+
checked={props.draft.reduceTransparency}
|
|
162
250
|
disabled={props.saving}
|
|
163
|
-
|
|
164
|
-
aria-
|
|
165
|
-
onInput={(event) => props.onChange({ accent: event.currentTarget.value })}
|
|
251
|
+
onChange={(reduceTransparency: boolean) => props.onChange({ reduceTransparency })}
|
|
252
|
+
aria-label="Reduce transparency"
|
|
166
253
|
/>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
{/* Inline, the typefaces read as one more palette choice; `end` hands
|
|
177
|
-
the closing slot to them for hosts whose order is palette and
|
|
178
|
-
surface first, text last. */}
|
|
179
|
-
<Show when={props.fontSettingsPlacement !== 'end'}>
|
|
180
|
-
<AppearanceFontSettingsGroup
|
|
181
|
-
settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}
|
|
182
|
-
menuPortalMount={props.menuPortalMount}
|
|
183
|
-
disabled={props.saving}
|
|
184
|
-
onChange={(fonts) => props.onChange({ fonts })}
|
|
185
|
-
/>
|
|
186
|
-
</Show>
|
|
187
|
-
<SettingsRow title="Glass" icon={<PanelsTopLeft />} description={glassDescription()}>
|
|
188
|
-
<GlassChoices {...props} />
|
|
189
|
-
</SettingsRow>
|
|
190
|
-
<Show when={!props.surfaceCapability.frosted && props.surfaceCapability.reason}>
|
|
191
|
-
<p role="status" class="px-4 py-2 text-xs text-muted-foreground">
|
|
192
|
-
{props.surfaceCapability.reason}
|
|
193
|
-
</p>
|
|
194
|
-
</Show>
|
|
195
|
-
<SettingsRow
|
|
196
|
-
title="Reduce transparency"
|
|
197
|
-
icon={<EyeOff />}
|
|
198
|
-
description="Prefer solid surfaces, including during live preview."
|
|
199
|
-
>
|
|
200
|
-
<Switch
|
|
201
|
-
checked={props.draft.reduceTransparency}
|
|
202
|
-
disabled={props.saving}
|
|
203
|
-
onChange={(reduceTransparency: boolean) => props.onChange({ reduceTransparency })}
|
|
204
|
-
aria-label="Reduce transparency"
|
|
205
|
-
/>
|
|
206
|
-
</SettingsRow>
|
|
207
|
-
<SettingsRow
|
|
208
|
-
title="Theme library"
|
|
209
|
-
icon={<Palette />}
|
|
210
|
-
description={
|
|
211
|
-
props.onManageThemes
|
|
212
|
-
? 'Manage themes through the application.'
|
|
213
|
-
: 'Theme import is unavailable.'
|
|
214
|
-
}
|
|
215
|
-
>
|
|
216
|
-
<Button
|
|
217
|
-
type="button"
|
|
218
|
-
size="sm"
|
|
219
|
-
variant="outline"
|
|
220
|
-
disabled={!props.onManageThemes || props.saving}
|
|
221
|
-
onClick={() => props.onManageThemes?.()}
|
|
254
|
+
</SettingsRow>
|
|
255
|
+
<SettingsRow
|
|
256
|
+
title="Theme library"
|
|
257
|
+
icon={<Palette />}
|
|
258
|
+
description={
|
|
259
|
+
props.onManageThemes
|
|
260
|
+
? 'Manage themes through the application.'
|
|
261
|
+
: 'Theme import is unavailable.'
|
|
262
|
+
}
|
|
222
263
|
>
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
264
|
+
<Button
|
|
265
|
+
type="button"
|
|
266
|
+
size="sm"
|
|
267
|
+
variant="outline"
|
|
268
|
+
disabled={!props.onManageThemes || props.saving}
|
|
269
|
+
onClick={() => props.onManageThemes?.()}
|
|
270
|
+
>
|
|
271
|
+
Manage themes
|
|
272
|
+
</Button>
|
|
273
|
+
</SettingsRow>
|
|
274
|
+
<Show when={props.fontSettingsPlacement === 'end'}>{fontRows()}</Show>
|
|
275
|
+
{props.extraRows}
|
|
233
276
|
</Show>
|
|
234
|
-
{props.extraRows}
|
|
235
277
|
</div>
|
|
236
278
|
<Show when={!props.hideActions}>
|
|
237
279
|
{/* Sticky so Save/Cancel stay reachable in a tall scroll container: the
|
|
@@ -305,11 +347,26 @@ export function AppearanceEditorActions(props: AppearanceEditorProps) {
|
|
|
305
347
|
)
|
|
306
348
|
}
|
|
307
349
|
|
|
350
|
+
const TAB_LABELS: Readonly<Record<AppearanceEditorTab, string>> = {
|
|
351
|
+
global: 'Global',
|
|
352
|
+
terminal: 'Terminal',
|
|
353
|
+
code: 'Code',
|
|
354
|
+
}
|
|
355
|
+
|
|
308
356
|
/** The editor in an inset Sheet docked beside the main view: the body scrolls and
|
|
309
357
|
* Reset/Cancel/Save sit in the panel's full-width footer, always reachable.
|
|
310
358
|
* Dismissal (Escape, the close button, an outside click) is `onDismiss`. */
|
|
311
359
|
export function AppearancePopover(props: AppearancePopoverProps) {
|
|
312
360
|
const [menuPortalMount, setMenuPortalMount] = createSignal<HTMLElement>()
|
|
361
|
+
const [ownTab, setOwnTab] = createSignal<AppearanceEditorTab>('global')
|
|
362
|
+
const tabbed = () => props.tabs === true || props.tab !== undefined
|
|
363
|
+
const tab = () => props.tab ?? ownTab()
|
|
364
|
+
const selectTab = (value: string) => {
|
|
365
|
+
const next = APPEARANCE_EDITOR_TABS.find((candidate) => candidate === value)
|
|
366
|
+
if (!next) return
|
|
367
|
+
setOwnTab(next)
|
|
368
|
+
props.onTabChange?.(next)
|
|
369
|
+
}
|
|
313
370
|
|
|
314
371
|
return (
|
|
315
372
|
<Sheet open={props.open} onOpenChange={(open) => (open ? props.onOpen() : props.onDismiss())}>
|
|
@@ -333,13 +390,48 @@ export function AppearancePopover(props: AppearancePopoverProps) {
|
|
|
333
390
|
<SheetContent side="end" closeLabel="Close appearance settings" ref={setMenuPortalMount}>
|
|
334
391
|
<SheetHeader>
|
|
335
392
|
<SheetTitle>Appearance</SheetTitle>
|
|
336
|
-
|
|
337
|
-
|
|
393
|
+
{/* One short line on the caption rung, the size other panel headers
|
|
394
|
+
use for their detail line. */}
|
|
395
|
+
<SheetDescription class="truncate text-xs">
|
|
396
|
+
{props.description ?? 'Changes preview live. Save keeps them.'}
|
|
338
397
|
</SheetDescription>
|
|
339
398
|
</SheetHeader>
|
|
340
|
-
<
|
|
341
|
-
|
|
342
|
-
|
|
399
|
+
<Show
|
|
400
|
+
when={tabbed()}
|
|
401
|
+
fallback={
|
|
402
|
+
<SheetBody>
|
|
403
|
+
<AppearanceEditor {...props} menuPortalMount={menuPortalMount()} hideActions />
|
|
404
|
+
</SheetBody>
|
|
405
|
+
}
|
|
406
|
+
>
|
|
407
|
+
<Tabs value={tab()} onChange={selectTab} class="min-h-0 flex-1 gap-0">
|
|
408
|
+
<div class="shrink-0 border-b border-border px-4 py-2">
|
|
409
|
+
<TabsList appearance="segmented" fill aria-label="Appearance section">
|
|
410
|
+
<For each={APPEARANCE_EDITOR_TABS}>
|
|
411
|
+
{(value) => (
|
|
412
|
+
<TabsTrigger appearance="segmented" value={value} class="flex-1">
|
|
413
|
+
{TAB_LABELS[value]}
|
|
414
|
+
</TabsTrigger>
|
|
415
|
+
)}
|
|
416
|
+
</For>
|
|
417
|
+
</TabsList>
|
|
418
|
+
</div>
|
|
419
|
+
<SheetBody>
|
|
420
|
+
<For each={APPEARANCE_EDITOR_TABS}>
|
|
421
|
+
{(value) => (
|
|
422
|
+
<TabsContent value={value}>
|
|
423
|
+
<AppearanceEditor
|
|
424
|
+
{...props}
|
|
425
|
+
section={value}
|
|
426
|
+
menuPortalMount={menuPortalMount()}
|
|
427
|
+
hideActions
|
|
428
|
+
/>
|
|
429
|
+
</TabsContent>
|
|
430
|
+
)}
|
|
431
|
+
</For>
|
|
432
|
+
</SheetBody>
|
|
433
|
+
</Tabs>
|
|
434
|
+
</Show>
|
|
343
435
|
<SheetFooter>
|
|
344
436
|
<AppearanceEditorActions {...props} />
|
|
345
437
|
</SheetFooter>
|
|
@@ -376,6 +376,12 @@ type PinnedThemeRowProps = {
|
|
|
376
376
|
preview: AdeaTheme
|
|
377
377
|
themes: readonly AdeaThemeRecord[]
|
|
378
378
|
disabled?: boolean
|
|
379
|
+
/**
|
|
380
|
+
* The row sits under a tab that already names its subject, so it is titled
|
|
381
|
+
* for what it sets ("Theme") and carries no description. The menu keeps the
|
|
382
|
+
* subject in its accessible name.
|
|
383
|
+
*/
|
|
384
|
+
sectioned?: boolean
|
|
379
385
|
onSelect: (id: string) => void
|
|
380
386
|
}
|
|
381
387
|
|
|
@@ -407,7 +413,11 @@ function PinnedThemeRow(
|
|
|
407
413
|
: `${props.subject} follows the interface theme.`
|
|
408
414
|
}
|
|
409
415
|
return (
|
|
410
|
-
<SettingsRow
|
|
416
|
+
<SettingsRow
|
|
417
|
+
title={props.sectioned ? 'Theme' : props.title}
|
|
418
|
+
icon={props.icon}
|
|
419
|
+
description={props.sectioned ? undefined : description()}
|
|
420
|
+
>
|
|
411
421
|
<ThemeSelectMenu
|
|
412
422
|
label={props.title}
|
|
413
423
|
selectedId={props.selectedId}
|
|
@@ -31,6 +31,10 @@ export type AppearanceDraft = Readonly<{
|
|
|
31
31
|
reduceTransparency: boolean
|
|
32
32
|
}>
|
|
33
33
|
|
|
34
|
+
/** The sections a tabbed appearance surface splits its rows into. */
|
|
35
|
+
export const APPEARANCE_EDITOR_TABS = ['global', 'terminal', 'code'] as const
|
|
36
|
+
export type AppearanceEditorTab = (typeof APPEARANCE_EDITOR_TABS)[number]
|
|
37
|
+
|
|
34
38
|
export type AppearanceEditorProps = {
|
|
35
39
|
draft: AppearanceDraft
|
|
36
40
|
/** Resolved preview themes, including the host's validated accent overlay. */
|
|
@@ -68,6 +72,19 @@ export type AppearanceEditorProps = {
|
|
|
68
72
|
* row anatomy (glyph tile, title, description, trailing control).
|
|
69
73
|
*/
|
|
70
74
|
extraRows?: JSX.Element
|
|
75
|
+
/**
|
|
76
|
+
* Draw one section of the option list instead of all of it. `global` holds
|
|
77
|
+
* the mode, the light and dark themes, accent, glass, reduced transparency,
|
|
78
|
+
* the theme library and the UI and Content typefaces. `terminal` holds the
|
|
79
|
+
* terminal palette and typeface, then `terminalRows`. `code` holds the code
|
|
80
|
+
* palette and typeface, then `codeRows`. Omitted, every row is drawn in one
|
|
81
|
+
* list as before, with no Terminal typeface row.
|
|
82
|
+
*/
|
|
83
|
+
section?: AppearanceEditorTab
|
|
84
|
+
/** Host rows closing the Terminal section, composed like `extraRows`. */
|
|
85
|
+
terminalRows?: JSX.Element
|
|
86
|
+
/** Host rows closing the Code section, composed like `extraRows`. */
|
|
87
|
+
codeRows?: JSX.Element
|
|
71
88
|
/** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */
|
|
72
89
|
hideActions?: boolean
|
|
73
90
|
/**
|
|
@@ -121,4 +138,14 @@ export type AppearancePopoverProps = AppearanceEditorProps & {
|
|
|
121
138
|
* the palette glyph the other toolbar actions carry.
|
|
122
139
|
*/
|
|
123
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
|
|
124
151
|
}
|