1.1.24 • Published 5 years ago

furmly-base-web v1.1.24

Weekly downloads
3
License
ISC
Repository
-
Last release
5 years ago

Furmly Web Base

Simple implementation of furmly components using react & styled-components.

@Demo

This is a simple themeable library that implements the visual components required by Furmly-client .

Installation

npm install furmly-base-web

Don't forget to include font files at "furmly-base-web/dist/Lato-Light.ttf" & "furmly-base-web/dist/Roboto-Thin.ttf

Usage

import configure from "furmly-base-web";
import RotateTextComponent from "./Rotate";

/*
    map is basically a key value pairing of component ELEMENTTYPE to react component.

    defaultMap is the raw key value map to furmly client components.
    
*/
const componentMap = configure({
  extend: (map, defaultMap) => {
    map.CUSTOM_COMPONENT = props => {
      return <div>{"This is a custom component"}</div>; // This is how to define a custom component. They are matched by uid.
    };
    return map.cook(); // make sure you return a cooked map.
  },
  providerConfig: [], //
  interceptor: (context, map, defaultMap) => {
    /*
    This function is an interceptor. Furmly-client will call this interceptor everytime it requires a component definition.
    */
    if (context.elementType == "INPUT" && context.uid == "rotate_text")
      return RotateTextComponent;
  }
});

Provider

Provider is the main entry point into rendering UI.Once a componentMap has been cooked you can directly access the provider const { PROVIDER } = componentMap

import React from "react"

//...construct componentMap earlier

const { PROVIDER } = componentMap;
export default (props)=> {
    return <PROVIDER id={props.process_id}>;
}

Themes

Styled components theme provider is used to provide themeing to base components.

import { ThemeProvider } from "furmly-base-web";
const theme = {
  foreColor: "red",
  labelBackgroundColor: "black",
  labelColor: "white"
};

export default props => {
  return <ThemeProvider theme={theme}>{components}</ThemeProvider>;
};

To do

  • Create better documentation in demo web site
  • Create better documentation for themes.
  • Implement more components
1.1.24

5 years ago

1.1.23

5 years ago

1.1.22

5 years ago

1.1.21

5 years ago

1.1.20

5 years ago

1.1.19

5 years ago

1.1.18

5 years ago

1.1.17

5 years ago

1.1.16

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago