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.
Files changed (2) hide show
  1. package/dist/theme.mjs +232 -232
  2. 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 S, color as z } from "@prostojs/palitra";
4
- const g = (r) => r, L = g({
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 = g({
42
- card: `data-[rounded=true]:rounded-$card-spacing data-[dense=true]:card-dense! ${N.map((r) => `data-[level=${r}]:card-${r}`).join(" ")}`
43
- }), T = g({
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 = g({
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 = g({
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 = g({
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 = g({
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 = g({
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 = g({
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 = g({
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
- }), _ = g({
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 m(r) {
380
+ function h(e) {
381
381
  let t = "";
382
- for (const [e, o] of Object.entries(r)) {
382
+ for (const [r, o] of Object.entries(e)) {
383
383
  const c = H(o);
384
- t += `${c.map((n) => `${e}${n}`).join(" ")} `;
384
+ t += `${c.map((n) => `${r}${n}`).join(" ")} `;
385
385
  }
386
386
  return t.trim();
387
387
  }
388
- function H(r) {
389
- if (typeof r == "string")
390
- return r.split(" ");
391
- if (Array.isArray(r))
392
- return r;
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 [e, o] of Object.entries(r))
395
- t.push(...H(o).map((c) => `${e}${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 G = (r, t) => {
399
- const e = {}, o = /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(r)]);
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
- e[c] = r[c];
403
- else if (!Object.prototype.hasOwnProperty.call(r, c))
404
- e[c] = t[c];
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 = r[c];
407
- Array.isArray(n) && (n = n.join(" ")), Array.isArray(i) && (i = i.join(" ")), typeof n == "string" && typeof i == "string" ? e[c] = `${i} ${n}` : typeof n == "object" && typeof i == "string" ? e[c] = `${i} ${m(n)}` : typeof n == "string" && typeof i == "object" ? e[c] = `${m(i)} ${n}` : typeof n == "object" && typeof i == "object" && (e[c] = `${m(i)} ${m(n)}`);
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 e;
410
- }, R = (r) => r.reduce((t, e) => G(t, e), {}), h = {
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 J(r) {
562
- var d, f, $, k, w, x;
563
- const t = (h == null ? void 0 : h.colors) || {};
564
- for (const y of Object.keys(t)) {
565
- const j = h == null ? void 0 : h.colors[y];
566
- typeof j == "string" && (t[y] = { color: j });
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 e = A(r, { ...h, colors: t }), o = {
568
+ const r = A({ ...e, colors: t }, K), o = {
569
569
  count: 5,
570
570
  preserveInputColor: !1,
571
571
  luminance: {
572
- dark: ((d = e.layerPalette.luminance) == null ? void 0 : d.dark) ?? e.darkest,
573
- light: ((f = e.layerPalette.luminance) == null ? void 0 : f.light) ?? e.darkest + e.layersDepth,
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: e.layerPalette.saturate,
577
- vivid: e.layerPalette.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 = S(
580
- P(e.colors, e.layerPalette.desaturate),
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 = S(
587
- P(e.colors, e.layerPalette.desaturate),
586
+ const i = w(
587
+ P(r.colors, r.layerPalette.desaturate),
588
588
  o
589
- ).toStrings(), l = S(
589
+ ).toStrings(), l = w(
590
590
  {
591
- primary: e.colors.primary,
592
- grey: e.colors.grey,
593
- secondary: e.colors.secondary,
594
- neutral: e.colors.neutral,
595
- good: e.colors.good,
596
- warn: e.colors.warn,
597
- error: e.colors.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: e.mainPalette.preserveInputColor,
601
+ preserveInputColor: r.mainPalette.preserveInputColor,
602
602
  luminance: {
603
- dark: (($ = e.mainPalette.luminance) == null ? void 0 : $.dark) ?? e.darkest + e.layersDepth + 0.02,
604
- light: ((k = e.mainPalette.luminance) == null ? void 0 : k.light) ?? e.lightest,
605
- useMiddle: (w = e.mainPalette.luminance) == null ? void 0 : w.useMiddle,
606
- middle: (x = e.mainPalette.luminance) == null ? void 0 : x.middle
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: e.mainPalette.saturate,
609
- vivid: e.mainPalette.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: e.surfaces
618
+ surfaces: r.surfaces
619
619
  };
620
620
  }
621
- function P(r, t = 0.5) {
622
- const e = {};
623
- for (const [o, c] of Object.entries(r)) {
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] = z(n).hsl();
627
- e[o] = z(i, l * t, d, "hsl").hex();
626
+ const [i, l, d] = S(n).hsl();
627
+ r[o] = S(i, l * t, d, "hsl").hex();
628
628
  }
629
629
  }
630
- return e;
630
+ return r;
631
631
  }
632
- function K() {
632
+ function Z() {
633
633
  return [
634
634
  [
635
635
  /^layer-([0-4])$/,
636
- ([, r], { theme: t }) => {
637
- let e = Number(r), o = Number(r);
638
- return t.reverseDarkLayers && (e = 4 - Number(r)), t.reverseLightLayers && (o = 4 - Number(r)), m({
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-${e} current-text-scope-light-2 current-icon-scope-light-2`,
641
- "[&.dark]:": `current-bg-scope-dark-${e} current-text-scope-light-2 current-icon-scope-light-2`
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
- ([, r], { theme: t }) => t.surfaces[r] ? m({
648
- "": `current-bg-${t.surfaces[r][0]} current-text-${t.surfaces[r][1]} current-icon-${t.surfaces[r][1]} current-border-${t.surfaces[r][2]} bg-current text-current border-current icon-current`,
649
- "dark:": `current-bg-${t.surfaces[r][3]} current-text-${t.surfaces[r][4]} current-icon-${t.surfaces[r][4]} current-border-${t.surfaces[r][5]} shadow-black/30`,
650
- "[&.dark]:": `current-bg-${t.surfaces[r][3]} current-text-${t.surfaces[r][4]} current-icon-${t.surfaces[r][4]} current-border-${t.surfaces[r][5]} shadow-black/30`
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(r, t = 0) {
659
- const e = 10 ** t;
660
- return Math.round(r * e) / e;
658
+ function p(e, t = 0) {
659
+ const r = 10 ** t;
660
+ return Math.round(e * r) / r;
661
661
  }
662
- function v(r, t, e = 3) {
662
+ function m(e, t, r = 3) {
663
663
  var n;
664
- const o = Number.parseFloat(r), c = ((n = /(px|em|rem|%)$/.exec(r)) == null ? void 0 : n[1]) || "";
665
- return `${p(o * t, e)}${c}`;
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 Q = {
668
- getCSS: ({ theme: r }) => `${b("body", r.fontSize.body) + // renderFontCss('label', theme.fontSize.label) +
669
- b("figcaption", r.fontSize.caption) + b("h1", r.fontSize.h1) + b("h2", r.fontSize.h2) + b("h3", r.fontSize.h3) + b("h4", r.fontSize.h4) + b("h5", r.fontSize.h5) + b("h6", r.fontSize.h6)}
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: ${r.spacing["fingertip-m"] || "3em"};
676
- --v-fingertip-half: ${v(r.spacing["fingertip-m"] || "3em", 0.5)};
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(r, t) {
719
- return `${r} { font-size: ${t[0]}; ${Object.entries(t[1]).map((e) => `${e[0]}: ${e[1]};`).join(" ")} }
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(r) {
723
- const [t, e, o, c] = z(r).rgba();
724
- return `${t} ${e} ${o}`;
722
+ function s(e) {
723
+ const [t, r, o, c] = S(e).rgba();
724
+ return `${t} ${r} ${o}`;
725
725
  }
726
- function O(r) {
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
- }[r];
736
+ }[e];
737
737
  }
738
- function W(r) {
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
- }[r];
748
+ }[e];
749
749
  }
750
- const Z = [
750
+ const ee = [
751
751
  [
752
752
  /^current-(text|bg|icon|border|outline|caret|hl)-(.+)$/,
753
- (r, { theme: t }) => {
754
- const e = r[1], o = r[2];
753
+ (e, { theme: t }) => {
754
+ const r = e[1], o = e[2];
755
755
  if (o.startsWith("scope-"))
756
756
  return {
757
- [`--current-${e}`]: `var(--${o})`
757
+ [`--current-${r}`]: `var(--${o})`
758
758
  };
759
759
  if (o === "hl")
760
760
  return {
761
- [`--current-${e}`]: "var(--current-hl)"
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-${e}`]: s(c.DEFAULT || c)
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
- (r, { theme: t }) => {
775
- const e = r[1], o = r[2] || `-${e}`, c = O(e), n = W(e), i = r[3], l = i ? Number(i.slice(1)) / 100 : 1, d = l === 1 ? `var(${c})` : l;
776
- return e === "icon" ? {
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
- (r, { theme: t }) => {
788
- const e = r[1], o = t.colors[e];
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[`${e}-50`]) || "",
793
- "--scope-color-100": s(t.colors[`${e}-100`]) || "",
794
- "--scope-color-200": s(t.colors[`${e}-200`]) || "",
795
- "--scope-color-300": s(t.colors[`${e}-300`]) || "",
796
- "--scope-color-400": s(t.colors[`${e}-400`]) || "",
797
- "--scope-color-500": s(t.colors[`${e}-500`]) || "",
798
- "--scope-color-600": s(t.colors[`${e}-600`]) || "",
799
- "--scope-color-700": s(t.colors[`${e}-700`]) || "",
800
- "--scope-color-800": s(t.colors[`${e}-800`]) || "",
801
- "--scope-color-900": s(t.colors[`${e}-900`]) || "",
802
- "--scope-light-0": s(t.colors[`${e}-light-0`]) || "",
803
- "--scope-light-1": s(t.colors[`${e}-light-1`]) || "",
804
- "--scope-light-2": s(t.colors[`${e}-light-2`]) || "",
805
- "--scope-light-3": s(t.colors[`${e}-light-3`]) || "",
806
- "--scope-light-4": s(t.colors[`${e}-light-4`]) || "",
807
- "--scope-dark-0": s(t.colors[`${e}-dark-0`]) || "",
808
- "--scope-dark-1": s(t.colors[`${e}-dark-1`]) || "",
809
- "--scope-dark-2": s(t.colors[`${e}-dark-2`]) || "",
810
- "--scope-dark-3": s(t.colors[`${e}-dark-3`]) || "",
811
- "--scope-dark-4": s(t.colors[`${e}-dark-4`]) || "",
812
- "--current-hl": s(t.colors[`${e}-500`]) || ""
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
- (r, { theme: t }) => {
819
- const e = W(r[1]), o = O(r[1]), c = r[2], n = r[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;
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
- [e]: `rgb(var(--scope-${c}, ${t.colors[l] || ""}) / ${d})`
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
- (r, { theme: t }) => {
829
- const e = r[1];
828
+ (e, { theme: t }) => {
829
+ const r = e[1];
830
830
  return {
831
- "--un-icon-opacity": Number(e) / 100
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
- ], ee = [
841
+ ], re = [
842
842
  [
843
843
  // special text margin (vertical) that compensates
844
844
  // the line height
845
845
  /^text-m([bty])?-(.*)$/,
846
- (r, { theme: t }) => {
847
- const e = r[1], o = r[2], c = e ? { y: ["top", "bottom"], t: ["top"], b: ["bottom"] }[e] : ["top", "bottom", "left", "right"], n = {};
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
- (r, { theme: t }) => ({
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
- (r, { theme: t }) => {
872
- const e = r[1];
873
- if (t.fontSize[e]) {
874
- const o = t.fontSize[e][1];
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": `${v(o["--font-corrected"], t.cardSpacingFactor.regular)}`,
877
- "--card-spacing-dense": `${v(
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
- (r, { theme: t }) => {
897
- const e = r[1];
898
- if (e.startsWith("[") && e.endsWith("]"))
896
+ (e, { theme: t }) => {
897
+ const r = e[1];
898
+ if (r.startsWith("[") && r.endsWith("]"))
899
899
  return {
900
- "--v-fingertip": e.slice(1, -1),
901
- "--v-fingertip-half": v(e.slice(1, -1), 0.5)
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(e))
903
+ if (["xs", "s", "m", "l", "xl"].includes(r))
904
904
  return {
905
- "--v-fingertip": t.spacing[`fingertip-${e}`],
906
- "--v-fingertip-half": v(t.spacing[`fingertip-${e}`], 0.5)
905
+ "--v-fingertip": t.spacing[`fingertip-${r}`],
906
+ "--v-fingertip-half": m(t.spacing[`fingertip-${r}`], 0.5)
907
907
  };
908
- if (t.spacing[e])
908
+ if (t.spacing[r])
909
909
  return {
910
- "--v-fingertip": t.spacing[e],
911
- "--v-fingertip-half": v(t.spacing[e], 0.5)
910
+ "--v-fingertip": t.spacing[r],
911
+ "--v-fingertip-half": m(t.spacing[r], 0.5)
912
912
  };
913
913
  }
914
914
  ]
915
- ], re = [...ee, ...Z];
916
- function a(r, t = 1) {
917
- return t * 1.618 ** r;
915
+ ], te = [...re, ...ee];
916
+ function a(e, t = 1) {
917
+ return t * 1.618 ** e;
918
918
  }
919
- function u(r, t, e, o, c) {
919
+ function u(e, t, r, o, c) {
920
920
  return {
921
- weight: r,
921
+ weight: e,
922
922
  boldWeight: t,
923
- size: e,
923
+ size: r,
924
924
  height: o,
925
925
  spacing: c
926
926
  };
927
927
  }
928
- const te = {
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 oe(r, t, e, o, c, n = 1, i = 0.5) {
1085
- const l = r * n, f = (o * r - l) / r, $ = l / 2, k = l * i - $ + f / 2, w = l * (1 - i) - $ + f / 2, x = p(k, 4), y = p(w, 4);
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: x,
1088
- mb: y,
1089
- size: r,
1087
+ mt: $,
1088
+ mb: x,
1089
+ size: e,
1090
1090
  correctedSize: l,
1091
1091
  theme: [
1092
- `${r}em`,
1092
+ `${e}em`,
1093
1093
  {
1094
- "--font-bold": e,
1095
- "--font-size": `${r}em`,
1094
+ "--font-bold": r,
1095
+ "--font-size": `${e}em`,
1096
1096
  "--font-corrected": `${l}em`,
1097
- "--font-bc": `${-y}em`,
1098
- "--font-tc": `${-x}em`,
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 ce = (r) => {
1110
+ const ne = (e) => {
1111
1111
  const t = {
1112
1112
  // canonical
1113
- $xxs: `${p(1 / r.spacingFactor ** 3, 3)}em`,
1114
- $xs: `${p(1 / r.spacingFactor ** 2, 3)}em`,
1115
- $s: `${p(1 / r.spacingFactor, 3)}em`,
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(r.spacingFactor, 3)}em`,
1118
- $xl: `${p(r.spacingFactor ** 2, 3)}em`,
1119
- $xxl: `${p(r.spacingFactor ** 3, 3)}em`,
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": r.fingertip.xs,
1123
- "fingertip-s": r.fingertip.s,
1124
- "fingertip-m": r.fingertip.m,
1125
- "fingertip-l": r.fingertip.l,
1126
- "fingertip-xl": r.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": r.baseRadius
1139
- }, e = {
1138
+ "base-radius": e.baseRadius
1139
+ }, r = {
1140
1140
  fingertip: "var(--v-fingertip)",
1141
1141
  "fingertip-half": "var(--v-fingertip-half)",
1142
- "fingertip-xs": r.fingertip.xs,
1143
- "fingertip-s": r.fingertip.s,
1144
- "fingertip-m": r.fingertip.m,
1145
- "fingertip-l": r.fingertip.l,
1146
- "fingertip-xl": r.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: r.baseRadius
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(r.typography))
1167
+ for (const [l, d] of Object.entries(e.typography))
1168
1168
  if (d != null && d.size) {
1169
- const f = oe(
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 || r.actualFontHeightFactor,
1176
- d.actualHeightTopBottomRatio || r.actualFontHeightTopBottomRatio
1175
+ d.actualHeightFactor || e.actualFontHeightFactor,
1176
+ d.actualHeightTopBottomRatio || e.actualFontHeightTopBottomRatio
1177
1177
  );
1178
- n[l] = f.theme, t[l] = `${f.size}em`;
1178
+ n[l] = g.theme, t[l] = `${g.size}em`;
1179
1179
  }
1180
- const i = J(r.palette);
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: r.layers.reverseLight,
1186
- reverseDarkLayers: r.layers.reverseDark,
1187
- lineHeight: e,
1185
+ reverseLightLayers: e.layers.reverseLight,
1186
+ reverseDarkLayers: e.layers.reverseDark,
1187
+ lineHeight: r,
1188
1188
  spacing: t,
1189
1189
  fontWeight: c,
1190
- actualFontHeightFactor: r.actualFontHeightFactor,
1191
- cardSpacingFactor: r.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(r, t = 1) {
1256
- return t * Math.sqrt(1.618) ** r;
1255
+ function V(e, t = 1) {
1256
+ return t * Math.sqrt(1.618) ** e;
1257
1257
  }
1258
- const ne = {
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: te,
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
- }, pe = (r) => {
1280
- const t = F(r, ne), e = ie();
1281
- e.preflights || (e.preflights = []), e.preflights.push(Q), e.rules || (e.rules = []), e.rules.push(...re);
1282
- const o = K();
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
- ...e,
1284
+ ...r,
1285
1285
  name: "vunor",
1286
- theme: F(ce(t), e.theme),
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 ie() {
1296
+ function ae() {
1297
1297
  var t;
1298
- const r = C();
1299
- return (t = r.rules) == null || t.forEach((e) => {
1300
- e[0] instanceof RegExp && (e[0].source.startsWith("^m-") || e[0].source.startsWith("^ma?") || e[0].source.startsWith("^p-?") || e[0].source.startsWith("^pa?")) && (e[2] = e[2] || {}, e[2].layer = "utilities");
1301
- }), r;
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 ae = [_, U, ...E], le = R(ae);
1304
- function ge(r, t = le) {
1305
- const e = r ? R([t, r]) : t;
1306
- for (const [o, c] of Object.entries(e))
1307
- e[o] = typeof c == "string" ? c : m(c);
1308
- return e;
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
- g as defineShortcuts,
1311
+ f as defineShortcuts,
1312
1312
  R as mergeVunorShortcuts,
1313
- le as mergedVunorShortcuts,
1314
- pe as presetVunor,
1315
- ae as rawVunorShortcuts,
1316
- m as toUnoShortcut,
1313
+ se as mergedVunorShortcuts,
1314
+ fe as presetVunor,
1315
+ le as rawVunorShortcuts,
1316
+ h as toUnoShortcut,
1317
1317
  ge as vunorShortcuts
1318
1318
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vunor",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",