@laerdal/life-react-components 6.0.0-dev.7.full → 6.0.0
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/README.md +1 -1
- package/dist/Accordion/__tests__/AccordionMenu.test.tsx +42 -0
- package/dist/Accordion/__tests__/ContentAccordion.test.tsx +150 -0
- package/dist/AuthPage/__tests__/AuthPage.test.tsx +27 -0
- package/dist/Banners/__tests__/Banner.test.tsx +47 -0
- package/dist/Banners/__tests__/OverviewBanner.test.tsx +20 -0
- package/dist/Breadcrumb/__tests__/Breadcrumb.test.tsx +78 -0
- package/dist/Button/DualFunctionButton.cjs +4 -4
- package/dist/Button/DualFunctionButton.cjs.map +1 -1
- package/dist/Button/DualFunctionButton.d.ts +2 -2
- package/dist/Button/DualFunctionButton.js +4 -4
- package/dist/Button/DualFunctionButton.js.map +1 -1
- package/dist/Button/{Button.cjs → TextButton.cjs} +179 -92
- package/dist/Button/TextButton.cjs.map +1 -0
- package/dist/Button/TextButton.d.ts +70 -0
- package/dist/Button/{Button.js → TextButton.js} +178 -91
- package/dist/Button/TextButton.js.map +1 -0
- 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/Button/__tests__/TextButton.test.tsx +45 -0
- package/dist/Button/index.cjs +11 -11
- package/dist/Button/index.cjs.map +1 -1
- package/dist/Button/index.d.ts +2 -2
- package/dist/Button/index.js +2 -2
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/HorizontalCard/__tests__/HorizontalCard.test.tsx +71 -0
- package/dist/Card/VerticalCard/{Card.cjs → VerticalCard.cjs} +62 -26
- package/dist/Card/VerticalCard/VerticalCard.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCard.d.ts +25 -0
- package/dist/Card/VerticalCard/{Card.js → VerticalCard.js} +62 -26
- package/dist/Card/VerticalCard/VerticalCard.js.map +1 -0
- package/dist/Card/VerticalCard/{CardBottomSection.cjs → VerticalCardBottomSection.cjs} +45 -27
- package/dist/Card/VerticalCard/VerticalCardBottomSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.d.ts +53 -0
- package/dist/Card/VerticalCard/{CardBottomSection.js → VerticalCardBottomSection.js} +45 -27
- package/dist/Card/VerticalCard/VerticalCardBottomSection.js.map +1 -0
- package/dist/Card/VerticalCard/{CardMiddleSection.cjs → VerticalCardMiddleSection.cjs} +46 -23
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.d.ts +42 -0
- package/dist/Card/VerticalCard/{CardMiddleSection.js → VerticalCardMiddleSection.js} +45 -23
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.js.map +1 -0
- package/dist/Card/VerticalCard/{CardTopSection.cjs → VerticalCardTopSection.cjs} +18 -16
- package/dist/Card/VerticalCard/VerticalCardTopSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/{CardTopSection.d.ts → VerticalCardTopSection.d.ts} +8 -8
- package/dist/Card/VerticalCard/{CardTopSection.js → VerticalCardTopSection.js} +17 -15
- package/dist/Card/VerticalCard/VerticalCardTopSection.js.map +1 -0
- package/dist/Card/VerticalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/VerticalCard/index.cjs +25 -25
- package/dist/Card/VerticalCard/index.cjs.map +1 -1
- package/dist/Card/VerticalCard/index.d.ts +7 -7
- package/dist/Card/VerticalCard/index.js +7 -7
- package/dist/Card/VerticalCard/index.js.map +1 -1
- package/dist/Chips/ActionChip.cjs +6 -0
- package/dist/Chips/ActionChip.cjs.map +1 -1
- package/dist/Chips/ActionChip.js +6 -0
- package/dist/Chips/ActionChip.js.map +1 -1
- package/dist/Chips/ChipStyles.cjs +210 -31
- package/dist/Chips/ChipStyles.cjs.map +1 -1
- package/dist/Chips/ChipStyles.js +210 -31
- package/dist/Chips/ChipStyles.js.map +1 -1
- package/dist/Chips/ChoiceChips.cjs +1 -1
- package/dist/Chips/ChoiceChips.cjs.map +1 -1
- package/dist/Chips/ChoiceChips.js +1 -1
- package/dist/Chips/ChoiceChips.js.map +1 -1
- package/dist/Chips/FilterChip.cjs +8 -1
- package/dist/Chips/FilterChip.cjs.map +1 -1
- package/dist/Chips/FilterChip.js +8 -1
- package/dist/Chips/FilterChip.js.map +1 -1
- package/dist/Chips/InputChip.cjs +14 -0
- package/dist/Chips/InputChip.cjs.map +1 -1
- package/dist/Chips/InputChip.js +14 -0
- package/dist/Chips/InputChip.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 +8 -2
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +8 -2
- 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/DropdownContent.cjs +2 -2
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +2 -2
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/__tests__/DropdownFilter.test.tsx +39 -0
- package/dist/Footer/Components/FooterTop.cjs +3 -0
- package/dist/Footer/Components/FooterTop.cjs.map +1 -1
- package/dist/Footer/Components/FooterTop.js +3 -0
- package/dist/Footer/Components/FooterTop.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 +5 -4
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js +6 -5
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +2 -2
- 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/MobileActionContainer.cjs +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js +2 -2
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.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/GlobalNavigationBar/types.cjs.map +1 -1
- package/dist/GlobalNavigationBar/types.d.ts +2 -2
- package/dist/GlobalNavigationBar/types.js.map +1 -1
- 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 +4 -0
- package/dist/HyperLink/styling.cjs.map +1 -1
- package/dist/HyperLink/styling.js +4 -0
- package/dist/HyperLink/styling.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +21 -5
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +1 -1
- package/dist/InputFields/DatepickerField.js +21 -5
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +4 -0
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.js +4 -0
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +2 -2
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.d.ts +4 -4
- package/dist/InputFields/RadioButton.js +2 -2
- package/dist/InputFields/RadioButton.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 +5 -0
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +5 -0
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/LinearProgress/__tests__/LinearProgress.test.tsx +25 -0
- package/dist/List/__tests__/ListRow.test.tsx +18 -0
- package/dist/LoadingPage/__tests__/GlobalLoadingPage.test.tsx +23 -0
- 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/ModalContainer.cjs +102 -83
- package/dist/Modals/ModalContainer.cjs.map +1 -1
- package/dist/Modals/ModalContainer.d.ts +20 -1
- package/dist/Modals/ModalContainer.js +103 -84
- package/dist/Modals/ModalContainer.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +7 -3
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +8 -4
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +2 -2
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +3 -3
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalStyles.cjs +12 -0
- package/dist/Modals/ModalStyles.cjs.map +1 -1
- package/dist/Modals/ModalStyles.js +12 -0
- package/dist/Modals/ModalStyles.js.map +1 -1
- package/dist/Modals/ModalTypes.cjs.map +1 -1
- package/dist/Modals/ModalTypes.d.ts +3 -3
- package/dist/Modals/ModalTypes.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 +7 -1
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.js +7 -1
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/NavItem/__tests__/NavItem.test.ts +6 -0
- package/dist/Navigation/NavigationProvider.cjs.map +1 -1
- package/dist/Navigation/NavigationProvider.d.ts +3 -0
- package/dist/Navigation/NavigationProvider.js.map +1 -1
- package/dist/NotificationDot/__tests__/NotificationDot.test.tsx +33 -0
- package/dist/Paginator/Paginator.cjs +18 -14
- package/dist/Paginator/Paginator.cjs.map +1 -1
- package/dist/Paginator/Paginator.d.ts +1 -5
- package/dist/Paginator/Paginator.js +18 -14
- package/dist/Paginator/Paginator.js.map +1 -1
- package/dist/Paginator/__tests__/Paginator.test.tsx +33 -0
- package/dist/Popover/Popover.cjs +1 -1
- package/dist/Popover/Popover.cjs.map +1 -1
- package/dist/Popover/Popover.js +2 -2
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/Popover/__tests__/Popover.test.tsx +64 -0
- package/dist/ProfileButton/__tests__/ProfileButton.test.tsx +31 -0
- package/dist/QuizButton/__tests__/QuizButton.test.tsx +53 -0
- package/dist/SegmentControl/__tests__/SegmentControl.test.tsx +145 -0
- package/dist/SideMenu/SideMenuFooter.cjs +1 -1
- package/dist/SideMenu/SideMenuFooter.cjs.map +1 -1
- package/dist/SideMenu/SideMenuFooter.js +2 -2
- package/dist/SideMenu/SideMenuFooter.js.map +1 -1
- package/dist/SideMenu/__tests__/SideMenu.test.tsx +99 -0
- package/dist/SideMenu/types.cjs.map +1 -1
- package/dist/SideMenu/types.d.ts +2 -2
- package/dist/SideMenu/types.js.map +1 -1
- package/dist/Switcher/__tests__/SwitcherMenuItem.tsx +14 -0
- package/dist/Table/TableBody.cjs +1 -1
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +2 -2
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableStyles.cjs +4 -1
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +4 -1
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/TableTypes.cjs.map +1 -1
- package/dist/Table/TableTypes.d.ts +2 -2
- package/dist/Table/TableTypes.js.map +1 -1
- package/dist/Table/__tests__/Table.test.tsx +499 -0
- 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 +48 -12
- package/dist/Tag/Tag.cjs.map +1 -1
- package/dist/Tag/Tag.js +48 -12
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/__tests__/Tag.test.tsx +86 -0
- package/dist/Tile/TileCommonItems.cjs +1 -1
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.js +2 -2
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Tile/TileTypes.cjs.map +1 -1
- package/dist/Tile/TileTypes.d.ts +2 -2
- package/dist/Tile/TileTypes.js.map +1 -1
- package/dist/Toasters/Toast.cjs +1 -2
- package/dist/Toasters/Toast.cjs.map +1 -1
- package/dist/Toasters/Toast.js +2 -3
- package/dist/Toasters/Toast.js.map +1 -1
- package/dist/Toasters/__tests__/Toast.test.tsx +74 -0
- package/dist/Toggles/TogglerStyles.cjs +171 -15
- package/dist/Toggles/TogglerStyles.cjs.map +1 -1
- package/dist/Toggles/TogglerStyles.js +171 -15
- 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/__tests__/TooltipWrapper.test.tsx +16 -0
- package/dist/common/NavigationHelper.cjs +0 -28
- package/dist/common/NavigationHelper.cjs.map +1 -1
- package/dist/common/NavigationHelper.d.ts +0 -4
- package/dist/common/NavigationHelper.js +1 -22
- package/dist/common/NavigationHelper.js.map +1 -1
- package/dist/styles/colors.cjs +6 -0
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +6 -0
- package/dist/styles/colors.js +6 -0
- package/dist/styles/colors.js.map +1 -1
- package/dist/styles/design-tokens/dark/tokens.css +481 -0
- package/dist/styles/design-tokens/light/tokens.css +481 -0
- package/dist/styles/design-tokens/rqi_dark/tokens.css +481 -0
- package/dist/styles/design-tokens/rqi_light/tokens.css +481 -0
- package/dist/styles/global.cjs +4 -4
- package/dist/styles/global.cjs.map +1 -1
- package/dist/styles/global.js +4 -4
- package/dist/styles/global.js.map +1 -1
- package/dist/styles/react-datepicker.css +766 -0
- package/dist/styles/typography.cjs +4 -1
- package/dist/styles/typography.cjs.map +1 -1
- package/dist/styles/typography.js +4 -1
- package/dist/styles/typography.js.map +1 -1
- 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/package.json +11 -6
- package/dist/Button/Button.cjs.map +0 -1
- package/dist/Button/Button.d.ts +0 -70
- package/dist/Button/Button.js.map +0 -1
- package/dist/Card/VerticalCard/Card.cjs.map +0 -1
- package/dist/Card/VerticalCard/Card.d.ts +0 -24
- package/dist/Card/VerticalCard/Card.js.map +0 -1
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +0 -1
- package/dist/Card/VerticalCard/CardBottomSection.d.ts +0 -49
- package/dist/Card/VerticalCard/CardBottomSection.js.map +0 -1
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +0 -1
- package/dist/Card/VerticalCard/CardMiddleSection.d.ts +0 -37
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +0 -1
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +0 -1
- package/dist/Card/VerticalCard/CardTopSection.js.map +0 -1
- package/dist/GlobalNavigationBar/__tests__/GlobalNavigationBar.tests.d.ts +0 -1
- package/dist/GlobalNavigationBar/__tests__/Logo.tests.d.ts +0 -1
- package/dist/List/__tests__/ListRow.tests.d.ts +0 -1
- package/dist/Tabs/__tests__/TabLink.tests.d.ts +0 -1
- package/dist/Tabs/__tests__/Tablist.tests.d.ts +0 -2
- package/dist/common/Link.cjs +0 -45
- package/dist/common/Link.cjs.map +0 -1
- package/dist/common/Link.d.ts +0 -9
- package/dist/common/Link.js +0 -37
- package/dist/common/Link.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalDialog.js","names":["React","Button","IconButton","SystemIcons","COLORS","ComponentL","ComponentM","ComponentTextStyle","ComponentXL","Size","ModalContainer","BackButtonWrapper","CloseButtonWrapper","Column","FlexContainer","ModalBody","ModalFooter","ModalHeaderActions","ModalHeaderActionsWithImage","ModalTitleSection","StyledModalHeader","ModalHoverModifier","ImageOverlay","ImageContainer","ModalNote","TooltipWrapper","HyperLink","ImageWithFallbacks","useTheme","jsx","_jsx","jsxs","_jsxs","ModalDialog","_ref","size","isModalOpen","title","topImage","topImageWithFallbacksProps","topImageGrayscale","buttons","leftFooterAction","backButton","closeAction","submitAction","tooltip","children","note","shouldCloseOnOverlayClick","state","icon","zIndex","contentOverflow","hideCloseButton","width","hasContentBorders","theme","getMinWidth","Small","Large","Medium","getMaxWidth","getImageHeight","getMarginBottom","getPadding","getMaxHeight","ModalTitle","textStyle","Bold","ModalTootip","delay","XSmall","align","position","withArrow","label","variant","shape","action","Help","color","generateToken","componentType","defaultVariant","ModalCloseButton","onClick","$hasImage","$size","borderRadius","Close","ModalBackButton","ArrowLineLeft","getLeftActionIconElement","cloneElement","LeftFooterAction","text","actionType","disabled","button","id","type","loading","style","order","marginRight","className","href","e","preventDefault","showModal","closeModal","minWidth","maxWidth","height","padding","onSubmit","display","flexDirection","maxHeight","$height","$marginBottom","src","alt","loader","fallbacks","$hasBackButton","$overflow","$hasContentBorders","map","b","i","propTypes","_pt","bool","isRequired","node","oneOfType","string","any","array","func","number"],"sources":["../../src/Modals/ModalDialog.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Button, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { COLORS, ComponentL, ComponentM, ComponentTextStyle, ComponentXL } from '../styles';\r\nimport { Size } from '../types';\r\nimport ModalContainer from './ModalContainer';\r\nimport {\r\n BackButtonWrapper,\r\n CloseButtonWrapper,\r\n Column,\r\n FlexContainer,\r\n ModalBody,\r\n ModalFooter,\r\n ModalHeaderActions,\r\n ModalHeaderActionsWithImage,\r\n ModalTitleSection,\r\n StyledModalHeader,\r\n ModalHoverModifier,\r\n ImageOverlay,\r\n ImageContainer,\r\n} from './ModalStyles';\r\n\r\nimport { ModalNote } from './ModalNote';\r\nimport { TooltipWrapper } from '../Tooltips';\r\nimport { ButtonAction, LeftFooterAction, LeftFooterButton, LeftFooterHyperlink } from './ModalTypes';\r\nimport { HyperLink, ImageWithFallbacks } from '..';\r\nimport { ImageWithFallbacksProps } from '../Image/ImageWithFallbacks';\r\nimport { useTheme } from 'styled-components';\r\n\r\nexport interface ModalDialogProps {\r\n /** Optional. Size of the modal. Defaults to 'medium' */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n /** Required. Current state of the modal. */\r\n isModalOpen: boolean;\r\n /** Optional. Content of the ModalDialog. */\r\n children?: React.ReactNode;\r\n /** Optional. Title of the ModalDialog. */\r\n title?: string | React.ReactNode;\r\n /** Optional. Content of the image to be shown in the header of the modal. */\r\n topImage?: any;\r\n /** Optional. Serves same purpose as 'topImage' except adds support for fallback options. Has higher priority than 'topImage'. */\r\n topImageWithFallbacksProps?: ImageWithFallbacksProps;\r\n /** Optional. If flag is set then overlay is added that converts image to grey color. */\r\n topImageGrayscale?: boolean;\r\n /** Optional. Collection of Buttons that will be shown in the footer on the right side of the ModalDialog. */\r\n buttons?: ButtonAction[];\r\n /** Optional. Left footer action that will be shown on the left side of the footer of ModalDialog. Can be a hyperlink, button or a note. */\r\n leftFooterAction?: LeftFooterAction;\r\n /** Optional. Tooltip that will be shown */\r\n tooltip?: string;\r\n /** */\r\n backButton?: () => void;\r\n closeAction: () => void;\r\n hideCloseButton?: boolean;\r\n submitAction: (event?: React.FormEvent<HTMLFormElement> | undefined) => void;\r\n note?: string | React.ReactNode;\r\n state?: string;\r\n icon?: React.ReactNode;\r\n zIndex?: number;\r\n contentOverflow?: string;\r\n width?: string;\r\n hasContentBorders?: boolean;\r\n shouldCloseOnOverlayClick?: boolean;\r\n}\r\n\r\nexport const ModalDialog: React.FunctionComponent<ModalDialogProps> = ({\r\n size,\r\n isModalOpen,\r\n title,\r\n topImage,\r\n topImageWithFallbacksProps,\r\n topImageGrayscale,\r\n buttons,\r\n leftFooterAction,\r\n backButton,\r\n closeAction,\r\n submitAction,\r\n tooltip,\r\n children,\r\n note,\r\n shouldCloseOnOverlayClick,\r\n state,\r\n icon,\r\n zIndex,\r\n contentOverflow,\r\n hideCloseButton,\r\n width,\r\n hasContentBorders,\r\n}) => {\r\n\r\n const theme = useTheme();\r\n const getMinWidth = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '320px';\r\n case Size.Large:\r\n return '640px';\r\n case Size.Medium:\r\n default:\r\n return '480px';\r\n }\r\n };\r\n\r\n const getMaxWidth = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '480px';\r\n case Size.Large:\r\n return '720px';\r\n case Size.Medium:\r\n default:\r\n return '640px';\r\n }\r\n };\r\n\r\n const getImageHeight = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return 160;\r\n case Size.Medium:\r\n return 200;\r\n case Size.Large:\r\n return 240;\r\n default:\r\n return 200;\r\n }\r\n };\r\n\r\n const getMarginBottom = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '16px';\r\n case Size.Medium:\r\n return '24px';\r\n case Size.Large:\r\n return '32px';\r\n default:\r\n return '24px';\r\n }\r\n };\r\n\r\n const getPadding = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '16px 16px 8px';\r\n case Size.Medium:\r\n return '24px 24px 20px';\r\n case Size.Large:\r\n return '32px';\r\n default:\r\n return '24px 24px 16px';\r\n }\r\n };\r\n\r\n const getMaxHeight = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return 'calc(100vh - 56px)';\r\n case Size.Medium:\r\n return 'calc(100vh - 76px)';\r\n case Size.Large:\r\n return 'calc(100vh - 96px)';\r\n default:\r\n return 'calc(100vh - 72px)';\r\n }\r\n };\r\n\r\n const ModalTitle = (title: string | React.ReactNode, size?: Size) => {\r\n if (typeof title === 'string') {\r\n switch (size) {\r\n case Size.Small:\r\n return <ComponentM textStyle={ComponentTextStyle.Bold}>{title}</ComponentM>;\r\n case Size.Medium:\r\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\r\n case Size.Large:\r\n return <ComponentXL textStyle={ComponentTextStyle.Bold}>{title}</ComponentXL>;\r\n default:\r\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\r\n }\r\n } else {\r\n return title;\r\n }\r\n };\r\n\r\n const ModalTootip = (tooltip: string) => {\r\n return (\r\n <ModalHoverModifier>\r\n <TooltipWrapper delay=\"0s\" size={Size.XSmall} align=\"center\" position=\"top\" withArrow={false} label={tooltip}>\r\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => {}}>\r\n <SystemIcons.Help size=\"24px\" color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} />\r\n </IconButton>\r\n </TooltipWrapper>\r\n </ModalHoverModifier>\r\n );\r\n };\r\n\r\n const ModalCloseButton = (onClick: any) => {\r\n return (\r\n <CloseButtonWrapper $hasImage={!!topImage || !!topImageWithFallbacksProps} $size={size}>\r\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => onClick()} borderRadius={48}>\r\n <SystemIcons.Close size=\"24px\" color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} />\r\n </IconButton>\r\n </CloseButtonWrapper>\r\n );\r\n };\r\n\r\n const ModalBackButton = () => {\r\n if (backButton) {\r\n return (\r\n <BackButtonWrapper $hasImage={!!topImage || !!topImageWithFallbacksProps} $size={size}>\r\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => backButton()} borderRadius={48}>\r\n <SystemIcons.ArrowLineLeft size=\"24px\" color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} />\r\n </IconButton>\r\n </BackButtonWrapper>\r\n );\r\n }\r\n };\r\n\r\n const getLeftActionIconElement = (icon: React.ReactNode) => {\r\n return React.cloneElement(icon as React.ReactElement<any>, { size: size === Size.Small ? '20px' : size === Size.Large ? '28px' : '24px' });\r\n };\r\n\r\n const LeftFooterAction = (leftFooterAction: LeftFooterAction) => {\r\n const { text, actionType, disabled, icon, action } = leftFooterAction;\r\n switch (actionType) {\r\n case 'button':\r\n const button = leftFooterAction as LeftFooterButton;\r\n return (\r\n <Button\r\n id={'left-action-button'}\r\n type={button?.type}\r\n disabled={disabled}\r\n loading={button?.loading}\r\n icon={icon}\r\n size={size}\r\n onClick={action}\r\n variant={button?.variant ?? 'secondary'}\r\n style={{ order: -1, marginRight: 'auto' }}>\r\n {button?.children ?? button?.text}\r\n </Button>\r\n );\r\n case 'hyperlink':\r\n return (\r\n <HyperLink\r\n id=\"left-action-hyperlink\"\r\n className=\"footer-action\"\r\n href={(leftFooterAction as LeftFooterHyperlink).href}\r\n disabled={disabled}\r\n variant=\"default\"\r\n onClick={(e) => {\r\n if (action) {\r\n e.preventDefault();\r\n action(e);\r\n }\r\n }}>\r\n {text}\r\n {icon && getLeftActionIconElement(icon)}\r\n </HyperLink>\r\n );\r\n case 'note':\r\n return (\r\n <div className=\"footer-action note\">\r\n {icon && getLeftActionIconElement(icon)}\r\n <span>{text}</span>\r\n </div>\r\n );\r\n }\r\n };\r\n\r\n return (\r\n <ModalContainer\r\n showModal={isModalOpen}\r\n closeModal={closeAction}\r\n minWidth={getMinWidth()}\r\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\r\n maxWidth={getMaxWidth()}\r\n height=\"auto\"\r\n padding={getPadding()}\r\n zIndex={zIndex}\r\n width={width}>\r\n <Column>\r\n <form onSubmit={submitAction} style={{ display: 'flex', flexDirection: 'column', maxHeight: getMaxHeight() }}>\r\n {(topImage || topImageWithFallbacksProps) && (\r\n <StyledModalHeader $size={size} $height={getImageHeight()} $marginBottom={getMarginBottom()}>\r\n <ImageContainer $height={getImageHeight()}>\r\n {topImageGrayscale && <ImageOverlay $height={getImageHeight()} />}\r\n {topImage && <img src={topImage} alt=\"Modal top\" />}\r\n {!topImage && topImageWithFallbacksProps && (\r\n <ImageWithFallbacks\r\n loader={topImageWithFallbacksProps.loader}\r\n alt={topImageWithFallbacksProps.alt}\r\n fallbacks={topImageWithFallbacksProps.fallbacks}\r\n src={topImageWithFallbacksProps.src}\r\n />\r\n )}\r\n </ImageContainer>\r\n <ModalHeaderActionsWithImage $hasBackButton={!!backButton}>\r\n {ModalBackButton()}\r\n {!hideCloseButton && ModalCloseButton(closeAction)}\r\n </ModalHeaderActionsWithImage>\r\n </StyledModalHeader>\r\n )}\r\n <ModalTitleSection>\r\n <FlexContainer>\r\n {!(topImage || topImageWithFallbacksProps) && ModalBackButton()}\r\n {title && ModalTitle(title, size)}\r\n </FlexContainer>\r\n {(tooltip || !(topImage || topImageWithFallbacksProps)) && (\r\n <ModalHeaderActions>\r\n {tooltip && ModalTootip(tooltip)}\r\n {!(topImage || topImageWithFallbacksProps || hideCloseButton) && ModalCloseButton(closeAction)}\r\n </ModalHeaderActions>\r\n )}\r\n </ModalTitleSection>\r\n\r\n <ModalBody $size={size} $overflow={contentOverflow} $hasContentBorders={hasContentBorders}>\r\n {children}\r\n </ModalBody>\r\n\r\n {note && <ModalNote note={note} state={state} size={size} icon={icon} />}\r\n\r\n <ModalFooter $size={size}>\r\n {leftFooterAction && LeftFooterAction(leftFooterAction)}\r\n {buttons?.map((b, i) => (\r\n <Button key={b.id || i} icon={b.icon} id={b.id} disabled={b.disabled} loading={b.loading} size={size} onClick={b.action} type={b.type} variant={b.variant}>\r\n {b.children ?? b.text}\r\n </Button>\r\n ))}\r\n </ModalFooter>\r\n </form>\r\n </Column>\r\n </ModalContainer>\r\n );\r\n};\r\n\r\nexport default ModalDialog;\r\n"],"mappings":";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CACD;EAAC,CACK,CAAC;AAErB,CAAC;AAAClG,WAAA,CAAAmG,SAAA;EA5SAhG,WAAW,EAAAiG,GAAA,CAAAC,IAAA,CAAAC,UAAA;EAEXxF,QAAQ,EAAAsF,GAAA,CAAAG,IAAA;EAERnG,KAAK,EAAAgG,GAAA,CAAAI,SAAA,EAAAJ,GAAA,CAAAK,MAAA,EAAAL,GAAA,CAAAG,IAAA;EAELlG,QAAQ,EAAA+F,GAAA,CAAAM,GAAA;EAIRnG,iBAAiB,EAAA6F,GAAA,CAAAC,IAAA;EAEjB7F,OAAO,EAAA4F,GAAA,CAAAO,KAAA;EAIP9F,OAAO,EAAAuF,GAAA,CAAAK,MAAA;EAEP/F,UAAU,EAAA0F,GAAA,CAAAQ,IAAA;EACVjG,WAAW,EAAAyF,GAAA,CAAAQ,IAAA,CAAAN,UAAA;EACXjF,eAAe,EAAA+E,GAAA,CAAAC,IAAA;EACfzF,YAAY,EAAAwF,GAAA,CAAAQ,IAAA,CAAAN,UAAA;EACZvF,IAAI,EAAAqF,GAAA,CAAAI,SAAA,EAAAJ,GAAA,CAAAK,MAAA,EAAAL,GAAA,CAAAG,IAAA;EACJtF,KAAK,EAAAmF,GAAA,CAAAK,MAAA;EACLvF,IAAI,EAAAkF,GAAA,CAAAG,IAAA;EACJpF,MAAM,EAAAiF,GAAA,CAAAS,MAAA;EACNzF,eAAe,EAAAgF,GAAA,CAAAK,MAAA;EACfnF,KAAK,EAAA8E,GAAA,CAAAK,MAAA;EACLlF,iBAAiB,EAAA6E,GAAA,CAAAC,IAAA;EACjBrF,yBAAyB,EAAAoF,GAAA,CAAAC;AAAA;AAiR3B,eAAerG,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ModalDialog.js","names":["React","TextButton","IconButton","SystemIcons","COLORS","ComponentL","ComponentM","ComponentTextStyle","ComponentXL","Size","ModalContainer","BackButtonWrapper","CloseButtonWrapper","Column","FlexContainer","ModalBody","ModalFooter","ModalHeaderActions","ModalHeaderActionsWithImage","ModalTitleSection","StyledModalHeader","ModalHoverModifier","ImageOverlay","ImageContainer","ModalNote","TooltipWrapper","HyperLink","ImageWithFallbacks","useTheme","jsx","_jsx","jsxs","_jsxs","ModalDialog","_ref","size","isModalOpen","title","topImage","topImageWithFallbacksProps","topImageGrayscale","buttons","leftFooterAction","backButton","closeAction","submitAction","tooltip","children","note","shouldCloseOnOverlayClick","state","icon","zIndex","contentOverflow","hideCloseButton","width","hasContentBorders","theme","getMinWidth","Small","Large","Medium","getMaxWidth","getImageHeight","getMarginBottom","getPadding","getMaxHeight","ModalTitle","textStyle","Bold","ModalTootip","delay","XSmall","align","position","withArrow","label","variant","shape","action","Help","color","generateToken","componentType","defaultVariant","ModalCloseButton","onClick","$hasImage","$size","borderRadius","Close","ModalBackButton","ArrowLineLeft","getLeftActionIconElement","cloneElement","LeftFooterAction","text","actionType","disabled","button","id","type","loading","style","order","marginRight","className","href","e","preventDefault","showModal","closeModal","minWidth","maxWidth","height","padding","onSubmit","display","flexDirection","maxHeight","$height","$marginBottom","src","alt","loader","fallbacks","$hasBackButton","$overflow","$hasContentBorders","map","b","i","propTypes","_pt","bool","isRequired","node","oneOfType","string","any","array","func","number"],"sources":["../../src/Modals/ModalDialog.tsx"],"sourcesContent":["import React from 'react';\r\nimport { TextButton, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { COLORS, ComponentL, ComponentM, ComponentTextStyle, ComponentXL } from '../styles';\r\nimport { Size } from '../types';\r\nimport ModalContainer from './ModalContainer';\r\nimport {\r\n BackButtonWrapper,\r\n CloseButtonWrapper,\r\n Column,\r\n FlexContainer,\r\n ModalBody,\r\n ModalFooter,\r\n ModalHeaderActions,\r\n ModalHeaderActionsWithImage,\r\n ModalTitleSection,\r\n StyledModalHeader,\r\n ModalHoverModifier,\r\n ImageOverlay,\r\n ImageContainer,\r\n} from './ModalStyles';\r\n\r\nimport { ModalNote } from './ModalNote';\r\nimport { TooltipWrapper } from '../Tooltips';\r\nimport { ButtonAction, LeftFooterAction, LeftFooterButton, LeftFooterHyperlink } from './ModalTypes';\r\nimport { HyperLink, ImageWithFallbacks } from '..';\r\nimport { ImageWithFallbacksProps } from '../Image/ImageWithFallbacks';\r\nimport { useTheme } from 'styled-components';\r\n\r\nexport interface ModalDialogProps {\r\n /** Optional. Size of the modal. Defaults to 'medium' */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n /** Required. Current state of the modal. */\r\n isModalOpen: boolean;\r\n /** Optional. Content of the ModalDialog. */\r\n children?: React.ReactNode;\r\n /** Optional. Title of the ModalDialog. */\r\n title?: string | React.ReactNode;\r\n /** Optional. Content of the image to be shown in the header of the modal. */\r\n topImage?: any;\r\n /** Optional. Serves same purpose as 'topImage' except adds support for fallback options. Has higher priority than 'topImage'. */\r\n topImageWithFallbacksProps?: ImageWithFallbacksProps;\r\n /** Optional. If flag is set then overlay is added that converts image to grey color. */\r\n topImageGrayscale?: boolean;\r\n /** Optional. Collection of Buttons that will be shown in the footer on the right side of the ModalDialog. */\r\n buttons?: ButtonAction[];\r\n /** Optional. Left footer action that will be shown on the left side of the footer of ModalDialog. Can be a hyperlink, button or a note. */\r\n leftFooterAction?: LeftFooterAction;\r\n /** Optional. Tooltip that will be shown */\r\n tooltip?: string;\r\n /** */\r\n backButton?: () => void;\r\n closeAction: () => void;\r\n hideCloseButton?: boolean;\r\n submitAction: (event?: React.FormEvent<HTMLFormElement> | undefined) => void;\r\n note?: string | React.ReactNode;\r\n state?: string;\r\n icon?: React.ReactNode;\r\n zIndex?: number;\r\n contentOverflow?: string;\r\n width?: string;\r\n hasContentBorders?: boolean;\r\n shouldCloseOnOverlayClick?: boolean;\r\n}\r\n\r\nexport const ModalDialog: React.FunctionComponent<ModalDialogProps> = ({\r\n size,\r\n isModalOpen,\r\n title,\r\n topImage,\r\n topImageWithFallbacksProps,\r\n topImageGrayscale,\r\n buttons,\r\n leftFooterAction,\r\n backButton,\r\n closeAction,\r\n submitAction,\r\n tooltip,\r\n children,\r\n note,\r\n shouldCloseOnOverlayClick,\r\n state,\r\n icon,\r\n zIndex,\r\n contentOverflow,\r\n hideCloseButton,\r\n width,\r\n hasContentBorders,\r\n}) => {\r\n\r\n const theme = useTheme();\r\n const getMinWidth = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '320px';\r\n case Size.Large:\r\n return '640px';\r\n case Size.Medium:\r\n default:\r\n return '480px';\r\n }\r\n };\r\n\r\n const getMaxWidth = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '480px';\r\n case Size.Large:\r\n return '720px';\r\n case Size.Medium:\r\n default:\r\n return '640px';\r\n }\r\n };\r\n\r\n const getImageHeight = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return 160;\r\n case Size.Medium:\r\n return 200;\r\n case Size.Large:\r\n return 240;\r\n default:\r\n return 200;\r\n }\r\n };\r\n\r\n const getMarginBottom = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '16px';\r\n case Size.Medium:\r\n return '24px';\r\n case Size.Large:\r\n return '32px';\r\n default:\r\n return '24px';\r\n }\r\n };\r\n\r\n const getPadding = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return '16px 16px 8px';\r\n case Size.Medium:\r\n return '24px 24px 20px';\r\n case Size.Large:\r\n return '32px';\r\n default:\r\n return '24px 24px 16px';\r\n }\r\n };\r\n\r\n const getMaxHeight = () => {\r\n switch (size) {\r\n case Size.Small:\r\n return 'calc(100vh - 56px)';\r\n case Size.Medium:\r\n return 'calc(100vh - 76px)';\r\n case Size.Large:\r\n return 'calc(100vh - 96px)';\r\n default:\r\n return 'calc(100vh - 72px)';\r\n }\r\n };\r\n\r\n const ModalTitle = (title: string | React.ReactNode, size?: Size) => {\r\n if (typeof title === 'string') {\r\n switch (size) {\r\n case Size.Small:\r\n return <ComponentM textStyle={ComponentTextStyle.Bold}>{title}</ComponentM>;\r\n case Size.Medium:\r\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\r\n case Size.Large:\r\n return <ComponentXL textStyle={ComponentTextStyle.Bold}>{title}</ComponentXL>;\r\n default:\r\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\r\n }\r\n } else {\r\n return title;\r\n }\r\n };\r\n\r\n const ModalTootip = (tooltip: string) => {\r\n return (\r\n <ModalHoverModifier>\r\n <TooltipWrapper delay=\"0s\" size={Size.XSmall} align=\"center\" position=\"top\" withArrow={false} label={tooltip}>\r\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => {}}>\r\n <SystemIcons.Help size=\"24px\" color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} />\r\n </IconButton>\r\n </TooltipWrapper>\r\n </ModalHoverModifier>\r\n );\r\n };\r\n\r\n const ModalCloseButton = (onClick: any) => {\r\n return (\r\n <CloseButtonWrapper $hasImage={!!topImage || !!topImageWithFallbacksProps} $size={size}>\r\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => onClick()} borderRadius={48}>\r\n <SystemIcons.Close size=\"24px\" color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} />\r\n </IconButton>\r\n </CloseButtonWrapper>\r\n );\r\n };\r\n\r\n const ModalBackButton = () => {\r\n if (backButton) {\r\n return (\r\n <BackButtonWrapper $hasImage={!!topImage || !!topImageWithFallbacksProps} $size={size}>\r\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => backButton()} borderRadius={48}>\r\n <SystemIcons.ArrowLineLeft size=\"24px\" color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} />\r\n </IconButton>\r\n </BackButtonWrapper>\r\n );\r\n }\r\n };\r\n\r\n const getLeftActionIconElement = (icon: React.ReactNode) => {\r\n return React.cloneElement(icon as React.ReactElement<any>, { size: size === Size.Small ? '20px' : size === Size.Large ? '28px' : '24px' });\r\n };\r\n\r\n const LeftFooterAction = (leftFooterAction: LeftFooterAction) => {\r\n const { text, actionType, disabled, icon, action } = leftFooterAction;\r\n switch (actionType) {\r\n case 'button':\r\n const button = leftFooterAction as LeftFooterButton;\r\n return (\r\n <TextButton\r\n id={'left-action-button'}\r\n type={button?.type}\r\n disabled={disabled}\r\n loading={button?.loading}\r\n icon={icon}\r\n size={size}\r\n onClick={action}\r\n variant={button?.variant ?? 'secondary'}\r\n style={{ order: -1, marginRight: 'auto' }}>\r\n {button?.children ?? button?.text}\r\n </TextButton>\r\n );\r\n case 'hyperlink':\r\n return (\r\n <HyperLink\r\n id=\"left-action-hyperlink\"\r\n className=\"footer-action\"\r\n href={(leftFooterAction as LeftFooterHyperlink).href}\r\n disabled={disabled}\r\n variant=\"default\"\r\n onClick={(e) => {\r\n if (action) {\r\n e.preventDefault();\r\n action(e);\r\n }\r\n }}>\r\n {text}\r\n {icon && getLeftActionIconElement(icon)}\r\n </HyperLink>\r\n );\r\n case 'note':\r\n return (\r\n <div className=\"footer-action note\">\r\n {icon && getLeftActionIconElement(icon)}\r\n <span>{text}</span>\r\n </div>\r\n );\r\n }\r\n };\r\n\r\n return (\r\n <ModalContainer\r\n showModal={isModalOpen}\r\n closeModal={closeAction}\r\n minWidth={getMinWidth()}\r\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\r\n maxWidth={getMaxWidth()}\r\n height=\"auto\"\r\n padding={getPadding()}\r\n zIndex={zIndex}\r\n width={width}>\r\n <Column>\r\n <form onSubmit={submitAction} style={{ display: 'flex', flexDirection: 'column', maxHeight: getMaxHeight() }}>\r\n {(topImage || topImageWithFallbacksProps) && (\r\n <StyledModalHeader $size={size} $height={getImageHeight()} $marginBottom={getMarginBottom()}>\r\n <ImageContainer $height={getImageHeight()}>\r\n {topImageGrayscale && <ImageOverlay $height={getImageHeight()} />}\r\n {topImage && <img src={topImage} alt=\"Modal top\" />}\r\n {!topImage && topImageWithFallbacksProps && (\r\n <ImageWithFallbacks\r\n loader={topImageWithFallbacksProps.loader}\r\n alt={topImageWithFallbacksProps.alt}\r\n fallbacks={topImageWithFallbacksProps.fallbacks}\r\n src={topImageWithFallbacksProps.src}\r\n />\r\n )}\r\n </ImageContainer>\r\n <ModalHeaderActionsWithImage $hasBackButton={!!backButton}>\r\n {ModalBackButton()}\r\n {!hideCloseButton && ModalCloseButton(closeAction)}\r\n </ModalHeaderActionsWithImage>\r\n </StyledModalHeader>\r\n )}\r\n <ModalTitleSection>\r\n <FlexContainer>\r\n {!(topImage || topImageWithFallbacksProps) && ModalBackButton()}\r\n {title && ModalTitle(title, size)}\r\n </FlexContainer>\r\n {(tooltip || !(topImage || topImageWithFallbacksProps)) && (\r\n <ModalHeaderActions>\r\n {tooltip && ModalTootip(tooltip)}\r\n {!(topImage || topImageWithFallbacksProps || hideCloseButton) && ModalCloseButton(closeAction)}\r\n </ModalHeaderActions>\r\n )}\r\n </ModalTitleSection>\r\n\r\n <ModalBody $size={size} $overflow={contentOverflow} $hasContentBorders={hasContentBorders}>\r\n {children}\r\n </ModalBody>\r\n\r\n {note && <ModalNote note={note} state={state} size={size} icon={icon} />}\r\n\r\n <ModalFooter $size={size}>\r\n {leftFooterAction && LeftFooterAction(leftFooterAction)}\r\n {buttons?.map((b, i) => (\r\n <TextButton key={b.id || i} icon={b.icon} id={b.id} disabled={b.disabled} loading={b.loading} size={size} onClick={b.action} type={b.type} variant={b.variant}>\r\n {b.children ?? b.text}\r\n </TextButton>\r\n ))}\r\n </ModalFooter>\r\n </form>\r\n </Column>\r\n </ModalContainer>\r\n );\r\n};\r\n\r\nexport default ModalDialog;\r\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,UAAU,QAAQ,WAAW;AAClD,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAEC,kBAAkB,EAAEC,WAAW,QAAQ,WAAW;AAC3F,SAASC,IAAI,QAAQ,UAAU;AAC/B,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SACEC,iBAAiB,EACjBC,kBAAkB,EAClBC,MAAM,EACNC,aAAa,EACbC,SAAS,E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IAAA;EAEjB7F,OAAO,EAAA4F,GAAA,CAAAO,KAAA;EAIP9F,OAAO,EAAAuF,GAAA,CAAAK,MAAA;EAEP/F,UAAU,EAAA0F,GAAA,CAAAQ,IAAA;EACVjG,WAAW,EAAAyF,GAAA,CAAAQ,IAAA,CAAAN,UAAA;EACXjF,eAAe,EAAA+E,GAAA,CAAAC,IAAA;EACfzF,YAAY,EAAAwF,GAAA,CAAAQ,IAAA,CAAAN,UAAA;EACZvF,IAAI,EAAAqF,GAAA,CAAAI,SAAA,EAAAJ,GAAA,CAAAK,MAAA,EAAAL,GAAA,CAAAG,IAAA;EACJtF,KAAK,EAAAmF,GAAA,CAAAK,MAAA;EACLvF,IAAI,EAAAkF,GAAA,CAAAG,IAAA;EACJpF,MAAM,EAAAiF,GAAA,CAAAS,MAAA;EACNzF,eAAe,EAAAgF,GAAA,CAAAK,MAAA;EACfnF,KAAK,EAAA8E,GAAA,CAAAK,MAAA;EACLlF,iBAAiB,EAAA6E,GAAA,CAAAC,IAAA;EACjBrF,yBAAyB,EAAAoF,GAAA,CAAAC;AAAA;AAiR3B,eAAerG,WAAW","ignoreList":[]}
|
|
@@ -20,6 +20,10 @@ const ModalHeader = exports.ModalHeader = _styledComponents.default.section`
|
|
|
20
20
|
margin-bottom: ${props => props.$marginBottom || '24px'};
|
|
21
21
|
`;
|
|
22
22
|
const StyledModalHeader = exports.StyledModalHeader = (0, _styledComponents.default)(ModalHeader)`
|
|
23
|
+
color: ${props => _.COLORS.generateToken({
|
|
24
|
+
componentType: 'text',
|
|
25
|
+
defaultVariant: 'default'
|
|
26
|
+
}, props.theme)};
|
|
23
27
|
flex: 1 0 calc(50% - 5px);
|
|
24
28
|
flex-direction: column;
|
|
25
29
|
flex-basis: auto;
|
|
@@ -68,12 +72,20 @@ const ImageOverlay = exports.ImageOverlay = _styledComponents.default.div`
|
|
|
68
72
|
}
|
|
69
73
|
`;
|
|
70
74
|
const Column = exports.Column = _styledComponents.default.div`
|
|
75
|
+
background: ${props => _.COLORS.generateToken({
|
|
76
|
+
componentType: 'bg-surface',
|
|
77
|
+
defaultVariant: 'default'
|
|
78
|
+
}, props.theme)};
|
|
71
79
|
display: flex;
|
|
72
80
|
flex-direction: column;
|
|
73
81
|
justify-content: stretch;
|
|
74
82
|
height: 100%;
|
|
75
83
|
`;
|
|
76
84
|
const ModalTitleSection = exports.ModalTitleSection = _styledComponents.default.section`
|
|
85
|
+
color: ${props => _.COLORS.generateToken({
|
|
86
|
+
componentType: 'text',
|
|
87
|
+
defaultVariant: 'default'
|
|
88
|
+
}, props.theme)};
|
|
77
89
|
word-break: break-word;
|
|
78
90
|
display: flex;
|
|
79
91
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStyles.cjs","names":["_styledComponents","_interopRequireWildcard","require","_","_styles","_types","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ModalHeader","exports","styled","section","props","$marginBottom","StyledModalHeader","$height","$size","ImageContainer","div","ImageOverlay","Column","ModalTitleSection","ModalHeaderActionsWithImage","$hasBackButton","ModalHeaderActions","FlexContainer","ModalHoverModifier","CloseButtonWrapper","$hasImage","css","BackButtonWrapper","ModalTitle","h5","$fontSize","ModalNoteSection","getBackgroundColor","$state","theme","getNoteMessageColor","ModalBody","$overflow","$hasContentBorders","COLORS","generateToken","componentType","defaultVariant","scrollBarStyling","Size","Small","ModalFooter","Large","state"],"sources":["../../src/Modals/ModalStyles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\r\nimport { COLORS } from '..';\r\nimport { scrollBarStyling } from '../styles';\r\nimport { Size } from '../types';\r\n\r\n/**\r\n * Modal styles\r\n */\r\nexport const ModalHeader = styled.section<{ $marginBottom?: string }>`\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: ${(props) => props.$marginBottom || '24px'};\r\n`;\r\n\r\nexport const StyledModalHeader = styled(ModalHeader)<{ $marginBottom?: string; $size?: string; $height?: number }>`\r\n flex: 1 0 calc(50% - 5px);\r\n flex-direction: column;\r\n flex-basis: auto;\r\n text-align: left;\r\n height: ${(props) => (props.$height ? `${props.$height - (props.$size === 'small' ? 16 : props.$size === 'large' ? 32 : 24)}px` : '')};\r\n img {\r\n width: 100%;\r\n height: ${(props) => `${props.$height}px`};\r\n object-fit: cover;\r\n border-radius: 8px 8px 0 0;\r\n }\r\n`;\r\n\r\nexport const ImageContainer = styled.div<{ $height: number }>`\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n\r\n #imgWithFallbackLoadingIndicator {\r\n position: absolute;\r\n left: 50%;\r\n top: 0;\r\n }\r\n`;\r\n\r\nexport const ImageOverlay = styled.div<{ $height: number }>`\r\n position: absolute;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n width: 100%;\r\n background: rgba(255, 255, 255, 0.5);\r\n border-radius: 8px 8px 0 0;\r\n\r\n &:after {\r\n position: absolute;\r\n height: ${(props) => `${props.$height}px`};\r\n border-radius: 8px 8px 0 0;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n background: #888888;\r\n mix-blend-mode: saturation;\r\n }\r\n`;\r\n\r\nexport const Column = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: stretch;\r\n height: 100%;\r\n`;\r\n\r\nexport const ModalTitleSection = styled.section`\r\n word-break: break-word;\r\n display: flex;\r\n width: 100%;\r\n justify-content: space-between;\r\n`;\r\n\r\nexport const ModalHeaderActionsWithImage = styled.div<{ $hasBackButton?: boolean }>`\r\n display: flex;\r\n flex-direction: ${(props) => (!props.$hasBackButton ? 'row-reverse' : 'row')};\r\n justify-content: space-between;\r\n width: 100%;\r\n z-index: 1;\r\n`;\r\n\r\nexport const ModalHeaderActions = styled.div`\r\n display: flex;\r\n margin: -12px -12px 0 0;\r\n`;\r\n\r\nexport const FlexContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n`;\r\n\r\nexport const ModalHoverModifier = styled.div`\r\n button:hover {\r\n cursor: help !important;\r\n }\r\n`;\r\n\r\nexport const CloseButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n ${(props) =>\r\n props.$hasImage\r\n ? css`\r\n margin: -12px -12px 0 0 !important;\r\n `\r\n : css`\r\n left: unset;\r\n `}\r\n }\r\n`;\r\n\r\nexport const BackButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n margin: -12px 0 0 -12px !important;\r\n }\r\n`;\r\n\r\nexport const ModalTitle = styled.h5<{ $fontSize?: string }>`\r\n margin: 0;\r\n font-size: ${(props) => props.$fontSize || '1.25em'};\r\n font-weight: bold;\r\n`;\r\n\r\nexport const ModalNoteSection = styled.section<{ $state: string; $size?: string }>`\r\n background-color: ${(props) => getBackgroundColor(props.$state, props.theme)};\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n margin-top: ${(props) => (props?.$size === 'small' ? `0px` : props?.$size === 'large' ? '16px' : '4px')};\r\n margin-bottom: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '24px' : '16px')};\r\n display: flex;\r\n flex-direction: row;\r\n padding: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '16px' : '12px')};\r\n border-radius: 2px;\r\n\r\n span {\r\n display: block;\r\n width: calc(100% - 32px);\r\n margin-left: 8px;\r\n color: ${(props) => getNoteMessageColor(props.$state, props.theme)};\r\n }\r\n`;\r\n\r\nexport const ModalBody = styled.section<{ $size?: string; $overflow?: string; $hasContentBorders?: boolean }>`\r\n flex: 1 1 auto;\r\n overflow: ${(props) => props?.$overflow ?? 'unset'};\r\n margin: ${(props) => (props?.$size === 'small' ? `8px 0` : props?.$size === 'large' ? '16px 0' : '12px 0')};\r\n\r\n border-top: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n border-bottom: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const ModalFooter = styled.section<{ $size?: Size }>`\r\n display: flex;\r\n justify-content: flex-end;\r\n\r\n gap: ${(props) => (props?.$size === 'large' ? `16px` : '8px')};\r\n\r\n .footer-action {\r\n order: -1;\r\n margin-right: auto;\r\n display: flex;\r\n align-items: center;\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n gap: ${(props) => (props?.$size === Size.Large ? `8px` : props?.$size === Size.Small ? '4px' : '6px')};\r\n }\r\n\r\n .footer-action.note {\r\n color: ${props => COLORS.generateToken({componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n }\r\n`;\r\n\r\nexport const getBackgroundColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'positive'}, theme);\r\n case 'warning':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'warning'}, theme);\r\n case 'critical':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'critical'}, theme);\r\n default:\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'primary'}, theme);\r\n }\r\n};\r\n\r\nexport const getNoteMessageColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'positive' }, theme);\r\n case 'warning':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'warning' }, theme);\r\n case 'critical':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'critical' }, theme);\r\n default:\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant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AS,CAAC,EAAER,KAAK,CAAC;IAC9F,KAAK,UAAU;MACb,OAAOK,QAAM,CAACC,aAAa,CAAC;QAACC,aAAa,EAAE,YAAY;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAER,KAAK,CAAC;IAC/F;MACE,OAAOK,QAAM,CAACC,aAAa,CAAC;QAACC,aAAa,EAAE,YAAY;QAAEC,cAAc,EAAE;MAAS,CAAC,EAAER,KAAK,CAAC;EAChG;AACF,CAAC;AAAC5B,OAAA,CAAA0B,kBAAA,GAAAA,kBAAA;AAEK,MAAMG,mBAAmB,GAAGA,CAACa,KAAa,EAAEd,KAAU,KAAK;EAChE,QAAQc,KAAK;IACX,KAAK,UAAU;MACb,OAAOT,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAW,CAAC,EAAER,KAAK,CAAC;IAC3F,KAAK,SAAS;MACZ,OAAOK,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAER,KAAK,CAAC;IAC1F,KAAK,UAAU;MACb,OAAOK,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAW,CAAC,EAAER,KAAK,CAAC;IAC3F;MACE,OAAOK,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAER,KAAK,CAAC;EAC5F;AACF,CAAC;AAAC5B,OAAA,CAAA6B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ModalStyles.cjs","names":["_styledComponents","_interopRequireWildcard","require","_","_styles","_types","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ModalHeader","exports","styled","section","props","$marginBottom","StyledModalHeader","COLORS","generateToken","componentType","defaultVariant","theme","$height","$size","ImageContainer","div","ImageOverlay","Column","ModalTitleSection","ModalHeaderActionsWithImage","$hasBackButton","ModalHeaderActions","FlexContainer","ModalHoverModifier","CloseButtonWrapper","$hasImage","css","BackButtonWrapper","ModalTitle","h5","$fontSize","ModalNoteSection","getBackgroundColor","$state","getNoteMessageColor","ModalBody","$overflow","$hasContentBorders","scrollBarStyling","Size","Small","ModalFooter","Large","state"],"sources":["../../src/Modals/ModalStyles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\r\nimport { COLORS } from '..';\r\nimport { scrollBarStyling } from '../styles';\r\nimport { Size } from '../types';\r\n\r\n/**\r\n * Modal styles\r\n */\r\nexport const ModalHeader = styled.section<{ $marginBottom?: string }>`\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: ${(props) => props.$marginBottom || '24px'};\r\n`;\r\n\r\nexport const StyledModalHeader = styled(ModalHeader)<{ $marginBottom?: string; $size?: string; $height?: number }>`\r\n color: ${props => COLORS.generateToken({componentType:'text', defaultVariant:'default'}, props.theme)};\r\n flex: 1 0 calc(50% - 5px);\r\n flex-direction: column;\r\n flex-basis: auto;\r\n text-align: left;\r\n height: ${(props) => (props.$height ? `${props.$height - (props.$size === 'small' ? 16 : props.$size === 'large' ? 32 : 24)}px` : '')};\r\n img {\r\n width: 100%;\r\n height: ${(props) => `${props.$height}px`};\r\n object-fit: cover;\r\n border-radius: 8px 8px 0 0;\r\n }\r\n`;\r\n\r\nexport const ImageContainer = styled.div<{ $height: number }>`\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n\r\n #imgWithFallbackLoadingIndicator {\r\n position: absolute;\r\n left: 50%;\r\n top: 0;\r\n }\r\n`;\r\n\r\nexport const ImageOverlay = styled.div<{ $height: number }>`\r\n position: absolute;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n width: 100%;\r\n background: rgba(255, 255, 255, 0.5);\r\n border-radius: 8px 8px 0 0;\r\n\r\n &:after {\r\n position: absolute;\r\n height: ${(props) => `${props.$height}px`};\r\n border-radius: 8px 8px 0 0;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n background: #888888;\r\n mix-blend-mode: saturation;\r\n }\r\n`;\r\n\r\nexport const Column = styled.div`\r\n background: ${props => COLORS.generateToken({componentType:'bg-surface', defaultVariant:'default'}, props.theme)};\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: stretch;\r\n height: 100%;\r\n`;\r\n\r\nexport const ModalTitleSection = styled.section`\r\n color: ${props => COLORS.generateToken({componentType:'text', defaultVariant:'default'}, props.theme)};\r\n word-break: break-word;\r\n display: flex;\r\n width: 100%;\r\n justify-content: space-between;\r\n`;\r\n\r\nexport const ModalHeaderActionsWithImage = styled.div<{ $hasBackButton?: boolean }>`\r\n display: flex;\r\n flex-direction: ${(props) => (!props.$hasBackButton ? 'row-reverse' : 'row')};\r\n justify-content: space-between;\r\n width: 100%;\r\n z-index: 1;\r\n`;\r\n\r\nexport const ModalHeaderActions = styled.div`\r\n display: flex;\r\n margin: -12px -12px 0 0;\r\n`;\r\n\r\nexport const FlexContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n`;\r\n\r\nexport const ModalHoverModifier = styled.div`\r\n button:hover {\r\n cursor: help !important;\r\n }\r\n`;\r\n\r\nexport const CloseButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n ${(props) =>\r\n props.$hasImage\r\n ? css`\r\n margin: -12px -12px 0 0 !important;\r\n `\r\n : css`\r\n left: unset;\r\n `}\r\n }\r\n`;\r\n\r\nexport const BackButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n margin: -12px 0 0 -12px !important;\r\n }\r\n`;\r\n\r\nexport const ModalTitle = styled.h5<{ $fontSize?: string }>`\r\n margin: 0;\r\n font-size: ${(props) => props.$fontSize || '1.25em'};\r\n font-weight: bold;\r\n`;\r\n\r\nexport const ModalNoteSection = styled.section<{ $state: string; $size?: string }>`\r\n background-color: ${(props) => getBackgroundColor(props.$state, props.theme)};\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n margin-top: ${(props) => (props?.$size === 'small' ? `0px` : props?.$size === 'large' ? '16px' : '4px')};\r\n margin-bottom: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '24px' : '16px')};\r\n display: flex;\r\n flex-direction: row;\r\n padding: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '16px' : '12px')};\r\n border-radius: 2px;\r\n\r\n span {\r\n display: block;\r\n width: calc(100% - 32px);\r\n margin-left: 8px;\r\n color: ${(props) => getNoteMessageColor(props.$state, props.theme)};\r\n }\r\n`;\r\n\r\nexport const ModalBody = styled.section<{ $size?: string; $overflow?: string; $hasContentBorders?: boolean }>`\r\n flex: 1 1 auto;\r\n overflow: ${(props) => props?.$overflow ?? 'unset'};\r\n margin: ${(props) => (props?.$size === 'small' ? `8px 0` : props?.$size === 'large' ? '16px 0' : '12px 0')};\r\n\r\n border-top: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n border-bottom: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const ModalFooter = styled.section<{ $size?: Size }>`\r\n display: flex;\r\n justify-content: flex-end;\r\n\r\n gap: ${(props) => (props?.$size === 'large' ? `16px` : '8px')};\r\n\r\n .footer-action {\r\n order: -1;\r\n margin-right: auto;\r\n display: flex;\r\n align-items: center;\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n gap: ${(props) => (props?.$size === Size.Large ? `8px` : props?.$size === Size.Small ? '4px' : '6px')};\r\n }\r\n\r\n .footer-action.note {\r\n color: ${props => COLORS.generateToken({componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n }\r\n`;\r\n\r\nexport const getBackgroundColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'positive'}, theme);\r\n case 'warning':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'warning'}, theme);\r\n case 'critical':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'critical'}, theme);\r\n default:\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'primary'}, theme);\r\n }\r\n};\r\n\r\nexport const getNoteMessageColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'positive' }, theme);\r\n case 'warning':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'warning' }, theme);\r\n case 'critical':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'critical' }, theme);\r\n default:\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'primary' }, theme);\r\n }\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAgC,SAAAI,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,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBA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AAc,EAAE;MAAU,CAAC,EAAEC,KAAK,CAAC;IAC/F;MACE,OAAOJ,QAAM,CAACC,aAAa,CAAC;QAACC,aAAa,EAAE,YAAY;QAAEC,cAAc,EAAE;MAAS,CAAC,EAAEC,KAAK,CAAC;EAChG;AACF,CAAC;AAACV,OAAA,CAAA+B,kBAAA,GAAAA,kBAAA;AAEK,MAAME,mBAAmB,GAAGA,CAACS,KAAa,EAAEhC,KAAU,KAAK;EAChE,QAAQgC,KAAK;IACX,KAAK,UAAU;MACb,OAAOpC,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAW,CAAC,EAAEC,KAAK,CAAC;IAC3F,KAAK,SAAS;MACZ,OAAOJ,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAEC,KAAK,CAAC;IAC1F,KAAK,UAAU;MACb,OAAOJ,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAW,CAAC,EAAEC,KAAK,CAAC;IAC3F;MACE,OAAOJ,QAAM,CAACC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAEC,KAAK,CAAC;EAC5F;AACF,CAAC;AAACV,OAAA,CAAAiC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -13,6 +13,10 @@ export const ModalHeader = styled.section`
|
|
|
13
13
|
margin-bottom: ${props => props.$marginBottom || '24px'};
|
|
14
14
|
`;
|
|
15
15
|
export const StyledModalHeader = styled(ModalHeader)`
|
|
16
|
+
color: ${props => COLORS.generateToken({
|
|
17
|
+
componentType: 'text',
|
|
18
|
+
defaultVariant: 'default'
|
|
19
|
+
}, props.theme)};
|
|
16
20
|
flex: 1 0 calc(50% - 5px);
|
|
17
21
|
flex-direction: column;
|
|
18
22
|
flex-basis: auto;
|
|
@@ -61,12 +65,20 @@ export const ImageOverlay = styled.div`
|
|
|
61
65
|
}
|
|
62
66
|
`;
|
|
63
67
|
export const Column = styled.div`
|
|
68
|
+
background: ${props => COLORS.generateToken({
|
|
69
|
+
componentType: 'bg-surface',
|
|
70
|
+
defaultVariant: 'default'
|
|
71
|
+
}, props.theme)};
|
|
64
72
|
display: flex;
|
|
65
73
|
flex-direction: column;
|
|
66
74
|
justify-content: stretch;
|
|
67
75
|
height: 100%;
|
|
68
76
|
`;
|
|
69
77
|
export const ModalTitleSection = styled.section`
|
|
78
|
+
color: ${props => COLORS.generateToken({
|
|
79
|
+
componentType: 'text',
|
|
80
|
+
defaultVariant: 'default'
|
|
81
|
+
}, props.theme)};
|
|
70
82
|
word-break: break-word;
|
|
71
83
|
display: flex;
|
|
72
84
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStyles.js","names":["styled","css","COLORS","scrollBarStyling","Size","ModalHeader","section","props","$marginBottom","StyledModalHeader","$height","$size","ImageContainer","div","ImageOverlay","Column","ModalTitleSection","ModalHeaderActionsWithImage","$hasBackButton","ModalHeaderActions","FlexContainer","ModalHoverModifier","CloseButtonWrapper","$hasImage","BackButtonWrapper","ModalTitle","h5","$fontSize","ModalNoteSection","getBackgroundColor","$state","theme","getNoteMessageColor","ModalBody","$overflow","$hasContentBorders","generateToken","componentType","defaultVariant","Small","ModalFooter","Large","state"],"sources":["../../src/Modals/ModalStyles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\r\nimport { COLORS } from '..';\r\nimport { scrollBarStyling } from '../styles';\r\nimport { Size } from '../types';\r\n\r\n/**\r\n * Modal styles\r\n */\r\nexport const ModalHeader = styled.section<{ $marginBottom?: string }>`\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: ${(props) => props.$marginBottom || '24px'};\r\n`;\r\n\r\nexport const StyledModalHeader = styled(ModalHeader)<{ $marginBottom?: string; $size?: string; $height?: number }>`\r\n flex: 1 0 calc(50% - 5px);\r\n flex-direction: column;\r\n flex-basis: auto;\r\n text-align: left;\r\n height: ${(props) => (props.$height ? `${props.$height - (props.$size === 'small' ? 16 : props.$size === 'large' ? 32 : 24)}px` : '')};\r\n img {\r\n width: 100%;\r\n height: ${(props) => `${props.$height}px`};\r\n object-fit: cover;\r\n border-radius: 8px 8px 0 0;\r\n }\r\n`;\r\n\r\nexport const ImageContainer = styled.div<{ $height: number }>`\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n\r\n #imgWithFallbackLoadingIndicator {\r\n position: absolute;\r\n left: 50%;\r\n top: 0;\r\n }\r\n`;\r\n\r\nexport const ImageOverlay = styled.div<{ $height: number }>`\r\n position: absolute;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n width: 100%;\r\n background: rgba(255, 255, 255, 0.5);\r\n border-radius: 8px 8px 0 0;\r\n\r\n &:after {\r\n position: absolute;\r\n height: ${(props) => `${props.$height}px`};\r\n border-radius: 8px 8px 0 0;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n background: #888888;\r\n mix-blend-mode: saturation;\r\n }\r\n`;\r\n\r\nexport const Column = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: stretch;\r\n height: 100%;\r\n`;\r\n\r\nexport const ModalTitleSection = styled.section`\r\n word-break: break-word;\r\n display: flex;\r\n width: 100%;\r\n justify-content: space-between;\r\n`;\r\n\r\nexport const ModalHeaderActionsWithImage = styled.div<{ $hasBackButton?: boolean }>`\r\n display: flex;\r\n flex-direction: ${(props) => (!props.$hasBackButton ? 'row-reverse' : 'row')};\r\n justify-content: space-between;\r\n width: 100%;\r\n z-index: 1;\r\n`;\r\n\r\nexport const ModalHeaderActions = styled.div`\r\n display: flex;\r\n margin: -12px -12px 0 0;\r\n`;\r\n\r\nexport const FlexContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n`;\r\n\r\nexport const ModalHoverModifier = styled.div`\r\n button:hover {\r\n cursor: help !important;\r\n }\r\n`;\r\n\r\nexport const CloseButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n ${(props) =>\r\n props.$hasImage\r\n ? css`\r\n margin: -12px -12px 0 0 !important;\r\n `\r\n : css`\r\n left: unset;\r\n `}\r\n }\r\n`;\r\n\r\nexport const BackButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n margin: -12px 0 0 -12px !important;\r\n }\r\n`;\r\n\r\nexport const ModalTitle = styled.h5<{ $fontSize?: string }>`\r\n margin: 0;\r\n font-size: ${(props) => props.$fontSize || '1.25em'};\r\n font-weight: bold;\r\n`;\r\n\r\nexport const ModalNoteSection = styled.section<{ $state: string; $size?: string }>`\r\n background-color: ${(props) => getBackgroundColor(props.$state, props.theme)};\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n margin-top: ${(props) => (props?.$size === 'small' ? `0px` : props?.$size === 'large' ? '16px' : '4px')};\r\n margin-bottom: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '24px' : '16px')};\r\n display: flex;\r\n flex-direction: row;\r\n padding: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '16px' : '12px')};\r\n border-radius: 2px;\r\n\r\n span {\r\n display: block;\r\n width: calc(100% - 32px);\r\n margin-left: 8px;\r\n color: ${(props) => getNoteMessageColor(props.$state, props.theme)};\r\n }\r\n`;\r\n\r\nexport const ModalBody = styled.section<{ $size?: string; $overflow?: string; $hasContentBorders?: boolean }>`\r\n flex: 1 1 auto;\r\n overflow: ${(props) => props?.$overflow ?? 'unset'};\r\n margin: ${(props) => (props?.$size === 'small' ? `8px 0` : props?.$size === 'large' ? '16px 0' : '12px 0')};\r\n\r\n border-top: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n border-bottom: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const ModalFooter = styled.section<{ $size?: Size }>`\r\n display: flex;\r\n justify-content: flex-end;\r\n\r\n gap: ${(props) => (props?.$size === 'large' ? `16px` : '8px')};\r\n\r\n .footer-action {\r\n order: -1;\r\n margin-right: auto;\r\n display: flex;\r\n align-items: center;\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n gap: ${(props) => (props?.$size === Size.Large ? `8px` : props?.$size === Size.Small ? '4px' : '6px')};\r\n }\r\n\r\n .footer-action.note {\r\n color: ${props => COLORS.generateToken({componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n }\r\n`;\r\n\r\nexport const getBackgroundColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'positive'}, theme);\r\n case 'warning':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'warning'}, theme);\r\n case 'critical':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'critical'}, theme);\r\n default:\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'primary'}, theme);\r\n }\r\n};\r\n\r\nexport const getNoteMessageColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'positive' }, theme);\r\n case 'warning':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'warning' }, theme);\r\n case 'critical':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'critical' }, theme);\r\n default:\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'primary' }, theme);\r\n }\r\n};\r\n"],"mappings":"AAAA,OAAOA,MAAM,IAAI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,mBAAmB,GAAGA,CAACU,KAAa,EAAEX,KAAU,KAAK;EAChE,QAAQW,KAAK;IACX,KAAK,UAAU;MACb,OAAOxC,MAAM,CAACkC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAW,CAAC,EAAEP,KAAK,CAAC;IAC3F,KAAK,SAAS;MACZ,OAAO7B,MAAM,CAACkC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAEP,KAAK,CAAC;IAC1F,KAAK,UAAU;MACb,OAAO7B,MAAM,CAACkC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAW,CAAC,EAAEP,KAAK,CAAC;IAC3F;MACE,OAAO7B,MAAM,CAACkC,aAAa,CAAC;QAAEC,aAAa,EAAE,MAAM;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAEP,KAAK,CAAC;EAC5F;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ModalStyles.js","names":["styled","css","COLORS","scrollBarStyling","Size","ModalHeader","section","props","$marginBottom","StyledModalHeader","generateToken","componentType","defaultVariant","theme","$height","$size","ImageContainer","div","ImageOverlay","Column","ModalTitleSection","ModalHeaderActionsWithImage","$hasBackButton","ModalHeaderActions","FlexContainer","ModalHoverModifier","CloseButtonWrapper","$hasImage","BackButtonWrapper","ModalTitle","h5","$fontSize","ModalNoteSection","getBackgroundColor","$state","getNoteMessageColor","ModalBody","$overflow","$hasContentBorders","Small","ModalFooter","Large","state"],"sources":["../../src/Modals/ModalStyles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\r\nimport { COLORS } from '..';\r\nimport { scrollBarStyling } from '../styles';\r\nimport { Size } from '../types';\r\n\r\n/**\r\n * Modal styles\r\n */\r\nexport const ModalHeader = styled.section<{ $marginBottom?: string }>`\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: ${(props) => props.$marginBottom || '24px'};\r\n`;\r\n\r\nexport const StyledModalHeader = styled(ModalHeader)<{ $marginBottom?: string; $size?: string; $height?: number }>`\r\n color: ${props => COLORS.generateToken({componentType:'text', defaultVariant:'default'}, props.theme)};\r\n flex: 1 0 calc(50% - 5px);\r\n flex-direction: column;\r\n flex-basis: auto;\r\n text-align: left;\r\n height: ${(props) => (props.$height ? `${props.$height - (props.$size === 'small' ? 16 : props.$size === 'large' ? 32 : 24)}px` : '')};\r\n img {\r\n width: 100%;\r\n height: ${(props) => `${props.$height}px`};\r\n object-fit: cover;\r\n border-radius: 8px 8px 0 0;\r\n }\r\n`;\r\n\r\nexport const ImageContainer = styled.div<{ $height: number }>`\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n\r\n #imgWithFallbackLoadingIndicator {\r\n position: absolute;\r\n left: 50%;\r\n top: 0;\r\n }\r\n`;\r\n\r\nexport const ImageOverlay = styled.div<{ $height: number }>`\r\n position: absolute;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n height: ${(props) => `${props.$height}px`};\r\n width: 100%;\r\n background: rgba(255, 255, 255, 0.5);\r\n border-radius: 8px 8px 0 0;\r\n\r\n &:after {\r\n position: absolute;\r\n height: ${(props) => `${props.$height}px`};\r\n border-radius: 8px 8px 0 0;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n background: #888888;\r\n mix-blend-mode: saturation;\r\n }\r\n`;\r\n\r\nexport const Column = styled.div`\r\n background: ${props => COLORS.generateToken({componentType:'bg-surface', defaultVariant:'default'}, props.theme)};\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: stretch;\r\n height: 100%;\r\n`;\r\n\r\nexport const ModalTitleSection = styled.section`\r\n color: ${props => COLORS.generateToken({componentType:'text', defaultVariant:'default'}, props.theme)};\r\n word-break: break-word;\r\n display: flex;\r\n width: 100%;\r\n justify-content: space-between;\r\n`;\r\n\r\nexport const ModalHeaderActionsWithImage = styled.div<{ $hasBackButton?: boolean }>`\r\n display: flex;\r\n flex-direction: ${(props) => (!props.$hasBackButton ? 'row-reverse' : 'row')};\r\n justify-content: space-between;\r\n width: 100%;\r\n z-index: 1;\r\n`;\r\n\r\nexport const ModalHeaderActions = styled.div`\r\n display: flex;\r\n margin: -12px -12px 0 0;\r\n`;\r\n\r\nexport const FlexContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n`;\r\n\r\nexport const ModalHoverModifier = styled.div`\r\n button:hover {\r\n cursor: help !important;\r\n }\r\n`;\r\n\r\nexport const CloseButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n ${(props) =>\r\n props.$hasImage\r\n ? css`\r\n margin: -12px -12px 0 0 !important;\r\n `\r\n : css`\r\n left: unset;\r\n `}\r\n }\r\n`;\r\n\r\nexport const BackButtonWrapper = styled.div<{ $size?: Size; $hasImage?: boolean }>`\r\n button {\r\n margin: -12px 0 0 -12px !important;\r\n }\r\n`;\r\n\r\nexport const ModalTitle = styled.h5<{ $fontSize?: string }>`\r\n margin: 0;\r\n font-size: ${(props) => props.$fontSize || '1.25em'};\r\n font-weight: bold;\r\n`;\r\n\r\nexport const ModalNoteSection = styled.section<{ $state: string; $size?: string }>`\r\n background-color: ${(props) => getBackgroundColor(props.$state, props.theme)};\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n margin-top: ${(props) => (props?.$size === 'small' ? `0px` : props?.$size === 'large' ? '16px' : '4px')};\r\n margin-bottom: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '24px' : '16px')};\r\n display: flex;\r\n flex-direction: row;\r\n padding: ${(props) => (props?.$size === 'small' ? `8px` : props?.$size === 'large' ? '16px' : '12px')};\r\n border-radius: 2px;\r\n\r\n span {\r\n display: block;\r\n width: calc(100% - 32px);\r\n margin-left: 8px;\r\n color: ${(props) => getNoteMessageColor(props.$state, props.theme)};\r\n }\r\n`;\r\n\r\nexport const ModalBody = styled.section<{ $size?: string; $overflow?: string; $hasContentBorders?: boolean }>`\r\n flex: 1 1 auto;\r\n overflow: ${(props) => props?.$overflow ?? 'unset'};\r\n margin: ${(props) => (props?.$size === 'small' ? `8px 0` : props?.$size === 'large' ? '16px 0' : '12px 0')};\r\n\r\n border-top: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n border-bottom: ${(props) => (props?.$hasContentBorders ? `1px solid ${COLORS.generateToken({componentType: 'border', defaultVariant: 'subtle'}, props.theme)}` : 'none')};\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const ModalFooter = styled.section<{ $size?: Size }>`\r\n display: flex;\r\n justify-content: flex-end;\r\n\r\n gap: ${(props) => (props?.$size === 'large' ? `16px` : '8px')};\r\n\r\n .footer-action {\r\n order: -1;\r\n margin-right: auto;\r\n display: flex;\r\n align-items: center;\r\n font-size: ${(props) => (props?.$size === 'small' ? `16px` : props?.$size === 'large' ? '20px' : '18px')};\r\n gap: ${(props) => (props?.$size === Size.Large ? `8px` : props?.$size === Size.Small ? '4px' : '6px')};\r\n }\r\n\r\n .footer-action.note {\r\n color: ${props => COLORS.generateToken({componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n }\r\n`;\r\n\r\nexport const getBackgroundColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'positive'}, theme);\r\n case 'warning':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'warning'}, theme);\r\n case 'critical':\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'critical'}, theme);\r\n default:\r\n return COLORS.generateToken({componentType: 'bg-surface', defaultVariant: 'primary'}, theme);\r\n }\r\n};\r\n\r\nexport const getNoteMessageColor = (state: string, theme: any) => {\r\n switch (state) {\r\n case 'positive':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'positive' }, theme);\r\n case 'warning':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'warning' }, theme);\r\n case 'critical':\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'critical' }, theme);\r\n default:\r\n return COLORS.generateToken({ componentType: 'text', defaultVariant: 'primary' }, theme);\r\n }\r\n};\r\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,MAAM,QAAQ,IAAI;AAC3B,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,IAAI,QAAQ,UAAU;;AAE/B;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGL,MAAM,CAACM,OAAmC;AACrE;AACA;AACA;AACA,mBAAoBC,KAAK,IAAKA,KAAK,CAACC,aAAa,IAAI,MAAM;AAC3D,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGT,MAAM,CAACK,WAAW,CAA+D;AAClH,WAAWE,KAAK,IAAIL,MAAM,CAACQ,aAAa,CAAC;EAACC,aAAa,EAAC,MAAM;EAAEC,cAAc,EAAC;AAAS,CAAC,EAAEL,KAAK,CAACM,KAAK,CAAC;AACvG;AACA;AACA;AACA;AACA,YAAaN,KAAK,IAAMA,KAAK,CAACO,OAAO,GAAG,GAAGP,KAAK,CAACO,OAAO,IAAIP,KAAK,CAACQ,KAAK,KAAK,OAAO,GAAG,EAAE,GAAGR,KAAK,CAACQ,KAAK,KAAK,OAAO,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,EAAG;AACvI;AACA;AACA,cAAeR,KAAK,IAAK,GAAGA,KAAK,CAACO,OAAO,IAAI;AAC7C;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAME,cAAc,GAAGhB,MAAM,CAACiB,GAAwB;AAC7D;AACA;AACA;AACA;AACA,YAAaV,KAAK,IAAK,GAAGA,KAAK,CAACO,OAAO,IAAI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,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M;QAAEC,cAAc,EAAE;MAAU,CAAC,EAAEC,KAAK,CAAC;EAC5F;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTypes.cjs","names":[],"sources":["../../src/Modals/ModalTypes.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ModalTypes.cjs","names":[],"sources":["../../src/Modals/ModalTypes.ts"],"sourcesContent":["import {TextButtonProps} from '../Button';\r\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\r\nimport {IconButtonProps} from '../Button';\r\nimport React from 'react';\r\nimport {IconDropdownButtonProps} from \"../Dropdown/DropdownButtonTypes\";\r\nimport {ToggleButtonProps} from \"../Toggles/ToggleButton\";\r\n\r\nexport interface ModalHeaderIconButton extends Omit<IconButtonProps, 'hideOnLowWidth' | 'flatEdge' | 'isInMobileMenu' | 'useTransparentBackground' | 'shouldNotInteract' | 'unsetIconSize' | 'borderRadius' | 'focusBackgroundColor' | 'children' | 'focusOnClick'> {\r\n componentType: 'icon';\r\n icon: React.ReactNode;\r\n}\r\n\r\nexport interface ModalHeaderDropdownButton extends Omit<IconDropdownButtonProps, 'size' | 'type'> {\r\n componentType: 'dropdown';\r\n}\r\n\r\nexport interface ModalHeaderToggleButton extends ToggleButtonProps {\r\n componentType: 'toggle';\r\n}\r\n\r\nexport type ModalHeaderButtons = ModalHeaderIconButton | ModalHeaderDropdownButton | ModalHeaderToggleButton;\r\n\r\n\r\nexport interface ButtonAction extends Pick<TextButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'> {\r\n action?: (() => void) | ((e: any) => void);\r\n text?: string;\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport interface LeftFooterActionBase {\r\n actionType: 'hyperlink' | 'note' | 'button';\r\n text: string;\r\n icon?: React.ReactNode;\r\n action?: (() => void) | ((e: any) => void);\r\n}\r\n\r\nexport interface LeftFooterHyperlink extends HyperlinkProps, LeftFooterActionBase {\r\n}\r\n\r\nexport interface LeftFooterButton extends Pick<TextButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'>, LeftFooterActionBase {\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport type LeftFooterAction = LeftFooterButton | LeftFooterHyperlink;\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextButtonProps } from '../Button';
|
|
2
2
|
import { HyperlinkProps } from '../HyperLink/HyperLink';
|
|
3
3
|
import { IconButtonProps } from '../Button';
|
|
4
4
|
import React from 'react';
|
|
@@ -15,7 +15,7 @@ export interface ModalHeaderToggleButton extends ToggleButtonProps {
|
|
|
15
15
|
componentType: 'toggle';
|
|
16
16
|
}
|
|
17
17
|
export type ModalHeaderButtons = ModalHeaderIconButton | ModalHeaderDropdownButton | ModalHeaderToggleButton;
|
|
18
|
-
export interface ButtonAction extends Pick<
|
|
18
|
+
export interface ButtonAction extends Pick<TextButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'> {
|
|
19
19
|
action?: (() => void) | ((e: any) => void);
|
|
20
20
|
text?: string;
|
|
21
21
|
children?: React.ReactNode;
|
|
@@ -28,7 +28,7 @@ export interface LeftFooterActionBase {
|
|
|
28
28
|
}
|
|
29
29
|
export interface LeftFooterHyperlink extends HyperlinkProps, LeftFooterActionBase {
|
|
30
30
|
}
|
|
31
|
-
export interface LeftFooterButton extends Pick<
|
|
31
|
+
export interface LeftFooterButton extends Pick<TextButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'>, LeftFooterActionBase {
|
|
32
32
|
children?: React.ReactNode;
|
|
33
33
|
}
|
|
34
34
|
export type LeftFooterAction = LeftFooterButton | LeftFooterHyperlink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTypes.js","names":[],"sources":["../../src/Modals/ModalTypes.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ModalTypes.js","names":[],"sources":["../../src/Modals/ModalTypes.ts"],"sourcesContent":["import {TextButtonProps} from '../Button';\r\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\r\nimport {IconButtonProps} from '../Button';\r\nimport React from 'react';\r\nimport {IconDropdownButtonProps} from \"../Dropdown/DropdownButtonTypes\";\r\nimport {ToggleButtonProps} from \"../Toggles/ToggleButton\";\r\n\r\nexport interface ModalHeaderIconButton extends Omit<IconButtonProps, 'hideOnLowWidth' | 'flatEdge' | 'isInMobileMenu' | 'useTransparentBackground' | 'shouldNotInteract' | 'unsetIconSize' | 'borderRadius' | 'focusBackgroundColor' | 'children' | 'focusOnClick'> {\r\n componentType: 'icon';\r\n icon: React.ReactNode;\r\n}\r\n\r\nexport interface ModalHeaderDropdownButton extends Omit<IconDropdownButtonProps, 'size' | 'type'> {\r\n componentType: 'dropdown';\r\n}\r\n\r\nexport interface ModalHeaderToggleButton extends ToggleButtonProps {\r\n componentType: 'toggle';\r\n}\r\n\r\nexport type ModalHeaderButtons = ModalHeaderIconButton | ModalHeaderDropdownButton | ModalHeaderToggleButton;\r\n\r\n\r\nexport interface ButtonAction extends Pick<TextButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'> {\r\n action?: (() => void) | ((e: any) => void);\r\n text?: string;\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport interface LeftFooterActionBase {\r\n actionType: 'hyperlink' | 'note' | 'button';\r\n text: string;\r\n icon?: React.ReactNode;\r\n action?: (() => void) | ((e: any) => void);\r\n}\r\n\r\nexport interface LeftFooterHyperlink extends HyperlinkProps, LeftFooterActionBase {\r\n}\r\n\r\nexport interface LeftFooterButton extends Pick<TextButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'>, LeftFooterActionBase {\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport type LeftFooterAction = LeftFooterButton | LeftFooterHyperlink;\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {render} from '../../test-utils';
|
|
3
|
+
import 'jest-styled-components';
|
|
4
|
+
import {ModalDialog} from '..';
|
|
5
|
+
import {Size, SystemIcons} from '../..';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
describe('<ModalDialog />', () => {
|
|
10
|
+
let mountingDiv: HTMLElement;
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
//being rendered as a React.Portal we need to have the 'root' div defined
|
|
14
|
+
mountingDiv = document.createElement('div');
|
|
15
|
+
mountingDiv.id = 'root';
|
|
16
|
+
document.body.appendChild(mountingDiv);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
document.body.removeChild(mountingDiv);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('Check modal not rendered when isModalOpen is false', async () => {
|
|
24
|
+
const {container, getByText} = render(
|
|
25
|
+
<ModalDialog
|
|
26
|
+
key="smallModalWithoutImage"
|
|
27
|
+
title={'Header'}
|
|
28
|
+
size={Size.Small}
|
|
29
|
+
isModalOpen={false}
|
|
30
|
+
closeAction={() => {
|
|
31
|
+
}}
|
|
32
|
+
submitAction={() => {
|
|
33
|
+
}}
|
|
34
|
+
/>,
|
|
35
|
+
);
|
|
36
|
+
//check modal portal not exists when modal not opened
|
|
37
|
+
expect(container.querySelector('.ReactModalPortal')).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('Check modal visible, title and footer buttons displayed correctly', async () => {
|
|
41
|
+
const {container, getByText} = render(
|
|
42
|
+
<ModalDialog
|
|
43
|
+
key="smallModalWithoutImage"
|
|
44
|
+
|
|
45
|
+
title={'Header'}
|
|
46
|
+
size={Size.Small}
|
|
47
|
+
isModalOpen={true}
|
|
48
|
+
closeAction={() => {
|
|
49
|
+
}}
|
|
50
|
+
submitAction={() => {
|
|
51
|
+
}}
|
|
52
|
+
buttons={[
|
|
53
|
+
{
|
|
54
|
+
action: () => {
|
|
55
|
+
},
|
|
56
|
+
text: 'Close',
|
|
57
|
+
variant: 'tertiary',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
action: () => {
|
|
61
|
+
},
|
|
62
|
+
text: 'Save',
|
|
63
|
+
},
|
|
64
|
+
]}
|
|
65
|
+
/>,
|
|
66
|
+
);
|
|
67
|
+
//check modal portal defined
|
|
68
|
+
expect(container.querySelector('.ReactModalPortal')).toBeDefined();
|
|
69
|
+
//Check header and footer buttons
|
|
70
|
+
expect(getByText('Header')).toBeDefined();
|
|
71
|
+
expect(getByText('Close')).toBeDefined();
|
|
72
|
+
expect(getByText('Save')).toBeDefined();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('Check tooltip, and link displayed without right footer buttons', async () => {
|
|
76
|
+
const {baseElement, getByText} = render(
|
|
77
|
+
<ModalDialog
|
|
78
|
+
key="smallModalWithoutImage"
|
|
79
|
+
|
|
80
|
+
title={'Header'}
|
|
81
|
+
size={Size.Small}
|
|
82
|
+
isModalOpen={true}
|
|
83
|
+
closeAction={() => {
|
|
84
|
+
}}
|
|
85
|
+
submitAction={() => {
|
|
86
|
+
}}
|
|
87
|
+
tooltip={'some test tooltip'}
|
|
88
|
+
leftFooterAction={{
|
|
89
|
+
id: 'test-link',
|
|
90
|
+
actionType: 'hyperlink',
|
|
91
|
+
text: 'Link',
|
|
92
|
+
href: 'http://test.com',
|
|
93
|
+
icon: <></>,
|
|
94
|
+
variant: 'default'
|
|
95
|
+
}}
|
|
96
|
+
/>,
|
|
97
|
+
);
|
|
98
|
+
//check tooltip displayed
|
|
99
|
+
expect(getByText('some test tooltip').textContent).toBeDefined();
|
|
100
|
+
//check footer link displayed
|
|
101
|
+
expect(getByText('Link').children).toBeDefined();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('Check note and footer note displayed', async () => {
|
|
105
|
+
const {baseElement, getByText} = render(
|
|
106
|
+
<ModalDialog
|
|
107
|
+
key="smallModalWithoutImage"
|
|
108
|
+
|
|
109
|
+
title={'Header'}
|
|
110
|
+
size={Size.Small}
|
|
111
|
+
isModalOpen={true}
|
|
112
|
+
closeAction={() => {
|
|
113
|
+
}}
|
|
114
|
+
submitAction={() => {
|
|
115
|
+
}}
|
|
116
|
+
leftFooterAction={{id: 'test-note', actionType: 'note', text: 'Test note', icon: <SystemIcons.Information/>}}
|
|
117
|
+
note={'Message text'}
|
|
118
|
+
state={'critical'}
|
|
119
|
+
/>,
|
|
120
|
+
);
|
|
121
|
+
//check footer note text displayed
|
|
122
|
+
expect(getByText('Test note').textContent).toBeDefined();
|
|
123
|
+
//check note section added
|
|
124
|
+
expect(baseElement.querySelectorAll('section')?.length).toEqual(4);
|
|
125
|
+
//check note message displayed
|
|
126
|
+
expect(getByText('Message text').children).toBeDefined();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('Check back button and close icon displayed', async () => {
|
|
130
|
+
const {baseElement, getByText, container} = render(
|
|
131
|
+
<ModalDialog
|
|
132
|
+
key="smallModalWithoutImage"
|
|
133
|
+
|
|
134
|
+
title={'Header'}
|
|
135
|
+
size={Size.Small}
|
|
136
|
+
backButton={() => {
|
|
137
|
+
}}
|
|
138
|
+
isModalOpen={true}
|
|
139
|
+
closeAction={() => {
|
|
140
|
+
}}
|
|
141
|
+
submitAction={() => {
|
|
142
|
+
}}
|
|
143
|
+
/>,
|
|
144
|
+
);
|
|
145
|
+
//only 2 svg elements should be found in the header of the modal
|
|
146
|
+
expect(baseElement.querySelectorAll('svg')?.length).toEqual(2);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('Check modal body displayed', async () => {
|
|
150
|
+
const {baseElement, getByText, container} = render(
|
|
151
|
+
<ModalDialog
|
|
152
|
+
key="smallModalWithoutImage"
|
|
153
|
+
|
|
154
|
+
title={'Header'}
|
|
155
|
+
size={Size.Small}
|
|
156
|
+
isModalOpen={true}
|
|
157
|
+
closeAction={() => {
|
|
158
|
+
}}
|
|
159
|
+
submitAction={() => {
|
|
160
|
+
}}>
|
|
161
|
+
<span>Inner modal text</span>
|
|
162
|
+
</ModalDialog>,
|
|
163
|
+
);
|
|
164
|
+
//Check all dialog sections are displayed
|
|
165
|
+
expect(baseElement.querySelectorAll('section')?.length).toEqual(3);
|
|
166
|
+
//Check that the second section (modal body) has the correct text
|
|
167
|
+
expect(baseElement.querySelectorAll('section')?.[1].textContent).toEqual('Inner modal text');
|
|
168
|
+
});
|
|
169
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {ModalContainer} from '../index';
|
|
3
|
+
import {act, fireEvent, render} from '../../test-utils';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
describe('ModalContainer', () => {
|
|
8
|
+
|
|
9
|
+
let mountingDiv: HTMLElement;
|
|
10
|
+
const scrollToSpy = jest.fn();
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
//being rendered as a React.Portal we need to have the 'root' div defined
|
|
14
|
+
mountingDiv = document.createElement('div');
|
|
15
|
+
mountingDiv.id = 'root';
|
|
16
|
+
document.body.appendChild(mountingDiv);
|
|
17
|
+
window.scrollTo = scrollToSpy;
|
|
18
|
+
document.body.style.position = '';
|
|
19
|
+
document.body.style.left = '';
|
|
20
|
+
document.body.style.top = '';
|
|
21
|
+
document.body.style.right = '';
|
|
22
|
+
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
document.body.removeChild(mountingDiv);
|
|
27
|
+
scrollToSpy.mockReset();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should not render content', () => {
|
|
31
|
+
const wrapper = render(<ModalContainer showModal={false} closeModal={jest.fn()} children={'text'}/>);
|
|
32
|
+
|
|
33
|
+
expect(wrapper.queryByText('text')).not.toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should render children inside react modal', () => {
|
|
37
|
+
const wrapper = render(<ModalContainer showModal={true} closeModal={jest.fn()} children={'text'}/>);
|
|
38
|
+
|
|
39
|
+
expect(wrapper.queryByText('text')).toBeInTheDocument();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should call onClose when react modal closes', () => {
|
|
43
|
+
const onClose = jest.fn();
|
|
44
|
+
const wrapper = render(<ModalContainer showModal={true} closeModal={onClose} children={'text'}/>);
|
|
45
|
+
|
|
46
|
+
act(() => {
|
|
47
|
+
fireEvent.click(document.querySelector('.ReactModal__Overlay')!);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
expect(onClose).toHaveBeenCalled();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should append custom styles when modal is mounted', () => {
|
|
54
|
+
const wrapper = render(<ModalContainer showModal={false} closeModal={jest.fn()} children={'text'}/>);
|
|
55
|
+
|
|
56
|
+
expect(document.querySelectorAll('[modal-custom-styling="active"]')).toHaveLength(1);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should prevent scroll when modal is open', () => {
|
|
60
|
+
Object.defineProperty(window, 'scrollY', {value: 5, writable: true});
|
|
61
|
+
|
|
62
|
+
const wrapper = render(<ModalContainer showModal={true} closeModal={jest.fn()} children={'text'}/>);
|
|
63
|
+
|
|
64
|
+
expect(document.body.style.top).toEqual('-5px');
|
|
65
|
+
expect(document.body.style.position).toEqual('fixed');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should not touch scroll if modal was not opened yet', async () => {
|
|
69
|
+
Object.defineProperty(window, 'scrollY', {value: 5, writable: true});
|
|
70
|
+
|
|
71
|
+
const wrapper = render(<ModalContainer showModal={false} closeModal={jest.fn()} children={'text'}/>);
|
|
72
|
+
|
|
73
|
+
expect(document.body.style.top).toBeFalsy();
|
|
74
|
+
expect(document.body.style.position).toBeFalsy();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
});
|