@pandacss/generator 0.34.2 → 0.34.3

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
@@ -937,9 +937,10 @@ function generatePreactJsxFactory(ctx) {
937
937
 
938
938
  const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
939
939
  const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
940
+ const __base__ = Dynamic.__base__ || Dynamic
940
941
 
941
942
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
942
- const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
943
+ const { as: Element = __base__, children, ...restProps } = props
943
944
 
944
945
 
945
946
  const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
@@ -971,11 +972,11 @@ function generatePreactJsxFactory(ctx) {
971
972
  }, combinedProps.children ?? children)
972
973
  })
973
974
 
974
- const name = getDisplayName(Dynamic)
975
+ const name = getDisplayName(__base__)
975
976
 
976
977
  ${componentName}.displayName = \`${factoryName}.\${name}\`
977
978
  ${componentName}.__cva__ = __cvaFn__
978
- ${componentName}.__base__ = Dynamic
979
+ ${componentName}.__base__ = __base__
979
980
  ${componentName}.__shouldForwardProps__ = shouldForwardProp
980
981
 
981
982
  return ${componentName}
@@ -1149,12 +1150,13 @@ function generatePreactJsxStringLiteralFactory(ctx) {
1149
1150
  ${ctx.file.import("css, cx", "../css/index")}
1150
1151
 
1151
1152
  function createStyledFn(Dynamic) {
1153
+ const __base__ = Dynamic.__base__ || Dynamic
1152
1154
  return function styledFn(template) {
1153
1155
  const styles = css.raw(template)
1154
1156
 
1155
1157
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
1156
- const { as: Element = Dynamic.__base__ || Dynamic, ...elementProps } = props
1157
-
1158
+ const { as: Element = __base__, ...elementProps } = props
1159
+
1158
1160
  function classes() {
1159
1161
  return cx(css(Dynamic.__styles__, styles), elementProps.className)
1160
1162
  }
@@ -1166,11 +1168,11 @@ function generatePreactJsxStringLiteralFactory(ctx) {
1166
1168
  })
1167
1169
  })
1168
1170
 
1169
- const name = getDisplayName(Dynamic)
1170
-
1171
+ const name = getDisplayName(__base__)
1172
+
1171
1173
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1172
1174
  ${componentName}.__styles__ = styles
1173
- ${componentName}.__base__ = Dynamic
1175
+ ${componentName}.__base__ = __base__
1174
1176
 
1175
1177
  return ${componentName}
1176
1178
  }
@@ -1263,9 +1265,10 @@ function generateQwikJsxFactory(ctx) {
1263
1265
 
1264
1266
  const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
1265
1267
  const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
1268
+ const __base__ = Dynamic.__base__ || Dynamic
1266
1269
 
1267
1270
  const ${componentName} = function ${componentName}(props) {
1268
- const { as: Element = Dynamic.__base__ || Dynamic, children, className, ...restProps } = props
1271
+ const { as: Element = __base__, children, className, ...restProps } = props
1269
1272
 
1270
1273
  const combinedProps = Object.assign({}, defaultProps, restProps)
1271
1274
 
@@ -1296,11 +1299,11 @@ function generateQwikJsxFactory(ctx) {
1296
1299
  }, combinedProps.children ?? children)
1297
1300
  }
1298
1301
 
1299
- const name = getDisplayName(Dynamic)
1302
+ const name = getDisplayName(__base__)
1300
1303
 
1301
1304
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1302
1305
  ${componentName}.__cva__ = __cvaFn__
1303
- ${componentName}.__base__ = Dynamic
1306
+ ${componentName}.__base__ = __base__
1304
1307
  ${componentName}.__shouldForwardProps__ = shouldForwardProp
1305
1308
 
1306
1309
  return ${componentName}
@@ -1476,14 +1479,15 @@ function generateQwikJsxStringLiteralFactory(ctx) {
1476
1479
  ${ctx.file.import("css, cx", "../css/index")}
1477
1480
 
1478
1481
  function createStyledFn(Dynamic) {
1482
+ const __base__ = Dynamic.__base__ || Dynamic
1479
1483
  return function styledFn(template) {
1480
1484
  const styles = css.raw(template)
1481
-
1485
+
1482
1486
  const ${componentName} = (props) => {
1483
- const { as: Element = Dynamic.__base__ || Dynamic, ...elementProps } = props
1484
-
1487
+ const { as: Element = __base__, ...elementProps } = props
1488
+
1485
1489
  function classes() {
1486
- return cx(css(Dynamic.__styles__, styles), elementProps.className)
1490
+ return cx(css(__base__.__styles__, styles), elementProps.className)
1487
1491
  }
1488
1492
 
1489
1493
  return h(Element, {
@@ -1492,12 +1496,12 @@ function generateQwikJsxStringLiteralFactory(ctx) {
1492
1496
  })
1493
1497
  }
1494
1498
 
1495
- const name = getDisplayName(Dynamic)
1496
-
1499
+ const name = getDisplayName(__base__)
1500
+
1497
1501
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1498
1502
  ${componentName}.__styles__ = styles
1499
- ${componentName}.__base__ = Dynamic
1500
-
1503
+ ${componentName}.__base__ = __base__
1504
+
1501
1505
  return ${componentName}
1502
1506
  }
1503
1507
  }
@@ -1595,9 +1599,10 @@ function generateReactJsxFactory(ctx) {
1595
1599
 
1596
1600
  const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
1597
1601
  const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
1602
+ const __base__ = Dynamic.__base__ || Dynamic
1598
1603
 
1599
1604
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
1600
- const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
1605
+ const { as: Element = __base__, children, ...restProps } = props
1601
1606
 
1602
1607
  const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
1603
1608
 
@@ -1628,11 +1633,11 @@ function generateReactJsxFactory(ctx) {
1628
1633
  }, combinedProps.children ?? children)
1629
1634
  })
1630
1635
 
1631
- const name = getDisplayName(Dynamic)
1636
+ const name = getDisplayName(__base__)
1632
1637
 
1633
1638
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1634
1639
  ${componentName}.__cva__ = __cvaFn__
1635
- ${componentName}.__base__ = Dynamic
1640
+ ${componentName}.__base__ = __base__
1636
1641
  ${componentName}.__shouldForwardProps__ = shouldForwardProp
1637
1642
 
1638
1643
  return ${componentName}
@@ -1807,14 +1812,15 @@ function generateReactJsxStringLiteralFactory(ctx) {
1807
1812
  ${ctx.file.import("css, cx", "../css/index")}
1808
1813
 
1809
1814
  function createStyledFn(Dynamic) {
1815
+ const __base__ = Dynamic.__base__ || Dynamic
1810
1816
  return function styledFn(template) {
1811
1817
  const styles = css.raw(template)
1812
1818
 
1813
1819
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
1814
- const { as: Element = Dynamic.__base__ || Dynamic, ...elementProps } = props
1815
-
1820
+ const { as: Element = __base__, ...elementProps } = props
1821
+
1816
1822
  function classes() {
1817
- return cx(css(Dynamic.__styles__, styles), elementProps.className)
1823
+ return cx(css(__base__.__styles__, styles), elementProps.className)
1818
1824
  }
1819
1825
 
1820
1826
  return createElement(Element, {
@@ -1824,12 +1830,12 @@ function generateReactJsxStringLiteralFactory(ctx) {
1824
1830
  })
1825
1831
  })
1826
1832
 
1827
- const name = getDisplayName(Dynamic)
1828
-
1833
+ const name = getDisplayName(__base__)
1834
+
1829
1835
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1830
1836
  ${componentName}.__styles__ = styles
1831
- ${componentName}.__base__ = Dynamic
1832
-
1837
+ ${componentName}.__base__ = __base__
1838
+
1833
1839
  return ${componentName}
1834
1840
  }
1835
1841
  }
@@ -2999,7 +3005,8 @@ function generatePropTypes(ctx) {
2999
3005
  | 'wordBreak'
3000
3006
  | 'writingMode'
3001
3007
 
3002
- type WithEscapeHatch<T> = T | \`[\${string}]\`
3008
+ type WithColorOpacityModifier<T> = T extends string ? \`$\{T}/\${string}\` : T
3009
+ type WithEscapeHatch<T> = T | \`[\${string}]\` | \`\${T}/{string}\` | WithColorOpacityModifier<T>
3003
3010
 
3004
3011
  type FilterVagueString<Key, Value> = Value extends boolean
3005
3012
  ? Value
package/dist/index.mjs CHANGED
@@ -901,9 +901,10 @@ function generatePreactJsxFactory(ctx) {
901
901
 
902
902
  const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
903
903
  const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
904
+ const __base__ = Dynamic.__base__ || Dynamic
904
905
 
905
906
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
906
- const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
907
+ const { as: Element = __base__, children, ...restProps } = props
907
908
 
908
909
 
909
910
  const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
@@ -935,11 +936,11 @@ function generatePreactJsxFactory(ctx) {
935
936
  }, combinedProps.children ?? children)
936
937
  })
937
938
 
938
- const name = getDisplayName(Dynamic)
939
+ const name = getDisplayName(__base__)
939
940
 
940
941
  ${componentName}.displayName = \`${factoryName}.\${name}\`
941
942
  ${componentName}.__cva__ = __cvaFn__
942
- ${componentName}.__base__ = Dynamic
943
+ ${componentName}.__base__ = __base__
943
944
  ${componentName}.__shouldForwardProps__ = shouldForwardProp
944
945
 
945
946
  return ${componentName}
@@ -1113,12 +1114,13 @@ function generatePreactJsxStringLiteralFactory(ctx) {
1113
1114
  ${ctx.file.import("css, cx", "../css/index")}
1114
1115
 
1115
1116
  function createStyledFn(Dynamic) {
1117
+ const __base__ = Dynamic.__base__ || Dynamic
1116
1118
  return function styledFn(template) {
1117
1119
  const styles = css.raw(template)
1118
1120
 
1119
1121
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
1120
- const { as: Element = Dynamic.__base__ || Dynamic, ...elementProps } = props
1121
-
1122
+ const { as: Element = __base__, ...elementProps } = props
1123
+
1122
1124
  function classes() {
1123
1125
  return cx(css(Dynamic.__styles__, styles), elementProps.className)
1124
1126
  }
@@ -1130,11 +1132,11 @@ function generatePreactJsxStringLiteralFactory(ctx) {
1130
1132
  })
1131
1133
  })
1132
1134
 
1133
- const name = getDisplayName(Dynamic)
1134
-
1135
+ const name = getDisplayName(__base__)
1136
+
1135
1137
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1136
1138
  ${componentName}.__styles__ = styles
1137
- ${componentName}.__base__ = Dynamic
1139
+ ${componentName}.__base__ = __base__
1138
1140
 
1139
1141
  return ${componentName}
1140
1142
  }
@@ -1227,9 +1229,10 @@ function generateQwikJsxFactory(ctx) {
1227
1229
 
1228
1230
  const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
1229
1231
  const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
1232
+ const __base__ = Dynamic.__base__ || Dynamic
1230
1233
 
1231
1234
  const ${componentName} = function ${componentName}(props) {
1232
- const { as: Element = Dynamic.__base__ || Dynamic, children, className, ...restProps } = props
1235
+ const { as: Element = __base__, children, className, ...restProps } = props
1233
1236
 
1234
1237
  const combinedProps = Object.assign({}, defaultProps, restProps)
1235
1238
 
@@ -1260,11 +1263,11 @@ function generateQwikJsxFactory(ctx) {
1260
1263
  }, combinedProps.children ?? children)
1261
1264
  }
1262
1265
 
1263
- const name = getDisplayName(Dynamic)
1266
+ const name = getDisplayName(__base__)
1264
1267
 
1265
1268
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1266
1269
  ${componentName}.__cva__ = __cvaFn__
1267
- ${componentName}.__base__ = Dynamic
1270
+ ${componentName}.__base__ = __base__
1268
1271
  ${componentName}.__shouldForwardProps__ = shouldForwardProp
1269
1272
 
1270
1273
  return ${componentName}
@@ -1440,14 +1443,15 @@ function generateQwikJsxStringLiteralFactory(ctx) {
1440
1443
  ${ctx.file.import("css, cx", "../css/index")}
1441
1444
 
1442
1445
  function createStyledFn(Dynamic) {
1446
+ const __base__ = Dynamic.__base__ || Dynamic
1443
1447
  return function styledFn(template) {
1444
1448
  const styles = css.raw(template)
1445
-
1449
+
1446
1450
  const ${componentName} = (props) => {
1447
- const { as: Element = Dynamic.__base__ || Dynamic, ...elementProps } = props
1448
-
1451
+ const { as: Element = __base__, ...elementProps } = props
1452
+
1449
1453
  function classes() {
1450
- return cx(css(Dynamic.__styles__, styles), elementProps.className)
1454
+ return cx(css(__base__.__styles__, styles), elementProps.className)
1451
1455
  }
1452
1456
 
1453
1457
  return h(Element, {
@@ -1456,12 +1460,12 @@ function generateQwikJsxStringLiteralFactory(ctx) {
1456
1460
  })
1457
1461
  }
1458
1462
 
1459
- const name = getDisplayName(Dynamic)
1460
-
1463
+ const name = getDisplayName(__base__)
1464
+
1461
1465
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1462
1466
  ${componentName}.__styles__ = styles
1463
- ${componentName}.__base__ = Dynamic
1464
-
1467
+ ${componentName}.__base__ = __base__
1468
+
1465
1469
  return ${componentName}
1466
1470
  }
1467
1471
  }
@@ -1559,9 +1563,10 @@ function generateReactJsxFactory(ctx) {
1559
1563
 
1560
1564
  const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
1561
1565
  const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
1566
+ const __base__ = Dynamic.__base__ || Dynamic
1562
1567
 
1563
1568
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
1564
- const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
1569
+ const { as: Element = __base__, children, ...restProps } = props
1565
1570
 
1566
1571
  const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
1567
1572
 
@@ -1592,11 +1597,11 @@ function generateReactJsxFactory(ctx) {
1592
1597
  }, combinedProps.children ?? children)
1593
1598
  })
1594
1599
 
1595
- const name = getDisplayName(Dynamic)
1600
+ const name = getDisplayName(__base__)
1596
1601
 
1597
1602
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1598
1603
  ${componentName}.__cva__ = __cvaFn__
1599
- ${componentName}.__base__ = Dynamic
1604
+ ${componentName}.__base__ = __base__
1600
1605
  ${componentName}.__shouldForwardProps__ = shouldForwardProp
1601
1606
 
1602
1607
  return ${componentName}
@@ -1771,14 +1776,15 @@ function generateReactJsxStringLiteralFactory(ctx) {
1771
1776
  ${ctx.file.import("css, cx", "../css/index")}
1772
1777
 
1773
1778
  function createStyledFn(Dynamic) {
1779
+ const __base__ = Dynamic.__base__ || Dynamic
1774
1780
  return function styledFn(template) {
1775
1781
  const styles = css.raw(template)
1776
1782
 
1777
1783
  const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
1778
- const { as: Element = Dynamic.__base__ || Dynamic, ...elementProps } = props
1779
-
1784
+ const { as: Element = __base__, ...elementProps } = props
1785
+
1780
1786
  function classes() {
1781
- return cx(css(Dynamic.__styles__, styles), elementProps.className)
1787
+ return cx(css(__base__.__styles__, styles), elementProps.className)
1782
1788
  }
1783
1789
 
1784
1790
  return createElement(Element, {
@@ -1788,12 +1794,12 @@ function generateReactJsxStringLiteralFactory(ctx) {
1788
1794
  })
1789
1795
  })
1790
1796
 
1791
- const name = getDisplayName(Dynamic)
1792
-
1797
+ const name = getDisplayName(__base__)
1798
+
1793
1799
  ${componentName}.displayName = \`${factoryName}.\${name}\`
1794
1800
  ${componentName}.__styles__ = styles
1795
- ${componentName}.__base__ = Dynamic
1796
-
1801
+ ${componentName}.__base__ = __base__
1802
+
1797
1803
  return ${componentName}
1798
1804
  }
1799
1805
  }
@@ -2963,7 +2969,8 @@ function generatePropTypes(ctx) {
2963
2969
  | 'wordBreak'
2964
2970
  | 'writingMode'
2965
2971
 
2966
- type WithEscapeHatch<T> = T | \`[\${string}]\`
2972
+ type WithColorOpacityModifier<T> = T extends string ? \`$\{T}/\${string}\` : T
2973
+ type WithEscapeHatch<T> = T | \`[\${string}]\` | \`\${T}/{string}\` | WithColorOpacityModifier<T>
2967
2974
 
2968
2975
  type FilterVagueString<Key, Value> = Value extends boolean
2969
2976
  ? Value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.34.2",
3
+ "version": "0.34.3",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -37,12 +37,12 @@
37
37
  "pluralize": "8.0.0",
38
38
  "postcss": "8.4.35",
39
39
  "ts-pattern": "5.0.8",
40
- "@pandacss/core": "0.34.2",
41
- "@pandacss/is-valid-prop": "^0.34.2",
42
- "@pandacss/logger": "0.34.2",
43
- "@pandacss/shared": "0.34.2",
44
- "@pandacss/token-dictionary": "0.34.2",
45
- "@pandacss/types": "0.34.2"
40
+ "@pandacss/core": "0.34.3",
41
+ "@pandacss/is-valid-prop": "^0.34.3",
42
+ "@pandacss/logger": "0.34.3",
43
+ "@pandacss/shared": "0.34.3",
44
+ "@pandacss/token-dictionary": "0.34.3",
45
+ "@pandacss/types": "0.34.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/pluralize": "0.0.33"