@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.js CHANGED
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  CacheMap: () => CacheMap,
24
24
  PANDA_CONFIG_NAME: () => PANDA_CONFIG_NAME,
25
25
  PandaError: () => PandaError,
@@ -88,12 +88,11 @@ __export(src_exports, {
88
88
  withoutImportant: () => withoutImportant,
89
89
  withoutSpace: () => withoutSpace
90
90
  });
91
- module.exports = __toCommonJS(src_exports);
91
+ module.exports = __toCommonJS(index_exports);
92
92
 
93
93
  // src/arbitrary-value.ts
94
94
  var getArbitraryValue = (_value) => {
95
- if (!_value || typeof _value !== "string")
96
- return _value;
95
+ if (!_value || typeof _value !== "string") return _value;
97
96
  const value = _value.trim();
98
97
  if (value[0] === "[" && value[value.length - 1] === "]") {
99
98
  const innerValue = value.slice(1, -1);
@@ -142,19 +141,15 @@ var ruleClean = /\/\*[^]*?\*\/| +/g;
142
141
  var ruleNewline = /\n+/g;
143
142
  var empty = " ";
144
143
  var astish = (val, tree = [{}]) => {
145
- if (!val)
146
- return tree[0];
144
+ if (!val) return tree[0];
147
145
  let block, left;
148
146
  while (block = newRule.exec(val.replace(ruleClean, ""))) {
149
- if (block[4])
150
- tree.shift();
147
+ if (block[4]) tree.shift();
151
148
  else if (block[3]) {
152
149
  left = block[3].replace(ruleNewline, empty).trim();
153
- if (!left.includes("&") && !left.startsWith("@"))
154
- left = "& " + left;
150
+ if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
155
151
  tree.unshift(tree[0][left] = tree[0][left] || {});
156
- } else
157
- tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
152
+ } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
158
153
  }
159
154
  return tree[0];
160
155
  };
@@ -277,8 +272,7 @@ var memo = (fn) => {
277
272
  var regex = /-(\w|$)/g;
278
273
  var callback = (_dashChar, char) => char.toUpperCase();
279
274
  var camelCaseProperty = memo((property) => {
280
- if (property.startsWith("--"))
281
- return property;
275
+ if (property.startsWith("--")) return property;
282
276
  let str = property.toLowerCase();
283
277
  str = str.startsWith("-ms-") ? str.substring(1) : str;
284
278
  return str.replace(regex, callback);
@@ -308,14 +302,12 @@ function toChar(code) {
308
302
  function toName(code) {
309
303
  let name = "";
310
304
  let x;
311
- for (x = Math.abs(code); x > 52; x = x / 52 | 0)
312
- name = toChar(x % 52) + name;
305
+ for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
313
306
  return toChar(x % 52) + name;
314
307
  }
315
308
  function toPhash(h, x) {
316
309
  let i = x.length;
317
- while (i)
318
- h = h * 33 ^ x.charCodeAt(--i);
310
+ while (i) h = h * 33 ^ x.charCodeAt(--i);
319
311
  return h;
320
312
  }
321
313
  function toHash(value) {
@@ -360,11 +352,9 @@ function markImportant(obj) {
360
352
  var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
361
353
  function mergeProps(...sources) {
362
354
  return sources.reduce((prev, obj) => {
363
- if (!obj)
364
- return prev;
355
+ if (!obj) return prev;
365
356
  Object.keys(obj).forEach((key) => {
366
- if (MERGE_OMIT.has(key))
367
- return;
357
+ if (MERGE_OMIT.has(key)) return;
368
358
  const prevValue = prev[key];
369
359
  const value = obj[key];
370
360
  if (isObject(prevValue) && isObject(value)) {
@@ -402,10 +392,8 @@ function walkObject(target, predicate, options = {}) {
402
392
  return inner(target);
403
393
  }
404
394
  function mapObject(obj, fn) {
405
- if (Array.isArray(obj))
406
- return obj.map((value) => fn(value));
407
- if (!isObject(obj))
408
- return fn(obj);
395
+ if (Array.isArray(obj)) return obj.map((value) => fn(value));
396
+ if (!isObject(obj)) return fn(obj);
409
397
  return walkObject(obj, (value) => fn(value));
410
398
  }
411
399
 
@@ -463,15 +451,13 @@ function createCss(context) {
463
451
  const normalizedObject = normalizeStyleObject(styleObject, context);
464
452
  const classNames = /* @__PURE__ */ new Set();
465
453
  walkObject(normalizedObject, (value, paths) => {
466
- if (value == null)
467
- return;
454
+ if (value == null) return;
468
455
  const important = isImportant(value);
469
456
  const [prop, ...allConditions] = conds.shift(paths);
470
457
  const conditions = filterBaseConditions(allConditions);
471
458
  const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
472
459
  let className = hashFn(conditions, transformed.className);
473
- if (important)
474
- className = `${className}!`;
460
+ if (important) className = `${className}!`;
475
461
  classNames.add(className);
476
462
  });
477
463
  return Array.from(classNames).join(" ");
@@ -483,8 +469,7 @@ function compactStyles(...styles) {
483
469
  function createMergeCss(context) {
484
470
  function resolve(styles) {
485
471
  const allStyles = compactStyles(...styles);
486
- if (allStyles.length === 1)
487
- return allStyles;
472
+ if (allStyles.length === 1) return allStyles;
488
473
  return allStyles.map((style) => normalizeStyleObject(style, context));
489
474
  }
490
475
  function mergeCss(...styles) {
@@ -576,12 +561,9 @@ var PandaError = class extends Error {
576
561
  // src/esc.ts
577
562
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
578
563
  var fcssescape = function(ch, asCodePoint) {
579
- if (!asCodePoint)
580
- return "\\" + ch;
581
- if (ch === "\0")
582
- return "\uFFFD";
583
- if (ch === "-" && ch.length === 1)
584
- return "\\-";
564
+ if (!asCodePoint) return "\\" + ch;
565
+ if (ch === "\0") return "\uFFFD";
566
+ if (ch === "-" && ch.length === 1) return "\\-";
585
567
  return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16);
586
568
  };
587
569
  var esc2 = (sel) => {
@@ -590,8 +572,7 @@ var esc2 = (sel) => {
590
572
 
591
573
  // src/flatten.ts
592
574
  function filterDefault(path) {
593
- if (path[0] === "DEFAULT")
594
- return path;
575
+ if (path[0] === "DEFAULT") return path;
595
576
  return path.filter((item) => item !== "DEFAULT");
596
577
  }
597
578
  function flatten(values, stop) {
@@ -627,8 +608,7 @@ function getOrCreateSet(map, key) {
627
608
  var wordRegex = /([A-Z])/g;
628
609
  var msRegex = /^ms-/;
629
610
  var hypenateProperty = memo((property) => {
630
- if (property.startsWith("--"))
631
- return property;
611
+ if (property.startsWith("--")) return property;
632
612
  return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
633
613
  });
634
614
 
@@ -725,12 +705,473 @@ var patternFns = {
725
705
  isCssUnit
726
706
  };
727
707
  var getPatternStyles = (pattern, styles) => {
728
- if (!pattern?.defaultValues)
729
- return styles;
708
+ if (!pattern?.defaultValues) return styles;
730
709
  const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
731
710
  return Object.assign({}, defaults, compact(styles));
732
711
  };
733
712
 
713
+ // src/property-priority.ts
714
+ var longHandPhysical = /* @__PURE__ */ new Set();
715
+ var longHandLogical = /* @__PURE__ */ new Set();
716
+ var shorthandsOfLonghands = /* @__PURE__ */ new Set();
717
+ var shorthandsOfShorthands = /* @__PURE__ */ new Set();
718
+ longHandLogical.add("backgroundBlendMode");
719
+ longHandLogical.add("isolation");
720
+ longHandLogical.add("mixBlendMode");
721
+ shorthandsOfShorthands.add("animation");
722
+ longHandLogical.add("animationComposition");
723
+ longHandLogical.add("animationDelay");
724
+ longHandLogical.add("animationDirection");
725
+ longHandLogical.add("animationDuration");
726
+ longHandLogical.add("animationFillMode");
727
+ longHandLogical.add("animationIterationCount");
728
+ longHandLogical.add("animationName");
729
+ longHandLogical.add("animationPlayState");
730
+ shorthandsOfLonghands.add("animationRange");
731
+ longHandLogical.add("animationRangeEnd");
732
+ longHandLogical.add("animationRangeStart");
733
+ longHandLogical.add("animationTimingFunction");
734
+ longHandLogical.add("animationTimeline");
735
+ shorthandsOfLonghands.add("scrollTimeline");
736
+ longHandLogical.add("scrollTimelineAxis");
737
+ longHandLogical.add("scrollTimelineName");
738
+ longHandLogical.add("timelineScope");
739
+ shorthandsOfLonghands.add("viewTimeline");
740
+ longHandLogical.add("viewTimelineAxis");
741
+ longHandLogical.add("viewTimelineInset");
742
+ longHandLogical.add("viewTimelineName");
743
+ shorthandsOfShorthands.add("background");
744
+ longHandLogical.add("backgroundAttachment");
745
+ longHandLogical.add("backgroundClip");
746
+ longHandLogical.add("backgroundColor");
747
+ longHandLogical.add("backgroundImage");
748
+ longHandLogical.add("backgroundOrigin");
749
+ longHandLogical.add("backgroundRepeat");
750
+ longHandLogical.add("backgroundSize");
751
+ shorthandsOfLonghands.add("backgroundPosition");
752
+ longHandLogical.add("backgroundPositionX");
753
+ longHandLogical.add("backgroundPositionY");
754
+ shorthandsOfShorthands.add("border");
755
+ shorthandsOfLonghands.add("borderColor");
756
+ shorthandsOfLonghands.add("borderStyle");
757
+ shorthandsOfLonghands.add("borderWidth");
758
+ shorthandsOfShorthands.add("borderBlock");
759
+ longHandLogical.add("borderBlockColor");
760
+ longHandLogical.add("borderBlockStyle");
761
+ longHandLogical.add("borderBlockWidth");
762
+ shorthandsOfLonghands.add("borderBlockStart");
763
+ shorthandsOfLonghands.add("borderTop");
764
+ longHandLogical.add("borderBlockStartColor");
765
+ longHandPhysical.add("borderTopColor");
766
+ longHandLogical.add("borderBlockStartStyle");
767
+ longHandPhysical.add("borderTopStyle");
768
+ longHandLogical.add("borderBlockStartWidth");
769
+ longHandPhysical.add("borderTopWidth");
770
+ shorthandsOfLonghands.add("borderBlockEnd");
771
+ shorthandsOfLonghands.add("borderBottom");
772
+ longHandLogical.add("borderBlockEndColor");
773
+ longHandPhysical.add("borderBottomColor");
774
+ longHandLogical.add("borderBlockEndStyle");
775
+ longHandPhysical.add("borderBottomStyle");
776
+ longHandLogical.add("borderBlockEndWidth");
777
+ longHandPhysical.add("borderBottomWidth");
778
+ shorthandsOfShorthands.add("borderInline");
779
+ shorthandsOfLonghands.add("borderInlineColor");
780
+ shorthandsOfLonghands.add("borderInlineStyle");
781
+ shorthandsOfLonghands.add("borderInlineWidth");
782
+ shorthandsOfLonghands.add("borderInlineStart");
783
+ shorthandsOfLonghands.add("borderLeft");
784
+ longHandLogical.add("borderInlineStartColor");
785
+ longHandPhysical.add("borderLeftColor");
786
+ longHandLogical.add("borderInlineStartStyle");
787
+ longHandPhysical.add("borderLeftStyle");
788
+ longHandLogical.add("borderInlineStartWidth");
789
+ longHandPhysical.add("borderLeftWidth");
790
+ shorthandsOfLonghands.add("borderInlineEnd");
791
+ shorthandsOfLonghands.add("borderRight");
792
+ longHandLogical.add("borderInlineEndColor");
793
+ longHandPhysical.add("borderRightColor");
794
+ longHandLogical.add("borderInlineEndStyle");
795
+ longHandPhysical.add("borderRightStyle");
796
+ longHandLogical.add("borderInlineEndWidth");
797
+ longHandPhysical.add("borderRightWidth");
798
+ shorthandsOfLonghands.add("borderImage");
799
+ longHandLogical.add("borderImageOutset");
800
+ longHandLogical.add("borderImageRepeat");
801
+ longHandLogical.add("borderImageSlice");
802
+ longHandLogical.add("borderImageSource");
803
+ longHandLogical.add("borderImageWidth");
804
+ shorthandsOfLonghands.add("borderRadius");
805
+ longHandLogical.add("borderStartEndRadius");
806
+ longHandLogical.add("borderStartStartRadius");
807
+ longHandLogical.add("borderEndEndRadius");
808
+ longHandLogical.add("borderEndStartRadius");
809
+ longHandPhysical.add("borderTopLeftRadius");
810
+ longHandPhysical.add("borderTopRightRadius");
811
+ longHandPhysical.add("borderBottomLeftRadius");
812
+ longHandPhysical.add("borderBottomRightRadius");
813
+ longHandLogical.add("boxShadow");
814
+ longHandLogical.add("accentColor");
815
+ longHandLogical.add("appearance");
816
+ longHandLogical.add("aspectRatio");
817
+ shorthandsOfLonghands.add("caret");
818
+ longHandLogical.add("caretColor");
819
+ longHandLogical.add("caretShape");
820
+ longHandLogical.add("cursor");
821
+ longHandLogical.add("imeMode");
822
+ longHandLogical.add("inputSecurity");
823
+ shorthandsOfLonghands.add("outline");
824
+ longHandLogical.add("outlineColor");
825
+ longHandLogical.add("outlineOffset");
826
+ longHandLogical.add("outlineStyle");
827
+ longHandLogical.add("outlineWidth");
828
+ longHandLogical.add("pointerEvents");
829
+ longHandLogical.add("resize");
830
+ longHandLogical.add("textOverflow");
831
+ longHandLogical.add("userSelect");
832
+ shorthandsOfLonghands.add("gridGap");
833
+ shorthandsOfLonghands.add("gap");
834
+ longHandLogical.add("gridRowGap");
835
+ longHandLogical.add("rowGap");
836
+ longHandLogical.add("gridColumnGap");
837
+ longHandLogical.add("columnGap");
838
+ shorthandsOfLonghands.add("placeContent");
839
+ longHandLogical.add("alignContent");
840
+ longHandLogical.add("justifyContent");
841
+ shorthandsOfLonghands.add("placeItems");
842
+ longHandLogical.add("alignItems");
843
+ longHandLogical.add("justifyItems");
844
+ shorthandsOfLonghands.add("placeSelf");
845
+ longHandLogical.add("alignSelf");
846
+ longHandLogical.add("justifySelf");
847
+ longHandLogical.add("boxSizing");
848
+ longHandLogical.add("fieldSizing");
849
+ longHandLogical.add("blockSize");
850
+ longHandPhysical.add("height");
851
+ longHandLogical.add("inlineSize");
852
+ longHandPhysical.add("width");
853
+ longHandLogical.add("maxBlockSize");
854
+ longHandPhysical.add("maxHeight");
855
+ longHandLogical.add("maxInlineSize");
856
+ longHandPhysical.add("maxWidth");
857
+ longHandLogical.add("minBlockSize");
858
+ longHandPhysical.add("minHeight");
859
+ longHandLogical.add("minInlineSize");
860
+ longHandPhysical.add("minWidth");
861
+ shorthandsOfShorthands.add("margin");
862
+ shorthandsOfLonghands.add("marginBlock");
863
+ longHandLogical.add("marginBlockStart");
864
+ longHandPhysical.add("marginTop");
865
+ longHandLogical.add("marginBlockEnd");
866
+ longHandPhysical.add("marginBottom");
867
+ shorthandsOfLonghands.add("marginInline");
868
+ longHandLogical.add("marginInlineStart");
869
+ longHandPhysical.add("marginLeft");
870
+ longHandLogical.add("marginInlineEnd");
871
+ longHandPhysical.add("marginRight");
872
+ longHandLogical.add("marginTrim");
873
+ shorthandsOfLonghands.add("overscrollBehavior");
874
+ longHandLogical.add("overscrollBehaviorBlock");
875
+ longHandPhysical.add("overscrollBehaviorY");
876
+ longHandLogical.add("overscrollBehaviorInline");
877
+ longHandPhysical.add("overscrollBehaviorX");
878
+ shorthandsOfShorthands.add("padding");
879
+ shorthandsOfLonghands.add("paddingBlock");
880
+ longHandLogical.add("paddingBlockStart");
881
+ longHandPhysical.add("paddingTop");
882
+ longHandLogical.add("paddingBlockEnd");
883
+ longHandPhysical.add("paddingBottom");
884
+ shorthandsOfLonghands.add("paddingInline");
885
+ longHandLogical.add("paddingInlineStart");
886
+ longHandPhysical.add("paddingLeft");
887
+ longHandLogical.add("paddingInlineEnd");
888
+ longHandPhysical.add("paddingRight");
889
+ longHandLogical.add("visibility");
890
+ longHandLogical.add("color");
891
+ longHandLogical.add("colorScheme");
892
+ longHandLogical.add("forcedColorAdjust");
893
+ longHandLogical.add("opacity");
894
+ longHandLogical.add("printColorAdjust");
895
+ shorthandsOfLonghands.add("columns");
896
+ longHandLogical.add("columnCount");
897
+ longHandLogical.add("columnWidth");
898
+ longHandLogical.add("columnFill");
899
+ longHandLogical.add("columnSpan");
900
+ shorthandsOfLonghands.add("columnRule");
901
+ longHandLogical.add("columnRuleColor");
902
+ longHandLogical.add("columnRuleStyle");
903
+ longHandLogical.add("columnRuleWidth");
904
+ longHandLogical.add("contain");
905
+ shorthandsOfLonghands.add("containIntrinsicSize");
906
+ longHandLogical.add("containIntrinsicBlockSize");
907
+ longHandLogical.add("containIntrinsicWidth");
908
+ longHandLogical.add("containIntrinsicHeight");
909
+ longHandLogical.add("containIntrinsicInlineSize");
910
+ shorthandsOfLonghands.add("container");
911
+ longHandLogical.add("containerName");
912
+ longHandLogical.add("containerType");
913
+ longHandLogical.add("contentVisibility");
914
+ longHandLogical.add("counterIncrement");
915
+ longHandLogical.add("counterReset");
916
+ longHandLogical.add("counterSet");
917
+ longHandLogical.add("display");
918
+ shorthandsOfLonghands.add("flex");
919
+ longHandLogical.add("flexBasis");
920
+ longHandLogical.add("flexGrow");
921
+ longHandLogical.add("flexShrink");
922
+ shorthandsOfLonghands.add("flexFlow");
923
+ longHandLogical.add("flexDirection");
924
+ longHandLogical.add("flexWrap");
925
+ longHandLogical.add("order");
926
+ shorthandsOfShorthands.add("font");
927
+ longHandLogical.add("fontFamily");
928
+ longHandLogical.add("fontSize");
929
+ longHandLogical.add("fontStretch");
930
+ longHandLogical.add("fontStyle");
931
+ longHandLogical.add("fontWeight");
932
+ longHandLogical.add("lineHeight");
933
+ shorthandsOfLonghands.add("fontVariant");
934
+ longHandLogical.add("fontVariantAlternates");
935
+ longHandLogical.add("fontVariantCaps");
936
+ longHandLogical.add("fontVariantEastAsian");
937
+ longHandLogical.add("fontVariantEmoji");
938
+ longHandLogical.add("fontVariantLigatures");
939
+ longHandLogical.add("fontVariantNumeric");
940
+ longHandLogical.add("fontVariantPosition");
941
+ longHandLogical.add("fontFeatureSettings");
942
+ longHandLogical.add("fontKerning");
943
+ longHandLogical.add("fontLanguageOverride");
944
+ longHandLogical.add("fontOpticalSizing");
945
+ longHandLogical.add("fontPalette");
946
+ longHandLogical.add("fontVariationSettings");
947
+ longHandLogical.add("fontSizeAdjust");
948
+ longHandLogical.add("fontSmooth");
949
+ longHandLogical.add("fontSynthesisPosition");
950
+ longHandLogical.add("fontSynthesisSmallCaps");
951
+ longHandLogical.add("fontSynthesisStyle");
952
+ longHandLogical.add("fontSynthesisWeight");
953
+ shorthandsOfLonghands.add("fontSynthesis");
954
+ longHandLogical.add("lineHeightStep");
955
+ longHandLogical.add("boxDecorationBreak");
956
+ longHandLogical.add("breakAfter");
957
+ longHandLogical.add("breakBefore");
958
+ longHandLogical.add("breakInside");
959
+ longHandLogical.add("orphans");
960
+ longHandLogical.add("widows");
961
+ longHandLogical.add("content");
962
+ longHandLogical.add("quotes");
963
+ shorthandsOfShorthands.add("grid");
964
+ longHandLogical.add("gridAutoFlow");
965
+ longHandLogical.add("gridAutoRows");
966
+ longHandLogical.add("gridAutoColumns");
967
+ shorthandsOfShorthands.add("gridTemplate");
968
+ shorthandsOfLonghands.add("gridTemplateAreas");
969
+ longHandLogical.add("gridTemplateColumns");
970
+ longHandLogical.add("gridTemplateRows");
971
+ shorthandsOfShorthands.add("gridArea");
972
+ shorthandsOfLonghands.add("gridRow");
973
+ longHandLogical.add("gridRowStart");
974
+ longHandLogical.add("gridRowEnd");
975
+ shorthandsOfLonghands.add("gridColumn");
976
+ longHandLogical.add("gridColumnStart");
977
+ longHandLogical.add("gridColumnEnd");
978
+ longHandLogical.add("alignTracks");
979
+ longHandLogical.add("justifyTracks");
980
+ longHandLogical.add("masonryAutoFlow");
981
+ longHandLogical.add("imageOrientation");
982
+ longHandLogical.add("imageRendering");
983
+ longHandLogical.add("imageResolution");
984
+ longHandLogical.add("objectFit");
985
+ longHandLogical.add("objectPosition");
986
+ longHandLogical.add("initialLetter");
987
+ longHandLogical.add("initialLetterAlign");
988
+ shorthandsOfLonghands.add("listStyle");
989
+ longHandLogical.add("listStyleImage");
990
+ longHandLogical.add("listStylePosition");
991
+ longHandLogical.add("listStyleType");
992
+ longHandLogical.add("clip");
993
+ longHandLogical.add("clipPath");
994
+ shorthandsOfLonghands.add("mask");
995
+ longHandLogical.add("maskClip");
996
+ longHandLogical.add("maskComposite");
997
+ longHandLogical.add("maskImage");
998
+ longHandLogical.add("maskMode");
999
+ longHandLogical.add("maskOrigin");
1000
+ longHandLogical.add("maskPosition");
1001
+ longHandLogical.add("maskRepeat");
1002
+ longHandLogical.add("maskSize");
1003
+ longHandLogical.add("maskType");
1004
+ shorthandsOfLonghands.add("maskBorder");
1005
+ longHandLogical.add("maskBorderMode");
1006
+ longHandLogical.add("maskBorderOutset");
1007
+ longHandLogical.add("maskBorderRepeat");
1008
+ longHandLogical.add("maskBorderSlice");
1009
+ longHandLogical.add("maskBorderSource");
1010
+ longHandLogical.add("maskBorderWidth");
1011
+ shorthandsOfShorthands.add("all");
1012
+ longHandLogical.add("textRendering");
1013
+ longHandLogical.add("zoom");
1014
+ shorthandsOfLonghands.add("offset");
1015
+ longHandLogical.add("offsetAnchor");
1016
+ longHandLogical.add("offsetDistance");
1017
+ longHandLogical.add("offsetPath");
1018
+ longHandLogical.add("offsetPosition");
1019
+ longHandLogical.add("offsetRotate");
1020
+ longHandLogical.add("WebkitBoxOrient");
1021
+ longHandLogical.add("WebkitLineClamp");
1022
+ longHandPhysical.add("lineClamp");
1023
+ longHandPhysical.add("maxLines");
1024
+ longHandLogical.add("blockOverflow");
1025
+ shorthandsOfLonghands.add("overflow");
1026
+ longHandLogical.add("overflowBlock");
1027
+ longHandPhysical.add("overflowY");
1028
+ longHandLogical.add("overflowInline");
1029
+ longHandPhysical.add("overflowX");
1030
+ longHandLogical.add("overflowClipMargin");
1031
+ longHandLogical.add("scrollGutter");
1032
+ longHandLogical.add("scrollBehavior");
1033
+ longHandLogical.add("page");
1034
+ longHandLogical.add("pageBreakAfter");
1035
+ longHandLogical.add("pageBreakBefore");
1036
+ longHandLogical.add("pageBreakInside");
1037
+ shorthandsOfShorthands.add("inset");
1038
+ shorthandsOfLonghands.add("insetBlock");
1039
+ longHandLogical.add("insetBlockStart");
1040
+ longHandPhysical.add("top");
1041
+ longHandLogical.add("insetBlockEnd");
1042
+ longHandPhysical.add("bottom");
1043
+ shorthandsOfLonghands.add("insetInline");
1044
+ longHandLogical.add("insetInlineStart");
1045
+ longHandPhysical.add("left");
1046
+ longHandLogical.add("insetInlineEnd");
1047
+ longHandPhysical.add("right");
1048
+ longHandLogical.add("clear");
1049
+ longHandLogical.add("float");
1050
+ longHandLogical.add("overlay");
1051
+ longHandLogical.add("position");
1052
+ longHandLogical.add("zIndex");
1053
+ longHandLogical.add("rubyAlign");
1054
+ longHandLogical.add("rubyMerge");
1055
+ longHandLogical.add("rubyPosition");
1056
+ longHandLogical.add("overflowAnchor");
1057
+ shorthandsOfShorthands.add("scrollMargin");
1058
+ shorthandsOfLonghands.add("scrollMarginBlock");
1059
+ longHandLogical.add("scrollMarginBlockStart");
1060
+ longHandPhysical.add("scrollMarginTop");
1061
+ longHandLogical.add("scrollMarginBlockEnd");
1062
+ longHandPhysical.add("scrollMarginBottom");
1063
+ shorthandsOfLonghands.add("scrollMarginInline");
1064
+ longHandLogical.add("scrollMarginInlineStart");
1065
+ longHandPhysical.add("scrollMarginLeft");
1066
+ longHandLogical.add("scrollMarginInlineEnd");
1067
+ longHandPhysical.add("scrollMarginRight");
1068
+ shorthandsOfShorthands.add("scrollPadding");
1069
+ shorthandsOfLonghands.add("scrollPaddingBlock");
1070
+ longHandLogical.add("scrollPaddingBlockStart");
1071
+ longHandPhysical.add("scrollPaddingTop");
1072
+ longHandLogical.add("scrollPaddingBlockEnd");
1073
+ longHandPhysical.add("scrollPaddingBottom");
1074
+ shorthandsOfLonghands.add("scrollPaddingInline");
1075
+ longHandLogical.add("scrollPaddingInlineStart");
1076
+ longHandPhysical.add("scrollPaddingLeft");
1077
+ longHandLogical.add("scrollPaddingInlineEnd");
1078
+ longHandPhysical.add("scrollPaddingRight");
1079
+ longHandLogical.add("scrollSnapAlign");
1080
+ longHandLogical.add("scrollSnapStop");
1081
+ shorthandsOfLonghands.add("scrollSnapType");
1082
+ longHandLogical.add("scrollbarColor");
1083
+ longHandLogical.add("scrollbarWidth");
1084
+ longHandLogical.add("shapeImageThreshold");
1085
+ longHandLogical.add("shapeMargin");
1086
+ longHandLogical.add("shapeOutside");
1087
+ longHandLogical.add("azimuth");
1088
+ longHandLogical.add("borderCollapse");
1089
+ longHandLogical.add("borderSpacing");
1090
+ longHandLogical.add("captionSide");
1091
+ longHandLogical.add("emptyCells");
1092
+ longHandLogical.add("tableLayout");
1093
+ longHandLogical.add("verticalAlign");
1094
+ shorthandsOfLonghands.add("textDecoration");
1095
+ longHandLogical.add("textDecorationColor");
1096
+ longHandLogical.add("textDecorationLine");
1097
+ longHandLogical.add("textDecorationSkip");
1098
+ longHandLogical.add("textDecorationSkipInk");
1099
+ longHandLogical.add("textDecorationStyle");
1100
+ longHandLogical.add("textDecorationThickness");
1101
+ shorthandsOfLonghands.add("WebkitTextStroke");
1102
+ longHandLogical.add("WebkitTextStrokeColor");
1103
+ longHandLogical.add("WebkitTextStrokeWidth");
1104
+ longHandLogical.add("WebkitTextFillColor");
1105
+ shorthandsOfLonghands.add("textEmphasis");
1106
+ longHandLogical.add("textEmphasisColor");
1107
+ longHandLogical.add("textEmphasisPosition");
1108
+ longHandLogical.add("textEmphasisStyle");
1109
+ longHandLogical.add("textShadow");
1110
+ longHandLogical.add("textUnderlineOffset");
1111
+ longHandLogical.add("textUnderlinePosition");
1112
+ longHandLogical.add("hangingPunctuation");
1113
+ longHandLogical.add("hyphenateCharacter");
1114
+ longHandLogical.add("hyphenateLimitChars");
1115
+ longHandLogical.add("hyphens");
1116
+ longHandLogical.add("letterSpacing");
1117
+ longHandLogical.add("lineBreak");
1118
+ longHandLogical.add("overflowWrap");
1119
+ longHandLogical.add("paintOrder");
1120
+ longHandLogical.add("tabSize");
1121
+ longHandLogical.add("textAlign");
1122
+ longHandLogical.add("textAlignLast");
1123
+ longHandLogical.add("textIndent");
1124
+ longHandLogical.add("textJustify");
1125
+ longHandLogical.add("textSizeAdjust");
1126
+ longHandLogical.add("textTransform");
1127
+ shorthandsOfLonghands.add("textWrap");
1128
+ longHandLogical.add("textWrapMode");
1129
+ longHandLogical.add("textWrapStyle");
1130
+ longHandLogical.add("whiteSpace");
1131
+ longHandLogical.add("whiteSpaceCollapse");
1132
+ longHandLogical.add("whiteSpaceTrim");
1133
+ longHandLogical.add("wordBreak");
1134
+ longHandLogical.add("wordSpacing");
1135
+ longHandLogical.add("wordWrap");
1136
+ longHandLogical.add("backfaceVisibility");
1137
+ longHandLogical.add("perspective");
1138
+ longHandLogical.add("perspectiveOrigin");
1139
+ longHandLogical.add("rotate");
1140
+ longHandLogical.add("scale");
1141
+ longHandLogical.add("transform");
1142
+ longHandLogical.add("transformBox");
1143
+ longHandLogical.add("transformOrigin");
1144
+ longHandLogical.add("transformStyle");
1145
+ longHandLogical.add("translate");
1146
+ shorthandsOfLonghands.add("transition");
1147
+ longHandLogical.add("transitionBehavior");
1148
+ longHandLogical.add("transitionDelay");
1149
+ longHandLogical.add("transitionDuration");
1150
+ longHandLogical.add("transitionProperty");
1151
+ longHandLogical.add("transitionTimingFunction");
1152
+ longHandLogical.add("viewTransitionName");
1153
+ longHandLogical.add("willChange");
1154
+ longHandLogical.add("direction");
1155
+ longHandLogical.add("textCombineUpright");
1156
+ longHandLogical.add("textOrientation");
1157
+ longHandLogical.add("unicodeBidi");
1158
+ longHandLogical.add("writingMode");
1159
+ longHandLogical.add("backdropFilter");
1160
+ longHandLogical.add("filter");
1161
+ longHandLogical.add("mathDepth");
1162
+ longHandLogical.add("mathShift");
1163
+ longHandLogical.add("mathStyle");
1164
+ longHandLogical.add("touchAction");
1165
+ function getPropertyPriority(key) {
1166
+ if (key === "all") return 0;
1167
+ if (key.startsWith("--")) return 1;
1168
+ if (longHandPhysical.has(key)) return 4e3;
1169
+ if (longHandLogical.has(key)) return 3e3;
1170
+ if (shorthandsOfLonghands.has(key)) return 2e3;
1171
+ if (shorthandsOfShorthands.has(key)) return 1e3;
1172
+ return 3e3;
1173
+ }
1174
+
734
1175
  // src/regex.ts
735
1176
  var createRegex = (item) => {
736
1177
  const regex2 = item.map((item2) => typeof item2 === "string" ? `^${item2}$` : item2.source).join("|");
@@ -740,8 +1181,7 @@ var createRegex = (item) => {
740
1181
  // src/serialize.ts
741
1182
  var stringifyJson = (config) => {
742
1183
  return JSON.stringify(config, (_key, value) => {
743
- if (typeof value === "function")
744
- return value.toString();
1184
+ if (typeof value === "function") return value.toString();
745
1185
  return value;
746
1186
  });
747
1187
  };
@@ -749,128 +1189,6 @@ var parseJson = (config) => {
749
1189
  return JSON.parse(config);
750
1190
  };
751
1191
 
752
- // src/shorthand-properties.ts
753
- var shorthandProperties = {
754
- animation: [
755
- "animationName",
756
- "animationDuration",
757
- "animationTimingFunction",
758
- "animationDelay",
759
- "animationIterationCount",
760
- "animationDirection",
761
- "animationFillMode",
762
- "animationPlayState"
763
- ],
764
- background: [
765
- "backgroundImage",
766
- "backgroundPosition",
767
- "backgroundSize",
768
- "backgroundRepeat",
769
- "backgroundAttachment",
770
- "backgroundOrigin",
771
- "backgroundClip",
772
- "backgroundColor"
773
- ],
774
- backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
775
- border: ["borderWidth", "borderStyle", "borderColor"],
776
- borderBlockEnd: ["borderBlockEndWidth", "borderBlockEndStyle", "borderBlockEndColor"],
777
- borderBlockStart: ["borderBlockStartWidth", "borderBlockStartStyle", "borderBlockStartColor"],
778
- borderBottom: ["borderBottomWidth", "borderBottomStyle", "borderBottomColor"],
779
- borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
780
- borderImage: ["borderImageSource", "borderImageSlice", "borderImageWidth", "borderImageOutset", "borderImageRepeat"],
781
- borderInlineEnd: ["borderInlineEndWidth", "borderInlineEndStyle", "borderInlineEndColor"],
782
- borderInlineStart: ["borderInlineStartWidth", "borderInlineStartStyle", "borderInlineStartColor"],
783
- borderLeft: ["borderLeftWidth", "borderLeftStyle", "borderLeftColor"],
784
- borderRadius: ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
785
- borderRight: ["borderRightWidth", "borderRightStyle", "borderRightColor"],
786
- borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
787
- borderTop: ["borderTopWidth", "borderTopStyle", "borderTopColor"],
788
- borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
789
- columnRule: ["columnRuleWidth", "columnRuleStyle", "columnRuleColor"],
790
- columns: ["columnWidth", "columnCount"],
791
- container: ["contain", "content"],
792
- containIntrinsicSize: ["containIntrinsicSizeInline", "containIntrinsicSizeBlock"],
793
- cue: ["cueBefore", "cueAfter"],
794
- flex: ["flexGrow", "flexShrink", "flexBasis"],
795
- flexFlow: ["flexDirection", "flexWrap"],
796
- font: [
797
- "fontStyle",
798
- "fontVariantCaps",
799
- "fontVariantEastAsian",
800
- "fontVariantLigatures",
801
- "fontVariantNumeric",
802
- "fontVariantPosition",
803
- "fontWeight",
804
- "fontStretch",
805
- "fontSize",
806
- "lineHeight",
807
- "fontFamily"
808
- ],
809
- fontSynthesis: ["fontSynthesisWeight", "fontSynthesisStyle", "fontSynthesisSmallCaps"],
810
- fontVariant: [
811
- "fontVariantCaps",
812
- "fontVariantEastAsian",
813
- "fontVariantLigatures",
814
- "fontVariantNumeric",
815
- "fontVariantPosition"
816
- ],
817
- gap: ["columnGap", "rowGap"],
818
- grid: [
819
- "gridTemplateColumns",
820
- "gridTemplateRows",
821
- "gridTemplateAreas",
822
- "gridAutoColumns",
823
- "gridAutoRows",
824
- "gridAutoFlow"
825
- ],
826
- gridArea: ["gridRowStart", "gridColumnStart", "gridRowEnd", "gridColumnEnd"],
827
- gridColumn: ["gridColumnStart", "gridColumnEnd"],
828
- gridGap: ["gridColumnGap", "gridRowGap"],
829
- gridRow: ["gridRowStart", "gridRowEnd"],
830
- gridTemplate: ["gridTemplateColumns", "gridTemplateRows", "gridTemplateAreas"],
831
- inset: ["top", "right", "bottom", "left"],
832
- listStyle: ["listStyleType", "listStylePosition", "listStyleImage"],
833
- margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
834
- mask: ["maskImage", "maskMode", "maskRepeat", "maskPosition", "maskClip", "maskOrigin", "maskSize", "maskComposite"],
835
- maskBorder: [
836
- "maskBorderSource",
837
- "maskBorderMode",
838
- "maskBorderSlice",
839
- "maskBorderWidth",
840
- "maskBorderOutset",
841
- "maskBorderRepeat"
842
- ],
843
- offset: ["offsetPosition", "offsetPath", "offsetDistance", "offsetRotate", "offsetAnchor"],
844
- outline: ["outlineWidth", "outlineStyle", "outlineColor"],
845
- overflow: ["overflowX", "overflowY"],
846
- padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
847
- pause: ["pauseBefore", "pauseAfter"],
848
- placeContent: ["alignContent", "justifyContent"],
849
- placeItems: ["alignItems", "justifyItems"],
850
- placeSelf: ["alignSelf", "justifySelf"],
851
- rest: ["restBefore", "restAfter"],
852
- scrollMargin: ["scrollMarginTop", "scrollMarginRight", "scrollMarginBottom", "scrollMarginLeft"],
853
- scrollPadding: ["scrollPaddingTop", "scrollPaddingRight", "scrollPaddingBottom", "scrollPaddingLeft"],
854
- scrollPaddingBlock: ["scrollPaddingBlockStart", "scrollPaddingBlockEnd"],
855
- scrollPaddingInline: ["scrollPaddingInlineStart", "scrollPaddingInlineEnd"],
856
- scrollSnapMargin: ["scrollSnapMarginTop", "scrollSnapMarginRight", "scrollSnapMarginBottom", "scrollSnapMarginLeft"],
857
- scrollSnapMarginBlock: ["scrollSnapMarginBlockStart", "scrollSnapMarginBlockEnd"],
858
- scrollSnapMarginInline: ["scrollSnapMarginInlineStart", "scrollSnapMarginInlineEnd"],
859
- scrollTimeline: ["scrollTimelineSource", "scrollTimelineOrientation"],
860
- textDecoration: ["textDecorationLine", "textDecorationStyle", "textDecorationColor"],
861
- textEmphasis: ["textEmphasisStyle", "textEmphasisColor"],
862
- transition: ["transitionProperty", "transitionDuration", "transitionTimingFunction", "transitionDelay"]
863
- };
864
- var longhands = Object.values(shorthandProperties).reduce((a, b) => {
865
- b.forEach((val) => a.add(val));
866
- return a;
867
- }, /* @__PURE__ */ new Set([]));
868
- function getPropertyPriority(property) {
869
- if (property === "all")
870
- return 0;
871
- return longhands.has(property) ? 2 : 1;
872
- }
873
-
874
1192
  // src/slot.ts
875
1193
  var getSlotRecipes = (recipe = {}) => {
876
1194
  const init = (slot) => ({
@@ -930,8 +1248,7 @@ function getNegativePath(path) {
930
1248
  return path.slice(0, -1).concat(`-${path.at(-1)}`);
931
1249
  }
932
1250
  function getDotPath(obj, path, fallback) {
933
- if (typeof path !== "string")
934
- return fallback;
1251
+ if (typeof path !== "string") return fallback;
935
1252
  const idx = path.indexOf(".");
936
1253
  if (idx === -1) {
937
1254
  return obj?.[path] ?? fallback;
@@ -978,8 +1295,11 @@ function mapToJson(map) {
978
1295
  }
979
1296
 
980
1297
  // src/typegen.ts
981
- function unionType(values) {
982
- return Array.from(values).map((value) => JSON.stringify(value)).join(" | ");
1298
+ function unionType(values, opts = {}) {
1299
+ const { fallback, stringify = JSON.stringify } = opts;
1300
+ const arr = Array.from(values);
1301
+ if (fallback != null && !arr.length) return fallback;
1302
+ return arr.map((v) => stringify(v)).join(" | ");
983
1303
  }
984
1304
 
985
1305
  // src/uniq.ts
@@ -1010,8 +1330,7 @@ function toPx(value = "") {
1010
1330
  return `${value}px`;
1011
1331
  }
1012
1332
  const unit = getUnit(value);
1013
- if (!unit)
1014
- return value;
1333
+ if (!unit) return value;
1015
1334
  if (unit === UNIT_PX) {
1016
1335
  return value;
1017
1336
  }
@@ -1021,8 +1340,7 @@ function toPx(value = "") {
1021
1340
  }
1022
1341
  function toEm(value = "", fontSize = BASE_FONT_SIZE) {
1023
1342
  const unit = getUnit(value);
1024
- if (!unit)
1025
- return value;
1343
+ if (!unit) return value;
1026
1344
  if (unit === UNIT_EM) {
1027
1345
  return value;
1028
1346
  }
@@ -1035,8 +1353,7 @@ function toEm(value = "", fontSize = BASE_FONT_SIZE) {
1035
1353
  }
1036
1354
  function toRem(value = "") {
1037
1355
  const unit = getUnit(value);
1038
- if (!unit)
1039
- return value;
1356
+ if (!unit) return value;
1040
1357
  if (unit === UNIT_REM) {
1041
1358
  return value;
1042
1359
  }