imbric-theme 0.1.0
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/.dockerignore +14 -0
- package/.editorconfig +13 -0
- package/.eslintignore +1 -0
- package/.eslintrc.json +36 -0
- package/.huskyrc.json +6 -0
- package/.lintstagedrc.json +5 -0
- package/.nvmrc +1 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +4 -0
- package/.releaserc.json +13 -0
- package/.storybook/main.js +13 -0
- package/.storybook/preview-head.html +2 -0
- package/.storybook/preview.js +53 -0
- package/.stylelintrc.json +14 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +0 -0
- package/Dockerfile +17 -0
- package/README.md +69 -0
- package/atoms/AlertModal/AlertModal.js +69 -0
- package/atoms/AlertModal/AlertModal.module.css +3 -0
- package/atoms/AlertModal/AlertModal.stories.js +30 -0
- package/atoms/AlertModal/constants.js +4 -0
- package/atoms/AlertModal/index.js +3 -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 +83 -0
- package/atoms/Button/Button.module.css +85 -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 +28 -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/Checkbox/Checkbox.js +77 -0
- package/atoms/Checkbox/Checkbox.module.css +60 -0
- package/atoms/Checkbox/Checkbox.stories.js +30 -0
- package/atoms/Checkbox/constants.js +1 -0
- package/atoms/Checkbox/index.js +3 -0
- package/atoms/Divider/Divider.js +22 -0
- package/atoms/Divider/Divider.module.css +25 -0
- package/atoms/Divider/Divider.stories.js +23 -0
- package/atoms/Divider/__snapshots__/Divider.stories.js.snap +22 -0
- package/atoms/Divider/constants.js +3 -0
- package/atoms/Divider/index.js +3 -0
- package/atoms/Heading/Heading.js +37 -0
- package/atoms/Heading/Heading.module.css +70 -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 +142 -0
- package/atoms/Icon/Icon.stories.js +48 -0
- package/atoms/Icon/__snapshots__/Icon.stories.js.snap +1311 -0
- package/atoms/Icon/constants.js +1091 -0
- package/atoms/Icon/helpers.js +9 -0
- package/atoms/Icon/index.js +3 -0
- package/atoms/Input/Input.js +229 -0
- package/atoms/Input/Input.module.css +83 -0
- package/atoms/Input/Input.stories.js +38 -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/Label/Label.js +31 -0
- package/atoms/Label/Label.module.css +42 -0
- package/atoms/Label/Label.stories.js +26 -0
- package/atoms/Label/constants.js +1 -0
- package/atoms/Label/index.js +3 -0
- package/atoms/LinkItem/LinkItem.js +38 -0
- package/atoms/LinkItem/LinkItem.module.css +19 -0
- package/atoms/LinkItem/LinkItem.stories.js +30 -0
- package/atoms/LinkItem/__snapshots__/Link.stories.js.snap +118 -0
- package/atoms/LinkItem/constants.js +5 -0
- package/atoms/LinkItem/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 +121 -0
- package/atoms/Modal/Modal.module.css +142 -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 +72 -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 +47 -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/Tab/Tab.js +41 -0
- package/atoms/Tab/Tab.module.css +17 -0
- package/atoms/Tab/Tab.stories.js +27 -0
- package/atoms/Tab/constants.js +1 -0
- package/atoms/Tab/index.js +3 -0
- package/atoms/Textarea/Textarea.js +137 -0
- package/atoms/Textarea/Textarea.module.css +54 -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/atoms/Toggle/Toggle.js +56 -0
- package/atoms/Toggle/Toggle.module.css +41 -0
- package/atoms/Toggle/Toggle.stories.js +21 -0
- package/atoms/Toggle/constants.js +1 -0
- package/atoms/Toggle/index.js +3 -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/useAddColumn.js +40 -0
- package/hook/useMedia.js +22 -0
- package/hook/useStateDate.js +25 -0
- package/hook/useTable.js +54 -0
- package/index.js +71 -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/DynamicTable/DynamicTable.js +372 -0
- package/layout/DynamicTable/DynamicTable.module.css +76 -0
- package/layout/DynamicTable/DynamicTable.stories.js +79 -0
- package/layout/DynamicTable/constants.js +323 -0
- package/layout/DynamicTable/index.js +3 -0
- package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
- package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
- package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
- package/layout/FlexColumnContent/constants.js +1 -0
- package/layout/FlexColumnContent/index.js +3 -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/Navbar/Navbar.js +247 -0
- package/layout/Navbar/Navbar.module.css +35 -0
- package/layout/Navbar/Navbar.stories.js +20 -0
- package/layout/Navbar/constants.js +35 -0
- package/layout/Navbar/index.js +2 -0
- package/layout/Sidebar/Sidebar.js +115 -0
- package/layout/Sidebar/Sidebar.module.css +387 -0
- package/layout/Sidebar/Sidebar.stories.js +28 -0
- package/layout/Sidebar/constants.js +228 -0
- package/layout/Sidebar/index.js +3 -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/CardDefault/CardDefault.js +65 -0
- package/molecules/CardDefault/CardDefault.module.css +19 -0
- package/molecules/CardDefault/CardDefault.stories.js +23 -0
- package/molecules/CardDefault/constants.js +1 -0
- package/molecules/CardDefault/index.js +3 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +89 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +118 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.stories.js +25 -0
- package/molecules/CardProductTypesBooking/constants.js +1 -0
- package/molecules/CardProductTypesBooking/index.js +3 -0
- package/molecules/CardServiceDetail/CardServiceDetail.js +400 -0
- package/molecules/CardServiceDetail/CardServiceDetail.module.css +222 -0
- package/molecules/CardServiceDetail/CardServiceDetail.stories.js +23 -0
- package/molecules/CardServiceDetail/constants.js +1 -0
- package/molecules/CardServiceDetail/index.js +3 -0
- package/molecules/CardServices/CardServices.js +461 -0
- package/molecules/CardServices/CardServices.module.css +213 -0
- package/molecules/CardServices/CardServices.stories.js +41 -0
- package/molecules/CardServices/constants.js +5 -0
- package/molecules/CardServices/index.js +3 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.js +381 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.module.css +213 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.stories.js +23 -0
- package/molecules/CardServicesFinalized/constants.js +1 -0
- package/molecules/CardServicesFinalized/index.js +3 -0
- package/molecules/CheckList/CheckList.js +135 -0
- package/molecules/CheckList/CheckList.module.css +94 -0
- package/molecules/CheckList/CheckList.stories.js +25 -0
- package/molecules/CheckList/constants.js +23 -0
- package/molecules/CheckList/index.js +3 -0
- package/molecules/ColumnTable/ColumnTable.js +154 -0
- package/molecules/ColumnTable/ColumnTable.module.css +51 -0
- package/molecules/ColumnTable/ColumnTable.stories.js +26 -0
- package/molecules/ColumnTable/constants.js +117 -0
- package/molecules/ColumnTable/index.js +3 -0
- package/molecules/DatePicker/DatePicker.js +242 -0
- package/molecules/DatePicker/DatePicker.module.css +38 -0
- package/molecules/DatePicker/DatePicker.stories.js +23 -0
- package/molecules/DatePicker/constants.js +3 -0
- package/molecules/DatePicker/index.js +3 -0
- package/molecules/DatePickerTime/DatePickerTime.js +133 -0
- package/molecules/DatePickerTime/DatePickerTime.module.css +3 -0
- package/molecules/DatePickerTime/DatePickerTime.stories.js +18 -0
- package/molecules/DatePickerTime/constants.js +1 -0
- package/molecules/DatePickerTime/index.js +3 -0
- package/molecules/Dropdown/Dropdown.js +62 -0
- package/molecules/Dropdown/Dropdown.module.css +52 -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/DynamicSelect/DynamicSelect.js +186 -0
- package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
- package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
- package/molecules/DynamicSelect/constants.js +7 -0
- package/molecules/DynamicSelect/index.js +3 -0
- package/molecules/Error/Error.js +35 -0
- package/molecules/Error/Error.module.css +12 -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/FooterTable/FooterTable.js +166 -0
- package/molecules/FooterTable/FooterTable.module.css +63 -0
- package/molecules/FooterTable/FooterTable.stories.js +23 -0
- package/molecules/FooterTable/constants.js +9 -0
- package/molecules/FooterTable/index.js +3 -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/InputAutocomplete/InputAutocomplete.js +221 -0
- package/molecules/InputAutocomplete/InputAutocomplete.module.css +55 -0
- package/molecules/InputAutocomplete/InputAutocomplete.stories.js +23 -0
- package/molecules/InputAutocomplete/constants.js +1 -0
- package/molecules/InputAutocomplete/index.js +3 -0
- package/molecules/ItemMenu/ItemMenu.js +134 -0
- package/molecules/ItemMenu/ItemMenu.module.css +363 -0
- package/molecules/ItemMenu/ItemMenu.stories.js +42 -0
- package/molecules/ItemMenu/constants.js +36 -0
- package/molecules/ItemMenu/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/RowTable/RowTable.js +928 -0
- package/molecules/RowTable/RowTable.module.css +63 -0
- package/molecules/RowTable/RowTable.stories.js +26 -0
- package/molecules/RowTable/constants.js +798 -0
- package/molecules/RowTable/index.js +3 -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/Tabs/Tabs.js +59 -0
- package/molecules/Tabs/Tabs.module.css +13 -0
- package/molecules/Tabs/Tabs.stories.js +34 -0
- package/molecules/Tabs/constants.js +34 -0
- package/molecules/Tabs/index.js +3 -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 +119 -0
- package/pages/Login/Login.js +102 -0
- package/pages/Login/Login.module.css +5 -0
- package/pages/Login/Login.stories.js +23 -0
- package/pages/Login/constants.js +1 -0
- package/pages/Login/index.js +3 -0
- package/pages/Login/validation/loginSchema.js +5 -0
- package/public/favicon.ico +0 -0
- package/public/static/google-maps.png +0 -0
- package/public/static/images/folders-folder.svg +26 -0
- package/public/static/images/permissions.svg +14 -0
- package/public/static/images/reports-results.svg +18 -0
- package/public/static/logo.svg +19 -0
- package/public/static/logologin.png +0 -0
- package/public/static/logologin.svg +16 -0
- package/public/static/logologintagos.svg +19 -0
- package/public/static/logotipo.svg +50 -0
- package/public/static/logotipoS.svg +26 -0
- package/public/static/taxisvalencia_logod.png +0 -0
- package/scripts/build-tokens.js +40 -0
- package/scripts/create-component.js +128 -0
- package/storybook.test.js +13 -0
- package/styles/GrupoMutua.css +391 -0
- package/styles/default.css +391 -0
- package/styles/globals.css +1524 -0
- package/styles/radiotaxiaragon.css +391 -0
- package/styles/spartan.css +391 -0
- package/styles/tagos.css +391 -0
- package/styles/taxisvalencia.css +391 -0
- package/styles/tokens.css +391 -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 +472 -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,46 @@
|
|
1
|
+
import { Heading, styles, options } from '.'
|
2
|
+
import {
|
3
|
+
getTemplate,
|
4
|
+
getListTemplate,
|
5
|
+
getOptionsArgTypes,
|
6
|
+
} from '../../helpers/storybook'
|
7
|
+
|
8
|
+
const Template = getTemplate(Heading, styles)
|
9
|
+
const ListTemplate = getListTemplate(Heading, styles)
|
10
|
+
|
11
|
+
export default {
|
12
|
+
title: 'Atoms/Heading',
|
13
|
+
component: Heading,
|
14
|
+
args: {
|
15
|
+
children: 'Lorem ipsum dolor sit amet, consectetur adipiscing.',
|
16
|
+
},
|
17
|
+
argTypes: {
|
18
|
+
color: getOptionsArgTypes(options.colors),
|
19
|
+
size: getOptionsArgTypes(options.sizes),
|
20
|
+
weight: getOptionsArgTypes(options.weights),
|
21
|
+
children: { control: 'text' },
|
22
|
+
},
|
23
|
+
}
|
24
|
+
|
25
|
+
export const Default = Template.bind({})
|
26
|
+
|
27
|
+
export const Inline = Template.bind({})
|
28
|
+
Inline.args = {
|
29
|
+
isInline: true,
|
30
|
+
}
|
31
|
+
|
32
|
+
export const Centered = Template.bind({})
|
33
|
+
Centered.args = {
|
34
|
+
isCentered: true,
|
35
|
+
children:
|
36
|
+
'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.',
|
37
|
+
}
|
38
|
+
|
39
|
+
export const Colors = ListTemplate.bind({})
|
40
|
+
Colors.args = { items: options.colors.map((color) => ({ color })) }
|
41
|
+
|
42
|
+
export const Sizes = ListTemplate.bind({})
|
43
|
+
Sizes.args = { items: options.sizes.map((size) => ({ size })) }
|
44
|
+
|
45
|
+
export const Weights = ListTemplate.bind({})
|
46
|
+
Weights.args = { items: options.weights.map((weight) => ({ weight })) }
|
@@ -0,0 +1,189 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`Storyshots Atoms/Heading Centered 1`] = `
|
4
|
+
<div
|
5
|
+
style={
|
6
|
+
Object {
|
7
|
+
"alignContent": "flex-start",
|
8
|
+
"display": "flex",
|
9
|
+
"flexDirection": "column",
|
10
|
+
"flexWrap": "wrap",
|
11
|
+
"gap": "10px 30px",
|
12
|
+
"height": "100%",
|
13
|
+
"justifyContent": "flex-start",
|
14
|
+
"maxHeight": "auto",
|
15
|
+
}
|
16
|
+
}
|
17
|
+
>
|
18
|
+
<h1
|
19
|
+
className="heading color-base size-md weight-bold is-centered"
|
20
|
+
>
|
21
|
+
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.
|
22
|
+
</h1>
|
23
|
+
</div>
|
24
|
+
`;
|
25
|
+
|
26
|
+
exports[`Storyshots Atoms/Heading Colors 1`] = `
|
27
|
+
<div
|
28
|
+
style={
|
29
|
+
Object {
|
30
|
+
"alignContent": "flex-start",
|
31
|
+
"display": "flex",
|
32
|
+
"flexDirection": "column",
|
33
|
+
"flexWrap": "wrap",
|
34
|
+
"gap": "10px 30px",
|
35
|
+
"height": "100%",
|
36
|
+
"justifyContent": "flex-start",
|
37
|
+
"maxHeight": "auto",
|
38
|
+
}
|
39
|
+
}
|
40
|
+
>
|
41
|
+
<h1
|
42
|
+
className="heading color-base size-md weight-bold"
|
43
|
+
>
|
44
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
45
|
+
</h1>
|
46
|
+
<h1
|
47
|
+
className="heading color-primary size-md weight-bold"
|
48
|
+
>
|
49
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
50
|
+
</h1>
|
51
|
+
<h1
|
52
|
+
className="heading color-tertiary size-md weight-bold"
|
53
|
+
>
|
54
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
55
|
+
</h1>
|
56
|
+
<h1
|
57
|
+
className="heading color-inverted size-md weight-bold"
|
58
|
+
>
|
59
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
60
|
+
</h1>
|
61
|
+
</div>
|
62
|
+
`;
|
63
|
+
|
64
|
+
exports[`Storyshots Atoms/Heading Default 1`] = `
|
65
|
+
<div
|
66
|
+
style={
|
67
|
+
Object {
|
68
|
+
"alignContent": "flex-start",
|
69
|
+
"display": "flex",
|
70
|
+
"flexDirection": "column",
|
71
|
+
"flexWrap": "wrap",
|
72
|
+
"gap": "10px 30px",
|
73
|
+
"height": "100%",
|
74
|
+
"justifyContent": "flex-start",
|
75
|
+
"maxHeight": "auto",
|
76
|
+
}
|
77
|
+
}
|
78
|
+
>
|
79
|
+
<h1
|
80
|
+
className="heading color-base size-md weight-bold"
|
81
|
+
>
|
82
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
83
|
+
</h1>
|
84
|
+
</div>
|
85
|
+
`;
|
86
|
+
|
87
|
+
exports[`Storyshots Atoms/Heading Inline 1`] = `
|
88
|
+
<div
|
89
|
+
style={
|
90
|
+
Object {
|
91
|
+
"alignContent": "flex-start",
|
92
|
+
"display": "flex",
|
93
|
+
"flexDirection": "column",
|
94
|
+
"flexWrap": "wrap",
|
95
|
+
"gap": "10px 30px",
|
96
|
+
"height": "100%",
|
97
|
+
"justifyContent": "flex-start",
|
98
|
+
"maxHeight": "auto",
|
99
|
+
}
|
100
|
+
}
|
101
|
+
>
|
102
|
+
<h1
|
103
|
+
className="heading color-base size-md weight-bold is-inline"
|
104
|
+
>
|
105
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
106
|
+
</h1>
|
107
|
+
</div>
|
108
|
+
`;
|
109
|
+
|
110
|
+
exports[`Storyshots Atoms/Heading Sizes 1`] = `
|
111
|
+
<div
|
112
|
+
style={
|
113
|
+
Object {
|
114
|
+
"alignContent": "flex-start",
|
115
|
+
"display": "flex",
|
116
|
+
"flexDirection": "column",
|
117
|
+
"flexWrap": "wrap",
|
118
|
+
"gap": "10px 30px",
|
119
|
+
"height": "100%",
|
120
|
+
"justifyContent": "flex-start",
|
121
|
+
"maxHeight": "auto",
|
122
|
+
}
|
123
|
+
}
|
124
|
+
>
|
125
|
+
<h1
|
126
|
+
className="heading color-base size-xs weight-bold"
|
127
|
+
>
|
128
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
129
|
+
</h1>
|
130
|
+
<h1
|
131
|
+
className="heading color-base size-sm weight-bold"
|
132
|
+
>
|
133
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
134
|
+
</h1>
|
135
|
+
<h1
|
136
|
+
className="heading color-base size-md weight-bold"
|
137
|
+
>
|
138
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
139
|
+
</h1>
|
140
|
+
<h1
|
141
|
+
className="heading color-base size-lg weight-bold"
|
142
|
+
>
|
143
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
144
|
+
</h1>
|
145
|
+
<h1
|
146
|
+
className="heading color-base size-xl weight-bold"
|
147
|
+
>
|
148
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
149
|
+
</h1>
|
150
|
+
<h1
|
151
|
+
className="heading color-base size-2xl weight-bold"
|
152
|
+
>
|
153
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
154
|
+
</h1>
|
155
|
+
</div>
|
156
|
+
`;
|
157
|
+
|
158
|
+
exports[`Storyshots Atoms/Heading Weights 1`] = `
|
159
|
+
<div
|
160
|
+
style={
|
161
|
+
Object {
|
162
|
+
"alignContent": "flex-start",
|
163
|
+
"display": "flex",
|
164
|
+
"flexDirection": "column",
|
165
|
+
"flexWrap": "wrap",
|
166
|
+
"gap": "10px 30px",
|
167
|
+
"height": "100%",
|
168
|
+
"justifyContent": "flex-start",
|
169
|
+
"maxHeight": "auto",
|
170
|
+
}
|
171
|
+
}
|
172
|
+
>
|
173
|
+
<h1
|
174
|
+
className="heading color-base size-md weight-light"
|
175
|
+
>
|
176
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
177
|
+
</h1>
|
178
|
+
<h1
|
179
|
+
className="heading color-base size-md weight-normal"
|
180
|
+
>
|
181
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
182
|
+
</h1>
|
183
|
+
<h1
|
184
|
+
className="heading color-base size-md weight-bold"
|
185
|
+
>
|
186
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing.
|
187
|
+
</h1>
|
188
|
+
</div>
|
189
|
+
`;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
import { mapSize } from './helpers'
|
4
|
+
|
5
|
+
import styles from './Icon.module.css'
|
6
|
+
import { options, iconsMap } from './constants'
|
7
|
+
import withStyles from '../../hocs/withStyles'
|
8
|
+
|
9
|
+
const handleClick = ({ onClick }) => (event) => {
|
10
|
+
onClick(event)
|
11
|
+
}
|
12
|
+
|
13
|
+
export const Icon = ({
|
14
|
+
id,
|
15
|
+
className,
|
16
|
+
onClick,
|
17
|
+
name,
|
18
|
+
size,
|
19
|
+
isClickable,
|
20
|
+
getStyles,
|
21
|
+
}) => {
|
22
|
+
const icon = iconsMap[name]
|
23
|
+
const mappedSize = mapSize(size)
|
24
|
+
|
25
|
+
return (
|
26
|
+
<div
|
27
|
+
id={id}
|
28
|
+
className={getStyles(className, 'icon', ['color', 'size', 'background'], {
|
29
|
+
'is-clickable': isClickable || !!onClick,
|
30
|
+
})}
|
31
|
+
style={{ width: mappedSize, height: mappedSize }}
|
32
|
+
onClick={onClick && handleClick({ onClick })}
|
33
|
+
>
|
34
|
+
<svg
|
35
|
+
viewBox={icon.viewBox}
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
37
|
+
width={mappedSize}
|
38
|
+
height={mappedSize}
|
39
|
+
>
|
40
|
+
{icon.svg}
|
41
|
+
</svg>
|
42
|
+
</div>
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
Icon.propTypes = {
|
47
|
+
name: PropTypes.oneOf(options.names).isRequired,
|
48
|
+
getStyles: PropTypes.func.isRequired,
|
49
|
+
onClick: PropTypes.func,
|
50
|
+
size: PropTypes.oneOf(options.sizes),
|
51
|
+
color: PropTypes.oneOf(options.colors),
|
52
|
+
background: PropTypes.oneOf(options.backgrounds),
|
53
|
+
id: PropTypes.string,
|
54
|
+
className: PropTypes.string,
|
55
|
+
isClickable: PropTypes.bool,
|
56
|
+
}
|
57
|
+
|
58
|
+
Icon.defaultProps = {
|
59
|
+
size: 'md',
|
60
|
+
color: 'base',
|
61
|
+
background: 'transparent',
|
62
|
+
isClickable: false,
|
63
|
+
getStyles: () => { },
|
64
|
+
}
|
65
|
+
|
66
|
+
export default withStyles(styles)(Icon)
|
@@ -0,0 +1,142 @@
|
|
1
|
+
.icon {
|
2
|
+
display: inline-flex;
|
3
|
+
align-items: center;
|
4
|
+
justify-content: center;
|
5
|
+
user-select: none;
|
6
|
+
}
|
7
|
+
|
8
|
+
.size-sm {
|
9
|
+
padding: 5px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.size-md {
|
13
|
+
padding: 8px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.size-lg {
|
17
|
+
padding: 12px;
|
18
|
+
}
|
19
|
+
|
20
|
+
.size-xl {
|
21
|
+
padding: 15px;
|
22
|
+
}
|
23
|
+
|
24
|
+
.color-success path,
|
25
|
+
.color-success circle {
|
26
|
+
fill: var(--color-tertiary-muted);
|
27
|
+
}
|
28
|
+
|
29
|
+
.color-success line,
|
30
|
+
.color-success rect {
|
31
|
+
stroke: var(--color-tertiary-muted);
|
32
|
+
}
|
33
|
+
|
34
|
+
.color-error path,
|
35
|
+
.color-error circle {
|
36
|
+
fill: var(--color-secondary-muted);
|
37
|
+
}
|
38
|
+
|
39
|
+
.color-error line,
|
40
|
+
.color-error rect {
|
41
|
+
stroke: var(--color-secondary-muted);
|
42
|
+
}
|
43
|
+
|
44
|
+
.color-base path,
|
45
|
+
.color-base circle {
|
46
|
+
fill: var(--color-font-base);
|
47
|
+
}
|
48
|
+
|
49
|
+
.color-base line,
|
50
|
+
.color-base rect {
|
51
|
+
stroke: var(--color-font-base);
|
52
|
+
}
|
53
|
+
|
54
|
+
.color-highlight path,
|
55
|
+
.color-highlight circle {
|
56
|
+
fill: var(--color-font-highlight);
|
57
|
+
}
|
58
|
+
|
59
|
+
.color-highlight line,
|
60
|
+
.color-highlight rect {
|
61
|
+
stroke: var(--color-font-highlight);
|
62
|
+
}
|
63
|
+
|
64
|
+
.color-muted path,
|
65
|
+
.color-muted circle {
|
66
|
+
fill: var(--color-font-muted);
|
67
|
+
}
|
68
|
+
|
69
|
+
.color-muted line,
|
70
|
+
.color-muted rect {
|
71
|
+
stroke: var(--color-font-muted);
|
72
|
+
}
|
73
|
+
|
74
|
+
.color-primary path,
|
75
|
+
.color-primary circle {
|
76
|
+
fill: var(--color-primary);
|
77
|
+
}
|
78
|
+
|
79
|
+
.color-primary line,
|
80
|
+
.color-primary rect {
|
81
|
+
stroke: var(--color-primary);
|
82
|
+
}
|
83
|
+
|
84
|
+
.color-inverted path,
|
85
|
+
.color-inverted circle {
|
86
|
+
fill: var(--color-primary-inverted);
|
87
|
+
}
|
88
|
+
|
89
|
+
.color-inverted line,
|
90
|
+
.color-inverted rect {
|
91
|
+
stroke: var(--color-primary-inverted);
|
92
|
+
}
|
93
|
+
|
94
|
+
.icon rect:global(.transparent) {
|
95
|
+
fill: var(--color-base-transparent) !important;
|
96
|
+
}
|
97
|
+
|
98
|
+
.background-success {
|
99
|
+
background: var(--color-tertiary-muted);
|
100
|
+
border-radius: var(--border-radius-full);
|
101
|
+
}
|
102
|
+
|
103
|
+
.background-error {
|
104
|
+
background: var(--color-secondary-muted);
|
105
|
+
border-radius: var(--border-radius-full);
|
106
|
+
}
|
107
|
+
|
108
|
+
.background-base {
|
109
|
+
background: var(--color-gray-100);
|
110
|
+
border-radius: var(--border-radius-full);
|
111
|
+
}
|
112
|
+
|
113
|
+
.background-transparent {
|
114
|
+
background: var(--color-base-transparent);
|
115
|
+
}
|
116
|
+
|
117
|
+
.background-highlight {
|
118
|
+
background: var(--color-primary-highlight);
|
119
|
+
border-radius: var(--border-radius-full);
|
120
|
+
}
|
121
|
+
|
122
|
+
.background-muted {
|
123
|
+
background: var(--color-primary-muted);
|
124
|
+
border-radius: var(--border-radius-full);
|
125
|
+
}
|
126
|
+
|
127
|
+
.background-inverted {
|
128
|
+
border: var(--picture-border);
|
129
|
+
background: var(--color-font-inverted);
|
130
|
+
border-radius: var(--border-radius-full);
|
131
|
+
box-shadow: var(--box-shadow-sm);
|
132
|
+
}
|
133
|
+
|
134
|
+
.background-spotlight {
|
135
|
+
background: var(--color-yellow-100);
|
136
|
+
border-radius: var(--border-radius-full);
|
137
|
+
box-shadow: var(--box-shadow-sm);
|
138
|
+
}
|
139
|
+
|
140
|
+
.is-clickable {
|
141
|
+
cursor: pointer;
|
142
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { Icon, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(Icon, styles)
|
10
|
+
const ListTemplate = getListTemplate(Icon, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Atoms/Icon',
|
14
|
+
component: Icon,
|
15
|
+
args: {
|
16
|
+
name: 'arrowRight',
|
17
|
+
},
|
18
|
+
argTypes: {
|
19
|
+
color: getOptionsArgTypes(options.colors),
|
20
|
+
size: getOptionsArgTypes(options.sizes),
|
21
|
+
name: getOptionsArgTypes(options.names),
|
22
|
+
background: getOptionsArgTypes(options.backgrounds),
|
23
|
+
},
|
24
|
+
parameters: { __sb: { fd: 'row' } },
|
25
|
+
}
|
26
|
+
|
27
|
+
export const Default = Template.bind({})
|
28
|
+
|
29
|
+
export const Clickable = Template.bind({})
|
30
|
+
Clickable.args = { isClickable: true }
|
31
|
+
|
32
|
+
export const Names = ListTemplate.bind({})
|
33
|
+
Names.args = {
|
34
|
+
items: options.names.map((name) => ({ name })),
|
35
|
+
}
|
36
|
+
|
37
|
+
export const Sizes = ListTemplate.bind({})
|
38
|
+
Sizes.args = { items: options.sizes.map((size) => ({ size })) }
|
39
|
+
|
40
|
+
export const Colors = ListTemplate.bind({})
|
41
|
+
Colors.args = {
|
42
|
+
items: options.colors.map((color) => ({ color })),
|
43
|
+
}
|
44
|
+
|
45
|
+
export const Backgrounds = ListTemplate.bind({})
|
46
|
+
Backgrounds.args = {
|
47
|
+
items: options.backgrounds.map((background) => ({ background })),
|
48
|
+
}
|