@charisol/plexo-sdk 2.0.9 → 2.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.
@@ -1,4 +1,4 @@
1
- import { i as e } from "./colorUtils-ohNG3v1i.js";
1
+ import { a as e } from "./colorUtils-BaVkGjFC.js";
2
2
  //#region src/v2/design/googleFontsData.ts
3
3
  var t = /* @__PURE__ */ "Roboto|s|123456789.Open Sans|s|345678.Inter|s|123456789.Montserrat|s|123456789.Poppins|s|123456789.Lato|s|13479.Arimo|s|4567.Roboto Condensed|s|123456789.Oswald|s|234567.Noto Sans|s|123456789.Roboto Mono|m|1234567.DM Sans|s|123456789.Raleway|s|123456789.Playfair Display|f|456789.Roboto Slab|f|123456789.Manrope|s|2345678.Rubik|s|3456789.Outfit|s|123456789.Nunito|s|23456789.Ubuntu|s|3457.Merriweather|f|3456789.Nunito Sans|s|23456789.Plus Jakarta Sans|s|2345678.Kanit|s|123456789.Bebas Neue|s|4.Work Sans|s|123456789.Lora|f|4567.Figtree|s|3456789.JetBrains Mono|m|12345678.Quicksand|s|34567.Barlow|s|123456789.PT Sans|s|47.Archivo|s|123456789.Mulish|s|23456789.Source Sans 3|s|23456789.Archivo Black|s|4.Prompt|s|123456789.Saira|s|123456789.Space Grotesk|s|34567.Bricolage Grotesque|s|2345678.Black Ops One|d|4.Fira Sans|s|123456789.Libre Baskerville|f|4567.Heebo|s|123456789.Jost|s|123456789.Cormorant Garamond|f|34567.Share Tech|s|4.Noto Serif|f|123456789.IBM Plex Sans|s|1234567.Barlow Condensed|s|123456789.Titillium Web|s|234679.Anton|s|4.Karla|s|2345678.Josefin Sans|s|1234567.Inter Tight|s|123456789.PT Serif|f|47.IBM Plex Mono|m|1234567.Libre Franklin|s|123456789.Smooch Sans|s|123456789.Inconsolata|m|23456789.Cairo|s|23456789.Mukta|s|2345678.EB Garamond|f|45678.Instrument Serif|f|4.Source Code Pro|m|23456789.Fraunces|f|123456789.Fjalla One|s|4.Lobster Two|d|47.Sora|s|12345678.Public Sans|s|123456789.Changa One|d|4.Assistant|s|2345678.Cabin|s|4567.Rajdhani|s|34567.Geist|s|123456789.Merriweather Sans|s|345678.Dancing Script|h|4567.Nanum Gothic|s|478.Lexend|s|123456789.Fredoka|s|34567.Ramabhadra|s|4.Instrument Sans|s|4567.Dosis|s|2345678.DM Serif Display|f|4.Anek Telugu|s|12345678.Newsreader|f|2345678.Red Hat Display|s|3456789.Source Serif 4|f|23456789.Cinzel|f|456789.Schibsted Grotesk|s|456789.Hind Siliguri|s|34567.Tajawal|s|2345789.Urbanist|s|123456789.Bitter|f|123456789.Oxygen|s|347.Caveat|h|4567.Hind|s|34567.Alfa Slab One|d|4.Google Sans Flex|s|123456789.Slabo 27px|f|4.Pacifico|h|4.Bungee|d|4.Crimson Text|f|467.Overpass|s|123456789.Geist Mono|m|123456789.Barlow Semi Condensed|s|123456789.Bodoni Moda|f|456789.Roboto Flex|s|123456789.Teko|s|34567.Chakra Petch|s|34567.M PLUS Rounded 1c|s|1345789.PT Sans Narrow|s|47.Orbitron|s|456789.Epilogue|s|123456789.DM Mono|m|345.Comfortaa|d|34567.Abel|s|4.Space Mono|m|47.M PLUS 1p|s|1345789.Zen Kaku Gothic New|s|34579.Almarai|s|3478.Shadows Into Light|h|4.Maven Pro|s|456789.Asap|s|123456789.Exo 2|s|123456789.Abril Fatface|d|4.Marcellus|f|4.Archivo Narrow|s|4567.Saira Condensed|s|123456789.Be Vietnam Pro|s|123456789.Questrial|s|4.Play|s|47.Unbounded|s|23456789.Great Vibes|h|4.Gravitas One|d|4.Hanken Grotesk|s|123456789.IBM Plex Sans Arabic|s|1234567.Spectral|f|2345678.Arvo|f|47.Sofia Sans|s|123456789.Lobster|d|4.Cormorant|f|34567.Albert Sans|s|123456789.Baloo 2|d|45678.Lexend Deca|s|123456789.League Spartan|s|123456789.Exo|s|123456789.Varela Round|s|4.Permanent Marker|h|4.IBM Plex Serif|f|1234567.Nanum Myeongjo|f|478.Red Hat Text|s|34567.Syne|s|45678.Geologica|s|123456789.Lilita One|d|4.Frank Ruhl Libre|f|3456789.Indie Flower|h|4.Amiri|f|47.Satisfy|h|4.Slabo 13px|f|4.Doppio One|s|4.Courier Prime|m|47.Atkinson Hyperlegible|s|47.Domine|f|4567.Yellowtail|h|4.Rethink Sans|s|45678.Noto Kufi Arabic|s|123456789.Alegreya Sans|s|1345789.Zilla Slab|f|34567.Fira Sans Condensed|s|123456789.ABeeZee|s|4.Yanone Kaffeesatz|s|234567.Luckiest Guy|d|4.Onest|s|123456789.Vollkorn|f|456789.Faustina|f|345678.Hammersmith One|s|4.LINE Seed JP|s|1478.Crimson Pro|f|23456789.Shippori Mincho|f|45678.Literata|f|23456789.Playfair|f|3456789.Roboto Serif|f|123456789.Montserrat Alternates|s|123456789.Quantico|s|47.Baskervville|f|4567.Noto Nastaliq Urdu|f|4567.Noto Naskh Arabic|f|4567.Press Start 2P|d|4.Asap Condensed|s|23456789.Catamaran|s|123456789.Rowdies|d|347.Bangers|d|4.Russo One|s|4.Bree Serif|f|4.Viga|s|4.Special Elite|d|4.Zen Maru Gothic|s|34579.Lexend Giga|s|123456789.News Cycle|s|47.Prata|f|4.Tinos|f|47.Alegreya|f|456789.Changa|s|2345678.Patua One|d|4.Tenor Sans|s|4.Khand|s|34567.Audiowide|d|4.Zeyada|h|4.Oxanium|d|2345678.Kalam|h|347.Golos Text|s|456789.Alata|s|4.Noticia Text|f|47.Amatic SC|h|47.Comic Neue|h|347.Hind Madurai|s|34567.Cantarell|s|47.Sarabun|s|12345678.IBM Plex Sans Condensed|s|1234567.Encode Sans|s|123456789.Righteous|d|4.Nanum Gothic Coding|h|47.Gothic A1|s|123456789.Fira Code|m|34567.Aleo|f|123456789.Libre Caslon Text|f|47.Chivo|s|123456789.Sawarabi Mincho|f|4.Sanchez|f|4.Courgette|h|4.Antic Slab|f|4.Kumbh Sans|s|123456789.Quattrocento|f|47.Old Standard TT|f|47.Cardo|f|47.Crete Round|f|4.Sawarabi Gothic|s|4.Antonio|s|1234567.League Gothic|s|4.DM Serif Text|f|4.STIX Two Text|f|4567.Philosopher|s|47.Signika|s|34567.Rubik Mono One|s|4.Passion One|d|479.Neuton|f|23478.Share Tech Mono|m|4.Gruppo|s|4.Kaushan Script|h|4.Sacramento|h|4.Francois One|s|4.VT323|m|4.Signika Negative|s|34567.Vazirmatn|s|123456789.Josefin Slab|f|1234567.Creepster|d|4.BIZ UDPGothic|s|47.Readex Pro|s|234567.Acme|s|4.Sen|s|45678.Titan One|d|4.Forum|d|4.Martel|f|2346789.Bevan|f|4.Unna|f|47.Biryani|s|2346789.Amaranth|s|47.Radio Canada|s|34567.Gilda Display|f|4.Pinyon Script|h|4.Didact Gothic|s|4.Encode Sans Condensed|s|123456789.Dela Gothic One|d|4.Saira Extra Condensed|s|123456789.Playfair Display SC|f|479.Playball|d|4.Delius|h|4.Ubuntu Condensed|s|4.Bai Jamjuree|s|234567.Oleo Script|d|47.Alex Brush|h|4.Merienda|h|3456789.Rammetto One|d|4.Alexandria|s|123456789.Michroma|s|4.Staatliches|d|4.Libre Barcode 39|d|4.Rokkitt|f|123456789.Sofia Sans Condensed|s|123456789.Gabarito|d|456789.Fugaz One|d|4.Kameron|f|4567.Krub|s|234567.IBM Plex Sans Thai|s|1234567.Concert One|d|4.Zen Old Mincho|f|45679.Poiret One|d|4.Quattrocento Sans|s|47.Cinzel Decorative|d|479.Andada Pro|f|45678.Libre Bodoni|f|4567.Racing Sans One|d|4.PT Mono|m|4.Lalezar|s|4.Architects Daughter|h|4.Bowlby One SC|d|4.Allura|h|4.Abhaya Libre|f|45678.Cookie|h|4.Italianno|h|4.Homemade Apple|h|4.Patrick Hand|h|4.Google Sans Code|m|345678.Yeseva One|d|4.Yantramanav|s|134579.Cormorant Infant|f|34567.Comic Relief|d|47.Chelsea Market|d|4.Unica One|d|4.Jua|s|4.GFS Didot|f|4.Goldman|d|47.Lustria|f|4.Paytone One|s|4.Gelasio|f|4567.Actor|s|4.Radio Canada Big|s|4567.Pathway Gothic One|s|4.Tektur|d|456789.Arsenal|s|47.Damion|h|4.Nanum Pen Script|h|4.Volkhov|f|47.Parisienne|h|4.Ubuntu Mono|m|47.Commissioner|s|123456789.Sofia Sans Extra Condensed|s|123456789.Host Grotesk|s|345678.Sorts Mill Goudy|f|4.Reenie Beanie|h|4.Hind Guntur|s|34567.PT Sans Caption|s|47.Lusitana|f|47.Petrona|f|123456789.Belleza|s|4.Cutive Mono|m|4.Sarala|s|47.DotGothic16|s|4.Fira Mono|m|457.Berkshire Swash|h|4.Caveat Brush|h|4.Advent Pro|s|123456789.Shippori Mincho B1|f|45678.Atkinson Hyperlegible Next|s|2345678.Istok Web|s|47.Jersey 25|d|4.Pirata One|d|4.Afacad|s|4567.Kosugi Maru|s|4.Saira Semi Condensed|s|123456789.Lemonada|d|34567.Sriracha|h|4.Rock Salt|h|4.Besley|f|456789.Gloria Hallelujah|h|4.M PLUS 1|s|123456789.Reddit Sans|s|23456789.Mrs Saint Delafield|h|4.Rozha One|f|4.Arapey|f|4.Amita|h|47.Alumni Sans|s|123456789.El Messiri|s|4567.Rye|d|4.Averia Serif Libre|d|347.Familjen Grotesk|s|4567.Pixelify Sans|d|4567.Julius Sans One|s|4.M PLUS 2|s|123456789.Tangerine|h|47.Alice|f|4.Blinker|s|12346789.Varela|s|4.Anonymous Pro|m|47.Reem Kufi|s|4567.BIZ UDGothic|s|47.Nothing You Could Do|h|4.Mona Sans|s|23456789.Monda|s|4567.Carlito|s|47.Jura|s|34567.Mukta Malar|s|2345678.Fira Sans Extra Condensed|s|123456789.Zen Kaku Gothic Antique|s|34579.Kaisei Decol|f|457.Eczar|f|45678.Ultra|f|4.Pangolin|h|4.Mitr|s|234567.Taviraj|f|123456789.Squada One|d|4.Italiana|s|4.Baloo Bhai 2|d|45678.Secular One|s|4.Red Hat Mono|m|34567.Monoton|d|4.Handlee|h|4.Mate|f|4.Marck Script|h|4.IBM Plex Sans JP|s|1234567.Vidaloka|f|4.Limelight|d|4.Six Caps|s|4.K2D|s|12345678.Mandali|s|4.Cousine|m|47.Germania One|d|4.Economica|s|47.Boogaloo|d|4".split("."), n = "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif", r = "ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif", i = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace", a = "cursive", o = (e) => /\s/.test(e) ? `'${e}'` : e, s = {
