@directus/themes 0.1.0 → 0.2.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.d.ts +3 -3
- package/dist/index.js +246 -156
- package/dist/schema.d.ts +31 -5
- package/dist/schema.json +159 -18
- package/dist/store.d.ts +150 -0
- package/dist/theme-provider.vue.d.ts +100 -0
- package/dist/use-theme.d.ts +25 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './schema.js';
|
|
2
|
+
export * from './store.js';
|
|
3
|
+
export * from './use-theme.js';
|
|
3
4
|
export { default as ThemeProvider } from './theme-provider.vue';
|
|
4
|
-
export { useTheme } from './use-theme.js';
|
package/dist/index.js
CHANGED
|
@@ -1,125 +1,166 @@
|
|
|
1
|
-
import { Type as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import { reactive as H, computed as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
const y = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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")], {
|
|
9
|
+
$id: "LineWidth"
|
|
10
|
+
}), U = e.Object({
|
|
11
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
12
|
+
// 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),
|
|
37
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
38
|
+
// 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),
|
|
47
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
48
|
+
// 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)
|
|
46
59
|
}),
|
|
47
|
-
modules:
|
|
48
|
-
background: e,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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)
|
|
56
71
|
})
|
|
57
72
|
}),
|
|
58
|
-
list:
|
|
59
|
-
icon:
|
|
60
|
-
foreground: e,
|
|
61
|
-
foregroundHover: e,
|
|
62
|
-
foregroundActive: e
|
|
73
|
+
list: e.Object({
|
|
74
|
+
icon: e.Object({
|
|
75
|
+
foreground: e.Ref(r),
|
|
76
|
+
foregroundHover: e.Ref(r),
|
|
77
|
+
foregroundActive: e.Ref(r)
|
|
63
78
|
}),
|
|
64
|
-
foreground: e,
|
|
65
|
-
foregroundHover: e,
|
|
66
|
-
foregroundActive: e,
|
|
67
|
-
background: e,
|
|
68
|
-
backgroundHover: e,
|
|
69
|
-
backgroundActive: e,
|
|
70
|
-
fontFamily:
|
|
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
|
+
})
|
|
71
90
|
})
|
|
72
91
|
}),
|
|
73
|
-
header:
|
|
74
|
-
background: e,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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)
|
|
78
100
|
}),
|
|
79
|
-
title:
|
|
80
|
-
foreground: e,
|
|
81
|
-
fontFamily:
|
|
101
|
+
title: e.Object({
|
|
102
|
+
foreground: e.Ref(r),
|
|
103
|
+
fontFamily: e.Ref(d)
|
|
82
104
|
})
|
|
83
105
|
}),
|
|
84
|
-
form:
|
|
85
|
-
field:
|
|
86
|
-
label:
|
|
87
|
-
foreground: e,
|
|
88
|
-
fontFamily:
|
|
106
|
+
form: e.Object({
|
|
107
|
+
field: e.Object({
|
|
108
|
+
label: e.Object({
|
|
109
|
+
foreground: e.Ref(r),
|
|
110
|
+
fontFamily: e.Ref(d)
|
|
89
111
|
}),
|
|
90
|
-
input:
|
|
91
|
-
background: e,
|
|
92
|
-
foreground: e,
|
|
93
|
-
foregroundSubdued: e
|
|
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)
|
|
94
122
|
})
|
|
95
123
|
})
|
|
96
124
|
}),
|
|
97
|
-
sidebar:
|
|
98
|
-
background: e,
|
|
99
|
-
foreground: e,
|
|
100
|
-
fontFamily:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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)
|
|
107
137
|
}),
|
|
108
|
-
foreground: e,
|
|
109
|
-
foregroundHover: e,
|
|
110
|
-
foregroundActive: e,
|
|
111
|
-
background: e,
|
|
112
|
-
backgroundHover: e,
|
|
113
|
-
backgroundActive: e,
|
|
114
|
-
fontFamily:
|
|
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)
|
|
115
147
|
})
|
|
116
148
|
})
|
|
117
149
|
})
|
|
118
|
-
}),
|
|
119
|
-
name:
|
|
120
|
-
appearance:
|
|
121
|
-
rules:
|
|
122
|
-
}),
|
|
150
|
+
}), V = e.Object({
|
|
151
|
+
name: e.String(),
|
|
152
|
+
appearance: e.Union([e.Literal("light"), e.Literal("dark")]),
|
|
153
|
+
rules: U
|
|
154
|
+
}), oe = {
|
|
155
|
+
$defs: {
|
|
156
|
+
Color: r,
|
|
157
|
+
FamilyName: d,
|
|
158
|
+
Length: F,
|
|
159
|
+
Percentage: A,
|
|
160
|
+
LineWidth: g,
|
|
161
|
+
BoxShadow: y
|
|
162
|
+
}
|
|
163
|
+
}, x = {
|
|
123
164
|
name: "Dark (Directus)",
|
|
124
165
|
appearance: "dark",
|
|
125
166
|
rules: {
|
|
@@ -151,15 +192,23 @@ const y = {
|
|
|
151
192
|
fontFamilySansSerif: '"Inter", system-ui',
|
|
152
193
|
fontFamilySerif: '"Merriweather", serif',
|
|
153
194
|
fontFamilyMonospace: '"Fira Mono", monospace',
|
|
195
|
+
borderRadius: "6px",
|
|
196
|
+
borderWidth: "2px",
|
|
154
197
|
navigation: {
|
|
155
198
|
background: "#21262e",
|
|
199
|
+
borderColor: "transparent",
|
|
200
|
+
borderWidth: "0px",
|
|
156
201
|
project: {
|
|
202
|
+
borderColor: "transparent",
|
|
203
|
+
borderWidth: "0px",
|
|
157
204
|
background: "#30363d",
|
|
158
205
|
foreground: "var(--theme--foreground-accent)",
|
|
159
206
|
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
160
207
|
},
|
|
161
208
|
modules: {
|
|
162
209
|
background: "var(--theme--background)",
|
|
210
|
+
borderColor: "transparent",
|
|
211
|
+
borderWidth: "0px",
|
|
163
212
|
button: {
|
|
164
213
|
foreground: "var(--theme--foreground-subdued)",
|
|
165
214
|
foregroundHover: "#fff",
|
|
@@ -181,11 +230,18 @@ const y = {
|
|
|
181
230
|
background: "transparent",
|
|
182
231
|
backgroundHover: "#30363d",
|
|
183
232
|
backgroundActive: "#30363d",
|
|
184
|
-
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
233
|
+
fontFamily: "var(--theme--font-family-sans-serif)",
|
|
234
|
+
divider: {
|
|
235
|
+
borderColor: "#30363d",
|
|
236
|
+
borderWidth: "var(--theme--border-width)"
|
|
237
|
+
}
|
|
185
238
|
}
|
|
186
239
|
},
|
|
187
240
|
header: {
|
|
188
241
|
background: "var(--theme--background)",
|
|
242
|
+
borderColor: "transparent",
|
|
243
|
+
borderWidth: "0px",
|
|
244
|
+
boxShadow: "0 4px 7px -4px rgb(var(--black) / 0.2)",
|
|
189
245
|
headline: {
|
|
190
246
|
foreground: "var(--theme--foreground-subdued)",
|
|
191
247
|
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
@@ -204,7 +260,13 @@ const y = {
|
|
|
204
260
|
input: {
|
|
205
261
|
background: "var(--theme--background)",
|
|
206
262
|
foreground: "var(--theme--foreground)",
|
|
207
|
-
foregroundSubdued: "var(--theme--foreground-subdued)"
|
|
263
|
+
foregroundSubdued: "var(--theme--foreground-subdued)",
|
|
264
|
+
borderColor: "#21262e",
|
|
265
|
+
borderColorHover: "#30363d",
|
|
266
|
+
borderColorFocus: "var(--theme--primary)",
|
|
267
|
+
boxShadow: "none",
|
|
268
|
+
boxShadowHover: "none",
|
|
269
|
+
boxShadowFocus: "0 0 16px -8px var(--theme--primary)"
|
|
208
270
|
}
|
|
209
271
|
}
|
|
210
272
|
},
|
|
@@ -212,6 +274,8 @@ const y = {
|
|
|
212
274
|
background: "#21262e",
|
|
213
275
|
foreground: "var(--theme--foreground-subdued)",
|
|
214
276
|
fontFamily: "var(--theme--font-family-sans-serif)",
|
|
277
|
+
borderColor: "transparent",
|
|
278
|
+
borderWidth: "0px",
|
|
215
279
|
section: {
|
|
216
280
|
toggle: {
|
|
217
281
|
icon: {
|
|
@@ -225,12 +289,14 @@ const y = {
|
|
|
225
289
|
background: "#30363d",
|
|
226
290
|
backgroundHover: "var(--theme--sidebar--section--toggle--background)",
|
|
227
291
|
backgroundActive: "var(--theme--sidebar--section--toggle--background)",
|
|
228
|
-
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
292
|
+
fontFamily: "var(--theme--font-family-sans-serif)",
|
|
293
|
+
borderColor: "transparent",
|
|
294
|
+
borderWidth: "0px"
|
|
229
295
|
}
|
|
230
296
|
}
|
|
231
297
|
}
|
|
232
298
|
}
|
|
233
|
-
},
|
|
299
|
+
}, S = {
|
|
234
300
|
name: "Light (Directus)",
|
|
235
301
|
appearance: "light",
|
|
236
302
|
rules: {
|
|
@@ -262,15 +328,23 @@ const y = {
|
|
|
262
328
|
fontFamilySansSerif: '"Inter", system-ui',
|
|
263
329
|
fontFamilySerif: '"Merriweather", serif',
|
|
264
330
|
fontFamilyMonospace: '"Fira Mono", monospace',
|
|
331
|
+
borderRadius: "6px",
|
|
332
|
+
borderWidth: "2px",
|
|
265
333
|
navigation: {
|
|
266
334
|
background: "#f0f4f9",
|
|
335
|
+
borderColor: "transparent",
|
|
336
|
+
borderWidth: "0px",
|
|
267
337
|
project: {
|
|
338
|
+
borderColor: "transparent",
|
|
339
|
+
borderWidth: "0px",
|
|
268
340
|
background: "#e4eaf1",
|
|
269
341
|
foreground: "var(--theme--foreground-accent)",
|
|
270
342
|
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
271
343
|
},
|
|
272
344
|
modules: {
|
|
273
345
|
background: "#18222f",
|
|
346
|
+
borderColor: "transparent",
|
|
347
|
+
borderWidth: "0px",
|
|
274
348
|
button: {
|
|
275
349
|
foreground: "#8196b1",
|
|
276
350
|
foregroundHover: "#fff",
|
|
@@ -292,11 +366,18 @@ const y = {
|
|
|
292
366
|
background: "transparent",
|
|
293
367
|
backgroundHover: "#e4eaf1",
|
|
294
368
|
backgroundActive: "#e4eaf1",
|
|
295
|
-
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
369
|
+
fontFamily: "var(--theme--font-family-sans-serif)",
|
|
370
|
+
divider: {
|
|
371
|
+
borderColor: "#d3dae4",
|
|
372
|
+
borderWidth: "var(--theme--border-width)"
|
|
373
|
+
}
|
|
296
374
|
}
|
|
297
375
|
},
|
|
298
376
|
header: {
|
|
299
377
|
background: "var(--theme--background)",
|
|
378
|
+
borderColor: "transparent",
|
|
379
|
+
borderWidth: "0px",
|
|
380
|
+
boxShadow: "0 4px 7px -4px rgb(0 0 0 / 0.2)",
|
|
300
381
|
headline: {
|
|
301
382
|
foreground: "var(--theme--foreground-subdued)",
|
|
302
383
|
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
@@ -315,7 +396,13 @@ const y = {
|
|
|
315
396
|
input: {
|
|
316
397
|
background: "var(--theme--background)",
|
|
317
398
|
foreground: "var(--theme--foreground)",
|
|
318
|
-
foregroundSubdued: "var(--theme--foreground-subdued)"
|
|
399
|
+
foregroundSubdued: "var(--theme--foreground-subdued)",
|
|
400
|
+
borderColor: "#e4eaf1",
|
|
401
|
+
borderColorHover: "#d3dae4",
|
|
402
|
+
borderColorFocus: "var(--theme--primary)",
|
|
403
|
+
boxShadow: "none",
|
|
404
|
+
boxShadowHover: "none",
|
|
405
|
+
boxShadowFocus: "0 0 16px -8px var(--theme--primary)"
|
|
319
406
|
}
|
|
320
407
|
}
|
|
321
408
|
},
|
|
@@ -323,6 +410,8 @@ const y = {
|
|
|
323
410
|
background: "#f0f4f9",
|
|
324
411
|
foreground: "var(--theme--foreground-subdued)",
|
|
325
412
|
fontFamily: "var(--theme--font-family-sans-serif)",
|
|
413
|
+
borderColor: "transparent",
|
|
414
|
+
borderWidth: "0px",
|
|
326
415
|
section: {
|
|
327
416
|
toggle: {
|
|
328
417
|
icon: {
|
|
@@ -336,88 +425,89 @@ const y = {
|
|
|
336
425
|
background: "#e4eaf1",
|
|
337
426
|
backgroundHover: "var(--theme--sidebar--section--toggle--background)",
|
|
338
427
|
backgroundActive: "var(--theme--sidebar--section--toggle--background)",
|
|
339
|
-
fontFamily: "var(--theme--font-family-sans-serif)"
|
|
428
|
+
fontFamily: "var(--theme--font-family-sans-serif)",
|
|
429
|
+
borderColor: "transparent",
|
|
430
|
+
borderWidth: "0px"
|
|
340
431
|
}
|
|
341
432
|
}
|
|
342
433
|
}
|
|
343
434
|
}
|
|
344
|
-
},
|
|
435
|
+
}, z = [S], E = [x], K = C("🎨 Themes", () => {
|
|
345
436
|
const t = H({
|
|
346
|
-
light:
|
|
347
|
-
dark:
|
|
437
|
+
light: z,
|
|
438
|
+
dark: E
|
|
348
439
|
});
|
|
349
|
-
return { themes: t, registerTheme: (
|
|
350
|
-
|
|
440
|
+
return { themes: t, registerTheme: (f) => {
|
|
441
|
+
f.appearance === "light" ? t.light.push(f) : t.dark.push(f);
|
|
351
442
|
} };
|
|
352
|
-
}),
|
|
353
|
-
const
|
|
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);
|
|
448
|
+
}) };
|
|
449
|
+
}, G = (t) => {
|
|
450
|
+
const m = [], f = (o, i = []) => {
|
|
354
451
|
for (const [a, n] of Object.entries(o))
|
|
355
|
-
typeof n == "object" && n !== null && ("type" in n && n.type === "object" && "properties" in n &&
|
|
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]));
|
|
356
453
|
};
|
|
357
|
-
|
|
358
|
-
const
|
|
454
|
+
f(V.properties.rules.properties);
|
|
455
|
+
const b = h(() => {
|
|
359
456
|
const o = [];
|
|
360
457
|
for (const a of m)
|
|
361
|
-
o.push(
|
|
458
|
+
o.push(M(c(t).rules, a).trim());
|
|
362
459
|
const i = /* @__PURE__ */ new Set();
|
|
363
460
|
for (const a of o)
|
|
364
|
-
a.split(",").forEach((
|
|
461
|
+
a.split(",").forEach((u) => i.add(u));
|
|
365
462
|
return Array.from(i);
|
|
366
|
-
}),
|
|
463
|
+
}), v = h(() => b.value.filter((o) => {
|
|
367
464
|
if (o.startsWith('"') && o.endsWith('"') && o.includes("var(") === !1) {
|
|
368
465
|
const i = ["Inter", "Merriweather", "Fira Mono"];
|
|
369
466
|
return !(i.includes(o) || i.map((a) => `"${a}"`).includes(o));
|
|
370
467
|
}
|
|
371
468
|
return !1;
|
|
372
469
|
}).map((o) => (o.startsWith('"') && o.endsWith('"') && (o = o.slice(1, -1)), o.replace(" ", "+"))));
|
|
373
|
-
return { fonts:
|
|
374
|
-
},
|
|
375
|
-
const { themes: o } = j(E());
|
|
376
|
-
return { theme: v(() => {
|
|
377
|
-
const a = d(t) ? d(s) : d(m), n = d(t) ? F : A, g = d(t) ? d(b) : d(f), h = d(o)[t ? "dark" : "light"].find((u) => u.name === a);
|
|
378
|
-
return h ? g ? p({}, n, h, { rules: g }) : p(n, h) : (a && a !== n.name && console.warn(`Theme "${a}" doesn't exist.`), g ? p({}, n, { rules: g }) : n);
|
|
379
|
-
}) };
|
|
380
|
-
}, ee = /* @__PURE__ */ O({
|
|
470
|
+
return { fonts: b, googleFonts: v };
|
|
471
|
+
}, ne = /* @__PURE__ */ W({
|
|
381
472
|
__name: "theme-provider",
|
|
382
473
|
props: {
|
|
383
474
|
darkMode: { type: Boolean },
|
|
384
|
-
themeLight: { default:
|
|
475
|
+
themeLight: { default: S.name },
|
|
385
476
|
themeLightOverrides: { default: () => ({}) },
|
|
386
|
-
themeDark: { default:
|
|
477
|
+
themeDark: { default: x.name },
|
|
387
478
|
themeDarkOverrides: { default: () => ({}) }
|
|
388
479
|
},
|
|
389
480
|
setup(t) {
|
|
390
|
-
const m = t, { darkMode:
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
}), { googleFonts:
|
|
394
|
-
|
|
395
|
-
link:
|
|
396
|
-
let
|
|
397
|
-
if (
|
|
398
|
-
const l =
|
|
399
|
-
|
|
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 += `
|
|
400
491
|
`;
|
|
401
492
|
}
|
|
402
|
-
return
|
|
493
|
+
return s ? [
|
|
403
494
|
{
|
|
404
495
|
rel: "stylesheet",
|
|
405
|
-
href:
|
|
496
|
+
href: s
|
|
406
497
|
}
|
|
407
498
|
] : [];
|
|
408
499
|
})
|
|
409
500
|
});
|
|
410
|
-
const
|
|
411
|
-
return (
|
|
412
|
-
D(
|
|
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)
|
|
413
504
|
]));
|
|
414
505
|
}
|
|
415
506
|
});
|
|
416
507
|
export {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
E as useThemeStore
|
|
508
|
+
oe as Definitions,
|
|
509
|
+
ne as ThemeProvider,
|
|
510
|
+
V as ThemeSchema,
|
|
511
|
+
q as useTheme,
|
|
512
|
+
K as useThemeStore
|
|
423
513
|
};
|