1.0.7 • Published 3 years ago

@jota-ds/lib-react v1.0.7

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

Jota DS

This is the Open Source Design System from Meiuca

Below we have all the instructions for you to use Jota DS as a dependency and work on building your product from it. Too easy. Use it to understand how your day to day would work with a Design System, to show the advantages to your stakeholders or simply to focus on your studies.

Playground

Acess the component playground, in storybook, to know how to use our Open Source Design System Storybook

Components

The components with a * have a small explanation for its use after the table since it can be a little tricky

ComponentMust have propertiesoptional properties
Accordionlabel='Your string' id='your-accordion-id'children=string | image | othersonColor={true | false} labelHeadingVariant='h2 | h3 | h4' opened="true | false"
Alerttitle='Your Title string' text='Your alert text'type='helper | warning 'isOpen={true | false}
AvatarimgAlt='Your alt text'size='small | medium | large' onColor={true | false} hasNotification={true | false} imgUrl='www.yourUrl'
BannerTitle='Your title' bgColor='#hexaColor' image='Your image path'headingVariant='h2 | h3 | h4' paragraph='Your paragraph text' highTypography={true | false} handleClick={function}
BrandexternalUrl='Your brand link' size='small | medium | large'type='symbol | logotype' alt='alt text for brand'
Buttonlabel='button label' type='primary | secondary'icon={true | false} iconType='any icon from our icon list' onColor={true | false}disabled={true | false} handleClick={function}
ButtonGroupprimaryLabel='first button label' tertiaryLabel='second button labelprimaryDisabled={true | false} tertiaryDisabled={true | false} onColor={true | false}handleCancel={function}handleConfirm={function}
ButtonIconsize='small | medium | large' icon='any icon from our icon list'onColor={true | false}handleClick={function}handleBlur={function}
Cardbasechildren='card content'onColor={true | false}handleClick={function}noPadding={true | false}
Cardimagechildren='card content'onColor={true | false}handleClick={function}image='your image path'
InputCheckboxvalue='checkbox text' name='Label and input name'disabled={true | false} onColor={true | false} handleChange={function} checked={true | false}
HeaderlogoSource='your-image.jpg | your-image.svg | your-image.png' linkList={{label: '', href: '', target: '', disabled: { true | false }, currentActive: { true | false }}} menuList={{label: 'Your string', tagLabel:'Your string', handleClick:function}}isLoggedIn={true | false} hasLinks={true | false} mainMenuIsOpen={true | false} ghost={true | false} If isLoggedIn is set to true, avatar={{name: 'Your string', imgUrl: 'your-image.jpg | your-image.svg | your-image.png', imgAlt: 'Your string', hasNotification: true | false}}
HeaderEmptylogoSource='your-image.jpg | your-image.svg | your-image.png'children={React.Component} hasLinks={true | false} mainMenuIsOpen={true | false} ghost={true | false}
Iconicon='any icon from our icon list' size='small | medium | large'className='name for icon class' id='your-icon-id'
IconShapeicon='any icon from our icon list' size='small | medium | large'variant='default | warning | helper'
InputPasswordlabel='Your string' id='your-input-id'placeHolder="Your placeholder" maxLength={number} handleChange={function} helperText='Warning helper text in case of error'error={true|false} onColor={true|false} disabled={true|false}
InputRadiobuttonlistData={label: 'Your label',value: 'The Value',}onColor={true|false} handleChange={function} listData={checked: true|false ,disabled: true|false}
InputSearchformID='your-form-id' formName='your form name'inputID="your-input-id" inputName='your input name' placeholder='search bar placeholder'ariaLabel='text for your aria label' hasPreventDefault={true|false} onColor={true|false} disabled={true|false} handleSubmit={function} handleInputChange={function}
InputTextlabel='Your string' id='your-input-id'placeHolder="Your placeholder" handleChange={function} handleFocus={function}maxLength={number} error={true|false} onColor={true|false} disabled={true|false}
InputTextarealabel='Your string' id='your-input-id'placeHolder="Your placeholder" maxLength={number} handleChange={function}error={true|false} onColor={true|false} disabled={true|false} showHelper={true|false}
Linklabel='Your string' href='/your-link' target='_blank|_self'onColor={true|false} disabled={true|false} icon={true|false} handleClick={function}
MenuariaLabel='Your string' menuList={{label: 'Your string', tagLabel: 'Your string', isCurrent:true|false, handleClick: function}}isOpen={true|false}
ModalisOpen={true|false} isDoubleAction={true|false} firstActionLabel='Your string' secondActionLabel='Your string' handleConfirm={function} handleClose={function}isCloseDisabled={true|false} handleCancel={function}
Notificationtitle="Your string" content="Your string" buttonText="Your string" handleConfirm={function} handleClose={function}isOpen={true|false}
OverflowMenumenuList={{label: 'Your string', tagLabel:'Your string', handleClick:function}}isOpen={true|false} onColor={true|false} toggleMenu={function} getCurrentMenuItem={function}
InputSelectlabel='Your string' options='your option', 'your option'} handleChange={function}disabled={true|false} error={true|false} errorMsg='Your string' placeholder='Your string' onColor={true|false}
StepsariaLabel='Acessible label' steps={type: 'current'|'finish'|'next',title: 'Your string'}}
Switchlabel="Your string" checked={true|false} handleChange={function}disabled={true|false} onColor={true|false}
TabGroup*ariaLabel="Your string"onColor={true|false} handleTabClick={function}
TabItem*label="Tab Label"
TagCategorylabel="Your string" icon='shapes'onColor={true|false}
TagHighlightlabel="Your string" tabIndex={number}
TagSelectlabel="Your string" handleChange={function}disabled={true|false} onColor={true|false} active={true|false}
Tooltip*position='bottom-end'|'bottom-start'|'bottom'|'left-end'|'left-start'|'left'|'right-end'|'right-start'|'right'|'top-end'|'top-start'|'top' body='Your string' children={React.Component}onColor={true|false}
Typographycomponent='heading|subtitle|paragraph|caption'If component attribute is heading, variant='h1|h2|h3|h4|h5|h6' If component attribute is heading, size='x-small'|'small'|'medium'|'large'|'x-large'|'display' If component attribute is subtitle, size='small'|'large' If component attribute is paragraph, size='small'|'large' onColor={true|false}

