/* eslint-disable */ import type { CssProperty, SystemStyleObject } from './system-types'; import type { TokenCategory } from '../tokens/index'; type Primitive = string | number | boolean | null | undefined type LiteralUnion = T | (K & Record) export type PatternProperty = | { type: 'property'; value: CssProperty; description?: string } | { type: 'enum'; value: string[]; description?: string } | { type: 'token'; value: TokenCategory; property?: CssProperty; description?: string } | { type: 'string' | 'boolean' | 'number'; description?: string } export interface PatternHelpers { map: (value: any, fn: (value: string) => string | undefined) => any isCssUnit: (value: any) => boolean isCssVar: (value: any) => boolean isCssFunction: (value: any) => boolean } export interface PatternProperties { [key: string]: PatternProperty } type InferProps = Record, any> export type PatternDefaultValue = Partial> export type PatternDefaultValueFn = (props: InferProps) => PatternDefaultValue export interface PatternConfig { /** * The description of the pattern. This will be used in the JSDoc comment. */ description?: string /** * The JSX element rendered by the pattern * @default 'div' */ jsxElement?: string /** * The properties of the pattern. */ properties?: T /** * The default values of the pattern. */ defaultValues?: PatternDefaultValue | PatternDefaultValueFn /** * The css object this pattern will generate. */ transform?: (props: InferProps, helpers: PatternHelpers) => SystemStyleObject /** * Whether the pattern is deprecated. */ deprecated?: boolean | string /** * The jsx element name this pattern will generate. */ jsxName?: string /** * The jsx elements to track for this pattern. Can be string or Regexp. * * @default capitalize(pattern.name) * @example ['Button', 'Link', /Button$/] */ jsx?: Array /** * Whether to only generate types for the specified properties. * This will disallow css properties */ strict?: boolean /** * @experimental * Disallow certain css properties for this pattern */ blocklist?: LiteralUnion[] }