@pandacss/generator 0.37.2 → 0.38.0
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 +33 -34
- package/dist/index.mjs +33 -34
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -544,7 +544,7 @@ function generatePattern(ctx, filters) {
|
|
|
544
544
|
const details = ctx.patterns.filterDetails(filters);
|
|
545
545
|
return details.map((pattern) => {
|
|
546
546
|
const { baseName, config, dashName, upperName, styleFnName, blocklistType } = pattern;
|
|
547
|
-
const { properties, transform, strict, description, defaultValues } = config;
|
|
547
|
+
const { properties, transform, strict, description, defaultValues, deprecated } = config;
|
|
548
548
|
const patternConfigFn = (0, import_javascript_stringify.stringify)((0, import_shared.compact)({ transform, defaultValues })) ?? "";
|
|
549
549
|
const helperImports = ["getPatternStyles, patternFns"];
|
|
550
550
|
if (patternConfigFn.includes("__spreadValues")) {
|
|
@@ -589,7 +589,7 @@ function generatePattern(ctx, filters) {
|
|
|
589
589
|
raw: (styles?: ${upperName}Styles) => SystemStyleObject
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
-
${description
|
|
592
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
593
593
|
export declare const ${baseName}: ${upperName}PatternFn;
|
|
594
594
|
`}
|
|
595
595
|
|
|
@@ -722,7 +722,7 @@ function generateRecipes(ctx, filters) {
|
|
|
722
722
|
const details = ctx.recipes.filterDetails(filters);
|
|
723
723
|
return details.map((recipe) => {
|
|
724
724
|
const { baseName, config, upperName, variantKeyMap, dashName } = recipe;
|
|
725
|
-
const { description, defaultVariants, compoundVariants } = config;
|
|
725
|
+
const { description, defaultVariants, compoundVariants, deprecated } = config;
|
|
726
726
|
const jsCode = (0, import_ts_pattern4.match)(config).when(
|
|
727
727
|
import_core.Recipes.isSlotRecipeConfig,
|
|
728
728
|
(config2) => import_outdent11.outdent`
|
|
@@ -818,7 +818,7 @@ function generateRecipes(ctx, filters) {
|
|
|
818
818
|
getVariantProps: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
819
819
|
}
|
|
820
820
|
|
|
821
|
-
${description
|
|
821
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
822
822
|
export declare const ${baseName}: ${upperName}Recipe
|
|
823
823
|
`
|
|
824
824
|
};
|
|
@@ -963,13 +963,13 @@ function generatePreactJsxFactory(ctx) {
|
|
|
963
963
|
function recipeClass() {
|
|
964
964
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
965
965
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
966
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
966
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
|
|
967
967
|
}
|
|
968
968
|
|
|
969
969
|
function cvaClass() {
|
|
970
970
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
971
971
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
972
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
972
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
|
|
973
973
|
}
|
|
974
974
|
|
|
975
975
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1022,7 +1022,7 @@ function generatePreactJsxPattern(ctx, filters) {
|
|
|
1022
1022
|
const details = ctx.patterns.filterDetails(filters);
|
|
1023
1023
|
return details.map((pattern) => {
|
|
1024
1024
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1025
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
1025
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
1026
1026
|
return {
|
|
1027
1027
|
name: dashName,
|
|
1028
1028
|
js: import_outdent15.outdent`
|
|
@@ -1076,7 +1076,7 @@ function generatePreactJsxPattern(ctx, filters) {
|
|
|
1076
1076
|
|
|
1077
1077
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1078
1078
|
|
|
1079
|
-
${description
|
|
1079
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
1080
1080
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
1081
1081
|
`
|
|
1082
1082
|
};
|
|
@@ -1291,13 +1291,13 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1291
1291
|
function recipeClass() {
|
|
1292
1292
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1293
1293
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
1294
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1294
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
1297
|
function cvaClass() {
|
|
1298
1298
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1299
1299
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1300
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1300
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
|
|
1301
1301
|
}
|
|
1302
1302
|
|
|
1303
1303
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1350,7 +1350,7 @@ function generateQwikJsxPattern(ctx, filters) {
|
|
|
1350
1350
|
const details = ctx.patterns.filterDetails(filters);
|
|
1351
1351
|
return details.map((pattern) => {
|
|
1352
1352
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1353
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
1353
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
1354
1354
|
return {
|
|
1355
1355
|
name: dashName,
|
|
1356
1356
|
js: import_outdent20.outdent`
|
|
@@ -1403,7 +1403,7 @@ function generateQwikJsxPattern(ctx, filters) {
|
|
|
1403
1403
|
|
|
1404
1404
|
export interface ${upperName}Props extends Assign<${typeName}<'${jsxElement}'>, DistributiveOmit<${upperName}Properties, ${blocklistType || '""'}>> {}
|
|
1405
1405
|
|
|
1406
|
-
${description
|
|
1406
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
1407
1407
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
1408
1408
|
`
|
|
1409
1409
|
};
|
|
@@ -1624,13 +1624,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1624
1624
|
function recipeClass() {
|
|
1625
1625
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1626
1626
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
1627
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.className)
|
|
1627
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
|
|
1628
1628
|
}
|
|
1629
1629
|
|
|
1630
1630
|
function cvaClass() {
|
|
1631
1631
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1632
1632
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1633
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
|
|
1633
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
1636
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1684,7 +1684,7 @@ function generateReactJsxPattern(ctx, filters) {
|
|
|
1684
1684
|
const details = ctx.patterns.filterDetails(filters);
|
|
1685
1685
|
return details.map((pattern) => {
|
|
1686
1686
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1687
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
1687
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
1688
1688
|
return {
|
|
1689
1689
|
name: dashName,
|
|
1690
1690
|
js: import_outdent25.outdent`
|
|
@@ -1737,7 +1737,7 @@ function generateReactJsxPattern(ctx, filters) {
|
|
|
1737
1737
|
|
|
1738
1738
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1739
1739
|
|
|
1740
|
-
${description
|
|
1740
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
1741
1741
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
1742
1742
|
`
|
|
1743
1743
|
};
|
|
@@ -1987,7 +1987,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1987
1987
|
__cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
1988
1988
|
return cx(
|
|
1989
1989
|
__cvaFn__(variantProps, false),
|
|
1990
|
-
css(compoundVariantStyles, propStyles, cssStyles),
|
|
1990
|
+
css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
|
|
1991
1991
|
localProps.class,
|
|
1992
1992
|
localProps.className
|
|
1993
1993
|
)
|
|
@@ -1997,7 +1997,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1997
1997
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1998
1998
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1999
1999
|
return cx(
|
|
2000
|
-
css(cvaStyles, propStyles, cssStyles),
|
|
2000
|
+
css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
|
|
2001
2001
|
localProps.class,
|
|
2002
2002
|
localProps.className
|
|
2003
2003
|
)
|
|
@@ -2061,7 +2061,7 @@ function generateSolidJsxPattern(ctx, filters) {
|
|
|
2061
2061
|
const details = ctx.patterns.filterDetails(filters);
|
|
2062
2062
|
return details.map((pattern) => {
|
|
2063
2063
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
2064
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
2064
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
2065
2065
|
return {
|
|
2066
2066
|
name: dashName,
|
|
2067
2067
|
js: import_outdent30.outdent`
|
|
@@ -2116,7 +2116,7 @@ function generateSolidJsxPattern(ctx, filters) {
|
|
|
2116
2116
|
|
|
2117
2117
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2118
2118
|
|
|
2119
|
-
${description
|
|
2119
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
2120
2120
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
2121
2121
|
`
|
|
2122
2122
|
};
|
|
@@ -2341,14 +2341,14 @@ function generateVueJsxFactory(ctx) {
|
|
|
2341
2341
|
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2342
2342
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2343
2343
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
2344
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2344
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
|
|
2345
2345
|
})
|
|
2346
2346
|
|
|
2347
2347
|
const cvaClass = computed(() => {
|
|
2348
2348
|
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2349
2349
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2350
2350
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
2351
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2351
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
|
|
2352
2352
|
})
|
|
2353
2353
|
|
|
2354
2354
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -2516,7 +2516,7 @@ function generateVueJsxPattern(ctx, filters) {
|
|
|
2516
2516
|
const details = ctx.patterns.filterDetails(filters);
|
|
2517
2517
|
return details.map((pattern) => {
|
|
2518
2518
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
2519
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
2519
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
2520
2520
|
return {
|
|
2521
2521
|
name: dashName,
|
|
2522
2522
|
js: import_outdent36.outdent`
|
|
@@ -2577,7 +2577,7 @@ function generateVueJsxPattern(ctx, filters) {
|
|
|
2577
2577
|
|
|
2578
2578
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2579
2579
|
|
|
2580
|
-
${description
|
|
2580
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
2581
2581
|
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
2582
2582
|
`
|
|
2583
2583
|
};
|
|
@@ -3517,12 +3517,12 @@ var parts_d_ts_default = {
|
|
|
3517
3517
|
|
|
3518
3518
|
// src/artifacts/generated/pattern.d.ts.json
|
|
3519
3519
|
var pattern_d_ts_default = {
|
|
3520
|
-
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n isCssUnit: (value: any) => boolean\n isCssVar: (value: any) => boolean\n isCssFunction: (value: any) => boolean\n}\n\nexport interface PatternProperties {\n [key: string]: PatternProperty\n}\n\ntype InferProps<T> = Record<LiteralUnion<keyof T>, any>\n\nexport type PatternDefaultValue<T> = Partial<InferProps<T>>\n\nexport type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The default values of the pattern.\n */\n defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsxName?: string\n /**\n * The jsx elements to track for this pattern. Can be string or Regexp.\n *\n * @default capitalize(pattern.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
3520
|
+
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n isCssUnit: (value: any) => boolean\n isCssVar: (value: any) => boolean\n isCssFunction: (value: any) => boolean\n}\n\nexport interface PatternProperties {\n [key: string]: PatternProperty\n}\n\ntype InferProps<T> = Record<LiteralUnion<keyof T>, any>\n\nexport type PatternDefaultValue<T> = Partial<InferProps<T>>\n\nexport type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The default values of the pattern.\n */\n defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * Whether the pattern is deprecated.\n */\n deprecated?: boolean | string\n /**\n * The jsx element name this pattern will generate.\n */\n jsxName?: string\n /**\n * The jsx elements to track for this pattern. Can be string or Regexp.\n *\n * @default capitalize(pattern.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
3521
3521
|
};
|
|
3522
3522
|
|
|
3523
3523
|
// src/artifacts/generated/recipe.d.ts.json
|
|
3524
3524
|
var recipe_d_ts_default = {
|
|
3525
|
-
content: "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\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]> | undefined\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\n/**\n * Extract the variant as optional props from a `cva` function.\n * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.\n */\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>\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 getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord = 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 class 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 * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\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>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> {\n /**\n * An optional class name that can be used to target slots in the DOM.\n */\n className?: string\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"
|
|
3525
|
+
content: "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\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]> | undefined\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\n/**\n * Extract the variant as optional props from a `cva` function.\n * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.\n */\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>\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 getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string\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 class 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 * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\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>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> {\n /**\n * An optional class name that can be used to target slots in the DOM.\n */\n className?: string\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string\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"
|
|
3526
3526
|
};
|
|
3527
3527
|
|
|
3528
3528
|
// src/artifacts/generated/selectors.d.ts.json
|
|
@@ -3537,7 +3537,7 @@ var static_css_d_ts_default = {
|
|
|
3537
3537
|
|
|
3538
3538
|
// src/artifacts/generated/system-types.d.ts.json
|
|
3539
3539
|
var system_types_d_ts_default = {
|
|
3540
|
-
content: "import type { ConditionalValue, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject\n}\ntype StyleProps = SystemStyleObject & WithCss\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
3540
|
+
content: "import type { ConditionalValue, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[]\n}\ntype StyleProps = SystemStyleObject & WithCss\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
3541
3541
|
};
|
|
3542
3542
|
|
|
3543
3543
|
// src/artifacts/types/generated.ts
|
|
@@ -3618,7 +3618,7 @@ function generatePropTypes(ctx) {
|
|
|
3618
3618
|
const { utility } = ctx;
|
|
3619
3619
|
const result = [
|
|
3620
3620
|
import_outdent40.outdent`
|
|
3621
|
-
${ctx.file.importType("
|
|
3621
|
+
${ctx.file.importType("ConditionalValue", "./conditions")}
|
|
3622
3622
|
${ctx.file.importType("CssProperties", "./system-types")}
|
|
3623
3623
|
${ctx.file.importType("Tokens", "../tokens/index")}
|
|
3624
3624
|
|
|
@@ -3719,7 +3719,10 @@ function generateStyleProps(ctx) {
|
|
|
3719
3719
|
if (!filtered.length) {
|
|
3720
3720
|
filtered.push("string | number");
|
|
3721
3721
|
}
|
|
3722
|
-
|
|
3722
|
+
let comment = csstype_d_ts_default.comments?.[prop] || "";
|
|
3723
|
+
if (ctx.utility.isDeprecated(prop)) {
|
|
3724
|
+
comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
|
|
3725
|
+
}
|
|
3723
3726
|
const value = filtered.filter(Boolean).join(" | ");
|
|
3724
3727
|
const line = `${key}?: ${restrict(prop, value, ctx.config)}`;
|
|
3725
3728
|
return " " + [comment, line].filter(Boolean).join("\n");
|
|
@@ -4580,7 +4583,7 @@ function generateResetCss(ctx, sheet) {
|
|
|
4580
4583
|
selector = `&${scope}`;
|
|
4581
4584
|
}
|
|
4582
4585
|
const scoped = {
|
|
4583
|
-
"*, ::before, ::after, ::backdrop, ::
|
|
4586
|
+
"*, ::before, ::after, ::backdrop, ::file-selector-button": {
|
|
4584
4587
|
margin: "0px",
|
|
4585
4588
|
padding: "0px",
|
|
4586
4589
|
boxSizing: "border-box",
|
|
@@ -4635,10 +4638,6 @@ function generateResetCss(ctx, sheet) {
|
|
|
4635
4638
|
"--placeholder-fallback": "color-mix(in srgb, currentColor 50%, transparent)",
|
|
4636
4639
|
color: "var(--global-color-placeholder, var(--placeholder-fallback))"
|
|
4637
4640
|
},
|
|
4638
|
-
"select, textarea, input:where(:not([type='button'], [type='reset'], [type='submit']))": {
|
|
4639
|
-
borderWidth: "1px",
|
|
4640
|
-
borderStyle: "solid"
|
|
4641
|
-
},
|
|
4642
4641
|
textarea: {
|
|
4643
4642
|
resize: "vertical"
|
|
4644
4643
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -508,7 +508,7 @@ function generatePattern(ctx, filters) {
|
|
|
508
508
|
const details = ctx.patterns.filterDetails(filters);
|
|
509
509
|
return details.map((pattern) => {
|
|
510
510
|
const { baseName, config, dashName, upperName, styleFnName, blocklistType } = pattern;
|
|
511
|
-
const { properties, transform, strict, description, defaultValues } = config;
|
|
511
|
+
const { properties, transform, strict, description, defaultValues, deprecated } = config;
|
|
512
512
|
const patternConfigFn = stringify(compact({ transform, defaultValues })) ?? "";
|
|
513
513
|
const helperImports = ["getPatternStyles, patternFns"];
|
|
514
514
|
if (patternConfigFn.includes("__spreadValues")) {
|
|
@@ -553,7 +553,7 @@ function generatePattern(ctx, filters) {
|
|
|
553
553
|
raw: (styles?: ${upperName}Styles) => SystemStyleObject
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
${description
|
|
556
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
557
557
|
export declare const ${baseName}: ${upperName}PatternFn;
|
|
558
558
|
`}
|
|
559
559
|
|
|
@@ -686,7 +686,7 @@ function generateRecipes(ctx, filters) {
|
|
|
686
686
|
const details = ctx.recipes.filterDetails(filters);
|
|
687
687
|
return details.map((recipe) => {
|
|
688
688
|
const { baseName, config, upperName, variantKeyMap, dashName } = recipe;
|
|
689
|
-
const { description, defaultVariants, compoundVariants } = config;
|
|
689
|
+
const { description, defaultVariants, compoundVariants, deprecated } = config;
|
|
690
690
|
const jsCode = match4(config).when(
|
|
691
691
|
Recipes.isSlotRecipeConfig,
|
|
692
692
|
(config2) => outdent11`
|
|
@@ -782,7 +782,7 @@ function generateRecipes(ctx, filters) {
|
|
|
782
782
|
getVariantProps: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
${description
|
|
785
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
786
786
|
export declare const ${baseName}: ${upperName}Recipe
|
|
787
787
|
`
|
|
788
788
|
};
|
|
@@ -927,13 +927,13 @@ function generatePreactJsxFactory(ctx) {
|
|
|
927
927
|
function recipeClass() {
|
|
928
928
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
929
929
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
930
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
930
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
|
|
931
931
|
}
|
|
932
932
|
|
|
933
933
|
function cvaClass() {
|
|
934
934
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
935
935
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
936
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
|
|
936
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
|
|
937
937
|
}
|
|
938
938
|
|
|
939
939
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -986,7 +986,7 @@ function generatePreactJsxPattern(ctx, filters) {
|
|
|
986
986
|
const details = ctx.patterns.filterDetails(filters);
|
|
987
987
|
return details.map((pattern) => {
|
|
988
988
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
989
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
989
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
990
990
|
return {
|
|
991
991
|
name: dashName,
|
|
992
992
|
js: outdent15`
|
|
@@ -1040,7 +1040,7 @@ function generatePreactJsxPattern(ctx, filters) {
|
|
|
1040
1040
|
|
|
1041
1041
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1042
1042
|
|
|
1043
|
-
${description
|
|
1043
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
1044
1044
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
1045
1045
|
`
|
|
1046
1046
|
};
|
|
@@ -1255,13 +1255,13 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1255
1255
|
function recipeClass() {
|
|
1256
1256
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1257
1257
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
1258
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1258
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
1261
|
function cvaClass() {
|
|
1262
1262
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1263
1263
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1264
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, className)
|
|
1264
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
|
|
1265
1265
|
}
|
|
1266
1266
|
|
|
1267
1267
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1314,7 +1314,7 @@ function generateQwikJsxPattern(ctx, filters) {
|
|
|
1314
1314
|
const details = ctx.patterns.filterDetails(filters);
|
|
1315
1315
|
return details.map((pattern) => {
|
|
1316
1316
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1317
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
1317
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
1318
1318
|
return {
|
|
1319
1319
|
name: dashName,
|
|
1320
1320
|
js: outdent20`
|
|
@@ -1367,7 +1367,7 @@ function generateQwikJsxPattern(ctx, filters) {
|
|
|
1367
1367
|
|
|
1368
1368
|
export interface ${upperName}Props extends Assign<${typeName}<'${jsxElement}'>, DistributiveOmit<${upperName}Properties, ${blocklistType || '""'}>> {}
|
|
1369
1369
|
|
|
1370
|
-
${description
|
|
1370
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
1371
1371
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
1372
1372
|
`
|
|
1373
1373
|
};
|
|
@@ -1588,13 +1588,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1588
1588
|
function recipeClass() {
|
|
1589
1589
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1590
1590
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
1591
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.className)
|
|
1591
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
|
|
1592
1592
|
}
|
|
1593
1593
|
|
|
1594
1594
|
function cvaClass() {
|
|
1595
1595
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1596
1596
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1597
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
|
|
1597
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
1600
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1648,7 +1648,7 @@ function generateReactJsxPattern(ctx, filters) {
|
|
|
1648
1648
|
const details = ctx.patterns.filterDetails(filters);
|
|
1649
1649
|
return details.map((pattern) => {
|
|
1650
1650
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1651
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
1651
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
1652
1652
|
return {
|
|
1653
1653
|
name: dashName,
|
|
1654
1654
|
js: outdent25`
|
|
@@ -1701,7 +1701,7 @@ function generateReactJsxPattern(ctx, filters) {
|
|
|
1701
1701
|
|
|
1702
1702
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
1703
1703
|
|
|
1704
|
-
${description
|
|
1704
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
1705
1705
|
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
1706
1706
|
`
|
|
1707
1707
|
};
|
|
@@ -1951,7 +1951,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1951
1951
|
__cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
1952
1952
|
return cx(
|
|
1953
1953
|
__cvaFn__(variantProps, false),
|
|
1954
|
-
css(compoundVariantStyles, propStyles, cssStyles),
|
|
1954
|
+
css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
|
|
1955
1955
|
localProps.class,
|
|
1956
1956
|
localProps.className
|
|
1957
1957
|
)
|
|
@@ -1961,7 +1961,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1961
1961
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1962
1962
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1963
1963
|
return cx(
|
|
1964
|
-
css(cvaStyles, propStyles, cssStyles),
|
|
1964
|
+
css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
|
|
1965
1965
|
localProps.class,
|
|
1966
1966
|
localProps.className
|
|
1967
1967
|
)
|
|
@@ -2025,7 +2025,7 @@ function generateSolidJsxPattern(ctx, filters) {
|
|
|
2025
2025
|
const details = ctx.patterns.filterDetails(filters);
|
|
2026
2026
|
return details.map((pattern) => {
|
|
2027
2027
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
2028
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
2028
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
2029
2029
|
return {
|
|
2030
2030
|
name: dashName,
|
|
2031
2031
|
js: outdent30`
|
|
@@ -2080,7 +2080,7 @@ function generateSolidJsxPattern(ctx, filters) {
|
|
|
2080
2080
|
|
|
2081
2081
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2082
2082
|
|
|
2083
|
-
${description
|
|
2083
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
2084
2084
|
export declare const ${jsxName}: Component<${upperName}Props>
|
|
2085
2085
|
`
|
|
2086
2086
|
};
|
|
@@ -2305,14 +2305,14 @@ function generateVueJsxFactory(ctx) {
|
|
|
2305
2305
|
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2306
2306
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2307
2307
|
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
|
2308
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2308
|
+
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
|
|
2309
2309
|
})
|
|
2310
2310
|
|
|
2311
2311
|
const cvaClass = computed(() => {
|
|
2312
2312
|
const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
|
|
2313
2313
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
2314
2314
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
2315
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
|
|
2315
|
+
return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
|
|
2316
2316
|
})
|
|
2317
2317
|
|
|
2318
2318
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -2480,7 +2480,7 @@ function generateVueJsxPattern(ctx, filters) {
|
|
|
2480
2480
|
const details = ctx.patterns.filterDetails(filters);
|
|
2481
2481
|
return details.map((pattern) => {
|
|
2482
2482
|
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
2483
|
-
const { description, jsxElement = "div" } = pattern.config;
|
|
2483
|
+
const { description, jsxElement = "div", deprecated } = pattern.config;
|
|
2484
2484
|
return {
|
|
2485
2485
|
name: dashName,
|
|
2486
2486
|
js: outdent36`
|
|
@@ -2541,7 +2541,7 @@ function generateVueJsxPattern(ctx, filters) {
|
|
|
2541
2541
|
|
|
2542
2542
|
export interface ${upperName}Props extends ${upperName}Properties, DistributiveOmit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}> {}
|
|
2543
2543
|
|
|
2544
|
-
${description
|
|
2544
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
2545
2545
|
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
2546
2546
|
`
|
|
2547
2547
|
};
|
|
@@ -3481,12 +3481,12 @@ var parts_d_ts_default = {
|
|
|
3481
3481
|
|
|
3482
3482
|
// src/artifacts/generated/pattern.d.ts.json
|
|
3483
3483
|
var pattern_d_ts_default = {
|
|
3484
|
-
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n isCssUnit: (value: any) => boolean\n isCssVar: (value: any) => boolean\n isCssFunction: (value: any) => boolean\n}\n\nexport interface PatternProperties {\n [key: string]: PatternProperty\n}\n\ntype InferProps<T> = Record<LiteralUnion<keyof T>, any>\n\nexport type PatternDefaultValue<T> = Partial<InferProps<T>>\n\nexport type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The default values of the pattern.\n */\n defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsxName?: string\n /**\n * The jsx elements to track for this pattern. Can be string or Regexp.\n *\n * @default capitalize(pattern.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
3484
|
+
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n isCssUnit: (value: any) => boolean\n isCssVar: (value: any) => boolean\n isCssFunction: (value: any) => boolean\n}\n\nexport interface PatternProperties {\n [key: string]: PatternProperty\n}\n\ntype InferProps<T> = Record<LiteralUnion<keyof T>, any>\n\nexport type PatternDefaultValue<T> = Partial<InferProps<T>>\n\nexport type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The default values of the pattern.\n */\n defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * Whether the pattern is deprecated.\n */\n deprecated?: boolean | string\n /**\n * The jsx element name this pattern will generate.\n */\n jsxName?: string\n /**\n * The jsx elements to track for this pattern. Can be string or Regexp.\n *\n * @default capitalize(pattern.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
3485
3485
|
};
|
|
3486
3486
|
|
|
3487
3487
|
// src/artifacts/generated/recipe.d.ts.json
|
|
3488
3488
|
var recipe_d_ts_default = {
|
|
3489
|
-
content: "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\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]> | undefined\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\n/**\n * Extract the variant as optional props from a `cva` function.\n * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.\n */\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>\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 getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord = 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 class 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 * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\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>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> {\n /**\n * An optional class name that can be used to target slots in the DOM.\n */\n className?: string\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"
|
|
3489
|
+
content: "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\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]> | undefined\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\n/**\n * Extract the variant as optional props from a `cva` function.\n * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.\n */\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>\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 getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string\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 class 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 * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\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>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> {\n /**\n * An optional class name that can be used to target slots in the DOM.\n */\n className?: string\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string\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"
|
|
3490
3490
|
};
|
|
3491
3491
|
|
|
3492
3492
|
// src/artifacts/generated/selectors.d.ts.json
|
|
@@ -3501,7 +3501,7 @@ var static_css_d_ts_default = {
|
|
|
3501
3501
|
|
|
3502
3502
|
// src/artifacts/generated/system-types.d.ts.json
|
|
3503
3503
|
var system_types_d_ts_default = {
|
|
3504
|
-
content: "import type { ConditionalValue, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject\n}\ntype StyleProps = SystemStyleObject & WithCss\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
3504
|
+
content: "import type { ConditionalValue, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[]\n}\ntype StyleProps = SystemStyleObject & WithCss\n\nexport type JsxStyleProps = StyleProps & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
3505
3505
|
};
|
|
3506
3506
|
|
|
3507
3507
|
// src/artifacts/types/generated.ts
|
|
@@ -3582,7 +3582,7 @@ function generatePropTypes(ctx) {
|
|
|
3582
3582
|
const { utility } = ctx;
|
|
3583
3583
|
const result = [
|
|
3584
3584
|
outdent40`
|
|
3585
|
-
${ctx.file.importType("
|
|
3585
|
+
${ctx.file.importType("ConditionalValue", "./conditions")}
|
|
3586
3586
|
${ctx.file.importType("CssProperties", "./system-types")}
|
|
3587
3587
|
${ctx.file.importType("Tokens", "../tokens/index")}
|
|
3588
3588
|
|
|
@@ -3683,7 +3683,10 @@ function generateStyleProps(ctx) {
|
|
|
3683
3683
|
if (!filtered.length) {
|
|
3684
3684
|
filtered.push("string | number");
|
|
3685
3685
|
}
|
|
3686
|
-
|
|
3686
|
+
let comment = csstype_d_ts_default.comments?.[prop] || "";
|
|
3687
|
+
if (ctx.utility.isDeprecated(prop)) {
|
|
3688
|
+
comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
|
|
3689
|
+
}
|
|
3687
3690
|
const value = filtered.filter(Boolean).join(" | ");
|
|
3688
3691
|
const line = `${key}?: ${restrict(prop, value, ctx.config)}`;
|
|
3689
3692
|
return " " + [comment, line].filter(Boolean).join("\n");
|
|
@@ -4544,7 +4547,7 @@ function generateResetCss(ctx, sheet) {
|
|
|
4544
4547
|
selector = `&${scope}`;
|
|
4545
4548
|
}
|
|
4546
4549
|
const scoped = {
|
|
4547
|
-
"*, ::before, ::after, ::backdrop, ::
|
|
4550
|
+
"*, ::before, ::after, ::backdrop, ::file-selector-button": {
|
|
4548
4551
|
margin: "0px",
|
|
4549
4552
|
padding: "0px",
|
|
4550
4553
|
boxSizing: "border-box",
|
|
@@ -4599,10 +4602,6 @@ function generateResetCss(ctx, sheet) {
|
|
|
4599
4602
|
"--placeholder-fallback": "color-mix(in srgb, currentColor 50%, transparent)",
|
|
4600
4603
|
color: "var(--global-color-placeholder, var(--placeholder-fallback))"
|
|
4601
4604
|
},
|
|
4602
|
-
"select, textarea, input:where(:not([type='button'], [type='reset'], [type='submit']))": {
|
|
4603
|
-
borderWidth: "1px",
|
|
4604
|
-
borderStyle: "solid"
|
|
4605
|
-
},
|
|
4606
4605
|
textarea: {
|
|
4607
4606
|
resize: "vertical"
|
|
4608
4607
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"pluralize": "8.0.0",
|
|
38
38
|
"postcss": "8.4.35",
|
|
39
39
|
"ts-pattern": "5.0.8",
|
|
40
|
-
"@pandacss/core": "0.
|
|
41
|
-
"@pandacss/is-valid-prop": "^0.
|
|
42
|
-
"@pandacss/logger": "0.
|
|
43
|
-
"@pandacss/shared": "0.
|
|
44
|
-
"@pandacss/token-dictionary": "0.
|
|
45
|
-
"@pandacss/types": "0.
|
|
40
|
+
"@pandacss/core": "0.38.0",
|
|
41
|
+
"@pandacss/is-valid-prop": "^0.38.0",
|
|
42
|
+
"@pandacss/logger": "0.38.0",
|
|
43
|
+
"@pandacss/shared": "0.38.0",
|
|
44
|
+
"@pandacss/token-dictionary": "0.38.0",
|
|
45
|
+
"@pandacss/types": "0.38.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/pluralize": "0.0.33"
|