@still-forest/canopy 0.11.0 → 0.11.1

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/index.js CHANGED
@@ -364,15 +364,44 @@ function fn() {
364
364
  for (var e, t, r = 0, n = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (t = dn(e)) && (n && (n += " "), n += t);
365
365
  return n;
366
366
  }
367
- const or = "-", ns = (e) => {
368
- const t = ss(e), {
367
+ const Tr = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Mr = fn, ns = (e, t) => (r) => {
368
+ var n;
369
+ if ((t == null ? void 0 : t.variants) == null) return Mr(e, r == null ? void 0 : r.class, r == null ? void 0 : r.className);
370
+ const { variants: o, defaultVariants: s } = t, i = Object.keys(o).map((l) => {
371
+ const d = r == null ? void 0 : r[l], f = s == null ? void 0 : s[l];
372
+ if (d === null) return null;
373
+ const m = Tr(d) || Tr(f);
374
+ return o[l][m];
375
+ }), a = r && Object.entries(r).reduce((l, d) => {
376
+ let [f, m] = d;
377
+ return m === void 0 || (l[f] = m), l;
378
+ }, {}), c = t == null || (n = t.compoundVariants) === null || n === void 0 ? void 0 : n.reduce((l, d) => {
379
+ let { class: f, className: m, ...g } = d;
380
+ return Object.entries(g).every((b) => {
381
+ let [p, h] = b;
382
+ return Array.isArray(h) ? h.includes({
383
+ ...s,
384
+ ...a
385
+ }[p]) : {
386
+ ...s,
387
+ ...a
388
+ }[p] === h;
389
+ }) ? [
390
+ ...l,
391
+ f,
392
+ m
393
+ ] : l;
394
+ }, []);
395
+ return Mr(e, i, c, r == null ? void 0 : r.class, r == null ? void 0 : r.className);
396
+ }, or = "-", os = (e) => {
397
+ const t = is(e), {
369
398
  conflictingClassGroups: r,
370
399
  conflictingClassGroupModifiers: n
371
400
  } = e;
372
401
  return {
373
402
  getClassGroupId: (i) => {
374
403
  const a = i.split(or);
375
- return a[0] === "" && a.length !== 1 && a.shift(), mn(a, t) || os(i);
404
+ return a[0] === "" && a.length !== 1 && a.shift(), mn(a, t) || ss(i);
376
405
  },
377
406
  getConflictingClassGroupIds: (i, a) => {
378
407
  const c = r[i] || [];
@@ -392,13 +421,13 @@ const or = "-", ns = (e) => {
392
421
  return (i = t.validators.find(({
393
422
  validator: a
394
423
  }) => a(s))) == null ? void 0 : i.classGroupId;
395
- }, Tr = /^\[(.+)\]$/, os = (e) => {
396
- if (Tr.test(e)) {
397
- const t = Tr.exec(e)[1], r = t == null ? void 0 : t.substring(0, t.indexOf(":"));
424
+ }, _r = /^\[(.+)\]$/, ss = (e) => {
425
+ if (_r.test(e)) {
426
+ const t = _r.exec(e)[1], r = t == null ? void 0 : t.substring(0, t.indexOf(":"));
398
427
  if (r)
399
428
  return "arbitrary.." + r;
400
429
  }
401
- }, ss = (e) => {
430
+ }, is = (e) => {
402
431
  const {
403
432
  theme: t,
404
433
  classGroups: r
@@ -412,12 +441,12 @@ const or = "-", ns = (e) => {
412
441
  }, qt = (e, t, r, n) => {
413
442
  e.forEach((o) => {
414
443
  if (typeof o == "string") {
415
- const s = o === "" ? t : Mr(t, o);
444
+ const s = o === "" ? t : jr(t, o);
416
445
  s.classGroupId = r;
417
446
  return;
418
447
  }
419
448
  if (typeof o == "function") {
420
- if (is(o)) {
449
+ if (as(o)) {
421
450
  qt(o(n), t, r, n);
422
451
  return;
423
452
  }
@@ -428,10 +457,10 @@ const or = "-", ns = (e) => {
428
457
  return;
429
458
  }
430
459
  Object.entries(o).forEach(([s, i]) => {
431
- qt(i, Mr(t, s), r, n);
460
+ qt(i, jr(t, s), r, n);
432
461
  });
433
462
  });
434
- }, Mr = (e, t) => {
463
+ }, jr = (e, t) => {
435
464
  let r = e;
436
465
  return t.split(or).forEach((n) => {
437
466
  r.nextPart.has(n) || r.nextPart.set(n, {
@@ -439,7 +468,7 @@ const or = "-", ns = (e) => {
439
468
  validators: []
440
469
  }), r = r.nextPart.get(n);
441
470
  }), r;
442
- }, is = (e) => e.isThemeGetter, as = (e) => {
471
+ }, as = (e) => e.isThemeGetter, ls = (e) => {
443
472
  if (e < 1)
444
473
  return {
445
474
  get: () => {
@@ -463,7 +492,7 @@ const or = "-", ns = (e) => {
463
492
  r.has(s) ? r.set(s, i) : o(s, i);
464
493
  }
465
494
  };
466
- }, Zt = "!", Jt = ":", ls = Jt.length, cs = (e) => {
495
+ }, Zt = "!", Jt = ":", cs = Jt.length, us = (e) => {
467
496
  const {
468
497
  prefix: t,
469
498
  experimentalParseClassName: r
@@ -475,7 +504,7 @@ const or = "-", ns = (e) => {
475
504
  let p = o[b];
476
505
  if (i === 0 && a === 0) {
477
506
  if (p === Jt) {
478
- s.push(o.slice(c, b)), c = b + ls;
507
+ s.push(o.slice(c, b)), c = b + cs;
479
508
  continue;
480
509
  }
481
510
  if (p === "/") {
@@ -485,7 +514,7 @@ const or = "-", ns = (e) => {
485
514
  }
486
515
  p === "[" ? i++ : p === "]" ? i-- : p === "(" ? a++ : p === ")" && a--;
487
516
  }
488
- const d = s.length === 0 ? o : o.substring(c), f = us(d), m = f !== d, g = l && l > c ? l - c : void 0;
517
+ const d = s.length === 0 ? o : o.substring(c), f = ds(d), m = f !== d, g = l && l > c ? l - c : void 0;
489
518
  return {
490
519
  modifiers: s,
491
520
  hasImportantModifier: m,
@@ -511,7 +540,7 @@ const or = "-", ns = (e) => {
511
540
  });
512
541
  }
513
542
  return n;
514
- }, us = (e) => e.endsWith(Zt) ? e.substring(0, e.length - 1) : e.startsWith(Zt) ? e.substring(1) : e, ds = (e) => {
543
+ }, ds = (e) => e.endsWith(Zt) ? e.substring(0, e.length - 1) : e.startsWith(Zt) ? e.substring(1) : e, fs = (e) => {
515
544
  const t = Object.fromEntries(e.orderSensitiveModifiers.map((n) => [n, !0]));
516
545
  return (n) => {
517
546
  if (n.length <= 1)
@@ -522,18 +551,18 @@ const or = "-", ns = (e) => {
522
551
  i[0] === "[" || t[i] ? (o.push(...s.sort(), i), s = []) : s.push(i);
523
552
  }), o.push(...s.sort()), o;
524
553
  };
525
- }, fs = (e) => ({
526
- cache: as(e.cacheSize),
527
- parseClassName: cs(e),
528
- sortModifiers: ds(e),
529
- ...ns(e)
530
- }), ms = /\s+/, ps = (e, t) => {
554
+ }, ms = (e) => ({
555
+ cache: ls(e.cacheSize),
556
+ parseClassName: us(e),
557
+ sortModifiers: fs(e),
558
+ ...os(e)
559
+ }), ps = /\s+/, gs = (e, t) => {
531
560
  const {
532
561
  parseClassName: r,
533
562
  getClassGroupId: n,
534
563
  getConflictingClassGroupIds: o,
535
564
  sortModifiers: s
536
- } = t, i = [], a = e.trim().split(ms);
565
+ } = t, i = [], a = e.trim().split(ps);
537
566
  let c = "";
538
567
  for (let l = a.length - 1; l >= 0; l -= 1) {
539
568
  const d = a[l], {
@@ -572,7 +601,7 @@ const or = "-", ns = (e) => {
572
601
  }
573
602
  return c;
574
603
  };
575
- function gs() {
604
+ function hs() {
576
605
  let e = 0, t, r, n = "";
577
606
  for (; e < arguments.length; )
578
607
  (t = arguments[e++]) && (r = pn(t)) && (n && (n += " "), n += r);
@@ -586,38 +615,38 @@ const pn = (e) => {
586
615
  e[n] && (t = pn(e[n])) && (r && (r += " "), r += t);
587
616
  return r;
588
617
  };
589
- function hs(e, ...t) {
618
+ function vs(e, ...t) {
590
619
  let r, n, o, s = i;
591
620
  function i(c) {
592
621
  const l = t.reduce((d, f) => f(d), e());
593
- return r = fs(l), n = r.cache.get, o = r.cache.set, s = a, a(c);
622
+ return r = ms(l), n = r.cache.get, o = r.cache.set, s = a, a(c);
594
623
  }
595
624
  function a(c) {
596
625
  const l = n(c);
597
626
  if (l)
598
627
  return l;
599
- const d = ps(c, r);
628
+ const d = gs(c, r);
600
629
  return o(c, d), d;
601
630
  }
602
631
  return function() {
603
- return s(gs.apply(null, arguments));
632
+ return s(hs.apply(null, arguments));
604
633
  };
605
634
  }
606
635
  const Q = (e) => {
607
636
  const t = (r) => r[e] || [];
608
637
  return t.isThemeGetter = !0, t;
609
- }, gn = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, hn = /^\((?:(\w[\w-]*):)?(.+)\)$/i, vs = /^\d+\/\d+$/, xs = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, bs = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, ys = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, ws = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Es = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, Ne = (e) => vs.test(e), L = (e) => !!e && !Number.isNaN(Number(e)), xe = (e) => !!e && Number.isInteger(Number(e)), _t = (e) => e.endsWith("%") && L(e.slice(0, -1)), me = (e) => xs.test(e), ks = () => !0, Cs = (e) => (
638
+ }, gn = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, hn = /^\((?:(\w[\w-]*):)?(.+)\)$/i, xs = /^\d+\/\d+$/, bs = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, ys = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, ws = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, Es = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, ks = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, Ne = (e) => xs.test(e), L = (e) => !!e && !Number.isNaN(Number(e)), xe = (e) => !!e && Number.isInteger(Number(e)), _t = (e) => e.endsWith("%") && L(e.slice(0, -1)), me = (e) => bs.test(e), Cs = () => !0, Rs = (e) => (
610
639
  // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
611
640
  // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
612
641
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
613
- bs.test(e) && !ys.test(e)
614
- ), vn = () => !1, Rs = (e) => ws.test(e), Ss = (e) => Es.test(e), As = (e) => !M(e) && !_(e), Ps = (e) => Ve(e, yn, vn), M = (e) => gn.test(e), Se = (e) => Ve(e, wn, Cs), jt = (e) => Ve(e, _s, L), _r = (e) => Ve(e, xn, vn), Os = (e) => Ve(e, bn, Ss), ct = (e) => Ve(e, En, Rs), _ = (e) => hn.test(e), Xe = (e) => Ue(e, wn), Ns = (e) => Ue(e, js), jr = (e) => Ue(e, xn), Ts = (e) => Ue(e, yn), Ms = (e) => Ue(e, bn), ut = (e) => Ue(e, En, !0), Ve = (e, t, r) => {
642
+ ys.test(e) && !ws.test(e)
643
+ ), vn = () => !1, Ss = (e) => Es.test(e), As = (e) => ks.test(e), Ps = (e) => !M(e) && !_(e), Os = (e) => Ve(e, yn, vn), M = (e) => gn.test(e), Se = (e) => Ve(e, wn, Rs), jt = (e) => Ve(e, js, L), Dr = (e) => Ve(e, xn, vn), Ns = (e) => Ve(e, bn, As), ct = (e) => Ve(e, En, Ss), _ = (e) => hn.test(e), Xe = (e) => Ue(e, wn), Ts = (e) => Ue(e, Ds), Ir = (e) => Ue(e, xn), Ms = (e) => Ue(e, yn), _s = (e) => Ue(e, bn), ut = (e) => Ue(e, En, !0), Ve = (e, t, r) => {
615
644
  const n = gn.exec(e);
616
645
  return n ? n[1] ? t(n[1]) : r(n[2]) : !1;
617
646
  }, Ue = (e, t, r = !1) => {
618
647
  const n = hn.exec(e);
619
648
  return n ? n[1] ? t(n[1]) : r : !1;
620
- }, xn = (e) => e === "position" || e === "percentage", bn = (e) => e === "image" || e === "url", yn = (e) => e === "length" || e === "size" || e === "bg-size", wn = (e) => e === "length", _s = (e) => e === "number", js = (e) => e === "family-name", En = (e) => e === "shadow", Ds = () => {
649
+ }, xn = (e) => e === "position" || e === "percentage", bn = (e) => e === "image" || e === "url", yn = (e) => e === "length" || e === "size" || e === "bg-size", wn = (e) => e === "length", js = (e) => e === "number", Ds = (e) => e === "family-name", En = (e) => e === "shadow", Is = () => {
621
650
  const e = Q("color"), t = Q("font"), r = Q("text"), n = Q("font-weight"), o = Q("tracking"), s = Q("leading"), i = Q("breakpoint"), a = Q("container"), c = Q("spacing"), l = Q("radius"), d = Q("shadow"), f = Q("inset-shadow"), m = Q("text-shadow"), g = Q("drop-shadow"), b = Q("blur"), p = Q("perspective"), h = Q("aspect"), w = Q("ease"), O = Q("animate"), P = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], S = () => [
622
651
  "center",
623
652
  "top",
@@ -638,11 +667,11 @@ const Q = (e) => {
638
667
  "left-bottom"
639
668
  ], C = () => [...S(), _, M], N = () => ["auto", "hidden", "clip", "visible", "scroll"], A = () => ["auto", "contain", "none"], k = () => [_, M, c], W = () => [Ne, "full", "auto", ...k()], U = () => [xe, "none", "subgrid", _, M], J = () => ["auto", {
640
669
  span: ["full", xe, _, M]
641
- }, xe, _, M], K = () => [xe, "auto", _, M], q = () => ["auto", "min", "max", "fr", _, M], G = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], B = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], z = () => ["auto", ...k()], V = () => [Ne, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...k()], E = () => [e, _, M], Z = () => [...S(), jr, _r, {
670
+ }, xe, _, M], K = () => [xe, "auto", _, M], q = () => ["auto", "min", "max", "fr", _, M], G = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], B = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], z = () => ["auto", ...k()], V = () => [Ne, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...k()], E = () => [e, _, M], Z = () => [...S(), Ir, Dr, {
642
671
  position: [_, M]
643
672
  }], y = () => ["no-repeat", {
644
673
  repeat: ["", "x", "y", "space", "round"]
645
- }], D = () => ["auto", "cover", "contain", Ts, Ps, {
674
+ }], D = () => ["auto", "cover", "contain", Ms, Os, {
646
675
  size: [_, M]
647
676
  }], v = () => [_t, Xe, Se], R = () => [
648
677
  // Deprecated since Tailwind CSS v4.0.0
@@ -652,7 +681,7 @@ const Q = (e) => {
652
681
  l,
653
682
  _,
654
683
  M
655
- ], j = () => ["", L, Xe, Se], T = () => ["solid", "dashed", "dotted", "double"], F = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], I = () => [L, _t, jr, _r], $ = () => [
684
+ ], j = () => ["", L, Xe, Se], T = () => ["solid", "dashed", "dotted", "double"], F = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], I = () => [L, _t, Ir, Dr], $ = () => [
656
685
  // Deprecated since Tailwind CSS v4.0.0
657
686
  "",
658
687
  "none",
@@ -667,11 +696,11 @@ const Q = (e) => {
667
696
  aspect: ["video"],
668
697
  blur: [me],
669
698
  breakpoint: [me],
670
- color: [ks],
699
+ color: [Cs],
671
700
  container: [me],
672
701
  "drop-shadow": [me],
673
702
  ease: ["in", "out", "in-out"],
674
- font: [As],
703
+ font: [Ps],
675
704
  "font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
676
705
  "inset-shadow": [me],
677
706
  leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
@@ -1383,7 +1412,7 @@ const Q = (e) => {
1383
1412
  * @see https://tailwindcss.com/docs/font-family
1384
1413
  */
1385
1414
  "font-family": [{
1386
- font: [Ns, M, t]
1415
+ font: [Ts, M, t]
1387
1416
  }],
1388
1417
  /**
1389
1418
  * Font Variant Numeric
@@ -1638,7 +1667,7 @@ const Q = (e) => {
1638
1667
  }, xe, _, M],
1639
1668
  radial: ["", _, M],
1640
1669
  conic: [xe, _, M]
1641
- }, Ms, Os]
1670
+ }, _s, Ns]
1642
1671
  }],
1643
1672
  /**
1644
1673
  * Background Color
@@ -3087,40 +3116,11 @@ const Q = (e) => {
3087
3116
  },
3088
3117
  orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
3089
3118
  };
3090
- }, Is = /* @__PURE__ */ hs(Ds);
3119
+ }, Ls = /* @__PURE__ */ vs(Is);
3091
3120
  function X(...e) {
3092
- return Is(fn(e));
3121
+ return Ls(fn(e));
3093
3122
  }
3094
- const Dr = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ir = fn, Ls = (e, t) => (r) => {
3095
- var n;
3096
- if ((t == null ? void 0 : t.variants) == null) return Ir(e, r == null ? void 0 : r.class, r == null ? void 0 : r.className);
3097
- const { variants: o, defaultVariants: s } = t, i = Object.keys(o).map((l) => {
3098
- const d = r == null ? void 0 : r[l], f = s == null ? void 0 : s[l];
3099
- if (d === null) return null;
3100
- const m = Dr(d) || Dr(f);
3101
- return o[l][m];
3102
- }), a = r && Object.entries(r).reduce((l, d) => {
3103
- let [f, m] = d;
3104
- return m === void 0 || (l[f] = m), l;
3105
- }, {}), c = t == null || (n = t.compoundVariants) === null || n === void 0 ? void 0 : n.reduce((l, d) => {
3106
- let { class: f, className: m, ...g } = d;
3107
- return Object.entries(g).every((b) => {
3108
- let [p, h] = b;
3109
- return Array.isArray(h) ? h.includes({
3110
- ...s,
3111
- ...a
3112
- }[p]) : {
3113
- ...s,
3114
- ...a
3115
- }[p] === h;
3116
- }) ? [
3117
- ...l,
3118
- f,
3119
- m
3120
- ] : l;
3121
- }, []);
3122
- return Ir(e, i, c, r == null ? void 0 : r.class, r == null ? void 0 : r.className);
3123
- }, Fs = Ls(
3123
+ const Fs = ns(
3124
3124
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
3125
3125
  {
3126
3126
  variants: {