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,247 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
import styles from './Navbar.module.css'
|
4
|
+
import withStyles from '../../hocs/withStyles'
|
5
|
+
import { useRouter } from "next/router";
|
6
|
+
import ReactTooltip from 'react-tooltip'
|
7
|
+
|
8
|
+
import Heading from '../../atoms/Heading/Heading'
|
9
|
+
import Tabs from '../../molecules/Tabs/Tabs'
|
10
|
+
import Icon from '../../atoms/Icon'
|
11
|
+
|
12
|
+
export const Navbar = ({
|
13
|
+
getStyles,
|
14
|
+
viewTabsNav,
|
15
|
+
viewOptionsNav,
|
16
|
+
isViewLegal,
|
17
|
+
isViewInfo,
|
18
|
+
isViewProfile,
|
19
|
+
isViewLogout,
|
20
|
+
children,
|
21
|
+
linkLogout,
|
22
|
+
linkLegal,
|
23
|
+
linkInfo,
|
24
|
+
linkProfile,
|
25
|
+
txtTootipLegal,
|
26
|
+
txtTootipInfo,
|
27
|
+
txtTootipProfile,
|
28
|
+
languageSwitchLink,
|
29
|
+
|
30
|
+
}) => {
|
31
|
+
|
32
|
+
const router = useRouter();
|
33
|
+
|
34
|
+
// STATE TOOLTIP
|
35
|
+
const [isToolTipMounted, setIsToolTipMounted] = useState(false)
|
36
|
+
|
37
|
+
// TOOLTIP
|
38
|
+
const handleMouseEnter = () => {
|
39
|
+
setIsToolTipMounted(true)
|
40
|
+
}
|
41
|
+
const handleMouseLeave = () => {
|
42
|
+
setIsToolTipMounted(false)
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
const handleClick = (e, path) => {
|
47
|
+
|
48
|
+
console.log("I clicked on the About Page" + path);
|
49
|
+
|
50
|
+
router.push({
|
51
|
+
pathname: path,
|
52
|
+
})
|
53
|
+
|
54
|
+
|
55
|
+
};
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
return (
|
61
|
+
<>
|
62
|
+
<header className={getStyles('navbar')}>
|
63
|
+
|
64
|
+
<Heading
|
65
|
+
color="base"
|
66
|
+
size="xs"
|
67
|
+
weight="light"
|
68
|
+
>
|
69
|
+
{children}
|
70
|
+
</Heading>
|
71
|
+
|
72
|
+
<Tabs
|
73
|
+
options={[
|
74
|
+
{
|
75
|
+
href: '/taxi',
|
76
|
+
text: 'Taxi',
|
77
|
+
view: true
|
78
|
+
},
|
79
|
+
{
|
80
|
+
href: '/parking',
|
81
|
+
text: 'Parking',
|
82
|
+
view: true
|
83
|
+
},
|
84
|
+
{
|
85
|
+
href: '/sharing',
|
86
|
+
text: 'Sharing',
|
87
|
+
view: true
|
88
|
+
},
|
89
|
+
{
|
90
|
+
href: '/sharing',
|
91
|
+
text: 'T. Publico',
|
92
|
+
view: true
|
93
|
+
},
|
94
|
+
{
|
95
|
+
href: '/sharing',
|
96
|
+
text: 'Hoja de Km',
|
97
|
+
view: true
|
98
|
+
}
|
99
|
+
]}
|
100
|
+
viewTabs={viewTabsNav}
|
101
|
+
/>
|
102
|
+
|
103
|
+
|
104
|
+
{viewOptionsNav ? (
|
105
|
+
<div className={getStyles('navbar__actions')}>
|
106
|
+
|
107
|
+
{isViewLegal ? (
|
108
|
+
<>
|
109
|
+
<span
|
110
|
+
data-tip
|
111
|
+
data-for='legal'
|
112
|
+
onMouseEnter={handleMouseEnter}
|
113
|
+
onMouseLeave={handleMouseLeave}
|
114
|
+
>
|
115
|
+
<Icon
|
116
|
+
size='lg'
|
117
|
+
name='legal'
|
118
|
+
color='highlight'
|
119
|
+
background='transparent'
|
120
|
+
onClick={linkLegal}
|
121
|
+
id='idIconLegalNavbar'
|
122
|
+
/>
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
{isToolTipMounted ? (
|
127
|
+
<ReactTooltip id='legal' type='error'>
|
128
|
+
<span>{txtTootipLegal}</span>
|
129
|
+
</ReactTooltip>
|
130
|
+
) : null}
|
131
|
+
</>
|
132
|
+
) : null}
|
133
|
+
|
134
|
+
{isViewInfo ? (
|
135
|
+
<>
|
136
|
+
<span
|
137
|
+
data-tip
|
138
|
+
data-for='info'
|
139
|
+
onMouseEnter={handleMouseEnter}
|
140
|
+
onMouseLeave={handleMouseLeave}
|
141
|
+
>
|
142
|
+
<Icon
|
143
|
+
size='lg'
|
144
|
+
name='info'
|
145
|
+
color='highlight'
|
146
|
+
background='transparent'
|
147
|
+
onClick={linkInfo}
|
148
|
+
id='idIconInfoNavbar'
|
149
|
+
/>
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
{isToolTipMounted ? (
|
154
|
+
<ReactTooltip id='info' type='error'>
|
155
|
+
<span>{txtTootipInfo}</span>
|
156
|
+
</ReactTooltip>
|
157
|
+
) : null}
|
158
|
+
</>
|
159
|
+
) : null}
|
160
|
+
|
161
|
+
{isViewProfile ? (
|
162
|
+
<>
|
163
|
+
<span
|
164
|
+
data-tip
|
165
|
+
data-for='profile'
|
166
|
+
onMouseEnter={handleMouseEnter}
|
167
|
+
onMouseLeave={handleMouseLeave}
|
168
|
+
>
|
169
|
+
<Icon
|
170
|
+
size='lg'
|
171
|
+
name='profile'
|
172
|
+
color='highlight'
|
173
|
+
background='transparent'
|
174
|
+
onClick={linkProfile}
|
175
|
+
id='idIconProfileNavbar'
|
176
|
+
/>
|
177
|
+
|
178
|
+
</span>
|
179
|
+
|
180
|
+
{isToolTipMounted ? (
|
181
|
+
<ReactTooltip id='profile' type='error'>
|
182
|
+
<span>{txtTootipProfile}</span>
|
183
|
+
</ReactTooltip>
|
184
|
+
) : null}
|
185
|
+
</>
|
186
|
+
) : null}
|
187
|
+
|
188
|
+
{languageSwitchLink}
|
189
|
+
|
190
|
+
{isViewLogout ? (
|
191
|
+
<Icon
|
192
|
+
size='lg'
|
193
|
+
name='logout'
|
194
|
+
color='highlight'
|
195
|
+
background='transparent'
|
196
|
+
onClick={linkLogout}
|
197
|
+
id='idIconLogoutNavbar'
|
198
|
+
/>
|
199
|
+
) : null}
|
200
|
+
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
) : null}
|
205
|
+
|
206
|
+
{/* {viewOptionsNav ? (
|
207
|
+
<div onClick={linkLogout} className={getStyles('navbar__item')}>
|
208
|
+
Logout
|
209
|
+
</div>
|
210
|
+
) : null} */}
|
211
|
+
|
212
|
+
|
213
|
+
</header>
|
214
|
+
|
215
|
+
|
216
|
+
</>
|
217
|
+
)
|
218
|
+
}
|
219
|
+
|
220
|
+
Navbar.propTypes = {
|
221
|
+
getStyles: PropTypes.func.isRequired,
|
222
|
+
children: PropTypes.any.isRequired,
|
223
|
+
viewTabsNav: PropTypes.bool,
|
224
|
+
viewOptionsNav: PropTypes.bool,
|
225
|
+
linkLogout: PropTypes.func,
|
226
|
+
linkLegal: PropTypes.func,
|
227
|
+
linkInfo: PropTypes.func,
|
228
|
+
linkProfile: PropTypes.func,
|
229
|
+
handleChange: PropTypes.func,
|
230
|
+
languageSwitchLink: PropTypes.any.isRequired,
|
231
|
+
isViewLegal: PropTypes.bool,
|
232
|
+
isViewInfo: PropTypes.bool,
|
233
|
+
isViewProfile: PropTypes.bool,
|
234
|
+
isViewLogout: PropTypes.bool,
|
235
|
+
}
|
236
|
+
|
237
|
+
Navbar.defaultProps = {
|
238
|
+
viewTabsNav: false,
|
239
|
+
viewOptionsNav: true,
|
240
|
+
getStyles: () => { },
|
241
|
+
isViewLegal: true,
|
242
|
+
isViewInfo: true,
|
243
|
+
isViewProfile: true,
|
244
|
+
isViewLogout: true,
|
245
|
+
}
|
246
|
+
|
247
|
+
export default withStyles(styles)(Navbar)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/* .is-playground {
|
2
|
+
border: var(--border-width-thick) dashed var(--color-primary);
|
3
|
+
} */
|
4
|
+
|
5
|
+
|
6
|
+
.navbar {
|
7
|
+
display: flex;
|
8
|
+
align-items: center;
|
9
|
+
justify-content: space-between;
|
10
|
+
flex-shrink: 0;
|
11
|
+
color: #000;
|
12
|
+
box-shadow: 0px 1px 4px rgb(100 116 139 / 12%);
|
13
|
+
width: calc(100%);
|
14
|
+
padding-left: 18px;
|
15
|
+
padding-right: 14px;
|
16
|
+
min-height: 51px;
|
17
|
+
background-color: #f2fcfc;
|
18
|
+
}
|
19
|
+
|
20
|
+
.navbar__title {
|
21
|
+
margin-right: auto;
|
22
|
+
font-size: 150%;
|
23
|
+
padding: 0.67em 1.5em;
|
24
|
+
}
|
25
|
+
|
26
|
+
.navbar__item {
|
27
|
+
padding: 0.67em 1.5em;
|
28
|
+
cursor: pointer;
|
29
|
+
vertical-align: middle;
|
30
|
+
}
|
31
|
+
|
32
|
+
.navbar__actions {
|
33
|
+
display: flex;
|
34
|
+
align-items: center;
|
35
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Navbar, styles } from '.'
|
2
|
+
|
3
|
+
import { getTemplate } from '../../helpers/storybook'
|
4
|
+
|
5
|
+
const Template = getTemplate(Navbar, styles)
|
6
|
+
|
7
|
+
export default {
|
8
|
+
title: 'Layout/Navbar',
|
9
|
+
component: Navbar,
|
10
|
+
args: {
|
11
|
+
viewTabsNav: false,
|
12
|
+
viewOptionsNav: true,
|
13
|
+
children: 'Taksee',
|
14
|
+
},
|
15
|
+
argTypes: {
|
16
|
+
children: { control: 'text' },
|
17
|
+
},
|
18
|
+
}
|
19
|
+
|
20
|
+
export const Default = Template.bind({})
|
@@ -0,0 +1,35 @@
|
|
1
|
+
export const options = [
|
2
|
+
{
|
3
|
+
active: false,
|
4
|
+
href: '#',
|
5
|
+
icon: 'legal',
|
6
|
+
text: 'Legal',
|
7
|
+
view: true,
|
8
|
+
viewSubMenu: true,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
active: false,
|
12
|
+
href: '/home',
|
13
|
+
icon: 'info',
|
14
|
+
text: 'User Guide',
|
15
|
+
view: true,
|
16
|
+
viewSubMenu: false,
|
17
|
+
},
|
18
|
+
{
|
19
|
+
active: false,
|
20
|
+
href: '/home',
|
21
|
+
icon: 'profile',
|
22
|
+
text: 'My profile',
|
23
|
+
view: true,
|
24
|
+
viewSubMenu: false,
|
25
|
+
},
|
26
|
+
// {
|
27
|
+
// active: false,
|
28
|
+
// href: '/home',
|
29
|
+
// icon: 'logout',
|
30
|
+
// text: 'Salir',
|
31
|
+
// view: true,
|
32
|
+
// viewSubMenu: false,
|
33
|
+
// },
|
34
|
+
|
35
|
+
]
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import React, { ReactNode, useRef, useState, useEffect } from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
import withStyles from '../../hocs/withStyles'
|
4
|
+
import { useRouter } from 'next/router'
|
5
|
+
|
6
|
+
// import { options } from './constants'
|
7
|
+
|
8
|
+
import styles from './Sidebar.module.css'
|
9
|
+
|
10
|
+
import Picture from '../../atoms/Picture'
|
11
|
+
import ItemMenu from '../../molecules/ItemMenu/ItemMenu'
|
12
|
+
|
13
|
+
export const Sidebar = ({ getStyles, menuCollapseView, options, isHrefLogo, isSrcLogoS, isSrcLogo }) => {
|
14
|
+
|
15
|
+
const router = useRouter()
|
16
|
+
|
17
|
+
return (
|
18
|
+
<>
|
19
|
+
<div className={getStyles('header', {
|
20
|
+
'collapsed': menuCollapseView,
|
21
|
+
})}>
|
22
|
+
|
23
|
+
<div className={getStyles('pro-sidebar')}>
|
24
|
+
|
25
|
+
<div className={getStyles('pro-sidebar-inner')}>
|
26
|
+
|
27
|
+
<div className={getStyles('pro-sidebar-layout')}>
|
28
|
+
|
29
|
+
<div className={getStyles('pro-sidebar-header')}>
|
30
|
+
|
31
|
+
<div className={getStyles('logotext')}>
|
32
|
+
{/* small and big change using menuCollapseView state */}
|
33
|
+
{menuCollapseView ? <Picture isHref={isHrefLogo} src={router.basePath + isSrcLogoS} width={19}></Picture> : <Picture isHref={isHrefLogo} src={router.basePath + isSrcLogo} width={'max-content'}></Picture>}
|
34
|
+
</div>
|
35
|
+
{/* <div className={getStyles('closemenu')}>
|
36
|
+
|
37
|
+
{menuCollapseView ? (
|
38
|
+
|
39
|
+
<Icon
|
40
|
+
name="angleRight"
|
41
|
+
onClick={menuIconClick}
|
42
|
+
/>
|
43
|
+
|
44
|
+
) : (
|
45
|
+
<Icon
|
46
|
+
name="angleLeft"
|
47
|
+
onClick={menuIconClick}
|
48
|
+
/>
|
49
|
+
)}
|
50
|
+
</div> */}
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div className={getStyles('pro-sidebar-content')}>
|
55
|
+
|
56
|
+
<nav className={getStyles('pro-menu', 'inner-submenu-arrows')}>
|
57
|
+
|
58
|
+
<ul>
|
59
|
+
|
60
|
+
{options.map((item, index) => (
|
61
|
+
item.view ?
|
62
|
+
<ItemMenu
|
63
|
+
key={'sidebarItem' + index}
|
64
|
+
icon={item.icon}
|
65
|
+
subMenu={item.viewSubMenu}
|
66
|
+
itemSubmenu={item.submenu}
|
67
|
+
itemHref={item.href}
|
68
|
+
itemActive={item.active}
|
69
|
+
>
|
70
|
+
{item.text}
|
71
|
+
</ItemMenu>
|
72
|
+
|
73
|
+
: null
|
74
|
+
|
75
|
+
))}
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
</>
|
91
|
+
)
|
92
|
+
}
|
93
|
+
|
94
|
+
Sidebar.propTypes = {
|
95
|
+
getStyles: PropTypes.func.isRequired,
|
96
|
+
isHrefLogo: PropTypes.any,
|
97
|
+
isSrcLogoS: PropTypes.string,
|
98
|
+
isSrcLogo: PropTypes.string
|
99
|
+
// options: PropTypes.arrayOf(
|
100
|
+
// PropTypes.shape({
|
101
|
+
// text: PropTypes.string,
|
102
|
+
// view: PropTypes.bool,
|
103
|
+
// })
|
104
|
+
// ).isRequired,
|
105
|
+
}
|
106
|
+
|
107
|
+
Sidebar.defaultProps = {
|
108
|
+
getStyles: () => { },
|
109
|
+
menuCollapseView: false,
|
110
|
+
isHrefLogo: '',
|
111
|
+
isSrcLogoS: '',
|
112
|
+
isSrcLogo: ''
|
113
|
+
}
|
114
|
+
|
115
|
+
export default withStyles(styles)(Sidebar)
|