@burdenoff/fe-libs 2026.1119.5 → 2026.1119.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrome/HeaderThemeSwitcher.js +1 -1
- package/dist/chrome/PersonaSurfaceControls.js +82 -189
- package/dist/chrome/PersonaViewsList.d.ts +28 -0
- package/dist/chrome/PersonaViewsList.js +139 -0
- package/dist/chrome/ThemePreferences.js +16 -16
- package/dist/chrome/appearance/AppearanceColourSection.d.ts +17 -0
- package/dist/chrome/appearance/AppearanceColourSection.js +337 -0
- package/dist/chrome/appearance/AppearanceDisplaySection.d.ts +7 -0
- package/dist/chrome/appearance/AppearanceDisplaySection.js +137 -0
- package/dist/chrome/appearance/AppearanceModeDepth.d.ts +11 -0
- package/dist/chrome/appearance/AppearanceModeDepth.js +158 -0
- package/dist/chrome/appearance/AppearancePreferences.d.ts +13 -0
- package/dist/chrome/appearance/AppearancePreferences.js +308 -0
- package/dist/chrome/appearance/AppearancePreview.d.ts +23 -0
- package/dist/chrome/appearance/AppearancePreview.js +218 -0
- package/dist/chrome/appearance/AppearanceThemeSection.d.ts +14 -0
- package/dist/chrome/appearance/AppearanceThemeSection.js +162 -0
- package/dist/chrome/appearance/ColourPanel.d.ts +37 -0
- package/dist/chrome/appearance/ColourPanel.js +264 -0
- package/dist/chrome/appearance/ThemeDialog.d.ts +21 -0
- package/dist/chrome/appearance/ThemeDialog.js +378 -0
- package/dist/chrome/appearance/appearanceShared.d.ts +24 -0
- package/dist/chrome/appearance/appearanceShared.js +46 -0
- package/dist/chrome/appearance/appearanceUi.d.ts +49 -0
- package/dist/chrome/appearance/appearanceUi.js +98 -0
- package/dist/chrome/appearance/useAppearanceLabels.d.ts +181 -0
- package/dist/chrome/appearance/useAppearanceLabels.js +259 -0
- package/dist/chrome/index.d.ts +1 -0
- package/dist/chrome/personaViewOptions.d.ts +8 -0
- package/dist/chrome/personaViewOptions.js +14 -0
- package/dist/chrome/shell/NewMenu.d.ts +13 -1
- package/dist/chrome/shell/NewMenu.js +27 -14
- package/dist/chrome/shell/ShellSidebar.js +2 -0
- package/dist/chrome/shell/SidebarProfileMenu.d.ts +36 -4
- package/dist/chrome/shell/SidebarProfileMenu.js +423 -331
- package/dist/chrome/shell/WorkspaceAccountCard.d.ts +22 -0
- package/dist/chrome/shell/WorkspaceAccountCard.js +102 -0
- package/dist/chrome/shell/pageHost.d.ts +19 -0
- package/dist/chrome/shell/pageHost.js +21 -0
- package/dist/chrome/shell/pageWidth.d.ts +39 -0
- package/dist/chrome/shell/pageWidth.js +18 -0
- package/dist/chrome/shellLabelManifest.d.ts +6 -0
- package/dist/chrome.js +26 -25
- package/dist/platform-pages/AppearanceSettingsPage.d.ts +11 -1
- package/dist/platform-pages/AppearanceSettingsPage.js +15 -8
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +346 -345
- package/dist/shared/backgrounds/BackgroundSettingsSection.d.ts +11 -0
- package/dist/shared/backgrounds/BackgroundSettingsSection.js +67 -0
- package/dist/shared/backgrounds/backgroundSectionLabels.d.ts +14 -0
- package/dist/shared/backgrounds/backgroundSectionLabels.js +36 -0
- package/dist/shared/backgrounds/index.d.ts +3 -0
- package/dist/shared/backgrounds/useBackgroundColors.js +3 -2
- package/dist/shared/backgrounds/useStartPageBackground.d.ts +12 -0
- package/dist/shared/backgrounds/useStartPageBackground.js +23 -0
- package/dist/shared/providers/AppShellProvider.d.ts +20 -1
- package/dist/shared/providers/AppShellProvider.js +230 -222
- package/dist/shared/providers/shell/PaletteThemeProvider.d.ts +13 -0
- package/dist/shared/providers/shell/PaletteThemeProvider.js +366 -0
- package/dist/shared/providers/shell/ThemeProvider.d.ts +9 -76
- package/dist/shared/providers/shell/ThemeProvider.js +63 -55
- package/dist/shared/providers/shell/appearance/colour.d.ts +29 -0
- package/dist/shared/providers/shell/appearance/colour.js +79 -0
- package/dist/shared/providers/shell/appearance/contrastFix.d.ts +70 -0
- package/dist/shared/providers/shell/appearance/contrastFix.js +117 -0
- package/dist/shared/providers/shell/appearance/index.d.ts +9 -0
- package/dist/shared/providers/shell/appearance/model.d.ts +68 -0
- package/dist/shared/providers/shell/appearance/model.js +92 -0
- package/dist/shared/providers/shell/appearance/operations.d.ts +70 -0
- package/dist/shared/providers/shell/appearance/operations.js +160 -0
- package/dist/shared/providers/shell/appearance/palettes.d.ts +111 -0
- package/dist/shared/providers/shell/appearance/palettes.js +460 -0
- package/dist/shared/providers/shell/appearance/storage.d.ts +39 -0
- package/dist/shared/providers/shell/appearance/storage.js +186 -0
- package/dist/shared/providers/shell/appearance/tokens.d.ts +5 -0
- package/dist/shared/providers/shell/appearance/tokens.js +43 -0
- package/dist/shared/providers/shell/appearance/types.d.ts +80 -0
- package/dist/shared/providers/shell/appearance/types.js +28 -0
- package/dist/shared/providers/shell/index.d.ts +1 -1
- package/dist/shared/providers/shell/responsiveDisplaySettings.d.ts +27 -0
- package/dist/shared/providers/shell/responsiveDisplaySettings.js +6 -0
- package/dist/shared/providers/shell/themeContext.d.ts +162 -0
- package/dist/shared/providers/shell/themeContext.js +4 -0
- package/dist/shared-backgrounds.js +4 -1
- package/dist/shell-native/system-bars.d.ts +5 -1
- package/dist/shell-native/system-bars.js +1 -1
- package/dist/ui/dropdown-menu.js +2 -0
- package/dist/ui/popover.js +1 -0
- package/dist/ui/select.js +1 -0
- package/package.json +5 -1
- package/src/shared/styles/page-widths.css +38 -0
- package/src/shared/tokens/build/brands/healthybowl.css +25 -3
- package/src/shared/tokens/build/themes.css +266 -0
- package/src/shared/tokens/display-settings.css +569 -0
- package/src/shared/tokens/tokens.css +4 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { AppearanceControls } from '../../shared/providers/shell/themeContext';
|
|
3
|
+
import { ColourDraft } from './ColourPanel';
|
|
4
|
+
import { AppearanceLabels } from './useAppearanceLabels';
|
|
5
|
+
/** The colour being added or changed (`editId`: the saved colour being changed). */
|
|
6
|
+
export type ColourPanelState = (ColourDraft & {
|
|
7
|
+
editId: string | null;
|
|
8
|
+
}) | null;
|
|
9
|
+
export declare function AppearanceColourSection({ appearance, brand, labels, panel, setPanel, addColourButton, }: {
|
|
10
|
+
appearance: AppearanceControls;
|
|
11
|
+
brand: string;
|
|
12
|
+
labels: AppearanceLabels;
|
|
13
|
+
/** The open panel (the page's live preview shows its colour before it is saved). */
|
|
14
|
+
panel: ColourPanelState;
|
|
15
|
+
setPanel: (next: ColourPanelState | ((current: ColourPanelState) => ColourPanelState)) => void;
|
|
16
|
+
addColourButton: RefObject<HTMLButtonElement | null>;
|
|
17
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { normalizeHex as e } from "../../shared/providers/shell/appearance/colour.js";
|
|
2
|
+
import { solveAccent as t } from "../../shared/providers/shell/appearance/contrastFix.js";
|
|
3
|
+
import { groundOf as n, resolveAppearance as r } from "../../shared/providers/shell/appearance/model.js";
|
|
4
|
+
import { ACCENT_PRESETS as i, NEW_COLOUR_START as a, PALETTES as o, SITE_COLOURS as s, paletteSurfaces as c } from "../../shared/providers/shell/appearance/palettes.js";
|
|
5
|
+
import { Button as l } from "../../ui/button.js";
|
|
6
|
+
import { Input as u } from "../../ui/input.js";
|
|
7
|
+
import { cn as d } from "../../utils/cn.js";
|
|
8
|
+
import "../../utils/index.js";
|
|
9
|
+
import { ColourPanel as f, formatRatio as p } from "./ColourPanel.js";
|
|
10
|
+
import { accentNameOf as m, notify as h, selectedSwatchOf as g, swatchTabIndex as _ } from "./appearanceShared.js";
|
|
11
|
+
import { AppearanceSection as v, Swatch as y, useRadioGroupKeys as b } from "./appearanceUi.js";
|
|
12
|
+
import { useRef as x, useState as S } from "react";
|
|
13
|
+
import { AlertTriangle as C, Check as w, ChevronDown as T, ChevronUp as E, GripVertical as D, Palette as O, Pencil as k, Plus as ee, Trash2 as A } from "lucide-react";
|
|
14
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
15
|
+
// src/chrome/appearance/AppearanceColourSection.tsx
|
|
16
|
+
function P({ appearance: u, brand: d, labels: x, panel: T, setPanel: E, addColourButton: D }) {
|
|
17
|
+
let A = b(), { settings: P, resolved: I, systemDark: L } = u, [R, z] = S(!1), B = n(P.palette, I.scheme, P.darkDepth, !0), V = o[P.palette], H = !!V.fixedAccent, U = T ? e(T.hex) : null, W = () => {
|
|
18
|
+
z(!1), E({
|
|
19
|
+
editId: null,
|
|
20
|
+
hex: a,
|
|
21
|
+
name: x.colourDefaultName(P.colours.length + 1)
|
|
22
|
+
});
|
|
23
|
+
}, G = () => {
|
|
24
|
+
E(null), requestAnimationFrame(() => D.current?.focus());
|
|
25
|
+
}, K = () => {
|
|
26
|
+
if (!T) return;
|
|
27
|
+
let t = e(T.hex);
|
|
28
|
+
if (!t) return;
|
|
29
|
+
let n = T.name.trim() || x.colourDefaultName(P.colours.length + 1);
|
|
30
|
+
if (T.editId) u.updateColour(T.editId, {
|
|
31
|
+
hex: t,
|
|
32
|
+
name: n
|
|
33
|
+
}), h(x, x.colourUpdated(n));
|
|
34
|
+
else {
|
|
35
|
+
let e = u.addColour({
|
|
36
|
+
hex: t,
|
|
37
|
+
name: n
|
|
38
|
+
});
|
|
39
|
+
if (!e) {
|
|
40
|
+
h(x, x.colourFull);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
h(x, x.colourSaved(e.name));
|
|
44
|
+
}
|
|
45
|
+
G();
|
|
46
|
+
}, q = (e) => {
|
|
47
|
+
let t = P.colours.find((t) => t.id === e);
|
|
48
|
+
if (!t) return;
|
|
49
|
+
let n = u.snapshot(), r = P.accent === `colour:${e}`;
|
|
50
|
+
u.deleteColour(e), P.colours.length <= 1 && z(!1), h(x, r ? x.colourDeletedAccent(t.name) : x.colourDeleted(t.name), () => {
|
|
51
|
+
u.restore(n), z(!0);
|
|
52
|
+
});
|
|
53
|
+
}, J = U ? V.modes.map((e) => ({
|
|
54
|
+
scheme: e,
|
|
55
|
+
surfaces: c(P.palette, e, P.darkDepth),
|
|
56
|
+
accent: t(U, n(P.palette, e, P.darkDepth, !0))
|
|
57
|
+
})) : [], Y = m(P.accent, u, x), X = !I.auto && !P.accent.startsWith("preset:") && P.accent !== "auto" && (I.accent.adjusted || I.accent.inkAdjusted), Z = r({
|
|
58
|
+
...P,
|
|
59
|
+
accent: "auto",
|
|
60
|
+
colours: []
|
|
61
|
+
}, {
|
|
62
|
+
systemDark: L,
|
|
63
|
+
brand: d
|
|
64
|
+
}).accent, Q = (e) => {
|
|
65
|
+
if (e === "purple") return x.palettes.fluidgrids.name;
|
|
66
|
+
if (e === "cyan" && d === "fluidgrids") return x.palettes.classic.name;
|
|
67
|
+
}, $ = g(P, H);
|
|
68
|
+
return /* @__PURE__ */ N(v, {
|
|
69
|
+
id: "appearance-colour",
|
|
70
|
+
icon: /* @__PURE__ */ M(O, {}),
|
|
71
|
+
title: x.colourTitle,
|
|
72
|
+
description: x.colourDescription,
|
|
73
|
+
children: [
|
|
74
|
+
H && /* @__PURE__ */ N("p", {
|
|
75
|
+
className: "flex items-start gap-2 text-sm text-text-secondary",
|
|
76
|
+
children: [/* @__PURE__ */ M(C, {
|
|
77
|
+
className: "mt-0.5 size-4 shrink-0 text-text-muted",
|
|
78
|
+
"aria-hidden": "true"
|
|
79
|
+
}), x.colourFixed]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ N("div", {
|
|
82
|
+
role: "radiogroup",
|
|
83
|
+
"aria-labelledby": "appearance-colour-title",
|
|
84
|
+
onKeyDown: A,
|
|
85
|
+
className: "flex flex-col gap-3",
|
|
86
|
+
"data-testid": "appearance-colours",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ M("span", {
|
|
89
|
+
className: "text-sm font-medium text-text-primary",
|
|
90
|
+
children: x.presetsTitle
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ N("div", {
|
|
93
|
+
className: "flex flex-wrap gap-1",
|
|
94
|
+
children: [/* @__PURE__ */ M(y, {
|
|
95
|
+
selected: $ === "auto",
|
|
96
|
+
name: x.themeColour,
|
|
97
|
+
sub: x.tagDefault,
|
|
98
|
+
fill: Z.fill,
|
|
99
|
+
on: Z.on,
|
|
100
|
+
tabIndex: _("auto", $, !0),
|
|
101
|
+
onSelect: () => u.setAccent("auto"),
|
|
102
|
+
testId: "appearance-accent-auto"
|
|
103
|
+
}), !H && i.map((e) => {
|
|
104
|
+
let t = `preset:${e.id}`, n = r({
|
|
105
|
+
...P,
|
|
106
|
+
accent: t
|
|
107
|
+
}, {
|
|
108
|
+
systemDark: L,
|
|
109
|
+
brand: d
|
|
110
|
+
}).accent;
|
|
111
|
+
return /* @__PURE__ */ M(y, {
|
|
112
|
+
selected: $ === t,
|
|
113
|
+
name: x.presets[e.id],
|
|
114
|
+
sub: Q(e.id),
|
|
115
|
+
fill: n.fill,
|
|
116
|
+
on: n.on,
|
|
117
|
+
tabIndex: _(t, $, !1),
|
|
118
|
+
onSelect: () => u.setAccent(t),
|
|
119
|
+
testId: `appearance-accent-${e.id}`
|
|
120
|
+
}, e.id);
|
|
121
|
+
})]
|
|
122
|
+
}),
|
|
123
|
+
!H && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("span", {
|
|
124
|
+
className: "flex items-baseline gap-2 text-sm font-medium text-text-primary",
|
|
125
|
+
children: [x.mine, /* @__PURE__ */ M("span", {
|
|
126
|
+
className: "text-xs font-normal text-text-muted",
|
|
127
|
+
children: x.mineHint
|
|
128
|
+
})]
|
|
129
|
+
}), /* @__PURE__ */ N("div", {
|
|
130
|
+
className: "flex flex-wrap gap-1",
|
|
131
|
+
"data-testid": "appearance-my-colours",
|
|
132
|
+
children: [P.colours.length === 0 && /* @__PURE__ */ M("span", {
|
|
133
|
+
className: "text-xs text-text-muted",
|
|
134
|
+
children: x.mineEmpty
|
|
135
|
+
}), P.colours.map((e) => {
|
|
136
|
+
let n = t(e.hex, B), r = `colour:${e.id}`;
|
|
137
|
+
return /* @__PURE__ */ M(y, {
|
|
138
|
+
selected: $ === r,
|
|
139
|
+
name: e.name,
|
|
140
|
+
sub: n.adjusted ? x.adjusted : e.hex,
|
|
141
|
+
fill: e.hex,
|
|
142
|
+
on: n.on,
|
|
143
|
+
tabIndex: _(r, $, !1),
|
|
144
|
+
onSelect: () => u.setAccent(`colour:${e.id}`),
|
|
145
|
+
testId: `appearance-colour-${e.id}`
|
|
146
|
+
}, e.id);
|
|
147
|
+
})]
|
|
148
|
+
})] })
|
|
149
|
+
]
|
|
150
|
+
}),
|
|
151
|
+
!H && /* @__PURE__ */ N("div", {
|
|
152
|
+
className: "flex flex-wrap items-center gap-2",
|
|
153
|
+
children: [/* @__PURE__ */ N(l, {
|
|
154
|
+
ref: D,
|
|
155
|
+
type: "button",
|
|
156
|
+
variant: "outline",
|
|
157
|
+
size: "sm",
|
|
158
|
+
onClick: W,
|
|
159
|
+
disabled: P.colours.length >= 24,
|
|
160
|
+
"data-testid": "appearance-colour-add",
|
|
161
|
+
children: [/* @__PURE__ */ M(ee, { "aria-hidden": "true" }), x.addColour]
|
|
162
|
+
}), P.colours.length > 0 && /* @__PURE__ */ N(l, {
|
|
163
|
+
type: "button",
|
|
164
|
+
variant: "ghost",
|
|
165
|
+
size: "sm",
|
|
166
|
+
"aria-expanded": R,
|
|
167
|
+
onClick: () => {
|
|
168
|
+
E(null), z((e) => !e);
|
|
169
|
+
},
|
|
170
|
+
"data-testid": "appearance-colour-manage",
|
|
171
|
+
children: [M(R ? w : k, { "aria-hidden": "true" }), R ? x.done : x.manage]
|
|
172
|
+
})]
|
|
173
|
+
}),
|
|
174
|
+
T && !H && /* @__PURE__ */ M("div", {
|
|
175
|
+
onKeyDown: (e) => {
|
|
176
|
+
e.key === "Escape" && (e.stopPropagation(), G());
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ M(f, {
|
|
179
|
+
editing: T.editId !== null,
|
|
180
|
+
draft: T,
|
|
181
|
+
onDraft: (e) => E((t) => t && {
|
|
182
|
+
...t,
|
|
183
|
+
...e
|
|
184
|
+
}),
|
|
185
|
+
onSave: K,
|
|
186
|
+
onCancel: G,
|
|
187
|
+
checks: J,
|
|
188
|
+
quickPicks: s.map((e) => ({
|
|
189
|
+
id: e.id,
|
|
190
|
+
name: x.presets[e.id],
|
|
191
|
+
hex: e.hex
|
|
192
|
+
})),
|
|
193
|
+
labels: x
|
|
194
|
+
})
|
|
195
|
+
}),
|
|
196
|
+
R && !H && P.colours.length > 0 && /* @__PURE__ */ M(F, {
|
|
197
|
+
appearance: u,
|
|
198
|
+
labels: x,
|
|
199
|
+
onDelete: q,
|
|
200
|
+
onEdit: (e) => {
|
|
201
|
+
z(!1), E({
|
|
202
|
+
editId: e.id,
|
|
203
|
+
hex: e.hex,
|
|
204
|
+
name: e.name
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}),
|
|
208
|
+
X && /* @__PURE__ */ N("p", {
|
|
209
|
+
className: "flex items-start gap-2 text-sm text-text-secondary",
|
|
210
|
+
"data-testid": "appearance-adjusted",
|
|
211
|
+
children: [/* @__PURE__ */ M(C, {
|
|
212
|
+
className: "mt-0.5 size-4 shrink-0 text-[var(--color-status-warning-text)]",
|
|
213
|
+
"aria-hidden": "true"
|
|
214
|
+
}), x.adjustedLine(Y, x.schemes[I.scheme], I.accent.fill, p(I.accent.onRatio), I.accent.ink)]
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function F({ appearance: e, labels: t, onDelete: n, onEdit: r }) {
|
|
220
|
+
let i = e.settings.colours, a = x(null), [o, s] = S(null), c = (n, r) => {
|
|
221
|
+
let a = i.find((e) => e.id === n), o = r.trim();
|
|
222
|
+
a && o && o !== a.name && (e.updateColour(n, { name: o }), h(t, t.colourRenamed(o)));
|
|
223
|
+
}, f = (t, n) => {
|
|
224
|
+
e.moveColour(t, n), requestAnimationFrame(() => {
|
|
225
|
+
document.querySelector(`[data-move="${t}"]:not(:disabled)`)?.focus();
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
return /* @__PURE__ */ N("div", {
|
|
229
|
+
className: "flex flex-col gap-2",
|
|
230
|
+
"data-testid": "appearance-manage-colours",
|
|
231
|
+
children: [/* @__PURE__ */ M("ul", {
|
|
232
|
+
"aria-label": t.mine,
|
|
233
|
+
className: "flex flex-col divide-y divide-border-subtle rounded-card border border-border-subtle",
|
|
234
|
+
children: i.map((p, m) => /* @__PURE__ */ N("li", {
|
|
235
|
+
draggable: !0,
|
|
236
|
+
onDragStart: (e) => {
|
|
237
|
+
a.current = p.id, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", p.id);
|
|
238
|
+
},
|
|
239
|
+
onDragOver: (e) => {
|
|
240
|
+
a.current && (e.preventDefault(), s(p.id));
|
|
241
|
+
},
|
|
242
|
+
onDragLeave: () => s((e) => e === p.id ? null : e),
|
|
243
|
+
onDrop: (n) => {
|
|
244
|
+
n.preventDefault();
|
|
245
|
+
let r = a.current;
|
|
246
|
+
if (a.current = null, s(null), r && r !== p.id) {
|
|
247
|
+
e.moveColour(r, m);
|
|
248
|
+
let n = i.find((e) => e.id === r);
|
|
249
|
+
n && h(t, t.colourMoved(n.name));
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
onDragEnd: () => {
|
|
253
|
+
a.current = null, s(null);
|
|
254
|
+
},
|
|
255
|
+
className: d("flex flex-wrap items-center gap-2 px-2 py-1.5", o === p.id && "bg-[var(--color-accent-soft)]"),
|
|
256
|
+
"data-testid": `appearance-manage-${p.id}`,
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ M("span", {
|
|
259
|
+
className: "cursor-grab text-text-muted",
|
|
260
|
+
title: t.dragHandle,
|
|
261
|
+
children: /* @__PURE__ */ M(D, {
|
|
262
|
+
className: "size-4",
|
|
263
|
+
"aria-hidden": "true"
|
|
264
|
+
})
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ M("span", {
|
|
267
|
+
"aria-hidden": "true",
|
|
268
|
+
className: "size-6 shrink-0 rounded-full bg-[var(--appearance-swatch)] shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--color-text-primary)_25%,transparent)]",
|
|
269
|
+
style: { "--appearance-swatch": p.hex }
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ M(u, {
|
|
272
|
+
type: "text",
|
|
273
|
+
defaultValue: p.name,
|
|
274
|
+
maxLength: 24,
|
|
275
|
+
autoComplete: "off",
|
|
276
|
+
"aria-label": t.nameFor(p.name),
|
|
277
|
+
className: "h-8 min-w-0 flex-[1_1_8rem]",
|
|
278
|
+
onBlur: (e) => c(p.id, e.target.value),
|
|
279
|
+
onKeyDown: (e) => {
|
|
280
|
+
e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
|
|
281
|
+
}
|
|
282
|
+
}, `${p.id}-${p.name}`),
|
|
283
|
+
/* @__PURE__ */ M("span", {
|
|
284
|
+
className: "font-mono text-xs text-text-muted",
|
|
285
|
+
children: p.hex
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ N("span", {
|
|
288
|
+
className: "ms-auto flex items-center gap-0.5",
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ M(l, {
|
|
291
|
+
type: "button",
|
|
292
|
+
variant: "ghost",
|
|
293
|
+
size: "icon-sm",
|
|
294
|
+
"aria-label": t.moveUp(p.name),
|
|
295
|
+
disabled: m === 0,
|
|
296
|
+
"data-move": p.id,
|
|
297
|
+
onClick: () => f(p.id, m - 1),
|
|
298
|
+
children: /* @__PURE__ */ M(E, { "aria-hidden": "true" })
|
|
299
|
+
}),
|
|
300
|
+
/* @__PURE__ */ M(l, {
|
|
301
|
+
type: "button",
|
|
302
|
+
variant: "ghost",
|
|
303
|
+
size: "icon-sm",
|
|
304
|
+
"aria-label": t.moveDown(p.name),
|
|
305
|
+
disabled: m === i.length - 1,
|
|
306
|
+
"data-move": p.id,
|
|
307
|
+
onClick: () => f(p.id, m + 1),
|
|
308
|
+
children: /* @__PURE__ */ M(T, { "aria-hidden": "true" })
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ M(l, {
|
|
311
|
+
type: "button",
|
|
312
|
+
variant: "ghost",
|
|
313
|
+
size: "icon-sm",
|
|
314
|
+
"aria-label": t.changeColour(p.name),
|
|
315
|
+
onClick: () => r(p),
|
|
316
|
+
children: /* @__PURE__ */ M(O, { "aria-hidden": "true" })
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ M(l, {
|
|
319
|
+
type: "button",
|
|
320
|
+
variant: "ghost",
|
|
321
|
+
size: "icon-sm",
|
|
322
|
+
"aria-label": t.deleteColour(p.name),
|
|
323
|
+
onClick: () => n(p.id),
|
|
324
|
+
"data-testid": `appearance-colour-delete-${p.id}`,
|
|
325
|
+
children: /* @__PURE__ */ M(A, { "aria-hidden": "true" })
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
})
|
|
329
|
+
]
|
|
330
|
+
}, p.id))
|
|
331
|
+
}), /* @__PURE__ */ M("p", {
|
|
332
|
+
className: "text-xs text-text-muted",
|
|
333
|
+
children: t.manageHint
|
|
334
|
+
})]
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
export { P as AppearanceColourSection };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AppearanceControls, ThemeContextValue } from '../../shared/providers/shell/themeContext';
|
|
2
|
+
import { AppearanceLabels } from './useAppearanceLabels';
|
|
3
|
+
export declare function AppearanceDisplaySection({ appearance, theme, labels, }: {
|
|
4
|
+
appearance: AppearanceControls;
|
|
5
|
+
theme: ThemeContextValue;
|
|
6
|
+
labels: AppearanceLabels;
|
|
7
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { PALETTES as e } from "../../shared/providers/shell/appearance/palettes.js";
|
|
2
|
+
import { Switch as t } from "../../ui/switch.js";
|
|
3
|
+
import { AppearanceSection as n, SelectedCheck as r, Tag as i, optionClass as a, useRadioGroupKeys as o } from "./appearanceUi.js";
|
|
4
|
+
import { useId as s } from "react";
|
|
5
|
+
import { Layers as c } from "lucide-react";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
// src/chrome/appearance/AppearanceDisplaySection.tsx
|
|
8
|
+
var d = [
|
|
9
|
+
"compact",
|
|
10
|
+
"comfortable",
|
|
11
|
+
"spacious"
|
|
12
|
+
], f = [
|
|
13
|
+
"small",
|
|
14
|
+
"default",
|
|
15
|
+
"large"
|
|
16
|
+
], p = [
|
|
17
|
+
"off",
|
|
18
|
+
"subtle",
|
|
19
|
+
"full"
|
|
20
|
+
];
|
|
21
|
+
function m({ appearance: r, theme: i, labels: a }) {
|
|
22
|
+
let m = s(), g = o(), _ = !!e[r.settings.palette].solid;
|
|
23
|
+
return /* @__PURE__ */ u(n, {
|
|
24
|
+
id: "appearance-display",
|
|
25
|
+
icon: /* @__PURE__ */ l(c, {}),
|
|
26
|
+
title: a.displayTitle,
|
|
27
|
+
description: a.displayDescription,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ l(h, {
|
|
30
|
+
id: `${m}-density`,
|
|
31
|
+
name: a.density,
|
|
32
|
+
hint: a.densityHint,
|
|
33
|
+
value: i.density,
|
|
34
|
+
options: d.map((e) => ({
|
|
35
|
+
value: e,
|
|
36
|
+
label: a.densities[e]
|
|
37
|
+
})),
|
|
38
|
+
defaultValue: r.displayDefaults.density,
|
|
39
|
+
defaultLabel: a.tagDefault,
|
|
40
|
+
onChange: i.setDensity,
|
|
41
|
+
keys: g,
|
|
42
|
+
testId: "appearance-density"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ l(h, {
|
|
45
|
+
id: `${m}-text`,
|
|
46
|
+
name: a.textSize,
|
|
47
|
+
hint: a.textSizeHint,
|
|
48
|
+
value: i.typography,
|
|
49
|
+
options: f.map((e) => ({
|
|
50
|
+
value: e,
|
|
51
|
+
label: a.textSizes[e]
|
|
52
|
+
})),
|
|
53
|
+
defaultValue: r.displayDefaults.typography,
|
|
54
|
+
defaultLabel: a.tagDefault,
|
|
55
|
+
onChange: i.setTypography,
|
|
56
|
+
keys: g,
|
|
57
|
+
testId: "appearance-text"
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ l(h, {
|
|
60
|
+
id: `${m}-glass`,
|
|
61
|
+
name: a.glass,
|
|
62
|
+
hint: _ ? a.glassSolid : a.glassHint,
|
|
63
|
+
value: i.glass,
|
|
64
|
+
options: p.map((e) => ({
|
|
65
|
+
value: e,
|
|
66
|
+
label: a.glasses[e]
|
|
67
|
+
})),
|
|
68
|
+
defaultValue: r.displayDefaults.glass,
|
|
69
|
+
defaultLabel: a.tagDefault,
|
|
70
|
+
onChange: i.setGlass,
|
|
71
|
+
keys: g,
|
|
72
|
+
disabled: _,
|
|
73
|
+
testId: "appearance-glass"
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ u("div", {
|
|
76
|
+
className: "flex items-center justify-between gap-4",
|
|
77
|
+
children: [/* @__PURE__ */ u("div", {
|
|
78
|
+
className: "flex min-w-0 flex-col",
|
|
79
|
+
children: [/* @__PURE__ */ l("span", {
|
|
80
|
+
id: `${m}-motion`,
|
|
81
|
+
className: "text-sm font-medium text-text-primary",
|
|
82
|
+
children: a.reduceMotion
|
|
83
|
+
}), /* @__PURE__ */ l("span", {
|
|
84
|
+
className: "text-xs text-text-muted",
|
|
85
|
+
children: a.reduceMotionHint
|
|
86
|
+
})]
|
|
87
|
+
}), /* @__PURE__ */ l(t, {
|
|
88
|
+
checked: i.reduceMotion,
|
|
89
|
+
onCheckedChange: i.setReduceMotion,
|
|
90
|
+
"aria-labelledby": `${m}-motion`,
|
|
91
|
+
"data-testid": "appearance-reduce-motion"
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function h({ id: e, name: t, hint: n, value: o, options: s, defaultValue: c, defaultLabel: d, onChange: f, keys: p, disabled: m = !1, testId: h }) {
|
|
98
|
+
return /* @__PURE__ */ u("div", {
|
|
99
|
+
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
100
|
+
children: [/* @__PURE__ */ u("div", {
|
|
101
|
+
className: "flex min-w-0 flex-col",
|
|
102
|
+
children: [/* @__PURE__ */ l("span", {
|
|
103
|
+
id: e,
|
|
104
|
+
className: "text-sm font-medium text-text-primary",
|
|
105
|
+
children: t
|
|
106
|
+
}), /* @__PURE__ */ l("span", {
|
|
107
|
+
className: "text-xs text-text-muted",
|
|
108
|
+
children: n
|
|
109
|
+
})]
|
|
110
|
+
}), /* @__PURE__ */ l("div", {
|
|
111
|
+
role: "radiogroup",
|
|
112
|
+
"aria-labelledby": e,
|
|
113
|
+
onKeyDown: p,
|
|
114
|
+
className: "flex flex-wrap gap-1.5",
|
|
115
|
+
"data-testid": h,
|
|
116
|
+
children: s.map((e) => {
|
|
117
|
+
let t = o === e.value;
|
|
118
|
+
return /* @__PURE__ */ u("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
role: "radio",
|
|
121
|
+
"aria-checked": t,
|
|
122
|
+
disabled: m,
|
|
123
|
+
tabIndex: t ? 0 : -1,
|
|
124
|
+
onClick: () => f(e.value),
|
|
125
|
+
"data-value": e.value,
|
|
126
|
+
className: a(t, "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium"),
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ l(r, { selected: t }),
|
|
129
|
+
e.label,
|
|
130
|
+
e.value === c && e.label !== d && /* @__PURE__ */ l(i, { children: d })
|
|
131
|
+
]
|
|
132
|
+
}, e.value);
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
export { m as AppearanceDisplaySection };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppearanceControls } from '../../shared/providers/shell/themeContext';
|
|
2
|
+
import { AppearanceLabels } from './useAppearanceLabels';
|
|
3
|
+
export declare function AppearanceModeSection({ appearance, labels, }: {
|
|
4
|
+
appearance: AppearanceControls;
|
|
5
|
+
labels: AppearanceLabels;
|
|
6
|
+
}): import('react').JSX.Element;
|
|
7
|
+
export declare function AppearanceDepthSection({ appearance, brand, labels, }: {
|
|
8
|
+
appearance: AppearanceControls;
|
|
9
|
+
brand: string;
|
|
10
|
+
labels: AppearanceLabels;
|
|
11
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { hasLightMode as e, resolveAppearance as t } from "../../shared/providers/shell/appearance/model.js";
|
|
2
|
+
import { PALETTES as n } from "../../shared/providers/shell/appearance/palettes.js";
|
|
3
|
+
import { lookTokenStyle as r } from "../../shared/providers/shell/appearance/tokens.js";
|
|
4
|
+
import { DARK_DEPTHS as i } from "../../shared/providers/shell/appearance/types.js";
|
|
5
|
+
import { AppearanceSection as a, SelectedCheck as o, Tag as s, optionClass as c, useRadioGroupKeys as l } from "./appearanceUi.js";
|
|
6
|
+
import { AlertTriangle as u, Contrast as d, Monitor as f, Moon as p, Sun as m } from "lucide-react";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
// src/chrome/appearance/AppearanceModeDepth.tsx
|
|
9
|
+
function _({ appearance: t, labels: n }) {
|
|
10
|
+
let r = l(), { settings: i, systemDark: s } = t, u = n.palettes[i.palette].name, _ = !e(i.palette), v = [
|
|
11
|
+
{
|
|
12
|
+
value: "light",
|
|
13
|
+
icon: /* @__PURE__ */ h(m, {}),
|
|
14
|
+
name: n.schemes.light,
|
|
15
|
+
hint: _ ? n.noLight(u) : n.lightHint,
|
|
16
|
+
disabled: _
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "dark",
|
|
20
|
+
icon: /* @__PURE__ */ h(p, {}),
|
|
21
|
+
name: n.schemes.dark,
|
|
22
|
+
hint: n.darkHint,
|
|
23
|
+
disabled: !1
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "system",
|
|
27
|
+
icon: /* @__PURE__ */ h(f, {}),
|
|
28
|
+
name: n.system,
|
|
29
|
+
hint: _ ? n.staysDark(u) : n.systemHint(n.schemes[s ? "dark" : "light"]),
|
|
30
|
+
disabled: !1
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
return /* @__PURE__ */ h(a, {
|
|
34
|
+
id: "appearance-mode",
|
|
35
|
+
icon: /* @__PURE__ */ h(d, {}),
|
|
36
|
+
title: n.modeTitle,
|
|
37
|
+
description: n.modeDescription,
|
|
38
|
+
children: /* @__PURE__ */ h("div", {
|
|
39
|
+
role: "radiogroup",
|
|
40
|
+
"aria-labelledby": "appearance-mode-title",
|
|
41
|
+
onKeyDown: r,
|
|
42
|
+
className: "grid grid-cols-1 gap-2 sm:grid-cols-3",
|
|
43
|
+
children: v.map((e) => {
|
|
44
|
+
let n = i.mode === e.value;
|
|
45
|
+
return /* @__PURE__ */ g("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
role: "radio",
|
|
48
|
+
"aria-checked": n,
|
|
49
|
+
disabled: e.disabled,
|
|
50
|
+
tabIndex: n ? 0 : -1,
|
|
51
|
+
onClick: () => t.setColorMode(e.value),
|
|
52
|
+
"data-testid": `appearance-mode-${e.value}`,
|
|
53
|
+
className: c(n, "flex flex-col gap-1 p-3"),
|
|
54
|
+
children: [/* @__PURE__ */ g("span", {
|
|
55
|
+
className: "flex items-center gap-2 text-sm font-semibold [&_svg]:size-4",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ h("span", {
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
className: "text-text-secondary",
|
|
60
|
+
children: e.icon
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ h("span", {
|
|
63
|
+
className: "flex-1",
|
|
64
|
+
children: e.name
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ h(o, { selected: n })
|
|
67
|
+
]
|
|
68
|
+
}), /* @__PURE__ */ h("span", {
|
|
69
|
+
className: "text-xs text-text-muted",
|
|
70
|
+
children: e.hint
|
|
71
|
+
})]
|
|
72
|
+
}, e.value);
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function v({ appearance: e, brand: d, labels: f }) {
|
|
78
|
+
let m = l(), { settings: _, defaults: v, resolved: y, systemDark: b } = e, x = !!n[_.palette].depthless;
|
|
79
|
+
return /* @__PURE__ */ g(a, {
|
|
80
|
+
id: "appearance-depth",
|
|
81
|
+
icon: /* @__PURE__ */ h(p, {}),
|
|
82
|
+
title: f.depthTitle,
|
|
83
|
+
description: f.depthDescription,
|
|
84
|
+
children: [(x || y.scheme === "light") && /* @__PURE__ */ g("p", {
|
|
85
|
+
className: "flex items-start gap-2 text-sm text-text-secondary",
|
|
86
|
+
children: [/* @__PURE__ */ h(u, {
|
|
87
|
+
className: "mt-0.5 size-4 shrink-0 text-text-muted",
|
|
88
|
+
"aria-hidden": "true"
|
|
89
|
+
}), x ? f.depthNone : f.depthLightNote]
|
|
90
|
+
}), /* @__PURE__ */ h("div", {
|
|
91
|
+
role: "radiogroup",
|
|
92
|
+
"aria-labelledby": "appearance-depth-title",
|
|
93
|
+
onKeyDown: m,
|
|
94
|
+
className: "grid grid-cols-1 gap-2 sm:grid-cols-3",
|
|
95
|
+
children: i.map((n) => {
|
|
96
|
+
let i = _.darkDepth === n, a = t({
|
|
97
|
+
palette: _.palette,
|
|
98
|
+
mode: "dark",
|
|
99
|
+
darkDepth: n,
|
|
100
|
+
accent: "auto",
|
|
101
|
+
colours: []
|
|
102
|
+
}, {
|
|
103
|
+
systemDark: b,
|
|
104
|
+
brand: d
|
|
105
|
+
});
|
|
106
|
+
return /* @__PURE__ */ g("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
role: "radio",
|
|
109
|
+
"aria-checked": i,
|
|
110
|
+
disabled: x,
|
|
111
|
+
tabIndex: i ? 0 : -1,
|
|
112
|
+
onClick: () => e.setDarkDepth(n),
|
|
113
|
+
"data-testid": `appearance-depth-${n}`,
|
|
114
|
+
className: c(i, "flex flex-col gap-2 p-2.5"),
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ g("span", {
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
"data-depth": "off",
|
|
119
|
+
style: r(a),
|
|
120
|
+
className: "grid h-10 grid-cols-[1.1fr_1fr_0.8fr] overflow-hidden rounded-md border border-border-subtle text-[10.5px] font-semibold text-text-secondary",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ h("span", {
|
|
123
|
+
className: "flex items-end bg-bg-canvas px-1.5 pb-1",
|
|
124
|
+
children: f.depthPage
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ h("span", {
|
|
127
|
+
className: "flex items-end bg-bg-surface px-1.5 pb-1",
|
|
128
|
+
children: f.depthCard
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ h("span", {
|
|
131
|
+
className: "flex items-end bg-bg-elevated px-1.5 pb-1",
|
|
132
|
+
children: f.depthMenu
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ g("span", {
|
|
137
|
+
className: "flex items-center gap-1.5 text-sm font-semibold",
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ h("span", { children: f.depths[n].name }),
|
|
140
|
+
n === v.darkDepth && /* @__PURE__ */ h(s, {
|
|
141
|
+
tone: "accent",
|
|
142
|
+
children: f.tagDefault
|
|
143
|
+
}),
|
|
144
|
+
/* @__PURE__ */ h("span", { className: "flex-1" }),
|
|
145
|
+
/* @__PURE__ */ h(o, { selected: i })
|
|
146
|
+
]
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ h("span", {
|
|
149
|
+
className: "text-xs text-text-muted",
|
|
150
|
+
children: f.depths[n].hint
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
}, n);
|
|
154
|
+
})
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
export { v as AppearanceDepthSection, _ as AppearanceModeSection };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface AppearancePreferencesProps {
|
|
3
|
+
/** The product's own sections, after Display (FluidGrids: Background). */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Resets the product's own sections with the rest (Reset to defaults) and returns how to put
|
|
7
|
+
* them back (Undo). Without it, Reset leaves them alone and says so.
|
|
8
|
+
*/
|
|
9
|
+
onResetDefaults?: () => () => void;
|
|
10
|
+
/** What the live preview shows behind the Assistant start page (FluidGrids: its background). */
|
|
11
|
+
previewBackground?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function AppearancePreferences({ children, onResetDefaults, previewBackground, }: AppearancePreferencesProps): import('react').JSX.Element | null;
|