vlite3 1.4.7 → 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.
Files changed (34) hide show
  1. package/components/AppShell/AppShellLayoutStorefront.vue.js +18 -18
  2. package/components/CategoryManager/CategoryManager.vue2.js +2 -2
  3. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  4. package/components/Dropdown/DropdownMenu.vue2.js +0 -1
  5. package/components/Input.vue.js +33 -25
  6. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  7. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  8. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  9. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +44 -0
  10. package/components/ScaleGenerator/ScaleGenerator.vue.js +110 -0
  11. package/components/ScaleGenerator/ScaleGenerator.vue2.js +4 -0
  12. package/components/ScaleGenerator/index.d.ts +2 -0
  13. package/components/ScaleGenerator/types.d.ts +63 -0
  14. package/components/Screen/ScreenFilter.vue.js +2 -2
  15. package/components/ThemeProvider/ThemeProvider.vue.d.ts +27 -0
  16. package/components/ThemeProvider/ThemeProvider.vue.js +37 -0
  17. package/components/ThemeProvider/ThemeProvider.vue2.js +4 -0
  18. package/components/ThemeProvider/index.d.ts +3 -0
  19. package/components/ThemeProvider/themeVars.d.ts +16 -0
  20. package/components/ThemeProvider/themeVars.js +372 -0
  21. package/components/ThemeProvider/types.d.ts +46 -0
  22. package/components/Timeline/Timeline.vue.js +17 -17
  23. package/components/Timeline/TimelineItem.vue.js +13 -13
  24. package/composables/useThemeStyles.d.ts +8 -0
  25. package/composables/useThemeStyles.js +9 -0
  26. package/index.d.ts +3 -0
  27. package/index.js +387 -373
  28. package/package.json +1 -1
  29. package/style.css +1 -1
  30. package/utils/colorUtils.d.ts +41 -0
  31. package/utils/colorUtils.js +36 -0
  32. package/utils/index.d.ts +1 -0
  33. /package/components/RichTextEditor/{RichTextLinkPopover.vue2.js → RichTextLinkPopover.vue.js} +0 -0
  34. /package/components/RichTextEditor/{RichTextToolbar.vue2.js → RichTextToolbar.vue.js} +0 -0
@@ -0,0 +1,3 @@
1
+ export { default as ThemeProvider } from './ThemeProvider.vue';
2
+ export type { ThemeProviderProps, ThemeStyles, ThemeMaxWidth } from './types';
3
+ export { buildThemeVariables, buildCardOverrideStyles } from './themeVars';
@@ -0,0 +1,16 @@
1
+ import { ThemeProviderProps, ThemeStyles } from './types';
2
+ export declare const DEFAULT_BASE_FONT_SIZE = 16;
3
+ export declare const DEFAULT_HEADING_SCALE = 1.25;
4
+ export declare const DEFAULT_BORDER_RADIUS = 8;
5
+ export declare const DEFAULT_MAX_WIDTH = 1440;
6
+ /**
7
+ * Nested card overrides. Lives outside `buildThemeVariables` because the SFC
8
+ * has to inject it as a real `<style>` block (it targets descendant
9
+ * `.bg-card .bg-card` selectors which cannot be expressed as inline variables).
10
+ */
11
+ export declare function buildCardOverrideStyles(bg: string, isDark: boolean): string;
12
+ /**
13
+ * Compute the full theme-styles record from a {@link ThemeProviderProps}.
14
+ * Pure: no DOM, no Vue. Re-usable from tests and from server-side code.
15
+ */
16
+ export declare function buildThemeVariables(props: ThemeProviderProps): ThemeStyles;
@@ -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>;
@@ -1,10 +1,10 @@
1
- import { defineComponent as p, computed as g, openBlock as r, createElementBlock as d, normalizeClass as k, createElementVNode as b, normalizeStyle as S, createCommentVNode as P, Fragment as C, renderList as B, isMemoSame as T, createBlock as z, withCtx as o, renderSlot as n, mergeProps as s } from "vue";
1
+ import { defineComponent as p, computed as g, openBlock as r, createElementBlock as d, normalizeClass as k, createElementVNode as b, normalizeStyle as S, createCommentVNode as x, Fragment as C, renderList as B, isMemoSame as T, createBlock as z, withCtx as o, renderSlot as s, mergeProps as n } from "vue";
2
2
  import V from "./TimelineItem.vue.js";
