@starasia/theme 2.0.1 → 3.0.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 +140 -140
- package/dist/index.umd.js +20 -20
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,170 +1,170 @@
|
|
|
1
1
|
import { jsx as w } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as O, useState as E, useMemo as y, useRef as F, useEffect as P, useContext as N } from "react";
|
|
3
|
-
function S(r,
|
|
4
|
-
let
|
|
5
|
-
for (const
|
|
6
|
-
if (Object.hasOwnProperty.call(r,
|
|
7
|
-
const
|
|
8
|
-
|
|
3
|
+
function S(r, t = "") {
|
|
4
|
+
let o = "";
|
|
5
|
+
for (const n in r)
|
|
6
|
+
if (Object.hasOwnProperty.call(r, n)) {
|
|
7
|
+
const e = r[n];
|
|
8
|
+
o += `/* ${n} */
|
|
9
9
|
`;
|
|
10
|
-
for (const
|
|
11
|
-
if (Object.hasOwnProperty.call(
|
|
12
|
-
const
|
|
13
|
-
|
|
10
|
+
for (const s in e)
|
|
11
|
+
if (Object.hasOwnProperty.call(e, s)) {
|
|
12
|
+
const i = e[s];
|
|
13
|
+
o += `--${t}-${n}-${s}: ${i};
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return o;
|
|
18
18
|
}
|
|
19
|
-
function C(r,
|
|
20
|
-
let
|
|
21
|
-
for (const
|
|
22
|
-
const
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
|
|
19
|
+
function C(r, t) {
|
|
20
|
+
let o = "";
|
|
21
|
+
for (const n in r) {
|
|
22
|
+
const e = r[n];
|
|
23
|
+
for (const s in e) {
|
|
24
|
+
const i = e[s], c = s ? `${t}-${n}-${s}` : `${t}-${n}`;
|
|
25
|
+
o += `--${c}: ${i};
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return o;
|
|
30
30
|
}
|
|
31
|
-
function M(r,
|
|
32
|
-
let
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
31
|
+
function M(r, t) {
|
|
32
|
+
let o = "";
|
|
33
|
+
function n(e, s, i = "", c = "", l = "") {
|
|
34
|
+
if (l) {
|
|
35
|
+
const a = `${i}${l}-${c}-${e}`;
|
|
36
|
+
o += `--${a}: ${s};
|
|
37
37
|
`;
|
|
38
38
|
} else {
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const a = `${i}${e}-${c}`;
|
|
40
|
+
o += `--${a}: ${s};
|
|
41
41
|
`;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
for (const
|
|
45
|
-
const
|
|
46
|
-
for (const
|
|
47
|
-
const c =
|
|
44
|
+
for (const e in r) {
|
|
45
|
+
const s = r[e];
|
|
46
|
+
for (const i in s) {
|
|
47
|
+
const c = s[i];
|
|
48
48
|
if (typeof c == "object")
|
|
49
|
-
for (const
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
for (const l in c) {
|
|
50
|
+
const a = c[l], u = `${t}-`;
|
|
51
|
+
n(
|
|
52
|
+
i,
|
|
52
53
|
a,
|
|
53
|
-
l,
|
|
54
54
|
u,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
e,
|
|
56
|
+
l
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const l = `${t}-`;
|
|
61
|
+
n(i, c, l, e);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
return
|
|
65
|
+
return o;
|
|
66
66
|
}
|
|
67
|
-
function B(r,
|
|
68
|
-
let
|
|
69
|
-
function
|
|
70
|
-
if (typeof
|
|
71
|
-
for (const c in
|
|
72
|
-
const
|
|
73
|
-
|
|
67
|
+
function B(r, t = "") {
|
|
68
|
+
let o = "";
|
|
69
|
+
function n(e, s, i = "") {
|
|
70
|
+
if (typeof s == "object")
|
|
71
|
+
for (const c in s) {
|
|
72
|
+
const l = s[c], a = `--${i}-${e}-${c}`;
|
|
73
|
+
o += `${a}: ${l};
|
|
74
74
|
`;
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
const c = `--${
|
|
78
|
-
|
|
77
|
+
const c = `--${i}-${e}`;
|
|
78
|
+
o += `${c}: ${s};
|
|
79
79
|
`;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
for (const
|
|
83
|
-
const
|
|
84
|
-
if (typeof
|
|
85
|
-
|
|
82
|
+
for (const e in r) {
|
|
83
|
+
const s = r[e];
|
|
84
|
+
if (typeof s == "object")
|
|
85
|
+
n(e, s, `${t}`);
|
|
86
86
|
else {
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const i = `--${t}-${e}`;
|
|
88
|
+
o += `${i}: ${s};
|
|
89
89
|
`;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return o;
|
|
93
93
|
}
|
|
94
|
-
function D(r,
|
|
95
|
-
let
|
|
96
|
-
for (const
|
|
97
|
-
const
|
|
98
|
-
for (const
|
|
99
|
-
const
|
|
100
|
-
|
|
94
|
+
function D(r, t = "") {
|
|
95
|
+
let o = "";
|
|
96
|
+
for (const n in r) {
|
|
97
|
+
const e = r[n];
|
|
98
|
+
for (const s in e) {
|
|
99
|
+
const i = `--${t}-${n}-${s}`, c = e[s];
|
|
100
|
+
o += `${i}: ${c};
|
|
101
101
|
`;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
return
|
|
104
|
+
return o;
|
|
105
105
|
}
|
|
106
|
-
function H(r,
|
|
107
|
-
let
|
|
108
|
-
for (const
|
|
109
|
-
if (Object.hasOwnProperty.call(r,
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
` :
|
|
106
|
+
function H(r, t) {
|
|
107
|
+
let o = "";
|
|
108
|
+
for (const n in r)
|
|
109
|
+
if (Object.hasOwnProperty.call(r, n)) {
|
|
110
|
+
const e = r[n];
|
|
111
|
+
n === "default" ? o += `--${t}: ${e};
|
|
112
|
+
` : o += `--${t}-${n}: ${e};
|
|
113
113
|
`;
|
|
114
114
|
}
|
|
115
|
-
return
|
|
115
|
+
return o;
|
|
116
116
|
}
|
|
117
117
|
const J = (r) => {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
return
|
|
121
|
-
const
|
|
122
|
-
return
|
|
118
|
+
const t = document.getElementById(r);
|
|
119
|
+
if (t)
|
|
120
|
+
return t;
|
|
121
|
+
const o = document.createElement("style");
|
|
122
|
+
return o.id = r, document.head.appendChild(o), o;
|
|
123
123
|
};
|
|
124
|
-
function g(r,
|
|
125
|
-
let
|
|
126
|
-
return Object.keys(r).forEach((
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
|
|
124
|
+
function g(r, t) {
|
|
125
|
+
let o = "";
|
|
126
|
+
return Object.keys(r).forEach((n) => {
|
|
127
|
+
const e = r[n];
|
|
128
|
+
if (e && typeof e == "object") {
|
|
129
|
+
o += g(e, `${t}-${n}`);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
o += `${t}-${n}: ${e};
|
|
133
133
|
`;
|
|
134
|
-
}),
|
|
134
|
+
}), o;
|
|
135
135
|
}
|
|
136
|
-
function L(r,
|
|
137
|
-
let
|
|
138
|
-
return r && (
|
|
136
|
+
function L(r, t) {
|
|
137
|
+
let o = "";
|
|
138
|
+
return r && (o += g(r, t)), o;
|
|
139
139
|
}
|
|
140
140
|
function V(r) {
|
|
141
141
|
var u, $, p, f, b, d;
|
|
142
142
|
if (!r)
|
|
143
143
|
return;
|
|
144
|
-
const
|
|
144
|
+
const t = (u = r.colors) != null && u.raw ? C(
|
|
145
145
|
r.colors.raw,
|
|
146
|
-
"
|
|
147
|
-
) : "",
|
|
146
|
+
"sa-ui-raw-color"
|
|
147
|
+
) : "", o = ($ = r.colors) != null && $.computed ? C(
|
|
148
148
|
r.colors.computed,
|
|
149
|
-
"
|
|
150
|
-
) : "",
|
|
149
|
+
"sa-ui-color"
|
|
150
|
+
) : "", n = (p = r.colors) != null && p.main ? M(r.colors.main, "sa-ui") : "", e = (f = r.colors) != null && f.brand ? S(r.colors.brand, "sa-ui-brand") : "", s = (b = r.colors) != null && b.utility ? S(
|
|
151
151
|
r.colors.utility,
|
|
152
|
-
"
|
|
153
|
-
) : "",
|
|
152
|
+
"sa-ui-utility"
|
|
153
|
+
) : "", i = (d = r.colors) != null && d.text ? H(
|
|
154
154
|
r.colors.text,
|
|
155
|
-
"
|
|
156
|
-
) : "", c = r.metrics ? B(r.metrics, "
|
|
155
|
+
"sa-ui-color-text"
|
|
156
|
+
) : "", c = r.metrics ? B(r.metrics, "sa-ui") : "", l = r.font ? D(r.font, "sa-ui") : "", a = r.components ? L(r.components, "--sa-ui") : "";
|
|
157
157
|
return `
|
|
158
158
|
:root {
|
|
159
|
-
${o}
|
|
160
159
|
${t}
|
|
161
|
-
${
|
|
160
|
+
${o}
|
|
162
161
|
${n}
|
|
163
162
|
${e}
|
|
164
|
-
${
|
|
165
|
-
${c}
|
|
163
|
+
${s}
|
|
166
164
|
${i}
|
|
165
|
+
${c}
|
|
167
166
|
${l}
|
|
167
|
+
${a}
|
|
168
168
|
}
|
|
169
169
|
`;
|
|
170
170
|
}
|
|
@@ -172,40 +172,40 @@ const j = O({
|
|
|
172
172
|
theme: void 0,
|
|
173
173
|
setTheme: () => {
|
|
174
174
|
}
|
|
175
|
-
}), _ = "
|
|
175
|
+
}), _ = "sa-theme-style";
|
|
176
176
|
function z(r) {
|
|
177
|
-
const
|
|
178
|
-
return
|
|
177
|
+
const t = r.split(",").map((o) => Number(o.trim()));
|
|
178
|
+
return t.length !== 3 || t.some((o) => !Number.isFinite(o) || o < 0 || o > 255) ? null : "#" + t.map((o) => Math.round(o).toString(16).padStart(2, "0")).join("");
|
|
179
179
|
}
|
|
180
180
|
function A(r) {
|
|
181
181
|
if (!r)
|
|
182
182
|
return "";
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
return
|
|
183
|
+
const t = /* @__PURE__ */ new Set(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o = Object.entries(r).filter(([n]) => t.has(n)).map(([n, e]) => {
|
|
184
|
+
const s = z(e);
|
|
185
|
+
return s ? ` --sa-color-brand-${n}: ${s};` : "";
|
|
186
186
|
}).filter(Boolean).join(`
|
|
187
187
|
`);
|
|
188
|
-
return
|
|
189
|
-
${
|
|
188
|
+
return o ? `:root {
|
|
189
|
+
${o}
|
|
190
190
|
}` : "";
|
|
191
191
|
}
|
|
192
|
-
function q({ value: r, children:
|
|
193
|
-
const [
|
|
194
|
-
() =>
|
|
195
|
-
[
|
|
196
|
-
),
|
|
192
|
+
function q({ value: r, children: t }) {
|
|
193
|
+
const [o, n] = E(r), e = y(
|
|
194
|
+
() => o ? JSON.stringify(o) : "",
|
|
195
|
+
[o]
|
|
196
|
+
), s = F(J(_));
|
|
197
197
|
P(() => {
|
|
198
|
-
var c,
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
198
|
+
var c, l;
|
|
199
|
+
if (e) {
|
|
200
|
+
const a = JSON.parse(e), u = V(a) ?? "", $ = A((l = (c = a == null ? void 0 : a.colors) == null ? void 0 : c.raw) == null ? void 0 : l.blue), p = [u, $].filter(Boolean).join(`
|
|
201
201
|
`);
|
|
202
|
-
p && (
|
|
202
|
+
p && (s != null && s.current) && (s.current.textContent = p);
|
|
203
203
|
}
|
|
204
|
-
}, [
|
|
205
|
-
const
|
|
206
|
-
c &&
|
|
204
|
+
}, [e]);
|
|
205
|
+
const i = (c) => {
|
|
206
|
+
c && n(c);
|
|
207
207
|
};
|
|
208
|
-
return /* @__PURE__ */ w(j.Provider, { value: { theme:
|
|
208
|
+
return /* @__PURE__ */ w(j.Provider, { value: { theme: o, setTheme: i }, children: t });
|
|
209
209
|
}
|
|
210
210
|
const I = {
|
|
211
211
|
raw: {
|
|
@@ -408,22 +408,22 @@ const I = {
|
|
|
408
408
|
colors: I,
|
|
409
409
|
metrics: K,
|
|
410
410
|
font: R
|
|
411
|
-
}, m = U, v = (r,
|
|
412
|
-
const
|
|
413
|
-
return Object.keys(r).forEach((
|
|
414
|
-
if (r != null && r[
|
|
415
|
-
|
|
416
|
-
...r == null ? void 0 : r[
|
|
417
|
-
...
|
|
418
|
-
...v(r == null ? void 0 : r[
|
|
411
|
+
}, m = U, v = (r, t) => {
|
|
412
|
+
const o = {};
|
|
413
|
+
return Object.keys(r).forEach((n) => {
|
|
414
|
+
if (r != null && r[n] && typeof (r == null ? void 0 : r[n]) == "object") {
|
|
415
|
+
o[n] = {
|
|
416
|
+
...r == null ? void 0 : r[n],
|
|
417
|
+
...t == null ? void 0 : t[n],
|
|
418
|
+
...v(r == null ? void 0 : r[n], t == null ? void 0 : t[n])
|
|
419
419
|
};
|
|
420
420
|
return;
|
|
421
421
|
}
|
|
422
|
-
|
|
423
|
-
}),
|
|
422
|
+
o[n] = (t == null ? void 0 : t[n]) || (r == null ? void 0 : r[n]);
|
|
423
|
+
}), o;
|
|
424
424
|
};
|
|
425
425
|
function x() {
|
|
426
|
-
const r = N(j),
|
|
426
|
+
const r = N(j), t = y(
|
|
427
427
|
() => ({
|
|
428
428
|
...m,
|
|
429
429
|
...r.theme,
|
|
@@ -431,26 +431,26 @@ function x() {
|
|
|
431
431
|
}),
|
|
432
432
|
[r.theme, m]
|
|
433
433
|
);
|
|
434
|
-
return { ...r, theme:
|
|
434
|
+
return { ...r, theme: t };
|
|
435
435
|
}
|
|
436
436
|
function G() {
|
|
437
437
|
const { theme: r } = x();
|
|
438
438
|
return r.colors;
|
|
439
439
|
}
|
|
440
440
|
function Q() {
|
|
441
|
-
var
|
|
441
|
+
var t;
|
|
442
442
|
const { theme: r } = x();
|
|
443
|
-
return (
|
|
443
|
+
return (t = r.metrics) == null ? void 0 : t.spacing;
|
|
444
444
|
}
|
|
445
445
|
function X() {
|
|
446
|
-
var
|
|
446
|
+
var t;
|
|
447
447
|
const { theme: r } = x();
|
|
448
|
-
return (
|
|
448
|
+
return (t = r.metrics) == null ? void 0 : t.radii;
|
|
449
449
|
}
|
|
450
450
|
function Z() {
|
|
451
|
-
var
|
|
451
|
+
var t;
|
|
452
452
|
const { theme: r } = x();
|
|
453
|
-
return (
|
|
453
|
+
return (t = r == null ? void 0 : r.metrics) == null ? void 0 : t.shadows;
|
|
454
454
|
}
|
|
455
455
|
function k(r) {
|
|
456
456
|
return r;
|
package/dist/index.umd.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`;for(const s in n)if(Object.hasOwnProperty.call(n,s)){const i=n[s];
|
|
3
|
-
`}}return
|
|
4
|
-
`}}return
|
|
5
|
-
`}else{const u=`${i}${n}-${c}`;
|
|
6
|
-
`}}for(const n in r){const s=r[n];for(const i in s){const c=s[i];if(typeof c=="object")for(const
|
|
7
|
-
`}else{const c=`--${i}-${n}`;
|
|
8
|
-
`}}for(const n in r){const s=r[n];if(typeof s=="object")e(n,s,`${
|
|
9
|
-
`}}return
|
|
10
|
-
`}}return
|
|
11
|
-
`:
|
|
12
|
-
`}return
|
|
13
|
-
`}),
|
|
1
|
+
(function(l,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],p):(l=typeof globalThis<"u"?globalThis:l||self,p(l["@starasia/theme"]={},l.jsxRuntime,l.React))})(this,function(l,p,m){"use strict";function C(r,t=""){let o="";for(const e in r)if(Object.hasOwnProperty.call(r,e)){const n=r[e];o+=`/* ${e} */
|
|
2
|
+
`;for(const s in n)if(Object.hasOwnProperty.call(n,s)){const i=n[s];o+=`--${t}-${e}-${s}: ${i};
|
|
3
|
+
`}}return o}function y(r,t){let o="";for(const e in r){const n=r[e];for(const s in n){const i=n[s],c=s?`${t}-${e}-${s}`:`${t}-${e}`;o+=`--${c}: ${i};
|
|
4
|
+
`}}return o}function E(r,t){let o="";function e(n,s,i="",c="",a=""){if(a){const u=`${i}${a}-${c}-${n}`;o+=`--${u}: ${s};
|
|
5
|
+
`}else{const u=`${i}${n}-${c}`;o+=`--${u}: ${s};
|
|
6
|
+
`}}for(const n in r){const s=r[n];for(const i in s){const c=s[i];if(typeof c=="object")for(const a in c){const u=c[a],$=`${t}-`;e(i,u,$,n,a)}else{const a=`${t}-`;e(i,c,a,n)}}}return o}function P(r,t=""){let o="";function e(n,s,i=""){if(typeof s=="object")for(const c in s){const a=s[c],u=`--${i}-${n}-${c}`;o+=`${u}: ${a};
|
|
7
|
+
`}else{const c=`--${i}-${n}`;o+=`${c}: ${s};
|
|
8
|
+
`}}for(const n in r){const s=r[n];if(typeof s=="object")e(n,s,`${t}`);else{const i=`--${t}-${n}`;o+=`${i}: ${s};
|
|
9
|
+
`}}return o}function F(r,t=""){let o="";for(const e in r){const n=r[e];for(const s in n){const i=`--${t}-${e}-${s}`,c=n[s];o+=`${i}: ${c};
|
|
10
|
+
`}}return o}function N(r,t){let o="";for(const e in r)if(Object.hasOwnProperty.call(r,e)){const n=r[e];e==="default"?o+=`--${t}: ${n};
|
|
11
|
+
`:o+=`--${t}-${e}: ${n};
|
|
12
|
+
`}return o}const M=r=>{const t=document.getElementById(r);if(t)return t;const o=document.createElement("style");return o.id=r,document.head.appendChild(o),o};function j(r,t){let o="";return Object.keys(r).forEach(e=>{const n=r[e];if(n&&typeof n=="object"){o+=j(n,`${t}-${e}`);return}o+=`${t}-${e}: ${n};
|
|
13
|
+
`}),o}function B(r,t){let o="";return r&&(o+=j(r,t)),o}function D(r){var $,b,x,v,w,O;if(!r)return;const t=($=r.colors)!=null&&$.raw?y(r.colors.raw,"sa-ui-raw-color"):"",o=(b=r.colors)!=null&&b.computed?y(r.colors.computed,"sa-ui-color"):"",e=(x=r.colors)!=null&&x.main?E(r.colors.main,"sa-ui"):"",n=(v=r.colors)!=null&&v.brand?C(r.colors.brand,"sa-ui-brand"):"",s=(w=r.colors)!=null&&w.utility?C(r.colors.utility,"sa-ui-utility"):"",i=(O=r.colors)!=null&&O.text?N(r.colors.text,"sa-ui-color-text"):"",c=r.metrics?P(r.metrics,"sa-ui"):"",a=r.font?F(r.font,"sa-ui"):"",u=r.components?B(r.components,"--sa-ui"):"";return`
|
|
14
14
|
:root {
|
|
15
|
-
${o}
|
|
16
15
|
${t}
|
|
16
|
+
${o}
|
|
17
17
|
${e}
|
|
18
18
|
${n}
|
|
19
19
|
${s}
|
|
20
20
|
${i}
|
|
21
21
|
${c}
|
|
22
|
-
${
|
|
22
|
+
${a}
|
|
23
23
|
${u}
|
|
24
24
|
}
|
|
25
|
-
`}const d=m.createContext({theme:void 0,setTheme:()=>{}}),H="
|
|
26
|
-
`);return
|
|
27
|
-
${
|
|
28
|
-
}`:""}function L({value:r,children:
|
|
29
|
-
`);x&&(s!=null&&s.current)&&(s.current.textContent=x)}},[n]);const i=c=>{c&&e(c)};return p.jsx(d.Provider,{value:{theme:
|
|
25
|
+
`}const d=m.createContext({theme:void 0,setTheme:()=>{}}),H="sa-theme-style";function R(r){const t=r.split(",").map(o=>Number(o.trim()));return t.length!==3||t.some(o=>!Number.isFinite(o)||o<0||o>255)?null:"#"+t.map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}function J(r){if(!r)return"";const t=new Set(["50","100","200","300","400","500","600","700","800","900"]),o=Object.entries(r).filter(([e])=>t.has(e)).map(([e,n])=>{const s=R(n);return s?` --sa-color-brand-${e}: ${s};`:""}).filter(Boolean).join(`
|
|
26
|
+
`);return o?`:root {
|
|
27
|
+
${o}
|
|
28
|
+
}`:""}function L({value:r,children:t}){const[o,e]=m.useState(r),n=m.useMemo(()=>o?JSON.stringify(o):"",[o]),s=m.useRef(M(H));m.useEffect(()=>{var c,a;if(n){const u=JSON.parse(n),$=D(u)??"",b=J((a=(c=u==null?void 0:u.colors)==null?void 0:c.raw)==null?void 0:a.blue),x=[$,b].filter(Boolean).join(`
|
|
29
|
+
`);x&&(s!=null&&s.current)&&(s.current.textContent=x)}},[n]);const i=c=>{c&&e(c)};return p.jsx(d.Provider,{value:{theme:o,setTheme:i},children:t})}const S={colors:{raw:{white:{900:"255, 255, 255"},black:{900:"0, 0, 0"},blue:{50:"230, 237, 246",100:"204, 217, 237",200:"153, 179, 219",300:"102, 140, 201",400:"51, 102, 183",500:"26, 79, 160",600:"4, 37, 79",700:"3, 31, 67",800:"2, 25, 55",900:"2, 19, 43"},pink:{50:"251, 219, 241",100:"248, 183, 228",200:"245, 147, 215",300:"241, 111, 202",400:"238, 75, 189",500:"235, 39, 176",600:"215, 19, 157",700:"179, 16, 131",800:"143, 13, 104",900:"107, 9, 78"},purple:{50:"249, 229, 252",100:"240, 196, 248",200:"230, 162, 244",300:"220, 128, 240",400:"210, 95, 236",500:"200, 61, 232",600:"180, 41, 212",700:"150, 34, 177",800:"120, 27, 142",900:"90, 21, 106"},red:{50:"251, 222, 222",100:"247, 188, 188",200:"243, 153, 153",300:"239, 119, 119",400:"235, 84, 84",500:"231, 50, 50",600:"212, 30, 30",700:"176, 25, 25",800:"141, 20, 20",900:"105, 15, 15"},orange:{50:"253, 235, 217",100:"251, 215, 179",200:"249, 195, 141",300:"247, 175, 103",400:"245, 155, 65",500:"243, 135, 27",600:"224, 116, 8",700:"187, 96, 7",800:"150, 77, 6",900:"112, 58, 4"},yellow:{50:"255, 250, 219",100:"255, 246, 184",200:"255, 241, 149",300:"255, 237, 114",400:"255, 232, 79",500:"255, 228, 44",600:"236, 209, 25",700:"197, 174, 21",800:"157, 139, 17",900:"118, 104, 12"},green:{50:"236, 255, 246",100:"151, 230, 193",200:"117, 222, 173",300:"82, 214, 152",400:"48, 206, 132",500:"40, 172, 110",600:"32, 137, 88",700:"24, 103, 66",800:"16, 68, 44",900:"16, 68, 44"},brand:{default:"4, 37, 79",active:"2, 19, 43",secondary:"153, 179, 219",tertiary:"230, 237, 246"}}},metrics:{radii:{none:"0",xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"0.875rem","2xl":"1rem",full:"12rem"},spacing:{0:"0rem",1:"0.063rem",2:"0.125rem",4:"0.25rem",6:"0.375rem",8:"0.5rem",10:"0.625rem",12:"0.75rem",14:"0.875rem",16:"1rem",18:"1.125rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",48:"3rem",64:"4rem",80:"5rem",96:"6rem",128:"8rem",160:"10rem",192:"12rem",224:"14rem",256:"16rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem","2xl":"2rem","3xl":"4rem"},border:{default:"1px solid var(--sa-border-subtle, #0b120e24)"},shadows:{sm:"0 1px 2px 0 #0000000d",md:"0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",lg:"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a",xl:"0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a","2xl":"0 25px 50px -12px #00000040",inner:"inset 0 2px 4px 0 #0000000d",card:"0px 4px 35px 0px #7090b040"}},font:{fontSizes:{xs:"0.625rem",sm:"0.75rem",md:"0.875rem",lg:"1rem",xl:"1.125rem","2xl":"1.25rem","3xl":"1.5rem","4xl":"2rem","5xl":"2.25rem","6xl":"3rem"},fontWeights:{hairline:100,thin:100,light:200,normal:300,medium:400,semibold:500,bold:600,extrabold:700,black:800},lineHeights:{3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"1.875rem",9:"2.25rem",10:"2.5rem",none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2}}},g=(r,t)=>{const o={};return Object.keys(r).forEach(e=>{if(r!=null&&r[e]&&typeof(r==null?void 0:r[e])=="object"){o[e]={...r==null?void 0:r[e],...t==null?void 0:t[e],...g(r==null?void 0:r[e],t==null?void 0:t[e])};return}o[e]=(t==null?void 0:t[e])||(r==null?void 0:r[e])}),o};function f(){const r=m.useContext(d),t=m.useMemo(()=>({...S,...r.theme,...g(S,r.theme)}),[r.theme,S]);return{...r,theme:t}}function _(){const{theme:r}=f();return r.colors}function q(){var t;const{theme:r}=f();return(t=r.metrics)==null?void 0:t.spacing}function A(){var t;const{theme:r}=f();return(t=r.metrics)==null?void 0:t.radii}function U(){var t;const{theme:r}=f();return(t=r==null?void 0:r.metrics)==null?void 0:t.shadows}function V(r){return r}l.ThemeContext=d,l.ThemeProvider=L,l.createTheme=V,l.useColor=_,l.useRadius=A,l.useShadow=U,l.useSpacing=q,l.useTheme=f,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|