import { CSSProperties, ComplexStyleRule } from '@vanilla-extract/css'; import { recipe } from '@vanilla-extract/recipes'; /* Types from Vanilla-extract */ // We duplicate type from Vanilla-extract because it doesn't expose // some needed types for proper extension. export type NullableTokens = { [key: string]: string | NullableTokens | null; }; export type RecipeStyleRule = ComplexStyleRule | string; export type VariantDefinitions = Record; export type VariantGroups = Record; export type ExtractCompoundVariant = Recipe extends (options: { compoundVariants?: Array; }) => any ? CompoundVariant : never; export type CompoundVariant = ExtractCompoundVariant>; export type CSSPropertiesWithVars = CSSProperties & { vars?: { [key: string]: string; }; }; /* Design system types */ export type TokensContract = { [key in keyof TContract]: string; }; export type BaseToken = | 'colors' | 'borderWidths' | 'radii' | 'sizes' | 'space' | 'fontSizes' | 'fontWeights' | 'fonts' | 'letterSpacings' | 'lineHeights' | 'zIndices'; export type ComponentTokens = { [x in BaseToken]?: TTokens; };