@laerdal/life-react-components 6.1.2-dev.1 → 6.1.2-dev.1.full

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,7 @@ const PopoverContainer = exports.PopoverContainer = _styledComponents.default.di
41
41
 
42
42
  &::after {
43
43
  ${props => props.$showArrowPointer ? renderArrowStyles(props.$position) : ''}
44
+ }
44
45
  `;
45
46
  const PopoverTopSectionContainer = exports.PopoverTopSectionContainer = _styledComponents.default.div`
46
47
  ${props => props.$size && `height: ${props.$size === _types.Size.Small ? '56px' : props.$size === _types.Size.Large ? '72px' : '64px'};`}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_","_Button","_icons","_styles","_types","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PopoverContainer","exports","styled","div","props","$size","Size","Small","Large","COLORS","generateToken","componentType","defaultVariant","theme","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","$position","Position","Bottom","Top","Left","Right","$showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","PopoverMiddleSectionContainer","scrollBarStyling","PopoverBottomSectionContainer","TextContainer","renderMargins","$note","NoteContainer","ComponentXSStyling","ComponentTextStyle","Regular","ComponentXXSStyling","ComponentSStyling","LabelContainer","ComponentMStyling","Bold","ComponentLStyling","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","useTheme","popoverRef","useRef","wrapperRef","useEffect","checkIfClickedOutside","current","contains","target","document","addEventListener","removeEventListener","handleWrapperClick","stopPropagation","jsxs","ref","note","jsx","text","IconButton","action","useTransparentBackground","iconColor","variant","shape","SystemIcons","Close","textButton","icon","TextButton","onClick","label","className","iconButtons","map","iconButton","propTypes","_propTypes","string","isRequired","arrayOf","node","func","bool","_default"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { TextButton, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ $size?: Size; $position: Position; $showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px')};\r\n ${(props) => props.$size && `min-width: ${props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px'};`}\r\n width: ${(props) => !props.$size ? 'fit-content' : 'auto'};\r\n border-radius: 4px;\r\n background: ${props => COLORS.generateToken({ componentType: 'bg-surface', defaultVariant: 'high' }, props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.$position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.$position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.$position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.$position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.$showArrowPointer ? renderArrowStyles(props.$position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size?: Size }>`\r\n margin: 8px;\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px'};`}\r\n ${(props) => props.$size && `padding: ${props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px'};`}\r\n ${(props) => !props.$size && `padding: 8px;`}\r\n ${(props) => props.$size && 'overflow-y: auto;'}\r\n ${(props) => props.$size && scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px'};`}\r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size?: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n ${(props) => props.$size && `margin: ${renderMargins(props.$note, props.$size)};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentMStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size?: Size): string => {\r\n if (!size) {\r\n return isNotePresent ? '8px' : '12px 8px';\r\n }\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(null);\r\n const wrapperRef = React.useRef<any>(null);\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target) && wrapperRef.current && !wrapperRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n const handleWrapperClick = (e: React.MouseEvent) => {\r\n if (showOnClick) {\r\n e.stopPropagation();\r\n setShowPopover(!showPopover);\r\n }\r\n };\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \r\n iconColor={COLORS.generateToken({ componentType: 'icon', defaultVariant: 'subtle' }, theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer $size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer $size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer $size={size} data-testid={'textBtn'}>\r\n <TextButton size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </TextButton>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer $size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div ref={wrapperRef} onClick={handleWrapperClick}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,CAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA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lH,OAAA,CAAAmH;IAAA;EAAA;EAoCL7C,WAAW,EAAA4C,UAAA,CAAAlH,OAAA,CAAAsH,IAAA,CAAAF,UAAA;EAKX7C,QAAQ,EAAA2C,UAAA,CAAAlH,OAAA,CAAAsH,IAAA,CAAAF,UAAA;EAWR5C,WAAW,EAAA0C,UAAA,CAAAlH,OAAA,CAAAwH,IAAA,CAAAJ,UAAA;EAMX3C,gBAAgB,EAAAyC,UAAA,CAAAlH,OAAA,CAAAwH;AAAA;AAAA,IAAAC,QAAA,GAAA1G,OAAA,CAAAf,OAAA,GA8FHkE,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"Popover.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_","_Button","_icons","_styles","_types","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PopoverContainer","exports","styled","div","props","$size","Size","Small","Large","COLORS","generateToken","componentType","defaultVariant","theme","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","$position","Position","Bottom","Top","Left","Right","$showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","PopoverMiddleSectionContainer","scrollBarStyling","PopoverBottomSectionContainer","TextContainer","renderMargins","$note","NoteContainer","ComponentXSStyling","ComponentTextStyle","Regular","ComponentXXSStyling","ComponentSStyling","LabelContainer","ComponentMStyling","Bold","ComponentLStyling","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","useTheme","popoverRef","useRef","wrapperRef","useEffect","checkIfClickedOutside","current","contains","target","document","addEventListener","removeEventListener","handleWrapperClick","stopPropagation","jsxs","ref","note","jsx","text","IconButton","action","useTransparentBackground","iconColor","variant","shape","SystemIcons","Close","textButton","icon","TextButton","onClick","label","className","iconButtons","map","iconButton","propTypes","_propTypes","string","isRequired","arrayOf","node","func","bool","_default"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { TextButton, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ $size?: Size; $position: Position; $showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px')};\r\n ${(props) => props.$size && `min-width: ${props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px'};`}\r\n width: ${(props) => !props.$size ? 'fit-content' : 'auto'};\r\n border-radius: 4px;\r\n background: ${props => COLORS.generateToken({ componentType: 'bg-surface', defaultVariant: 'high' }, props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.$position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.$position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.$position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.$position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.$showArrowPointer ? renderArrowStyles(props.$position) : '')}\r\n }\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size?: Size }>`\r\n margin: 8px;\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px'};`}\r\n ${(props) => props.$size && `padding: ${props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px'};`}\r\n ${(props) => !props.$size && `padding: 8px;`}\r\n ${(props) => props.$size && 'overflow-y: auto;'}\r\n ${(props) => props.$size && scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px'};`}\r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size?: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n ${(props) => props.$size && `margin: ${renderMargins(props.$note, props.$size)};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentMStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size?: Size): string => {\r\n if (!size) {\r\n return isNotePresent ? '8px' : '12px 8px';\r\n }\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(null);\r\n const wrapperRef = React.useRef<any>(null);\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target) && wrapperRef.current && !wrapperRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n const handleWrapperClick = (e: React.MouseEvent) => {\r\n if (showOnClick) {\r\n e.stopPropagation();\r\n setShowPopover(!showPopover);\r\n }\r\n };\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \r\n iconColor={COLORS.generateToken({ componentType: 'icon', defaultVariant: 'subtle' }, theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer $size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer $size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer $size={size} data-testid={'textBtn'}>\r\n <TextButton size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </TextButton>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer $size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div ref={wrapperRef} onClick={handleWrapperClick}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,CAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA0C,IAAAO,WAA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A;EAoCL7C,WAAW,EAAA4C,UAAA,CAAAlH,OAAA,CAAAsH,IAAA,CAAAF,UAAA;EAKX7C,QAAQ,EAAA2C,UAAA,CAAAlH,OAAA,CAAAsH,IAAA,CAAAF,UAAA;EAWR5C,WAAW,EAAA0C,UAAA,CAAAlH,OAAA,CAAAwH,IAAA,CAAAJ,UAAA;EAMX3C,gBAAgB,EAAAyC,UAAA,CAAAlH,OAAA,CAAAwH;AAAA;AAAA,IAAAC,QAAA,GAAA1G,OAAA,CAAAf,OAAA,GA8FHkE,OAAO","ignoreList":[]}
@@ -32,6 +32,7 @@ export const PopoverContainer = styled.div`
32
32
 
33
33
  &::after {
34
34
  ${props => props.$showArrowPointer ? renderArrowStyles(props.$position) : ''}
35
+ }
35
36
  `;
36
37
  export const PopoverTopSectionContainer = styled.div`
37
38
  ${props => props.$size && `height: ${props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};`}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXSStyling","TextButton","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","jsx","_jsx","jsxs","_jsxs","PopoverContainer","div","props","$size","Small","Large","generateToken","componentType","defaultVariant","theme","BOXSHADOW_CENTERED","popover","$position","Bottom","Top","Left","Right","$showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","PopoverMiddleSectionContainer","PopoverBottomSectionContainer","TextContainer","renderMargins","$note","NoteContainer","Regular","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","popoverRef","useRef","wrapperRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","handleWrapperClick","stopPropagation","ref","note","text","action","useTransparentBackground","iconColor","variant","shape","Close","textButton","icon","onClick","label","className","iconButtons","map","iconButton","propTypes","_pt","string","isRequired","arrayOf","node","func","bool"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { TextButton, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ $size?: Size; $position: Position; $showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px')};\r\n ${(props) => props.$size && `min-width: ${props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px'};`}\r\n width: ${(props) => !props.$size ? 'fit-content' : 'auto'};\r\n border-radius: 4px;\r\n background: ${props => COLORS.generateToken({ componentType: 'bg-surface', defaultVariant: 'high' }, props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.$position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.$position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.$position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.$position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.$showArrowPointer ? renderArrowStyles(props.$position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size?: Size }>`\r\n margin: 8px;\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px'};`}\r\n ${(props) => props.$size && `padding: ${props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px'};`}\r\n ${(props) => !props.$size && `padding: 8px;`}\r\n ${(props) => props.$size && 'overflow-y: auto;'}\r\n ${(props) => props.$size && scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px'};`}\r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size?: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n ${(props) => props.$size && `margin: ${renderMargins(props.$note, props.$size)};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentMStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size?: Size): string => {\r\n if (!size) {\r\n return isNotePresent ? '8px' : '12px 8px';\r\n }\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(null);\r\n const wrapperRef = React.useRef<any>(null);\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target) && wrapperRef.current && !wrapperRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n const handleWrapperClick = (e: React.MouseEvent) => {\r\n if (showOnClick) {\r\n e.stopPropagation();\r\n setShowPopover(!showPopover);\r\n }\r\n };\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \r\n iconColor={COLORS.generateToken({ componentType: 'icon', defaultVariant: 'subtle' }, theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer $size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer $size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer $size={size} data-testid={'textBtn'}>\r\n <TextButton size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </TextButton>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer $size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div ref={wrapperRef} onClick={handleWrapperClick}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAASC,MAAM,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAQ,IAAI;AACnE,SAASC,UAAU,EAAEC,UAAU,QAAQ,WAAW;AAClD,SAASC,WAAW,QAAQ,UAA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,KAAA;MAAKgE,GAAG,EAAEZ,UAAW;MAACuB,OAAO,EAAEb,kBAAmB;MAAAlB,QAAA,GAC/CA,QAAQ,eAET9C,IAAA;QAAK+E,SAAS,EAAC;MAAe,CAAE,CAAC;IAAA,CAC9B,CAAC;EAAA,CACQ,CAAC;AAErB,CAAC;AAACtC,OAAA,CAAA0C,SAAA;EA5HAxC,eAAe,EAAAyC,GAAA,CAAAX,KAAA;IAhDfL,IAAI,EAAAgB,GAAA,CAAAC,MAAA,CAAAC,UAAA;IAKJnB,IAAI,EAAAiB,GAAA,CAAAC;EAAA;EAgDJzC,kBAAkB,EAAAwC,GAAA,CAAAX,KAAA;IAvBlBO,WAAW,EAAAI,GAAA,CAAAG,OAAA,CAAAH,GAAA,CAAAX,KAAA;MAlBXG,IAAI,EAAAQ,GAAA,CAAAI,IAAA,CAAAF,UAAA;MAKJjB,MAAM,EAAAe,GAAA,CAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;IAaLV,UAAU,EAAAS,GAAA,CAAAX,KAAA;MAvBVG,IAAI,EAAAQ,GAAA,CAAAI,IAAA,CAAAF,UAAA;MAKJjB,MAAM,EAAAe,GAAA,CAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;EAAA;EAoCLxC,WAAW,EAAAuC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAKXxC,QAAQ,EAAAsC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAWRvC,WAAW,EAAAqC,GAAA,CAAAM,IAAA,CAAAJ,UAAA;EAMXtC,gBAAgB,EAAAoC,GAAA,CAAAM;AAAA;AA8FlB,eAAejD,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"Popover.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXSStyling","TextButton","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","jsx","_jsx","jsxs","_jsxs","PopoverContainer","div","props","$size","Small","Large","generateToken","componentType","defaultVariant","theme","BOXSHADOW_CENTERED","popover","$position","Bottom","Top","Left","Right","$showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","PopoverMiddleSectionContainer","PopoverBottomSectionContainer","TextContainer","renderMargins","$note","NoteContainer","Regular","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","popoverRef","useRef","wrapperRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","handleWrapperClick","stopPropagation","ref","note","text","action","useTransparentBackground","iconColor","variant","shape","Close","textButton","icon","onClick","label","className","iconButtons","map","iconButton","propTypes","_pt","string","isRequired","arrayOf","node","func","bool"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { TextButton, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ $size?: Size; $position: Position; $showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px')};\r\n ${(props) => props.$size && `min-width: ${props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px'};`}\r\n width: ${(props) => !props.$size ? 'fit-content' : 'auto'};\r\n border-radius: 4px;\r\n background: ${props => COLORS.generateToken({ componentType: 'bg-surface', defaultVariant: 'high' }, props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.$position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.$position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.$position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.$position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.$showArrowPointer ? renderArrowStyles(props.$position) : '')}\r\n }\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size?: Size }>`\r\n margin: 8px;\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px'};`}\r\n ${(props) => props.$size && `padding: ${props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px'};`}\r\n ${(props) => !props.$size && `padding: 8px;`}\r\n ${(props) => props.$size && 'overflow-y: auto;'}\r\n ${(props) => props.$size && scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `height: ${props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px'};`}\r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size?: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n ${(props) => props.$size && `margin: ${renderMargins(props.$note, props.$size)};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ $size?: Size }>`\r\n ${(props) =>\r\n !props.$size\r\n ? ComponentMStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size?: Size }>`\r\n ${(props) => props.$size && `margin: ${props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};`}\r\n ${(props) => !props.$size && `margin: 8px;`}\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size?: Size): string => {\r\n if (!size) {\r\n return isNotePresent ? '8px' : '12px 8px';\r\n }\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(null);\r\n const wrapperRef = React.useRef<any>(null);\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target) && wrapperRef.current && !wrapperRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n const handleWrapperClick = (e: React.MouseEvent) => {\r\n if (showOnClick) {\r\n e.stopPropagation();\r\n setShowPopover(!showPopover);\r\n }\r\n };\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \r\n iconColor={COLORS.generateToken({ componentType: 'icon', defaultVariant: 'subtle' }, theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer $size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer $size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer $size={size} data-testid={'textBtn'}>\r\n <TextButton size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </TextButton>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer $size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div ref={wrapperRef} onClick={handleWrapperClick}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAASC,MAAM,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAQ,IAAI;AACnE,SAASC,UAAU,EAAEC,UAAU,QAAQ,WAAW;AAClD,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAEC,gBAAgB,EAAEC,SAAS,QAAQ,WAAW;AACjJ,SAASC,QAAQ,EAAEC,IAAI,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,OAAO,MAAMC,gBAAgB,GAAGrB,MAAM,CAACsB,GAAsE;AAC7G,cAAeC,KAAK,IAAMA,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACS,KAAK,GAAG,OAAO,GAAGF,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACU,KAAK,GAAG,OAAO,GAAG,OAAQ;AAChH,IAAKH,KAAK,IAAKA,KAAK,CAACC,KAAK,IAAI,cAAcD,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACS,KAAK,GAAG,OAAO,GAAGF,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACU,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG;AACpI,WAAYH,KAAK,IAAK,CAACA,KAAK,CAACC,KAAK,GAAG,aAAa,GAAG,MAAM;AAC3D;AACA,gBAAgBD,KAAK,IAAIrB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GAAA,CAAAK,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;EAAA;EAoCLxC,WAAW,EAAAuC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAKXxC,QAAQ,EAAAsC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAWRvC,WAAW,EAAAqC,GAAA,CAAAM,IAAA,CAAAJ,UAAA;EAMXtC,gBAAgB,EAAAoC,GAAA,CAAAM;AAAA;AA8FlB,eAAejD,OAAO","ignoreList":[]}
package/package.json CHANGED
@@ -1,150 +1,154 @@
1
1
  {
2
- "name": "@laerdal/life-react-components",
3
- "version": "6.1.2-dev.1",
4
- "private": false,
5
- "author": "Erik Martirosyan <erik.martirosyan@laerdal.com>",
6
- "contributors": [],
7
- "description": "Laerdal LIFE component library for React.",
8
- "keywords": [],
9
- "license": "UNLICENSED",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/Laerdal-Medical/dcs-life-react-js"
13
- },
14
- "main": "dist/index.cjs",
15
- "module": "dist/index.js",
16
- "types": "dist/index.d.ts",
17
- "exports": {
18
- ".": {
19
- "require": "./dist/index.cjs",
20
- "import": "./dist/index.js",
21
- "types": "./dist/index.d.ts"
22
- }
23
- },
24
- "sideEffects": false,
25
- "files": [
26
- "dist"
27
- ],
28
- "scripts": {
29
- "bump": "yarn version --patch",
30
- "build": "yarn extract-design-tokens && yarn build:babel:esm && yarn build:babel:cjs && tsc --emitDeclarationOnly --declaration --declarationDir dist && node scripts/copyTS.cjs",
31
- "extract-design-tokens": "node scripts/extractDesignTokens.js",
32
- "build:babel:esm": "cross-env BABEL_ENV=esm babel --source-maps --extensions \".js,.ts,.tsx\" src --out-dir dist --out-file-extension .js --copy-files",
33
- "build:babel:cjs": "cross-env BABEL_ENV=cjs babel --source-maps --extensions \".js,.ts,.tsx\" src --out-dir dist --out-file-extension .cjs --copy-files",
34
- "clean": "rimraf dist",
35
- "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose",
36
- "test": "jest src/",
37
- "test:coverage": "jest --collectCoverage src/",
38
- "test-watch": "jest --watch",
39
- "storybook": "storybook dev -p 6006",
40
- "build-storybook": "storybook build"
41
- },
42
- "eslintConfig": {
43
- "extends": [
44
- "react-app",
45
- "plugin:storybook/recommended"
46
- ]
47
- },
48
- "browserslist": {
49
- "production": [
50
- ">0.2%",
51
- "not dead",
52
- "not op_mini all"
53
- ],
54
- "development": [
55
- "last 1 chrome version",
56
- "last 1 firefox version",
57
- "last 1 safari version"
58
- ]
59
- },
60
- "omlet": {
61
- "exports": {
62
- ".": "src/index.ts"
63
- }
64
- },
65
- "dependencies": {
66
- "@babel/plugin-transform-typescript": "^7.28.0",
67
- "@laerdal/figma-svg": "^5.2.2",
68
- "@types/node": "^18.0.6",
69
- "animated-scroll-to": "^2.3.0",
70
- "dayjs": "^1.11.5",
71
- "nanoid": "3.3.11",
72
- "react": "^19.0.0",
73
- "react-datepicker": "^8.4.0",
74
- "react-dom": "^19.0.0",
75
- "react-inlinesvg": "^4.2.0",
76
- "react-modal": "^3.16.0",
77
- "react-quill-new": "^3.6.0",
78
- "react-resize-detector": "^12.0.0",
79
- "rooks": "8.4.0",
80
- "styled-components": "^6.1.13",
81
- "typescript": "^5.1.2"
82
- },
83
- "devDependencies": {
84
- "@babel/cli": "^7.22.0",
85
- "@babel/plugin-proposal-class-properties": "^7.18.6",
86
- "@babel/plugin-proposal-decorators": "^7.27.1",
87
- "@babel/plugin-proposal-export-default-from": "^7.22.0",
88
- "@babel/plugin-proposal-numeric-separator": "^7.18.6",
89
- "@babel/plugin-proposal-object-rest-spread": "^7.18.6",
90
- "@babel/plugin-transform-runtime": "^7.22.0",
91
- "@babel/preset-env": "^7.22.0",
92
- "@babel/preset-react": "^7.22.0",
93
- "@babel/preset-typescript": "^7.27.0",
94
- "@babel/runtime": "^7.22.0",
95
- "@chromatic-com/storybook": "1.4.0",
96
- "@laerdal-medical/life-design-tokens": "^1.5.1-beta",
97
- "@laerdal/life-react-components": "5.1.0",
98
- "@laerdal/navigation": "^3.2.0",
99
- "@storybook/addon-essentials": "^8.1.3",
100
- "@storybook/addon-interactions": "^8.1.3",
101
- "@storybook/addon-links": "^8.1.3",
102
- "@storybook/addon-onboarding": "^8.1.3",
103
- "@storybook/addon-webpack5-compiler-swc": "1.0.2",
104
- "@storybook/addons": "^7.6.17",
105
- "@storybook/blocks": "^8.1.3",
106
- "@storybook/react": "^8.1.3",
107
- "@storybook/react-webpack5": "^8.1.3",
108
- "@storybook/test": "^8.1.3",
109
- "@testing-library/dom": "^10.4.0",
110
- "@testing-library/jest-dom": "^6.5.0",
111
- "@testing-library/react": "^16.0.1",
112
- "@testing-library/user-event": "^14.5.2",
113
- "@types/jest": "^29.5.12",
114
- "@types/react": "^19.1.2",
115
- "@types/react-datepicker": "^4.4.2",
116
- "@types/react-dom": "^18.3.0",
117
- "@types/react-modal": "^3.13.1",
118
- "babel-plugin-inline-react-svg": "^2.0.1",
119
- "babel-plugin-typescript-to-proptypes": "^2.0.0",
120
- "concurrently": "^5.2.0",
121
- "cross-env": "^7.0.3",
122
- "css-loader": "^7.1.2",
123
- "eslint-plugin-storybook": "^0.8.0",
124
- "history": "^5.3.0",
125
- "jest": "^29.7.0",
126
- "jest-environment-jsdom": "^29.7.0",
127
- "jest-styled-components": "^7.2.0",
128
- "jest-svg-transformer": "^1.0.0",
129
- "react-router": "^6.0.0",
130
- "react-share": "^5.1.0",
131
- "regenerator-runtime": "^0.13.9",
132
- "storybook": "^8.1.3",
133
- "storybook-addon-themes": "^6.1.0",
134
- "style-loader": "^4.0.0",
135
- "ts-jest": "^29.2.5",
136
- "webpack": "^5.99.9",
137
- "webpack-cli": "^6.0.1",
138
- "webpack-dev-server": "^5.2.1"
139
- },
140
- "peerDependencies": {
141
- "@babel/core": "^7.0.0",
142
- "react": "^19",
143
- "react-dom": "^19"
144
- },
145
- "resolutions": {
146
- "nwsapi": "2.2.9",
147
- "date-fns": "2.24.0",
148
- "@types/react": "19.1.2"
149
- }
2
+ "name": "@laerdal/life-react-components",
3
+ "version": "6.1.2-dev.1.full",
4
+ "private": false,
5
+ "author": "Erik Martirosyan \u003cerik.martirosyan@laerdal.com\u003e",
6
+ "contributors": [
7
+
8
+ ],
9
+ "description": "Laerdal LIFE component library for React.",
10
+ "keywords": [
11
+
12
+ ],
13
+ "license": "UNLICENSED",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/Laerdal-Medical/dcs-life-react-js"
17
+ },
18
+ "main": "dist/index.cjs",
19
+ "module": "dist/index.js",
20
+ "types": "dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "require": "./dist/index.cjs",
24
+ "import": "./dist/index.js",
25
+ "types": "./dist/index.d.ts"
26
+ }
27
+ },
28
+ "sideEffects": false,
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "scripts": {
33
+ "bump": "yarn version --patch",
34
+ "build": "yarn extract-design-tokens \u0026\u0026 yarn build:babel:esm \u0026\u0026 yarn build:babel:cjs \u0026\u0026 tsc --emitDeclarationOnly --declaration --declarationDir dist \u0026\u0026 node scripts/copyTS.cjs",
35
+ "extract-design-tokens": "node scripts/extractDesignTokens.js",
36
+ "build:babel:esm": "cross-env BABEL_ENV=esm babel --source-maps --extensions \".js,.ts,.tsx\" src --out-dir dist --out-file-extension .js --copy-files",
37
+ "build:babel:cjs": "cross-env BABEL_ENV=cjs babel --source-maps --extensions \".js,.ts,.tsx\" src --out-dir dist --out-file-extension .cjs --copy-files",
38
+ "clean": "rimraf dist",
39
+ "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose",
40
+ "test": "jest src/",
41
+ "test:coverage": "jest --collectCoverage src/",
42
+ "test-watch": "jest --watch",
43
+ "storybook": "storybook dev -p 6006",
44
+ "build-storybook": "storybook build"
45
+ },
46
+ "eslintConfig": {
47
+ "extends": [
48
+ "react-app",
49
+ "plugin:storybook/recommended"
50
+ ]
51
+ },
52
+ "browserslist": {
53
+ "production": [
54
+ "\u003e0.2%",
55
+ "not dead",
56
+ "not op_mini all"
57
+ ],
58
+ "development": [
59
+ "last 1 chrome version",
60
+ "last 1 firefox version",
61
+ "last 1 safari version"
62
+ ]
63
+ },
64
+ "omlet": {
65
+ "exports": {
66
+ ".": "src/index.ts"
67
+ }
68
+ },
69
+ "dependencies": {
70
+ "@babel/plugin-transform-typescript": "^7.28.0",
71
+ "@laerdal/figma-svg": "^5.2.2",
72
+ "@types/node": "^18.0.6",
73
+ "animated-scroll-to": "^2.3.0",
74
+ "dayjs": "^1.11.5",
75
+ "nanoid": "3.3.11",
76
+ "react": "^19.0.0",
77
+ "react-datepicker": "^8.4.0",
78
+ "react-dom": "^19.0.0",
79
+ "react-inlinesvg": "^4.2.0",
80
+ "react-modal": "^3.16.0",
81
+ "react-quill-new": "^3.6.0",
82
+ "react-resize-detector": "^12.0.0",
83
+ "rooks": "8.4.0",
84
+ "styled-components": "^6.1.13",
85
+ "typescript": "^5.1.2"
86
+ },
87
+ "devDependencies": {
88
+ "@babel/cli": "^7.22.0",
89
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
90
+ "@babel/plugin-proposal-decorators": "^7.27.1",
91
+ "@babel/plugin-proposal-export-default-from": "^7.22.0",
92
+ "@babel/plugin-proposal-numeric-separator": "^7.18.6",
93
+ "@babel/plugin-proposal-object-rest-spread": "^7.18.6",
94
+ "@babel/plugin-transform-runtime": "^7.22.0",
95
+ "@babel/preset-env": "^7.22.0",
96
+ "@babel/preset-react": "^7.22.0",
97
+ "@babel/preset-typescript": "^7.27.0",
98
+ "@babel/runtime": "^7.22.0",
99
+ "@chromatic-com/storybook": "1.4.0",
100
+ "@laerdal-medical/life-design-tokens": "^1.5.1-beta",
101
+ "@laerdal/life-react-components": "5.1.0",
102
+ "@laerdal/navigation": "^3.2.0",
103
+ "@storybook/addon-essentials": "^8.1.3",
104
+ "@storybook/addon-interactions": "^8.1.3",
105
+ "@storybook/addon-links": "^8.1.3",
106
+ "@storybook/addon-onboarding": "^8.1.3",
107
+ "@storybook/addon-webpack5-compiler-swc": "1.0.2",
108
+ "@storybook/addons": "^7.6.17",
109
+ "@storybook/blocks": "^8.1.3",
110
+ "@storybook/react": "^8.1.3",
111
+ "@storybook/react-webpack5": "^8.1.3",
112
+ "@storybook/test": "^8.1.3",
113
+ "@testing-library/dom": "^10.4.0",
114
+ "@testing-library/jest-dom": "^6.5.0",
115
+ "@testing-library/react": "^16.0.1",
116
+ "@testing-library/user-event": "^14.5.2",
117
+ "@types/jest": "^29.5.12",
118
+ "@types/react": "^19.1.2",
119
+ "@types/react-datepicker": "^4.4.2",
120
+ "@types/react-dom": "^18.3.0",
121
+ "@types/react-modal": "^3.13.1",
122
+ "babel-plugin-inline-react-svg": "^2.0.1",
123
+ "babel-plugin-typescript-to-proptypes": "^2.0.0",
124
+ "concurrently": "^5.2.0",
125
+ "cross-env": "^7.0.3",
126
+ "css-loader": "^7.1.2",
127
+ "eslint-plugin-storybook": "^0.8.0",
128
+ "history": "^5.3.0",
129
+ "jest": "^29.7.0",
130
+ "jest-environment-jsdom": "^29.7.0",
131
+ "jest-styled-components": "^7.2.0",
132
+ "jest-svg-transformer": "^1.0.0",
133
+ "react-router": "^6.0.0",
134
+ "react-share": "^5.1.0",
135
+ "regenerator-runtime": "^0.13.9",
136
+ "storybook": "^8.1.3",
137
+ "storybook-addon-themes": "^6.1.0",
138
+ "style-loader": "^4.0.0",
139
+ "ts-jest": "^29.2.5",
140
+ "webpack": "^5.99.9",
141
+ "webpack-cli": "^6.0.1",
142
+ "webpack-dev-server": "^5.2.1"
143
+ },
144
+ "peerDependencies": {
145
+ "@babel/core": "^7.0.0",
146
+ "react": "^19",
147
+ "react-dom": "^19"
148
+ },
149
+ "resolutions": {
150
+ "nwsapi": "2.2.9",
151
+ "date-fns": "2.24.0",
152
+ "@types/react": "19.1.2"
153
+ }
150
154
  }