0.1.81 • Published 3 years ago

react-design-system-docaposte v0.1.81

Weekly downloads
39
License
MIT
Repository
-
Last release
3 years ago

react-design-system-docaposte

A library of React components design system Docaposte

NPM JavaScript Style Guide

Install

npm install --save react-design-system-docaposte

Usage

import React from 'react'

import MyComponent from 'react-design-system-docaposte'
import 'react-design-system-docaposte/dist/index.css'

export default function Example() {
    return <MyComponent/>
}

Example

Run start script in example/package.json

npm start

Components

Button

Props component extends ButtonHTMLAttributes interface.

PropsTypeDefaultRequiredDetail
theme"primary""secondary""ghost""primary"falseDefine button style
size"thin""default""default"falseDefine button size
iconReactNodeundefinedfalseDefine icon inside button to right of the text
loadingbooleanundefinedfalseDisplay loader inside button

ButtonLink

Props component extends AnchorHTMLAttributes and ButtonHTMLAttributes interface.

PropsTypeDefaultRequiredDetail
asLinkbooleanfalsefalseDefine if render tag HTML is link a or button

Card

Props component extends HTMLAttributes interface.

PropsTypeDefaultRequiredDetail
alignItem"left" "center" "right""center"false/trueAlign the card inside content in available space
paddingbooleanundefinedfalseDefine if card has padding

Input

This component extends InputHTMLAttributes interface.

PropsTypeDefaultRequiredDetail
idstringundefinedfalseElement id, is required if label is defined
labelstringundefinedfalseText label
errorstringundefinedfalseDisplay error below input, only render if not undefined
fullWidthstringundefinedfalseDefine if input take full with to available space
iconReactNodeundefinedfalseDisplay icon inside input

Text

Props component extends PropsWithChildren interface.

PropsTypeDefaultRequiredDetail
colorstringundefinedfalseDefine text render color, component can be use with sub-component

Text component has multiple sub-component to render text.

<Text.H1>
<Text.H2>
<Text.H3>
<Text.H4>
<Text.H5>
<Text.Subtitle1>
<Text.Subtitle2>
<Text.Body1>
<Text.Body2>
<Text.Caption>
<Text.Error>

Loader

Render loader svg animate, props component extends SVGAttributes interface.

PropsTypeDefaultRequiredDetail
colorstring"currentColor"falseDefine color of loader, default color is black
sizestring number24falseDefine size icon loader, default is 24px

Modal

Display modal, this component return a ReactPortal.

PropsTypeDefaultRequiredDetail
childrenReactNodetrueModal content
openbooleanfalsetrueDefine if modal is display or not
onClose() => voidundefinedfalseCallback function is trigger when modal is closed
fullHeightbooleanundefinedfalseModal wrapper can take the full height of the screen
disabledCloseClickOutsidebooleanundefinedfalseBy default modal is closed when click outside modal wrapper. This event can be disabled

Alert

Render a alert.

PropsTypeDefaultRequiredDetail
childrenReactNodetrueContent
displayedbooleanfalsefalseDefine if alert is display or not
theme"success""warning""error""info"undefinedfalseDefine alert style
alignItem"left" "center" "right"undefinedfalseAlign alert inside content in available space
closablebooleanundefinedfalseDefine if alert can be closed
fullWidthbooleanundefinedfalseDefine alert take full width available space
onClose() => voidundefinedfalseCallback function is trigger when close button is clicked

Browser Support

IEChromeFirefoxOperaSafari
IE 11+ ✔Chrome 4.0+ ✔Firefox 16.0+ ✔Opera 15.0+ ✔Safari 4.0+ ✔

License

Copyright © 2020 Eukles Solution

0.1.81

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.52

3 years ago

0.1.51

3 years ago

0.1.5

3 years ago

0.1.45

3 years ago

0.1.42

3 years ago

0.1.43

3 years ago

0.1.44

3 years ago

0.1.41

3 years ago

0.1.4

3 years ago

0.1.31

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago