@pandacss/preset-base 2.0.0-beta.9 → 2.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
@@ -84,6 +84,8 @@ var conditions = {
84
84
  required: "&:is(:required, [data-required], [aria-required=true])",
85
85
  valid: "&:is(:valid, [data-valid])",
86
86
  invalid: "&:is(:invalid, [data-invalid], [aria-invalid=true])",
87
+ userValid: "&:is(:user-valid, [data-user-valid])",
88
+ userInvalid: "&:is(:user-invalid, [data-user-invalid])",
87
89
  autofill: "&:autofill",
88
90
  inRange: "&:is(:in-range, [data-in-range])",
89
91
  outOfRange: "&:is(:out-of-range, [data-outside-range])",
@@ -102,6 +104,7 @@ var conditions = {
102
104
  fullscreen: "&:is(:fullscreen, [data-fullscreen])",
103
105
  loading: "&:is([data-loading], [aria-busy=true])",
104
106
  hidden: "&:is([hidden], [data-hidden])",
107
+ inert: "&:is([inert], [data-inert])",
105
108
  current: "&:is([aria-current=true], [data-current])",
106
109
  currentPage: "&[aria-current=page]",
107
110
  currentStep: "&[aria-current=step]",
@@ -133,47 +136,13 @@ var conditions = {
133
136
  icon: "& :where(svg)",
134
137
  starting: "@starting-style",
135
138
  noscript: "@media (scripting: none)",
136
- invertedColors: "@media (inverted-colors: inverted)"
137
- };
138
-
139
- // src/global-css.ts
140
- var EMPTY = "/*-*/ /*-*/";
141
- var globalCss = {
142
- "*, ::before, ::after, ::backdrop": {
143
- "--blur": EMPTY,
144
- "--brightness": EMPTY,
145
- "--contrast": EMPTY,
146
- "--grayscale": EMPTY,
147
- "--hue-rotate": EMPTY,
148
- "--invert": EMPTY,
149
- "--saturate": EMPTY,
150
- "--sepia": EMPTY,
151
- "--drop-shadow": EMPTY,
152
- "--backdrop-blur": EMPTY,
153
- "--backdrop-brightness": EMPTY,
154
- "--backdrop-contrast": EMPTY,
155
- "--backdrop-grayscale": EMPTY,
156
- "--backdrop-hue-rotate": EMPTY,
157
- "--backdrop-invert": EMPTY,
158
- "--backdrop-opacity": EMPTY,
159
- "--backdrop-saturate": EMPTY,
160
- "--backdrop-sepia": EMPTY,
161
- "--gradient-from-position": EMPTY,
162
- "--gradient-to-position": EMPTY,
163
- "--gradient-via-position": EMPTY,
164
- "--scroll-snap-strictness": "proximity",
165
- "--border-spacing-x": 0,
166
- "--border-spacing-y": 0,
167
- "--translate-x": 0,
168
- "--translate-y": 0,
169
- "--rotate": 0,
170
- "--rotate-x": 0,
171
- "--rotate-y": 0,
172
- "--skew-x": 0,
173
- "--skew-y": 0,
174
- "--scale-x": 1,
175
- "--scale-y": 1
176
- }
139
+ invertedColors: "@media (inverted-colors: inverted)",
140
+ pointerFine: "@media (pointer: fine)",
141
+ pointerCoarse: "@media (pointer: coarse)",
142
+ pointerNone: "@media (pointer: none)",
143
+ anyPointerFine: "@media (any-pointer: fine)",
144
+ anyPointerCoarse: "@media (any-pointer: coarse)",
145
+ anyPointerNone: "@media (any-pointer: none)"
177
146
  };
178
147
 
179
148
  // src/patterns.ts
@@ -465,14 +434,14 @@ var divider = definePattern({
465
434
  thickness: "1px"
466
435
  },
467
436
  transform(props, { map }) {
468
- const { orientation, thickness, color, ...rest } = props;
437
+ const { orientation, thickness, color: color2, ...rest } = props;
469
438
  return {
470
439
  "--thickness": thickness,
471
440
  width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
472
441
  height: map(orientation, (v) => v === "horizontal" ? void 0 : "100%"),
473
442
  borderBlockEndWidth: map(orientation, (v) => v === "horizontal" ? "var(--thickness)" : void 0),
474
443
  borderInlineEndWidth: map(orientation, (v) => v === "vertical" ? "var(--thickness)" : void 0),
475
- borderColor: color,
444
+ borderColor: color2,
476
445
  ...rest
477
446
  };
478
447
  }
@@ -659,8 +628,8 @@ var background = {
659
628
  group: "Background",
660
629
  transform(value) {
661
630
  return {
662
- backgroundClip: value,
663
- WebkitBackgroundClip: value
631
+ WebkitBackgroundClip: value,
632
+ backgroundClip: value
664
633
  };
665
634
  }
666
635
  },
@@ -1148,6 +1117,14 @@ var divide = {
1148
1117
  }
1149
1118
  };
1150
1119
 
1120
+ // src/css-var.ts
1121
+ function cssVar(syntax, initialValue) {
1122
+ return initialValue === void 0 ? { syntax, inherits: false } : { syntax, inherits: false, initialValue };
1123
+ }
1124
+ function anyVar(initialValue) {
1125
+ return cssVar("*", initialValue);
1126
+ }
1127
+
1151
1128
  // src/utilities/effects.ts
1152
1129
  var effects = {
1153
1130
  opacity: {
@@ -1182,6 +1159,7 @@ var effects = {
1182
1159
  brightness: {
1183
1160
  className: "brightness",
1184
1161
  group: "Effect",
1162
+ globalVars: { "--brightness": anyVar() },
1185
1163
  transform(value) {
1186
1164
  return {
1187
1165
  "--brightness": `brightness(${value})`
@@ -1191,6 +1169,7 @@ var effects = {
1191
1169
  contrast: {
1192
1170
  className: "contrast",
1193
1171
  group: "Effect",
1172
+ globalVars: { "--contrast": anyVar() },
1194
1173
  transform(value) {
1195
1174
  return {
1196
1175
  "--contrast": `contrast(${value})`
@@ -1200,6 +1179,7 @@ var effects = {
1200
1179
  grayscale: {
1201
1180
  className: "grayscale",
1202
1181
  group: "Effect",
1182
+ globalVars: { "--grayscale": anyVar() },
1203
1183
  transform(value) {
1204
1184
  return {
1205
1185
  "--grayscale": `grayscale(${value})`
@@ -1209,6 +1189,7 @@ var effects = {
1209
1189
  hueRotate: {
1210
1190
  className: "hue-rotate",
1211
1191
  group: "Effect",
1192
+ globalVars: { "--hue-rotate": anyVar() },
1212
1193
  transform(value) {
1213
1194
  return {
1214
1195
  "--hue-rotate": `hue-rotate(${value})`
@@ -1218,6 +1199,7 @@ var effects = {
1218
1199
  invert: {
1219
1200
  className: "invert",
1220
1201
  group: "Effect",
1202
+ globalVars: { "--invert": anyVar() },
1221
1203
  transform(value) {
1222
1204
  return {
1223
1205
  "--invert": `invert(${value})`
@@ -1227,6 +1209,7 @@ var effects = {
1227
1209
  saturate: {
1228
1210
  className: "saturate",
1229
1211
  group: "Effect",
1212
+ globalVars: { "--saturate": anyVar() },
1230
1213
  transform(value) {
1231
1214
  return {
1232
1215
  "--saturate": `saturate(${value})`
@@ -1236,6 +1219,7 @@ var effects = {
1236
1219
  sepia: {
1237
1220
  className: "sepia",
1238
1221
  group: "Effect",
1222
+ globalVars: { "--sepia": anyVar() },
1239
1223
  transform(value) {
1240
1224
  return {
1241
1225
  "--sepia": `sepia(${value})`
@@ -1246,6 +1230,7 @@ var effects = {
1246
1230
  className: "drop-shadow",
1247
1231
  group: "Effect",
1248
1232
  values: "dropShadows",
1233
+ globalVars: { "--drop-shadow": anyVar() },
1249
1234
  transform(value) {
1250
1235
  return {
1251
1236
  "--drop-shadow": value
@@ -1256,6 +1241,7 @@ var effects = {
1256
1241
  className: "blur",
1257
1242
  group: "Effect",
1258
1243
  values: "blurs",
1244
+ globalVars: { "--blur": anyVar() },
1259
1245
  transform(value) {
1260
1246
  return {
1261
1247
  "--blur": `blur(${value})`
@@ -1270,8 +1256,8 @@ var effects = {
1270
1256
  },
1271
1257
  transform(value) {
1272
1258
  return {
1273
- backdropFilter: value,
1274
- WebkitBackdropFilter: value
1259
+ WebkitBackdropFilter: value,
1260
+ backdropFilter: value
1275
1261
  };
1276
1262
  }
1277
1263
  },
@@ -1279,6 +1265,7 @@ var effects = {
1279
1265
  className: "bkdp-blur",
1280
1266
  group: "Effect",
1281
1267
  values: "blurs",
1268
+ globalVars: { "--backdrop-blur": anyVar() },
1282
1269
  transform(value) {
1283
1270
  return {
1284
1271
  "--backdrop-blur": `blur(${value})`
@@ -1288,6 +1275,7 @@ var effects = {
1288
1275
  backdropBrightness: {
1289
1276
  className: "bkdp-brightness",
1290
1277
  group: "Effect",
1278
+ globalVars: { "--backdrop-brightness": anyVar() },
1291
1279
  transform(value) {
1292
1280
  return {
1293
1281
  "--backdrop-brightness": `brightness(${value})`
@@ -1297,6 +1285,7 @@ var effects = {
1297
1285
  backdropContrast: {
1298
1286
  className: "bkdp-contrast",
1299
1287
  group: "Effect",
1288
+ globalVars: { "--backdrop-contrast": anyVar() },
1300
1289
  transform(value) {
1301
1290
  return {
1302
1291
  "--backdrop-contrast": `contrast(${value})`
@@ -1306,6 +1295,7 @@ var effects = {
1306
1295
  backdropGrayscale: {
1307
1296
  className: "bkdp-grayscale",
1308
1297
  group: "Effect",
1298
+ globalVars: { "--backdrop-grayscale": anyVar() },
1309
1299
  transform(value) {
1310
1300
  return {
1311
1301
  "--backdrop-grayscale": `grayscale(${value})`
@@ -1315,6 +1305,7 @@ var effects = {
1315
1305
  backdropHueRotate: {
1316
1306
  className: "bkdp-hue-rotate",
1317
1307
  group: "Effect",
1308
+ globalVars: { "--backdrop-hue-rotate": anyVar() },
1318
1309
  transform(value) {
1319
1310
  return {
1320
1311
  "--backdrop-hue-rotate": `hue-rotate(${value})`
@@ -1324,6 +1315,7 @@ var effects = {
1324
1315
  backdropInvert: {
1325
1316
  className: "bkdp-invert",
1326
1317
  group: "Effect",
1318
+ globalVars: { "--backdrop-invert": anyVar() },
1327
1319
  transform(value) {
1328
1320
  return {
1329
1321
  "--backdrop-invert": `invert(${value})`
@@ -1333,6 +1325,7 @@ var effects = {
1333
1325
  backdropOpacity: {
1334
1326
  className: "bkdp-opacity",
1335
1327
  group: "Effect",
1328
+ globalVars: { "--backdrop-opacity": anyVar() },
1336
1329
  transform(value) {
1337
1330
  return {
1338
1331
  "--backdrop-opacity": value
@@ -1342,6 +1335,7 @@ var effects = {
1342
1335
  backdropSaturate: {
1343
1336
  className: "bkdp-saturate",
1344
1337
  group: "Effect",
1338
+ globalVars: { "--backdrop-saturate": anyVar() },
1345
1339
  transform(value) {
1346
1340
  return {
1347
1341
  "--backdrop-saturate": `saturate(${value})`
@@ -1351,6 +1345,7 @@ var effects = {
1351
1345
  backdropSepia: {
1352
1346
  className: "bkdp-sepia",
1353
1347
  group: "Effect",
1348
+ globalVars: { "--backdrop-sepia": anyVar() },
1354
1349
  transform(value) {
1355
1350
  return {
1356
1351
  "--backdrop-sepia": `sepia(${value})`
@@ -1601,6 +1596,12 @@ var focusRing = {
1601
1596
  };
1602
1597
 
1603
1598
  // src/utilities/gradient.ts
1599
+ var stopColor = () => cssVar("<color>", "#0000");
1600
+ var composed = {
1601
+ "--gradient-position": anyVar(),
1602
+ "--gradient-stops": anyVar(),
1603
+ "--gradient-via-stops": anyVar()
1604
+ };
1604
1605
  var gradientVia = createColorMixTransform("--gradient-via");
1605
1606
  var linearGradientDirectionMap = /* @__PURE__ */ new Map([
1606
1607
  ["to-t", "to top"],
@@ -1626,6 +1627,7 @@ var backgroundGradients = {
1626
1627
  shorthand: "bgGradient",
1627
1628
  className: "bg-grad",
1628
1629
  group: "Background Gradient",
1630
+ globalVars: composed,
1629
1631
  values: linearGradientValues,
1630
1632
  transform(value, { raw, token }) {
1631
1633
  const tokenValue = token(`gradients.${raw}`);
@@ -1646,6 +1648,7 @@ var backgroundGradients = {
1646
1648
  shorthand: "bgLinear",
1647
1649
  className: "bg-linear",
1648
1650
  group: "Background Gradient",
1651
+ globalVars: composed,
1649
1652
  values: linearGradientValues,
1650
1653
  transform(value, { raw, token }) {
1651
1654
  const tokenValue = token(`gradients.${raw}`);
@@ -1666,6 +1669,7 @@ var backgroundGradients = {
1666
1669
  shorthand: "bgRadial",
1667
1670
  className: "bg-radial",
1668
1671
  group: "Background Gradient",
1672
+ globalVars: composed,
1669
1673
  values: "gradients",
1670
1674
  transform(value, { raw, token }) {
1671
1675
  const tokenValue = token(`gradients.${raw}`);
@@ -1683,6 +1687,7 @@ var backgroundGradients = {
1683
1687
  shorthand: "bgConic",
1684
1688
  className: "bg-conic",
1685
1689
  group: "Background Gradient",
1690
+ globalVars: composed,
1686
1691
  transform(value) {
1687
1692
  return {
1688
1693
  "--gradient-stops": gradientStops,
@@ -1694,6 +1699,7 @@ var backgroundGradients = {
1694
1699
  textGradient: {
1695
1700
  className: "txt-grad",
1696
1701
  group: "Background Gradient",
1702
+ globalVars: composed,
1697
1703
  values: linearGradientValues,
1698
1704
  transform(value, { raw, token }) {
1699
1705
  const tokenValue = token(`gradients.${raw}`);
@@ -1723,6 +1729,7 @@ var backgroundGradients = {
1723
1729
  gradientFromPosition: {
1724
1730
  className: "grad-from-pos",
1725
1731
  group: "Background Gradient",
1732
+ globalVars: { "--gradient-from-position": cssVar("<length-percentage>", "0%") },
1726
1733
  transform(value) {
1727
1734
  return {
1728
1735
  "--gradient-from-position": value
@@ -1732,6 +1739,7 @@ var backgroundGradients = {
1732
1739
  gradientToPosition: {
1733
1740
  className: "grad-to-pos",
1734
1741
  group: "Background Gradient",
1742
+ globalVars: { "--gradient-to-position": cssVar("<length-percentage>", "100%") },
1735
1743
  transform(value) {
1736
1744
  return {
1737
1745
  "--gradient-to-position": value
@@ -1742,18 +1750,21 @@ var backgroundGradients = {
1742
1750
  className: "grad-from",
1743
1751
  values: "colors",
1744
1752
  group: "Background Gradient",
1753
+ globalVars: { "--gradient-from": stopColor() },
1745
1754
  transform: createColorMixTransform("--gradient-from")
1746
1755
  },
1747
1756
  gradientTo: {
1748
1757
  className: "grad-to",
1749
1758
  values: "colors",
1750
1759
  group: "Background Gradient",
1760
+ globalVars: { "--gradient-to": stopColor() },
1751
1761
  transform: createColorMixTransform("--gradient-to")
1752
1762
  },
1753
1763
  gradientVia: {
1754
1764
  className: "grad-via",
1755
1765
  values: "colors",
1756
1766
  group: "Background Gradient",
1767
+ globalVars: { "--gradient-via": stopColor() },
1757
1768
  transform(value, args) {
1758
1769
  const transformed = gradientVia(value, args);
1759
1770
  return {
@@ -1766,6 +1777,7 @@ var backgroundGradients = {
1766
1777
  gradientViaPosition: {
1767
1778
  className: "grad-via-pos",
1768
1779
  group: "Background Gradient",
1780
+ globalVars: { "--gradient-via-position": cssVar("<length-percentage>", "50%") },
1769
1781
  transform(value) {
1770
1782
  return {
1771
1783
  "--gradient-via-position": value
@@ -1824,6 +1836,19 @@ var helpers = {
1824
1836
  };
1825
1837
 
1826
1838
  // src/utilities/interactivity.ts
1839
+ var SCROLLBAR_COLOR = "var(--scrollbar-thumb, currentColor) var(--scrollbar-track, transparent)";
1840
+ function scrollbarColorStyles(colorVars) {
1841
+ return {
1842
+ ...colorVars,
1843
+ scrollbarColor: SCROLLBAR_COLOR,
1844
+ "&::-webkit-scrollbar-thumb": {
1845
+ backgroundColor: "var(--scrollbar-thumb, currentColor)"
1846
+ },
1847
+ "&::-webkit-scrollbar-track": {
1848
+ backgroundColor: "var(--scrollbar-track, transparent)"
1849
+ }
1850
+ };
1851
+ }
1827
1852
  var interactivity = {
1828
1853
  accentColor: {
1829
1854
  className: "ac-c",
@@ -1869,9 +1894,25 @@ var interactivity = {
1869
1894
  },
1870
1895
  scrollbarColor: {
1871
1896
  className: "scr-bar-c",
1897
+ group: "Scroll"
1898
+ },
1899
+ scrollbarThumb: {
1900
+ className: "scr-bar-th",
1901
+ values: "colors",
1902
+ group: "Scroll",
1903
+ globalVars: { "--scrollbar-thumb": cssVar("<color>") },
1904
+ transform(value, args) {
1905
+ return scrollbarColorStyles(createColorMixTransform("--scrollbar-thumb")(value, args));
1906
+ }
1907
+ },
1908
+ scrollbarTrack: {
1909
+ className: "scr-bar-tk",
1872
1910
  values: "colors",
1873
1911
  group: "Scroll",
1874
- transform: createColorMixTransform("scrollbarColor")
1912
+ globalVars: { "--scrollbar-track": cssVar("<color>") },
1913
+ transform(value, args) {
1914
+ return scrollbarColorStyles(createColorMixTransform("--scrollbar-track")(value, args));
1915
+ }
1875
1916
  },
1876
1917
  scrollbarGutter: {
1877
1918
  className: "scr-bar-g",
@@ -1879,7 +1920,6 @@ var interactivity = {
1879
1920
  },
1880
1921
  scrollbarWidth: {
1881
1922
  className: "scr-bar-w",
1882
- values: "sizes",
1883
1923
  group: "Scroll"
1884
1924
  },
1885
1925
  // Scroll Margin
@@ -2021,6 +2061,7 @@ var interactivity = {
2021
2061
  className: "scrs-strt",
2022
2062
  values: ["mandatory", "proximity"],
2023
2063
  group: "Scroll",
2064
+ globalVars: { "--scroll-snap-strictness": anyVar("proximity") },
2024
2065
  transform(value) {
2025
2066
  return {
2026
2067
  "--scroll-snap-strictness": value
@@ -2174,8 +2215,8 @@ var layout = {
2174
2215
  group: "Layout",
2175
2216
  transform(value) {
2176
2217
  return {
2177
- boxDecorationBreak: value,
2178
- WebkitBoxDecorationBreak: value
2218
+ WebkitBoxDecorationBreak: value,
2219
+ boxDecorationBreak: value
2179
2220
  };
2180
2221
  }
2181
2222
  },
@@ -2329,6 +2370,245 @@ var list = {
2329
2370
  }
2330
2371
  };
2331
2372
 
2373
+ // src/utilities/mask.ts
2374
+ var IDENTITY = "linear-gradient(#fff, #fff)";
2375
+ var maskVar = (name) => `var(--mask-${name})`;
2376
+ var LAYERS = ["linear", "radial", "conic"];
2377
+ var EDGES = ["left", "right", "bottom", "top"];
2378
+ var MASK_IMAGE = LAYERS.map(maskVar).join(", ");
2379
+ var MASK_EDGES = EDGES.map(maskVar).join(", ");
2380
+ var image = { syntax: "*", inherits: false, initialValue: IDENTITY };
2381
+ var composedList = { syntax: "*", inherits: false };
2382
+ var keyword = (initialValue) => ({ syntax: "*", inherits: false, initialValue });
2383
+ var color = (initialValue) => ({ syntax: "<color>", inherits: false, initialValue });
2384
+ var position = (initialValue) => ({
2385
+ syntax: "<length-percentage>",
2386
+ inherits: false,
2387
+ initialValue
2388
+ });
2389
+ function gradientVars(name) {
2390
+ return {
2391
+ [`--mask-${name}`]: image,
2392
+ [`--mask-${name}-from-color`]: color("black"),
2393
+ [`--mask-${name}-to-color`]: color("transparent"),
2394
+ [`--mask-${name}-from-position`]: position("0%"),
2395
+ [`--mask-${name}-to-position`]: position("100%")
2396
+ };
2397
+ }
2398
+ var maskVars = Object.assign(
2399
+ {},
2400
+ ...[...LAYERS, ...EDGES].map(gradientVars),
2401
+ ...LAYERS.map((layer) => ({ [`--mask-${layer}-stops`]: composedList })),
2402
+ {
2403
+ // `to bottom` is as valid here as `45deg`.
2404
+ "--mask-linear-position": keyword("0deg"),
2405
+ "--mask-conic-position": keyword("0deg"),
2406
+ "--mask-radial-position": keyword("center"),
2407
+ "--mask-radial-shape": keyword("ellipse"),
2408
+ "--mask-radial-size": keyword("farthest-corner"),
2409
+ "--mask-composite": keyword("intersect"),
2410
+ "--mask-composite-webkit": keyword("source-in")
2411
+ }
2412
+ );
2413
+ function cssProps(styles) {
2414
+ return styles;
2415
+ }
2416
+ function maskLayers(layers) {
2417
+ return {
2418
+ WebkitMaskImage: MASK_IMAGE,
2419
+ maskImage: MASK_IMAGE,
2420
+ WebkitMaskComposite: maskVar("composite-webkit"),
2421
+ maskComposite: maskVar("composite"),
2422
+ ...layers
2423
+ };
2424
+ }
2425
+ function stopList(name) {
2426
+ return `${maskVar(`${name}-from-color`)} ${maskVar(`${name}-from-position`)}, ${maskVar(`${name}-to-color`)} ${maskVar(`${name}-to-position`)}`;
2427
+ }
2428
+ function edgeLayers(edges) {
2429
+ const layers = { "--mask-linear": MASK_EDGES };
2430
+ for (const edge of edges) layers[`--mask-${edge}`] = `linear-gradient(to ${edge}, ${stopList(edge)})`;
2431
+ return maskLayers(layers);
2432
+ }
2433
+ var GEOMETRY = {
2434
+ linear: { fn: "linear-gradient", head: maskVar("linear-position") },
2435
+ radial: {
2436
+ fn: "radial-gradient",
2437
+ head: `${maskVar("radial-shape")} ${maskVar("radial-size")} at ${maskVar("radial-position")}`
2438
+ },
2439
+ conic: { fn: "conic-gradient", head: `from ${maskVar("conic-position")}` }
2440
+ };
2441
+ function gradientLayer(layer) {
2442
+ const { fn, head } = GEOMETRY[layer];
2443
+ return maskLayers({
2444
+ [`--mask-${layer}-stops`]: `${head}, ${stopList(layer)}`,
2445
+ [`--mask-${layer}`]: `${fn}(${maskVar(`${layer}-stops`)})`
2446
+ });
2447
+ }
2448
+ function positionStop(className, vars, wiring) {
2449
+ return {
2450
+ className,
2451
+ values: "spacing",
2452
+ group: "Mask",
2453
+ globalVars: maskVars,
2454
+ transform(value) {
2455
+ const stops = Object.fromEntries(vars.map((name) => [`--mask-${name}`, value]));
2456
+ return cssProps({ ...wiring(), ...stops });
2457
+ }
2458
+ };
2459
+ }
2460
+ function colorStop(className, vars, wiring) {
2461
+ return {
2462
+ className,
2463
+ values: "colors",
2464
+ group: "Mask",
2465
+ globalVars: maskVars,
2466
+ transform(value, args) {
2467
+ const stops = {};
2468
+ for (const name of vars) Object.assign(stops, createColorMixTransform(`--mask-${name}`)(value, args));
2469
+ return cssProps({ ...wiring(), ...stops });
2470
+ }
2471
+ };
2472
+ }
2473
+ function stopProps(prop, className, targets, wiring) {
2474
+ const vars = (suffix) => targets.map((target) => `${target}-${suffix}`);
2475
+ return {
2476
+ [`${prop}From`]: positionStop(`${className}-from`, vars("from-position"), wiring),
2477
+ [`${prop}To`]: positionStop(`${className}-to`, vars("to-position"), wiring),
2478
+ [`${prop}FromColor`]: colorStop(`${className}-from-c`, vars("from-color"), wiring),
2479
+ [`${prop}ToColor`]: colorStop(`${className}-to-c`, vars("to-color"), wiring)
2480
+ };
2481
+ }
2482
+ var EDGE_GROUPS = [
2483
+ ["Top", "t", ["top"]],
2484
+ ["Right", "r", ["right"]],
2485
+ ["Bottom", "b", ["bottom"]],
2486
+ ["Left", "l", ["left"]],
2487
+ ["X", "x", ["left", "right"]],
2488
+ ["Y", "y", ["top", "bottom"]]
2489
+ ];
2490
+ var edgeProps = Object.assign(
2491
+ {},
2492
+ ...EDGE_GROUPS.map(
2493
+ ([name, short, edges]) => stopProps(`mask${name}`, `msk-${short}`, edges, () => edgeLayers(edges))
2494
+ )
2495
+ );
2496
+ var layerProps = (layer) => stopProps(`mask${layer[0].toUpperCase()}${layer.slice(1)}`, `msk-${layer}`, [layer], () => gradientLayer(layer));
2497
+ function prefixed(prop, className) {
2498
+ const webkit = `Webkit${prop[0].toUpperCase()}${prop.slice(1)}`;
2499
+ return {
2500
+ className,
2501
+ group: "Mask",
2502
+ transform(value) {
2503
+ return cssProps({ [webkit]: value, [prop]: value });
2504
+ }
2505
+ };
2506
+ }
2507
+ var webkitMaskComposite = {
2508
+ add: "source-over",
2509
+ subtract: "source-out",
2510
+ intersect: "source-in",
2511
+ exclude: "xor"
2512
+ };
2513
+ var POSITION = {
2514
+ center: "center",
2515
+ top: "top",
2516
+ bottom: "bottom",
2517
+ left: "left",
2518
+ right: "right"
2519
+ };
2520
+ var linearDirectionMap = /* @__PURE__ */ new Map([
2521
+ ["to-t", "to top"],
2522
+ ["to-tr", "to top right"],
2523
+ ["to-r", "to right"],
2524
+ ["to-br", "to bottom right"],
2525
+ ["to-b", "to bottom"],
2526
+ ["to-bl", "to bottom left"],
2527
+ ["to-l", "to left"],
2528
+ ["to-tl", "to top left"]
2529
+ ]);
2530
+ var maskLinearValues = () => Object.fromEntries(linearDirectionMap.entries());
2531
+ function asAngle(raw, value) {
2532
+ if (/^-?\d+(\.\d+)?$/.test(raw)) return `${raw}deg`;
2533
+ return value;
2534
+ }
2535
+ var varOnly = (name, className, values) => ({
2536
+ className,
2537
+ group: "Mask",
2538
+ globalVars: maskVars,
2539
+ values,
2540
+ transform: (value) => ({ [`--mask-${name}`]: value })
2541
+ });
2542
+ var mask = {
2543
+ mask: prefixed("mask", "msk"),
2544
+ maskImage: prefixed("maskImage", "msk-i"),
2545
+ maskSize: prefixed("maskSize", "msk-s"),
2546
+ maskPosition: prefixed("maskPosition", "msk-p"),
2547
+ maskRepeat: prefixed("maskRepeat", "msk-r"),
2548
+ maskClip: prefixed("maskClip", "msk-cp"),
2549
+ maskOrigin: prefixed("maskOrigin", "msk-o"),
2550
+ maskComposite: {
2551
+ className: "msk-cmp",
2552
+ group: "Mask",
2553
+ globalVars: maskVars,
2554
+ // Via variables so class order can't decide — every fade helper emits this same pair.
2555
+ transform(value) {
2556
+ return cssProps({
2557
+ "--mask-composite": value,
2558
+ "--mask-composite-webkit": webkitMaskComposite[value] ?? value,
2559
+ WebkitMaskComposite: maskVar("composite-webkit"),
2560
+ maskComposite: maskVar("composite")
2561
+ });
2562
+ }
2563
+ },
2564
+ maskMode: { className: "msk-md", group: "Mask" },
2565
+ maskType: { className: "msk-t", group: "Mask" },
2566
+ ...edgeProps,
2567
+ maskLinear: {
2568
+ className: "msk-linear",
2569
+ group: "Mask",
2570
+ globalVars: maskVars,
2571
+ values: maskLinearValues,
2572
+ transform(value, { raw }) {
2573
+ const angle = linearDirectionMap.get(String(raw)) ?? asAngle(String(raw), value);
2574
+ return cssProps({ ...gradientLayer("linear"), "--mask-linear-position": angle });
2575
+ }
2576
+ },
2577
+ ...layerProps("linear"),
2578
+ maskRadial: {
2579
+ className: "msk-radial",
2580
+ group: "Mask",
2581
+ globalVars: maskVars,
2582
+ transform(value) {
2583
+ return cssProps({ ...gradientLayer("radial"), "--mask-radial-size": value });
2584
+ }
2585
+ },
2586
+ ...layerProps("radial"),
2587
+ maskRadialAt: varOnly("radial-position", "msk-radial-at", {
2588
+ ...POSITION,
2589
+ "top left": "top left",
2590
+ "top right": "top right",
2591
+ "bottom left": "bottom left",
2592
+ "bottom right": "bottom right"
2593
+ }),
2594
+ maskRadialSize: varOnly("radial-size", "msk-radial-sz", {
2595
+ "closest-side": "closest-side",
2596
+ "closest-corner": "closest-corner",
2597
+ "farthest-side": "farthest-side",
2598
+ "farthest-corner": "farthest-corner"
2599
+ }),
2600
+ maskRadialShape: varOnly("radial-shape", "msk-radial-shape", { circle: "circle", ellipse: "ellipse" }),
2601
+ maskConic: {
2602
+ className: "msk-conic",
2603
+ group: "Mask",
2604
+ globalVars: maskVars,
2605
+ transform(value, { raw }) {
2606
+ return cssProps({ ...gradientLayer("conic"), "--mask-conic-position": asAngle(String(raw), value) });
2607
+ }
2608
+ },
2609
+ ...layerProps("conic")
2610
+ };
2611
+
2332
2612
  // src/utilities/outline.ts
2333
2613
  var outline = {
2334
2614
  outlineWidth: {
@@ -2370,56 +2650,35 @@ var polyfill = {
2370
2650
  className: "ap",
2371
2651
  group: "Visibility",
2372
2652
  transform(value) {
2373
- return { appearance: value, WebkitAppearance: value };
2653
+ return { WebkitAppearance: value, appearance: value };
2374
2654
  }
2375
2655
  },
2376
2656
  backfaceVisibility: {
2377
2657
  className: "bfv",
2378
2658
  group: "Visibility",
2379
2659
  transform(value) {
2380
- return { backfaceVisibility: value, WebkitBackfaceVisibility: value };
2660
+ return { WebkitBackfaceVisibility: value, backfaceVisibility: value };
2381
2661
  }
2382
2662
  },
2383
2663
  clipPath: {
2384
2664
  className: "cp-path",
2385
2665
  group: "Other",
2386
2666
  transform(value) {
2387
- return { clipPath: value, WebkitClipPath: value };
2667
+ return { WebkitClipPath: value, clipPath: value };
2388
2668
  }
2389
2669
  },
2390
2670
  hyphens: {
2391
2671
  className: "hy",
2392
2672
  group: "Other",
2393
2673
  transform(value) {
2394
- return { hyphens: value, WebkitHyphens: value };
2395
- }
2396
- },
2397
- mask: {
2398
- className: "msk",
2399
- group: "Other",
2400
- transform(value) {
2401
- return { mask: value, WebkitMask: value };
2402
- }
2403
- },
2404
- maskImage: {
2405
- className: "msk-i",
2406
- group: "Other",
2407
- transform(value) {
2408
- return { maskImage: value, WebkitMaskImage: value };
2409
- }
2410
- },
2411
- maskSize: {
2412
- className: "msk-s",
2413
- group: "Other",
2414
- transform(value) {
2415
- return { maskSize: value, WebkitMaskSize: value };
2674
+ return { WebkitHyphens: value, hyphens: value };
2416
2675
  }
2417
2676
  },
2418
2677
  textSizeAdjust: {
2419
2678
  className: "txt-adj",
2420
2679
  group: "Typography",
2421
2680
  transform(value) {
2422
- return { textSizeAdjust: value, WebkitTextSizeAdjust: value };
2681
+ return { WebkitTextSizeAdjust: value, textSizeAdjust: value };
2423
2682
  }
2424
2683
  }
2425
2684
  };
@@ -2788,6 +3047,7 @@ var tables = {
2788
3047
  className: "bd-sx",
2789
3048
  values: "spacing",
2790
3049
  group: "Table",
3050
+ globalVars: { "--border-spacing-x": cssVar("<length>", "0") },
2791
3051
  transform(value) {
2792
3052
  return {
2793
3053
  "--border-spacing-x": value
@@ -2798,6 +3058,7 @@ var tables = {
2798
3058
  className: "bd-sy",
2799
3059
  values: "spacing",
2800
3060
  group: "Table",
3061
+ globalVars: { "--border-spacing-y": cssVar("<length>", "0") },
2801
3062
  transform(value) {
2802
3063
  return {
2803
3064
  "--border-spacing-y": value
@@ -2811,6 +3072,8 @@ var tables = {
2811
3072
  };
2812
3073
 
2813
3074
  // src/utilities/transforms.ts
3075
+ var length = () => cssVar("<length-percentage>", "0");
3076
+ var ROTATE_AXES = ["x", "y", "z"].map((axis) => `var(--rotate-${axis},)`).join(" ");
2814
3077
  var positiveFractions = {
2815
3078
  "1/2": "50%",
2816
3079
  "1/3": "33.333333%",
@@ -2845,18 +3108,20 @@ var transforms = {
2845
3108
  className: "rotate",
2846
3109
  group: "Transform",
2847
3110
  property: "rotate",
2848
- values: {
2849
- auto: "var(--rotate-x) var(--rotate-y)",
2850
- "auto-3d": "var(--rotate-x) var(--rotate-y) var(--rotate-z)"
3111
+ // `auto-3d` is an alias: an unset axis contributes nothing either way.
3112
+ values: { auto: "auto", "auto-3d": "auto" },
3113
+ transform(value) {
3114
+ return value === "auto" ? { transform: ROTATE_AXES } : { rotate: value };
2851
3115
  }
2852
3116
  },
2853
3117
  rotateX: {
2854
3118
  className: "rotate-x",
2855
3119
  group: "Transform",
2856
3120
  property: "rotate",
3121
+ globalVars: { "--rotate-x": anyVar() },
2857
3122
  transform(value) {
2858
3123
  return {
2859
- "--rotate-x": value
3124
+ "--rotate-x": `rotateX(${value})`
2860
3125
  };
2861
3126
  }
2862
3127
  },
@@ -2864,9 +3129,10 @@ var transforms = {
2864
3129
  className: "rotate-y",
2865
3130
  group: "Transform",
2866
3131
  property: "rotate",
3132
+ globalVars: { "--rotate-y": anyVar() },
2867
3133
  transform(value) {
2868
3134
  return {
2869
- "--rotate-y": value
3135
+ "--rotate-y": `rotateY(${value})`
2870
3136
  };
2871
3137
  }
2872
3138
  },
@@ -2874,9 +3140,10 @@ var transforms = {
2874
3140
  className: "rotate-z",
2875
3141
  group: "Transform",
2876
3142
  property: "rotate",
3143
+ globalVars: { "--rotate-z": anyVar() },
2877
3144
  transform(value) {
2878
3145
  return {
2879
- "--rotate-z": value
3146
+ "--rotate-z": `rotateZ(${value})`
2880
3147
  };
2881
3148
  }
2882
3149
  },
@@ -2891,6 +3158,7 @@ var transforms = {
2891
3158
  scaleX: {
2892
3159
  className: "scale-x",
2893
3160
  group: "Transform",
3161
+ globalVars: { "--scale-x": anyVar("1") },
2894
3162
  transform(value) {
2895
3163
  return {
2896
3164
  "--scale-x": value
@@ -2900,6 +3168,7 @@ var transforms = {
2900
3168
  scaleY: {
2901
3169
  className: "scale-y",
2902
3170
  group: "Transform",
3171
+ globalVars: { "--scale-y": anyVar("1") },
2903
3172
  transform(value) {
2904
3173
  return {
2905
3174
  "--scale-y": value
@@ -2919,6 +3188,7 @@ var transforms = {
2919
3188
  shorthand: "x",
2920
3189
  className: "translate-x",
2921
3190
  group: "Transform",
3191
+ globalVars: { "--translate-x": length() },
2922
3192
  values(theme) {
2923
3193
  return {
2924
3194
  ...theme("spacing"),
@@ -2935,6 +3205,7 @@ var transforms = {
2935
3205
  shorthand: "y",
2936
3206
  className: "translate-y",
2937
3207
  group: "Transform",
3208
+ globalVars: { "--translate-y": length() },
2938
3209
  values(theme) {
2939
3210
  return {
2940
3211
  ...theme("spacing"),
@@ -2951,11 +3222,11 @@ var transforms = {
2951
3222
  shorthand: "z",
2952
3223
  className: "translate-z",
2953
3224
  group: "Transform",
3225
+ // `<length>`, not `<length-percentage>`: the third slot of `translate` rejects a
3226
+ // percentage, and a stray one would take x and y down with it.
3227
+ globalVars: { "--translate-z": cssVar("<length>", "0") },
2954
3228
  values(theme) {
2955
- return {
2956
- ...theme("spacing"),
2957
- ...fractions
2958
- };
3229
+ return theme("spacing");
2959
3230
  },
2960
3231
  transform(value) {
2961
3232
  return {
@@ -3261,11 +3532,7 @@ var typography = {
3261
3532
  },
3262
3533
  textWrap: {
3263
3534
  className: "tw",
3264
- values: ["wrap", "balance", "nowrap"],
3265
- group: "Typography",
3266
- transform(value) {
3267
- return { textWrap: value };
3268
- }
3535
+ group: "Typography"
3269
3536
  },
3270
3537
  truncate: {
3271
3538
  className: "trunc",
@@ -3303,6 +3570,7 @@ var typography = {
3303
3570
  var utilities = Object.assign(
3304
3571
  {},
3305
3572
  layout,
3573
+ mask,
3306
3574
  display,
3307
3575
  flexGrid,
3308
3576
  spacing,
@@ -3333,9 +3601,7 @@ var preset = definePreset({
3333
3601
  name: "@pandacss/preset-base",
3334
3602
  conditions,
3335
3603
  utilities,
3336
- patterns,
3337
- // globalVars,
3338
- globalCss
3604
+ patterns
3339
3605
  });
3340
3606
  var index_default = preset;
3341
3607
  // Annotate the CommonJS export names for ESM import in node: