A UI interfaces collection to align the components development process across all platforms. React components build using these interfaces supposedly should work on Web, Mobile (iOS and Android) and Desktop.
Run the following command in the plugin directoy:
npm i --save @blueeast/bluerain-ui-interfaces
Following component interfaces have been defined and exposed through this repo.
import { TextInputProperties } from '@blueeast/bluerain-ui-interfaces';
export interface MUITextInputProperties extends TextInputProperties {
autoComplete?: string,
autoCorrect?: string,
id?: string,
label?: string,
className?: any,
margin?: 'none' |
'dense' |
'normal',
required?: boolean,
error?: boolean,
type?: string,
rowsMax?: string,
rows?: string,
helperText?: ReactNode,
InputLabelProps?: object,
fullWidth?: boolean,
errorText?: ReactNode,
}
const BlueRainTextInput: React.StatelessComponent<MUITextInputProperties> = (rawProps) => {
const { onChangeText , ...props } = rawProps;
let disabled = false;
if(props.editable !== undefined && !props.editable) {
disabled = true;
}
return (
<TextField
onChange={(props.onChange || onChangeText) ? customOnChange(rawProps) : () => {return null;}}
rows={props.numberOfLines}
helperText={props.errorText}
{...props}
/>
);
};
export default BlueRainTextInput;
Notice how props from interface have been mapped to material-ui textinput props. For exmaple rows has been mapped numberOfLines.
ResponsiveLayout component to create responsive layouts.
Generated using TypeDoc
The state of current window or screen. Stored in
bluerain.windowin the redux store.{number} width The window width
{number} height The window height
{WindowSize} size The window size i.e. (xs|sm|md|lg|xl)