@laerdal/life-react-components 3.5.1-dev.16 → 3.5.1-dev.17
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 +25 -3
- package/dist/Accordion/ContentAccordion.cjs.map +1 -1
- package/dist/Accordion/ContentAccordion.js +25 -3
- package/dist/Accordion/ContentAccordion.js.map +1 -1
- package/dist/Accordion/styles.cjs +29 -3
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.js +29 -3
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/Banners/Banner.cjs +34 -29
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.js +34 -29
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Banners/OverviewBanner.cjs +6 -2
- package/dist/Banners/OverviewBanner.cjs.map +1 -1
- package/dist/Banners/OverviewBanner.js +6 -2
- package/dist/Banners/OverviewBanner.js.map +1 -1
- package/dist/Banners/styles.cjs +29 -29
- package/dist/Banners/styles.cjs.map +1 -1
- package/dist/Banners/styles.d.ts +1 -1
- package/dist/Banners/styles.js +29 -29
- package/dist/Banners/styles.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +4 -2
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +4 -2
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Breadcrumb/styles.cjs +7 -3
- package/dist/Breadcrumb/styles.cjs.map +1 -1
- package/dist/Breadcrumb/styles.js +7 -3
- package/dist/Breadcrumb/styles.js.map +1 -1
- package/dist/Button/BackButton.cjs +12 -2
- package/dist/Button/BackButton.cjs.map +1 -1
- package/dist/Button/BackButton.js +12 -2
- package/dist/Button/BackButton.js.map +1 -1
- package/dist/Button/Button.cjs +28 -28
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.js +28 -28
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +36 -10
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.js +36 -10
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.cjs +12 -2
- package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.js +12 -2
- package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +8 -2
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.js +8 -2
- package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +5 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +5 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
- package/dist/Card/VerticalCard/Card.cjs +12 -2
- package/dist/Card/VerticalCard/Card.cjs.map +1 -1
- package/dist/Card/VerticalCard/Card.js +12 -2
- package/dist/Card/VerticalCard/Card.js.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.cjs +16 -7
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.js +16 -7
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.cjs +8 -5
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.js +8 -5
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.cjs +6 -3
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.js +6 -3
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -1
- package/dist/Chips/ChipStyles.cjs +59 -1
- package/dist/Chips/ChipStyles.cjs.map +1 -1
- package/dist/Chips/ChipStyles.js +59 -1
- package/dist/Chips/ChipStyles.js.map +1 -1
- package/dist/ChipsInput/ChipInputField.cjs +33 -5
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +30 -5
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +5 -3
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +5 -3
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +93 -13
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.js +93 -13
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +16 -10
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +16 -10
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +5 -3
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.js +5 -3
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Footer/Components/FooterBottomLinks.cjs +3 -1
- package/dist/Footer/Components/FooterBottomLinks.cjs.map +1 -1
- package/dist/Footer/Components/FooterBottomLinks.js +3 -1
- package/dist/Footer/Components/FooterBottomLinks.js.map +1 -1
- package/dist/Footer/Components/FooterDropdownLinks.cjs +32 -4
- package/dist/Footer/Components/FooterDropdownLinks.cjs.map +1 -1
- package/dist/Footer/Components/FooterDropdownLinks.js +32 -4
- package/dist/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/Footer/Components/FooterNavSection.cjs +3 -1
- package/dist/Footer/Components/FooterNavSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNavSection.js +3 -1
- package/dist/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +26 -4
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +26 -4
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/Footer/Components/FooterTop.cjs +19 -6
- package/dist/Footer/Components/FooterTop.cjs.map +1 -1
- package/dist/Footer/Components/FooterTop.js +19 -6
- package/dist/Footer/Components/FooterTop.js.map +1 -1
- package/dist/Footer/Footer.cjs +3 -1
- package/dist/Footer/Footer.cjs.map +1 -1
- package/dist/Footer/Footer.js +3 -1
- package/dist/Footer/Footer.js.map +1 -1
- package/dist/Footer/SiteFooter.cjs +8 -2
- package/dist/Footer/SiteFooter.cjs.map +1 -1
- package/dist/Footer/SiteFooter.js +8 -2
- package/dist/Footer/SiteFooter.js.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +6 -2
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js +6 -2
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
- package/dist/GlobalNavigationBar/Logo.cjs +8 -7
- package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Logo.d.ts +1 -1
- package/dist/GlobalNavigationBar/Logo.js +8 -7
- package/dist/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs +6 -2
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js +6 -2
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +6 -2
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.js +6 -2
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +19 -5
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +19 -5
- package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs +42 -8
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.d.ts +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js +42 -8
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs +3 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js +3 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +7 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js +7 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs +26 -6
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js +26 -6
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +5 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +5 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -1
- package/dist/HyperLink/styling.cjs +32 -2
- package/dist/HyperLink/styling.cjs.map +1 -1
- package/dist/HyperLink/styling.d.ts +2 -2
- package/dist/HyperLink/styling.js +32 -2
- package/dist/HyperLink/styling.js.map +1 -1
- package/dist/InputFields/Checkbox.cjs +29 -3
- package/dist/InputFields/Checkbox.cjs.map +1 -1
- package/dist/InputFields/Checkbox.js +29 -3
- package/dist/InputFields/Checkbox.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +97 -5
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.js +94 -5
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs +11 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.js +11 -1
- package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
- package/dist/InputFields/Label.cjs +25 -4
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.js +25 -4
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +33 -5
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.js +33 -5
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs +3 -2
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.js +3 -2
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +12 -5
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +12 -5
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +31 -3
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.js +31 -3
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/RichTextField.cjs +34 -4
- package/dist/InputFields/RichTextField.cjs.map +1 -1
- package/dist/InputFields/RichTextField.js +31 -4
- package/dist/InputFields/RichTextField.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs +6 -2
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.js +3 -2
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +4 -2
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.js +4 -2
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +38 -5
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.js +38 -5
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs +15 -1
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +15 -1
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +31 -1
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.js +31 -1
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/styling.cjs +50 -13
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +3 -3
- package/dist/InputFields/styling.js +50 -13
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/LinearProgress/LinearProgress.cjs +47 -5
- package/dist/LinearProgress/LinearProgress.cjs.map +1 -1
- package/dist/LinearProgress/LinearProgress.js +47 -5
- package/dist/LinearProgress/LinearProgress.js.map +1 -1
- package/dist/List/ListRow.cjs +19 -1
- package/dist/List/ListRow.cjs.map +1 -1
- package/dist/List/ListRow.js +19 -1
- package/dist/List/ListRow.js.map +1 -1
- package/dist/LoadingPage/GlobalLoadingPage.cjs +11 -3
- package/dist/LoadingPage/GlobalLoadingPage.cjs.map +1 -1
- package/dist/LoadingPage/GlobalLoadingPage.js +11 -3
- package/dist/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/MenuItem/MenuItem.cjs +51 -2
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.d.ts +1 -1
- package/dist/MenuItem/MenuItem.js +52 -3
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/MiniProductCard/MiniProductCard.cjs +21 -6
- package/dist/MiniProductCard/MiniProductCard.cjs.map +1 -1
- package/dist/MiniProductCard/MiniProductCard.d.ts +1 -1
- package/dist/MiniProductCard/MiniProductCard.js +21 -6
- package/dist/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/Modals/Modal.cjs +3 -2
- package/dist/Modals/Modal.cjs.map +1 -1
- package/dist/Modals/Modal.js +3 -2
- package/dist/Modals/Modal.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +17 -7
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +14 -7
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +5 -3
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +5 -3
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalNote.cjs +6 -4
- package/dist/Modals/ModalNote.cjs.map +1 -1
- package/dist/Modals/ModalNote.js +6 -4
- package/dist/Modals/ModalNote.js.map +1 -1
- package/dist/Modals/ModalStyles.cjs +17 -15
- package/dist/Modals/ModalStyles.cjs.map +1 -1
- package/dist/Modals/ModalStyles.d.ts +2 -2
- package/dist/Modals/ModalStyles.js +17 -15
- package/dist/Modals/ModalStyles.js.map +1 -1
- package/dist/NavItem/NavItem.cjs +27 -1
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.js +27 -1
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/NotificationDot/NotificationDot.cjs +2 -2
- package/dist/NotificationDot/NotificationDot.cjs.map +1 -1
- package/dist/NotificationDot/NotificationDot.js +2 -2
- package/dist/NotificationDot/NotificationDot.js.map +1 -1
- package/dist/Paginator/Paginator.cjs +33 -3
- package/dist/Paginator/Paginator.cjs.map +1 -1
- package/dist/Paginator/Paginator.js +33 -3
- package/dist/Paginator/Paginator.js.map +1 -1
- package/dist/Panel/Panel.cjs +6 -2
- package/dist/Panel/Panel.cjs.map +1 -1
- package/dist/Panel/Panel.js +6 -2
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Popover/Popover.cjs +7 -4
- package/dist/Popover/Popover.cjs.map +1 -1
- package/dist/Popover/Popover.js +7 -4
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/ProfileButton/ProfileButton.cjs +11 -4
- package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
- package/dist/ProfileButton/ProfileButton.js +11 -4
- package/dist/ProfileButton/ProfileButton.js.map +1 -1
- package/dist/QuizButton/QuizButton.cjs +51 -14
- package/dist/QuizButton/QuizButton.cjs.map +1 -1
- package/dist/QuizButton/QuizButton.js +51 -14
- package/dist/QuizButton/QuizButton.js.map +1 -1
- package/dist/SegmentControl/SegmentControl.cjs +25 -3
- package/dist/SegmentControl/SegmentControl.cjs.map +1 -1
- package/dist/SegmentControl/SegmentControl.js +25 -3
- package/dist/SegmentControl/SegmentControl.js.map +1 -1
- package/dist/SideMenu/SideMenu.cjs +3 -1
- package/dist/SideMenu/SideMenu.cjs.map +1 -1
- package/dist/SideMenu/SideMenu.js +3 -1
- package/dist/SideMenu/SideMenu.js.map +1 -1
- package/dist/SideMenu/SideMenuFooter.cjs +9 -3
- package/dist/SideMenu/SideMenuFooter.cjs.map +1 -1
- package/dist/SideMenu/SideMenuFooter.js +9 -3
- package/dist/SideMenu/SideMenuFooter.js.map +1 -1
- package/dist/SideMenu/SideMenuHeader.cjs +7 -1
- package/dist/SideMenu/SideMenuHeader.cjs.map +1 -1
- package/dist/SideMenu/SideMenuHeader.js +7 -1
- package/dist/SideMenu/SideMenuHeader.js.map +1 -1
- package/dist/SkipToContent/SkipToContent.cjs +6 -2
- package/dist/SkipToContent/SkipToContent.cjs.map +1 -1
- package/dist/SkipToContent/SkipToContent.js +6 -2
- package/dist/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.cjs +27 -1
- package/dist/Switcher/SwitcherMenuItem.cjs.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.js +27 -1
- package/dist/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/Table/TableFooter.cjs +4 -2
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +4 -2
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableStyles.cjs +80 -12
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +80 -12
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Tabs/HorizontalTabs.cjs +36 -2
- package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
- package/dist/Tabs/HorizontalTabs.js +36 -2
- package/dist/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/Tabs/TabLink.cjs +33 -3
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.js +33 -3
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tag/Tag.cjs +25 -1
- package/dist/Tag/Tag.cjs.map +1 -1
- package/dist/Tag/Tag.js +25 -1
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tile/Tile.cjs +5 -1
- package/dist/Tile/Tile.cjs.map +1 -1
- package/dist/Tile/Tile.js +5 -1
- package/dist/Tile/Tile.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +6 -2
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.js +6 -2
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Tile/TileFooter.cjs +3 -1
- package/dist/Tile/TileFooter.cjs.map +1 -1
- package/dist/Tile/TileFooter.js +3 -1
- package/dist/Tile/TileFooter.js.map +1 -1
- package/dist/Tile/TileHeader.cjs +12 -4
- package/dist/Tile/TileHeader.cjs.map +1 -1
- package/dist/Tile/TileHeader.js +9 -4
- package/dist/Tile/TileHeader.js.map +1 -1
- package/dist/Toasters/Toast.cjs +49 -4
- package/dist/Toasters/Toast.cjs.map +1 -1
- package/dist/Toasters/Toast.js +50 -5
- package/dist/Toasters/Toast.js.map +1 -1
- package/dist/Toggles/ToggleButton.cjs +7 -1
- package/dist/Toggles/ToggleButton.cjs.map +1 -1
- package/dist/Toggles/ToggleButton.js +7 -1
- package/dist/Toggles/ToggleButton.js.map +1 -1
- package/dist/Toggles/ToggleSwitch.cjs +3 -2
- package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
- package/dist/Toggles/ToggleSwitch.js +3 -2
- package/dist/Toggles/ToggleSwitch.js.map +1 -1
- package/dist/Toggles/TogglerStyles.cjs +38 -2
- package/dist/Toggles/TogglerStyles.cjs.map +1 -1
- package/dist/Toggles/TogglerStyles.js +38 -2
- package/dist/Toggles/TogglerStyles.js.map +1 -1
- package/dist/Tooltips/TooltipStyles.cjs +10 -8
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.js +10 -8
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/common/InputStyling.cjs +15 -1
- package/dist/common/InputStyling.cjs.map +1 -1
- package/dist/common/InputStyling.d.ts +1 -1
- package/dist/common/InputStyling.js +15 -1
- package/dist/common/InputStyling.js.map +1 -1
- package/dist/styles/global.cjs +11 -3
- package/dist/styles/global.cjs.map +1 -1
- package/dist/styles/global.js +11 -3
- package/dist/styles/global.js.map +1 -1
- package/dist/styles/index.cjs +9 -1
- package/dist/styles/index.cjs.map +1 -1
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.js +9 -1
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/typography.cjs +3 -1
- package/dist/styles/typography.cjs.map +1 -1
- package/dist/styles/typography.d.ts +6 -6
- package/dist/styles/typography.js +3 -1
- package/dist/styles/typography.js.map +1 -1
- package/package.json +1 -1
package/dist/Panel/Panel.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.cjs","names":["_react","_interopRequireDefault","require","_styledComponents","_styles","_Button","_icons","_LinearProgress","_rooks","_types","_jsxRuntime","_excluded","_excluded2","_templateObject","_templateObject2","_templateObject3","_templateObject4","_Panel$propTypes","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Wrapper","styled","div","_taggedTemplateLiteral2","COLORS","neutral_20","BREAKPOINTS","LARGE","Media","Body","neutral_600","Footer","Panel","props","_currentItem$media","_currentItem$media2","_React$useState","React","useState","_React$useState2","_slicedToArray2","currentImage","setCurrentImage","isLargeScreen","useMediaMatch","replace","rest","order","undefined","media","title","content","items","type","_props","_props$items","_objectWithoutProperties2","_props2","_props2$title","moveLeft","moveRight","currentItem","jsxs","className","concat","children","jsx","fit","src","alt","Quote","IconButton","action","variant","shape","SystemIcons","ChevronLeft","LinearProgress","size","Size","Large","Medium","value","max","LinearProgressType","Dots","ChevronRight","exports","propTypes","_propTypes","oneOf","oneOfType","isRequired","string","node","arrayOf"],"sources":["../../src/Panel/Panel.tsx"],"sourcesContent":["import React from 'react';\r\nimport styled from \"styled-components\";\r\nimport {BREAKPOINTS, COLORS, Quote} from \"../styles\";\r\nimport {IconButton} from \"../Button\";\r\nimport {SystemIcons} from \"../icons\";\r\nimport {LinearProgress, LinearProgressType} from \"../LinearProgress\";\r\nimport {useMediaMatch} from \"rooks\";\r\nimport {Size} from \"../types\";\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n background: ${COLORS.neutral_20};\r\n min-height: 100%;\r\n align-items: flex-end;\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n\r\n gap: 24px;\r\n padding: 24px 32px 64px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n gap: 32px;\r\n padding: 32px 64px 128px;\r\n }\r\n\r\n &.reverse {\r\n align-items: flex-start;\r\n }\r\n`;\r\n\r\nconst Media = styled.div`\r\n display: flex;\r\n width: 320px;\r\n height: 200px;\r\n\r\n\r\n img {\r\n object-fit: contain;\r\n }\r\n\r\n img.fit {\r\n object-fit: contain;\r\n }\r\n\r\n img.fill {\r\n object-fit: cover;\r\n }\r\n\r\n max-width: 100%;\r\n\r\n img {\r\n max-width: 100%;\r\n width: 320px;\r\n height: 200px;\r\n }\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n width: 488px;\r\n height: 280px;\r\n\r\n img {\r\n width: 488px;\r\n height: 280px;\r\n }\r\n }\r\n\r\n`;\r\n\r\nconst Body = styled.div`\r\n flex: 1;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center;\r\n\r\n width: 100%;\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n \r\n p:not(:first-of-type) {\r\n flex: 1;\r\n color: ${COLORS.neutral_600};\r\n }\r\n\r\n\r\n`;\r\nconst Footer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 100%;\r\n\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n\r\n .progress {\r\n width: max-content;\r\n }\r\n`;\r\n\r\nexport interface BasePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'> {\r\n type?: 'default' | 'carousel';\r\n}\r\n\r\nexport interface PanelContent {\r\n media?: { type: 'image', src: string; alt: string, fit?: 'fill' | 'fit' } | { type: 'custom', content: React.ReactNode };\r\n title?: string;\r\n content?: React.ReactNode;\r\n}\r\n\r\nexport interface DefaultPanelProps extends BasePanelProps, PanelContent {\r\n /**\r\n * Optional. Specifies the type of the panel as 'default'.\r\n * If not specified, the type defaults to 'default'.\r\n */\r\n type?: 'default';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n}\r\n\r\nexport interface CarouselPanelProps extends BasePanelProps {\r\n /**\r\n * Required. Specifies the type of the panel as 'carousel'.\r\n */\r\n type: 'carousel';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n\r\n /**\r\n * Optional. An array of PanelContent objects.\r\n * Each object represents a slide in the carousel.\r\n */\r\n items?: PanelContent[];\r\n}\r\nexport type PanelProps = DefaultPanelProps | CarouselPanelProps;\r\n\r\nexport const Panel = (props: PanelProps) => {\r\n\r\n const [currentImage, setCurrentImage] = React.useState(0);\r\n const isLargeScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\r\n\r\n let rest: React.HTMLAttributes<HTMLDivElement> = {};\r\n let order = undefined;\r\n let media = undefined;\r\n let title = '';\r\n let content = undefined;\r\n let items: PanelContent[] = [];\r\n\r\n\r\n switch (props.type) {\r\n case 'carousel':\r\n ({items = [], order, ...rest} = props);\r\n break;\r\n case 'default':\r\n default:\r\n ({media, content, title = '', order, ...rest} = props)\r\n break;\r\n }\r\n\r\n\r\n const moveLeft = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);\r\n }\r\n const moveRight = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);\r\n }\r\n\r\n const currentItem: PanelContent = props.type === 'carousel' ? items[currentImage] : {media, title, content};\r\n\r\n return (\r\n <Wrapper {...rest} className={`${rest.className || ''} ${order || ''} `}>\r\n <Media>\r\n {\r\n currentItem.media?.type === 'image' &&\r\n <img className={currentItem.media.fit} src={currentItem.media.src} alt={currentItem.media.alt}/>\r\n }\r\n {\r\n currentItem.media?.type === 'custom' && currentItem.media.content\r\n }\r\n </Media>\r\n <Body>\r\n <Quote>{currentItem.title}</Quote>\r\n <p>{currentItem.content}</p>\r\n </Body>\r\n {\r\n props.type === 'carousel' &&\r\n <Footer>\r\n <IconButton action={moveLeft} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronLeft/>\r\n </IconButton>\r\n <LinearProgress size={isLargeScreen ? Size.Large : Size.Medium}\r\n className={'progress'}\r\n value={currentImage + 1}\r\n max={props.items!.length }\r\n type={LinearProgressType.Dots}/>\r\n <IconButton action={moveRight} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronRight/>\r\n </IconButton>\r\n </Footer>\r\n }\r\n </Wrapper>\r\n )\r\n};\r\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA8B,IAAAQ,WAAA,GAAAR,OAAA;AAAA,IAAAS,SAAA;EAAAC,UAAA;AAAA,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAA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AAlB,gBAAA,WAAA2F,UAAA,YAAAC,KAAA,EAMR,SAAS,EAAG,SAAS,SAAA1E,gBAAA,aAAAlB,gBAAA,WAAA2F,UAAA,YAAAM,OAAA,CAAAN,UAAA,YAAAf,KAAA;EA7B7BzB,KAAK,EAAAwC,UAAA,YAAAE,SAAA,EAAAF,UAAA,YAAAf,KAAA;IAAKrB,IAAI,EAAAoC,UAAA,YAAAC,KAAA,EAAE,OAAO,GAAAE,UAAA;IAAExB,GAAG,EAAAqB,UAAA,YAAAI,MAAA,CAAAD,UAAA;IAAUvB,GAAG,EAAAoB,UAAA,YAAAI,MAAA,CAAAD,UAAA;IAAUzB,GAAG,EAAAsB,UAAA,YAAAC,KAAA,EAAG,MAAM,EAAG,KAAK;EAAA,IAAAD,UAAA,YAAAf,KAAA;IAAOrB,IAAI,EAAAoC,UAAA,YAAAC,KAAA,EAAE,QAAQ,GAAAE,UAAA;IAAEzC,OAAO,EAAAsC,UAAA,YAAAK,IAAA,CAAAF;EAAA;EACrG1C,KAAK,EAAAuC,UAAA,YAAAI,MAAA;EACL1C,OAAO,EAAAsC,UAAA,YAAAK;AAAA,MAAAhG,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Panel.cjs","names":["_react","_interopRequireDefault","require","_styledComponents","_styles","_Button","_icons","_LinearProgress","_rooks","_types","_jsxRuntime","_excluded","_excluded2","_templateObject","_templateObject2","_templateObject3","_templateObject4","_Panel$propTypes","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Wrapper","styled","div","_taggedTemplateLiteral2","props","COLORS","getColor","theme","BREAKPOINTS","LARGE","Media","Body","Footer","Panel","_currentItem$media","_currentItem$media2","_React$useState","React","useState","_React$useState2","_slicedToArray2","currentImage","setCurrentImage","isLargeScreen","useMediaMatch","replace","rest","order","undefined","media","title","content","items","type","_props","_props$items","_objectWithoutProperties2","_props2","_props2$title","moveLeft","moveRight","currentItem","jsxs","className","concat","children","jsx","fit","src","alt","Quote","IconButton","action","variant","shape","SystemIcons","ChevronLeft","LinearProgress","size","Size","Large","Medium","value","max","LinearProgressType","Dots","ChevronRight","exports","propTypes","_propTypes","oneOf","oneOfType","isRequired","string","node","arrayOf"],"sources":["../../src/Panel/Panel.tsx"],"sourcesContent":["import React from 'react';\r\nimport styled from \"styled-components\";\r\nimport {BREAKPOINTS, COLORS, Quote} from \"../styles\";\r\nimport {IconButton} from \"../Button\";\r\nimport {SystemIcons} from \"../icons\";\r\nimport {LinearProgress, LinearProgressType} from \"../LinearProgress\";\r\nimport {useMediaMatch} from \"rooks\";\r\nimport {Size} from \"../types\";\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n background: ${props => COLORS.getColor('neutral_20', props.theme)};\r\n min-height: 100%;\r\n align-items: flex-end;\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n\r\n gap: 24px;\r\n padding: 24px 32px 64px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n gap: 32px;\r\n padding: 32px 64px 128px;\r\n }\r\n\r\n &.reverse {\r\n align-items: flex-start;\r\n }\r\n`;\r\n\r\nconst Media = styled.div`\r\n display: flex;\r\n width: 320px;\r\n height: 200px;\r\n\r\n\r\n img {\r\n object-fit: contain;\r\n }\r\n\r\n img.fit {\r\n object-fit: contain;\r\n }\r\n\r\n img.fill {\r\n object-fit: cover;\r\n }\r\n\r\n max-width: 100%;\r\n\r\n img {\r\n max-width: 100%;\r\n width: 320px;\r\n height: 200px;\r\n }\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n width: 488px;\r\n height: 280px;\r\n\r\n img {\r\n width: 488px;\r\n height: 280px;\r\n }\r\n }\r\n\r\n`;\r\n\r\nconst Body = styled.div`\r\n flex: 1;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center;\r\n\r\n width: 100%;\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n \r\n p:not(:first-of-type) {\r\n flex: 1;\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n }\r\n\r\n\r\n`;\r\nconst Footer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 100%;\r\n\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n\r\n .progress {\r\n width: max-content;\r\n }\r\n`;\r\n\r\nexport interface BasePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'> {\r\n type?: 'default' | 'carousel';\r\n}\r\n\r\nexport interface PanelContent {\r\n media?: { type: 'image', src: string; alt: string, fit?: 'fill' | 'fit' } | { type: 'custom', content: React.ReactNode };\r\n title?: string;\r\n content?: React.ReactNode;\r\n}\r\n\r\nexport interface DefaultPanelProps extends BasePanelProps, PanelContent {\r\n /**\r\n * Optional. Specifies the type of the panel as 'default'.\r\n * If not specified, the type defaults to 'default'.\r\n */\r\n type?: 'default';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n}\r\n\r\nexport interface CarouselPanelProps extends BasePanelProps {\r\n /**\r\n * Required. Specifies the type of the panel as 'carousel'.\r\n */\r\n type: 'carousel';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n\r\n /**\r\n * Optional. An array of PanelContent objects.\r\n * Each object represents a slide in the carousel.\r\n */\r\n items?: PanelContent[];\r\n}\r\nexport type PanelProps = DefaultPanelProps | CarouselPanelProps;\r\n\r\nexport const Panel = (props: PanelProps) => {\r\n\r\n const [currentImage, setCurrentImage] = React.useState(0);\r\n const isLargeScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\r\n\r\n let rest: React.HTMLAttributes<HTMLDivElement> = {};\r\n let order = undefined;\r\n let media = undefined;\r\n let title = '';\r\n let content = undefined;\r\n let items: PanelContent[] = [];\r\n\r\n\r\n switch (props.type) {\r\n case 'carousel':\r\n ({items = [], order, ...rest} = props);\r\n break;\r\n case 'default':\r\n default:\r\n ({media, content, title = '', order, ...rest} = props)\r\n break;\r\n }\r\n\r\n\r\n const moveLeft = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);\r\n }\r\n const moveRight = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);\r\n }\r\n\r\n const currentItem: PanelContent = props.type === 'carousel' ? items[currentImage] : {media, title, content};\r\n\r\n return (\r\n <Wrapper {...rest} className={`${rest.className || ''} ${order || ''} `}>\r\n <Media>\r\n {\r\n currentItem.media?.type === 'image' &&\r\n <img className={currentItem.media.fit} src={currentItem.media.src} alt={currentItem.media.alt}/>\r\n }\r\n {\r\n currentItem.media?.type === 'custom' && currentItem.media.content\r\n }\r\n </Media>\r\n <Body>\r\n <Quote>{currentItem.title}</Quote>\r\n <p>{currentItem.content}</p>\r\n </Body>\r\n {\r\n props.type === 'carousel' &&\r\n <Footer>\r\n <IconButton action={moveLeft} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronLeft/>\r\n </IconButton>\r\n <LinearProgress size={isLargeScreen ? Size.Large : Size.Medium}\r\n className={'progress'}\r\n value={currentImage + 1}\r\n max={props.items!.length }\r\n type={LinearProgressType.Dots}/>\r\n <IconButton action={moveRight} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronRight/>\r\n </IconButton>\r\n </Footer>\r\n }\r\n </Wrapper>\r\n )\r\n};\r\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAA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,EAAAsB,UAAA,YAAAC,KAAA,EAAG,MAAM,EAAG,KAAK;EAAA,IAAAD,UAAA,YAAAf,KAAA;IAAOrB,IAAI,EAAAoC,UAAA,YAAAC,KAAA,EAAE,QAAQ,GAAAE,UAAA;IAAEzC,OAAO,EAAAsC,UAAA,YAAAK,IAAA,CAAAF;EAAA;EACrG1C,KAAK,EAAAuC,UAAA,YAAAI,MAAA;EACL1C,OAAO,EAAAsC,UAAA,YAAAK;AAAA,MAAAhG,gBAAA","ignoreList":[]}
|
package/dist/Panel/Panel.js
CHANGED
|
@@ -18,9 +18,13 @@ import { useMediaMatch } from "rooks";
|
|
|
18
18
|
import { Size } from "../types";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n background: ", ";\n min-height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n overflow: hidden;\n\n gap: 24px;\n padding: 24px 32px 64px;\n\n ", " {\n gap: 32px;\n padding: 32px 64px 128px;\n }\n\n &.reverse {\n align-items: flex-start;\n }\n"])),
|
|
21
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n background: ", ";\n min-height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n overflow: hidden;\n\n gap: 24px;\n padding: 24px 32px 64px;\n\n ", " {\n gap: 32px;\n padding: 32px 64px 128px;\n }\n\n &.reverse {\n align-items: flex-start;\n }\n"])), function (props) {
|
|
22
|
+
return COLORS.getColor('neutral_20', props.theme);
|
|
23
|
+
}, BREAKPOINTS.LARGE);
|
|
22
24
|
var Media = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n width: 320px;\n height: 200px;\n\n\n img {\n object-fit: contain;\n }\n\n img.fit {\n object-fit: contain;\n }\n\n img.fill {\n object-fit: cover;\n }\n\n max-width: 100%;\n\n img {\n max-width: 100%;\n width: 320px;\n height: 200px;\n }\n\n ", " {\n width: 488px;\n height: 280px;\n\n img {\n width: 488px;\n height: 280px;\n }\n }\n\n"])), BREAKPOINTS.LARGE);
|
|
23
|
-
var Body = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n\n width: 100%;\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n \n p:not(:first-of-type) {\n flex: 1;\n color: ", ";\n }\n\n\n"])), BREAKPOINTS.LARGE,
|
|
25
|
+
var Body = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n\n width: 100%;\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n \n p:not(:first-of-type) {\n flex: 1;\n color: ", ";\n }\n\n\n"])), BREAKPOINTS.LARGE, function (props) {
|
|
26
|
+
return COLORS.getColor('neutral_600', props.theme);
|
|
27
|
+
});
|
|
24
28
|
var Footer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n\n .progress {\n width: max-content;\n }\n"])), BREAKPOINTS.LARGE);
|
|
25
29
|
export var Panel = function Panel(props) {
|
|
26
30
|
var _currentItem$media, _currentItem$media2;
|
package/dist/Panel/Panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.js","names":["React","styled","BREAKPOINTS","COLORS","Quote","IconButton","SystemIcons","LinearProgress","LinearProgressType","useMediaMatch","Size","jsx","_jsx","jsxs","_jsxs","Wrapper","div","_templateObject","_taggedTemplateLiteral","neutral_20","LARGE","Media","_templateObject2","Body","_templateObject3","neutral_600","Footer","_templateObject4","Panel","props","_currentItem$media","_currentItem$media2","_React$useState","useState","_React$useState2","_slicedToArray","currentImage","setCurrentImage","isLargeScreen","replace","rest","order","undefined","media","title","content","items","type","_props","_props$items","_objectWithoutProperties","_excluded","_props2","_props2$title","_excluded2","moveLeft","length","moveRight","currentItem","_objectSpread","className","concat","children","fit","src","alt","action","variant","shape","ChevronLeft","size","Large","Medium","value","max","Dots","ChevronRight","propTypes","_Panel$propTypes","_pt","oneOf","oneOfType","isRequired","string","node","_defineProperty","arrayOf"],"sources":["../../src/Panel/Panel.tsx"],"sourcesContent":["import React from 'react';\r\nimport styled from \"styled-components\";\r\nimport {BREAKPOINTS, COLORS, Quote} from \"../styles\";\r\nimport {IconButton} from \"../Button\";\r\nimport {SystemIcons} from \"../icons\";\r\nimport {LinearProgress, LinearProgressType} from \"../LinearProgress\";\r\nimport {useMediaMatch} from \"rooks\";\r\nimport {Size} from \"../types\";\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n background: ${COLORS.neutral_20};\r\n min-height: 100%;\r\n align-items: flex-end;\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n\r\n gap: 24px;\r\n padding: 24px 32px 64px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n gap: 32px;\r\n padding: 32px 64px 128px;\r\n }\r\n\r\n &.reverse {\r\n align-items: flex-start;\r\n }\r\n`;\r\n\r\nconst Media = styled.div`\r\n display: flex;\r\n width: 320px;\r\n height: 200px;\r\n\r\n\r\n img {\r\n object-fit: contain;\r\n }\r\n\r\n img.fit {\r\n object-fit: contain;\r\n }\r\n\r\n img.fill {\r\n object-fit: cover;\r\n }\r\n\r\n max-width: 100%;\r\n\r\n img {\r\n max-width: 100%;\r\n width: 320px;\r\n height: 200px;\r\n }\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n width: 488px;\r\n height: 280px;\r\n\r\n img {\r\n width: 488px;\r\n height: 280px;\r\n }\r\n }\r\n\r\n`;\r\n\r\nconst Body = styled.div`\r\n flex: 1;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center;\r\n\r\n width: 100%;\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n \r\n p:not(:first-of-type) {\r\n flex: 1;\r\n color: ${COLORS.neutral_600};\r\n }\r\n\r\n\r\n`;\r\nconst Footer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 100%;\r\n\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n\r\n .progress {\r\n width: max-content;\r\n }\r\n`;\r\n\r\nexport interface BasePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'> {\r\n type?: 'default' | 'carousel';\r\n}\r\n\r\nexport interface PanelContent {\r\n media?: { type: 'image', src: string; alt: string, fit?: 'fill' | 'fit' } | { type: 'custom', content: React.ReactNode };\r\n title?: string;\r\n content?: React.ReactNode;\r\n}\r\n\r\nexport interface DefaultPanelProps extends BasePanelProps, PanelContent {\r\n /**\r\n * Optional. Specifies the type of the panel as 'default'.\r\n * If not specified, the type defaults to 'default'.\r\n */\r\n type?: 'default';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n}\r\n\r\nexport interface CarouselPanelProps extends BasePanelProps {\r\n /**\r\n * Required. Specifies the type of the panel as 'carousel'.\r\n */\r\n type: 'carousel';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n\r\n /**\r\n * Optional. An array of PanelContent objects.\r\n * Each object represents a slide in the carousel.\r\n */\r\n items?: PanelContent[];\r\n}\r\nexport type PanelProps = DefaultPanelProps | CarouselPanelProps;\r\n\r\nexport const Panel = (props: PanelProps) => {\r\n\r\n const [currentImage, setCurrentImage] = React.useState(0);\r\n const isLargeScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\r\n\r\n let rest: React.HTMLAttributes<HTMLDivElement> = {};\r\n let order = undefined;\r\n let media = undefined;\r\n let title = '';\r\n let content = undefined;\r\n let items: PanelContent[] = [];\r\n\r\n\r\n switch (props.type) {\r\n case 'carousel':\r\n ({items = [], order, ...rest} = props);\r\n break;\r\n case 'default':\r\n default:\r\n ({media, content, title = '', order, ...rest} = props)\r\n break;\r\n }\r\n\r\n\r\n const moveLeft = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);\r\n }\r\n const moveRight = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);\r\n }\r\n\r\n const currentItem: PanelContent = props.type === 'carousel' ? items[currentImage] : {media, title, content};\r\n\r\n return (\r\n <Wrapper {...rest} className={`${rest.className || ''} ${order || ''} `}>\r\n <Media>\r\n {\r\n currentItem.media?.type === 'image' &&\r\n <img className={currentItem.media.fit} src={currentItem.media.src} alt={currentItem.media.alt}/>\r\n }\r\n {\r\n currentItem.media?.type === 'custom' && currentItem.media.content\r\n }\r\n </Media>\r\n <Body>\r\n <Quote>{currentItem.title}</Quote>\r\n <p>{currentItem.content}</p>\r\n </Body>\r\n {\r\n props.type === 'carousel' &&\r\n <Footer>\r\n <IconButton action={moveLeft} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronLeft/>\r\n </IconButton>\r\n <LinearProgress size={isLargeScreen ? Size.Large : Size.Medium}\r\n className={'progress'}\r\n value={currentImage + 1}\r\n max={props.items!.length }\r\n type={LinearProgressType.Dots}/>\r\n <IconButton action={moveRight} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronRight/>\r\n </IconButton>\r\n </Footer>\r\n }\r\n </Wrapper>\r\n )\r\n};\r\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAA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ton","SystemIcons","LinearProgress","LinearProgressType","useMediaMatch","Size","jsx","_jsx","jsxs","_jsxs","Wrapper","div","_templateObject","_taggedTemplateLiteral","props","getColor","theme","LARGE","Media","_templateObject2","Body","_templateObject3","Footer","_templateObject4","Panel","_currentItem$media","_currentItem$media2","_React$useState","useState","_React$useState2","_slicedToArray","currentImage","setCurrentImage","isLargeScreen","replace","rest","order","undefined","media","title","content","items","type","_props","_props$items","_objectWithoutProperties","_excluded","_props2","_props2$title","_excluded2","moveLeft","length","moveRight","currentItem","_objectSpread","className","concat","children","fit","src","alt","action","variant","shape","ChevronLeft","size","Large","Medium","value","max","Dots","ChevronRight","propTypes","_Panel$propTypes","_pt","oneOf","oneOfType","isRequired","string","node","_defineProperty","arrayOf"],"sources":["../../src/Panel/Panel.tsx"],"sourcesContent":["import React from 'react';\r\nimport styled from \"styled-components\";\r\nimport {BREAKPOINTS, COLORS, Quote} from \"../styles\";\r\nimport {IconButton} from \"../Button\";\r\nimport {SystemIcons} from \"../icons\";\r\nimport {LinearProgress, LinearProgressType} from \"../LinearProgress\";\r\nimport {useMediaMatch} from \"rooks\";\r\nimport {Size} from \"../types\";\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n background: ${props => COLORS.getColor('neutral_20', props.theme)};\r\n min-height: 100%;\r\n align-items: flex-end;\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n\r\n gap: 24px;\r\n padding: 24px 32px 64px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n gap: 32px;\r\n padding: 32px 64px 128px;\r\n }\r\n\r\n &.reverse {\r\n align-items: flex-start;\r\n }\r\n`;\r\n\r\nconst Media = styled.div`\r\n display: flex;\r\n width: 320px;\r\n height: 200px;\r\n\r\n\r\n img {\r\n object-fit: contain;\r\n }\r\n\r\n img.fit {\r\n object-fit: contain;\r\n }\r\n\r\n img.fill {\r\n object-fit: cover;\r\n }\r\n\r\n max-width: 100%;\r\n\r\n img {\r\n max-width: 100%;\r\n width: 320px;\r\n height: 200px;\r\n }\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n width: 488px;\r\n height: 280px;\r\n\r\n img {\r\n width: 488px;\r\n height: 280px;\r\n }\r\n }\r\n\r\n`;\r\n\r\nconst Body = styled.div`\r\n flex: 1;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center;\r\n\r\n width: 100%;\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n \r\n p:not(:first-of-type) {\r\n flex: 1;\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n }\r\n\r\n\r\n`;\r\nconst Footer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 100%;\r\n\r\n max-width: 320px;\r\n\r\n ${BREAKPOINTS.LARGE} {\r\n max-width: 488px;\r\n }\r\n\r\n .progress {\r\n width: max-content;\r\n }\r\n`;\r\n\r\nexport interface BasePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'> {\r\n type?: 'default' | 'carousel';\r\n}\r\n\r\nexport interface PanelContent {\r\n media?: { type: 'image', src: string; alt: string, fit?: 'fill' | 'fit' } | { type: 'custom', content: React.ReactNode };\r\n title?: string;\r\n content?: React.ReactNode;\r\n}\r\n\r\nexport interface DefaultPanelProps extends BasePanelProps, PanelContent {\r\n /**\r\n * Optional. Specifies the type of the panel as 'default'.\r\n * If not specified, the type defaults to 'default'.\r\n */\r\n type?: 'default';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n}\r\n\r\nexport interface CarouselPanelProps extends BasePanelProps {\r\n /**\r\n * Required. Specifies the type of the panel as 'carousel'.\r\n */\r\n type: 'carousel';\r\n\r\n /**\r\n * Optional. Specifies the order of the content in the panel.\r\n * It can be 'default' or 'reverse'. Defaults to 'default' if not specified.\r\n */\r\n order?: 'default' | 'reverse';\r\n\r\n /**\r\n * Optional. An array of PanelContent objects.\r\n * Each object represents a slide in the carousel.\r\n */\r\n items?: PanelContent[];\r\n}\r\nexport type PanelProps = DefaultPanelProps | CarouselPanelProps;\r\n\r\nexport const Panel = (props: PanelProps) => {\r\n\r\n const [currentImage, setCurrentImage] = React.useState(0);\r\n const isLargeScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\r\n\r\n let rest: React.HTMLAttributes<HTMLDivElement> = {};\r\n let order = undefined;\r\n let media = undefined;\r\n let title = '';\r\n let content = undefined;\r\n let items: PanelContent[] = [];\r\n\r\n\r\n switch (props.type) {\r\n case 'carousel':\r\n ({items = [], order, ...rest} = props);\r\n break;\r\n case 'default':\r\n default:\r\n ({media, content, title = '', order, ...rest} = props)\r\n break;\r\n }\r\n\r\n\r\n const moveLeft = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);\r\n }\r\n const moveRight = () => {\r\n props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);\r\n }\r\n\r\n const currentItem: PanelContent = props.type === 'carousel' ? items[currentImage] : {media, title, content};\r\n\r\n return (\r\n <Wrapper {...rest} className={`${rest.className || ''} ${order || ''} `}>\r\n <Media>\r\n {\r\n currentItem.media?.type === 'image' &&\r\n <img className={currentItem.media.fit} src={currentItem.media.src} alt={currentItem.media.alt}/>\r\n }\r\n {\r\n currentItem.media?.type === 'custom' && currentItem.media.content\r\n }\r\n </Media>\r\n <Body>\r\n <Quote>{currentItem.title}</Quote>\r\n <p>{currentItem.content}</p>\r\n </Body>\r\n {\r\n props.type === 'carousel' &&\r\n <Footer>\r\n <IconButton action={moveLeft} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronLeft/>\r\n </IconButton>\r\n <LinearProgress size={isLargeScreen ? Size.Large : Size.Medium}\r\n className={'progress'}\r\n value={currentImage + 1}\r\n max={props.items!.length }\r\n type={LinearProgressType.Dots}/>\r\n <IconButton action={moveRight} variant={'secondary'} shape={'circular'}>\r\n <SystemIcons.ChevronRight/>\r\n </IconButton>\r\n </Footer>\r\n }\r\n </Wrapper>\r\n )\r\n};\r\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,WAAW,EAAEC,MAAM,EAAEC,KAAK,QAAO,WAAW;AACpD,SAAQC,UAAU,QAAO,WAAW;AACpC,SAAQC,WAAW,QAAO,UAAU;AACpC,SAAQC,cAAc,EAAEC,kBAAkB,QAAO,mBAAmB;AACpE,SAAQC,aAAa,QAAO,OAAO;AACnC,SAAQC,IAAI,QAAO,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE9B,IAAMC,OAAO,GAAGd,MAAM,CAACe,GAAG,CAAAC,eAAA,KAAAA,eAAA,GAAAC,sBAAA,4UAGV,UAAAC,KAAK;EAAA,OAAIhB,MAAM,CAACiB,QAAQ,CAAC,YAAY,EAAED,KAAK,CAACE,KAAK,CAAC;AAAA,GAS/DnB,WAAW,CAACoB,KAAK,CAQpB;AAED,IAAMC,KAAK,GAAGtB,MAAM,CAACe,GAAG,CAAAQ,gBAAA,KAAAA,gBAAA,GAAAN,sBAAA,maA0BpBhB,WAAW,CAACoB,KAAK,CAUpB;AAED,IAAMG,IAAI,GAAGxB,MAAM,CAACe,GAAG,CAAAU,gBAAA,KAAAA,gBAAA,GAAAR,sBAAA,0QAUnBhB,WAAW,CAACoB,KAAK,EAMR,UAAAH,KAAK;EAAA,OAAIhB,MAAM,CAACiB,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAAA,EAIhE;AACD,IAAMM,MAAM,GAAG1B,MAAM,CAACe,GAAG,CAAAY,gBAAA,KAAAA,gBAAA,GAAAV,sBAAA,+MAQrBhB,WAAW,CAACoB,KAAK,CAOpB;AA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,KAAA,EAAG,MAAM,EAAG,KAAK;EAAA,IAAAD,GAAA,CAAAX,KAAA;IAAOrB,IAAI,EAAAgC,GAAA,CAAAC,KAAA,EAAE,QAAQ,GAAAE,UAAA;IAAErC,OAAO,EAAAkC,GAAA,CAAAK,IAAA,CAAAF;EAAA;EACrGtC,KAAK,EAAAmC,GAAA,CAAAI,MAAA;EACLtC,OAAO,EAAAkC,GAAA,CAAAK;AAAA,MAAAN,gBAAA","ignoreList":[]}
|
package/dist/Popover/Popover.cjs
CHANGED
|
@@ -10,7 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _styledComponents =
|
|
13
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
14
14
|
var _ = require("..");
|
|
15
15
|
var _Button = require("../Button");
|
|
16
16
|
var _icons = require("../icons");
|
|
@@ -24,7 +24,9 @@ var PopoverContainer = _styledComponents["default"].div(_templateObject || (_tem
|
|
|
24
24
|
return props.size === _types.Size.Small ? '240px' : props.size === _types.Size.Large ? '480px' : '360px';
|
|
25
25
|
}, function (props) {
|
|
26
26
|
return props.size === _types.Size.Small ? '320px' : props.size === _types.Size.Large ? '640px' : '480px';
|
|
27
|
-
},
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return _.COLORS.getColor('white', props.theme);
|
|
29
|
+
}, _styles.BOXSHADOWS.BOXSHADOW_CENTERED, _styles.Z_INDEXES.popover, function (props) {
|
|
28
30
|
return props.position == _types.Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '';
|
|
29
31
|
}, function (props) {
|
|
30
32
|
return props.position == _types.Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '';
|
|
@@ -54,7 +56,7 @@ var TextContainer = _styledComponents["default"].div(_templateObject5 || (_templ
|
|
|
54
56
|
return renderMargins(props.note, props.size);
|
|
55
57
|
});
|
|
56
58
|
var NoteContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (props) {
|
|
57
|
-
return props.size === _types.Size.Small ? (0, _styles.ComponentXXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600) : props.size === _types.Size.Large ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600) : (0, _.ComponentXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600);
|
|
59
|
+
return props.size === _types.Size.Small ? (0, _styles.ComponentXXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.getColor('neutral_600', props.theme)) : props.size === _types.Size.Large ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Regular, _.COLORS.getColor('neutral_600', props.theme)) : (0, _.ComponentXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.getColor('neutral_600', props.theme));
|
|
58
60
|
});
|
|
59
61
|
var LabelContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (props) {
|
|
60
62
|
return props.size === _types.Size.Small ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Bold, null) : props.size === _types.Size.Large ? (0, _styles.ComponentLStyling)(_.ComponentTextStyle.Bold, null) : (0, _styles.ComponentMStyling)(_.ComponentTextStyle.Bold, null);
|
|
@@ -126,6 +128,7 @@ var Popover = function Popover(_ref) {
|
|
|
126
128
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
127
129
|
showPopover = _React$useState2[0],
|
|
128
130
|
setShowPopover = _React$useState2[1];
|
|
131
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
129
132
|
var popoverRef = React.useRef();
|
|
130
133
|
React.useEffect(function () {
|
|
131
134
|
var checkIfClickedOutside = function checkIfClickedOutside(e) {
|
|
@@ -167,7 +170,7 @@ var Popover = function Popover(_ref) {
|
|
|
167
170
|
return setShowPopover(false);
|
|
168
171
|
},
|
|
169
172
|
useTransparentBackground: true,
|
|
170
|
-
iconColor: _.COLORS.neutral_600,
|
|
173
|
+
iconColor: _.COLORS.getColor('neutral_600', theme),
|
|
171
174
|
variant: "secondary",
|
|
172
175
|
shape: "circular",
|
|
173
176
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.Close, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_","_Button","_icons","_styles","_types","_jsxRuntime","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PopoverContainer","styled","div","_taggedTemplateLiteral2","props","size","Size","Small","Large","COLORS","white","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","position","Position","Bottom","Top","Left","Right","showArrowPointer","renderArrowStyles","exports","PopoverTopSectionContainer","PopoverMiddleSectionContainer","scrollBarStyling","PopoverBottomSectionContainer","TextContainer","renderMargins","note","NoteContainer","ComponentXXSStyling","ComponentTextStyle","Regular","neutral_600","ComponentSStyling","ComponentXSStyling","LabelContainer","Bold","ComponentLStyling","ComponentMStyling","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","showOnClick","concat","showPopover","isNotePresent","Popover","_ref","_bottomSectionProps$t","_bottomSectionProps$i","_ref$size","Medium","topSectionProps","bottomSectionProps","mainContent","children","_ref$showOnClick","_ref$showArrowPointer","_React$useState","useState","_React$useState2","_slicedToArray2","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","current","contains","target","document","addEventListener","removeEventListener","jsxs","ref","jsx","text","IconButton","action","useTransparentBackground","iconColor","variant","shape","SystemIcons","Close","textButton","icon","Button","onClick","label","className","iconButtons","map","iconButton","propTypes","_propTypes","string","isRequired","arrayOf","node","func","bool","_default"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { Button, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ size: Size; position: Position; showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px')};\r\n min-width: ${(props) => (props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px')};\r\n border-radius: 4px;\r\n background: ${COLORS.white};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.showArrowPointer ? renderArrowStyles(props.position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ note: boolean; size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n margin: ${(props) => renderMargins(props.note, props.size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\r\n : props.size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ position: Position; showOnClick: boolean; showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.position === Position.Left || props.position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const popoverRef = React.useRef<any>();\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\r\n <PopoverContainer size={size} position={position} ref={popoverRef} showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer size={size}>\r\n <TextContainer note={!!topSectionProps?.note} size={size}>\r\n {topSectionProps?.note && <NoteContainer size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer size={size} data-testid={'textBtn'}>\r\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </Button>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n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C;IAAA,CAC9B,CAAC;EAAA,CACQ,CAAC;AAErB,CAAC;AAAC5C,OAAA,CAAAgD,SAAA;EAlHA1C,eAAe,EAAA2C,UAAA,YAAAb,KAAA;IAhDfN,IAAI,EAAAmB,UAAA,YAAAC,MAAA,CAAAC,UAAA;IAKJvE,IAAI,EAAAqE,UAAA,YAAAC;EAAA;EAgDJ3C,kBAAkB,EAAA0C,UAAA,YAAAb,KAAA;IAvBlBS,WAAW,EAAAI,UAAA,YAAAG,OAAA,CAAAH,UAAA,YAAAb,KAAA;MAlBXI,IAAI,EAAAS,UAAA,YAAAI,IAAA,CAAAF,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,YAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,YAAAC;IAAA;IAaLX,UAAU,EAAAU,UAAA,YAAAb,KAAA;MAvBVI,IAAI,EAAAS,UAAA,YAAAI,IAAA,CAAAF,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,YAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,YAAAC;IAAA;EAAA;EAoCL1C,WAAW,EAAAyC,UAAA,YAAAI,IAAA,CAAAF,UAAA;EAKX1C,QAAQ,EAAAwC,UAAA,YAAAI,IAAA,CAAAF,UAAA;EAWRvD,WAAW,EAAAqD,UAAA,YAAAM,IAAA,CAAAJ,UAAA;EAMXhF,gBAAgB,EAAA8E,UAAA,YAAAM;AAAA;AAAA,IAAAC,QAAA,GAoFHxD,OAAO;AAAA3B,OAAA,cAAAmF,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Popover.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_","_Button","_icons","_styles","_types","_jsxRuntime","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PopoverContainer","styled","div","_taggedTemplateLiteral2","props","size","Size","Small","Large","COLORS","getColor","theme","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","position","Position","Bottom","Top","Left","Right","showArrowPointer","renderArrowStyles","exports","PopoverTopSectionContainer","PopoverMiddleSectionContainer","scrollBarStyling","PopoverBottomSectionContainer","TextContainer","renderMargins","note","NoteContainer","ComponentXXSStyling","ComponentTextStyle","Regular","ComponentSStyling","ComponentXSStyling","LabelContainer","Bold","ComponentLStyling","ComponentMStyling","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","showOnClick","concat","showPopover","isNotePresent","Popover","_ref","_bottomSectionProps$t","_bottomSectionProps$i","_ref$size","Medium","topSectionProps","bottomSectionProps","mainContent","children","_ref$showOnClick","_ref$showArrowPointer","_React$useState","useState","_React$useState2","_slicedToArray2","setShowPopover","useTheme","popoverRef","useRef","useEffect","checkIfClickedOutside","current","contains","target","document","addEventListener","removeEventListener","jsxs","ref","jsx","text","IconButton","action","useTransparentBackground","iconColor","variant","shape","SystemIcons","Close","textButton","icon","Button","onClick","label","className","iconButtons","map","iconButton","propTypes","_propTypes","string","isRequired","arrayOf","node","func","bool","_default"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { Button, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ size: Size; position: Position; showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px')};\r\n min-width: ${(props) => (props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px')};\r\n border-radius: 4px;\r\n background: ${props => COLORS.getColor('white', props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.showArrowPointer ? renderArrowStyles(props.position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ note: boolean; size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n margin: ${(props) => renderMargins(props.note, props.size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))\r\n : props.size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ position: Position; showOnClick: boolean; showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.position === Position.Left || props.position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>();\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\r\n <PopoverContainer size={size} position={position} ref={popoverRef} showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer size={size}>\r\n <TextContainer note={!!topSectionProps?.note} size={size}>\r\n {topSectionProps?.note && <NoteContainer size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground iconColor={COLORS.getColor('neutral_600', theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer size={size} data-testid={'textBtn'}>\r\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </Button>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,CAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA0C,IAAAO,WAAA,GAAAP,OAAA;AAAA,IAAAQ,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OA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YAAAb,KAAA;IAvBlBS,WAAW,EAAAI,UAAA,YAAAG,OAAA,CAAAH,UAAA,YAAAb,KAAA;MAlBXI,IAAI,EAAAS,UAAA,YAAAI,IAAA,CAAAF,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,YAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,YAAAC;IAAA;IAaLX,UAAU,EAAAU,UAAA,YAAAb,KAAA;MAvBVI,IAAI,EAAAS,UAAA,YAAAI,IAAA,CAAAF,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,YAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,YAAAC;IAAA;EAAA;EAoCL3C,WAAW,EAAA0C,UAAA,YAAAI,IAAA,CAAAF,UAAA;EAKX3C,QAAQ,EAAAyC,UAAA,YAAAI,IAAA,CAAAF,UAAA;EAWRxD,WAAW,EAAAsD,UAAA,YAAAM,IAAA,CAAAJ,UAAA;EAMXhF,gBAAgB,EAAA8E,UAAA,YAAAM;AAAA;AAAA,IAAAC,QAAA,GAqFHzD,OAAO;AAAA1B,OAAA,cAAAmF,QAAA","ignoreList":[]}
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
|
|
|
3
3
|
import _pt from "prop-types";
|
|
4
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
6
|
+
import styled, { useTheme } from 'styled-components';
|
|
7
7
|
import { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';
|
|
8
8
|
import { Button, IconButton } from '../Button';
|
|
9
9
|
import { SystemIcons } from '../icons';
|
|
@@ -15,7 +15,9 @@ export var PopoverContainer = styled.div(_templateObject || (_templateObject = _
|
|
|
15
15
|
return props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px';
|
|
16
16
|
}, function (props) {
|
|
17
17
|
return props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px';
|
|
18
|
-
},
|
|
18
|
+
}, function (props) {
|
|
19
|
+
return COLORS.getColor('white', props.theme);
|
|
20
|
+
}, BOXSHADOWS.BOXSHADOW_CENTERED, Z_INDEXES.popover, function (props) {
|
|
19
21
|
return props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '';
|
|
20
22
|
}, function (props) {
|
|
21
23
|
return props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '';
|
|
@@ -41,7 +43,7 @@ var TextContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTe
|
|
|
41
43
|
return renderMargins(props.note, props.size);
|
|
42
44
|
});
|
|
43
45
|
var NoteContainer = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
44
|
-
return props.size === Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : props.size === Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600);
|
|
46
|
+
return props.size === Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme)) : props.size === Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme)) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme));
|
|
45
47
|
});
|
|
46
48
|
var LabelContainer = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
47
49
|
return props.size === Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : props.size === Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null);
|
|
@@ -112,6 +114,7 @@ var Popover = function Popover(_ref) {
|
|
|
112
114
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
113
115
|
showPopover = _React$useState2[0],
|
|
114
116
|
setShowPopover = _React$useState2[1];
|
|
117
|
+
var theme = useTheme();
|
|
115
118
|
var popoverRef = React.useRef();
|
|
116
119
|
React.useEffect(function () {
|
|
117
120
|
var checkIfClickedOutside = function checkIfClickedOutside(e) {
|
|
@@ -153,7 +156,7 @@ var Popover = function Popover(_ref) {
|
|
|
153
156
|
return setShowPopover(false);
|
|
154
157
|
},
|
|
155
158
|
useTransparentBackground: true,
|
|
156
|
-
iconColor: COLORS.neutral_600,
|
|
159
|
+
iconColor: COLORS.getColor('neutral_600', theme),
|
|
157
160
|
variant: "secondary",
|
|
158
161
|
shape: "circular",
|
|
159
162
|
children: /*#__PURE__*/_jsx(SystemIcons.Close, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Button","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","jsx","_jsx","jsxs","_jsxs","PopoverContainer","div","_templateObject","_taggedTemplateLiteral","props","size","Small","Large","white","BOXSHADOW_CENTERED","popover","position","Bottom","Top","Left","Right","showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","_templateObject2","PopoverMiddleSectionContainer","_templateObject3","PopoverBottomSectionContainer","_templateObject4","TextContainer","_templateObject5","renderMargins","note","NoteContainer","_templateObject6","Regular","neutral_600","LabelContainer","_templateObject7","Bold","CloseButtonContainer","_templateObject8","TextButtonContainer","_templateObject9","IconButtonContainer","_templateObject10","PopoverWrapper","_templateObject11","showOnClick","concat","showPopover","isNotePresent","Popover","_ref","_bottomSectionProps$t","_bottomSectionProps$i","_ref$size","Medium","topSectionProps","bottomSectionProps","mainContent","children","_ref$showOnClick","_ref$showArrowPointer","_React$useState","useState","_React$useState2","_slicedToArray","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","ref","text","action","useTransparentBackground","iconColor","variant","shape","Close","textButton","icon","onClick","label","className","iconButtons","map","iconButton","propTypes","_pt","string","isRequired","arrayOf","node","func","bool"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { Button, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ size: Size; position: Position; showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px')};\r\n min-width: ${(props) => (props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px')};\r\n border-radius: 4px;\r\n background: ${COLORS.white};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.showArrowPointer ? renderArrowStyles(props.position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ note: boolean; size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n margin: ${(props) => renderMargins(props.note, props.size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\r\n : props.size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ position: Position; showOnClick: boolean; showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.position === Position.Left || props.position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const popoverRef = React.useRef<any>();\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\r\n <PopoverContainer size={size} position={position} ref={popoverRef} showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer size={size}>\r\n <TextContainer note={!!topSectionProps?.note} size={size}>\r\n {topSectionProps?.note && <NoteContainer size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer size={size} data-testid={'textBtn'}>\r\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </Button>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\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KNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;IAaLV,UAAU,EAAAS,GAAA,CAAAX,KAAA;MAvBVG,IAAI,EAAAQ,GAAA,CAAAI,IAAA,CAAAF,UAAA;MAKJjB,MAAM,EAAAe,GAAA,CAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;EAAA;EAoCLtC,WAAW,EAAAqC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAKXtC,QAAQ,EAAAoC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAWRnD,WAAW,EAAAiD,GAAA,CAAAM,IAAA,CAAAJ,UAAA;EAMX9E,gBAAgB,EAAA4E,GAAA,CAAAM;AAAA;AAoFlB,eAAenD,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Popover.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXSStyling","Button","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","jsx","_jsx","jsxs","_jsxs","PopoverContainer","div","_templateObject","_taggedTemplateLiteral","props","size","Small","Large","getColor","theme","BOXSHADOW_CENTERED","popover","position","Bottom","Top","Left","Right","showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","_templateObject2","PopoverMiddleSectionContainer","_templateObject3","PopoverBottomSectionContainer","_templateObject4","TextContainer","_templateObject5","renderMargins","note","NoteContainer","_templateObject6","Regular","LabelContainer","_templateObject7","Bold","CloseButtonContainer","_templateObject8","TextButtonContainer","_templateObject9","IconButtonContainer","_templateObject10","PopoverWrapper","_templateObject11","showOnClick","concat","showPopover","isNotePresent","Popover","_ref","_bottomSectionProps$t","_bottomSectionProps$i","_ref$size","Medium","topSectionProps","bottomSectionProps","mainContent","children","_ref$showOnClick","_ref$showArrowPointer","_React$useState","useState","_React$useState2","_slicedToArray","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","ref","text","action","useTransparentBackground","iconColor","variant","shape","Close","textButton","icon","onClick","label","className","iconButtons","map","iconButton","propTypes","_pt","string","isRequired","arrayOf","node","func","bool"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { Button, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ size: Size; position: Position; showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px')};\r\n min-width: ${(props) => (props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px')};\r\n border-radius: 4px;\r\n background: ${props => COLORS.getColor('white', props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.showArrowPointer ? renderArrowStyles(props.position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ size: Size }>`\r\n height: ${(props) => (props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ note: boolean; size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n margin: ${(props) => renderMargins(props.note, props.size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))\r\n : props.size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_600', props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ size: Size }>`\r\n ${(props) =>\r\n props.size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ size: Size }>`\r\n margin: ${(props) => (props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ position: Position; showOnClick: boolean; showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.position === Position.Left || props.position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>();\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\r\n <PopoverContainer size={size} position={position} ref={popoverRef} showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer size={size}>\r\n <TextContainer note={!!topSectionProps?.note} size={size}>\r\n {topSectionProps?.note && <NoteContainer size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground iconColor={COLORS.getColor('neutral_600', theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer size={size} data-testid={'textBtn'}>\r\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </Button>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>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A,CAAAX,KAAA;IAhDfL,IAAI,EAAAgB,GAAA,CAAAC,MAAA,CAAAC,UAAA;IAKJlE,IAAI,EAAAgE,GAAA,CAAAC;EAAA;EAgDJvC,kBAAkB,EAAAsC,GAAA,CAAAX,KAAA;IAvBlBO,WAAW,EAAAI,GAAA,CAAAG,OAAA,CAAAH,GAAA,CAAAX,KAAA;MAlBXG,IAAI,EAAAQ,GAAA,CAAAI,IAAA,CAAAF,UAAA;MAKJjB,MAAM,EAAAe,GAAA,CAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;IAaLV,UAAU,EAAAS,GAAA,CAAAX,KAAA;MAvBVG,IAAI,EAAAQ,GAAA,CAAAI,IAAA,CAAAF,UAAA;MAKJjB,MAAM,EAAAe,GAAA,CAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;EAAA;EAoCLtC,WAAW,EAAAqC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAKXtC,QAAQ,EAAAoC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAWRnD,WAAW,EAAAiD,GAAA,CAAAM,IAAA,CAAAJ,UAAA;EAMX7E,gBAAgB,EAAA2E,GAAA,CAAAM;AAAA;AAqFlB,eAAenD,OAAO","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _styledComponents =
|
|
14
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
15
|
var _ = require("..");
|
|
16
16
|
var _Iconbutton = require("../Button/Iconbutton");
|
|
17
17
|
var _NotificationDot = require("../NotificationDot");
|
|
@@ -23,10 +23,16 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
24
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
-
var PortraitOverlay = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ", ";\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n"])),
|
|
26
|
+
var PortraitOverlay = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ", ";\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n"])), function (props) {
|
|
27
|
+
return _.COLORS.getColor('black', props.theme);
|
|
28
|
+
});
|
|
27
29
|
var ProfileButtonContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ", " {\n display: ", ";\n\n ", " {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ", " {\n background-color: ", ";\n\n svg, svg path {\n fill: ", ";\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ", " {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ", " {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n"])), _Iconbutton.IconButtonStyledPrimary, function (props) {
|
|
28
30
|
return props.hideOnLowWidth ? 'none' : 'inline';
|
|
29
|
-
}, _styles.BREAKPOINTS.MEDIUM, _Iconbutton.IconButtonContentStyles,
|
|
31
|
+
}, _styles.BREAKPOINTS.MEDIUM, _Iconbutton.IconButtonContentStyles, function (props) {
|
|
32
|
+
return _.COLORS.getColor('neutral_100', props.theme);
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return _.COLORS.getColor('neutral_300', props.theme);
|
|
35
|
+
}, PortraitOverlay, PortraitOverlay);
|
|
30
36
|
exports.ProfileButtonContainer = ProfileButtonContainer;
|
|
31
37
|
var NotificationContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n left: 30px;\n bottom: 30px;\n"])));
|
|
32
38
|
var ImageWrapper = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n"])));
|
|
@@ -40,6 +46,7 @@ var ProfileButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
40
46
|
className = _ref.className,
|
|
41
47
|
tabIndex = _ref.tabIndex,
|
|
42
48
|
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
49
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
43
50
|
var renderIcon = function renderIcon() {
|
|
44
51
|
return portraitSrc && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ImageWrapper, {
|
|
45
52
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -48,7 +55,7 @@ var ProfileButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
48
55
|
}) || initials && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ComponentS, {
|
|
49
56
|
className: "initials",
|
|
50
57
|
textStyle: _styles.ComponentTextStyle.Bold,
|
|
51
|
-
color: disabled ? _.COLORS.neutral_300 : _.COLORS.white,
|
|
58
|
+
color: disabled ? _.COLORS.getColor('neutral_300', theme) : _.COLORS.getColor('white', theme),
|
|
52
59
|
children: initials
|
|
53
60
|
}) || /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
54
61
|
children: icon
|