UNPKG

@wix/design-system

Version:

@wix/design-system

31 lines 1.92 kB
export declare const NAMESPACE = "wds"; type ClassValue = string | false | null | undefined; type VariantMap = Record<string, readonly string[]>; type Config<Slots extends readonly string[], Variants extends VariantMap, States extends readonly string[]> = { slots?: Slots; variants?: Variants; states?: States; }; type Props<Variants extends VariantMap, States extends readonly string[]> = { [V in keyof Variants]?: Variants[V][number] | false | null; } & { [S in States[number]]?: boolean | null; }; export declare const createClassNames: <const Slots extends readonly string[] = [], const Variants extends VariantMap = Record<never, never>, const States extends readonly string[] = []>(blockName: string, config?: Config<Slots, Variants, States>, versionedNs?: string) => { readonly root: (props?: Props<Variants, States>, ...classes: ClassValue[]) => string; readonly element: (name: Slots[number], ...classes: ClassValue[]) => string; readonly slot: (name: Slots[number]) => string; readonly variant: <V extends keyof Variants>(name: V, value: Variants[V][number]) => string; readonly state: (name: States[number]) => string; readonly block: string; }; export declare const defineClassNames: <const Slots extends readonly string[] = [], const Variants extends VariantMap = Record<never, never>, const States extends readonly string[] = []>(blockName: string, config?: Config<Slots, Variants, States>) => { readonly root: (props?: Props<Variants, States>, ...classes: ClassValue[]) => string; readonly element: (name: Slots[number], ...classes: ClassValue[]) => string; readonly slot: (name: Slots[number]) => string; readonly variant: <V extends keyof Variants>(name: V, value: Variants[V][number]) => string; readonly state: (name: States[number]) => string; readonly block: string; }; export {}; //# sourceMappingURL=defineClassNames.d.ts.map