@starasia/theme 1.0.4 → 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,195 +1,213 @@
1
- import { jsx as C } 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 b = `${e}${l}-${c}-${t}`;
36
- o += `--${b}: ${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 b = `${e}${t}-${c}`;
40
- o += `--${b}: ${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 b = c[l], n = `${a}-`;
49
+ for (const i in c) {
50
+ const l = c[i], u = `${o}-`;
51
51
  s(
52
- e,
53
- b,
52
+ a,
53
+ l,
54
+ u,
54
55
  n,
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], b = `--${e}-${t}-${c}`;
73
- o += `${b}: ${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 D(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
117
  const J = (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;
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 B(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 n, v, d, w, p, x;
140
+ function V(r) {
141
+ var u, $, p, f, b, d;
142
142
  if (!r)
143
143
  return;
144
- const a = (n = r.colors) != null && n.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 = (v = r.colors) != null && v.computed ? f(
147
+ ) : "", t = ($ = r.colors) != null && $.computed ? C(
148
148
  r.colors.computed,
149
149
  "starasia-ui-color"
150
- ) : "", s = (d = r.colors) != null && d.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 ? D(
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") : "", b = r.components ? B(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
- ${b}
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 K({ value: r, children: a }) {
177
- const [o, s] = j(r), t = $(
178
- () => o ? JSON.stringify(o) : "",
179
- [o]
180
- ), i = O(J(L));
181
- E(() => {
182
- if (t) {
183
- const c = H(JSON.parse(t));
184
- c && (i != null && i.current) && (i.current.textContent = c);
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) {
181
+ if (!r)
182
+ return "";
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(`
187
+ `);
188
+ return t ? `:root {
189
+ ${t}
190
+ }` : "";
191
+ }
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(`
201
+ `);
202
+ p && (e != null && e.current) && (e.current.textContent = p);
185
203
  }
186
- }, [t]);
187
- const e = (c) => {
204
+ }, [n]);
205
+ const a = (c) => {
188
206
  c && s(c);
189
207
  };
190
- return /* @__PURE__ */ C(k.Provider, { value: { theme: o, setTheme: e }, children: a });
208
+ return /* @__PURE__ */ w(j.Provider, { value: { theme: t, setTheme: a }, children: o });
191
209
  }
192
- const V = {
210
+ const I = {
193
211
  raw: {
194
212
  white: {
195
213
  900: "255, 255, 255"
@@ -198,16 +216,16 @@ const V = {
198
216
  900: "0, 0, 0"
199
217
  },
200
218
  blue: {
201
- 50: "227, 242, 253",
202
- 100: "187, 222, 251",
203
- 200: "144, 202, 249",
204
- 300: "100, 181, 246",
205
- 400: "66, 165, 245",
206
- 500: "33, 150, 243",
207
- 600: "30, 136, 229",
208
- 700: "25, 118, 210",
209
- 800: "21, 101, 192",
210
- 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"
211
229
  },
212
230
  pink: {
213
231
  50: "251, 219, 241",
@@ -222,412 +240,73 @@ const V = {
222
240
  900: "107, 9, 78"
223
241
  },
224
242
  purple: {
225
- 50: "233, 222, 245",
226
- 100: "212, 189, 235",
227
- 200: "190, 156, 226",
228
- 300: "169, 123, 216",
229
- 400: "147, 90, 207",
230
- 500: "126, 57, 197",
231
- 600: "105, 47, 164",
232
- 700: "84, 38, 131",
233
- 800: "63, 28, 98",
234
- 900: "42, 19, 65"
235
- },
236
- gray: {
237
- 50: "255, 254, 255",
238
- 100: "239, 243, 248",
239
- 200: "201, 206, 204",
240
- 300: "174, 182, 178",
241
- 400: "147, 158, 153",
242
- 500: "120, 134, 127",
243
- 600: "96, 107, 102",
244
- 700: "72, 80, 76",
245
- 800: "48, 53, 51",
246
- 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"
247
253
  },
248
254
  red: {
249
- 50: "255, 240, 243",
250
- 100: "255, 204, 213",
251
- 200: "255, 179, 193",
252
- 300: "255, 143, 163",
253
- 400: "255, 117, 143",
254
- 500: "255, 77, 109",
255
- 600: "201, 24, 74",
256
- 700: "164, 19, 60",
257
- 800: "128, 15, 47",
258
- 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"
259
265
  },
260
266
  orange: {
261
- 50: "250, 246, 224",
262
- 100: "255, 245, 193",
263
- 200: "255, 225, 139",
264
- 300: "255, 203, 105",
265
- 400: "234, 183, 84",
266
- 500: "210, 160, 58",
267
- 600: "179, 130, 10",
268
- 700: "152, 104, 0",
269
- 800: "126, 80, 0",
270
- 900: "97, 52, 0"
271
- },
272
- aloha: {
273
- 50: "219, 247, 242",
274
- 100: "184, 240, 230",
275
- 200: "149, 232, 218",
276
- 300: "114, 225, 206",
277
- 400: "79, 218, 194",
278
- 500: "44, 210, 182",
279
- 600: "36, 175, 152",
280
- 700: "29, 140, 121",
281
- 800: "22, 105, 91",
282
- 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"
283
289
  },
284
290
  green: {
285
- 50: "220, 246, 234",
286
- 100: "186, 238, 214",
287
- 200: "151, 230, 193",
288
- 300: "117, 222, 173",
289
- 400: "82, 214, 152",
290
- 500: "48, 206, 132",
291
- 600: "40, 172, 110",
292
- 700: "32, 137, 88",
293
- 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",
294
300
  900: "16, 68, 44"
295
301
  },
296
302
  brand: {
297
- default: "74, 106, 148",
298
- active: "57, 82, 116",
299
- secondary: "144, 176, 218",
300
- tertiary: "227, 237, 248"
301
- }
302
- },
303
- computed: {
304
- white: {
305
- 900: "rgba(var(--starasia-ui-raw-color-white-900), 1)",
306
- "": "rgba(var(--starasia-ui-raw-color-gray-50), 1)"
307
- },
308
- black: {
309
- 900: "rgba(var(--starasia-ui-raw-color-black-900), 1)"
310
- },
311
- blue: {
312
- 50: "rgba(var(--starasia-ui-raw-color-blue-50), 1)",
313
- 100: "rgba(var(--starasia-ui-raw-color-blue-100), 1)",
314
- 200: "rgba(var(--starasia-ui-raw-color-blue-200), 1)",
315
- 300: "rgba(var(--starasia-ui-raw-color-blue-300), 1)",
316
- 400: "rgba(var(--starasia-ui-raw-color-blue-400), 1)",
317
- 500: "rgba(var(--starasia-ui-raw-color-blue-500), 1)",
318
- 600: "rgba(var(--starasia-ui-raw-color-blue-600), 1)",
319
- 700: "rgba(var(--starasia-ui-raw-color-blue-700), 1)",
320
- 800: "rgba(var(--starasia-ui-raw-color-blue-800), 1)",
321
- 900: "rgba(var(--starasia-ui-raw-color-blue-900), 1)"
322
- },
323
- pink: {
324
- 50: "rgba(var(--starasia-ui-raw-color-pink-50), 1)",
325
- 100: "rgba(var(--starasia-ui-raw-color-pink-100), 1)",
326
- 200: "rgba(var(--starasia-ui-raw-color-pink-200), 1)",
327
- 300: "rgba(var(--starasia-ui-raw-color-pink-300), 1)",
328
- 400: "rgba(var(--starasia-ui-raw-color-pink-400), 1)",
329
- 500: "rgba(var(--starasia-ui-raw-color-pink-500), 1)",
330
- 600: "rgba(var(--starasia-ui-raw-color-pink-600), 1)",
331
- 700: "rgba(var(--starasia-ui-raw-color-pink-700), 1)",
332
- 800: "rgba(var(--starasia-ui-raw-color-pink-800), 1)",
333
- 900: "rgba(var(--starasia-ui-raw-color-pink-900), 1)"
334
- },
335
- purple: {
336
- 50: "rgba(var(--starasia-ui-raw-color-purple-50), 1)",
337
- 100: "rgba(var(--starasia-ui-raw-color-purple-100), 1)",
338
- 200: "rgba(var(--starasia-ui-raw-color-purple-200), 1)",
339
- 300: "rgba(var(--starasia-ui-raw-color-purple-300), 1)",
340
- 400: "rgba(var(--starasia-ui-raw-color-purple-400), 1)",
341
- 500: "rgba(var(--starasia-ui-raw-color-purple-500), 1)",
342
- 600: "rgba(var(--starasia-ui-raw-color-purple-600), 1)",
343
- 700: "rgba(var(--starasia-ui-raw-color-purple-700), 1)",
344
- 800: "rgba(var(--starasia-ui-raw-color-purple-800), 1)",
345
- 900: "rgba(var(--starasia-ui-raw-color-purple-900), 1)"
346
- },
347
- gray: {
348
- 50: "rgba(var(--starasia-ui-raw-color-gray-50), 1)",
349
- 100: "rgba(var(--starasia-ui-raw-color-gray-100), 1)",
350
- 200: "rgba(var(--starasia-ui-raw-color-gray-200), 1)",
351
- 300: "rgba(var(--starasia-ui-raw-color-gray-300), 1)",
352
- 400: "rgba(var(--starasia-ui-raw-color-gray-400), 1)",
353
- 500: "rgba(var(--starasia-ui-raw-color-gray-500), 1)",
354
- 600: "rgba(var(--starasia-ui-raw-color-gray-600), 1)",
355
- 700: "rgba(var(--starasia-ui-raw-color-gray-700), 1)",
356
- 800: "rgba(var(--starasia-ui-raw-color-gray-800), 1)",
357
- 900: "rgba(var(--starasia-ui-raw-color-gray-900), 1)"
358
- },
359
- red: {
360
- 50: "rgba(var(--starasia-ui-raw-color-red-50), 1)",
361
- 100: "rgba(var(--starasia-ui-raw-color-red-100), 1)",
362
- 200: "rgba(var(--starasia-ui-raw-color-red-200), 1)",
363
- 300: "rgba(var(--starasia-ui-raw-color-red-300), 1)",
364
- 400: "rgba(var(--starasia-ui-raw-color-red-400), 1)",
365
- 500: "rgba(var(--starasia-ui-raw-color-red-500), 1)",
366
- 600: "rgba(var(--starasia-ui-raw-color-red-600), 1)",
367
- 700: "rgba(var(--starasia-ui-raw-color-red-700), 1)",
368
- 800: "rgba(var(--starasia-ui-raw-color-red-800), 1)",
369
- 900: "rgba(var(--starasia-ui-raw-color-red-900), 1)"
370
- },
371
- orange: {
372
- 50: "rgba(var(--starasia-ui-raw-color-orange-50), 1)",
373
- 100: "rgba(var(--starasia-ui-raw-color-orange-100), 1)",
374
- 200: "rgba(var(--starasia-ui-raw-color-orange-200), 1)",
375
- 300: "rgba(var(--starasia-ui-raw-color-orange-300), 1)",
376
- 400: "rgba(var(--starasia-ui-raw-color-orange-400), 1)",
377
- 500: "rgba(var(--starasia-ui-raw-color-orange-500), 1)",
378
- 600: "rgba(var(--starasia-ui-raw-color-orange-600), 1)",
379
- 700: "rgba(var(--starasia-ui-raw-color-orange-700), 1)",
380
- 800: "rgba(var(--starasia-ui-raw-color-orange-800), 1)",
381
- 900: "rgba(var(--starasia-ui-raw-color-orange-900), 1)"
382
- },
383
- aloha: {
384
- 50: "rgba(var(--starasia-ui-raw-color-aloha-50), 1)",
385
- 100: "rgba(var(--starasia-ui-raw-color-aloha-100), 1)",
386
- 200: "rgba(var(--starasia-ui-raw-color-aloha-200), 1)",
387
- 300: "rgba(var(--starasia-ui-raw-color-aloha-300), 1)",
388
- 400: "rgba(var(--starasia-ui-raw-color-aloha-400), 1)",
389
- 500: "rgba(var(--starasia-ui-raw-color-aloha-500), 1)",
390
- 600: "rgba(var(--starasia-ui-raw-color-aloha-600), 1)",
391
- 700: "rgba(var(--starasia-ui-raw-color-aloha-700), 1)",
392
- 800: "rgba(var(--starasia-ui-raw-color-aloha-800), 1)",
393
- 900: "rgba(var(--starasia-ui-raw-color-aloha-900), 1)"
394
- },
395
- green: {
396
- 50: "rgba(var(--starasia-ui-raw-color-green-50), 1)",
397
- 100: "rgba(var(--starasia-ui-raw-color-green-100), 1)",
398
- 200: "rgba(var(--starasia-ui-raw-color-green-200), 1)",
399
- 300: "rgba(var(--starasia-ui-raw-color-green-300), 1)",
400
- 400: "rgba(var(--starasia-ui-raw-color-green-400), 1)",
401
- 500: "rgba(var(--starasia-ui-raw-color-green-500), 1)",
402
- 600: "rgba(var(--starasia-ui-raw-color-green-600), 1)",
403
- 700: "rgba(var(--starasia-ui-raw-color-green-700), 1)",
404
- 800: "rgba(var(--starasia-ui-raw-color-green-800), 1)",
405
- 900: "rgba(var(--starasia-ui-raw-color-green-900), 1)"
406
- }
407
- },
408
- main: {
409
- primary: {
410
- "background-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
411
- "text-color": "rgb(255, 255, 255)",
412
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
413
- hover: {
414
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)",
415
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)",
416
- "text-color": "rgb(255, 255, 255)"
417
- },
418
- active: {
419
- "background-color": "rgb(var(--starasia-ui-raw-color-brand-active))",
420
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-active))",
421
- "text-color": "rgb(255, 255, 255)",
422
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"
423
- },
424
- disable: {
425
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.68)",
426
- "border-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.68)",
427
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
428
- }
429
- },
430
- secondary: {
431
- "background-color": "rgb(var(--starasia-ui-raw-color-gray-50))",
432
- "text-color": "rgb(72, 80, 76)",
433
- "border-color": "rgba(120, 134, 127, 0.2)",
434
- hover: {
435
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-100), 0.9)",
436
- "border-color": "rgba(120, 134, 127, 0.2)",
437
- "text-color": "rgb(72, 80, 76)",
438
- shadow: "0px 0px 0px -1px #f0f0f0"
439
- },
440
- active: {
441
- "background-color": "rgba(var(--starasia-ui-raw-color-gray-200), 0.1)",
442
- "border-color": "rgba(120, 134, 127, 0.2)",
443
- "text-color": "rgb(72, 80, 76)",
444
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-gray-200), 0.28), 0px 0px 0px -1px #f0f0f0"
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
- tertiary: {
453
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.21)",
454
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
455
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.21)",
456
- hover: {
457
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.3)",
458
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.3)",
459
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
460
- shadow: "0px 0px 0px -1px #f0f0f0"
461
- },
462
- active: {
463
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.46)",
464
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.46)",
465
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
466
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"
467
- },
468
- disable: {
469
- "background-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.5)",
470
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-secondary), 0.5)",
471
- "text-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.5)"
472
- }
473
- },
474
- quaternary: {
475
- "background-color": "rgba(255, 255, 255, 0)",
476
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
477
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
478
- hover: {
479
- "background-color": "rgba(255, 255, 255, 0)",
480
- "border-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)",
481
- "text-color": "rgba(var(--starasia-ui-raw-color-brand-default), 0.9)"
482
- },
483
- active: {
484
- "background-color": "rgb(255, 255, 255)",
485
- "border-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
486
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
487
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"
488
- },
489
- disable: {
490
- "background-color": "rgba(255, 255, 255, 0)",
491
- "border-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)",
492
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
493
- }
494
- },
495
- link: {
496
- "background-color": "rgba(255, 255, 255, 0)",
497
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))",
498
- "border-color": "rgba(255, 255, 255, 0)",
499
- hover: {
500
- "background-color": "rgba(255, 255, 255, 0)",
501
- "border-color": "rgba(255, 255, 255, 0)",
502
- "text-color": "rgba(var(--starasia-ui-raw-color-brand-active), 0.9)"
503
- },
504
- active: {
505
- "background-color": "rgba(255, 255, 255, 0)",
506
- "border-color": "rgba(255, 255, 255, 0)",
507
- "text-color": "rgb(var(--starasia-ui-raw-color-brand-default))"
508
- },
509
- disable: {
510
- "background-color": "rgba(255, 255, 255, 0)",
511
- "border-color": "rgba(255, 255, 255, 0)",
512
- "text-color": "rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"
513
- }
514
- },
515
- success: {
516
- "background-color": "rgb(var(--starasia-ui-raw-color-green-500))",
517
- "text-color": "rgb(255, 255, 255)",
518
- "border-color": "rgb(var(--starasia-ui-raw-color-green-500))",
519
- hover: {
520
- "background-color": "rgba(var(--starasia-ui-raw-color-green-500), 0.9)",
521
- "border-color": "rgba(var(--starasia-ui-raw-color-green-500), 0.9)",
522
- "text-color": "rgb(255, 255, 255)"
523
- },
524
- active: {
525
- "background-color": "rgba(var(--starasia-ui-raw-color-green-600), 0.75)",
526
- "border-color": "rgba(var(--starasia-ui-raw-color-green-600), 0.75)",
527
- "text-color": "rgb(255, 255, 255)",
528
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-green-800), 0.28)"
529
- },
530
- disable: {
531
- "background-color": "rgb(var(--starasia-ui-raw-color-gray-400))",
532
- "border-color": "rgb(var(--starasia-ui-raw-color-gray-400))",
533
- "text-color": "rgba(120, 134, 127, 0.62)"
534
- }
535
- },
536
- danger: {
537
- "background-color": "rgb(var(--starasia-ui-raw-color-red-600))",
538
- "text-color": "rgb(255, 255, 255)",
539
- "border-color": "rgb(var(--starasia-ui-raw-color-red-600))",
540
- hover: {
541
- "background-color": "rgba(var(--starasia-ui-raw-color-red-600), 0.9)",
542
- "border-color": "rgba(var(--starasia-ui-raw-color-red-600), 0.9)",
543
- "text-color": "rgb(255, 255, 255)"
544
- },
545
- active: {
546
- "background-color": "rgba(var(--starasia-ui-raw-color-red-800), 0.68)",
547
- "border-color": "rgba(var(--starasia-ui-raw-color-red-800), 0.68)",
548
- "text-color": "rgb(255, 255, 255)",
549
- shadow: "0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-red-800), 0.28)"
550
- },
551
- disable: {
552
- "background-color": "rgb(var(--starasia-ui-raw-color-red-300))",
553
- "border-color": "rgb(var(--starasia-ui-raw-color-red-300))",
554
- "text-color": "rgba(201, 24, 74, 0.3)"
555
- }
556
- },
557
- warning: {
558
- "background-color": "rgb(var(--starasia-ui-raw-color-orange-600))",
559
- "text-color": "rgb(255, 255, 255)",
560
- "border-color": "rgb(var(--starasia-ui-raw-color-orange-600))",
561
- hover: {
562
- "background-color": "rgba(var(--starasia-ui-raw-color-orange-600), 0.9)",
563
- "border-color": "rgba(var(--starasia-ui-raw-color-orange-600), 0.9)",
564
- "text-color": "rgb(255, 255, 255)"
565
- },
566
- active: {
567
- "background-color": "rgba(var(--starasia-ui-raw-color-orange-800), 0.75)",
568
- "border-color": "rgba(var(--starasia-ui-raw-color-orange-800), 0.75)",
569
- "text-color": "rgb(255, 255, 255)",
570
- shadow: "0px 0px 0px 2px rgba(var(--starasia-ui-raw-color-orange-800), 0.28)"
571
- },
572
- disable: {
573
- "background-color": "rgb(var(--starasia-ui-raw-color-orange-300))",
574
- "border-color": "rgb(var(--starasia-ui-raw-color-orange-300))",
575
- "text-color": "rgb(var(--starasia-ui-raw-color-orange-600))"
576
- }
577
- }
578
- },
579
- brand: {
580
- primary: {
581
- default: "rgba(74, 106, 148, 1)",
582
- secondary: "rgba(144, 176, 218, 1)",
583
- tertiary: "rgba(227, 237, 248, 1)"
584
- },
585
- secondary: {
586
- default: "var(--starasia-ui-color-pink-700)",
587
- secondary: "var(--starasia-ui-color-pink-300)",
588
- tertiary: "var(--starasia-ui-color-pink-50)"
589
- }
590
- },
591
- text: {
592
- default: "var(--starasia-ui-color-gray-900)",
593
- secondary: "var(--starasia-ui-color-gray-700)",
594
- tertiary: "var(--starasia-ui-color-gray-500)",
595
- disable: "var(--starasia-ui-color-gray-200)",
596
- white: "var(--starasia-ui-color-white-900)"
597
- },
598
- utility: {
599
- success: {
600
- default: "var(--starasia-ui-color-green-600)",
601
- secondary: "var(--starasia-ui-color-green-200)",
602
- tertiary: "var(--starasia-ui-color-green-50)"
603
- },
604
- danger: {
605
- default: "var(--starasia-ui-color-red-600)",
606
- secondary: "var(--starasia-ui-color-red-200)",
607
- tertiary: "var(--starasia-ui-color-red-50)"
608
- },
609
- warning: {
610
- default: "var(--starasia-ui-color-orange-600)",
611
- secondary: "var(--starasia-ui-color-orange-200)",
612
- tertiary: "var(--starasia-ui-color-orange-50)"
613
- },
614
- information: {
615
- default: "var(--starasia-ui-color-blue-600)",
616
- secondary: "var(--starasia-ui-color-blue-200)",
617
- tertiary: "var(--starasia-ui-color-blue-50)"
618
- },
619
- dark: {
620
- default: "var(--starasia-ui-color-gray-600)",
621
- secondary: "var(--starasia-ui-color-gray-200)",
622
- tertiary: "var(--starasia-ui-color-gray-50)"
623
- },
624
- fill: {
625
- default: "rgba(120, 134, 127, 0.2)",
626
- secondary: "rgba(120, 134, 127, 0.16)",
627
- 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"
628
307
  }
629
308
  }
630
- }, _ = {
309
+ }, K = {
631
310
  radii: {
632
311
  none: "0",
633
312
  xs: "0.25rem",
@@ -674,18 +353,18 @@ const V = {
674
353
  "3xl": "4rem"
675
354
  },
676
355
  border: {
677
- default: "1px solid var(--starasia-ui-color-border)"
356
+ default: "1px solid var(--sa-border-subtle, #0b120e24)"
678
357
  },
679
358
  shadows: {
680
- sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
681
- md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
682
- lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
683
- xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
684
- "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
685
- inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
686
- 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"
687
366
  }
688
- }, q = {
367
+ }, R = {
689
368
  fontSizes: {
690
369
  xs: "0.625rem",
691
370
  sm: "0.75rem",
@@ -725,64 +404,64 @@ const V = {
725
404
  relaxed: 1.625,
726
405
  loose: 2
727
406
  }
728
- }, z = {
729
- colors: V,
730
- metrics: _,
731
- font: q
732
- }, u = z, S = (r, a) => {
733
- const o = {};
407
+ }, U = {
408
+ colors: I,
409
+ metrics: K,
410
+ font: R
411
+ }, m = U, v = (r, o) => {
412
+ const t = {};
734
413
  return Object.keys(r).forEach((s) => {
735
414
  if (r != null && r[s] && typeof (r == null ? void 0 : r[s]) == "object") {
736
- o[s] = {
415
+ t[s] = {
737
416
  ...r == null ? void 0 : r[s],
738
- ...a == null ? void 0 : a[s],
739
- ...S(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])
740
419
  };
741
420
  return;
742
421
  }
743
- o[s] = (a == null ? void 0 : a[s]) || (r == null ? void 0 : r[s]);
744
- }), o;
422
+ t[s] = (o == null ? void 0 : o[s]) || (r == null ? void 0 : r[s]);
423
+ }), t;
745
424
  };
746
- function g() {
747
- const r = P(k), a = $(
425
+ function x() {
426
+ const r = N(j), o = y(
748
427
  () => ({
749
- ...u,
428
+ ...m,
750
429
  ...r.theme,
751
- ...S(u, r.theme)
430
+ ...v(m, r.theme)
752
431
  }),
753
- [r.theme, u]
432
+ [r.theme, m]
754
433
  );
755
- return { ...r, theme: a };
434
+ return { ...r, theme: o };
756
435
  }
757
- function R() {
758
- const { theme: r } = g();
436
+ function G() {
437
+ const { theme: r } = x();
759
438
  return r.colors;
760
439
  }
761
- function U() {
762
- var a;
763
- const { theme: r } = g();
764
- 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;
765
444
  }
766
- function W() {
767
- var a;
768
- const { theme: r } = g();
769
- 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;
770
449
  }
771
- function Y() {
772
- var a;
773
- const { theme: r } = g();
774
- 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;
775
454
  }
776
- function G(r) {
455
+ function k(r) {
777
456
  return r;
778
457
  }
779
458
  export {
780
- k as ThemeContext,
781
- K as ThemeProvider,
782
- G as createTheme,
783
- R as useColor,
784
- W as useRadius,
785
- Y as useShadow,
786
- U as useSpacing,
787
- g 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
788
467
  };