@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.
Files changed (44) hide show
  1. package/README.md +61 -22
  2. package/dist/contrast.d.ts +34 -0
  3. package/dist/contrast.d.ts.map +1 -0
  4. package/dist/index.d.ts +35 -74
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +188 -133
  7. package/dist/index.js.map +1 -1
  8. package/dist/ink.d.ts +2 -2
  9. package/dist/sections.d.ts +0 -7
  10. package/dist/sections.d.ts.map +1 -1
  11. package/package.json +1 -1
  12. package/theme-data.json +35 -107
  13. package/themes/catppuccin-latte.css +52 -45
  14. package/themes/catppuccin-mocha.css +55 -47
  15. package/themes/kanzo-dark.css +55 -55
  16. package/themes/kanzo.css +53 -50
  17. package/themes/lofi-dark.css +70 -0
  18. package/themes/lofi.css +38 -22
  19. package/themes/nord-dark.css +54 -46
  20. package/themes/nord.css +55 -47
  21. package/themes.css +4 -25
  22. package/tokens.css +49 -35
  23. package/themes/acid.css +0 -54
  24. package/themes/bank-dark.css +0 -62
  25. package/themes/bank-private-dark.css +0 -62
  26. package/themes/bank-private.css +0 -61
  27. package/themes/bank.css +0 -61
  28. package/themes/catppuccin-latte-dark.css +0 -62
  29. package/themes/catppuccin-mocha-dark.css +0 -62
  30. package/themes/cmyk.css +0 -54
  31. package/themes/coffee.css +0 -54
  32. package/themes/cyberpunk.css +0 -54
  33. package/themes/dim.css +0 -54
  34. package/themes/dracula-dark.css +0 -62
  35. package/themes/dracula.css +0 -61
  36. package/themes/forest.css +0 -54
  37. package/themes/lemonade.css +0 -54
  38. package/themes/luxury.css +0 -54
  39. package/themes/monochrome-dark.css +0 -62
  40. package/themes/monochrome.css +0 -61
  41. package/themes/night.css +0 -54
  42. package/themes/sunset.css +0 -54
  43. package/themes/synthwave.css +0 -54
  44. package/themes/wireframe.css +0 -54
