diff --git a/packages/generator/src/artifacts/generated/recipe.d.ts.json b/packages/generator/src/artifacts/generated/recipe.d.ts.json index 77e130b8e..dbe0ea97c 100644 --- a/packages/generator/src/artifacts/generated/recipe.d.ts.json +++ b/packages/generator/src/artifacts/generated/recipe.d.ts.json @@ -1,3 +1,3 @@ { - "content": "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\n\ntype StringToBoolean = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record>\n\nexport type RecipeSelection = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean | undefined\n }\n\nexport type RecipeVariantFn = (props?: RecipeSelection) => 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 | SlotRecipeVariantFn>,\n> = Pretty[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn | SlotRecipeVariantFn>,\n> = Exclude>>, undefined>\n\ntype RecipeVariantMap = {\n [K in keyof T]: Array\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn extends RecipeVariantFn {\n __type: RecipeSelection\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap\n raw: (props?: RecipeSelection) => SystemStyleObject\n config: RecipeConfig\n splitVariantProps>(\n props: Props,\n ): [RecipeSelection, Pretty>]\n}\n\ntype OneOrMore = T | Array\n\nexport type RecipeCompoundSelection = {\n [K in keyof T]?: OneOrMore> | undefined\n}\n\nexport type RecipeCompoundVariant = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition {\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\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty>>[]\n /**\n * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\n}\n\nexport type RecipeCreatorFn = (config: RecipeDefinition) => RecipeRuntimeFn\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\n}\n\nexport interface RecipeConfig\n extends RecipeDefinition,\n RecipeConfigMeta {}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\ntype SlotRecord = Partial>\n\nexport type SlotRecipeVariantRecord = Record>>\n\nexport type SlotRecipeVariantFn = (\n props?: RecipeSelection,\n) => SlotRecord\n\nexport interface SlotRecipeRuntimeFn>\n extends SlotRecipeVariantFn {\n raw: (props?: RecipeSelection) => Record\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap\n splitVariantProps>(props: Props): [RecipeSelection, Pretty>]\n}\n\nexport type SlotRecipeCompoundVariant = T & {\n css: SlotRecord\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord = SlotRecipeVariantRecord,\n> {\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord\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\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty>>[]\n /**\n * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\n}\n\nexport type SlotRecipeCreatorFn = >(\n config: SlotRecipeDefinition,\n) => SlotRecipeRuntimeFn\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord = SlotRecipeVariantRecord,\n> = SlotRecipeDefinition & RecipeConfigMeta\n" + "content": "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\n\ntype StringToBoolean = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record>\n\nexport type RecipeSelection = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean | undefined\n }\n\nexport type RecipeVariantFn = (props?: RecipeSelection) => 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 | SlotRecipeVariantFn>,\n> = Pretty[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn | SlotRecipeVariantFn>,\n> = Exclude>>, undefined>\n\ntype RecipeVariantMap = {\n [K in keyof T]: Array\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\nexport interface RecipeRuntimeFn extends RecipeVariantFn {\n __type: RecipeSelection\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap\n raw: (props?: RecipeSelection) => SystemStyleObject\n config: RecipeConfig\n splitVariantProps>(\n props: Props,\n ): [RecipeSelection, Pretty>]\n}\n\ntype OneOrMore = T | Array\n\nexport type RecipeCompoundSelection = {\n [K in keyof T]?: OneOrMore> | undefined\n}\n\nexport type RecipeCompoundVariant = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition {\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\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty>>[]\n}\n\nexport type RecipeCreatorFn = (config: RecipeDefinition) => RecipeRuntimeFn\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\n /**\n * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[]\n}\n\nexport interface RecipeConfig\n extends RecipeDefinition,\n RecipeConfigMeta {}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\ntype SlotRecord = Partial>\n\nexport type SlotRecipeVariantRecord = Record>>\n\nexport type SlotRecipeVariantFn = (\n props?: RecipeSelection,\n) => SlotRecord\n\nexport interface SlotRecipeRuntimeFn>\n extends SlotRecipeVariantFn {\n raw: (props?: RecipeSelection) => Record\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap\n splitVariantProps>(props: Props): [RecipeSelection, Pretty>]\n}\n\nexport type SlotRecipeCompoundVariant = T & {\n css: SlotRecord\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord = SlotRecipeVariantRecord,\n> {\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord\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\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty>>[]\n}\n\nexport type SlotRecipeCreatorFn = >(\n config: SlotRecipeDefinition,\n) => SlotRecipeRuntimeFn\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord = SlotRecipeVariantRecord,\n> = SlotRecipeDefinition & RecipeConfigMeta\n" } \ No newline at end of file diff --git a/packages/studio/styled-system/types/recipe.d.ts b/packages/studio/styled-system/types/recipe.d.ts index 8e86f75e0..0303e9dcb 100644 --- a/packages/studio/styled-system/types/recipe.d.ts +++ b/packages/studio/styled-system/types/recipe.d.ts @@ -75,10 +75,6 @@ export interface RecipeDefinition>>[] - /** - * Variants to pre-generate, will be include in the final `config.staticCss` - */ - staticCss?: RecipeRule[] } export type RecipeCreatorFn = (config: RecipeDefinition) => RecipeRuntimeFn @@ -99,6 +95,10 @@ interface RecipeConfigMeta { * @example ['Button', 'Link', /Button$/] */ jsx?: Array + /** + * Variants to pre-generate, will be include in the final `config.staticCss` + */ + staticCss?: RecipeRule[] } export interface RecipeConfig @@ -153,10 +153,6 @@ export interface SlotRecipeDefinition< * The styles to apply when a combination of variants is selected. */ compoundVariants?: Pretty>>[] - /** - * Variants to pre-generate, will be include in the final `config.staticCss` - */ - staticCss?: RecipeRule[] } export type SlotRecipeCreatorFn = >( diff --git a/packages/types/src/recipe.ts b/packages/types/src/recipe.ts index fc769a431..bc91b9558 100644 --- a/packages/types/src/recipe.ts +++ b/packages/types/src/recipe.ts @@ -74,10 +74,6 @@ export interface RecipeDefinition>>[] - /** - * Variants to pre-generate, will be include in the final `config.staticCss` - */ - staticCss?: RecipeRule[] } export type RecipeCreatorFn = (config: RecipeDefinition) => RecipeRuntimeFn @@ -98,6 +94,10 @@ interface RecipeConfigMeta { * @example ['Button', 'Link', /Button$/] */ jsx?: Array + /** + * Variants to pre-generate, will be include in the final `config.staticCss` + */ + staticCss?: RecipeRule[] } export interface RecipeConfig @@ -152,10 +152,6 @@ export interface SlotRecipeDefinition< * The styles to apply when a combination of variants is selected. */ compoundVariants?: Pretty>>[] - /** - * Variants to pre-generate, will be include in the final `config.staticCss` - */ - staticCss?: RecipeRule[] } export type SlotRecipeCreatorFn = >(