import type { ReactNode, CSSProperties } from 'react'; import type { CssType, CssFunction } from '../types.js'; import { createSetupError } from '../utils/error.js'; export type ObjectInterpolation = CssType | CssType[]; export type TemplateStringsInterpolation = CssFunction | CssFunction[]; interface CssSignature { (...interpolations: ObjectInterpolation[]): string; ( template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation[] ): string; } export interface ClassNamesProps { children: (opts: { css: CssSignature; style: CSSProperties }) => ReactNode; } /** * ## Class Names * * Use a component where styles are not necessarily used on a JSX element. * For further details [read the documentation](https://compiledcssinjs.com/docs/api-class-names). * * ### Style with objects * * @example * ``` * * {({ css, style }) => children({ className: css({ fontSize: 12 }) })} * * ``` * * ### Style with template literals * * @example * ``` * * {({ css, style }) => children({ className: css`font-size: 12px;` })} * * ``` * * ### Compose styles with arrays * * @example * ``` * * {({ css, style }) => * children({ className: css([{ fontSize: 12 }, css`font-size: 12px`]) })} * * ``` */ export function ClassNames({ children }: ClassNamesProps): JSX.Element; export function ClassNames(_props: ClassNamesProps): JSX.Element { throw createSetupError(); }