0.2.95 • Published 5 years ago

@expandorg/components v0.2.95

Weekly downloads
2
License
MPL-2.0
Repository
github
Last release
5 years ago

Expand UI

license

Expand UI & Modules is a collection of React components, tools and guidelines for creating expand products.

  • Modules npm version: Dynamic extensible JSON powered form library for React.
  • UI Components npm version: set of components such as Buttons, Panels, Menus, HOC's. General purpose components used to build expand.org web applications.
  • UI Kit npm version: Colors, and Typography used across expand.org apps

Documentation and live playground

Detailed documentation and forms playground is available in docz

https://expandorg.github.io/expand-components/

installation

Expand components library is a set of public npm packages: @expandorg/components, @expandorg/modules, @expandorg/uikit:

npm install  @expandorg/modules @expandorg/components @expandorg/uikit --save

Prerequisites

expand UI & Modules use stylus and css-modules by default to import stylesheets. It is necessary to import .styl files located in node_modules. We recommend using webpack, but other bundlers can be configured.

Here is webpack config example

// webpack.config.babel.js
export default (env = {}) => {
  const dev = !!env.dev;
  return {
    ...
    module: {
      rules: [
        {
          test: /^((?!\.module).)*\.styl$/,
          use: [
            'style-loader',
            'css-loader?sourceMap&importLoaders=2',
            'postcss-loader?sourceMap',
            'stylus-loader?paths[]=src',
          ],
          exclude: /node_modules\/(?!(@expandorg)\/).*/,
        },
        {
          test: /\.module\.styl$/,
          use: [
            'style-loader',
            `css-loader?sourceMap&importLoaders=2&modules&localIdentName=${dev ? '[local]__[path][name]__' : ''}[hash:base64:5]`,
            'postcss-loader?sourceMap',
            'stylus-loader?paths[]=src',
          ],
          exclude: /node_modules\/(?!(@expandorg)\/).*/,
        }
      ],
    },
  };
};

Basic Usage

import React from 'react'
import { Button } from '@expandorg/components';

const MyComponent = () => (
  <Button theme="secondary" onClick={() => console.log('click!')}>
    Hello World
  </Button>
);

Modules Form Usage

import React from 'react'
import { Form, formProps, FormDataProvider } from '@expandorg/modules';


const form = {   // define form modules
  modules: [{
    name: "input-1",
    type: "input",
    placeholder: "Input value"
  }]
}


class CustomForm extends Component {    // your form component

  handleSubmit = values => {
    console.log(values);
  };

  render() {
    return (
      <FormDataProvider formData={null}>
        <Form
          form={form}
          onSubmit={this.handleSubmit}
        >
          {moduleProps => <Module {...moduleProps} />}
        </Form>
      </FormDataProvider>
    );
  }
}

License

This project is licensed under the terms of Mozilla Public License 2.0.

0.2.95

5 years ago

0.2.94

6 years ago

0.2.93

6 years ago

0.2.92

6 years ago

0.2.91

6 years ago

0.2.90

6 years ago

0.2.89

6 years ago

0.2.88

6 years ago

0.2.87

6 years ago

0.2.86

6 years ago

0.2.85

6 years ago

0.2.84

6 years ago

0.2.83

6 years ago

0.2.82

6 years ago

0.2.81

6 years ago

0.2.81-y.1

6 years ago

0.2.81-y.0

6 years ago

0.2.81-alpha.4

6 years ago

0.2.81-alpha.3

6 years ago

0.2.81-alpha.2

6 years ago

0.2.81-alpha.1

6 years ago

0.2.81-alpha.0

6 years ago

0.2.80

6 years ago

0.2.79

6 years ago

0.2.78

6 years ago

0.2.77

6 years ago

0.2.76

6 years ago

0.2.75

6 years ago

0.2.74

6 years ago

0.2.73

6 years ago

0.2.72

6 years ago

0.2.71

6 years ago

0.2.70

6 years ago

0.2.69

6 years ago

0.2.68

6 years ago

0.2.67

6 years ago

0.2.66

6 years ago

0.2.65

6 years ago

0.2.64

6 years ago

0.2.63

6 years ago

0.2.62

6 years ago

0.2.61

6 years ago

0.2.60

6 years ago

0.2.59

6 years ago

0.2.58

6 years ago

0.2.57

6 years ago

0.2.56

6 years ago

0.2.55

6 years ago

0.2.54

6 years ago

0.2.53

6 years ago

0.2.52

6 years ago

0.2.51

6 years ago

0.2.50

6 years ago

0.2.49

6 years ago

0.2.48

6 years ago

0.2.47

6 years ago

0.2.46

6 years ago

0.2.45

6 years ago

0.2.44

6 years ago

0.2.43

6 years ago

0.2.42

6 years ago

0.2.41

6 years ago

0.2.40

6 years ago

0.2.39

6 years ago

0.2.38

6 years ago

0.2.37

6 years ago

0.2.36

6 years ago

0.2.35

6 years ago

0.2.34

6 years ago

0.2.33

6 years ago

0.2.32

6 years ago

0.2.31

6 years ago

0.2.30

6 years ago

0.2.29

6 years ago

0.2.28

6 years ago

0.2.27

6 years ago

0.2.26

6 years ago

0.2.25

6 years ago

0.2.24

6 years ago

0.2.23

6 years ago

0.2.22

6 years ago

0.2.21

6 years ago

0.2.20

6 years ago

0.2.19

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.1.16

7 years ago

0.1.15

7 years ago