@pandacss/generator 1.11.1 → 1.11.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
@@ -1383,7 +1383,10 @@ function generatePreactCreateStyleContext(ctx) {
1383
1383
 
1384
1384
  const WithProvider = forwardRef(function WithProvider(props, ref) {
1385
1385
  const [variantProps, restProps] = svaFn.splitVariantProps(props)
1386
-
1386
+ options?.forwardProps?.forEach((key) => {
1387
+ if (key in variantProps) restProps[key] = variantProps[key]
1388
+ })
1389
+
1387
1390
  const slotStyles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
1388
1391
  slotStyles._classNameMap = svaFn.classNameMap
1389
1392
 
@@ -2298,7 +2301,10 @@ function generateReactCreateStyleContext(ctx) {
2298
2301
 
2299
2302
  const WithProvider = forwardRef((props, ref) => {
2300
2303
  const [variantProps, restProps] = svaFn.splitVariantProps(props)
2301
-
2304
+ options?.forwardProps?.forEach((key) => {
2305
+ if (key in variantProps) restProps[key] = variantProps[key]
2306
+ })
2307
+
2302
2308
  const slotStyles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
2303
2309
  slotStyles._classNameMap = svaFn.classNameMap
2304
2310
 
@@ -2920,6 +2926,14 @@ function generateSolidCreateStyleContext(ctx) {
2920
2926
  const [variantProps, restProps] = svaFn.splitVariantProps(props)
2921
2927
  const [local, propsWithoutChildren] = splitProps(restProps, ["children"])
2922
2928
 
2929
+ // forward selected variant props to the component without losing reactivity
2930
+ const forwardedProps = {}
2931
+ options?.forwardProps?.forEach((key) => {
2932
+ if (key in variantProps) {
2933
+ Object.defineProperty(forwardedProps, key, { get: () => variantProps[key], enumerable: true })
2934
+ }
2935
+ })
2936
+
2923
2937
  const slotStyles = createMemo(() => {
2924
2938
  const styles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
2925
2939
  styles._classNameMap = svaFn.classNameMap
@@ -2943,7 +2957,7 @@ function generateSolidCreateStyleContext(ctx) {
2943
2957
  get children() {
2944
2958
  return createComponent(
2945
2959
  StyledComponent,
2946
- mergeProps(resolvedProps, {
2960
+ mergeProps(resolvedProps, forwardedProps, {
2947
2961
  get children() {
2948
2962
  return local.children
2949
2963
  },
@@ -3567,6 +3581,9 @@ function generateVueCreateStyleContext(ctx) {
3567
3581
  })
3568
3582
  const res = computed(() => {
3569
3583
  const [variantProps, restProps] = svaFn.splitVariantProps(props.value)
3584
+ options?.forwardProps?.forEach((key) => {
3585
+ if (key in variantProps) restProps[key] = variantProps[key]
3586
+ })
3570
3587
  return { variantProps, restProps }
3571
3588
  })
3572
3589
 
package/dist/index.mjs CHANGED
@@ -1346,7 +1346,10 @@ function generatePreactCreateStyleContext(ctx) {
1346
1346
 
1347
1347
  const WithProvider = forwardRef(function WithProvider(props, ref) {
1348
1348
  const [variantProps, restProps] = svaFn.splitVariantProps(props)
1349
-
1349
+ options?.forwardProps?.forEach((key) => {
1350
+ if (key in variantProps) restProps[key] = variantProps[key]
1351
+ })
1352
+
1350
1353
  const slotStyles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
1351
1354
  slotStyles._classNameMap = svaFn.classNameMap
1352
1355
 
@@ -2261,7 +2264,10 @@ function generateReactCreateStyleContext(ctx) {
2261
2264
 
2262
2265
  const WithProvider = forwardRef((props, ref) => {
2263
2266
  const [variantProps, restProps] = svaFn.splitVariantProps(props)
2264
-
2267
+ options?.forwardProps?.forEach((key) => {
2268
+ if (key in variantProps) restProps[key] = variantProps[key]
2269
+ })
2270
+
2265
2271
  const slotStyles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
2266
2272
  slotStyles._classNameMap = svaFn.classNameMap
2267
2273
 
@@ -2883,6 +2889,14 @@ function generateSolidCreateStyleContext(ctx) {
2883
2889
  const [variantProps, restProps] = svaFn.splitVariantProps(props)
2884
2890
  const [local, propsWithoutChildren] = splitProps(restProps, ["children"])
2885
2891
 
2892
+ // forward selected variant props to the component without losing reactivity
2893
+ const forwardedProps = {}
2894
+ options?.forwardProps?.forEach((key) => {
2895
+ if (key in variantProps) {
2896
+ Object.defineProperty(forwardedProps, key, { get: () => variantProps[key], enumerable: true })
2897
+ }
2898
+ })
2899
+
2886
2900
  const slotStyles = createMemo(() => {
2887
2901
  const styles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
2888
2902
  styles._classNameMap = svaFn.classNameMap
@@ -2906,7 +2920,7 @@ function generateSolidCreateStyleContext(ctx) {
2906
2920
  get children() {
2907
2921
  return createComponent(
2908
2922
  StyledComponent,
2909
- mergeProps(resolvedProps, {
2923
+ mergeProps(resolvedProps, forwardedProps, {
2910
2924
  get children() {
2911
2925
  return local.children
2912
2926
  },
@@ -3530,6 +3544,9 @@ function generateVueCreateStyleContext(ctx) {
3530
3544
  })
3531
3545
  const res = computed(() => {
3532
3546
  const [variantProps, restProps] = svaFn.splitVariantProps(props.value)
3547
+ options?.forwardProps?.forEach((key) => {
3548
+ if (key in variantProps) restProps[key] = variantProps[key]
3549
+ })
3533
3550
  return { variantProps, restProps }
3534
3551
  })
3535
3552
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -38,16 +38,19 @@
38
38
  "pluralize": "8.0.0",
39
39
  "postcss": "8.5.14",
40
40
  "ts-pattern": "5.9.0",
41
- "@pandacss/core": "1.11.1",
42
- "@pandacss/is-valid-prop": "^1.11.1",
43
- "@pandacss/logger": "1.11.1",
44
- "@pandacss/shared": "1.11.1",
45
- "@pandacss/token-dictionary": "1.11.1",
46
- "@pandacss/types": "1.11.1"
41
+ "@pandacss/core": "1.11.3",
42
+ "@pandacss/is-valid-prop": "^1.11.3",
43
+ "@pandacss/logger": "1.11.3",
44
+ "@pandacss/shared": "1.11.3",
45
+ "@pandacss/token-dictionary": "1.11.3",
46
+ "@pandacss/types": "1.11.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/pluralize": "0.0.33"
50
50
  },
51
+ "engines": {
52
+ "node": ">=20"
53
+ },
51
54
  "scripts": {
52
55
  "build": "tsup src/index.ts --format=esm,cjs --dts",
53
56
  "build-fast": "tsup src/index.ts --format=esm,cjs --no-dts",