vlite3 1.4.8 → 1.4.9

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.
@@ -0,0 +1,372 @@
1
+ import { hexToHSL as s, mixColorHex as a } from "../../utils/colorUtils.js";
2
+ const x = 16, k = 1.25, y = 8, $ = 1440, g = (r, o) => {
3
+ const l = Number(r);
4
+ return Number.isFinite(l) && l > 0 ? l : o;
5
+ }, F = (r, o) => {
6
+ const l = Number(r);
7
+ return Number.isFinite(l) && l >= 0 ? l : o;
8
+ }, i = (r) => Number.parseFloat(r.toFixed(8)).toString(), w = [
9
+ "0.5",
10
+ "1",
11
+ "1.5",
12
+ "2",
13
+ "2.5",
14
+ "3",
15
+ "3.5",
16
+ "4",
17
+ "4.5",
18
+ "5",
19
+ "5.5",
20
+ "6",
21
+ "6.5",
22
+ "7",
23
+ "7.5",
24
+ "8",
25
+ "8.5",
26
+ "9",
27
+ "9.5",
28
+ "10",
29
+ "10.5",
30
+ "11",
31
+ "11.5",
32
+ "12",
33
+ "12.5",
34
+ "13",
35
+ "13.5",
36
+ "14",
37
+ "14.5",
38
+ "15",
39
+ "15.5",
40
+ "16",
41
+ "16.5",
42
+ "17",
43
+ "17.5",
44
+ "18",
45
+ "18.5",
46
+ "19",
47
+ "19.5",
48
+ "20"
49
+ ], E = {
50
+ 1: 0.95,
51
+ "1.5": 0.91,
52
+ 2: 0.85,
53
+ "2.5": 0.8,
54
+ 3: 0.75,
55
+ "3.5": 0.7,
56
+ 4: 0.65,
57
+ 5: 0.6,
58
+ 6: 0.55,
59
+ 7: 0.5,
60
+ 8: 0.45
61
+ }, B = {
62
+ "0.5": 1,
63
+ 1: 1.03030303,
64
+ "1.5": 1.06060606,
65
+ 2: 1.1030303,
66
+ "2.5": 1.13333333,
67
+ 3: 1.16363636,
68
+ "3.5": 1.19393939,
69
+ 4: 1.2242424242424241,
70
+ "4.5": 1.31515152,
71
+ 5: 1.39393939,
72
+ "5.5": 1.48484848,
73
+ 6: 1.57575758,
74
+ "6.5": 1.63636364,
75
+ 7: 1.6969697,
76
+ "7.5": 1.75757576,
77
+ 8: 1.81818182,
78
+ "8.5": 1.87878788,
79
+ 9: 1.93939394,
80
+ "9.5": 2,
81
+ 10: 2.06060606,
82
+ "10.5": 2.1,
83
+ 11: 2.15,
84
+ "11.5": 2.2,
85
+ 12: 2.25,
86
+ "12.5": 2.3,
87
+ 13: 2.35,
88
+ "13.5": 2.4,
89
+ 14: 2.45,
90
+ "14.5": 2.5,
91
+ 15: 2.55,
92
+ "15.5": 2.6,
93
+ 16: 2.65,
94
+ "16.5": 2.7,
95
+ 17: 2.75,
96
+ "17.5": 2.8,
97
+ 18: 2.85,
98
+ "18.5": 2.9,
99
+ 19: 2.95,
100
+ "19.5": 3,
101
+ 20: 3.05
102
+ }, T = [
103
+ ["xs", 0.75, 1],
104
+ ["sm", 0.875, 1.25],
105
+ ["base", 1, 1.5],
106
+ ["lg", 1.125, 1.75],
107
+ ["xl", 1.25, 1.75],
108
+ ["2xl", 1.5, 2],
109
+ ["3xl", 1.875, 2.25],
110
+ ["4xl", 2.25, 2.5],
111
+ ["5xl", 3, 3],
112
+ ["6xl", 3.75, 3.75]
113
+ ], C = {
114
+ "--font-weight-extralight": "200",
115
+ "--font-weight-light": "300",
116
+ "--font-weight-normal": "400",
117
+ "--font-weight-medium": "500",
118
+ "--font-weight-semibold": "600",
119
+ "--font-weight-bold": "700",
120
+ "--font-weight-extrabold": "800",
121
+ "--font-weight-black": "900"
122
+ }, L = (r, o, l) => {
123
+ const t = o / x;
124
+ r["font-size"] = `${o}px`, r["--font-size-base"] = `${o}px`, T.forEach(([c, e, f]) => {
125
+ const u = e * t;
126
+ r[`--text-${c}`] = `${i(u)}rem`, r[`--text-${c}--line-height`] = f === e ? "1" : `calc(${i(f * t)} / ${i(u)})`;
127
+ }), Object.entries(E).forEach(([c, e]) => {
128
+ r[`--text--fs-${c}`] = `${i(e)}em`;
129
+ });
130
+ const n = l / k;
131
+ w.forEach((c) => {
132
+ const f = 1 + (B[c] - 1) * n;
133
+ r[`--text-fs-${c}`] = `${i(f)}em`;
134
+ });
135
+ }, _ = (r, o) => {
136
+ const l = o / x;
137
+ r["--radius"] = `${i(l)}rem`, r["--radius-sm"] = `${i(l * 0.8)}rem`, r["--radius-md"] = `${i(l)}rem`, r["--radius-lg"] = `${i(l * 1.34)}rem`, r["--radius-xl"] = `${i(l * 1.6)}rem`, r["--radius-2xl"] = `${i(l * 2)}rem`, r["--radius-3xl"] = `${i(l * 3)}rem`;
138
+ }, S = (r, o) => {
139
+ if (typeof o == "string") {
140
+ const t = o.trim().toLowerCase();
141
+ r["--shop-max-width"] = t === "full" || t === "none" ? "none" : o;
142
+ return;
143
+ }
144
+ if (o === 0) {
145
+ r["--shop-max-width"] = "none";
146
+ return;
147
+ }
148
+ const l = g(o ?? void 0, $);
149
+ r["--shop-max-width"] = `${l}px`;
150
+ }, A = {
151
+ danger: {
152
+ light: "#ffeeee",
153
+ default: "#ff3b30",
154
+ dark: "#ee392e",
155
+ fg: "#ffffff",
156
+ fgLight: "#d70015",
157
+ subtle: "#fdecea",
158
+ subtleFg: "#b42318",
159
+ subtleBorder: "#f5c2c0"
160
+ },
161
+ warning: {
162
+ light: "#fbf4e6",
163
+ default: "#ff9500",
164
+ dark: "#ee8b06",
165
+ fg: "#ffffff",
166
+ fgLight: "#c95100",
167
+ subtle: "#fef7e6",
168
+ subtleFg: "#8a4b08",
169
+ subtleBorder: "#f6d8a8"
170
+ },
171
+ info: {
172
+ light: "#e3eeff",
173
+ default: "#007aff",
174
+ dark: "#0e72ee",
175
+ fg: "#ffffff",
176
+ fgLight: "#0051a8",
177
+ subtle: "#e8f0fe",
178
+ subtleFg: "#1a56db",
179
+ subtleBorder: "#c3dafe"
180
+ },
181
+ success: {
182
+ light: "#e1ede6",
183
+ default: "#007E51",
184
+ dark: "#06764c",
185
+ fg: "#ffffff",
186
+ fgLight: "#248a3d",
187
+ subtle: "#ECF8EB",
188
+ subtleFg: "#216e39",
189
+ subtleBorder: "#b7e1c1"
190
+ },
191
+ secondary: {
192
+ subtle: "#f1f1ef",
193
+ subtleFg: "#37352f",
194
+ subtleBorder: "#e3e2df"
195
+ },
196
+ purple: { subtle: "#f3ecff", subtleFg: "#6941c6", subtleBorder: "#e4d7ff" },
197
+ teal: { subtle: "#e6f6f5", subtleFg: "#0f766e", subtleBorder: "#bfe8e5" },
198
+ indigo: { subtle: "#e7e6fd", subtleFg: "#4338ca", subtleBorder: "#d6dcff" },
199
+ orange: { subtle: "#fff1e6", subtleFg: "#c2410c", subtleBorder: "#ffd6bf" },
200
+ pink: { subtle: "#fdebf3", subtleFg: "#be185d", subtleBorder: "#f8c6db" },
201
+ cyan: { subtle: "#E1F8F8", subtleFg: "#0e7490", subtleBorder: "#c2ecf5" },
202
+ chart: ["#6366f1", "#22c55e", "#f59e0b", "#ef4444", "#3b82f6", "#ec4899"]
203
+ }, N = {
204
+ danger: {
205
+ light: "#391413",
206
+ default: "#7F1D1D",
207
+ dark: "#882d28",
208
+ fg: "#ffffff",
209
+ fgLight: "#FCFCFC",
210
+ subtle: "#2a1111",
211
+ subtleFg: "#FF4B4B",
212
+ subtleBorder: "#991b1b"
213
+ },
214
+ warning: {
215
+ light: "#34220a",
216
+ default: "#95600E",
217
+ dark: "#9e6a23",
218
+ fg: "#ffffff",
219
+ fgLight: "#ff9f0a",
220
+ subtle: "#2a1c07",
221
+ subtleFg: "#fbbf24",
222
+ subtleBorder: "#92400e"
223
+ },
224
+ info: {
225
+ light: "#112039",
226
+ default: "#1a4298",
227
+ dark: "#3360d2",
228
+ fg: "#ffffff",
229
+ fgLight: "#93c5fd",
230
+ subtle: "#0f1e33",
231
+ subtleFg: "#d2e6ff",
232
+ subtleBorder: "#1e40af"
233
+ },
234
+ success: {
235
+ light: "#112815",
236
+ default: "#0e4d2e",
237
+ dark: "#235a3b",
238
+ fg: "#ffffff",
239
+ fgLight: "#6ee7b7",
240
+ subtle: "#0f2419",
241
+ subtleFg: "#e2f5e9",
242
+ subtleBorder: "#1f7a4c"
243
+ },
244
+ secondary: {
245
+ subtle: "#1f1f1f",
246
+ subtleFg: "#e4e4e7",
247
+ subtleBorder: "#3f3f46"
248
+ },
249
+ purple: { subtle: "#1d1333", subtleFg: "#c084fc", subtleBorder: "#6b21a8" },
250
+ teal: { subtle: "#0f2a28", subtleFg: "#2dd4bf", subtleBorder: "#0f766e" },
251
+ indigo: { subtle: "#1c0a49", subtleFg: "#dcd1ff", subtleBorder: "#3730a3" },
252
+ orange: { subtle: "#2a1709", subtleFg: "#fb923c", subtleBorder: "#9a3412" },
253
+ pink: { subtle: "#2a0f1c", subtleFg: "#f472b6", subtleBorder: "#9d174d" },
254
+ cyan: { subtle: "#0e242a", subtleFg: "#22d3ee", subtleBorder: "#0e7490" },
255
+ chart: ["#818cf8", "#34d399", "#fbbf24", "#fb7185", "#60a5fa", "#f472b6"]
256
+ }, D = (r, o) => {
257
+ const l = o ? N : A;
258
+ ["danger", "warning", "info", "success"].forEach((c) => {
259
+ const e = l[c];
260
+ r[`--color-${c}-light`] = e.light, r[`--color-${c}`] = e.default, r[`--color-${c}-dark`] = e.dark, r[`--color-${c}-fg`] = e.fg, r[`--color-${c}-fg-light`] = e.fgLight, r[`--color-${c}-subtle`] = e.subtle, r[`--color-${c}-subtle-fg`] = e.subtleFg, r[`--color-${c}-subtle-border`] = e.subtleBorder, c === "danger" && (r["--color-destructive"] = e.default, r["--color-destructive-foreground"] = e.fg);
261
+ }), [
262
+ "secondary",
263
+ "purple",
264
+ "teal",
265
+ "indigo",
266
+ "orange",
267
+ "pink",
268
+ "cyan"
269
+ ].forEach((c) => {
270
+ const e = l[c];
271
+ r[`--color-${c}-subtle`] = e.subtle, r[`--color-${c}-subtle-fg`] = e.subtleFg, r[`--color-${c}-subtle-border`] = e.subtleBorder;
272
+ }), l.chart.forEach((c, e) => {
273
+ r[`--color-chart-${e + 1}`] = c;
274
+ });
275
+ };
276
+ function O(r, o) {
277
+ if (!r) return "";
278
+ if (o) {
279
+ const c = a(r, "#ffffff", 0.07), e = a(r, "#ffffff", 0.12), f = a(r, "#ffffff", 0.1), u = a(r, "#ffffff", 0.14), d = a(r, "#ffffff", 0.13), v = a(r, "#ffffff", 0.16), b = a(r, "#ffffff", 0.07), h = a(r, "#ffffff", 0.11), m = a(r, "#ffffff", 0.1), p = a(r, "#ffffff", 0.14);
280
+ return `
281
+ .vlite-theme-provider.dark .bg-card {
282
+ --color-body: ${c} !important;
283
+ --color-white: ${c} !important;
284
+ --color-mixture-1: ${e} !important;
285
+ --color-mixture-2: #ffffff !important;
286
+ background-color: ${c} !important;
287
+ }
288
+ .vlite-theme-provider.dark .bg-card .bg-card {
289
+ --color-body: ${f} !important;
290
+ --color-white: ${f} !important;
291
+ --color-mixture-1: ${u} !important;
292
+ --color-mixture-2: #000000;
293
+ background-color: ${f} !important;
294
+ }
295
+ .vlite-theme-provider.dark .bg-card .bg-card .bg-card {
296
+ --color-body: ${d} !important;
297
+ --color-white: ${d} !important;
298
+ --color-mixture-1: ${v} !important;
299
+ --color-mixture-2: #000000;
300
+ background-color: ${d} !important;
301
+ }
302
+ .vlite-theme-provider.dark .bg-card-light {
303
+ --color-body: ${b} !important;
304
+ --color-white: ${b} !important;
305
+ --color-mixture-1: ${h} !important;
306
+ --color-mixture-2: #ffffff !important;
307
+ background-color: ${b} !important;
308
+ }
309
+ .vlite-theme-provider.dark .bg-card .bg-card-light {
310
+ --color-body: ${m} !important;
311
+ --color-white: ${m} !important;
312
+ --color-mixture-1: ${p} !important;
313
+ --color-mixture-2: #000000;
314
+ background-color: ${m} !important;
315
+ }
316
+ `;
317
+ }
318
+ const l = a(r, "#000000", 0.03), t = a(r, "#000000", 0.055), n = a(r, "#000000", 0.09);
319
+ return `
320
+ .vlite-theme-provider .bg-card,
321
+ .vlite-theme-provider .bg-card-light {
322
+ --color-body: ${l} !important;
323
+ --color-white: ${l} !important;
324
+ --color-mixture-1: ${l} !important;
325
+ --color-mixture-2: #000000 !important;
326
+ background-color: ${l} !important;
327
+ border-color: color-mix(in oklab, var(--color-mixture-1) 94%, var(--color-mixture-2));
328
+ }
329
+ .vlite-theme-provider .bg-card .bg-card,
330
+ .vlite-theme-provider .bg-card-light .bg-card-light {
331
+ --color-body: ${t} !important;
332
+ --color-white: ${t} !important;
333
+ --color-mixture-1: ${t};
334
+ --color-mixture-2: #000000;
335
+ background-color: ${t} !important;
336
+ }
337
+ .vlite-theme-provider .bg-card .bg-card .bg-card,
338
+ .vlite-theme-provider .bg-card-light .bg-card-light .bg-card-light {
339
+ --color-body: ${n} !important;
340
+ --color-white: ${n} !important;
341
+ --color-mixture-1: ${n};
342
+ --color-mixture-2: #000000;
343
+ background-color: ${n} !important;
344
+ }
345
+ `;
346
+ }
347
+ function R(r) {
348
+ const o = {};
349
+ if (o["--color-white"] = r.bgColor ?? "#ffffff", o["--color-black"] = "#000000", r.bgColor) {
350
+ o["--color-background"] = r.bgColor, o["--color-body"] = r.bgColor;
351
+ const l = s(r.bgColor).l < 50;
352
+ l ? (o["--color-mixture-1"] = "#0c0c0c", o["--color-mixture-2"] = "#ffffff", o["--color-white"] = r.bgColor, o["--color-black"] = "#ffffff", o["--color-gray-50"] = "color-mix(in oklab, var(--color-mixture-1) 96.5%, var(--color-mixture-2))", o["--color-gray-100"] = "color-mix(in oklab, var(--color-mixture-1) 94.5%, var(--color-mixture-2))", o["--color-gray-150"] = "color-mix(in oklab, var(--color-mixture-1) 90.5%, var(--color-mixture-2))", o["--color-gray-200"] = "color-mix(in oklab, var(--color-mixture-1) 86.5%, var(--color-mixture-2))", o["--color-gray-250"] = "color-mix(in oklab, var(--color-mixture-1) 82.5%, var(--color-mixture-2))", o["--color-gray-300"] = "color-mix(in oklab, var(--color-mixture-1) 79.5%, var(--color-mixture-2))", o["--color-gray-350"] = "color-mix(in oklab, var(--color-mixture-1) 70%, var(--color-mixture-2))", o["--color-gray-400"] = "color-mix(in oklab, var(--color-mixture-1) 62%, var(--color-mixture-2))", o["--color-gray-500"] = "color-mix(in oklab, var(--color-mixture-1) 49%, var(--color-mixture-2))", o["--color-gray-600"] = "color-mix(in oklab, var(--color-mixture-1) 39%, var(--color-mixture-2))", o["--color-gray-700"] = "color-mix(in oklab, var(--color-mixture-1) 27%, var(--color-mixture-2))", o["--color-gray-800"] = "color-mix(in oklab, var(--color-mixture-1) 17%, var(--color-mixture-2))", o["--color-gray-850"] = "color-mix(in oklab, var(--color-mixture-1) 10%, var(--color-mixture-2))", o["--color-gray-900"] = "color-mix(in oklab, var(--color-mixture-1) 6%, var(--color-mixture-2))", o["--color-gray-950"] = "var(--color-mixture-2)", o["--color-foreground"] = "var(--color-gray-850)", o["--color-border"] = "color-mix(in oklab, var(--color-background) 74%, #ffffff)", o["--color-input"] = "color-mix(in oklab, var(--color-background) 70%, #ffffff)", o["--color-card"] = "color-mix(in oklab, var(--color-background) 94%, #ffffff)", o["--color-card-light"] = "color-mix(in oklab, var(--color-background) 96%, #ffffff)", o["--color-secondary"] = "color-mix(in oklab, var(--color-background) 87.5%, #ffffff)", o["--color-secondary-foreground"] = "var(--color-foreground)", o["--color-muted"] = "color-mix(in oklab, var(--color-background) 92.5%, #ffffff)", o["--color-muted-light"] = "color-mix(in oklab, var(--color-background) 95%, #ffffff)", o["--color-muted-foreground"] = "var(--color-gray-600)", o["--color-accent"] = "color-mix(in oklab, var(--color-background) 90%, #ffffff)", o["--color-accent-foreground"] = "var(--color-foreground)", o["--color-scrollbar"] = "color-mix(in oklab, var(--color-background) 80%, #ffffff)", o["--color-scrollbar-hover"] = "color-mix(in oklab, var(--color-background) 75%, #ffffff)", o["--shadow-sm"] = "none", o["--shadow-DEFAULT"] = "none", o["--shadow-md"] = "none", o["--shadow-lg"] = "none", o["--shadow-xl"] = "none") : (o["--color-mixture-1"] = "#ffffff", o["--color-mixture-2"] = "#000000", o["--color-gray-50"] = "color-mix(in oklab, var(--color-mixture-1) 98%, var(--color-mixture-2))", o["--color-gray-100"] = "color-mix(in oklab, var(--color-mixture-1) 97%, var(--color-mixture-2))", o["--color-gray-150"] = "color-mix(in oklab, var(--color-mixture-1) 96%, var(--color-mixture-2))", o["--color-gray-200"] = "color-mix(in oklab, var(--color-mixture-1) 94%, var(--color-mixture-2))", o["--color-gray-250"] = "color-mix(in oklab, var(--color-mixture-1) 92%, var(--color-mixture-2))", o["--color-gray-300"] = "color-mix(in oklab, var(--color-mixture-1) 86%, var(--color-mixture-2))", o["--color-gray-350"] = "color-mix(in oklab, var(--color-mixture-1) 80%, var(--color-mixture-2))", o["--color-gray-400"] = "color-mix(in oklab, var(--color-mixture-1) 62%, var(--color-mixture-2))", o["--color-gray-500"] = "color-mix(in oklab, var(--color-mixture-1) 49%, var(--color-mixture-2))", o["--color-gray-600"] = "color-mix(in oklab, var(--color-mixture-1) 39%, var(--color-mixture-2))", o["--color-gray-700"] = "color-mix(in oklab, var(--color-mixture-1) 27%, var(--color-mixture-2))", o["--color-gray-800"] = "color-mix(in oklab, var(--color-mixture-1) 17%, var(--color-mixture-2))", o["--color-gray-850"] = "color-mix(in oklab, var(--color-mixture-1) 10%, var(--color-mixture-2))", o["--color-gray-900"] = "color-mix(in oklab, var(--color-mixture-1) 6%, var(--color-mixture-2))", o["--color-gray-950"] = "var(--color-mixture-2)", o["--color-foreground"] = "var(--color-gray-850)", o["--color-border"] = "color-mix(in oklab, var(--color-background) 88%, #000000)", o["--color-input"] = "color-mix(in oklab, var(--color-background) 87%, #000000)", o["--color-card"] = "color-mix(in oklab, var(--color-background) 96%, #000000)", o["--color-card-light"] = "color-mix(in oklab, var(--color-background) 98%, #000000)", o["--color-secondary"] = "color-mix(in oklab, var(--color-background) 94.8%, #000000)", o["--color-secondary-foreground"] = "var(--color-foreground)", o["--color-muted"] = "color-mix(in oklab, var(--color-background) 94%, #000000)", o["--color-muted-light"] = "color-mix(in oklab, var(--color-background) 97%, #000000)", o["--color-muted-foreground"] = "color-mix(in oklab, var(--color-background) 10%, #000000)", o["--color-accent"] = "color-mix(in oklab, var(--color-background) 95%, #000000)", o["--color-accent-foreground"] = "var(--color-foreground)", o["--color-scrollbar"] = "color-mix(in oklab, var(--color-background) 80%, #000000)", o["--color-scrollbar-hover"] = "color-mix(in oklab, var(--color-background) 75%, #000000)", o["--shadow-sm"] = "rgba(95, 97, 100, 0.07) 0px 15px 90px 0px, rgba(0, 0, 0, 0.02) 0.2px 0.2px 1px 0px", o["--shadow-DEFAULT"] = "rgba(55, 59, 74, 0.074) 0px 10px 55px 3px", o["--shadow-md"] = "var(--shadow-DEFAULT)", o["--shadow-lg"] = "rgba(100, 100, 111, 0.15) 0px 7px 40px -1px", o["--shadow-xl"] = "rgba(0, 0, 0, 0.2) 0px 15px 50px -12px"), D(o, l);
353
+ }
354
+ if (r.primaryColor) {
355
+ o["--color-primary"] = r.primaryColor;
356
+ const { l } = s(r.primaryColor), t = l > 50 ? "#171717" : "#fafafa";
357
+ o["--color-primary-foreground"] = t, o["--color-primary-fg"] = t, o["--color-primary-dark"] = `color-mix(in oklab, ${r.primaryColor} 80%, #000000)`, o["--color-primary-light"] = `color-mix(in oklab, ${t} 92%, ${r.primaryColor})`, o["--color-primary-fg-light"] = o["--color-primary-dark"];
358
+ }
359
+ return r.footerBgColor && (o["--color-footer"] = r.footerBgColor), o["--spacing"] = "0.25rem", Object.assign(o, C), L(
360
+ o,
361
+ g(r.baseFontSize, x),
362
+ g(r.headingScale, k)
363
+ ), _(o, F(r.borderRadius, y)), S(o, r.maxWidth), o["--tooltip-bg"] = "var(--color-background)", o["--tooltip-text"] = "var(--color-foreground)", o["--tooltip-border"] = "color-mix(in oklab, var(--color-mixture-1) 90%, var(--color-mixture-2))", o["--tooltip-radius"] = "var(--radius)", o["--tooltip-shadow"] = "var(--shadow-DEFAULT)", o["--tooltip-arrow-size"] = "0.5em", o["--tooltip-z-index"] = "50", o["--date-picker-border"] = "var(--color-border)", o["--date-picker-radius"] = "var(--radius)", o["--timer-picker-bg"] = "var(--color-background)", o["--iconPicker-border"] = "var(--color-border)", o;
364
+ }
365
+ export {
366
+ x as DEFAULT_BASE_FONT_SIZE,
367
+ y as DEFAULT_BORDER_RADIUS,
368
+ k as DEFAULT_HEADING_SCALE,
369
+ $ as DEFAULT_MAX_WIDTH,
370
+ O as buildCardOverrideStyles,
371
+ R as buildThemeVariables
372
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Public type surface for {@link ThemeProvider}.
3
+ *
4
+ * The provider is intentionally **data-driven**: it accepts plain theme tokens
5
+ * (colors, sizing, scale) and produces the matching set of CSS variables
6
+ * (`--color-*`, `--text-*`, `--radius-*`, `--shop-max-width`, …). Downstream
7
+ * app code can then map any domain object (shop theme, blog theme, dashboard
8
+ * theme) onto this single shape.
9
+ *
10
+ * Generic over `unknown` because the provider never reads the data itself —
11
+ * it just forwards the props to its computed style block.
12
+ */
13
+ export type ThemeMaxWidth = number | string | null | undefined;
14
+ export interface ThemeProviderProps {
15
+ /**
16
+ * Page background color. Used to derive the full set of `--color-*` tokens
17
+ * (foreground, border, card, muted, accent, scrollbar, …).
18
+ */
19
+ bgColor?: string;
20
+ /** Brand / primary color. Generates `--color-primary*` variants. */
21
+ primaryColor?: string;
22
+ /** Optional footer background. Surfaced as `--color-footer` if provided. */
23
+ footerBgColor?: string;
24
+ /** Base font size in `px`. Default `16`. Drives `--text-*` scale. */
25
+ baseFontSize?: number;
26
+ /** Heading ratio relative to the default `1.25` step. Default `1.25`. */
27
+ headingScale?: number;
28
+ /** Border radius in `px`. Default `8`. Drives `--radius*` family. */
29
+ borderRadius?: number;
30
+ /**
31
+ * Maximum content width:
32
+ * - `number` → emitted as `${n}px`
33
+ * - `'full' | 'none' | 0` → emitted as `none`
34
+ * - any other string is passed through verbatim
35
+ */
36
+ maxWidth?: ThemeMaxWidth;
37
+ /** Optional root class. Defaults to `'vlite-theme-provider'`. */
38
+ rootClass?: string;
39
+ }
40
+ /**
41
+ * The flat key/value record of CSS variables produced by
42
+ * {@link buildThemeVariables}. Consumers that need to read the resolved
43
+ * theme (e.g. a side panel that wants to read `--color-background`) can
44
+ * inject this from a parent `ThemeProvider`.
45
+ */
46
+ export type ThemeStyles = Record<string, string>;
@@ -0,0 +1,8 @@
1
+ import { ComputedRef, InjectionKey } from 'vue';
2
+ import { ThemeStyles } from '../components/ThemeProvider/types';
3
+ export declare const THEME_STYLES_KEY: InjectionKey<ComputedRef<ThemeStyles>>;
4
+ /**
5
+ * Inject the reactive theme-styles computed ref produced by the nearest
6
+ * `<ThemeProvider>` ancestor. Returns `undefined` if no provider is present.
7
+ */
8
+ export declare function useThemeStyles(): ComputedRef<ThemeStyles> | undefined;
@@ -0,0 +1,9 @@
1
+ import { inject as e } from "vue";
2
+ const t = /* @__PURE__ */ Symbol("vlite-theme-styles");
3
+ function i() {
4
+ return e(t, void 0);
5
+ }
6
+ export {
7
+ t as THEME_STYLES_KEY,
8
+ i as useThemeStyles
9
+ };
package/index.d.ts CHANGED
@@ -62,6 +62,9 @@ export * from './components/Rating';
62
62
  export * from './components/AsyncSelect';
63
63
  export * from './components/ImageComparison';
64
64
  export { default as ImageMagnifier } from './components/ImageMagnifier.vue';
65
+ export * from './components/ThemeProvider';
66
+ export * from './components/ScaleGenerator';
67
+ export { THEME_STYLES_KEY, useThemeStyles } from './composables/useThemeStyles';
65
68
  export { default as Icon } from './components/Icon.vue';
66
69
  export { default as Logo } from './components/Logo.vue';
67
70
  export { default as Alert } from './components/Alert.vue';