@pandacss/preset-base 2.0.0-beta.13 → 2.0.0-beta.15

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
@@ -57,6 +57,8 @@ var conditions = {
57
57
  required: "&:is(:required, [data-required], [aria-required=true])",
58
58
  valid: "&:is(:valid, [data-valid])",
59
59
  invalid: "&:is(:invalid, [data-invalid], [aria-invalid=true])",
60
+ userValid: "&:is(:user-valid, [data-user-valid])",
61
+ userInvalid: "&:is(:user-invalid, [data-user-invalid])",
60
62
  autofill: "&:autofill",
61
63
  inRange: "&:is(:in-range, [data-in-range])",
62
64
  outOfRange: "&:is(:out-of-range, [data-outside-range])",
@@ -75,6 +77,7 @@ var conditions = {
75
77
  fullscreen: "&:is(:fullscreen, [data-fullscreen])",
76
78
  loading: "&:is([data-loading], [aria-busy=true])",
77
79
  hidden: "&:is([hidden], [data-hidden])",
80
+ inert: "&:is([inert], [data-inert])",
78
81
  current: "&:is([aria-current=true], [data-current])",
79
82
  currentPage: "&[aria-current=page]",
80
83
  currentStep: "&[aria-current=step]",
@@ -106,47 +109,13 @@ var conditions = {
106
109
  icon: "& :where(svg)",
107
110
  starting: "@starting-style",
108
111
  noscript: "@media (scripting: none)",
109
- invertedColors: "@media (inverted-colors: inverted)"
110
- };
111
-
112
- // src/global-css.ts
113
- var EMPTY = "/*-*/ /*-*/";
114
- var globalCss = {
115
- "*, ::before, ::after, ::backdrop": {
116
- "--blur": EMPTY,
117
- "--brightness": EMPTY,
118
- "--contrast": EMPTY,
119
- "--grayscale": EMPTY,
120
- "--hue-rotate": EMPTY,
121
- "--invert": EMPTY,
122
- "--saturate": EMPTY,
123
- "--sepia": EMPTY,
124
- "--drop-shadow": EMPTY,
125
- "--backdrop-blur": EMPTY,
126
- "--backdrop-brightness": EMPTY,
127
- "--backdrop-contrast": EMPTY,
128
- "--backdrop-grayscale": EMPTY,
129
- "--backdrop-hue-rotate": EMPTY,
130
- "--backdrop-invert": EMPTY,
131
- "--backdrop-opacity": EMPTY,
132
- "--backdrop-saturate": EMPTY,
133
- "--backdrop-sepia": EMPTY,
134
- "--gradient-from-position": EMPTY,
135
- "--gradient-to-position": EMPTY,
136
- "--gradient-via-position": EMPTY,
137
- "--scroll-snap-strictness": "proximity",
138
- "--border-spacing-x": 0,
139
- "--border-spacing-y": 0,
140
- "--translate-x": 0,
141
- "--translate-y": 0,
142
- "--rotate": 0,
143
- "--rotate-x": 0,
144
- "--rotate-y": 0,
145
- "--skew-x": 0,
146
- "--skew-y": 0,
147
- "--scale-x": 1,
148
- "--scale-y": 1
149
- }
112
+ invertedColors: "@media (inverted-colors: inverted)",
113
+ pointerFine: "@media (pointer: fine)",
114
+ pointerCoarse: "@media (pointer: coarse)",
115
+ pointerNone: "@media (pointer: none)",
116
+ anyPointerFine: "@media (any-pointer: fine)",
117
+ anyPointerCoarse: "@media (any-pointer: coarse)",
118
+ anyPointerNone: "@media (any-pointer: none)"
150
119
  };
151
120
 
152
121
  // src/patterns.ts
@@ -438,14 +407,14 @@ var divider = definePattern({
438
407
  thickness: "1px"
439
408
  },
440
409
  transform(props, { map }) {
441
- const { orientation, thickness, color, ...rest } = props;
410
+ const { orientation, thickness, color: color2, ...rest } = props;
442
411
  return {
443
412
  "--thickness": thickness,
444
413
  width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
445
414
  height: map(orientation, (v) => v === "horizontal" ? void 0 : "100%"),
446
415
  borderBlockEndWidth: map(orientation, (v) => v === "horizontal" ? "var(--thickness)" : void 0),
447
416
  borderInlineEndWidth: map(orientation, (v) => v === "vertical" ? "var(--thickness)" : void 0),
448
- borderColor: color,
417
+ borderColor: color2,
449
418
  ...rest
450
419
  };
451
420
  }
@@ -632,8 +601,8 @@ var background = {
632
601
  group: "Background",
633
602
  transform(value) {
634
603
  return {
635
- backgroundClip: value,
636
- WebkitBackgroundClip: value
604
+ WebkitBackgroundClip: value,
605
+ backgroundClip: value
637
606
  };
638
607
  }
639
608
  },
@@ -1121,6 +1090,14 @@ var divide = {
1121
1090
  }
1122
1091
  };
1123
1092
 
1093
+ // src/css-var.ts
1094
+ function cssVar(syntax, initialValue) {
1095
+ return initialValue === void 0 ? { syntax, inherits: false } : { syntax, inherits: false, initialValue };
1096
+ }
1097
+ function anyVar(initialValue) {
1098
+ return cssVar("*", initialValue);
1099
+ }
1100
+
1124
1101
  // src/utilities/effects.ts
1125
1102
  var effects = {
1126
1103
  opacity: {
@@ -1155,6 +1132,7 @@ var effects = {
1155
1132
  brightness: {
1156
1133
  className: "brightness",
1157
1134
  group: "Effect",
1135
+ globalVars: { "--brightness": anyVar() },
1158
1136
  transform(value) {
1159
1137
  return {
1160
1138
  "--brightness": `brightness(${value})`
@@ -1164,6 +1142,7 @@ var effects = {
1164
1142
  contrast: {
1165
1143
  className: "contrast",
1166
1144
  group: "Effect",
1145
+ globalVars: { "--contrast": anyVar() },
1167
1146
  transform(value) {
1168
1147
  return {
1169
1148
  "--contrast": `contrast(${value})`
@@ -1173,6 +1152,7 @@ var effects = {
1173
1152
  grayscale: {
1174
1153
  className: "grayscale",
1175
1154
  group: "Effect",
1155
+ globalVars: { "--grayscale": anyVar() },
1176
1156
  transform(value) {
1177
1157
  return {
1178
1158
  "--grayscale": `grayscale(${value})`
@@ -1182,6 +1162,7 @@ var effects = {
1182
1162
  hueRotate: {
1183
1163
  className: "hue-rotate",
1184
1164
  group: "Effect",
1165
+ globalVars: { "--hue-rotate": anyVar() },
1185
1166
  transform(value) {
1186
1167
  return {
1187
1168
  "--hue-rotate": `hue-rotate(${value})`
@@ -1191,6 +1172,7 @@ var effects = {
1191
1172
  invert: {
1192
1173
  className: "invert",
1193
1174
  group: "Effect",
1175
+ globalVars: { "--invert": anyVar() },
1194
1176
  transform(value) {
1195
1177
  return {
1196
1178
  "--invert": `invert(${value})`
@@ -1200,6 +1182,7 @@ var effects = {
1200
1182
  saturate: {
1201
1183
  className: "saturate",
1202
1184
  group: "Effect",
1185
+ globalVars: { "--saturate": anyVar() },
1203
1186
  transform(value) {
1204
1187
  return {
1205
1188
  "--saturate": `saturate(${value})`
@@ -1209,6 +1192,7 @@ var effects = {
1209
1192
  sepia: {
1210
1193
  className: "sepia",
1211
1194
  group: "Effect",
1195
+ globalVars: { "--sepia": anyVar() },
1212
1196
  transform(value) {
1213
1197
  return {
1214
1198
  "--sepia": `sepia(${value})`
@@ -1219,6 +1203,7 @@ var effects = {
1219
1203
  className: "drop-shadow",
1220
1204
  group: "Effect",
1221
1205
  values: "dropShadows",
1206
+ globalVars: { "--drop-shadow": anyVar() },
1222
1207
  transform(value) {
1223
1208
  return {
1224
1209
  "--drop-shadow": value
@@ -1229,6 +1214,7 @@ var effects = {
1229
1214
  className: "blur",
1230
1215
  group: "Effect",
1231
1216
  values: "blurs",
1217
+ globalVars: { "--blur": anyVar() },
1232
1218
  transform(value) {
1233
1219
  return {
1234
1220
  "--blur": `blur(${value})`
@@ -1252,6 +1238,7 @@ var effects = {
1252
1238
  className: "bkdp-blur",
1253
1239
  group: "Effect",
1254
1240
  values: "blurs",
1241
+ globalVars: { "--backdrop-blur": anyVar() },
1255
1242
  transform(value) {
1256
1243
  return {
1257
1244
  "--backdrop-blur": `blur(${value})`
@@ -1261,6 +1248,7 @@ var effects = {
1261
1248
  backdropBrightness: {
1262
1249
  className: "bkdp-brightness",
1263
1250
  group: "Effect",
1251
+ globalVars: { "--backdrop-brightness": anyVar() },
1264
1252
  transform(value) {
1265
1253
  return {
1266
1254
  "--backdrop-brightness": `brightness(${value})`
@@ -1270,6 +1258,7 @@ var effects = {
1270
1258
  backdropContrast: {
1271
1259
  className: "bkdp-contrast",
1272
1260
  group: "Effect",
1261
+ globalVars: { "--backdrop-contrast": anyVar() },
1273
1262
  transform(value) {
1274
1263
  return {
1275
1264
  "--backdrop-contrast": `contrast(${value})`
@@ -1279,6 +1268,7 @@ var effects = {
1279
1268
  backdropGrayscale: {
1280
1269
  className: "bkdp-grayscale",
1281
1270
  group: "Effect",
1271
+ globalVars: { "--backdrop-grayscale": anyVar() },
1282
1272
  transform(value) {
1283
1273
  return {
1284
1274
  "--backdrop-grayscale": `grayscale(${value})`
@@ -1288,6 +1278,7 @@ var effects = {
1288
1278
  backdropHueRotate: {
1289
1279
  className: "bkdp-hue-rotate",
1290
1280
  group: "Effect",
1281
+ globalVars: { "--backdrop-hue-rotate": anyVar() },
1291
1282
  transform(value) {
1292
1283
  return {
1293
1284
  "--backdrop-hue-rotate": `hue-rotate(${value})`
@@ -1297,6 +1288,7 @@ var effects = {
1297
1288
  backdropInvert: {
1298
1289
  className: "bkdp-invert",
1299
1290
  group: "Effect",
1291
+ globalVars: { "--backdrop-invert": anyVar() },
1300
1292
  transform(value) {
1301
1293
  return {
1302
1294
  "--backdrop-invert": `invert(${value})`
@@ -1306,6 +1298,7 @@ var effects = {
1306
1298
  backdropOpacity: {
1307
1299
  className: "bkdp-opacity",
1308
1300
  group: "Effect",
1301
+ globalVars: { "--backdrop-opacity": anyVar() },
1309
1302
  transform(value) {
1310
1303
  return {
1311
1304
  "--backdrop-opacity": value
@@ -1315,6 +1308,7 @@ var effects = {
1315
1308
  backdropSaturate: {
1316
1309
  className: "bkdp-saturate",
1317
1310
  group: "Effect",
1311
+ globalVars: { "--backdrop-saturate": anyVar() },
1318
1312
  transform(value) {
1319
1313
  return {
1320
1314
  "--backdrop-saturate": `saturate(${value})`
@@ -1324,6 +1318,7 @@ var effects = {
1324
1318
  backdropSepia: {
1325
1319
  className: "bkdp-sepia",
1326
1320
  group: "Effect",
1321
+ globalVars: { "--backdrop-sepia": anyVar() },
1327
1322
  transform(value) {
1328
1323
  return {
1329
1324
  "--backdrop-sepia": `sepia(${value})`
@@ -1574,6 +1569,12 @@ var focusRing = {
1574
1569
  };
1575
1570
 
1576
1571
  // src/utilities/gradient.ts
1572
+ var stopColor = () => cssVar("<color>", "#0000");
1573
+ var composed = {
1574
+ "--gradient-position": anyVar(),
1575
+ "--gradient-stops": anyVar(),
1576
+ "--gradient-via-stops": anyVar()
1577
+ };
1577
1578
  var gradientVia = createColorMixTransform("--gradient-via");
1578
1579
  var linearGradientDirectionMap = /* @__PURE__ */ new Map([
1579
1580
  ["to-t", "to top"],
@@ -1599,6 +1600,7 @@ var backgroundGradients = {
1599
1600
  shorthand: "bgGradient",
1600
1601
  className: "bg-grad",
1601
1602
  group: "Background Gradient",
1603
+ globalVars: composed,
1602
1604
  values: linearGradientValues,
1603
1605
  transform(value, { raw, token }) {
1604
1606
  const tokenValue = token(`gradients.${raw}`);
@@ -1619,6 +1621,7 @@ var backgroundGradients = {
1619
1621
  shorthand: "bgLinear",
1620
1622
  className: "bg-linear",
1621
1623
  group: "Background Gradient",
1624
+ globalVars: composed,
1622
1625
  values: linearGradientValues,
1623
1626
  transform(value, { raw, token }) {
1624
1627
  const tokenValue = token(`gradients.${raw}`);
@@ -1639,6 +1642,7 @@ var backgroundGradients = {
1639
1642
  shorthand: "bgRadial",
1640
1643
  className: "bg-radial",
1641
1644
  group: "Background Gradient",
1645
+ globalVars: composed,
1642
1646
  values: "gradients",
1643
1647
  transform(value, { raw, token }) {
1644
1648
  const tokenValue = token(`gradients.${raw}`);
@@ -1656,6 +1660,7 @@ var backgroundGradients = {
1656
1660
  shorthand: "bgConic",
1657
1661
  className: "bg-conic",
1658
1662
  group: "Background Gradient",
1663
+ globalVars: composed,
1659
1664
  transform(value) {
1660
1665
  return {
1661
1666
  "--gradient-stops": gradientStops,
@@ -1667,6 +1672,7 @@ var backgroundGradients = {
1667
1672
  textGradient: {
1668
1673
  className: "txt-grad",
1669
1674
  group: "Background Gradient",
1675
+ globalVars: composed,
1670
1676
  values: linearGradientValues,
1671
1677
  transform(value, { raw, token }) {
1672
1678
  const tokenValue = token(`gradients.${raw}`);
@@ -1696,6 +1702,7 @@ var backgroundGradients = {
1696
1702
  gradientFromPosition: {
1697
1703
  className: "grad-from-pos",
1698
1704
  group: "Background Gradient",
1705
+ globalVars: { "--gradient-from-position": cssVar("<length-percentage>", "0%") },
1699
1706
  transform(value) {
1700
1707
  return {
1701
1708
  "--gradient-from-position": value
@@ -1705,6 +1712,7 @@ var backgroundGradients = {
1705
1712
  gradientToPosition: {
1706
1713
  className: "grad-to-pos",
1707
1714
  group: "Background Gradient",
1715
+ globalVars: { "--gradient-to-position": cssVar("<length-percentage>", "100%") },
1708
1716
  transform(value) {
1709
1717
  return {
1710
1718
  "--gradient-to-position": value
@@ -1715,18 +1723,21 @@ var backgroundGradients = {
1715
1723
  className: "grad-from",
1716
1724
  values: "colors",
1717
1725
  group: "Background Gradient",
1726
+ globalVars: { "--gradient-from": stopColor() },
1718
1727
  transform: createColorMixTransform("--gradient-from")
1719
1728
  },
1720
1729
  gradientTo: {
1721
1730
  className: "grad-to",
1722
1731
  values: "colors",
1723
1732
  group: "Background Gradient",
1733
+ globalVars: { "--gradient-to": stopColor() },
1724
1734
  transform: createColorMixTransform("--gradient-to")
1725
1735
  },
1726
1736
  gradientVia: {
1727
1737
  className: "grad-via",
1728
1738
  values: "colors",
1729
1739
  group: "Background Gradient",
1740
+ globalVars: { "--gradient-via": stopColor() },
1730
1741
  transform(value, args) {
1731
1742
  const transformed = gradientVia(value, args);
1732
1743
  return {
@@ -1739,6 +1750,7 @@ var backgroundGradients = {
1739
1750
  gradientViaPosition: {
1740
1751
  className: "grad-via-pos",
1741
1752
  group: "Background Gradient",
1753
+ globalVars: { "--gradient-via-position": cssVar("<length-percentage>", "50%") },
1742
1754
  transform(value) {
1743
1755
  return {
1744
1756
  "--gradient-via-position": value
@@ -1797,6 +1809,19 @@ var helpers = {
1797
1809
  };
1798
1810
 
1799
1811
  // src/utilities/interactivity.ts
1812
+ var SCROLLBAR_COLOR = "var(--scrollbar-thumb, currentColor) var(--scrollbar-track, transparent)";
1813
+ function scrollbarColorStyles(colorVars) {
1814
+ return {
1815
+ ...colorVars,
1816
+ scrollbarColor: SCROLLBAR_COLOR,
1817
+ "&::-webkit-scrollbar-thumb": {
1818
+ backgroundColor: "var(--scrollbar-thumb, currentColor)"
1819
+ },
1820
+ "&::-webkit-scrollbar-track": {
1821
+ backgroundColor: "var(--scrollbar-track, transparent)"
1822
+ }
1823
+ };
1824
+ }
1800
1825
  var interactivity = {
1801
1826
  accentColor: {
1802
1827
  className: "ac-c",
@@ -1842,9 +1867,25 @@ var interactivity = {
1842
1867
  },
1843
1868
  scrollbarColor: {
1844
1869
  className: "scr-bar-c",
1870
+ group: "Scroll"
1871
+ },
1872
+ scrollbarThumb: {
1873
+ className: "scr-bar-th",
1874
+ values: "colors",
1875
+ group: "Scroll",
1876
+ globalVars: { "--scrollbar-thumb": cssVar("<color>") },
1877
+ transform(value, args) {
1878
+ return scrollbarColorStyles(createColorMixTransform("--scrollbar-thumb")(value, args));
1879
+ }
1880
+ },
1881
+ scrollbarTrack: {
1882
+ className: "scr-bar-tk",
1845
1883
  values: "colors",
1846
1884
  group: "Scroll",
1847
- transform: createColorMixTransform("scrollbarColor")
1885
+ globalVars: { "--scrollbar-track": cssVar("<color>") },
1886
+ transform(value, args) {
1887
+ return scrollbarColorStyles(createColorMixTransform("--scrollbar-track")(value, args));
1888
+ }
1848
1889
  },
1849
1890
  scrollbarGutter: {
1850
1891
  className: "scr-bar-g",
@@ -1852,7 +1893,6 @@ var interactivity = {
1852
1893
  },
1853
1894
  scrollbarWidth: {
1854
1895
  className: "scr-bar-w",
1855
- values: "sizes",
1856
1896
  group: "Scroll"
1857
1897
  },
1858
1898
  // Scroll Margin
@@ -1994,6 +2034,7 @@ var interactivity = {
1994
2034
  className: "scrs-strt",
1995
2035
  values: ["mandatory", "proximity"],
1996
2036
  group: "Scroll",
2037
+ globalVars: { "--scroll-snap-strictness": anyVar("proximity") },
1997
2038
  transform(value) {
1998
2039
  return {
1999
2040
  "--scroll-snap-strictness": value
@@ -2147,8 +2188,8 @@ var layout = {
2147
2188
  group: "Layout",
2148
2189
  transform(value) {
2149
2190
  return {
2150
- boxDecorationBreak: value,
2151
- WebkitBoxDecorationBreak: value
2191
+ WebkitBoxDecorationBreak: value,
2192
+ boxDecorationBreak: value
2152
2193
  };
2153
2194
  }
2154
2195
  },
@@ -2302,6 +2343,245 @@ var list = {
2302
2343
  }
2303
2344
  };
2304
2345
 
2346
+ // src/utilities/mask.ts
2347
+ var IDENTITY = "linear-gradient(#fff, #fff)";
2348
+ var maskVar = (name) => `var(--mask-${name})`;
2349
+ var LAYERS = ["linear", "radial", "conic"];
2350
+ var EDGES = ["left", "right", "bottom", "top"];
2351
+ var MASK_IMAGE = LAYERS.map(maskVar).join(", ");
2352
+ var MASK_EDGES = EDGES.map(maskVar).join(", ");
2353
+ var image = { syntax: "*", inherits: false, initialValue: IDENTITY };
2354
+ var composedList = { syntax: "*", inherits: false };
2355
+ var keyword = (initialValue) => ({ syntax: "*", inherits: false, initialValue });
2356
+ var color = (initialValue) => ({ syntax: "<color>", inherits: false, initialValue });
2357
+ var position = (initialValue) => ({
2358
+ syntax: "<length-percentage>",
2359
+ inherits: false,
2360
+ initialValue
2361
+ });
2362
+ function gradientVars(name) {
2363
+ return {
2364
+ [`--mask-${name}`]: image,
2365
+ [`--mask-${name}-from-color`]: color("black"),
2366
+ [`--mask-${name}-to-color`]: color("transparent"),
2367
+ [`--mask-${name}-from-position`]: position("0%"),
2368
+ [`--mask-${name}-to-position`]: position("100%")
2369
+ };
2370
+ }
2371
+ var maskVars = Object.assign(
2372
+ {},
2373
+ ...[...LAYERS, ...EDGES].map(gradientVars),
2374
+ ...LAYERS.map((layer) => ({ [`--mask-${layer}-stops`]: composedList })),
2375
+ {
2376
+ // `to bottom` is as valid here as `45deg`.
2377
+ "--mask-linear-position": keyword("0deg"),
2378
+ "--mask-conic-position": keyword("0deg"),
2379
+ "--mask-radial-position": keyword("center"),
2380
+ "--mask-radial-shape": keyword("ellipse"),
2381
+ "--mask-radial-size": keyword("farthest-corner"),
2382
+ "--mask-composite": keyword("intersect"),
2383
+ "--mask-composite-webkit": keyword("source-in")
2384
+ }
2385
+ );
2386
+ function cssProps(styles) {
2387
+ return styles;
2388
+ }
2389
+ function maskLayers(layers) {
2390
+ return {
2391
+ WebkitMaskImage: MASK_IMAGE,
2392
+ maskImage: MASK_IMAGE,
2393
+ WebkitMaskComposite: maskVar("composite-webkit"),
2394
+ maskComposite: maskVar("composite"),
2395
+ ...layers
2396
+ };
2397
+ }
2398
+ function stopList(name) {
2399
+ return `${maskVar(`${name}-from-color`)} ${maskVar(`${name}-from-position`)}, ${maskVar(`${name}-to-color`)} ${maskVar(`${name}-to-position`)}`;
2400
+ }
2401
+ function edgeLayers(edges) {
2402
+ const layers = { "--mask-linear": MASK_EDGES };
2403
+ for (const edge of edges) layers[`--mask-${edge}`] = `linear-gradient(to ${edge}, ${stopList(edge)})`;
2404
+ return maskLayers(layers);
2405
+ }
2406
+ var GEOMETRY = {
2407
+ linear: { fn: "linear-gradient", head: maskVar("linear-position") },
2408
+ radial: {
2409
+ fn: "radial-gradient",
2410
+ head: `${maskVar("radial-shape")} ${maskVar("radial-size")} at ${maskVar("radial-position")}`
2411
+ },
2412
+ conic: { fn: "conic-gradient", head: `from ${maskVar("conic-position")}` }
2413
+ };
2414
+ function gradientLayer(layer) {
2415
+ const { fn, head } = GEOMETRY[layer];
2416
+ return maskLayers({
2417
+ [`--mask-${layer}-stops`]: `${head}, ${stopList(layer)}`,
2418
+ [`--mask-${layer}`]: `${fn}(${maskVar(`${layer}-stops`)})`
2419
+ });
2420
+ }
2421
+ function positionStop(className, vars, wiring) {
2422
+ return {
2423
+ className,
2424
+ values: "spacing",
2425
+ group: "Mask",
2426
+ globalVars: maskVars,
2427
+ transform(value) {
2428
+ const stops = Object.fromEntries(vars.map((name) => [`--mask-${name}`, value]));
2429
+ return cssProps({ ...wiring(), ...stops });
2430
+ }
2431
+ };
2432
+ }
2433
+ function colorStop(className, vars, wiring) {
2434
+ return {
2435
+ className,
2436
+ values: "colors",
2437
+ group: "Mask",
2438
+ globalVars: maskVars,
2439
+ transform(value, args) {
2440
+ const stops = {};
2441
+ for (const name of vars) Object.assign(stops, createColorMixTransform(`--mask-${name}`)(value, args));
2442
+ return cssProps({ ...wiring(), ...stops });
2443
+ }
2444
+ };
2445
+ }
2446
+ function stopProps(prop, className, targets, wiring) {
2447
+ const vars = (suffix) => targets.map((target) => `${target}-${suffix}`);
2448
+ return {
2449
+ [`${prop}From`]: positionStop(`${className}-from`, vars("from-position"), wiring),
2450
+ [`${prop}To`]: positionStop(`${className}-to`, vars("to-position"), wiring),
2451
+ [`${prop}FromColor`]: colorStop(`${className}-from-c`, vars("from-color"), wiring),
2452
+ [`${prop}ToColor`]: colorStop(`${className}-to-c`, vars("to-color"), wiring)
2453
+ };
2454
+ }
2455
+ var EDGE_GROUPS = [
2456
+ ["Top", "t", ["top"]],
2457
+ ["Right", "r", ["right"]],
2458
+ ["Bottom", "b", ["bottom"]],
2459
+ ["Left", "l", ["left"]],
2460
+ ["X", "x", ["left", "right"]],
2461
+ ["Y", "y", ["top", "bottom"]]
2462
+ ];
2463
+ var edgeProps = Object.assign(
2464
+ {},
2465
+ ...EDGE_GROUPS.map(
2466
+ ([name, short, edges]) => stopProps(`mask${name}`, `msk-${short}`, edges, () => edgeLayers(edges))
2467
+ )
2468
+ );
2469
+ var layerProps = (layer) => stopProps(`mask${layer[0].toUpperCase()}${layer.slice(1)}`, `msk-${layer}`, [layer], () => gradientLayer(layer));
2470
+ function prefixed(prop, className) {
2471
+ const webkit = `Webkit${prop[0].toUpperCase()}${prop.slice(1)}`;
2472
+ return {
2473
+ className,
2474
+ group: "Mask",
2475
+ transform(value) {
2476
+ return cssProps({ [webkit]: value, [prop]: value });
2477
+ }
2478
+ };
2479
+ }
2480
+ var webkitMaskComposite = {
2481
+ add: "source-over",
2482
+ subtract: "source-out",
2483
+ intersect: "source-in",
2484
+ exclude: "xor"
2485
+ };
2486
+ var POSITION = {
2487
+ center: "center",
2488
+ top: "top",
2489
+ bottom: "bottom",
2490
+ left: "left",
2491
+ right: "right"
2492
+ };
2493
+ var linearDirectionMap = /* @__PURE__ */ new Map([
2494
+ ["to-t", "to top"],
2495
+ ["to-tr", "to top right"],
2496
+ ["to-r", "to right"],
2497
+ ["to-br", "to bottom right"],
2498
+ ["to-b", "to bottom"],
2499
+ ["to-bl", "to bottom left"],
2500
+ ["to-l", "to left"],
2501
+ ["to-tl", "to top left"]
2502
+ ]);
2503
+ var maskLinearValues = () => Object.fromEntries(linearDirectionMap.entries());
2504
+ function asAngle(raw, value) {
2505
+ if (/^-?\d+(\.\d+)?$/.test(raw)) return `${raw}deg`;
2506
+ return value;
2507
+ }
2508
+ var varOnly = (name, className, values) => ({
2509
+ className,
2510
+ group: "Mask",
2511
+ globalVars: maskVars,
2512
+ values,
2513
+ transform: (value) => ({ [`--mask-${name}`]: value })
2514
+ });
2515
+ var mask = {
2516
+ mask: prefixed("mask", "msk"),
2517
+ maskImage: prefixed("maskImage", "msk-i"),
2518
+ maskSize: prefixed("maskSize", "msk-s"),
2519
+ maskPosition: prefixed("maskPosition", "msk-p"),
2520
+ maskRepeat: prefixed("maskRepeat", "msk-r"),
2521
+ maskClip: prefixed("maskClip", "msk-cp"),
2522
+ maskOrigin: prefixed("maskOrigin", "msk-o"),
2523
+ maskComposite: {
2524
+ className: "msk-cmp",
2525
+ group: "Mask",
2526
+ globalVars: maskVars,
2527
+ // Via variables so class order can't decide — every fade helper emits this same pair.
2528
+ transform(value) {
2529
+ return cssProps({
2530
+ "--mask-composite": value,
2531
+ "--mask-composite-webkit": webkitMaskComposite[value] ?? value,
2532
+ WebkitMaskComposite: maskVar("composite-webkit"),
2533
+ maskComposite: maskVar("composite")
2534
+ });
2535
+ }
2536
+ },
2537
+ maskMode: { className: "msk-md", group: "Mask" },
2538
+ maskType: { className: "msk-t", group: "Mask" },
2539
+ ...edgeProps,
2540
+ maskLinear: {
2541
+ className: "msk-linear",
2542
+ group: "Mask",
2543
+ globalVars: maskVars,
2544
+ values: maskLinearValues,
2545
+ transform(value, { raw }) {
2546
+ const angle = linearDirectionMap.get(String(raw)) ?? asAngle(String(raw), value);
2547
+ return cssProps({ ...gradientLayer("linear"), "--mask-linear-position": angle });
2548
+ }
2549
+ },
2550
+ ...layerProps("linear"),
2551
+ maskRadial: {
2552
+ className: "msk-radial",
2553
+ group: "Mask",
2554
+ globalVars: maskVars,
2555
+ transform(value) {
2556
+ return cssProps({ ...gradientLayer("radial"), "--mask-radial-size": value });
2557
+ }
2558
+ },
2559
+ ...layerProps("radial"),
2560
+ maskRadialAt: varOnly("radial-position", "msk-radial-at", {
2561
+ ...POSITION,
2562
+ "top left": "top left",
2563
+ "top right": "top right",
2564
+ "bottom left": "bottom left",
2565
+ "bottom right": "bottom right"
2566
+ }),
2567
+ maskRadialSize: varOnly("radial-size", "msk-radial-sz", {
2568
+ "closest-side": "closest-side",
2569
+ "closest-corner": "closest-corner",
2570
+ "farthest-side": "farthest-side",
2571
+ "farthest-corner": "farthest-corner"
2572
+ }),
2573
+ maskRadialShape: varOnly("radial-shape", "msk-radial-shape", { circle: "circle", ellipse: "ellipse" }),
2574
+ maskConic: {
2575
+ className: "msk-conic",
2576
+ group: "Mask",
2577
+ globalVars: maskVars,
2578
+ transform(value, { raw }) {
2579
+ return cssProps({ ...gradientLayer("conic"), "--mask-conic-position": asAngle(String(raw), value) });
2580
+ }
2581
+ },
2582
+ ...layerProps("conic")
2583
+ };
2584
+
2305
2585
  // src/utilities/outline.ts
2306
2586
  var outline = {
2307
2587
  outlineWidth: {
@@ -2343,56 +2623,35 @@ var polyfill = {
2343
2623
  className: "ap",
2344
2624
  group: "Visibility",
2345
2625
  transform(value) {
2346
- return { appearance: value, WebkitAppearance: value };
2626
+ return { WebkitAppearance: value, appearance: value };
2347
2627
  }
2348
2628
  },
2349
2629
  backfaceVisibility: {
2350
2630
  className: "bfv",
2351
2631
  group: "Visibility",
2352
2632
  transform(value) {
2353
- return { backfaceVisibility: value, WebkitBackfaceVisibility: value };
2633
+ return { WebkitBackfaceVisibility: value, backfaceVisibility: value };
2354
2634
  }
2355
2635
  },
2356
2636
  clipPath: {
2357
2637
  className: "cp-path",
2358
2638
  group: "Other",
2359
2639
  transform(value) {
2360
- return { clipPath: value, WebkitClipPath: value };
2640
+ return { WebkitClipPath: value, clipPath: value };
2361
2641
  }
2362
2642
  },
2363
2643
  hyphens: {
2364
2644
  className: "hy",
2365
2645
  group: "Other",
2366
2646
  transform(value) {
2367
- return { hyphens: value, WebkitHyphens: value };
2368
- }
2369
- },
2370
- mask: {
2371
- className: "msk",
2372
- group: "Other",
2373
- transform(value) {
2374
- return { mask: value, WebkitMask: value };
2375
- }
2376
- },
2377
- maskImage: {
2378
- className: "msk-i",
2379
- group: "Other",
2380
- transform(value) {
2381
- return { maskImage: value, WebkitMaskImage: value };
2382
- }
2383
- },
2384
- maskSize: {
2385
- className: "msk-s",
2386
- group: "Other",
2387
- transform(value) {
2388
- return { maskSize: value, WebkitMaskSize: value };
2647
+ return { WebkitHyphens: value, hyphens: value };
2389
2648
  }
2390
2649
  },
2391
2650
  textSizeAdjust: {
2392
2651
  className: "txt-adj",
2393
2652
  group: "Typography",
2394
2653
  transform(value) {
2395
- return { textSizeAdjust: value, WebkitTextSizeAdjust: value };
2654
+ return { WebkitTextSizeAdjust: value, textSizeAdjust: value };
2396
2655
  }
2397
2656
  }
2398
2657
  };
@@ -2761,6 +3020,7 @@ var tables = {
2761
3020
  className: "bd-sx",
2762
3021
  values: "spacing",
2763
3022
  group: "Table",
3023
+ globalVars: { "--border-spacing-x": cssVar("<length>", "0") },
2764
3024
  transform(value) {
2765
3025
  return {
2766
3026
  "--border-spacing-x": value
@@ -2771,6 +3031,7 @@ var tables = {
2771
3031
  className: "bd-sy",
2772
3032
  values: "spacing",
2773
3033
  group: "Table",
3034
+ globalVars: { "--border-spacing-y": cssVar("<length>", "0") },
2774
3035
  transform(value) {
2775
3036
  return {
2776
3037
  "--border-spacing-y": value
@@ -2784,6 +3045,8 @@ var tables = {
2784
3045
  };
2785
3046
 
2786
3047
  // src/utilities/transforms.ts
3048
+ var length = () => cssVar("<length-percentage>", "0");
3049
+ var ROTATE_AXES = ["x", "y", "z"].map((axis) => `var(--rotate-${axis},)`).join(" ");
2787
3050
  var positiveFractions = {
2788
3051
  "1/2": "50%",
2789
3052
  "1/3": "33.333333%",
@@ -2818,18 +3081,20 @@ var transforms = {
2818
3081
  className: "rotate",
2819
3082
  group: "Transform",
2820
3083
  property: "rotate",
2821
- values: {
2822
- auto: "var(--rotate-x) var(--rotate-y)",
2823
- "auto-3d": "var(--rotate-x) var(--rotate-y) var(--rotate-z)"
3084
+ // `auto-3d` is an alias: an unset axis contributes nothing either way.
3085
+ values: { auto: "auto", "auto-3d": "auto" },
3086
+ transform(value) {
3087
+ return value === "auto" ? { transform: ROTATE_AXES } : { rotate: value };
2824
3088
  }
2825
3089
  },
2826
3090
  rotateX: {
2827
3091
  className: "rotate-x",
2828
3092
  group: "Transform",
2829
3093
  property: "rotate",
3094
+ globalVars: { "--rotate-x": anyVar() },
2830
3095
  transform(value) {
2831
3096
  return {
2832
- "--rotate-x": value
3097
+ "--rotate-x": `rotateX(${value})`
2833
3098
  };
2834
3099
  }
2835
3100
  },
@@ -2837,9 +3102,10 @@ var transforms = {
2837
3102
  className: "rotate-y",
2838
3103
  group: "Transform",
2839
3104
  property: "rotate",
3105
+ globalVars: { "--rotate-y": anyVar() },
2840
3106
  transform(value) {
2841
3107
  return {
2842
- "--rotate-y": value
3108
+ "--rotate-y": `rotateY(${value})`
2843
3109
  };
2844
3110
  }
2845
3111
  },
@@ -2847,9 +3113,10 @@ var transforms = {
2847
3113
  className: "rotate-z",
2848
3114
  group: "Transform",
2849
3115
  property: "rotate",
3116
+ globalVars: { "--rotate-z": anyVar() },
2850
3117
  transform(value) {
2851
3118
  return {
2852
- "--rotate-z": value
3119
+ "--rotate-z": `rotateZ(${value})`
2853
3120
  };
2854
3121
  }
2855
3122
  },
@@ -2864,6 +3131,7 @@ var transforms = {
2864
3131
  scaleX: {
2865
3132
  className: "scale-x",
2866
3133
  group: "Transform",
3134
+ globalVars: { "--scale-x": anyVar("1") },
2867
3135
  transform(value) {
2868
3136
  return {
2869
3137
  "--scale-x": value
@@ -2873,6 +3141,7 @@ var transforms = {
2873
3141
  scaleY: {
2874
3142
  className: "scale-y",
2875
3143
  group: "Transform",
3144
+ globalVars: { "--scale-y": anyVar("1") },
2876
3145
  transform(value) {
2877
3146
  return {
2878
3147
  "--scale-y": value
@@ -2892,6 +3161,7 @@ var transforms = {
2892
3161
  shorthand: "x",
2893
3162
  className: "translate-x",
2894
3163
  group: "Transform",
3164
+ globalVars: { "--translate-x": length() },
2895
3165
  values(theme) {
2896
3166
  return {
2897
3167
  ...theme("spacing"),
@@ -2908,6 +3178,7 @@ var transforms = {
2908
3178
  shorthand: "y",
2909
3179
  className: "translate-y",
2910
3180
  group: "Transform",
3181
+ globalVars: { "--translate-y": length() },
2911
3182
  values(theme) {
2912
3183
  return {
2913
3184
  ...theme("spacing"),
@@ -2924,11 +3195,11 @@ var transforms = {
2924
3195
  shorthand: "z",
2925
3196
  className: "translate-z",
2926
3197
  group: "Transform",
3198
+ // `<length>`, not `<length-percentage>`: the third slot of `translate` rejects a
3199
+ // percentage, and a stray one would take x and y down with it.
3200
+ globalVars: { "--translate-z": cssVar("<length>", "0") },
2927
3201
  values(theme) {
2928
- return {
2929
- ...theme("spacing"),
2930
- ...fractions
2931
- };
3202
+ return theme("spacing");
2932
3203
  },
2933
3204
  transform(value) {
2934
3205
  return {
@@ -3234,11 +3505,7 @@ var typography = {
3234
3505
  },
3235
3506
  textWrap: {
3236
3507
  className: "tw",
3237
- values: ["wrap", "balance", "nowrap"],
3238
- group: "Typography",
3239
- transform(value) {
3240
- return { textWrap: value };
3241
- }
3508
+ group: "Typography"
3242
3509
  },
3243
3510
  truncate: {
3244
3511
  className: "trunc",
@@ -3276,6 +3543,7 @@ var typography = {
3276
3543
  var utilities = Object.assign(
3277
3544
  {},
3278
3545
  layout,
3546
+ mask,
3279
3547
  display,
3280
3548
  flexGrid,
3281
3549
  spacing,
@@ -3306,9 +3574,7 @@ var preset = definePreset({
3306
3574
  name: "@pandacss/preset-base",
3307
3575
  conditions,
3308
3576
  utilities,
3309
- patterns,
3310
- // globalVars,
3311
- globalCss
3577
+ patterns
3312
3578
  });
3313
3579
  var index_default = preset;
3314
3580
  export {