@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,13 @@
|
|
|
1
|
+
import { ResolvedAppearance } from './appearance/model';
|
|
2
|
+
import { AppearanceDefaults, DarkDepth, PaletteName } from './appearance/types';
|
|
3
|
+
import { ThemeMode, ThemeProviderProps } from './themeContext';
|
|
4
|
+
/** What this model sets inline on `<html>` for a chosen accent, and clears without one. */
|
|
5
|
+
export declare const INLINE_ACCENT_PROPERTIES: readonly ["--color-action-primary-bg", "--color-action-primary-bgHover", "--color-action-primary-bgActive", "--color-action-primary-text", "--color-action-primary-border", "--color-text-link", "--color-text-linkHover", "--color-accent-raw", "--custom-accent-luminance"];
|
|
6
|
+
/** Writes a resolved look's accent to `<html>` (inline), or clears it for the palette's own. */
|
|
7
|
+
export declare function applyInlineAccent(root: HTMLElement, look: ResolvedAppearance): void;
|
|
8
|
+
/**
|
|
9
|
+
* A product's starting point. `defaultMode` may still name a dark theme (the earlier model's
|
|
10
|
+
* way to start dark in it): that theme is then the default palette, in Dark.
|
|
11
|
+
*/
|
|
12
|
+
export declare function appearanceDefaultsOf(defaultMode: ThemeMode | undefined, defaultPalette: PaletteName | undefined, defaultDarkDepth: DarkDepth | undefined): AppearanceDefaults;
|
|
13
|
+
export declare function PaletteThemeProvider({ children, defaultMode, defaultBrand, defaultDensity, defaultTypography, defaultGlass, storageKey, themedNativeControls, responsiveDisplaySettings, defaultPalette, defaultDarkDepth, }: ThemeProviderProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { desktopSetTheme as e } from "../../native/desktop.js";
|
|
2
|
+
import { normalizeHex as t } from "./appearance/colour.js";
|
|
3
|
+
import { accentLuminance as n } from "./appearance/contrastFix.js";
|
|
4
|
+
import { accentHexOf as r, activeLookOf as i, hasLightMode as a, lookModeOf as ee, presetPair as te, resolveAppearance as ne, schemeOf as re } from "./appearance/model.js";
|
|
5
|
+
import { withAccent as ie, withColourAdded as ae, withColourDeleted as oe, withColourMoved as se, withColourUpdated as ce, withDarkDepth as le, withDefaults as ue, withLookApplied as de, withLookCreated as fe, withLookDeleted as pe, withLookDuplicated as me, withLookUpdated as he, withMode as ge, withPalette as o, withRequestedMode as _e } from "./appearance/operations.js";
|
|
6
|
+
import { PALETTES as ve } from "./appearance/palettes.js";
|
|
7
|
+
import { appearanceKeys as ye, clearKey as be, deviceStorage as s, readAppearance as xe, writeKey as c } from "./appearance/storage.js";
|
|
8
|
+
import { isAccentPresetId as Se, isPaletteName as Ce } from "./appearance/types.js";
|
|
9
|
+
import { brandAttribute as we } from "./brandAttribute.js";
|
|
10
|
+
import { applyResponsiveDisplaySettings as Te } from "./responsiveDisplaySettings.js";
|
|
11
|
+
import { applyThemedNativeControls as Ee } from "./themedNativeControls.js";
|
|
12
|
+
import { ThemeContext as De } from "./themeContext.js";
|
|
13
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as Oe, useState as f } from "react";
|
|
14
|
+
import { jsx as ke } from "react/jsx-runtime";
|
|
15
|
+
// src/shared/providers/shell/PaletteThemeProvider.tsx
|
|
16
|
+
var p = "(prefers-color-scheme: dark)", Ae = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(p).matches, m = [
|
|
17
|
+
"--color-action-primary-bg",
|
|
18
|
+
"--color-action-primary-bgHover",
|
|
19
|
+
"--color-action-primary-bgActive",
|
|
20
|
+
"--color-action-primary-text",
|
|
21
|
+
"--color-action-primary-border",
|
|
22
|
+
"--color-text-link",
|
|
23
|
+
"--color-text-linkHover",
|
|
24
|
+
"--color-accent-raw",
|
|
25
|
+
"--custom-accent-luminance"
|
|
26
|
+
];
|
|
27
|
+
function h(e, t) {
|
|
28
|
+
if (t.auto) {
|
|
29
|
+
e.removeAttribute("data-accent"), e.removeAttribute("data-accent-label");
|
|
30
|
+
for (let t of m) e.style.removeProperty(t);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
let r = t.accent;
|
|
34
|
+
e.setAttribute("data-accent", "custom"), r.onDark ? e.setAttribute("data-accent-label", "dark") : e.removeAttribute("data-accent-label"), e.style.setProperty("--color-action-primary-bg", r.fill), e.style.setProperty("--color-action-primary-bgHover", r.hover), e.style.setProperty("--color-action-primary-bgActive", r.active), e.style.setProperty("--color-action-primary-text", r.on), e.style.setProperty("--color-action-primary-border", r.fill), e.style.setProperty("--color-text-link", `var(--color-accent-text, ${r.ink})`), e.style.setProperty("--color-text-linkHover", `var(--color-accent-text, ${r.inkHover})`), e.style.setProperty("--color-accent-raw", r.raw), e.style.setProperty("--custom-accent-luminance", n(r.fill));
|
|
35
|
+
}
|
|
36
|
+
var je = /* @__PURE__ */ new Set([
|
|
37
|
+
"forest",
|
|
38
|
+
"ocean",
|
|
39
|
+
"sunset",
|
|
40
|
+
"high-contrast"
|
|
41
|
+
]);
|
|
42
|
+
function g(e, t, n) {
|
|
43
|
+
let r = t ?? "classic", i = "system";
|
|
44
|
+
return e === "light" || e === "dark" || e === "system" ? i = e : e && je.has(e) && Ce(e) && (t || (r = e), i = "dark"), i === "light" && !a(r) && (i = "dark"), {
|
|
45
|
+
palette: r,
|
|
46
|
+
mode: i,
|
|
47
|
+
darkDepth: n ?? "darker"
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function Me(e) {
|
|
51
|
+
return a(e.palette) ? e.mode : e.palette;
|
|
52
|
+
}
|
|
53
|
+
function Ne(e) {
|
|
54
|
+
return a(e.palette) ? e.scheme : e.palette;
|
|
55
|
+
}
|
|
56
|
+
var _ = (e) => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`, v = (e) => {
|
|
57
|
+
try {
|
|
58
|
+
return s()?.getItem(e) ?? null;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}, y = (e, t, n) => e !== null && t.includes(e) ? e : n, Pe = [
|
|
63
|
+
"compact",
|
|
64
|
+
"comfortable",
|
|
65
|
+
"spacious"
|
|
66
|
+
], Fe = [
|
|
67
|
+
"small",
|
|
68
|
+
"default",
|
|
69
|
+
"large"
|
|
70
|
+
], Ie = [
|
|
71
|
+
"off",
|
|
72
|
+
"subtle",
|
|
73
|
+
"full"
|
|
74
|
+
];
|
|
75
|
+
function b({ children: n, defaultMode: a, defaultBrand: je = "default", defaultDensity: b = "comfortable", defaultTypography: x = "default", defaultGlass: S = "full", storageKey: C = "burdenoff-theme", themedNativeControls: Le = !1, responsiveDisplaySettings: Re = !1, defaultPalette: ze, defaultDarkDepth: Be }) {
|
|
76
|
+
let w = d(() => ye(C), [C]), T = d(() => g(a, ze, Be), [
|
|
77
|
+
a,
|
|
78
|
+
ze,
|
|
79
|
+
Be
|
|
80
|
+
]), [E, D] = f(() => xe(s(), C, T)), [O, Ve] = f(() => v(`${C}-brand`) || je), [k, He] = f(() => y(v(w.density), Pe, b)), [A, Ue] = f(() => y(v(w.typography), Fe, x)), [j, We] = f(() => y(v(w.glass), Ie, S)), [M, Ge] = f(() => v(w.reduceMotion) === "1"), [N, Ke] = f(Ae);
|
|
81
|
+
u(() => {
|
|
82
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
83
|
+
let e = window.matchMedia(p), t = (e) => Ke(e.matches);
|
|
84
|
+
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
85
|
+
}, []);
|
|
86
|
+
let P = d(() => ne(E, {
|
|
87
|
+
systemDark: N,
|
|
88
|
+
brand: O
|
|
89
|
+
}), [
|
|
90
|
+
E,
|
|
91
|
+
N,
|
|
92
|
+
O
|
|
93
|
+
]), F = Oe(E);
|
|
94
|
+
u(() => {
|
|
95
|
+
let e = F.current;
|
|
96
|
+
if (F.current = E, e === E) return;
|
|
97
|
+
let t = s();
|
|
98
|
+
e.palette !== E.palette && c(t, w.palette, E.palette), e.mode !== E.mode && c(t, w.colorMode, E.mode), e.darkDepth !== E.darkDepth && c(t, w.darkDepth, E.darkDepth), e.accent !== E.accent && c(t, w.accent, E.accent), e.colours !== E.colours && c(t, w.colours, JSON.stringify(E.colours)), e.looks !== E.looks && c(t, w.looks, JSON.stringify(E.looks)), e.activeLookId !== E.activeLookId && (E.activeLookId === null ? be(t, w.activeLook) : c(t, w.activeLook, E.activeLookId));
|
|
99
|
+
}, [E, w]), u(() => {
|
|
100
|
+
if (Le) return Ee(document, P.scheme);
|
|
101
|
+
}, [Le, P.scheme]), u(() => {
|
|
102
|
+
if (Re) return Te(document.documentElement);
|
|
103
|
+
}, [Re]), u(() => {
|
|
104
|
+
let t = document.documentElement;
|
|
105
|
+
t.setAttribute("data-theme", P.cssTheme), t.setAttribute("data-brand", we(O)), t.setAttribute("data-dark-depth", P.depth), t.setAttribute("data-density", k), t.setAttribute("data-typography", A), t.setAttribute("data-glass", j), t.toggleAttribute("data-reduce-motion", M), P.scheme === "dark" ? t.classList.add("dark") : t.classList.remove("dark"), h(t, P);
|
|
106
|
+
let n = () => {
|
|
107
|
+
let n = getComputedStyle(t).getPropertyValue("--color-bg-canvas").trim();
|
|
108
|
+
e({
|
|
109
|
+
scheme: P.scheme,
|
|
110
|
+
backgroundColor: n || void 0
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
if (typeof requestAnimationFrame == "function") {
|
|
114
|
+
let e = requestAnimationFrame(n);
|
|
115
|
+
return () => cancelAnimationFrame(e);
|
|
116
|
+
}
|
|
117
|
+
n();
|
|
118
|
+
}, [
|
|
119
|
+
P,
|
|
120
|
+
O,
|
|
121
|
+
k,
|
|
122
|
+
A,
|
|
123
|
+
j,
|
|
124
|
+
M
|
|
125
|
+
]), u(() => () => {
|
|
126
|
+
let e = document.documentElement;
|
|
127
|
+
e.removeAttribute("data-dark-depth"), e.removeAttribute("data-accent"), e.removeAttribute("data-accent-label");
|
|
128
|
+
for (let t of m) e.style.removeProperty(t);
|
|
129
|
+
}, []);
|
|
130
|
+
let I = l((e, t) => {
|
|
131
|
+
c(s(), e, t);
|
|
132
|
+
}, []), L = l((e) => {
|
|
133
|
+
Ve(e), I(`${C}-brand`, e);
|
|
134
|
+
}, [I, C]), R = l((e) => {
|
|
135
|
+
He(e), I(w.density, e);
|
|
136
|
+
}, [I, w]), z = l((e) => {
|
|
137
|
+
Ue(e), I(w.typography, e);
|
|
138
|
+
}, [I, w]), B = l((e) => {
|
|
139
|
+
We(e), I(w.glass, e);
|
|
140
|
+
}, [I, w]), V = l((e) => {
|
|
141
|
+
Ge(e), I(w.reduceMotion, e ? "1" : "0");
|
|
142
|
+
}, [I, w]), H = l((e) => {
|
|
143
|
+
let t = o(E, e, N);
|
|
144
|
+
return D((t) => o(t, e, N)), { modeChanged: t.mode !== E.mode };
|
|
145
|
+
}, [E, N]), U = l((e) => {
|
|
146
|
+
D((t) => ge(t, e));
|
|
147
|
+
}, []), W = l((e) => {
|
|
148
|
+
D((t) => le(t, e));
|
|
149
|
+
}, []), G = l((e) => {
|
|
150
|
+
D((t) => ie(t, e));
|
|
151
|
+
}, []), K = l((e) => {
|
|
152
|
+
let n = t(e.hex);
|
|
153
|
+
if (!n || E.colours.length >= 24) return null;
|
|
154
|
+
let r = {
|
|
155
|
+
id: _("colour"),
|
|
156
|
+
name: e.name.trim().slice(0, 24) || n,
|
|
157
|
+
hex: n
|
|
158
|
+
};
|
|
159
|
+
return D((e) => ae(e, r)), r;
|
|
160
|
+
}, [E.colours.length]), qe = l((e, t) => {
|
|
161
|
+
D((n) => ce(n, e, t));
|
|
162
|
+
}, []), Je = l((e) => {
|
|
163
|
+
D((t) => oe(t, e));
|
|
164
|
+
}, []), Ye = l((e, t) => {
|
|
165
|
+
D((n) => se(n, e, t));
|
|
166
|
+
}, []), q = l((e) => {
|
|
167
|
+
let t = {
|
|
168
|
+
...e,
|
|
169
|
+
id: _("look")
|
|
170
|
+
};
|
|
171
|
+
return D((e) => fe(e, t)), t;
|
|
172
|
+
}, []), J = l((e, t) => {
|
|
173
|
+
D((n) => he(n, e, t));
|
|
174
|
+
}, []), Xe = l((e, t) => {
|
|
175
|
+
let n = E.looks.find((t) => t.id === e);
|
|
176
|
+
if (!n) return null;
|
|
177
|
+
let r = {
|
|
178
|
+
id: _("look"),
|
|
179
|
+
name: t
|
|
180
|
+
};
|
|
181
|
+
return D((t) => me(t, e, r)), {
|
|
182
|
+
...n,
|
|
183
|
+
...r
|
|
184
|
+
};
|
|
185
|
+
}, [E.looks]), Y = l((e) => {
|
|
186
|
+
D((t) => pe(t, e, T));
|
|
187
|
+
}, [T]), X = l((e) => {
|
|
188
|
+
D((t) => de(t, e));
|
|
189
|
+
}, []), Ze = l(() => ({
|
|
190
|
+
settings: E,
|
|
191
|
+
density: k,
|
|
192
|
+
typography: A,
|
|
193
|
+
glass: j,
|
|
194
|
+
reduceMotion: M
|
|
195
|
+
}), [
|
|
196
|
+
E,
|
|
197
|
+
k,
|
|
198
|
+
A,
|
|
199
|
+
j,
|
|
200
|
+
M
|
|
201
|
+
]), Qe = l((e) => {
|
|
202
|
+
D(e.settings), R(e.density), z(e.typography), B(e.glass), V(e.reduceMotion);
|
|
203
|
+
}, [
|
|
204
|
+
R,
|
|
205
|
+
z,
|
|
206
|
+
B,
|
|
207
|
+
V
|
|
208
|
+
]), $e = l(() => {
|
|
209
|
+
D((e) => ue(e, T)), R(b), z(x), B(S), V(!1);
|
|
210
|
+
}, [
|
|
211
|
+
T,
|
|
212
|
+
b,
|
|
213
|
+
x,
|
|
214
|
+
S,
|
|
215
|
+
R,
|
|
216
|
+
z,
|
|
217
|
+
B,
|
|
218
|
+
V
|
|
219
|
+
]), Z = d(() => i(E), [E]), et = d(() => ({
|
|
220
|
+
density: b,
|
|
221
|
+
typography: x,
|
|
222
|
+
glass: S
|
|
223
|
+
}), [
|
|
224
|
+
b,
|
|
225
|
+
x,
|
|
226
|
+
S
|
|
227
|
+
]), tt = d(() => ({
|
|
228
|
+
settings: E,
|
|
229
|
+
defaults: T,
|
|
230
|
+
displayDefaults: et,
|
|
231
|
+
resolved: P,
|
|
232
|
+
systemDark: N,
|
|
233
|
+
activeLook: Z,
|
|
234
|
+
setPalette: H,
|
|
235
|
+
setColorMode: U,
|
|
236
|
+
setDarkDepth: W,
|
|
237
|
+
setAccent: G,
|
|
238
|
+
addColour: K,
|
|
239
|
+
updateColour: qe,
|
|
240
|
+
deleteColour: Je,
|
|
241
|
+
moveColour: Ye,
|
|
242
|
+
createLook: q,
|
|
243
|
+
updateLook: J,
|
|
244
|
+
duplicateLook: Xe,
|
|
245
|
+
deleteLook: Y,
|
|
246
|
+
applyLook: X,
|
|
247
|
+
resetToDefaults: $e,
|
|
248
|
+
snapshot: Ze,
|
|
249
|
+
restore: Qe
|
|
250
|
+
}), [
|
|
251
|
+
E,
|
|
252
|
+
T,
|
|
253
|
+
et,
|
|
254
|
+
P,
|
|
255
|
+
N,
|
|
256
|
+
Z,
|
|
257
|
+
H,
|
|
258
|
+
U,
|
|
259
|
+
W,
|
|
260
|
+
G,
|
|
261
|
+
K,
|
|
262
|
+
qe,
|
|
263
|
+
Je,
|
|
264
|
+
Ye,
|
|
265
|
+
q,
|
|
266
|
+
J,
|
|
267
|
+
Xe,
|
|
268
|
+
Y,
|
|
269
|
+
X,
|
|
270
|
+
$e,
|
|
271
|
+
Ze,
|
|
272
|
+
Qe
|
|
273
|
+
]), Q = l((e) => {
|
|
274
|
+
e === "light" || e === "dark" || e === "system" ? D((t) => _e(t, e, T)) : e !== "custom" && Ce(e) && D((t) => o(t, e, N));
|
|
275
|
+
}, [T, N]), nt = l(() => {
|
|
276
|
+
Q(P.scheme === "light" ? "dark" : "light");
|
|
277
|
+
}, [P.scheme, Q]), rt = d(() => E.looks.map((e) => {
|
|
278
|
+
let t = re(e.palette, ee(e, E.mode), N), n = e.accent.startsWith("preset:") ? e.accent.slice(7) : null, i = n && Se(n) ? te(n, t, ve[e.palette].darkLabel).fill : r(e.accent, E.colours) ?? "";
|
|
279
|
+
return {
|
|
280
|
+
id: e.id,
|
|
281
|
+
name: e.name,
|
|
282
|
+
base: t,
|
|
283
|
+
accent: i,
|
|
284
|
+
density: k,
|
|
285
|
+
typography: A,
|
|
286
|
+
glass: j,
|
|
287
|
+
reduceMotion: M
|
|
288
|
+
};
|
|
289
|
+
}), [
|
|
290
|
+
E,
|
|
291
|
+
N,
|
|
292
|
+
k,
|
|
293
|
+
A,
|
|
294
|
+
j,
|
|
295
|
+
M
|
|
296
|
+
]), it = l((e) => {
|
|
297
|
+
let n = t(e.accent), r = q({
|
|
298
|
+
name: e.name,
|
|
299
|
+
palette: "classic",
|
|
300
|
+
accent: n || "auto",
|
|
301
|
+
mode: e.base
|
|
302
|
+
});
|
|
303
|
+
return {
|
|
304
|
+
...e,
|
|
305
|
+
id: r.id
|
|
306
|
+
};
|
|
307
|
+
}, [q]), $ = l((e, n) => {
|
|
308
|
+
let r = n.accent === void 0 ? null : t(n.accent);
|
|
309
|
+
J(e, {
|
|
310
|
+
...n.name === void 0 ? {} : { name: n.name },
|
|
311
|
+
...r ? { accent: r } : {},
|
|
312
|
+
...n.base === void 0 ? {} : { mode: n.base }
|
|
313
|
+
});
|
|
314
|
+
}, [J]), at = d(() => ({
|
|
315
|
+
mode: Me(E),
|
|
316
|
+
brand: O,
|
|
317
|
+
density: k,
|
|
318
|
+
typography: A,
|
|
319
|
+
glass: j,
|
|
320
|
+
reduceMotion: M,
|
|
321
|
+
resolvedTheme: P.scheme,
|
|
322
|
+
resolvedThemeName: Ne(P),
|
|
323
|
+
setMode: Q,
|
|
324
|
+
setBrand: L,
|
|
325
|
+
setDensity: R,
|
|
326
|
+
setTypography: z,
|
|
327
|
+
setGlass: B,
|
|
328
|
+
setReduceMotion: V,
|
|
329
|
+
customThemes: rt,
|
|
330
|
+
activeCustomId: Z?.id ?? null,
|
|
331
|
+
createCustomTheme: it,
|
|
332
|
+
updateCustomTheme: $,
|
|
333
|
+
deleteCustomTheme: Y,
|
|
334
|
+
applyCustomTheme: X,
|
|
335
|
+
colorMode: P.scheme,
|
|
336
|
+
toggleColorMode: nt,
|
|
337
|
+
appearance: tt
|
|
338
|
+
}), [
|
|
339
|
+
E,
|
|
340
|
+
O,
|
|
341
|
+
k,
|
|
342
|
+
A,
|
|
343
|
+
j,
|
|
344
|
+
M,
|
|
345
|
+
P,
|
|
346
|
+
Q,
|
|
347
|
+
L,
|
|
348
|
+
R,
|
|
349
|
+
z,
|
|
350
|
+
B,
|
|
351
|
+
V,
|
|
352
|
+
rt,
|
|
353
|
+
Z,
|
|
354
|
+
it,
|
|
355
|
+
$,
|
|
356
|
+
Y,
|
|
357
|
+
X,
|
|
358
|
+
nt,
|
|
359
|
+
tt
|
|
360
|
+
]);
|
|
361
|
+
return /* @__PURE__ */ ke(De.Provider, {
|
|
362
|
+
value: at,
|
|
363
|
+
children: n
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
export { m as INLINE_ACCENT_PROPERTIES, b as PaletteThemeProvider, g as appearanceDefaultsOf, h as applyInlineAccent };
|
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* six concrete Boff UI themes, `system` (resolves to light/dark from the OS), or
|
|
5
|
-
* `custom` (a user-designed theme — see {@link CustomTheme}). The light/dark
|
|
6
|
-
* *family* is exposed separately as `resolvedTheme`, while `resolvedThemeName` is
|
|
7
|
-
* the concrete CSS theme written to `data-theme` on the document root.
|
|
8
|
-
*/
|
|
9
|
-
export type ThemeMode = 'light' | 'dark' | 'forest' | 'ocean' | 'sunset' | 'high-contrast' | 'system' | 'custom';
|
|
10
|
-
/** The six concrete CSS themes (`data-theme` only ever receives one of these). */
|
|
11
|
-
export type ThemeName = Exclude<ThemeMode, 'system' | 'custom'>;
|
|
12
|
-
export type Brand = 'workspaces' | 'fluidgrids' | 'bigconsole' | 'botlit' | 'botmanor' | 'vibecontrols' | 'healthybowl' | 'housingvista' | 'adaptercloud' | 'artistrybase' | 'atheletebridge' | 'brainyrich' | 'buildmyiq' | 'collabkin' | 'comradecircle' | 'coolandlovely' | 'cosmicintersection' | 'crewfoundry' | 'ecoimpacthub' | 'eventfullymanaged' | 'ggnomad' | 'govcitizenhub' | 'headshotmarketing' | 'hookmovies' | 'intelwatchtower' | 'kadaikodi' | 'labsofscience' | 'manufacturedops' | 'movethewheels' | 'mybodyshield' | 'planmagnet' | 'proserviceworld' | 'semanticfed' | 'subscriberbot' | 'theculturepost' | 'theglobalfuel' | 'timecampus' | 'default';
|
|
13
|
-
export type Density = 'compact' | 'comfortable' | 'spacious';
|
|
14
|
-
export type Typography = 'default' | 'large' | 'small';
|
|
15
|
-
/** Glass intensity preference (drives `data-glass` → blur + opaque fallback). */
|
|
16
|
-
export type GlassIntensity = 'off' | 'subtle' | 'full';
|
|
17
|
-
/**
|
|
18
|
-
* A user-designed, saved theme. Reusable across every product (the storage key
|
|
19
|
-
* is shared across all shells). A custom theme inherits a light/dark base CSS
|
|
20
|
-
* block and redefines ONLY the action accent (which retints the whole UI via the
|
|
21
|
-
* existing `color-mix(... var(--color-action-primary-bg) ...)` tokens) plus the
|
|
22
|
-
* density / typography / glass / motion axes — no new token names.
|
|
23
|
-
*/
|
|
24
|
-
export interface CustomTheme {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
base: 'light' | 'dark';
|
|
28
|
-
/** single hex accent — feeds --color-action-primary-bg only */
|
|
29
|
-
accent: string;
|
|
30
|
-
density: Density;
|
|
31
|
-
typography: Typography;
|
|
32
|
-
glass: GlassIntensity;
|
|
33
|
-
reduceMotion: boolean;
|
|
34
|
-
}
|
|
1
|
+
import { ThemeContextValue, ThemeName, ThemeProviderProps } from './themeContext';
|
|
2
|
+
export type { AppearanceControls, AppearanceSnapshot, Brand, CustomTheme, Density, DisplayDefaults, GlassIntensity, ThemeContextValue, ThemeMode, ThemeName, ThemeProviderProps, Typography, } from './themeContext';
|
|
3
|
+
export type { AccentChoice, AppearanceDefaults, AppearanceSettings, ColorModeSetting, ColorScheme, DarkDepth, LookMode, PaletteName, SavedColour, SavedLook, } from './appearance/types';
|
|
35
4
|
/** Metadata for the theme picker / Appearance settings UI. */
|
|
36
5
|
export interface ThemeOption {
|
|
37
6
|
value: ThemeName;
|
|
@@ -39,48 +8,12 @@ export interface ThemeOption {
|
|
|
39
8
|
family: 'light' | 'dark';
|
|
40
9
|
}
|
|
41
10
|
export declare const THEME_OPTIONS: ReadonlyArray<ThemeOption>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
reduceMotion: boolean;
|
|
49
|
-
/** light/dark family of the active theme */
|
|
50
|
-
resolvedTheme: 'light' | 'dark';
|
|
51
|
-
/** concrete theme written to data-theme (light|dark|forest|ocean|sunset|high-contrast) */
|
|
52
|
-
resolvedThemeName: ThemeName;
|
|
53
|
-
setMode: (mode: ThemeMode) => void;
|
|
54
|
-
setBrand: (brand: Brand) => void;
|
|
55
|
-
setDensity: (density: Density) => void;
|
|
56
|
-
setTypography: (typography: Typography) => void;
|
|
57
|
-
setGlass: (glass: GlassIntensity) => void;
|
|
58
|
-
setReduceMotion: (reduce: boolean) => void;
|
|
59
|
-
customThemes: CustomTheme[];
|
|
60
|
-
activeCustomId: string | null;
|
|
61
|
-
createCustomTheme: (t: Omit<CustomTheme, 'id'>) => CustomTheme;
|
|
62
|
-
updateCustomTheme: (id: string, patch: Partial<Omit<CustomTheme, 'id'>>) => void;
|
|
63
|
-
deleteCustomTheme: (id: string) => void;
|
|
64
|
-
/** Activate a saved custom theme (sets mode='custom'). */
|
|
65
|
-
applyCustomTheme: (id: string) => void;
|
|
66
|
-
colorMode: 'light' | 'dark';
|
|
67
|
-
toggleColorMode: () => void;
|
|
68
|
-
}
|
|
69
|
-
export interface ThemeProviderProps {
|
|
70
|
-
children: ReactNode;
|
|
71
|
-
defaultMode?: ThemeMode;
|
|
72
|
-
defaultBrand?: Brand;
|
|
73
|
-
defaultDensity?: Density;
|
|
74
|
-
defaultTypography?: Typography;
|
|
75
|
-
defaultGlass?: GlassIntensity;
|
|
76
|
-
storageKey?: string;
|
|
77
|
-
/**
|
|
78
|
-
* BOFF-15413: scrollbars, select menus and the other controls the browser draws
|
|
79
|
-
* follow this theme instead of the OS (`themedNativeControls.ts`). Off by default.
|
|
80
|
-
*/
|
|
81
|
-
themedNativeControls?: boolean;
|
|
82
|
-
}
|
|
83
|
-
export declare function ThemeProvider({ children, defaultMode, defaultBrand, defaultDensity, defaultTypography, defaultGlass, storageKey, themedNativeControls, }: ThemeProviderProps): import('react').JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* The theme for every product. Without `paletteAppearance` it is the theme model products have
|
|
13
|
+
* today (six themes, custom themes that carry their own display settings), unchanged. With it
|
|
14
|
+
* (BOFF-15524, FluidGrids), the palette appearance model: see `PaletteThemeProvider`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ThemeProvider(props: ThemeProviderProps): import('react').JSX.Element;
|
|
84
17
|
export declare function useTheme(): ThemeContextValue;
|
|
85
18
|
/**
|
|
86
19
|
* The theme, or null outside a ThemeProvider — for a surface that must work
|