@kanzo-tech/theme 0.19.0 → 0.20.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 +61 -22
- package/dist/contrast.d.ts +34 -0
- package/dist/contrast.d.ts.map +1 -0
- package/dist/index.d.ts +35 -74
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +188 -133
- package/dist/index.js.map +1 -1
- package/dist/ink.d.ts +2 -2
- package/dist/sections.d.ts +0 -7
- package/dist/sections.d.ts.map +1 -1
- package/package.json +1 -1
- package/theme-data.json +35 -107
- package/themes/catppuccin-latte.css +52 -45
- package/themes/catppuccin-mocha.css +55 -47
- package/themes/kanzo-dark.css +55 -55
- package/themes/kanzo.css +53 -50
- package/themes/lofi-dark.css +70 -0
- package/themes/lofi.css +38 -22
- package/themes/nord-dark.css +54 -46
- package/themes/nord.css +55 -47
- package/themes.css +4 -25
- package/tokens.css +49 -35
- package/themes/acid.css +0 -54
- package/themes/bank-dark.css +0 -62
- package/themes/bank-private-dark.css +0 -62
- package/themes/bank-private.css +0 -61
- package/themes/bank.css +0 -61
- package/themes/catppuccin-latte-dark.css +0 -62
- package/themes/catppuccin-mocha-dark.css +0 -62
- package/themes/cmyk.css +0 -54
- package/themes/coffee.css +0 -54
- package/themes/cyberpunk.css +0 -54
- package/themes/dim.css +0 -54
- package/themes/dracula-dark.css +0 -62
- package/themes/dracula.css +0 -61
- package/themes/forest.css +0 -54
- package/themes/lemonade.css +0 -54
- package/themes/luxury.css +0 -54
- package/themes/monochrome-dark.css +0 -62
- package/themes/monochrome.css +0 -61
- package/themes/night.css +0 -54
- package/themes/sunset.css +0 -54
- package/themes/synthwave.css +0 -54
- package/themes/wireframe.css +0 -54
package/dist/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const
|
|
2
|
-
radii:
|
|
3
|
-
fonts:
|
|
4
|
-
monoFonts:
|
|
5
|
-
densities:
|
|
6
|
-
themes:
|
|
7
|
-
prefs:
|
|
8
|
-
fallbacks:
|
|
1
|
+
const T = { none: "0rem", xs: "0.125rem", sm: "0.25rem", md: "0.5rem", lg: "0.625rem" }, R = { system: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', geist: 'var(--font-geist-sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)', inter: 'var(--font-inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)' }, $ = { system: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace', "geist-mono": 'var(--font-geist-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace)', "jetbrains-mono": 'var(--font-jetbrains-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace)' }, L = { default: "16px", compact: "14px", comfortable: "18px" }, C = [{ value: "kanzo", label: "Kanzo", dark: !1, family: "kanzo" }, { value: "kanzo-dark", label: "Kanzo Dark", dark: !0, family: "kanzo" }, { value: "catppuccin-latte", label: "Catppuccin Latte", dark: !1, family: "catppuccin" }, { value: "catppuccin-mocha", label: "Catppuccin Mocha", dark: !0, family: "catppuccin" }, { value: "lofi", label: "Lo-fi", dark: !1, family: "lofi" }, { value: "lofi-dark", label: "Lo-fi Dark", dark: !0, family: "lofi" }, { value: "nord", label: "Nord", dark: !1, family: "nord" }, { value: "nord-dark", label: "Nord Dark", dark: !0, family: "nord" }], E = { appearance: { kind: "choice", options: [{ value: "light", label: "Light" }, { value: "dark", label: "Dark" }], default: "light", label: "Appearance", doc: "which side of the document is worn" }, radius: { kind: "choice", options: [{ value: "none", label: "none" }, { value: "xs", label: "xs" }, { value: "sm", label: "sm" }, { value: "md", label: "md" }, { value: "lg", label: "lg" }], default: "md", attr: "data-radius", source: "themes", label: "Radius", doc: "how round a corner is" }, font: { kind: "choice", options: [{ value: "system", label: "System" }, { value: "geist", label: "Geist" }, { value: "inter", label: "Inter" }], default: "geist", attr: "data-font", source: "themes", label: "Font", doc: "the face body text is set in" }, monoFont: { kind: "choice", options: [{ value: "system", label: "System" }, { value: "geist-mono", label: "Geist Mono" }, { value: "jetbrains-mono", label: "JetBrains" }], default: "geist-mono", attr: "data-mono-font", source: "themes", label: "Mono font", doc: "the face code is set in" }, density: { kind: "choice", options: [{ value: "default", label: "Default" }, { value: "compact", label: "Compact" }, { value: "comfortable", label: "Cozy" }], default: "default", attr: "data-font-size", source: "themes", label: "Density", doc: "the root size everything scales from" }, themeByAppearance: { kind: "choice", options: { from: "themes" }, default: "", attr: "data-theme", source: "document", byAppearance: !0, label: "Theme", doc: "which theme is worn on this side" } }, O = { "--secondary-foreground": ["--foreground"], "--accent-foreground": ["--foreground"], "--popover": ["--card"], "--input": ["--border"], "--field": ["--muted"], "--faint": ["--muted-foreground"], "--destructive-foreground": ["--destructive"], "--info-foreground": ["--info"], "--success-foreground": ["--success"], "--warning-foreground": ["--warning"], "--sidebar": ["--popover", "--card"], "--sidebar-foreground": ["--muted-foreground"] }, v = {
|
|
2
|
+
radii: T,
|
|
3
|
+
fonts: R,
|
|
4
|
+
monoFonts: $,
|
|
5
|
+
densities: L,
|
|
6
|
+
themes: C,
|
|
7
|
+
prefs: E,
|
|
8
|
+
fallbacks: O
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function x(e, n) {
|
|
11
11
|
if (e.kind !== "choice") return null;
|
|
12
12
|
if (Array.isArray(e.options)) return e.options;
|
|
13
13
|
const t = n == null ? void 0 : n[e.options.from];
|
|
14
14
|
return t && t.length > 0 ? t : null;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const Y = (e) => e === "true";
|
|
17
|
+
function J(e, n) {
|
|
18
18
|
const t = Number.parseFloat(e);
|
|
19
19
|
return Number.isFinite(t) ? t : n.min;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function X(e, n, t, o) {
|
|
22
22
|
const s = (r) => {
|
|
23
23
|
if (typeof r != "string") return !1;
|
|
24
24
|
if (e.kind === "choice") {
|
|
25
|
-
const i =
|
|
25
|
+
const i = x(e, o);
|
|
26
26
|
return i === null || i.some((l) => l.value === r);
|
|
27
27
|
}
|
|
28
28
|
if (e.kind === "toggle") return r === "true" || r === "false";
|
|
@@ -30,28 +30,28 @@ function H(e, n, t, a) {
|
|
|
30
30
|
return Number.isFinite(c) && c >= e.min && c <= e.max;
|
|
31
31
|
};
|
|
32
32
|
if (s(t == null ? void 0 : t.pinned)) return { value: t.pinned, via: "pinned", offered: !1 };
|
|
33
|
-
const
|
|
34
|
-
return
|
|
33
|
+
const a = !(t != null && t.hidden);
|
|
34
|
+
return a && s(n) ? { value: n, via: "stored", offered: a } : s(t == null ? void 0 : t.default) ? { value: t.default, via: "policy", offered: a } : { value: e.default, via: "default", offered: a };
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
for (const [
|
|
39
|
-
const c = s[
|
|
36
|
+
function Q(e, n, t) {
|
|
37
|
+
const o = [], s = e.prefs ?? {};
|
|
38
|
+
for (const [a, r] of Object.entries(n)) {
|
|
39
|
+
const c = s[a];
|
|
40
40
|
if (!c) {
|
|
41
|
-
|
|
42
|
-
token:
|
|
41
|
+
o.push({
|
|
42
|
+
token: a,
|
|
43
43
|
kind: "unknown",
|
|
44
|
-
detail: `"${e.namespace}" declares no preference "${
|
|
44
|
+
detail: `"${e.namespace}" declares no preference "${a}"`
|
|
45
45
|
});
|
|
46
46
|
continue;
|
|
47
47
|
}
|
|
48
48
|
let i, l;
|
|
49
49
|
switch (c.kind) {
|
|
50
50
|
case "choice": {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
i =
|
|
51
|
+
const d = x(c, t);
|
|
52
|
+
if (d === null) continue;
|
|
53
|
+
const y = d.map((z) => z.value);
|
|
54
|
+
i = y.includes(r), l = y.join(", ");
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
case "toggle": {
|
|
@@ -59,66 +59,66 @@ function W(e, n, t) {
|
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
default: {
|
|
62
|
-
const
|
|
63
|
-
i = Number.isFinite(
|
|
62
|
+
const d = Number.parseFloat(r);
|
|
63
|
+
i = Number.isFinite(d) && d >= c.min && d <= c.max, l = `${c.min}–${c.max}`;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
i ||
|
|
67
|
-
token:
|
|
66
|
+
i || o.push({
|
|
67
|
+
token: a,
|
|
68
68
|
kind: "shadowed",
|
|
69
|
-
detail: `"${r}" is not a legal ${e.namespace}.${
|
|
69
|
+
detail: `"${r}" is not a legal ${e.namespace}.${a} (${l}). It resolves to the default instead.`
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return o;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const t = e.replace(/^--/, "").split("-"),
|
|
76
|
-
for (let s = 0; s < t.length; s++)
|
|
77
|
-
return
|
|
74
|
+
function A(e) {
|
|
75
|
+
const t = e.replace(/^--/, "").split("-"), o = [];
|
|
76
|
+
for (let s = 0; s < t.length; s++) o.push(`--${t.slice(s).join("-")}`);
|
|
77
|
+
return o;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
for (const
|
|
81
|
-
const r = n[
|
|
82
|
-
if (r !== void 0) return { value: r, via:
|
|
79
|
+
function q(e, n, t) {
|
|
80
|
+
for (const a of A(e)) {
|
|
81
|
+
const r = n[a];
|
|
82
|
+
if (r !== void 0) return { value: r, via: a };
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const o = e.replace(new RegExp(`^--${t.namespace}-`), ""), s = (t.tokens ?? {})[o];
|
|
85
85
|
return s ? { value: s.default, via: `${t.namespace}:default` } : null;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function V(e, n) {
|
|
88
88
|
const t = [];
|
|
89
|
-
for (const
|
|
89
|
+
for (const o of Object.keys(n)) {
|
|
90
90
|
const s = `--${e.namespace}-`;
|
|
91
|
-
if (!
|
|
91
|
+
if (!o.startsWith(s)) {
|
|
92
92
|
t.push({
|
|
93
|
-
token:
|
|
93
|
+
token: o,
|
|
94
94
|
kind: "unknown",
|
|
95
95
|
detail: `not in the "${e.namespace}" namespace — a section may only declare its own`
|
|
96
96
|
});
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
if (!(
|
|
101
|
-
const r =
|
|
99
|
+
const a = o.slice(s.length);
|
|
100
|
+
if (!(a in (e.tokens ?? {}))) {
|
|
101
|
+
const r = A(o)[1];
|
|
102
102
|
t.push({
|
|
103
|
-
token:
|
|
103
|
+
token: o,
|
|
104
104
|
kind: "shadowed",
|
|
105
|
-
detail: `"${e.namespace}" declares no "${
|
|
105
|
+
detail: `"${e.namespace}" declares no "${a}". Unvalidated, this would fall back to ${r ?? "nothing"} and paint something plausible — which is the silent-typo failure this check exists to prevent.`
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
return t;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Z(e, n) {
|
|
112
112
|
return e.sections[n] ?? {};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function ee(e, n, t) {
|
|
115
115
|
return { ...e, sections: { ...e.sections, [n]: t } };
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const B = v.densities, D = (e) => Number.parseFloat(e), P = Math.min(...Object.values(B).map(D)), j = 1.5, _ = [
|
|
118
118
|
{
|
|
119
119
|
id: "target-size",
|
|
120
120
|
subject: "the smallest interactive control, at the smallest density",
|
|
121
|
-
measured: Number((
|
|
121
|
+
measured: Number((j * P).toFixed(2)),
|
|
122
122
|
threshold: 24,
|
|
123
123
|
holds: ">=",
|
|
124
124
|
unit: "CSS px",
|
|
@@ -136,91 +136,142 @@ const $ = k.densities, O = (e) => Number.parseFloat(e), C = Math.min(...Object.v
|
|
|
136
136
|
reason: "Real and not gradeable, and saying so beats inventing a bar. `--kanzo-font-size-xs` is 0.625rem, which is 10px at the default root and 8.75px at compact. What would close it: a house floor with a reason. The honest anchor already exists in the source — the IDE tier justifies `--kanzo-font-size-base` as 13px, 'below Tailwind text-xs', which means the scale was designed against a floor nobody wrote down. Writing that floor down is the work."
|
|
137
137
|
}
|
|
138
138
|
];
|
|
139
|
-
function
|
|
140
|
-
return
|
|
139
|
+
function te() {
|
|
140
|
+
return _.filter(
|
|
141
141
|
(e) => e.measured !== null && e.threshold !== null
|
|
142
142
|
).map((e) => ({
|
|
143
143
|
...e,
|
|
144
144
|
ok: e.holds === ">=" ? e.measured >= e.threshold : e.holds === "<=" ? e.measured <= e.threshold : e.measured < e.threshold
|
|
145
145
|
}));
|
|
146
146
|
}
|
|
147
|
-
const
|
|
148
|
-
function
|
|
149
|
-
const n = e.trim().replace(/^#/, ""), [t = 0,
|
|
150
|
-
(
|
|
151
|
-
),
|
|
147
|
+
const F = (e) => e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4, g = (e) => e <= 31308e-7 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - 0.055, G = (e) => Math.min(255, Math.max(0, Math.round(e * 255)));
|
|
148
|
+
function k(e) {
|
|
149
|
+
const n = e.trim().replace(/^#/, ""), [t = 0, o = 0, s = 0] = [0, 2, 4].map(
|
|
150
|
+
(d) => F(Number.parseInt(n.slice(d, d + 2), 16) / 255)
|
|
151
|
+
), a = Math.cbrt(0.4122214708 * t + 0.5363325363 * o + 0.0514459929 * s), r = Math.cbrt(0.2119034982 * t + 0.6806995451 * o + 0.1073969566 * s), c = Math.cbrt(0.0883024619 * t + 0.2817188376 * o + 0.6299787005 * s), i = 1.9779984951 * a - 2.428592205 * r + 0.4505937099 * c, l = 0.0259040371 * a + 0.7827717662 * r - 0.808675766 * c;
|
|
152
152
|
return {
|
|
153
|
-
l: 0.2104542553 *
|
|
153
|
+
l: 0.2104542553 * a + 0.793617785 * r - 0.0040720468 * c,
|
|
154
154
|
c: Math.hypot(i, l),
|
|
155
155
|
h: (Math.atan2(l, i) * 180 / Math.PI + 360) % 360
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
function m({ l: e, c: n, h: t }) {
|
|
159
|
-
const
|
|
159
|
+
const o = t * Math.PI / 180, s = n * Math.cos(o), a = n * Math.sin(o), r = (e + 0.3963377774 * s + 0.2158037573 * a) ** 3, c = (e - 0.1055613458 * s - 0.0638541728 * a) ** 3, i = (e - 0.0894841775 * s - 1.291485548 * a) ** 3;
|
|
160
160
|
return `#${[
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
].map((l) =>
|
|
161
|
+
g(4.0767416621 * r - 3.3077115913 * c + 0.2309699292 * i),
|
|
162
|
+
g(-1.2684380046 * r + 2.6097574011 * c - 0.3413193965 * i),
|
|
163
|
+
g(-0.0041960863 * r - 0.7034186147 * c + 1.707614701 * i)
|
|
164
|
+
].map((l) => G(l).toString(16).padStart(2, "0")).join("")}`;
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
const n = e.trim().replace(/^#/, ""), [t = 0,
|
|
168
|
-
(
|
|
166
|
+
const M = (e) => {
|
|
167
|
+
const n = e.trim().replace(/^#/, ""), [t = 0, o = 0, s = 0] = [0, 2, 4].map(
|
|
168
|
+
(a) => F(Number.parseInt(n.slice(a, a + 2), 16) / 255)
|
|
169
169
|
);
|
|
170
|
-
return 0.2126 * t + 0.7152 *
|
|
170
|
+
return 0.2126 * t + 0.7152 * o + 0.0722 * s;
|
|
171
171
|
};
|
|
172
|
-
function
|
|
173
|
-
const [t,
|
|
174
|
-
return (t + 0.05) / (
|
|
172
|
+
function f(e, n) {
|
|
173
|
+
const [t, o] = [M(e), M(n)].sort((s, a) => a - s);
|
|
174
|
+
return (t + 0.05) / (o + 0.05);
|
|
175
175
|
}
|
|
176
|
-
const
|
|
176
|
+
const h = 4.5, p = (e, n, t, o = 0.2) => ({
|
|
177
177
|
l: n ? e.l * (1 - t) : e.l + (1 - e.l) * t,
|
|
178
|
-
c: e.c *
|
|
178
|
+
c: e.c * o,
|
|
179
179
|
h: e.h
|
|
180
|
-
}),
|
|
181
|
-
function
|
|
182
|
-
const [
|
|
183
|
-
const l =
|
|
180
|
+
}), N = 0.8, I = 0.9;
|
|
181
|
+
function ne(e, n, t) {
|
|
182
|
+
const [o, s] = [k(e), k(n)], a = (i) => i.h * Math.PI / 180, r = (i) => {
|
|
183
|
+
const l = o.c * Math.cos(a(o)) * i + s.c * Math.cos(a(s)) * (1 - i), d = o.c * Math.sin(a(o)) * i + s.c * Math.sin(a(s)) * (1 - i);
|
|
184
184
|
return m({
|
|
185
|
-
l:
|
|
186
|
-
c: Math.hypot(l,
|
|
187
|
-
h: (Math.atan2(
|
|
185
|
+
l: o.l * i + s.l * (1 - i),
|
|
186
|
+
c: Math.hypot(l, d),
|
|
187
|
+
h: (Math.atan2(d, l) * 180 / Math.PI + 360) % 360
|
|
188
188
|
});
|
|
189
189
|
}, c = r(0.6);
|
|
190
|
-
if (t === void 0 ||
|
|
190
|
+
if (t === void 0 || f(c, t) >= h) return c;
|
|
191
191
|
for (let i = 0.58; i >= 0; i -= 0.02) {
|
|
192
192
|
const l = r(i);
|
|
193
|
-
if (
|
|
193
|
+
if (f(l, t) >= h) return l;
|
|
194
194
|
}
|
|
195
195
|
return r(0);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
for (let
|
|
201
|
-
const r = m(
|
|
202
|
-
if (
|
|
197
|
+
function S(e, n, t) {
|
|
198
|
+
const o = t ? N : I, s = m(p(n, t, o));
|
|
199
|
+
if (f(e, s) >= h) return s;
|
|
200
|
+
for (let a = o; a <= 1.0001; a += 0.01) {
|
|
201
|
+
const r = m(p(n, t, a));
|
|
202
|
+
if (f(e, r) >= h) return r;
|
|
203
203
|
}
|
|
204
|
-
for (let
|
|
205
|
-
const r = m(
|
|
206
|
-
if (
|
|
204
|
+
for (let a = 0.2; a >= -1e-4; a -= 0.02) {
|
|
205
|
+
const r = m(p(n, t, 1, a));
|
|
206
|
+
if (f(e, r) >= h) return r;
|
|
207
|
+
}
|
|
208
|
+
return m(p(n, t, 1, 0));
|
|
209
|
+
}
|
|
210
|
+
function oe(e) {
|
|
211
|
+
const n = k(e), t = f(e, m(p(n, !0, N))) >= f(e, m(p(n, !1, I))), o = S(e, n, t);
|
|
212
|
+
if (f(e, o) >= h) return o;
|
|
213
|
+
const s = S(e, n, !t);
|
|
214
|
+
return f(e, s) > f(e, o) ? s : o;
|
|
215
|
+
}
|
|
216
|
+
const u = (e, n) => ({ ground: e, ink: n, min: h }), b = (e, n) => ({ ground: e, ink: n, min: 3 }), U = ["keyword", "string", "number", "function", "variable", "property", "type", "annotation"], H = [
|
|
217
|
+
u("--background", "--foreground"),
|
|
218
|
+
u("--card", "--foreground"),
|
|
219
|
+
u("--popover", "--foreground"),
|
|
220
|
+
u("--muted", "--muted-foreground"),
|
|
221
|
+
u("--background", "--muted-foreground"),
|
|
222
|
+
u("--primary", "--primary-foreground"),
|
|
223
|
+
u("--secondary", "--secondary-foreground"),
|
|
224
|
+
u("--accent", "--accent-foreground"),
|
|
225
|
+
u("--accent", "--muted-foreground"),
|
|
226
|
+
u("--destructive", "--destructive-content"),
|
|
227
|
+
u("--info", "--info-content"),
|
|
228
|
+
u("--success", "--success-content"),
|
|
229
|
+
u("--warning", "--warning-content"),
|
|
230
|
+
u("--sidebar", "--sidebar-foreground"),
|
|
231
|
+
u("--background", "--destructive-foreground"),
|
|
232
|
+
u("--background", "--info-foreground"),
|
|
233
|
+
u("--background", "--success-foreground"),
|
|
234
|
+
u("--background", "--warning-foreground"),
|
|
235
|
+
...U.flatMap((e) => [
|
|
236
|
+
u("--background", `--syntax-${e}`),
|
|
237
|
+
u("--muted", `--syntax-${e}`)
|
|
238
|
+
]),
|
|
239
|
+
b("--background", "--primary"),
|
|
240
|
+
b("--background", "--ring"),
|
|
241
|
+
b("--background", "--input"),
|
|
242
|
+
...[1, 2, 3, 4, 5, 6, 7, 8].map((e) => b("--background", `--chart-${e}`))
|
|
243
|
+
], w = /^#[0-9a-f]{6}$/i;
|
|
244
|
+
function ae(e, n = H) {
|
|
245
|
+
var o, s;
|
|
246
|
+
const t = [];
|
|
247
|
+
for (const a of n) {
|
|
248
|
+
const [r, c] = [(o = e(a.ground)) == null ? void 0 : o.trim(), (s = e(a.ink)) == null ? void 0 : s.trim()];
|
|
249
|
+
if (!r || !c || !w.test(r) || !w.test(c)) continue;
|
|
250
|
+
const i = f(r, c);
|
|
251
|
+
i < a.min && t.push({ ...a, ratio: i });
|
|
252
|
+
}
|
|
253
|
+
return t;
|
|
254
|
+
}
|
|
255
|
+
const W = v, se = v.themes;
|
|
256
|
+
function re(e) {
|
|
257
|
+
var t;
|
|
258
|
+
const n = /* @__PURE__ */ new Map();
|
|
259
|
+
for (const o of e) {
|
|
260
|
+
const s = o.family ?? o.value, a = n.get(s) ?? n.set(s, { family: s }).get(s);
|
|
261
|
+
a[t = o.dark ? "dark" : "light"] ?? (a[t] = o);
|
|
207
262
|
}
|
|
208
|
-
return
|
|
263
|
+
return [...n.values()];
|
|
209
264
|
}
|
|
210
|
-
function
|
|
211
|
-
const n =
|
|
212
|
-
|
|
213
|
-
const s = y(e, n, !t);
|
|
214
|
-
return d(e, s) > d(e, a) ? s : a;
|
|
265
|
+
function ie(e) {
|
|
266
|
+
const n = e.find((o) => !o.dark), t = e.find((o) => o.dark && (n == null ? void 0 : n.family) !== void 0 && o.family === n.family) ?? e.find((o) => o.dark);
|
|
267
|
+
return { light: (n == null ? void 0 : n.value) ?? "", dark: (t == null ? void 0 : t.value) ?? "" };
|
|
215
268
|
}
|
|
216
|
-
const
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
// defers to the OS. One spelling is what lets it be declared, and therefore resolved, like the rest.
|
|
220
|
-
appearance: "",
|
|
269
|
+
const ce = 8, ue = {
|
|
270
|
+
// A host moves the starting side with `policy.theme.appearance.default`.
|
|
271
|
+
appearance: "light",
|
|
221
272
|
radius: "md",
|
|
222
|
-
font: "
|
|
223
|
-
monoFont: "
|
|
273
|
+
font: "geist",
|
|
274
|
+
monoFont: "geist-mono",
|
|
224
275
|
density: "default",
|
|
225
276
|
// Empty, and both sides fall through to the tenant's default — so a tenant shipping one theme per
|
|
226
277
|
// side stores nothing and gets the `<html>` it always had. `""` per side means the same thing:
|
|
@@ -231,7 +282,7 @@ const D = k, Z = k.themes, ee = 8, te = {
|
|
|
231
282
|
// choice* the first time the panel opened — and a default that has been stored can no longer move
|
|
232
283
|
// when the section, or the tenant's policy, changes it.
|
|
233
284
|
sections: {}
|
|
234
|
-
},
|
|
285
|
+
}, le = "kanzo_theme_prefs", K = W.prefs, de = "theme", fe = Object.entries(K).filter(([, e]) => !!e.attr).map(([e, n]) => ({
|
|
235
286
|
key: e,
|
|
236
287
|
attr: n.attr,
|
|
237
288
|
def: n.default,
|
|
@@ -239,31 +290,35 @@ const D = k, Z = k.themes, ee = 8, te = {
|
|
|
239
290
|
byAppearance: n.byAppearance
|
|
240
291
|
}));
|
|
241
292
|
export {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
293
|
+
h as AA,
|
|
294
|
+
fe as AXES,
|
|
295
|
+
ce as CHART_SLOTS,
|
|
296
|
+
H as CONTRAST_PAIRS,
|
|
297
|
+
de as CORE_NAMESPACE,
|
|
298
|
+
K as CORE_PREFS,
|
|
299
|
+
ue as DEFAULT_PREFS,
|
|
300
|
+
_ as DENSITY_OBLIGATIONS,
|
|
301
|
+
le as STORAGE_KEY,
|
|
302
|
+
ae as auditContrast,
|
|
303
|
+
te as checkDensity,
|
|
304
|
+
f as contrast,
|
|
305
|
+
ie as defaultThemePair,
|
|
306
|
+
A as fallbackChain,
|
|
253
307
|
m as hex,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
308
|
+
oe as inkFor,
|
|
309
|
+
k as oklch,
|
|
310
|
+
ne as pageInk,
|
|
311
|
+
Y as prefBoolean,
|
|
312
|
+
J as prefNumber,
|
|
313
|
+
x as prefOptions,
|
|
314
|
+
X as resolvePref,
|
|
315
|
+
q as resolveSectionToken,
|
|
316
|
+
Z as sectionOf,
|
|
317
|
+
W as themeData,
|
|
318
|
+
re as themeFamilies,
|
|
319
|
+
se as themeIndex,
|
|
320
|
+
Q as validatePrefs,
|
|
321
|
+
V as validateSection,
|
|
322
|
+
ee as withSection
|
|
268
323
|
};
|
|
269
324
|
//# sourceMappingURL=index.js.map
|