chore: remove unused storybook code
This commit is contained in:
parent
650078b125
commit
770fa13ea0
5 changed files with 5 additions and 4779 deletions
|
|
@ -1,10 +0,0 @@
|
|||
module.exports = {
|
||||
stories: ['../src/stories/index.js'],
|
||||
addons: [
|
||||
'@storybook/addon-actions',
|
||||
'@storybook/addon-links',
|
||||
'@storybook/addon-knobs',
|
||||
'@storybook/addon-backgrounds',
|
||||
'@storybook/preset-create-react-app'
|
||||
]
|
||||
}
|
||||
|
|
@ -36,10 +36,6 @@ You will also see any lint errors in the console.
|
|||
|
||||
Runs eslint --fix on the src folder
|
||||
|
||||
### `npm storybook`
|
||||
|
||||
Runs the storybook server
|
||||
|
||||
### `npm test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.<br>
|
||||
|
|
|
|||
4551
new-lamassu-admin/package-lock.json
generated
4551
new-lamassu-admin/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -53,13 +53,6 @@
|
|||
"yup": "0.32.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-actions": "6.0.26",
|
||||
"@storybook/addon-backgrounds": "6.0.26",
|
||||
"@storybook/addon-knobs": "6.0.26",
|
||||
"@storybook/addon-links": "6.0.26",
|
||||
"@storybook/addons": "6.0.26",
|
||||
"@storybook/preset-create-react-app": "^3.1.4",
|
||||
"@storybook/react": "6.0.26",
|
||||
"@welldone-software/why-did-you-render": "^3.3.9",
|
||||
"eslint": "^7.19.0",
|
||||
"eslint-config-prettier": "^6.7.0",
|
||||
|
|
@ -99,9 +92,7 @@
|
|||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"storybook": "start-storybook -p 9009 -s public",
|
||||
"postinstall": "patch-package",
|
||||
"build-storybook": "build-storybook -s public",
|
||||
"lamassu": "REACT_APP_BUILD_TARGET=LAMASSU react-scripts start",
|
||||
"pazuz": "REACT_APP_BUILD_TARGET=PAZUZ react-scripts start"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,210 +0,0 @@
|
|||
import Checkbox from '@material-ui/core/Checkbox'
|
||||
import FormControlLabel from '@material-ui/core/FormControlLabel'
|
||||
import {
|
||||
MuiThemeProvider,
|
||||
createMuiTheme,
|
||||
StylesProvider,
|
||||
jssPreset
|
||||
} from '@material-ui/core/styles'
|
||||
import { withKnobs, text, boolean, select } from '@storybook/addon-knobs'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
import { create } from 'jss'
|
||||
import extendJss from 'jss-plugin-extend'
|
||||
import React from 'react'
|
||||
|
||||
import { ActionButton, Button, Link } from 'src/components/buttons'
|
||||
import { TextInput, Switch, CashIn, CashOut } from 'src/components/inputs'
|
||||
import { ReactComponent as AuthorizeIconReversed } from 'src/styling/icons/button/authorize/white.svg'
|
||||
import { ReactComponent as AuthorizeIcon } from 'src/styling/icons/button/authorize/zodiac.svg'
|
||||
|
||||
// import ConfirmDialog from '../components/ConfirmDialog'
|
||||
import {
|
||||
H1,
|
||||
H2,
|
||||
H3,
|
||||
TL1,
|
||||
TL2,
|
||||
P,
|
||||
Info1,
|
||||
Info2,
|
||||
Mono
|
||||
} from '../components/typography'
|
||||
import {
|
||||
inputFontFamily,
|
||||
secondaryColor,
|
||||
fontColor
|
||||
} from '../styling/variables'
|
||||
|
||||
const jss = create({
|
||||
plugins: [extendJss(), ...jssPreset().plugins]
|
||||
})
|
||||
|
||||
const Wrapper = ({ children }) => (
|
||||
<StylesProvider jss={jss}>
|
||||
<MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>
|
||||
</StylesProvider>
|
||||
)
|
||||
|
||||
const story = storiesOf('Components', module)
|
||||
story.addDecorator(withKnobs)
|
||||
|
||||
const colors = {
|
||||
Primary: 'primary',
|
||||
Secondary: 'secondary'
|
||||
}
|
||||
|
||||
const linkColors = {
|
||||
Primary: 'primary',
|
||||
Secondary: 'secondary',
|
||||
'No Color': 'no-color'
|
||||
}
|
||||
|
||||
const sizes = {
|
||||
Large: 'lg',
|
||||
Small: 'sm'
|
||||
}
|
||||
|
||||
const theme = createMuiTheme({
|
||||
typography: {
|
||||
fontFamily: inputFontFamily
|
||||
},
|
||||
MuiButtonBase: {
|
||||
disableRipple: true
|
||||
},
|
||||
palette: {
|
||||
primary: {
|
||||
light: secondaryColor,
|
||||
dark: secondaryColor,
|
||||
main: secondaryColor
|
||||
},
|
||||
secondary: {
|
||||
light: secondaryColor,
|
||||
dark: secondaryColor,
|
||||
main: secondaryColor
|
||||
}
|
||||
},
|
||||
overrides: {
|
||||
MuiInputLabel: {
|
||||
paddingLeft: 4
|
||||
},
|
||||
MuiFormLabel: {
|
||||
root: {
|
||||
color: fontColor,
|
||||
'&$focused': {
|
||||
color: 'blue'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
story.add('Button', () => (
|
||||
<Wrapper>
|
||||
<Button
|
||||
disabled={boolean('Disabled', false)}
|
||||
size={select('Size', sizes, 'lg')}>
|
||||
{text('Label', 'Button')}
|
||||
</Button>
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
story.add('Action Button', () => (
|
||||
<Wrapper>
|
||||
<ActionButton
|
||||
disabled={boolean('Disabled', false)}
|
||||
color={select('Color', linkColors, 'primary')}
|
||||
Icon={AuthorizeIcon}
|
||||
InverseIcon={AuthorizeIconReversed}>
|
||||
{text('Label', 'Button')}
|
||||
</ActionButton>
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
story.add('Text Button', () => (
|
||||
<Wrapper>
|
||||
<Link color={select('Color', linkColors, 'primary')}>
|
||||
{text('Label', 'Text Button')}
|
||||
</Link>
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
story.add('Switch', () => (
|
||||
<Wrapper>
|
||||
<FormControlLabel control={<Switch value="checkedB" />} label="iOS style" />
|
||||
<Switch label="hehe" disabled />
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
story.add('Text Input', () => (
|
||||
<Wrapper>
|
||||
<TextInput
|
||||
name="text-input"
|
||||
touched={[]}
|
||||
color={select('Color', colors, 'amazonite')}
|
||||
/>
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
story.add('Checkbox', () => (
|
||||
<Wrapper>
|
||||
<Checkbox
|
||||
value="checkedC"
|
||||
inputProps={{
|
||||
'aria-label': 'uncontrolled-checkbox'
|
||||
}}
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
value="checkedB"
|
||||
inputProps={{
|
||||
'aria-label': 'uncontrolled-checkbox'
|
||||
}}
|
||||
/>
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
story.add('Cashbox', () => (
|
||||
<Wrapper>
|
||||
<div>
|
||||
<CashIn percent={0} notes={0} />
|
||||
<hr />
|
||||
<CashIn percent={49} notes={19} />
|
||||
<hr />
|
||||
<CashIn percent={50} notes={20} />
|
||||
<hr />
|
||||
<CashIn percent={51} notes={22} />
|
||||
<hr />
|
||||
<CashIn percent={99} notes={39} />
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<CashOut percent={0} notes={0} denomination={20} />
|
||||
<hr />
|
||||
<CashOut percent={49} notes={19} denomination={20} />
|
||||
<hr />
|
||||
<CashOut percent={50} notes={20} denomination={20} />
|
||||
<hr />
|
||||
<CashOut percent={51.00001} notes={22} denomination={20} />
|
||||
</div>
|
||||
</Wrapper>
|
||||
))
|
||||
|
||||
const typographyStory = storiesOf('Typography', module)
|
||||
typographyStory.add('H1', () => <H1>Hehehe</H1>)
|
||||
|
||||
typographyStory.add('H2', () => <H2>Hehehe</H2>)
|
||||
|
||||
typographyStory.add('H3', () => <H3>Hehehe</H3>)
|
||||
|
||||
typographyStory.add('TL1', () => <TL1>Hehehe</TL1>)
|
||||
|
||||
typographyStory.add('TL2', () => <TL2>Hehehe</TL2>)
|
||||
|
||||
typographyStory.add('P', () => <P>Hehehe</P>)
|
||||
|
||||
typographyStory.add('Info1', () => <Info1>Hehehe</Info1>)
|
||||
|
||||
typographyStory.add('Info2', () => <Info2>Hehehe</Info2>)
|
||||
|
||||
typographyStory.add('Mono', () => <Mono>Hehehe</Mono>)
|
||||
Loading…
Add table
Add a link
Reference in a new issue