Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,069 changes: 6,822 additions & 2,247 deletions package-lock.json

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rgsystem/lib-ui",
"version": "3.0.0",
"version": "4.0.0",
"description": "React components library for the dashboard",
"main": "lib/index.js",
"browser": "lib/index.umd.js",
Expand All @@ -25,12 +25,12 @@
"prepublishOnly": "rm -rf lib && npm run build"
},
"peerDependencies": {
"@material-ui/core": "^4.7.0",
"@material-ui/core": "^4.9.2",
"@styled-system/css": "^5.x",
"react": "^16.x",
"react-dom": "^16.x",
"styled-components": "^4.x",
"styled-icons": "^9.0.1",
"styled-icons": "^9.x",
"styled-system": "^5.x"
},
"husky": {
Expand Down Expand Up @@ -62,53 +62,53 @@
},
"homepage": "https://github.com/rgsystemes/lib-ui#readme",
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@babel/preset-react": "^7.0.0",
"@material-ui/core": "^4.7.0",
"@storybook/addon-a11y": "^5.2.1",
"@storybook/addon-actions": "^5.2.1",
"@storybook/addon-jest": "^5.2.1",
"@storybook/addon-knobs": "^5.2.1",
"@storybook/addon-links": "^5.2.1",
"@storybook/addon-notes": "^5.2.1",
"@storybook/addons": "^5.2.1",
"@storybook/react": "^5.2.1",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"@material-ui/core": "^4.9.2",
"@storybook/addon-a11y": "^5.3.13",
"@storybook/addon-actions": "^5.3.13",
"@storybook/addon-jest": "^5.3.13",
"@storybook/addon-knobs": "^5.3.13",
"@storybook/addon-links": "^5.3.13",
"@storybook/addon-notes": "^5.3.13",
"@storybook/addons": "^5.3.13",
"@storybook/react": "^5.3.13",
"@storybook/storybook-deployer": "^2.8.1",
"@styled-system/css": "^5.1.4",
"@testing-library/jest-dom": "^4.1.0",
"@testing-library/react": "^9.2.0",
"@testing-library/react-hooks": "^2.0.1",
"@testing-library/user-event": "^7.1.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/react-hooks": "^2.0.3",
"@testing-library/user-event": "^7.2.1",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"babel-plugin-styled-components": "^1.10.6",
"core-js": "^3.2.1",
"eslint": "^6.5.1",
"babel-plugin-styled-components": "^1.10.7",
"core-js": "^3.6.4",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.15.0",
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-standard": "^4.0.1",
"husky": "^3.0.8",
"husky": "^3.1.0",
"jest": "^24.9.0",
"lint-staged": "^9.4.1",
"plop": "^2.4.0",
"react": "^16.10.1",
"lint-staged": "^9.5.0",
"plop": "^2.5.3",
"react": "^16.12.0",
"react-animate-height": "^2.0.20",
"react-dom": "^16.10.1",
"rollup": "^1.22.0",
"react-dom": "^16.12.0",
"rollup": "^1.31.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-peer-deps-external": "^2.2.2",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-uglify": "^6.0.4",
"storybook-addon-styled-component-theme": "^1.2.5",
"styled-components": "^4.4.0",
"styled-icons": "^9.0.1",
"styled-system": "^5.1.2"
"storybook-addon-styled-component-theme": "^1.3.0",
"styled-components": "^4.4.1",
"styled-icons": "^9.3.0",
"styled-system": "^5.1.4"
},
"dependencies": {}
}
2 changes: 1 addition & 1 deletion src/Atoms/Banner/Banner.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const closableBanner = () => {
setTimeout(() => setClosed(false), 5000)
}
},
[closed]
[closed],
)