package/dist/index.js CHANGED
@@ -1,28 +1,28 @@
1
- const I = { none: "0rem", xs: "0.125rem", sm: "0.25rem", md: "0.5rem", lg: "0.625rem" }, N = { 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)' }, R = { 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)' }, z = { default: "16px", compact: "14px", comfortable: "18px" }, E = [{ name: "acid", dark: !1 }, { name: "bank-dark", dark: !0 }, { name: "bank-private-dark", dark: !0 }, { name: "bank-private", dark: !1 }, { name: "bank", dark: !1 }, { name: "catppuccin-latte-dark", dark: !0 }, { name: "catppuccin-latte", dark: !1 }, { name: "catppuccin-mocha-dark", dark: !0 }, { name: "catppuccin-mocha", dark: !1 }, { name: "cmyk", dark: !1 }, { name: "coffee", dark: !0 }, { name: "cyberpunk", dark: !1 }, { name: "dim", dark: !0 }, { name: "dracula-dark", dark: !0 }, { name: "dracula", dark: !1 }, { name: "forest", dark: !0 }, { name: "kanzo-dark", dark: !0 }, { name: "kanzo", dark: !1 }, { name: "lemonade", dark: !1 }, { name: "lofi", dark: !1 }, { name: "luxury", dark: !0 }, { name: "monochrome-dark", dark: !0 }, { name: "monochrome", dark: !1 }, { name: "night", dark: !0 }, { name: "nord-dark", dark: !0 }, { name: "nord", dark: !1 }, { name: "sunset", dark: !0 }, { name: "synthwave", dark: !0 }, { name: "wireframe", dark: !1 }], T = { appearance: { kind: "choice", options: [{ value: "", label: "System" }, { value: "light", label: "Light" }, { value: "dark", label: "Dark" }], default: "", 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: "system", 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: "system", 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" } }, 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"] }, k = {
2
- radii: I,
3
- fonts: N,
4
- monoFonts: R,
5
- densities: z,
6
- themes: E,
7
- prefs: T,
8
- fallbacks: L
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 M(e, n) {
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 G = (e) => e === "true";
17
- function U(e, n) {
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 H(e, n, t, a) {
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 = M(e, a);
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 o = !(t != null && t.hidden);
34
- return o && s(n) ? { value: n, via: "stored", offered: o } : s(t == null ? void 0 : t.default) ? { value: t.default, via: "policy", offered: o } : { value: e.default, via: "default", offered: o };
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 W(e, n, t) {
37
- const a = [], s = e.prefs ?? {};
38
- for (const [o, r] of Object.entries(n)) {
39
- const c = s[o];
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
- a.push({
42
- token: o,
41
+ o.push({
42
+ token: a,
43
43
  kind: "unknown",
44
- detail: `"${e.namespace}" declares no preference "${o}"`
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 u = M(c, t);
52
- if (u === null) continue;
53
- const g = u.map((F) => F.value);
54
- i = g.includes(r), l = g.join(", ");
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 u = Number.parseFloat(r);
63
- i = Number.isFinite(u) && u >= c.min && u <= c.max, l = `${c.min}–${c.max}`;
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 || a.push({
67
- token: o,
66
+ i || o.push({
67
+ token: a,
68
68
  kind: "shadowed",
69
- detail: `"${r}" is not a legal ${e.namespace}.${o} (${l}). It resolves to the default instead.`
69
+ detail: `"${r}" is not a legal ${e.namespace}.${a} (${l}). It resolves to the default instead.`
70
70
  });
71
71
  }
72
- return a;
72
+ return o;
73
73
  }
74
- function S(e) {
75
- const t = e.replace(/^--/, "").split("-"), a = [];
76
- for (let s = 0; s < t.length; s++) a.push(`--${t.slice(s).join("-")}`);
77
- return a;
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 J(e, n, t) {
80
- for (const o of S(e)) {
81
- const r = n[o];
82
- if (r !== void 0) return { value: r, via: o };
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 a = e.replace(new RegExp(`^--${t.namespace}-`), ""), s = (t.tokens ?? {})[a];
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 K(e, n) {
87
+ function V(e, n) {
88
88
  const t = [];
89
- for (const a of Object.keys(n)) {
89
+ for (const o of Object.keys(n)) {
90
90
  const s = `--${e.namespace}-`;
91
- if (!a.startsWith(s)) {
91
+ if (!o.startsWith(s)) {
92
92
  t.push({
93
- token: a,
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 o = a.slice(s.length);
100
- if (!(o in (e.tokens ?? {}))) {
101
- const r = S(a)[1];
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: a,
103
+ token: o,
104
104
  kind: "shadowed",
105
- detail: `"${e.namespace}" declares no "${o}". Unvalidated, this would fall back to ${r ?? "nothing"} and paint something plausible — which is the silent-typo failure this check exists to prevent.`
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 Y(e, n) {
111
+ function Z(e, n) {
112
112
  return e.sections[n] ?? {};
113
113
  }
114
- function X(e, n, t) {
114
+ function ee(e, n, t) {
115
115
  return { ...e, sections: { ...e.sections, [n]: t } };
116
116
  }
117
- const $ = k.densities, O = (e) => Number.parseFloat(e), C = Math.min(...Object.values($).map(O)), B = 1.5, j = [
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((B * C).toFixed(2)),
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 q() {
140
- return j.filter(
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 x = (e) => e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4, p = (e) => e <= 31308e-7 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - 0.055, _ = (e) => Math.min(255, Math.max(0, Math.round(e * 255)));
148
- function b(e) {
149
- const n = e.trim().replace(/^#/, ""), [t = 0, a = 0, s = 0] = [0, 2, 4].map(
150
- (u) => x(Number.parseInt(n.slice(u, u + 2), 16) / 255)
151
- ), o = Math.cbrt(0.4122214708 * t + 0.5363325363 * a + 0.0514459929 * s), r = Math.cbrt(0.2119034982 * t + 0.6806995451 * a + 0.1073969566 * s), c = Math.cbrt(0.0883024619 * t + 0.2817188376 * a + 0.6299787005 * s), i = 1.9779984951 * o - 2.428592205 * r + 0.4505937099 * c, l = 0.0259040371 * o + 0.7827717662 * r - 0.808675766 * c;
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 * o + 0.793617785 * r - 0.0040720468 * c,
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 a = t * Math.PI / 180, s = n * Math.cos(a), o = n * Math.sin(a), r = (e + 0.3963377774 * s + 0.2158037573 * o) ** 3, c = (e - 0.1055613458 * s - 0.0638541728 * o) ** 3, i = (e - 0.0894841775 * s - 1.291485548 * o) ** 3;
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
- p(4.0767416621 * r - 3.3077115913 * c + 0.2309699292 * i),
162
- p(-1.2684380046 * r + 2.6097574011 * c - 0.3413193965 * i),
163
- p(-0.0041960863 * r - 0.7034186147 * c + 1.707614701 * i)
164
- ].map((l) => _(l).toString(16).padStart(2, "0")).join("")}`;
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 v = (e) => {
167
- const n = e.trim().replace(/^#/, ""), [t = 0, a = 0, s = 0] = [0, 2, 4].map(
168
- (o) => x(Number.parseInt(n.slice(o, o + 2), 16) / 255)
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 * a + 0.0722 * s;
170
+ return 0.2126 * t + 0.7152 * o + 0.0722 * s;
171
171
  };
172
- function d(e, n) {
173
- const [t, a] = [v(e), v(n)].sort((s, o) => o - s);
174
- return (t + 0.05) / (a + 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 f = 4.5, h = (e, n, t, a = 0.2) => ({
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 * a,
178
+ c: e.c * o,
179
179
  h: e.h
180
- }), w = 0.8, A = 0.9;
181
- function Q(e, n, t) {
182
- const [a, s] = [b(e), b(n)], o = (i) => i.h * Math.PI / 180, r = (i) => {
183
- const l = a.c * Math.cos(o(a)) * i + s.c * Math.cos(o(s)) * (1 - i), u = a.c * Math.sin(o(a)) * i + s.c * Math.sin(o(s)) * (1 - i);
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: a.l * i + s.l * (1 - i),
186
- c: Math.hypot(l, u),
187
- h: (Math.atan2(u, l) * 180 / Math.PI + 360) % 360
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 || d(c, t) >= f) return c;
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 (d(l, t) >= f) return l;
193
+ if (f(l, t) >= h) return l;
194
194
  }
195
195
  return r(0);
196
196
  }
197
- function y(e, n, t) {
198
- const a = t ? w : A, s = m(h(n, t, a));
199
- if (d(e, s) >= f) return s;
200
- for (let o = a; o <= 1.0001; o += 0.01) {
201
- const r = m(h(n, t, o));
202
- if (d(e, r) >= f) return r;
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 o = 0.2; o >= -1e-4; o -= 0.02) {
205
- const r = m(h(n, t, 1, o));
206
- if (d(e, r) >= f) return r;
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 m(h(n, t, 1, 0));
263
+ return [...n.values()];
209
264
  }
210
- function V(e) {
211
- const n = b(e), t = d(e, m(h(n, !0, w))) >= d(e, m(h(n, !1, A))), a = y(e, n, t);
212
- if (d(e, a) >= f) return a;
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 D = k, Z = k.themes, ee = 8, te = {
217
- // `""`, not `"system"` and no longer `null`: the default is to have no side pinned, spelled the
218
- // way every other deferral in this table is — a theme key of `""` defers to the tenant, this
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: "system",
223
- monoFont: "system",
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
- }, ne = "kanzo_theme_prefs", P = D.prefs, ae = "theme", oe = Object.entries(P).filter(([, e]) => !!e.attr).map(([e, n]) => ({
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
- f as AA,
243
- oe as AXES,
244
- ee as CHART_SLOTS,
245
- ae as CORE_NAMESPACE,
246
- P as CORE_PREFS,
247
- te as DEFAULT_PREFS,
248
- j as DENSITY_OBLIGATIONS,
249
- ne as STORAGE_KEY,
250
- q as checkDensity,
251
- d as contrast,
252
- S as fallbackChain,
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
- V as inkFor,
255
- b as oklch,
256
- Q as pageInk,
257
- G as prefBoolean,
258
- U as prefNumber,
259
- M as prefOptions,
260
- H as resolvePref,
261
- J as resolveSectionToken,
262
- Y as sectionOf,
263
- D as themeData,
264
- Z as themeIndex,
265
- W as validatePrefs,
266
- K as validateSection,
267
- X as withSection
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