@laerdal/life-react-components 6.0.0-dev.2.full → 6.0.0-dev.21.full.full
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/ContentAccordion.cjs +40 -11
- package/dist/Accordion/ContentAccordion.cjs.map +1 -1
- package/dist/Accordion/ContentAccordion.js +40 -11
- package/dist/Accordion/ContentAccordion.js.map +1 -1
- package/dist/Accordion/__tests__/AccordionMenu.test.tsx +42 -0
- package/dist/Accordion/__tests__/ContentAccordion.test.tsx +150 -0
- package/dist/Accordion/styles.cjs +51 -13
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.js +51 -13
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/AuthPage/__tests__/AuthPage.test.tsx +27 -0
- package/dist/Banners/Banner.cjs +38 -34
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.d.ts +2 -3
- package/dist/Banners/Banner.js +38 -34
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Banners/__tests__/Banner.test.tsx +47 -0
- package/dist/Banners/__tests__/OverviewBanner.test.tsx +20 -0
- package/dist/Banners/styles.cjs +8 -16
- package/dist/Banners/styles.cjs.map +1 -1
- package/dist/Banners/styles.js +8 -16
- package/dist/Banners/styles.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +8 -2
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +8 -2
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Breadcrumb/__tests__/Breadcrumb.test.tsx +78 -0
- package/dist/Breadcrumb/styles.cjs +15 -4
- package/dist/Breadcrumb/styles.cjs.map +1 -1
- package/dist/Breadcrumb/styles.js +15 -4
- package/dist/Breadcrumb/styles.js.map +1 -1
- package/dist/Button/BackButton.cjs +27 -6
- package/dist/Button/BackButton.cjs.map +1 -1
- package/dist/Button/BackButton.js +27 -6
- package/dist/Button/BackButton.js.map +1 -1
- package/dist/Button/Button.cjs +179 -47
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.d.ts +2 -0
- package/dist/Button/Button.js +179 -47
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +83 -21
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.js +83 -21
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Button/__tests__/BackButton.test.tsx +32 -0
- package/dist/Button/__tests__/Button.test.tsx +45 -0
- package/dist/Button/__tests__/DualButton.test.tsx +119 -0
- package/dist/Card/HorizontalCard/HorizontalCard.cjs +20 -5
- package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.js +20 -5
- package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +12 -3
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.js +12 -3
- package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +8 -2
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +8 -2
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
- package/dist/Card/HorizontalCard/__tests__/HorizontalCard.test.tsx +71 -0
- package/dist/Card/HorizontalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/VerticalCard/Card.cjs +67 -16
- package/dist/Card/VerticalCard/Card.cjs.map +1 -1
- package/dist/Card/VerticalCard/Card.d.ts +1 -0
- package/dist/Card/VerticalCard/Card.js +67 -16
- package/dist/Card/VerticalCard/Card.js.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.cjs +34 -7
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.js +34 -7
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.cjs +27 -8
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.d.ts +5 -0
- package/dist/Card/VerticalCard/CardMiddleSection.js +27 -8
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.cjs +12 -3
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.js +12 -3
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -1
- package/dist/Card/__tests__/Card.test.tsx +146 -0
- package/dist/Chips/ChipStyles.cjs +4 -1
- package/dist/Chips/ChipStyles.cjs.map +1 -1
- package/dist/Chips/ChipStyles.js +4 -1
- package/dist/Chips/ChipStyles.js.map +1 -1
- package/dist/Chips/FilterChip.cjs +1 -0
- package/dist/Chips/FilterChip.cjs.map +1 -1
- package/dist/Chips/FilterChip.js +1 -0
- package/dist/Chips/FilterChip.js.map +1 -1
- package/dist/Chips/__tests__/ActionChip.test.tsx +94 -0
- package/dist/Chips/__tests__/ChoiceChips.test.tsx +79 -0
- package/dist/Chips/__tests__/FilterChip.test.tsx +95 -0
- package/dist/Chips/__tests__/InputChip.test.tsx +155 -0
- package/dist/ChipsInput/ChipInputField.cjs +16 -4
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +16 -4
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/ChipsInput/__tests__/ChipDropdownInput.test.tsx +100 -0
- package/dist/ChipsInput/__tests__/ChipInputFields.test.tsx +155 -0
- package/dist/Dropdown/BasicDropdown.cjs +12 -3
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +12 -3
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +172 -42
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.js +172 -42
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +36 -10
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +36 -10
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +12 -3
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.js +12 -3
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Dropdown/__tests__/DropdownFilter.test.tsx +39 -0
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +4 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +4 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/Footer/__tests__/Footer.test.tsx +182 -0
- package/dist/GlobalNavigationBar/Logo.cjs +2 -1
- package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Logo.js +2 -1
- package/dist/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/GlobalNavigationBar/__tests__/Logo.test.tsx +39 -0
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +10 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.js +10 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +3 -2
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js +3 -2
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +4 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +4 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/__tests__/DesktopActions.test.tsx +108 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/ExtendedMainMenu.test.tsx +28 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/MainMenu.test.tsx +55 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/RightSideNav.test.tsx +45 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/UserMenu.test.tsx +125 -0
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenu.test.tsx +317 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenuContent.test.tsx +294 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenuHeader.test.tsx +195 -0
- package/dist/HyperLink/HyperLink.cjs +18 -2
- package/dist/HyperLink/HyperLink.cjs.map +1 -1
- package/dist/HyperLink/HyperLink.d.ts +2 -0
- package/dist/HyperLink/HyperLink.js +18 -2
- package/dist/HyperLink/HyperLink.js.map +1 -1
- package/dist/HyperLink/styling.cjs +38 -8
- package/dist/HyperLink/styling.cjs.map +1 -1
- package/dist/HyperLink/styling.js +38 -8
- package/dist/HyperLink/styling.js.map +1 -1
- package/dist/InputFields/Checkbox.cjs +54 -14
- package/dist/InputFields/Checkbox.cjs.map +1 -1
- package/dist/InputFields/Checkbox.js +54 -14
- package/dist/InputFields/Checkbox.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +149 -43
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +1 -1
- package/dist/InputFields/DatepickerField.js +150 -44
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs +20 -5
- package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.js +20 -5
- package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
- package/dist/InputFields/Label.cjs +38 -11
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.js +38 -11
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +66 -16
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.js +66 -16
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs +4 -1
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.d.ts +1 -1
- package/dist/InputFields/PasswordField.js +4 -1
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +30 -6
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +30 -6
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +63 -15
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.js +63 -15
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/RichTextField.cjs +60 -15
- package/dist/InputFields/RichTextField.cjs.map +1 -1
- package/dist/InputFields/RichTextField.js +60 -15
- package/dist/InputFields/RichTextField.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs +4 -1
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.js +4 -1
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +9 -3
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +1 -1
- package/dist/InputFields/TextField.js +9 -3
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +68 -17
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.js +68 -17
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/__tests__/NumberField.test.tsx +67 -0
- package/dist/InputFields/__tests__/NumberInput.test.tsx +68 -0
- package/dist/InputFields/__tests__/QuickSearch.test.tsx +42 -0
- package/dist/InputFields/components/SearchBarInput.cjs +28 -7
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +28 -7
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +60 -15
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.js +60 -15
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/styling.cjs +95 -39
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +1 -2
- package/dist/InputFields/styling.js +95 -39
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/LinearProgress/LinearProgress.cjs +161 -53
- package/dist/LinearProgress/LinearProgress.cjs.map +1 -1
- package/dist/LinearProgress/LinearProgress.js +161 -53
- package/dist/LinearProgress/LinearProgress.js.map +1 -1
- package/dist/LinearProgress/__tests__/LinearProgress.test.tsx +25 -0
- package/dist/List/ListRow.cjs +36 -9
- package/dist/List/ListRow.cjs.map +1 -1
- package/dist/List/ListRow.js +36 -9
- package/dist/List/ListRow.js.map +1 -1
- package/dist/List/__tests__/ListRow.test.tsx +18 -0
- package/dist/LoadingIndicator/LoadingIndicator.cjs +4 -1
- package/dist/LoadingIndicator/LoadingIndicator.cjs.map +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.js +4 -1
- package/dist/LoadingIndicator/LoadingIndicator.js.map +1 -1
- package/dist/LoadingPage/GlobalLoadingPage.cjs +4 -1
- package/dist/LoadingPage/GlobalLoadingPage.cjs.map +1 -1
- package/dist/LoadingPage/GlobalLoadingPage.js +4 -1
- package/dist/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/LoadingPage/__tests__/GlobalLoadingPage.test.tsx +23 -0
- package/dist/MenuItem/MenuItem.cjs +101 -26
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.js +101 -26
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/MiniProductCard/MiniProductCard.cjs +15 -1
- package/dist/MiniProductCard/MiniProductCard.cjs.map +1 -1
- package/dist/MiniProductCard/MiniProductCard.d.ts +1 -0
- package/dist/MiniProductCard/MiniProductCard.js +15 -1
- package/dist/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/Modals/Modal.cjs +4 -1
- package/dist/Modals/Modal.cjs.map +1 -1
- package/dist/Modals/Modal.js +4 -1
- package/dist/Modals/Modal.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +24 -6
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +24 -6
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +12 -3
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +12 -3
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalNote.cjs +16 -4
- package/dist/Modals/ModalNote.cjs.map +1 -1
- package/dist/Modals/ModalNote.js +16 -4
- package/dist/Modals/ModalNote.js.map +1 -1
- package/dist/Modals/ModalStyles.cjs +44 -11
- package/dist/Modals/ModalStyles.cjs.map +1 -1
- package/dist/Modals/ModalStyles.js +44 -11
- package/dist/Modals/ModalStyles.js.map +1 -1
- package/dist/Modals/__tests__/Modal.test.tsx +169 -0
- package/dist/Modals/__tests__/ModalContainer.test.tsx +77 -0
- package/dist/Modals/__tests__/ModalContent.test.tsx +126 -0
- package/dist/NavItem/NavItem.cjs +11 -2
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.js +11 -2
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/NavItem/__tests__/NavItem.test.ts +6 -0
- package/dist/NotificationDot/NotificationDot.cjs +17 -2
- package/dist/NotificationDot/NotificationDot.cjs.map +1 -1
- package/dist/NotificationDot/NotificationDot.js +17 -2
- package/dist/NotificationDot/NotificationDot.js.map +1 -1
- package/dist/NotificationDot/__tests__/NotificationDot.test.tsx +33 -0
- package/dist/Paginator/Paginator.cjs +86 -35
- package/dist/Paginator/Paginator.cjs.map +1 -1
- package/dist/Paginator/Paginator.d.ts +1 -5
- package/dist/Paginator/Paginator.js +86 -35
- package/dist/Paginator/Paginator.js.map +1 -1
- package/dist/Paginator/__tests__/Paginator.test.tsx +33 -0
- package/dist/Panel/Panel.cjs +4 -1
- package/dist/Panel/Panel.cjs.map +1 -1
- package/dist/Panel/Panel.js +4 -1
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Popover/Popover.cjs +22 -3
- package/dist/Popover/Popover.cjs.map +1 -1
- package/dist/Popover/Popover.js +22 -3
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/Popover/__tests__/Popover.test.tsx +64 -0
- package/dist/ProfileButton/ProfileButton.cjs +9 -2
- package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
- package/dist/ProfileButton/ProfileButton.js +9 -2
- package/dist/ProfileButton/ProfileButton.js.map +1 -1
- package/dist/ProfileButton/__tests__/ProfileButton.test.tsx +31 -0
- package/dist/QuizButton/__tests__/QuizButton.test.tsx +53 -0
- package/dist/SegmentControl/SegmentControl.cjs +46 -11
- package/dist/SegmentControl/SegmentControl.cjs.map +1 -1
- package/dist/SegmentControl/SegmentControl.js +46 -11
- package/dist/SegmentControl/SegmentControl.js.map +1 -1
- package/dist/SegmentControl/__tests__/SegmentControl.test.tsx +145 -0
- package/dist/SideMenu/SideMenuHeader.cjs +12 -3
- package/dist/SideMenu/SideMenuHeader.cjs.map +1 -1
- package/dist/SideMenu/SideMenuHeader.js +12 -3
- package/dist/SideMenu/SideMenuHeader.js.map +1 -1
- package/dist/SideMenu/__tests__/SideMenu.test.tsx +99 -0
- package/dist/Switcher/SwitcherMenuItem.cjs +4 -1
- package/dist/Switcher/SwitcherMenuItem.cjs.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.js +4 -1
- package/dist/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/Switcher/__tests__/SwitcherMenuItem.tsx +14 -0
- package/dist/Table/TableFooter.cjs +8 -2
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +8 -2
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableStyles.cjs +132 -33
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +132 -33
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/__tests__/Table.test.tsx +499 -0
- package/dist/Tabs/HorizontalTabs.cjs +68 -18
- package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
- package/dist/Tabs/HorizontalTabs.js +68 -18
- package/dist/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/Tabs/TabLink.cjs +4 -1
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.js +4 -1
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tabs/VerticalTabs.cjs +1 -0
- package/dist/Tabs/VerticalTabs.cjs.map +1 -1
- package/dist/Tabs/VerticalTabs.js +1 -0
- package/dist/Tabs/VerticalTabs.js.map +1 -1
- package/dist/Tabs/__tests__/HorizontalTabs.test.tsx +95 -0
- package/dist/Tabs/__tests__/TabLink.test.tsx +40 -0
- package/dist/Tabs/__tests__/Tablist.test.tsx +37 -0
- package/dist/Tag/Tag.cjs +2 -2
- package/dist/Tag/Tag.cjs.map +1 -1
- package/dist/Tag/Tag.js +2 -2
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/__tests__/Tag.test.tsx +86 -0
- package/dist/Tile/Tile.cjs +8 -2
- package/dist/Tile/Tile.cjs.map +1 -1
- package/dist/Tile/Tile.js +8 -2
- package/dist/Tile/Tile.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +8 -2
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.js +8 -2
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Tile/TileFooter.cjs +4 -1
- package/dist/Tile/TileFooter.cjs.map +1 -1
- package/dist/Tile/TileFooter.js +4 -1
- package/dist/Tile/TileFooter.js.map +1 -1
- package/dist/Tile/TileHeader.cjs +12 -3
- package/dist/Tile/TileHeader.cjs.map +1 -1
- package/dist/Tile/TileHeader.js +12 -3
- package/dist/Tile/TileHeader.js.map +1 -1
- package/dist/Toasters/Toast.cjs +62 -13
- package/dist/Toasters/Toast.cjs.map +1 -1
- package/dist/Toasters/Toast.js +62 -13
- package/dist/Toasters/Toast.js.map +1 -1
- package/dist/Toasters/__tests__/Toast.test.tsx +74 -0
- package/dist/Toggles/ToggleButton.cjs +9 -3
- package/dist/Toggles/ToggleButton.cjs.map +1 -1
- package/dist/Toggles/ToggleButton.d.ts +1 -1
- package/dist/Toggles/ToggleButton.js +9 -3
- package/dist/Toggles/ToggleButton.js.map +1 -1
- package/dist/Toggles/TogglerStyles.cjs +22 -8
- package/dist/Toggles/TogglerStyles.cjs.map +1 -1
- package/dist/Toggles/TogglerStyles.js +22 -8
- package/dist/Toggles/TogglerStyles.js.map +1 -1
- package/dist/Toggles/__tests__/ToggleButton.test.tsx +53 -0
- package/dist/Toggles/__tests__/ToggleSwitch.test.tsx +87 -0
- package/dist/Tooltips/TooltipStyles.cjs +28 -6
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.js +28 -6
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/Tooltips/__tests__/TooltipWrapper.test.tsx +16 -0
- package/dist/common/InputStyling.cjs +30 -7
- package/dist/common/InputStyling.cjs.map +1 -1
- package/dist/common/InputStyling.js +30 -7
- package/dist/common/InputStyling.js.map +1 -1
- package/dist/custom.d.ts +2 -0
- package/dist/styles/colors.cjs +439 -84
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +200 -11
- package/dist/styles/colors.js +439 -84
- package/dist/styles/colors.js.map +1 -1
- package/dist/styles/global.cjs +19 -2
- package/dist/styles/global.cjs.map +1 -1
- package/dist/styles/global.d.ts +3 -2
- package/dist/styles/global.js +18 -3
- package/dist/styles/global.js.map +1 -1
- package/dist/styles/index.cjs +21 -9
- package/dist/styles/index.cjs.map +1 -1
- package/dist/styles/index.d.ts +2 -2
- package/dist/styles/index.js +18 -6
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/react-datepicker.css +766 -0
- package/dist/test-utils.cjs +7 -1
- package/dist/test-utils.cjs.map +1 -1
- package/dist/test-utils.js +7 -1
- package/dist/test-utils.js.map +1 -1
- package/dist/utils/color-tokens.cjs +91 -0
- package/dist/utils/color-tokens.cjs.map +1 -0
- package/dist/utils/color-tokens.d.ts +19 -0
- package/dist/utils/color-tokens.js +82 -0
- package/dist/utils/color-tokens.js.map +1 -0
- package/package.json +12 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","useTheme","COLORS","ComponentS","ComponentTextStyle","
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","useTheme","COLORS","ComponentS","ComponentTextStyle","ComponentXLStyling","Tag","jsx","_jsx","jsxs","_jsxs","CardMiddleSectionContainer","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","generateToken","componentType","defaultVariant","theme","CardMiddleSectionTitle","h3","Bold","$disabled","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","componentId","children","$extraTopMargin","Boolean","$bottomMargin","textStyle","color","id","className","map","x","index","label","variant","icon"],"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, ComponentXLStyling, 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 /** Top level Id of Card component */\r\n componentId?: string;\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.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionTitle = styled.h3<{ $disabled?: boolean }>`\r\n ${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled \r\n ? COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)\r\n : COLORS.generateToken({componentType:'text',defaultVariant:'default'}, props.theme)\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 componentId\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n \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.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <CardMiddleSectionTitle \r\n id={`${componentId}-title`} \r\n className=\"titleBlock\"\r\n $disabled={disabled}>\r\n {title}\r\n </CardMiddleSectionTitle>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, 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,kBAAkB,EAAEC,GAAG,QAAqB,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8BxH,OAAO,MAAMC,0BAA0B,GAAGX,MAAM,CAACY,GAAG;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,gCAAgC,GAAGb,MAAM,CAACY,GAAuB;AAC9E;AACA;AACA;AACA;AACA;AACA,sBAAuBE,KAAK,IAAKA,KAAK,CAACC,MAAM;AAC7C,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAGhB,MAAM,CAACY,GAAG;AACrD;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMK,+BAA+B,GAAGjB,MAAM,CAACY,GAAyD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaE,KAAK,IAAIZ,MAAM,CAACgB,aAAa,CAAC;EAAEC,aAAa,EAAE,MAAM;EAAEC,cAAc,EAAE;AAAS,CAAC,EAAEN,KAAK,CAACO,KAAK,CAAC;AAC5G;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,sBAAsB,GAAGtB,MAAM,CAACuB,EAA2B;AACxE,IAAIT,KAAK,IAAIT,kBAAkB,CAACD,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S,EAAEU,QAAS;MAAAE,QAAA,EACnBN;IAAK,CACgB,CAAC,EACxBC,WAAW,iBACVxB,IAAA,CAACL,UAAU;MAACyC,SAAS,EAAC,kBAAkB;MAACF,KAAK,EAAExC,MAAM,CAACgB,aAAa,CAAC;QAACC,aAAa,EAAC,MAAM;QAACC,cAAc,EAAC;MAAQ,CAAC,EAAEC,KAAK,CAAE;MAAAgB,QAAA,EACzHL;IAAW,CACF,CACb,EACAC,IAAI,iBACHzB,IAAA,CAACQ,2BAA2B;MAAAqB,QAAA,EACzBJ,IAAI,CAACY,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,kBACjBvC,IAAA,CAACF,GAAG;QAA6B0C,KAAK,EAAEF,CAAC,CAACE,KAAM;QAACC,OAAO,EAAEH,CAAC,CAACG,OAAO,IAAI,SAAU;QAACC,IAAI,EAAEJ,CAAC,CAACI;MAAK,GAArF,GAAGJ,CAAC,CAACE,KAAK,IAAID,KAAK,EAAoE,CAClG;IAAC,CACyB,CAC9B,EACAb,QAAQ,iBACP1B,IAAA,CAACQ,2BAA2B;MAAAqB,QAAA,EACzBH,QAAQ,CAACW,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,kBACrBvC,IAAA,CAACF,GAAG;QAA6B0C,KAAK,EAAEF,CAAC,CAACE,KAAM;QAACC,OAAO,EAAEH,CAAC,CAACG,OAAO,IAAI,SAAU;QAACC,IAAI,EAAEJ,CAAC,CAACI;MAAK,GAArF,GAAGJ,CAAC,CAACE,KAAK,IAAID,KAAK,EAAoE,CAClG;IAAC,CACyB,CAC9B;EAAA,CACyB,CAAC;AAEjC,CAAC;AAED,eAAerB,iBAAiB","ignoreList":[]}
|
|
@@ -99,10 +99,12 @@ const CardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
99
99
|
height: image?.height ?? 200
|
|
100
100
|
},
|
|
101
101
|
children: [image && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionImageContainer, {
|
|
102
|
+
role: "none",
|
|
103
|
+
"aria-hidden": "true",
|
|
102
104
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageWithFallbacks, {
|
|
103
105
|
fallbacks: image.fallbackSrc ?? '',
|
|
104
106
|
src: image.src,
|
|
105
|
-
alt:
|
|
107
|
+
alt: "",
|
|
106
108
|
loader: image.loader ?? false,
|
|
107
109
|
width: image.width,
|
|
108
110
|
height: image.height
|
|
@@ -124,9 +126,16 @@ const CardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
124
126
|
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardTopSectionRibbonContainer, {
|
|
125
127
|
"data-testid": 'card-topSection-ribbon',
|
|
126
128
|
$color: highlightRibbonContentColor ?? '',
|
|
127
|
-
$backgroundColor: disabled ? _index.COLORS.
|
|
129
|
+
$backgroundColor: disabled ? _index.COLORS.generateToken({
|
|
130
|
+
componentType: 'bg-fill',
|
|
131
|
+
state: 'disabled'
|
|
132
|
+
}, theme) : highlightRibbonBgColor ?? '',
|
|
128
133
|
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
|
|
129
|
-
color:
|
|
134
|
+
color: disabled ? _index.COLORS.generateToken({
|
|
135
|
+
componentType: 'text',
|
|
136
|
+
isOnFill: true,
|
|
137
|
+
state: 'disabled'
|
|
138
|
+
}, theme) : highlightRibbonContentColor ?? '',
|
|
130
139
|
textStyle: _typography.ComponentTextStyle.Regular,
|
|
131
140
|
children: highlightRibbonText
|
|
132
141
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardTopSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_typography","_Checkbox","_interopRequireDefault","_Tag","_index","_Image","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardTopSectionImageContainer","exports","styled","div","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","COLORS","getColor","theme","CardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","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,M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;IAAWjB,GAAG,EAAAc,UAAA,CAAAnE,OAAA,CAAAsE,MAAA,CAAAG,UAAA;IAAU3B,MAAM,EAAAqB,UAAA,CAAAnE,OAAA,CAAAsE,MAAA;IAAWf,KAAK,EAAAY,UAAA,CAAAnE,OAAA,CAAAsE,MAAA;IAAWhB,MAAM,EAAAa,UAAA,CAAAnE,OAAA,CAAAoE;EAAA;EAEjG/C,QAAQ,EAAA8C,UAAA,CAAAnE,OAAA,CAAAoE;AAAA;AAAA,IAAAM,QAAA,GAAA3D,OAAA,CAAAf,OAAA,GAwHK6B,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CardTopSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_typography","_Checkbox","_interopRequireDefault","_Tag","_index","_Image","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardTopSectionImageContainer","exports","styled","div","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","COLORS","getColor","theme","CardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","useTheme","jsxs","style","height","children","jsx","role","ImageWithFallbacks","fallbacks","fallbackSrc","src","alt","loader","width","select","Tag","label","variant","icon","generateToken","componentType","state","ComponentS","color","isOnFill","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 role=\"none\" aria-hidden=\"true\">\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} 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.generateToken({componentType:'bg-fill', state:'disabled'}, theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={disabled ? COLORS.generateToken({componentType:'text', isOnFill: true, state:'disabled'}, theme) : 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,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAA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AAA;AAAA,IAAAM,QAAA,GAAAhE,OAAA,CAAAf,OAAA,GAwHK6B,cAAc","ignoreList":[]}
|
|
@@ -90,10 +90,12 @@ const CardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
90
90
|
height: image?.height ?? 200
|
|
91
91
|
},
|
|
92
92
|
children: [image && /*#__PURE__*/_jsx(CardTopSectionImageContainer, {
|
|
93
|
+
role: "none",
|
|
94
|
+
"aria-hidden": "true",
|
|
93
95
|
children: /*#__PURE__*/_jsx(ImageWithFallbacks, {
|
|
94
96
|
fallbacks: image.fallbackSrc ?? '',
|
|
95
97
|
src: image.src,
|
|
96
|
-
alt:
|
|
98
|
+
alt: "",
|
|
97
99
|
loader: image.loader ?? false,
|
|
98
100
|
width: image.width,
|
|
99
101
|
height: image.height
|
|
@@ -115,9 +117,16 @@ const CardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
115
117
|
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/_jsxs(CardTopSectionRibbonContainer, {
|
|
116
118
|
"data-testid": 'card-topSection-ribbon',
|
|
117
119
|
$color: highlightRibbonContentColor ?? '',
|
|
118
|
-
$backgroundColor: disabled ? COLORS.
|
|
120
|
+
$backgroundColor: disabled ? COLORS.generateToken({
|
|
121
|
+
componentType: 'bg-fill',
|
|
122
|
+
state: 'disabled'
|
|
123
|
+
}, theme) : highlightRibbonBgColor ?? '',
|
|
119
124
|
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/_jsx(ComponentS, {
|
|
120
|
-
color:
|
|
125
|
+
color: disabled ? COLORS.generateToken({
|
|
126
|
+
componentType: 'text',
|
|
127
|
+
isOnFill: true,
|
|
128
|
+
state: 'disabled'
|
|
129
|
+
}, theme) : highlightRibbonContentColor ?? '',
|
|
121
130
|
textStyle: ComponentTextStyle.Regular,
|
|
122
131
|
children: highlightRibbonText
|
|
123
132
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardTopSection.js","names":["React","styled","useTheme","ComponentS","ComponentTextStyle","Checkbox","Tag","COLORS","ImageWithFallbacks","jsx","_jsx","jsxs","_jsxs","CardTopSectionImageContainer","div","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","getColor","theme","CardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","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,aAA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BAAgB,EAAEF,QAAQ,GAAGX,MAAM,CAACgB,QAAQ,CAAC,aAAa,EAAEC,KAAK,CAAC,GAAGc,sBAAsB,IAAI,EAAG;MAAAG,QAAA,GACpHN,mBAAmB,EACnBC,mBAAmB,iBAClB1B,IAAA,CAACP,UAAU;QAACiD,KAAK,EAAEf,2BAA2B,IAAI,EAAG;QAACgB,SAAS,EAAEjD,kBAAkB,CAACkD,OAAQ;QAAAb,QAAA,EACzFL;MAAmB,CACV,CACb;IAAA,CAC4B,CAChC;EAAA,CACsB,CAAC;AAE9B,CAAC,CAAC;AAACX,cAAA,CAAA8B,SAAA;EA1ID1B,QAAQ,EAAA2B,GAAA,CAAAC,IAAA;EAER3B,WAAW,EAAA0B,GAAA,CAAAE,IAAA;EAEX1B,QAAQ,EAAAwB,GAAA,CAAAG,MAAA;EAER1B,OAAO,EAAAuB,GAAA,CAAAI,IAAA;EAIPxB,mBAAmB,EAAAoB,GAAA,CAAAG,MAAA;EAEnBxB,mBAAmB,EAAAqB,GAAA,CAAAI,IAAA;EAEnBvB,2BAA2B,EAAAmB,GAAA,CAAAG,MAAA;EAE3BrB,sBAAsB,EAAAkB,GAAA,CAAAG,MAAA;EAEtB5B,KAAK,EAAAyB,GAAA,CAAAK,KAAA;IAAKjB,GAAG,EAAAY,GAAA,CAAAG,MAAA,CAAAG,UAAA;IAAUnB,WAAW,EAAAa,GAAA,CAAAG,MAAA;IAAWd,GAAG,EAAAW,GAAA,CAAAG,MAAA,CAAAG,UAAA;IAAUtB,MAAM,EAAAgB,GAAA,CAAAG,MAAA;IAAWZ,KAAK,EAAAS,GAAA,CAAAG,MAAA;IAAWb,MAAM,EAAAU,GAAA,CAAAC;EAAA;EAEjGvC,QAAQ,EAAAsC,GAAA,CAAAC;AAAA;AAwHV,eAAehC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CardTopSection.js","names":["React","styled","useTheme","ComponentS","ComponentTextStyle","Checkbox","Tag","COLORS","ImageWithFallbacks","jsx","_jsx","jsxs","_jsxs","CardTopSectionImageContainer","div","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","getColor","theme","CardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","style","height","children","role","fallbacks","fallbackSrc","src","alt","loader","width","select","label","variant","icon","generateToken","componentType","state","color","isOnFill","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 role=\"none\" aria-hidden=\"true\">\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} 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.generateToken({componentType:'bg-fill', state:'disabled'}, theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={disabled ? COLORS.generateToken({componentType:'text', isOnFill: true, state:'disabled'}, theme) : 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;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AAAG,MAAA;IAAWhB,KAAK,EAAAa,GAAA,CAAAG,MAAA;IAAWjB,MAAM,EAAAc,GAAA,CAAAC;EAAA;EAEjG5C,QAAQ,EAAA2C,GAAA,CAAAC;AAAA;AAwHV,eAAerC,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { fireEvent, getByRole, render } from '../../test-utils';
|
|
3
|
+
import 'jest-styled-components';
|
|
4
|
+
import { Card } from '../..';
|
|
5
|
+
import { COLORS } from '../../styles';
|
|
6
|
+
import { SystemIcons } from '../../icons';
|
|
7
|
+
|
|
8
|
+
describe('<Card />',()=>{
|
|
9
|
+
it('renders top section', async () => {
|
|
10
|
+
const{getByTestId} = render(
|
|
11
|
+
<Card topSectionProps={{disabled: false}} disabled/>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
expect(getByTestId('card-topSection')).toBeDefined();
|
|
15
|
+
//expect(getByTestId('card-middleSection')).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders middle section', async () => {
|
|
19
|
+
const{getByTestId} = render(
|
|
20
|
+
<Card middleSectionProps={{title:'title',disabled:false}} disabled/>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(getByTestId('card-middleSection')).toBeDefined();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders bottom section', async () => {
|
|
27
|
+
const{getByTestId} = render(
|
|
28
|
+
<Card bottomSectionProps={{disabled:false}} disabled/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
expect(getByTestId('card-bottomSection')).toBeDefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('fires card clicked event on click', async () => {
|
|
35
|
+
const cardClicked = jest.fn();
|
|
36
|
+
const{getByTestId} = render(
|
|
37
|
+
<Card bottomSectionProps={{disabled:false}} disabled={false} onCardClicked={cardClicked}/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
fireEvent.click(getByTestId('card-link'));
|
|
41
|
+
expect(cardClicked).toHaveBeenCalled();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('fires card clicked event on keyDown', async () => {
|
|
45
|
+
const cardClicked = jest.fn();
|
|
46
|
+
const{getByTestId} = render(
|
|
47
|
+
<Card bottomSectionProps={{disabled:false}} disabled={false} onCardClicked={cardClicked}/>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
fireEvent.keyDown(getByTestId('card-wrapper'), {key: 'Enter', code: 'Enter', charCode: 13});
|
|
51
|
+
expect(cardClicked).toHaveBeenCalled();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('renders tag in top section', async () => {
|
|
55
|
+
const{getByText} = render(
|
|
56
|
+
<Card topSectionProps={{disabled: false, tagLabel:'test_label'}} disabled/>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
expect(getByText('test_label')).toBeDefined();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('renders checkbox in top section', async () => {
|
|
63
|
+
const{getByTestId} = render(
|
|
64
|
+
<Card topSectionProps={{disabled: false, selected: true}} disabled/>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
expect(getByTestId('card-topSection-checkbox')).toBeDefined();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('renders highlight ribbon in top section', async () => {
|
|
71
|
+
const{getByTestId, getByText} = render(
|
|
72
|
+
<Card topSectionProps={{disabled: false, highlightRibbonText:'testRibbon', highlightRibbonBgColor:'red'}} disabled={false}/>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
expect(getByText('testRibbon')).toBeDefined();
|
|
76
|
+
expect(getByTestId('card-topSection-ribbon')).toHaveStyleRule('background-color','red');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('renders title ,description and category label in middle section', async () => {
|
|
80
|
+
const{getByText} = render(
|
|
81
|
+
<Card middleSectionProps={{title:'testTitle', disabled: false, description:'testDescription', categoryLabel:'testCatLabel'}} disabled={false}/>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
expect(getByText('testTitle')).toBeDefined();
|
|
85
|
+
expect(getByText('testDescription')).toBeDefined();
|
|
86
|
+
expect(getByText('testCatLabel')).toBeDefined();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('renders tags in middle section', async () => {
|
|
90
|
+
const{getByText} = render(
|
|
91
|
+
<Card middleSectionProps={{title:'testTitle', disabled: false, tags:[{label:'testTag'}], row2Tags:[{label:'testTag2'}]}} disabled={false}/>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect(getByText('testTitle')).toBeDefined();
|
|
95
|
+
expect(getByText('testTag2')).toBeDefined();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('renders note text in bottom section', async () => {
|
|
99
|
+
const{getByText} = render(
|
|
100
|
+
<Card bottomSectionProps={{disabled: false, noteLeft:'leftNote', noteRight:'rightNote'}} disabled={false}/>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect(getByText('leftNote')).toBeDefined();
|
|
104
|
+
expect(getByText('rightNote')).toBeDefined();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('renders author in bottom section', async () => {
|
|
108
|
+
const{getByText,getByTestId} = render(
|
|
109
|
+
<Card bottomSectionProps={{disabled: true, authorName:'testAuthor'}} disabled={true}/>
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
expect(getByText('testAuthor')).toBeDefined();
|
|
113
|
+
expect(getByTestId('card-bottomSection-author')).toBeDefined();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('renders actions in bottom section', async () => {
|
|
117
|
+
const{getByText,getByTestId} = render(
|
|
118
|
+
<Card bottomSectionProps={{disabled: true, authorName:'testAuthor', actions:[{icon:<SystemIcons.Add/>,onClick:()=>{}}]}} disabled={true}/>
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
expect(getByText('testAuthor')).toBeDefined();
|
|
122
|
+
expect(getByTestId('card-bottomSection-author')).toBeDefined();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('fires leftButton click event on click', async () => {
|
|
126
|
+
const leftButtonClicked = jest.fn();
|
|
127
|
+
const{getByRole} = render(
|
|
128
|
+
<Card bottomSectionProps={{disabled: true,
|
|
129
|
+
authorName:'testAuthor',
|
|
130
|
+
actions:[],
|
|
131
|
+
leftButton: {
|
|
132
|
+
variant: 'tertiary',
|
|
133
|
+
buttonText: 'button',
|
|
134
|
+
onClick: (e) => {
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
leftButtonClicked();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}}
|
|
140
|
+
disabled={true}/>
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
fireEvent.click(getByRole('button'));
|
|
144
|
+
expect(leftButtonClicked).toBeCalledTimes(1);
|
|
145
|
+
});
|
|
146
|
+
})
|
|
@@ -149,7 +149,10 @@ const ChipContainer = exports.ChipContainer = _styledComponents.default.div`
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
&.outline {
|
|
152
|
-
color: ${props => _styles.COLORS.
|
|
152
|
+
color: ${props => _styles.COLORS.generateToken({
|
|
153
|
+
componentType: 'text',
|
|
154
|
+
defaultVariant: 'subtle'
|
|
155
|
+
}, props.theme)};
|
|
153
156
|
|
|
154
157
|
${ChipContent} {
|
|
155
158
|
background-color: ${props => _styles.COLORS.getColor('white', props.theme)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipStyles.cjs","names":["_styledComponents","_interopRequireDefault","require","_styles","ChipContentContainer","exports","styled","div","ChipContent","ComponentXSStyling","ComponentTextStyle","Bold","ChipContainer","ComponentSStyling","ComponentMStyling","focusStyles","props","COLORS","getColor","theme"],"sources":["../../src/Chips/ChipStyles.ts"],"sourcesContent":["/**\r\n * Import third-party libraries.\r\n */\r\nimport styled from 'styled-components';\r\n\r\n/**\r\n * Import custom style properties.\r\n */\r\nimport { COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, focusStyles } from '../styles';\r\n\r\nexport const ChipContentContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n min-height: 48px;\r\n width: max-content;\r\n`;\r\n\r\nexport const ChipContent = styled.div`\r\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\r\n\r\n position: relative;\r\n display: flex;\r\n gap: 4px;\r\n align-items: center;\r\n min-height: 24px;\r\n box-sizing: border-box;\r\n border-radius: 24px;\r\n padding: 4px 12px;\r\n\r\n .chip-icon {\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n\r\n svg {\r\n height: 16px;\r\n width: 16px;\r\n }\r\n }\r\n\r\n .icon-left {\r\n margin-left: -4px;\r\n }\r\n\r\n .icon-right {\r\n margin-right: -4px;\r\n }\r\n\r\n .action-right {\r\n position: absolute;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 48px;\r\n width: 48px;\r\n right: -8px;\r\n }\r\n\r\n &.with-action-right {\r\n position: relative;\r\n padding-right: 28px;\r\n }\r\n`;\r\n\r\nexport const ChipContainer = styled.div`\r\n display: inline-block;\r\n cursor: pointer;\r\n position: relative;\r\n\r\n &.medium {\r\n ${ChipContent} {\r\n gap: 6px;\r\n padding: 10px 16px;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 20px;\r\n width: 20px;\r\n\r\n svg {\r\n height: 20px;\r\n width: 20px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 38px;\r\n\r\n .action-right {\r\n right: -2px;\r\n }\r\n }\r\n }\r\n\r\n &.large {\r\n ${ChipContent} {\r\n gap: 8px;\r\n padding: 12px 20px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 24px;\r\n width: 24px;\r\n\r\n svg {\r\n height: 24px;\r\n width: 24px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 48px;\r\n\r\n .action-right {\r\n right: 4px;\r\n }\r\n }\r\n }\r\n\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.default {\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_500', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n }\r\n\r\n &.outline {\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_200', props.theme)};\r\n color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_300', props.theme)};\r\n color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n box-shadow: none;\r\n }\r\n }\r\n\r\n //account for border\r\n &.small.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 2px 10px;\r\n }\r\n }\r\n\r\n &.medium.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 8px 14px;\r\n }\r\n }\r\n\r\n &.large.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 10px 18px;\r\n }\r\n }\r\n\r\n &.invalid {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('critical_100', props.theme)};\r\n color: ${props => COLORS.getColor('critical_600', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:active:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n }\r\n\r\n .action-right:focus {\r\n ${focusStyles}\r\n }\r\n\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n\r\n &.invalid {\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n\r\n ${ChipContentContainer} {\r\n pointer-events: none;\r\n }\r\n\r\n ${ChipContent} {\r\n border: none !important;\r\n background-color: ${props => COLORS.getColor('neutral_100', props.theme)} !important;\r\n color: ${props => COLORS.getColor('neutral_300', props.theme)} !important;\r\n }\r\n }\r\n`;\r\n"],"mappings":";;;;;;;AAGA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGE,yBAAM,CAACC,GAAG;AAC9C;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,WAAW,GAAAH,OAAA,CAAAG,WAAA,GAAGF,yBAAM,CAACC,GAAG;AACrC,IAAI,IAAAE,0BAAkB,EAACC,0BAAkB,CAACC,IAAI,EAAE,IAAI,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,aAAa,GAAAP,OAAA,CAAAO,aAAA,GAAGN,yBAAM,CAACC,GAAG;AACvC;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW;AACjB;AACA;AACA;AACA,QAAQ,IAAAK,yBAAiB,EAACH,0BAAkB,CAACC,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMH,WAAW;AACjB;AACA;AACA;AACA,QAAQ,IAAAM,yBAAiB,EAACJ,0BAAkB,CAACC,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,mBAAW;AACjB;AACA;AACA;AACA,aAAaC,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,OAAO,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC3D;AACA,MAAMX,WAAW;AACjB,0BAA0BQ,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAE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AAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC/E,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AACpE;AACA;AACA;AACA,0BAA0BH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC/E,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AACpE;AACA;AACA;AACA;AACA,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMf,oBAAoB;AAC1B;AACA;AACA;AACA,MAAMI,WAAW;AACjB;AACA,0BAA0BQ,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC9E,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AACnE;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ChipStyles.cjs","names":["_styledComponents","_interopRequireDefault","require","_styles","ChipContentContainer","exports","styled","div","ChipContent","ComponentXSStyling","ComponentTextStyle","Bold","ChipContainer","ComponentSStyling","ComponentMStyling","focusStyles","props","COLORS","getColor","theme","generateToken","componentType","defaultVariant"],"sources":["../../src/Chips/ChipStyles.ts"],"sourcesContent":["/**\r\n * Import third-party libraries.\r\n */\r\nimport styled from 'styled-components';\r\n\r\n/**\r\n * Import custom style properties.\r\n */\r\nimport { COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, focusStyles } from '../styles';\r\n\r\nexport const ChipContentContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n min-height: 48px;\r\n width: max-content;\r\n`;\r\n\r\nexport const ChipContent = styled.div`\r\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\r\n\r\n position: relative;\r\n display: flex;\r\n gap: 4px;\r\n align-items: center;\r\n min-height: 24px;\r\n box-sizing: border-box;\r\n border-radius: 24px;\r\n padding: 4px 12px;\r\n\r\n .chip-icon {\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n\r\n svg {\r\n height: 16px;\r\n width: 16px;\r\n }\r\n }\r\n\r\n .icon-left {\r\n margin-left: -4px;\r\n }\r\n\r\n .icon-right {\r\n margin-right: -4px;\r\n }\r\n\r\n .action-right {\r\n position: absolute;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 48px;\r\n width: 48px;\r\n right: -8px;\r\n }\r\n\r\n &.with-action-right {\r\n position: relative;\r\n padding-right: 28px;\r\n }\r\n`;\r\n\r\nexport const ChipContainer = styled.div`\r\n display: inline-block;\r\n cursor: pointer;\r\n position: relative;\r\n\r\n &.medium {\r\n ${ChipContent} {\r\n gap: 6px;\r\n padding: 10px 16px;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 20px;\r\n width: 20px;\r\n\r\n svg {\r\n height: 20px;\r\n width: 20px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 38px;\r\n\r\n .action-right {\r\n right: -2px;\r\n }\r\n }\r\n }\r\n\r\n &.large {\r\n ${ChipContent} {\r\n gap: 8px;\r\n padding: 12px 20px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 24px;\r\n width: 24px;\r\n\r\n svg {\r\n height: 24px;\r\n width: 24px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 48px;\r\n\r\n .action-right {\r\n right: 4px;\r\n }\r\n }\r\n }\r\n\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.default {\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_500', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n }\r\n\r\n &.outline {\r\n color: ${props => COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_200', props.theme)};\r\n color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_300', props.theme)};\r\n color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n box-shadow: none;\r\n }\r\n }\r\n\r\n //account for border\r\n &.small.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 2px 10px;\r\n }\r\n }\r\n\r\n &.medium.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 8px 14px;\r\n }\r\n }\r\n\r\n &.large.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 10px 18px;\r\n }\r\n }\r\n\r\n &.invalid {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('critical_100', props.theme)};\r\n color: ${props => COLORS.getColor('critical_600', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:active:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n }\r\n\r\n .action-right:focus {\r\n ${focusStyles}\r\n }\r\n\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n\r\n &.invalid {\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n\r\n ${ChipContentContainer} {\r\n pointer-events: none;\r\n }\r\n\r\n ${ChipContent} {\r\n border: none !important;\r\n background-color: ${props => COLORS.getColor('neutral_100', props.theme)} !important;\r\n color: ${props => COLORS.getColor('neutral_300', props.theme)} !important;\r\n }\r\n }\r\n`;\r\n"],"mappings":";;;;;;;AAGA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGE,yBAAM,CAACC,GAAG;AAC9C;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,WAAW,GAAAH,OAAA,CAAAG,WAAA,GAAGF,yBAAM,CAACC,GAAG;AACrC,IAAI,IAAAE,0BAAkB,EAACC,0BAAkB,CAACC,IAAI,EAAE,IAAI,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,aAAa,GAAAP,OAAA,CAAAO,aAAA,GAAGN,yBAAM,CAACC,GAAG;AACvC;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW;AACjB;AACA;AACA;AACA,QAAQ,IAAAK,yBAAiB,EAACH,0BAAkB,CAACC,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMH,WAAW;AACjB;AACA;AACA;AACA,QAAQ,IAAAM,yBAAiB,EAACJ,0BAAkB,CAACC,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,mBAAW;AACjB;AACA;AACA;AACA,aAAaC,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,OAAO,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC3D;AACA,MAAMX,WAAW;AACjB,0BAA0BQ,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC9E;AACA;AACA;AACA;AACA,MAAMX,WAAW;AACjB,0BAA0BQ,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAA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CAACC,QAAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AACpE;AACA;AACA;AACA,0BAA0BH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC/E,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC;AACpE;AACA;AACA;AACA;AACA,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMf,oBAAoB;AAC1B;AACA;AACA;AACA,MAAMI,WAAW;AACjB;AACA,0BAA0BQ,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AAC9E,eAAeH,KAAK,IAAIC,cAAM,CAACC,QAAQ,CAAC,aAAa,EAAEF,KAAK,CAACG,KAAK,CAAC;AACnE;AACA;AACA,CAAC","ignoreList":[]}
|
package/dist/Chips/ChipStyles.js
CHANGED
|
@@ -141,7 +141,10 @@ export const ChipContainer = styled.div`
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
&.outline {
|
|
144
|
-
color: ${props => COLORS.
|
|
144
|
+
color: ${props => COLORS.generateToken({
|
|
145
|
+
componentType: 'text',
|
|
146
|
+
defaultVariant: 'subtle'
|
|
147
|
+
}, props.theme)};
|
|
145
148
|
|
|
146
149
|
${ChipContent} {
|
|
147
150
|
background-color: ${props => COLORS.getColor('white', props.theme)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipStyles.js","names":["styled","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","focusStyles","ChipContentContainer","div","ChipContent","Bold","ChipContainer","props","getColor","theme"],"sources":["../../src/Chips/ChipStyles.ts"],"sourcesContent":["/**\r\n * Import third-party libraries.\r\n */\r\nimport styled from 'styled-components';\r\n\r\n/**\r\n * Import custom style properties.\r\n */\r\nimport { COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, focusStyles } from '../styles';\r\n\r\nexport const ChipContentContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n min-height: 48px;\r\n width: max-content;\r\n`;\r\n\r\nexport const ChipContent = styled.div`\r\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\r\n\r\n position: relative;\r\n display: flex;\r\n gap: 4px;\r\n align-items: center;\r\n min-height: 24px;\r\n box-sizing: border-box;\r\n border-radius: 24px;\r\n padding: 4px 12px;\r\n\r\n .chip-icon {\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n\r\n svg {\r\n height: 16px;\r\n width: 16px;\r\n }\r\n }\r\n\r\n .icon-left {\r\n margin-left: -4px;\r\n }\r\n\r\n .icon-right {\r\n margin-right: -4px;\r\n }\r\n\r\n .action-right {\r\n position: absolute;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 48px;\r\n width: 48px;\r\n right: -8px;\r\n }\r\n\r\n &.with-action-right {\r\n position: relative;\r\n padding-right: 28px;\r\n }\r\n`;\r\n\r\nexport const ChipContainer = styled.div`\r\n display: inline-block;\r\n cursor: pointer;\r\n position: relative;\r\n\r\n &.medium {\r\n ${ChipContent} {\r\n gap: 6px;\r\n padding: 10px 16px;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 20px;\r\n width: 20px;\r\n\r\n svg {\r\n height: 20px;\r\n width: 20px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 38px;\r\n\r\n .action-right {\r\n right: -2px;\r\n }\r\n }\r\n }\r\n\r\n &.large {\r\n ${ChipContent} {\r\n gap: 8px;\r\n padding: 12px 20px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 24px;\r\n width: 24px;\r\n\r\n svg {\r\n height: 24px;\r\n width: 24px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 48px;\r\n\r\n .action-right {\r\n right: 4px;\r\n }\r\n }\r\n }\r\n\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.default {\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_500', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n }\r\n\r\n &.outline {\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_200', props.theme)};\r\n color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_300', props.theme)};\r\n color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n box-shadow: none;\r\n }\r\n }\r\n\r\n //account for border\r\n &.small.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 2px 10px;\r\n }\r\n }\r\n\r\n &.medium.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 8px 14px;\r\n }\r\n }\r\n\r\n &.large.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 10px 18px;\r\n }\r\n }\r\n\r\n &.invalid {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('critical_100', props.theme)};\r\n color: ${props => COLORS.getColor('critical_600', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:active:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n }\r\n\r\n .action-right:focus {\r\n ${focusStyles}\r\n }\r\n\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n\r\n &.invalid {\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n\r\n ${ChipContentContainer} {\r\n pointer-events: none;\r\n }\r\n\r\n ${ChipContent} {\r\n border: none !important;\r\n background-color: ${props => COLORS.getColor('neutral_100', props.theme)} !important;\r\n color: ${props => COLORS.getColor('neutral_300', props.theme)} !important;\r\n }\r\n }\r\n`;\r\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,kBAAkB,EAAEC,WAAW,QAAQ,WAAW;AAE7H,OAAO,MAAMC,oBAAoB,GAAGP,MAAM,CAACQ,GAAG;AAC9C;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,WAAW,GAAGT,MAAM,CAACQ,GAAG;AACrC,IAAIH,kBAAkB,CAACD,kBAAkB,CAACM,IAAI,EAAE,IAAI,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGX,MAAM,CAACQ,GAAG;AACvC;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW;AACjB;AACA;AACA;AACA,QAAQN,iBAAiB,CAACC,kBAAkB,CAACM,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMD,WAAW;AACjB;AACA;AACA;AACA,QAAQP,iBAAiB,CAACE,kBAAkB,CAACM,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMJ,WAAW;AACjB;AACA;AACA;AACA,aAAaM,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,OAAO,EAAED,KAAK,CAACE,KAAK,CAAC;AAC3D;AACA,MAAML,WAAW;AACjB,0BAA0BG,KAAK,IAAIX,MAAM,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,EAAED,KAAK,CAACE,KAAK,CAAC;AAC/E,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,cAAc,EAAED,KAAK,CAACE,KAAK,CAAC;AACpE;AACA;AACA;AACA,0BAA0BF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,cAAc,EAAED,KAAK,CAACE,KAAK,CAAC;AAC/E,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,cAAc,EAAED,KAAK,CAACE,KAAK,CAAC;AACpE;AACA;AACA;AACA;AACA,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMP,oBAAoB;AAC1B;AACA;AACA;AACA,MAAME,WAAW;AACjB;AACA,0BAA0BG,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAC9E,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AACnE;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ChipStyles.js","names":["styled","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","focusStyles","ChipContentContainer","div","ChipContent","Bold","ChipContainer","props","getColor","theme","generateToken","componentType","defaultVariant"],"sources":["../../src/Chips/ChipStyles.ts"],"sourcesContent":["/**\r\n * Import third-party libraries.\r\n */\r\nimport styled from 'styled-components';\r\n\r\n/**\r\n * Import custom style properties.\r\n */\r\nimport { COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, focusStyles } from '../styles';\r\n\r\nexport const ChipContentContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n min-height: 48px;\r\n width: max-content;\r\n`;\r\n\r\nexport const ChipContent = styled.div`\r\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\r\n\r\n position: relative;\r\n display: flex;\r\n gap: 4px;\r\n align-items: center;\r\n min-height: 24px;\r\n box-sizing: border-box;\r\n border-radius: 24px;\r\n padding: 4px 12px;\r\n\r\n .chip-icon {\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n\r\n svg {\r\n height: 16px;\r\n width: 16px;\r\n }\r\n }\r\n\r\n .icon-left {\r\n margin-left: -4px;\r\n }\r\n\r\n .icon-right {\r\n margin-right: -4px;\r\n }\r\n\r\n .action-right {\r\n position: absolute;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 48px;\r\n width: 48px;\r\n right: -8px;\r\n }\r\n\r\n &.with-action-right {\r\n position: relative;\r\n padding-right: 28px;\r\n }\r\n`;\r\n\r\nexport const ChipContainer = styled.div`\r\n display: inline-block;\r\n cursor: pointer;\r\n position: relative;\r\n\r\n &.medium {\r\n ${ChipContent} {\r\n gap: 6px;\r\n padding: 10px 16px;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 20px;\r\n width: 20px;\r\n\r\n svg {\r\n height: 20px;\r\n width: 20px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 38px;\r\n\r\n .action-right {\r\n right: -2px;\r\n }\r\n }\r\n }\r\n\r\n &.large {\r\n ${ChipContent} {\r\n gap: 8px;\r\n padding: 12px 20px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n .chip-icon {\r\n height: 24px;\r\n width: 24px;\r\n\r\n svg {\r\n height: 24px;\r\n width: 24px;\r\n }\r\n }\r\n }\r\n\r\n .with-action-right {\r\n padding-right: 48px;\r\n\r\n .action-right {\r\n right: 4px;\r\n }\r\n }\r\n }\r\n\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.default {\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_500', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.default:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n }\r\n\r\n &.outline {\r\n color: ${props => COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)};\r\n\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_200', props.theme)};\r\n color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.outline:active:not(.action-within) {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n border: 2px solid ${props => COLORS.getColor('primary_300', props.theme)};\r\n color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n box-shadow: none;\r\n }\r\n }\r\n\r\n //account for border\r\n &.small.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 2px 10px;\r\n }\r\n }\r\n\r\n &.medium.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 8px 14px;\r\n }\r\n }\r\n\r\n &.large.outline:not(.disabled) {\r\n ${ChipContent} {\r\n padding: 10px 18px;\r\n }\r\n }\r\n\r\n &.invalid {\r\n ${ChipContent} {\r\n background-color: ${props => COLORS.getColor('critical_100', props.theme)};\r\n color: ${props => COLORS.getColor('critical_600', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:hover:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n }\r\n\r\n &.interactive.invalid:active:not(.action-within) {\r\n ${ChipContent} {\r\n background: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n }\r\n\r\n .action-right:focus {\r\n ${focusStyles}\r\n }\r\n\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n\r\n &.invalid {\r\n .action-right:hover .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_200', props.theme)};\r\n color: ${props => COLORS.getColor('critical_700', props.theme)};\r\n }\r\n\r\n .action-right:active .chip-icon {\r\n background-color: ${props => COLORS.getColor('critical_300', props.theme)};\r\n color: ${props => COLORS.getColor('critical_800', props.theme)};\r\n }\r\n\r\n .action-right.disabled .chip-icon {\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('primary_300', props.theme)};\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n\r\n ${ChipContentContainer} {\r\n pointer-events: none;\r\n }\r\n\r\n ${ChipContent} {\r\n border: none !important;\r\n background-color: ${props => COLORS.getColor('neutral_100', props.theme)} !important;\r\n color: ${props => COLORS.getColor('neutral_300', props.theme)} !important;\r\n }\r\n }\r\n`;\r\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,kBAAkB,EAAEC,WAAW,QAAQ,WAAW;AAE7H,OAAO,MAAMC,oBAAoB,GAAGP,MAAM,CAACQ,GAAG;AAC9C;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,WAAW,GAAGT,MAAM,CAACQ,GAAG;AACrC,IAAIH,kBAAkB,CAACD,kBAAkB,CAACM,IAAI,EAAE,IAAI,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGX,MAAM,CAACQ,GAAG;AACvC;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW;AACjB;AACA;AACA;AACA,QAAQN,iBAAiB,CAACC,kBAAkB,CAACM,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMD,WAAW;AACjB;AACA;AACA;AACA,QAAQP,iBAAiB,CAACE,kBAAkB,CAACM,IAAI,EAAE,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMJ,WAAW;AACjB;AACA;AACA;AACA,aAAaM,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,OAAO,EAAED,KAAK,CAACE,KAAK,CAAC;AAC3D;AACA,MAAML,WAAW;AACjB,0BAA0BG,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAC9E;AACA;AACA;AACA;AACA,MAAML,WAAW;AACjB,0BAA0BG,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAC9E;AACA;AACA;AACA;AACA,MAAML,WAAW;AACjB,0BAA0BG,KAAK,IAAIX,MAAM,C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ACE,KAAK,CAAC;AAC/E,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,cAAc,EAAED,KAAK,CAACE,KAAK,CAAC;AACpE;AACA;AACA;AACA;AACA,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMP,oBAAoB;AAC1B;AACA;AACA;AACA,MAAME,WAAW;AACjB;AACA,0BAA0BG,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAC9E,eAAeF,KAAK,IAAIX,MAAM,CAACY,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AACnE;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -46,6 +46,7 @@ const FilterChip = _ref => {
|
|
|
46
46
|
*/
|
|
47
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChipStyles.ChipContainer, _objectSpread(_objectSpread({
|
|
48
48
|
role: "checkbox",
|
|
49
|
+
"aria-checked": selected,
|
|
49
50
|
"data-testid": dataTestId,
|
|
50
51
|
className: `${size} ${disabled ? 'disabled' : ''} ${selected ? 'default' : 'outline'} ${!!onClick ? 'interactive' : ''} ${className || ''}`,
|
|
51
52
|
tabIndex: disabled || !onClick ? -1 : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterChip.cjs","names":["React","_interopRequireWildcard","require","_types","_index","_ChipStyles","_common","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","FilterChip","_ref","selected","text","size","Size","Medium","disabled","onClick","className","dataTestId","rest","_objectWithoutProperties2","jsx","ChipContainer","role","tabIndex","onKeyDown","key","onMouseDown","defaultOnMouseDownHandler","children","ChipContentContainer","jsxs","ChipContent","SystemIcons","CheckMark","_default","exports"],"sources":["../../src/Chips/FilterChip.tsx"],"sourcesContent":["/**\r\n * Import React libraries.\r\n */\r\nimport * as React from 'react';\r\nimport {Size} from '../types';\r\n\r\n/**\r\n * Import custom components.\r\n */\r\nimport {SystemIcons} from '../icons/index';\r\n\r\n/**\r\n * Import custom styles.\r\n */\r\nimport {ChipContent, ChipContentContainer, ChipContainer} from './ChipStyles';\r\n\r\n/**\r\n * Import custom types.\r\n */\r\nimport {FilterChipProps} from './ChipTypes';\r\nimport {defaultOnMouseDownHandler} from '../common';\r\n\r\nconst FilterChip: React.FunctionComponent<FilterChipProps> = ({\r\n selected,\r\n text,\r\n size = Size.Medium,\r\n disabled,\r\n onClick,\r\n className,\r\n dataTestId,\r\n ...rest\r\n }: FilterChipProps) => {\r\n\r\n\r\n /**\r\n * Return Filter Chip component.\r\n */\r\n return (\r\n <ChipContainer\r\n role=\"checkbox\"\r\n data-testid={dataTestId}\r\n className={`${size} ${disabled ? 'disabled' : ''} ${selected ? 'default' : 'outline'} ${!!onClick ? 'interactive' : ''} ${className || ''}`}\r\n tabIndex={disabled || !onClick ? -1 : 0}\r\n onKeyDown={e => (e.key === 'Enter' || e.key === ' ') && !disabled && onClick && onClick()}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={() => !disabled && onClick && onClick()}\r\n {...rest}>\r\n <ChipContentContainer>\r\n <ChipContent>\r\n {selected && <div className={'chip-icon icon-left'}><SystemIcons.CheckMark className={'icon'}/></div>}\r\n <div>{text}</div>\r\n </ChipContent>\r\n </ChipContentContainer>\r\n </ChipContainer>\r\n );\r\n};\r\n\r\nexport default FilterChip;\r\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE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,SAAS;MACTC;IAEe,CAAC,GAAAT,IAAA;IADbU,IAAI,OAAAC,yBAAA,CAAAzC,OAAA,EAAA8B,IAAA,EAAArC,SAAA;EAIrE;AACF;AACA;EACE,oBACE,IAAAD,WAAA,CAAAkD,GAAA,EAACpD,WAAA,CAAAqD,aAAa,EAAArB,aAAA,CAAAA,aAAA;IACZsB,IAAI,EAAC,UAAU;IACf,
|
|
1
|
+
{"version":3,"file":"FilterChip.cjs","names":["React","_interopRequireWildcard","require","_types","_index","_ChipStyles","_common","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","FilterChip","_ref","selected","text","size","Size","Medium","disabled","onClick","className","dataTestId","rest","_objectWithoutProperties2","jsx","ChipContainer","role","tabIndex","onKeyDown","key","onMouseDown","defaultOnMouseDownHandler","children","ChipContentContainer","jsxs","ChipContent","SystemIcons","CheckMark","_default","exports"],"sources":["../../src/Chips/FilterChip.tsx"],"sourcesContent":["/**\r\n * Import React libraries.\r\n */\r\nimport * as React from 'react';\r\nimport {Size} from '../types';\r\n\r\n/**\r\n * Import custom components.\r\n */\r\nimport {SystemIcons} from '../icons/index';\r\n\r\n/**\r\n * Import custom styles.\r\n */\r\nimport {ChipContent, ChipContentContainer, ChipContainer} from './ChipStyles';\r\n\r\n/**\r\n * Import custom types.\r\n */\r\nimport {FilterChipProps} from './ChipTypes';\r\nimport {defaultOnMouseDownHandler} from '../common';\r\n\r\nconst FilterChip: React.FunctionComponent<FilterChipProps> = ({\r\n selected,\r\n text,\r\n size = Size.Medium,\r\n disabled,\r\n onClick,\r\n className,\r\n dataTestId,\r\n ...rest\r\n }: FilterChipProps) => {\r\n\r\n\r\n /**\r\n * Return Filter Chip component.\r\n */\r\n return (\r\n <ChipContainer\r\n role=\"checkbox\"\r\n aria-checked={selected}\r\n data-testid={dataTestId}\r\n className={`${size} ${disabled ? 'disabled' : ''} ${selected ? 'default' : 'outline'} ${!!onClick ? 'interactive' : ''} ${className || ''}`}\r\n tabIndex={disabled || !onClick ? -1 : 0}\r\n onKeyDown={e => (e.key === 'Enter' || e.key === ' ') && !disabled && onClick && onClick()}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={() => !disabled && onClick && onClick()}\r\n {...rest}>\r\n <ChipContentContainer>\r\n <ChipContent>\r\n {selected && <div className={'chip-icon icon-left'}><SystemIcons.CheckMark className={'icon'}/></div>}\r\n <div>{text}</div>\r\n </ChipContent>\r\n </ChipContentContainer>\r\n </ChipContainer>\r\n );\r\n};\r\n\r\nexport default FilterChip;\r\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAJ,OAAA;AAAoD,IAAAK,WAAA,GAAAL,OAAA;AAAA,MAAAM,SAAA;AApBpD;AACA;AACA;AAIA;AACA;AACA;AAGA;AACA;AACA;AAGA;AACA;AACA;AAFA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAA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pD,CAAC,CAACoD,GAAG,KAAK,GAAG,KAAK,CAACX,QAAQ,IAAIC,OAAO,IAAIA,OAAO,CAAC,CAAE;IAC1FW,WAAW,EAAEC,iCAA0B;IACvCZ,OAAO,EAAEA,CAAA,KAAM,CAACD,QAAQ,IAAIC,OAAO,IAAIA,OAAO,CAAC;EAAE,GAC7CG,IAAI;IAAAU,QAAA,eACR,IAAA1D,WAAA,CAAAkD,GAAA,EAACpD,WAAA,CAAA6D,oBAAoB;MAAAD,QAAA,eACnB,IAAA1D,WAAA,CAAA4D,IAAA,EAAC9D,WAAA,CAAA+D,WAAW;QAAAH,QAAA,GACTnB,QAAQ,iBAAI,IAAAvC,WAAA,CAAAkD,GAAA;UAAKJ,SAAS,EAAE,qBAAsB;UAAAY,QAAA,eAAC,IAAA1D,WAAA,CAAAkD,GAAA,EAACrD,MAAA,CAAAiE,WAAW,CAACC,SAAS;YAACjB,SAAS,EAAE;UAAO,CAAC;QAAC,CAAK,CAAC,eACrG,IAAA9C,WAAA,CAAAkD,GAAA;UAAAQ,QAAA,EAAMlB;QAAI,CAAM,CAAC;MAAA,CACN;IAAC,CACM;EAAC,EACV,CAAC;AAEpB,CAAC;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAzD,OAAA,GAEa6B,UAAU","ignoreList":[]}
|
package/dist/Chips/FilterChip.js
CHANGED
|
@@ -41,6 +41,7 @@ const FilterChip = _ref => {
|
|
|
41
41
|
*/
|
|
42
42
|
return /*#__PURE__*/_jsx(ChipContainer, _objectSpread(_objectSpread({
|
|
43
43
|
role: "checkbox",
|
|
44
|
+
"aria-checked": selected,
|
|
44
45
|
"data-testid": dataTestId,
|
|
45
46
|
className: `${size} ${disabled ? 'disabled' : ''} ${selected ? 'default' : 'outline'} ${!!onClick ? 'interactive' : ''} ${className || ''}`,
|
|
46
47
|
tabIndex: disabled || !onClick ? -1 : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterChip.js","names":["React","Size","SystemIcons","ChipContent","ChipContentContainer","ChipContainer","defaultOnMouseDownHandler","jsx","_jsx","jsxs","_jsxs","FilterChip","_ref","selected","text","size","Medium","disabled","onClick","className","dataTestId","rest","_objectWithoutProperties","_excluded","_objectSpread","role","tabIndex","onKeyDown","e","key","onMouseDown","children","CheckMark"],"sources":["../../src/Chips/FilterChip.tsx"],"sourcesContent":["/**\r\n * Import React libraries.\r\n */\r\nimport * as React from 'react';\r\nimport {Size} from '../types';\r\n\r\n/**\r\n * Import custom components.\r\n */\r\nimport {SystemIcons} from '../icons/index';\r\n\r\n/**\r\n * Import custom styles.\r\n */\r\nimport {ChipContent, ChipContentContainer, ChipContainer} from './ChipStyles';\r\n\r\n/**\r\n * Import custom types.\r\n */\r\nimport {FilterChipProps} from './ChipTypes';\r\nimport {defaultOnMouseDownHandler} from '../common';\r\n\r\nconst FilterChip: React.FunctionComponent<FilterChipProps> = ({\r\n selected,\r\n text,\r\n size = Size.Medium,\r\n disabled,\r\n onClick,\r\n className,\r\n dataTestId,\r\n ...rest\r\n }: FilterChipProps) => {\r\n\r\n\r\n /**\r\n * Return Filter Chip component.\r\n */\r\n return (\r\n <ChipContainer\r\n role=\"checkbox\"\r\n data-testid={dataTestId}\r\n className={`${size} ${disabled ? 'disabled' : ''} ${selected ? 'default' : 'outline'} ${!!onClick ? 'interactive' : ''} ${className || ''}`}\r\n tabIndex={disabled || !onClick ? -1 : 0}\r\n onKeyDown={e => (e.key === 'Enter' || e.key === ' ') && !disabled && onClick && onClick()}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={() => !disabled && onClick && onClick()}\r\n {...rest}>\r\n <ChipContentContainer>\r\n <ChipContent>\r\n {selected && <div className={'chip-icon icon-left'}><SystemIcons.CheckMark className={'icon'}/></div>}\r\n <div>{text}</div>\r\n </ChipContent>\r\n </ChipContentContainer>\r\n </ChipContainer>\r\n );\r\n};\r\n\r\nexport default FilterChip;\r\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAQC,IAAI,QAAO,UAAU;;AAE7B;AACA;AACA;AACA,SAAQC,WAAW,QAAO,gBAAgB;;AAE1C;AACA;AACA;AACA,SAAQC,WAAW,EAAEC,oBAAoB,EAAEC,aAAa,QAAO,cAAc;;AAE7E;AACA;AACA;;AAEA,SAAQC,yBAAyB,QAAO,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAMC,UAAoD,GAAGC,IAAA,IASwB;EAAA,IATvB;MACEC,QAAQ;MACRC,IAAI;MACJC,IAAI,GAAGd,IAAI,CAACe,MAAM;MAClBC,QAAQ;MACRC,OAAO;MACPC,SAAS;MACTC;IAEe,CAAC,GAAAR,IAAA;IADbS,IAAI,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA;EAIrE;AACF;AACA;EACE,oBACEf,IAAA,CAACH,aAAa,EAAAmB,aAAA,CAAAA,aAAA;IACZC,IAAI,EAAC,UAAU;IACf,
|
|
1
|
+
{"version":3,"file":"FilterChip.js","names":["React","Size","SystemIcons","ChipContent","ChipContentContainer","ChipContainer","defaultOnMouseDownHandler","jsx","_jsx","jsxs","_jsxs","FilterChip","_ref","selected","text","size","Medium","disabled","onClick","className","dataTestId","rest","_objectWithoutProperties","_excluded","_objectSpread","role","tabIndex","onKeyDown","e","key","onMouseDown","children","CheckMark"],"sources":["../../src/Chips/FilterChip.tsx"],"sourcesContent":["/**\r\n * Import React libraries.\r\n */\r\nimport * as React from 'react';\r\nimport {Size} from '../types';\r\n\r\n/**\r\n * Import custom components.\r\n */\r\nimport {SystemIcons} from '../icons/index';\r\n\r\n/**\r\n * Import custom styles.\r\n */\r\nimport {ChipContent, ChipContentContainer, ChipContainer} from './ChipStyles';\r\n\r\n/**\r\n * Import custom types.\r\n */\r\nimport {FilterChipProps} from './ChipTypes';\r\nimport {defaultOnMouseDownHandler} from '../common';\r\n\r\nconst FilterChip: React.FunctionComponent<FilterChipProps> = ({\r\n selected,\r\n text,\r\n size = Size.Medium,\r\n disabled,\r\n onClick,\r\n className,\r\n dataTestId,\r\n ...rest\r\n }: FilterChipProps) => {\r\n\r\n\r\n /**\r\n * Return Filter Chip component.\r\n */\r\n return (\r\n <ChipContainer\r\n role=\"checkbox\"\r\n aria-checked={selected}\r\n data-testid={dataTestId}\r\n className={`${size} ${disabled ? 'disabled' : ''} ${selected ? 'default' : 'outline'} ${!!onClick ? 'interactive' : ''} ${className || ''}`}\r\n tabIndex={disabled || !onClick ? -1 : 0}\r\n onKeyDown={e => (e.key === 'Enter' || e.key === ' ') && !disabled && onClick && onClick()}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={() => !disabled && onClick && onClick()}\r\n {...rest}>\r\n <ChipContentContainer>\r\n <ChipContent>\r\n {selected && <div className={'chip-icon icon-left'}><SystemIcons.CheckMark className={'icon'}/></div>}\r\n <div>{text}</div>\r\n </ChipContent>\r\n </ChipContentContainer>\r\n </ChipContainer>\r\n );\r\n};\r\n\r\nexport default FilterChip;\r\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAQC,IAAI,QAAO,UAAU;;AAE7B;AACA;AACA;AACA,SAAQC,WAAW,QAAO,gBAAgB;;AAE1C;AACA;AACA;AACA,SAAQC,WAAW,EAAEC,oBAAoB,EAAEC,aAAa,QAAO,cAAc;;AAE7E;AACA;AACA;;AAEA,SAAQC,yBAAyB,QAAO,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAMC,UAAoD,GAAGC,IAAA,IASwB;EAAA,IATvB;MACEC,QAAQ;MACRC,IAAI;MACJC,IAAI,GAAGd,IAAI,CAACe,MAAM;MAClBC,QAAQ;MACRC,OAAO;MACPC,SAAS;MACTC;IAEe,CAAC,GAAAR,IAAA;IADbS,IAAI,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA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