diff --git a/README.md b/README.md index 9a1ab52e78..54fecc7225 100755 --- a/README.md +++ b/README.md @@ -1,210 +1,296 @@ -# Welcome to Scality core-ui +# Welcome to Scality Core-UI -This project is a React stateless components library containing all common React components, [Styled-components](https://www.styled-components.com/)' components, layouts, icons and themes for all Scality UI projects. +Core-UI is a component library containing all components, layouts, icons and themes used for all Scality UI projects. -Components are also themable by using the [styled-components' theming concept](https://www.styled-components.com/docs/advanced). +## Getting started -## What are stateless Components? +### Installation -Stateless Components just receive an input as props and return an output as JSX: ```(props) => JSX```. The input, only if available in form of props, shapes the rendered output. These kind of components don't manage state and don't have any side-effects (e.g. accessing the browser's local storage). +#### Manual installation -Examples: +- Add ```@scality/core-ui``` in the ```package.json```'s dependencies of your project. -- Stateless/Presentational/Dumb component: -```javascript -const BooksList = ({books}) => { - return ( - - ) -} +```json + "@scality/core-ui": "github:scality/core-ui#0.114.0", ``` -- Stateful/Container/Smart component: -```javascript -import React, { useState, useEffect } from 'react'; +- ```@scality/core-ui``` requires the peerDependencies below. Make sure that you have them in the ```package.json```'s dependencies. -const BooksList = (props) => { - const [books, setBooks] = useState([]); - useEffect(() => { - setBooks(['Harry Potter', 'Star Wars']); - }, []); +```json + "@fortawesome/fontawesome-free": "^5.10.2", + "@fortawesome/fontawesome-svg-core": "^1.2.35", + "@fortawesome/free-regular-svg-icons": "^5.15.3", + "@fortawesome/free-solid-svg-icons": "^5.15.3", + "@fortawesome/react-fontawesome": "^0.1.14", + "@js-temporal/polyfill": "^0.4.4", + "polished": "3.4.1", + "pretty-bytes": "^5.6.0", + "react": "^17.0.2", + "react-debounce-input": "3.2.2", + "react-dom": "^17.0.2", + "react-dropzone": "^14.2.3", + "react-query": "^3.34.0", + "react-router": "^5.2.0", + "react-router-dom": "^5.2.0", + "react-select": "4.3.1", + "react-table": "^7.7.0", + "react-virtualized": "9.22.3", + "react-virtualized-auto-sizer": "^1.0.5", + "react-window": "^1.8.6", + "styled-components": "^4.1.2", + "styled-system": "^5.1.5", + "vega": "^5.17.3", + "vega-embed": "^6.0.0", + "vega-lite": "^5.0.0", + "vega-tooltip": "^0.27.0" +``` - return ( - - ) -} +- Install the dependencies : +```sh +npm install ``` -## How to use it +### Usage -- Add ```@scality/core-ui``` in the ```package.json```'s dependencies of your project. -```json - "@scality/core-ui": "github:scality/core-ui.git", -``` +- Import a component from ```@scality/core-ui/dist/next'``` or ```@scality/core-ui``` + +- Use props to change its appearance and behaviour + +```jsx +import { Button } from '@scality/core-ui/dist/next'; +import { Icon } from '@scality/core-ui'; + +