@starasia/theme 2.0.0 → 2.0.1

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,217 +1,213 @@
1
- import { jsx as S } from "react/jsx-runtime";
2
- import { createContext as h, useState as j, useMemo as $, useRef as O, useEffect as E, useContext as P } from "react";
3
- function y(r, a = "") {
4
- let o = "";
1
+ import { jsx as w } from "react/jsx-runtime";
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, o = "") {
4
+ let t = "";
5
5
  for (const s in r)
6
6
  if (Object.hasOwnProperty.call(r, s)) {
7
- const t = r[s];
8
- o += `/* ${s} */
7
+ const n = r[s];
8
+ t += `/* ${s} */
9
9
  `;
10
- for (const i in t)
11
- if (Object.hasOwnProperty.call(t, i)) {
12
- const e = t[i];
13
- o += `--${a}-${s}-${i}: ${e};
10
+ for (const e in n)
11
+ if (Object.hasOwnProperty.call(n, e)) {
12
+ const a = n[e];
13
+ t += `--${o}-${s}-${e}: ${a};
14
14
  `;
15
15
  }
16
16
  }
17
- return o;
17
+ return t;
18
18
  }
19
- function f(r, a) {
20
- let o = "";
19
+ function C(r, o) {
20
+ let t = "";
21
21
  for (const s in r) {
22
- const t = r[s];
23
- for (const i in t) {
24
- const e = t[i], c = i ? `${a}-${s}-${i}` : `${a}-${s}`;
25
- o += `--${c}: ${e};
22
+ const n = r[s];
23
+ for (const e in n) {
24
+ const a = n[e], c = e ? `${o}-${s}-${e}` : `${o}-${s}`;
25
+ t += `--${c}: ${a};
26
26
  `;
27
27
  }
28
28
  }
29
- return o;
29
+ return t;
30
30
  }
31
- function F(r, a) {
32
- let o = "";
33
- function s(t, i, e = "", c = "", l = "") {
34
- if (l) {
35
- const n = `${e}${l}-${c}-${t}`;
36
- o += `--${n}: ${i};
31
+ function M(r, o) {
32
+ let t = "";
33
+ function s(n, e, a = "", c = "", i = "") {
34
+ if (i) {
35
+ const l = `${a}${i}-${c}-${n}`;
36
+ t += `--${l}: ${e};
37
37
  `;
38
38
  } else {
39
- const n = `${e}${t}-${c}`;
40
- o += `--${n}: ${i};
39
+ const l = `${a}${n}-${c}`;
40
+ t += `--${l}: ${e};
41
41
  `;
42
42
  }
43
43
  }
44
- for (const t in r) {
45
- const i = r[t];
46
- for (const e in i) {
47
- const c = i[e];
44
+ for (const n in r) {
45
+ const e = r[n];
46
+ for (const a in e) {
47
+ const c = e[a];
48
48
  if (typeof c == "object")
49
- for (const l in c) {
50
- const n = c[l], b = `${a}-`;
49
+ for (const i in c) {
50
+ const l = c[i], u = `${o}-`;
51
51
  s(
52
- e,
52
+ a,
53
+ l,
54
+ u,
53
55
  n,
54
- b,
55
- t,
56
- l
56
+ i
57
57
  );
58
58
  }
59
59
  else {
60
- const l = `${a}-`;
61
- s(e, c, l, t);
60
+ const i = `${o}-`;
61
+ s(a, c, i, n);
62
62
  }
63
63
  }
64
64
  }
65
- return o;
65
+ return t;
66
66
  }
67
- function N(r, a = "") {
68
- let o = "";
69
- function s(t, i, e = "") {
70
- if (typeof i == "object")
71
- for (const c in i) {
72
- const l = i[c], n = `--${e}-${t}-${c}`;
73
- o += `${n}: ${l};
67
+ function B(r, o = "") {
68
+ let t = "";
69
+ function s(n, e, a = "") {
70
+ if (typeof e == "object")
71
+ for (const c in e) {
72
+ const i = e[c], l = `--${a}-${n}-${c}`;
73
+ t += `${l}: ${i};
74
74
  `;
75
75
  }
76
76
  else {
77
- const c = `--${e}-${t}`;
78
- o += `${c}: ${i};
77
+ const c = `--${a}-${n}`;
78
+ t += `${c}: ${e};
79
79
  `;
80
80
  }
81
81
  }
82
- for (const t in r) {
83
- const i = r[t];
84
- if (typeof i == "object")
85
- s(t, i, `${a}`);
82
+ for (const n in r) {
83
+ const e = r[n];
84
+ if (typeof e == "object")
85
+ s(n, e, `${o}`);
86
86
  else {
87
- const e = `--${a}-${t}`;
88
- o += `${e}: ${i};
87
+ const a = `--${o}-${n}`;
88
+ t += `${a}: ${e};
89
89
  `;
90
90
  }
91
91
  }
92
- return o;
92
+ return t;
93
93
  }
94
- function M(r, a = "") {
95
- let o = "";
94
+ function D(r, o = "") {
95
+ let t = "";
96
96
  for (const s in r) {
97
- const t = r[s];
98
- for (const i in t) {
99
- const e = `--${a}-${s}-${i}`, c = t[i];
100
- o += `${e}: ${c};
97
+ const n = r[s];
98
+ for (const e in n) {
99
+ const a = `--${o}-${s}-${e}`, c = n[e];
100
+ t += `${a}: ${c};
101
101
  `;
102
102
  }
103
103
  }
104
- return o;
104
+ return t;
105
105
  }
106
- function B(r, a) {
107
- let o = "";
106
+ function H(r, o) {
107
+ let t = "";
108
108
  for (const s in r)
109
109
  if (Object.hasOwnProperty.call(r, s)) {
110
- const t = r[s];
111
- s === "default" ? o += `--${a}: ${t};
112
- ` : o += `--${a}-${s}: ${t};
110
+ const n = r[s];
111
+ s === "default" ? t += `--${o}: ${n};
112
+ ` : t += `--${o}-${s}: ${n};
113
113
  `;
114
114
  }
115
- return o;
115
+ return t;
116
116
  }
117
- const D = (r) => {
118
- const a = document.getElementById(r);
119
- if (a)
120
- return a;
121
- const o = document.createElement("style");
122
- return o.id = r, document.head.appendChild(o), o;
117
+ const J = (r) => {
118
+ const o = document.getElementById(r);
119
+ if (o)
120
+ return o;
121
+ const t = document.createElement("style");
122
+ return t.id = r, document.head.appendChild(t), t;
123
123
  };
124
- function m(r, a) {
125
- let o = "";
124
+ function g(r, o) {
125
+ let t = "";
126
126
  return Object.keys(r).forEach((s) => {
127
- const t = r[s];
128
- if (t && typeof t == "object") {
129
- o += m(t, `${a}-${s}`);
127
+ const n = r[s];
128
+ if (n && typeof n == "object") {
129
+ t += g(n, `${o}-${s}`);
130
130
  return;
131
131
  }
132
- o += `${a}-${s}: ${t};
132
+ t += `${o}-${s}: ${n};
133
133
  `;
134
- }), o;
134
+ }), t;
135
135
  }
136
- function J(r, a) {
137
- let o = "";
138
- return r && (o += m(r, a)), o;
136
+ function L(r, o) {
137
+ let t = "";
138
+ return r && (t += g(r, o)), t;
139
139
  }
140
- function H(r) {
141
- var b, u, g, w, p, x;
140
+ function V(r) {
141
+ var u, $, p, f, b, d;
142
142
  if (!r)
143
143
  return;
144
- const a = (b = r.colors) != null && b.raw ? f(
144
+ const o = (u = r.colors) != null && u.raw ? C(
145
145
  r.colors.raw,
146
146
  "starasia-ui-raw-color"
147
- ) : "", o = (u = r.colors) != null && u.computed ? f(
147
+ ) : "", t = ($ = r.colors) != null && $.computed ? C(
148
148
  r.colors.computed,
149
149
  "starasia-ui-color"
150
- ) : "", s = (g = r.colors) != null && g.main ? F(r.colors.main, "starasia-ui") : "", t = (w = r.colors) != null && w.brand ? y(r.colors.brand, "starasia-ui-brand") : "", i = (p = r.colors) != null && p.utility ? y(
150
+ ) : "", s = (p = r.colors) != null && p.main ? M(r.colors.main, "starasia-ui") : "", n = (f = r.colors) != null && f.brand ? S(r.colors.brand, "starasia-ui-brand") : "", e = (b = r.colors) != null && b.utility ? S(
151
151
  r.colors.utility,
152
152
  "starasia-ui-utility"
153
- ) : "", e = (x = r.colors) != null && x.text ? B(
153
+ ) : "", a = (d = r.colors) != null && d.text ? H(
154
154
  r.colors.text,
155
155
  "starasia-ui-color-text"
156
- ) : "", c = r.metrics ? N(r.metrics, "starasia-ui") : "", l = r.font ? M(r.font, "starasia-ui") : "", n = r.components ? J(r.components, "--starasia-ui") : "";
156
+ ) : "", c = r.metrics ? B(r.metrics, "starasia-ui") : "", i = r.font ? D(r.font, "starasia-ui") : "", l = r.components ? L(r.components, "--starasia-ui") : "";
157
157
  return `
158
158
  :root {
159
- ${a}
160
159
  ${o}
161
- ${s}
162
160
  ${t}
163
- ${i}
161
+ ${s}
162
+ ${n}
164
163
  ${e}
164
+ ${a}
165
165
  ${c}
166
+ ${i}
166
167
  ${l}
167
- ${n}
168
168
  }
169
169
  `;
170
170
  }
171
- const k = h({
171
+ const j = O({
172
172
  theme: void 0,
173
173
  setTheme: () => {
174
174
  }
175
- }), L = "starasia-theme-style";
176
- function V(r) {
175
+ }), _ = "starasia-theme-style";
176
+ function z(r) {
177
+ const o = r.split(",").map((t) => Number(t.trim()));
178
+ return o.length !== 3 || o.some((t) => !Number.isFinite(t) || t < 0 || t > 255) ? null : "#" + o.map((t) => Math.round(t).toString(16).padStart(2, "0")).join("");
179
+ }
180
+ function A(r) {
177
181
  if (!r)
178
182
  return "";
179
- const a = {
180
- 50: "50",
181
- 100: "100",
182
- 200: "200",
183
- 300: "300",
184
- 400: "400",
185
- 500: "500",
186
- 600: "600",
187
- 700: "700",
188
- 800: "800",
189
- 900: "900"
190
- }, o = Object.entries(r).filter(([s]) => a[s]).map(([s, t]) => ` --sa-color-brand-${s}: rgb(${t});`).join(`
183
+ const o = /* @__PURE__ */ new Set(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), t = Object.entries(r).filter(([s]) => o.has(s)).map(([s, n]) => {
184
+ const e = z(n);
185
+ return e ? ` --sa-color-brand-${s}: ${e};` : "";
186
+ }).filter(Boolean).join(`
191
187
  `);
192
- return o ? `:root {
193
- ${o}
188
+ return t ? `:root {
189
+ ${t}
194
190
  }` : "";
195
191
  }
196
- function R({ value: r, children: a }) {
197
- const [o, s] = j(r), t = $(
198
- () => o ? JSON.stringify(o) : "",
199
- [o]
200
- ), i = O(D(L));
201
- E(() => {
202
- var c, l;
203
- if (t) {
204
- const n = JSON.parse(t), b = H(n) ?? "", u = V((l = (c = n == null ? void 0 : n.colors) == null ? void 0 : c.raw) == null ? void 0 : l.blue), g = [b, u].filter(Boolean).join(`
192
+ function q({ value: r, children: o }) {
193
+ const [t, s] = E(r), n = y(
194
+ () => t ? JSON.stringify(t) : "",
195
+ [t]
196
+ ), e = F(J(_));
197
+ P(() => {
198
+ var c, i;
199
+ if (n) {
200
+ const l = JSON.parse(n), u = V(l) ?? "", $ = A((i = (c = l == null ? void 0 : l.colors) == null ? void 0 : c.raw) == null ? void 0 : i.blue), p = [u, $].filter(Boolean).join(`
205
201
  `);
206
- g && (i != null && i.current) && (i.current.textContent = g);
202
+ p && (e != null && e.current) && (e.current.textContent = p);
207
203
  }
208
- }, [t]);
209
- const e = (c) => {
204
+ }, [n]);
205
+ const a = (c) => {
210
206
  c && s(c);
211
207
  };
212
- return /* @__PURE__ */ S(k.Provider, { value: { theme: o, setTheme: e }, children: a });
208
+ return /* @__PURE__ */ w(j.Provider, { value: { theme: t, setTheme: a }, children: o });
213
209
  }
214
- const _ = {
210
+ const I = {
215
211
  raw: {
216
212
  white: {
217
213
  900: "255, 255, 255"
@@ -220,16 +216,16 @@ const _ = {
220
216
  900: "0, 0, 0"
221
217
  },
222
218
  blue: {
223
- 50: "227, 242, 253",
224
- 100: "187, 222, 251",
225
- 200: "144, 202, 249",
226
- 300: "100, 181, 246",
227
- 400: "66, 165, 245",
228
- 500: "33, 150, 243",
229
- 600: "30, 136, 229",
230
- 700: "25, 118, 210",
231
- 800: "21, 101, 192",
232
- 900: "13, 71, 161"
219
+ 50: "230, 237, 246",
220
+ 100: "204, 217, 237",
221
+ 200: "153, 179, 219",
222
+ 300: "102, 140, 201",
223
+ 400: "51, 102, 183",
224
+ 500: "26, 79, 160",
225
+ 600: "4, 37, 79",
226
+ 700: "3, 31, 67",
227
+ 800: "2, 25, 55",
228
+ 900: "2, 19, 43"
233
229
  },
234
230
  pink: {
235
231
  50: "251, 219, 241",
@@ -244,412 +240,73 @@ const _ = {
244
240
  900: "107, 9, 78"
245
241
  },
246
242
  purple: {
247
- 50: "233, 222, 245",
248
- 100: "212, 189, 235",
249
- 200: "190, 156, 226",
250
- 300: "169, 123, 216",
251
- 400: "147, 90, 207",
252
- 500: "126, 57, 197",
253
- 600: "105, 47, 164",
254
- 700: "84, 38, 131",
255
- 800: "63, 28, 98",
256
- 900: "42, 19, 65"
257
- },
258
- gray: {
259
- 50: "255, 254, 255",
260
- 100: "239, 243, 248",
261
- 200: "201, 206, 204",
262
- 300: "174, 182, 178",
263
- 400: "147, 158, 153",
264
- 500: "120, 134, 127",
265
- 600: "96, 107, 102",
266
- 700: "72, 80, 76",
267
- 800: "48, 53, 51",
268
- 900: "24, 26, 25"
243
+ 50: "249, 229, 252",
244
+ 100: "240, 196, 248",
245
+ 200: "230, 162, 244",
246
+ 300: "220, 128, 240",
247
+ 400: "210, 95, 236",
248
+ 500: "200, 61, 232",
249
+ 600: "180, 41, 212",
250
+ 700: "150, 34, 177",
251
+ 800: "120, 27, 142",
252
+ 900: "90, 21, 106"
269
253
  },
270
254
  red: {
271
- 50: "255, 240, 243",
272
- 100: "255, 204, 213",
273
- 200: "255, 179, 193",
274
- 300: "255, 143, 163",
275
- 400: "255, 117, 143",
276
- 500: "255, 77, 109",
277
- 600: "201, 24, 74",
278
- 700: "164, 19, 60",
279
- 800: "128, 15, 47",
280
- 900: "89, 13, 34"
255
+ 50: "251, 222, 222",
256
+ 100: "247, 188, 188",
257
+ 200: "243, 153, 153",
258
+ 300: "239, 119, 119",
259
+ 400: "235, 84, 84",
260
+ 500: "231, 50, 50",
261
+ 600: "212, 30, 30",
262
+ 700: "176, 25, 25",
263
+ 800: "141, 20, 20",
264
+ 900: "105, 15, 15"
281
265
  },
282
266
  orange: {
283
- 50: "250, 246, 224",
284
- 100: "255, 245, 193",
285
- 200: "255, 225, 139",
286
- 300: "255, 203, 105",
287
- 400: "234, 183, 84",
288
- 500: "210, 160, 58",
289
- 600: "179, 130, 10",
290
- 700: "152, 104, 0",
291
- 800: "126, 80, 0",
292
- 900: "97, 52, 0"
293
- },
294
- aloha: {
295
- 50: "219, 247, 242",
296
- 100: "184, 240, 230",
297
- 200: "149, 232, 218",
298
- 300: "114, 225, 206",
299
- 400: "79, 218, 194",
300
- 500: "44, 210, 182",
301
- 600: "36, 175, 152",
302
- 700: "29, 140, 121",
303
- 800: "22, 105, 91",
304
- 900: "14, 70, 60"
267
+ 50: "253, 235, 217",
268
+ 100: "251, 215, 179",
269
+ 200: "249, 195, 141",
270
+ 300: "247, 175, 103",
271
+ 400: "245, 155, 65",
272
+ 500: "243, 135, 27",
273
+ 600: "224, 116, 8",
274
+ 700: "187, 96, 7",
275
+ 800: "150, 77, 6",
276
+ 900: "112, 58, 4"
277
+ },
278
+ yellow: {
279
+ 50: "255, 250, 219",
280
+ 100: "255, 246, 184",
281
+ 200: "255, 241, 149",
282
+ 300: "255, 237, 114",
283
+ 400: "255, 232, 79",
284
+ 500: "255, 228, 44",
285
+ 600: "236, 209, 25",
286
+ 700: "197, 174, 21",
287
+ 800: "157, 139, 17",
288
+ 900: "118, 104, 12"
305
289
  },
306
290
  green: {
307
- 50: "220, 246, 234",
308
- 100: "186, 238, 214",
309
- 200: "151, 230, 193",
310
- 300: "117, 222, 173",
311
- 400: "82, 214, 152",
312
- 500: "48, 206, 132",
313
- 600: "40, 172, 110",
314
- 700: "32, 137, 88",
315
- 800: "24, 103, 66",
291
+ 50: "236, 255, 246",
292
+ 100: "151, 230, 193",
293
+ 200: "117, 222, 173",
294
+ 300: "82, 214, 152",
295
+ 400: "48, 206, 132",
296
+ 500: "40, 172, 110",
297
+ 600: "32, 137, 88",
298
+ 700: "24, 103, 66",
299
+ 800: "16, 68, 44",
316
300
  900: "16, 68, 44"
317
301
  },
318
302
  brand: {
319
- default: "74, 106, 148",
320
- active: "57, 82, 116",
321
- secondary: "144, 176, 218",
322
- tertiary: "227, 237, 248"
323
- }
324
- },
325
- computed: {
326
- white: {
327
- 900: "rgba(var(--starasia-ui-raw-color-white-900), 1)",
328
- "": "rgba(var(--starasia-ui-raw-color-gray-50), 1)"
329
- },
330
- black: {
331
- 900: "rgba(var(--starasia-ui-raw-color-black-900), 1)"
332
- },
333
- blue: {
334
- 50: "rgba(var(--starasia-ui-raw-color-blue-50), 1)",
335
- 100: "rgba(var(--starasia-ui-raw-color-blue-100), 1)",
336
- 200: "rgba(var(--starasia-ui-raw-color-blue-200), 1)",
337
- 300: "rgba(var(--starasia-ui-raw-color-blue-300), 1)",
338
- 400: "rgba(var(--starasia-ui-raw-color-blue-400), 1)",
339
- 500: "rgba(var(--starasia-ui-raw-color-blue-500), 1)",
340
- 600: "rgba(var(--starasia-ui-raw-color-blue-600), 1)",
341
- 700: "rgba(var(--starasia-ui-raw-color-blue-700), 1)",
342
- 800: "rgba(var(--starasia-ui-raw-color-blue-800), 1)",
343
- 900: "rgba(var(--starasia-ui-raw-color-blue-900), 1)"
344
- },
345
- pink: {
346
- 50: "rgba(var(--starasia-ui-raw-color-pink-50), 1)",
347
- 100: "rgba(var(--starasia-ui-raw-color-pink-100), 1)",
348
- 200: "rgba(var(--starasia-ui-raw-color-pink-200), 1)",
349
- 300: "rgba(var(--starasia-ui-raw-color-pink-300), 1)",
350
- 400: "rgba(var(--starasia-ui-raw-color-pink-400), 1)",
351
- 500: "rgba(var(--starasia-ui-raw-color-pink-500), 1)",
352
- 600: "rgba(var(--starasia-ui-raw-color-pink-600), 1)",
353
- 700: "rgba(var(--starasia-ui-raw-color-pink-700), 1)",
354
- 800: "rgba(var(--starasia-ui-raw-color-pink-800), 1)",
355
- 900: "rgba(var(--starasia-ui-raw-color-pink-900), 1)"
356
- },
357
- purple: {
358
- 50: "rgba(var(--starasia-ui-raw-color-purple-50), 1)",
359
- 100: "rgba(var(--starasia-ui-raw-color-purple-100), 1)",
360
- 200: "rgba(var(--starasia-ui-raw-color-purple-200), 1)",
361
- 300: "rgba(var(--starasia-ui-raw-color-purple-300), 1)",
362
- 400: "rgba(var(--starasia-ui-raw-color-purple-400), 1)",
363
- 500: "rgba(var(--starasia-ui-raw-color-purple-500), 1)",
364
- 600: "rgba(var(--starasia-ui-raw-color-purple-600), 1)",
365
- 700: "rgba(var(--starasia-ui-raw-color-purple-700), 1)",
366
- 800: "rgba(var(--starasia-ui-raw-color-purple-800), 1)",
367
- 900: "rgba(var(--starasia-ui-raw-color-purple-900), 1)"
368
- },
369
- gray: {
370
- 50: "rgba(var(--starasia-ui-raw-color-gray-50), 1)",
371
- 100: "rgba(var(--starasia-ui-raw-color-gray-100), 1)",
372
- 200: "rgba(var(--starasia-ui-raw-color-gray-200), 1)",
373
- 300: "rgba(var(--starasia-ui-raw-color-gray-300), 1)",
374
- 400: "rgba(var(--starasia-ui-raw-color-gray-400), 1)",
375
- 500: "rgba(var(--starasia-ui-raw-color-gray-500), 1)",
376
- 600: "rgba(var(--starasia-ui-raw-color-gray-600), 1)",
377
- 700: "rgba(var(--starasia-ui-raw-color-gray-700), 1)",
378
- 800: "rgba(var(--starasia-ui-raw-color-gray-800), 1)",
379
- 900: "rgba(var(--starasia-ui-raw-color-gray-900), 1)"
380
- },
381
- red: {
382
- 50: "rgba(var(--starasia-ui-raw-color-red-50), 1)",
383
- 100: "rgba(var(--starasia-ui-raw-color-red-100), 1)",
384
- 200: "rgba(var(--starasia-ui-raw-color-red-200), 1)",
385
- 300: "rgba(var(--starasia-ui-raw-color-red-300), 1)",
386
- 400: "rgba(var(--starasia-ui-raw-color-red-400), 1)",
387
- 500: "rgba(var(--starasia-ui-raw-color-red-500), 1)",
388
- 600: "rgba(var(--starasia-ui-raw-color-red-600), 1)",
389
- 700: "rgba(var(--starasia-ui-raw-color-red-700), 1)",
390
- 800: "rgba(var(--starasia-ui-raw-color-red-800), 1)",
391
- 900: "rgba(var(--starasia-ui-raw-color-red-900), 1)"
392
- },
393
- orange: {
394
- 50: "rgba(var(--starasia-ui-raw-color-orange-50), 1)",
395
- 100: "rgba(var(--starasia-ui-raw-color-orange-100), 1)",
396
- 200: "rgba(var(--starasia-ui-raw-color-orange-200), 1)",
397
- 300: "rgba(var(--starasia-ui-raw-color-orange-300), 1)",
398
- 400: "rgba(var(--starasia-ui-raw-color-orange-400), 1)",
399
- 500: "rgba(var(--starasia-ui-raw-color-orange-500), 1)",
400
- 600: "rgba(var(--starasia-ui-raw-color-orange-600), 1)",
401
- 700: "rgba(var(--starasia-ui-raw-color-orange-700), 1)",
402
- 800: "rgba(var(--starasia-ui-raw-color-orange-800), 1)",
403
- 900: "rgba(var(--starasia-ui-raw-color-orange-900), 1)"
404
- },
405
- aloha: {
406
- 50: "rgba(var(--starasia-ui-raw-color-aloha-50), 1)",
407
- 100: "rgba(var(--starasia-ui-raw-color-aloha-100), 1)",
408
- 200: "rgba(var(--starasia-ui-raw-color-aloha-200), 1)",
409
- 300: "rgba(var(--starasia-ui-raw-color-aloha-300), 1)",
410
- 400: "rgba(var(--starasia-ui-raw-color-aloha-400), 1)",
411
- 500: "rgba(var(--starasia-ui-raw-color-aloha-500), 1)",
412
- 600: "rgba(var(--starasia-ui-raw-color-aloha-600), 1)",
413
- 700: "rgba(var(--starasia-ui-raw-color-aloha-700), 1)",
414
- 800: "rgba(var(--starasia-ui-raw-color-aloha-800), 1)",
415
- 900: "rgba(var(--starasia-ui-raw-color-aloha-900), 1)"
416
- },
417
- green: {
418
- 50: "rgba(var(--starasia-ui-raw-color-green-50), 1)",
419
- 100: "rgba(var(--starasia-ui-raw-color-green-100), 1)",
420
- 200: "rgba(var(--starasia-ui-raw-color-green-200), 1)",
421
- 300: "rgba(var(--starasia-ui-raw-color-green-300), 1)",
422
- 400: "rgba(var(--starasia-ui-raw-color-green-400), 1)",
423
- 500: "rgba(var(--starasia-ui-raw-color-green-500), 1)",
424
- 600: "rgba(var(--starasia-ui-raw-color-green-600), 1)",
425
- 700: "rgba(var(--starasia-ui-raw-color-green-700), 1)",
426
- 800: "rgba(var(--starasia-ui-raw-color-green-800), 1)",
427
- 900: "rgba(var(--starasia-ui-raw-color-green-900), 1)"
428
- }
429
- },
430
- main: {
431
- primary: {
432
- "background-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
433
- "text-color": "rgb(255, 255, 255)",
434
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
435
- hover: {
436
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)",
437
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)",
438
- "text-color": "rgb(255, 255, 255)"
439
- },
440
- active: {
441
- "background-color": "rgb(var(--starasia-ui-raw-color-brand-active))",
442
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-active))",
443
- "text-color": "rgb(255, 255, 255)",
444
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"
445
- },
446
- disable: {
447
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.68)",
448
- "border-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.68)",
449
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
450
- }
451
- },
452
- secondary: {
453
- "background-color": "rgb(var(--starasia-ui-raw-color-gray-50))",
454
- "text-color": "rgb(72, 80, 76)",
455
- "border-color": "rgba(120, 134, 127, 0.2)",
456
- hover: {
457
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-100), 0.9)",
458
- "border-color": "rgba(120, 134, 127, 0.2)",
459
- "text-color": "rgb(72, 80, 76)",
460
- shadow: "0px 0px 0px -1px #f0f0f0"
461
- },
462
- active: {
463
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.1)",
464
- "border-color": "rgba(120, 134, 127, 0.2)",
465
- "text-color": "rgb(72, 80, 76)",
466
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-gray-200), 0.28), 0px 0px 0px -1px #f0f0f0"
467
- },
468
- disable: {
469
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.68)",
470
- "border-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.68)",
471
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
472
- }
473
- },
474
- tertiary: {
475
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.21)",
476
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
477
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.21)",
478
- hover: {
479
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.3)",
480
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.3)",
481
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
482
- shadow: "0px 0px 0px -1px #f0f0f0"
483
- },
484
- active: {
485
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.46)",
486
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.46)",
487
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
488
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"
489
- },
490
- disable: {
491
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.5)",
492
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.5)",
493
- "text-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.5)"
494
- }
495
- },
496
- quaternary: {
497
- "background-color": "rgba(255, 255, 255, 0)",
498
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
499
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
500
- hover: {
501
- "background-color": "rgba(255, 255, 255, 0)",
502
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)",
503
- "text-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)"
504
- },
505
- active: {
506
- "background-color": "rgb(255, 255, 255)",
507
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
508
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
509
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"
510
- },
511
- disable: {
512
- "background-color": "rgba(255, 255, 255, 0)",
513
- "border-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)",
514
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
515
- }
516
- },
517
- link: {
518
- "background-color": "rgba(255, 255, 255, 0)",
519
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
520
- "border-color": "rgba(255, 255, 255, 0)",
521
- hover: {
522
- "background-color": "rgba(255, 255, 255, 0)",
523
- "border-color": "rgba(255, 255, 255, 0)",
524
- "text-color": "rgba(var(--starasia-ui-raw-color-brand-active), 0.9)"
525
- },
526
- active: {
527
- "background-color": "rgba(255, 255, 255, 0)",
528
- "border-color": "rgba(255, 255, 255, 0)",
529
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))"
530
- },
531
- disable: {
532
- "background-color": "rgba(255, 255, 255, 0)",
533
- "border-color": "rgba(255, 255, 255, 0)",
534
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
535
- }
536
- },
537
- success: {
538
- "background-color": "rgb(var(--starasia-ui-raw-color-green-500))",
539
- "text-color": "rgb(255, 255, 255)",
540
- "border-color": "rgb(var(--starasia-ui-raw-color-green-500))",
541
- hover: {
542
- "background-color": "rgba(var(--starasia-ui-raw-color-green-500), 0.9)",
543
- "border-color": "rgba(var(--starasia-ui-raw-color-green-500), 0.9)",
544
- "text-color": "rgb(255, 255, 255)"
545
- },
546
- active: {
547
- "background-color": "rgba(var(--starasia-ui-raw-color-green-600), 0.75)",
548
- "border-color": "rgba(var(--starasia-ui-raw-color-green-600), 0.75)",
549
- "text-color": "rgb(255, 255, 255)",
550
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-green-800), 0.28)"
551
- },
552
- disable: {
553
- "background-color": "rgb(var(--starasia-ui-raw-color-gray-400))",
554
- "border-color": "rgb(var(--starasia-ui-raw-color-gray-400))",
555
- "text-color": "rgba(120, 134, 127, 0.62)"
556
- }
557
- },
558
- danger: {
559
- "background-color": "rgb(var(--starasia-ui-raw-color-red-600))",
560
- "text-color": "rgb(255, 255, 255)",
561
- "border-color": "rgb(var(--starasia-ui-raw-color-red-600))",
562
- hover: {
563
- "background-color": "rgba(var(--starasia-ui-raw-color-red-600), 0.9)",
564
- "border-color": "rgba(var(--starasia-ui-raw-color-red-600), 0.9)",
565
- "text-color": "rgb(255, 255, 255)"
566
- },
567
- active: {
568
- "background-color": "rgba(var(--starasia-ui-raw-color-red-800), 0.68)",
569
- "border-color": "rgba(var(--starasia-ui-raw-color-red-800), 0.68)",
570
- "text-color": "rgb(255, 255, 255)",
571
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-red-800), 0.28)"
572
- },
573
- disable: {
574
- "background-color": "rgb(var(--starasia-ui-raw-color-red-300))",
575
- "border-color": "rgb(var(--starasia-ui-raw-color-red-300))",
576
- "text-color": "rgba(201, 24, 74, 0.3)"
577
- }
578
- },
579
- warning: {
580
- "background-color": "rgb(var(--starasia-ui-raw-color-orange-600))",
581
- "text-color": "rgb(255, 255, 255)",
582
- "border-color": "rgb(var(--starasia-ui-raw-color-orange-600))",
583
- hover: {
584
- "background-color": "rgba(var(--starasia-ui-raw-color-orange-600), 0.9)",
585
- "border-color": "rgba(var(--starasia-ui-raw-color-orange-600), 0.9)",
586
- "text-color": "rgb(255, 255, 255)"
587
- },
588
- active: {
589
- "background-color": "rgba(var(--starasia-ui-raw-color-orange-800), 0.75)",
590
- "border-color": "rgba(var(--starasia-ui-raw-color-orange-800), 0.75)",
591
- "text-color": "rgb(255, 255, 255)",
592
- shadow: "0px 0px 0px 2px rgba(var(--starasia-ui-raw-color-orange-800), 0.28)"
593
- },
594
- disable: {
595
- "background-color": "rgb(var(--starasia-ui-raw-color-orange-300))",
596
- "border-color": "rgb(var(--starasia-ui-raw-color-orange-300))",
597
- "text-color": "rgb(var(--starasia-ui-raw-color-orange-600))"
598
- }
599
- }
600
- },
601
- brand: {
602
- primary: {
603
- default: "rgba(74, 106, 148, 1)",
604
- secondary: "rgba(144, 176, 218, 1)",
605
- tertiary: "rgba(227, 237, 248, 1)"
606
- },
607
- secondary: {
608
- default: "var(--starasia-ui-color-pink-700)",
609
- secondary: "var(--starasia-ui-color-pink-300)",
610
- tertiary: "var(--starasia-ui-color-pink-50)"
611
- }
612
- },
613
- text: {
614
- default: "var(--starasia-ui-color-gray-900)",
615
- secondary: "var(--starasia-ui-color-gray-700)",
616
- tertiary: "var(--starasia-ui-color-gray-500)",
617
- disable: "var(--starasia-ui-color-gray-200)",
618
- white: "var(--starasia-ui-color-white-900)"
619
- },
620
- utility: {
621
- success: {
622
- default: "var(--starasia-ui-color-green-600)",
623
- secondary: "var(--starasia-ui-color-green-200)",
624
- tertiary: "var(--starasia-ui-color-green-50)"
625
- },
626
- danger: {
627
- default: "var(--starasia-ui-color-red-600)",
628
- secondary: "var(--starasia-ui-color-red-200)",
629
- tertiary: "var(--starasia-ui-color-red-50)"
630
- },
631
- warning: {
632
- default: "var(--starasia-ui-color-orange-600)",
633
- secondary: "var(--starasia-ui-color-orange-200)",
634
- tertiary: "var(--starasia-ui-color-orange-50)"
635
- },
636
- information: {
637
- default: "var(--starasia-ui-color-blue-600)",
638
- secondary: "var(--starasia-ui-color-blue-200)",
639
- tertiary: "var(--starasia-ui-color-blue-50)"
640
- },
641
- dark: {
642
- default: "var(--starasia-ui-color-gray-600)",
643
- secondary: "var(--starasia-ui-color-gray-200)",
644
- tertiary: "var(--starasia-ui-color-gray-50)"
645
- },
646
- fill: {
647
- default: "rgba(120, 134, 127, 0.2)",
648
- secondary: "rgba(120, 134, 127, 0.16)",
649
- tertiary: "rgba(120, 134, 127, 0.1)"
303
+ default: "4, 37, 79",
304
+ active: "2, 19, 43",
305
+ secondary: "153, 179, 219",
306
+ tertiary: "230, 237, 246"
650
307
  }
651
308
  }
