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