@laerdal/life-react-components 6.0.0-dev.2 → 6.0.0-dev.20.full
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/ContentAccordion.cjs +40 -11
- package/dist/Accordion/ContentAccordion.cjs.map +1 -1
- package/dist/Accordion/ContentAccordion.js +40 -11
- package/dist/Accordion/ContentAccordion.js.map +1 -1
- package/dist/Accordion/__tests__/AccordionMenu.test.tsx +42 -0
- package/dist/Accordion/__tests__/ContentAccordion.test.tsx +150 -0
- package/dist/Accordion/styles.cjs +51 -13
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.js +51 -13
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/AuthPage/__tests__/AuthPage.test.tsx +27 -0
- package/dist/Banners/Banner.cjs +38 -34
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.d.ts +2 -3
- package/dist/Banners/Banner.js +38 -34
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Banners/__tests__/Banner.test.tsx +47 -0
- package/dist/Banners/__tests__/OverviewBanner.test.tsx +20 -0
- package/dist/Banners/styles.cjs +8 -16
- package/dist/Banners/styles.cjs.map +1 -1
- package/dist/Banners/styles.js +8 -16
- package/dist/Banners/styles.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +8 -2
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +8 -2
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Breadcrumb/__tests__/Breadcrumb.test.tsx +78 -0
- package/dist/Breadcrumb/styles.cjs +15 -4
- package/dist/Breadcrumb/styles.cjs.map +1 -1
- package/dist/Breadcrumb/styles.js +15 -4
- package/dist/Breadcrumb/styles.js.map +1 -1
- package/dist/Button/BackButton.cjs +27 -6
- package/dist/Button/BackButton.cjs.map +1 -1
- package/dist/Button/BackButton.js +27 -6
- package/dist/Button/BackButton.js.map +1 -1
- package/dist/Button/Button.cjs +179 -47
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.d.ts +2 -0
- package/dist/Button/Button.js +179 -47
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +83 -21
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.js +83 -21
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Button/__tests__/BackButton.test.tsx +32 -0
- package/dist/Button/__tests__/Button.test.tsx +45 -0
- package/dist/Button/__tests__/DualButton.test.tsx +119 -0
- package/dist/Card/HorizontalCard/HorizontalCard.cjs +20 -5
- package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.js +20 -5
- package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +12 -3
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.js +12 -3
- package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +8 -2
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +8 -2
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
- package/dist/Card/HorizontalCard/__tests__/HorizontalCard.test.tsx +71 -0
- package/dist/Card/HorizontalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/VerticalCard/Card.cjs +20 -5
- package/dist/Card/VerticalCard/Card.cjs.map +1 -1
- package/dist/Card/VerticalCard/Card.js +20 -5
- package/dist/Card/VerticalCard/Card.js.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.cjs +28 -7
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.js +28 -7
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.cjs +19 -4
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.js +19 -4
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.cjs +9 -2
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.js +9 -2
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -1
- package/dist/Card/__tests__/Card.test.tsx +146 -0
- package/dist/Chips/ChipStyles.cjs +4 -1
- package/dist/Chips/ChipStyles.cjs.map +1 -1
- package/dist/Chips/ChipStyles.js +4 -1
- package/dist/Chips/ChipStyles.js.map +1 -1
- package/dist/Chips/__tests__/ActionChip.test.tsx +94 -0
- package/dist/Chips/__tests__/ChoiceChips.test.tsx +79 -0
- package/dist/Chips/__tests__/FilterChip.test.tsx +95 -0
- package/dist/Chips/__tests__/InputChip.test.tsx +155 -0
- package/dist/ChipsInput/ChipInputField.cjs +16 -4
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +16 -4
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/ChipsInput/__tests__/ChipDropdownInput.test.tsx +100 -0
- package/dist/ChipsInput/__tests__/ChipInputFields.test.tsx +155 -0
- package/dist/Dropdown/BasicDropdown.cjs +12 -3
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +12 -3
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +172 -42
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.js +172 -42
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +36 -10
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +36 -10
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +12 -3
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.js +12 -3
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Dropdown/__tests__/DropdownFilter.test.tsx +39 -0
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +4 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +4 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/Footer/__tests__/Footer.test.tsx +182 -0
- package/dist/GlobalNavigationBar/Logo.cjs +2 -1
- package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Logo.js +2 -1
- package/dist/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/GlobalNavigationBar/__tests__/GlobalNavigationBar.tests.d.ts +1 -0
- package/dist/GlobalNavigationBar/__tests__/Logo.test.tsx +39 -0
- package/dist/GlobalNavigationBar/__tests__/Logo.tests.d.ts +1 -0
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +10 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.js +10 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +3 -2
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js +3 -2
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +4 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +4 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/__tests__/DesktopActions.test.tsx +108 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/ExtendedMainMenu.test.tsx +28 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/MainMenu.test.tsx +55 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/RightSideNav.test.tsx +45 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/UserMenu.test.tsx +125 -0
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenu.test.tsx +317 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenuContent.test.tsx +294 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenuHeader.test.tsx +195 -0
- package/dist/HyperLink/HyperLink.cjs +18 -2
- package/dist/HyperLink/HyperLink.cjs.map +1 -1
- package/dist/HyperLink/HyperLink.d.ts +2 -0
- package/dist/HyperLink/HyperLink.js +18 -2
- package/dist/HyperLink/HyperLink.js.map +1 -1
- package/dist/HyperLink/styling.cjs +38 -8
- package/dist/HyperLink/styling.cjs.map +1 -1
- package/dist/HyperLink/styling.js +38 -8
- package/dist/HyperLink/styling.js.map +1 -1
- package/dist/InputFields/Checkbox.cjs +54 -14
- package/dist/InputFields/Checkbox.cjs.map +1 -1
- package/dist/InputFields/Checkbox.js +54 -14
- package/dist/InputFields/Checkbox.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +149 -43
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +1 -1
- package/dist/InputFields/DatepickerField.js +150 -44
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs +20 -5
- package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.js +20 -5
- package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
- package/dist/InputFields/Label.cjs +38 -11
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.js +38 -11
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +66 -16
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.js +66 -16
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs +4 -1
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.d.ts +1 -1
- package/dist/InputFields/PasswordField.js +4 -1
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +30 -6
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +30 -6
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +63 -15
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.js +63 -15
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/RichTextField.cjs +60 -15
- package/dist/InputFields/RichTextField.cjs.map +1 -1
- package/dist/InputFields/RichTextField.js +60 -15
- package/dist/InputFields/RichTextField.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs +4 -1
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.js +4 -1
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +9 -3
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +1 -1
- package/dist/InputFields/TextField.js +9 -3
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +68 -17
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.js +68 -17
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/__tests__/NumberField.test.tsx +67 -0
- package/dist/InputFields/__tests__/NumberInput.test.tsx +68 -0
- package/dist/InputFields/__tests__/QuickSearch.test.tsx +42 -0
- package/dist/InputFields/components/SearchBarInput.cjs +28 -7
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +28 -7
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +60 -15
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.js +60 -15
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/styling.cjs +95 -39
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +1 -2
- package/dist/InputFields/styling.js +95 -39
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/LinearProgress/LinearProgress.cjs +161 -53
- package/dist/LinearProgress/LinearProgress.cjs.map +1 -1
- package/dist/LinearProgress/LinearProgress.js +161 -53
- package/dist/LinearProgress/LinearProgress.js.map +1 -1
- package/dist/LinearProgress/__tests__/LinearProgress.test.tsx +25 -0
- package/dist/List/ListRow.cjs +36 -9
- package/dist/List/ListRow.cjs.map +1 -1
- package/dist/List/ListRow.js +36 -9
- package/dist/List/ListRow.js.map +1 -1
- package/dist/List/__tests__/ListRow.test.tsx +18 -0
- package/dist/List/__tests__/ListRow.tests.d.ts +1 -0
- package/dist/LoadingIndicator/LoadingIndicator.cjs +4 -1
- package/dist/LoadingIndicator/LoadingIndicator.cjs.map +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.js +4 -1
- package/dist/LoadingIndicator/LoadingIndicator.js.map +1 -1
- package/dist/LoadingPage/GlobalLoadingPage.cjs +4 -1
- package/dist/LoadingPage/GlobalLoadingPage.cjs.map +1 -1
- package/dist/LoadingPage/GlobalLoadingPage.js +4 -1
- package/dist/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/LoadingPage/__tests__/GlobalLoadingPage.test.tsx +23 -0
- package/dist/MenuItem/MenuItem.cjs +101 -26
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.js +101 -26
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/MiniProductCard/MiniProductCard.cjs +15 -1
- package/dist/MiniProductCard/MiniProductCard.cjs.map +1 -1
- package/dist/MiniProductCard/MiniProductCard.d.ts +1 -0
- package/dist/MiniProductCard/MiniProductCard.js +15 -1
- package/dist/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/Modals/Modal.cjs +4 -1
- package/dist/Modals/Modal.cjs.map +1 -1
- package/dist/Modals/Modal.js +4 -1
- package/dist/Modals/Modal.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +24 -6
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +24 -6
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +12 -3
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +12 -3
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalNote.cjs +16 -4
- package/dist/Modals/ModalNote.cjs.map +1 -1
- package/dist/Modals/ModalNote.js +16 -4
- package/dist/Modals/ModalNote.js.map +1 -1
- package/dist/Modals/ModalStyles.cjs +44 -11
- package/dist/Modals/ModalStyles.cjs.map +1 -1
- package/dist/Modals/ModalStyles.js +44 -11
- package/dist/Modals/ModalStyles.js.map +1 -1
- package/dist/Modals/__tests__/Modal.test.tsx +169 -0
- package/dist/Modals/__tests__/ModalContainer.test.tsx +77 -0
- package/dist/Modals/__tests__/ModalContent.test.tsx +126 -0
- package/dist/NavItem/NavItem.cjs +11 -2
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.js +11 -2
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/NavItem/__tests__/NavItem.test.ts +6 -0
- package/dist/NotificationDot/NotificationDot.cjs +17 -2
- package/dist/NotificationDot/NotificationDot.cjs.map +1 -1
- package/dist/NotificationDot/NotificationDot.js +17 -2
- package/dist/NotificationDot/NotificationDot.js.map +1 -1
- package/dist/NotificationDot/__tests__/NotificationDot.test.tsx +33 -0
- package/dist/Paginator/Paginator.cjs +76 -29
- package/dist/Paginator/Paginator.cjs.map +1 -1
- package/dist/Paginator/Paginator.js +76 -29
- package/dist/Paginator/Paginator.js.map +1 -1
- package/dist/Paginator/__tests__/Paginator.test.tsx +39 -0
- package/dist/Panel/Panel.cjs +4 -1
- package/dist/Panel/Panel.cjs.map +1 -1
- package/dist/Panel/Panel.js +4 -1
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Popover/Popover.cjs +22 -3
- package/dist/Popover/Popover.cjs.map +1 -1
- package/dist/Popover/Popover.js +22 -3
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/Popover/__tests__/Popover.test.tsx +64 -0
- package/dist/ProfileButton/ProfileButton.cjs +9 -2
- package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
- package/dist/ProfileButton/ProfileButton.js +9 -2
- package/dist/ProfileButton/ProfileButton.js.map +1 -1
- package/dist/ProfileButton/__tests__/ProfileButton.test.tsx +31 -0
- package/dist/QuizButton/__tests__/QuizButton.test.tsx +53 -0
- package/dist/SegmentControl/SegmentControl.cjs +46 -11
- package/dist/SegmentControl/SegmentControl.cjs.map +1 -1
- package/dist/SegmentControl/SegmentControl.js +46 -11
- package/dist/SegmentControl/SegmentControl.js.map +1 -1
- package/dist/SegmentControl/__tests__/SegmentControl.test.tsx +145 -0
- package/dist/SideMenu/SideMenuHeader.cjs +12 -3
- package/dist/SideMenu/SideMenuHeader.cjs.map +1 -1
- package/dist/SideMenu/SideMenuHeader.js +12 -3
- package/dist/SideMenu/SideMenuHeader.js.map +1 -1
- package/dist/SideMenu/__tests__/SideMenu.test.tsx +99 -0
- package/dist/Switcher/SwitcherMenuItem.cjs +4 -1
- package/dist/Switcher/SwitcherMenuItem.cjs.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.js +4 -1
- package/dist/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/Switcher/__tests__/SwitcherMenuItem.tsx +14 -0
- package/dist/Table/TableFooter.cjs +8 -2
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +8 -2
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableStyles.cjs +132 -33
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +132 -33
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/__tests__/Table.test.tsx +499 -0
- package/dist/Tabs/HorizontalTabs.cjs +68 -18
- package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
- package/dist/Tabs/HorizontalTabs.js +68 -18
- package/dist/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/Tabs/TabLink.cjs +4 -1
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.js +4 -1
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tabs/VerticalTabs.cjs +1 -0
- package/dist/Tabs/VerticalTabs.cjs.map +1 -1
- package/dist/Tabs/VerticalTabs.js +1 -0
- package/dist/Tabs/VerticalTabs.js.map +1 -1
- package/dist/Tabs/__tests__/HorizontalTabs.test.tsx +95 -0
- package/dist/Tabs/__tests__/TabLink.test.tsx +40 -0
- package/dist/Tabs/__tests__/TabLink.tests.d.ts +1 -0
- package/dist/Tabs/__tests__/Tablist.test.tsx +37 -0
- package/dist/Tabs/__tests__/Tablist.tests.d.ts +2 -0
- package/dist/Tag/Tag.cjs +2 -2
- package/dist/Tag/Tag.cjs.map +1 -1
- package/dist/Tag/Tag.js +2 -2
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/__tests__/Tag.test.tsx +86 -0
- package/dist/Tile/Tile.cjs +8 -2
- package/dist/Tile/Tile.cjs.map +1 -1
- package/dist/Tile/Tile.js +8 -2
- package/dist/Tile/Tile.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +8 -2
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.js +8 -2
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Tile/TileFooter.cjs +4 -1
- package/dist/Tile/TileFooter.cjs.map +1 -1
- package/dist/Tile/TileFooter.js +4 -1
- package/dist/Tile/TileFooter.js.map +1 -1
- package/dist/Tile/TileHeader.cjs +12 -3
- package/dist/Tile/TileHeader.cjs.map +1 -1
- package/dist/Tile/TileHeader.js +12 -3
- package/dist/Tile/TileHeader.js.map +1 -1
- package/dist/Toasters/Toast.cjs +62 -13
- package/dist/Toasters/Toast.cjs.map +1 -1
- package/dist/Toasters/Toast.js +62 -13
- package/dist/Toasters/Toast.js.map +1 -1
- package/dist/Toasters/__tests__/Toast.test.tsx +74 -0
- package/dist/Toggles/ToggleButton.cjs +9 -3
- package/dist/Toggles/ToggleButton.cjs.map +1 -1
- package/dist/Toggles/ToggleButton.d.ts +1 -1
- package/dist/Toggles/ToggleButton.js +9 -3
- package/dist/Toggles/ToggleButton.js.map +1 -1
- package/dist/Toggles/TogglerStyles.cjs +22 -8
- package/dist/Toggles/TogglerStyles.cjs.map +1 -1
- package/dist/Toggles/TogglerStyles.js +22 -8
- package/dist/Toggles/TogglerStyles.js.map +1 -1
- package/dist/Toggles/__tests__/ToggleButton.test.tsx +53 -0
- package/dist/Toggles/__tests__/ToggleSwitch.test.tsx +87 -0
- package/dist/Tooltips/TooltipStyles.cjs +28 -6
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.js +28 -6
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/Tooltips/__tests__/TooltipWrapper.test.tsx +16 -0
- package/dist/common/InputStyling.cjs +30 -7
- package/dist/common/InputStyling.cjs.map +1 -1
- package/dist/common/InputStyling.js +30 -7
- package/dist/common/InputStyling.js.map +1 -1
- package/dist/common/Link.cjs +45 -0
- package/dist/common/Link.cjs.map +1 -0
- package/dist/common/Link.d.ts +9 -0
- package/dist/common/Link.js +37 -0
- package/dist/common/Link.js.map +1 -0
- package/dist/common/NavigationHelper.cjs +30 -0
- package/dist/common/NavigationHelper.cjs.map +1 -0
- package/dist/common/NavigationHelper.d.ts +4 -0
- package/dist/common/NavigationHelper.js +23 -0
- package/dist/common/NavigationHelper.js.map +1 -0
- package/dist/custom.d.ts +2 -0
- package/dist/styles/colors.cjs +439 -84
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +200 -11
- package/dist/styles/colors.js +439 -84
- package/dist/styles/colors.js.map +1 -1
- package/dist/styles/global.cjs +19 -2
- package/dist/styles/global.cjs.map +1 -1
- package/dist/styles/global.d.ts +3 -2
- package/dist/styles/global.js +18 -3
- package/dist/styles/global.js.map +1 -1
- package/dist/styles/index.cjs +21 -9
- package/dist/styles/index.cjs.map +1 -1
- package/dist/styles/index.d.ts +2 -2
- package/dist/styles/index.js +18 -6
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/react-datepicker.css +766 -0
- package/dist/utils/color-tokens.cjs +91 -0
- package/dist/utils/color-tokens.cjs.map +1 -0
- package/dist/utils/color-tokens.d.ts +19 -0
- package/dist/utils/color-tokens.js +82 -0
- package/dist/utils/color-tokens.js.map +1 -0
- package/package.json +12 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonStyles.js","names":["styled","css","keyframes","BREAKPOINTS","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","focusStyles","scrollBarStyling","Z_INDEXES","Size","RowLayout","div","Button","button","props","getColor","theme","flowLeft","flowRight","fadeOut","fadeIn","Menu","off_canvas","SMALL","Right","SiteName","span","MenuSection","li","MenuSectionList","ul","UserMenuSectionListStyling","hover","focus","active","flowDown","MobileMenuWrapper","ScrollableContainer","Small","MobileHeaderText","Bold","MobileHeaderNote","Regular","MobileHeaderContainer"],"sources":["../../../src/GlobalNavigationBar/mobile/CommonStyles.ts"],"sourcesContent":["import styled, {css, keyframes} from 'styled-components';\r\nimport {\r\n BREAKPOINTS,\r\n COLORS,\r\n ComponentMStyling,\r\n ComponentSStyling,\r\n ComponentTextStyle,\r\n ComponentXSStyling,\r\n focusStyles,\r\n scrollBarStyling,\r\n Z_INDEXES\r\n} from '../../styles';\r\nimport {Size} from '../../types';\r\
|
|
1
|
+
{"version":3,"file":"CommonStyles.js","names":["styled","css","keyframes","BREAKPOINTS","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","focusStyles","scrollBarStyling","Z_INDEXES","Size","RowLayout","div","Button","button","props","getColor","theme","flowLeft","flowRight","fadeOut","fadeIn","Menu","off_canvas","SMALL","Right","SiteName","span","MenuSection","li","MenuSectionList","ul","UserMenuSectionListStyling","hover","focus","active","flowDown","MobileMenuWrapper","ScrollableContainer","Small","MobileHeaderText","Bold","MobileHeaderNote","Regular","MobileHeaderContainer"],"sources":["../../../src/GlobalNavigationBar/mobile/CommonStyles.ts"],"sourcesContent":["import styled, {css, keyframes} from 'styled-components';\r\nimport {\r\n BREAKPOINTS,\r\n COLORS,\r\n ComponentMStyling,\r\n ComponentSStyling,\r\n ComponentTextStyle,\r\n ComponentXSStyling,\r\n focusStyles,\r\n scrollBarStyling,\r\n Z_INDEXES\r\n} from '../../styles';\r\nimport {Size} from '../../types';\r\n\r\nexport const RowLayout = styled.div`\r\n display: flex;\r\n align-items: center;\r\n`;\r\n\r\nexport const Button = styled.button`\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n font-weight: bold;\r\n border: 0;\r\n`;\r\n\r\nconst flowLeft = keyframes`\r\n 0% {\r\n opacity: 0;\r\n transform: translateX(100%);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translateX(0);\r\n }\r\n`;\r\n\r\nconst flowRight = keyframes`\r\n 0% {\r\n opacity: 1;\r\n transform: translateX(0);\r\n visibility: visible;\r\n }\r\n to {\r\n opacity: 0;\r\n visibility: hidden;\r\n transform: translateX(100%);\r\n }\r\n`;\r\n\r\n\r\nexport const fadeOut = keyframes`\r\n 0% {\r\n opacity: 1;\r\n visibility: visible;\r\n }\r\n to {\r\n opacity: 0;\r\n visibility: hidden;\r\n }\r\n`;\r\n\r\nexport const fadeIn = keyframes`\r\n 0% {\r\n opacity: 0;\r\n visibility: hidden;\r\n }\r\n to {\r\n opacity: 1;\r\n visibility: visible;\r\n }\r\n`;\r\n\r\nexport const Menu = styled.div`\r\n height: 100%;\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n box-sizing: border-box;\r\n right: 0;\r\n top: 0;\r\n position: absolute;\r\n z-index: ${Z_INDEXES.off_canvas};\r\n align-items: center;\r\n\r\n width: 320px;\r\n\r\n ${BREAKPOINTS.SMALL} {\r\n width: 400px;\r\n }\r\n\r\n .open & {\r\n visibility: visible;\r\n display: flex;\r\n animation: ${flowLeft} 0.3s ease-in-out;\r\n }\r\n\r\n .closed & {\r\n visibility: hidden;\r\n animation: ${flowRight} 0.3s ease-in-out;\r\n }\r\n`;\r\n\r\nexport const Right = styled.div`\r\n display: flex;\r\n margin-left: auto;\r\n`;\r\n\r\nexport const SiteName = styled.span`\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n font-weight: bold;\r\n font-size: 14px;\r\n margin-left: 4px;\r\n`;\r\n\r\nexport const MenuSection = styled.li`\r\n margin-top: 16px;\r\n\r\n .disabled-link {\r\n color: #21212150;\r\n pointer-events: none;\r\n key-events: none;\r\n }\r\n`;\r\n\r\nexport const MenuSectionList = styled.ul`\r\n list-style: none;\r\n padding: 0;\r\n\r\n li {\r\n width: 80%;\r\n height: 48px;\r\n margin: 0 auto 0 12px;\r\n\r\n a {\r\n height: 100%;\r\n }\r\n }\r\n`;\r\n\r\nexport const UserMenuSectionListStyling = css`\r\n li {\r\n position: relative;\r\n }\r\n\r\n li:hover:not(.disabled) {\r\n z-index: ${Z_INDEXES.hover};\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n\r\n a {\r\n color: ${props => COLORS.getColor('primary_600', props.theme)};\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('primary_600', props.theme)};\r\n }\r\n }\r\n\r\n li:focus-within:not(.disabled) {\r\n z-index: ${Z_INDEXES.focus};\r\n\r\n ${focusStyles}\r\n a {\r\n outline: none;\r\n }\r\n }\r\n\r\n li:active:not(.disabled) {\r\n z-index: ${Z_INDEXES.active};\r\n background: ${props => COLORS.getColor('primary_100', props.theme)};\r\n\r\n a {\r\n color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n }\r\n\r\n .disabled {\r\n a {\r\n color: ${props => COLORS.getColor('neutral_300', props.theme)};\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_300', props.theme)};\r\n }\r\n\r\n background-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n }\r\n`;\r\n\r\n\r\nexport const flowDown = keyframes`\r\n 0% {\r\n opacity: 0;\r\n transform: translateY(-10px);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translateY(0);\r\n }\r\n`;\r\n\r\nexport const MobileMenuWrapper = styled.div`\r\n width: 100%;\r\n box-sizing: border-box;\r\n flex-flow: column;\r\n display: flex;\r\n flex: 1;\r\n overflow: hidden;\r\n`;\r\n\r\nexport const ScrollableContainer = styled.div`\r\n flex: 1;\r\n display: flex;\r\n flex-direction: column;\r\n overflow-y: auto;\r\n max-height: 100%;\r\n\r\n &.scrollable {\r\n margin-right: 6px;\r\n padding-right: 10px;\r\n }\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n ::-webkit-scrollbar-track {\r\n margin: 8px;\r\n }\r\n`;\r\n\r\nexport const MobileHeaderText = styled.div`\r\n ${props => ComponentSStyling(ComponentTextStyle.Bold, COLORS.getColor('neutral_600', props.theme))}\r\n ${BREAKPOINTS.SMALL} {\r\n ${props => ComponentMStyling(ComponentTextStyle.Bold, COLORS.getColor('neutral_600', props.theme))}\r\n }\r\n`;\r\nexport const MobileHeaderNote = styled.div`\r\n word-break: break-all;\r\n ${props => ComponentXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))}\r\n`;\r\n\r\nexport const MobileHeaderContainer = styled.div`\r\n margin: 0 24px;\r\n padding-bottom: 8px;\r\n box-sizing: border-box;\r\n border-bottom: 1px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n display: flex;\r\n flex-direction: column;\r\n`;\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {act, render, waitFor} from '../../../test-utils';
|
|
3
|
+
import {
|
|
4
|
+
DesktopMenuButtonTypes,
|
|
5
|
+
MenuNavigationItemTypeGroup,
|
|
6
|
+
MenuNavigationItemTypeItem,
|
|
7
|
+
MobileMenuButtonTypes
|
|
8
|
+
} from '../../types';
|
|
9
|
+
import {SystemIcons} from '../../../icons';
|
|
10
|
+
import MobileMenu from '../MobileMenu';
|
|
11
|
+
import { NavigationProvider } from '../../../Navigation';
|
|
12
|
+
|
|
13
|
+
const navigateSpy = jest.fn();
|
|
14
|
+
const isActiveRouteSpy = jest.fn();
|
|
15
|
+
|
|
16
|
+
jest.mock('rooks', () => ({
|
|
17
|
+
useDimensionsRef: () => [],
|
|
18
|
+
useMediaMatch: () => true
|
|
19
|
+
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
describe('MobileMenu', () => {
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const navProps = {
|
|
28
|
+
currentPath: '',
|
|
29
|
+
isActiveRoute: () => false,
|
|
30
|
+
navigate: (path: string, isExternal: boolean) => {}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const mainNavigationOptions = [
|
|
35
|
+
{
|
|
36
|
+
label: 'Overview',
|
|
37
|
+
to: '/',
|
|
38
|
+
exact: true,
|
|
39
|
+
onClick: () => {
|
|
40
|
+
console.log('Clicked on overview page');
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Services',
|
|
45
|
+
to: '/services',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Products',
|
|
49
|
+
to: '/products',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const secondaryNavigationOptions = [
|
|
54
|
+
{
|
|
55
|
+
label: 'Pinned Tab',
|
|
56
|
+
to: 'pinned',
|
|
57
|
+
pinned: true
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const headerActions: DesktopMenuButtonTypes[] = [
|
|
62
|
+
{
|
|
63
|
+
type: 'action',
|
|
64
|
+
action: (e) => {
|
|
65
|
+
console.log('search');
|
|
66
|
+
},
|
|
67
|
+
icon: <SystemIcons.Search/>,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: 'action',
|
|
71
|
+
action: (e) => {
|
|
72
|
+
console.log('notifications');
|
|
73
|
+
},
|
|
74
|
+
icon: <SystemIcons.Notification/>,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'action',
|
|
78
|
+
action: (e) => {
|
|
79
|
+
console.log('language');
|
|
80
|
+
},
|
|
81
|
+
icon: <SystemIcons.Language/>,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: 'action',
|
|
85
|
+
action: (e) => {
|
|
86
|
+
console.log('settings');
|
|
87
|
+
},
|
|
88
|
+
icon: <SystemIcons.GearSettings/>,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'profile',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: 'action',
|
|
95
|
+
action: (e) => {
|
|
96
|
+
console.log('shop');
|
|
97
|
+
},
|
|
98
|
+
icon: <SystemIcons.ShoppingCart/>,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'switcher',
|
|
102
|
+
action: (e) => {
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
window.portalNav.toggle();
|
|
105
|
+
console.log('switcher')
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
const notifications: MenuNavigationItemTypeItem[] = [
|
|
111
|
+
{
|
|
112
|
+
label: 'First',
|
|
113
|
+
note: 'This is a note',
|
|
114
|
+
to: '/n7',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: 'Second',
|
|
118
|
+
note: 'This is a note',
|
|
119
|
+
to: '/n6',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: 'Third',
|
|
123
|
+
note: 'This is a note',
|
|
124
|
+
to: '/n5',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: 'Fourth',
|
|
128
|
+
note: 'This is a note',
|
|
129
|
+
to: '/n4',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: 'Fifth',
|
|
133
|
+
note: 'This is a note',
|
|
134
|
+
to: '/n3',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: 'Sixth',
|
|
138
|
+
note: 'This is a note',
|
|
139
|
+
to: '/n2',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: 'Seventh',
|
|
143
|
+
note: 'This is a note',
|
|
144
|
+
to: '/n1',
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
const mobileActions: MobileMenuButtonTypes[] = [
|
|
149
|
+
{
|
|
150
|
+
type: 'submenu',
|
|
151
|
+
menu: {
|
|
152
|
+
type: 'custom',
|
|
153
|
+
label: 'Search',
|
|
154
|
+
custom: () => 'custom'
|
|
155
|
+
},
|
|
156
|
+
icon: <SystemIcons.Search/>,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'submenu',
|
|
160
|
+
menu: {
|
|
161
|
+
type: 'group',
|
|
162
|
+
label: 'Notifications',
|
|
163
|
+
items: notifications
|
|
164
|
+
},
|
|
165
|
+
icon: <SystemIcons.Notification/>,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: 'action',
|
|
169
|
+
action: (e) => {
|
|
170
|
+
console.log('language');
|
|
171
|
+
return true;
|
|
172
|
+
},
|
|
173
|
+
icon: <SystemIcons.Language/>,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'profile',
|
|
177
|
+
placement: 'left'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'switcher',
|
|
181
|
+
action: (e) => {
|
|
182
|
+
// @ts-ignore
|
|
183
|
+
window.portalNav.toggle();
|
|
184
|
+
console.log('switcher')
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
];
|
|
188
|
+
|
|
189
|
+
const mobileStickyNav = [
|
|
190
|
+
{
|
|
191
|
+
label: 'Help',
|
|
192
|
+
to: '/help',
|
|
193
|
+
pinned: true,
|
|
194
|
+
icon: <SystemIcons.Help/>,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
label: 'Support',
|
|
198
|
+
to: '/support',
|
|
199
|
+
pinned: true,
|
|
200
|
+
icon: <SystemIcons.Support/>,
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
const accountSection = [
|
|
205
|
+
{label: 'My Account', to: '/account/myaccount', icon: <SystemIcons.User/>, external: false},
|
|
206
|
+
{label: 'Language & Region', to: '/account/language', icon: <SystemIcons.Language/>, external: false},
|
|
207
|
+
{label: 'Settings', to: '/account/settings', icon: <SystemIcons.GearSettings/>, external: false},
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
const organizationSection = [
|
|
211
|
+
{
|
|
212
|
+
label: 'Organization details',
|
|
213
|
+
to: '/organization/myorganization',
|
|
214
|
+
icon: <SystemIcons.Institute/>,
|
|
215
|
+
external: false
|
|
216
|
+
},
|
|
217
|
+
{label: 'People', to: '/organization/user-management', icon: <SystemIcons.Team/>, external: false},
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
const supportSection = [
|
|
221
|
+
{
|
|
222
|
+
label: 'Help',
|
|
223
|
+
to: 'https://laerdal.force.com/HelpCenter',
|
|
224
|
+
icon: <SystemIcons.Help/>,
|
|
225
|
+
external: true,
|
|
226
|
+
pinned: true
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
label: 'Support',
|
|
230
|
+
to: 'https://www.laerdal.com/support/',
|
|
231
|
+
icon: <SystemIcons.Support/>,
|
|
232
|
+
external: true,
|
|
233
|
+
pinned: true
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
|
|
237
|
+
const mobileNavigationSubGroup = {
|
|
238
|
+
type: 'group',
|
|
239
|
+
items: [...organizationSection, ...supportSection],
|
|
240
|
+
note: 'This is a note',
|
|
241
|
+
header: {
|
|
242
|
+
header: 'Title',
|
|
243
|
+
note: 'Note Text'
|
|
244
|
+
},
|
|
245
|
+
footer: {
|
|
246
|
+
header: 'Title',
|
|
247
|
+
note: 'Note text',
|
|
248
|
+
link: {
|
|
249
|
+
label: 'Link text',
|
|
250
|
+
href: '#',
|
|
251
|
+
external: false
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
action: {
|
|
255
|
+
label: 'Sign out',
|
|
256
|
+
action: () => {
|
|
257
|
+
console.log('Sign out');
|
|
258
|
+
},
|
|
259
|
+
icon: <SystemIcons.Logout/>
|
|
260
|
+
},
|
|
261
|
+
label: 'Organization',
|
|
262
|
+
icon: <SystemIcons.Institute/>,
|
|
263
|
+
} as MenuNavigationItemTypeGroup;
|
|
264
|
+
|
|
265
|
+
it('should render label', () => {
|
|
266
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenu show={true} label={'label'} onClose={jest.fn()}/></NavigationProvider>)
|
|
267
|
+
|
|
268
|
+
expect(wrapper.findByText('label')).toBeDefined();
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('should render header', () => {
|
|
272
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenu show={true} header={{header: 'header', note: 'note'}} onClose={jest.fn()}/></NavigationProvider>)
|
|
273
|
+
|
|
274
|
+
expect(wrapper.findByText('header')).toBeDefined();
|
|
275
|
+
expect(wrapper.findByText('note')).toBeDefined();
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('should render footer', () => {
|
|
279
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenu
|
|
280
|
+
onClose={jest.fn()}
|
|
281
|
+
show={true}
|
|
282
|
+
footer={{header: 'header', note: 'note', link: {label: 'link', href: '#'}}}/></NavigationProvider>)
|
|
283
|
+
|
|
284
|
+
expect(wrapper.findByText('header')).toBeDefined();
|
|
285
|
+
expect(wrapper.findByText('note')).toBeDefined();
|
|
286
|
+
expect(wrapper.findByText('link')).toBeDefined();
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('should render action', () => {
|
|
290
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenu
|
|
291
|
+
onClose={jest.fn()}
|
|
292
|
+
show={true}
|
|
293
|
+
action={{action: jest.fn(), label: 'action'}}/></NavigationProvider>)
|
|
294
|
+
|
|
295
|
+
expect(wrapper.findByText('action')).toBeDefined();
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
it('should render items', () => {
|
|
299
|
+
const items = [mobileNavigationSubGroup, ...mainNavigationOptions, ...mobileStickyNav]
|
|
300
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenu show={true} onClose={jest.fn()} items={items}/></NavigationProvider>)
|
|
301
|
+
|
|
302
|
+
items.forEach(item => {
|
|
303
|
+
expect(wrapper.findByText(item.label)).toBeDefined();
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it('should call on close when close button is clicked', () => {
|
|
308
|
+
const close = jest.fn();
|
|
309
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenu show={true} label={'label'} onClose={close}/></NavigationProvider>)
|
|
310
|
+
|
|
311
|
+
act(() => {
|
|
312
|
+
wrapper.container.querySelector('button')!.click();
|
|
313
|
+
});
|
|
314
|
+
expect(close).toHaveBeenCalled();
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
});
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {render} from '../../../test-utils';
|
|
3
|
+
import MobileMenuContent from '../MobileMenuContent';
|
|
4
|
+
import {
|
|
5
|
+
DesktopMenuButtonTypes,
|
|
6
|
+
MenuNavigationItemTypeGroup,
|
|
7
|
+
MenuNavigationItemTypeItem,
|
|
8
|
+
MobileMenuButtonTypes
|
|
9
|
+
} from '../../types';
|
|
10
|
+
import {SystemIcons} from '../../../icons';
|
|
11
|
+
import { NavigationProvider } from '../../../Navigation';
|
|
12
|
+
|
|
13
|
+
const navigateSpy = jest.fn();
|
|
14
|
+
const isActiveRouteSpy = jest.fn();
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
jest.mock('rooks', () => ({
|
|
18
|
+
useDimensionsRef: () => [],
|
|
19
|
+
useMediaMatch: () => true
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
describe('MobileMenuContent', () => {
|
|
23
|
+
|
|
24
|
+
const navProps = {
|
|
25
|
+
currentPath: '',
|
|
26
|
+
isActiveRoute: () => false,
|
|
27
|
+
navigate: (path: string, isExternal: boolean) => {}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const mainNavigationOptions = [
|
|
31
|
+
{
|
|
32
|
+
label: 'Overview',
|
|
33
|
+
to: '/',
|
|
34
|
+
exact: true,
|
|
35
|
+
onClick: () => {
|
|
36
|
+
console.log('Clicked on overview page');
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Services',
|
|
41
|
+
to: '/services',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Products',
|
|
45
|
+
to: '/products',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const secondaryNavigationOptions = [
|
|
50
|
+
{
|
|
51
|
+
label: 'Pinned Tab',
|
|
52
|
+
to: 'pinned',
|
|
53
|
+
pinned: true
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const headerActions: DesktopMenuButtonTypes[] = [
|
|
58
|
+
{
|
|
59
|
+
type: 'action',
|
|
60
|
+
action: (e) => {
|
|
61
|
+
console.log('search');
|
|
62
|
+
},
|
|
63
|
+
icon: <SystemIcons.Search/>,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: 'action',
|
|
67
|
+
action: (e) => {
|
|
68
|
+
console.log('notifications');
|
|
69
|
+
},
|
|
70
|
+
icon: <SystemIcons.Notification/>,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'action',
|
|
74
|
+
action: (e) => {
|
|
75
|
+
console.log('language');
|
|
76
|
+
},
|
|
77
|
+
icon: <SystemIcons.Language/>,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'action',
|
|
81
|
+
action: (e) => {
|
|
82
|
+
console.log('settings');
|
|
83
|
+
},
|
|
84
|
+
icon: <SystemIcons.GearSettings/>,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: 'profile',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'action',
|
|
91
|
+
action: (e) => {
|
|
92
|
+
console.log('shop');
|
|
93
|
+
},
|
|
94
|
+
icon: <SystemIcons.ShoppingCart/>,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'switcher',
|
|
98
|
+
action: (e) => {
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
window.portalNav.toggle();
|
|
101
|
+
console.log('switcher')
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
const notifications: MenuNavigationItemTypeItem[] = [
|
|
107
|
+
{
|
|
108
|
+
label: 'First',
|
|
109
|
+
note: 'This is a note',
|
|
110
|
+
to: '/n7',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: 'Second',
|
|
114
|
+
note: 'This is a note',
|
|
115
|
+
to: '/n6',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: 'Third',
|
|
119
|
+
note: 'This is a note',
|
|
120
|
+
to: '/n5',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'Fourth',
|
|
124
|
+
note: 'This is a note',
|
|
125
|
+
to: '/n4',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: 'Fifth',
|
|
129
|
+
note: 'This is a note',
|
|
130
|
+
to: '/n3',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: 'Sixth',
|
|
134
|
+
note: 'This is a note',
|
|
135
|
+
to: '/n2',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: 'Seventh',
|
|
139
|
+
note: 'This is a note',
|
|
140
|
+
to: '/n1',
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
const mobileActions: MobileMenuButtonTypes[] = [
|
|
145
|
+
{
|
|
146
|
+
type: 'submenu',
|
|
147
|
+
menu: {
|
|
148
|
+
type: 'custom',
|
|
149
|
+
label: 'Search',
|
|
150
|
+
custom: () => 'custom'
|
|
151
|
+
},
|
|
152
|
+
icon: <SystemIcons.Search/>,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'submenu',
|
|
156
|
+
menu: {
|
|
157
|
+
type: 'group',
|
|
158
|
+
label: 'Notifications',
|
|
159
|
+
items: notifications
|
|
160
|
+
},
|
|
161
|
+
icon: <SystemIcons.Notification/>,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: 'action',
|
|
165
|
+
action: (e) => {
|
|
166
|
+
console.log('language');
|
|
167
|
+
return true;
|
|
168
|
+
},
|
|
169
|
+
icon: <SystemIcons.Language/>,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
type: 'profile',
|
|
173
|
+
placement: 'left'
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'switcher',
|
|
177
|
+
action: (e) => {
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
window.portalNav.toggle();
|
|
180
|
+
console.log('switcher')
|
|
181
|
+
},
|
|
182
|
+
}
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
const mobileStickyNav = [
|
|
186
|
+
{
|
|
187
|
+
label: 'Help',
|
|
188
|
+
to: '/help',
|
|
189
|
+
pinned: true,
|
|
190
|
+
icon: <SystemIcons.Help/>,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
label: 'Support',
|
|
194
|
+
to: '/support',
|
|
195
|
+
pinned: true,
|
|
196
|
+
icon: <SystemIcons.Support/>,
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
|
|
200
|
+
const accountSection = [
|
|
201
|
+
{label: 'My Account', to: '/account/myaccount', icon: <SystemIcons.User/>, external: false},
|
|
202
|
+
{label: 'Language & Region', to: '/account/language', icon: <SystemIcons.Language/>, external: false},
|
|
203
|
+
{label: 'Settings', to: '/account/settings', icon: <SystemIcons.GearSettings/>, external: false},
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
const organizationSection = [
|
|
207
|
+
{
|
|
208
|
+
label: 'Organization details',
|
|
209
|
+
to: '/organization/myorganization',
|
|
210
|
+
icon: <SystemIcons.Institute/>,
|
|
211
|
+
external: false
|
|
212
|
+
},
|
|
213
|
+
{label: 'People', to: '/organization/user-management', icon: <SystemIcons.Team/>, external: false},
|
|
214
|
+
];
|
|
215
|
+
|
|
216
|
+
const supportSection = [
|
|
217
|
+
{
|
|
218
|
+
label: 'Help',
|
|
219
|
+
to: 'https://laerdal.force.com/HelpCenter',
|
|
220
|
+
icon: <SystemIcons.Help/>,
|
|
221
|
+
external: true,
|
|
222
|
+
pinned: true
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: 'Support',
|
|
226
|
+
to: 'https://www.laerdal.com/support/',
|
|
227
|
+
icon: <SystemIcons.Support/>,
|
|
228
|
+
external: true,
|
|
229
|
+
pinned: true
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
|
|
233
|
+
const mobileNavigationSubGroup = {
|
|
234
|
+
type: 'group',
|
|
235
|
+
items: [...organizationSection, ...supportSection],
|
|
236
|
+
note: 'This is a note',
|
|
237
|
+
header: {
|
|
238
|
+
header: 'Title',
|
|
239
|
+
note: 'Note Text'
|
|
240
|
+
},
|
|
241
|
+
footer: {
|
|
242
|
+
header: 'Title',
|
|
243
|
+
note: 'Note text',
|
|
244
|
+
link: {
|
|
245
|
+
label: 'Link text',
|
|
246
|
+
href: '#',
|
|
247
|
+
external: false
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
action: {
|
|
251
|
+
label: 'Sign out',
|
|
252
|
+
action: () => {
|
|
253
|
+
console.log('Sign out');
|
|
254
|
+
},
|
|
255
|
+
icon: <SystemIcons.Logout/>
|
|
256
|
+
},
|
|
257
|
+
label: 'Organization',
|
|
258
|
+
icon: <SystemIcons.Institute/>,
|
|
259
|
+
} as MenuNavigationItemTypeGroup;
|
|
260
|
+
|
|
261
|
+
it('should render header', () => {
|
|
262
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenuContent header={{header: 'header', note: 'note'}}/> </NavigationProvider>)
|
|
263
|
+
|
|
264
|
+
expect(wrapper.getByText('header')).toBeDefined();
|
|
265
|
+
expect(wrapper.getByText('note')).toBeDefined();
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('should render footer', () => {
|
|
269
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenuContent
|
|
270
|
+
footer={{header: 'header', note: 'note', link: {label: 'link', href: '#'}}}/></NavigationProvider>)
|
|
271
|
+
|
|
272
|
+
expect(wrapper.getByText('header')).toBeDefined();
|
|
273
|
+
expect(wrapper.getByText('note')).toBeDefined();
|
|
274
|
+
expect(wrapper.getByText('link')).toBeDefined();
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it('should render action', () => {
|
|
278
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenuContent
|
|
279
|
+
action={{action: jest.fn(), label: 'action'}}/></NavigationProvider>)
|
|
280
|
+
|
|
281
|
+
expect(wrapper.getByText('action')).toBeDefined();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('should render items', () => {
|
|
285
|
+
const items = [mobileNavigationSubGroup, ...mainNavigationOptions, ...mobileStickyNav]
|
|
286
|
+
const wrapper = render(<NavigationProvider {...navProps}><MobileMenuContent
|
|
287
|
+
items={items}/></NavigationProvider>)
|
|
288
|
+
|
|
289
|
+
items.forEach(item => {
|
|
290
|
+
expect(wrapper.getByText(item.label)).toBeDefined();
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
});
|