@starasia/theme 3.5.0 → 3.7.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.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as M, jsxs as q } from "react/jsx-runtime";
2
- import { createContext as ve, useState as _, useMemo as K, useEffect as O, useRef as ge, useCallback as $, useContext as ie } from "react";
3
- const me = (e, r) => {
1
+ import { jsx as C, jsxs as ae } from "react/jsx-runtime";
2
+ import { createContext as me, useState as _, useMemo as Q, useEffect as I, useRef as ye, useCallback as $, useContext as be } from "react";
3
+ const he = (e, r) => {
4
4
  if (typeof document > "u")
5
5
  return;
6
6
  const a = document.getElementById(r);
@@ -10,7 +10,7 @@ const me = (e, r) => {
10
10
  const s = document.createElement("style");
11
11
  s.id = r, s.textContent = e, document.head.appendChild(s);
12
12
  }
13
- }, ye = (e) => {
13
+ }, we = (e) => {
14
14
  if (typeof document > "u")
15
15
  return null;
16
16
  const r = document.getElementById(e);
@@ -19,7 +19,7 @@ const me = (e, r) => {
19
19
  const a = document.createElement("style");
20
20
  return a.id = e, document.head.appendChild(a), a;
21
21
  };
22
- function j(e) {
22
+ function T(e) {
23
23
  let r = e.trim().replace(/^#/, "");
24
24
  r.length === 3 && (r = r.split("").map((s) => s + s).join("")), r.length === 8 && (r = r.slice(0, 6));
25
25
  const a = parseInt(r, 16);
@@ -29,12 +29,12 @@ function j(e) {
29
29
  b: (a & 255) / 255
30
30
  };
31
31
  }
32
- const J = (e) => Math.max(0, Math.min(255, Math.round(e * 255))).toString(16).padStart(2, "0");
33
- function he({ r: e, g: r, b: a }) {
34
- return `#${J(e)}${J(r)}${J(a)}`;
32
+ const Y = (e) => Math.max(0, Math.min(255, Math.round(e * 255))).toString(16).padStart(2, "0");
33
+ function xe({ r: e, g: r, b: a }) {
34
+ return `#${Y(e)}${Y(r)}${Y(a)}`;
35
35
  }
36
- const C = (e) => e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4), Y = (e) => e <= 31308e-7 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
37
- function we(e, r, a) {
36
+ const A = (e) => e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4), z = (e) => e <= 31308e-7 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
37
+ function Se(e, r, a) {
38
38
  const s = 0.4122214708 * e + 0.5363325363 * r + 0.0514459929 * a, c = 0.2119034982 * e + 0.6806995451 * r + 0.1073969566 * a, o = 0.0883024619 * e + 0.2817188376 * r + 0.6299787005 * a, n = Math.cbrt(s), d = Math.cbrt(c), t = Math.cbrt(o);
39
39
  return {
40
40
  L: 0.2104542553 * n + 0.793617785 * d - 0.0040720468 * t,
@@ -42,7 +42,7 @@ function we(e, r, a) {
42
42
  b: 0.0259040371 * n + 0.7827717662 * d - 0.808675766 * t
43
43
  };
44
44
  }
45
- function xe(e, r, a) {
45
+ function Ee(e, r, a) {
46
46
  const s = e + 0.3963377774 * r + 0.2158037573 * a, c = e - 0.1055613458 * r - 0.0638541728 * a, o = e - 0.0894841775 * r - 1.291485548 * a, n = s * s * s, d = c * c * c, t = o * o * o;
47
47
  return {
48
48
  r: 4.0767416621 * n - 3.3077115913 * d + 0.2309699292 * t,
@@ -50,53 +50,53 @@ function xe(e, r, a) {
50
50
  b: -0.0041960863 * n - 0.7034186147 * d + 1.707614701 * t
51
51
  };
52
52
  }
53
- function Se({ r: e, g: r, b: a }) {
54
- const { L: s, a: c, b: o } = we(
55
- C(e),
56
- C(r),
57
- C(a)
53
+ function Me({ r: e, g: r, b: a }) {
54
+ const { L: s, a: c, b: o } = Se(
55
+ A(e),
56
+ A(r),
57
+ A(a)
58
58
  ), n = Math.sqrt(c * c + o * o);
59
59
  let d = Math.atan2(o, c) * 180 / Math.PI;
60
60
  return d < 0 && (d += 360), { l: s, c: n, h: d };
61
61
  }
62
- const x = (e) => Se(j(e)), ee = ({ r: e, g: r, b: a }, s = 1e-4) => e >= -s && e <= 1 + s && r >= -s && r <= 1 + s && a >= -s && a <= 1 + s;
63
- function Ee({ l: e, c: r, h: a }) {
64
- const s = a * Math.PI / 180, c = (n) => xe(e, n * Math.cos(s), n * Math.sin(s));
62
+ const w = (e) => Me(T(e)), se = ({ r: e, g: r, b: a }, s = 1e-4) => e >= -s && e <= 1 + s && r >= -s && r <= 1 + s && a >= -s && a <= 1 + s;
63
+ function Ce({ l: e, c: r, h: a }) {
64
+ const s = a * Math.PI / 180, c = (n) => Ee(e, n * Math.cos(s), n * Math.sin(s));
65
65
  let o = c(r);
66
- if (!ee(o)) {
66
+ if (!se(o)) {
67
67
  let n = 0, d = r;
68
68
  for (let t = 0; t < 20; t++) {
69
69
  const b = (n + d) / 2;
70
- o = c(b), ee(o) ? n = b : d = b;
70
+ o = c(b), se(o) ? n = b : d = b;
71
71
  }
72
72
  o = c(n);
73
73
  }
74
74
  return {
75
- r: Math.min(1, Math.max(0, Y(o.r))),
76
- g: Math.min(1, Math.max(0, Y(o.g))),
77
- b: Math.min(1, Math.max(0, Y(o.b)))
75
+ r: Math.min(1, Math.max(0, z(o.r))),
76
+ g: Math.min(1, Math.max(0, z(o.g))),
77
+ b: Math.min(1, Math.max(0, z(o.b)))
78
78
  };
79
79
  }
80
- const D = (e) => he(Ee(e));
81
- function Q({ r: e, g: r, b: a }) {
82
- return 0.2126 * C(e) + 0.7152 * C(r) + 0.0722 * C(a);
80
+ const N = (e) => xe(Ce(e));
81
+ function V({ r: e, g: r, b: a }) {
82
+ return 0.2126 * A(e) + 0.7152 * A(r) + 0.0722 * A(a);
83
83
  }
84
- function Me(e, r) {
85
- const a = Q(j(e)), s = Q(j(r)), c = Math.max(a, s), o = Math.min(a, s);
84
+ function X(e, r) {
85
+ const a = V(T(e)), s = V(T(r)), c = Math.max(a, s), o = Math.min(a, s);
86
86
  return (c + 0.05) / (o + 0.05);
87
87
  }
88
- function V(e, r = ["#ffffff", "#1e1f21"]) {
88
+ function R(e, r = ["#ffffff", "#1e1f21"]) {
89
89
  let a = r[0], s = -1;
90
90
  for (const c of r) {
91
- const o = Me(e, c);
91
+ const o = X(e, c);
92
92
  o > s && (s = o, a = c);
93
93
  }
94
94
  return a;
95
95
  }
96
- function de(e) {
97
- return Q(j(e)) < 0.4;
96
+ function fe(e) {
97
+ return V(T(e)) < 0.4;
98
98
  }
99
- const T = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"], F = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "1100"], P = {
99
+ const F = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"], P = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "1100"], U = {
100
100
  brand: {
101
101
  L: [0.9434, 0.8816, 0.7612, 0.6375, 0.5179, 0.4415, 0.2695, 0.2429, 0.2155, 0.1878],
102
102
  C: [0.0143, 0.031, 0.0645, 0.1017, 0.1394, 0.1429, 0.086, 0.0761, 0.066, 0.0549]
@@ -117,40 +117,40 @@ const T = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
117
117
  L: [0.9673, 0.9003, 0.8504, 0.8055, 0.7624, 0.6961, 0.5244, 0.3979, 0.2567, 0.2201],
118
118
  C: [0.0205, 0.0679, 0.0991, 0.1284, 0.1495, 0.1346, 0.0998, 0.0731, 0.0415, 0.0332]
119
119
  }
120
- }, Ce = [1, 0.9791, 0.9577, 0.9007, 0.7857, 0.6501, 0.6028, 0.5383, 0.4389, 0.36, 0.2856, 0.239], Ae = [0.2127, 0.2401, 0.3133, 0.3673, 0.4198, 0.5093, 0.603, 0.682, 0.7408, 0.8102, 0.8546, 0.9153], Le = 0.02;
121
- function U(e, r) {
122
- const { c: a, h: s } = x(e), c = Math.max(...r.C) || 1;
120
+ }, Ae = [1, 0.9791, 0.9577, 0.9007, 0.7857, 0.6501, 0.6028, 0.5383, 0.4389, 0.36, 0.2856, 0.239], Le = [0.2127, 0.2401, 0.3133, 0.3673, 0.4198, 0.5093, 0.603, 0.682, 0.7408, 0.8102, 0.8546, 0.9153], $e = 0.02;
121
+ function H(e, r) {
122
+ const { c: a, h: s } = w(e), c = Math.max(...r.C) || 1;
123
123
  return r.L.map(
124
- (o, n) => D({ l: o, c: a * (r.C[n] / c), h: s })
124
+ (o, n) => N({ l: o, c: a * (r.C[n] / c), h: s })
125
125
  );
126
126
  }
127
- function re(e, r) {
128
- const { c: a, h: s } = x(e), c = Math.min(a, Le), o = r.length;
127
+ function oe(e, r) {
128
+ const { c: a, h: s } = w(e), c = Math.min(a, $e), o = r.length;
129
129
  return r.map((n, d) => {
130
130
  const t = d / (o - 1), b = 1 - Math.abs(2 * t - 1);
131
- return D({ l: n, c: c * b, h: s });
131
+ return N({ l: n, c: c * b, h: s });
132
132
  });
133
133
  }
134
- function ae(e, r, a, s, c = 0.018) {
135
- const o = x(e).l, n = x(r).l;
134
+ function ce(e, r, a, s, c = 0.018) {
135
+ const o = w(e).l, n = w(r).l;
136
136
  return Array.from({ length: a }, (d, t) => {
137
137
  if (t === 0)
138
138
  return e;
139
139
  if (t === a - 1)
140
140
  return r;
141
- const b = t / (a - 1), v = o + (n - o) * b, f = 1 - Math.abs(2 * b - 1);
142
- return D({ l: v, c: c * f, h: s });
141
+ const b = t / (a - 1), v = o + (n - o) * b, k = 1 - Math.abs(2 * b - 1);
142
+ return N({ l: v, c: c * k, h: s });
143
143
  });
144
144
  }
145
- function Ze(e, r) {
145
+ function qe(e, r) {
146
146
  let a = e[0], s = 1 / 0;
147
147
  for (const c of e) {
148
- const o = Math.abs(x(c).l - r);
148
+ const o = Math.abs(w(c).l - r);
149
149
  o < s && (s = o, a = c);
150
150
  }
151
151
  return a;
152
152
  }
153
- const be = [
153
+ const ue = [
154
154
  { token: "--sa-text-primary", recipe: "var(--sa-color-gray-1000, #292a2e)", scale: "gray" },
155
155
  { token: "--sa-text-primary-inverse", recipe: "var(--sa-color-gray-50, #ffffff)", scale: "gray" },
156
156
  { token: "--sa-text-on-brand", recipe: "var(--sa-color-gray-50, #ffffff)", scale: "gray" },
@@ -305,7 +305,7 @@ const be = [
305
305
  { token: "--sa-border-danger", recipe: "var(--sa-color-error-600, #c9184a)", scale: "error" },
306
306
  { token: "--sa-border-danger-subtle", recipe: "var(--sa-color-error-200, #ffb3c1)", scale: "error" },
307
307
  { token: "--sa-border-danger-disable", recipe: "var(--sa-color-error-200, #ffb3c1)", scale: "error" },
308
- { token: "--sa-border-success", recipe: "var(--sa-color-success-600, #28ac6e)", scale: "success" },
308
+ { token: "--sa-border-success", recipe: "var(--sa-color-success-700, #208958)", scale: "success" },
309
309
  { token: "--sa-border-success-subtle", recipe: "var(--sa-color-success-200, #97e6c1)", scale: "success" },
310
310
  { token: "--sa-border-success-disable", recipe: "var(--sa-color-success-200, #97e6c1)", scale: "success" },
311
311
  { token: "--sa-border-info", recipe: "var(--sa-color-info-600, #0090d4)", scale: "info" },
@@ -333,7 +333,7 @@ const be = [
333
333
  { token: "--sa-text-on-accent", recipe: "var(--sa-color-gray-1100, #1e1f21)", scale: "gray" },
334
334
  { token: "--sa-icon-accent", recipe: "var(--sa-color-amber-700, #a8690b)", scale: "amber" },
335
335
  { token: "--sa-border-accent", recipe: "var(--sa-color-amber-500, #f5a524)", scale: "amber" }
336
- ], fe = [
336
+ ], ke = [
337
337
  { token: "--sa-text-primary", recipe: "var(--sa-color-dark-1100, #e2e3e4)", scale: "dark" },
338
338
  { token: "--sa-text-primary-inverse", recipe: "var(--sa-color-gray-1100, #1e1f21)", scale: "gray" },
339
339
  { token: "--sa-text-brand", recipe: "var(--sa-color-brand-300, #668cc9)", scale: "brand" },
@@ -356,10 +356,10 @@ const be = [
356
356
  { token: "--sa-text-info-hover", recipe: "var(--sa-color-info-100, #def3ff)", scale: "info" },
357
357
  { token: "--sa-text-info-pressed", recipe: "var(--sa-color-info-200, #b6eaff)", scale: "info" },
358
358
  { token: "--sa-text-info-disable", recipe: "var(--sa-color-info-600, #0090d4)", scale: "info" },
359
- { token: "--sa-text-subtle", recipe: "var(--sa-color-gray-500, #8c8f97)", scale: "gray" },
360
- { token: "--sa-text-subtlest", recipe: "var(--sa-color-gray-600, #7d818a)", scale: "gray" },
361
- { token: "--sa-text-hover", recipe: "var(--sa-color-dark-400, #4b4d51)", scale: "dark" },
362
- { token: "--sa-text-pressed", recipe: "var(--sa-color-dark-200, #303134)", scale: "dark" },
359
+ { token: "--sa-text-subtle", recipe: "var(--sa-color-dark-800, #a9abaf)", scale: "dark" },
360
+ { token: "--sa-text-subtlest", recipe: "var(--sa-color-gray-500, #8c8f97)", scale: "gray" },
361
+ { token: "--sa-text-hover", recipe: "var(--sa-color-dark-800, #a9abaf)", scale: "dark" },
362
+ { token: "--sa-text-pressed", recipe: "var(--sa-color-dark-900, #bfc1c4)", scale: "dark" },
363
363
  { token: "--sa-text-disable", recipe: "var(--sa-color-white-alpha-a20, #ceced933)", scale: "white" },
364
364
  { token: "--sa-text-bolder", recipe: "var(--sa-color-gray-50, #ffffff)", scale: "gray" },
365
365
  { token: "--sa-text-warning", recipe: "var(--sa-color-warning-300, #f1b259)", scale: "warning" },
@@ -367,10 +367,10 @@ const be = [
367
367
  { token: "--sa-text-warning-hover", recipe: "var(--sa-color-warning-100, #f8d9ac)", scale: "warning" },
368
368
  { token: "--sa-text-warning-pressed", recipe: "var(--sa-color-warning-200, #f4c583)", scale: "warning" },
369
369
  { token: "--sa-text-warning-disable", recipe: "var(--sa-color-warning-600, #8e5f1d)", scale: "warning" },
370
- { token: "--sa-text-secondary", recipe: "var(--sa-color-secondary-300, #5468e1)", scale: "secondary" },
370
+ { token: "--sa-text-secondary", recipe: "var(--sa-color-secondary-200, #8a98ea)", scale: "secondary" },
371
371
  { token: "--sa-text-secondary-bolder", recipe: "var(--sa-color-secondary-50, #e6e9fb)", scale: "secondary" },
372
- { token: "--sa-text-secondary-hover", recipe: "var(--sa-color-secondary-100, #b0b9f1)", scale: "secondary" },
373
- { token: "--sa-text-secondary-pressed", recipe: "var(--sa-color-secondary-200, #8a98ea)", scale: "secondary" },
372
+ { token: "--sa-text-secondary-hover", recipe: "var(--sa-color-secondary-50, #e6e9fb)", scale: "secondary" },
373
+ { token: "--sa-text-secondary-pressed", recipe: "var(--sa-color-secondary-100, #b0b9f1)", scale: "secondary" },
374
374
  { token: "--sa-text-secondary-disable", recipe: "var(--sa-color-secondary-600, #001bbf)", scale: "secondary" },
375
375
  { token: "--sa-icon-primary", recipe: "var(--sa-color-dark-1100, #e2e3e4)", scale: "dark" },
376
376
  { token: "--sa-icon-primary-inverse", recipe: "var(--sa-color-gray-1100, #1e1f21)", scale: "gray" },
@@ -423,7 +423,7 @@ const be = [
423
423
  { token: "--sa-background-disable", recipe: "var(--sa-color-white-alpha-a5, #bdbdbd0d)", scale: "white" },
424
424
  { token: "--sa-background-overlay", recipe: "var(--sa-color-black-alpha-a45, #00000073)", scale: "black" },
425
425
  { token: "--sa-background-brand", recipe: "#3b6fe0", scale: null },
426
- { token: "--sa-background-brand-hover", recipe: "#5581e8", scale: null },
426
+ { token: "--sa-background-brand-hover", recipe: "#3565d9", scale: null },
427
427
  { token: "--sa-background-brand-pressed", recipe: "#2f5ad2", scale: null },
428
428
  { token: "--sa-background-brand-disable", recipe: "var(--sa-color-brand-600, #04254f)", scale: "brand" },
429
429
  { token: "--sa-background-brand-subtle", recipe: "var(--sa-color-brand-400, #3366b7)", scale: "brand" },
@@ -477,12 +477,12 @@ const be = [
477
477
  { token: "--sa-border-primary", recipe: "var(--sa-color-white-alpha-a20, #ceced933)", scale: "white" },
478
478
  { token: "--sa-border-primary-inverse", recipe: "var(--sa-color-dark-400, #4b4d51)", scale: "dark" },
479
479
  { token: "--sa-border-subtle", recipe: "var(--sa-color-white-alpha-a10, #bdbdbd1a)", scale: "white" },
480
- { token: "--sa-border-bold", recipe: "var(--sa-color-dark-500, #63666b)", scale: "dark" },
480
+ { token: "--sa-border-bold", recipe: "var(--sa-color-gray-600, #7d818a)", scale: "gray" },
481
481
  { token: "--sa-border-disabled", recipe: "var(--sa-color-white-alpha-a5, #bdbdbd0d)", scale: "white" },
482
482
  { token: "--sa-border-focused", recipe: "var(--sa-color-brand-300, #668cc9)", scale: "brand" },
483
- { token: "--sa-border-input", recipe: "var(--sa-color-dark-500, #63666b)", scale: "dark" },
484
- { token: "--sa-border-selected", recipe: "var(--sa-color-brand-400, #3366b7)", scale: "brand" },
485
- { token: "--sa-border-brand", recipe: "var(--sa-color-brand-400, #3366b7)", scale: "brand" },
483
+ { token: "--sa-border-input", recipe: "var(--sa-color-gray-700, #6b6e76)", scale: "gray" },
484
+ { token: "--sa-border-selected", recipe: "var(--sa-color-brand-300, #668cc9)", scale: "brand" },
485
+ { token: "--sa-border-brand", recipe: "var(--sa-color-brand-300, #668cc9)", scale: "brand" },
486
486
  { token: "--sa-border-brand-disable", recipe: "var(--sa-color-brand-600, #04254f)", scale: "brand" },
487
487
  { token: "--sa-border-danger", recipe: "var(--sa-color-error-500, #ff4d6d)", scale: "error" },
488
488
  { token: "--sa-border-danger-subtle", recipe: "var(--sa-color-error-700, #a4133c)", scale: "error" },
@@ -512,43 +512,92 @@ const be = [
512
512
  { token: "--sa-icon-accent", recipe: "var(--sa-color-amber-400, #ffb63f)", scale: "amber" },
513
513
  { token: "--sa-border-accent", recipe: "var(--sa-color-amber-400, #ffb63f)", scale: "amber" }
514
514
  ];
515
- function $e(e, r) {
515
+ function _e(e, r) {
516
516
  const a = e.match(/var\(--sa-color-([a-z]+)-(\d+),\s*([^)]+)\)/);
517
517
  if (!a)
518
518
  return e;
519
519
  const [, s, c, o] = a, n = r[s];
520
520
  if (!n)
521
521
  return o.trim();
522
- const t = (n.length === 12 ? F : T).indexOf(c);
522
+ const t = (n.length === 12 ? P : F).indexOf(c);
523
523
  return t >= 0 ? n[t] : o.trim();
524
524
  }
525
- function se(e, r) {
526
- const a = x(e);
527
- return D({ ...a, l: Math.min(0.98, Math.max(0.05, a.l + r)) });
525
+ function Z(e, r) {
526
+ const a = w(e);
527
+ return N({ ...a, l: Math.min(0.98, Math.max(0.02, a.l + r)) });
528
+ }
529
+ function q(e, r, a = 4.5) {
530
+ if (X(e, r) >= a)
531
+ return e;
532
+ const s = w(e).l >= w(r).l ? 1 : -1;
533
+ for (const c of [s, -s])
534
+ for (let o = 1; o <= 96; o++) {
535
+ const n = Z(e, c * o * 0.01);
536
+ if (X(n, r) >= a)
537
+ return n;
538
+ }
539
+ return R(r);
528
540
  }
529
- function _e(e) {
530
- const r = e.base, a = de(r), s = x(r), c = D({
541
+ function Re(e) {
542
+ const r = e.base, a = fe(r), s = w(r), c = N({
531
543
  l: a ? 0.96 : 0.22,
532
544
  c: Math.min(s.c * 0.5, 0.02),
533
545
  h: s.h
534
- }), o = a ? c : r, n = a ? r : c, d = ae(o, n, 12, s.h), t = ae(n, o, 12, s.h), b = U(e.brand, P.brand), v = { gray: d, dark: t, brand: b };
535
- ["error", "success", "info", "warning"].forEach((p) => {
536
- const y = e[p];
537
- y && (v[p] = U(y, P[p]));
546
+ }), o = a ? c : r, n = a ? r : c, d = ce(o, n, 12, s.h), t = ce(n, o, 12, s.h), b = H(e.brand, U.brand), v = { gray: d, dark: t, brand: b };
547
+ ["error", "success", "info", "warning"].forEach((u) => {
548
+ const g = e[u];
549
+ g && (v[u] = H(g, U[u]));
538
550
  });
539
- const f = a ? fe : be, u = {};
540
- for (const p of f)
541
- p.token !== "--sa-text-on-brand" && (u[p.token] = $e(p.recipe, v));
542
- const k = e.brand.toLowerCase(), m = V(k), S = m === "#ffffff" ? -1 : 1;
543
- u["--sa-background-brand"] = k, u["--sa-background-brand-hover"] = se(k, S * 0.06), u["--sa-background-brand-pressed"] = se(k, S * 0.12), u["--sa-text-on-brand"] = m;
544
- const g = {};
545
- for (const [p, y] of Object.entries(v))
546
- (y.length === 12 ? F : T).forEach((E, i) => {
547
- g[`--sa-color-${p}-${E}`] = y[i];
551
+ const k = a ? ke : ue, f = {};
552
+ for (const u of k)
553
+ u.token !== "--sa-text-on-brand" && (f[u.token] = _e(u.recipe, v));
554
+ const p = R(e.brand.toLowerCase()), m = q(e.brand.toLowerCase(), p), E = p === "#ffffff" ? -1 : 1;
555
+ f["--sa-background-brand"] = m, f["--sa-background-brand-hover"] = Z(m, E * 0.06), f["--sa-background-brand-pressed"] = Z(m, E * 0.12), f["--sa-text-on-brand"] = p;
556
+ const y = f["--sa-background-primary"], x = (u, g, i = 4.5) => {
557
+ f[u] && /^#[0-9a-f]{6}$/i.test(f[u]) && (f[u] = q(f[u], g, i));
558
+ };
559
+ for (const u of [
560
+ "--sa-text-primary",
561
+ "--sa-text-subtle",
562
+ "--sa-text-subtlest",
563
+ "--sa-text-hover",
564
+ "--sa-text-pressed",
565
+ "--sa-text-brand",
566
+ "--sa-text-brand-hover",
567
+ "--sa-text-brand-pressed",
568
+ "--sa-text-secondary",
569
+ "--sa-text-error",
570
+ "--sa-text-success",
571
+ "--sa-text-info",
572
+ "--sa-text-warning"
573
+ ])
574
+ x(u, y);
575
+ for (const u of [
576
+ "--sa-border-input",
577
+ "--sa-border-bold",
578
+ "--sa-border-brand",
579
+ "--sa-border-selected",
580
+ "--sa-border-focused",
581
+ "--sa-border-danger",
582
+ "--sa-border-success",
583
+ "--sa-border-info",
584
+ "--sa-border-warning"
585
+ ])
586
+ x(u, y, 3);
587
+ for (const u of ["--sa-background-neutral", "--sa-background-neutral-hover"])
588
+ x(u, f["--sa-text-primary"]);
589
+ if (f["--sa-text-on-accent"] = R("#f5a524"), a)
590
+ for (const u of ["error", "success", "info", "warning"])
591
+ for (const g of ["", "-hover", "-pressed"])
592
+ x(`--sa-background-${u}${g}`, f["--sa-text-primary-inverse"]);
593
+ const M = {};
594
+ for (const [u, g] of Object.entries(v))
595
+ (g.length === 12 ? P : F).forEach((l, h) => {
596
+ M[`--sa-color-${u}-${l}`] = g[h];
548
597
  });
549
- return { tokens: { ...g, ...u }, isDark: a, brand: b, gray: d };
598
+ return { tokens: { ...M, ...f }, isDark: a, brand: b, gray: d };
550
599
  }
551
- const qe = {
600
+ const er = {
552
601
  name: "starasia",
553
602
  brand: "#1a4fa0",
554
603
  neutral: "#7d818a",
@@ -558,46 +607,46 @@ const qe = {
558
607
  warning: "#ed9f30",
559
608
  radius: 8,
560
609
  font: { body: "Inter" }
561
- }, oe = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', Re = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', w = (e) => Math.round(e * 10) / 10;
562
- function I(e, r, a, s) {
610
+ }, ne = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', De = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', S = (e) => Math.round(e * 10) / 10;
611
+ function B(e, r, a, s) {
563
612
  s.forEach((c, o) => {
564
613
  e[`--sa-color-${r}-${c}`] = a[o];
565
614
  });
566
615
  }
567
- function De(e, r = {}) {
616
+ function Ne(e, r = {}) {
568
617
  const a = r.as ?? "root";
569
618
  if (a === "skin" && !r.name)
570
619
  throw new Error('buildTheme: options.name wajib saat as:"skin"');
571
620
  const s = a === "skin" ? `[data-skin="${r.name}"]` : r.selector ?? ":root";
572
621
  if (e.base)
573
- return Ne(e, s);
574
- const c = r.darkPrimary ?? !0, o = {}, n = {}, d = { brand: [] }, t = /* @__PURE__ */ new Set(["brand"]), b = U(e.brand, P.brand);
575
- if (d.brand = b, I(o, "brand", b, T), o["--sa-text-on-brand"] = V(b[6]), ["error", "success", "info", "warning"].forEach((f) => {
576
- const u = e[f];
577
- if (!u)
622
+ return Oe(e, s);
623
+ const c = r.darkPrimary ?? !0, o = {}, n = {}, d = { brand: [] }, t = /* @__PURE__ */ new Set(["brand"]), b = H(e.brand, U.brand);
624
+ if (d.brand = b, B(o, "brand", b, F), o["--sa-text-on-brand"] = R(b[6]), ["error", "success", "info", "warning"].forEach((k) => {
625
+ const f = e[k];
626
+ if (!f)
578
627
  return;
579
- const k = U(u, P[f]);
580
- d[f] = k, I(o, f, k, T), t.add(f);
628
+ const p = H(f, U[k]);
629
+ d[k] = p, B(o, k, p, F), t.add(k);
581
630
  }), e.neutral) {
582
- const f = re(e.neutral, Ce), u = re(e.neutral, Ae);
583
- d.gray = f, d.dark = u, I(o, "gray", f, F), I(o, "dark", u, F), t.add("gray"), t.add("dark");
631
+ const k = oe(e.neutral, Ae), f = oe(e.neutral, Le);
632
+ d.gray = k, d.dark = f, B(o, "gray", k, P), B(o, "dark", f, P), t.add("gray"), t.add("dark");
584
633
  }
585
- if (ue(o, e), c) {
586
- const f = b[4];
587
- n["--sa-background-brand"] = f, n["--sa-background-brand-hover"] = b[3], n["--sa-background-brand-pressed"] = b[5], n["--sa-text-on-brand"] = V(f);
634
+ if (pe(o, e), c) {
635
+ const k = R(b[4]), f = q(b[4], k), p = k === "#ffffff";
636
+ n["--sa-background-brand"] = f, n["--sa-background-brand-hover"] = p ? b[5] : b[3], n["--sa-background-brand-pressed"] = p ? b[6] : b[2], n["--sa-text-on-brand"] = k;
588
637
  }
589
- return { css: a === "skin" ? Ie(s, o, n, t) : Oe(s, o, n), rootTokens: o, darkTokens: n, ramps: d };
638
+ return { css: a === "skin" ? Be(s, o, n, t) : Ie(s, o, n), rootTokens: o, darkTokens: n, ramps: d };
590
639
  }
591
- function ue(e, r) {
640
+ function pe(e, r) {
592
641
  var a, s, c;
593
642
  if (typeof r.radius == "number") {
594
643
  const o = r.radius;
595
- e["--sa-radii-xs"] = `${w(o * 0.5)}px`, e["--sa-radii-sm"] = `${w(o * 0.75)}px`, e["--sa-radii-md"] = `${w(o)}px`, e["--sa-radii-lg"] = `${w(o * 1.5)}px`, e["--sa-radii-xl"] = `${w(o * 1.75)}px`, e["--sa-radii-2xl"] = `${w(o * 2)}px`, e["--sa-radii-rounded"] = `${w(o)}px`;
644
+ e["--sa-radii-xs"] = `${S(o * 0.5)}px`, e["--sa-radii-sm"] = `${S(o * 0.75)}px`, e["--sa-radii-md"] = `${S(o)}px`, e["--sa-radii-lg"] = `${S(o * 1.5)}px`, e["--sa-radii-xl"] = `${S(o * 1.75)}px`, e["--sa-radii-2xl"] = `${S(o * 2)}px`, e["--sa-radii-rounded"] = `${S(o)}px`;
596
645
  }
597
- (a = r.font) != null && a.body && (e["--sa-font-family"] = `"${r.font.body}", ${oe}`), (s = r.font) != null && s.heading && (e["--sa-font-family-heading"] = `"${r.font.heading}", ${oe}`), (c = r.font) != null && c.mono && (e["--sa-font-family-mono"] = `"${r.font.mono}", ${Re}`);
646
+ (a = r.font) != null && a.body && (e["--sa-font-family"] = `"${r.font.body}", ${ne}`), (s = r.font) != null && s.heading && (e["--sa-font-family-heading"] = `"${r.font.heading}", ${ne}`), (c = r.font) != null && c.mono && (e["--sa-font-family-mono"] = `"${r.font.mono}", ${De}`);
598
647
  }
599
- function Ne(e, r) {
600
- const { tokens: a, brand: s, gray: c, isDark: o } = _e({
648
+ function Oe(e, r) {
649
+ const { tokens: a, brand: s, gray: c, isDark: o } = Re({
601
650
  base: e.base,
602
651
  brand: e.brand,
603
652
  error: e.error,
@@ -605,46 +654,46 @@ function Ne(e, r) {
605
654
  info: e.info,
606
655
  warning: e.warning
607
656
  });
608
- ue(a, e);
657
+ pe(a, e);
609
658
  const n = o ? "dark" : "light", d = `${r},
610
659
  ${r}[data-theme="dark"]`;
611
660
  return {
612
661
  // color-scheme → scrollbar & kontrol native browser ikut terang/gelap tema.
613
662
  // Bukan token, jadi tidak masuk rootTokens.
614
- css: R(d, { ...a, "color-scheme": n }),
663
+ css: D(d, { ...a, "color-scheme": n }),
615
664
  rootTokens: a,
616
665
  darkTokens: {},
617
666
  ramps: { brand: s, gray: c },
618
667
  scheme: n
619
668
  };
620
669
  }
621
- function R(e, r) {
670
+ function D(e, r) {
622
671
  const a = Object.entries(r).map(([s, c]) => ` ${s}: ${c};`);
623
672
  return a.length ? `${e} {
624
673
  ${a.join(`
625
674
  `)}
626
675
  }` : "";
627
676
  }
628
- function Oe(e, r, a) {
677
+ function Ie(e, r, a) {
629
678
  const s = e === ":root" ? '[data-theme="dark"]' : `${e}[data-theme="dark"], ${e} [data-theme="dark"]`;
630
- return [R(e, r), R(s, a)].filter(Boolean).join(`
679
+ return [D(e, r), D(s, a)].filter(Boolean).join(`
631
680
 
632
681
  `);
633
682
  }
634
- function Ie(e, r, a, s) {
683
+ function Be(e, r, a, s) {
635
684
  const c = {};
636
- for (const t of be)
685
+ for (const t of ue)
637
686
  t.scale && s.has(t.scale) && t.token !== "--sa-text-on-brand" && (c[t.token] = t.recipe);
638
687
  const o = { ...r, ...c }, n = {};
639
- for (const t of fe)
688
+ for (const t of ke)
640
689
  (t.scale && s.has(t.scale) || t.token in o) && (n[t.token] = t.recipe);
641
690
  const d = { ...n, ...a };
642
- return [R(e, o), R(`${e}[data-theme="dark"]`, d)].filter(Boolean).join(`
691
+ return [D(e, o), D(`${e}[data-theme="dark"]`, d)].filter(Boolean).join(`
643
692
 
644
693
  `);
645
694
  }
646
- const N = "sa-theme";
647
- function B(e = N) {
695
+ const O = "sa-theme";
696
+ function j(e = O) {
648
697
  try {
649
698
  if (typeof localStorage > "u")
650
699
  return null;
@@ -654,7 +703,7 @@ function B(e = N) {
654
703
  return null;
655
704
  }
656
705
  }
657
- function Be(e, r = N) {
706
+ function je(e, r = O) {
658
707
  try {
659
708
  if (typeof localStorage > "u")
660
709
  return;
@@ -662,7 +711,7 @@ function Be(e, r = N) {
662
711
  } catch {
663
712
  }
664
713
  }
665
- function je(e = N) {
714
+ function Te(e = O) {
666
715
  try {
667
716
  if (typeof localStorage > "u")
668
717
  return;
@@ -670,7 +719,7 @@ function je(e = N) {
670
719
  } catch {
671
720
  }
672
721
  }
673
- function Te(e) {
722
+ function Fe(e) {
674
723
  if (e === "system")
675
724
  try {
676
725
  return typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
@@ -679,22 +728,22 @@ function Te(e) {
679
728
  }
680
729
  return e;
681
730
  }
682
- function z(e) {
731
+ function G(e) {
683
732
  if (typeof document > "u")
684
733
  return;
685
734
  const r = document.documentElement;
686
- Te(e) === "dark" ? r.setAttribute("data-theme", "dark") : r.removeAttribute("data-theme");
735
+ Fe(e) === "dark" ? r.setAttribute("data-theme", "dark") : r.removeAttribute("data-theme");
687
736
  }
688
- function ce(e) {
737
+ function te(e) {
689
738
  if (typeof document > "u")
690
739
  return;
691
740
  const r = document.documentElement;
692
741
  e ? r.setAttribute("data-skin", e) : r.removeAttribute("data-skin");
693
742
  }
694
- function er(e = N) {
743
+ function rr(e = O) {
695
744
  return "(function(){try{var p=JSON.parse(localStorage.getItem(" + JSON.stringify(e) + ")||'{}');var d=document.documentElement;var m=p.mode==='system'?((window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light'):p.mode;if(m==='dark')d.setAttribute('data-theme','dark');if(p.skin)d.setAttribute('data-skin',p.skin);}catch(e){}})();";
696
745
  }
697
- const Fe = {
746
+ const Pe = {
698
747
  raw: {
699
748
  white: {
700
749
  900: "255, 255, 255"
@@ -793,7 +842,7 @@ const Fe = {
793
842
  tertiary: "230, 237, 246"
794
843
  }
795
844
  }
796
- }, Pe = {
845
+ }, Ue = {
797
846
  radii: {
798
847
  none: "0",
799
848
  xs: "0.25rem",
@@ -851,7 +900,7 @@ const Fe = {
851
900
  inner: "inset 0 2px 4px 0 #0000000d",
852
901
  card: "0px 4px 35px 0px #7090b040"
853
902
  }
854
- }, Ue = {
903
+ }, He = {
855
904
  fontSizes: {
856
905
  xs: "0.625rem",
857
906
  sm: "0.75rem",
@@ -891,11 +940,11 @@ const Fe = {
891
940
  relaxed: 1.625,
892
941
  loose: 2
893
942
  }
894
- }, ke = {
895
- colors: Fe,
896
- metrics: Pe,
897
- font: Ue
898
- }, X = ve({
943
+ }, ge = {
944
+ colors: Pe,
945
+ metrics: Ue,
946
+ font: He
947
+ }, ee = me({
899
948
  theme: void 0,
900
949
  setTheme: () => {
901
950
  },
@@ -908,20 +957,20 @@ const Fe = {
908
957
  },
909
958
  resetTheme: () => {
910
959
  }
911
- }), He = "sa-theme-style", G = "sa-theme-seed-style";
912
- function Je(e) {
960
+ }), Je = "sa-theme-style", W = "sa-theme-seed-style";
961
+ function Ye(e) {
913
962
  const r = e.split(",").map((a) => Number(a.trim()));
914
963
  return r.length !== 3 || r.some((a) => !Number.isFinite(a) || a < 0 || a > 255) ? null : "#" + r.map((a) => Math.round(a).toString(16).padStart(2, "0")).join("");
915
964
  }
916
- var te, le;
917
- const Ye = ((le = (te = ke.colors) == null ? void 0 : te.raw) == null ? void 0 : le.blue) ?? {}, ne = (e) => (e ?? "").replace(/\s+/g, "");
918
- function ze(e) {
965
+ var ie, de;
966
+ const ze = ((de = (ie = ge.colors) == null ? void 0 : ie.raw) == null ? void 0 : de.blue) ?? {}, le = (e) => (e ?? "").replace(/\s+/g, "");
967
+ function Ge(e) {
919
968
  if (!e)
920
969
  return "";
921
970
  const r = /* @__PURE__ */ new Set(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), a = Object.entries(e).filter(([s]) => r.has(s)).filter(
922
- ([s, c]) => ne(c) !== ne(Ye[s])
971
+ ([s, c]) => le(c) !== le(ze[s])
923
972
  ).map(([s, c]) => {
924
- const o = Je(c);
973
+ const o = Ye(c);
925
974
  return o ? ` --sa-color-brand-${s}: ${o};` : "";
926
975
  }).filter(Boolean).join(`
927
976
  `);
@@ -929,11 +978,11 @@ function ze(e) {
929
978
  ${a}
930
979
  }` : "";
931
980
  }
932
- function rr({
981
+ function ar({
933
982
  value: e,
934
983
  seed: r,
935
984
  persist: a = !0,
936
- storageKey: s = N,
985
+ storageKey: s = O,
937
986
  manageAttributes: c = !1,
938
987
  children: o
939
988
  }) {
@@ -941,110 +990,110 @@ function rr({
941
990
  if (t)
942
991
  return r;
943
992
  if (a) {
944
- const i = B(s);
993
+ const i = j(s);
945
994
  if (i != null && i.seed)
946
995
  return i.seed;
947
996
  }
948
997
  return null;
949
- }), f = t ? r : b, u = K(
950
- () => f ? JSON.stringify(f) : "",
951
- [f]
998
+ }), k = t ? r : b, f = Q(
999
+ () => k ? JSON.stringify(k) : "",
1000
+ [k]
952
1001
  );
953
- O(() => {
1002
+ I(() => {
954
1003
  if (typeof document > "u")
955
1004
  return;
956
- if (!u) {
957
- const l = document.getElementById(G);
1005
+ if (!f) {
1006
+ const l = document.getElementById(W);
958
1007
  l && (l.textContent = "");
959
1008
  return;
960
1009
  }
961
- const { css: i } = De(JSON.parse(u));
962
- me(i, G);
963
- }, [u]), O(() => {
1010
+ const { css: i } = Ne(JSON.parse(f));
1011
+ he(i, W);
1012
+ }, [f]), I(() => {
964
1013
  var l;
965
1014
  if (!c || !a)
966
1015
  return;
967
- const i = B(s);
968
- if (i && (i.mode && z(i.mode), i.skin !== void 0 && ce(i.skin), i.mode === "system" && typeof window < "u")) {
969
- const h = window.matchMedia("(prefers-color-scheme: dark)"), L = () => z("system");
1016
+ const i = j(s);
1017
+ if (i && (i.mode && G(i.mode), i.skin !== void 0 && te(i.skin), i.mode === "system" && typeof window < "u")) {
1018
+ const h = window.matchMedia("(prefers-color-scheme: dark)"), L = () => G("system");
970
1019
  return (l = h.addEventListener) == null || l.call(h, "change", L), () => {
971
- var Z;
972
- return (Z = h.removeEventListener) == null ? void 0 : Z.call(h, "change", L);
1020
+ var re;
1021
+ return (re = h.removeEventListener) == null ? void 0 : re.call(h, "change", L);
973
1022
  };
974
1023
  }
975
1024
  }, [c, a, s]);
976
- const k = K(
1025
+ const p = Q(
977
1026
  () => n ? JSON.stringify(n) : "",
978
1027
  [n]
979
- ), m = ge(null);
980
- O(() => {
1028
+ ), m = ye(null);
1029
+ I(() => {
981
1030
  var h, L;
982
- m.current || (m.current = ye(He));
1031
+ m.current || (m.current = we(Je));
983
1032
  const i = m.current;
984
1033
  if (!i)
985
1034
  return;
986
- const l = k ? JSON.parse(k) : void 0;
987
- i.textContent = l ? ze((L = (h = l == null ? void 0 : l.colors) == null ? void 0 : h.raw) == null ? void 0 : L.blue) : "";
988
- }, [k]), O(() => () => {
1035
+ const l = p ? JSON.parse(p) : void 0;
1036
+ i.textContent = l ? Ge((L = (h = l == null ? void 0 : l.colors) == null ? void 0 : h.raw) == null ? void 0 : L.blue) : "";
1037
+ }, [p]), I(() => () => {
989
1038
  m.current && (m.current.textContent = "");
990
1039
  }, []);
991
- const S = (i) => {
1040
+ const E = (i) => {
992
1041
  i && d(i);
993
- }, g = $(
1042
+ }, y = $(
994
1043
  (i) => {
995
1044
  if (!a)
996
1045
  return;
997
- const l = B(s) || {};
998
- Be({ ...l, ...i }, s);
1046
+ const l = j(s) || {};
1047
+ je({ ...l, ...i }, s);
999
1048
  },
1000
1049
  [a, s]
1001
- ), p = $(
1050
+ ), x = $(
1002
1051
  (i) => {
1003
- t || (v(i), g({ seed: i }));
1052
+ t || (v(i), y({ seed: i }));
1004
1053
  },
1005
- [t, g]
1006
- ), y = $(
1054
+ [t, y]
1055
+ ), M = $(
1007
1056
  (i) => {
1008
- z(i), g({ mode: i });
1057
+ G(i), y({ mode: i });
1009
1058
  },
1010
- [g]
1011
- ), A = $(
1059
+ [y]
1060
+ ), u = $(
1012
1061
  (i) => {
1013
- ce(i), g({ skin: i });
1062
+ te(i), y({ skin: i });
1014
1063
  },
1015
- [g]
1016
- ), E = $(() => {
1017
- if (t || v(null), je(s), typeof document < "u") {
1018
- const i = document.getElementById(G);
1064
+ [y]
1065
+ ), g = $(() => {
1066
+ if (t || v(null), Te(s), typeof document < "u") {
1067
+ const i = document.getElementById(W);
1019
1068
  i && (i.textContent = "");
1020
1069
  }
1021
1070
  }, [t, s]);
1022
- return /* @__PURE__ */ M(
1023
- X.Provider,
1071
+ return /* @__PURE__ */ C(
1072
+ ee.Provider,
1024
1073
  {
1025
1074
  value: {
1026
1075
  theme: n,
1027
- setTheme: S,
1028
- seed: f,
1029
- setSeed: p,
1030
- setMode: y,
1031
- setSkin: A,
1032
- resetTheme: E
1076
+ setTheme: E,
1077
+ seed: k,
1078
+ setSeed: x,
1079
+ setMode: M,
1080
+ setSkin: u,
1081
+ resetTheme: g
1033
1082
  },
1034
1083
  children: o
1035
1084
  }
1036
1085
  );
1037
1086
  }
1038
- const Ge = [
1087
+ const We = [
1039
1088
  { name: null, label: "Default" },
1040
1089
  { name: "tech", label: "Tech" }
1041
- ], We = [
1090
+ ], Ke = [
1042
1091
  { value: "light", label: "Light" },
1043
1092
  { value: "dark", label: "Dark" },
1044
1093
  { value: "system", label: "System" }
1045
1094
  ];
1046
- function ar({
1047
- skins: e = Ge,
1095
+ function sr({
1096
+ skins: e = We,
1048
1097
  showMode: r = !0,
1049
1098
  allowCustom: a = !1,
1050
1099
  storageKey: s,
@@ -1052,23 +1101,23 @@ function ar({
1052
1101
  style: o
1053
1102
  }) {
1054
1103
  var i;
1055
- const { setMode: n, setSkin: d, setSeed: t } = ie(X), b = typeof window < "u" ? B(s) : null, [v, f] = _(
1104
+ const { setMode: n, setSkin: d, setSeed: t } = be(ee), b = typeof window < "u" ? j(s) : null, [v, k] = _(
1056
1105
  (b == null ? void 0 : b.mode) ?? (typeof document < "u" && document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light")
1057
- ), [u, k] = _(
1106
+ ), [f, p] = _(
1058
1107
  (b == null ? void 0 : b.skin) ?? (typeof document < "u" ? document.documentElement.getAttribute("data-skin") : null)
1059
- ), [m, S] = _(((i = b == null ? void 0 : b.seed) == null ? void 0 : i.brand) ?? "#1a4fa0"), g = (l) => {
1060
- f(l), n(l);
1061
- }, p = (l) => {
1062
- k(l), d(l);
1063
- }, y = (l) => {
1064
- S(l), t({ brand: l });
1065
- }, A = {
1108
+ ), [m, E] = _(((i = b == null ? void 0 : b.seed) == null ? void 0 : i.brand) ?? "#1a4fa0"), y = (l) => {
1109
+ k(l), n(l);
1110
+ }, x = (l) => {
1111
+ p(l), d(l);
1112
+ }, M = (l) => {
1113
+ E(l), t({ brand: l });
1114
+ }, u = {
1066
1115
  display: "inline-flex",
1067
1116
  gap: 4,
1068
1117
  padding: 4,
1069
1118
  borderRadius: "var(--sa-radii-md)",
1070
1119
  background: "var(--sa-background-neutral)"
1071
- }, E = (l) => ({
1120
+ }, g = (l) => ({
1072
1121
  border: "none",
1073
1122
  cursor: "pointer",
1074
1123
  fontSize: 12,
@@ -1079,35 +1128,35 @@ function ar({
1079
1128
  color: l ? "var(--sa-text-primary)" : "var(--sa-text-subtle)",
1080
1129
  boxShadow: l ? "var(--sa-shadow-sm)" : "none"
1081
1130
  });
1082
- return /* @__PURE__ */ q(
1131
+ return /* @__PURE__ */ ae(
1083
1132
  "div",
1084
1133
  {
1085
1134
  className: c,
1086
1135
  style: { display: "flex", gap: 12, flexWrap: "wrap", alignItems: "center", ...o },
1087
1136
  children: [
1088
- r && /* @__PURE__ */ M("div", { role: "group", "aria-label": "Mode", style: A, children: We.map((l) => /* @__PURE__ */ M(
1137
+ r && /* @__PURE__ */ C("div", { role: "group", "aria-label": "Mode", style: u, children: Ke.map((l) => /* @__PURE__ */ C(
1089
1138
  "button",
1090
1139
  {
1091
1140
  type: "button",
1092
1141
  "aria-pressed": v === l.value,
1093
- style: E(v === l.value),
1094
- onClick: () => g(l.value),
1142
+ style: g(v === l.value),
1143
+ onClick: () => y(l.value),
1095
1144
  children: l.label
1096
1145
  },
1097
1146
  l.value
1098
1147
  )) }),
1099
- e.length > 0 && /* @__PURE__ */ M("div", { role: "group", "aria-label": "Skin", style: A, children: e.map((l) => /* @__PURE__ */ M(
1148
+ e.length > 0 && /* @__PURE__ */ C("div", { role: "group", "aria-label": "Skin", style: u, children: e.map((l) => /* @__PURE__ */ C(
1100
1149
  "button",
1101
1150
  {
1102
1151
  type: "button",
1103
- "aria-pressed": u === l.name,
1104
- style: E(u === l.name),
1105
- onClick: () => p(l.name),
1152
+ "aria-pressed": f === l.name,
1153
+ style: g(f === l.name),
1154
+ onClick: () => x(l.name),
1106
1155
  children: l.label
1107
1156
  },
1108
1157
  l.name ?? "default"
1109
1158
  )) }),
1110
- a && /* @__PURE__ */ q(
1159
+ a && /* @__PURE__ */ ae(
1111
1160
  "label",
1112
1161
  {
1113
1162
  style: {
@@ -1119,12 +1168,12 @@ function ar({
1119
1168
  },
1120
1169
  children: [
1121
1170
  "Brand",
1122
- /* @__PURE__ */ M(
1171
+ /* @__PURE__ */ C(
1123
1172
  "input",
1124
1173
  {
1125
1174
  type: "color",
1126
1175
  value: m,
1127
- onChange: (l) => y(l.target.value),
1176
+ onChange: (l) => M(l.target.value),
1128
1177
  "aria-label": "Custom brand color",
1129
1178
  style: {
1130
1179
  width: 28,
@@ -1144,57 +1193,57 @@ function ar({
1144
1193
  }
1145
1194
  );
1146
1195
  }
1147
- const W = ke, pe = (e, r) => {
1196
+ const K = ge, ve = (e, r) => {
1148
1197
  const a = {};
1149
1198
  return Object.keys(e).forEach((s) => {
1150
1199
  if (e != null && e[s] && typeof (e == null ? void 0 : e[s]) == "object") {
1151
1200
  a[s] = {
1152
1201
  ...e == null ? void 0 : e[s],
1153
1202
  ...r == null ? void 0 : r[s],
1154
- ...pe(e == null ? void 0 : e[s], r == null ? void 0 : r[s])
1203
+ ...ve(e == null ? void 0 : e[s], r == null ? void 0 : r[s])
1155
1204
  };
1156
1205
  return;
1157
1206
  }
1158
1207
  a[s] = (r == null ? void 0 : r[s]) || (e == null ? void 0 : e[s]);
1159
1208
  }), a;
1160
1209
  };
1161
- function H() {
1162
- const e = ie(X), r = K(
1210
+ function J() {
1211
+ const e = be(ee), r = Q(
1163
1212
  () => ({
1164
- ...W,
1213
+ ...K,
1165
1214
  ...e.theme,
1166
- ...pe(W, e.theme)
1215
+ ...ve(K, e.theme)
1167
1216
  }),
1168
- [e.theme, W]
1217
+ [e.theme, K]
1169
1218
  );
1170
1219
  return { ...e, theme: r };
1171
1220
  }
1172
- function sr() {
1173
- const { theme: e } = H();
1221
+ function or() {
1222
+ const { theme: e } = J();
1174
1223
  return e.colors;
1175
1224
  }
1176
- function or() {
1225
+ function cr() {
1177
1226
  var r;
1178
- const { theme: e } = H();
1227
+ const { theme: e } = J();
1179
1228
  return (r = e.metrics) == null ? void 0 : r.spacing;
1180
1229
  }
1181
- function cr() {
1230
+ function nr() {
1182
1231
  var r;
1183
- const { theme: e } = H();
1232
+ const { theme: e } = J();
1184
1233
  return (r = e.metrics) == null ? void 0 : r.radii;
1185
1234
  }
1186
- function nr() {
1235
+ function tr() {
1187
1236
  var r;
1188
- const { theme: e } = H();
1237
+ const { theme: e } = J();
1189
1238
  return (r = e == null ? void 0 : e.metrics) == null ? void 0 : r.shadows;
1190
1239
  }
1191
- function tr(e) {
1240
+ function lr(e) {
1192
1241
  return e;
1193
1242
  }
1194
- function Ke(e) {
1195
- return de(e) ? "dark" : "light";
1243
+ function Qe(e) {
1244
+ return fe(e) ? "dark" : "light";
1196
1245
  }
1197
- const Qe = [
1246
+ const Ve = [
1198
1247
  // terang
1199
1248
  { name: "light", base: "#ffffff", brand: "#2563eb" },
1200
1249
  { name: "cupcake", base: "#faf7f5", brand: "#65c3c8" },
@@ -1230,50 +1279,50 @@ const Qe = [
1230
1279
  { name: "sunset", base: "#1b2433", brand: "#ff865b" },
1231
1280
  { name: "black", base: "#000000", brand: "#6a6a6a" },
1232
1281
  { name: "abyss", base: "#001a1a", brand: "#18c9b4" }
1233
- ], lr = Qe.map((e) => ({
1282
+ ], ir = Ve.map((e) => ({
1234
1283
  name: e.name,
1235
1284
  label: e.label ?? e.name.charAt(0).toUpperCase() + e.name.slice(1),
1236
1285
  base: e.base,
1237
1286
  brand: e.brand,
1238
- scheme: Ke(e.base)
1287
+ scheme: Qe(e.base)
1239
1288
  }));
1240
1289
  export {
1241
- N as DEFAULT_STORAGE_KEY,
1242
- P as LADDERS,
1243
- Ae as NEUTRAL_LADDER_DARK,
1244
- Ce as NEUTRAL_LADDER_GRAY,
1245
- qe as SA_DEFAULT_SEED,
1246
- T as SCALE_KEYS_10,
1247
- F as SCALE_KEYS_12,
1248
- lr as THEME_PRESETS,
1249
- X as ThemeContext,
1250
- rr as ThemeProvider,
1251
- ar as ThemeSwitcher,
1252
- z as applyMode,
1253
- ce as applySkin,
1254
- De as buildTheme,
1255
- je as clearPref,
1256
- Me as contrastRatio,
1257
- tr as createTheme,
1258
- Ke as getThemeScheme,
1259
- x as hexToOklch,
1260
- j as hexToRgb,
1261
- de as isDarkColor,
1262
- re as neutralRamp,
1263
- D as oklchToHex,
1264
- Ze as pickByLightness,
1265
- V as pickTextOn,
1266
- ae as rampBetween,
1267
- U as rampFromSeed,
1268
- B as readPref,
1269
- Te as resolveMode,
1270
- he as rgbToHex,
1271
- Se as rgbToOklch,
1272
- er as themeBootScript,
1273
- sr as useColor,
1274
- cr as useRadius,
1275
- nr as useShadow,
1276
- or as useSpacing,
1277
- H as useTheme,
1278
- Be as writePref
1290
+ O as DEFAULT_STORAGE_KEY,
1291
+ U as LADDERS,
1292
+ Le as NEUTRAL_LADDER_DARK,
1293
+ Ae as NEUTRAL_LADDER_GRAY,
1294
+ er as SA_DEFAULT_SEED,
1295
+ F as SCALE_KEYS_10,
1296
+ P as SCALE_KEYS_12,
1297
+ ir as THEME_PRESETS,
1298
+ ee as ThemeContext,
1299
+ ar as ThemeProvider,
1300
+ sr as ThemeSwitcher,
1301
+ G as applyMode,
1302
+ te as applySkin,
1303
+ Ne as buildTheme,
1304
+ Te as clearPref,
1305
+ X as contrastRatio,
1306
+ lr as createTheme,
1307
+ Qe as getThemeScheme,
1308
+ w as hexToOklch,
1309
+ T as hexToRgb,
1310
+ fe as isDarkColor,
1311
+ oe as neutralRamp,
1312
+ N as oklchToHex,
1313
+ qe as pickByLightness,
1314
+ R as pickTextOn,
1315
+ ce as rampBetween,
1316
+ H as rampFromSeed,
1317
+ j as readPref,
1318
+ Fe as resolveMode,
1319
+ xe as rgbToHex,
1320
+ Me as rgbToOklch,
1321
+ rr as themeBootScript,
1322
+ or as useColor,
1323
+ nr as useRadius,
1324
+ tr as useShadow,
1325
+ cr as useSpacing,
1326
+ J as useTheme,
1327
+ je as writePref
1279
1328
  };