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
package/.babelrc.json
ADDED
package/.dockerignore
ADDED
package/.editorconfig
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# https://github.com/airbnb/javascript/blob/master/.editorconfig
|
2
|
+
root = true
|
3
|
+
|
4
|
+
[*]
|
5
|
+
indent_style = space
|
6
|
+
indent_size = 2
|
7
|
+
charset = utf-8
|
8
|
+
trim_trailing_whitespace = true
|
9
|
+
insert_final_newline = true
|
10
|
+
end_of_line = lf
|
11
|
+
|
12
|
+
[CHANGELOG.md]
|
13
|
+
indent_size = false
|
package/.eslintignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
package/.eslintrc.json
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"env": {
|
3
|
+
"browser": true,
|
4
|
+
"commonjs": true,
|
5
|
+
"es6": true,
|
6
|
+
"jest": true,
|
7
|
+
"node": true
|
8
|
+
},
|
9
|
+
"extends": [
|
10
|
+
"eslint:recommended",
|
11
|
+
"plugin:react/recommended",
|
12
|
+
"plugin:prettier/recommended",
|
13
|
+
"plugin:storybook/recommended"
|
14
|
+
],
|
15
|
+
"globals": {
|
16
|
+
"Atomics": "readonly",
|
17
|
+
"SharedArrayBuffer": "readonly"
|
18
|
+
},
|
19
|
+
"parserOptions": {
|
20
|
+
"ecmaVersion": 2020,
|
21
|
+
"sourceType": "module",
|
22
|
+
"ecmaFeatures": {
|
23
|
+
"jsx": true
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"plugins": ["react"],
|
27
|
+
"settings": {
|
28
|
+
"react": {
|
29
|
+
"version": "detect"
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"rules": {
|
33
|
+
"react/react-in-jsx-scope": "off",
|
34
|
+
"react/forbid-prop-types": "warn"
|
35
|
+
}
|
36
|
+
}
|
package/.huskyrc.json
ADDED
package/.nvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
v15
|
package/.prettierignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
package/.prettierrc.json
ADDED
package/.releaserc.json
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"release": {
|
3
|
+
"branches": ["master", "next"]
|
4
|
+
},
|
5
|
+
"plugins": [
|
6
|
+
"@semantic-release/commit-analyzer",
|
7
|
+
"@semantic-release/release-notes-generator",
|
8
|
+
"@semantic-release/changelog",
|
9
|
+
"@semantic-release/npm",
|
10
|
+
"@semantic-release/github",
|
11
|
+
"@semantic-release/git"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
const loadConfigs = require('../webpack/loadConfigs')
|
2
|
+
const cssModules = require('../webpack/cssModules')
|
3
|
+
const reactInlineSvg = require('../webpack/reactInlineSvg')
|
4
|
+
|
5
|
+
module.exports = {
|
6
|
+
stories: ['../{tokens,atoms,molecules,layout,pages}/**/*.stories.@(js|mdx)'],
|
7
|
+
addons: ['@storybook/addon-links', '@storybook/addon-essentials', 'storybook-addon-theme-changer'],
|
8
|
+
staticDirs: ['../public'],
|
9
|
+
webpackFinal: loadConfigs([cssModules, reactInlineSvg]),
|
10
|
+
features: {
|
11
|
+
postcss: false,
|
12
|
+
},
|
13
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import 'minireset.css'
|
4
|
+
import '../styles/globals.css'
|
5
|
+
import '../styles/tokens.css'
|
6
|
+
import '../styles/GrupoMutua.css'
|
7
|
+
import '../styles/taxisvalencia.css'
|
8
|
+
import '../styles/radiotaxiaragon.css'
|
9
|
+
import '../styles/spartan.css'
|
10
|
+
import '../styles/default.css'
|
11
|
+
import '../styles/tagos.css'
|
12
|
+
|
13
|
+
|
14
|
+
const getStyles = ({ __sb } = {}) => ({
|
15
|
+
display: 'flex',
|
16
|
+
flexDirection: __sb?.fd || 'column',
|
17
|
+
maxHeight: __sb?.mh || 'auto',
|
18
|
+
justifyContent: 'flex-start',
|
19
|
+
alignContent: 'flex-start',
|
20
|
+
flexWrap: 'wrap',
|
21
|
+
height: '100%',
|
22
|
+
gap: '10px 30px',
|
23
|
+
})
|
24
|
+
|
25
|
+
export const decorators = [
|
26
|
+
(Story, { parameters }) => (
|
27
|
+
<div style={getStyles(parameters)}>
|
28
|
+
<Story />
|
29
|
+
</div>
|
30
|
+
),
|
31
|
+
]
|
32
|
+
|
33
|
+
export const parameters = {
|
34
|
+
argTypes: {
|
35
|
+
styles: { table: { disable: true } },
|
36
|
+
getStyles: { table: { disable: true } },
|
37
|
+
},
|
38
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
39
|
+
}
|
40
|
+
|
41
|
+
export const globalTypes = {
|
42
|
+
themes: {
|
43
|
+
defaultValue: [
|
44
|
+
"Imbric",
|
45
|
+
"Default",
|
46
|
+
"GrupoMutua",
|
47
|
+
"Taxisvalencia",
|
48
|
+
"Radiotaxiaragon",
|
49
|
+
"Spartan",
|
50
|
+
"Tagos",
|
51
|
+
],
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
// Use IntelliSense para saber los atributos posibles.
|
3
|
+
// Mantenga el puntero para ver las descripciones de los existentes atributos.
|
4
|
+
// Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
+
"version": "0.2.0",
|
6
|
+
"configurations": [
|
7
|
+
{
|
8
|
+
"type": "pwa-chrome",
|
9
|
+
"request": "launch",
|
10
|
+
"name": "Launch Chrome against localhost",
|
11
|
+
"url": "http://localhost:6006",
|
12
|
+
"webRoot": "${workspaceFolder}"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
package/CHANGELOG.md
ADDED
File without changes
|
package/Dockerfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
FROM node:18-alpine
|
2
|
+
|
3
|
+
## set environment stage
|
4
|
+
ENV PATH /app/node_modules/.bin:$PATH
|
5
|
+
ENV NODE_OPTIONS --openssl-legacy-provider
|
6
|
+
WORKDIR /app
|
7
|
+
COPY . /app/
|
8
|
+
|
9
|
+
## build app stage
|
10
|
+
RUN yarn install --network-timeout 200000 \
|
11
|
+
&& yarn build
|
12
|
+
|
13
|
+
## final image stage
|
14
|
+
FROM nginx:alpine
|
15
|
+
COPY --from=0 /app/storybook-static/ /usr/share/nginx/html/
|
16
|
+
|
17
|
+
EXPOSE 80
|
package/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
## Table of Contents
|
2
|
+
|
3
|
+
- [Getting Started](#Getting-Started)
|
4
|
+
- [Storybook](#Storybook)
|
5
|
+
- [Running the project locally](#Running-the-project-locally)
|
6
|
+
- [Running the tests](#Running-the-tests)
|
7
|
+
- [Methodologies](#Methodologies)
|
8
|
+
- [Atomic Design](#Atomic-Design)
|
9
|
+
- [Molecules definition](#Molecules-definition)
|
10
|
+
|
11
|
+
## Getting Started
|
12
|
+
|
13
|
+
> You must have `react, react-dom and classnames installed` thiose are peer dependencies of this project.
|
14
|
+
|
15
|
+
#### 1. Installation
|
16
|
+
|
17
|
+
_Using NPM_
|
18
|
+
```bash
|
19
|
+
npm install imbric-theme
|
20
|
+
```
|
21
|
+
_Using Yarn_
|
22
|
+
```bash
|
23
|
+
yarn add imbric-theme
|
24
|
+
```
|
25
|
+
|
26
|
+
#### 2. Using the library
|
27
|
+
|
28
|
+
- Import component
|
29
|
+
|
30
|
+
```jsx
|
31
|
+
import { Icon, ButtonIcon } from '....'
|
32
|
+
```
|
33
|
+
|
34
|
+
- Use component
|
35
|
+
|
36
|
+
```js
|
37
|
+
<ButtonIcon icon="arrowRight" type="primary">
|
38
|
+
Cowards Agreed
|
39
|
+
</ButtonIcon>
|
40
|
+
```
|
41
|
+
## Storybook
|
42
|
+
Check the rest of the available components in our [Storybook](....)
|
43
|
+
|
44
|
+
## Running the project locally
|
45
|
+
|
46
|
+
Follow these steps to `start the project` in development
|
47
|
+
|
48
|
+
1. Clone repository. `git clone git@bitbucket.org:jorgemuriel/imbric-storybook.git`
|
49
|
+
2. Install dependencies in the project folder running `yarn` or `npm install`
|
50
|
+
3. Run Storybook with `yarn dev` or `npm run dev`, this command will build the tokens and open Storybook.
|
51
|
+
|
52
|
+
## Running the tests
|
53
|
+
|
54
|
+
1. Run `yarn run test`or `npm run test`
|
55
|
+
2. To keep the tests running, run `yarn run test:watch`
|
56
|
+
|
57
|
+
## Methodologies
|
58
|
+
|
59
|
+
### Atomic Design
|
60
|
+
|
61
|
+
For this project will be using the methodology to create componentes called [Atomic Design](https://shop.bradfrost.com/products/atomic-design-ebook). The component library will be creating just **Atoms** and **Molecules** with the following definitions:
|
62
|
+
|
63
|
+
#### Atoms definition
|
64
|
+
|
65
|
+
For this project an atom will be a component that is composed by an unique Atom with or without HTML tags, or just HTML tags.
|
66
|
+
|
67
|
+
#### Molecules definition
|
68
|
+
|
69
|
+
For this project a molecule is a component that is composed by at least 2 different atoms.
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './AlertModal.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
import withReactContent from 'sweetalert2-react-content'
|
8
|
+
import Swal from 'sweetalert2'
|
9
|
+
|
10
|
+
export const AlertModal = ({
|
11
|
+
children,
|
12
|
+
getStyles,
|
13
|
+
titleAlert,
|
14
|
+
subTitleAlert,
|
15
|
+
iconAlert,
|
16
|
+
txtBtnAlert,
|
17
|
+
txtBtnAlertCancel,
|
18
|
+
showCancelButton,
|
19
|
+
onConfirm,
|
20
|
+
onDismiss,
|
21
|
+
}) => {
|
22
|
+
|
23
|
+
const MySwal = withReactContent(Swal)
|
24
|
+
|
25
|
+
MySwal.fire({
|
26
|
+
title: titleAlert,
|
27
|
+
icon: iconAlert,
|
28
|
+
html: subTitleAlert,
|
29
|
+
confirmButtonText: txtBtnAlert,
|
30
|
+
cancelButtonText: txtBtnAlertCancel,
|
31
|
+
showCancelButton: showCancelButton,
|
32
|
+
}).then((result) => {
|
33
|
+
if (result.isConfirmed || (result.isDismissed && !onDismiss)) {
|
34
|
+
onConfirm()
|
35
|
+
} else if (result.isDismissed) {
|
36
|
+
onDismiss()
|
37
|
+
}
|
38
|
+
})
|
39
|
+
|
40
|
+
|
41
|
+
return <div className={getStyles('alert-modal')}>{children}</div>
|
42
|
+
}
|
43
|
+
|
44
|
+
AlertModal.propTypes = {
|
45
|
+
children: PropTypes.node,
|
46
|
+
getStyles: PropTypes.func.isRequired,
|
47
|
+
titleAlert: PropTypes.string.isRequired,
|
48
|
+
subTitleAlert: PropTypes.string.isRequired,
|
49
|
+
txtBtnAlert: PropTypes.string.isRequired,
|
50
|
+
txtBtnAlertCancel: PropTypes.string,
|
51
|
+
iconAlert: PropTypes.oneOf(options.icon),
|
52
|
+
onConfirm: PropTypes.func,
|
53
|
+
onDismiss: PropTypes.func,
|
54
|
+
showCancelButton: PropTypes.bool,
|
55
|
+
}
|
56
|
+
|
57
|
+
AlertModal.defaultProps = {
|
58
|
+
getStyles: () => { },
|
59
|
+
onConfirm: () => { },
|
60
|
+
// onDismiss: () => {}, // Not default for use onConfirm if is undefined
|
61
|
+
titleAlert: 'Felicidades!',
|
62
|
+
subTitleAlert: 'Todo ha ido correctamente',
|
63
|
+
txtBtnAlert: 'Ok',
|
64
|
+
txtBtnAlertCancel: 'Cancelar',
|
65
|
+
iconAlert: 'success',
|
66
|
+
showCancelButton: false,
|
67
|
+
}
|
68
|
+
|
69
|
+
export default withStyles(styles)(AlertModal)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { AlertModal, styles, options } from '.'
|
2
|
+
options
|
3
|
+
|
4
|
+
import {
|
5
|
+
getTemplate,
|
6
|
+
getListTemplate,
|
7
|
+
getOptionsArgTypes,
|
8
|
+
} from '../../helpers/storybook'
|
9
|
+
|
10
|
+
const Template = getTemplate(AlertModal, styles)
|
11
|
+
const ListTemplate = getListTemplate(AlertModal, styles)
|
12
|
+
|
13
|
+
export default {
|
14
|
+
title: 'Atoms/AlertModal',
|
15
|
+
component: AlertModal,
|
16
|
+
args: {
|
17
|
+
titleAlert: 'Felicidades!',
|
18
|
+
subTitleAlert: 'Ejemplo de subtitulo',
|
19
|
+
txtBtnAlert: 'Aceptar',
|
20
|
+
// resultIsConfirmed: true,
|
21
|
+
// resultIsDenied: '',
|
22
|
+
},
|
23
|
+
argTypes: {
|
24
|
+
iconAlert: getOptionsArgTypes(options.icon),
|
25
|
+
},
|
26
|
+
}
|
27
|
+
|
28
|
+
export const Default = Template.bind({})
|
29
|
+
// export const List = ListTemplate.bind({})
|
30
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import Picture from '../Picture'
|
5
|
+
|
6
|
+
import styles from './Avatar.module.css'
|
7
|
+
import { options } from './constants'
|
8
|
+
import { mapSize } from './helpers'
|
9
|
+
import withStyles from '../../hocs/withStyles'
|
10
|
+
|
11
|
+
export const Avatar = ({ src, size, getStyles }) => {
|
12
|
+
return (
|
13
|
+
<div className={getStyles('avatar')}>
|
14
|
+
<Picture
|
15
|
+
src={src}
|
16
|
+
width={mapSize(size)}
|
17
|
+
height={mapSize(size)}
|
18
|
+
isRounded
|
19
|
+
withBorder
|
20
|
+
/>
|
21
|
+
</div>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
Avatar.propTypes = {
|
26
|
+
src: PropTypes.string.isRequired,
|
27
|
+
getStyles: PropTypes.func.isRequired,
|
28
|
+
size: PropTypes.oneOf(options.sizes),
|
29
|
+
}
|
30
|
+
|
31
|
+
Avatar.defaultProps = {
|
32
|
+
size: 'md',
|
33
|
+
getStyles: () => {},
|
34
|
+
}
|
35
|
+
|
36
|
+
export default withStyles(styles)(Avatar)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Avatar, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(Avatar, styles)
|
10
|
+
const ListTemplate = getListTemplate(Avatar, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Atoms/Avatar',
|
14
|
+
component: Avatar,
|
15
|
+
args: {
|
16
|
+
src: 'https://picsum.photos/id/1027/200/200',
|
17
|
+
},
|
18
|
+
argTypes: {
|
19
|
+
size: getOptionsArgTypes(options.sizes),
|
20
|
+
},
|
21
|
+
parameters: { __sb: { fd: 'row' } },
|
22
|
+
}
|
23
|
+
|
24
|
+
export const Default = Template.bind({})
|
25
|
+
|
26
|
+
export const Sizes = ListTemplate.bind({})
|
27
|
+
Sizes.args = {
|
28
|
+
items: options.sizes.map((size) => ({ size })),
|
29
|
+
}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`Storyshots Atoms/Avatar Default 1`] = `
|
4
|
+
<div
|
5
|
+
style={
|
6
|
+
Object {
|
7
|
+
"alignContent": "flex-start",
|
8
|
+
"display": "flex",
|
9
|
+
"flexDirection": "row",
|
10
|
+
"flexWrap": "wrap",
|
11
|
+
"gap": "10px 30px",
|
12
|
+
"height": "100%",
|
13
|
+
"justifyContent": "flex-start",
|
14
|
+
"maxHeight": "auto",
|
15
|
+
}
|
16
|
+
}
|
17
|
+
>
|
18
|
+
<div
|
19
|
+
className="avatar"
|
20
|
+
>
|
21
|
+
<picture
|
22
|
+
className="picture is-rounded with-border"
|
23
|
+
>
|
24
|
+
<img
|
25
|
+
src="https://picsum.photos/id/1027/200/200"
|
26
|
+
style={
|
27
|
+
Object {
|
28
|
+
"height": 44,
|
29
|
+
"maxWidth": 44,
|
30
|
+
}
|
31
|
+
}
|
32
|
+
/>
|
33
|
+
</picture>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
`;
|
37
|
+
|
38
|
+
exports[`Storyshots Atoms/Avatar Sizes 1`] = `
|
39
|
+
<div
|
40
|
+
style={
|
41
|
+
Object {
|
42
|
+
"alignContent": "flex-start",
|
43
|
+
"display": "flex",
|
44
|
+
"flexDirection": "row",
|
45
|
+
"flexWrap": "wrap",
|
46
|
+
"gap": "10px 30px",
|
47
|
+
"height": "100%",
|
48
|
+
"justifyContent": "flex-start",
|
49
|
+
"maxHeight": "auto",
|
50
|
+
}
|
51
|
+
}
|
52
|
+
>
|
53
|
+
<div
|
54
|
+
className="avatar"
|
55
|
+
>
|
56
|
+
<picture
|
57
|
+
className="picture is-rounded with-border"
|
58
|
+
>
|
59
|
+
<img
|
60
|
+
src="https://picsum.photos/id/1027/200/200"
|
61
|
+
style={
|
62
|
+
Object {
|
63
|
+
"height": 22,
|
64
|
+
"maxWidth": 22,
|
65
|
+
}
|
66
|
+
}
|
67
|
+
/>
|
68
|
+
</picture>
|
69
|
+
</div>
|
70
|
+
<div
|
71
|
+
className="avatar"
|
72
|
+
>
|
73
|
+
<picture
|
74
|
+
className="picture is-rounded with-border"
|
75
|
+
>
|
76
|
+
<img
|
77
|
+
src="https://picsum.photos/id/1027/200/200"
|
78
|
+
style={
|
79
|
+
Object {
|
80
|
+
"height": 44,
|
81
|
+
"maxWidth": 44,
|
82
|
+
}
|
83
|
+
}
|
84
|
+
/>
|
85
|
+
</picture>
|
86
|
+
</div>
|
87
|
+
<div
|
88
|
+
className="avatar"
|
89
|
+
>
|
90
|
+
<picture
|
91
|
+
className="picture is-rounded with-border"
|
92
|
+
>
|
93
|
+
<img
|
94
|
+
src="https://picsum.photos/id/1027/200/200"
|
95
|
+
style={
|
96
|
+
Object {
|
97
|
+
"height": 66,
|
98
|
+
"maxWidth": 66,
|
99
|
+
}
|
100
|
+
}
|
101
|
+
/>
|
102
|
+
</picture>
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
`;
|