@pandacss/generator 0.0.0-dev-20230703201107 → 0.0.0-dev-20230704200435
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 +121 -113
- package/dist/index.mjs +122 -114
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -99,7 +99,7 @@ var getMessages = (ctx) => ({
|
|
|
99
99
|
|
|
100
100
|
// src/artifacts/index.ts
|
|
101
101
|
import { isObject } from "@pandacss/shared";
|
|
102
|
-
import
|
|
102
|
+
import outdent42 from "outdent";
|
|
103
103
|
|
|
104
104
|
// src/artifacts/css/global-css.ts
|
|
105
105
|
var generateGlobalCss = (ctx) => {
|
|
@@ -821,6 +821,7 @@ var is_valid_prop_mjs_default = {
|
|
|
821
821
|
};
|
|
822
822
|
|
|
823
823
|
// src/artifacts/js/is-valid-prop.ts
|
|
824
|
+
import { outdent as outdent9 } from "outdent";
|
|
824
825
|
function generateisValidProp(ctx) {
|
|
825
826
|
if (ctx.isTemplateLiteralSyntax)
|
|
826
827
|
return;
|
|
@@ -830,14 +831,19 @@ function generateisValidProp(ctx) {
|
|
|
830
831
|
`var userGenerated = [${ctx.properties.map((key) => JSON.stringify(key)).join(",")}]`
|
|
831
832
|
);
|
|
832
833
|
return {
|
|
833
|
-
js: content
|
|
834
|
+
js: content,
|
|
835
|
+
dts: outdent9`
|
|
836
|
+
declare const isCssProperty: (value: string) => boolean;
|
|
837
|
+
|
|
838
|
+
export { isCssProperty };
|
|
839
|
+
`
|
|
834
840
|
};
|
|
835
841
|
}
|
|
836
842
|
|
|
837
843
|
// src/artifacts/js/pattern.ts
|
|
838
844
|
import { unionType } from "@pandacss/shared";
|
|
839
845
|
import { stringify as stringify2 } from "javascript-stringify";
|
|
840
|
-
import { outdent as
|
|
846
|
+
import { outdent as outdent10 } from "outdent";
|
|
841
847
|
import { match } from "ts-pattern";
|
|
842
848
|
function generatePattern(ctx) {
|
|
843
849
|
if (ctx.patterns.isEmpty())
|
|
@@ -855,7 +861,7 @@ function generatePattern(ctx) {
|
|
|
855
861
|
}
|
|
856
862
|
return {
|
|
857
863
|
name: dashName,
|
|
858
|
-
dts:
|
|
864
|
+
dts: outdent10`
|
|
859
865
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
860
866
|
import type { PropertyValue } from '../types/prop-type'
|
|
861
867
|
import type { Properties } from '../types/csstype'
|
|
@@ -879,7 +885,7 @@ function generatePattern(ctx) {
|
|
|
879
885
|
}).join("\n ")}
|
|
880
886
|
}
|
|
881
887
|
|
|
882
|
-
${strict ?
|
|
888
|
+
${strict ? outdent10`export declare function ${name}(options: ${upperName}Properties): string` : outdent10`
|
|
883
889
|
|
|
884
890
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
885
891
|
|
|
@@ -888,7 +894,7 @@ function generatePattern(ctx) {
|
|
|
888
894
|
`}
|
|
889
895
|
|
|
890
896
|
`,
|
|
891
|
-
js:
|
|
897
|
+
js: outdent10`
|
|
892
898
|
${ctx.file.import(helperImports.join(", "), "../helpers")}
|
|
893
899
|
${ctx.file.import("css", "../css/index")}
|
|
894
900
|
|
|
@@ -905,7 +911,7 @@ transform`)}
|
|
|
905
911
|
|
|
906
912
|
// src/artifacts/js/recipe.ts
|
|
907
913
|
import { unionType as unionType2 } from "@pandacss/shared";
|
|
908
|
-
import { outdent as
|
|
914
|
+
import { outdent as outdent11 } from "outdent";
|
|
909
915
|
var stringify3 = (value) => JSON.stringify(value, null, 2);
|
|
910
916
|
var isBooleanValue = (value) => value === "true" || value === "false";
|
|
911
917
|
function generateRecipes(ctx) {
|
|
@@ -919,7 +925,7 @@ function generateRecipes(ctx) {
|
|
|
919
925
|
const createRecipeFn = {
|
|
920
926
|
name: "create-recipe",
|
|
921
927
|
dts: "",
|
|
922
|
-
js:
|
|
928
|
+
js: outdent11`
|
|
923
929
|
${ctx.file.import("css", "../css/css")}
|
|
924
930
|
${ctx.file.import("assertCompoundVariant, getCompoundVariantCss", "../css/cva")}
|
|
925
931
|
${ctx.file.import("cx", "../css/cx")}
|
|
@@ -966,7 +972,7 @@ function generateRecipes(ctx) {
|
|
|
966
972
|
const { name, description, defaultVariants, compoundVariants } = config;
|
|
967
973
|
return {
|
|
968
974
|
name: dashName,
|
|
969
|
-
js:
|
|
975
|
+
js: outdent11`
|
|
970
976
|
${ctx.file.import("splitProps", "../helpers")}
|
|
971
977
|
${ctx.file.import("createRecipe", "./create-recipe")}
|
|
972
978
|
|
|
@@ -987,7 +993,7 @@ function generateRecipes(ctx) {
|
|
|
987
993
|
splitVariantProps,
|
|
988
994
|
})
|
|
989
995
|
`,
|
|
990
|
-
dts:
|
|
996
|
+
dts: outdent11`
|
|
991
997
|
import type { ConditionalValue } from '../types'
|
|
992
998
|
import type { Pretty } from '../types/helpers'
|
|
993
999
|
|
|
@@ -1025,7 +1031,7 @@ function generateRecipes(ctx) {
|
|
|
1025
1031
|
}
|
|
1026
1032
|
|
|
1027
1033
|
// src/artifacts/js/token.ts
|
|
1028
|
-
import
|
|
1034
|
+
import outdent12 from "outdent";
|
|
1029
1035
|
function generateTokenJs(ctx) {
|
|
1030
1036
|
const { tokens } = ctx;
|
|
1031
1037
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1036,7 +1042,7 @@ function generateTokenJs(ctx) {
|
|
|
1036
1042
|
});
|
|
1037
1043
|
const obj = Object.fromEntries(map);
|
|
1038
1044
|
return {
|
|
1039
|
-
js:
|
|
1045
|
+
js: outdent12`
|
|
1040
1046
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1041
1047
|
|
|
1042
1048
|
export function token(path, fallback) {
|
|
@@ -1049,7 +1055,7 @@ function generateTokenJs(ctx) {
|
|
|
1049
1055
|
|
|
1050
1056
|
token.var = tokenVar
|
|
1051
1057
|
`,
|
|
1052
|
-
dts:
|
|
1058
|
+
dts: outdent12`
|
|
1053
1059
|
import type { Token } from './tokens'
|
|
1054
1060
|
|
|
1055
1061
|
export declare const token: {
|
|
@@ -1063,11 +1069,11 @@ function generateTokenJs(ctx) {
|
|
|
1063
1069
|
}
|
|
1064
1070
|
|
|
1065
1071
|
// src/artifacts/preact-jsx/jsx.ts
|
|
1066
|
-
import { outdent as
|
|
1072
|
+
import { outdent as outdent13 } from "outdent";
|
|
1067
1073
|
function generatePreactJsxFactory(ctx) {
|
|
1068
1074
|
const { factoryName, componentName } = ctx.jsx;
|
|
1069
1075
|
return {
|
|
1070
|
-
js:
|
|
1076
|
+
js: outdent13`
|
|
1071
1077
|
import { h } from 'preact'
|
|
1072
1078
|
import { forwardRef } from 'preact/compat'
|
|
1073
1079
|
import { useMemo } from 'preact/hooks'
|
|
@@ -1134,7 +1140,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1134
1140
|
}
|
|
1135
1141
|
|
|
1136
1142
|
// src/artifacts/preact-jsx/pattern.ts
|
|
1137
|
-
import { outdent as
|
|
1143
|
+
import { outdent as outdent14 } from "outdent";
|
|
1138
1144
|
import { match as match2 } from "ts-pattern";
|
|
1139
1145
|
function generatePreactJsxPattern(ctx) {
|
|
1140
1146
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1143,7 +1149,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1143
1149
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1144
1150
|
return {
|
|
1145
1151
|
name: dashName,
|
|
1146
|
-
js:
|
|
1152
|
+
js: outdent14`
|
|
1147
1153
|
import { h } from 'preact'
|
|
1148
1154
|
import { forwardRef } from 'preact/compat'
|
|
1149
1155
|
${ctx.file.import(factoryName, "./factory")}
|
|
@@ -1152,12 +1158,12 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1152
1158
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1153
1159
|
${match2(props.length).with(
|
|
1154
1160
|
0,
|
|
1155
|
-
() =>
|
|
1161
|
+
() => outdent14`
|
|
1156
1162
|
const styleProps = ${styleFnName}()
|
|
1157
1163
|
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1158
1164
|
`
|
|
1159
1165
|
).otherwise(
|
|
1160
|
-
() =>
|
|
1166
|
+
() => outdent14`
|
|
1161
1167
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1162
1168
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1163
1169
|
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1165,7 +1171,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1165
1171
|
)}
|
|
1166
1172
|
})
|
|
1167
1173
|
`,
|
|
1168
|
-
dts:
|
|
1174
|
+
dts: outdent14`
|
|
1169
1175
|
import type { FunctionComponent } from 'preact'
|
|
1170
1176
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1171
1177
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1180,15 +1186,15 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1180
1186
|
}
|
|
1181
1187
|
|
|
1182
1188
|
// src/artifacts/preact-jsx/types.ts
|
|
1183
|
-
import { outdent as
|
|
1189
|
+
import { outdent as outdent15 } from "outdent";
|
|
1184
1190
|
function generatePreactJsxTypes(ctx) {
|
|
1185
1191
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1186
1192
|
return {
|
|
1187
|
-
jsxFactory:
|
|
1193
|
+
jsxFactory: outdent15`
|
|
1188
1194
|
import type { ${upperName} } from '../types/jsx'
|
|
1189
1195
|
export declare const ${factoryName}: ${upperName}
|
|
1190
1196
|
`,
|
|
1191
|
-
jsxType:
|
|
1197
|
+
jsxType: outdent15`
|
|
1192
1198
|
import type { ComponentProps, JSX } from 'preact'
|
|
1193
1199
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1194
1200
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1223,11 +1229,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1223
1229
|
}
|
|
1224
1230
|
|
|
1225
1231
|
// src/artifacts/preact-jsx/jsx.string-literal.ts
|
|
1226
|
-
import { outdent as
|
|
1232
|
+
import { outdent as outdent16 } from "outdent";
|
|
1227
1233
|
function generatePreactJsxStringLiteralFactory(ctx) {
|
|
1228
1234
|
const { factoryName, componentName } = ctx.jsx;
|
|
1229
1235
|
return {
|
|
1230
|
-
js:
|
|
1236
|
+
js: outdent16`
|
|
1231
1237
|
import { h } from 'preact'
|
|
1232
1238
|
import { forwardRef } from 'preact/compat'
|
|
1233
1239
|
${ctx.file.import("css, cx", "../css/index")}
|
|
@@ -1273,15 +1279,15 @@ function generatePreactJsxStringLiteralFactory(ctx) {
|
|
|
1273
1279
|
}
|
|
1274
1280
|
|
|
1275
1281
|
// src/artifacts/preact-jsx/types.string-literal.ts
|
|
1276
|
-
import { outdent as
|
|
1282
|
+
import { outdent as outdent17 } from "outdent";
|
|
1277
1283
|
function generatePreactJsxStringLiteralTypes(ctx) {
|
|
1278
1284
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1279
1285
|
return {
|
|
1280
|
-
jsxFactory:
|
|
1286
|
+
jsxFactory: outdent17`
|
|
1281
1287
|
import type { ${upperName} } from '../types/jsx'
|
|
1282
1288
|
export declare const ${factoryName}: ${upperName}
|
|
1283
1289
|
`,
|
|
1284
|
-
jsxType:
|
|
1290
|
+
jsxType: outdent17`
|
|
1285
1291
|
import type { ComponentProps, JSX } from 'preact'
|
|
1286
1292
|
|
|
1287
1293
|
type ElementType = keyof JSX.IntrinsicElements
|
|
@@ -1307,11 +1313,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1307
1313
|
}
|
|
1308
1314
|
|
|
1309
1315
|
// src/artifacts/qwik-jsx/jsx.ts
|
|
1310
|
-
import { outdent as
|
|
1316
|
+
import { outdent as outdent18 } from "outdent";
|
|
1311
1317
|
function generateQwikJsxFactory(ctx) {
|
|
1312
1318
|
const { factoryName, componentName } = ctx.jsx;
|
|
1313
1319
|
return {
|
|
1314
|
-
js:
|
|
1320
|
+
js: outdent18`
|
|
1315
1321
|
import { h } from '@builder.io/qwik'
|
|
1316
1322
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1317
1323
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -1375,7 +1381,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1375
1381
|
}
|
|
1376
1382
|
|
|
1377
1383
|
// src/artifacts/qwik-jsx/pattern.ts
|
|
1378
|
-
import { outdent as
|
|
1384
|
+
import { outdent as outdent19 } from "outdent";
|
|
1379
1385
|
import { match as match3 } from "ts-pattern";
|
|
1380
1386
|
function generateQwikJsxPattern(ctx) {
|
|
1381
1387
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1384,7 +1390,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1384
1390
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1385
1391
|
return {
|
|
1386
1392
|
name: dashName,
|
|
1387
|
-
js:
|
|
1393
|
+
js: outdent19`
|
|
1388
1394
|
import { h } from '@builder.io/qwik'
|
|
1389
1395
|
${ctx.file.import(factoryName, "./factory")}
|
|
1390
1396
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -1392,12 +1398,12 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1392
1398
|
export const ${jsxName} = function ${jsxName}(props) {
|
|
1393
1399
|
${match3(props.length).with(
|
|
1394
1400
|
0,
|
|
1395
|
-
() =>
|
|
1401
|
+
() => outdent19`
|
|
1396
1402
|
const styleProps = ${styleFnName}()
|
|
1397
1403
|
return h(${factoryName}.${jsxElement}, { ...styleProps, ...props })
|
|
1398
1404
|
`
|
|
1399
1405
|
).otherwise(
|
|
1400
|
-
() =>
|
|
1406
|
+
() => outdent19`
|
|
1401
1407
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1402
1408
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1403
1409
|
return h(${factoryName}.${jsxElement}, { ...styleProps, ...restProps })
|
|
@@ -1405,7 +1411,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1405
1411
|
)}
|
|
1406
1412
|
}
|
|
1407
1413
|
`,
|
|
1408
|
-
dts:
|
|
1414
|
+
dts: outdent19`
|
|
1409
1415
|
import type { FunctionComponent } from '@builder.io/qwik'
|
|
1410
1416
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1411
1417
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1424,15 +1430,15 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1424
1430
|
}
|
|
1425
1431
|
|
|
1426
1432
|
// src/artifacts/qwik-jsx/types.ts
|
|
1427
|
-
import { outdent as
|
|
1433
|
+
import { outdent as outdent20 } from "outdent";
|
|
1428
1434
|
function generateQwikJsxTypes(ctx) {
|
|
1429
1435
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1430
1436
|
return {
|
|
1431
|
-
jsxFactory:
|
|
1437
|
+
jsxFactory: outdent20`
|
|
1432
1438
|
import { ${upperName} } from '../types/jsx'
|
|
1433
1439
|
export declare const ${factoryName}: ${upperName}
|
|
1434
1440
|
`,
|
|
1435
|
-
jsxType:
|
|
1441
|
+
jsxType: outdent20`
|
|
1436
1442
|
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1437
1443
|
import type { Assign as _Assign, JsxStyleProps, PatchedHTMLProps } from './system-types'
|
|
1438
1444
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1486,11 +1492,11 @@ export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T>, JsxSt
|
|
|
1486
1492
|
}
|
|
1487
1493
|
|
|
1488
1494
|
// src/artifacts/qwik-jsx/jsx.string-literal.ts
|
|
1489
|
-
import { outdent as
|
|
1495
|
+
import { outdent as outdent21 } from "outdent";
|
|
1490
1496
|
function generateQwikJsxStringLiteralFactory(ctx) {
|
|
1491
1497
|
const { factoryName, componentName } = ctx.jsx;
|
|
1492
1498
|
return {
|
|
1493
|
-
js:
|
|
1499
|
+
js: outdent21`
|
|
1494
1500
|
import { h } from '@builder.io/qwik'
|
|
1495
1501
|
${ctx.file.import("css, cx", "../css/index")}
|
|
1496
1502
|
|
|
@@ -1535,15 +1541,15 @@ function generateQwikJsxStringLiteralFactory(ctx) {
|
|
|
1535
1541
|
}
|
|
1536
1542
|
|
|
1537
1543
|
// src/artifacts/qwik-jsx/types.string-literal.ts
|
|
1538
|
-
import { outdent as
|
|
1544
|
+
import { outdent as outdent22 } from "outdent";
|
|
1539
1545
|
function generateQwikJsxStringLiteralTypes(ctx) {
|
|
1540
1546
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1541
1547
|
return {
|
|
1542
|
-
jsxFactory:
|
|
1548
|
+
jsxFactory: outdent22`
|
|
1543
1549
|
import { ${upperName} } from '../types/jsx'
|
|
1544
1550
|
export declare const ${factoryName}: ${upperName}
|
|
1545
1551
|
`,
|
|
1546
|
-
jsxType:
|
|
1552
|
+
jsxType: outdent22`
|
|
1547
1553
|
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1548
1554
|
|
|
1549
1555
|
type ElementType = keyof QwikIntrinsicElements | FunctionComponent<any>
|
|
@@ -1574,11 +1580,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1574
1580
|
}
|
|
1575
1581
|
|
|
1576
1582
|
// src/artifacts/react-jsx/jsx.ts
|
|
1577
|
-
import { outdent as
|
|
1583
|
+
import { outdent as outdent23 } from "outdent";
|
|
1578
1584
|
function generateReactJsxFactory(ctx) {
|
|
1579
1585
|
const { factoryName, componentName } = ctx.jsx;
|
|
1580
1586
|
return {
|
|
1581
|
-
js:
|
|
1587
|
+
js: outdent23`
|
|
1582
1588
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
1583
1589
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1584
1590
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -1644,7 +1650,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1644
1650
|
}
|
|
1645
1651
|
|
|
1646
1652
|
// src/artifacts/react-jsx/pattern.ts
|
|
1647
|
-
import { outdent as
|
|
1653
|
+
import { outdent as outdent24 } from "outdent";
|
|
1648
1654
|
import { match as match4 } from "ts-pattern";
|
|
1649
1655
|
function generateReactJsxPattern(ctx) {
|
|
1650
1656
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1653,7 +1659,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1653
1659
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1654
1660
|
return {
|
|
1655
1661
|
name: dashName,
|
|
1656
|
-
js:
|
|
1662
|
+
js: outdent24`
|
|
1657
1663
|
import { createElement, forwardRef } from 'react'
|
|
1658
1664
|
${ctx.file.import(factoryName, "./factory")}
|
|
1659
1665
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -1661,12 +1667,12 @@ function generateReactJsxPattern(ctx) {
|
|
|
1661
1667
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1662
1668
|
${match4(props.length).with(
|
|
1663
1669
|
0,
|
|
1664
|
-
() =>
|
|
1670
|
+
() => outdent24`
|
|
1665
1671
|
const styleProps = ${styleFnName}()
|
|
1666
1672
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1667
1673
|
`
|
|
1668
1674
|
).otherwise(
|
|
1669
|
-
() =>
|
|
1675
|
+
() => outdent24`
|
|
1670
1676
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1671
1677
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1672
1678
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1674,7 +1680,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1674
1680
|
)}
|
|
1675
1681
|
})
|
|
1676
1682
|
`,
|
|
1677
|
-
dts:
|
|
1683
|
+
dts: outdent24`
|
|
1678
1684
|
import type { FunctionComponent } from 'react'
|
|
1679
1685
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1680
1686
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1689,15 +1695,15 @@ function generateReactJsxPattern(ctx) {
|
|
|
1689
1695
|
}
|
|
1690
1696
|
|
|
1691
1697
|
// src/artifacts/react-jsx/types.ts
|
|
1692
|
-
import { outdent as
|
|
1698
|
+
import { outdent as outdent25 } from "outdent";
|
|
1693
1699
|
function generateReactJsxTypes(ctx) {
|
|
1694
1700
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1695
1701
|
return {
|
|
1696
|
-
jsxFactory:
|
|
1702
|
+
jsxFactory: outdent25`
|
|
1697
1703
|
import { ${upperName} } from '../types/jsx'
|
|
1698
1704
|
export declare const ${factoryName}: ${upperName}
|
|
1699
1705
|
`,
|
|
1700
|
-
jsxType:
|
|
1706
|
+
jsxType: outdent25`
|
|
1701
1707
|
import type { ComponentProps, ElementType } from 'react'
|
|
1702
1708
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1703
1709
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1730,11 +1736,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1730
1736
|
}
|
|
1731
1737
|
|
|
1732
1738
|
// src/artifacts/react-jsx/jsx.string-literal.ts
|
|
1733
|
-
import { outdent as
|
|
1739
|
+
import { outdent as outdent26 } from "outdent";
|
|
1734
1740
|
function generateReactJsxStringLiteralFactory(ctx) {
|
|
1735
1741
|
const { factoryName, componentName } = ctx.jsx;
|
|
1736
1742
|
return {
|
|
1737
|
-
js:
|
|
1743
|
+
js: outdent26`
|
|
1738
1744
|
import { createElement, forwardRef } from 'react'
|
|
1739
1745
|
${ctx.file.import("css, cx", "../css/index")}
|
|
1740
1746
|
|
|
@@ -1780,15 +1786,15 @@ function generateReactJsxStringLiteralFactory(ctx) {
|
|
|
1780
1786
|
}
|
|
1781
1787
|
|
|
1782
1788
|
// src/artifacts/react-jsx/types.string-literal.ts
|
|
1783
|
-
import { outdent as
|
|
1789
|
+
import { outdent as outdent27 } from "outdent";
|
|
1784
1790
|
function generateReactJsxStringLiteralTypes(ctx) {
|
|
1785
1791
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1786
1792
|
return {
|
|
1787
|
-
jsxFactory:
|
|
1793
|
+
jsxFactory: outdent27`
|
|
1788
1794
|
import { ${upperName} } from '../types/jsx'
|
|
1789
1795
|
export declare const ${factoryName}: ${upperName}
|
|
1790
1796
|
`,
|
|
1791
|
-
jsxType:
|
|
1797
|
+
jsxType: outdent27`
|
|
1792
1798
|
import type { ComponentProps, ElementType } from 'react'
|
|
1793
1799
|
|
|
1794
1800
|
type Dict = Record<string, unknown>
|
|
@@ -1812,11 +1818,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1812
1818
|
}
|
|
1813
1819
|
|
|
1814
1820
|
// src/artifacts/solid-jsx/jsx.ts
|
|
1815
|
-
import { outdent as
|
|
1821
|
+
import { outdent as outdent28 } from "outdent";
|
|
1816
1822
|
function generateSolidJsxFactory(ctx) {
|
|
1817
1823
|
const { componentName, factoryName } = ctx.jsx;
|
|
1818
1824
|
return {
|
|
1819
|
-
js:
|
|
1825
|
+
js: outdent28`
|
|
1820
1826
|
import { Dynamic } from 'solid-js/web'
|
|
1821
1827
|
import { mergeProps, splitProps } from 'solid-js'
|
|
1822
1828
|
import { createComponent } from 'solid-js/web'
|
|
@@ -1893,7 +1899,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1893
1899
|
}
|
|
1894
1900
|
|
|
1895
1901
|
// src/artifacts/solid-jsx/pattern.ts
|
|
1896
|
-
import { outdent as
|
|
1902
|
+
import { outdent as outdent29 } from "outdent";
|
|
1897
1903
|
import { match as match5 } from "ts-pattern";
|
|
1898
1904
|
function generateSolidJsxPattern(ctx) {
|
|
1899
1905
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1902,7 +1908,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1902
1908
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1903
1909
|
return {
|
|
1904
1910
|
name: dashName,
|
|
1905
|
-
js:
|
|
1911
|
+
js: outdent29`
|
|
1906
1912
|
import { splitProps, mergeProps } from 'solid-js'
|
|
1907
1913
|
import { createComponent } from 'solid-js/web'
|
|
1908
1914
|
${ctx.file.import(factoryName, "./factory")}
|
|
@@ -1911,12 +1917,12 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1911
1917
|
export function ${jsxName}(props) {
|
|
1912
1918
|
${match5(props.length).with(
|
|
1913
1919
|
0,
|
|
1914
|
-
() =>
|
|
1920
|
+
() => outdent29`
|
|
1915
1921
|
const styleProps = ${styleFnName}()
|
|
1916
1922
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, props))
|
|
1917
1923
|
`
|
|
1918
1924
|
).otherwise(
|
|
1919
|
-
() =>
|
|
1925
|
+
() => outdent29`
|
|
1920
1926
|
const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
1921
1927
|
const styleProps = ${styleFnName}(patternProps)
|
|
1922
1928
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, restProps))
|
|
@@ -1924,7 +1930,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1924
1930
|
)}
|
|
1925
1931
|
}
|
|
1926
1932
|
`,
|
|
1927
|
-
dts:
|
|
1933
|
+
dts: outdent29`
|
|
1928
1934
|
import { Component } from 'solid-js'
|
|
1929
1935
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1930
1936
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -1939,15 +1945,15 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1939
1945
|
}
|
|
1940
1946
|
|
|
1941
1947
|
// src/artifacts/solid-jsx/types.ts
|
|
1942
|
-
import { outdent as
|
|
1948
|
+
import { outdent as outdent30 } from "outdent";
|
|
1943
1949
|
function generateSolidJsxTypes(ctx) {
|
|
1944
1950
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1945
1951
|
return {
|
|
1946
|
-
jsxFactory:
|
|
1952
|
+
jsxFactory: outdent30`
|
|
1947
1953
|
import type { ${upperName} } from '../types/jsx'
|
|
1948
1954
|
export declare const ${factoryName}: ${upperName}
|
|
1949
1955
|
`,
|
|
1950
|
-
jsxType:
|
|
1956
|
+
jsxType: outdent30`
|
|
1951
1957
|
import type { ComponentProps, Component, JSX } from 'solid-js'
|
|
1952
1958
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1953
1959
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1982,11 +1988,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1982
1988
|
}
|
|
1983
1989
|
|
|
1984
1990
|
// src/artifacts/solid-jsx/jsx.string-literal.ts
|
|
1985
|
-
import { outdent as
|
|
1991
|
+
import { outdent as outdent31 } from "outdent";
|
|
1986
1992
|
function generateSolidJsxStringLiteralFactory(ctx) {
|
|
1987
1993
|
const { componentName, factoryName } = ctx.jsx;
|
|
1988
1994
|
return {
|
|
1989
|
-
js:
|
|
1995
|
+
js: outdent31`
|
|
1990
1996
|
import { mergeProps, splitProps } from 'solid-js'
|
|
1991
1997
|
import { Dynamic, createComponent } from 'solid-js/web'
|
|
1992
1998
|
${ctx.file.import("css, cx", "../css/index")}
|
|
@@ -2038,15 +2044,15 @@ export const ${factoryName} = createJsxFactory()
|
|
|
2038
2044
|
}
|
|
2039
2045
|
|
|
2040
2046
|
// src/artifacts/solid-jsx/types.string-literal.ts
|
|
2041
|
-
import { outdent as
|
|
2047
|
+
import { outdent as outdent32 } from "outdent";
|
|
2042
2048
|
function generateSolidJsxStringLiteralTypes(ctx) {
|
|
2043
2049
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2044
2050
|
return {
|
|
2045
|
-
jsxFactory:
|
|
2051
|
+
jsxFactory: outdent32`
|
|
2046
2052
|
import type { ${upperName} } from '../types/jsx'
|
|
2047
2053
|
export declare const ${factoryName}: ${upperName}
|
|
2048
2054
|
`,
|
|
2049
|
-
jsxType:
|
|
2055
|
+
jsxType: outdent32`
|
|
2050
2056
|
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
2051
2057
|
|
|
2052
2058
|
type Dict = Record<string, unknown>
|
|
@@ -2072,11 +2078,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
2072
2078
|
}
|
|
2073
2079
|
|
|
2074
2080
|
// src/artifacts/vue-jsx/jsx.ts
|
|
2075
|
-
import { outdent as
|
|
2081
|
+
import { outdent as outdent33 } from "outdent";
|
|
2076
2082
|
function generateVueJsxFactory(ctx) {
|
|
2077
2083
|
const { factoryName } = ctx.jsx;
|
|
2078
2084
|
return {
|
|
2079
|
-
js:
|
|
2085
|
+
js: outdent33`
|
|
2080
2086
|
import { defineComponent, h, computed } from 'vue'
|
|
2081
2087
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
2082
2088
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -2150,11 +2156,11 @@ function generateVueJsxFactory(ctx) {
|
|
|
2150
2156
|
}
|
|
2151
2157
|
|
|
2152
2158
|
// src/artifacts/vue-jsx/jsx.string-literal.ts
|
|
2153
|
-
import { outdent as
|
|
2159
|
+
import { outdent as outdent34 } from "outdent";
|
|
2154
2160
|
function generateVueJsxStringLiteralFactory(ctx) {
|
|
2155
2161
|
const { factoryName } = ctx.jsx;
|
|
2156
2162
|
return {
|
|
2157
|
-
js:
|
|
2163
|
+
js: outdent34`
|
|
2158
2164
|
import { defineComponent, h, computed } from 'vue'
|
|
2159
2165
|
${ctx.file.import("css, cx", "../css/index")}
|
|
2160
2166
|
|
|
@@ -2204,7 +2210,7 @@ function generateVueJsxStringLiteralFactory(ctx) {
|
|
|
2204
2210
|
}
|
|
2205
2211
|
|
|
2206
2212
|
// src/artifacts/vue-jsx/pattern.ts
|
|
2207
|
-
import { outdent as
|
|
2213
|
+
import { outdent as outdent35 } from "outdent";
|
|
2208
2214
|
function generateVueJsxPattern(ctx) {
|
|
2209
2215
|
const { typeName, factoryName } = ctx.jsx;
|
|
2210
2216
|
return ctx.patterns.details.map((pattern) => {
|
|
@@ -2213,7 +2219,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2213
2219
|
const propList = props.map((v) => JSON.stringify(v)).join(", ");
|
|
2214
2220
|
return {
|
|
2215
2221
|
name: dashName,
|
|
2216
|
-
js:
|
|
2222
|
+
js: outdent35`
|
|
2217
2223
|
import { defineComponent, h, computed } from 'vue'
|
|
2218
2224
|
${ctx.file.import(factoryName, "./factory")}
|
|
2219
2225
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -2231,7 +2237,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2231
2237
|
}
|
|
2232
2238
|
})
|
|
2233
2239
|
`,
|
|
2234
|
-
dts:
|
|
2240
|
+
dts: outdent35`
|
|
2235
2241
|
import { FunctionalComponent } from 'vue'
|
|
2236
2242
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2237
2243
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -2246,15 +2252,15 @@ function generateVueJsxPattern(ctx) {
|
|
|
2246
2252
|
}
|
|
2247
2253
|
|
|
2248
2254
|
// src/artifacts/vue-jsx/types.ts
|
|
2249
|
-
import { outdent as
|
|
2255
|
+
import { outdent as outdent36 } from "outdent";
|
|
2250
2256
|
function generateVueJsxTypes(ctx) {
|
|
2251
2257
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2252
2258
|
return {
|
|
2253
|
-
jsxFactory:
|
|
2259
|
+
jsxFactory: outdent36`
|
|
2254
2260
|
import { ${upperName} } from '../types/jsx'
|
|
2255
2261
|
export declare const ${factoryName}: ${upperName}
|
|
2256
2262
|
`,
|
|
2257
|
-
jsxType:
|
|
2263
|
+
jsxType: outdent36`
|
|
2258
2264
|
import type { Component, FunctionalComponent } from 'vue'
|
|
2259
2265
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
2260
2266
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -2411,15 +2417,15 @@ type IntrinsicElement =
|
|
|
2411
2417
|
}
|
|
2412
2418
|
|
|
2413
2419
|
// src/artifacts/vue-jsx/types.string-literal.ts
|
|
2414
|
-
import { outdent as
|
|
2420
|
+
import { outdent as outdent37 } from "outdent";
|
|
2415
2421
|
function generateVueJsxStringLiteralTypes(ctx) {
|
|
2416
2422
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2417
2423
|
return {
|
|
2418
|
-
jsxFactory:
|
|
2424
|
+
jsxFactory: outdent37`
|
|
2419
2425
|
import { ${upperName} } from '../types/jsx'
|
|
2420
2426
|
export declare const ${factoryName}: ${upperName}
|
|
2421
2427
|
`,
|
|
2422
|
-
jsxType:
|
|
2428
|
+
jsxType: outdent37`
|
|
2423
2429
|
import type { Component, FunctionalComponent } from 'vue'
|
|
2424
2430
|
|
|
2425
2431
|
type IntrinsicElement =
|
|
@@ -2710,9 +2716,9 @@ function getGeneratedTypes() {
|
|
|
2710
2716
|
}
|
|
2711
2717
|
|
|
2712
2718
|
// src/artifacts/types/main.ts
|
|
2713
|
-
import { outdent as
|
|
2719
|
+
import { outdent as outdent38 } from "outdent";
|
|
2714
2720
|
var generateTypesEntry = () => ({
|
|
2715
|
-
global:
|
|
2721
|
+
global: outdent38`
|
|
2716
2722
|
import type { RecipeVariantRecord, RecipeConfig } from './recipe'
|
|
2717
2723
|
import type { Parts } from './parts'
|
|
2718
2724
|
import type { PatternConfig } from './pattern'
|
|
@@ -2729,19 +2735,19 @@ var generateTypesEntry = () => ({
|
|
|
2729
2735
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>;
|
|
2730
2736
|
}
|
|
2731
2737
|
`,
|
|
2732
|
-
index:
|
|
2738
|
+
index: outdent38`
|
|
2733
2739
|
import './global'
|
|
2734
2740
|
export type { ConditionalValue } from './conditions'
|
|
2735
2741
|
export type { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
|
|
2736
2742
|
|
|
2737
2743
|
`,
|
|
2738
|
-
helpers:
|
|
2744
|
+
helpers: outdent38`
|
|
2739
2745
|
export type Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never
|
|
2740
2746
|
`
|
|
2741
2747
|
});
|
|
2742
2748
|
|
|
2743
2749
|
// src/artifacts/types/prop-types.ts
|
|
2744
|
-
import { outdent as
|
|
2750
|
+
import { outdent as outdent39 } from "outdent";
|
|
2745
2751
|
function generatePropTypes(ctx) {
|
|
2746
2752
|
const {
|
|
2747
2753
|
config: { strictTokens },
|
|
@@ -2749,7 +2755,7 @@ function generatePropTypes(ctx) {
|
|
|
2749
2755
|
} = ctx;
|
|
2750
2756
|
const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
|
|
2751
2757
|
const result = [
|
|
2752
|
-
|
|
2758
|
+
outdent39`
|
|
2753
2759
|
import type { ConditionalValue } from './conditions';
|
|
2754
2760
|
import type { CssProperties } from './system-types'
|
|
2755
2761
|
import type { Tokens } from '../tokens'
|
|
@@ -2772,7 +2778,7 @@ function generatePropTypes(ctx) {
|
|
|
2772
2778
|
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
2773
2779
|
});
|
|
2774
2780
|
result.push("}");
|
|
2775
|
-
return
|
|
2781
|
+
return outdent39`
|
|
2776
2782
|
${result.join("\n")}
|
|
2777
2783
|
|
|
2778
2784
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
@@ -2785,10 +2791,10 @@ function generatePropTypes(ctx) {
|
|
|
2785
2791
|
|
|
2786
2792
|
// src/artifacts/types/style-props.ts
|
|
2787
2793
|
import { allCssProperties } from "@pandacss/is-valid-prop";
|
|
2788
|
-
import
|
|
2794
|
+
import outdent40 from "outdent";
|
|
2789
2795
|
function generateStyleProps(ctx) {
|
|
2790
2796
|
const props = new Set(allCssProperties.concat(ctx.utility.keys()));
|
|
2791
|
-
return
|
|
2797
|
+
return outdent40`
|
|
2792
2798
|
import type { ConditionalValue } from './conditions'
|
|
2793
2799
|
import type { PropertyValue } from './prop-type'
|
|
2794
2800
|
import type { Token } from '../tokens'
|
|
@@ -2805,7 +2811,7 @@ function generateStyleProps(ctx) {
|
|
|
2805
2811
|
|
|
2806
2812
|
// src/artifacts/types/token-types.ts
|
|
2807
2813
|
import { capitalize, unionType as unionType3 } from "@pandacss/shared";
|
|
2808
|
-
import { outdent as
|
|
2814
|
+
import { outdent as outdent41 } from "outdent";
|
|
2809
2815
|
import pluralize from "pluralize";
|
|
2810
2816
|
var categories = [
|
|
2811
2817
|
"zIndex",
|
|
@@ -2850,7 +2856,7 @@ function generateTokenTypes(ctx) {
|
|
|
2850
2856
|
result.add("} & { [token: string]: never }");
|
|
2851
2857
|
set.add(Array.from(result).join("\n"));
|
|
2852
2858
|
set.add(`export type TokenCategory = ${unionType3(categories)}`);
|
|
2853
|
-
return
|
|
2859
|
+
return outdent41.string(Array.from(set).join("\n\n"));
|
|
2854
2860
|
}
|
|
2855
2861
|
|
|
2856
2862
|
// src/artifacts/index.ts
|
|
@@ -2947,8 +2953,8 @@ function setupRecipes(ctx) {
|
|
|
2947
2953
|
return;
|
|
2948
2954
|
const indexFiles = files.filter((file) => !file.name.includes("create-recipe"));
|
|
2949
2955
|
const index = {
|
|
2950
|
-
js:
|
|
2951
|
-
dts:
|
|
2956
|
+
js: outdent42.string(indexFiles.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
2957
|
+
dts: outdent42.string(indexFiles.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
2952
2958
|
};
|
|
2953
2959
|
return {
|
|
2954
2960
|
dir: ctx.paths.recipe,
|
|
@@ -2967,8 +2973,8 @@ function setupPatterns(ctx) {
|
|
|
2967
2973
|
if (!files)
|
|
2968
2974
|
return;
|
|
2969
2975
|
const index = {
|
|
2970
|
-
js:
|
|
2971
|
-
dts:
|
|
2976
|
+
js: outdent42.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
2977
|
+
dts: outdent42.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
2972
2978
|
};
|
|
2973
2979
|
return {
|
|
2974
2980
|
dir: ctx.paths.pattern,
|
|
@@ -2988,13 +2994,15 @@ function setupJsx(ctx) {
|
|
|
2988
2994
|
const factory = generateJsxFactory(ctx);
|
|
2989
2995
|
const patterns = generateJsxPatterns(ctx);
|
|
2990
2996
|
const index = {
|
|
2991
|
-
js:
|
|
2997
|
+
js: outdent42`
|
|
2992
2998
|
${ctx.file.export("./factory")}
|
|
2993
|
-
${
|
|
2999
|
+
${isValidProp?.js ? ctx.file.export("./is-valid-prop") : ""}
|
|
3000
|
+
${outdent42.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
|
|
2994
3001
|
`,
|
|
2995
|
-
dts:
|
|
3002
|
+
dts: outdent42`
|
|
2996
3003
|
export * from './factory'
|
|
2997
|
-
${
|
|
3004
|
+
${isValidProp?.dts ? `export * from './is-valid-prop'` : ""}
|
|
3005
|
+
${outdent42.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
2998
3006
|
export type { ${ctx.jsx.typeName} } from '../types/jsx'
|
|
2999
3007
|
`
|
|
3000
3008
|
};
|
|
@@ -3004,6 +3012,7 @@ function setupJsx(ctx) {
|
|
|
3004
3012
|
...patterns.map((file) => ({ file: ctx.file.ext(file.name), code: file.js })),
|
|
3005
3013
|
...patterns.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
|
|
3006
3014
|
{ file: ctx.file.ext("is-valid-prop"), code: isValidProp?.js },
|
|
3015
|
+
{ file: "is-valid-prop.d.ts", code: isValidProp?.dts },
|
|
3007
3016
|
{ file: "factory.d.ts", code: types.jsxFactory },
|
|
3008
3017
|
{ file: ctx.file.ext("factory"), code: factory?.js },
|
|
3009
3018
|
{ file: "index.d.ts", code: index.dts },
|
|
@@ -3013,12 +3022,12 @@ function setupJsx(ctx) {
|
|
|
3013
3022
|
}
|
|
3014
3023
|
function setupCssIndex(ctx) {
|
|
3015
3024
|
const index = {
|
|
3016
|
-
js:
|
|
3025
|
+
js: outdent42`
|
|
3017
3026
|
${ctx.file.export("./css")}
|
|
3018
3027
|
${ctx.file.export("./cx")}
|
|
3019
3028
|
${ctx.isTemplateLiteralSyntax ? "" : ctx.file.export("./cva")}
|
|
3020
3029
|
`,
|
|
3021
|
-
dts:
|
|
3030
|
+
dts: outdent42`
|
|
3022
3031
|
export * from './css'
|
|
3023
3032
|
export * from './cx'
|
|
3024
3033
|
${ctx.isTemplateLiteralSyntax ? "" : `export * from './cva'`}
|
|
@@ -3115,8 +3124,7 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
3115
3124
|
// src/artifacts/css/parser-css.ts
|
|
3116
3125
|
import { logger } from "@pandacss/logger";
|
|
3117
3126
|
import { pipe, tap, tryCatch } from "lil-fp/func";
|
|
3118
|
-
import { match as match6
|
|
3119
|
-
var flattenStyles = (data) => Object.assign({}, data, { css: void 0 }, data.css ?? {});
|
|
3127
|
+
import { P, match as match6 } from "ts-pattern";
|
|
3120
3128
|
var generateParserCss = (ctx) => (result) => pipe(
|
|
3121
3129
|
{ ...ctx, sheet: ctx.createSheet(), result },
|
|
3122
3130
|
tap(({ sheet, result: result2, patterns, recipes }) => {
|
|
@@ -3132,7 +3140,7 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3132
3140
|
});
|
|
3133
3141
|
result2.jsx.forEach((jsx) => {
|
|
3134
3142
|
jsx.data.forEach((data) => {
|
|
3135
|
-
sheet.
|
|
3143
|
+
sheet.processStyleProps(data);
|
|
3136
3144
|
});
|
|
3137
3145
|
});
|
|
3138
3146
|
result2.recipe.forEach((recipeSet, name) => {
|
|
@@ -3143,8 +3151,8 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3143
3151
|
continue;
|
|
3144
3152
|
match6(recipe).with({ type: "jsx-recipe", name: P.string }, ({ name: name2 }) => {
|
|
3145
3153
|
recipe.data.forEach((data) => {
|
|
3146
|
-
const [recipeProps, styleProps] = recipes.splitProps(name2,
|
|
3147
|
-
sheet.
|
|
3154
|
+
const [recipeProps, styleProps] = recipes.splitProps(name2, data);
|
|
3155
|
+
sheet.processStyleProps(styleProps);
|
|
3148
3156
|
sheet.processRecipe(recipeConfig, recipeProps);
|
|
3149
3157
|
});
|
|
3150
3158
|
}).otherwise(() => {
|
|
@@ -3163,8 +3171,8 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3163
3171
|
match6(pattern).with({ type: "jsx-pattern", name: P.string }, ({ name: name2 }) => {
|
|
3164
3172
|
pattern.data.forEach((data) => {
|
|
3165
3173
|
const fnName = patterns.getFnName(name2);
|
|
3166
|
-
const styleProps = patterns.transform(fnName,
|
|
3167
|
-
sheet.
|
|
3174
|
+
const styleProps = patterns.transform(fnName, data);
|
|
3175
|
+
sheet.processStyleProps(styleProps);
|
|
3168
3176
|
});
|
|
3169
3177
|
}).otherwise(() => {
|
|
3170
3178
|
pattern.data.forEach((data) => {
|