@pandacss/generator 0.0.0-dev-20230413133612 → 0.0.0-dev-20230413141731
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.d.ts +5 -0
- package/dist/index.js +41 -25
- package/dist/index.mjs +41 -25
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare const getEngine: (conf: LoadConfigResult) => {
|
|
|
41
41
|
name: string;
|
|
42
42
|
props: string[];
|
|
43
43
|
baseName: string;
|
|
44
|
+
jsx: (string | RegExp)[];
|
|
44
45
|
}[];
|
|
45
46
|
recipes: Record<string, _pandacss_types.RecipeConfig>;
|
|
46
47
|
getConfig: (name: string) => _pandacss_types.RecipeConfig | undefined;
|
|
@@ -155,6 +156,7 @@ declare const createGenerator: (conf: LoadConfigResult) => {
|
|
|
155
156
|
name: string;
|
|
156
157
|
props: string[];
|
|
157
158
|
baseName: string;
|
|
159
|
+
jsx: (string | RegExp)[];
|
|
158
160
|
}[];
|
|
159
161
|
recipes: Record<string, _pandacss_types.RecipeConfig>;
|
|
160
162
|
getConfig: (name: string) => _pandacss_types.RecipeConfig | undefined;
|
|
@@ -262,8 +264,11 @@ declare const createGenerator: (conf: LoadConfigResult) => {
|
|
|
262
264
|
name: string;
|
|
263
265
|
props: string[];
|
|
264
266
|
baseName: string;
|
|
267
|
+
jsx: (string | RegExp)[];
|
|
265
268
|
})[];
|
|
266
269
|
};
|
|
270
|
+
getRecipeName: (jsx: string) => string;
|
|
271
|
+
getRecipeByName: (name: string) => _pandacss_types.RecipeConfig | undefined;
|
|
267
272
|
};
|
|
268
273
|
};
|
|
269
274
|
type Generator = ReturnType<typeof createGenerator>;
|
package/dist/index.js
CHANGED
|
@@ -1753,7 +1753,7 @@ var composition_d_ts_default = {
|
|
|
1753
1753
|
|
|
1754
1754
|
// src/artifacts/generated/recipe.d.ts.json
|
|
1755
1755
|
var recipe_d_ts_default = {
|
|
1756
|
-
content: "import type { SystemStyleObject } from './system-types'\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<string, Record<string, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n}\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<T extends RecipeVariantFn<RecipeVariantRecord>> = Parameters<T>[0]\n\nexport type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n variants: (keyof T)[]\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n}\n\nexport type RecipeDefinition<T extends RecipeVariantRecord> = {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\nexport type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {\n /**\n * The name of the recipe.\n */\n name: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe.\n */\n jsx?: string
|
|
1756
|
+
content: "import type { SystemStyleObject } from './system-types'\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<string, Record<string, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n}\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<T extends RecipeVariantFn<RecipeVariantRecord>> = Parameters<T>[0]\n\nexport type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n variants: (keyof T)[]\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n}\n\nexport type RecipeDefinition<T extends RecipeVariantRecord> = {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\nexport type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {\n /**\n * The name of the recipe.\n */\n name: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n}\n"
|
|
1757
1757
|
};
|
|
1758
1758
|
|
|
1759
1759
|
// src/artifacts/generated/selectors.d.ts.json
|
|
@@ -2204,6 +2204,7 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
2204
2204
|
var import_logger2 = require("@pandacss/logger");
|
|
2205
2205
|
var import_func = require("lil-fp/func");
|
|
2206
2206
|
var import_ts_pattern5 = require("ts-pattern");
|
|
2207
|
+
var flattenStyles = (data) => Object.assign({}, data, { css: void 0 }, data.css ?? {});
|
|
2207
2208
|
var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
2208
2209
|
{ ...ctx, sheet: ctx.createSheet(), result },
|
|
2209
2210
|
(0, import_func.tap)(({ sheet, result: result2, patterns, recipes }) => {
|
|
@@ -2219,17 +2220,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2219
2220
|
});
|
|
2220
2221
|
result2.jsx.forEach((jsx) => {
|
|
2221
2222
|
jsx.data.forEach((data) => {
|
|
2222
|
-
|
|
2223
|
-
const styles = { ...rest, ...css3 };
|
|
2224
|
-
(0, import_ts_pattern5.match)(jsx).with({ type: "pattern", name: import_ts_pattern5.P.string }, ({ name }) => {
|
|
2225
|
-
result2.setPattern(patterns.getFnName(name), { data: [styles] });
|
|
2226
|
-
}).with({ type: "recipe", name: import_ts_pattern5.P.string }, ({ name }) => {
|
|
2227
|
-
const [recipeProps, styleProps] = recipes.splitProps(name, styles);
|
|
2228
|
-
result2.setRecipe(recipes.getFnName(name), { data: [recipeProps] });
|
|
2229
|
-
sheet.processAtomic(styleProps);
|
|
2230
|
-
}).otherwise(() => {
|
|
2231
|
-
sheet.processAtomic(styles);
|
|
2232
|
-
});
|
|
2223
|
+
sheet.processAtomic(flattenStyles(data));
|
|
2233
2224
|
});
|
|
2234
2225
|
});
|
|
2235
2226
|
result2.recipe.forEach((recipeSet, name) => {
|
|
@@ -2238,8 +2229,16 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2238
2229
|
const recipeConfig = recipes.getConfig(name);
|
|
2239
2230
|
if (!recipeConfig)
|
|
2240
2231
|
continue;
|
|
2241
|
-
recipe.
|
|
2242
|
-
|
|
2232
|
+
(0, import_ts_pattern5.match)(recipe).with({ type: "jsx-recipe", name: import_ts_pattern5.P.string }, ({ name: name2 }) => {
|
|
2233
|
+
recipe.data.forEach((data) => {
|
|
2234
|
+
const [recipeProps, styleProps] = recipes.splitProps(name2, flattenStyles(data));
|
|
2235
|
+
sheet.processAtomic(styleProps);
|
|
2236
|
+
sheet.processRecipe(recipeConfig, recipeProps);
|
|
2237
|
+
});
|
|
2238
|
+
}).otherwise(() => {
|
|
2239
|
+
recipe.data.forEach((data) => {
|
|
2240
|
+
sheet.processRecipe(recipeConfig, data);
|
|
2241
|
+
});
|
|
2243
2242
|
});
|
|
2244
2243
|
}
|
|
2245
2244
|
} catch (error) {
|
|
@@ -2249,9 +2248,16 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2249
2248
|
result2.pattern.forEach((patternSet, name) => {
|
|
2250
2249
|
try {
|
|
2251
2250
|
for (const pattern of patternSet) {
|
|
2252
|
-
pattern.
|
|
2253
|
-
|
|
2254
|
-
|
|
2251
|
+
(0, import_ts_pattern5.match)(pattern).with({ type: "jsx-pattern", name: import_ts_pattern5.P.string }, ({ name: name2 }) => {
|
|
2252
|
+
pattern.data.forEach((data) => {
|
|
2253
|
+
const styleProps = patterns.transform(name2, flattenStyles(data));
|
|
2254
|
+
sheet.processAtomic(styleProps);
|
|
2255
|
+
});
|
|
2256
|
+
}).otherwise(() => {
|
|
2257
|
+
pattern.data.forEach((data) => {
|
|
2258
|
+
const styleProps = patterns.transform(name, data);
|
|
2259
|
+
sheet.processAtomic(styleProps);
|
|
2260
|
+
});
|
|
2255
2261
|
});
|
|
2256
2262
|
}
|
|
2257
2263
|
} catch (error) {
|
|
@@ -2405,27 +2411,35 @@ var getRecipeEngine = (config) => {
|
|
|
2405
2411
|
import_lil_fp3.Obj.bind("getConfig", ({ recipes }) => {
|
|
2406
2412
|
return (name) => recipes[name];
|
|
2407
2413
|
}),
|
|
2408
|
-
import_lil_fp3.Obj.bind("getNames", (
|
|
2414
|
+
import_lil_fp3.Obj.bind("getNames", () => {
|
|
2409
2415
|
return (name) => ({
|
|
2410
2416
|
upperName: (0, import_shared7.capitalize)(name),
|
|
2411
2417
|
dashName: (0, import_shared7.dashCase)(name),
|
|
2412
|
-
jsxName:
|
|
2418
|
+
jsxName: (0, import_shared7.capitalize)(name)
|
|
2413
2419
|
});
|
|
2414
2420
|
}),
|
|
2415
2421
|
import_lil_fp3.Obj.bind("nodes", ({ recipes }) => {
|
|
2416
2422
|
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
2417
2423
|
type: "recipe",
|
|
2418
|
-
name:
|
|
2424
|
+
name: (0, import_shared7.capitalize)(name),
|
|
2419
2425
|
props: Object.keys(recipe.variants ?? {}),
|
|
2420
|
-
baseName: name
|
|
2426
|
+
baseName: name,
|
|
2427
|
+
jsx: recipe.jsx ?? [(0, import_shared7.capitalize)(name)]
|
|
2421
2428
|
}));
|
|
2422
2429
|
}),
|
|
2423
|
-
import_lil_fp3.Obj.bind("getFnName", ({ nodes }) =>
|
|
2424
|
-
return
|
|
2430
|
+
import_lil_fp3.Obj.bind("getFnName", ({ nodes }) => {
|
|
2431
|
+
return (jsx) => {
|
|
2432
|
+
const recipe = nodes.find((node) => {
|
|
2433
|
+
return node.jsx.some((tag) => typeof tag === "string" ? tag === jsx : tag.test(jsx));
|
|
2434
|
+
});
|
|
2435
|
+
return recipe?.baseName ?? (0, import_shared7.uncapitalize)(jsx);
|
|
2436
|
+
};
|
|
2425
2437
|
}),
|
|
2426
2438
|
import_lil_fp3.Obj.bind("splitProps", ({ nodes }) => {
|
|
2427
2439
|
return (name, props) => {
|
|
2428
|
-
const recipe = nodes.find((node) =>
|
|
2440
|
+
const recipe = nodes.find((node) => {
|
|
2441
|
+
return node.jsx.some((tag) => typeof tag === "string" ? tag === name : tag.test(name));
|
|
2442
|
+
});
|
|
2429
2443
|
if (!recipe)
|
|
2430
2444
|
return [{}, props];
|
|
2431
2445
|
return (0, import_shared7.splitProps)(props, recipe.props);
|
|
@@ -2496,7 +2510,9 @@ var createGenerator = (conf) => (0, import_lil_fp4.pipe)(
|
|
|
2496
2510
|
factory: jsx.factoryName,
|
|
2497
2511
|
isStyleProp: isValidProperty,
|
|
2498
2512
|
nodes: [...patterns.nodes, ...recipes.nodes]
|
|
2499
|
-
}
|
|
2513
|
+
},
|
|
2514
|
+
getRecipeName: recipes.getFnName,
|
|
2515
|
+
getRecipeByName: recipes.getConfig
|
|
2500
2516
|
}))
|
|
2501
2517
|
);
|
|
2502
2518
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -1722,7 +1722,7 @@ var composition_d_ts_default = {
|
|
|
1722
1722
|
|
|
1723
1723
|
// src/artifacts/generated/recipe.d.ts.json
|
|
1724
1724
|
var recipe_d_ts_default = {
|
|
1725
|
-
content: "import type { SystemStyleObject } from './system-types'\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<string, Record<string, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n}\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<T extends RecipeVariantFn<RecipeVariantRecord>> = Parameters<T>[0]\n\nexport type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n variants: (keyof T)[]\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n}\n\nexport type RecipeDefinition<T extends RecipeVariantRecord> = {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\nexport type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {\n /**\n * The name of the recipe.\n */\n name: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe.\n */\n jsx?: string
|
|
1725
|
+
content: "import type { SystemStyleObject } from './system-types'\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<string, Record<string, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n}\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<T extends RecipeVariantFn<RecipeVariantRecord>> = Parameters<T>[0]\n\nexport type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n variants: (keyof T)[]\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n}\n\nexport type RecipeDefinition<T extends RecipeVariantRecord> = {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\nexport type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {\n /**\n * The name of the recipe.\n */\n name: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n}\n"
|
|
1726
1726
|
};
|
|
1727
1727
|
|
|
1728
1728
|
// src/artifacts/generated/selectors.d.ts.json
|
|
@@ -2173,6 +2173,7 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
2173
2173
|
import { logger } from "@pandacss/logger";
|
|
2174
2174
|
import { pipe, tap, tryCatch } from "lil-fp/func";
|
|
2175
2175
|
import { match as match5, P } from "ts-pattern";
|
|
2176
|
+
var flattenStyles = (data) => Object.assign({}, data, { css: void 0 }, data.css ?? {});
|
|
2176
2177
|
var generateParserCss = (ctx) => (result) => pipe(
|
|
2177
2178
|
{ ...ctx, sheet: ctx.createSheet(), result },
|
|
2178
2179
|
tap(({ sheet, result: result2, patterns, recipes }) => {
|
|
@@ -2188,17 +2189,7 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
2188
2189
|
});
|
|
2189
2190
|
result2.jsx.forEach((jsx) => {
|
|
2190
2191
|
jsx.data.forEach((data) => {
|
|
2191
|
-
|
|
2192
|
-
const styles = { ...rest, ...css3 };
|
|
2193
|
-
match5(jsx).with({ type: "pattern", name: P.string }, ({ name }) => {
|
|
2194
|
-
result2.setPattern(patterns.getFnName(name), { data: [styles] });
|
|
2195
|
-
}).with({ type: "recipe", name: P.string }, ({ name }) => {
|
|
2196
|
-
const [recipeProps, styleProps] = recipes.splitProps(name, styles);
|
|
2197
|
-
result2.setRecipe(recipes.getFnName(name), { data: [recipeProps] });
|
|
2198
|
-
sheet.processAtomic(styleProps);
|
|
2199
|
-
}).otherwise(() => {
|
|
2200
|
-
sheet.processAtomic(styles);
|
|
2201
|
-
});
|
|
2192
|
+
sheet.processAtomic(flattenStyles(data));
|
|
2202
2193
|
});
|
|
2203
2194
|
});
|
|
2204
2195
|
result2.recipe.forEach((recipeSet, name) => {
|
|
@@ -2207,8 +2198,16 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
2207
2198
|
const recipeConfig = recipes.getConfig(name);
|
|
2208
2199
|
if (!recipeConfig)
|
|
2209
2200
|
continue;
|
|
2210
|
-
recipe.
|
|
2211
|
-
|
|
2201
|
+
match5(recipe).with({ type: "jsx-recipe", name: P.string }, ({ name: name2 }) => {
|
|
2202
|
+
recipe.data.forEach((data) => {
|
|
2203
|
+
const [recipeProps, styleProps] = recipes.splitProps(name2, flattenStyles(data));
|
|
2204
|
+
sheet.processAtomic(styleProps);
|
|
2205
|
+
sheet.processRecipe(recipeConfig, recipeProps);
|
|
2206
|
+
});
|
|
2207
|
+
}).otherwise(() => {
|
|
2208
|
+
recipe.data.forEach((data) => {
|
|
2209
|
+
sheet.processRecipe(recipeConfig, data);
|
|
2210
|
+
});
|
|
2212
2211
|
});
|
|
2213
2212
|
}
|
|
2214
2213
|
} catch (error) {
|
|
@@ -2218,9 +2217,16 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
2218
2217
|
result2.pattern.forEach((patternSet, name) => {
|
|
2219
2218
|
try {
|
|
2220
2219
|
for (const pattern of patternSet) {
|
|
2221
|
-
pattern.
|
|
2222
|
-
|
|
2223
|
-
|
|
2220
|
+
match5(pattern).with({ type: "jsx-pattern", name: P.string }, ({ name: name2 }) => {
|
|
2221
|
+
pattern.data.forEach((data) => {
|
|
2222
|
+
const styleProps = patterns.transform(name2, flattenStyles(data));
|
|
2223
|
+
sheet.processAtomic(styleProps);
|
|
2224
|
+
});
|
|
2225
|
+
}).otherwise(() => {
|
|
2226
|
+
pattern.data.forEach((data) => {
|
|
2227
|
+
const styleProps = patterns.transform(name, data);
|
|
2228
|
+
sheet.processAtomic(styleProps);
|
|
2229
|
+
});
|
|
2224
2230
|
});
|
|
2225
2231
|
}
|
|
2226
2232
|
} catch (error) {
|
|
@@ -2374,27 +2380,35 @@ var getRecipeEngine = (config) => {
|
|
|
2374
2380
|
Obj3.bind("getConfig", ({ recipes }) => {
|
|
2375
2381
|
return (name) => recipes[name];
|
|
2376
2382
|
}),
|
|
2377
|
-
Obj3.bind("getNames", (
|
|
2383
|
+
Obj3.bind("getNames", () => {
|
|
2378
2384
|
return (name) => ({
|
|
2379
2385
|
upperName: capitalize4(name),
|
|
2380
2386
|
dashName: dashCase2(name),
|
|
2381
|
-
jsxName:
|
|
2387
|
+
jsxName: capitalize4(name)
|
|
2382
2388
|
});
|
|
2383
2389
|
}),
|
|
2384
2390
|
Obj3.bind("nodes", ({ recipes }) => {
|
|
2385
2391
|
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
2386
2392
|
type: "recipe",
|
|
2387
|
-
name:
|
|
2393
|
+
name: capitalize4(name),
|
|
2388
2394
|
props: Object.keys(recipe.variants ?? {}),
|
|
2389
|
-
baseName: name
|
|
2395
|
+
baseName: name,
|
|
2396
|
+
jsx: recipe.jsx ?? [capitalize4(name)]
|
|
2390
2397
|
}));
|
|
2391
2398
|
}),
|
|
2392
|
-
Obj3.bind("getFnName", ({ nodes }) =>
|
|
2393
|
-
return
|
|
2399
|
+
Obj3.bind("getFnName", ({ nodes }) => {
|
|
2400
|
+
return (jsx) => {
|
|
2401
|
+
const recipe = nodes.find((node) => {
|
|
2402
|
+
return node.jsx.some((tag) => typeof tag === "string" ? tag === jsx : tag.test(jsx));
|
|
2403
|
+
});
|
|
2404
|
+
return recipe?.baseName ?? uncapitalize2(jsx);
|
|
2405
|
+
};
|
|
2394
2406
|
}),
|
|
2395
2407
|
Obj3.bind("splitProps", ({ nodes }) => {
|
|
2396
2408
|
return (name, props) => {
|
|
2397
|
-
const recipe = nodes.find((node) =>
|
|
2409
|
+
const recipe = nodes.find((node) => {
|
|
2410
|
+
return node.jsx.some((tag) => typeof tag === "string" ? tag === name : tag.test(name));
|
|
2411
|
+
});
|
|
2398
2412
|
if (!recipe)
|
|
2399
2413
|
return [{}, props];
|
|
2400
2414
|
return splitProps(props, recipe.props);
|
|
@@ -2465,7 +2479,9 @@ var createGenerator = (conf) => pipe5(
|
|
|
2465
2479
|
factory: jsx.factoryName,
|
|
2466
2480
|
isStyleProp: isValidProperty,
|
|
2467
2481
|
nodes: [...patterns.nodes, ...recipes.nodes]
|
|
2468
|
-
}
|
|
2482
|
+
},
|
|
2483
|
+
getRecipeName: recipes.getFnName,
|
|
2484
|
+
getRecipeByName: recipes.getConfig
|
|
2469
2485
|
}))
|
|
2470
2486
|
);
|
|
2471
2487
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230413141731",
|
|
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.2",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
25
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/types": "0.0.0-dev-
|
|
28
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230413141731",
|
|
24
|
+
"@pandacss/logger": "0.0.0-dev-20230413141731",
|
|
25
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230413141731",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230413141731",
|
|
27
|
+
"@pandacss/types": "0.0.0-dev-20230413141731",
|
|
28
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230413141731"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.29",
|
|
32
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
32
|
+
"@pandacss/fixture": "0.0.0-dev-20230413141731"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"prebuild": "tsx scripts/prebuild.ts",
|