3
- const E = {
3
+ const j = {
4
4
  key: 0,
5
5
  class: "absolute top-4 left-4 right-4 h-0.5 bg-border",
6
6
  "aria-hidden": "true"
7
- }, M = {
7
+ }, E = {
8
8
  key: 1,
9
9
  class: "absolute top-4 left-4 right-4 h-0.5 bg-border block sm:hidden",
10
10
  "aria-hidden": "true"
@@ -22,8 +22,8 @@ const E = {
22
22
  },
23
23
  emits: ["step-click"],
24
24
  setup(e, { emit: w }) {
25
- const l = e, x = w, a = g(() => l.direction === "vertical"), y = g(() => l.steps.length <= 1 ? 0 : Math.min(l.activeStep, l.steps.length - 1) / (l.steps.length - 1) * 100), $ = (i, f) => {
26
- x("step-click", i, f);
25
+ const l = e, P = w, a = g(() => l.direction === "vertical"), y = g(() => l.steps.length <= 1 ? 0 : Math.min(l.activeStep, l.steps.length - 1) / (l.steps.length - 1) * 100), $ = (i, f) => {
26
+ P("step-click", i, f);
27
27
  };
28
28
  return (i, f) => (r(), d("nav", {
29
29
  "aria-label": "Progress",
@@ -35,22 +35,22 @@ const E = {
35
35
  "relative flex",
36
36
  a.value ? "flex-col space-y-0" : "",
37
37
  !a.value && e.textPosition === "bottom" ? "flex-row w-full justify-between items-center" : "",
38
- !a.value && e.textPosition === "right" ? "flex-row w-full" : ""
38
+ !a.value && e.textPosition === "right" ? "flex-row w-full max-sm:justify-between max-sm:items-center" : ""
39
39
  ])
40
40
  }, [
41
- !a.value && e.textPosition === "bottom" ? (r(), d("div", E, [
41
+ !a.value && e.textPosition === "bottom" ? (r(), d("div", j, [
42
42
  b("div", {
43
43
  class: "h-full bg-primary transition-all duration-300 ease-in-out",
44
44
  style: S({ width: `${y.value}%` })
45
45
  }, null, 4)
46
- ])) : P("", !0),
47
- !a.value && e.textPosition === "right" ? (r(), d("div", M, [
46
+ ])) : x("", !0),
47
+ !a.value && e.textPosition === "right" ? (r(), d("div", E, [
48
48
  b("div", {
49
49
  class: "h-full bg-primary transition-all duration-300 ease-in-out",
50
50
  style: S({ width: `${y.value}%` })
51
51
  }, null, 4)
52
- ])) : P("", !0),
53
- (r(!0), d(C, null, B(e.steps, (c, m, N, u) => {
52
+ ])) : x("", !0),
53
+ (r(!0), d(C, null, B(e.steps, (c, m, M, u) => {
54
54
  const v = [
55
55
  c,
56
56
  m,
@@ -77,22 +77,22 @@ const E = {
77
77
  onStepClick: $
78
78
  }, {
79
79
  indicator: o((t) => [
80
- n(i.$slots, "indicator", s({ ref_for: !0 }, t))
80
+ s(i.$slots, "indicator", n({ ref_for: !0 }, t))
81
81
  ]),
82
82
  title: o((t) => [
83
- n(i.$slots, "title", s({ ref_for: !0 }, t))
83
+ s(i.$slots, "title", n({ ref_for: !0 }, t))
84
84
  ]),
85
85
  subtitle: o((t) => [
86
- n(i.$slots, "subtitle", s({ ref_for: !0 }, t))
86
+ s(i.$slots, "subtitle", n({ ref_for: !0 }, t))
87
87
  ]),
88
88
  status: o((t) => [
89
- n(i.$slots, "status", s({ ref_for: !0 }, t))
89
+ s(i.$slots, "status", n({ ref_for: !0 }, t))
90
90
  ]),
91
91
  content: o((t) => [
92
- n(i.$slots, "content", s({ ref_for: !0 }, t))
92
+ s(i.$slots, "content", n({ ref_for: !0 }, t))
93
93
  ]),
94
94
  body: o((t) => [
95
- n(i.$slots, "body", s({ ref_for: !0 }, t))
95
+ s(i.$slots, "body", n({ ref_for: !0 }, t))
96
96
  ]),
97
97
  _: 3
98
98
  }, 8, ["step", "index", "is-last", "active-step", "direction", "text-position", "line-style", "indicator-type", "clickable"]));
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, computed as b, openBlock as s, createElementBlock as l, normalizeClass as o, createElementVNode as i, createVNode as y, createCommentVNode as c, renderSlot as a, toDisplayString as d, createBlock as g, resolveDynamicComponent as I, normalizeProps as $, mergeProps as L } from "vue";
1
+ import { defineComponent as P, computed as b, openBlock as n, createElementBlock as l, normalizeClass as o, createElementVNode as i, createVNode as y, createCommentVNode as c, renderSlot as a, toDisplayString as d, createBlock as g, resolveDynamicComponent as I, normalizeProps as $, mergeProps as L } from "vue";
2
2
  import h from "./TimelineIndicator.vue.js";
3
3
  import B from "../StatusChip/StatusChip.vue.js";
4
4
  import { $t as r } from "../../utils/i18n.js";
@@ -33,10 +33,10 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
33
33
  },
34
34
  emits: ["step-click"],
35
35
  setup(t, { emit: v }) {
36
- const n = t, k = v, S = b(() => n.direction === "vertical"), m = b(() => n.step.progressStatus ? n.step.progressStatus : n.index < n.activeStep ? "completed" : n.index === n.activeStep ? "current" : "upcoming"), u = (e) => e.titleI18n ? r(e.titleI18n) : e.title, w = (e) => e.subtitleI18n ? r(e.subtitleI18n) : e.subtitle, x = (e) => e.descriptionI18n ? r(e.descriptionI18n) : e.description, f = () => {
37
- n.clickable && k("step-click", n.step, n.index);
36
+ const s = t, k = v, S = b(() => s.direction === "vertical"), m = b(() => s.step.progressStatus ? s.step.progressStatus : s.index < s.activeStep ? "completed" : s.index === s.activeStep ? "current" : "upcoming"), u = (e) => e.titleI18n ? r(e.titleI18n) : e.title, w = (e) => e.subtitleI18n ? r(e.subtitleI18n) : e.subtitle, x = (e) => e.descriptionI18n ? r(e.descriptionI18n) : e.description, f = () => {
37
+ s.clickable && k("step-click", s.step, s.index);
38
38
  };
39
- return (e, F) => S.value ? (s(), l("li", {
39
+ return (e, F) => S.value ? (n(), l("li", {
40
40
  key: 0,
41
41
  class: o(["relative flex w-full", t.clickable ? "cursor-pointer" : ""]),
42
42
  onClick: f
@@ -48,7 +48,7 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
48
48
  index: t.index,
49
49
  icon: t.step.icon
50
50
  }, null, 8, ["status", "type", "index", "icon"]),
51
- t.isLast ? c("", !0) : (s(), l("div", {
51
+ t.isLast ? c("", !0) : (n(), l("div", {
52
52
  key: 0,
53
53
  class: o(["my-2 flex-1 transition-colors duration-300", [
54
54
  t.lineStyle === "dashed" ? "w-0 border-l-[1.5px] border-dashed" : "w-0.5",
@@ -76,15 +76,15 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
76
76
  step: t.step,
77
77
  index: t.index
78
78
  }, () => [
79
- t.step.subtitle || t.step.subtitleI18n ? (s(), l("p", N, d(w(t.step)), 1)) : c("", !0)
79
+ t.step.subtitle || t.step.subtitleI18n ? (n(), l("p", N, d(w(t.step)), 1)) : c("", !0)
80
80
  ])
81
81
  ]),
82
- t.step.status || e.$slots.status ? (s(), l("div", j, [
82
+ t.step.status || e.$slots.status ? (n(), l("div", j, [
83
83
  a(e.$slots, "status", {
84
84
  step: t.step,
85
85
  index: t.index
86
86
  }, () => [
87
- t.step.status ? (s(), g(B, {
87
+ t.step.status ? (n(), g(B, {
88
88
  key: 0,
89
89
  status: t.step.status
90
90
  }, null, 8, ["status"])) : c("", !0)
@@ -96,19 +96,19 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
96
96
  step: t.step,
97
97
  index: t.index
98
98
  }, () => [
99
- t.step.component ? (s(), g(I(t.step.component), $(L({ key: 0 }, t.step.componentProps)), null, 16)) : t.step.description || t.step.descriptionI18n ? (s(), l("p", E, d(x(t.step)), 1)) : c("", !0)
99
+ t.step.component ? (n(), g(I(t.step.component), $(L({ key: 0 }, t.step.componentProps)), null, 16)) : t.step.description || t.step.descriptionI18n ? (n(), l("p", E, d(x(t.step)), 1)) : c("", !0)
100
100
  ])
101
101
  ])
102
102
  ])
103
103
  ])
104
104
  ], 2)
105
- ], 2)) : (s(), l("li", {
105
+ ], 2)) : (n(), l("li", {
106
106
  key: 1,
107
107
  onClick: f,
108
108
  class: o([
109
109
  "relative",
110
110
  t.clickable ? "cursor-pointer" : "",
111
- t.textPosition === "bottom" ? "flex-none w-8" : "flex-1 last:flex-none"
111
+ t.textPosition === "bottom" ? "flex-none w-8" : "flex-none w-8 sm:flex-1 sm:w-auto sm:last:flex-none"
112
112
  ])
113
113
  }, [
114
114
  i("div", {
@@ -139,10 +139,10 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
139
139
  i("span", {
140
140
  class: o(["text-sm font-medium leading-tight", m.value === "upcoming" ? "text-muted-foreground" : "text-primary"])
141
141
  }, d(u(t.step)), 3),
142
- t.step.description || t.step.descriptionI18n ? (s(), l("span", q, d(x(t.step)), 1)) : c("", !0)
142
+ t.step.description || t.step.descriptionI18n ? (n(), l("span", q, d(x(t.step)), 1)) : c("", !0)
143
143
  ])
144
144
  ], 2),
145
- t.textPosition === "right" && !t.isLast ? (s(), l("div", A, [
145
+ t.textPosition === "right" && !t.isLast ? (n(), l("div", A, [
146
146
  i("div", {
147
147
  class: o(["h-full bg-primary transition-all duration-300", t.index < t.activeStep ? "w-full" : "w-0"])
148
148
  }, null, 2)
@@ -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';