4
4
  sans: n,
@@ -46,64 +46,64 @@ var t = /* @__PURE__ */ "Roboto|s|123456789.Open Sans|s|345678.Inter|s|123456789
46
46
  function h(e) {
47
47
  return e.split(",")[0].trim().replace(/^['"]|['"]$/g, "");
48
48
  }
49
- var g = (e) => /^[A-Za-z0-9][A-Za-z0-9 ]{0,63}$/.test(e) && !m(e), _ = (e) => p(e)?.stack ?? `${o(e)}, ${n}`, v = [
49
+ var g = (e) => /^[A-Za-z0-9][A-Za-z0-9 ]{0,63}$/.test(e) && !m(e), te = (e) => p(e)?.stack ?? `${o(e)}, ${n}`, _ = [
50
50
  400,
51
51
  500,
52
52
  600,
53
53
  700
54
54
  ];
55
- function y(e, t = []) {
55
+ function v(e, t = []) {
56
56
  let n = p(e)?.weights;
57
57
  if (!n) return [];
58
- let r = new Set([...v, ...t].filter((e) => n.includes(e)));
58
+ let r = new Set([..._, ...t].filter((e) => n.includes(e)));
59
59
  return r.size || r.add(n.includes(400) ? 400 : n[0]), [...r].sort((e, t) => e - t);
60
60
  }
61
- var b = (e) => encodeURIComponent(e).replace(/%20/g, "+");
62
- function x(e) {
61
+ var y = (e) => encodeURIComponent(e).replace(/%20/g, "+");
62
+ function b(e) {
63
63
  let t = e.map((e) => typeof e == "string" ? { family: e } : e).filter((e) => g(e.family)), n = [], r = [], i = /* @__PURE__ */ new Set();
64
64
  for (let e of t) {
65
65
  let t = e.family.toLowerCase();
66
66
  if (i.has(t)) continue;
67
67
  i.add(t);
68
68
  let a = p(e.family);
69
- a ? n.push(`family=${b(a.name)}:wght@${y(a.name, e.weights).join(";")}`) : r.push(`https://fonts.googleapis.com/css?family=${b(e.family)}:400,700&display=swap`);
69
+ a ? n.push(`family=${y(a.name)}:wght@${v(a.name, e.weights).join(";")}`) : r.push(`https://fonts.googleapis.com/css?family=${y(e.family)}:400,700&display=swap`);
70
70
  }
71
71
  return [...n.length ? [`https://fonts.googleapis.com/css2?${n.join("&")}&display=swap`] : [], ...r];
72
72
  }
73
- function S(e) {
73
+ function x(e) {
74
74
  let t = p(e);
75
75
  if (!t) return null;
76
76
  let n = encodeURIComponent(`${t.name} AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789$%&!?.,'-`);
77
- return `https://fonts.googleapis.com/css2?family=${b(t.name)}&text=${n}&display=swap`;
77
+ return `https://fonts.googleapis.com/css2?family=${y(t.name)}&text=${n}&display=swap`;
78
78
  }
79
79
  //#endregion
80
80
  //#region src/v2/design/customFonts.ts
81
- var C = 12, w = 12, te = 3e6, ne = ".woff2,.woff,.ttf,.otf,font/woff2,font/woff,font/ttf,font/otf", re = /^[A-Za-z0-9][A-Za-z0-9 ]{0,47}$/, ie = [
81
+ var ne = 12, S = 12, C = 3e6, re = ".woff2,.woff,.ttf,.otf,font/woff2,font/woff,font/ttf,font/otf", ie = /^[A-Za-z0-9][A-Za-z0-9 ]{0,47}$/, ae = [
82
82
  "woff2",
83
83
  "woff",
84
84
  "truetype",
85
85
  "opentype"
86
- ], ae = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|vnd\.ms-fontobject|octet-stream));base64,[A-Za-z0-9+/=]+$/i;
87
- function T(e) {
88
- return typeof e != "string" || /[\s"'\\()<>]/.test(e) ? !1 : e.startsWith("data:") ? e.length <= 56e4 && ae.test(e) : e.length > 2e3 ? !1 : /^https:\/\/[^/?#]+(?:[/?#]|$)/i.test(e) || /^\/(?!\/)/.test(e);
86
+ ], oe = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|vnd\.ms-fontobject|octet-stream));base64,[A-Za-z0-9+/=]+$/i;
87
+ function w(e) {
88
+ return typeof e != "string" || /[\s"'\\()<>]/.test(e) ? !1 : e.startsWith("data:") ? e.length <= 56e4 && oe.test(e) : e.length > 2e3 ? !1 : /^https:\/\/[^/?#]+(?:[/?#]|$)/i.test(e) || /^\/(?!\/)/.test(e);
89
89
  }
90
- var oe = (e) => {
90
+ var se = (e) => {
91
91
  let t = typeof e == "string" ? Number(e) : e;
92
92
  return typeof t == "number" && Number.isInteger(t) && t >= 100 && t <= 900 && t % 100 == 0 ? t : null;
93
93
  };
94
- function E(e) {
94
+ function T(e) {
95
95
  if (!Array.isArray(e)) return [];
96
96
  let t = [];
97
97
  for (let n of e) {
98
98
  if (t.length >= 12) break;
99
99
  if (!n || typeof n != "object") continue;
100
100
  let e = typeof n.family == "string" ? n.family.trim().replace(/\s+/g, " ") : "";
101
- if (!re.test(e) || m(e)) continue;
101
+ if (!ie.test(e) || m(e)) continue;
102
102
  let r = Array.isArray(n.variants) ? n.variants : [], i = [];
103
103
  for (let e of r) {
104
104
  if (i.length >= 12 || !e || typeof e != "object") continue;
105
- let t = oe(e.weight), n = e.style === "italic" ? "italic" : "normal";
106
- if (t === null || !T(e.url) || !ie.includes(e.format)) continue;
105
+ let t = se(e.weight), n = e.style === "italic" ? "italic" : "normal";
106
+ if (t === null || !w(e.url) || !ae.includes(e.format)) continue;
107
107
  let r = i.findIndex((e) => e.weight === t && e.style === n), a = {
108
108
  weight: t,
109
109
  style: n,
@@ -116,7 +116,7 @@ function E(e) {
116
116
  let a = t.findIndex((t) => t.family.toLowerCase() === e.toLowerCase());
117
117
  a >= 0 ? t[a] = {
118
118
  family: t[a].family,
119
- variants: D(t[a].variants, i)
119
+ variants: E(t[a].variants, i)
120
120
  } : t.push({
121
121
  family: e,
122
122
  variants: i.sort((e, t) => e.weight - t.weight || e.style.localeCompare(t.style))
@@ -124,7 +124,7 @@ function E(e) {
124
124
  }
125
125
  return t;
126
126
  }
127
- function D(e, t) {
127
+ function E(e, t) {
128
128
  let n = [...e];
129
129
  for (let e of t) {
130
130
  let t = n.findIndex((t) => t.weight === e.weight && t.style === e.style);
@@ -132,9 +132,9 @@ function D(e, t) {
132
132
  }
133
133
  return n.slice(0, 12).sort((e, t) => e.weight - t.weight || e.style.localeCompare(t.style));
134
134
  }
135
- var O = (e) => e?.fonts ?? [], k = (e, t) => e?.find((e) => e.family.toLowerCase() === t.trim().toLowerCase());
136
- function A(e, t, n) {
137
- let r = E([...e.fonts ?? [], {
135
+ var D = (e) => e?.fonts ?? [], O = (e, t) => e?.find((e) => e.family.toLowerCase() === t.trim().toLowerCase());
136
+ function k(e, t, n) {
137
+ let r = T([...e.fonts ?? [], {
138
138
  family: t,
139
139
  variants: [n]
140
140
  }]);
@@ -143,7 +143,7 @@ function A(e, t, n) {
143
143
  fonts: r
144
144
  };
145
145
  }
146
- function j(e, t) {
146
+ function A(e, t) {
147
147
  let n = (e.fonts ?? []).filter((e) => e.family.toLowerCase() !== t.toLowerCase());
148
148
  if (n.length === (e.fonts ?? []).length) return e;
149
149
  let { fonts: r, ...i } = e;
@@ -152,12 +152,12 @@ function j(e, t) {
152
152
  fonts: n
153
153
  } : i;
154
154
  }
155
- function M(e, t) {
155
+ function j(e, t) {
156
156
  let n = [];
157
- for (let r of E(e)) if (!(t && !t.has(r.family.toLowerCase()))) for (let e of r.variants) n.push(`@font-face{font-family:"${r.family}";font-style:${e.style};font-weight:${e.weight};font-display:swap;src:url("${e.url}") format("${e.format}")}`);
157
+ for (let r of T(e)) if (!(t && !t.has(r.family.toLowerCase()))) for (let e of r.variants) n.push(`@font-face{font-family:"${r.family}";font-style:${e.style};font-weight:${e.weight};font-display:swap;src:url("${e.url}") format("${e.format}")}`);
158
158
  return n.join("\n");
159
159
  }
160
- var N = [
160
+ var M = [
161
161
  [/extra[\s_-]?light|ultra[\s_-]?light|\bxlight\b/i, 200],
162
162
  [/\bthin\b|hairline/i, 100],
163
163
  [/semi[\s_-]?bold|demi[\s_-]?bold/i, 600],
@@ -168,14 +168,14 @@ var N = [
168
168
  [/\blight\b/i, 300],
169
169
  [/\bregular\b|\bnormal\b|\bbook\b/i, 400]
170
170
  ];
171
- function P(e, t = "") {
171
+ function N(e, t = "") {
172
172
  let n = /\.([A-Za-z0-9]+)$/.exec(e)?.[1]?.toLowerCase() ?? "", r = n === "woff2" || /woff2/.test(t) ? "woff2" : n === "woff" || /woff/.test(t) ? "woff" : n === "ttf" || /ttf|truetype/.test(t) ? "truetype" : n === "otf" || /otf|opentype/.test(t) ? "opentype" : null, i = e.replace(/\.[A-Za-z0-9]+$/, "").replace(/[_]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/-/g, " "), a = ` ${i} `, o = /italic|oblique/i.test(a) ? "italic" : "normal", s = 400;
173
- for (let [e, t] of N) if (e.test(a)) {
173
+ for (let [e, t] of M) if (e.test(a)) {
174
174
  s = t;
175
175
  break;
176
176
  }
177
177
  let c = i.replace(/italic|oblique/gi, " ");
178
- for (let [e] of N) c = c.replace(new RegExp(e.source, "gi"), " ");
178
+ for (let [e] of M) c = c.replace(new RegExp(e.source, "gi"), " ");
179
179
  return c = c.replace(/[^A-Za-z0-9 ]+/g, " ").replace(/\s+/g, " ").trim().slice(0, 48), {
180
180
  family: c,
181
181
  weight: s,
@@ -183,7 +183,7 @@ function P(e, t = "") {
183
183
  format: r
184
184
  };
185
185
  }
186
- var F = {
186
+ var P = {
187
187
  100: "Thin",
188
188
  200: "Extra light",
189
189
  300: "Light",
@@ -196,27 +196,27 @@ var F = {
196
196
  };
197
197
  //#endregion
198
198
  //#region src/v2/design/tokens.ts
199
- function I(e) {
199
+ function F(e) {
200
200
  let t = String(e.value), n = e.unit && e.unit !== "null" ? e.unit : "";
201
201
  return !n || t.endsWith(n) || t.includes("var(") || t.includes("calc(") ? t : `${t}${n}`;
202
202
  }
203
- var L = (e) => `var(${e})`;
204
- function R(e) {
203
+ var I = (e) => `var(${e})`;
204
+ function L(e) {
205
205
  let t = /^\s*var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,.*)?\)\s*$/.exec(e);
206
206
  return t ? t[1] : null;
207
207
  }
208
- function z(e) {
208
+ function R(e) {
209
209
  return new Map(e.tokens.map((e) => [e.key, e]));
210
210
  }
211
- function B(e, t) {
211
+ function z(e, t) {
212
212
  return e.tokens.find((e) => e.key === t);
213
213
  }
214
- function V(e, t) {
215
- return B(e, t)?.value;
214
+ function B(e, t) {
215
+ return z(e, t)?.value;
216
216
  }
217
- var H = (e) => /^#[0-9a-f]{3,8}$/i.test(e) || /^(rgb|hsl)a?\(/i.test(e) ? "color" : /^-?\d*\.?\d+(px|rem|em|%)$/.test(e) ? "dimension" : /^-?\d*\.?\d+$/.test(e) ? "number" : "string", U = (e) => e.replace(/^--/, "").split("-").filter(Boolean).map((e) => e[0].toUpperCase() + e.slice(1)).join(" ");
218
- function W(e, t, n, r = {}) {
219
- let i = B(e, t);
217
+ var V = (e) => /^#[0-9a-f]{3,8}$/i.test(e) || /^(rgb|hsl)a?\(/i.test(e) ? "color" : /^-?\d*\.?\d+(px|rem|em|%)$/.test(e) ? "dimension" : /^-?\d*\.?\d+$/.test(e) ? "number" : "string", H = (e) => e.replace(/^--/, "").split("-").filter(Boolean).map((e) => e[0].toUpperCase() + e.slice(1)).join(" ");
218
+ function U(e, t, n, r = {}) {
219
+ let i = z(e, t);
220
220
  if (i) return i.value === n && (r.unit === void 0 || r.unit === i.unit) ? e : {
221
221
  ...e,
222
222
  tokens: e.tokens.map((e) => e.key === t ? {
@@ -227,9 +227,9 @@ function W(e, t, n, r = {}) {
227
227
  };
228
228
  let a = r.layer ?? "brand", o = {
229
229
  key: t,
230
- name: r.name ?? U(t),
230
+ name: r.name ?? H(t),
231
231
  value: n,
232
- type: r.type ?? H(n),
232
+ type: r.type ?? V(n),
233
233
  unit: r.unit ?? null,
234
234
  layer: a,
235
235
  comment: r.comment ?? null
@@ -239,42 +239,42 @@ function W(e, t, n, r = {}) {
239
239
  tokens: [...e.tokens, o]
240
240
  };
241
241
  }
242
- function G(e, t) {
242
+ function W(e, t) {
243
243
  let n = e;
244
- for (let [e, r] of Object.entries(t)) n = W(n, e, r);
244
+ for (let [e, r] of Object.entries(t)) n = U(n, e, r);
245
245
  return n;
246
246
  }
247
- function K(e, t) {
247
+ function G(e, t) {
248
248
  return e.tokens.some((e) => e.key === t) ? {
249
249
  ...e,
250
250
  tokens: e.tokens.filter((e) => e.key !== t)
251
251
  } : e;
252
252
  }
253
- function q(e, t, n = 0) {
254
- let r = e instanceof Map ? e : z(e), i = R(t);
253
+ function K(e, t, n = 0) {
254
+ let r = e instanceof Map ? e : R(e), i = L(t);
255
255
  if (!i || n > 12) return t;
256
256
  let a = r.get(i);
257
257
  if (!a) {
258
258
  let e = /^\s*var\(\s*--[A-Za-z0-9_-]+\s*,\s*(.*)\)\s*$/.exec(t)?.[1];
259
- return e ? q(r, e.trim(), n + 1) : t;
259
+ return e ? K(r, e.trim(), n + 1) : t;
260
260
  }
261
- return q(r, I(a), n + 1);
261
+ return K(r, F(a), n + 1);
262
262
  }
263
- function se(e, t) {
264
- let n = B(e, t);
265
- return n ? q(e, I(n)) : void 0;
263
+ function ce(e, t) {
264
+ let n = z(e, t);
265
+ return n ? K(e, F(n)) : void 0;
266
266
  }
267
267
  //#endregion
268
268
  //#region src/v2/design/lint.ts
269
- var J = { "--color-border-muted": "--color-border-subtle" }, ce = /var\(\s*(--[A-Za-z0-9_-]+)/g, Y = (e) => [...e.matchAll(ce)].map((e) => e[1]);
270
- function* X(e) {
269
+ var q = { "--color-border-muted": "--color-border-subtle" }, le = /var\(\s*(--[A-Za-z0-9_-]+)/g, J = (e) => [...e.matchAll(le)].map((e) => e[1]);
270
+ function* Y(e) {
271
271
  for (let t of e ?? []) {
272
272
  for (let e of Object.values(t.properties ?? {})) yield String(e.value);
273
273
  for (let e of Object.values(t.variants ?? {})) for (let t of Object.values(e.properties ?? {})) yield String(t.value);
274
- yield* X(t.children);
274
+ yield* Y(t.children);
275
275
  }
276
276
  }
277
- function le(t) {
277
+ function ue(t) {
278
278
  let n = [], r = /* @__PURE__ */ new Map();
279
279
  for (let e of t.tokens) r.set(e.key, (r.get(e.key) ?? 0) + 1);
280
280
  for (let i of t.tokens) {
@@ -289,7 +289,7 @@ function le(t) {
289
289
  message: `${i.key} is defined more than once; only one value can win.`,
290
290
  fixable: !0
291
291
  });
292
- let a = String(i.value), o = Y(a);
292
+ let a = String(i.value), o = J(a);
293
293
  o.length && i.unit && i.unit !== "null" && n.push({
294
294
  kind: "unit-on-reference",
295
295
  key: i.key,
@@ -319,7 +319,7 @@ function le(t) {
319
319
  let t = /* @__PURE__ */ new Set(), r = e.key;
320
320
  for (; r && !t.has(r);) {
321
321
  t.add(r);
322
- let e = R(String(i.get(r)?.value ?? ""));
322
+ let e = L(String(i.get(r)?.value ?? ""));
323
323
  r = e && i.has(e) ? e : void 0;
324
324
  }
325
325
  r && !a.has(r) && (a.add(r), n.push({
@@ -330,29 +330,29 @@ function le(t) {
330
330
  }));
331
331
  }
332
332
  let o = /* @__PURE__ */ new Set();
333
- for (let e of t.components) for (let t of X(e.nodes)) for (let i of Y(t)) !r.has(i) && !o.has(`${e.name}:${i}`) && (o.add(`${e.name}:${i}`), n.push({
333
+ for (let e of t.components) for (let t of Y(e.nodes)) for (let i of J(t)) !r.has(i) && !o.has(`${e.name}:${i}`) && (o.add(`${e.name}:${i}`), n.push({
334
334
  kind: "dangling-reference",
335
335
  key: e.name,
336
336
  message: `The ${e.name} component uses ${i}, which doesn't exist.`,
337
- fixable: i in J
337
+ fixable: i in q
338
338
  }));
339
339
  return n;
340
340
  }
341
- function Z(e, t, n = 0) {
341
+ function X(e, t, n = 0) {
342
342
  return n > 12 ? e : e.replace(/var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,[^)]*)?\)/g, (e, r) => {
343
343
  let i = t.get(r);
344
344
  if (!i) return e;
345
345
  let a = i.unit && i.unit !== "null" ? i.unit : "", o = String(i.value);
346
- return Z(!a || o.endsWith(a) || o.includes("var(") || o.includes("calc(") ? o : `${o}${a}`, t, n + 1);
346
+ return X(!a || o.endsWith(a) || o.includes("var(") || o.includes("calc(") ? o : `${o}${a}`, t, n + 1);
347
347
  });
348
348
  }
349
- var Q = (e) => e.replace(/var\(\s*(--[A-Za-z0-9_-]+)/g, (e, t) => J[t] ? e.replace(t, J[t]) : e);
350
- function $(e) {
349
+ var Z = (e) => e.replace(/var\(\s*(--[A-Za-z0-9_-]+)/g, (e, t) => q[t] ? e.replace(t, q[t]) : e);
350
+ function Q(e) {
351
351
  let t = !1, n = (e) => {
352
352
  if (!e) return e;
353
353
  let n = {};
354
354
  for (let [r, i] of Object.entries(e)) {
355
- let e = Q(String(i.value));
355
+ let e = Z(String(i.value));
356
356
  e !== i.value && (t = !0), n[r] = e === i.value ? i : {
357
357
  ...i,
358
358
  value: e
@@ -363,7 +363,7 @@ function $(e) {
363
363
  if (!e) return e;
364
364
  let n = {};
365
365
  for (let [r, i] of Object.entries(e)) {
366
- let e = Q(String(i));
366
+ let e = Z(String(i));
367
367
  e !== i && (t = !0), n[r] = e;
368
368
  }
369
369
  return n;
@@ -379,15 +379,30 @@ function $(e) {
379
379
  changed: t
380
380
  };
381
381
  }
382
- function ue(e) {
383
- let t = !1, n = /* @__PURE__ */ new Set(), r = e.tokens.filter((e) => n.has(e.key) ? (t = !0, !1) : (n.add(e.key), !0)).map((e) => Y(String(e.value)).length && e.unit && e.unit !== "null" ? (t = !0, {
382
+ var de = /^-?\d*\.?\d+(px|rem|em|%|vh|vw)$|^#[0-9a-f]{3,8}$/i, $ = (e) => {
383
+ let t = String(e).trim().toLowerCase().replace(/\s+/g, ""), n = /^(-?\d*\.?\d+)rem$/.exec(t);
384
+ return n ? `${parseFloat(n[1]) * 16}px` : t;
385
+ };
386
+ function fe(e, t) {
387
+ if (!e) return e;
388
+ let n;
389
+ for (let [r, i] of Object.entries(e)) {
390
+ if (typeof i != "string" || !de.test(i.trim())) continue;
391
+ n ??= { ...e };
392
+ let a = t.find((e) => e.layer === "semantic" && $(`${e.value}${e.unit && e.unit !== "null" && !String(e.value).endsWith(e.unit) ? e.unit : ""}`) === $(i));
393
+ a ? n[r] = `var(${a.key})` : delete n[r];
394
+ }
395
+ return n ?? e;
396
+ }
397
+ function pe(e) {
398
+ let t = !1, n = /* @__PURE__ */ new Set(), r = e.tokens.filter((e) => n.has(e.key) ? (t = !0, !1) : (n.add(e.key), !0)).map((e) => J(String(e.value)).length && e.unit && e.unit !== "null" ? (t = !0, {
384
399
  ...e,
385
400
  unit: null
386
401
  }) : e), i = new Map(r.map((e) => [e.key, e]));
387
402
  r = r.map((e) => {
388
- if (e.layer === "brand" && Y(String(e.value)).length) {
389
- let n = Z(String(e.value), i);
390
- if (n !== e.value && !Y(n).length) return t = !0, {
403
+ if (e.layer === "brand" && J(String(e.value)).length) {
404
+ let n = X(String(e.value), i);
405
+ if (n !== e.value && !J(n).length) return t = !0, {
391
406
  ...e,
392
407
  value: n
393
408
  };
@@ -395,7 +410,7 @@ function ue(e) {
395
410
  return e;
396
411
  });
397
412
  let a = new Set(r.map((e) => e.key)), o = r.find((e) => e.key === "--font-family-sans");
398
- for (let e of [...r]) for (let n of Y(String(e.value))) a.has(n) || (n === "--font-family-heading" || n === "--font-family-body") && o && (a.add(n), t = !0, r = [...r, {
413
+ for (let e of [...r]) for (let n of J(String(e.value))) a.has(n) || (n === "--font-family-heading" || n === "--font-family-body") && o && (a.add(n), t = !0, r = [...r, {
399
414
  key: n,
400
415
  name: n === "--font-family-heading" ? "Font Family Heading" : "Font Family Body",
401
416
  value: o.value,
@@ -405,16 +420,17 @@ function ue(e) {
405
420
  comment: n === "--font-family-heading" ? "Heading font" : "Body font"
406
421
  }]);
407
422
  let s = e.components, c = e.components.map((e) => {
408
- let t = $(e.nodes);
409
- return t.changed ? {
423
+ let t = Q(e.nodes), n = fe(e.props, r);
424
+ return !t.changed && n === e.props ? e : {
410
425
  ...e,
411
- nodes: t.nodes ?? e.nodes
412
- } : e;
426
+ nodes: t.changed ? t.nodes ?? e.nodes : e.nodes,
427
+ ...n ? { props: n } : {}
428
+ };
413
429
  });
414
430
  c.some((t, n) => t !== e.components[n]) && (s = c, t = !0);
415
431
  let l = e.fonts;
416
432
  if (l !== void 0) {
417
- let e = E(l);
433
+ let e = T(l);
418
434
  JSON.stringify(e) !== JSON.stringify(l) && (l = e, t = !0);
419
435
  }
420
436
  if (!t) return e;
@@ -426,4 +442,4 @@ function ue(e) {
426
442
  return l?.length ? u.fonts = l : delete u.fonts, u;
427
443
  }
428
444
  //#endregion
429
- export { p as A, k as C, E as D, j as E, h as F, _ as I, y as L, x as M, g as N, d as O, m as P, O as S, T, te as _, U as a, A as b, K as c, W as d, G as f, C as g, ne as h, V as i, S as j, l as k, se as l, z as m, ue as n, L as o, I as p, B as r, R as s, le as t, q as u, w as v, P as w, M as x, F as y };
445
+ export { p as A, O as C, T as D, A as E, h as F, te as I, v as L, b as M, g as N, d as O, m as P, D as S, w as T, C as _, H as a, k as b, G as c, U as d, W as f, ne as g, re as h, B as i, x as j, l as k, ce as l, R as m, pe as n, I as o, F as p, z as r, L as s, ue as t, K as u, S as v, N as w, j as x, P as y };