apphouse
Version:
Component library for React that uses observable state management and theme-able components.
55 lines (54 loc) • 2.02 kB
TypeScript
import { Style } from '../Style';
import { Token } from '../Token';
import { ThemeStyles } from '../../styles/defaults/themes.interface';
/**
* Helper function to determine if a property key is a selector
* @param styleKey
* @returns
*/
export declare const isSelector: (property: string) => boolean;
/**
* Force first letter uppercase on a word
* @param string string
* @returns
*/
export declare const makeFirstLetterUppercase: (string: string) => string;
export declare const createStylesFromObject: (objectStyles: any) => Record<string, Style>;
export declare const getStyleValue: () => void;
export declare const toStylesObject: ({ value, withColorsFromPaletteId, lookup }: {
value: Record<string, Style>;
withColorsFromPaletteId?: string | undefined;
lookup: {
[id: string]: string;
};
}) => object;
export declare const toApphouseStyles: ({ value, withColorsFromPaletteId, lookup }: {
value: Record<string, Style>;
withColorsFromPaletteId?: string | undefined;
lookup: {
[id: string]: string;
};
}) => ThemeStyles;
export declare const objectifyStylesWithBaseColors: ({ value }: {
value: Record<string, Style>;
theme?: "dark" | "light" | undefined;
colors: {
[colorId: string]: string;
};
tokens: Record<string, Token>;
}) => object;
export declare const camelcaseifyCssProperty: (property: string) => string;
/**
* Attempt to get a preview tag based on an item from the base component list
* @param baseComponent string from baseComponent list
* @returns an html tag (it will default to div if no match is found)
*/
export declare const getPreviewWithTagFromBaseComponent: (baseComponent: string) => string;
/**
* Attempt to get a preview tag based on the property keys on a object
* @param cssObj object representing the styles
* @returns an html tag (it will default to div if no match is found)
*/
export declare const getPreviewWithTagBasedOnObjectProperties: (obj: {
[id: string]: any;
}, k?: string) => string;