vunor 0.0.10 → 0.0.11
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/theme.mjs +232 -232
- package/package.json +1 -1
package/dist/theme.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import A, { defu as F } from "defu";
|
|
2
2
|
import { presetWind as C } from "unocss";
|
|
3
|
-
import { palitra as
|
|
4
|
-
const
|
|
3
|
+
import { palitra as w, color as S } from "@prostojs/palitra";
|
|
4
|
+
const f = (e) => e, L = f({
|
|
5
5
|
btn: {
|
|
6
6
|
"": "h-fingertip flex items-center justify-center px-$m gap-$xs select-none fw-bold tracking-wide relative",
|
|
7
7
|
"[&.btn-round]:": "px-fingertip-half rounded-fingertip-half",
|
|
@@ -38,9 +38,9 @@ const g = (r) => r, L = g({
|
|
|
38
38
|
"body",
|
|
39
39
|
"body-s",
|
|
40
40
|
"callout"
|
|
41
|
-
], D =
|
|
42
|
-
card: `data-[rounded=true]:rounded-$card-spacing data-[dense=true]:card-dense! ${N.map((
|
|
43
|
-
}), T =
|
|
41
|
+
], D = f({
|
|
42
|
+
card: `data-[rounded=true]:rounded-$card-spacing data-[dense=true]:card-dense! ${N.map((e) => `data-[level=${e}]:card-${e}`).join(" ")}`
|
|
43
|
+
}), T = f({
|
|
44
44
|
"checkbox-root": {
|
|
45
45
|
"": "text-body select-none flex gap-$m cursor-default current-bg-scope-color-500 current-border-scope-color-500",
|
|
46
46
|
"data-[error=true]:": "current-border-error-500",
|
|
@@ -63,7 +63,7 @@ const g = (r) => r, L = g({
|
|
|
63
63
|
"checkbox-label": {
|
|
64
64
|
"": "select-none text-body lh-1.5em"
|
|
65
65
|
}
|
|
66
|
-
}), q =
|
|
66
|
+
}), q = f({
|
|
67
67
|
"combobox-multi-input": "i8-input relative flex items-center",
|
|
68
68
|
"combobox-multi-items": "text-ellipsis overflow-hidden whitespace-nowrap absolute max-w-full pr-$m lh-1em",
|
|
69
69
|
"combobox-embedded-input": "text-left outline-0 outline-offset-0",
|
|
@@ -71,16 +71,16 @@ const g = (r) => r, L = g({
|
|
|
71
71
|
"": "hover:current-icon-scope-color-500 hover:icon-current cursor-pointer",
|
|
72
72
|
"group-[[aria-expanded=true]]/i8:": "-scale-100"
|
|
73
73
|
}
|
|
74
|
-
}), M =
|
|
74
|
+
}), M = f({
|
|
75
75
|
"loading-indicator": "cursor-wait",
|
|
76
76
|
"loading-indicator-ring": {
|
|
77
77
|
"": "animate-spin animate-duration-1500",
|
|
78
78
|
"[&>circle]:": "animate-loading-dashoffset animate-count-infinite animate-duration-2500"
|
|
79
79
|
}
|
|
80
|
-
}), I =
|
|
80
|
+
}), I = f({
|
|
81
81
|
"menu-root": "flex flex-col overflow-hidden",
|
|
82
82
|
"menu-item": "justify-start c8-flat gap-$m w-full fw-400"
|
|
83
|
-
}), X =
|
|
83
|
+
}), X = f({
|
|
84
84
|
"rb-container": {
|
|
85
85
|
"": "flex flex-col gap-$s text-body"
|
|
86
86
|
},
|
|
@@ -110,7 +110,7 @@ const g = (r) => r, L = g({
|
|
|
110
110
|
"": "select-none px-$s text-body leading-none lh-1.25em",
|
|
111
111
|
"aria-[disabled=true]:": "scope-grey opacity-50 cursor-not-allowed"
|
|
112
112
|
}
|
|
113
|
-
}), Y =
|
|
113
|
+
}), Y = f({
|
|
114
114
|
"select-content": {
|
|
115
115
|
"": "min-w-[60px] rounded-base surface-0 bg-current overflow-hidden shadow-xl z-[100] current-border-grey-400 border-current/20 ",
|
|
116
116
|
"data-[design=round]:": "rounded-fingertip-half",
|
|
@@ -136,7 +136,7 @@ const g = (r) => r, L = g({
|
|
|
136
136
|
"[&>span]:data-[state=checked]:": "text-scope-color-500 fw-700!"
|
|
137
137
|
},
|
|
138
138
|
"select-separator": "h-[1px] bg-grey-500/10 mx-$s"
|
|
139
|
-
}), B =
|
|
139
|
+
}), B = f({
|
|
140
140
|
slider: {
|
|
141
141
|
"": "relative flex items-center select-none touch-none min-w-2em min-h-2em"
|
|
142
142
|
},
|
|
@@ -166,7 +166,7 @@ const g = (r) => r, L = g({
|
|
|
166
166
|
q,
|
|
167
167
|
B,
|
|
168
168
|
M
|
|
169
|
-
], U =
|
|
169
|
+
], U = f({
|
|
170
170
|
// FILLED
|
|
171
171
|
"c8-filled": {
|
|
172
172
|
"": "current-bg-scope-color-500 rounded-base current-text-white current-icon-white icon-current/100 bg-current text-current",
|
|
@@ -238,7 +238,7 @@ const g = (r) => r, L = g({
|
|
|
238
238
|
"c8-light-active": {
|
|
239
239
|
"not-([disabled]):": "bg-current/20"
|
|
240
240
|
}
|
|
241
|
-
}),
|
|
241
|
+
}), G = f({
|
|
242
242
|
i8: {
|
|
243
243
|
"": "h-fingertip min-w-3em flex items-center select-none relative current-icon-grey-500 icon-current content-box current-border-grey-500 border-current/20",
|
|
244
244
|
"data-[type=textarea]": "min-h-fingertip h-auto items-start",
|
|
@@ -377,37 +377,37 @@ const g = (r) => r, L = g({
|
|
|
377
377
|
"[&>.icon-color:hover]:": "current-icon-scope-color-500 icon-current"
|
|
378
378
|
}
|
|
379
379
|
});
|
|
380
|
-
function
|
|
380
|
+
function h(e) {
|
|
381
381
|
let t = "";
|
|
382
|
-
for (const [
|
|
382
|
+
for (const [r, o] of Object.entries(e)) {
|
|
383
383
|
const c = H(o);
|
|
384
|
-
t += `${c.map((n) => `${
|
|
384
|
+
t += `${c.map((n) => `${r}${n}`).join(" ")} `;
|
|
385
385
|
}
|
|
386
386
|
return t.trim();
|
|
387
387
|
}
|
|
388
|
-
function H(
|
|
389
|
-
if (typeof
|
|
390
|
-
return
|
|
391
|
-
if (Array.isArray(
|
|
392
|
-
return
|
|
388
|
+
function H(e) {
|
|
389
|
+
if (typeof e == "string")
|
|
390
|
+
return e.split(" ");
|
|
391
|
+
if (Array.isArray(e))
|
|
392
|
+
return e;
|
|
393
393
|
const t = [];
|
|
394
|
-
for (const [
|
|
395
|
-
t.push(...H(o).map((c) => `${
|
|
394
|
+
for (const [r, o] of Object.entries(e))
|
|
395
|
+
t.push(...H(o).map((c) => `${r}${c}`));
|
|
396
396
|
return t;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
399
|
-
const
|
|
398
|
+
const J = (e, t) => {
|
|
399
|
+
const r = {}, o = /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(e)]);
|
|
400
400
|
for (const c of Array.from(o))
|
|
401
401
|
if (!Object.prototype.hasOwnProperty.call(t, c))
|
|
402
|
-
|
|
403
|
-
else if (!Object.prototype.hasOwnProperty.call(
|
|
404
|
-
|
|
402
|
+
r[c] = e[c];
|
|
403
|
+
else if (!Object.prototype.hasOwnProperty.call(e, c))
|
|
404
|
+
r[c] = t[c];
|
|
405
405
|
else {
|
|
406
|
-
let n = t[c], i =
|
|
407
|
-
Array.isArray(n) && (n = n.join(" ")), Array.isArray(i) && (i = i.join(" ")), typeof n == "string" && typeof i == "string" ?
|
|
406
|
+
let n = t[c], i = e[c];
|
|
407
|
+
Array.isArray(n) && (n = n.join(" ")), Array.isArray(i) && (i = i.join(" ")), typeof n == "string" && typeof i == "string" ? r[c] = `${i} ${n}` : typeof n == "object" && typeof i == "string" ? r[c] = `${i} ${h(n)}` : typeof n == "string" && typeof i == "object" ? r[c] = `${h(i)} ${n}` : typeof n == "object" && typeof i == "object" && (r[c] = `${h(i)} ${h(n)}`);
|
|
408
408
|
}
|
|
409
|
-
return
|
|
410
|
-
}, R = (
|
|
409
|
+
return r;
|
|
410
|
+
}, R = (e) => e.reduce((t, r) => J(t, r), {}), K = {
|
|
411
411
|
colors: {
|
|
412
412
|
primary: { color: "#004eaf", preserveInputColor: !0, saturate: { dark: -0.2, light: -0.2 } },
|
|
413
413
|
grey: { color: "#858892", saturate: { dark: 0, light: 0 } },
|
|
@@ -558,55 +558,55 @@ const G = (r, t) => {
|
|
|
558
558
|
]
|
|
559
559
|
}
|
|
560
560
|
};
|
|
561
|
-
function
|
|
562
|
-
var d,
|
|
563
|
-
const t = (
|
|
564
|
-
for (const
|
|
565
|
-
const j =
|
|
566
|
-
typeof j == "string" && (t[
|
|
561
|
+
function Q(e) {
|
|
562
|
+
var d, g, v, y, k, $, x;
|
|
563
|
+
const t = (e == null ? void 0 : e.colors) || {};
|
|
564
|
+
for (const z of Object.keys(t)) {
|
|
565
|
+
const j = (d = e == null ? void 0 : e.colors) == null ? void 0 : d[z];
|
|
566
|
+
typeof j == "string" && (t[z] = { color: j });
|
|
567
567
|
}
|
|
568
|
-
const
|
|
568
|
+
const r = A({ ...e, colors: t }, K), o = {
|
|
569
569
|
count: 5,
|
|
570
570
|
preserveInputColor: !1,
|
|
571
571
|
luminance: {
|
|
572
|
-
dark: ((
|
|
573
|
-
light: ((
|
|
572
|
+
dark: ((g = r.layerPalette.luminance) == null ? void 0 : g.dark) ?? r.darkest,
|
|
573
|
+
light: ((v = r.layerPalette.luminance) == null ? void 0 : v.light) ?? r.darkest + r.layersDepth,
|
|
574
574
|
useMiddle: !1
|
|
575
575
|
},
|
|
576
|
-
saturate:
|
|
577
|
-
vivid:
|
|
576
|
+
saturate: r.layerPalette.saturate,
|
|
577
|
+
vivid: r.layerPalette.vivid,
|
|
578
578
|
suffixes: ["dark-0", "dark-1", "dark-2", "dark-3", "dark-4"]
|
|
579
|
-
}, c =
|
|
580
|
-
P(
|
|
579
|
+
}, c = w(
|
|
580
|
+
P(r.colors, r.layerPalette.desaturate),
|
|
581
581
|
o
|
|
582
582
|
).toStrings();
|
|
583
583
|
o.suffixes = ["light-0", "light-1", "light-2", "light-3", "light-4"].reverse();
|
|
584
584
|
const n = o.luminance.light - o.luminance.dark;
|
|
585
585
|
o.luminance = { dark: 1 - n, light: 1, useMiddle: !1 };
|
|
586
|
-
const i =
|
|
587
|
-
P(
|
|
586
|
+
const i = w(
|
|
587
|
+
P(r.colors, r.layerPalette.desaturate),
|
|
588
588
|
o
|
|
589
|
-
).toStrings(), l =
|
|
589
|
+
).toStrings(), l = w(
|
|
590
590
|
{
|
|
591
|
-
primary:
|
|
592
|
-
grey:
|
|
593
|
-
secondary:
|
|
594
|
-
neutral:
|
|
595
|
-
good:
|
|
596
|
-
warn:
|
|
597
|
-
error:
|
|
591
|
+
primary: r.colors.primary,
|
|
592
|
+
grey: r.colors.grey,
|
|
593
|
+
secondary: r.colors.secondary,
|
|
594
|
+
neutral: r.colors.neutral,
|
|
595
|
+
good: r.colors.good,
|
|
596
|
+
warn: r.colors.warn,
|
|
597
|
+
error: r.colors.error
|
|
598
598
|
},
|
|
599
599
|
{
|
|
600
600
|
count: 10,
|
|
601
|
-
preserveInputColor:
|
|
601
|
+
preserveInputColor: r.mainPalette.preserveInputColor,
|
|
602
602
|
luminance: {
|
|
603
|
-
dark: ((
|
|
604
|
-
light: ((k =
|
|
605
|
-
useMiddle: (
|
|
606
|
-
middle: (x =
|
|
603
|
+
dark: ((y = r.mainPalette.luminance) == null ? void 0 : y.dark) ?? r.darkest + r.layersDepth + 0.02,
|
|
604
|
+
light: ((k = r.mainPalette.luminance) == null ? void 0 : k.light) ?? r.lightest,
|
|
605
|
+
useMiddle: ($ = r.mainPalette.luminance) == null ? void 0 : $.useMiddle,
|
|
606
|
+
middle: (x = r.mainPalette.luminance) == null ? void 0 : x.middle
|
|
607
607
|
},
|
|
608
|
-
saturate:
|
|
609
|
-
vivid:
|
|
608
|
+
saturate: r.mainPalette.saturate,
|
|
609
|
+
vivid: r.mainPalette.vivid
|
|
610
610
|
}
|
|
611
611
|
).toStrings();
|
|
612
612
|
return {
|
|
@@ -615,39 +615,39 @@ function J(r) {
|
|
|
615
615
|
...i,
|
|
616
616
|
...l
|
|
617
617
|
},
|
|
618
|
-
surfaces:
|
|
618
|
+
surfaces: r.surfaces
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
|
-
function P(
|
|
622
|
-
const
|
|
623
|
-
for (const [o, c] of Object.entries(
|
|
621
|
+
function P(e, t = 0.5) {
|
|
622
|
+
const r = {};
|
|
623
|
+
for (const [o, c] of Object.entries(e)) {
|
|
624
624
|
const n = typeof c == "string" ? c : c.color;
|
|
625
625
|
if (n) {
|
|
626
|
-
const [i, l, d] =
|
|
627
|
-
|
|
626
|
+
const [i, l, d] = S(n).hsl();
|
|
627
|
+
r[o] = S(i, l * t, d, "hsl").hex();
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
return
|
|
630
|
+
return r;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function Z() {
|
|
633
633
|
return [
|
|
634
634
|
[
|
|
635
635
|
/^layer-([0-4])$/,
|
|
636
|
-
([,
|
|
637
|
-
let
|
|
638
|
-
return t.reverseDarkLayers && (
|
|
636
|
+
([, e], { theme: t }) => {
|
|
637
|
+
let r = Number(e), o = Number(e);
|
|
638
|
+
return t.reverseDarkLayers && (r = 4 - Number(e)), t.reverseLightLayers && (o = 4 - Number(e)), h({
|
|
639
639
|
"": `current-bg-scope-light-${o} current-text-scope-dark-2 current-icon-scope-dark-2 bg-current text-current`,
|
|
640
|
-
"dark:": `current-bg-scope-dark-${
|
|
641
|
-
"[&.dark]:": `current-bg-scope-dark-${
|
|
640
|
+
"dark:": `current-bg-scope-dark-${r} current-text-scope-light-2 current-icon-scope-light-2`,
|
|
641
|
+
"[&.dark]:": `current-bg-scope-dark-${r} current-text-scope-light-2 current-icon-scope-light-2`
|
|
642
642
|
});
|
|
643
643
|
}
|
|
644
644
|
],
|
|
645
645
|
[
|
|
646
646
|
/^surface-(.+)$/,
|
|
647
|
-
([,
|
|
648
|
-
"": `current-bg-${t.surfaces[
|
|
649
|
-
"dark:": `current-bg-${t.surfaces[
|
|
650
|
-
"[&.dark]:": `current-bg-${t.surfaces[
|
|
647
|
+
([, e], { theme: t }) => t.surfaces[e] ? h({
|
|
648
|
+
"": `current-bg-${t.surfaces[e][0]} current-text-${t.surfaces[e][1]} current-icon-${t.surfaces[e][1]} current-border-${t.surfaces[e][2]} bg-current text-current border-current icon-current`,
|
|
649
|
+
"dark:": `current-bg-${t.surfaces[e][3]} current-text-${t.surfaces[e][4]} current-icon-${t.surfaces[e][4]} current-border-${t.surfaces[e][5]} shadow-black/30`,
|
|
650
|
+
"[&.dark]:": `current-bg-${t.surfaces[e][3]} current-text-${t.surfaces[e][4]} current-icon-${t.surfaces[e][4]} current-border-${t.surfaces[e][5]} shadow-black/30`
|
|
651
651
|
}) : ""
|
|
652
652
|
],
|
|
653
653
|
{
|
|
@@ -655,25 +655,25 @@ function K() {
|
|
|
655
655
|
}
|
|
656
656
|
];
|
|
657
657
|
}
|
|
658
|
-
function p(
|
|
659
|
-
const
|
|
660
|
-
return Math.round(
|
|
658
|
+
function p(e, t = 0) {
|
|
659
|
+
const r = 10 ** t;
|
|
660
|
+
return Math.round(e * r) / r;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function m(e, t, r = 3) {
|
|
663
663
|
var n;
|
|
664
|
-
const o = Number.parseFloat(
|
|
665
|
-
return `${p(o * t,
|
|
664
|
+
const o = Number.parseFloat(e), c = ((n = /(px|em|rem|%)$/.exec(e)) == null ? void 0 : n[1]) || "";
|
|
665
|
+
return `${p(o * t, r)}${c}`;
|
|
666
666
|
}
|
|
667
|
-
const
|
|
668
|
-
getCSS: ({ theme:
|
|
669
|
-
b("figcaption",
|
|
667
|
+
const _ = {
|
|
668
|
+
getCSS: ({ theme: e }) => `${b("body", e.fontSize.body) + // renderFontCss('label', theme.fontSize.label) +
|
|
669
|
+
b("figcaption", e.fontSize.caption) + b("h1", e.fontSize.h1) + b("h2", e.fontSize.h2) + b("h3", e.fontSize.h3) + b("h4", e.fontSize.h4) + b("h5", e.fontSize.h5) + b("h6", e.fontSize.h6)}
|
|
670
670
|
:root {
|
|
671
671
|
--un-default-border-color: rgba(0,0,0,10%);
|
|
672
672
|
--scope-black: 0 0 0;
|
|
673
673
|
--scope-white: 255 255 255;
|
|
674
674
|
--scope-hl: var(--scope-color-500);
|
|
675
|
-
--v-fingertip: ${
|
|
676
|
-
--v-fingertip-half: ${
|
|
675
|
+
--v-fingertip: ${e.spacing["fingertip-m"] || "3em"};
|
|
676
|
+
--v-fingertip-half: ${m(e.spacing["fingertip-m"] || "3em", 0.5)};
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
html.dark, .dark {
|
|
@@ -715,15 +715,15 @@ html.dark, .dark {
|
|
|
715
715
|
}
|
|
716
716
|
`
|
|
717
717
|
};
|
|
718
|
-
function b(
|
|
719
|
-
return `${
|
|
718
|
+
function b(e, t) {
|
|
719
|
+
return `${e} { font-size: ${t[0]}; ${Object.entries(t[1]).map((r) => `${r[0]}: ${r[1]};`).join(" ")} }
|
|
720
720
|
`;
|
|
721
721
|
}
|
|
722
|
-
function s(
|
|
723
|
-
const [t,
|
|
724
|
-
return `${t} ${
|
|
722
|
+
function s(e) {
|
|
723
|
+
const [t, r, o, c] = S(e).rgba();
|
|
724
|
+
return `${t} ${r} ${o}`;
|
|
725
725
|
}
|
|
726
|
-
function O(
|
|
726
|
+
function O(e) {
|
|
727
727
|
return {
|
|
728
728
|
bg: "--un-bg-opacity",
|
|
729
729
|
text: "--un-text-opacity",
|
|
@@ -733,9 +733,9 @@ function O(r) {
|
|
|
733
733
|
border: "--un-border-opacity",
|
|
734
734
|
outline: "--un-outline-opacity",
|
|
735
735
|
caret: "--un-caret-opacity"
|
|
736
|
-
}[
|
|
736
|
+
}[e];
|
|
737
737
|
}
|
|
738
|
-
function W(
|
|
738
|
+
function W(e) {
|
|
739
739
|
return {
|
|
740
740
|
bg: "background-color",
|
|
741
741
|
text: "color",
|
|
@@ -745,35 +745,35 @@ function W(r) {
|
|
|
745
745
|
border: "border-color",
|
|
746
746
|
outline: "outline-color",
|
|
747
747
|
caret: "caret-color"
|
|
748
|
-
}[
|
|
748
|
+
}[e];
|
|
749
749
|
}
|
|
750
|
-
const
|
|
750
|
+
const ee = [
|
|
751
751
|
[
|
|
752
752
|
/^current-(text|bg|icon|border|outline|caret|hl)-(.+)$/,
|
|
753
|
-
(
|
|
754
|
-
const
|
|
753
|
+
(e, { theme: t }) => {
|
|
754
|
+
const r = e[1], o = e[2];
|
|
755
755
|
if (o.startsWith("scope-"))
|
|
756
756
|
return {
|
|
757
|
-
[`--current-${
|
|
757
|
+
[`--current-${r}`]: `var(--${o})`
|
|
758
758
|
};
|
|
759
759
|
if (o === "hl")
|
|
760
760
|
return {
|
|
761
|
-
[`--current-${
|
|
761
|
+
[`--current-${r}`]: "var(--current-hl)"
|
|
762
762
|
};
|
|
763
763
|
const c = t.colors[o] || o;
|
|
764
764
|
if (c)
|
|
765
765
|
return {
|
|
766
766
|
// @ts-expect-error
|
|
767
767
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
768
|
-
[`--current-${
|
|
768
|
+
[`--current-${r}`]: s(c.DEFAULT || c)
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
771
|
],
|
|
772
772
|
[
|
|
773
773
|
/^(text|bg|icon|border|outline|caret|fill)-current(-text|-bg|-icon|-border|-outline|-caret|-hl)?(\/\d{1,3})?$/,
|
|
774
|
-
(
|
|
775
|
-
const
|
|
776
|
-
return
|
|
774
|
+
(e, { theme: t }) => {
|
|
775
|
+
const r = e[1], o = e[2] || `-${r}`, c = O(r), n = W(r), i = e[3], l = i ? Number(i.slice(1)) / 100 : 1, d = l === 1 ? `var(${c})` : l;
|
|
776
|
+
return r === "icon" ? {
|
|
777
777
|
[c]: l,
|
|
778
778
|
"--current-icon": o === "-hl" ? `var(--current${o})` : void 0
|
|
779
779
|
} : {
|
|
@@ -784,51 +784,51 @@ const Z = [
|
|
|
784
784
|
],
|
|
785
785
|
[
|
|
786
786
|
/^scope-(.*)$/,
|
|
787
|
-
(
|
|
788
|
-
const
|
|
787
|
+
(e, { theme: t }) => {
|
|
788
|
+
const r = e[1], o = t.colors[r];
|
|
789
789
|
if (o)
|
|
790
790
|
return {
|
|
791
791
|
"--scope-color": s(o),
|
|
792
|
-
"--scope-color-50": s(t.colors[`${
|
|
793
|
-
"--scope-color-100": s(t.colors[`${
|
|
794
|
-
"--scope-color-200": s(t.colors[`${
|
|
795
|
-
"--scope-color-300": s(t.colors[`${
|
|
796
|
-
"--scope-color-400": s(t.colors[`${
|
|
797
|
-
"--scope-color-500": s(t.colors[`${
|
|
798
|
-
"--scope-color-600": s(t.colors[`${
|
|
799
|
-
"--scope-color-700": s(t.colors[`${
|
|
800
|
-
"--scope-color-800": s(t.colors[`${
|
|
801
|
-
"--scope-color-900": s(t.colors[`${
|
|
802
|
-
"--scope-light-0": s(t.colors[`${
|
|
803
|
-
"--scope-light-1": s(t.colors[`${
|
|
804
|
-
"--scope-light-2": s(t.colors[`${
|
|
805
|
-
"--scope-light-3": s(t.colors[`${
|
|
806
|
-
"--scope-light-4": s(t.colors[`${
|
|
807
|
-
"--scope-dark-0": s(t.colors[`${
|
|
808
|
-
"--scope-dark-1": s(t.colors[`${
|
|
809
|
-
"--scope-dark-2": s(t.colors[`${
|
|
810
|
-
"--scope-dark-3": s(t.colors[`${
|
|
811
|
-
"--scope-dark-4": s(t.colors[`${
|
|
812
|
-
"--current-hl": s(t.colors[`${
|
|
792
|
+
"--scope-color-50": s(t.colors[`${r}-50`]) || "",
|
|
793
|
+
"--scope-color-100": s(t.colors[`${r}-100`]) || "",
|
|
794
|
+
"--scope-color-200": s(t.colors[`${r}-200`]) || "",
|
|
795
|
+
"--scope-color-300": s(t.colors[`${r}-300`]) || "",
|
|
796
|
+
"--scope-color-400": s(t.colors[`${r}-400`]) || "",
|
|
797
|
+
"--scope-color-500": s(t.colors[`${r}-500`]) || "",
|
|
798
|
+
"--scope-color-600": s(t.colors[`${r}-600`]) || "",
|
|
799
|
+
"--scope-color-700": s(t.colors[`${r}-700`]) || "",
|
|
800
|
+
"--scope-color-800": s(t.colors[`${r}-800`]) || "",
|
|
801
|
+
"--scope-color-900": s(t.colors[`${r}-900`]) || "",
|
|
802
|
+
"--scope-light-0": s(t.colors[`${r}-light-0`]) || "",
|
|
803
|
+
"--scope-light-1": s(t.colors[`${r}-light-1`]) || "",
|
|
804
|
+
"--scope-light-2": s(t.colors[`${r}-light-2`]) || "",
|
|
805
|
+
"--scope-light-3": s(t.colors[`${r}-light-3`]) || "",
|
|
806
|
+
"--scope-light-4": s(t.colors[`${r}-light-4`]) || "",
|
|
807
|
+
"--scope-dark-0": s(t.colors[`${r}-dark-0`]) || "",
|
|
808
|
+
"--scope-dark-1": s(t.colors[`${r}-dark-1`]) || "",
|
|
809
|
+
"--scope-dark-2": s(t.colors[`${r}-dark-2`]) || "",
|
|
810
|
+
"--scope-dark-3": s(t.colors[`${r}-dark-3`]) || "",
|
|
811
|
+
"--scope-dark-4": s(t.colors[`${r}-dark-4`]) || "",
|
|
812
|
+
"--current-hl": s(t.colors[`${r}-500`]) || ""
|
|
813
813
|
};
|
|
814
814
|
}
|
|
815
815
|
],
|
|
816
816
|
[
|
|
817
817
|
/^(bg|text|fill|stroke|border|outline|icon|caret)-scope-((?:color|dark|light|text|bg|white|black|icon)(?:-\d+)?)(\/\d{1,3})?$/,
|
|
818
|
-
(
|
|
819
|
-
const
|
|
818
|
+
(e, { theme: t }) => {
|
|
819
|
+
const r = W(e[1]), o = O(e[1]), c = e[2], n = e[3], i = n ? Number(n.slice(1)) / 100 : 1, l = c.startsWith("color") ? `grey-${c.slice(6)}` : `grey-${c}`, d = i === 1 ? `var(${o})` : i;
|
|
820
820
|
return {
|
|
821
821
|
[o]: i,
|
|
822
|
-
[
|
|
822
|
+
[r]: `rgb(var(--scope-${c}, ${t.colors[l] || ""}) / ${d})`
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
825
|
],
|
|
826
826
|
[
|
|
827
827
|
/^icon-opacity-(\d{1,3})$/,
|
|
828
|
-
(
|
|
829
|
-
const
|
|
828
|
+
(e, { theme: t }) => {
|
|
829
|
+
const r = e[1];
|
|
830
830
|
return {
|
|
831
|
-
"--un-icon-opacity": Number(
|
|
831
|
+
"--un-icon-opacity": Number(r) / 100
|
|
832
832
|
};
|
|
833
833
|
}
|
|
834
834
|
],
|
|
@@ -838,13 +838,13 @@ const Z = [
|
|
|
838
838
|
color: "rgb(var(--current-icon) / var(--un-icon-opacity, 1))"
|
|
839
839
|
})
|
|
840
840
|
]
|
|
841
|
-
],
|
|
841
|
+
], re = [
|
|
842
842
|
[
|
|
843
843
|
// special text margin (vertical) that compensates
|
|
844
844
|
// the line height
|
|
845
845
|
/^text-m([bty])?-(.*)$/,
|
|
846
|
-
(
|
|
847
|
-
const
|
|
846
|
+
(e, { theme: t }) => {
|
|
847
|
+
const r = e[1], o = e[2], c = r ? { y: ["top", "bottom"], t: ["top"], b: ["bottom"] }[r] : ["top", "bottom", "left", "right"], n = {};
|
|
848
848
|
if (t.spacing[o]) {
|
|
849
849
|
for (const i of c)
|
|
850
850
|
n[`margin-${i}`] = ["left", "right"].includes(i) ? t.spacing[o] : `calc(${t.spacing[o]} + var(--font-${i === "top" ? "tc" : "bc"}))`;
|
|
@@ -861,20 +861,20 @@ const Z = [
|
|
|
861
861
|
],
|
|
862
862
|
[
|
|
863
863
|
/^card-dense$/,
|
|
864
|
-
(
|
|
864
|
+
(e, { theme: t }) => ({
|
|
865
865
|
"--card-spacing": "var(--card-spacing-dense)"
|
|
866
866
|
}),
|
|
867
867
|
{ layer: "utilities" }
|
|
868
868
|
],
|
|
869
869
|
[
|
|
870
870
|
/^card-(.*)$/,
|
|
871
|
-
(
|
|
872
|
-
const
|
|
873
|
-
if (t.fontSize[
|
|
874
|
-
const o = t.fontSize[
|
|
871
|
+
(e, { theme: t }) => {
|
|
872
|
+
const r = e[1];
|
|
873
|
+
if (t.fontSize[r]) {
|
|
874
|
+
const o = t.fontSize[r][1];
|
|
875
875
|
return {
|
|
876
|
-
"--card-spacing": `${
|
|
877
|
-
"--card-spacing-dense": `${
|
|
876
|
+
"--card-spacing": `${m(o["--font-corrected"], t.cardSpacingFactor.regular)}`,
|
|
877
|
+
"--card-spacing-dense": `${m(
|
|
878
878
|
o["--font-corrected"],
|
|
879
879
|
t.cardSpacingFactor.dense
|
|
880
880
|
)}`,
|
|
@@ -893,39 +893,39 @@ const Z = [
|
|
|
893
893
|
],
|
|
894
894
|
[
|
|
895
895
|
/^fingertip-(.*)/,
|
|
896
|
-
(
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
896
|
+
(e, { theme: t }) => {
|
|
897
|
+
const r = e[1];
|
|
898
|
+
if (r.startsWith("[") && r.endsWith("]"))
|
|
899
899
|
return {
|
|
900
|
-
"--v-fingertip":
|
|
901
|
-
"--v-fingertip-half":
|
|
900
|
+
"--v-fingertip": r.slice(1, -1),
|
|
901
|
+
"--v-fingertip-half": m(r.slice(1, -1), 0.5)
|
|
902
902
|
};
|
|
903
|
-
if (["xs", "s", "m", "l", "xl"].includes(
|
|
903
|
+
if (["xs", "s", "m", "l", "xl"].includes(r))
|
|
904
904
|
return {
|
|
905
|
-
"--v-fingertip": t.spacing[`fingertip-${
|
|
906
|
-
"--v-fingertip-half":
|
|
905
|
+
"--v-fingertip": t.spacing[`fingertip-${r}`],
|
|
906
|
+
"--v-fingertip-half": m(t.spacing[`fingertip-${r}`], 0.5)
|
|
907
907
|
};
|
|
908
|
-
if (t.spacing[
|
|
908
|
+
if (t.spacing[r])
|
|
909
909
|
return {
|
|
910
|
-
"--v-fingertip": t.spacing[
|
|
911
|
-
"--v-fingertip-half":
|
|
910
|
+
"--v-fingertip": t.spacing[r],
|
|
911
|
+
"--v-fingertip-half": m(t.spacing[r], 0.5)
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
914
|
]
|
|
915
|
-
],
|
|
916
|
-
function a(
|
|
917
|
-
return t * 1.618 **
|
|
915
|
+
], te = [...re, ...ee];
|
|
916
|
+
function a(e, t = 1) {
|
|
917
|
+
return t * 1.618 ** e;
|
|
918
918
|
}
|
|
919
|
-
function u(
|
|
919
|
+
function u(e, t, r, o, c) {
|
|
920
920
|
return {
|
|
921
|
-
weight:
|
|
921
|
+
weight: e,
|
|
922
922
|
boldWeight: t,
|
|
923
|
-
size:
|
|
923
|
+
size: r,
|
|
924
924
|
height: o,
|
|
925
925
|
spacing: c
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
|
-
const
|
|
928
|
+
const oe = {
|
|
929
929
|
h1: (
|
|
930
930
|
/* */
|
|
931
931
|
u(
|
|
@@ -1081,21 +1081,21 @@ const te = {
|
|
|
1081
1081
|
)
|
|
1082
1082
|
)
|
|
1083
1083
|
};
|
|
1084
|
-
function
|
|
1085
|
-
const l =
|
|
1084
|
+
function ce(e, t, r, o, c, n = 1, i = 0.5) {
|
|
1085
|
+
const l = e * n, g = (o * e - l) / e, v = l / 2, y = l * i - v + g / 2, k = l * (1 - i) - v + g / 2, $ = p(y, 4), x = p(k, 4);
|
|
1086
1086
|
return {
|
|
1087
|
-
mt:
|
|
1088
|
-
mb:
|
|
1089
|
-
size:
|
|
1087
|
+
mt: $,
|
|
1088
|
+
mb: x,
|
|
1089
|
+
size: e,
|
|
1090
1090
|
correctedSize: l,
|
|
1091
1091
|
theme: [
|
|
1092
|
-
`${
|
|
1092
|
+
`${e}em`,
|
|
1093
1093
|
{
|
|
1094
|
-
"--font-bold":
|
|
1095
|
-
"--font-size": `${
|
|
1094
|
+
"--font-bold": r,
|
|
1095
|
+
"--font-size": `${e}em`,
|
|
1096
1096
|
"--font-corrected": `${l}em`,
|
|
1097
|
-
"--font-bc": `${-
|
|
1098
|
-
"--font-tc": `${
|
|
1097
|
+
"--font-bc": `${-x}em`,
|
|
1098
|
+
"--font-tc": `${-$}em`,
|
|
1099
1099
|
"font-weight": t,
|
|
1100
1100
|
"line-height": `${o}em`,
|
|
1101
1101
|
"letter-spacing": `${c}em`
|
|
@@ -1107,23 +1107,23 @@ function oe(r, t, e, o, c, n = 1, i = 0.5) {
|
|
|
1107
1107
|
]
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
|
-
const
|
|
1110
|
+
const ne = (e) => {
|
|
1111
1111
|
const t = {
|
|
1112
1112
|
// canonical
|
|
1113
|
-
$xxs: `${p(1 /
|
|
1114
|
-
$xs: `${p(1 /
|
|
1115
|
-
$s: `${p(1 /
|
|
1113
|
+
$xxs: `${p(1 / e.spacingFactor ** 3, 3)}em`,
|
|
1114
|
+
$xs: `${p(1 / e.spacingFactor ** 2, 3)}em`,
|
|
1115
|
+
$s: `${p(1 / e.spacingFactor, 3)}em`,
|
|
1116
1116
|
$m: "1em",
|
|
1117
|
-
$l: `${p(
|
|
1118
|
-
$xl: `${p(
|
|
1119
|
-
$xxl: `${p(
|
|
1117
|
+
$l: `${p(e.spacingFactor, 3)}em`,
|
|
1118
|
+
$xl: `${p(e.spacingFactor ** 2, 3)}em`,
|
|
1119
|
+
$xxl: `${p(e.spacingFactor ** 3, 3)}em`,
|
|
1120
1120
|
fingertip: "var(--v-fingertip)",
|
|
1121
1121
|
"fingertip-half": "var(--v-fingertip-half)",
|
|
1122
|
-
"fingertip-xs":
|
|
1123
|
-
"fingertip-s":
|
|
1124
|
-
"fingertip-m":
|
|
1125
|
-
"fingertip-l":
|
|
1126
|
-
"fingertip-xl":
|
|
1122
|
+
"fingertip-xs": e.fingertip.xs,
|
|
1123
|
+
"fingertip-s": e.fingertip.s,
|
|
1124
|
+
"fingertip-m": e.fingertip.m,
|
|
1125
|
+
"fingertip-l": e.fingertip.l,
|
|
1126
|
+
"fingertip-xl": e.fingertip.xl,
|
|
1127
1127
|
// font-based
|
|
1128
1128
|
"$font-tc": "var(--font-bc)",
|
|
1129
1129
|
"$font-bc": "var(--font-tc)",
|
|
@@ -1135,18 +1135,18 @@ const ce = (r) => {
|
|
|
1135
1135
|
"$card-heading-size": "var(--card-heading-size)",
|
|
1136
1136
|
"$card-heading-corrected": "var(--card-heading-corrected)",
|
|
1137
1137
|
// radius
|
|
1138
|
-
"base-radius":
|
|
1139
|
-
},
|
|
1138
|
+
"base-radius": e.baseRadius
|
|
1139
|
+
}, r = {
|
|
1140
1140
|
fingertip: "var(--v-fingertip)",
|
|
1141
1141
|
"fingertip-half": "var(--v-fingertip-half)",
|
|
1142
|
-
"fingertip-xs":
|
|
1143
|
-
"fingertip-s":
|
|
1144
|
-
"fingertip-m":
|
|
1145
|
-
"fingertip-l":
|
|
1146
|
-
"fingertip-xl":
|
|
1142
|
+
"fingertip-xs": e.fingertip.xs,
|
|
1143
|
+
"fingertip-s": e.fingertip.s,
|
|
1144
|
+
"fingertip-m": e.fingertip.m,
|
|
1145
|
+
"fingertip-l": e.fingertip.l,
|
|
1146
|
+
"fingertip-xl": e.fingertip.xl
|
|
1147
1147
|
}, o = {
|
|
1148
1148
|
...t,
|
|
1149
|
-
base:
|
|
1149
|
+
base: e.baseRadius
|
|
1150
1150
|
}, c = {
|
|
1151
1151
|
$bold: "var(--font-bold)"
|
|
1152
1152
|
}, n = {
|
|
@@ -1164,31 +1164,31 @@ const ce = (r) => {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
]
|
|
1166
1166
|
};
|
|
1167
|
-
for (const [l, d] of Object.entries(
|
|
1167
|
+
for (const [l, d] of Object.entries(e.typography))
|
|
1168
1168
|
if (d != null && d.size) {
|
|
1169
|
-
const
|
|
1169
|
+
const g = ce(
|
|
1170
1170
|
d.size || 1,
|
|
1171
1171
|
d.weight || 400,
|
|
1172
1172
|
d.boldWeight || 700,
|
|
1173
1173
|
d.height || 1,
|
|
1174
1174
|
d.spacing || 0,
|
|
1175
|
-
d.actualHeightFactor ||
|
|
1176
|
-
d.actualHeightTopBottomRatio ||
|
|
1175
|
+
d.actualHeightFactor || e.actualFontHeightFactor,
|
|
1176
|
+
d.actualHeightTopBottomRatio || e.actualFontHeightTopBottomRatio
|
|
1177
1177
|
);
|
|
1178
|
-
n[l] =
|
|
1178
|
+
n[l] = g.theme, t[l] = `${g.size}em`;
|
|
1179
1179
|
}
|
|
1180
|
-
const i =
|
|
1180
|
+
const i = Q(e.palette);
|
|
1181
1181
|
return {
|
|
1182
1182
|
colors: i.colors,
|
|
1183
1183
|
surfaces: i.surfaces,
|
|
1184
1184
|
borderColor: "red",
|
|
1185
|
-
reverseLightLayers:
|
|
1186
|
-
reverseDarkLayers:
|
|
1187
|
-
lineHeight:
|
|
1185
|
+
reverseLightLayers: e.layers.reverseLight,
|
|
1186
|
+
reverseDarkLayers: e.layers.reverseDark,
|
|
1187
|
+
lineHeight: r,
|
|
1188
1188
|
spacing: t,
|
|
1189
1189
|
fontWeight: c,
|
|
1190
|
-
actualFontHeightFactor:
|
|
1191
|
-
cardSpacingFactor:
|
|
1190
|
+
actualFontHeightFactor: e.actualFontHeightFactor,
|
|
1191
|
+
cardSpacingFactor: e.cardSpacingFactor,
|
|
1192
1192
|
fontSize: n,
|
|
1193
1193
|
width: t,
|
|
1194
1194
|
height: t,
|
|
@@ -1252,10 +1252,10 @@ const ce = (r) => {
|
|
|
1252
1252
|
// },
|
|
1253
1253
|
};
|
|
1254
1254
|
};
|
|
1255
|
-
function V(
|
|
1256
|
-
return t * Math.sqrt(1.618) **
|
|
1255
|
+
function V(e, t = 1) {
|
|
1256
|
+
return t * Math.sqrt(1.618) ** e;
|
|
1257
1257
|
}
|
|
1258
|
-
const
|
|
1258
|
+
const ie = {
|
|
1259
1259
|
spacingFactor: 1.618,
|
|
1260
1260
|
actualFontHeightFactor: 1,
|
|
1261
1261
|
actualFontHeightTopBottomRatio: 0.52,
|
|
@@ -1263,7 +1263,7 @@ const ne = {
|
|
|
1263
1263
|
regular: 1,
|
|
1264
1264
|
dense: 0.6
|
|
1265
1265
|
},
|
|
1266
|
-
typography:
|
|
1266
|
+
typography: oe,
|
|
1267
1267
|
layers: {
|
|
1268
1268
|
reverseDark: !1,
|
|
1269
1269
|
reverseLight: !1
|
|
@@ -1276,14 +1276,14 @@ const ne = {
|
|
|
1276
1276
|
xl: "4em"
|
|
1277
1277
|
},
|
|
1278
1278
|
baseRadius: `${p(1 / 1.618, 3)}em`
|
|
1279
|
-
},
|
|
1280
|
-
const t = F(
|
|
1281
|
-
|
|
1282
|
-
const o =
|
|
1279
|
+
}, fe = (e) => {
|
|
1280
|
+
const t = F(e, ie), r = ae();
|
|
1281
|
+
r.preflights || (r.preflights = []), r.preflights.push(_), r.rules || (r.rules = []), r.rules.push(...te);
|
|
1282
|
+
const o = Z();
|
|
1283
1283
|
return {
|
|
1284
|
-
...
|
|
1284
|
+
...r,
|
|
1285
1285
|
name: "vunor",
|
|
1286
|
-
theme: F(
|
|
1286
|
+
theme: F(ne(t), r.theme),
|
|
1287
1287
|
shortcuts: o,
|
|
1288
1288
|
layers: {
|
|
1289
1289
|
preflights: 0,
|
|
@@ -1293,26 +1293,26 @@ const ne = {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
};
|
|
1295
1295
|
};
|
|
1296
|
-
function
|
|
1296
|
+
function ae() {
|
|
1297
1297
|
var t;
|
|
1298
|
-
const
|
|
1299
|
-
return (t =
|
|
1300
|
-
|
|
1301
|
-
}),
|
|
1298
|
+
const e = C();
|
|
1299
|
+
return (t = e.rules) == null || t.forEach((r) => {
|
|
1300
|
+
r[0] instanceof RegExp && (r[0].source.startsWith("^m-") || r[0].source.startsWith("^ma?") || r[0].source.startsWith("^p-?") || r[0].source.startsWith("^pa?")) && (r[2] = r[2] || {}, r[2].layer = "utilities");
|
|
1301
|
+
}), e;
|
|
1302
1302
|
}
|
|
1303
|
-
const
|
|
1304
|
-
function ge(
|
|
1305
|
-
const
|
|
1306
|
-
for (const [o, c] of Object.entries(
|
|
1307
|
-
|
|
1308
|
-
return
|
|
1303
|
+
const le = [G, U, ...E], se = R(le);
|
|
1304
|
+
function ge(e, t = se) {
|
|
1305
|
+
const r = e ? R([t, e]) : t;
|
|
1306
|
+
for (const [o, c] of Object.entries(r))
|
|
1307
|
+
r[o] = typeof c == "string" ? c : h(c);
|
|
1308
|
+
return r;
|
|
1309
1309
|
}
|
|
1310
1310
|
export {
|
|
1311
|
-
|
|
1311
|
+
f as defineShortcuts,
|
|
1312
1312
|
R as mergeVunorShortcuts,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1313
|
+
se as mergedVunorShortcuts,
|
|
1314
|
+
fe as presetVunor,
|
|
1315
|
+
le as rawVunorShortcuts,
|
|
1316
|
+
h as toUnoShortcut,
|
|
1317
1317
|
ge as vunorShortcuts
|
|
1318
1318
|
};
|