import { AllHTMLAttributes, ElementType } from 'react'; import { StyleObject as StyletronStyleObject } from 'styletron-react'; import { StandardEngine as StyletronStandardEngine } from 'styletron-standard'; import { Direction, Theme, ThemeClassNames } from '@sprinklrjs/spaceweb-themes/types'; export declare type StyleObject = StyletronStyleObject; export declare type StandardEngine = StyletronStandardEngine; /** * Theme-callback function (used to specify styles dynamically) * * TODO: Replace `any` for `unknown`, the change will cause several * components to fail. */ export declare type StyleFn

= (utils: StyleUtils, props: P) => StyleObject | string | undefined; declare type RecursiveArray = Array>; /** * CSS in JS object */ export declare type StyleAtom = string | StyleObject | undefined | StyleFn; /** * Spaceweb's style's argument type */ export declare type Styles = StyleAtom | RecursiveArray; /** * Returns StyleObject from styling arguments (StyleArgument) */ export declare type GetStyle = (...args: Styles[]) => StyleObject; /** * Space context */ export interface ThemeContext { classes: ThemeClassNames; direction?: Direction; theme: Theme; } export interface Sheet { css: string; attrs: { [key: string]: string; }; } export declare type StyletronContext = { container: HTMLStyleElement[]; styletron: StandardEngine; } | undefined; /** * Stores browser's available features */ export declare type BrowserFeaturesContext = { done: boolean; gridLayout: boolean; msGridLayout: boolean; }; /** * Variant Options */ export declare type Variant = 'primary' | 'secondary' | 'tertiary' | 'minimal'; /** * Size Options */ export declare type Size = 'xxxxs' | 'xxxs' | 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Intent Options */ export declare type Intent = 'default' | 'success' | 'warning' | 'error' | 'ai'; /** * Gets Styletron's generated class names from `StyleArg`s */ export declare type CSSFunc = (...args: Styles[]) => string; /** * Translates length from pixels to rems units (based on theme `htmlFontSize`) */ export declare type Px2Rem = (px: number | string) => string; /** * `useStyle` return type */ export declare type StyleUtils = ThemeContext & { isRTL?: boolean; css: CSSFunc; getStyle: GetStyle; px2rem: Px2Rem; }; /** * ClassName type for Spaceweb's components * See: https://frontend.sprinklr.com/spaceweb/guides/styling#styled */ export declare type ClassName = Styles; /** * Spaceweb Components' default interface * * Equivalent to AllHTMLAttributes with a replacement of default className and style attributes with our own. */ export declare type SpacewebComponentProps> = Omit & { $as?: ElementType; className?: ClassName; style?: Styles; }; export {};