@jswork/styled-box
Version:
Styled box for react.
79 lines (78 loc) • 2.26 kB
TypeScript
import PropTypes from 'prop-types';
import { Component } from 'react';
import { Props } from '@jswork/styled-types';
export default class StyledBox extends Component<Props> {
static displayName: string;
static version: string;
static propTypes: {
/**
* The extended className for component.
*/
className: PropTypes.Requireable<string>;
/**
* The main className for component.
*/
mainClassName: PropTypes.Requireable<string>;
/**
* Styled engine(eg: styled-component).
*/
styled: PropTypes.Validator<any>;
/**
* The distance unit.
*/
unit: PropTypes.Requireable<string>;
/**
* If remove the default unit.
*/
unitless: PropTypes.Requireable<boolean>;
/**
* Deault node name.
*/
as: PropTypes.Requireable<any>;
/**
* Default props for the `as` component.
*/
asProps: PropTypes.Requireable<any>;
/**
* The rem value transformer.
*/
val: PropTypes.Requireable<(...args: any[]) => any>;
/**
* External plugin list.
*/
plugins: PropTypes.Requireable<any[]>;
/**
* Plugin value.
*/
plugin: PropTypes.Requireable<string | object>;
/**
* Plugin options.
*/
options: PropTypes.Requireable<any>;
/**
* The dependencies of the component.
*/
deps: PropTypes.Requireable<any>;
/**
* The dynamic render for styled box.
*/
staticStyled: PropTypes.Requireable<boolean>;
};
static defaultProps: {
sub: string;
unit: string;
unitless: boolean;
as: string;
val: any;
plugins: never[];
staticStyled: boolean;
mainClassName: string;
};
private Styled;
private theProps;
shouldComponentUpdate(inProps: any): boolean;
updateProps: (inProps: any) => void;
updateStyled: (inProps: any) => void;
componentDidMount(): void;
render(): JSX.Element | null;
}