@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.js
CHANGED
|
@@ -130,7 +130,7 @@ var getMessages = (ctx) => ({
|
|
|
130
130
|
|
|
131
131
|
// src/artifacts/index.ts
|
|
132
132
|
var import_shared4 = require("@pandacss/shared");
|
|
133
|
-
var
|
|
133
|
+
var import_outdent42 = __toESM(require("outdent"));
|
|
134
134
|
|
|
135
135
|
// src/artifacts/css/global-css.ts
|
|
136
136
|
var generateGlobalCss = (ctx) => {
|
|
@@ -852,6 +852,7 @@ var is_valid_prop_mjs_default = {
|
|
|
852
852
|
};
|
|
853
853
|
|
|
854
854
|
// src/artifacts/js/is-valid-prop.ts
|
|
855
|
+
var import_outdent9 = require("outdent");
|
|
855
856
|
function generateisValidProp(ctx) {
|
|
856
857
|
if (ctx.isTemplateLiteralSyntax)
|
|
857
858
|
return;
|
|
@@ -861,14 +862,19 @@ function generateisValidProp(ctx) {
|
|
|
861
862
|
`var userGenerated = [${ctx.properties.map((key) => JSON.stringify(key)).join(",")}]`
|
|
862
863
|
);
|
|
863
864
|
return {
|
|
864
|
-
js: content
|
|
865
|
+
js: content,
|
|
866
|
+
dts: import_outdent9.outdent`
|
|
867
|
+
declare const isCssProperty: (value: string) => boolean;
|
|
868
|
+
|
|
869
|
+
export { isCssProperty };
|
|
870
|
+
`
|
|
865
871
|
};
|
|
866
872
|
}
|
|
867
873
|
|
|
868
874
|
// src/artifacts/js/pattern.ts
|
|
869
875
|
var import_shared = require("@pandacss/shared");
|
|
870
876
|
var import_javascript_stringify = require("javascript-stringify");
|
|
871
|
-
var
|
|
877
|
+
var import_outdent10 = require("outdent");
|
|
872
878
|
var import_ts_pattern = require("ts-pattern");
|
|
873
879
|
function generatePattern(ctx) {
|
|
874
880
|
if (ctx.patterns.isEmpty())
|
|
@@ -886,7 +892,7 @@ function generatePattern(ctx) {
|
|
|
886
892
|
}
|
|
887
893
|
return {
|
|
888
894
|
name: dashName,
|
|
889
|
-
dts:
|
|
895
|
+
dts: import_outdent10.outdent`
|
|
890
896
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
891
897
|
import type { PropertyValue } from '../types/prop-type'
|
|
892
898
|
import type { Properties } from '../types/csstype'
|
|
@@ -910,7 +916,7 @@ function generatePattern(ctx) {
|
|
|
910
916
|
}).join("\n ")}
|
|
911
917
|
}
|
|
912
918
|
|
|
913
|
-
${strict ?
|
|
919
|
+
${strict ? import_outdent10.outdent`export declare function ${name}(options: ${upperName}Properties): string` : import_outdent10.outdent`
|
|
914
920
|
|
|
915
921
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
916
922
|
|
|
@@ -919,7 +925,7 @@ function generatePattern(ctx) {
|
|
|
919
925
|
`}
|
|
920
926
|
|
|
921
927
|
`,
|
|
922
|
-
js:
|
|
928
|
+
js: import_outdent10.outdent`
|
|
923
929
|
${ctx.file.import(helperImports.join(", "), "../helpers")}
|
|
924
930
|
${ctx.file.import("css", "../css/index")}
|
|
925
931
|
|
|
@@ -936,7 +942,7 @@ transform`)}
|
|
|
936
942
|
|
|
937
943
|
// src/artifacts/js/recipe.ts
|
|
938
944
|
var import_shared2 = require("@pandacss/shared");
|
|
939
|
-
var
|
|
945
|
+
var import_outdent11 = require("outdent");
|
|
940
946
|
var stringify3 = (value) => JSON.stringify(value, null, 2);
|
|
941
947
|
var isBooleanValue = (value) => value === "true" || value === "false";
|
|
942
948
|
function generateRecipes(ctx) {
|
|
@@ -950,7 +956,7 @@ function generateRecipes(ctx) {
|
|
|
950
956
|
const createRecipeFn = {
|
|
951
957
|
name: "create-recipe",
|
|
952
958
|
dts: "",
|
|
953
|
-
js:
|
|
959
|
+
js: import_outdent11.outdent`
|
|
954
960
|
${ctx.file.import("css", "../css/css")}
|
|
955
961
|
${ctx.file.import("assertCompoundVariant, getCompoundVariantCss", "../css/cva")}
|
|
956
962
|
${ctx.file.import("cx", "../css/cx")}
|
|
@@ -997,7 +1003,7 @@ function generateRecipes(ctx) {
|
|
|
997
1003
|
const { name, description, defaultVariants, compoundVariants } = config;
|
|
998
1004
|
return {
|
|
999
1005
|
name: dashName,
|
|
1000
|
-
js:
|
|
1006
|
+
js: import_outdent11.outdent`
|
|
1001
1007
|
${ctx.file.import("splitProps", "../helpers")}
|
|
1002
1008
|
${ctx.file.import("createRecipe", "./create-recipe")}
|
|
1003
1009
|
|
|
@@ -1018,7 +1024,7 @@ function generateRecipes(ctx) {
|
|
|
1018
1024
|
splitVariantProps,
|
|
1019
1025
|
})
|
|
1020
1026
|
`,
|
|
1021
|
-
dts:
|
|
1027
|
+
dts: import_outdent11.outdent`
|
|
1022
1028
|
import type { ConditionalValue } from '../types'
|
|
1023
1029
|
import type { Pretty } from '../types/helpers'
|
|
1024
1030
|
|
|
@@ -1056,7 +1062,7 @@ function generateRecipes(ctx) {
|
|
|
1056
1062
|
}
|
|
1057
1063
|
|
|
1058
1064
|
// src/artifacts/js/token.ts
|
|
1059
|
-
var
|
|
1065
|
+
var import_outdent12 = __toESM(require("outdent"));
|
|
1060
1066
|
function generateTokenJs(ctx) {
|
|
1061
1067
|
const { tokens } = ctx;
|
|
1062
1068
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1067,7 +1073,7 @@ function generateTokenJs(ctx) {
|
|
|
1067
1073
|
});
|
|
1068
1074
|
const obj = Object.fromEntries(map);
|
|
1069
1075
|
return {
|
|
1070
|
-
js:
|
|
1076
|
+
js: import_outdent12.default`
|
|
1071
1077
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1072
1078
|
|
|
1073
1079
|
export function token(path, fallback) {
|
|
@@ -1080,7 +1086,7 @@ function generateTokenJs(ctx) {
|
|
|
1080
1086
|
|
|
1081
1087
|
token.var = tokenVar
|
|
1082
1088
|
`,
|
|
1083
|
-
dts:
|
|
1089
|
+
dts: import_outdent12.default`
|
|
1084
1090
|
import type { Token } from './tokens'
|
|
1085
1091
|
|
|
1086
1092
|
export declare const token: {
|
|
@@ -1094,11 +1100,11 @@ function generateTokenJs(ctx) {
|
|
|
1094
1100
|
}
|
|
1095
1101
|
|
|
1096
1102
|
// src/artifacts/preact-jsx/jsx.ts
|
|
1097
|
-
var
|
|
1103
|
+
var import_outdent13 = require("outdent");
|
|
1098
1104
|
function generatePreactJsxFactory(ctx) {
|
|
1099
1105
|
const { factoryName, componentName } = ctx.jsx;
|
|
1100
1106
|
return {
|
|
1101
|
-
js:
|
|
1107
|
+
js: import_outdent13.outdent`
|
|
1102
1108
|
import { h } from 'preact'
|
|
1103
1109
|
import { forwardRef } from 'preact/compat'
|
|
1104
1110
|
import { useMemo } from 'preact/hooks'
|
|
@@ -1165,7 +1171,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1165
1171
|
}
|
|
1166
1172
|
|
|
1167
1173
|
// src/artifacts/preact-jsx/pattern.ts
|
|
1168
|
-
var
|
|
1174
|
+
var import_outdent14 = require("outdent");
|
|
1169
1175
|
var import_ts_pattern2 = require("ts-pattern");
|
|
1170
1176
|
function generatePreactJsxPattern(ctx) {
|
|
1171
1177
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1174,7 +1180,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1174
1180
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1175
1181
|
return {
|
|
1176
1182
|
name: dashName,
|
|
1177
|
-
js:
|
|
1183
|
+
js: import_outdent14.outdent`
|
|
1178
1184
|
import { h } from 'preact'
|
|
1179
1185
|
import { forwardRef } from 'preact/compat'
|
|
1180
1186
|
${ctx.file.import(factoryName, "./factory")}
|
|
@@ -1183,12 +1189,12 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1183
1189
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1184
1190
|
${(0, import_ts_pattern2.match)(props.length).with(
|
|
1185
1191
|
0,
|
|
1186
|
-
() =>
|
|
1192
|
+
() => import_outdent14.outdent`
|
|
1187
1193
|
const styleProps = ${styleFnName}()
|
|
1188
1194
|
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1189
1195
|
`
|
|
1190
1196
|
).otherwise(
|
|
1191
|
-
() =>
|
|
1197
|
+
() => import_outdent14.outdent`
|
|
1192
1198
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1193
1199
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1194
1200
|
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1196,7 +1202,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1196
1202
|
)}
|
|
1197
1203
|
})
|
|
1198
1204
|
`,
|
|
1199
|
-
dts:
|
|
1205
|
+
dts: import_outdent14.outdent`
|
|
1200
1206
|
import type { FunctionComponent } from 'preact'
|
|
1201
1207
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1202
1208
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1211,15 +1217,15 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1211
1217
|
}
|
|
1212
1218
|
|
|
1213
1219
|
// src/artifacts/preact-jsx/types.ts
|
|
1214
|
-
var
|
|
1220
|
+
var import_outdent15 = require("outdent");
|
|
1215
1221
|
function generatePreactJsxTypes(ctx) {
|
|
1216
1222
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1217
1223
|
return {
|
|
1218
|
-
jsxFactory:
|
|
1224
|
+
jsxFactory: import_outdent15.outdent`
|
|
1219
1225
|
import type { ${upperName} } from '../types/jsx'
|
|
1220
1226
|
export declare const ${factoryName}: ${upperName}
|
|
1221
1227
|
`,
|
|
1222
|
-
jsxType:
|
|
1228
|
+
jsxType: import_outdent15.outdent`
|
|
1223
1229
|
import type { ComponentProps, JSX } from 'preact'
|
|
1224
1230
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1225
1231
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1254,11 +1260,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1254
1260
|
}
|
|
1255
1261
|
|
|
1256
1262
|
// src/artifacts/preact-jsx/jsx.string-literal.ts
|
|
1257
|
-
var
|
|
1263
|
+
var import_outdent16 = require("outdent");
|
|
1258
1264
|
function generatePreactJsxStringLiteralFactory(ctx) {
|
|
1259
1265
|
const { factoryName, componentName } = ctx.jsx;
|
|
1260
1266
|
return {
|
|
1261
|
-
js:
|
|
1267
|
+
js: import_outdent16.outdent`
|
|
1262
1268
|
import { h } from 'preact'
|
|
1263
1269
|
import { forwardRef } from 'preact/compat'
|
|
1264
1270
|
${ctx.file.import("css, cx", "../css/index")}
|
|
@@ -1304,15 +1310,15 @@ function generatePreactJsxStringLiteralFactory(ctx) {
|
|
|
1304
1310
|
}
|
|
1305
1311
|
|
|
1306
1312
|
// src/artifacts/preact-jsx/types.string-literal.ts
|
|
1307
|
-
var
|
|
1313
|
+
var import_outdent17 = require("outdent");
|
|
1308
1314
|
function generatePreactJsxStringLiteralTypes(ctx) {
|
|
1309
1315
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1310
1316
|
return {
|
|
1311
|
-
jsxFactory:
|
|
1317
|
+
jsxFactory: import_outdent17.outdent`
|
|
1312
1318
|
import type { ${upperName} } from '../types/jsx'
|
|
1313
1319
|
export declare const ${factoryName}: ${upperName}
|
|
1314
1320
|
`,
|
|
1315
|
-
jsxType:
|
|
1321
|
+
jsxType: import_outdent17.outdent`
|
|
1316
1322
|
import type { ComponentProps, JSX } from 'preact'
|
|
1317
1323
|
|
|
1318
1324
|
type ElementType = keyof JSX.IntrinsicElements
|
|
@@ -1338,11 +1344,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1338
1344
|
}
|
|
1339
1345
|
|
|
1340
1346
|
// src/artifacts/qwik-jsx/jsx.ts
|
|
1341
|
-
var
|
|
1347
|
+
var import_outdent18 = require("outdent");
|
|
1342
1348
|
function generateQwikJsxFactory(ctx) {
|
|
1343
1349
|
const { factoryName, componentName } = ctx.jsx;
|
|
1344
1350
|
return {
|
|
1345
|
-
js:
|
|
1351
|
+
js: import_outdent18.outdent`
|
|
1346
1352
|
import { h } from '@builder.io/qwik'
|
|
1347
1353
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1348
1354
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -1406,7 +1412,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1406
1412
|
}
|
|
1407
1413
|
|
|
1408
1414
|
// src/artifacts/qwik-jsx/pattern.ts
|
|
1409
|
-
var
|
|
1415
|
+
var import_outdent19 = require("outdent");
|
|
1410
1416
|
var import_ts_pattern3 = require("ts-pattern");
|
|
1411
1417
|
function generateQwikJsxPattern(ctx) {
|
|
1412
1418
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1415,7 +1421,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1415
1421
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1416
1422
|
return {
|
|
1417
1423
|
name: dashName,
|
|
1418
|
-
js:
|
|
1424
|
+
js: import_outdent19.outdent`
|
|
1419
1425
|
import { h } from '@builder.io/qwik'
|
|
1420
1426
|
${ctx.file.import(factoryName, "./factory")}
|
|
1421
1427
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -1423,12 +1429,12 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1423
1429
|
export const ${jsxName} = function ${jsxName}(props) {
|
|
1424
1430
|
${(0, import_ts_pattern3.match)(props.length).with(
|
|
1425
1431
|
0,
|
|
1426
|
-
() =>
|
|
1432
|
+
() => import_outdent19.outdent`
|
|
1427
1433
|
const styleProps = ${styleFnName}()
|
|
1428
1434
|
return h(${factoryName}.${jsxElement}, { ...styleProps, ...props })
|
|
1429
1435
|
`
|
|
1430
1436
|
).otherwise(
|
|
1431
|
-
() =>
|
|
1437
|
+
() => import_outdent19.outdent`
|
|
1432
1438
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1433
1439
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1434
1440
|
return h(${factoryName}.${jsxElement}, { ...styleProps, ...restProps })
|
|
@@ -1436,7 +1442,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1436
1442
|
)}
|
|
1437
1443
|
}
|
|
1438
1444
|
`,
|
|
1439
|
-
dts:
|
|
1445
|
+
dts: import_outdent19.outdent`
|
|
1440
1446
|
import type { FunctionComponent } from '@builder.io/qwik'
|
|
1441
1447
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1442
1448
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1455,15 +1461,15 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1455
1461
|
}
|
|
1456
1462
|
|
|
1457
1463
|
// src/artifacts/qwik-jsx/types.ts
|
|
1458
|
-
var
|
|
1464
|
+
var import_outdent20 = require("outdent");
|
|
1459
1465
|
function generateQwikJsxTypes(ctx) {
|
|
1460
1466
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1461
1467
|
return {
|
|
1462
|
-
jsxFactory:
|
|
1468
|
+
jsxFactory: import_outdent20.outdent`
|
|
1463
1469
|
import { ${upperName} } from '../types/jsx'
|
|
1464
1470
|
export declare const ${factoryName}: ${upperName}
|
|
1465
1471
|
`,
|
|
1466
|
-
jsxType:
|
|
1472
|
+
jsxType: import_outdent20.outdent`
|
|
1467
1473
|
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1468
1474
|
import type { Assign as _Assign, JsxStyleProps, PatchedHTMLProps } from './system-types'
|
|
1469
1475
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1517,11 +1523,11 @@ export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T>, JsxSt
|
|
|
1517
1523
|
}
|
|
1518
1524
|
|
|
1519
1525
|
// src/artifacts/qwik-jsx/jsx.string-literal.ts
|
|
1520
|
-
var
|
|
1526
|
+
var import_outdent21 = require("outdent");
|
|
1521
1527
|
function generateQwikJsxStringLiteralFactory(ctx) {
|
|
1522
1528
|
const { factoryName, componentName } = ctx.jsx;
|
|
1523
1529
|
return {
|
|
1524
|
-
js:
|
|
1530
|
+
js: import_outdent21.outdent`
|
|
1525
1531
|
import { h } from '@builder.io/qwik'
|
|
1526
1532
|
${ctx.file.import("css, cx", "../css/index")}
|
|
1527
1533
|
|
|
@@ -1566,15 +1572,15 @@ function generateQwikJsxStringLiteralFactory(ctx) {
|
|
|
1566
1572
|
}
|
|
1567
1573
|
|
|
1568
1574
|
// src/artifacts/qwik-jsx/types.string-literal.ts
|
|
1569
|
-
var
|
|
1575
|
+
var import_outdent22 = require("outdent");
|
|
1570
1576
|
function generateQwikJsxStringLiteralTypes(ctx) {
|
|
1571
1577
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1572
1578
|
return {
|
|
1573
|
-
jsxFactory:
|
|
1579
|
+
jsxFactory: import_outdent22.outdent`
|
|
1574
1580
|
import { ${upperName} } from '../types/jsx'
|
|
1575
1581
|
export declare const ${factoryName}: ${upperName}
|
|
1576
1582
|
`,
|
|
1577
|
-
jsxType:
|
|
1583
|
+
jsxType: import_outdent22.outdent`
|
|
1578
1584
|
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1579
1585
|
|
|
1580
1586
|
type ElementType = keyof QwikIntrinsicElements | FunctionComponent<any>
|
|
@@ -1605,11 +1611,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1605
1611
|
}
|
|
1606
1612
|
|
|
1607
1613
|
// src/artifacts/react-jsx/jsx.ts
|
|
1608
|
-
var
|
|
1614
|
+
var import_outdent23 = require("outdent");
|
|
1609
1615
|
function generateReactJsxFactory(ctx) {
|
|
1610
1616
|
const { factoryName, componentName } = ctx.jsx;
|
|
1611
1617
|
return {
|
|
1612
|
-
js:
|
|
1618
|
+
js: import_outdent23.outdent`
|
|
1613
1619
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
1614
1620
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1615
1621
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -1675,7 +1681,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1675
1681
|
}
|
|
1676
1682
|
|
|
1677
1683
|
// src/artifacts/react-jsx/pattern.ts
|
|
1678
|
-
var
|
|
1684
|
+
var import_outdent24 = require("outdent");
|
|
1679
1685
|
var import_ts_pattern4 = require("ts-pattern");
|
|
1680
1686
|
function generateReactJsxPattern(ctx) {
|
|
1681
1687
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1684,7 +1690,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1684
1690
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1685
1691
|
return {
|
|
1686
1692
|
name: dashName,
|
|
1687
|
-
js:
|
|
1693
|
+
js: import_outdent24.outdent`
|
|
1688
1694
|
import { createElement, forwardRef } from 'react'
|
|
1689
1695
|
${ctx.file.import(factoryName, "./factory")}
|
|
1690
1696
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -1692,12 +1698,12 @@ function generateReactJsxPattern(ctx) {
|
|
|
1692
1698
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1693
1699
|
${(0, import_ts_pattern4.match)(props.length).with(
|
|
1694
1700
|
0,
|
|
1695
|
-
() =>
|
|
1701
|
+
() => import_outdent24.outdent`
|
|
1696
1702
|
const styleProps = ${styleFnName}()
|
|
1697
1703
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1698
1704
|
`
|
|
1699
1705
|
).otherwise(
|
|
1700
|
-
() =>
|
|
1706
|
+
() => import_outdent24.outdent`
|
|
1701
1707
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1702
1708
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1703
1709
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1705,7 +1711,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1705
1711
|
)}
|
|
1706
1712
|
})
|
|
1707
1713
|
`,
|
|
1708
|
-
dts:
|
|
1714
|
+
dts: import_outdent24.outdent`
|
|
1709
1715
|
import type { FunctionComponent } from 'react'
|
|
1710
1716
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1711
1717
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1720,15 +1726,15 @@ function generateReactJsxPattern(ctx) {
|
|
|
1720
1726
|
}
|
|
1721
1727
|
|
|
1722
1728
|
// src/artifacts/react-jsx/types.ts
|
|
1723
|
-
var
|
|
1729
|
+
var import_outdent25 = require("outdent");
|
|
1724
1730
|
function generateReactJsxTypes(ctx) {
|
|
1725
1731
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1726
1732
|
return {
|
|
1727
|
-
jsxFactory:
|
|
1733
|
+
jsxFactory: import_outdent25.outdent`
|
|
1728
1734
|
import { ${upperName} } from '../types/jsx'
|
|
1729
1735
|
export declare const ${factoryName}: ${upperName}
|
|
1730
1736
|
`,
|
|
1731
|
-
jsxType:
|
|
1737
|
+
jsxType: import_outdent25.outdent`
|
|
1732
1738
|
import type { ComponentProps, ElementType } from 'react'
|
|
1733
1739
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1734
1740
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1761,11 +1767,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1761
1767
|
}
|
|
1762
1768
|
|
|
1763
1769
|
// src/artifacts/react-jsx/jsx.string-literal.ts
|
|
1764
|
-
var
|
|
1770
|
+
var import_outdent26 = require("outdent");
|
|
1765
1771
|
function generateReactJsxStringLiteralFactory(ctx) {
|
|
1766
1772
|
const { factoryName, componentName } = ctx.jsx;
|
|
1767
1773
|
return {
|
|
1768
|
-
js:
|
|
1774
|
+
js: import_outdent26.outdent`
|
|
1769
1775
|
import { createElement, forwardRef } from 'react'
|
|
1770
1776
|
${ctx.file.import("css, cx", "../css/index")}
|
|
1771
1777
|
|
|
@@ -1811,15 +1817,15 @@ function generateReactJsxStringLiteralFactory(ctx) {
|
|
|
1811
1817
|
}
|
|
1812
1818
|
|
|
1813
1819
|
// src/artifacts/react-jsx/types.string-literal.ts
|
|
1814
|
-
var
|
|
1820
|
+
var import_outdent27 = require("outdent");
|
|
1815
1821
|
function generateReactJsxStringLiteralTypes(ctx) {
|
|
1816
1822
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1817
1823
|
return {
|
|
1818
|
-
jsxFactory:
|
|
1824
|
+
jsxFactory: import_outdent27.outdent`
|
|
1819
1825
|
import { ${upperName} } from '../types/jsx'
|
|
1820
1826
|
export declare const ${factoryName}: ${upperName}
|
|
1821
1827
|
`,
|
|
1822
|
-
jsxType:
|
|
1828
|
+
jsxType: import_outdent27.outdent`
|
|
1823
1829
|
import type { ComponentProps, ElementType } from 'react'
|
|
1824
1830
|
|
|
1825
1831
|
type Dict = Record<string, unknown>
|
|
@@ -1843,11 +1849,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1843
1849
|
}
|
|
1844
1850
|
|
|
1845
1851
|
// src/artifacts/solid-jsx/jsx.ts
|
|
1846
|
-
var
|
|
1852
|
+
var import_outdent28 = require("outdent");
|
|
1847
1853
|
function generateSolidJsxFactory(ctx) {
|
|
1848
1854
|
const { componentName, factoryName } = ctx.jsx;
|
|
1849
1855
|
return {
|
|
1850
|
-
js:
|
|
1856
|
+
js: import_outdent28.outdent`
|
|
1851
1857
|
import { Dynamic } from 'solid-js/web'
|
|
1852
1858
|
import { mergeProps, splitProps } from 'solid-js'
|
|
1853
1859
|
import { createComponent } from 'solid-js/web'
|
|
@@ -1924,7 +1930,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1924
1930
|
}
|
|
1925
1931
|
|
|
1926
1932
|
// src/artifacts/solid-jsx/pattern.ts
|
|
1927
|
-
var
|
|
1933
|
+
var import_outdent29 = require("outdent");
|
|
1928
1934
|
var import_ts_pattern5 = require("ts-pattern");
|
|
1929
1935
|
function generateSolidJsxPattern(ctx) {
|
|
1930
1936
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1933,7 +1939,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1933
1939
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1934
1940
|
return {
|
|
1935
1941
|
name: dashName,
|
|
1936
|
-
js:
|
|
1942
|
+
js: import_outdent29.outdent`
|
|
1937
1943
|
import { splitProps, mergeProps } from 'solid-js'
|
|
1938
1944
|
import { createComponent } from 'solid-js/web'
|
|
1939
1945
|
${ctx.file.import(factoryName, "./factory")}
|
|
@@ -1942,12 +1948,12 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1942
1948
|
export function ${jsxName}(props) {
|
|
1943
1949
|
${(0, import_ts_pattern5.match)(props.length).with(
|
|
1944
1950
|
0,
|
|
1945
|
-
() =>
|
|
1951
|
+
() => import_outdent29.outdent`
|
|
1946
1952
|
const styleProps = ${styleFnName}()
|
|
1947
1953
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, props))
|
|
1948
1954
|
`
|
|
1949
1955
|
).otherwise(
|
|
1950
|
-
() =>
|
|
1956
|
+
() => import_outdent29.outdent`
|
|
1951
1957
|
const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
1952
1958
|
const styleProps = ${styleFnName}(patternProps)
|
|
1953
1959
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, restProps))
|
|
@@ -1955,7 +1961,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1955
1961
|
)}
|
|
1956
1962
|
}
|
|
1957
1963
|
`,
|
|
1958
|
-
dts:
|
|
1964
|
+
dts: import_outdent29.outdent`
|
|
1959
1965
|
import { Component } from 'solid-js'
|
|
1960
1966
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1961
1967
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -1970,15 +1976,15 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1970
1976
|
}
|
|
1971
1977
|
|
|
1972
1978
|
// src/artifacts/solid-jsx/types.ts
|
|
1973
|
-
var
|
|
1979
|
+
var import_outdent30 = require("outdent");
|
|
1974
1980
|
function generateSolidJsxTypes(ctx) {
|
|
1975
1981
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1976
1982
|
return {
|
|
1977
|
-
jsxFactory:
|
|
1983
|
+
jsxFactory: import_outdent30.outdent`
|
|
1978
1984
|
import type { ${upperName} } from '../types/jsx'
|
|
1979
1985
|
export declare const ${factoryName}: ${upperName}
|
|
1980
1986
|
`,
|
|
1981
|
-
jsxType:
|
|
1987
|
+
jsxType: import_outdent30.outdent`
|
|
1982
1988
|
import type { ComponentProps, Component, JSX } from 'solid-js'
|
|
1983
1989
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1984
1990
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -2013,11 +2019,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
2013
2019
|
}
|
|
2014
2020
|
|
|
2015
2021
|
// src/artifacts/solid-jsx/jsx.string-literal.ts
|
|
2016
|
-
var
|
|
2022
|
+
var import_outdent31 = require("outdent");
|
|
2017
2023
|
function generateSolidJsxStringLiteralFactory(ctx) {
|
|
2018
2024
|
const { componentName, factoryName } = ctx.jsx;
|
|
2019
2025
|
return {
|
|
2020
|
-
js:
|
|
2026
|
+
js: import_outdent31.outdent`
|
|
2021
2027
|
import { mergeProps, splitProps } from 'solid-js'
|
|
2022
2028
|
import { Dynamic, createComponent } from 'solid-js/web'
|
|
2023
2029
|
${ctx.file.import("css, cx", "../css/index")}
|
|
@@ -2069,15 +2075,15 @@ export const ${factoryName} = createJsxFactory()
|
|
|
2069
2075
|
}
|
|
2070
2076
|
|
|
2071
2077
|
// src/artifacts/solid-jsx/types.string-literal.ts
|
|
2072
|
-
var
|
|
2078
|
+
var import_outdent32 = require("outdent");
|
|
2073
2079
|
function generateSolidJsxStringLiteralTypes(ctx) {
|
|
2074
2080
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2075
2081
|
return {
|
|
2076
|
-
jsxFactory:
|
|
2082
|
+
jsxFactory: import_outdent32.outdent`
|
|
2077
2083
|
import type { ${upperName} } from '../types/jsx'
|
|
2078
2084
|
export declare const ${factoryName}: ${upperName}
|
|
2079
2085
|
`,
|
|
2080
|
-
jsxType:
|
|
2086
|
+
jsxType: import_outdent32.outdent`
|
|
2081
2087
|
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
2082
2088
|
|
|
2083
2089
|
type Dict = Record<string, unknown>
|
|
@@ -2103,11 +2109,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
2103
2109
|
}
|
|
2104
2110
|
|
|
2105
2111
|
// src/artifacts/vue-jsx/jsx.ts
|
|
2106
|
-
var
|
|
2112
|
+
var import_outdent33 = require("outdent");
|
|
2107
2113
|
function generateVueJsxFactory(ctx) {
|
|
2108
2114
|
const { factoryName } = ctx.jsx;
|
|
2109
2115
|
return {
|
|
2110
|
-
js:
|
|
2116
|
+
js: import_outdent33.outdent`
|
|
2111
2117
|
import { defineComponent, h, computed } from 'vue'
|
|
2112
2118
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
2113
2119
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -2181,11 +2187,11 @@ function generateVueJsxFactory(ctx) {
|
|
|
2181
2187
|
}
|
|
2182
2188
|
|
|
2183
2189
|
// src/artifacts/vue-jsx/jsx.string-literal.ts
|
|
2184
|
-
var
|
|
2190
|
+
var import_outdent34 = require("outdent");
|
|
2185
2191
|
function generateVueJsxStringLiteralFactory(ctx) {
|
|
2186
2192
|
const { factoryName } = ctx.jsx;
|
|
2187
2193
|
return {
|
|
2188
|
-
js:
|
|
2194
|
+
js: import_outdent34.outdent`
|
|
2189
2195
|
import { defineComponent, h, computed } from 'vue'
|
|
2190
2196
|
${ctx.file.import("css, cx", "../css/index")}
|
|
2191
2197
|
|
|
@@ -2235,7 +2241,7 @@ function generateVueJsxStringLiteralFactory(ctx) {
|
|
|
2235
2241
|
}
|
|
2236
2242
|
|
|
2237
2243
|
// src/artifacts/vue-jsx/pattern.ts
|
|
2238
|
-
var
|
|
2244
|
+
var import_outdent35 = require("outdent");
|
|
2239
2245
|
function generateVueJsxPattern(ctx) {
|
|
2240
2246
|
const { typeName, factoryName } = ctx.jsx;
|
|
2241
2247
|
return ctx.patterns.details.map((pattern) => {
|
|
@@ -2244,7 +2250,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2244
2250
|
const propList = props.map((v) => JSON.stringify(v)).join(", ");
|
|
2245
2251
|
return {
|
|
2246
2252
|
name: dashName,
|
|
2247
|
-
js:
|
|
2253
|
+
js: import_outdent35.outdent`
|
|
2248
2254
|
import { defineComponent, h, computed } from 'vue'
|
|
2249
2255
|
${ctx.file.import(factoryName, "./factory")}
|
|
2250
2256
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -2262,7 +2268,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2262
2268
|
}
|
|
2263
2269
|
})
|
|
2264
2270
|
`,
|
|
2265
|
-
dts:
|
|
2271
|
+
dts: import_outdent35.outdent`
|
|
2266
2272
|
import { FunctionalComponent } from 'vue'
|
|
2267
2273
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2268
2274
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -2277,15 +2283,15 @@ function generateVueJsxPattern(ctx) {
|
|
|
2277
2283
|
}
|
|
2278
2284
|
|
|
2279
2285
|
// src/artifacts/vue-jsx/types.ts
|
|
2280
|
-
var
|
|
2286
|
+
var import_outdent36 = require("outdent");
|
|
2281
2287
|
function generateVueJsxTypes(ctx) {
|
|
2282
2288
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2283
2289
|
return {
|
|
2284
|
-
jsxFactory:
|
|
2290
|
+
jsxFactory: import_outdent36.outdent`
|
|
2285
2291
|
import { ${upperName} } from '../types/jsx'
|
|
2286
2292
|
export declare const ${factoryName}: ${upperName}
|
|
2287
2293
|
`,
|
|
2288
|
-
jsxType:
|
|
2294
|
+
jsxType: import_outdent36.outdent`
|
|
2289
2295
|
import type { Component, FunctionalComponent } from 'vue'
|
|
2290
2296
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
2291
2297
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -2442,15 +2448,15 @@ type IntrinsicElement =
|
|
|
2442
2448
|
}
|
|
2443
2449
|
|
|
2444
2450
|
// src/artifacts/vue-jsx/types.string-literal.ts
|
|
2445
|
-
var
|
|
2451
|
+
var import_outdent37 = require("outdent");
|
|
2446
2452
|
function generateVueJsxStringLiteralTypes(ctx) {
|
|
2447
2453
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2448
2454
|
return {
|
|
2449
|
-
jsxFactory:
|
|
2455
|
+
jsxFactory: import_outdent37.outdent`
|
|
2450
2456
|
import { ${upperName} } from '../types/jsx'
|
|
2451
2457
|
export declare const ${factoryName}: ${upperName}
|
|
2452
2458
|
`,
|
|
2453
|
-
jsxType:
|
|
2459
|
+
jsxType: import_outdent37.outdent`
|
|
2454
2460
|
import type { Component, FunctionalComponent } from 'vue'
|
|
2455
2461
|
|
|
2456
2462
|
type IntrinsicElement =
|
|
@@ -2741,9 +2747,9 @@ function getGeneratedTypes() {
|
|
|
2741
2747
|
}
|
|
2742
2748
|
|
|
2743
2749
|
// src/artifacts/types/main.ts
|
|
2744
|
-
var
|
|
2750
|
+
var import_outdent38 = require("outdent");
|
|
2745
2751
|
var generateTypesEntry = () => ({
|
|
2746
|
-
global:
|
|
2752
|
+
global: import_outdent38.outdent`
|
|
2747
2753
|
import type { RecipeVariantRecord, RecipeConfig } from './recipe'
|
|
2748
2754
|
import type { Parts } from './parts'
|
|
2749
2755
|
import type { PatternConfig } from './pattern'
|
|
@@ -2760,19 +2766,19 @@ var generateTypesEntry = () => ({
|
|
|
2760
2766
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>;
|
|
2761
2767
|
}
|
|
2762
2768
|
`,
|
|
2763
|
-
index:
|
|
2769
|
+
index: import_outdent38.outdent`
|
|
2764
2770
|
import './global'
|
|
2765
2771
|
export type { ConditionalValue } from './conditions'
|
|
2766
2772
|
export type { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
|
|
2767
2773
|
|
|
2768
2774
|
`,
|
|
2769
|
-
helpers:
|
|
2775
|
+
helpers: import_outdent38.outdent`
|
|
2770
2776
|
export type Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never
|
|
2771
2777
|
`
|
|
2772
2778
|
});
|
|
2773
2779
|
|
|
2774
2780
|
// src/artifacts/types/prop-types.ts
|
|
2775
|
-
var
|
|
2781
|
+
var import_outdent39 = require("outdent");
|
|
2776
2782
|
function generatePropTypes(ctx) {
|
|
2777
2783
|
const {
|
|
2778
2784
|
config: { strictTokens },
|
|
@@ -2780,7 +2786,7 @@ function generatePropTypes(ctx) {
|
|
|
2780
2786
|
} = ctx;
|
|
2781
2787
|
const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
|
|
2782
2788
|
const result = [
|
|
2783
|
-
|
|
2789
|
+
import_outdent39.outdent`
|
|
2784
2790
|
import type { ConditionalValue } from './conditions';
|
|
2785
2791
|
import type { CssProperties } from './system-types'
|
|
2786
2792
|
import type { Tokens } from '../tokens'
|
|
@@ -2803,7 +2809,7 @@ function generatePropTypes(ctx) {
|
|
|
2803
2809
|
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
2804
2810
|
});
|
|
2805
2811
|
result.push("}");
|
|
2806
|
-
return
|
|
2812
|
+
return import_outdent39.outdent`
|
|
2807
2813
|
${result.join("\n")}
|
|
2808
2814
|
|
|
2809
2815
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
@@ -2816,10 +2822,10 @@ function generatePropTypes(ctx) {
|
|
|
2816
2822
|
|
|
2817
2823
|
// src/artifacts/types/style-props.ts
|
|
2818
2824
|
var import_is_valid_prop = require("@pandacss/is-valid-prop");
|
|
2819
|
-
var
|
|
2825
|
+
var import_outdent40 = __toESM(require("outdent"));
|
|
2820
2826
|
function generateStyleProps(ctx) {
|
|
2821
2827
|
const props = new Set(import_is_valid_prop.allCssProperties.concat(ctx.utility.keys()));
|
|
2822
|
-
return
|
|
2828
|
+
return import_outdent40.default`
|
|
2823
2829
|
import type { ConditionalValue } from './conditions'
|
|
2824
2830
|
import type { PropertyValue } from './prop-type'
|
|
2825
2831
|
import type { Token } from '../tokens'
|
|
@@ -2836,7 +2842,7 @@ function generateStyleProps(ctx) {
|
|
|
2836
2842
|
|
|
2837
2843
|
// src/artifacts/types/token-types.ts
|
|
2838
2844
|
var import_shared3 = require("@pandacss/shared");
|
|
2839
|
-
var
|
|
2845
|
+
var import_outdent41 = require("outdent");
|
|
2840
2846
|
var import_pluralize = __toESM(require("pluralize"));
|
|
2841
2847
|
var categories = [
|
|
2842
2848
|
"zIndex",
|
|
@@ -2881,7 +2887,7 @@ function generateTokenTypes(ctx) {
|
|
|
2881
2887
|
result.add("} & { [token: string]: never }");
|
|
2882
2888
|
set.add(Array.from(result).join("\n"));
|
|
2883
2889
|
set.add(`export type TokenCategory = ${(0, import_shared3.unionType)(categories)}`);
|
|
2884
|
-
return
|
|
2890
|
+
return import_outdent41.outdent.string(Array.from(set).join("\n\n"));
|
|
2885
2891
|
}
|
|
2886
2892
|
|
|
2887
2893
|
// src/artifacts/index.ts
|
|
@@ -2978,8 +2984,8 @@ function setupRecipes(ctx) {
|
|
|
2978
2984
|
return;
|
|
2979
2985
|
const indexFiles = files.filter((file) => !file.name.includes("create-recipe"));
|
|
2980
2986
|
const index = {
|
|
2981
|
-
js:
|
|
2982
|
-
dts:
|
|
2987
|
+
js: import_outdent42.default.string(indexFiles.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
2988
|
+
dts: import_outdent42.default.string(indexFiles.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
2983
2989
|
};
|
|
2984
2990
|
return {
|
|
2985
2991
|
dir: ctx.paths.recipe,
|
|
@@ -2998,8 +3004,8 @@ function setupPatterns(ctx) {
|
|
|
2998
3004
|
if (!files)
|
|
2999
3005
|
return;
|
|
3000
3006
|
const index = {
|
|
3001
|
-
js:
|
|
3002
|
-
dts:
|
|
3007
|
+
js: import_outdent42.default.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
3008
|
+
dts: import_outdent42.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
3003
3009
|
};
|
|
3004
3010
|
return {
|
|
3005
3011
|
dir: ctx.paths.pattern,
|
|
@@ -3019,13 +3025,15 @@ function setupJsx(ctx) {
|
|
|
3019
3025
|
const factory = generateJsxFactory(ctx);
|
|
3020
3026
|
const patterns = generateJsxPatterns(ctx);
|
|
3021
3027
|
const index = {
|
|
3022
|
-
js:
|
|
3028
|
+
js: import_outdent42.default`
|
|
3023
3029
|
${ctx.file.export("./factory")}
|
|
3024
|
-
${
|
|
3030
|
+
${isValidProp?.js ? ctx.file.export("./is-valid-prop") : ""}
|
|
3031
|
+
${import_outdent42.default.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
|
|
3025
3032
|
`,
|
|
3026
|
-
dts:
|
|
3033
|
+
dts: import_outdent42.default`
|
|
3027
3034
|
export * from './factory'
|
|
3028
|
-
${
|
|
3035
|
+
${isValidProp?.dts ? `export * from './is-valid-prop'` : ""}
|
|
3036
|
+
${import_outdent42.default.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
3029
3037
|
export type { ${ctx.jsx.typeName} } from '../types/jsx'
|
|
3030
3038
|
`
|
|
3031
3039
|
};
|
|
@@ -3035,6 +3043,7 @@ function setupJsx(ctx) {
|
|
|
3035
3043
|
...patterns.map((file) => ({ file: ctx.file.ext(file.name), code: file.js })),
|
|
3036
3044
|
...patterns.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
|
|
3037
3045
|
{ file: ctx.file.ext("is-valid-prop"), code: isValidProp?.js },
|
|
3046
|
+
{ file: "is-valid-prop.d.ts", code: isValidProp?.dts },
|
|
3038
3047
|
{ file: "factory.d.ts", code: types.jsxFactory },
|
|
3039
3048
|
{ file: ctx.file.ext("factory"), code: factory?.js },
|
|
3040
3049
|
{ file: "index.d.ts", code: index.dts },
|
|
@@ -3044,12 +3053,12 @@ function setupJsx(ctx) {
|
|
|
3044
3053
|
}
|
|
3045
3054
|
function setupCssIndex(ctx) {
|
|
3046
3055
|
const index = {
|
|
3047
|
-
js:
|
|
3056
|
+
js: import_outdent42.default`
|
|
3048
3057
|
${ctx.file.export("./css")}
|
|
3049
3058
|
${ctx.file.export("./cx")}
|
|
3050
3059
|
${ctx.isTemplateLiteralSyntax ? "" : ctx.file.export("./cva")}
|
|
3051
3060
|
`,
|
|
3052
|
-
dts:
|
|
3061
|
+
dts: import_outdent42.default`
|
|
3053
3062
|
export * from './css'
|
|
3054
3063
|
export * from './cx'
|
|
3055
3064
|
${ctx.isTemplateLiteralSyntax ? "" : `export * from './cva'`}
|
|
@@ -3147,7 +3156,6 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
3147
3156
|
var import_logger2 = require("@pandacss/logger");
|
|
3148
3157
|
var import_func = require("lil-fp/func");
|
|
3149
3158
|
var import_ts_pattern6 = require("ts-pattern");
|
|
3150
|
-
var flattenStyles = (data) => Object.assign({}, data, { css: void 0 }, data.css ?? {});
|
|
3151
3159
|
var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
3152
3160
|
{ ...ctx, sheet: ctx.createSheet(), result },
|
|
3153
3161
|
(0, import_func.tap)(({ sheet, result: result2, patterns, recipes }) => {
|
|
@@ -3163,7 +3171,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3163
3171
|
});
|
|
3164
3172
|
result2.jsx.forEach((jsx) => {
|
|
3165
3173
|
jsx.data.forEach((data) => {
|
|
3166
|
-
sheet.
|
|
3174
|
+
sheet.processStyleProps(data);
|
|
3167
3175
|
});
|
|
3168
3176
|
});
|
|
3169
3177
|
result2.recipe.forEach((recipeSet, name) => {
|
|
@@ -3174,8 +3182,8 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3174
3182
|
continue;
|
|
3175
3183
|
(0, import_ts_pattern6.match)(recipe).with({ type: "jsx-recipe", name: import_ts_pattern6.P.string }, ({ name: name2 }) => {
|
|
3176
3184
|
recipe.data.forEach((data) => {
|
|
3177
|
-
const [recipeProps, styleProps] = recipes.splitProps(name2,
|
|
3178
|
-
sheet.
|
|
3185
|
+
const [recipeProps, styleProps] = recipes.splitProps(name2, data);
|
|
3186
|
+
sheet.processStyleProps(styleProps);
|
|
3179
3187
|
sheet.processRecipe(recipeConfig, recipeProps);
|
|
3180
3188
|
});
|
|
3181
3189
|
}).otherwise(() => {
|
|
@@ -3194,8 +3202,8 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3194
3202
|
(0, import_ts_pattern6.match)(pattern).with({ type: "jsx-pattern", name: import_ts_pattern6.P.string }, ({ name: name2 }) => {
|
|
3195
3203
|
pattern.data.forEach((data) => {
|
|
3196
3204
|
const fnName = patterns.getFnName(name2);
|
|
3197
|
-
const styleProps = patterns.transform(fnName,
|
|
3198
|
-
sheet.
|
|
3205
|
+
const styleProps = patterns.transform(fnName, data);
|
|
3206
|
+
sheet.processStyleProps(styleProps);
|
|
3199
3207
|
});
|
|
3200
3208
|
}).otherwise(() => {
|
|
3201
3209
|
pattern.data.forEach((data) => {
|