vlite3 1.5.23 → 1.5.25
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/components/AppShell/AppShell.vue.d.ts +1 -1
- package/components/CategoryManager/CategoryManager2.vue.js +3 -3
- package/components/ColorPicker/ColorPicker.vue.d.ts +3 -0
- package/components/ColorPicker/ColorPicker.vue.js +16 -14
- package/components/DatePicker.vue.d.ts +2 -0
- package/components/DatePicker.vue.js +19 -17
- package/components/Dropdown/Dropdown.vue.d.ts +2 -0
- package/components/Dropdown/Dropdown.vue.js +111 -106
- package/components/Dropdown/DropdownMenu.vue.d.ts +2 -0
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/{DropdownMenu3.vue.js → DropdownMenu2.vue.js} +24 -23
- package/components/Form/{AccordionView2.vue.js → AccordionView.vue.js} +1 -1
- package/components/Form/index2.vue.js +1 -1
- package/components/Modal.vue.d.ts +4 -0
- package/components/Modal.vue.js +2 -2
- package/components/Modal2.vue.js +59 -55
- package/components/Navbar/Navbar.vue.d.ts +1 -1
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover3.vue.js +2 -2
- package/components/RichTextEditor/RichTextToolbar3.vue.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +3 -3
- package/components/SidePanel.vue.d.ts +3 -1
- package/components/SidePanel.vue.js +1 -1
- package/components/SidePanel2.vue.js +39 -37
- package/components/ThemeProvider/themeVars.js +115 -115
- package/components/ThemeToggle.vue.d.ts +1 -1
- package/components/Tooltip.vue.d.ts +2 -0
- package/components/Tooltip.vue.js +13 -10
- package/composables/useOverlayPortal.d.ts +14 -0
- package/composables/useOverlayPortal.js +16 -0
- package/composables/useTheme.d.ts +2 -2
- package/composables/useTheme.js +64 -29
- package/docs/components/modal.md +18 -16
- package/docs-manifest.json +3 -3
- package/index.d.ts +1 -0
- package/index.js +334 -330
- package/package.json +2 -2
- package/style.css +193 -107
- /package/components/RichTextEditor/{RichTextLinkPopover2.vue.js → RichTextLinkPopover.vue.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar2.vue.js → RichTextToolbar.vue.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mixColorHex as i, hexToHSL as s } from "../../utils/colorUtils.js";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return Number.isFinite(
|
|
5
|
-
}, A = (o,
|
|
6
|
-
const
|
|
7
|
-
return Number.isFinite(
|
|
2
|
+
const m = 16, y = 1.25, T = 8, L = 1440, _ = 64, d = /* @__PURE__ */ new Map(), $ = (o, r) => {
|
|
3
|
+
const l = Number(o);
|
|
4
|
+
return Number.isFinite(l) && l > 0 ? l : r;
|
|
5
|
+
}, A = (o, r) => {
|
|
6
|
+
const l = Number(o);
|
|
7
|
+
return Number.isFinite(l) && l >= 0 ? l : r;
|
|
8
8
|
}, a = (o) => Number.parseFloat(o.toFixed(8)).toString(), N = [
|
|
9
9
|
"0.5",
|
|
10
10
|
"1",
|
|
@@ -119,34 +119,34 @@ const g = 16, y = 1.25, C = 8, L = 1440, _ = 64, d = /* @__PURE__ */ new Map(),
|
|
|
119
119
|
"--font-weight-bold": "700",
|
|
120
120
|
"--font-weight-extrabold": "800",
|
|
121
121
|
"--font-weight-black": "900"
|
|
122
|
-
}, z = (o,
|
|
123
|
-
const t =
|
|
124
|
-
o["font-size"] = `${
|
|
125
|
-
const u =
|
|
126
|
-
o[`--text-${
|
|
127
|
-
}), Object.entries(D).forEach(([
|
|
128
|
-
o[`--text--fs-${
|
|
122
|
+
}, z = (o, r, l) => {
|
|
123
|
+
const t = r / m;
|
|
124
|
+
o["font-size"] = `${r}px`, o["--font-size-base"] = `${r}px`, I.forEach(([e, c, n]) => {
|
|
125
|
+
const u = c * t;
|
|
126
|
+
o[`--text-${e}`] = `${a(u)}rem`, o[`--text-${e}--line-height`] = n === c ? "1" : `calc(${a(n * t)} / ${a(u)})`;
|
|
127
|
+
}), Object.entries(D).forEach(([e, c]) => {
|
|
128
|
+
o[`--text--fs-${e}`] = `${a(c)}em`;
|
|
129
129
|
});
|
|
130
|
-
const f =
|
|
131
|
-
N.forEach((
|
|
132
|
-
const n = 1 + (V[
|
|
133
|
-
o[`--text-fs-${
|
|
130
|
+
const f = l / y;
|
|
131
|
+
N.forEach((e) => {
|
|
132
|
+
const n = 1 + (V[e] - 1) * f;
|
|
133
|
+
o[`--text-fs-${e}`] = `${a(n)}em`;
|
|
134
134
|
});
|
|
135
|
-
}, R = (o,
|
|
136
|
-
const
|
|
137
|
-
o["--radius"] = `${a(
|
|
138
|
-
}, U = (o,
|
|
139
|
-
if (typeof
|
|
140
|
-
const t =
|
|
141
|
-
o["--shop-max-width"] = t === "full" || t === "none" ? "none" :
|
|
135
|
+
}, R = (o, r) => {
|
|
136
|
+
const l = r / m;
|
|
137
|
+
o["--radius"] = `${a(l)}rem`, o["--radius-sm"] = `${a(l * 0.8)}rem`, o["--radius-md"] = `${a(l)}rem`, o["--radius-lg"] = `${a(l * 1.34)}rem`, o["--radius-xl"] = `${a(l * 1.6)}rem`, o["--radius-2xl"] = `${a(l * 2)}rem`, o["--radius-3xl"] = `${a(l * 3)}rem`;
|
|
138
|
+
}, U = (o, r) => {
|
|
139
|
+
if (typeof r == "string") {
|
|
140
|
+
const t = r.trim().toLowerCase();
|
|
141
|
+
o["--shop-max-width"] = t === "full" || t === "none" ? "none" : r;
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
if (
|
|
144
|
+
if (r === 0) {
|
|
145
145
|
o["--shop-max-width"] = "none";
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
const
|
|
149
|
-
o["--shop-max-width"] = `${
|
|
148
|
+
const l = $(r ?? void 0, L);
|
|
149
|
+
o["--shop-max-width"] = `${l}px`;
|
|
150
150
|
}, H = {
|
|
151
151
|
danger: {
|
|
152
152
|
light: "#ffeeee",
|
|
@@ -253,11 +253,11 @@ const g = 16, y = 1.25, C = 8, L = 1440, _ = 64, d = /* @__PURE__ */ new Map(),
|
|
|
253
253
|
pink: { subtle: "#2a0f1c", subtleFg: "#f472b6", subtleBorder: "#9d174d" },
|
|
254
254
|
cyan: { subtle: "#0e242a", subtleFg: "#22d3ee", subtleBorder: "#0e7490" },
|
|
255
255
|
chart: ["#818cf8", "#34d399", "#fbbf24", "#fb7185", "#60a5fa", "#f472b6"]
|
|
256
|
-
}, j = (o,
|
|
257
|
-
const
|
|
258
|
-
["danger", "warning", "info", "success"].forEach((
|
|
259
|
-
const
|
|
260
|
-
o[`--color-${
|
|
256
|
+
}, j = (o, r) => {
|
|
257
|
+
const l = r ? M : H;
|
|
258
|
+
["danger", "warning", "info", "success"].forEach((e) => {
|
|
259
|
+
const c = l[e];
|
|
260
|
+
o[`--color-${e}-light`] = c.light, o[`--color-${e}`] = c.default, o[`--color-${e}-dark`] = c.dark, o[`--color-${e}-fg`] = c.fg, o[`--color-${e}-fg-light`] = c.fgLight, o[`--color-${e}-subtle`] = c.subtle, o[`--color-${e}-subtle-fg`] = c.subtleFg, o[`--color-${e}-subtle-border`] = c.subtleBorder, e === "danger" && (o["--color-destructive"] = c.default, o["--color-destructive-foreground"] = c.fg);
|
|
261
261
|
}), [
|
|
262
262
|
"secondary",
|
|
263
263
|
"purple",
|
|
@@ -266,93 +266,93 @@ const g = 16, y = 1.25, C = 8, L = 1440, _ = 64, d = /* @__PURE__ */ new Map(),
|
|
|
266
266
|
"orange",
|
|
267
267
|
"pink",
|
|
268
268
|
"cyan"
|
|
269
|
-
].forEach((
|
|
270
|
-
const
|
|
271
|
-
o[`--color-${
|
|
272
|
-
}),
|
|
273
|
-
o[`--color-chart-${
|
|
269
|
+
].forEach((e) => {
|
|
270
|
+
const c = l[e];
|
|
271
|
+
o[`--color-${e}-subtle`] = c.subtle, o[`--color-${e}-subtle-fg`] = c.subtleFg, o[`--color-${e}-subtle-border`] = c.subtleBorder;
|
|
272
|
+
}), l.chart.forEach((e, c) => {
|
|
273
|
+
o[`--color-chart-${c + 1}`] = e;
|
|
274
274
|
});
|
|
275
|
-
}, b = (o,
|
|
276
|
-
const t =
|
|
275
|
+
}, b = (o, r, l) => {
|
|
276
|
+
const t = w(r, l), f = F(r);
|
|
277
277
|
return `${G(t, o)}${o} {
|
|
278
278
|
background-color: ${f} !important;
|
|
279
279
|
}
|
|
280
280
|
`;
|
|
281
|
-
}, X = (o,
|
|
282
|
-
const t = s(o).l < 50, f = t ? "#ffffff" : "#000000",
|
|
281
|
+
}, X = (o, r, l) => {
|
|
282
|
+
const t = s(o).l < 50, f = t ? "#ffffff" : "#000000", e = i(o, f, t ? 0.07 : 0.03), c = i(o, f, t ? 0.1 : 0.055), n = i(o, f, t ? 0.04 : 0.015), u = i(o, f, t ? 0.08 : 0.04);
|
|
283
283
|
return [
|
|
284
|
-
b(`${
|
|
285
|
-
b(`${
|
|
286
|
-
b(`${
|
|
287
|
-
b(`${
|
|
288
|
-
b(`${
|
|
284
|
+
b(`${l} .bg-card`, o, r),
|
|
285
|
+
b(`${l} .bg-card-light`, n, r),
|
|
286
|
+
b(`${l} .bg-card .bg-card`, e, r),
|
|
287
|
+
b(`${l} .bg-card .bg-card-light`, u, r),
|
|
288
|
+
b(`${l} .bg-card .bg-card .bg-card`, c, r)
|
|
289
289
|
].join("");
|
|
290
290
|
};
|
|
291
|
-
function Z(o,
|
|
291
|
+
function Z(o, r, l = ".vlite-theme-provider", t, f) {
|
|
292
292
|
if (t)
|
|
293
|
-
return X(t, f,
|
|
293
|
+
return X(t, f, l);
|
|
294
294
|
if (!o) return "";
|
|
295
|
-
if (
|
|
296
|
-
const u = i(o, "#ffffff", 0.07),
|
|
295
|
+
if (r) {
|
|
296
|
+
const u = i(o, "#ffffff", 0.07), E = i(o, "#ffffff", 0.12), g = i(o, "#ffffff", 0.1), p = i(o, "#ffffff", 0.14), x = i(o, "#ffffff", 0.13), S = i(o, "#ffffff", 0.16), h = i(o, "#ffffff", 0.07), C = i(o, "#ffffff", 0.11), k = i(o, "#ffffff", 0.1), B = i(o, "#ffffff", 0.14);
|
|
297
297
|
return `
|
|
298
|
-
${
|
|
298
|
+
${l}.dark .bg-card {
|
|
299
299
|
--color-body: ${u} !important;
|
|
300
300
|
--color-white: ${u} !important;
|
|
301
|
-
--color-mixture-1: ${
|
|
301
|
+
--color-mixture-1: ${E} !important;
|
|
302
302
|
--color-mixture-2: #ffffff !important;
|
|
303
303
|
background-color: ${u} !important;
|
|
304
304
|
}
|
|
305
|
-
${
|
|
306
|
-
--color-body: ${
|
|
307
|
-
--color-white: ${
|
|
308
|
-
--color-mixture-1: ${
|
|
305
|
+
${l}.dark .bg-card .bg-card {
|
|
306
|
+
--color-body: ${g} !important;
|
|
307
|
+
--color-white: ${g} !important;
|
|
308
|
+
--color-mixture-1: ${p} !important;
|
|
309
309
|
--color-mixture-2: #000000;
|
|
310
|
-
background-color: ${
|
|
310
|
+
background-color: ${g} !important;
|
|
311
311
|
}
|
|
312
|
-
${
|
|
312
|
+
${l}.dark .bg-card .bg-card .bg-card {
|
|
313
313
|
--color-body: ${x} !important;
|
|
314
314
|
--color-white: ${x} !important;
|
|
315
315
|
--color-mixture-1: ${S} !important;
|
|
316
316
|
--color-mixture-2: #000000;
|
|
317
317
|
background-color: ${x} !important;
|
|
318
318
|
}
|
|
319
|
-
${
|
|
319
|
+
${l}.dark .bg-card-light {
|
|
320
|
+
--color-body: ${h} !important;
|
|
321
|
+
--color-white: ${h} !important;
|
|
322
|
+
--color-mixture-1: ${C} !important;
|
|
323
|
+
--color-mixture-2: #ffffff !important;
|
|
324
|
+
background-color: ${h} !important;
|
|
325
|
+
}
|
|
326
|
+
${l}.dark .bg-card .bg-card-light {
|
|
320
327
|
--color-body: ${k} !important;
|
|
321
328
|
--color-white: ${k} !important;
|
|
322
329
|
--color-mixture-1: ${B} !important;
|
|
323
|
-
--color-mixture-2: #ffffff !important;
|
|
324
|
-
background-color: ${k} !important;
|
|
325
|
-
}
|
|
326
|
-
${r}.dark .bg-card .bg-card-light {
|
|
327
|
-
--color-body: ${h} !important;
|
|
328
|
-
--color-white: ${h} !important;
|
|
329
|
-
--color-mixture-1: ${T} !important;
|
|
330
330
|
--color-mixture-2: #000000;
|
|
331
|
-
background-color: ${
|
|
331
|
+
background-color: ${k} !important;
|
|
332
332
|
}
|
|
333
333
|
`;
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const e = i(o, "#000000", 0.03), c = i(o, "#000000", 0.055), n = i(o, "#000000", 0.09);
|
|
336
336
|
return `
|
|
337
|
-
${
|
|
338
|
-
${
|
|
339
|
-
--color-body: ${
|
|
340
|
-
--color-white: ${
|
|
341
|
-
--color-mixture-1: ${
|
|
337
|
+
${l} .bg-card,
|
|
338
|
+
${l} .bg-card-light {
|
|
339
|
+
--color-body: ${e} !important;
|
|
340
|
+
--color-white: ${e} !important;
|
|
341
|
+
--color-mixture-1: ${e} !important;
|
|
342
342
|
--color-mixture-2: #000000 !important;
|
|
343
|
-
background-color: ${
|
|
343
|
+
background-color: ${e} !important;
|
|
344
344
|
border-color: color-mix(in oklab, var(--color-mixture-1) 94%, var(--color-mixture-2));
|
|
345
345
|
}
|
|
346
|
-
${
|
|
347
|
-
${
|
|
348
|
-
--color-body: ${
|
|
349
|
-
--color-white: ${
|
|
350
|
-
--color-mixture-1: ${
|
|
346
|
+
${l} .bg-card .bg-card,
|
|
347
|
+
${l} .bg-card-light .bg-card-light {
|
|
348
|
+
--color-body: ${c} !important;
|
|
349
|
+
--color-white: ${c} !important;
|
|
350
|
+
--color-mixture-1: ${c};
|
|
351
351
|
--color-mixture-2: #000000;
|
|
352
|
-
background-color: ${
|
|
352
|
+
background-color: ${c} !important;
|
|
353
353
|
}
|
|
354
|
-
${
|
|
355
|
-
${
|
|
354
|
+
${l} .bg-card .bg-card .bg-card,
|
|
355
|
+
${l} .bg-card-light .bg-card-light .bg-card-light {
|
|
356
356
|
--color-body: ${n} !important;
|
|
357
357
|
--color-white: ${n} !important;
|
|
358
358
|
--color-mixture-1: ${n};
|
|
@@ -362,51 +362,51 @@ ${r} .bg-card-light .bg-card-light .bg-card-light {
|
|
|
362
362
|
`;
|
|
363
363
|
}
|
|
364
364
|
const F = (o) => o.replace(/[{};]/g, "");
|
|
365
|
-
function G(o,
|
|
366
|
-
if (!
|
|
367
|
-
const
|
|
365
|
+
function G(o, r = ".vlite-theme-provider") {
|
|
366
|
+
if (!r) return "";
|
|
367
|
+
const l = [];
|
|
368
368
|
for (const [t, f] of Object.entries(o)) {
|
|
369
369
|
if (!t.startsWith("--") && t !== "font-size") continue;
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
const e = F(f);
|
|
371
|
+
e && l.push(
|
|
372
|
+
e.includes("!important") ? ` ${t}: ${e};` : ` ${t}: ${e} !important;`
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
return
|
|
376
|
-
${
|
|
375
|
+
return l.length === 0 ? "" : `${r} {
|
|
376
|
+
${l.join(`
|
|
377
377
|
`)}
|
|
378
378
|
}
|
|
379
379
|
`;
|
|
380
380
|
}
|
|
381
|
-
const K = (o,
|
|
382
|
-
if (o["--color-white"] =
|
|
383
|
-
o["--color-background"] =
|
|
384
|
-
const
|
|
385
|
-
|
|
381
|
+
const K = (o, r) => {
|
|
382
|
+
if (o["--color-white"] = r.bgColor ?? "#ffffff", o["--color-black"] = "#000000", o["--vlite-theme-white"] = r.bgColor ?? "#ffffff", o["--vlite-theme-mixture-1"] = "#ffffff", o["--vlite-theme-mixture-2"] = "#0c0c0c", r.bgColor) {
|
|
383
|
+
o["--color-background"] = r.bgColor, o["--color-body"] = r.bgColor;
|
|
384
|
+
const l = s(r.bgColor).l < 50;
|
|
385
|
+
l ? (o["--color-mixture-1"] = "#0c0c0c", o["--color-mixture-2"] = "#ffffff", o["--color-white"] = r.bgColor, o["--color-black"] = "#ffffff", o["--vlite-theme-white"] = r.bgColor, o["--vlite-theme-mixture-1"] = "#0c0c0c", o["--vlite-theme-mixture-2"] = "#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["--vlite-theme-white"] = r.bgColor, o["--vlite-theme-mixture-1"] = "#ffffff", o["--vlite-theme-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"), j(o, l);
|
|
386
386
|
}
|
|
387
|
-
if (
|
|
388
|
-
o["--color-primary"] =
|
|
389
|
-
const { l
|
|
390
|
-
o["--color-primary-foreground"] = t, o["--color-primary-fg"] = t, o["--color-primary-dark"] = `color-mix(in oklab, ${
|
|
387
|
+
if (r.primaryColor) {
|
|
388
|
+
o["--color-primary"] = r.primaryColor;
|
|
389
|
+
const { l } = s(r.primaryColor), t = l > 50 ? "#171717" : "#fafafa";
|
|
390
|
+
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"];
|
|
391
391
|
}
|
|
392
392
|
}, P = (o) => {
|
|
393
393
|
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-shadow"] = "var(--shadow-DEFAULT)", o["--date-picker-border"] = "var(--color-border)", o["--timer-picker-bg"] = "var(--color-background)", o["--iconPicker-border"] = "var(--color-border)";
|
|
394
|
-
},
|
|
395
|
-
const
|
|
396
|
-
return K(
|
|
394
|
+
}, w = (o, r) => {
|
|
395
|
+
const l = {};
|
|
396
|
+
return K(l, { bgColor: o, primaryColor: r }), P(l), l;
|
|
397
397
|
};
|
|
398
398
|
function W(o) {
|
|
399
|
-
const
|
|
400
|
-
o.footerBgColor && (
|
|
401
|
-
const
|
|
402
|
-
return
|
|
403
|
-
l,
|
|
399
|
+
const r = w(o.bgColor, o.primaryColor);
|
|
400
|
+
o.footerBgColor && (r["--color-footer"] = o.footerBgColor);
|
|
401
|
+
const l = $(o.baseFontSize, m), t = o.scaleSpacingWithBaseFontSize ? 0.25 * (l / m) : 0.25;
|
|
402
|
+
return r["--spacing"] = `${a(t)}rem`, Object.assign(r, O), z(
|
|
404
403
|
r,
|
|
404
|
+
l,
|
|
405
405
|
$(o.headingScale, y)
|
|
406
|
-
), R(
|
|
406
|
+
), R(r, A(o.borderRadius, T)), U(r, o.maxWidth), r["--tooltip-radius"] = "var(--radius)", r["--tooltip-arrow-size"] = "0.5em", r["--tooltip-z-index"] = "50", r["--date-picker-radius"] = "var(--radius)", r;
|
|
407
407
|
}
|
|
408
408
|
function q(o) {
|
|
409
|
-
const
|
|
409
|
+
const r = JSON.stringify([
|
|
410
410
|
o.bgColor,
|
|
411
411
|
o.surfaceColor,
|
|
412
412
|
o.primaryColor,
|
|
@@ -416,19 +416,19 @@ function q(o) {
|
|
|
416
416
|
o.headingScale,
|
|
417
417
|
o.borderRadius,
|
|
418
418
|
o.maxWidth
|
|
419
|
-
]),
|
|
420
|
-
if (
|
|
421
|
-
return d.delete(
|
|
419
|
+
]), l = d.get(r);
|
|
420
|
+
if (l)
|
|
421
|
+
return d.delete(r), d.set(r, l), l;
|
|
422
422
|
const t = Object.freeze(W(o));
|
|
423
|
-
if (d.set(
|
|
423
|
+
if (d.set(r, t), d.size > _) {
|
|
424
424
|
const f = d.keys().next().value;
|
|
425
425
|
f !== void 0 && d.delete(f);
|
|
426
426
|
}
|
|
427
427
|
return t;
|
|
428
428
|
}
|
|
429
429
|
export {
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
m as DEFAULT_BASE_FONT_SIZE,
|
|
431
|
+
T as DEFAULT_BORDER_RADIUS,
|
|
432
432
|
y as DEFAULT_HEADING_SCALE,
|
|
433
433
|
L as DEFAULT_MAX_WIDTH,
|
|
434
434
|
Z as buildCardOverrideStyles,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TooltTipProps } from 'v-tooltip-lite/types';
|
|
2
|
+
import { VLiteOverlayTarget } from '../composables/useOverlayPortal';
|
|
2
3
|
interface Props extends TooltTipProps {
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
contentI18n?: string;
|
|
6
|
+
teleportTarget?: VLiteOverlayTarget;
|
|
5
7
|
}
|
|
6
8
|
declare function __VLS_template(): {
|
|
7
9
|
attrs: Partial<{}>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, computed as i, openBlock as l, createElementBlock as d, renderSlot as n, createBlock as u, unref as r, mergeProps as f, withCtx as a } from "vue";
|
|
2
2
|
import "v-tooltip-lite/style.css";
|
|
3
|
-
import
|
|
4
|
-
import { $t as
|
|
5
|
-
|
|
3
|
+
import m from "v-tooltip-lite";
|
|
4
|
+
import { $t as g } from "../utils/i18n.js";
|
|
5
|
+
import { useVLiteOverlayTarget as y } from "../composables/useOverlayPortal.js";
|
|
6
|
+
const k = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "contents"
|
|
8
|
-
},
|
|
9
|
+
}, I = /* @__PURE__ */ p({
|
|
9
10
|
__name: "Tooltip",
|
|
10
11
|
props: {
|
|
11
12
|
disabled: { type: Boolean, default: !1 },
|
|
12
13
|
contentI18n: {},
|
|
14
|
+
teleportTarget: {},
|
|
13
15
|
content: {},
|
|
14
16
|
placement: { default: "top" },
|
|
15
17
|
offset: {},
|
|
@@ -27,10 +29,11 @@ const y = {
|
|
|
27
29
|
menuId: {}
|
|
28
30
|
},
|
|
29
31
|
setup(t) {
|
|
30
|
-
const e = t, s =
|
|
31
|
-
return (o,
|
|
32
|
+
const e = t, s = i(() => e.contentI18n ? g(e.contentI18n) : e.content), c = y(() => e.teleportTarget);
|
|
33
|
+
return (o, B) => t.disabled ? (l(), d("div", k, [
|
|
32
34
|
n(o.$slots, "default")
|
|
33
|
-
])) : (l(),
|
|
35
|
+
])) : (l(), u(r(m), f({ key: 1 }, { ...e, content: s.value }, {
|
|
36
|
+
"teleport-target": r(c),
|
|
34
37
|
class: "inline-block",
|
|
35
38
|
"class-name": `basic-tooltip ${t.className}`
|
|
36
39
|
}), {
|
|
@@ -41,9 +44,9 @@ const y = {
|
|
|
41
44
|
n(o.$slots, "content")
|
|
42
45
|
]),
|
|
43
46
|
_: 3
|
|
44
|
-
}, 16, ["class-name"]));
|
|
47
|
+
}, 16, ["teleport-target", "class-name"]));
|
|
45
48
|
}
|
|
46
49
|
});
|
|
47
50
|
export {
|
|
48
|
-
|
|
51
|
+
I as default
|
|
49
52
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export type VLiteOverlayTarget = string | HTMLElement;
|
|
3
|
+
export type VLiteOverlayTargetSource = MaybeRefOrGetter<VLiteOverlayTarget | null | undefined>;
|
|
4
|
+
export interface VLiteOverlayContext {
|
|
5
|
+
target: VLiteOverlayTargetSource;
|
|
6
|
+
}
|
|
7
|
+
export declare const VLITE_OVERLAY_CONTEXT_KEY: InjectionKey<VLiteOverlayContext>;
|
|
8
|
+
/** Provides a logical destination for teleported VLite surfaces below this component. */
|
|
9
|
+
export declare const provideVLiteOverlayContext: (context: VLiteOverlayContext) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves an explicit component target before the nearest provided overlay target.
|
|
12
|
+
* Standalone VLite consumers remain backward compatible and teleport to body.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useVLiteOverlayTarget: (explicitTarget?: VLiteOverlayTargetSource) => ComputedRef<VLiteOverlayTarget>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { inject as n, computed as v, toValue as e, provide as c } from "vue";
|
|
2
|
+
const r = /* @__PURE__ */ Symbol.for(
|
|
3
|
+
"vlite3:overlay-context"
|
|
4
|
+
), l = (o) => {
|
|
5
|
+
c(r, o);
|
|
6
|
+
}, d = (o) => {
|
|
7
|
+
const t = n(r, null);
|
|
8
|
+
return v(
|
|
9
|
+
() => (o ? e(o) : void 0) ?? (t ? e(t.target) : void 0) ?? "body"
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
r as VLITE_OVERLAY_CONTEXT_KEY,
|
|
14
|
+
l as provideVLiteOverlayContext,
|
|
15
|
+
d as useVLiteOverlayTarget
|
|
16
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type Theme = 'light' | 'dark';
|
|
1
|
+
export type Theme = 'light' | 'dark';
|
|
2
2
|
export declare function initializeTheme(): void;
|
|
3
3
|
export declare function useTheme(): {
|
|
4
4
|
theme: import('vue').Ref<Theme, Theme>;
|
|
5
|
+
setTheme: (newTheme: Theme) => void;
|
|
5
6
|
toggleTheme: () => void;
|
|
6
7
|
};
|
|
7
|
-
export {};
|
package/composables/useTheme.js
CHANGED
|
@@ -1,40 +1,75 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { ref as h, watch as g } from "vue";
|
|
2
|
+
const o = "builto-theme", f = "vlite:theme-change", i = h(m());
|
|
3
|
+
let u = null, c = !1, d = !0, l = !0;
|
|
4
|
+
function a(e) {
|
|
5
|
+
return e === "light" || e === "dark";
|
|
6
|
+
}
|
|
7
|
+
function m() {
|
|
4
8
|
if (typeof window > "u") return "light";
|
|
5
|
-
const e = localStorage.getItem(
|
|
6
|
-
return e
|
|
9
|
+
const e = localStorage.getItem(o);
|
|
10
|
+
return a(e) ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7
11
|
}
|
|
8
|
-
function
|
|
9
|
-
document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(e);
|
|
12
|
+
function s(e) {
|
|
13
|
+
typeof document > "u" || (document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(e), document.documentElement.classList.add("bg-body"), document.documentElement.style.colorScheme = e);
|
|
10
14
|
}
|
|
11
|
-
function
|
|
12
|
-
typeof window > "u" ||
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
function p(e, t) {
|
|
16
|
+
typeof window > "u" || window.dispatchEvent(
|
|
17
|
+
new CustomEvent(f, {
|
|
18
|
+
detail: { theme: e, persist: t }
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function E(e) {
|
|
23
|
+
if (typeof window > "u") return;
|
|
24
|
+
const t = d, n = l;
|
|
25
|
+
d = !0, l = !0, t && localStorage.getItem(o) !== e && localStorage.setItem(o, e), s(e), n && p(e, t);
|
|
15
26
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
function r(e, t, n = !0) {
|
|
28
|
+
if (typeof window > "u") {
|
|
29
|
+
i.value = e;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (i.value === e) {
|
|
33
|
+
t && localStorage.getItem(o) !== e && localStorage.setItem(o, e), s(e);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
d = t, l = n, i.value = e;
|
|
37
|
+
}
|
|
38
|
+
function w() {
|
|
39
|
+
if (typeof window > "u" || c) return;
|
|
40
|
+
c = !0, window.addEventListener(f, (t) => {
|
|
41
|
+
const n = t.detail;
|
|
42
|
+
if (a(n)) {
|
|
43
|
+
r(n, !0, !1);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
n && typeof n == "object" && "theme" in n && a(n.theme) && "persist" in n && typeof n.persist == "boolean" && r(n.theme, n.persist, !1);
|
|
47
|
+
}), window.addEventListener("storage", (t) => {
|
|
48
|
+
t.key === o && a(t.newValue) && r(t.newValue, !0, !1);
|
|
49
|
+
}), window.matchMedia?.("(prefers-color-scheme: dark)")?.addEventListener("change", (t) => {
|
|
50
|
+
localStorage.getItem(o) || r(t.matches ? "dark" : "light", !1);
|
|
28
51
|
});
|
|
29
|
-
|
|
30
|
-
|
|
52
|
+
}
|
|
53
|
+
function y() {
|
|
54
|
+
if (typeof window > "u") return;
|
|
55
|
+
const e = m(), t = a(localStorage.getItem(o));
|
|
56
|
+
u ? r(e, t, !1) : (i.value = e, s(e), u = g(i, E, { flush: "sync" })), w();
|
|
57
|
+
}
|
|
58
|
+
function v() {
|
|
59
|
+
y();
|
|
60
|
+
function e(n) {
|
|
61
|
+
r(n, !0);
|
|
62
|
+
}
|
|
63
|
+
function t() {
|
|
64
|
+
e(i.value === "light" ? "dark" : "light");
|
|
31
65
|
}
|
|
32
66
|
return {
|
|
33
|
-
theme:
|
|
34
|
-
|
|
67
|
+
theme: i,
|
|
68
|
+
setTheme: e,
|
|
69
|
+
toggleTheme: t
|
|
35
70
|
};
|
|
36
71
|
}
|
|
37
72
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
73
|
+
y as initializeTheme,
|
|
74
|
+
v as useTheme
|
|
40
75
|
};
|
package/docs/components/modal.md
CHANGED
|
@@ -4,22 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
### Props
|
|
6
6
|
|
|
7
|
-
| Prop | Type | Default | Description
|
|
8
|
-
| :---------------- | :---------- | :------------ |
|
|
9
|
-
| `show` | `boolean` | `false` | Binding (`v-model:show`) - Visibility state
|
|
10
|
-
| `title` | `string` | — | Modal title text
|
|
11
|
-
| `titleI18n` | `string` | — | I18n key for the title text
|
|
12
|
-
| `description` | `string` | — | Helper text below title
|
|
13
|
-
| `descriptionI18n` | `string` | — | I18n key for the helper text
|
|
14
|
-
| `maxWidth` | `string` | `sm:max-w-lg` | Tailwind max-width class (e.g. `max-w-2xl`)
|
|
15
|
-
| `closeOutside` | `boolean` | `true` | Close when clicking backdrop
|
|
16
|
-
| `backdrop` | `boolean` | `true` | Show dark overlay
|
|
17
|
-
| `triggerClass` | `string` | — | Classes for the trigger wrapper
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| :---------------- | :---------- | :------------ | :--------------------------------------------- |
|
|
9
|
+
| `show` | `boolean` | `false` | Binding (`v-model:show`) - Visibility state |
|
|
10
|
+
| `title` | `string` | — | Modal title text |
|
|
11
|
+
| `titleI18n` | `string` | — | I18n key for the title text |
|
|
12
|
+
| `description` | `string` | — | Helper text below title |
|
|
13
|
+
| `descriptionI18n` | `string` | — | I18n key for the helper text |
|
|
14
|
+
| `maxWidth` | `string` | `sm:max-w-lg` | Tailwind max-width class (e.g. `max-w-2xl`) |
|
|
15
|
+
| `closeOutside` | `boolean` | `true` | Close when clicking backdrop |
|
|
16
|
+
| `backdrop` | `boolean` | `true` | Show dark overlay |
|
|
17
|
+
| `triggerClass` | `string` | — | Classes for the trigger wrapper |
|
|
18
|
+
| `overlayClass` | `string` | — | Classes applied to the full-screen overlay |
|
|
19
|
+
| `modalClass` | `string` | — | Classes applied to the modal/dialog container |
|
|
20
|
+
| `headerClass` | `string` | — | Classes applied to the modal header |
|
|
21
|
+
| `bodyClass` | `string` | — | Classes applied to the scrollable content area |
|
|
22
|
+
| `footerClass` | `string` | — | Classes for the footer section |
|
|
23
|
+
| `body` | `Component` | — | Component to render lazily inside |
|
|
24
|
+
| `bodyProps` | `object` | — | Props to pass to the `body` component |
|
|
23
25
|
|
|
24
26
|
### Events
|
|
25
27
|
|