@pandacss/preset-base 0.54.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -108,6 +108,8 @@ declare const preset: {
108
108
  vertical: string;
109
109
  icon: string;
110
110
  starting: string;
111
+ noscript: string;
112
+ invertedColors: string;
111
113
  };
112
114
  utilities: _pandacss_types.UtilityConfig;
113
115
  patterns: {
package/dist/index.d.ts CHANGED
@@ -108,6 +108,8 @@ declare const preset: {
108
108
  vertical: string;
109
109
  icon: string;
110
110
  starting: string;
111
+ noscript: string;
112
+ invertedColors: string;
111
113
  };
112
114
  utilities: _pandacss_types.UtilityConfig;
113
115
  patterns: {
package/dist/index.js CHANGED
@@ -18,12 +18,12 @@ 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, {
23
- default: () => src_default,
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ default: () => index_default,
24
24
  preset: () => preset
25
25
  });
26
- module.exports = __toCommonJS(src_exports);
26
+ module.exports = __toCommonJS(index_exports);
27
27
 
28
28
  // src/conditions.ts
29
29
  var conditions = {
@@ -49,7 +49,7 @@ var conditions = {
49
49
  after: "&::after",
50
50
  firstLetter: "&::first-letter",
51
51
  firstLine: "&::first-line",
52
- marker: "&::marker",
52
+ marker: "&:is(::marker, ::-webkit-details-marker)",
53
53
  selection: "&::selection",
54
54
  file: "&::file-selector-button",
55
55
  backdrop: "&::backdrop",
@@ -97,7 +97,7 @@ var conditions = {
97
97
  atValue: "&[data-state=at-value]",
98
98
  default: "&:default",
99
99
  optional: "&:optional",
100
- open: '&:is([open], [data-open], [data-state="open"])',
100
+ open: '&:is([open], [data-open], [data-state="open"], :popover-open)',
101
101
  closed: '&:is([closed], [data-closed], [data-state="closed"])',
102
102
  fullscreen: "&:is(:fullscreen, [data-fullscreen])",
103
103
  loading: "&:is([data-loading], [aria-busy=true])",
@@ -123,15 +123,17 @@ var conditions = {
123
123
  highContrast: "@media (forced-colors: active)",
124
124
  lessContrast: "@media (prefers-contrast: less)",
125
125
  moreContrast: "@media (prefers-contrast: more)",
126
- ltr: "[dir=ltr] &",
127
- rtl: "[dir=rtl] &",
126
+ ltr: ":where([dir=ltr], :dir(ltr)) &",
127
+ rtl: ":where([dir=rtl], :dir(rtl)) &",
128
128
  scrollbar: "&::-webkit-scrollbar",
129
129
  scrollbarThumb: "&::-webkit-scrollbar-thumb",
130
130
  scrollbarTrack: "&::-webkit-scrollbar-track",
131
131
  horizontal: "&[data-orientation=horizontal]",
132
132
  vertical: "&[data-orientation=vertical]",
133
133
  icon: "& :where(svg)",
134
- starting: "@starting-style"
134
+ starting: "@starting-style",
135
+ noscript: "@media (scripting: none)",
136
+ invertedColors: "@media (inverted-colors: inverted)"
135
137
  };
136
138
 
137
139
  // src/global-css.ts
@@ -619,8 +621,7 @@ var patterns = {
619
621
  // src/color-mix-transform.ts
620
622
  var createColorMixTransform = (prop) => (value, args) => {
621
623
  const mix = args.utils.colorMix(value);
622
- if (mix.invalid)
623
- return { [prop]: value };
624
+ if (mix.invalid) return { [prop]: value };
624
625
  const cssVar = "--mix-" + prop;
625
626
  return {
626
627
  [cssVar]: mix.value,
@@ -1513,51 +1514,105 @@ var flexGrid = {
1513
1514
 
1514
1515
  // src/utilities/gradient.ts
1515
1516
  var gradientVia = createColorMixTransform("--gradient-via");
1516
- var gradientTemplate = {
1517
- "to-t": "linear-gradient(to top, var(--gradient))",
1518
- "to-tr": "linear-gradient(to top right, var(--gradient))",
1519
- "to-r": "linear-gradient(to right, var(--gradient))",
1520
- "to-br": "linear-gradient(to bottom right, var(--gradient))",
1521
- "to-b": "linear-gradient(to bottom, var(--gradient))",
1522
- "to-bl": "linear-gradient(to bottom left, var(--gradient))",
1523
- "to-l": "linear-gradient(to left, var(--gradient))",
1524
- "to-tl": "linear-gradient(to top left, var(--gradient))"
1525
- };
1526
- var gradientVars = {
1527
- "--gradient-stops": "var(--gradient-via-stops, var(--gradient-from) var(--gradient-from-position), var(--gradient-to) var(--gradient-to-position))",
1528
- "--gradient": "var(--gradient-via-stops, var(--gradient-stops))"
1517
+ var linearGradientDirectionMap = /* @__PURE__ */ new Map([
1518
+ ["to-t", "to top"],
1519
+ ["to-tr", "to top right"],
1520
+ ["to-r", "to right"],
1521
+ ["to-br", "to bottom right"],
1522
+ ["to-b", "to bottom"],
1523
+ ["to-bl", "to bottom left"],
1524
+ ["to-l", "to left"],
1525
+ ["to-tl", "to top left"]
1526
+ ]);
1527
+ var linearGradientValues = (theme) => {
1528
+ return {
1529
+ ...theme("gradients"),
1530
+ ...Object.fromEntries(linearGradientDirectionMap.entries())
1531
+ };
1529
1532
  };
1533
+ var gradientStops = "var(--gradient-via-stops, var(--gradient-position), var(--gradient-from) var(--gradient-from-position), var(--gradient-to) var(--gradient-to-position))";
1534
+ var gradientViaStops = "var(--gradient-position), var(--gradient-from) var(--gradient-from-position), var(--gradient-via) var(--gradient-via-position), var(--gradient-to) var(--gradient-to-position)";
1530
1535
  var backgroundGradients = {
1531
1536
  backgroundGradient: {
1532
1537
  shorthand: "bgGradient",
1533
1538
  className: "bg-grad",
1534
1539
  group: "Background Gradient",
1535
- values(theme) {
1540
+ values: linearGradientValues,
1541
+ transform(_value, { raw: value, token }) {
1542
+ const tokenValue = token(`gradients.${value}`);
1543
+ if (tokenValue) {
1544
+ return { backgroundImage: tokenValue };
1545
+ }
1536
1546
  return {
1537
- ...theme("gradients"),
1538
- ...gradientTemplate
1547
+ "--gradient-stops": gradientStops,
1548
+ "--gradient-position": linearGradientDirectionMap.get(value) || value,
1549
+ backgroundImage: `linear-gradient(var(--gradient-stops))`
1539
1550
  };
1540
- },
1541
- transform(value) {
1551
+ }
1552
+ },
1553
+ backgroundLinear: {
1554
+ shorthand: "bgLinear",
1555
+ className: "bg-linear",
1556
+ group: "Background Gradient",
1557
+ values: linearGradientValues,
1558
+ transform(_value, { raw: value, token }) {
1559
+ const tokenValue = token(`gradients.${value}`);
1560
+ if (tokenValue) {
1561
+ return { backgroundImage: tokenValue };
1562
+ }
1542
1563
  return {
1543
- ...gradientVars,
1544
- backgroundImage: value
1564
+ "--gradient-stops": gradientStops,
1565
+ "--gradient-position": linearGradientDirectionMap.get(value) || value,
1566
+ backgroundImage: `linear-gradient(var(--gradient-stops))`
1545
1567
  };
1546
1568
  }
1547
1569
  },
1548
- textGradient: {
1549
- className: "txt-grad",
1570
+ backgroundRadial: {
1571
+ shorthand: "bgRadial",
1572
+ className: "bg-radial",
1550
1573
  group: "Background Gradient",
1551
- values(theme) {
1574
+ values: "gradients",
1575
+ transform(_value, { raw: value, token }) {
1576
+ const tokenValue = token(`gradients.${value}`);
1577
+ if (tokenValue) {
1578
+ return { backgroundImage: tokenValue };
1579
+ }
1552
1580
  return {
1553
- ...theme("gradients"),
1554
- ...gradientTemplate
1581
+ "--gradient-stops": gradientStops,
1582
+ "--gradient-position": value,
1583
+ backgroundImage: `radial-gradient(var(--gradient-stops,${value}))`
1555
1584
  };
1556
- },
1585
+ }
1586
+ },
1587
+ backgroundConic: {
1588
+ shorthand: "bgConic",
1589
+ className: "bg-conic",
1590
+ group: "Background Gradient",
1557
1591
  transform(value) {
1558
1592
  return {
1559
- ...gradientVars,
1560
- backgroundImage: value,
1593
+ "--gradient-stops": gradientStops,
1594
+ "--gradient-position": value,
1595
+ backgroundImage: `conic-gradient(var(--gradient-stops))`
1596
+ };
1597
+ }
1598
+ },
1599
+ textGradient: {
1600
+ className: "txt-grad",
1601
+ group: "Background Gradient",
1602
+ values: linearGradientValues,
1603
+ transform(_value, { raw: value, token }) {
1604
+ const tokenValue = token(`gradients.${value}`);
1605
+ if (tokenValue) {
1606
+ return {
1607
+ backgroundImage: tokenValue,
1608
+ WebkitBackgroundClip: "text",
1609
+ color: "transparent"
1610
+ };
1611
+ }
1612
+ return {
1613
+ "--gradient-stops": gradientStops,
1614
+ "--gradient-position": linearGradientDirectionMap.get(value) || value,
1615
+ backgroundImage: `linear-gradient(var(--gradient-stops))`,
1561
1616
  WebkitBackgroundClip: "text",
1562
1617
  color: "transparent"
1563
1618
  };
@@ -1601,7 +1656,8 @@ var backgroundGradients = {
1601
1656
  const transformed = gradientVia(value, args);
1602
1657
  return {
1603
1658
  ...transformed,
1604
- "--gradient-stops": "var(--gradient-from) var(--gradient-from-position), var(--gradient-via) var(--gradient-via-position), var(--gradient-to) var(--gradient-to-position)"
1659
+ "--gradient-stops": "var(--gradient-via-stops)",
1660
+ "--gradient-via-stops": gradientViaStops
1605
1661
  };
1606
1662
  }
1607
1663
  },
@@ -1654,8 +1710,7 @@ var helpers = {
1654
1710
  values: { type: "boolean" },
1655
1711
  group: "Other",
1656
1712
  transform(value) {
1657
- if (!value)
1658
- return {};
1713
+ if (!value) return {};
1659
1714
  return {
1660
1715
  outline: "1px solid blue !important",
1661
1716
  "&>*": {
@@ -2388,6 +2443,17 @@ var sizing = {
2388
2443
  className: "max-b",
2389
2444
  group: "Height",
2390
2445
  values: heightValues
2446
+ },
2447
+ boxSize: {
2448
+ className: "size",
2449
+ group: "Width",
2450
+ values: widthValues,
2451
+ transform(value) {
2452
+ return {
2453
+ width: value,
2454
+ height: value
2455
+ };
2456
+ }
2391
2457
  }
2392
2458
  };
2393
2459
 
@@ -3088,8 +3154,7 @@ var typography = {
3088
3154
  values: { type: "boolean" },
3089
3155
  group: "Typography",
3090
3156
  transform(value) {
3091
- if (!value)
3092
- return {};
3157
+ if (!value) return {};
3093
3158
  return {
3094
3159
  overflow: "hidden",
3095
3160
  textOverflow: "ellipsis",
@@ -3153,7 +3218,7 @@ var preset = definePreset({
3153
3218
  // globalVars,
3154
3219
  globalCss
3155
3220
  });
3156
- var src_default = preset;
3221
+ var index_default = preset;
3157
3222
  // Annotate the CommonJS export names for ESM import in node:
3158
3223
  0 && (module.exports = {
3159
3224
  preset
package/dist/index.mjs CHANGED
@@ -22,7 +22,7 @@ var conditions = {
22
22
  after: "&::after",
23
23
  firstLetter: "&::first-letter",
24
24
  firstLine: "&::first-line",
25
- marker: "&::marker",
25
+ marker: "&:is(::marker, ::-webkit-details-marker)",
26
26
  selection: "&::selection",
27
27
  file: "&::file-selector-button",
28
28
  backdrop: "&::backdrop",
@@ -70,7 +70,7 @@ var conditions = {
70
70
  atValue: "&[data-state=at-value]",
71
71
  default: "&:default",
72
72
  optional: "&:optional",
73
- open: '&:is([open], [data-open], [data-state="open"])',
73
+ open: '&:is([open], [data-open], [data-state="open"], :popover-open)',
74
74
  closed: '&:is([closed], [data-closed], [data-state="closed"])',
75
75
  fullscreen: "&:is(:fullscreen, [data-fullscreen])",
76
76
  loading: "&:is([data-loading], [aria-busy=true])",
@@ -96,15 +96,17 @@ var conditions = {
96
96
  highContrast: "@media (forced-colors: active)",
97
97
  lessContrast: "@media (prefers-contrast: less)",
98
98
  moreContrast: "@media (prefers-contrast: more)",
99
- ltr: "[dir=ltr] &",
100
- rtl: "[dir=rtl] &",
99
+ ltr: ":where([dir=ltr], :dir(ltr)) &",
100
+ rtl: ":where([dir=rtl], :dir(rtl)) &",
101
101
  scrollbar: "&::-webkit-scrollbar",
102
102
  scrollbarThumb: "&::-webkit-scrollbar-thumb",
103
103
  scrollbarTrack: "&::-webkit-scrollbar-track",
104
104
  horizontal: "&[data-orientation=horizontal]",
105
105
  vertical: "&[data-orientation=vertical]",
106
106
  icon: "& :where(svg)",
107
- starting: "@starting-style"
107
+ starting: "@starting-style",
108
+ noscript: "@media (scripting: none)",
109
+ invertedColors: "@media (inverted-colors: inverted)"
108
110
  };
109
111
 
110
112
  // src/global-css.ts
@@ -592,8 +594,7 @@ var patterns = {
592
594
  // src/color-mix-transform.ts
593
595
  var createColorMixTransform = (prop) => (value, args) => {
594
596
  const mix = args.utils.colorMix(value);
595
- if (mix.invalid)
596
- return { [prop]: value };
597
+ if (mix.invalid) return { [prop]: value };
597
598
  const cssVar = "--mix-" + prop;
598
599
  return {
599
600
  [cssVar]: mix.value,
@@ -1486,51 +1487,105 @@ var flexGrid = {
1486
1487
 
1487
1488
  // src/utilities/gradient.ts
1488
1489
  var gradientVia = createColorMixTransform("--gradient-via");
1489
- var gradientTemplate = {
1490
- "to-t": "linear-gradient(to top, var(--gradient))",
1491
- "to-tr": "linear-gradient(to top right, var(--gradient))",
1492
- "to-r": "linear-gradient(to right, var(--gradient))",
1493
- "to-br": "linear-gradient(to bottom right, var(--gradient))",
1494
- "to-b": "linear-gradient(to bottom, var(--gradient))",
1495
- "to-bl": "linear-gradient(to bottom left, var(--gradient))",
1496
- "to-l": "linear-gradient(to left, var(--gradient))",
1497
- "to-tl": "linear-gradient(to top left, var(--gradient))"
1498
- };
1499
- var gradientVars = {
1500
- "--gradient-stops": "var(--gradient-via-stops, var(--gradient-from) var(--gradient-from-position), var(--gradient-to) var(--gradient-to-position))",
1501
- "--gradient": "var(--gradient-via-stops, var(--gradient-stops))"
1490
+ var linearGradientDirectionMap = /* @__PURE__ */ new Map([
1491
+ ["to-t", "to top"],
1492
+ ["to-tr", "to top right"],
1493
+ ["to-r", "to right"],
1494
+ ["to-br", "to bottom right"],
1495
+ ["to-b", "to bottom"],
1496
+ ["to-bl", "to bottom left"],
1497
+ ["to-l", "to left"],
1498
+ ["to-tl", "to top left"]
1499
+ ]);
1500
+ var linearGradientValues = (theme) => {
1501
+ return {
1502
+ ...theme("gradients"),
1503
+ ...Object.fromEntries(linearGradientDirectionMap.entries())
1504
+ };
1502
1505
  };
1506
+ var gradientStops = "var(--gradient-via-stops, var(--gradient-position), var(--gradient-from) var(--gradient-from-position), var(--gradient-to) var(--gradient-to-position))";
1507
+ var gradientViaStops = "var(--gradient-position), var(--gradient-from) var(--gradient-from-position), var(--gradient-via) var(--gradient-via-position), var(--gradient-to) var(--gradient-to-position)";
1503
1508
  var backgroundGradients = {
1504
1509
  backgroundGradient: {
1505
1510
  shorthand: "bgGradient",
1506
1511
  className: "bg-grad",
1507
1512
  group: "Background Gradient",
1508
- values(theme) {
1513
+ values: linearGradientValues,
1514
+ transform(_value, { raw: value, token }) {
1515
+ const tokenValue = token(`gradients.${value}`);
1516
+ if (tokenValue) {
1517
+ return { backgroundImage: tokenValue };
1518
+ }
1509
1519
  return {
1510
- ...theme("gradients"),
1511
- ...gradientTemplate
1520
+ "--gradient-stops": gradientStops,
1521
+ "--gradient-position": linearGradientDirectionMap.get(value) || value,
1522
+ backgroundImage: `linear-gradient(var(--gradient-stops))`
1512
1523
  };
1513
- },
1514
- transform(value) {
1524
+ }
1525
+ },
1526
+ backgroundLinear: {
1527
+ shorthand: "bgLinear",
1528
+ className: "bg-linear",
1529
+ group: "Background Gradient",
1530
+ values: linearGradientValues,
1531
+ transform(_value, { raw: value, token }) {
1532
+ const tokenValue = token(`gradients.${value}`);
1533
+ if (tokenValue) {
1534
+ return { backgroundImage: tokenValue };
1535
+ }
1515
1536
  return {
1516
- ...gradientVars,
1517
- backgroundImage: value
1537
+ "--gradient-stops": gradientStops,
1538
+ "--gradient-position": linearGradientDirectionMap.get(value) || value,
1539
+ backgroundImage: `linear-gradient(var(--gradient-stops))`
1518
1540
  };
1519
1541
  }
1520
1542
  },
1521
- textGradient: {
1522
- className: "txt-grad",
1543
+ backgroundRadial: {
1544
+ shorthand: "bgRadial",
1545
+ className: "bg-radial",
1523
1546
  group: "Background Gradient",
1524
- values(theme) {
1547
+ values: "gradients",
1548
+ transform(_value, { raw: value, token }) {
1549
+ const tokenValue = token(`gradients.${value}`);
1550
+ if (tokenValue) {
1551
+ return { backgroundImage: tokenValue };
1552
+ }
1525
1553
  return {
1526
- ...theme("gradients"),
1527
- ...gradientTemplate
1554
+ "--gradient-stops": gradientStops,
1555
+ "--gradient-position": value,
1556
+ backgroundImage: `radial-gradient(var(--gradient-stops,${value}))`
1528
1557
  };
1529
- },
1558
+ }
1559
+ },
1560
+ backgroundConic: {
1561
+ shorthand: "bgConic",
1562
+ className: "bg-conic",
1563
+ group: "Background Gradient",
1530
1564
  transform(value) {
1531
1565
  return {
1532
- ...gradientVars,
1533
- backgroundImage: value,
1566
+ "--gradient-stops": gradientStops,
1567
+ "--gradient-position": value,
1568
+ backgroundImage: `conic-gradient(var(--gradient-stops))`
1569
+ };
1570
+ }
1571
+ },
1572
+ textGradient: {
1573
+ className: "txt-grad",
1574
+ group: "Background Gradient",
1575
+ values: linearGradientValues,
1576
+ transform(_value, { raw: value, token }) {
1577
+ const tokenValue = token(`gradients.${value}`);
1578
+ if (tokenValue) {
1579
+ return {
1580
+ backgroundImage: tokenValue,
1581
+ WebkitBackgroundClip: "text",
1582
+ color: "transparent"
1583
+ };
1584
+ }
1585
+ return {
1586
+ "--gradient-stops": gradientStops,
1587
+ "--gradient-position": linearGradientDirectionMap.get(value) || value,
1588
+ backgroundImage: `linear-gradient(var(--gradient-stops))`,
1534
1589
  WebkitBackgroundClip: "text",
1535
1590
  color: "transparent"
1536
1591
  };
@@ -1574,7 +1629,8 @@ var backgroundGradients = {
1574
1629
  const transformed = gradientVia(value, args);
1575
1630
  return {
1576
1631
  ...transformed,
1577
- "--gradient-stops": "var(--gradient-from) var(--gradient-from-position), var(--gradient-via) var(--gradient-via-position), var(--gradient-to) var(--gradient-to-position)"
1632
+ "--gradient-stops": "var(--gradient-via-stops)",
1633
+ "--gradient-via-stops": gradientViaStops
1578
1634
  };
1579
1635
  }
1580
1636
  },
@@ -1627,8 +1683,7 @@ var helpers = {
1627
1683
  values: { type: "boolean" },
1628
1684
  group: "Other",
1629
1685
  transform(value) {
1630
- if (!value)
1631
- return {};
1686
+ if (!value) return {};
1632
1687
  return {
1633
1688
  outline: "1px solid blue !important",
1634
1689
  "&>*": {
@@ -2361,6 +2416,17 @@ var sizing = {
2361
2416
  className: "max-b",
2362
2417
  group: "Height",
2363
2418
  values: heightValues
2419
+ },
2420
+ boxSize: {
2421
+ className: "size",
2422
+ group: "Width",
2423
+ values: widthValues,
2424
+ transform(value) {
2425
+ return {
2426
+ width: value,
2427
+ height: value
2428
+ };
2429
+ }
2364
2430
  }
2365
2431
  };
2366
2432
 
@@ -3061,8 +3127,7 @@ var typography = {
3061
3127
  values: { type: "boolean" },
3062
3128
  group: "Typography",
3063
3129
  transform(value) {
3064
- if (!value)
3065
- return {};
3130
+ if (!value) return {};
3066
3131
  return {
3067
3132
  overflow: "hidden",
3068
3133
  textOverflow: "ellipsis",
@@ -3126,8 +3191,8 @@ var preset = definePreset({
3126
3191
  // globalVars,
3127
3192
  globalCss
3128
3193
  });
3129
- var src_default = preset;
3194
+ var index_default = preset;
3130
3195
  export {
3131
- src_default as default,
3196
+ index_default as default,
3132
3197
  preset
3133
3198
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/preset-base",
3
- "version": "0.54.0",
3
+ "version": "1.0.1",
4
4
  "description": "The base preset for Panda CSS that contains the conditions and utilities",
5
5
  "author": "Segun Adebayo <joseshegs@gmail.com>",
6
6
  "main": "dist/index.js",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@pandacss/types": "0.54.0"
35
+ "@pandacss/types": "1.0.1"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsup src/index.ts --format=esm,cjs --dts",