@pandacss/generator 0.0.0-dev-20231023094721 → 0.0.0-dev-20231023175607
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 +47 -37
- package/dist/index.mjs +47 -37
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1405,7 +1405,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1405
1405
|
|
|
1406
1406
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1407
1407
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1408
|
-
|
|
1408
|
+
|
|
1409
1409
|
const defaultProps = Object.assign(
|
|
1410
1410
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
1411
1411
|
options.defaultProps,
|
|
@@ -1419,8 +1419,8 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1419
1419
|
|
|
1420
1420
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
1421
1421
|
|
|
1422
|
-
const [forwardedProps, variantProps, styleProps,
|
|
1423
|
-
return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
1422
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] = useMemo(() => {
|
|
1423
|
+
return splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
1424
1424
|
}, [combinedProps])
|
|
1425
1425
|
|
|
1426
1426
|
function recipeClass() {
|
|
@@ -1448,12 +1448,12 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1448
1448
|
})
|
|
1449
1449
|
|
|
1450
1450
|
const name = getDisplayName(Dynamic)
|
|
1451
|
-
|
|
1451
|
+
|
|
1452
1452
|
${componentName}.displayName = \`${factoryName}.\${name}\`
|
|
1453
1453
|
${componentName}.__cva__ = cvaFn
|
|
1454
1454
|
${componentName}.__base__ = Dynamic
|
|
1455
1455
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
1456
|
-
|
|
1456
|
+
|
|
1457
1457
|
return ${componentName}
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
@@ -1709,7 +1709,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1709
1709
|
|
|
1710
1710
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1711
1711
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1712
|
-
|
|
1712
|
+
|
|
1713
1713
|
const defaultProps = Object.assign(
|
|
1714
1714
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
1715
1715
|
options.defaultProps,
|
|
@@ -1722,16 +1722,18 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1722
1722
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
1723
1723
|
|
|
1724
1724
|
const combinedProps = Object.assign({}, defaultProps, restProps)
|
|
1725
|
-
|
|
1726
|
-
const [forwardedProps, variantProps, styleProps,
|
|
1727
|
-
splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
1725
|
+
|
|
1726
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] =
|
|
1727
|
+
splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
1728
|
+
|
|
1729
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1728
1730
|
|
|
1729
1731
|
function recipeClass() {
|
|
1730
1732
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1731
1733
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
1732
1734
|
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1733
1735
|
}
|
|
1734
|
-
|
|
1736
|
+
|
|
1735
1737
|
function cvaClass() {
|
|
1736
1738
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1737
1739
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
@@ -1750,12 +1752,12 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1750
1752
|
}
|
|
1751
1753
|
|
|
1752
1754
|
const name = getDisplayName(Dynamic)
|
|
1753
|
-
|
|
1755
|
+
|
|
1754
1756
|
${componentName}.displayName = \`${factoryName}.\${name}\`
|
|
1755
1757
|
${componentName}.__cva__ = cvaFn
|
|
1756
1758
|
${componentName}.__base__ = Dynamic
|
|
1757
1759
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
1758
|
-
|
|
1760
|
+
|
|
1759
1761
|
return ${componentName}
|
|
1760
1762
|
}
|
|
1761
1763
|
|
|
@@ -2018,7 +2020,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
2018
2020
|
|
|
2019
2021
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
2020
2022
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
2021
|
-
|
|
2023
|
+
|
|
2022
2024
|
const defaultProps = Object.assign(
|
|
2023
2025
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
2024
2026
|
options.defaultProps,
|
|
@@ -2026,14 +2028,14 @@ function generateReactJsxFactory(ctx) {
|
|
|
2026
2028
|
|
|
2027
2029
|
const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
|
|
2028
2030
|
const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
|
|
2029
|
-
|
|
2031
|
+
|
|
2030
2032
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
2031
2033
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
2032
2034
|
|
|
2033
2035
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
2034
2036
|
|
|
2035
|
-
const [forwardedProps, variantProps, styleProps,
|
|
2036
|
-
return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
2037
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] = useMemo(() => {
|
|
2038
|
+
return splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
2037
2039
|
}, [combinedProps])
|
|
2038
2040
|
|
|
2039
2041
|
function recipeClass() {
|
|
@@ -2061,12 +2063,12 @@ function generateReactJsxFactory(ctx) {
|
|
|
2061
2063
|
})
|
|
2062
2064
|
|
|
2063
2065
|
const name = getDisplayName(Dynamic)
|
|
2064
|
-
|
|
2066
|
+
|
|
2065
2067
|
${componentName}.displayName = \`${factoryName}.\${name}\`
|
|
2066
2068
|
${componentName}.__cva__ = cvaFn
|
|
2067
2069
|
${componentName}.__base__ = Dynamic
|
|
2068
2070
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
2069
|
-
|
|
2071
|
+
|
|
2070
2072
|
return ${componentName}
|
|
2071
2073
|
}
|
|
2072
2074
|
|
|
@@ -2323,13 +2325,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2323
2325
|
${ctx.file.import("isCssProperty, allCssProperties", "./is-valid-prop")}
|
|
2324
2326
|
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
2325
2327
|
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
2326
|
-
|
|
2328
|
+
|
|
2327
2329
|
function styledFn(element, configOrCva = {}, options = {}) {
|
|
2328
2330
|
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
2329
2331
|
|
|
2330
2332
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
2331
2333
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
2332
|
-
|
|
2334
|
+
|
|
2333
2335
|
const defaultProps = Object.assign(
|
|
2334
2336
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
2335
2337
|
options.defaultProps,
|
|
@@ -2337,19 +2339,21 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2337
2339
|
|
|
2338
2340
|
const ${componentName} = (props) => {
|
|
2339
2341
|
const mergedProps = mergeProps({ as: element.__base__ || element }, defaultProps, props)
|
|
2340
|
-
|
|
2342
|
+
|
|
2341
2343
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
2342
2344
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
2343
|
-
|
|
2344
|
-
const forwardedKeys = createMemo(() => Object.keys(props).filter(shouldForwardProp))
|
|
2345
2345
|
|
|
2346
|
-
const
|
|
2346
|
+
const forwardedKeys = createMemo(() =>
|
|
2347
|
+
Object.keys(props).filter((prop) => !normalizeHTMLProps.keys.includes(prop) && shouldForwardProp(prop)),
|
|
2348
|
+
)
|
|
2349
|
+
|
|
2350
|
+
const [localProps, htmlProps, forwardedProps, variantProps, styleProps, elementProps] = splitProps(
|
|
2347
2351
|
mergedProps,
|
|
2348
2352
|
['as', 'class', 'className'],
|
|
2353
|
+
normalizeHTMLProps.keys,
|
|
2349
2354
|
forwardedKeys(),
|
|
2350
2355
|
__cvaFn__.variantKeys,
|
|
2351
2356
|
allCssProperties,
|
|
2352
|
-
normalizeHTMLProps.keys
|
|
2353
2357
|
)
|
|
2354
2358
|
|
|
2355
2359
|
function recipeClass() {
|
|
@@ -2394,7 +2398,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2394
2398
|
${componentName}.__cva__ = cvaFn
|
|
2395
2399
|
${componentName}.__base__ = element
|
|
2396
2400
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
2397
|
-
|
|
2401
|
+
|
|
2398
2402
|
return ${componentName}
|
|
2399
2403
|
}
|
|
2400
2404
|
|
|
@@ -2653,15 +2657,15 @@ function generateVueJsxFactory(ctx) {
|
|
|
2653
2657
|
|
|
2654
2658
|
function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
2655
2659
|
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
2656
|
-
|
|
2660
|
+
|
|
2657
2661
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
2658
2662
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
2659
|
-
|
|
2663
|
+
|
|
2660
2664
|
const defaultProps = Object.assign(
|
|
2661
2665
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
2662
2666
|
options.defaultProps,
|
|
2663
2667
|
)
|
|
2664
|
-
|
|
2668
|
+
|
|
2665
2669
|
const name = getDisplayName(Dynamic)
|
|
2666
2670
|
|
|
2667
2671
|
const ${componentName} = defineComponent({
|
|
@@ -2671,22 +2675,22 @@ function generateVueJsxFactory(ctx) {
|
|
|
2671
2675
|
setup(props, { slots, attrs }) {
|
|
2672
2676
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
2673
2677
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
2674
|
-
|
|
2678
|
+
|
|
2675
2679
|
const combinedProps = computed(() => Object.assign({}, defaultProps, attrs))
|
|
2676
|
-
|
|
2680
|
+
|
|
2677
2681
|
const splittedProps = computed(() => {
|
|
2678
|
-
return splitProps(combinedProps.value, shouldForwardProp, __cvaFn__.variantKeys, isCssProperty
|
|
2682
|
+
return splitProps(combinedProps.value, normalizeHTMLProps.keys, shouldForwardProp, __cvaFn__.variantKeys, isCssProperty)
|
|
2679
2683
|
})
|
|
2680
2684
|
|
|
2681
2685
|
const recipeClass = computed(() => {
|
|
2682
|
-
const [_forwardedProps, variantProps, styleProps,
|
|
2686
|
+
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2683
2687
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2684
2688
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
2685
2689
|
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.value.className)
|
|
2686
2690
|
})
|
|
2687
2691
|
|
|
2688
2692
|
const cvaClass = computed(() => {
|
|
2689
|
-
const [_forwardedProps, variantProps, styleProps,
|
|
2693
|
+
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2690
2694
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2691
2695
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
2692
2696
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className)
|
|
@@ -2695,7 +2699,7 @@ function generateVueJsxFactory(ctx) {
|
|
|
2695
2699
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
2696
2700
|
|
|
2697
2701
|
return () => {
|
|
2698
|
-
const [forwardedProps, _variantProps, _styleProps,
|
|
2702
|
+
const [htmlProps, forwardedProps, _variantProps, _styleProps, elementProps] = splittedProps.value
|
|
2699
2703
|
return h(
|
|
2700
2704
|
props.as,
|
|
2701
2705
|
{
|
|
@@ -2714,7 +2718,7 @@ function generateVueJsxFactory(ctx) {
|
|
|
2714
2718
|
${componentName}.__cva__ = cvaFn
|
|
2715
2719
|
${componentName}.__base__ = Dynamic
|
|
2716
2720
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
2717
|
-
|
|
2721
|
+
|
|
2718
2722
|
return ${componentName}
|
|
2719
2723
|
}
|
|
2720
2724
|
|
|
@@ -3105,7 +3109,13 @@ function getGeneratedTypes(ctx) {
|
|
|
3105
3109
|
composition: rewriteImports(composition_d_ts_default.content),
|
|
3106
3110
|
selectors: rewriteImports(selectors_d_ts_default.content),
|
|
3107
3111
|
system: rewriteImports(
|
|
3108
|
-
(0, import_ts_pattern9.match)(ctx.jsx.styleProps).with("all", () => system_types_d_ts_default.content).with(
|
|
3112
|
+
(0, import_ts_pattern9.match)(ctx.jsx.styleProps).with("all", () => system_types_d_ts_default.content).with(
|
|
3113
|
+
"minimal",
|
|
3114
|
+
() => system_types_d_ts_default.content.replace("WithHTMLProps<T>,", "T,").replace(jsxStyleProps, "export type JsxStyleProps = WithCss")
|
|
3115
|
+
).with(
|
|
3116
|
+
"none",
|
|
3117
|
+
() => system_types_d_ts_default.content.replace("WithHTMLProps<T>,", "T,").replace(jsxStyleProps, "export type JsxStyleProps = {}")
|
|
3118
|
+
).exhaustive()
|
|
3109
3119
|
)
|
|
3110
3120
|
};
|
|
3111
3121
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1374,7 +1374,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1374
1374
|
|
|
1375
1375
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1376
1376
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1377
|
-
|
|
1377
|
+
|
|
1378
1378
|
const defaultProps = Object.assign(
|
|
1379
1379
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
1380
1380
|
options.defaultProps,
|
|
@@ -1388,8 +1388,8 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1388
1388
|
|
|
1389
1389
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
1390
1390
|
|
|
1391
|
-
const [forwardedProps, variantProps, styleProps,
|
|
1392
|
-
return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
1391
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] = useMemo(() => {
|
|
1392
|
+
return splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
1393
1393
|
}, [combinedProps])
|
|
1394
1394
|
|
|
1395
1395
|
function recipeClass() {
|
|
@@ -1417,12 +1417,12 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1417
1417
|
})
|
|
1418
1418
|
|
|
1419
1419
|
const name = getDisplayName(Dynamic)
|
|
1420
|
-
|
|
1420
|
+
|
|
1421
1421
|
${componentName}.displayName = \`${factoryName}.\${name}\`
|
|
1422
1422
|
${componentName}.__cva__ = cvaFn
|
|
1423
1423
|
${componentName}.__base__ = Dynamic
|
|
1424
1424
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
1425
|
-
|
|
1425
|
+
|
|
1426
1426
|
return ${componentName}
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
@@ -1678,7 +1678,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1678
1678
|
|
|
1679
1679
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1680
1680
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1681
|
-
|
|
1681
|
+
|
|
1682
1682
|
const defaultProps = Object.assign(
|
|
1683
1683
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
1684
1684
|
options.defaultProps,
|
|
@@ -1691,16 +1691,18 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1691
1691
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
1692
1692
|
|
|
1693
1693
|
const combinedProps = Object.assign({}, defaultProps, restProps)
|
|
1694
|
-
|
|
1695
|
-
const [forwardedProps, variantProps, styleProps,
|
|
1696
|
-
splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
1694
|
+
|
|
1695
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] =
|
|
1696
|
+
splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
1697
|
+
|
|
1698
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1697
1699
|
|
|
1698
1700
|
function recipeClass() {
|
|
1699
1701
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1700
1702
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
1701
1703
|
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1702
1704
|
}
|
|
1703
|
-
|
|
1705
|
+
|
|
1704
1706
|
function cvaClass() {
|
|
1705
1707
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1706
1708
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
@@ -1719,12 +1721,12 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1719
1721
|
}
|
|
1720
1722
|
|
|
1721
1723
|
const name = getDisplayName(Dynamic)
|
|
1722
|
-
|
|
1724
|
+
|
|
1723
1725
|
${componentName}.displayName = \`${factoryName}.\${name}\`
|
|
1724
1726
|
${componentName}.__cva__ = cvaFn
|
|
1725
1727
|
${componentName}.__base__ = Dynamic
|
|
1726
1728
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
1727
|
-
|
|
1729
|
+
|
|
1728
1730
|
return ${componentName}
|
|
1729
1731
|
}
|
|
1730
1732
|
|
|
@@ -1987,7 +1989,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1987
1989
|
|
|
1988
1990
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1989
1991
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1990
|
-
|
|
1992
|
+
|
|
1991
1993
|
const defaultProps = Object.assign(
|
|
1992
1994
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
1993
1995
|
options.defaultProps,
|
|
@@ -1995,14 +1997,14 @@ function generateReactJsxFactory(ctx) {
|
|
|
1995
1997
|
|
|
1996
1998
|
const ${componentName} = /* @__PURE__ */ forwardRef(function ${componentName}(props, ref) {
|
|
1997
1999
|
const { as: Element = Dynamic.__base__ || Dynamic, children, ...restProps } = props
|
|
1998
|
-
|
|
2000
|
+
|
|
1999
2001
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
2000
2002
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
2001
2003
|
|
|
2002
2004
|
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps])
|
|
2003
2005
|
|
|
2004
|
-
const [forwardedProps, variantProps, styleProps,
|
|
2005
|
-
return splitProps(combinedProps, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty
|
|
2006
|
+
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] = useMemo(() => {
|
|
2007
|
+
return splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
|
2006
2008
|
}, [combinedProps])
|
|
2007
2009
|
|
|
2008
2010
|
function recipeClass() {
|
|
@@ -2030,12 +2032,12 @@ function generateReactJsxFactory(ctx) {
|
|
|
2030
2032
|
})
|
|
2031
2033
|
|
|
2032
2034
|
const name = getDisplayName(Dynamic)
|
|
2033
|
-
|
|
2035
|
+
|
|
2034
2036
|
${componentName}.displayName = \`${factoryName}.\${name}\`
|
|
2035
2037
|
${componentName}.__cva__ = cvaFn
|
|
2036
2038
|
${componentName}.__base__ = Dynamic
|
|
2037
2039
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
2038
|
-
|
|
2040
|
+
|
|
2039
2041
|
return ${componentName}
|
|
2040
2042
|
}
|
|
2041
2043
|
|
|
@@ -2292,13 +2294,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2292
2294
|
${ctx.file.import("isCssProperty, allCssProperties", "./is-valid-prop")}
|
|
2293
2295
|
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
2294
2296
|
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
2295
|
-
|
|
2297
|
+
|
|
2296
2298
|
function styledFn(element, configOrCva = {}, options = {}) {
|
|
2297
2299
|
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
2298
2300
|
|
|
2299
2301
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
2300
2302
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
2301
|
-
|
|
2303
|
+
|
|
2302
2304
|
const defaultProps = Object.assign(
|
|
2303
2305
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
2304
2306
|
options.defaultProps,
|
|
@@ -2306,19 +2308,21 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2306
2308
|
|
|
2307
2309
|
const ${componentName} = (props) => {
|
|
2308
2310
|
const mergedProps = mergeProps({ as: element.__base__ || element }, defaultProps, props)
|
|
2309
|
-
|
|
2311
|
+
|
|
2310
2312
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
2311
2313
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
2312
|
-
|
|
2313
|
-
const forwardedKeys = createMemo(() => Object.keys(props).filter(shouldForwardProp))
|
|
2314
2314
|
|
|
2315
|
-
const
|
|
2315
|
+
const forwardedKeys = createMemo(() =>
|
|
2316
|
+
Object.keys(props).filter((prop) => !normalizeHTMLProps.keys.includes(prop) && shouldForwardProp(prop)),
|
|
2317
|
+
)
|
|
2318
|
+
|
|
2319
|
+
const [localProps, htmlProps, forwardedProps, variantProps, styleProps, elementProps] = splitProps(
|
|
2316
2320
|
mergedProps,
|
|
2317
2321
|
['as', 'class', 'className'],
|
|
2322
|
+
normalizeHTMLProps.keys,
|
|
2318
2323
|
forwardedKeys(),
|
|
2319
2324
|
__cvaFn__.variantKeys,
|
|
2320
2325
|
allCssProperties,
|
|
2321
|
-
normalizeHTMLProps.keys
|
|
2322
2326
|
)
|
|
2323
2327
|
|
|
2324
2328
|
function recipeClass() {
|
|
@@ -2363,7 +2367,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2363
2367
|
${componentName}.__cva__ = cvaFn
|
|
2364
2368
|
${componentName}.__base__ = element
|
|
2365
2369
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
2366
|
-
|
|
2370
|
+
|
|
2367
2371
|
return ${componentName}
|
|
2368
2372
|
}
|
|
2369
2373
|
|
|
@@ -2622,15 +2626,15 @@ function generateVueJsxFactory(ctx) {
|
|
|
2622
2626
|
|
|
2623
2627
|
function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
|
2624
2628
|
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
2625
|
-
|
|
2629
|
+
|
|
2626
2630
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
2627
2631
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
2628
|
-
|
|
2632
|
+
|
|
2629
2633
|
const defaultProps = Object.assign(
|
|
2630
2634
|
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
|
2631
2635
|
options.defaultProps,
|
|
2632
2636
|
)
|
|
2633
|
-
|
|
2637
|
+
|
|
2634
2638
|
const name = getDisplayName(Dynamic)
|
|
2635
2639
|
|
|
2636
2640
|
const ${componentName} = defineComponent({
|
|
@@ -2640,22 +2644,22 @@ function generateVueJsxFactory(ctx) {
|
|
|
2640
2644
|
setup(props, { slots, attrs }) {
|
|
2641
2645
|
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn)
|
|
2642
2646
|
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp)
|
|
2643
|
-
|
|
2647
|
+
|
|
2644
2648
|
const combinedProps = computed(() => Object.assign({}, defaultProps, attrs))
|
|
2645
|
-
|
|
2649
|
+
|
|
2646
2650
|
const splittedProps = computed(() => {
|
|
2647
|
-
return splitProps(combinedProps.value, shouldForwardProp, __cvaFn__.variantKeys, isCssProperty
|
|
2651
|
+
return splitProps(combinedProps.value, normalizeHTMLProps.keys, shouldForwardProp, __cvaFn__.variantKeys, isCssProperty)
|
|
2648
2652
|
})
|
|
2649
2653
|
|
|
2650
2654
|
const recipeClass = computed(() => {
|
|
2651
|
-
const [_forwardedProps, variantProps, styleProps,
|
|
2655
|
+
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2652
2656
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2653
2657
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
2654
2658
|
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.value.className)
|
|
2655
2659
|
})
|
|
2656
2660
|
|
|
2657
2661
|
const cvaClass = computed(() => {
|
|
2658
|
-
const [_forwardedProps, variantProps, styleProps,
|
|
2662
|
+
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2659
2663
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2660
2664
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
2661
2665
|
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className)
|
|
@@ -2664,7 +2668,7 @@ function generateVueJsxFactory(ctx) {
|
|
|
2664
2668
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
2665
2669
|
|
|
2666
2670
|
return () => {
|
|
2667
|
-
const [forwardedProps, _variantProps, _styleProps,
|
|
2671
|
+
const [htmlProps, forwardedProps, _variantProps, _styleProps, elementProps] = splittedProps.value
|
|
2668
2672
|
return h(
|
|
2669
2673
|
props.as,
|
|
2670
2674
|
{
|
|
@@ -2683,7 +2687,7 @@ function generateVueJsxFactory(ctx) {
|
|
|
2683
2687
|
${componentName}.__cva__ = cvaFn
|
|
2684
2688
|
${componentName}.__base__ = Dynamic
|
|
2685
2689
|
${componentName}.__shouldForwardProps__ = shouldForwardProp
|
|
2686
|
-
|
|
2690
|
+
|
|
2687
2691
|
return ${componentName}
|
|
2688
2692
|
}
|
|
2689
2693
|
|
|
@@ -3074,7 +3078,13 @@ function getGeneratedTypes(ctx) {
|
|
|
3074
3078
|
composition: rewriteImports(composition_d_ts_default.content),
|
|
3075
3079
|
selectors: rewriteImports(selectors_d_ts_default.content),
|
|
3076
3080
|
system: rewriteImports(
|
|
3077
|
-
match9(ctx.jsx.styleProps).with("all", () => system_types_d_ts_default.content).with(
|
|
3081
|
+
match9(ctx.jsx.styleProps).with("all", () => system_types_d_ts_default.content).with(
|
|
3082
|
+
"minimal",
|
|
3083
|
+
() => system_types_d_ts_default.content.replace("WithHTMLProps<T>,", "T,").replace(jsxStyleProps, "export type JsxStyleProps = WithCss")
|
|
3084
|
+
).with(
|
|
3085
|
+
"none",
|
|
3086
|
+
() => system_types_d_ts_default.content.replace("WithHTMLProps<T>,", "T,").replace(jsxStyleProps, "export type JsxStyleProps = {}")
|
|
3087
|
+
).exhaustive()
|
|
3078
3088
|
)
|
|
3079
3089
|
};
|
|
3080
3090
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20231023175607",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "^8.4.31",
|
|
22
22
|
"ts-pattern": "5.0.5",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
25
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
28
|
-
"@pandacss/types": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20231023175607",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20231023175607",
|
|
25
|
+
"@pandacss/logger": "0.0.0-dev-20231023175607",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20231023175607",
|
|
27
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20231023175607",
|
|
28
|
+
"@pandacss/types": "0.0.0-dev-20231023175607"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
33
|
+
"@pandacss/fixture": "0.0.0-dev-20231023175607"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|