@laerdal/life-react-components 3.5.1-dev.15 → 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 +51 -41
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.js +51 -41
- 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/colors.cjs +6 -1
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +1 -0
- package/dist/styles/colors.js +6 -1
- package/dist/styles/colors.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
|
@@ -3,20 +3,28 @@ 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;
|
|
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, ComponentXXS, LinearProgress, LinearProgressType, LinearProgressVariant, Size } from '../../index';
|
|
8
8
|
import { IconButton } from '../../Button';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
export var CardBottomSectionProgressStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 0;\n"])));
|
|
12
|
-
export var CardBottomSectionNotesStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 48px;\n position: relative;\n color: ", ";\n display: flex;\n flex-direction: row;\n align-items: center;\n"])),
|
|
12
|
+
export var CardBottomSectionNotesStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 48px;\n position: relative;\n color: ", ";\n display: flex;\n flex-direction: row;\n align-items: center;\n"])), function (props) {
|
|
13
|
+
return COLORS.getColor('neutral_500', props.theme);
|
|
14
|
+
});
|
|
13
15
|
export var CardBottomSectionAuthorStyles = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ", "\n"])), function (props) {
|
|
14
|
-
return props.disabled ? "\n color: ".concat(COLORS.neutral_300, ";\n svg, img {\n filter: grayscale(100%);\n }\n \n ") : '';
|
|
16
|
+
return props.disabled ? "\n color: ".concat(COLORS.getColor('neutral_300', props.theme), ";\n svg, img {\n filter: grayscale(100%);\n }\n \n ") : '';
|
|
17
|
+
});
|
|
18
|
+
export var CardBottomSectionDivider = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n width: 100%;\n"])), function (props) {
|
|
19
|
+
return COLORS.getColor('neutral_100', props.theme);
|
|
15
20
|
});
|
|
16
|
-
export var CardBottomSectionDivider = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n width: 100%;\n"])), COLORS.neutral_100);
|
|
17
21
|
export var CardBottomSectionNoteLeftStyles = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])));
|
|
18
22
|
export var CardBottomSectionNoteRightStyles = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])));
|
|
19
|
-
export var CardBottomSectionButtonRowContainerStyles = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ", ";\n }\n"])),
|
|
23
|
+
export var CardBottomSectionButtonRowContainerStyles = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ", ";\n }\n"])), function (props) {
|
|
24
|
+
return COLORS.getColor('neutral_100', props.theme);
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return COLORS.getColor('neutral_600', props.theme);
|
|
27
|
+
});
|
|
20
28
|
export var CardBottomSectionContainer = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n"])));
|
|
21
29
|
var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
22
30
|
var progressLevel = _ref.progressLevel,
|
|
@@ -35,6 +43,7 @@ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
35
43
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
36
44
|
elRefs = _React$useState2[0],
|
|
37
45
|
setElRefs = _React$useState2[1];
|
|
46
|
+
var theme = useTheme();
|
|
38
47
|
var length = (actions === null || actions === void 0 ? void 0 : actions.length) || 0;
|
|
39
48
|
React.useEffect(function () {
|
|
40
49
|
setElRefs(Array(length || 0).fill(null).map(function () {
|
|
@@ -58,13 +67,13 @@ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
58
67
|
}), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNotesStyles, {
|
|
59
68
|
children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNoteLeftStyles, {
|
|
60
69
|
children: [noteLeftIcon, /*#__PURE__*/_jsx(ComponentXXS, {
|
|
61
|
-
color: COLORS.neutral_500,
|
|
70
|
+
color: COLORS.getColor('neutral_500', theme),
|
|
62
71
|
textStyle: ComponentTextStyle.Bold,
|
|
63
72
|
children: noteLeft
|
|
64
73
|
})]
|
|
65
74
|
}), (noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNoteRightStyles, {
|
|
66
75
|
children: [noteRightIcon, /*#__PURE__*/_jsx(ComponentXXS, {
|
|
67
|
-
color: COLORS.neutral_500,
|
|
76
|
+
color: COLORS.getColor('neutral_500', theme),
|
|
68
77
|
textStyle: ComponentTextStyle.Bold,
|
|
69
78
|
children: noteRight
|
|
70
79
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBottomSection.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXXS","LinearProgress","LinearProgressType","LinearProgressVariant","Size","IconButton","jsx","_jsx","jsxs","_jsxs","CardBottomSectionProgressStyles","div","_templateObject","_taggedTemplateLiteral","CardBottomSectionNotesStyles","_templateObject2","neutral_500","CardBottomSectionAuthorStyles","_templateObject3","props","disabled","concat","neutral_300","CardBottomSectionDivider","_templateObject4","neutral_100","CardBottomSectionNoteLeftStyles","_templateObject5","CardBottomSectionNoteRightStyles","_templateObject6","CardBottomSectionButtonRowContainerStyles","_templateObject7","neutral_600","CardBottomSectionContainer","_templateObject8","CardBottomSection","forwardRef","_ref","ref","progressLevel","progressMax","_ref$progressType","progressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","authorName","logo","actions","_React$useState","useState","_React$useState2","_slicedToArray","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","children","size","Small","type","variant","Normal","value","max","color","textStyle","Bold","x","index","shape","action","e","onClick","icon","propTypes","_pt","number","string","node","arrayOf","isRequired","func","bool"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXS,\r\n LinearProgress,\r\n LinearProgressType,\r\n LinearProgressVariant,\r\n Size\r\n} from '../../index';\r\nimport {IconButton} from '../../Button';\r\n\r\nexport interface ActionItem {\r\n icon: React.ReactNode;\r\n onClick: () => void;\r\n}\r\n\r\nexport interface CardBottomSectionProps {\r\n /** Optional. Current progress level shown in the progress bar. */\r\n progressLevel?: number;\r\n /** Optional. Maximum level of progress in the progress bar. */\r\n progressMax?: number;\r\n /** Optional. Type of the progress bar. */\r\n progressType?: LinearProgressType;\r\n\r\n /** Optional. Note text shown on the left side of the section. */\r\n noteLeft?: string;\r\n /** Optional. Note icon shown on the left side of the section. */\r\n noteLeftIcon?: React.ReactNode;\r\n /** Optional. Note text shown on the right side of the section. */\r\n noteRight?: string;\r\n /** Optional. Note icon shown on the right side of the section. */\r\n noteRightIcon?: React.ReactNode;\r\n\r\n /** Author name shown at the bottom-left part of the section. */\r\n authorName?: string;\r\n /** Array of actions shown on the bottom-right corner of the section. */\r\n actions?: ActionItem[];\r\n /** Logo shown on the right side of the section, in front of AuthorName. */\r\n logo?: React.ReactNode;\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardBottomSectionProgressStyles = styled.div`\r\n padding: 8px 0;\r\n`;\r\n\r\nexport const CardBottomSectionNotesStyles = styled.div`\r\n height: 48px;\r\n position: relative;\r\n color: ${COLORS.neutral_500};\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nexport const CardBottomSectionAuthorStyles = styled.div<{ disabled?: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n height: 48px;\r\n\r\n div:first-child {\r\n flex-grow: 2;\r\n }\r\n\r\n svg, img {\r\n width: 80px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n\r\n ${props => props.disabled ? `\r\n color: ${COLORS.neutral_300};\r\n svg, img {\r\n filter: grayscale(100%);\r\n }\r\n \r\n ` : ''}\r\n`;\r\n\r\nexport const CardBottomSectionDivider = styled.div`\r\n border-top: 1px;\r\n border-top-color: ${COLORS.neutral_100};\r\n border-top-style: solid;\r\n width: 100%;\r\n`;\r\n\r\nexport const CardBottomSectionNoteLeftStyles = styled.div`\r\n position: absolute;\r\n left: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionNoteRightStyles = styled.div`\r\n position: absolute;\r\n right: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n align-items: center;\r\n border-top: 1px;\r\n border-top-color: ${COLORS.neutral_100};\r\n border-top-style: solid;\r\n\r\n button:last-child {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n button:not(:last-child) {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n svg {\r\n color: ${COLORS.neutral_600};\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionContainer = styled.div`\r\n padding: 0px 16px 8px 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nconst CardBottomSection = React.forwardRef(({\r\n progressLevel,\r\n progressMax,\r\n progressType = LinearProgressType.Line,\r\n noteLeft,\r\n noteLeftIcon,\r\n noteRight,\r\n noteRightIcon,\r\n authorName,\r\n logo,\r\n actions,\r\n disabled\r\n }: CardBottomSectionProps,\r\n ref: React.Ref<React.RefObject<HTMLButtonElement>[]>) => {\r\n\r\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\r\n\r\n const length = actions?.length || 0;\r\n\r\n React.useEffect(() => {\r\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\r\n }, [length]);\r\n\r\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\r\n\r\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;\r\n\r\n return (\r\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\r\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\r\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\r\n <LinearProgress size={Size.Small}\r\n type={progressType}\r\n variant={LinearProgressVariant.Normal}\r\n value={progressLevel}\r\n max={progressMax ?? progressLevel}/>\r\n </CardBottomSectionProgressStyles>}\r\n\r\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\r\n {(noteLeft || noteLeftIcon) && (\r\n <CardBottomSectionNoteLeftStyles>\r\n {noteLeftIcon}\r\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\r\n </CardBottomSectionNoteLeftStyles>\r\n )}\r\n {(noteRight || noteRightIcon) && (\r\n <CardBottomSectionNoteRightStyles>\r\n {noteRightIcon}\r\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\r\n </CardBottomSectionNoteRightStyles>\r\n )}\r\n </CardBottomSectionNotesStyles>}\r\n\r\n {(authorName || logo) && <CardBottomSectionAuthorStyles disabled={disabled} data-testid={'card-bottomSection-author'}>\r\n <ComponentXXS>{authorName}</ComponentXXS>\r\n {logo}\r\n </CardBottomSectionAuthorStyles>}\r\n\r\n {actions && <CardBottomSectionButtonRowContainerStyles>\r\n {actions.map((x, index) => (\r\n <IconButton ref={elRefs[index]}\r\n key={index}\r\n disabled={disabled}\r\n variant=\"secondary\"\r\n shape=\"circular\"\r\n action={(e) => {\r\n x.onClick();\r\n }}>\r\n {x.icon}\r\n </IconButton>\r\n ))}\r\n </CardBottomSectionButt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U,EAAAqC,GAAA,CAAAE,MAAA;EAEVrC,OAAO,EAAAmC,GAAA,CAAAI,OAAA,CAAAJ,GAAA,CAAAN,KAAA;IAxBPI,IAAI,EAAAE,GAAA,CAAAG,IAAA,CAAAE,UAAA;IACJR,OAAO,EAAAG,GAAA,CAAAM,IAAA,CAAAD;EAAA;EAyBPzC,IAAI,EAAAoC,GAAA,CAAAG,IAAA;EAEJpE,QAAQ,EAAAiE,GAAA,CAAAO;AAAA;AAmLV,eAAezD,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CardBottomSection.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXXS","LinearProgress","LinearProgressType","LinearProgressVariant","Size","IconButton","jsx","_jsx","jsxs","_jsxs","CardBottomSectionProgressStyles","div","_templateObject","_taggedTemplateLiteral","CardBottomSectionNotesStyles","_templateObject2","props","getColor","theme","CardBottomSectionAuthorStyles","_templateObject3","disabled","concat","CardBottomSectionDivider","_templateObject4","CardBottomSectionNoteLeftStyles","_templateObject5","CardBottomSectionNoteRightStyles","_templateObject6","CardBottomSectionButtonRowContainerStyles","_templateObject7","CardBottomSectionContainer","_templateObject8","CardBottomSection","forwardRef","_ref","ref","progressLevel","progressMax","_ref$progressType","progressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","authorName","logo","actions","_React$useState","useState","_React$useState2","_slicedToArray","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","children","size","Small","type","variant","Normal","value","max","color","textStyle","Bold","x","index","shape","action","e","onClick","icon","propTypes","_pt","number","string","node","arrayOf","isRequired","func","bool"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXS,\r\n LinearProgress,\r\n LinearProgressType,\r\n LinearProgressVariant,\r\n Size\r\n} from '../../index';\r\nimport {IconButton} from '../../Button';\r\n\r\nexport interface ActionItem {\r\n icon: React.ReactNode;\r\n onClick: () => void;\r\n}\r\n\r\nexport interface CardBottomSectionProps {\r\n /** Optional. Current progress level shown in the progress bar. */\r\n progressLevel?: number;\r\n /** Optional. Maximum level of progress in the progress bar. */\r\n progressMax?: number;\r\n /** Optional. Type of the progress bar. */\r\n progressType?: LinearProgressType;\r\n\r\n /** Optional. Note text shown on the left side of the section. */\r\n noteLeft?: string;\r\n /** Optional. Note icon shown on the left side of the section. */\r\n noteLeftIcon?: React.ReactNode;\r\n /** Optional. Note text shown on the right side of the section. */\r\n noteRight?: string;\r\n /** Optional. Note icon shown on the right side of the section. */\r\n noteRightIcon?: React.ReactNode;\r\n\r\n /** Author name shown at the bottom-left part of the section. */\r\n authorName?: string;\r\n /** Array of actions shown on the bottom-right corner of the section. */\r\n actions?: ActionItem[];\r\n /** Logo shown on the right side of the section, in front of AuthorName. */\r\n logo?: React.ReactNode;\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardBottomSectionProgressStyles = styled.div`\r\n padding: 8px 0;\r\n`;\r\n\r\nexport const CardBottomSectionNotesStyles = styled.div`\r\n height: 48px;\r\n position: relative;\r\n color: ${props => COLORS.getColor('neutral_500', props.theme)};\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nexport const CardBottomSectionAuthorStyles = styled.div<{ disabled?: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n height: 48px;\r\n\r\n div:first-child {\r\n flex-grow: 2;\r\n }\r\n\r\n svg, img {\r\n width: 80px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n\r\n ${props => props.disabled ? `\r\n color: ${COLORS.getColor('neutral_300', props.theme)};\r\n svg, img {\r\n filter: grayscale(100%);\r\n }\r\n \r\n ` : ''}\r\n`;\r\n\r\nexport const CardBottomSectionDivider = styled.div`\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n border-top-style: solid;\r\n width: 100%;\r\n`;\r\n\r\nexport const CardBottomSectionNoteLeftStyles = styled.div`\r\n position: absolute;\r\n left: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionNoteRightStyles = styled.div`\r\n position: absolute;\r\n right: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n align-items: center;\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n border-top-style: solid;\r\n\r\n button:last-child {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n button:not(:last-child) {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionContainer = styled.div`\r\n padding: 0px 16px 8px 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nconst CardBottomSection = React.forwardRef(({\r\n progressLevel,\r\n progressMax,\r\n progressType = LinearProgressType.Line,\r\n noteLeft,\r\n noteLeftIcon,\r\n noteRight,\r\n noteRightIcon,\r\n authorName,\r\n logo,\r\n actions,\r\n disabled\r\n }: CardBottomSectionProps,\r\n ref: React.Ref<React.RefObject<HTMLButtonElement>[]>) => {\r\n\r\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\r\n const theme = useTheme();\r\n const length = actions?.length || 0;\r\n\r\n React.useEffect(() => {\r\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\r\n }, [length]);\r\n\r\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\r\n\r\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;\r\n\r\n return (\r\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\r\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\r\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\r\n <LinearProgress size={Size.Small}\r\n type={progressType}\r\n variant={LinearProgressVariant.Normal}\r\n value={progressLevel}\r\n max={progressMax ?? progressLevel}/>\r\n </CardBottomSectionProgressStyles>}\r\n\r\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\r\n {(noteLeft || noteLeftIcon) && (\r\n <CardBottomSectionNoteLeftStyles>\r\n {noteLeftIcon}\r\n <ComponentXXS color={COLORS.getColor('neutral_500', theme)} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\r\n </CardBottomSectionNoteLeftStyles>\r\n )}\r\n {(noteRight || noteRightIcon) && (\r\n <CardBottomSectionNoteRightStyles>\r\n {noteRightIcon}\r\n <ComponentXXS color={COLORS.getColor('neutral_500', theme)} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\r\n </CardBottomSectionNoteRightStyles>\r\n )}\r\n </CardBottomSectionNotesStyles>}\r\n\r\n {(authorName || logo) && <CardBottomSectionAuthorStyles disabled={disabled} data-testid={'card-bottomSection-author'}>\r\n <ComponentXXS>{authorName}</ComponentXXS>\r\n {logo}\r\n </CardBottomSectionAuthorStyles>}\r\n\r\n {actions && <CardBottomSectionButtonRowContainerStyles>\r\n {actions.map((x, index) => (\r\n <IconButton ref={elRefs[index]}\r\n key={index}\r\n disabled={disabled}\r\n variant=\"secondary\"\r\n shape=\"circular\"\r\n action={(e) => {\r\n x.onClick();\r\n }}>\r\n {x.icon}\r\n </IconButton>\r\n ))}\r\n </CardBottomSectionButtonRowContainer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CAACK,OAAO,CAAC,CAAC;UACb,CAAE;UAAAhB,QAAA,EACXW,CAAC,CAACM;QAAI,GAPQL,KAQL,CAAC;MAAA,CACd;IAAC,CACuC,CAAC;EAAA,CAClB,CAAC;AAEjC,CAAC,CAAC;AAAC3C,iBAAA,CAAAiD,SAAA;EAvMD7C,aAAa,EAAA8C,GAAA,CAAAC,MAAA;EAEb9C,WAAW,EAAA6C,GAAA,CAAAC,MAAA;EAKX1C,QAAQ,EAAAyC,GAAA,CAAAE,MAAA;EAER1C,YAAY,EAAAwC,GAAA,CAAAG,IAAA;EAEZ1C,SAAS,EAAAuC,GAAA,CAAAE,MAAA;EAETxC,aAAa,EAAAsC,GAAA,CAAAG,IAAA;EAGbxC,UAAU,EAAAqC,GAAA,CAAAE,MAAA;EAEVrC,OAAO,EAAAmC,GAAA,CAAAI,OAAA,CAAAJ,GAAA,CAAAN,KAAA;IAxBPI,IAAI,EAAAE,GAAA,CAAAG,IAAA,CAAAE,UAAA;IACJR,OAAO,EAAAG,GAAA,CAAAM,IAAA,CAAAD;EAAA;EAyBPzC,IAAI,EAAAoC,GAAA,CAAAG,IAAA;EAEJjE,QAAQ,EAAA8D,GAAA,CAAAO;AAAA;AAmLV,eAAezD,iBAAiB","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports["default"] = exports.CardMiddleSectionTagsStyles = exports.CardMiddleSectionContainer = exports.CardMiddleSectionColorBandStyles = exports.CardMiddleSectionCategoryStyles = void 0;
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _styledComponents =
|
|
11
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
12
12
|
var _index = require("../../index");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
@@ -22,7 +22,9 @@ var CardMiddleSectionColorBandStyles = _styledComponents["default"].div(_templat
|
|
|
22
22
|
exports.CardMiddleSectionColorBandStyles = CardMiddleSectionColorBandStyles;
|
|
23
23
|
var CardMiddleSectionTagsStyles = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n"])));
|
|
24
24
|
exports.CardMiddleSectionTagsStyles = CardMiddleSectionTagsStyles;
|
|
25
|
-
var CardMiddleSectionCategoryStyles = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ", ";\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])),
|
|
25
|
+
var CardMiddleSectionCategoryStyles = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ", ";\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), function (props) {
|
|
26
|
+
return _index.COLORS.getColor('neutral_500', props.theme);
|
|
27
|
+
});
|
|
26
28
|
exports.CardMiddleSectionCategoryStyles = CardMiddleSectionCategoryStyles;
|
|
27
29
|
var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
28
30
|
var colorBandColor = _ref.colorBandColor,
|
|
@@ -33,6 +35,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
33
35
|
tags = _ref.tags,
|
|
34
36
|
row2Tags = _ref.row2Tags,
|
|
35
37
|
disabled = _ref.disabled;
|
|
38
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
36
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardMiddleSectionContainer, {
|
|
37
40
|
"data-testid": 'card-middleSection',
|
|
38
41
|
children: [colorBandColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionColorBandStyles, {
|
|
@@ -42,17 +45,17 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
42
45
|
bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
43
46
|
children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
44
47
|
textStyle: _index.ComponentTextStyle.Bold,
|
|
45
|
-
color: _index.COLORS.neutral_500,
|
|
48
|
+
color: _index.COLORS.getColor('neutral_500', theme),
|
|
46
49
|
children: categoryLabel
|
|
47
50
|
})]
|
|
48
51
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXL, {
|
|
49
52
|
className: "titleBlock",
|
|
50
53
|
textStyle: _index.ComponentTextStyle.Bold,
|
|
51
|
-
color: disabled ? _index.COLORS.neutral_500 : _index.COLORS.black,
|
|
54
|
+
color: disabled ? _index.COLORS.getColor('neutral_500', theme) : _index.COLORS.getColor('black', theme),
|
|
52
55
|
children: title
|
|
53
56
|
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
54
57
|
className: "descriptionBlock",
|
|
55
|
-
color: _index.COLORS.neutral_600,
|
|
58
|
+
color: _index.COLORS.getColor('neutral_600', theme),
|
|
56
59
|
children: description
|
|
57
60
|
}), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTagsStyles, {
|
|
58
61
|
children: tags.map(function (x, index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardMiddleSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_jsxRuntime","_templateObject","_templateObject2","_templateObject3","_templateObject4","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardMiddleSectionContainer","styled","div","_taggedTemplateLiteral2","exports","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","COLORS","getColor","theme","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","useTheme","jsxs","children","jsx","extraTopMargin","Boolean","bottomMargin","ComponentS","textStyle","ComponentTextStyle","Bold","color","ComponentXL","className","map","x","index","_x$variant","Tag","label","variant","icon","concat","_x$variant2","_default"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface CardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: CardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: CardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport interface CardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const CardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const CardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const CardMiddleSectionCategoryStyles = styled.div<{ extraTopMargin: boolean; bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_500', props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n return (\r\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <CardMiddleSectionCategoryStyles extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.getColor('neutral_500', theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <ComponentXL className=\"titleBlock\" textStyle={ComponentTextStyle.Bold} color={disabled ? COLORS.getColor('neutral_500', theme) : COLORS.getColor('black', theme)}>\r\n {title}\r\n </ComponentXL>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.getColor('neutral_600', theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n </CardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default CardMiddleSection;\r\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAoG,IAAAG,WAAA,GAAAH,OAAA;AAAA,IAAAI,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC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AAK,CAAoE,CAAC;MAAA,CACnG;IAAC,CACyB,CAC9B;EAAA,CACyB,CAAC;AAEjC,CAAC;AAAC,IAAAQ,QAAA,GAEalC,iBAAiB;AAAAT,OAAA,cAAA2C,QAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
4
|
+
import styled, { useTheme } from 'styled-components';
|
|
5
5
|
import { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag } from '../../index';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -10,7 +10,9 @@ export var CardMiddleSectionColorBandStyles = styled.div(_templateObject2 || (_t
|
|
|
10
10
|
return props.$color;
|
|
11
11
|
});
|
|
12
12
|
export var CardMiddleSectionTagsStyles = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n"])));
|
|
13
|
-
export var CardMiddleSectionCategoryStyles = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ", ";\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])),
|
|
13
|
+
export var CardMiddleSectionCategoryStyles = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ", ";\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), function (props) {
|
|
14
|
+
return COLORS.getColor('neutral_500', props.theme);
|
|
15
|
+
});
|
|
14
16
|
var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
15
17
|
var colorBandColor = _ref.colorBandColor,
|
|
16
18
|
categoryIcon = _ref.categoryIcon,
|
|
@@ -20,6 +22,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
20
22
|
tags = _ref.tags,
|
|
21
23
|
row2Tags = _ref.row2Tags,
|
|
22
24
|
disabled = _ref.disabled;
|
|
25
|
+
var theme = useTheme();
|
|
23
26
|
return /*#__PURE__*/_jsxs(CardMiddleSectionContainer, {
|
|
24
27
|
"data-testid": 'card-middleSection',
|
|
25
28
|
children: [colorBandColor && /*#__PURE__*/_jsx(CardMiddleSectionColorBandStyles, {
|
|
@@ -29,17 +32,17 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
29
32
|
bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
30
33
|
children: [categoryIcon, /*#__PURE__*/_jsx(ComponentS, {
|
|
31
34
|
textStyle: ComponentTextStyle.Bold,
|
|
32
|
-
color: COLORS.neutral_500,
|
|
35
|
+
color: COLORS.getColor('neutral_500', theme),
|
|
33
36
|
children: categoryLabel
|
|
34
37
|
})]
|
|
35
38
|
}), /*#__PURE__*/_jsx(ComponentXL, {
|
|
36
39
|
className: "titleBlock",
|
|
37
40
|
textStyle: ComponentTextStyle.Bold,
|
|
38
|
-
color: disabled ? COLORS.neutral_500 : COLORS.black,
|
|
41
|
+
color: disabled ? COLORS.getColor('neutral_500', theme) : COLORS.getColor('black', theme),
|
|
39
42
|
children: title
|
|
40
43
|
}), description && /*#__PURE__*/_jsx(ComponentS, {
|
|
41
44
|
className: "descriptionBlock",
|
|
42
|
-
color: COLORS.neutral_600,
|
|
45
|
+
color: COLORS.getColor('neutral_600', theme),
|
|
43
46
|
children: description
|
|
44
47
|
}), tags && /*#__PURE__*/_jsx(CardMiddleSectionTagsStyles, {
|
|
45
48
|
children: tags.map(function (x, index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","COLORS","ComponentS","ComponentTextStyle","ComponentXL","Tag","jsx","_jsx","jsxs","_jsxs","CardMiddleSectionContainer","div","_templateObject","_taggedTemplateLiteral","CardMiddleSectionColorBandStyles","_templateObject2","props","$color","CardMiddleSectionTagsStyles","_templateObject3","CardMiddleSectionCategoryStyles","_templateObject4","
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","useTheme","COLORS","ComponentS","ComponentTextStyle","ComponentXL","Tag","jsx","_jsx","jsxs","_jsxs","CardMiddleSectionContainer","div","_templateObject","_taggedTemplateLiteral","CardMiddleSectionColorBandStyles","_templateObject2","props","$color","CardMiddleSectionTagsStyles","_templateObject3","CardMiddleSectionCategoryStyles","_templateObject4","getColor","theme","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","children","extraTopMargin","Boolean","bottomMargin","textStyle","Bold","color","className","map","x","index","_x$variant","label","variant","icon","concat","_x$variant2"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface CardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: CardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: CardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport interface CardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const CardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const CardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const CardMiddleSectionCategoryStyles = styled.div<{ extraTopMargin: boolean; bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_500', props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n return (\r\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <CardMiddleSectionCategoryStyles extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.getColor('neutral_500', theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <ComponentXL className=\"titleBlock\" textStyle={ComponentTextStyle.Bold} color={disabled ? COLORS.getColor('neutral_500', theme) : COLORS.getColor('black', theme)}>\r\n {title}\r\n </ComponentXL>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.getColor('neutral_600', theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n </CardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default CardMiddleSection;\r\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAASC,MAAM,EAAEC,UAAU,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,GAAG,QAAqB,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA4BpG,OAAO,IAAMC,0BAA0B,GAAGX,MAAM,CAACY,GAAG,CAAAC,eAAA,KAAAA,eAAA,GAAAC,sBAAA,2PAgBnD;AAED,OAAO,IAAMC,gCAAgC,GAAGf,MAAM,CAACY,GAAG,CAAAI,gBAAA,KAAAA,gBAAA,GAAAF,sBAAA,wHAMpC,UAACG,KAAK;EAAA,OAAKA,KAAK,CAACC,MAAM;AAAA,EAC5C;AAED,OAAO,IAAMC,2BAA2B,GAAGnB,MAAM,CAACY,GAAG,CAAAQ,gBAAA,KAAAA,gBAAA,GAAAN,sBAAA,wGAMpD;AAED,OAAO,IAAMO,+BAA+B,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AA,CACnG;IAAC,CACyB,CAC9B;EAAA,CACyB,CAAC;AAEjC,CAAC;AAED,eAAepB,iBAAiB","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ exports["default"] = exports.CardTopSectionTagContainer = exports.CardTopSection
|
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _styledComponents =
|
|
12
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
13
|
var _typography = require("../../styles/typography");
|
|
14
14
|
var _Checkbox = _interopRequireDefault(require("../../InputFields/Checkbox"));
|
|
15
15
|
var _Tag = require("../../Tag");
|
|
@@ -33,7 +33,9 @@ var CardTopSectionRibbonContainer = _styledComponents["default"].div(_templateOb
|
|
|
33
33
|
return props.$color;
|
|
34
34
|
});
|
|
35
35
|
exports.CardTopSectionRibbonContainer = CardTopSectionRibbonContainer;
|
|
36
|
-
var CardTopSectionCheckboxContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])),
|
|
36
|
+
var CardTopSectionCheckboxContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), function (props) {
|
|
37
|
+
return _index.COLORS.getColor('white', props.theme);
|
|
38
|
+
});
|
|
37
39
|
exports.CardTopSectionCheckboxContainer = CardTopSectionCheckboxContainer;
|
|
38
40
|
var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
39
41
|
var _image$height, _image$fallbackSrc, _image$loader;
|
|
@@ -49,6 +51,7 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
49
51
|
highlightRibbonContentColor = _ref.highlightRibbonContentColor,
|
|
50
52
|
highlightRibbonBgColor = _ref.highlightRibbonBgColor,
|
|
51
53
|
disabled = _ref.disabled;
|
|
54
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
52
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardTopSectionContainer, {
|
|
53
56
|
disabled: disabled,
|
|
54
57
|
"data-testid": 'card-topSection',
|
|
@@ -83,7 +86,7 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
83
86
|
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardTopSectionRibbonContainer, {
|
|
84
87
|
"data-testid": 'card-topSection-ribbon',
|
|
85
88
|
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
86
|
-
$backgroundColor: disabled ? _index.COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
89
|
+
$backgroundColor: disabled ? _index.COLORS.getColor('neutral_300', theme) : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
87
90
|
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
|
|
88
91
|
color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
89
92
|
textStyle: _typography.ComponentTextStyle.Regular,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardTopSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_typography","_Checkbox","_Tag","_index","_Image","_jsxRuntime","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardTopSectionImageContainer","styled","div","_taggedTemplateLiteral2","exports","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","COLORS","white","CardTopSection","forwardRef","_ref","ref","_image$height","_image$fallbackSrc","_image$loader","selected","setSelected","image","tagLabel","tagIcon","_ref$tagVariant","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","jsxs","style","height","children","jsx","ImageWithFallbacks","fallbacks","fallbackSrc","src","alt","loader","width","select","Tag","label","variant","icon","neutral_300","ComponentS","color","textStyle","ComponentTextStyle","Regular","propTypes","_propTypes","bool","func","string","node","shape","isRequired","_default"],"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface CardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const CardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const CardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n\r\n .checkbox-icon {\r\n background-color: ${COLORS.white};\r\n }\r\n`;\r\n\r\nconst CardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: CardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n return (\r\n <CardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <CardTopSectionImageContainer>\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt={image.alt} loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </CardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <CardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </CardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <CardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </CardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <CardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.neutral_300 : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </CardTopSectionRibbonContainer>\r\n )}\r\n </CardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardTopSection;\r\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,IA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9B,CAAC,CAAC;AAACf,cAAA,CAAAyC,SAAA;EAzIDlC,QAAQ,EAAAmC,UAAA,YAAAC,IAAA;EAERnC,WAAW,EAAAkC,UAAA,YAAAE,IAAA;EAEXlC,QAAQ,EAAAgC,UAAA,YAAAG,MAAA;EAERlC,OAAO,EAAA+B,UAAA,YAAAI,IAAA;EAIP/B,mBAAmB,EAAA2B,UAAA,YAAAG,MAAA;EAEnB/B,mBAAmB,EAAA4B,UAAA,YAAAI,IAAA;EAEnB9B,2BAA2B,EAAA0B,UAAA,YAAAG,MAAA;EAE3B5B,sBAAsB,EAAAyB,UAAA,YAAAG,MAAA;EAEtBpC,KAAK,EAAAiC,UAAA,YAAAK,KAAA;IAAKrB,GAAG,EAAAgB,UAAA,YAAAG,MAAA,CAAAG,UAAA;IAAUvB,WAAW,EAAAiB,UAAA,YAAAG,MAAA;IAAWlB,GAAG,EAAAe,UAAA,YAAAG,MAAA,CAAAG,UAAA;IAAU5B,MAAM,EAAAsB,UAAA,YAAAG,MAAA;IAAWhB,KAAK,EAAAa,UAAA,YAAAG,MAAA;IAAWjB,MAAM,EAAAc,UAAA,YAAAC;EAAA;EAEjGlD,QAAQ,EAAAiD,UAAA,YAAAC;AAAA;AAAA,IAAAM,QAAA,GAuHKjD,cAAc;AAAAX,OAAA,cAAA4D,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CardTopSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_typography","_Checkbox","_interopRequireDefault","_Tag","_index","_Image","_jsxRuntime","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardTopSectionImageContainer","styled","div","_taggedTemplateLiteral2","exports","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","COLORS","getColor","theme","CardTopSection","forwardRef","_ref","ref","_image$height","_image$fallbackSrc","_image$loader","selected","setSelected","image","tagLabel","tagIcon","_ref$tagVariant","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","useTheme","jsxs","style","height","children","jsx","ImageWithFallbacks","fallbacks","fallbackSrc","src","alt","loader","width","select","Tag","label","variant","icon","ComponentS","color","textStyle","ComponentTextStyle","Regular","propTypes","_propTypes","bool","func","string","node","shape","isRequired","_default"],"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface CardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const CardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const CardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n\r\n .checkbox-icon {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n`;\r\n\r\nconst CardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: CardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n const theme = useTheme();\r\n return (\r\n <CardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <CardTopSectionImageContainer>\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt={image.alt} loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </CardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <CardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </CardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <CardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </CardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <CardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.getColor('neutral_300', theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </CardTopSectionRibbonContainer>\r\n )}\r\n </CardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardTopSection;\r\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA+C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,IAAAS,eAAA,EAAAC,gBAAA,E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,CAAC;AAE9B,CAAC,CAAC;AAACf,cAAA,CAAAyC,SAAA;EA1IDlC,QAAQ,EAAAmC,UAAA,YAAAC,IAAA;EAERnC,WAAW,EAAAkC,UAAA,YAAAE,IAAA;EAEXlC,QAAQ,EAAAgC,UAAA,YAAAG,MAAA;EAERlC,OAAO,EAAA+B,UAAA,YAAAI,IAAA;EAIP/B,mBAAmB,EAAA2B,UAAA,YAAAG,MAAA;EAEnB/B,mBAAmB,EAAA4B,UAAA,YAAAI,IAAA;EAEnB9B,2BAA2B,EAAA0B,UAAA,YAAAG,MAAA;EAE3B5B,sBAAsB,EAAAyB,UAAA,YAAAG,MAAA;EAEtBpC,KAAK,EAAAiC,UAAA,YAAAK,KAAA;IAAKpB,GAAG,EAAAe,UAAA,YAAAG,MAAA,CAAAG,UAAA;IAAUtB,WAAW,EAAAgB,UAAA,YAAAG,MAAA;IAAWjB,GAAG,EAAAc,UAAA,YAAAG,MAAA,CAAAG,UAAA;IAAU3B,MAAM,EAAAqB,UAAA,YAAAG,MAAA;IAAWf,KAAK,EAAAY,UAAA,YAAAG,MAAA;IAAWhB,MAAM,EAAAa,UAAA,YAAAC;EAAA;EAEjGnD,QAAQ,EAAAkD,UAAA,YAAAC;AAAA;AAAA,IAAAM,QAAA,GAwHKjD,cAAc;AAAAZ,OAAA,cAAA6D,QAAA","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
|
|
|
2
2
|
import _pt from "prop-types";
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
5
|
+
import styled, { useTheme } from 'styled-components';
|
|
6
6
|
import { ComponentS, ComponentTextStyle } from '../../styles/typography';
|
|
7
7
|
import Checkbox from '../../InputFields/Checkbox';
|
|
8
8
|
import { Tag } from '../../Tag';
|
|
@@ -20,7 +20,9 @@ export var CardTopSectionRibbonContainer = styled.div(_templateObject4 || (_temp
|
|
|
20
20
|
}, function (props) {
|
|
21
21
|
return props.$color;
|
|
22
22
|
});
|
|
23
|
-
export var CardTopSectionCheckboxContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])),
|
|
23
|
+
export var CardTopSectionCheckboxContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), function (props) {
|
|
24
|
+
return COLORS.getColor('white', props.theme);
|
|
25
|
+
});
|
|
24
26
|
var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
25
27
|
var _image$height, _image$fallbackSrc, _image$loader;
|
|
26
28
|
var selected = _ref.selected,
|
|
@@ -35,6 +37,7 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
35
37
|
highlightRibbonContentColor = _ref.highlightRibbonContentColor,
|
|
36
38
|
highlightRibbonBgColor = _ref.highlightRibbonBgColor,
|
|
37
39
|
disabled = _ref.disabled;
|
|
40
|
+
var theme = useTheme();
|
|
38
41
|
return /*#__PURE__*/_jsxs(CardTopSectionContainer, {
|
|
39
42
|
disabled: disabled,
|
|
40
43
|
"data-testid": 'card-topSection',
|
|
@@ -69,7 +72,7 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
69
72
|
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/_jsxs(CardTopSectionRibbonContainer, {
|
|
70
73
|
"data-testid": 'card-topSection-ribbon',
|
|
71
74
|
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
72
|
-
$backgroundColor: disabled ? COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
75
|
+
$backgroundColor: disabled ? COLORS.getColor('neutral_300', theme) : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
73
76
|
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/_jsx(ComponentS, {
|
|
74
77
|
color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
75
78
|
textStyle: ComponentTextStyle.Regular,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardTopSection.js","names":["React","styled","ComponentS","ComponentTextStyle","Checkbox","Tag","COLORS","ImageWithFallbacks","jsx","_jsx","jsxs","_jsxs","CardTopSectionImageContainer","div","_templateObject","_taggedTemplateLiteral","CardTopSectionTagContainer","_templateObject2","CardTopSectionContainer","_templateObject3","props","disabled","CardTopSectionRibbonContainer","_templateObject4","$backgroundColor","$color","CardTopSectionCheckboxContainer","_templateObject5","white","CardTopSection","forwardRef","_ref","ref","_image$height","_image$fallbackSrc","_image$loader","selected","setSelected","image","tagLabel","tagIcon","_ref$tagVariant","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","style","height","children","fallbacks","fallbackSrc","src","alt","loader","width","select","label","variant","icon","neutral_300","color","textStyle","Regular","propTypes","_pt","bool","func","string","node","shape","isRequired"],"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface CardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const CardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const CardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n\r\n .checkbox-icon {\r\n background-color: ${COLORS.white};\r\n }\r\n`;\r\n\r\nconst CardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: CardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n return (\r\n <CardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <CardTopSectionImageContainer>\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt={image.alt} loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </CardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <CardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </CardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <CardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </CardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <CardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.neutral_300 : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </CardTopSectionRibbonContainer>\r\n )}\r\n </CardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardTopSection;\r\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,UAAU,EAAEC,kBAAkB,QAAO,yBAAyB;AACtE,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAAQC,GAAG,QAAoB,WAAW;AAE1C,SAAQC,MAAM,QAAO,aAAa;AAClC,SAAQC,kBAAkB,QAAO,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA2B/C,OAAO,IAAMC,4BAA4B,GAAGX,MAAM,CAACY,GAAG,CAAAC,eAAA,KAAAA,eAAA,GAAAC,sBAAA,2PAYrD;AAED,OAAO,IAAMC,0BAA0B,GAAGf,MAAM,CAACY,GAAG,CAAAI,gBAAA,KAAAA,gBAAA,GAAAF,sBAAA,6FAMnD;AAED,OAAO,IAAMG,uBAAuB,GAAGjB,MAAM,CAACY,GAAG,CAAAM,gBAAA,KAAAA,gBAAA,GAAAJ,sBAAA,kFAK7C,UAAAK,KAAK;EAAA,OAAIA,KAAK,CAACC,QAAQ,yDAGpB,EAAE;AAAA,EACR;AAED,OAAO,IAAMC,6BAA6B,GAAGrB,MAAM,CAACY,GAAG,CAAAU,gBAAA,KAAAA,gBAAA,GAAAR,sBAAA,uXAEjC,UAAAK,KAAK;EAAA,OAAIA,KAAK,CAACI,gBAAgB;AAAA,GAYxC,UAAAJ,KAAK;EAAA,OAAIA,KAAK,CAACK,MAAM;AAAA,EAMjC;AAED,OAAO,IAAMC,+BAA+B,GAAGzB,MAAM,CAACY,GAAG,CAAAc,gBAAA,KAAAA,gBAAA,GAAAZ,sBAAA,iIAOjCT,MAAM,CAACsB,KAAK,CAEnC;AAED,I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;EAAA,CACsB,CAAC;AAE9B,CAAC,CAAC;AAACf,cAAA,CAAAmC,SAAA;EAzID5B,QAAQ,EAAA6B,GAAA,CAAAC,IAAA;EAER7B,WAAW,EAAA4B,GAAA,CAAAE,IAAA;EAEX5B,QAAQ,EAAA0B,GAAA,CAAAG,MAAA;EAER5B,OAAO,EAAAyB,GAAA,CAAAI,IAAA;EAIPzB,mBAAmB,EAAAqB,GAAA,CAAAG,MAAA;EAEnBzB,mBAAmB,EAAAsB,GAAA,CAAAI,IAAA;EAEnBxB,2BAA2B,EAAAoB,GAAA,CAAAG,MAAA;EAE3BtB,sBAAsB,EAAAmB,GAAA,CAAAG,MAAA;EAEtB9B,KAAK,EAAA2B,GAAA,CAAAK,KAAA;IAAKlB,GAAG,EAAAa,GAAA,CAAAG,MAAA,CAAAG,UAAA;IAAUpB,WAAW,EAAAc,GAAA,CAAAG,MAAA;IAAWf,GAAG,EAAAY,GAAA,CAAAG,MAAA,CAAAG,UAAA;IAAUvB,MAAM,EAAAiB,GAAA,CAAAG,MAAA;IAAWb,KAAK,EAAAU,GAAA,CAAAG,MAAA;IAAWd,MAAM,EAAAW,GAAA,CAAAC;EAAA;EAEjG7C,QAAQ,EAAA4C,GAAA,CAAAC;AAAA;AAuHV,eAAerC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CardTopSection.js","names":["React","styled","useTheme","ComponentS","ComponentTextStyle","Checkbox","Tag","COLORS","ImageWithFallbacks","jsx","_jsx","jsxs","_jsxs","CardTopSectionImageContainer","div","_templateObject","_taggedTemplateLiteral","CardTopSectionTagContainer","_templateObject2","CardTopSectionContainer","_templateObject3","props","disabled","CardTopSectionRibbonContainer","_templateObject4","$backgroundColor","$color","CardTopSectionCheckboxContainer","_templateObject5","getColor","theme","CardTopSection","forwardRef","_ref","ref","_image$height","_image$fallbackSrc","_image$loader","selected","setSelected","image","tagLabel","tagIcon","_ref$tagVariant","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","style","height","children","fallbacks","fallbackSrc","src","alt","loader","width","select","label","variant","icon","color","textStyle","Regular","propTypes","_pt","bool","func","string","node","shape","isRequired"],"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface CardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const CardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const CardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n\r\n .checkbox-icon {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n`;\r\n\r\nconst CardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: CardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n const theme = useTheme();\r\n return (\r\n <CardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <CardTopSectionImageContainer>\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt={image.alt} loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </CardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <CardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </CardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <CardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </CardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <CardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.getColor('neutral_300', theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </CardTopSectionRibbonContainer>\r\n )}\r\n </CardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardTopSection;\r\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAAQC,UAAU,EAAEC,kBAAkB,QAAO,yBAAyB;AACtE,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAAQC,GAAG,QAAoB,WAAW;AAE1C,SAAQC,MAAM,QAAO,aAAa;AAClC,SAAQC,kBAAkB,QAAO,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA2B/C,OAAO,IAAMC,4BAA4B,GAAGZ,MAAM,CAACa,GAAG,CAAAC,eAAA,KAAAA,eAAA,GAAAC,sBAAA,2PAYrD;AAED,OAAO,IAAMC,0BAA0B,GAAGhB,MAAM,CAACa,GAAG,CAAAI,gBAAA,KAAAA,gBAAA,GAAAF,sBAAA,6FAMn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