@directus/themes 0.2.0 → 0.3.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.js CHANGED
@@ -1,173 +1,321 @@
1
- import { Type as e } from "@sinclair/typebox";
2
- import { defineStore as C, storeToRefs as j } from "pinia";
3
- import { reactive as H, computed as h, unref as c, defineComponent as W, toRefs as O, openBlock as B, createBlock as $, Teleport as L, createTextVNode as T, toDisplayString as D } from "vue";
4
- import { merge as R, get as M, mapKeys as _ } from "lodash-es";
5
- import { useHead as N } from "@unhead/vue";
6
- import I from "decamelize";
7
- import { flatten as P } from "flat";
8
- const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e.String({ $id: "Length" }), A = e.String({ $id: "Percentage" }), y = e.String({ $id: "BoxShadow" }), g = e.Union([e.String(), e.Literal("thin"), e.Literal("medium"), e.Literal("thick")], {
1
+ import { computed as v, unref as i, reactive as B, defineComponent as $, toRefs as D, openBlock as T, createBlock as L, Teleport as G, createTextVNode as N, toDisplayString as M } from "vue";
2
+ import { useHead as E } from "@unhead/vue";
3
+ import { get as W, merge as S, mapKeys as U } from "lodash-es";
4
+ import { defineStore as _, storeToRefs as I } from "pinia";
5
+ import P from "decamelize";
6
+ import { flatten as V } from "flat";
7
+ import { cssVar as z } from "@directus/utils/browser";
8
+ import { Type as r } from "@sinclair/typebox";
9
+ const e = r.String({ $id: "Color" }), u = r.String({ $id: "FamilyName" }), F = r.String({ $id: "FontWeight" }), k = r.String({ $id: "Length" }), O = r.String({ $id: "Percentage" }), y = r.String({ $id: "BoxShadow" }), j = r.String({ $id: "Number" }), H = r.String({ $id: "Size" }), b = r.Union([r.String(), r.Literal("thin"), r.Literal("medium"), r.Literal("thick")], {
9
10
  $id: "LineWidth"
10
- }), U = e.Object({
11
+ }), w = r.Optional(
12
+ r.Object({
13
+ columnGap: r.Optional(r.Union([r.Ref(k), r.Ref(O)])),
14
+ rowGap: r.Optional(r.Union([r.Ref(k), r.Ref(O)])),
15
+ field: r.Optional(
16
+ r.Object({
17
+ label: r.Optional(
18
+ r.Object({
19
+ foreground: r.Optional(r.Ref(e)),
20
+ fontFamily: r.Optional(r.Ref(u)),
21
+ fontWeight: r.Optional(r.Ref(F))
22
+ })
23
+ ),
24
+ input: r.Optional(
25
+ r.Object({
26
+ background: r.Optional(r.Ref(e)),
27
+ backgroundSubdued: r.Optional(r.Ref(e)),
28
+ foreground: r.Optional(r.Ref(e)),
29
+ foregroundSubdued: r.Optional(r.Ref(e)),
30
+ borderColor: r.Optional(r.Ref(e)),
31
+ borderColorHover: r.Optional(r.Ref(e)),
32
+ borderColorFocus: r.Optional(r.Ref(e)),
33
+ boxShadow: r.Optional(r.Ref(y)),
34
+ boxShadowHover: r.Optional(r.Ref(y)),
35
+ boxShadowFocus: r.Optional(r.Ref(y)),
36
+ height: r.Optional(r.Ref(H)),
37
+ padding: r.Optional(r.Union([r.Ref(k), r.Ref(O)]))
38
+ })
39
+ )
40
+ })
41
+ )
42
+ })
43
+ ), K = r.Object({
44
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////
45
+ // Base border styles
46
+ borderRadius: r.Optional(r.Union([r.Ref(k), r.Ref(O)])),
47
+ borderWidth: r.Optional(r.Ref(b)),
11
48
  //////////////////////////////////////////////////////////////////////////////////////////////////////////
12
49
  // Base color palette
13
- foreground: e.Ref(r),
14
- foregroundSubdued: e.Ref(r),
15
- foregroundAccent: e.Ref(r),
16
- background: e.Ref(r),
17
- primary: e.Ref(r),
18
- primaryBackground: e.Ref(r),
19
- primarySubdued: e.Ref(r),
20
- primaryAccent: e.Ref(r),
21
- secondary: e.Ref(r),
22
- secondaryBackground: e.Ref(r),
23
- secondarySubdued: e.Ref(r),
24
- secondaryAccent: e.Ref(r),
25
- success: e.Ref(r),
26
- successBackground: e.Ref(r),
27
- successSubdued: e.Ref(r),
28
- successAccent: e.Ref(r),
29
- warning: e.Ref(r),
30
- warningBackground: e.Ref(r),
31
- warningSubdued: e.Ref(r),
32
- warningAccent: e.Ref(r),
33
- danger: e.Ref(r),
34
- dangerBackground: e.Ref(r),
35
- dangerSubdued: e.Ref(r),
36
- dangerAccent: e.Ref(r),
50
+ foreground: r.Optional(r.Ref(e)),
51
+ foregroundSubdued: r.Optional(r.Ref(e)),
52
+ foregroundAccent: r.Optional(r.Ref(e)),
53
+ background: r.Optional(r.Ref(e)),
54
+ backgroundNormal: r.Optional(r.Ref(e)),
55
+ backgroundAccent: r.Optional(r.Ref(e)),
56
+ backgroundSubdued: r.Optional(r.Ref(e)),
57
+ borderColor: r.Optional(r.Ref(e)),
58
+ borderColorAccent: r.Optional(r.Ref(e)),
59
+ borderColorSubdued: r.Optional(r.Ref(e)),
60
+ primary: r.Optional(r.Ref(e)),
61
+ primaryBackground: r.Optional(r.Ref(e)),
62
+ primarySubdued: r.Optional(r.Ref(e)),
63
+ primaryAccent: r.Optional(r.Ref(e)),
64
+ secondary: r.Optional(r.Ref(e)),
65
+ secondaryBackground: r.Optional(r.Ref(e)),
66
+ secondarySubdued: r.Optional(r.Ref(e)),
67
+ secondaryAccent: r.Optional(r.Ref(e)),
68
+ success: r.Optional(r.Ref(e)),
69
+ successBackground: r.Optional(r.Ref(e)),
70
+ successSubdued: r.Optional(r.Ref(e)),
71
+ successAccent: r.Optional(r.Ref(e)),
72
+ warning: r.Optional(r.Ref(e)),
73
+ warningBackground: r.Optional(r.Ref(e)),
74
+ warningSubdued: r.Optional(r.Ref(e)),
75
+ warningAccent: r.Optional(r.Ref(e)),
76
+ danger: r.Optional(r.Ref(e)),
77
+ dangerBackground: r.Optional(r.Ref(e)),
78
+ dangerSubdued: r.Optional(r.Ref(e)),
79
+ dangerAccent: r.Optional(r.Ref(e)),
37
80
  //////////////////////////////////////////////////////////////////////////////////////////////////////////
38
81
  // Base fonts
39
- fontFamilyDisplay: e.Ref(d),
40
- fontFamilySansSerif: e.Ref(d),
41
- fontFamilySerif: e.Ref(d),
42
- fontFamilyMonospace: e.Ref(d),
43
- //////////////////////////////////////////////////////////////////////////////////////////////////////////
44
- // Base border styles
45
- borderRadius: e.Union([e.Ref(F), e.Ref(A)]),
46
- borderWidth: e.Ref(g),
82
+ fonts: r.Optional(
83
+ r.Object({
84
+ display: r.Optional(
85
+ r.Object({
86
+ fontFamily: r.Optional(r.Ref(u)),
87
+ fontWeight: r.Optional(r.Ref(F))
88
+ })
89
+ ),
90
+ sans: r.Optional(
91
+ r.Object({
92
+ fontFamily: r.Optional(r.Ref(u)),
93
+ fontWeight: r.Optional(r.Ref(F))
94
+ })
95
+ ),
96
+ serif: r.Optional(
97
+ r.Object({
98
+ fontFamily: r.Optional(r.Ref(u)),
99
+ fontWeight: r.Optional(r.Ref(F))
100
+ })
101
+ ),
102
+ monospace: r.Optional(
103
+ r.Object({
104
+ fontFamily: r.Optional(r.Ref(u)),
105
+ fontWeight: r.Optional(r.Ref(F))
106
+ })
107
+ )
108
+ })
109
+ ),
47
110
  //////////////////////////////////////////////////////////////////////////////////////////////////////////
48
111
  // Scopes
49
- navigation: e.Object({
50
- background: e.Ref(r),
51
- borderWidth: e.Ref(g),
52
- borderColor: e.Ref(r),
53
- project: e.Object({
54
- background: e.Ref(r),
55
- foreground: e.Ref(r),
56
- fontFamily: e.Ref(d),
57
- borderWidth: e.Ref(g),
58
- borderColor: e.Ref(r)
59
- }),
60
- modules: e.Object({
61
- background: e.Ref(r),
62
- borderWidth: e.Ref(g),
63
- borderColor: e.Ref(r),
64
- button: e.Object({
65
- foreground: e.Ref(r),
66
- foregroundHover: e.Ref(r),
67
- foregroundActive: e.Ref(r),
68
- background: e.Ref(r),
69
- backgroundHover: e.Ref(r),
70
- backgroundActive: e.Ref(r)
71
- })
72
- }),
73
- list: e.Object({
74
- icon: e.Object({
75
- foreground: e.Ref(r),
76
- foregroundHover: e.Ref(r),
77
- foregroundActive: e.Ref(r)
78
- }),
79
- foreground: e.Ref(r),
80
- foregroundHover: e.Ref(r),
81
- foregroundActive: e.Ref(r),
82
- background: e.Ref(r),
83
- backgroundHover: e.Ref(r),
84
- backgroundActive: e.Ref(r),
85
- fontFamily: e.Ref(d),
86
- divider: e.Object({
87
- borderColor: e.Ref(r),
88
- borderWidth: e.Ref(g)
89
- })
112
+ navigation: r.Optional(
113
+ r.Object({
114
+ background: r.Optional(r.Ref(e)),
115
+ backgroundAccent: r.Optional(r.Ref(e)),
116
+ borderWidth: r.Optional(r.Ref(b)),
117
+ borderColor: r.Optional(r.Ref(e)),
118
+ project: r.Optional(
119
+ r.Object({
120
+ background: r.Optional(r.Ref(e)),
121
+ foreground: r.Optional(r.Ref(e)),
122
+ fontFamily: r.Optional(r.Ref(u)),
123
+ borderWidth: r.Optional(r.Ref(b)),
124
+ borderColor: r.Optional(r.Ref(e))
125
+ })
126
+ ),
127
+ modules: r.Optional(
128
+ r.Object({
129
+ background: r.Optional(r.Ref(e)),
130
+ borderWidth: r.Optional(r.Ref(b)),
131
+ borderColor: r.Optional(r.Ref(e)),
132
+ button: r.Optional(
133
+ r.Object({
134
+ foreground: r.Optional(r.Ref(e)),
135
+ foregroundHover: r.Optional(r.Ref(e)),
136
+ foregroundActive: r.Optional(r.Ref(e)),
137
+ background: r.Optional(r.Ref(e)),
138
+ backgroundHover: r.Optional(r.Ref(e)),
139
+ backgroundActive: r.Optional(r.Ref(e))
140
+ })
141
+ )
142
+ })
143
+ ),
144
+ list: r.Optional(
145
+ r.Object({
146
+ icon: r.Optional(
147
+ r.Object({
148
+ foreground: r.Optional(r.Ref(e)),
149
+ foregroundHover: r.Optional(r.Ref(e)),
150
+ foregroundActive: r.Optional(r.Ref(e))
151
+ })
152
+ ),
153
+ foreground: r.Optional(r.Ref(e)),
154
+ foregroundHover: r.Optional(r.Ref(e)),
155
+ foregroundActive: r.Optional(r.Ref(e)),
156
+ background: r.Optional(r.Ref(e)),
157
+ backgroundHover: r.Optional(r.Ref(e)),
158
+ backgroundActive: r.Optional(r.Ref(e)),
159
+ fontFamily: r.Optional(r.Ref(u)),
160
+ divider: r.Object({
161
+ borderColor: r.Optional(r.Ref(e)),
162
+ borderWidth: r.Optional(r.Ref(b))
163
+ })
164
+ })
165
+ )
90
166
  })
91
- }),
92
- header: e.Object({
93
- background: e.Ref(r),
94
- borderWidth: e.Ref(g),
95
- borderColor: e.Ref(r),
96
- boxShadow: e.Ref(y),
97
- headline: e.Object({
98
- foreground: e.Ref(r),
99
- fontFamily: e.Ref(d)
100
- }),
101
- title: e.Object({
102
- foreground: e.Ref(r),
103
- fontFamily: e.Ref(d)
167
+ ),
168
+ header: r.Optional(
169
+ r.Object({
170
+ background: r.Optional(r.Ref(e)),
171
+ borderWidth: r.Optional(r.Ref(b)),
172
+ borderColor: r.Optional(r.Ref(e)),
173
+ boxShadow: r.Optional(r.Ref(y)),
174
+ headline: r.Optional(
175
+ r.Object({
176
+ foreground: r.Optional(r.Ref(e)),
177
+ fontFamily: r.Optional(r.Ref(u))
178
+ })
179
+ ),
180
+ title: r.Optional(
181
+ r.Object({
182
+ foreground: r.Optional(r.Ref(e)),
183
+ fontFamily: r.Optional(r.Ref(u)),
184
+ fontWeight: r.Optional(r.Ref(F))
185
+ })
186
+ )
104
187
  })
105
- }),
106
- form: e.Object({
107
- field: e.Object({
108
- label: e.Object({
109
- foreground: e.Ref(r),
110
- fontFamily: e.Ref(d)
111
- }),
112
- input: e.Object({
113
- background: e.Ref(r),
114
- foreground: e.Ref(r),
115
- foregroundSubdued: e.Ref(r),
116
- borderColor: e.Ref(r),
117
- borderColorHover: e.Ref(r),
118
- borderColorFocus: e.Ref(r),
119
- boxShadow: e.Ref(y),
120
- boxShadowHover: e.Ref(y),
121
- boxShadowFocus: e.Ref(y)
122
- })
188
+ ),
189
+ form: w,
190
+ sidebar: r.Optional(
191
+ r.Object({
192
+ background: r.Optional(r.Ref(e)),
193
+ foreground: r.Optional(r.Ref(e)),
194
+ fontFamily: r.Optional(r.Ref(u)),
195
+ borderWidth: r.Optional(r.Ref(b)),
196
+ borderColor: r.Optional(r.Ref(e)),
197
+ section: r.Optional(
198
+ r.Object({
199
+ toggle: r.Optional(
200
+ r.Object({
201
+ icon: r.Optional(
202
+ r.Object({
203
+ foreground: r.Optional(r.Ref(e)),
204
+ foregroundHover: r.Optional(r.Ref(e)),
205
+ foregroundActive: r.Optional(r.Ref(e))
206
+ })
207
+ ),
208
+ foreground: r.Optional(r.Ref(e)),
209
+ foregroundHover: r.Optional(r.Ref(e)),
210
+ foregroundActive: r.Optional(r.Ref(e)),
211
+ background: r.Optional(r.Ref(e)),
212
+ backgroundHover: r.Optional(r.Ref(e)),
213
+ backgroundActive: r.Optional(r.Ref(e)),
214
+ fontFamily: r.Optional(r.Ref(u)),
215
+ borderWidth: r.Optional(r.Ref(b)),
216
+ borderColor: r.Optional(r.Ref(e))
217
+ })
218
+ ),
219
+ form: w
220
+ })
221
+ )
123
222
  })
124
- }),
125
- sidebar: e.Object({
126
- background: e.Ref(r),
127
- foreground: e.Ref(r),
128
- fontFamily: e.Ref(d),
129
- borderWidth: e.Ref(g),
130
- borderColor: e.Ref(r),
131
- section: e.Object({
132
- toggle: e.Object({
133
- icon: e.Object({
134
- foreground: e.Ref(r),
135
- foregroundHover: e.Ref(r),
136
- foregroundActive: e.Ref(r)
137
- }),
138
- foreground: e.Ref(r),
139
- foregroundHover: e.Ref(r),
140
- foregroundActive: e.Ref(r),
141
- background: e.Ref(r),
142
- backgroundHover: e.Ref(r),
143
- backgroundActive: e.Ref(r),
144
- fontFamily: e.Ref(d),
145
- borderWidth: e.Ref(g),
146
- borderColor: e.Ref(r)
147
- })
223
+ ),
224
+ public: r.Optional(
225
+ r.Object({
226
+ background: r.Optional(r.Ref(e)),
227
+ foreground: r.Optional(r.Ref(e)),
228
+ foregroundAccent: r.Optional(r.Ref(e)),
229
+ art: r.Optional(
230
+ r.Object({
231
+ background: r.Optional(r.Ref(e)),
232
+ primary: r.Optional(r.Ref(e)),
233
+ secondary: r.Optional(r.Ref(e)),
234
+ speed: r.Optional(r.Ref(j))
235
+ })
236
+ ),
237
+ form: w
148
238
  })
149
- })
150
- }), V = e.Object({
151
- name: e.String(),
152
- appearance: e.Union([e.Literal("light"), e.Literal("dark")]),
153
- rules: U
154
- }), oe = {
239
+ ),
240
+ popover: r.Optional(
241
+ r.Object({
242
+ menu: r.Optional(
243
+ r.Object({
244
+ background: r.Optional(r.Ref(e)),
245
+ borderRadius: r.Optional(r.Optional(r.Union([r.Ref(k), r.Ref(O)]))),
246
+ boxShadow: r.Optional(r.Ref(y))
247
+ })
248
+ )
249
+ })
250
+ )
251
+ }), Q = r.Object({
252
+ name: r.String(),
253
+ appearance: r.Union([r.Literal("light"), r.Literal("dark")]),
254
+ rules: K
255
+ }), lr = {
155
256
  $defs: {
156
- Color: r,
157
- FamilyName: d,
158
- Length: F,
159
- Percentage: A,
160
- LineWidth: g,
161
- BoxShadow: y
257
+ Color: e,
258
+ FamilyName: u,
259
+ Length: k,
260
+ Percentage: O,
261
+ LineWidth: b,
262
+ BoxShadow: y,
263
+ Size: H,
264
+ Number: j
162
265
  }
163
- }, x = {
164
- name: "Dark (Directus)",
266
+ }, q = (d) => {
267
+ const s = v(() => {
268
+ const o = /* @__PURE__ */ new Map(), c = (m, a = []) => {
269
+ for (const [t, n] of Object.entries(m))
270
+ typeof n == "object" && n !== null && ("type" in n && n.type === "object" && "properties" in n && c(n.properties, [...a, t]), "$ref" in n && n.$ref === "FamilyName" && (o.has(a) ? o.set(a, { family: t, weight: o.get(a).weight }) : o.set(a, { family: t, weight: null })), "$ref" in n && n.$ref === "FontWeight" && (o.has(a) ? o.set(a, { family: o.get(a).family, weight: t }) : o.set(a, { family: null, weight: t })));
271
+ };
272
+ return c(Q.properties.rules.properties), o;
273
+ }), f = v(() => {
274
+ const o = /* @__PURE__ */ new Map();
275
+ for (const [c, { family: m, weight: a }] of s.value.entries()) {
276
+ let t = null, n = null;
277
+ if (m && (t = W(i(d).rules, [...c, m])), a && (n = W(i(d).rules, [...c, a])), t) {
278
+ const h = t.split(",");
279
+ for (const l of h) {
280
+ const g = l.trim();
281
+ if (g.startsWith("var(--")) {
282
+ h.push(z(g.slice(6, -1)));
283
+ continue;
284
+ }
285
+ if ((g.startsWith('"') && g.endsWith('"')) === !1)
286
+ continue;
287
+ const x = g.slice(1, -1);
288
+ o.has(x) ? o.get(x).add(n ?? "400") : o.set(x, /* @__PURE__ */ new Set([n ?? "400"]));
289
+ }
290
+ }
291
+ }
292
+ return o;
293
+ });
294
+ return { googleFonts: v(() => {
295
+ const o = [];
296
+ for (const [c, m] of f.value.entries())
297
+ if (["Inter", "Merriweather", "Fira Mono"].includes(c) === !1) {
298
+ const t = Array.from(m).join(";");
299
+ o.push(`${c.replace(" ", "+")}:wght@${t}`);
300
+ }
301
+ return o;
302
+ }) };
303
+ }, R = (d) => d, A = R({
304
+ name: "Directus Default",
165
305
  appearance: "dark",
166
306
  rules: {
307
+ borderRadius: "6px",
308
+ borderWidth: "2px",
167
309
  foreground: "#c9d1d9",
168
310
  foregroundAccent: "#f0f6fc",
169
311
  foregroundSubdued: "#666672",
170
312
  background: "#0d1117",
313
+ backgroundNormal: "#21262e",
314
+ backgroundAccent: "#30363d",
315
+ backgroundSubdued: "#161b22",
316
+ borderColor: "#21262e",
317
+ borderColorAccent: "#30363d",
318
+ borderColorSubdued: "#21262d",
171
319
  primary: "var(--project-color)",
172
320
  primaryBackground: "color-mix(in srgb, var(--theme--background), var(--theme--primary) 10%)",
173
321
  primarySubdued: "color-mix(in srgb, var(--theme--background), var(--theme--primary) 50%)",
@@ -188,14 +336,27 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
188
336
  dangerBackground: "color-mix(in srgb, var(--theme--background), var(--theme--danger) 10%)",
189
337
  dangerSubdued: "color-mix(in srgb, var(--theme--background), var(--theme--danger) 50%)",
190
338
  dangerAccent: "color-mix(in srgb, var(--theme--danger), #16151a 25%)",
191
- fontFamilyDisplay: "var(--theme--font-family-sans-serif)",
192
- fontFamilySansSerif: '"Inter", system-ui',
193
- fontFamilySerif: '"Merriweather", serif',
194
- fontFamilyMonospace: '"Fira Mono", monospace',
195
- borderRadius: "6px",
196
- borderWidth: "2px",
339
+ fonts: {
340
+ display: {
341
+ fontFamily: '"Inter", system-ui',
342
+ fontWeight: "700"
343
+ },
344
+ sans: {
345
+ fontFamily: '"Inter", system-ui',
346
+ fontWeight: "500"
347
+ },
348
+ serif: {
349
+ fontFamily: '"Merriweather", serif',
350
+ fontWeight: "500"
351
+ },
352
+ monospace: {
353
+ fontFamily: '"Fira Mono", monospace',
354
+ fontWeight: "500"
355
+ }
356
+ },
197
357
  navigation: {
198
358
  background: "#21262e",
359
+ backgroundAccent: "#30363d",
199
360
  borderColor: "transparent",
200
361
  borderWidth: "0px",
201
362
  project: {
@@ -203,7 +364,7 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
203
364
  borderWidth: "0px",
204
365
  background: "#30363d",
205
366
  foreground: "var(--theme--foreground-accent)",
206
- fontFamily: "var(--theme--font-family-sans-serif)"
367
+ fontFamily: "var(--theme--fonts--sans--font-family)"
207
368
  },
208
369
  modules: {
209
370
  background: "var(--theme--background)",
@@ -230,7 +391,7 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
230
391
  background: "transparent",
231
392
  backgroundHover: "#30363d",
232
393
  backgroundActive: "#30363d",
233
- fontFamily: "var(--theme--font-family-sans-serif)",
394
+ fontFamily: "var(--theme--fonts--sans--font-family)",
234
395
  divider: {
235
396
  borderColor: "#30363d",
236
397
  borderWidth: "var(--theme--border-width)"
@@ -244,21 +405,22 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
244
405
  boxShadow: "0 4px 7px -4px rgb(var(--black) / 0.2)",
245
406
  headline: {
246
407
  foreground: "var(--theme--foreground-subdued)",
247
- fontFamily: "var(--theme--font-family-sans-serif)"
408
+ fontFamily: "var(--theme--fonts--sans--font-family)"
248
409
  },
249
410
  title: {
250
411
  foreground: "var(--theme--foreground-accent)",
251
- fontFamily: "var(--theme--font-family-display)"
412
+ fontFamily: "var(--theme--fonts--display--font-family)"
252
413
  }
253
414
  },
254
415
  form: {
255
416
  field: {
256
417
  label: {
257
418
  foreground: "var(--theme--foreground-accent)",
258
- fontFamily: "var(--theme--font-family-sans-serif)"
419
+ fontFamily: "var(--theme--fonts--sans--font-family)"
259
420
  },
260
421
  input: {
261
422
  background: "var(--theme--background)",
423
+ backgroundSubdued: "var(--theme--background-subdued)",
262
424
  foreground: "var(--theme--foreground)",
263
425
  foregroundSubdued: "var(--theme--foreground-subdued)",
264
426
  borderColor: "#21262e",
@@ -266,14 +428,15 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
266
428
  borderColorFocus: "var(--theme--primary)",
267
429
  boxShadow: "none",
268
430
  boxShadowHover: "none",
269
- boxShadowFocus: "0 0 16px -8px var(--theme--primary)"
431
+ boxShadowFocus: "0 0 16px -8px var(--theme--primary)",
432
+ height: "60px"
270
433
  }
271
434
  }
272
435
  },
273
436
  sidebar: {
274
437
  background: "#21262e",
275
438
  foreground: "var(--theme--foreground-subdued)",
276
- fontFamily: "var(--theme--font-family-sans-serif)",
439
+ fontFamily: "var(--theme--fonts--sans--font-family)",
277
440
  borderColor: "transparent",
278
441
  borderWidth: "0px",
279
442
  section: {
@@ -289,21 +452,175 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
289
452
  background: "#30363d",
290
453
  backgroundHover: "var(--theme--sidebar--section--toggle--background)",
291
454
  backgroundActive: "var(--theme--sidebar--section--toggle--background)",
292
- fontFamily: "var(--theme--font-family-sans-serif)",
455
+ fontFamily: "var(--theme--fonts--sans--font-family)",
293
456
  borderColor: "transparent",
294
457
  borderWidth: "0px"
458
+ },
459
+ form: {
460
+ columnGap: "var(--theme--form--column-gap)",
461
+ rowGap: "var(--theme--form--row-gap)",
462
+ label: {
463
+ foreground: "var(--theme--form--field--label--foreground)",
464
+ fontFamily: "var(--theme--form--field--label--font-family)"
465
+ },
466
+ field: {
467
+ input: {
468
+ background: "var(--theme--form--field--input--background)",
469
+ foreground: "var(--theme--form--field--input--foreground)",
470
+ foregroundSubdued: "var(--theme--form--field--input--foreground-subdued)",
471
+ borderColor: "var(--theme--form--field--input--border-color)",
472
+ borderColorHover: "var(--theme--form--field--input--border-color-hover)",
473
+ borderColorFocus: "var(--theme--form--field--input--border-color-focus)",
474
+ boxShadow: "var(--theme--form--field--input--box-shadow)",
475
+ boxShadowHover: "var(--theme--form--field--input--box-shadow-hover)",
476
+ boxShadowFocus: "var(--theme--form--field--input--box-shadow-focus)",
477
+ height: "52px"
478
+ }
479
+ }
480
+ }
481
+ }
482
+ },
483
+ public: {
484
+ background: "var(--theme--background)",
485
+ foreground: "var(--theme--foreground)",
486
+ foregroundAccent: "var(--theme--foreground-accent)",
487
+ art: {
488
+ background: "#0e1c2f",
489
+ primary: "var(--theme--primary)",
490
+ secondary: "var(--theme--secondary)",
491
+ speed: "1"
492
+ },
493
+ form: {
494
+ columnGap: "var(--theme--form--column-gap)",
495
+ rowGap: "var(--theme--form--row-gap)",
496
+ field: {
497
+ label: {
498
+ foreground: "var(--theme--form--field--label--foreground)",
499
+ fontFamily: "var(--theme--form--field--label--font-family)"
500
+ },
501
+ input: {
502
+ background: "var(--theme--form--field--input--background)",
503
+ foreground: "var(--theme--form--field--input--foreground)",
504
+ foregroundSubdued: "var(--theme--form--field--input--foreground-subdued)",
505
+ borderColor: "var(--theme--form--field--input--border-color)",
506
+ borderColorHover: "var(--theme--form--field--input--border-color-hover)",
507
+ borderColorFocus: "var(--theme--form--field--input--border-color-focus)",
508
+ boxShadow: "var(--theme--form--field--input--box-shadow)",
509
+ boxShadowHover: "var(--theme--form--field--input--box-shadow-hover)",
510
+ boxShadowFocus: "var(--theme--form--field--input--box-shadow-focus)",
511
+ height: "var(--theme--form--field--input--height)"
512
+ }
513
+ }
514
+ }
515
+ },
516
+ popover: {
517
+ menu: {
518
+ background: "#161b22",
519
+ borderRadius: "var(--theme--border-radius)",
520
+ boxShadow: "0px 0px 6px 0px rgb(0, 0, 0, 0.2)"
521
+ }
522
+ }
523
+ }
524
+ }), J = R({
525
+ name: "Directus Color Match",
526
+ appearance: "light",
527
+ rules: {
528
+ background: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 7%)",
529
+ backgroundAccent: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 20%)",
530
+ backgroundNormal: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 15%)",
531
+ backgroundSubdued: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 10%)",
532
+ borderColor: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 20%)",
533
+ borderColorAccent: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 40%)",
534
+ borderColorSubdued: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 15%)",
535
+ borderRadius: "12px",
536
+ borderWidth: "1px",
537
+ foreground: "color-mix(in srgb, #000000, var(--theme--primary) 70%)",
538
+ foregroundAccent: "color-mix(in srgb, #000000, var(--theme--primary) 50%)",
539
+ foregroundSubdued: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 60%)",
540
+ fonts: {
541
+ display: {
542
+ fontFamily: '"Montserrat", system-ui',
543
+ fontWeight: "400"
544
+ }
545
+ },
546
+ form: {
547
+ field: {
548
+ input: { background: "#FFFFFF", backgroundSubdued: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 13%)" }
549
+ }
550
+ },
551
+ navigation: {
552
+ background: "#FFFFFF",
553
+ backgroundAccent: "var(--theme--background)",
554
+ borderWidth: "var(--theme--border-width)",
555
+ borderColor: "var(--theme--border-color-subdued)",
556
+ modules: {
557
+ background: "color-mix(in srgb, #000000, var(--theme--primary) 90%)",
558
+ button: {
559
+ backgroundActive: "#FFFFFF",
560
+ foreground: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 20%)",
561
+ foregroundActive: "var(--theme--primary)"
562
+ }
563
+ },
564
+ project: { borderWidth: "1px", background: "#FFFFFF", borderColor: "var(--theme--border-color-subdued)" },
565
+ list: {
566
+ divider: { borderColor: "var(--theme--border-color-subdued)" },
567
+ icon: { foreground: "var(--theme--foreground)" },
568
+ foreground: "var(--theme--foreground)",
569
+ foregroundHover: "var(--theme--foreground)",
570
+ foregroundActive: "var(--theme--foreground)"
571
+ }
572
+ },
573
+ header: {
574
+ background: "#FFFFFF",
575
+ borderWidth: "1px",
576
+ borderColor: "var(--theme--border-color-subdued)",
577
+ boxShadow: "0 4px 7px -4px rgba(0,102,102, 0.2)"
578
+ },
579
+ sidebar: {
580
+ background: "#FFFFFF",
581
+ borderWidth: "1px",
582
+ borderColor: "var(--theme--border-color-subdued)",
583
+ section: {
584
+ toggle: {
585
+ borderColor: "var(--theme--border-color-subdued)",
586
+ borderWidth: "1px",
587
+ background: "#FFFFFF",
588
+ foreground: "var(--theme--foreground)",
589
+ foregroundHover: "var(--theme--foreground)",
590
+ foregroundActive: "var(--theme--foreground-accent)",
591
+ icon: {
592
+ foreground: "var(--theme--foreground)",
593
+ foregroundHover: "var(--theme--foreground)",
594
+ foregroundActive: "var(--theme--foreground-accent)"
595
+ }
295
596
  }
296
597
  }
598
+ },
599
+ public: {
600
+ art: {
601
+ background: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 10%)",
602
+ primary: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 60%)",
603
+ secondary: "color-mix(in srgb, #FFFFFF, var(--theme--secondary) 70%)"
604
+ },
605
+ background: "#FFFFFF"
297
606
  }
298
607
  }
299
- }, S = {
300
- name: "Light (Directus)",
608
+ }), C = R({
609
+ name: "Directus Default",
301
610
  appearance: "light",
302
611
  rules: {
612
+ borderRadius: "6px",
613
+ borderWidth: "2px",
303
614
  foreground: "#4f5464",
304
615
  foregroundAccent: "#172940",
305
616
  foregroundSubdued: "#a2b5cd",
306
617
  background: "#fff",
618
+ backgroundNormal: "#f0f4f9",
619
+ backgroundAccent: "#e4eaf1",
620
+ backgroundSubdued: "#f7fafc",
621
+ borderColor: "#e4eaf1",
622
+ borderColorAccent: "#d3dae4",
623
+ borderColorSubdued: "#f0f4f9",
307
624
  primary: "var(--project-color)",
308
625
  primaryBackground: "color-mix(in srgb, var(--theme--background), var(--theme--primary) 10%)",
309
626
  primarySubdued: "color-mix(in srgb, var(--theme--background), var(--theme--primary) 50%)",
@@ -324,25 +641,38 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
324
641
  dangerBackground: "color-mix(in srgb, var(--theme--background), var(--theme--danger) 10%)",
325
642
  dangerSubdued: "color-mix(in srgb, var(--theme--background), var(--theme--danger) 50%)",
326
643
  dangerAccent: "color-mix(in srgb, var(--theme--danger), #2e3c43 25%)",
327
- fontFamilyDisplay: "var(--theme--font-family-sans-serif)",
328
- fontFamilySansSerif: '"Inter", system-ui',
329
- fontFamilySerif: '"Merriweather", serif',
330
- fontFamilyMonospace: '"Fira Mono", monospace',
331
- borderRadius: "6px",
332
- borderWidth: "2px",
644
+ fonts: {
645
+ display: {
646
+ fontFamily: '"Inter", system-ui',
647
+ fontWeight: "700"
648
+ },
649
+ sans: {
650
+ fontFamily: '"Inter", system-ui',
651
+ fontWeight: "500"
652
+ },
653
+ serif: {
654
+ fontFamily: '"Merriweather", serif',
655
+ fontWeight: "500"
656
+ },
657
+ monospace: {
658
+ fontFamily: '"Fira Mono", monospace',
659
+ fontWeight: "500"
660
+ }
661
+ },
333
662
  navigation: {
334
- background: "#f0f4f9",
663
+ background: "var(--theme--background-normal)",
664
+ backgroundAccent: "var(--theme--background-accent)",
335
665
  borderColor: "transparent",
336
666
  borderWidth: "0px",
337
667
  project: {
338
668
  borderColor: "transparent",
339
669
  borderWidth: "0px",
340
- background: "#e4eaf1",
670
+ background: "var(--theme--navigation--background-accent)",
341
671
  foreground: "var(--theme--foreground-accent)",
342
672
  fontFamily: "var(--theme--font-family-sans-serif)"
343
673
  },
344
674
  modules: {
345
- background: "#18222f",
675
+ background: "#0e1c2f",
346
676
  borderColor: "transparent",
347
677
  borderWidth: "0px",
348
678
  button: {
@@ -351,7 +681,7 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
351
681
  foregroundActive: "var(--theme--foreground-accent)",
352
682
  background: "transparent",
353
683
  backgroundHover: "transparent",
354
- backgroundActive: "#f0f4f9"
684
+ backgroundActive: "var(--theme--background-normal)"
355
685
  }
356
686
  },
357
687
  list: {
@@ -364,11 +694,11 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
364
694
  foregroundHover: "var(--theme--navigation--list--foreground)",
365
695
  foregroundActive: "var(--theme--navigation--list--foreground)",
366
696
  background: "transparent",
367
- backgroundHover: "#e4eaf1",
368
- backgroundActive: "#e4eaf1",
697
+ backgroundHover: "var(--theme--navigation--background-accent)",
698
+ backgroundActive: "var(--theme--navigation--background-accent)",
369
699
  fontFamily: "var(--theme--font-family-sans-serif)",
370
700
  divider: {
371
- borderColor: "#d3dae4",
701
+ borderColor: "var(--theme--border-color-accent)",
372
702
  borderWidth: "var(--theme--border-width)"
373
703
  }
374
704
  }
@@ -384,30 +714,37 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
384
714
  },
385
715
  title: {
386
716
  foreground: "var(--theme--foreground-accent)",
387
- fontFamily: "var(--theme--font-family-display)"
717
+ fontFamily: "var(--theme--fonts--display--font-family)",
718
+ fontWeight: "var(--theme--fonts--display--font-weight)"
388
719
  }
389
720
  },
390
721
  form: {
722
+ columnGap: "32px",
723
+ rowGap: "40px",
391
724
  field: {
392
725
  label: {
393
726
  foreground: "var(--theme--foreground-accent)",
394
- fontFamily: "var(--theme--font-family-sans-serif)"
727
+ fontFamily: "var(--theme--font-family-sans-serif)",
728
+ fontWeight: "600"
395
729
  },
396
730
  input: {
397
731
  background: "var(--theme--background)",
732
+ backgroundSubdued: "var(--theme--background-subdued)",
398
733
  foreground: "var(--theme--foreground)",
399
734
  foregroundSubdued: "var(--theme--foreground-subdued)",
400
- borderColor: "#e4eaf1",
401
- borderColorHover: "#d3dae4",
735
+ borderColor: "var(--theme--border-color)",
736
+ borderColorHover: "var(--theme--border-color-accent)",
402
737
  borderColorFocus: "var(--theme--primary)",
403
738
  boxShadow: "none",
404
739
  boxShadowHover: "none",
405
- boxShadowFocus: "0 0 16px -8px var(--theme--primary)"
740
+ boxShadowFocus: "0 0 16px -8px var(--theme--primary)",
741
+ height: "60px",
742
+ padding: "16px"
406
743
  }
407
744
  }
408
745
  },
409
746
  sidebar: {
410
- background: "#f0f4f9",
747
+ background: "var(--theme--background-normal)",
411
748
  foreground: "var(--theme--foreground-subdued)",
412
749
  fontFamily: "var(--theme--font-family-sans-serif)",
413
750
  borderColor: "transparent",
@@ -422,92 +759,245 @@ const r = e.String({ $id: "Color" }), d = e.String({ $id: "FamilyName" }), F = e
422
759
  foreground: "var(--theme--foreground-accent)",
423
760
  foregroundHover: "var(--theme--sidebar--section--toggle--foreground)",
424
761
  foregroundActive: "var(--theme--sidebar--section--toggle--foreground)",
425
- background: "#e4eaf1",
762
+ background: "var(--theme--background-accent)",
426
763
  backgroundHover: "var(--theme--sidebar--section--toggle--background)",
427
764
  backgroundActive: "var(--theme--sidebar--section--toggle--background)",
428
765
  fontFamily: "var(--theme--font-family-sans-serif)",
429
766
  borderColor: "transparent",
430
767
  borderWidth: "0px"
768
+ },
769
+ form: {
770
+ columnGap: "var(--theme--form--column-gap)",
771
+ rowGap: "var(--theme--form--row-gap)",
772
+ label: {
773
+ foreground: "var(--theme--form--field--label--foreground)",
774
+ fontFamily: "var(--theme--form--field--label--font-family)"
775
+ },
776
+ field: {
777
+ input: {
778
+ background: "var(--theme--form--field--input--background)",
779
+ foreground: "var(--theme--form--field--input--foreground)",
780
+ foregroundSubdued: "var(--theme--form--field--input--foreground-subdued)",
781
+ borderColor: "var(--theme--form--field--input--border-color)",
782
+ borderColorHover: "var(--theme--form--field--input--border-color-hover)",
783
+ borderColorFocus: "var(--theme--form--field--input--border-color-focus)",
784
+ boxShadow: "var(--theme--form--field--input--box-shadow)",
785
+ boxShadowHover: "var(--theme--form--field--input--box-shadow-hover)",
786
+ boxShadowFocus: "var(--theme--form--field--input--box-shadow-focus)",
787
+ height: "52px",
788
+ padding: "12px"
789
+ }
790
+ }
791
+ }
792
+ }
793
+ },
794
+ public: {
795
+ background: "var(--theme--background)",
796
+ foreground: "var(--theme--foreground)",
797
+ foregroundAccent: "var(--theme--foreground-accent)",
798
+ art: {
799
+ background: "#0e1c2f",
800
+ primary: "var(--theme--primary)",
801
+ secondary: "var(--theme--secondary)",
802
+ speed: "1"
803
+ },
804
+ form: {
805
+ columnGap: "var(--theme--form--column-gap)",
806
+ rowGap: "var(--theme--form--row-gap)",
807
+ label: {
808
+ foreground: "var(--theme--form--field--label--foreground)",
809
+ fontFamily: "var(--theme--form--field--label--font-family)"
810
+ },
811
+ field: {
812
+ input: {
813
+ background: "var(--theme--form--field--input--background)",
814
+ foreground: "var(--theme--form--field--input--foreground)",
815
+ foregroundSubdued: "var(--theme--form--field--input--foreground-subdued)",
816
+ borderColor: "var(--theme--form--field--input--border-color)",
817
+ borderColorHover: "var(--theme--form--field--input--border-color-hover)",
818
+ borderColorFocus: "var(--theme--form--field--input--border-color-focus)",
819
+ boxShadow: "var(--theme--form--field--input--box-shadow)",
820
+ boxShadowHover: "var(--theme--form--field--input--box-shadow-hover)",
821
+ boxShadowFocus: "var(--theme--form--field--input--box-shadow-focus)",
822
+ height: "var(--theme--form--field--input--height)",
823
+ padding: "var(--theme--form--field--input--padding)"
824
+ }
431
825
  }
432
826
  }
827
+ },
828
+ popover: {
829
+ menu: {
830
+ background: "#fafcfd",
831
+ borderRadius: "var(--theme--border-radius)",
832
+ boxShadow: "0px 0px 6px 0px rgb(23, 41, 64, 0.2), 0px 0px 12px 2px rgb(23, 41, 64, 0.05)"
833
+ }
433
834
  }