return !closed && <Banner
Expand Down
4 changes: 2 additions & 2 deletions src/Atoms/Button/Button.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export const button = () => (
{colors.map(color =>
<Button onClick={action('clicked')} color={color} size={size} disabled={boolean('Disabled', false)}>
{size.charAt(0).toUpperCase() + size.slice(1)} button
</Button>
</Button>,
)}
</Row>
</Row>,
)}
</Container>
)
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/ButtonGroup/ButtonGroup.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const buttonGroup = () => (
<Icon button Component={Star} />
<Icon button Component={Home} />
</ButtonGroup>
</ButtonGroups>
</ButtonGroups>,
)}
</Container>
)
Expand Down
6 changes: 3 additions & 3 deletions src/Atoms/Byte/Byte.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ const useByte = (units, value = 0, accuracy) => {

const scales = useMemo(
() => units.map((unit, power) => ({ unit, scale: Math.pow(1024, power) })),
[units]
[units],
)

const { scale, unit } = useMemo(
() => (
scales.length ? scales.reduce((acc, obj) => value >= obj.scale ? obj : acc) :
{ scale: 1, unit: '' }
),
[scales, value]
[scales, value],
)

const bytes = useMemo(
() => Math.round(value * roundFactor / scale) / roundFactor,
[value, roundFactor, scale]
[value, roundFactor, scale],
)
return { bytes, unit }
}
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/IconButton/IconButton.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const iconButton = () => (
Icons.map((Icon, index) =>
<IconButton key={index} onClick={action('icon clicked')}>
<Icon size={20} />
</IconButton>
</IconButton>,
)
)
iconButton.story = {
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Input/Input.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const input = () =>
error={boolean('Error')}
endAdornment={<InputAdornment><IconButton><Search size={20}/></IconButton></InputAdornment>}
size={size}
/>
/>,
)}
</Container>
input.story = {
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/TextField/TextField.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const textField = () =>
helperText={`${size} text field`}
placeholder="Placeholder"
size={size}
/>
/>,
)}
</Container>

