Options
All
  • Public
  • Public/Protected
  • All
Menu

BlueRain UI Interfaces

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.

🎊 Status

Greenkeeper badge

Usage

Run the following command in the plugin directoy:

npm i --save @blueeast/bluerain-ui-interfaces

List of Interfaces

Following component interfaces have been defined and exposed through this repo.

Example Implementation of Interface

  • First export interface from bluerain-ui-interfaces repo.
import { TextInputProperties } from '@blueeast/bluerain-ui-interfaces';
  • Then extend/implement interface for component you intend to develop

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,
}
  • Then use above extended interface for component development
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.

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

WindowState

WindowState: object

The state of current window or screen. Stored in bluerain.window in the redux store.

property

{number} width The window width

property

{number} height The window height

property

{WindowSize} size The window size i.e. (xs|sm|md|lg|xl)

Type declaration

  • Optional height?: undefined | number
  • Optional size?: WindowSize
  • Optional width?: undefined | number

Variables

Const SET_WINDOW_INFO

SET_WINDOW_INFO: "@@BLUERAIN/SET_WINDOW_INFO" = "@@BLUERAIN/SET_WINDOW_INFO"

Const WindowInfo

WindowInfo: any = connect(mapStateToPropsWindowInfo, mapDispatchToPropsWindowInfo)(Render)

Const WindowSize

WindowSize: "xs" | "sm" | "md" | "lg" | "xl" = connect(mapStateToPropsWindowSize)(Render)

Functions

Const Column

Const Container

  • Container(props: IProps): Element

Const Render

  • Render(__namedParameters: object): any

ResponsiveLayout

  • ResponsiveLayout(props: IAllProps): Element
  • ResponsiveLayout component to create responsive layouts.

    prop

    {string} windowSize The window size i.e. (xs|sm|md|lg|xl)

    prop

    {React.Component} default The default component to render, if a current size component is not given.

    prop

    {React.Component} xs The component to render when the screen size is extra-small.

    prop

    {React.Component} sm The component to render when the screen size is small.

    prop

    {React.Component} md The component to render when the screen size is medium.

    prop

    {React.Component} lg The component to render when the screen size is large.

    prop

    {React.Component} xl The component to render when the screen size is extra-large.

    Parameters

    Returns Element

Const Row

Const cloneElements

  • cloneElements(props: any): ReactElement<any>[]

Const getComponentOffset

  • getComponentOffset(screenSize: any, props: any): string | 0

Const getComponentWidth

  • getComponentWidth(screenSize: any, props: any): any

getWindowSize

  • getWindowSize(width?: number): "xs" | "sm" | "md" | "lg" | "xl"

initialState

Const isHidden

  • isHidden(screenSize: any, props: any): boolean

Const mapDispatchToPropsWindowInfo

  • mapDispatchToPropsWindowInfo(dispatch: any, ownProps: any): object
  • Parameters

    • dispatch: any
    • ownProps: any

    Returns object

    • setWindowDimentions: function
      • setWindowDimentions(w: any, h: any): any

Const mapStateToPropsWindowInfo

  • mapStateToPropsWindowInfo(state: any): object

Const mapStateToPropsWindowSize

  • mapStateToPropsWindowSize(state: any): object

setWindowDimentions

  • setWindowDimentions(width: number, height: number): object
  • Parameters

    • width: number
    • height: number

    Returns object

    • height: number
    • type: string
    • width: number

Const toPercent

  • toPercent(num: any): string

Const withWindowInfo

  • withWindowInfo(Component: any): any

Const withWindowSize

  • withWindowSize(Component: any): any

Object literals

Const defaultProps

defaultProps: object

gutter

gutter: number = 30

size

size: number = 12

Const defaultViewStyles

defaultViewStyles: object

overflow

overflow: string = "visible"

Const gridLimits

gridLimits: object

lg

lg: number = 1200

md

md: number = 992

sm

sm: number = 768

xs

xs: number = 576

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc