@pandacss/generator 0.0.0-dev-20230927132629 → 0.0.0-dev-20230927144111
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 +45 -38
- package/dist/index.mjs +45 -38
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1054,7 +1054,15 @@ function generateRecipes(ctx) {
|
|
|
1054
1054
|
${ctx.file.import("compact, createCss, withoutSpace", "../helpers")}
|
|
1055
1055
|
|
|
1056
1056
|
export const createRecipe = (name, defaultVariants, compoundVariants) => {
|
|
1057
|
-
|
|
1057
|
+
const getRecipeStyles = (variants) => {
|
|
1058
|
+
return {
|
|
1059
|
+
[name]: '__ignore__',
|
|
1060
|
+
...defaultVariants,
|
|
1061
|
+
...compact(variants),
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
const recipeFn = (variants, withCompoundVariants = true) => {
|
|
1058
1066
|
const transform = (prop, value) => {
|
|
1059
1067
|
assertCompoundVariant(name, compoundVariants, variants, prop)
|
|
1060
1068
|
|
|
@@ -1074,16 +1082,21 @@ function generateRecipes(ctx) {
|
|
|
1074
1082
|
}
|
|
1075
1083
|
})
|
|
1076
1084
|
|
|
1077
|
-
const recipeStyles =
|
|
1078
|
-
[name]: '__ignore__',
|
|
1079
|
-
...defaultVariants,
|
|
1080
|
-
...compact(variants),
|
|
1081
|
-
}
|
|
1085
|
+
const recipeStyles = getRecipeStyles(variants)
|
|
1082
1086
|
|
|
1083
|
-
|
|
1087
|
+
if (withCompoundVariants) {
|
|
1088
|
+
const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
|
|
1089
|
+
return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
|
|
1090
|
+
}
|
|
1084
1091
|
|
|
1085
|
-
return
|
|
1092
|
+
return recipeCss(recipeStyles)
|
|
1086
1093
|
}
|
|
1094
|
+
|
|
1095
|
+
return Object.assign(recipeFn, {
|
|
1096
|
+
__getCompoundVariantCss__: (variants) => {
|
|
1097
|
+
return getCompoundVariantCss(compoundVariants, getRecipeStyles(variants));
|
|
1098
|
+
},
|
|
1099
|
+
})
|
|
1087
1100
|
}
|
|
1088
1101
|
`
|
|
1089
1102
|
};
|
|
@@ -1280,7 +1293,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1280
1293
|
import { h } from 'preact'
|
|
1281
1294
|
import { forwardRef } from 'preact/compat'
|
|
1282
1295
|
import { useMemo } from 'preact/hooks'
|
|
1283
|
-
${ctx.file.import("css, cx, cva
|
|
1296
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1284
1297
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1285
1298
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1286
1299
|
|
|
@@ -1296,15 +1309,14 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1296
1309
|
|
|
1297
1310
|
function recipeClass() {
|
|
1298
1311
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1299
|
-
const
|
|
1300
|
-
return cx(cvaFn(variantProps), css(
|
|
1312
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1313
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className, elementProps.class)
|
|
1301
1314
|
}
|
|
1302
1315
|
|
|
1303
1316
|
function cvaClass() {
|
|
1304
1317
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1305
1318
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1306
|
-
|
|
1307
|
-
return cx(css(styles), elementProps.className, elementProps.class)
|
|
1319
|
+
return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className, elementProps.class)
|
|
1308
1320
|
}
|
|
1309
1321
|
|
|
1310
1322
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1525,7 +1537,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1525
1537
|
return {
|
|
1526
1538
|
js: import_outdent19.outdent`
|
|
1527
1539
|
import { h } from '@builder.io/qwik'
|
|
1528
|
-
${ctx.file.import("css, cx, cva
|
|
1540
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1529
1541
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1530
1542
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1531
1543
|
|
|
@@ -1541,14 +1553,13 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1541
1553
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1542
1554
|
|
|
1543
1555
|
function recipeClass() {
|
|
1544
|
-
const
|
|
1545
|
-
return cx(cvaFn(variantProps), css(
|
|
1556
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1557
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.class)
|
|
1546
1558
|
}
|
|
1547
1559
|
|
|
1548
1560
|
function cvaClass() {
|
|
1549
1561
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1550
|
-
|
|
1551
|
-
return cx(css(styles), elementProps.class)
|
|
1562
|
+
return cx(css(cvaStyles, propStyles, cssStyles), elementProps.class)
|
|
1552
1563
|
}
|
|
1553
1564
|
|
|
1554
1565
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1776,7 +1787,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1776
1787
|
return {
|
|
1777
1788
|
js: import_outdent24.outdent`
|
|
1778
1789
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
1779
|
-
${ctx.file.import("css, cx, cva
|
|
1790
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1780
1791
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1781
1792
|
${ctx.jsx.styleProps === "all" ? ctx.file.import("isCssProperty", "./is-valid-prop") : ""}
|
|
1782
1793
|
|
|
@@ -1794,15 +1805,14 @@ function generateReactJsxFactory(ctx) {
|
|
|
1794
1805
|
|
|
1795
1806
|
function recipeClass() {
|
|
1796
1807
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1797
|
-
const
|
|
1798
|
-
return cx(cvaFn(variantProps), css(
|
|
1808
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1809
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
|
|
1799
1810
|
}
|
|
1800
1811
|
|
|
1801
1812
|
function cvaClass() {
|
|
1802
1813
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1803
1814
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1804
|
-
|
|
1805
|
-
return cx(css(styles), elementProps.className)
|
|
1815
|
+
return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className)
|
|
1806
1816
|
}`;
|
|
1807
1817
|
}).with("minimal", () => {
|
|
1808
1818
|
return import_outdent24.outdent`
|
|
@@ -1811,13 +1821,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1811
1821
|
}, [restProps])
|
|
1812
1822
|
|
|
1813
1823
|
function recipeClass() {
|
|
1814
|
-
|
|
1824
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1825
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, elementProps.css), elementProps.className)
|
|
1815
1826
|
}
|
|
1816
1827
|
|
|
1817
1828
|
function cvaClass() {
|
|
1818
1829
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1819
|
-
|
|
1820
|
-
return cx(css(styles), elementProps.className)
|
|
1830
|
+
return cx(css(cvaStyles, elementProps.css), elementProps.className)
|
|
1821
1831
|
}`;
|
|
1822
1832
|
}).with("none", () => {
|
|
1823
1833
|
return import_outdent24.outdent`
|
|
@@ -1826,13 +1836,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1826
1836
|
}, [restProps])
|
|
1827
1837
|
|
|
1828
1838
|
function recipeClass() {
|
|
1829
|
-
|
|
1839
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1840
|
+
return cx(cvaFn(variantProps, false), elementProps.className)
|
|
1830
1841
|
}
|
|
1831
1842
|
|
|
1832
1843
|
function cvaClass() {
|
|
1833
1844
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1834
|
-
|
|
1835
|
-
return cx(css(styles), elementProps.className)
|
|
1845
|
+
return cx(css(cvaStyles), elementProps.className)
|
|
1836
1846
|
}`;
|
|
1837
1847
|
}).run()}
|
|
1838
1848
|
|
|
@@ -2082,15 +2092,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2082
2092
|
|
|
2083
2093
|
function recipeClass() {
|
|
2084
2094
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2085
|
-
|
|
2086
|
-
return cx(cvaFn(variantProps), css(styles), localProps.class)
|
|
2095
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), localProps.class)
|
|
2087
2096
|
}
|
|
2088
2097
|
|
|
2089
2098
|
function cvaClass() {
|
|
2090
2099
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2091
2100
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
2092
|
-
|
|
2093
|
-
return cx(css(styles), localProps.class)
|
|
2101
|
+
return cx(css(cvaStyles, propStyles, cssStyles), localProps.class)
|
|
2094
2102
|
}
|
|
2095
2103
|
|
|
2096
2104
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -2341,15 +2349,14 @@ function generateVueJsxFactory(ctx) {
|
|
|
2341
2349
|
const recipeClass = computed(() => {
|
|
2342
2350
|
const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
|
|
2343
2351
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2344
|
-
const
|
|
2345
|
-
return cx(cvaFn(variantProps), css(
|
|
2352
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
2353
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
|
|
2346
2354
|
})
|
|
2347
2355
|
|
|
2348
2356
|
const cvaClass = computed(() => {
|
|
2349
2357
|
const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
|
|
2350
2358
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2351
|
-
|
|
2352
|
-
return cx(cvaFn(variantProps), css(styles), elementProps.className)
|
|
2359
|
+
return cx(cvaFn(variantProps), css(propStyles, cssStyles), elementProps.className)
|
|
2353
2360
|
})
|
|
2354
2361
|
|
|
2355
2362
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -2697,7 +2704,7 @@ var composition_d_ts_default = {
|
|
|
2697
2704
|
|
|
2698
2705
|
// src/artifacts/generated/recipe.d.ts.json
|
|
2699
2706
|
var recipe_d_ts_default = {
|
|
2700
|
-
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\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<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n raw: (props?: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\nexport type RecipeCompoundSelection<T
|
|
2707
|
+
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\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<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n raw: (props?: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>>\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface 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\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\ninterface RecipeConfigMeta {\n /**\n * The name of the recipe.\n */\n className: 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\nexport interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>\n extends RecipeDefinition<T>,\n RecipeConfigMeta {}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\ntype SlotRecord<S extends string, T> = Partial<Record<S, T>>\n\nexport type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>\n\nexport type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (\n props?: RecipeSelection<T>,\n) => SlotRecord<S, string>\n\nexport interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>\n extends SlotRecipeVariantFn<S, T> {\n raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVariantRecord<S>> {\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly<S[]>\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord<S, SystemStyleObject>\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]\n}\n\nexport type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(\n config: SlotRecipeDefinition<S, T>,\n) => SlotRecipeRuntimeFn<S, T>\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> = SlotRecipeDefinition<S, T> & RecipeConfigMeta\n"
|
|
2701
2708
|
};
|
|
2702
2709
|
|
|
2703
2710
|
// src/artifacts/generated/pattern.d.ts.json
|
package/dist/index.mjs
CHANGED
|
@@ -1023,7 +1023,15 @@ function generateRecipes(ctx) {
|
|
|
1023
1023
|
${ctx.file.import("compact, createCss, withoutSpace", "../helpers")}
|
|
1024
1024
|
|
|
1025
1025
|
export const createRecipe = (name, defaultVariants, compoundVariants) => {
|
|
1026
|
-
|
|
1026
|
+
const getRecipeStyles = (variants) => {
|
|
1027
|
+
return {
|
|
1028
|
+
[name]: '__ignore__',
|
|
1029
|
+
...defaultVariants,
|
|
1030
|
+
...compact(variants),
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
const recipeFn = (variants, withCompoundVariants = true) => {
|
|
1027
1035
|
const transform = (prop, value) => {
|
|
1028
1036
|
assertCompoundVariant(name, compoundVariants, variants, prop)
|
|
1029
1037
|
|
|
@@ -1043,16 +1051,21 @@ function generateRecipes(ctx) {
|
|
|
1043
1051
|
}
|
|
1044
1052
|
})
|
|
1045
1053
|
|
|
1046
|
-
const recipeStyles =
|
|
1047
|
-
[name]: '__ignore__',
|
|
1048
|
-
...defaultVariants,
|
|
1049
|
-
...compact(variants),
|
|
1050
|
-
}
|
|
1054
|
+
const recipeStyles = getRecipeStyles(variants)
|
|
1051
1055
|
|
|
1052
|
-
|
|
1056
|
+
if (withCompoundVariants) {
|
|
1057
|
+
const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
|
|
1058
|
+
return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
|
|
1059
|
+
}
|
|
1053
1060
|
|
|
1054
|
-
return
|
|
1061
|
+
return recipeCss(recipeStyles)
|
|
1055
1062
|
}
|
|
1063
|
+
|
|
1064
|
+
return Object.assign(recipeFn, {
|
|
1065
|
+
__getCompoundVariantCss__: (variants) => {
|
|
1066
|
+
return getCompoundVariantCss(compoundVariants, getRecipeStyles(variants));
|
|
1067
|
+
},
|
|
1068
|
+
})
|
|
1056
1069
|
}
|
|
1057
1070
|
`
|
|
1058
1071
|
};
|
|
@@ -1249,7 +1262,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1249
1262
|
import { h } from 'preact'
|
|
1250
1263
|
import { forwardRef } from 'preact/compat'
|
|
1251
1264
|
import { useMemo } from 'preact/hooks'
|
|
1252
|
-
${ctx.file.import("css, cx, cva
|
|
1265
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1253
1266
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1254
1267
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1255
1268
|
|
|
@@ -1265,15 +1278,14 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1265
1278
|
|
|
1266
1279
|
function recipeClass() {
|
|
1267
1280
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1268
|
-
const
|
|
1269
|
-
return cx(cvaFn(variantProps), css(
|
|
1281
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1282
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className, elementProps.class)
|
|
1270
1283
|
}
|
|
1271
1284
|
|
|
1272
1285
|
function cvaClass() {
|
|
1273
1286
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1274
1287
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1275
|
-
|
|
1276
|
-
return cx(css(styles), elementProps.className, elementProps.class)
|
|
1288
|
+
return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className, elementProps.class)
|
|
1277
1289
|
}
|
|
1278
1290
|
|
|
1279
1291
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1494,7 +1506,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1494
1506
|
return {
|
|
1495
1507
|
js: outdent19`
|
|
1496
1508
|
import { h } from '@builder.io/qwik'
|
|
1497
|
-
${ctx.file.import("css, cx, cva
|
|
1509
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1498
1510
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1499
1511
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1500
1512
|
|
|
@@ -1510,14 +1522,13 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1510
1522
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1511
1523
|
|
|
1512
1524
|
function recipeClass() {
|
|
1513
|
-
const
|
|
1514
|
-
return cx(cvaFn(variantProps), css(
|
|
1525
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1526
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.class)
|
|
1515
1527
|
}
|
|
1516
1528
|
|
|
1517
1529
|
function cvaClass() {
|
|
1518
1530
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1519
|
-
|
|
1520
|
-
return cx(css(styles), elementProps.class)
|
|
1531
|
+
return cx(css(cvaStyles, propStyles, cssStyles), elementProps.class)
|
|
1521
1532
|
}
|
|
1522
1533
|
|
|
1523
1534
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1745,7 +1756,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1745
1756
|
return {
|
|
1746
1757
|
js: outdent24`
|
|
1747
1758
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
1748
|
-
${ctx.file.import("css, cx, cva
|
|
1759
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1749
1760
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1750
1761
|
${ctx.jsx.styleProps === "all" ? ctx.file.import("isCssProperty", "./is-valid-prop") : ""}
|
|
1751
1762
|
|
|
@@ -1763,15 +1774,14 @@ function generateReactJsxFactory(ctx) {
|
|
|
1763
1774
|
|
|
1764
1775
|
function recipeClass() {
|
|
1765
1776
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1766
|
-
const
|
|
1767
|
-
return cx(cvaFn(variantProps), css(
|
|
1777
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1778
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
|
|
1768
1779
|
}
|
|
1769
1780
|
|
|
1770
1781
|
function cvaClass() {
|
|
1771
1782
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1772
1783
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1773
|
-
|
|
1774
|
-
return cx(css(styles), elementProps.className)
|
|
1784
|
+
return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className)
|
|
1775
1785
|
}`;
|
|
1776
1786
|
}).with("minimal", () => {
|
|
1777
1787
|
return outdent24`
|
|
@@ -1780,13 +1790,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1780
1790
|
}, [restProps])
|
|
1781
1791
|
|
|
1782
1792
|
function recipeClass() {
|
|
1783
|
-
|
|
1793
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1794
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, elementProps.css), elementProps.className)
|
|
1784
1795
|
}
|
|
1785
1796
|
|
|
1786
1797
|
function cvaClass() {
|
|
1787
1798
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1788
|
-
|
|
1789
|
-
return cx(css(styles), elementProps.className)
|
|
1799
|
+
return cx(css(cvaStyles, elementProps.css), elementProps.className)
|
|
1790
1800
|
}`;
|
|
1791
1801
|
}).with("none", () => {
|
|
1792
1802
|
return outdent24`
|
|
@@ -1795,13 +1805,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1795
1805
|
}, [restProps])
|
|
1796
1806
|
|
|
1797
1807
|
function recipeClass() {
|
|
1798
|
-
|
|
1808
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
1809
|
+
return cx(cvaFn(variantProps, false), elementProps.className)
|
|
1799
1810
|
}
|
|
1800
1811
|
|
|
1801
1812
|
function cvaClass() {
|
|
1802
1813
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
1803
|
-
|
|
1804
|
-
return cx(css(styles), elementProps.className)
|
|
1814
|
+
return cx(css(cvaStyles), elementProps.className)
|
|
1805
1815
|
}`;
|
|
1806
1816
|
}).run()}
|
|
1807
1817
|
|
|
@@ -2051,15 +2061,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
2051
2061
|
|
|
2052
2062
|
function recipeClass() {
|
|
2053
2063
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2054
|
-
|
|
2055
|
-
return cx(cvaFn(variantProps), css(styles), localProps.class)
|
|
2064
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), localProps.class)
|
|
2056
2065
|
}
|
|
2057
2066
|
|
|
2058
2067
|
function cvaClass() {
|
|
2059
2068
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2060
2069
|
const cvaStyles = cvaFn.raw(variantProps)
|
|
2061
|
-
|
|
2062
|
-
return cx(css(styles), localProps.class)
|
|
2070
|
+
return cx(css(cvaStyles, propStyles, cssStyles), localProps.class)
|
|
2063
2071
|
}
|
|
2064
2072
|
|
|
2065
2073
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -2310,15 +2318,14 @@ function generateVueJsxFactory(ctx) {
|
|
|
2310
2318
|
const recipeClass = computed(() => {
|
|
2311
2319
|
const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
|
|
2312
2320
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2313
|
-
const
|
|
2314
|
-
return cx(cvaFn(variantProps), css(
|
|
2321
|
+
const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
|
|
2322
|
+
return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
|
|
2315
2323
|
})
|
|
2316
2324
|
|
|
2317
2325
|
const cvaClass = computed(() => {
|
|
2318
2326
|
const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
|
|
2319
2327
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2320
|
-
|
|
2321
|
-
return cx(cvaFn(variantProps), css(styles), elementProps.className)
|
|
2328
|
+
return cx(cvaFn(variantProps), css(propStyles, cssStyles), elementProps.className)
|
|
2322
2329
|
})
|
|
2323
2330
|
|
|
2324
2331
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -2666,7 +2673,7 @@ var composition_d_ts_default = {
|
|
|
2666
2673
|
|
|
2667
2674
|
// src/artifacts/generated/recipe.d.ts.json
|
|
2668
2675
|
var recipe_d_ts_default = {
|
|
2669
|
-
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\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<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n raw: (props?: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\nexport type RecipeCompoundSelection<T
|
|
2676
|
+
content: "import type { SystemStyleObject, DistributiveOmit } from './system-types'\n\ntype Pretty<T> = { [K in keyof T]: T[K] } & {}\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\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<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n raw: (props?: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>>\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface 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\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\ninterface RecipeConfigMeta {\n /**\n * The name of the recipe.\n */\n className: 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\nexport interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>\n extends RecipeDefinition<T>,\n RecipeConfigMeta {}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\ntype SlotRecord<S extends string, T> = Partial<Record<S, T>>\n\nexport type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>\n\nexport type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (\n props?: RecipeSelection<T>,\n) => SlotRecord<S, string>\n\nexport interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>\n extends SlotRecipeVariantFn<S, T> {\n raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVariantRecord<S>> {\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly<S[]>\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord<S, SystemStyleObject>\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]\n}\n\nexport type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(\n config: SlotRecipeDefinition<S, T>,\n) => SlotRecipeRuntimeFn<S, T>\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> = SlotRecipeDefinition<S, T> & RecipeConfigMeta\n"
|
|
2670
2677
|
};
|
|
2671
2678
|
|
|
2672
2679
|
// src/artifacts/generated/pattern.d.ts.json
|
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-20230927144111",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.27",
|
|
22
22
|
"ts-pattern": "5.0.5",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
25
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
28
|
-
"@pandacss/types": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230927144111",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230927144111",
|
|
25
|
+
"@pandacss/logger": "0.0.0-dev-20230927144111",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230927144111",
|
|
27
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230927144111",
|
|
28
|
+
"@pandacss/types": "0.0.0-dev-20230927144111"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
33
|
+
"@pandacss/fixture": "0.0.0-dev-20230927144111"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|