@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
47 lines (46 loc) • 2.18 kB
TypeScript
import { AnyNumber, AnyString, Dict } from "../utils/types.js";
import "../utils/index.js";
import { ThemingProps, VuiTheme } from "../theme/types.js";
import { extendTheme } from "../theme/extendTheme.js";
import "../theme/index.js";
import { IProps, ThemeGetter } from "@xstyled/styled-components";
//#region src/core/theme.d.ts
type VuiThemeGetter<ThemeKey extends keyof VuiTheme> = ThemeGetter<keyof VuiTheme[ThemeKey] | AnyString | AnyNumber>;
/** Type of the 'th' theme getter function. */
type ThemeGet = {
(path: string, defaultValue?: any): (props: IProps) => any;
animation: VuiThemeGetter<'animations'>;
borders: VuiThemeGetter<'borders'>;
color: VuiThemeGetter<'colors'>;
duration: VuiThemeGetter<'durations'>;
font: VuiThemeGetter<'fonts'>;
fontSize: VuiThemeGetter<'fontSizes'>;
fontWeight: VuiThemeGetter<'fontWeights'>;
radius: VuiThemeGetter<'radii'>;
ringWidth: VuiThemeGetter<'ringWidths'>;
screen: VuiThemeGetter<'screens'>;
/** @deprecated Use box-shadow instead */
shadow: VuiThemeGetter<'shadows'>;
size: VuiThemeGetter<'sizes'>;
space: VuiThemeGetter<'spaces'>;
transform: VuiThemeGetter<'transforms'>;
transition: VuiThemeGetter<'transitions'>;
zIndex: VuiThemeGetter<'zIndices'>;
};
/** Removes specific theming keys from the given props. */
declare function omitThemingProps<T extends ThemingProps>(props: T): Omit<T, "size" | "variant">;
/** Re-export of xstyled 'th' with custom typing and screen getter. */
declare const th$1: ThemeGet;
/**
* Combines baseStyle, size and variant styling from a component's theme configuration.
* @param component - name of any component configured in the theme
* @param props - props object of the given component
*/
declare function useStyleConfig(component: keyof VuiTheme['components'], props?: any): Dict;
/** Returns theme value at the given path. */
declare function useTh(path: keyof VuiTheme | AnyString, defaultValue?: any): any;
/** Returns the theme object with extensions. */
declare function useTheme(): VuiTheme;
//#endregion
export { ThemeGet, extendTheme, omitThemingProps, th$1 as th, useStyleConfig, useTh, useTheme };
//# sourceMappingURL=theme.d.ts.map