434
835
  }
435
- }, z = [S], E = [x], K = C("🎨 Themes", () => {
436
- const t = H({
437
- light: z,
438
- dark: E
439
- });
440
- return { themes: t, registerTheme: (f) => {
441
- f.appearance === "light" ? t.light.push(f) : t.dark.push(f);
836
+ }), X = R({
837
+ name: "Directus Minimal",
838
+ appearance: "light",
839
+ rules: {
840
+ borderWidth: "1px",
841
+ backgroundPage: "color-mix(in srgb, #FFFFFF, var(--theme--primary) 7%)",
842
+ navigation: {
843
+ background: "#FFFFFF",
844
+ modules: {
845
+ background: "#FFFFFF",
846
+ button: {
847
+ backgroundActive: "#F1F5F9",
848
+ foreground: "var(--theme--foreground)",
849
+ foregroundHover: "var(--theme--primary)",
850
+ foregroundActive: "var(--theme--primary)",
851
+ backgroundHover: "#F1F5F9",
852
+ background: "#FFFFFF"
853
+ },
854
+ borderWidth: "1px",
855
+ borderColor: "var(--theme--border-color)"
856
+ },
857
+ project: {
858
+ borderWidth: "1px",
859
+ background: "#FFFFFF",
860
+ borderColor: "var(--theme--border-color)"
861
+ },
862
+ list: {
863
+ icon: {
864
+ foreground: "#0F172A"
865
+ },
866
+ divider: {
867
+ borderColor: "var(--theme--border-color)"
868
+ }
869
+ },
870
+ borderWidth: "1px",
871
+ backgroundAccent: "#F1F5F9",
872
+ borderColor: "var(--theme--border-color)"
873
+ },
874
+ header: {
875
+ background: "#FFFFFF",
876
+ borderWidth: "1px",
877
+ borderColor: "var(--theme--border-color)",
878
+ boxShadow: "0 4px 7px -4px rgba(0,102,102, 0.1)"
879
+ },
880
+ backgroundAccent: "#E2E8F0",
881
+ backgroundSubdued: "#F8FAFC",
882
+ background: "#FFFFFF",
883
+ foreground: "#1E293B",
884
+ foregroundAccent: "#0F172A",
885
+ foregroundSubdued: "#94A3B8",
886
+ borderRadius: "4px",
887
+ borderColor: "#E2E8F0",
888
+ borderColorAccent: "#CBD5E1",
889
+ borderColorSubdued: "#F1F5F9",
890
+ form: {
891
+ rowGap: "32px",
892
+ field: {
893
+ input: {
894
+ background: "#FFFFFF",
895
+ backgroundSubdued: "#F8FAFC",
896
+ boxShadowFocus: "none",
897
+ height: "52px"
898
+ }
899
+ }
900
+ },
901
+ sidebar: {
902
+ background: "#FFFFFF",
903
+ borderWidth: "1px",
904
+ borderColor: "var(--theme--border-color)",
905
+ section: {
906
+ toggle: {
907
+ borderColor: "var(--theme--border-color)",
908
+ borderWidth: "1px",
909
+ background: "#FFFFFF",
910
+ foreground: "var(--theme--foreground-subdued)",
911
+ foregroundHover: "var(--theme--foreground)",
912
+ foregroundActive: "var(--theme--foreground-accent)",
913
+ icon: {
914
+ foreground: "var(--theme--foreground)",
915
+ foregroundHover: "var(--theme--foreground)",
916
+ foregroundActive: "var(--theme--foreground-accent)"
917
+ }
918
+ },
919
+ form: {
920
+ field: {
921
+ input: {
922
+ height: "42px"
923
+ }
924
+ }
925
+ }
926
+ }
927
+ },
928
+ fontFamilyDisplay: "system-ui",
929
+ public: {
930
+ art: {
931
+ background: "color-mix(in srgb, #FFFFFF, var(--project-color) 10%)",
932
+ primary: "color-mix(in srgb, #FFFFFF, var(--project-color) 70%)",
933
+ secondary: "color-mix(in srgb, #FFFFFF, var(--project-color) 40%)"
934
+ },
935
+ background: "#FFFFFF"
936
+ },
937
+ backgroundNormal: "#F1F5F9",
938
+ secondary: "#64748B",
939
+ primary: "#0F172A",
940
+ primaryBackground: "#F1F5F9",
941
+ primarySubdued: "#F8FAFC",
942
+ primaryAccent: "#E2E8F0",
943
+ secondaryAccent: "#E2E8F0",
944
+ secondaryBackground: "#F1F5F9",
945
+ secondarySubdued: "#F8FAFC"
946
+ }
947
+ }), Y = [A], Z = [C, X, J], rr = _("🎨 Themes", () => {
948
+ const d = B({ light: Z, dark: Y });
949
+ return { themes: d, registerTheme: (f) => {
950
+ f.appearance === "light" ? d.light.push(f) : d.dark.push(f);
442
951
  } };
443
- }), q = (t, m, f, b, v) => {
444
- const { themes: o } = j(K());
445
- return { theme: h(() => {
446
- const a = c(t) ? c(f) : c(m), n = c(t) ? x : S, u = c(t) ? c(v) : c(b), p = c(o)[t ? "dark" : "light"].find((s) => s.name === a);
447
- return p ? u ? R({}, n, p, { rules: u }) : R(n, p) : (a && a !== n.name && console.warn(`Theme "${a}" doesn't exist.`), u ? R({}, n, { rules: u }) : n);
952
+ }), er = (d, s, f, p, o) => {
953
+ const { themes: c } = I(rr());
954
+ return { theme: v(() => {
955
+ const a = i(d) ? i(f) : i(s), t = i(d) ? A : C, n = i(d) ? i(o) : i(p), h = i(c)[i(d) ? "dark" : "light"].find((l) => l.name === a);
956
+ return h ? n ? S({}, t, h, { rules: n }) : S(t, h) : (a && a !== t.name && console.warn(`Theme "${a}" doesn't exist.`), n ? S({}, t, { rules: n }) : t);
448
957
  }) };
449
- }, G = (t) => {
450
- const m = [], f = (o, i = []) => {
451
- for (const [a, n] of Object.entries(o))
452
- typeof n == "object" && n !== null && ("type" in n && n.type === "object" && "properties" in n && f(n.properties, [...i, a]), "$ref" in n && n.$ref === "FamilyName" && m.push([...i, a]));
453
- };
454
- f(V.properties.rules.properties);
455
- const b = h(() => {
456
- const o = [];
457
- for (const a of m)
458
- o.push(M(c(t).rules, a).trim());
459
- const i = /* @__PURE__ */ new Set();
460
- for (const a of o)
461
- a.split(",").forEach((u) => i.add(u));
462
- return Array.from(i);
463
- }), v = h(() => b.value.filter((o) => {
464
- if (o.startsWith('"') && o.endsWith('"') && o.includes("var(") === !1) {
465
- const i = ["Inter", "Merriweather", "Fira Mono"];
466
- return !(i.includes(o) || i.map((a) => `"${a}"`).includes(o));
467
- }
468
- return !1;
469
- }).map((o) => (o.startsWith('"') && o.endsWith('"') && (o = o.slice(1, -1)), o.replace(" ", "+"))));
470
- return { fonts: b, googleFonts: v };
471
- }, ne = /* @__PURE__ */ W({
958
+ }, or = (d) => {
959
+ const s = V(d, { delimiter: "--" }), f = (p) => `--theme--${P(p, { separator: "-" })}`;
960
+ return U(s, (p, o) => f(o));
961
+ }, gr = /* @__PURE__ */ $({
472
962
  __name: "theme-provider",
473
963
  props: {
474
964
  darkMode: { type: Boolean },
475
- themeLight: { default: S.name },
965
+ themeLight: { default: C.name },
476
966
  themeLightOverrides: { default: () => ({}) },
477
- themeDark: { default: x.name },
967
+ themeDark: { default: A.name },
478
968
  themeDarkOverrides: { default: () => ({}) }
479
969
  },
480
- setup(t) {
481
- const m = t, { darkMode: f, themeLight: b, themeDark: v, themeLightOverrides: o, themeDarkOverrides: i } = O(m), { theme: a } = q(f, b, v, o, i), n = h(() => {
482
- const s = P(c(a).rules, { delimiter: "--" }), l = (k) => `--theme--${I(k, { separator: "-" })}`;
483
- return _(s, (k, w) => l(w));
484
- }), { googleFonts: u } = G(a);
485
- N({
486
- link: h(() => {
487
- let s = "";
488
- if (u.value.length > 0) {
489
- const l = u.value.join("&family=");
490
- s += `https://fonts.googleapis.com/css2?family=${l}`, s += `
970
+ setup(d) {
971
+ const s = d, { darkMode: f, themeLight: p, themeDark: o, themeLightOverrides: c, themeDarkOverrides: m } = D(s), { theme: a } = er(f, p, o, c, m), t = v(() => or(i(a).rules)), { googleFonts: n } = q(a);
972
+ E({
973
+ link: v(() => {
974
+ let l = "";
975
+ if (n.value.length > 0) {
976
+ const g = n.value.join("&family=");
977
+ l += `https://fonts.googleapis.com/css2?family=${g}`, l += `
491
978
  `;
492
979
  }
493
- return s ? [
980
+ return l ? [
494
981
  {
495
982
  rel: "stylesheet",
496
- href: s
983
+ href: l
497
984
  }
498
985
  ] : [];
499
986
  })
500
987
  });
501
- const p = h(() => `:root {${Object.entries(c(n)).map(([l, k]) => `${l}: ${k};`).join(" ")}}`);
502
- return (s, l) => (B(), $(L, { to: "#theme" }, [
503
- T(D(p.value), 1)
988
+ const h = v(() => `:root {${Object.entries(i(t)).map(([g, x]) => `${g}: ${x};`).join(" ")}}`);
989
+ return (l, g) => (T(), L(G, { to: "#theme" }, [
990
+ N(M(h.value), 1)
504
991
  ]));
505
992
  }
506
993
  });
507
994
  export {
508
- oe as Definitions,
509
- ne as ThemeProvider,
510
- V as ThemeSchema,
511
- q as useTheme,
512
- K as useThemeStore
995
+ lr as Definitions,
996
+ gr as ThemeProvider,
997
+ Q as ThemeSchema,
998
+ R as defineTheme,
999
+ or as rulesToCssVars,
1000
+ q as useFonts,
1001
+ er as useTheme,
1002
+ rr as useThemeStore
513
1003
  };