@pandacss/generator 0.0.0-dev-20230320214959 → 0.0.0-dev-20230321103030

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
@@ -901,32 +901,29 @@ function generatePreactLayoutGrid() {
901
901
  var import_outdent13 = require("outdent");
902
902
  var import_ts_pattern2 = require("ts-pattern");
903
903
  function generatePreactJsxPattern(ctx) {
904
- const {
905
- config: { jsxFactory }
906
- } = ctx;
904
+ const { typeName, factoryName } = ctx.jsx;
907
905
  return ctx.patterns.details.map((pattern) => {
908
906
  const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
909
- const { description } = pattern.config;
910
- const { typeName } = ctx.jsx;
907
+ const { description, jsxElement = "div" } = pattern.config;
911
908
  return {
912
909
  name: dashName,
913
910
  js: import_outdent13.outdent`
914
911
  import { h } from 'preact'
915
912
  import { forwardRef } from 'preact/compat'
916
- ${ctx.file.import(jsxFactory, "./factory")}
913
+ ${ctx.file.import(factoryName, "./factory")}
917
914
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
918
915
 
919
916
  export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
920
917
  ${(0, import_ts_pattern2.match)(props.length).with(
921
918
  0,
922
919
  () => import_outdent13.outdent`
923
- return h(${jsxFactory}.div, { ref, ...props })
920
+ return h(${factoryName}.${jsxElement}, { ref, ...props })
924
921
  `
925
922
  ).otherwise(
926
923
  () => import_outdent13.outdent`
927
924
  const { ${props.join(", ")}, ...restProps } = props
928
925
  const styleProps = ${styleFnName}({${props.join(", ")}})
929
- return h(${jsxFactory}.div, { ref, ...styleProps, ...restProps })
926
+ return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
930
927
  `
931
928
  )}
932
929
  })
@@ -936,7 +933,7 @@ function generatePreactJsxPattern(ctx) {
936
933
  import type { ${upperName}Properties } from '../patterns/${dashName}'
937
934
  import type { ${typeName} } from '../types/jsx'
938
935
 
939
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
936
+ export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
940
937
 
941
938
  ${description ? `/** ${description} */` : ""}
942
939
  export declare const ${jsxName}: FunctionComponent<${upperName}Props>
@@ -1091,7 +1088,7 @@ function generateReactJsxPattern(ctx) {
1091
1088
  const { typeName, factoryName } = ctx.jsx;
1092
1089
  return ctx.patterns.details.map((pattern) => {
1093
1090
  const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
1094
- const { description } = pattern.config;
1091
+ const { description, jsxElement = "div" } = pattern.config;
1095
1092
  return {
1096
1093
  name: dashName,
1097
1094
  js: import_outdent17.outdent`
@@ -1103,13 +1100,13 @@ function generateReactJsxPattern(ctx) {
1103
1100
  ${(0, import_ts_pattern3.match)(props.length).with(
1104
1101
  0,
1105
1102
  () => import_outdent17.outdent`
1106
- return createElement(${factoryName}.div, { ref, ...props })
1103
+ return createElement(${factoryName}.${jsxElement}, { ref, ...props })
1107
1104
  `
1108
1105
  ).otherwise(
1109
1106
  () => import_outdent17.outdent`
1110
1107
  const { ${props.join(", ")}, ...restProps } = props
1111
1108
  const styleProps = ${styleFnName}({${props.join(", ")}})
1112
- return createElement(${factoryName}.div, { ref, ...styleProps, ...restProps })
1109
+ return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
1113
1110
  `
1114
1111
  )}
1115
1112
  })
@@ -1119,7 +1116,7 @@ function generateReactJsxPattern(ctx) {
1119
1116
  import type { ${upperName}Properties } from '../patterns/${dashName}'
1120
1117
  import type { ${typeName} } from '../types/jsx'
1121
1118
 
1122
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
1119
+ export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
1123
1120
 
1124
1121
  ${description ? `/** ${description} */` : ""}
1125
1122
  export declare const ${jsxName}: FunctionComponent<${upperName}Props>
@@ -1286,10 +1283,10 @@ function generateSolidLayoutGrid() {
1286
1283
  var import_outdent21 = require("outdent");
1287
1284
  var import_ts_pattern4 = require("ts-pattern");
1288
1285
  function generateSolidJsxPattern(ctx) {
1286
+ const { typeName, factoryName } = ctx.jsx;
1289
1287
  return ctx.patterns.details.map((pattern) => {
1290
1288
  const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
1291
- const { description } = pattern.config;
1292
- const { typeName, factoryName } = ctx.jsx;
1289
+ const { description, jsxElement = "div" } = pattern.config;
1293
1290
  return {
1294
1291
  name: dashName,
1295
1292
  js: import_outdent21.outdent`
@@ -1302,13 +1299,13 @@ function generateSolidJsxPattern(ctx) {
1302
1299
  ${(0, import_ts_pattern4.match)(props.length).with(
1303
1300
  0,
1304
1301
  () => import_outdent21.outdent`
1305
- return createComponent(${factoryName}.div, props)
1302
+ return createComponent(${factoryName}.${jsxElement}, props)
1306
1303
  `
1307
1304
  ).otherwise(
1308
1305
  () => import_outdent21.outdent`
1309
1306
  const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
1310
1307
  const styleProps = ${styleFnName}(patternProps)
1311
- return createComponent(${factoryName}.div, mergeProps(styleProps, restProps))
1308
+ return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, restProps))
1312
1309
  `
1313
1310
  )}
1314
1311
  }
@@ -1318,7 +1315,7 @@ function generateSolidJsxPattern(ctx) {
1318
1315
  import { ${upperName}Properties } from '../patterns/${dashName}'
1319
1316
  import { ${typeName} } from '../types/jsx'
1320
1317
 
1321
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
1318
+ export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
1322
1319
 
1323
1320
  ${description ? `/** ${description} */` : ""}
1324
1321
  export declare const ${jsxName}: Component<${upperName}Props>
package/dist/index.mjs CHANGED
@@ -870,32 +870,29 @@ function generatePreactLayoutGrid() {
870
870
  import { outdent as outdent13 } from "outdent";
871
871
  import { match as match2 } from "ts-pattern";
872
872
  function generatePreactJsxPattern(ctx) {
873
- const {
874
- config: { jsxFactory }
875
- } = ctx;
873
+ const { typeName, factoryName } = ctx.jsx;
876
874
  return ctx.patterns.details.map((pattern) => {
877
875
  const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
878
- const { description } = pattern.config;
879
- const { typeName } = ctx.jsx;
876
+ const { description, jsxElement = "div" } = pattern.config;
880
877
  return {
881
878
  name: dashName,
882
879
  js: outdent13`
883
880
  import { h } from 'preact'
884
881
  import { forwardRef } from 'preact/compat'
885
- ${ctx.file.import(jsxFactory, "./factory")}
882
+ ${ctx.file.import(factoryName, "./factory")}
886
883
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
887
884
 
888
885
  export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
889
886
  ${match2(props.length).with(
890
887
  0,
891
888
  () => outdent13`
892
- return h(${jsxFactory}.div, { ref, ...props })
889
+ return h(${factoryName}.${jsxElement}, { ref, ...props })
893
890
  `
894
891
  ).otherwise(
895
892
  () => outdent13`
896
893
  const { ${props.join(", ")}, ...restProps } = props
897
894
  const styleProps = ${styleFnName}({${props.join(", ")}})
898
- return h(${jsxFactory}.div, { ref, ...styleProps, ...restProps })
895
+ return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
899
896
  `
900
897
  )}
901
898
  })
@@ -905,7 +902,7 @@ function generatePreactJsxPattern(ctx) {
905
902
  import type { ${upperName}Properties } from '../patterns/${dashName}'
906
903
  import type { ${typeName} } from '../types/jsx'
907
904
 
908
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
905
+ export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
909
906
 
910
907
  ${description ? `/** ${description} */` : ""}
911
908
  export declare const ${jsxName}: FunctionComponent<${upperName}Props>
@@ -1060,7 +1057,7 @@ function generateReactJsxPattern(ctx) {
1060
1057
  const { typeName, factoryName } = ctx.jsx;
1061
1058
  return ctx.patterns.details.map((pattern) => {
1062
1059
  const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
1063
- const { description } = pattern.config;
1060
+ const { description, jsxElement = "div" } = pattern.config;
1064
1061
  return {
1065
1062
  name: dashName,
1066
1063
  js: outdent17`
@@ -1072,13 +1069,13 @@ function generateReactJsxPattern(ctx) {
1072
1069
  ${match3(props.length).with(
1073
1070
  0,
1074
1071
  () => outdent17`
1075
- return createElement(${factoryName}.div, { ref, ...props })
1072
+ return createElement(${factoryName}.${jsxElement}, { ref, ...props })
1076
1073
  `
1077
1074
  ).otherwise(
1078
1075
  () => outdent17`
1079
1076
  const { ${props.join(", ")}, ...restProps } = props
1080
1077
  const styleProps = ${styleFnName}({${props.join(", ")}})
1081
- return createElement(${factoryName}.div, { ref, ...styleProps, ...restProps })
1078
+ return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
1082
1079
  `
1083
1080
  )}
1084
1081
  })
@@ -1088,7 +1085,7 @@ function generateReactJsxPattern(ctx) {
1088
1085
  import type { ${upperName}Properties } from '../patterns/${dashName}'
1089
1086
  import type { ${typeName} } from '../types/jsx'
1090
1087
 
1091
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
1088
+ export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
1092
1089
 
1093
1090
  ${description ? `/** ${description} */` : ""}
1094
1091
  export declare const ${jsxName}: FunctionComponent<${upperName}Props>
@@ -1255,10 +1252,10 @@ function generateSolidLayoutGrid() {
1255
1252
  import { outdent as outdent21 } from "outdent";
1256
1253
  import { match as match4 } from "ts-pattern";
1257
1254
  function generateSolidJsxPattern(ctx) {
1255
+ const { typeName, factoryName } = ctx.jsx;
1258
1256
  return ctx.patterns.details.map((pattern) => {
1259
1257
  const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
1260
- const { description } = pattern.config;
1261
- const { typeName, factoryName } = ctx.jsx;
1258
+ const { description, jsxElement = "div" } = pattern.config;
1262
1259
  return {
1263
1260
  name: dashName,
1264
1261
  js: outdent21`
@@ -1271,13 +1268,13 @@ function generateSolidJsxPattern(ctx) {
1271
1268
  ${match4(props.length).with(
1272
1269
  0,
1273
1270
  () => outdent21`
1274
- return createComponent(${factoryName}.div, props)
1271
+ return createComponent(${factoryName}.${jsxElement}, props)
1275
1272
  `
1276
1273
  ).otherwise(
1277
1274
  () => outdent21`
1278
1275
  const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
1279
1276
  const styleProps = ${styleFnName}(patternProps)
1280
- return createComponent(${factoryName}.div, mergeProps(styleProps, restProps))
1277
+ return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, restProps))
1281
1278
  `
1282
1279
  )}
1283
1280
  }
@@ -1287,7 +1284,7 @@ function generateSolidJsxPattern(ctx) {
1287
1284
  import { ${upperName}Properties } from '../patterns/${dashName}'
1288
1285
  import { ${typeName} } from '../types/jsx'
1289
1286
 
1290
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
1287
+ export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
1291
1288
 
1292
1289
  ${description ? `/** ${description} */` : ""}
1293
1290
  export declare const ${jsxName}: Component<${upperName}Props>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.0.0-dev-20230320214959",
3
+ "version": "0.0.0-dev-20230321103030",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -20,16 +20,16 @@
20
20
  "pluralize": "8.0.0",
21
21
  "postcss": "8.4.21",
22
22
  "ts-pattern": "4.2.1",
23
- "@pandacss/core": "0.0.0-dev-20230320214959",
24
- "@pandacss/logger": "0.0.0-dev-20230320214959",
25
- "@pandacss/is-valid-prop": "0.0.0-dev-20230320214959",
26
- "@pandacss/shared": "0.0.0-dev-20230320214959",
27
- "@pandacss/types": "0.0.0-dev-20230320214959",
28
- "@pandacss/token-dictionary": "0.0.0-dev-20230320214959"
23
+ "@pandacss/core": "0.0.0-dev-20230321103030",
24
+ "@pandacss/logger": "0.0.0-dev-20230321103030",
25
+ "@pandacss/is-valid-prop": "0.0.0-dev-20230321103030",
26
+ "@pandacss/shared": "0.0.0-dev-20230321103030",
27
+ "@pandacss/types": "0.0.0-dev-20230321103030",
28
+ "@pandacss/token-dictionary": "0.0.0-dev-20230321103030"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/pluralize": "0.0.29",
32
- "@pandacss/fixture": "0.0.0-dev-20230320214959"
32
+ "@pandacss/fixture": "0.0.0-dev-20230321103030"
33
33
  },
34
34
  "scripts": {
35
35
  "prebuild": "tsx scripts/prebuild.ts",