@pandacss/shared 0.53.7 → 1.0.0

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.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  // src/arbitrary-value.ts
2
2
  var getArbitraryValue = (_value) => {
3
- if (!_value || typeof _value !== "string")
4
- return _value;
3
+ if (!_value || typeof _value !== "string") return _value;
5
4
  const value = _value.trim();
6
5
  if (value[0] === "[" && value[value.length - 1] === "]") {
7
6
  const innerValue = value.slice(1, -1);
@@ -50,19 +49,15 @@ var ruleClean = /\/\*[^]*?\*\/| +/g;
50
49
  var ruleNewline = /\n+/g;
51
50
  var empty = " ";
52
51
  var astish = (val, tree = [{}]) => {
53
- if (!val)
54
- return tree[0];
52
+ if (!val) return tree[0];
55
53
  let block, left;
56
54
  while (block = newRule.exec(val.replace(ruleClean, ""))) {
57
- if (block[4])
58
- tree.shift();
55
+ if (block[4]) tree.shift();
59
56
  else if (block[3]) {
60
57
  left = block[3].replace(ruleNewline, empty).trim();
61
- if (!left.includes("&") && !left.startsWith("@"))
62
- left = "& " + left;
58
+ if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
63
59
  tree.unshift(tree[0][left] = tree[0][left] || {});
64
- } else
65
- tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
60
+ } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
66
61
  }
67
62
  return tree[0];
68
63
  };
@@ -185,8 +180,7 @@ var memo = (fn) => {
185
180
  var regex = /-(\w|$)/g;
186
181
  var callback = (_dashChar, char) => char.toUpperCase();
187
182
  var camelCaseProperty = memo((property) => {
188
- if (property.startsWith("--"))
189
- return property;
183
+ if (property.startsWith("--")) return property;
190
184
  let str = property.toLowerCase();
191
185
  str = str.startsWith("-ms-") ? str.substring(1) : str;
192
186
  return str.replace(regex, callback);
@@ -216,14 +210,12 @@ function toChar(code) {
216
210
  function toName(code) {
217
211
  let name = "";
218
212
  let x;
219
- for (x = Math.abs(code); x > 52; x = x / 52 | 0)
220
- name = toChar(x % 52) + name;
213
+ for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
221
214
  return toChar(x % 52) + name;
222
215
  }
223
216
  function toPhash(h, x) {
224
217
  let i = x.length;
225
- while (i)
226
- h = h * 33 ^ x.charCodeAt(--i);
218
+ while (i) h = h * 33 ^ x.charCodeAt(--i);
227
219
  return h;
228
220
  }
229
221
  function toHash(value) {
@@ -268,11 +260,9 @@ function markImportant(obj) {
268
260
  var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
269
261
  function mergeProps(...sources) {
270
262
  return sources.reduce((prev, obj) => {
271
- if (!obj)
272
- return prev;
263
+ if (!obj) return prev;
273
264
  Object.keys(obj).forEach((key) => {
274
- if (MERGE_OMIT.has(key))
275
- return;
265
+ if (MERGE_OMIT.has(key)) return;
276
266
  const prevValue = prev[key];
277
267
  const value = obj[key];
278
268
  if (isObject(prevValue) && isObject(value)) {
@@ -310,10 +300,8 @@ function walkObject(target, predicate, options = {}) {
310
300
  return inner(target);
311
301
  }
312
302
  function mapObject(obj, fn) {
313
- if (Array.isArray(obj))
314
- return obj.map((value) => fn(value));
315
- if (!isObject(obj))
316
- return fn(obj);
303
+ if (Array.isArray(obj)) return obj.map((value) => fn(value));
304
+ if (!isObject(obj)) return fn(obj);
317
305
  return walkObject(obj, (value) => fn(value));
318
306
  }
319
307
 
@@ -371,15 +359,13 @@ function createCss(context) {
371
359
  const normalizedObject = normalizeStyleObject(styleObject, context);
372
360
  const classNames = /* @__PURE__ */ new Set();
373
361
  walkObject(normalizedObject, (value, paths) => {
374
- if (value == null)
375
- return;
362
+ if (value == null) return;
376
363
  const important = isImportant(value);
377
364
  const [prop, ...allConditions] = conds.shift(paths);
378
365
  const conditions = filterBaseConditions(allConditions);
379
366
  const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
380
367
  let className = hashFn(conditions, transformed.className);
381
- if (important)
382
- className = `${className}!`;
368
+ if (important) className = `${className}!`;
383
369
  classNames.add(className);
384
370
  });
385
371
  return Array.from(classNames).join(" ");
@@ -391,8 +377,7 @@ function compactStyles(...styles) {
391
377
  function createMergeCss(context) {
392
378
  function resolve(styles) {
393
379
  const allStyles = compactStyles(...styles);
394
- if (allStyles.length === 1)
395
- return allStyles;
380
+ if (allStyles.length === 1) return allStyles;
396
381
  return allStyles.map((style) => normalizeStyleObject(style, context));
397
382
  }
398
383
  function mergeCss(...styles) {
@@ -484,12 +469,9 @@ var PandaError = class extends Error {
484
469
  // src/esc.ts
485
470
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
486
471
  var fcssescape = function(ch, asCodePoint) {
487
- if (!asCodePoint)
488
- return "\\" + ch;
489
- if (ch === "\0")
490
- return "\uFFFD";
491
- if (ch === "-" && ch.length === 1)
492
- return "\\-";
472
+ if (!asCodePoint) return "\\" + ch;
473
+ if (ch === "\0") return "\uFFFD";
474
+ if (ch === "-" && ch.length === 1) return "\\-";
493
475
  return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16);
494
476
  };
495
477
  var esc2 = (sel) => {
@@ -498,8 +480,7 @@ var esc2 = (sel) => {
498
480
 
499
481
  // src/flatten.ts
500
482
  function filterDefault(path) {
501
- if (path[0] === "DEFAULT")
502
- return path;
483
+ if (path[0] === "DEFAULT") return path;
503
484
  return path.filter((item) => item !== "DEFAULT");
504
485
  }
505
486
  function flatten(values, stop) {
@@ -535,8 +516,7 @@ function getOrCreateSet(map, key) {
535
516
  var wordRegex = /([A-Z])/g;
536
517
  var msRegex = /^ms-/;
537
518
  var hypenateProperty = memo((property) => {
538
- if (property.startsWith("--"))
539
- return property;
519
+ if (property.startsWith("--")) return property;
540
520
  return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
541
521
  });
542
522
 
@@ -633,12 +613,473 @@ var patternFns = {
633
613
  isCssUnit
634
614
  };
635
615
  var getPatternStyles = (pattern, styles) => {
636
- if (!pattern?.defaultValues)
637
- return styles;
616
+ if (!pattern?.defaultValues) return styles;
638
617
  const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
639
618
  return Object.assign({}, defaults, compact(styles));
640
619
  };
641
620
 
621
+ // src/property-priority.ts
622
+ var longHandPhysical = /* @__PURE__ */ new Set();
623
+ var longHandLogical = /* @__PURE__ */ new Set();
624
+ var shorthandsOfLonghands = /* @__PURE__ */ new Set();
625
+ var shorthandsOfShorthands = /* @__PURE__ */ new Set();
626
+ longHandLogical.add("backgroundBlendMode");
627
+ longHandLogical.add("isolation");
628
+ longHandLogical.add("mixBlendMode");
629
+ shorthandsOfShorthands.add("animation");
630
+ longHandLogical.add("animationComposition");
631
+ longHandLogical.add("animationDelay");
632
+ longHandLogical.add("animationDirection");
633
+ longHandLogical.add("animationDuration");
634
+ longHandLogical.add("animationFillMode");
635
+ longHandLogical.add("animationIterationCount");
636
+ longHandLogical.add("animationName");
637
+ longHandLogical.add("animationPlayState");
638
+ shorthandsOfLonghands.add("animationRange");
639
+ longHandLogical.add("animationRangeEnd");
640
+ longHandLogical.add("animationRangeStart");
641
+ longHandLogical.add("animationTimingFunction");
642
+ longHandLogical.add("animationTimeline");
643
+ shorthandsOfLonghands.add("scrollTimeline");
644
+ longHandLogical.add("scrollTimelineAxis");
645
+ longHandLogical.add("scrollTimelineName");
646
+ longHandLogical.add("timelineScope");
647
+ shorthandsOfLonghands.add("viewTimeline");
648
+ longHandLogical.add("viewTimelineAxis");
649
+ longHandLogical.add("viewTimelineInset");
650
+ longHandLogical.add("viewTimelineName");
651
+ shorthandsOfShorthands.add("background");
652
+ longHandLogical.add("backgroundAttachment");
653
+ longHandLogical.add("backgroundClip");
654
+ longHandLogical.add("backgroundColor");
655
+ longHandLogical.add("backgroundImage");
656
+ longHandLogical.add("backgroundOrigin");
657
+ longHandLogical.add("backgroundRepeat");
658
+ longHandLogical.add("backgroundSize");
659
+ shorthandsOfLonghands.add("backgroundPosition");
660
+ longHandLogical.add("backgroundPositionX");
661
+ longHandLogical.add("backgroundPositionY");
662
+ shorthandsOfShorthands.add("border");
663
+ shorthandsOfLonghands.add("borderColor");
664
+ shorthandsOfLonghands.add("borderStyle");
665
+ shorthandsOfLonghands.add("borderWidth");
666
+ shorthandsOfShorthands.add("borderBlock");
667
+ longHandLogical.add("borderBlockColor");
668
+ longHandLogical.add("borderBlockStyle");
669
+ longHandLogical.add("borderBlockWidth");
670
+ shorthandsOfLonghands.add("borderBlockStart");
671
+ shorthandsOfLonghands.add("borderTop");
672
+ longHandLogical.add("borderBlockStartColor");
673
+ longHandPhysical.add("borderTopColor");
674
+ longHandLogical.add("borderBlockStartStyle");
675
+ longHandPhysical.add("borderTopStyle");
676
+ longHandLogical.add("borderBlockStartWidth");
677
+ longHandPhysical.add("borderTopWidth");
678
+ shorthandsOfLonghands.add("borderBlockEnd");
679
+ shorthandsOfLonghands.add("borderBottom");
680
+ longHandLogical.add("borderBlockEndColor");
681
+ longHandPhysical.add("borderBottomColor");
682
+ longHandLogical.add("borderBlockEndStyle");
683
+ longHandPhysical.add("borderBottomStyle");
684
+ longHandLogical.add("borderBlockEndWidth");
685
+ longHandPhysical.add("borderBottomWidth");
686
+ shorthandsOfShorthands.add("borderInline");
687
+ shorthandsOfLonghands.add("borderInlineColor");
688
+ shorthandsOfLonghands.add("borderInlineStyle");
689
+ shorthandsOfLonghands.add("borderInlineWidth");
690
+ shorthandsOfLonghands.add("borderInlineStart");
691
+ shorthandsOfLonghands.add("borderLeft");
692
+ longHandLogical.add("borderInlineStartColor");
693
+ longHandPhysical.add("borderLeftColor");
694
+ longHandLogical.add("borderInlineStartStyle");
695
+ longHandPhysical.add("borderLeftStyle");
696
+ longHandLogical.add("borderInlineStartWidth");
697
+ longHandPhysical.add("borderLeftWidth");
698
+ shorthandsOfLonghands.add("borderInlineEnd");
699
+ shorthandsOfLonghands.add("borderRight");
700
+ longHandLogical.add("borderInlineEndColor");
701
+ longHandPhysical.add("borderRightColor");
702
+ longHandLogical.add("borderInlineEndStyle");
703
+ longHandPhysical.add("borderRightStyle");
704
+ longHandLogical.add("borderInlineEndWidth");
705
+ longHandPhysical.add("borderRightWidth");
706
+ shorthandsOfLonghands.add("borderImage");
707
+ longHandLogical.add("borderImageOutset");
708
+ longHandLogical.add("borderImageRepeat");
709
+ longHandLogical.add("borderImageSlice");
710
+ longHandLogical.add("borderImageSource");
711
+ longHandLogical.add("borderImageWidth");
712
+ shorthandsOfLonghands.add("borderRadius");
713
+ longHandLogical.add("borderStartEndRadius");
714
+ longHandLogical.add("borderStartStartRadius");
715
+ longHandLogical.add("borderEndEndRadius");
716
+ longHandLogical.add("borderEndStartRadius");
717
+ longHandPhysical.add("borderTopLeftRadius");
718
+ longHandPhysical.add("borderTopRightRadius");
719
+ longHandPhysical.add("borderBottomLeftRadius");
720
+ longHandPhysical.add("borderBottomRightRadius");
721
+ longHandLogical.add("boxShadow");
722
+ longHandLogical.add("accentColor");
723
+ longHandLogical.add("appearance");
724
+ longHandLogical.add("aspectRatio");
725
+ shorthandsOfLonghands.add("caret");
726
+ longHandLogical.add("caretColor");
727
+ longHandLogical.add("caretShape");
728
+ longHandLogical.add("cursor");
729
+ longHandLogical.add("imeMode");
730
+ longHandLogical.add("inputSecurity");
731
+ shorthandsOfLonghands.add("outline");
732
+ longHandLogical.add("outlineColor");
733
+ longHandLogical.add("outlineOffset");
734
+ longHandLogical.add("outlineStyle");
735
+ longHandLogical.add("outlineWidth");
736
+ longHandLogical.add("pointerEvents");
737
+ longHandLogical.add("resize");
738
+ longHandLogical.add("textOverflow");
739
+ longHandLogical.add("userSelect");
740
+ shorthandsOfLonghands.add("gridGap");
741
+ shorthandsOfLonghands.add("gap");
742
+ longHandLogical.add("gridRowGap");
743
+ longHandLogical.add("rowGap");
744
+ longHandLogical.add("gridColumnGap");
745
+ longHandLogical.add("columnGap");
746
+ shorthandsOfLonghands.add("placeContent");
747
+ longHandLogical.add("alignContent");
748
+ longHandLogical.add("justifyContent");
749
+ shorthandsOfLonghands.add("placeItems");
750
+ longHandLogical.add("alignItems");
751
+ longHandLogical.add("justifyItems");
752
+ shorthandsOfLonghands.add("placeSelf");
753
+ longHandLogical.add("alignSelf");
754
+ longHandLogical.add("justifySelf");
755
+ longHandLogical.add("boxSizing");
756
+ longHandLogical.add("fieldSizing");
757
+ longHandLogical.add("blockSize");
758
+ longHandPhysical.add("height");
759
+ longHandLogical.add("inlineSize");
760
+ longHandPhysical.add("width");
761
+ longHandLogical.add("maxBlockSize");
762
+ longHandPhysical.add("maxHeight");
763
+ longHandLogical.add("maxInlineSize");
764
+ longHandPhysical.add("maxWidth");
765
+ longHandLogical.add("minBlockSize");
766
+ longHandPhysical.add("minHeight");
767
+ longHandLogical.add("minInlineSize");
768
+ longHandPhysical.add("minWidth");
769
+ shorthandsOfShorthands.add("margin");
770
+ shorthandsOfLonghands.add("marginBlock");
771
+ longHandLogical.add("marginBlockStart");
772
+ longHandPhysical.add("marginTop");
773
+ longHandLogical.add("marginBlockEnd");
774
+ longHandPhysical.add("marginBottom");
775
+ shorthandsOfLonghands.add("marginInline");
776
+ longHandLogical.add("marginInlineStart");
777
+ longHandPhysical.add("marginLeft");
778
+ longHandLogical.add("marginInlineEnd");
779
+ longHandPhysical.add("marginRight");
780
+ longHandLogical.add("marginTrim");
781
+ shorthandsOfLonghands.add("overscrollBehavior");
782
+ longHandLogical.add("overscrollBehaviorBlock");
783
+ longHandPhysical.add("overscrollBehaviorY");
784
+ longHandLogical.add("overscrollBehaviorInline");
785
+ longHandPhysical.add("overscrollBehaviorX");
786
+ shorthandsOfShorthands.add("padding");
787
+ shorthandsOfLonghands.add("paddingBlock");
788
+ longHandLogical.add("paddingBlockStart");
789
+ longHandPhysical.add("paddingTop");
790
+ longHandLogical.add("paddingBlockEnd");
791
+ longHandPhysical.add("paddingBottom");
792
+ shorthandsOfLonghands.add("paddingInline");
793
+ longHandLogical.add("paddingInlineStart");
794
+ longHandPhysical.add("paddingLeft");
795
+ longHandLogical.add("paddingInlineEnd");
796
+ longHandPhysical.add("paddingRight");
797
+ longHandLogical.add("visibility");
798
+ longHandLogical.add("color");
799
+ longHandLogical.add("colorScheme");
800
+ longHandLogical.add("forcedColorAdjust");
801
+ longHandLogical.add("opacity");
802
+ longHandLogical.add("printColorAdjust");
803
+ shorthandsOfLonghands.add("columns");
804
+ longHandLogical.add("columnCount");
805
+ longHandLogical.add("columnWidth");
806
+ longHandLogical.add("columnFill");
807
+ longHandLogical.add("columnSpan");
808
+ shorthandsOfLonghands.add("columnRule");
809
+ longHandLogical.add("columnRuleColor");
810
+ longHandLogical.add("columnRuleStyle");
811
+ longHandLogical.add("columnRuleWidth");
812
+ longHandLogical.add("contain");
813
+ shorthandsOfLonghands.add("containIntrinsicSize");
814
+ longHandLogical.add("containIntrinsicBlockSize");
815
+ longHandLogical.add("containIntrinsicWidth");
816
+ longHandLogical.add("containIntrinsicHeight");
817
+ longHandLogical.add("containIntrinsicInlineSize");
818
+ shorthandsOfLonghands.add("container");
819
+ longHandLogical.add("containerName");
820
+ longHandLogical.add("containerType");
821
+ longHandLogical.add("contentVisibility");
822
+ longHandLogical.add("counterIncrement");
823
+ longHandLogical.add("counterReset");
824
+ longHandLogical.add("counterSet");
825
+ longHandLogical.add("display");
826
+ shorthandsOfLonghands.add("flex");
827
+ longHandLogical.add("flexBasis");
828
+ longHandLogical.add("flexGrow");
829
+ longHandLogical.add("flexShrink");
830
+ shorthandsOfLonghands.add("flexFlow");
831
+ longHandLogical.add("flexDirection");
832
+ longHandLogical.add("flexWrap");
833
+ longHandLogical.add("order");
834
+ shorthandsOfShorthands.add("font");
835
+ longHandLogical.add("fontFamily");
836
+ longHandLogical.add("fontSize");
837
+ longHandLogical.add("fontStretch");
838
+ longHandLogical.add("fontStyle");
839
+ longHandLogical.add("fontWeight");
840
+ longHandLogical.add("lineHeight");
841
+ shorthandsOfLonghands.add("fontVariant");
842
+ longHandLogical.add("fontVariantAlternates");
843
+ longHandLogical.add("fontVariantCaps");
844
+ longHandLogical.add("fontVariantEastAsian");
845
+ longHandLogical.add("fontVariantEmoji");
846
+ longHandLogical.add("fontVariantLigatures");
847
+ longHandLogical.add("fontVariantNumeric");
848
+ longHandLogical.add("fontVariantPosition");
849
+ longHandLogical.add("fontFeatureSettings");
850
+ longHandLogical.add("fontKerning");
851
+ longHandLogical.add("fontLanguageOverride");
852
+ longHandLogical.add("fontOpticalSizing");
853
+ longHandLogical.add("fontPalette");
854
+ longHandLogical.add("fontVariationSettings");
855
+ longHandLogical.add("fontSizeAdjust");
856
+ longHandLogical.add("fontSmooth");
857
+ longHandLogical.add("fontSynthesisPosition");
858
+ longHandLogical.add("fontSynthesisSmallCaps");
859
+ longHandLogical.add("fontSynthesisStyle");
860
+ longHandLogical.add("fontSynthesisWeight");
861
+ shorthandsOfLonghands.add("fontSynthesis");
862
+ longHandLogical.add("lineHeightStep");
863
+ longHandLogical.add("boxDecorationBreak");
864
+ longHandLogical.add("breakAfter");
865
+ longHandLogical.add("breakBefore");
866
+ longHandLogical.add("breakInside");
867
+ longHandLogical.add("orphans");
868
+ longHandLogical.add("widows");
869
+ longHandLogical.add("content");
870
+ longHandLogical.add("quotes");
871
+ shorthandsOfShorthands.add("grid");
872
+ longHandLogical.add("gridAutoFlow");
873
+ longHandLogical.add("gridAutoRows");
874
+ longHandLogical.add("gridAutoColumns");
875
+ shorthandsOfShorthands.add("gridTemplate");
876
+ shorthandsOfLonghands.add("gridTemplateAreas");
877
+ longHandLogical.add("gridTemplateColumns");
878
+ longHandLogical.add("gridTemplateRows");
879
+ shorthandsOfShorthands.add("gridArea");
880
+ shorthandsOfLonghands.add("gridRow");
881
+ longHandLogical.add("gridRowStart");
882
+ longHandLogical.add("gridRowEnd");
883
+ shorthandsOfLonghands.add("gridColumn");
884
+ longHandLogical.add("gridColumnStart");
885
+ longHandLogical.add("gridColumnEnd");
886
+ longHandLogical.add("alignTracks");
887
+ longHandLogical.add("justifyTracks");
888
+ longHandLogical.add("masonryAutoFlow");
889
+ longHandLogical.add("imageOrientation");
890
+ longHandLogical.add("imageRendering");
891
+ longHandLogical.add("imageResolution");
892
+ longHandLogical.add("objectFit");
893
+ longHandLogical.add("objectPosition");
894
+ longHandLogical.add("initialLetter");
895
+ longHandLogical.add("initialLetterAlign");
896
+ shorthandsOfLonghands.add("listStyle");
897
+ longHandLogical.add("listStyleImage");
898
+ longHandLogical.add("listStylePosition");
899
+ longHandLogical.add("listStyleType");
900
+ longHandLogical.add("clip");
901
+ longHandLogical.add("clipPath");
902
+ shorthandsOfLonghands.add("mask");
903
+ longHandLogical.add("maskClip");
904
+ longHandLogical.add("maskComposite");
905
+ longHandLogical.add("maskImage");
906
+ longHandLogical.add("maskMode");
907
+ longHandLogical.add("maskOrigin");
908
+ longHandLogical.add("maskPosition");
909
+ longHandLogical.add("maskRepeat");
910
+ longHandLogical.add("maskSize");
911
+ longHandLogical.add("maskType");
912
+ shorthandsOfLonghands.add("maskBorder");
913
+ longHandLogical.add("maskBorderMode");
914
+ longHandLogical.add("maskBorderOutset");
915
+ longHandLogical.add("maskBorderRepeat");
916
+ longHandLogical.add("maskBorderSlice");
917
+ longHandLogical.add("maskBorderSource");
918
+ longHandLogical.add("maskBorderWidth");
919
+ shorthandsOfShorthands.add("all");
920
+ longHandLogical.add("textRendering");
921
+ longHandLogical.add("zoom");
922
+ shorthandsOfLonghands.add("offset");
923
+ longHandLogical.add("offsetAnchor");
924
+ longHandLogical.add("offsetDistance");
925
+ longHandLogical.add("offsetPath");
926
+ longHandLogical.add("offsetPosition");
927
+ longHandLogical.add("offsetRotate");
928
+ longHandLogical.add("WebkitBoxOrient");
929
+ longHandLogical.add("WebkitLineClamp");
930
+ longHandPhysical.add("lineClamp");
931
+ longHandPhysical.add("maxLines");
932
+ longHandLogical.add("blockOverflow");
933
+ shorthandsOfLonghands.add("overflow");
934
+ longHandLogical.add("overflowBlock");
935
+ longHandPhysical.add("overflowY");
936
+ longHandLogical.add("overflowInline");
937
+ longHandPhysical.add("overflowX");
938
+ longHandLogical.add("overflowClipMargin");
939
+ longHandLogical.add("scrollGutter");
940
+ longHandLogical.add("scrollBehavior");
941
+ longHandLogical.add("page");
942
+ longHandLogical.add("pageBreakAfter");
943
+ longHandLogical.add("pageBreakBefore");
944
+ longHandLogical.add("pageBreakInside");
945
+ shorthandsOfShorthands.add("inset");
946
+ shorthandsOfLonghands.add("insetBlock");
947
+ longHandLogical.add("insetBlockStart");
948
+ longHandPhysical.add("top");
949
+ longHandLogical.add("insetBlockEnd");
950
+ longHandPhysical.add("bottom");
951
+ shorthandsOfLonghands.add("insetInline");
952
+ longHandLogical.add("insetInlineStart");
953
+ longHandPhysical.add("left");
954
+ longHandLogical.add("insetInlineEnd");
955
+ longHandPhysical.add("right");
956
+ longHandLogical.add("clear");
957
+ longHandLogical.add("float");
958
+ longHandLogical.add("overlay");
959
+ longHandLogical.add("position");
960
+ longHandLogical.add("zIndex");
961
+ longHandLogical.add("rubyAlign");
962
+ longHandLogical.add("rubyMerge");
963
+ longHandLogical.add("rubyPosition");
964
+ longHandLogical.add("overflowAnchor");
965
+ shorthandsOfShorthands.add("scrollMargin");
966
+ shorthandsOfLonghands.add("scrollMarginBlock");
967
+ longHandLogical.add("scrollMarginBlockStart");
968
+ longHandPhysical.add("scrollMarginTop");
969
+ longHandLogical.add("scrollMarginBlockEnd");
970
+ longHandPhysical.add("scrollMarginBottom");
971
+ shorthandsOfLonghands.add("scrollMarginInline");
972
+ longHandLogical.add("scrollMarginInlineStart");
973
+ longHandPhysical.add("scrollMarginLeft");
974
+ longHandLogical.add("scrollMarginInlineEnd");
975
+ longHandPhysical.add("scrollMarginRight");
976
+ shorthandsOfShorthands.add("scrollPadding");
977
+ shorthandsOfLonghands.add("scrollPaddingBlock");
978
+ longHandLogical.add("scrollPaddingBlockStart");
979
+ longHandPhysical.add("scrollPaddingTop");
980
+ longHandLogical.add("scrollPaddingBlockEnd");
981
+ longHandPhysical.add("scrollPaddingBottom");
982
+ shorthandsOfLonghands.add("scrollPaddingInline");
983
+ longHandLogical.add("scrollPaddingInlineStart");
984
+ longHandPhysical.add("scrollPaddingLeft");
985
+ longHandLogical.add("scrollPaddingInlineEnd");
986
+ longHandPhysical.add("scrollPaddingRight");
987
+ longHandLogical.add("scrollSnapAlign");
988
+ longHandLogical.add("scrollSnapStop");
989
+ shorthandsOfLonghands.add("scrollSnapType");
990
+ longHandLogical.add("scrollbarColor");
991
+ longHandLogical.add("scrollbarWidth");
992
+ longHandLogical.add("shapeImageThreshold");
993
+ longHandLogical.add("shapeMargin");
994
+ longHandLogical.add("shapeOutside");
995
+ longHandLogical.add("azimuth");
996
+ longHandLogical.add("borderCollapse");
997
+ longHandLogical.add("borderSpacing");
998
+ longHandLogical.add("captionSide");
999
+ longHandLogical.add("emptyCells");
1000
+ longHandLogical.add("tableLayout");
1001
+ longHandLogical.add("verticalAlign");
1002
+ shorthandsOfLonghands.add("textDecoration");
1003
+ longHandLogical.add("textDecorationColor");
1004
+ longHandLogical.add("textDecorationLine");
1005
+ longHandLogical.add("textDecorationSkip");
1006
+ longHandLogical.add("textDecorationSkipInk");
1007
+ longHandLogical.add("textDecorationStyle");
1008
+ longHandLogical.add("textDecorationThickness");
1009
+ shorthandsOfLonghands.add("WebkitTextStroke");
1010
+ longHandLogical.add("WebkitTextStrokeColor");
1011
+ longHandLogical.add("WebkitTextStrokeWidth");
1012
+ longHandLogical.add("WebkitTextFillColor");
1013
+ shorthandsOfLonghands.add("textEmphasis");
1014
+ longHandLogical.add("textEmphasisColor");
1015
+ longHandLogical.add("textEmphasisPosition");
1016
+ longHandLogical.add("textEmphasisStyle");
1017
+ longHandLogical.add("textShadow");
1018
+ longHandLogical.add("textUnderlineOffset");
1019
+ longHandLogical.add("textUnderlinePosition");
1020
+ longHandLogical.add("hangingPunctuation");
1021
+ longHandLogical.add("hyphenateCharacter");
1022
+ longHandLogical.add("hyphenateLimitChars");
1023
+ longHandLogical.add("hyphens");
1024
+ longHandLogical.add("letterSpacing");
1025
+ longHandLogical.add("lineBreak");
1026
+ longHandLogical.add("overflowWrap");
1027
+ longHandLogical.add("paintOrder");
1028
+ longHandLogical.add("tabSize");
1029
+ longHandLogical.add("textAlign");
1030
+ longHandLogical.add("textAlignLast");
1031
+ longHandLogical.add("textIndent");
1032
+ longHandLogical.add("textJustify");
1033
+ longHandLogical.add("textSizeAdjust");
1034
+ longHandLogical.add("textTransform");
1035
+ shorthandsOfLonghands.add("textWrap");
1036
+ longHandLogical.add("textWrapMode");
1037
+ longHandLogical.add("textWrapStyle");
1038
+ longHandLogical.add("whiteSpace");
1039
+ longHandLogical.add("whiteSpaceCollapse");
1040
+ longHandLogical.add("whiteSpaceTrim");
1041
+ longHandLogical.add("wordBreak");
1042
+ longHandLogical.add("wordSpacing");
1043
+ longHandLogical.add("wordWrap");
1044
+ longHandLogical.add("backfaceVisibility");
1045
+ longHandLogical.add("perspective");
1046
+ longHandLogical.add("perspectiveOrigin");
1047
+ longHandLogical.add("rotate");
1048
+ longHandLogical.add("scale");
1049
+ longHandLogical.add("transform");
1050
+ longHandLogical.add("transformBox");
1051
+ longHandLogical.add("transformOrigin");
1052
+ longHandLogical.add("transformStyle");
1053
+ longHandLogical.add("translate");
1054
+ shorthandsOfLonghands.add("transition");
1055
+ longHandLogical.add("transitionBehavior");
1056
+ longHandLogical.add("transitionDelay");
1057
+ longHandLogical.add("transitionDuration");
1058
+ longHandLogical.add("transitionProperty");
1059
+ longHandLogical.add("transitionTimingFunction");
1060
+ longHandLogical.add("viewTransitionName");
1061
+ longHandLogical.add("willChange");
1062
+ longHandLogical.add("direction");
1063
+ longHandLogical.add("textCombineUpright");
1064
+ longHandLogical.add("textOrientation");
1065
+ longHandLogical.add("unicodeBidi");
1066
+ longHandLogical.add("writingMode");
1067
+ longHandLogical.add("backdropFilter");
1068
+ longHandLogical.add("filter");
1069
+ longHandLogical.add("mathDepth");
1070
+ longHandLogical.add("mathShift");
1071
+ longHandLogical.add("mathStyle");
1072
+ longHandLogical.add("touchAction");
1073
+ function getPropertyPriority(key) {
1074
+ if (key === "all") return 0;
1075
+ if (key.startsWith("--")) return 1;
1076
+ if (longHandPhysical.has(key)) return 4e3;
1077
+ if (longHandLogical.has(key)) return 3e3;
1078
+ if (shorthandsOfLonghands.has(key)) return 2e3;
1079
+ if (shorthandsOfShorthands.has(key)) return 1e3;
1080
+ return 3e3;
1081
+ }
1082
+
642
1083
  // src/regex.ts
643
1084
  var createRegex = (item) => {
644
1085
  const regex2 = item.map((item2) => typeof item2 === "string" ? `^${item2}$` : item2.source).join("|");
@@ -648,8 +1089,7 @@ var createRegex = (item) => {
648
1089
  // src/serialize.ts
649
1090
  var stringifyJson = (config) => {
650
1091
  return JSON.stringify(config, (_key, value) => {
651
- if (typeof value === "function")
652
- return value.toString();
1092
+ if (typeof value === "function") return value.toString();
653
1093
  return value;
654
1094
  });
655
1095
  };
@@ -657,128 +1097,6 @@ var parseJson = (config) => {
657
1097
  return JSON.parse(config);
658
1098
  };
659
1099
 
660
- // src/shorthand-properties.ts
661
- var shorthandProperties = {
662
- animation: [
663
- "animationName",
664
- "animationDuration",
665
- "animationTimingFunction",
666
- "animationDelay",
667
- "animationIterationCount",
668
- "animationDirection",
669
- "animationFillMode",
670
- "animationPlayState"
671
- ],
672
- background: [
673
- "backgroundImage",
674
- "backgroundPosition",
675
- "backgroundSize",
676
- "backgroundRepeat",
677
- "backgroundAttachment",
678
- "backgroundOrigin",
679
- "backgroundClip",
680
- "backgroundColor"
681
- ],
682
- backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
683
- border: ["borderWidth", "borderStyle", "borderColor"],
684
- borderBlockEnd: ["borderBlockEndWidth", "borderBlockEndStyle", "borderBlockEndColor"],
685
- borderBlockStart: ["borderBlockStartWidth", "borderBlockStartStyle", "borderBlockStartColor"],
686
- borderBottom: ["borderBottomWidth", "borderBottomStyle", "borderBottomColor"],
687
- borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
688
- borderImage: ["borderImageSource", "borderImageSlice", "borderImageWidth", "borderImageOutset", "borderImageRepeat"],
689
- borderInlineEnd: ["borderInlineEndWidth", "borderInlineEndStyle", "borderInlineEndColor"],
690
- borderInlineStart: ["borderInlineStartWidth", "borderInlineStartStyle", "borderInlineStartColor"],
691
- borderLeft: ["borderLeftWidth", "borderLeftStyle", "borderLeftColor"],
692
- borderRadius: ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
693
- borderRight: ["borderRightWidth", "borderRightStyle", "borderRightColor"],
694
- borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
695
- borderTop: ["borderTopWidth", "borderTopStyle", "borderTopColor"],
696
- borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
697
- columnRule: ["columnRuleWidth", "columnRuleStyle", "columnRuleColor"],
698
- columns: ["columnWidth", "columnCount"],
699
- container: ["contain", "content"],
700
- containIntrinsicSize: ["containIntrinsicSizeInline", "containIntrinsicSizeBlock"],
701
- cue: ["cueBefore", "cueAfter"],
702
- flex: ["flexGrow", "flexShrink", "flexBasis"],
703
- flexFlow: ["flexDirection", "flexWrap"],
704
- font: [
705
- "fontStyle",
706
- "fontVariantCaps",
707
- "fontVariantEastAsian",
708
- "fontVariantLigatures",
709
- "fontVariantNumeric",
710
- "fontVariantPosition",
711
- "fontWeight",
712
- "fontStretch",
713
- "fontSize",
714
- "lineHeight",
715
- "fontFamily"
716
- ],
717
- fontSynthesis: ["fontSynthesisWeight", "fontSynthesisStyle", "fontSynthesisSmallCaps"],
718
- fontVariant: [
719
- "fontVariantCaps",
720
- "fontVariantEastAsian",
721
- "fontVariantLigatures",
722
- "fontVariantNumeric",
723
- "fontVariantPosition"
724
- ],
725
- gap: ["columnGap", "rowGap"],
726
- grid: [
727
- "gridTemplateColumns",
728
- "gridTemplateRows",
729
- "gridTemplateAreas",
730
- "gridAutoColumns",
731
- "gridAutoRows",
732
- "gridAutoFlow"
733
- ],
734
- gridArea: ["gridRowStart", "gridColumnStart", "gridRowEnd", "gridColumnEnd"],
735
- gridColumn: ["gridColumnStart", "gridColumnEnd"],
736
- gridGap: ["gridColumnGap", "gridRowGap"],
737
- gridRow: ["gridRowStart", "gridRowEnd"],
738
- gridTemplate: ["gridTemplateColumns", "gridTemplateRows", "gridTemplateAreas"],
739
- inset: ["top", "right", "bottom", "left"],
740
- listStyle: ["listStyleType", "listStylePosition", "listStyleImage"],
741
- margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
742
- mask: ["maskImage", "maskMode", "maskRepeat", "maskPosition", "maskClip", "maskOrigin", "maskSize", "maskComposite"],
743
- maskBorder: [
744
- "maskBorderSource",
745
- "maskBorderMode",
746
- "maskBorderSlice",
747
- "maskBorderWidth",
748
- "maskBorderOutset",
749
- "maskBorderRepeat"
750
- ],
751
- offset: ["offsetPosition", "offsetPath", "offsetDistance", "offsetRotate", "offsetAnchor"],
752
- outline: ["outlineWidth", "outlineStyle", "outlineColor"],
753
- overflow: ["overflowX", "overflowY"],
754
- padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
755
- pause: ["pauseBefore", "pauseAfter"],
756
- placeContent: ["alignContent", "justifyContent"],
757
- placeItems: ["alignItems", "justifyItems"],
758
- placeSelf: ["alignSelf", "justifySelf"],
759
- rest: ["restBefore", "restAfter"],
760
- scrollMargin: ["scrollMarginTop", "scrollMarginRight", "scrollMarginBottom", "scrollMarginLeft"],
761
- scrollPadding: ["scrollPaddingTop", "scrollPaddingRight", "scrollPaddingBottom", "scrollPaddingLeft"],
762
- scrollPaddingBlock: ["scrollPaddingBlockStart", "scrollPaddingBlockEnd"],
763
- scrollPaddingInline: ["scrollPaddingInlineStart", "scrollPaddingInlineEnd"],
764
- scrollSnapMargin: ["scrollSnapMarginTop", "scrollSnapMarginRight", "scrollSnapMarginBottom", "scrollSnapMarginLeft"],
765
- scrollSnapMarginBlock: ["scrollSnapMarginBlockStart", "scrollSnapMarginBlockEnd"],
766
- scrollSnapMarginInline: ["scrollSnapMarginInlineStart", "scrollSnapMarginInlineEnd"],
767
- scrollTimeline: ["scrollTimelineSource", "scrollTimelineOrientation"],
768
- textDecoration: ["textDecorationLine", "textDecorationStyle", "textDecorationColor"],
769
- textEmphasis: ["textEmphasisStyle", "textEmphasisColor"],
770
- transition: ["transitionProperty", "transitionDuration", "transitionTimingFunction", "transitionDelay"]
771
- };
772
- var longhands = Object.values(shorthandProperties).reduce((a, b) => {
773
- b.forEach((val) => a.add(val));
774
- return a;
775
- }, /* @__PURE__ */ new Set([]));
776
- function getPropertyPriority(property) {
777
- if (property === "all")
778
- return 0;
779
- return longhands.has(property) ? 2 : 1;
780
- }
781
-
782
1100
  // src/slot.ts
783
1101
  var getSlotRecipes = (recipe = {}) => {
784
1102
  const init = (slot) => ({
@@ -838,8 +1156,7 @@ function getNegativePath(path) {
838
1156
  return path.slice(0, -1).concat(`-${path.at(-1)}`);
839
1157
  }
840
1158
  function getDotPath(obj, path, fallback) {
841
- if (typeof path !== "string")
842
- return fallback;
1159
+ if (typeof path !== "string") return fallback;
843
1160
  const idx = path.indexOf(".");
844
1161
  if (idx === -1) {
845
1162
  return obj?.[path] ?? fallback;
@@ -886,8 +1203,11 @@ function mapToJson(map) {
886
1203
  }
887
1204
 
888
1205
  // src/typegen.ts
889
- function unionType(values) {
890
- return Array.from(values).map((value) => JSON.stringify(value)).join(" | ");
1206
+ function unionType(values, opts = {}) {
1207
+ const { fallback, stringify = JSON.stringify } = opts;
1208
+ const arr = Array.from(values);
1209
+ if (fallback != null && !arr.length) return fallback;
1210
+ return arr.map((v) => stringify(v)).join(" | ");
891
1211
  }
892
1212
 
893
1213
  // src/uniq.ts
@@ -918,8 +1238,7 @@ function toPx(value = "") {
918
1238
  return `${value}px`;
919
1239
  }
920
1240
  const unit = getUnit(value);
921
- if (!unit)
922
- return value;
1241
+ if (!unit) return value;
923
1242
  if (unit === UNIT_PX) {
924
1243
  return value;
925
1244
  }
@@ -929,8 +1248,7 @@ function toPx(value = "") {
929
1248
  }
930
1249
  function toEm(value = "", fontSize = BASE_FONT_SIZE) {
931
1250
  const unit = getUnit(value);
932
- if (!unit)
933
- return value;
1251
+ if (!unit) return value;
934
1252
  if (unit === UNIT_EM) {
935
1253
  return value;
936
1254
  }
@@ -943,8 +1261,7 @@ function toEm(value = "", fontSize = BASE_FONT_SIZE) {
943
1261
  }
944
1262
  function toRem(value = "") {
945
1263
  const unit = getUnit(value);
946
- if (!unit)
947
- return value;
1264
+ if (!unit) return value;
948
1265
  if (unit === UNIT_REM) {
949
1266
  return value;
950
1267
  }