UNPKG

@noema/motif

Version:

A type-safe styling library for React components built on top of [Vanilla Extract](https://vanilla-extract.style/). `@noema/motif` allows you to create styled components with consistent theme-aware props that cleanly separate styling from component logic.

8 lines (7 loc) 544 B
import { ComponentType } from 'react'; import { CSSProps, MotifStyle } from './motif-style.js'; import { Elements, motif, SprinklesFn } from './motif.js'; export declare function createMotif<E extends readonly Elements[], S extends SprinklesFn, P extends CSSProps, SH extends string = string>(elements: E, sprinkles: S, config: MotifStyle<P, SH>): { [K in E[number]]: ReturnType<typeof motif<K, S, P, SH>>; }; export type MotifComponents<Components> = { [E in keyof Components]: Components[E] extends ComponentType<infer P> ? P : never; };