/*! * Original code by SEEK * MIT Licensed, Copyright (c) 2021 SEEK. * * Credits to the SEEK team: * https://github.com/seek-oss/vanilla-extract/blob/master/packages/recipes/src/createRuntimeFn.ts */ import { Accessor } from "solid-js"; import { BooleanMap, SystemStyleObject, Theme, ThemeVarsAndBreakpoints } from "./types"; declare type HopeVariantDefinitions = Record; export declare type HopeVariantGroups = Record; export declare type HopeVariantSelection = { [VariantGroup in keyof Variants]?: BooleanMap; }; interface HopeCompoundVariant { /** The combined variants that should apply the style. */ variants: HopeVariantSelection; /** The style to be applied. */ style: SystemStyleObject; } export interface HopeStyleOptions { /** The base style. */ baseStyle?: SystemStyleObject; /** * The variants style. * Each variant will become a `prop` of the component. */ variants?: Variants; /** The combined variants style. */ compoundVariants?: Array>; /** The default value for each variant. */ defaultVariants?: HopeVariantSelection; } export declare type HopeStyleOptionsInterpolation = HopeStyleOptions | ((theme: ThemeVarsAndBreakpoints) => HopeStyleOptions); export declare type HopeStyleResult = { baseClassName: string; variantClassNames: { [K in keyof Variants]: { [V in keyof Variants[K]]: string; }; }; compoundVariants: Array<[HopeVariantSelection, string]>; }; declare type UseStylesFn = (variantProps?: HopeVariantSelection) => Accessor; /** Extract the variant props type of `useStyles` primitive. */ export declare type HopeVariantProps> = Parameters[0]; /** Compute classNames from a hope style options. */ export declare function computeStyleOptions(options: HopeStyleOptions, theme: Theme): HopeStyleResult; /** Get the variants classNames of selected variants. */ export declare function getSelectedVariantClassNames(styleResult: HopeStyleResult, selectedVariants: HopeVariantSelection): Array; /** Create a `useStyles` primitive. */ export declare function createStyles(interpolation: HopeStyleOptionsInterpolation): UseStylesFn; export {};