Expand Down
8 changes: 4 additions & 4 deletions src/Atoms/Trans/Trans.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ it('should translate', () => {
const { getByText } = render(
<TransProvider value={translations}>
<Trans transKey="global.translatedText"/>
</TransProvider>
</TransProvider>,
)

expect(getByText('Bonsoir')).toBeInTheDocument()
Expand All @@ -25,7 +25,7 @@ it('should return transKey when not defined', () => {
const { getByText } = render(
<TransProvider value={translations}>
<Trans transKey="global.notTranslatedText" dude="Bro"/>
</TransProvider>
</TransProvider>,
)

expect(getByText('global.notTranslatedText')).toBeInTheDocument()
Expand All @@ -35,7 +35,7 @@ it('should translate with the transKey passed as a child', () => {
const { getByText } = render(
<TransProvider value={translations}>
<Trans dude="bro" verb="lift">global.translatedTextWithParameters</Trans>
</TransProvider>
</TransProvider>,
)

expect(getByText('Bonsoir bro ! Est-ce que tu lift ?')).toBeInTheDocument()
Expand All @@ -45,7 +45,7 @@ it('should translate with parameters', () => {
const { getByText } = render(
<TransProvider value={translations}>
<Trans transKey="global.translatedTextWithParameters" dude="bro" verb="lift"/>
</TransProvider>
</TransProvider>,
)

expect(getByText('Bonsoir bro ! Est-ce que tu lift ?')).toBeInTheDocument()
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Trans/useTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default () => {
.split('.')
.reduce(
(acc, k) => acc[k] || transKey,
translations
translations,
)

Object.entries(parameters).forEach(([key, value]) => {
Expand Down
4 changes: 2 additions & 2 deletions src/Molecules/Breadcrumb/Breadcrumb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const Breadcrumb = (
path = [],
Item = BaseItem,
...props
}
},
) => (
<Breadcrumbs aria-label="breadcrumb" data-testid="breadcrumb" {...props}>
{path.map(({ id, ...pathProps }) =>
<Item key={id} id={id} { ...pathProps} />
<Item key={id} id={id} { ...pathProps} />,
)}
</Breadcrumbs>
)
Expand Down
4 changes: 2 additions & 2 deletions src/Molecules/ExpansionPanel/ExpansionPanel.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export const expansionPanel = () => panels.map(([summary, details], index) =>
{details}
</Typo>
</ExpansionPanelDetails>
</ExpansionPanel>
</ExpansionPanel>,
)

const Toggle = styled(
({ expanded, ...props }) => <Button { ...props } />
({ expanded, ...props }) => <Button { ...props } />,
).attrs(props => ({
children: props.expanded ? <KeyboardArrowUp size={14}/> : <KeyboardArrowDown size={14}/>,
...props,
Expand Down
2 changes: 1 addition & 1 deletion src/Molecules/Export/Export.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ExtraOptions = ({ value, onChange }) =>
value={value}
control={<Radio />}
label={label}
/>
/>,
)}
</RadioGroup>
</FormControl>
Expand Down
8 changes: 4 additions & 4 deletions src/Molecules/Export/Export.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const exportFormats = [
it('should not call onExport when the filename is empty', () => {
const onExport = jest.fn()
const { getByText } = render(
<Export value={{ filename: '' }} onExport={onExport}/>
<Export value={{ filename: '' }} onExport={onExport}/>,
)

userEvent.click(getByText('global.export.actionExport'))
Expand All @@ -37,7 +37,7 @@ it('should not call onExport when the filename is empty', () => {
it('should not call onExport when the format is empty', () => {
const onExport = jest.fn()
const { getByText } = render(
<Export value={{ format: '' }} formats={exportFormats} onExport={onExport}/>
<Export value={{ format: '' }} formats={exportFormats} onExport={onExport}/>,
)

userEvent.click(getByText('global.export.actionExport'))
Expand All @@ -48,7 +48,7 @@ it('should not call onExport when the format is empty', () => {
it('should call onExport when the filename and format are filled', () => {
const onExport = jest.fn()
const { getByText } = render(
<Export onExport={onExport} formats={exportFormats} value={{ filename: 'toto', format: 'xls' }}/>
<Export onExport={onExport} formats={exportFormats} value={{ filename: 'toto', format: 'xls' }}/>,
)

userEvent.click(getByText('global.export.actionExport'))
Expand All @@ -64,7 +64,7 @@ it('should call onExport when filename and format are filled in but disabled is
formats={exportFormats}
value={{ filename: 'toto', format: 'xls' }}
disabled={true}
/>
/>,
)

userEvent.click(getByText('global.export.actionExport'))
Expand Down
4 changes: 2 additions & 2 deletions src/Molecules/FormControl/FormControl.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const formControl = () => {
onChange={action('Radio group changed')}
>
{options.map(({ value, label }) =>
<FormControlLabel value={value} control={<Radio />} label={label} />
<FormControlLabel value={value} control={<Radio />} label={label} />,
)}
</RadioGroup>
</FormControl>
Expand All @@ -83,7 +83,7 @@ export const formControl = () => {
<FormControlLabel
control={<Checkbox value={value} onChange={action('Checkbox changed')}/>}
label={label}
/>
/>,
)}
</FormGroup>
</FormControl>
Expand Down
2 changes: 1 addition & 1 deletion src/Molecules/List/List.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const list = () =>
<ListItemText>
{league}
</ListItemText>
</ListItem>
</ListItem>,
)}
</List>
list.story = {
Expand Down
2 changes: 1 addition & 1 deletion src/Molecules/Pagination/Pagination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Pagination = ({
onClick={() => handleSizeChange(size)}
>
{t('global.pagination.perPage', { count: size })}
</MenuItem>
</MenuItem>,
)}
</Menu>
<ButtonGroup size="small">
Expand Down
8 changes: 4 additions & 4 deletions src/Molecules/Pagination/Pagination.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ it('should call onPageChange when user clicks first', () => {
const { getByTestId } = render(
<Wrapper>
<Pagination onPageChange={onPageChange} />
</Wrapper>
</Wrapper>,
)

user.click(getByTestId('first'))
Expand All @@ -30,7 +30,7 @@ it('should call onPageChange when user clicks prev', () => {
const { getByTestId } = render(
<Wrapper>
<Pagination currentPage={12} onPageChange={onPageChange} />
</Wrapper>
</Wrapper>,
)

user.click(getByTestId('prev'))
Expand All @@ -43,7 +43,7 @@ it('should call onPageChange when user clicks next', () => {
const { getByTestId } = render(
<Wrapper>
<Pagination onPageChange={onPageChange} />
</Wrapper>
</Wrapper>,
)

user.click(getByTestId('next'))
Expand All @@ -57,7 +57,7 @@ it('should call onSizeChange when user select another size', async () => {
const { getByTestId, findByTestId } = render(
<Wrapper>
<Pagination sizeOptions={[10, 20, 30]} onSizeChange={onSizeChange} />
</Wrapper>
</Wrapper>,
)

user.click(getByTestId('select'))
Expand Down
2 changes: 1 addition & 1 deletion src/Molecules/TableList/SortedColumn/SortedColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const switchOrder = (name, order, onSort) => {
order === NONE ? null : name,
order === NONE ? null :
order === DESC ? 'desc' :
'asc'
'asc',
)
}

Expand Down
Loading