*The tab group and tab item are used together, the tab group needs to wrap the tab item component, each tab item component will be one tab. Example:

<TabGroupTag>
  <TabItemTag label='label 1'></TabItemTag>
  <TabItemTag label='label 2'></TabItemTag>
  <TabItemTag label='label 3'></TabItemTag>
</TabGroupTag>

*The tooltip component works when you pass the content that you want to trigger the tooltip inside it as a children, the content that will be triggered will be passed as the body prop. Example:

<TooltipTag position="top" body="this is my text inside the tooltip">
  <strong>Here is my text that is always visible and will trigger the tooltip on mouse hover</strong>
</TooltipTag>

Quick start - React

1) Install

Install DS from:

yarn add @jota-ds/lib-react

2) Import a component

In your React App, import a component as:

import { Button } from '@jota-ds/lib-react';

Sample usage of button component.

<Button label="Label" type="primary" />

3) Import DS default fonts

In your index.html, in the \ tag, import:

<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
  href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&display=swap"
  rel="stylesheet"
/>
<link
  href="https://fonts.googleapis.com/css2?family=Lusitana:wght@400;500;600;700&display=swap"
  rel="stylesheet"
/>

Quick start - NextJS

Our library can be consumed in your NextJS app. Follow the instructions below:

1) Install

yarn add @jota-ds/lib-react

2) Import a component

Sample usage of a button component in NextJS.

import {DynamicButton} from "@jota-ds/lib-react/next"

Then:

<DynamicButton label="Label" type="primary" />

3) Import DS default fonts

In your index.html, in the \ tag, import:

<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
  href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&display=swap"
  rel="stylesheet"
/>
<link
  href="https://fonts.googleapis.com/css2?family=Lusitana:wght@400;500;600;700&display=swap"
  rel="stylesheet"
/>

CodeSandbox

Still have doubts? View our example on CodeSandbox:

Edit stupefied-cannon-cjttc