UNPKG

@wix/design-system

Version:

@wix/design-system

21 lines 1.08 kB
export declare const NAMESPACE = "wds"; type ClassValue = string | false | null | undefined; type VariantMap = Record<string, readonly string[]>; type NodeConfig = { variants?: VariantMap; states?: readonly string[]; }; type Config = Record<string, NodeConfig>; type NodeProps<Node extends NodeConfig> = { [V in keyof NonNullable<Node['variants']>]?: NonNullable<Node['variants']>[V][number] | false | null; } & { [S in NonNullable<Node['states']>[number] & string]?: boolean | null; }; type ClassNameFn<Node extends NodeConfig> = (props?: NodeProps<Node>, ...classes: ClassValue[]) => string; type ClassNames<C extends Config> = { [K in keyof C | 'root']: ClassNameFn<K extends keyof C ? C[K] : NodeConfig>; }; export declare const createClassNames: <const C extends Config = Record<never, never>>(blockName: string, config?: C, versionedNs?: string) => ClassNames<C>; export declare const defineClassNames: <const C extends Config = Record<never, never>>(blockName: string, config?: C) => ClassNames<C>; export {}; //# sourceMappingURL=defineClassNames.d.ts.map