imbric-theme 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.babelrc.json +3 -0
- package/.commitlintrc.json +3 -0
- package/.editorconfig +13 -0
- package/.eslintcache +1 -0
- package/.eslintrc.json +36 -0
- package/.huskyrc.json +6 -0
- package/.lintstagedrc.json +5 -0
- package/.nvmrc +1 -0
- package/.prettierrc.json +4 -0
- package/.releaserc.json +13 -0
- package/.storybook/main.js +9 -0
- package/.storybook/preview-head.html +2 -0
- package/.storybook/preview.js +32 -0
- package/.stylelintrc.json +14 -0
- package/.vscode/launch.json +15 -0
- package/CHANGELOG.md +0 -0
- package/README.md +69 -0
- package/atoms/Avatar/Avatar.js +36 -0
- package/atoms/Avatar/Avatar.module.css +3 -0
- package/atoms/Avatar/Avatar.stories.js +29 -0
- package/atoms/Avatar/__snapshots__/Avatar.stories.js.snap +105 -0
- package/atoms/Avatar/constants.js +3 -0
- package/atoms/Avatar/helpers.js +7 -0
- package/atoms/Avatar/index.js +3 -0
- package/atoms/Button/Button.js +68 -0
- package/atoms/Button/Button.module.css +63 -0
- package/atoms/Button/Button.stories.js +47 -0
- package/atoms/Button/Button.test.js +60 -0
- package/atoms/Button/__snapshots__/Button.stories.js.snap +191 -0
- package/atoms/Button/constants.js +3 -0
- package/atoms/Button/index.js +3 -0
- package/atoms/Card/Card.js +48 -0
- package/atoms/Card/Card.module.css +52 -0
- package/atoms/Card/Card.stories.js +41 -0
- package/atoms/Card/__snapshots__/Card.stories.js.snap +136 -0
- package/atoms/Card/constants.js +4 -0
- package/atoms/Card/index.js +3 -0
- package/atoms/Check/Check.js +26 -0
- package/atoms/Check/Check.module.css +11 -0
- package/atoms/Check/Check.stories.js +15 -0
- package/atoms/Check/__snapshots__/Check.stories.js.snap +67 -0
- package/atoms/Check/index.js +2 -0
- package/atoms/Divider/Divider.js +19 -0
- package/atoms/Divider/Divider.module.css +5 -0
- package/atoms/Divider/Divider.stories.js +12 -0
- package/atoms/Divider/__snapshots__/Divider.stories.js.snap +22 -0
- package/atoms/Divider/index.js +2 -0
- package/atoms/Heading/Heading.js +37 -0
- package/atoms/Heading/Heading.module.css +66 -0
- package/atoms/Heading/Heading.stories.js +46 -0
- package/atoms/Heading/__snapshots__/Heading.stories.js.snap +189 -0
- package/atoms/Heading/constants.js +5 -0
- package/atoms/Heading/index.js +3 -0
- package/atoms/Icon/Icon.js +66 -0
- package/atoms/Icon/Icon.module.css +112 -0
- package/atoms/Icon/Icon.stories.js +48 -0
- package/atoms/Icon/__snapshots__/Icon.stories.js.snap +1311 -0
- package/atoms/Icon/constants.js +486 -0
- package/atoms/Icon/helpers.js +9 -0
- package/atoms/Icon/index.js +3 -0
- package/atoms/Input/Input.js +49 -0
- package/atoms/Input/Input.module.css +27 -0
- package/atoms/Input/Input.stories.js +32 -0
- package/atoms/Input/__snapshots__/Input.stories.js.snap +101 -0
- package/atoms/Input/constants.js +3 -0
- package/atoms/Input/index.js +3 -0
- package/atoms/Link/Link.js +33 -0
- package/atoms/Link/Link.module.css +14 -0
- package/atoms/Link/Link.stories.js +30 -0
- package/atoms/Link/__snapshots__/Link.stories.js.snap +118 -0
- package/atoms/Link/constants.js +5 -0
- package/atoms/Link/index.js +3 -0
- package/atoms/Loading/Loading.js +30 -0
- package/atoms/Loading/Loading.module.css +51 -0
- package/atoms/Loading/Loading.stories.js +17 -0
- package/atoms/Loading/__snapshots__/Loading.stories.js.snap +26 -0
- package/atoms/Loading/index.js +2 -0
- package/atoms/Modal/Modal.js +98 -0
- package/atoms/Modal/Modal.module.css +85 -0
- package/atoms/Modal/Modal.stories.js +43 -0
- package/atoms/Modal/__snapshots__/Modal.stories.js.snap +239 -0
- package/atoms/Modal/constants.js +1 -0
- package/atoms/Modal/index.js +3 -0
- package/atoms/Paragraph/Paragraph.js +56 -0
- package/atoms/Paragraph/Paragraph.module.css +68 -0
- package/atoms/Paragraph/Paragraph.stories.js +52 -0
- package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +230 -0
- package/atoms/Paragraph/constants.js +5 -0
- package/atoms/Paragraph/index.js +3 -0
- package/atoms/Picture/Picture.js +40 -0
- package/atoms/Picture/Picture.module.css +16 -0
- package/atoms/Picture/Picture.stories.js +32 -0
- package/atoms/Picture/__snapshots__/Picture.stories.js.snap +156 -0
- package/atoms/Picture/index.js +2 -0
- package/atoms/Textarea/Textarea.js +46 -0
- package/atoms/Textarea/Textarea.module.css +25 -0
- package/atoms/Textarea/Textarea.stories.js +16 -0
- package/atoms/Textarea/__snapshots__/Textarea.stories.js.snap +25 -0
- package/atoms/Textarea/index.js +2 -0
- package/codecov.yml +2 -0
- package/helpers/storybook.js +29 -0
- package/helpers/storybook.test.js +40 -0
- package/helpers/styles.js +37 -0
- package/helpers/styles.test.js +222 -0
- package/hocs/withStyles.js +17 -0
- package/hook/useMedia.js +22 -0
- package/index.js +31 -0
- package/jest.config.js +23 -0
- package/jest.setup.js +13 -0
- package/layout/CenteredContent/CenteredContent.js +30 -0
- package/layout/CenteredContent/CenteredContent.module.css +12 -0
- package/layout/CenteredContent/CenteredContent.stories.js +22 -0
- package/layout/CenteredContent/__snapshots__/CenteredContent.stories.js.snap +27 -0
- package/layout/CenteredContent/index.js +2 -0
- package/layout/Container/Container.js +29 -0
- package/layout/Container/Container.module.css +14 -0
- package/layout/Container/Container.stories.js +22 -0
- package/layout/Container/__snapshots__/Container.stories.js.snap +27 -0
- package/layout/Container/index.js +2 -0
- package/layout/FullHeightContent/FullHeightContent.js +40 -0
- package/layout/FullHeightContent/FullHeightContent.module.css +21 -0
- package/layout/FullHeightContent/FullHeightContent.stories.js +22 -0
- package/layout/FullHeightContent/__snapshots__/FullHeightContent.stories.js.snap +41 -0
- package/layout/FullHeightContent/index.js +2 -0
- package/layout/Spacer/Spacer.js +40 -0
- package/layout/Spacer/Spacer.module.css +12 -0
- package/layout/Spacer/Spacer.stories.js +25 -0
- package/layout/Spacer/__snapshots__/Spacer.stories.js.snap +97 -0
- package/layout/Spacer/components/Horizontal/Horizontal.js +43 -0
- package/layout/Spacer/components/Horizontal/Horizontal.stories.js +32 -0
- package/layout/Spacer/components/Horizontal/__snapshots__/Horizontal.stories.js.snap +97 -0
- package/layout/Spacer/components/Horizontal/index.js +1 -0
- package/layout/Spacer/components/Vertical/Vertical.js +31 -0
- package/layout/Spacer/components/Vertical/Vertical.stories.js +25 -0
- package/layout/Spacer/components/Vertical/__snapshots__/Vertical.stories.js.snap +85 -0
- package/layout/Spacer/components/Vertical/index.js +1 -0
- package/layout/Spacer/components/index.js +2 -0
- package/layout/Spacer/constants.js +5 -0
- package/layout/Spacer/helpers.js +3 -0
- package/layout/Spacer/index.js +3 -0
- package/molecules/Accordion/Accordion.js +70 -0
- package/molecules/Accordion/Accordion.module.css +12 -0
- package/molecules/Accordion/Accordion.stories.js +31 -0
- package/molecules/Accordion/__snapshots__/Accordion.stories.js.snap +228 -0
- package/molecules/Accordion/index.js +2 -0
- package/molecules/AddButton/AddButton.js +137 -0
- package/molecules/AddButton/AddButton.module.css +128 -0
- package/molecules/AddButton/AddButton.stories.js +47 -0
- package/molecules/AddButton/__snapshots__/AddButton.stories.js.snap +326 -0
- package/molecules/AddButton/constants.js +6 -0
- package/molecules/AddButton/handlers.js +58 -0
- package/molecules/AddButton/handlers.test.js +19 -0
- package/molecules/AddButton/helpers.js +6 -0
- package/molecules/AddButton/helpers.test.js +41 -0
- package/molecules/AddButton/hooks.js +14 -0
- package/molecules/AddButton/index.js +3 -0
- package/molecules/ButtonIcon/ButtonIcon.js +41 -0
- package/molecules/ButtonIcon/ButtonIcon.stories.js +27 -0
- package/molecules/ButtonIcon/__snapshots__/ButtonIcon.stories.js.snap +178 -0
- package/molecules/ButtonIcon/constants.js +6 -0
- package/molecules/ButtonIcon/index.js +2 -0
- package/molecules/Dropdown/Dropdown.js +59 -0
- package/molecules/Dropdown/Dropdown.module.css +34 -0
- package/molecules/Dropdown/Dropdown.stories.js +41 -0
- package/molecules/Dropdown/__snapshots__/Dropdown.stories.js.snap +181 -0
- package/molecules/Dropdown/index.js +2 -0
- package/molecules/Error/Error.js +35 -0
- package/molecules/Error/Error.module.css +11 -0
- package/molecules/Error/Error.stories.js +18 -0
- package/molecules/Error/__snapshots__/Error.stories.js.snap +134 -0
- package/molecules/Error/index.js +2 -0
- package/molecules/IconLabel/IconLabel.js +83 -0
- package/molecules/IconLabel/IconLabel.module.css +16 -0
- package/molecules/IconLabel/IconLabel.stories.js +25 -0
- package/molecules/IconLabel/__snapshots__/IconLabel.stories.js.snap +211 -0
- package/molecules/IconLabel/constants.js +6 -0
- package/molecules/IconLabel/index.js +3 -0
- package/molecules/LoadingError/LoadingError.js +31 -0
- package/molecules/LoadingError/LoadingError.stories.js +24 -0
- package/molecules/LoadingError/__snapshots__/LoadingError.stories.js.snap +109 -0
- package/molecules/LoadingError/index.js +1 -0
- package/molecules/Score/Score.js +61 -0
- package/molecules/Score/Score.module.css +11 -0
- package/molecules/Score/Score.stories.js +13 -0
- package/molecules/Score/__snapshots__/Score.stories.js.snap +100 -0
- package/molecules/Score/faces/happy.svg +7 -0
- package/molecules/Score/faces/normal.svg +6 -0
- package/molecules/Score/faces/sad.svg +6 -0
- package/molecules/Score/index.js +2 -0
- package/molecules/Task/Task.js +114 -0
- package/molecules/Task/Task.module.css +47 -0
- package/molecules/Task/Task.stories.js +47 -0
- package/molecules/Task/__snapshots__/Task.stories.js.snap +953 -0
- package/molecules/Task/constants.js +1 -0
- package/molecules/Task/index.js +3 -0
- package/molecules/TaskCounter/TaskCounter.js +74 -0
- package/molecules/TaskCounter/TaskCounter.module.css +11 -0
- package/molecules/TaskCounter/TaskCounter.stories.js +26 -0
- package/molecules/TaskCounter/__snapshots__/TaskCounter.stories.js.snap +177 -0
- package/molecules/TaskCounter/index.js +2 -0
- package/package.json +102 -0
- package/scripts/build-tokens.js +40 -0
- package/scripts/create-component.js +127 -0
- package/storybook.test.js +13 -0
- package/styles/globals.css +10 -0
- package/styles/tokens.css +390 -0
- package/templates/component/Component.js +22 -0
- package/templates/component/Component.module.css +3 -0
- package/templates/component/Component.stories.js +23 -0
- package/templates/component/constants.js +1 -0
- package/templates/component/index.js +3 -0
- package/tokens/Token/Helper.js +30 -0
- package/tokens/Token/Token.js +13 -0
- package/tokens/Token/Token.module.css +64 -0
- package/tokens/Token/components/Color.js +21 -0
- package/tokens/Token/components/Color.stories.js +126 -0
- package/tokens/Token/components/FontFamily.js +24 -0
- package/tokens/Token/components/FontFamily.stories.js +32 -0
- package/tokens/Token/components/FontSize.js +24 -0
- package/tokens/Token/components/FontSize.stories.js +31 -0
- package/tokens/Token/components/FontWeight.js +24 -0
- package/tokens/Token/components/FontWeight.stories.js +31 -0
- package/tokens/Token/components/Spacing.js +24 -0
- package/tokens/Token/components/Spacing.stories.js +29 -0
- package/tokens/Token/components/__snapshots__/Color.stories.js.snap +7169 -0
- package/tokens/Token/components/__snapshots__/FontFamily.stories.js.snap +133 -0
- package/tokens/Token/components/__snapshots__/FontSize.stories.js.snap +261 -0
- package/tokens/Token/components/__snapshots__/FontWeight.stories.js.snap +317 -0
- package/tokens/Token/components/__snapshots__/Spacing.stories.js.snap +229 -0
- package/tokens/Token/components/index.js +5 -0
- package/tokens/Token/helpers.js +17 -0
- package/tokens/Token/index.js +1 -0
- package/tokens/index.js +471 -0
- package/utils/isEmpty.js +28 -0
- package/utils/isEmpty.test.js +125 -0
- package/utils/isObject.js +4 -0
- package/utils/keyboardCodes.js +6 -0
- package/utils/testUtils/matchMediaMock.js +14 -0
- package/utils/testUtils/svgrMock.js +2 -0
- package/utils/toCapitalize.js +4 -0
- package/utils/toKebabCase.js +8 -0
- package/utils/toPascalCase.js +20 -0
- package/webpack/cssModules.js +30 -0
- package/webpack/loadConfigs.js +6 -0
- package/webpack/reactInlineSvg.js +22 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import Helper from '../Helper'
|
5
|
+
|
6
|
+
import styles from '../Token.module.css'
|
7
|
+
|
8
|
+
const FontFamily = ({ label, value, children }) => {
|
9
|
+
return (
|
10
|
+
<Helper label={label} value={value}>
|
11
|
+
<div className={styles['font-family']} style={{ fontFamily: value }}>
|
12
|
+
{children}
|
13
|
+
</div>
|
14
|
+
</Helper>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
FontFamily.propTypes = {
|
19
|
+
label: PropTypes.string.isRequired,
|
20
|
+
value: PropTypes.arrayOf(PropTypes.string).isRequired,
|
21
|
+
children: PropTypes.string.isRequired,
|
22
|
+
}
|
23
|
+
|
24
|
+
export default FontFamily
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import Token from '..'
|
2
|
+
import { choices } from '../..'
|
3
|
+
|
4
|
+
import { getTemplate, getListTemplate } from '../../../helpers/storybook'
|
5
|
+
import { getTokenItems } from '../helpers'
|
6
|
+
|
7
|
+
const Template = getTemplate(Token.FontFamily)
|
8
|
+
const ListTemplate = getListTemplate(Token.FontFamily)
|
9
|
+
|
10
|
+
export default {
|
11
|
+
title: 'Tokens/FontFamily',
|
12
|
+
component: Token.FontFamily,
|
13
|
+
args: {
|
14
|
+
children:
|
15
|
+
"Depend noticed bones Edge disturbing flesh heard cream. Morninged facial judgment Hobbit fortress. Camp flatten buy dagger Sit. Leagues sweeter 1400 mean friend unlost Déagol trade stuffing? Smithy's jiffy merely treacherous cozy interesting ask seat Thror's.",
|
16
|
+
},
|
17
|
+
argTypes: {
|
18
|
+
value: { control: null },
|
19
|
+
label: { control: null },
|
20
|
+
},
|
21
|
+
}
|
22
|
+
|
23
|
+
const getItems = getTokenItems(choices.fontFamily, 'fontFamily')
|
24
|
+
|
25
|
+
export const Default = Template.bind({})
|
26
|
+
Default.args = {
|
27
|
+
label: 'var(--font-family-sans)',
|
28
|
+
value: choices.fontFamily.sans,
|
29
|
+
}
|
30
|
+
|
31
|
+
export const Types = ListTemplate.bind({})
|
32
|
+
Types.args = { items: getItems() }
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import Helper from '../Helper'
|
5
|
+
|
6
|
+
import styles from '../Token.module.css'
|
7
|
+
|
8
|
+
const FontSize = ({ label, value, children }) => {
|
9
|
+
return (
|
10
|
+
<Helper label={label} value={value}>
|
11
|
+
<div className={styles['font-size']} style={{ fontSize: value }}>
|
12
|
+
{children}
|
13
|
+
</div>
|
14
|
+
</Helper>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
FontSize.propTypes = {
|
19
|
+
label: PropTypes.string.isRequired,
|
20
|
+
value: PropTypes.string.isRequired,
|
21
|
+
children: PropTypes.string.isRequired,
|
22
|
+
}
|
23
|
+
|
24
|
+
export default FontSize
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Token from '..'
|
2
|
+
import { choices } from '../..'
|
3
|
+
|
4
|
+
import { getTemplate, getListTemplate } from '../../../helpers/storybook'
|
5
|
+
import { getTokenItems } from '../helpers'
|
6
|
+
|
7
|
+
const Template = getTemplate(Token.FontSize)
|
8
|
+
const ListTemplate = getListTemplate(Token.FontSize)
|
9
|
+
|
10
|
+
export default {
|
11
|
+
title: 'Tokens/FontSize',
|
12
|
+
component: Token.FontSize,
|
13
|
+
args: {
|
14
|
+
children: 'Woodland lasted crowned holiday pirate brother wrath.',
|
15
|
+
},
|
16
|
+
argTypes: {
|
17
|
+
value: { control: null },
|
18
|
+
label: { control: null },
|
19
|
+
},
|
20
|
+
}
|
21
|
+
|
22
|
+
const getItems = getTokenItems(choices.fontSize, 'fontSize')
|
23
|
+
|
24
|
+
export const Default = Template.bind({})
|
25
|
+
Default.args = {
|
26
|
+
label: 'var(--font-size-base)',
|
27
|
+
value: choices.fontSize.base,
|
28
|
+
}
|
29
|
+
|
30
|
+
export const Sizes = ListTemplate.bind({})
|
31
|
+
Sizes.args = { items: getItems() }
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import Helper from '../Helper'
|
5
|
+
|
6
|
+
import styles from '../Token.module.css'
|
7
|
+
|
8
|
+
const FontWeight = ({ label, value, children }) => {
|
9
|
+
return (
|
10
|
+
<Helper label={label} value={value}>
|
11
|
+
<div className={styles['font-weight']} style={{ fontWeight: value }}>
|
12
|
+
{children}
|
13
|
+
</div>
|
14
|
+
</Helper>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
FontWeight.propTypes = {
|
19
|
+
label: PropTypes.string.isRequired,
|
20
|
+
value: PropTypes.number.isRequired,
|
21
|
+
children: PropTypes.string.isRequired,
|
22
|
+
}
|
23
|
+
|
24
|
+
export default FontWeight
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Token from '..'
|
2
|
+
import { choices } from '../..'
|
3
|
+
|
4
|
+
import { getTemplate, getListTemplate } from '../../../helpers/storybook'
|
5
|
+
import { getTokenItems } from '../helpers'
|
6
|
+
|
7
|
+
const Template = getTemplate(Token.FontWeight)
|
8
|
+
const ListTemplate = getListTemplate(Token.FontWeight)
|
9
|
+
|
10
|
+
export default {
|
11
|
+
title: 'Tokens/FontWeight',
|
12
|
+
component: Token.FontWeight,
|
13
|
+
args: {
|
14
|
+
children: 'Cheap doors deny rune Mithrandir spawning brown dishes?',
|
15
|
+
},
|
16
|
+
argTypes: {
|
17
|
+
value: { control: null },
|
18
|
+
label: { control: null },
|
19
|
+
},
|
20
|
+
}
|
21
|
+
|
22
|
+
const getItems = getTokenItems(choices.fontWeight, 'fontWeight')
|
23
|
+
|
24
|
+
export const Default = Template.bind({})
|
25
|
+
Default.args = {
|
26
|
+
label: 'var(--font-weight-normal)',
|
27
|
+
value: choices.fontWeight.normal,
|
28
|
+
}
|
29
|
+
|
30
|
+
export const Sizes = ListTemplate.bind({})
|
31
|
+
Sizes.args = { items: getItems() }
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import Spacer from '../../../layout/Spacer'
|
5
|
+
import Helper from '../Helper'
|
6
|
+
|
7
|
+
import styles from '../Token.module.css'
|
8
|
+
|
9
|
+
const Spacing = ({ label, value }) => {
|
10
|
+
return (
|
11
|
+
<Helper label={label} value={value}>
|
12
|
+
<div className={styles.spacer}>
|
13
|
+
<Spacer size={value} isPlayground />
|
14
|
+
</div>
|
15
|
+
</Helper>
|
16
|
+
)
|
17
|
+
}
|
18
|
+
|
19
|
+
Spacing.propTypes = {
|
20
|
+
label: PropTypes.string.isRequired,
|
21
|
+
value: PropTypes.number.isRequired,
|
22
|
+
}
|
23
|
+
|
24
|
+
export default Spacing
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import Token from '..'
|
2
|
+
import { choices } from '../..'
|
3
|
+
|
4
|
+
import { getTemplate, getListTemplate } from '../../../helpers/storybook'
|
5
|
+
import { getTokenItems } from '../helpers'
|
6
|
+
|
7
|
+
const Template = getTemplate(Token.Spacing)
|
8
|
+
const ListTemplate = getListTemplate(Token.Spacing)
|
9
|
+
|
10
|
+
export default {
|
11
|
+
title: 'Tokens/Spacing',
|
12
|
+
component: Token.Spacing,
|
13
|
+
argTypes: {
|
14
|
+
value: { control: null },
|
15
|
+
label: { control: null },
|
16
|
+
},
|
17
|
+
parameters: { __sb: { fd: 'row' } },
|
18
|
+
}
|
19
|
+
|
20
|
+
const getItems = getTokenItems(choices.spacing, 'spacing')
|
21
|
+
|
22
|
+
export const Default = Template.bind({})
|
23
|
+
Default.args = {
|
24
|
+
label: 'var(--spacing-none)',
|
25
|
+
value: choices.spacing.none,
|
26
|
+
}
|
27
|
+
|
28
|
+
export const Sizes = ListTemplate.bind({})
|
29
|
+
Sizes.args = { items: getItems() }
|