652
- }, q = {
309
+ }, K = {
653
310
  radii: {
654
311
  none: "0",
655
312
  xs: "0.25rem",
@@ -696,18 +353,18 @@ const _ = {
696
353
  "3xl": "4rem"
697
354
  },
698
355
  border: {
699
- default: "1px solid var(--starasia-ui-color-border)"
356
+ default: "1px solid var(--sa-border-subtle, #0b120e24)"
700
357
  },
701
358
  shadows: {
702
- sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
703
- md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
704
- lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
705
- xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
706
- "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
707
- inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
708
- card: "0px 4px 35px 0px rgba(112, 144, 176, 0.25)"
359
+ sm: "0 1px 2px 0 #0000000d",
360
+ md: "0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
361
+ lg: "0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a",
362
+ xl: "0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a",
363
+ "2xl": "0 25px 50px -12px #00000040",
364
+ inner: "inset 0 2px 4px 0 #0000000d",
365
+ card: "0px 4px 35px 0px #7090b040"
709
366
  }
710
- }, z = {
367
+ }, R = {
711
368
  fontSizes: {
712
369
  xs: "0.625rem",
713
370
  sm: "0.75rem",
@@ -747,64 +404,64 @@ const _ = {
747
404
  relaxed: 1.625,
748
405
  loose: 2
749
406
  }
750
- }, A = {
751
- colors: _,
752
- metrics: q,
753
- font: z
754
- }, v = A, C = (r, a) => {
755
- const o = {};
407
+ }, U = {
408
+ colors: I,
409
+ metrics: K,
410
+ font: R
411
+ }, m = U, v = (r, o) => {
412
+ const t = {};
756
413
  return Object.keys(r).forEach((s) => {
757
414
  if (r != null && r[s] && typeof (r == null ? void 0 : r[s]) == "object") {
758
- o[s] = {
415
+ t[s] = {
759
416
  ...r == null ? void 0 : r[s],
760
- ...a == null ? void 0 : a[s],
761
- ...C(r == null ? void 0 : r[s], a == null ? void 0 : a[s])
417
+ ...o == null ? void 0 : o[s],
418
+ ...v(r == null ? void 0 : r[s], o == null ? void 0 : o[s])
762
419
  };
763
420
  return;
764
421
  }
765
- o[s] = (a == null ? void 0 : a[s]) || (r == null ? void 0 : r[s]);
766
- }), o;
422
+ t[s] = (o == null ? void 0 : o[s]) || (r == null ? void 0 : r[s]);
423
+ }), t;
767
424
  };
768
- function d() {
769
- const r = P(k), a = $(
425
+ function x() {
426
+ const r = N(j), o = y(
770
427
  () => ({
771
- ...v,
428
+ ...m,
772
429
  ...r.theme,
773
- ...C(v, r.theme)
430
+ ...v(m, r.theme)
774
431
  }),
775
- [r.theme, v]
432
+ [r.theme, m]
776
433
  );
777
- return { ...r, theme: a };
434
+ return { ...r, theme: o };
778
435
  }
779
- function U() {
780
- const { theme: r } = d();
436
+ function G() {
437
+ const { theme: r } = x();
781
438
  return r.colors;
782
439
  }
783
- function W() {
784
- var a;
785
- const { theme: r } = d();
786
- return (a = r.metrics) == null ? void 0 : a.spacing;
440
+ function Q() {
441
+ var o;
442
+ const { theme: r } = x();
443
+ return (o = r.metrics) == null ? void 0 : o.spacing;
787
444
  }
788
- function Y() {
789
- var a;
790
- const { theme: r } = d();
791
- return (a = r.metrics) == null ? void 0 : a.radii;
445
+ function X() {
446
+ var o;
447
+ const { theme: r } = x();
448
+ return (o = r.metrics) == null ? void 0 : o.radii;
792
449
  }
793
- function G() {
794
- var a;
795
- const { theme: r } = d();
796
- return (a = r == null ? void 0 : r.metrics) == null ? void 0 : a.shadows;
450
+ function Z() {
451
+ var o;
452
+ const { theme: r } = x();
453
+ return (o = r == null ? void 0 : r.metrics) == null ? void 0 : o.shadows;
797
454
  }
798
- function Q(r) {
455
+ function k(r) {
799
456
  return r;
800
457
  }
801
458
  export {
802
- k as ThemeContext,
803
- R as ThemeProvider,
804
- Q as createTheme,
805
- U as useColor,
806
- Y as useRadius,
807
- G as useShadow,
808
- W as useSpacing,
809
- d as useTheme
459
+ j as ThemeContext,
460
+ q as ThemeProvider,
461
+ k as createTheme,
462
+ G as useColor,
463
+ X as useRadius,
464
+ Z as useShadow,
465
+ Q as useSpacing,
466
+ x as useTheme
810
467
  };