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

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.
@@ -18,7 +18,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
19
  const PopoverContainer = exports.PopoverContainer = _styledComponents.default.div`
20
20
  //height: ${props => props.$size === _types.Size.Small ? '240px' : props.$size === _types.Size.Large ? '480px' : '360px'};
21
- min-width: ${props => props.$size === _types.Size.Small ? '320px' : props.$size === _types.Size.Large ? '640px' : '480px'};
21
+ ${props => props.$size && `min-width: ${props.$size === _types.Size.Small ? '320px' : props.$size === _types.Size.Large ? '640px' : '480px'};`}
22
+ width: ${props => !props.$size ? 'fit-content' : 'auto'};
22
23
  border-radius: 4px;
23
24
  background: ${props => _.COLORS.generateToken({
24
25
  componentType: 'bg-surface',
@@ -42,18 +43,19 @@ const PopoverContainer = exports.PopoverContainer = _styledComponents.default.di
42
43
  ${props => props.$showArrowPointer ? renderArrowStyles(props.$position) : ''}
43
44
  `;
44
45
  const PopoverTopSectionContainer = exports.PopoverTopSectionContainer = _styledComponents.default.div`
45
- height: ${props => props.$size === _types.Size.Small ? '56px' : props.$size === _types.Size.Large ? '72px' : '64px'};
46
+ ${props => props.$size && `height: ${props.$size === _types.Size.Small ? '56px' : props.$size === _types.Size.Large ? '72px' : '64px'};`}
46
47
  display: flex;
47
48
  `;
48
49
  const PopoverMiddleSectionContainer = exports.PopoverMiddleSectionContainer = _styledComponents.default.div`
49
50
  margin: 8px;
50
- height: ${props => props.$size === _types.Size.Small ? '104px' : props.$size === _types.Size.Large ? '304px' : '208px'};
51
- padding: ${props => props.$size === _types.Size.Small ? '0 8px' : props.$size === _types.Size.Large ? '0 16px' : '0 12px'};
52
- overflow-y: auto;
53
- ${(0, _styles.scrollBarStyling)(_types.Size.Small)}
51
+ ${props => props.$size && `height: ${props.$size === _types.Size.Small ? '104px' : props.$size === _types.Size.Large ? '304px' : '208px'};`}
52
+ ${props => props.$size && `padding: ${props.$size === _types.Size.Small ? '0 8px' : props.$size === _types.Size.Large ? '0 16px' : '0 12px'};`}
53
+ ${props => !props.$size && `padding: 8px;`}
54
+ ${props => props.$size && 'overflow-y: auto;'}
55
+ ${props => props.$size && (0, _styles.scrollBarStyling)(_types.Size.Small)}
54
56
  `;
55
57
  const PopoverBottomSectionContainer = exports.PopoverBottomSectionContainer = _styledComponents.default.div`
56
- height: ${props => props.$size === _types.Size.Small ? '64px' : props.$size === _types.Size.Large ? '88px' : '72px'};
58
+ ${props => props.$size && `height: ${props.$size === _types.Size.Small ? '64px' : props.$size === _types.Size.Large ? '88px' : '72px'};`}
57
59
  display: flex;
58
60
 
59
61
  .bottom-flex {
@@ -67,11 +69,15 @@ const TextContainer = _styledComponents.default.div`
67
69
  componentType: 'text',
68
70
  defaultVariant: 'default'
69
71
  }, props.theme)};
70
- margin: ${props => renderMargins(props.$note, props.$size)};
72
+ ${props => props.$size && `margin: ${renderMargins(props.$note, props.$size)};`}
73
+ ${props => !props.$size && `margin: 8px;`}
71
74
  flex-grow: 1;
72
75
  `;
73
76
  const NoteContainer = _styledComponents.default.div`
74
- ${props => props.$size === _types.Size.Small ? (0, _styles.ComponentXXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.generateToken({
77
+ ${props => !props.$size ? (0, _.ComponentXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.generateToken({
78
+ componentType: 'text',
79
+ defaultVariant: 'subtle'
80
+ }, props.theme)) : props.$size === _types.Size.Small ? (0, _styles.ComponentXXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.generateToken({
75
81
  componentType: 'text',
76
82
  defaultVariant: 'subtle'
77
83
  }, props.theme)) : props.$size === _types.Size.Large ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Regular, _.COLORS.generateToken({
@@ -83,16 +89,19 @@ const NoteContainer = _styledComponents.default.div`
83
89
  }, props.theme))}
84
90
  `;
85
91
  const LabelContainer = _styledComponents.default.div`
86
- ${props => props.$size === _types.Size.Small ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Bold, null) : props.$size === _types.Size.Large ? (0, _styles.ComponentLStyling)(_.ComponentTextStyle.Bold, null) : (0, _styles.ComponentMStyling)(_.ComponentTextStyle.Bold, null)}
92
+ ${props => !props.$size ? (0, _styles.ComponentMStyling)(_.ComponentTextStyle.Bold, null) : props.$size === _types.Size.Small ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Bold, null) : props.$size === _types.Size.Large ? (0, _styles.ComponentLStyling)(_.ComponentTextStyle.Bold, null) : (0, _styles.ComponentMStyling)(_.ComponentTextStyle.Bold, null)}
87
93
  `;
88
94
  const CloseButtonContainer = _styledComponents.default.div`
89
- margin: ${props => props.$size === _types.Size.Small ? '4px 16px 4px 0' : props.$size === _types.Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};
95
+ ${props => props.$size && `margin: ${props.$size === _types.Size.Small ? '4px 16px 4px 0' : props.$size === _types.Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};`}
96
+ ${props => !props.$size && `margin: 8px;`}
90
97
  `;
91
98
  const TextButtonContainer = _styledComponents.default.div`
92
- margin: ${props => props.$size === _types.Size.Small ? '8px 0 8px 16px' : props.$size === _types.Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};
99
+ ${props => props.$size && `margin: ${props.$size === _types.Size.Small ? '8px 0 8px 16px' : props.$size === _types.Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};`}
100
+ ${props => !props.$size && `margin: 8px;`}
93
101
  `;
94
102
  const IconButtonContainer = _styledComponents.default.div`
95
- margin: ${props => props.$size === _types.Size.Small ? '8px 16px 8px 0' : props.$size === _types.Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};
103
+ ${props => props.$size && `margin: ${props.$size === _types.Size.Small ? '8px 16px 8px 0' : props.$size === _types.Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};`}
104
+ ${props => !props.$size && `margin: 8px;`}
96
105
  display: flex;
97
106
  `;
98
107
  const PopoverWrapper = exports.PopoverWrapper = _styledComponents.default.div`
@@ -122,6 +131,9 @@ const PopoverWrapper = exports.PopoverWrapper = _styledComponents.default.div`
122
131
  }`}
123
132
  `;
124
133
  const renderMargins = (isNotePresent, size) => {
134
+ if (!size) {
135
+ return isNotePresent ? '8px' : '12px 8px';
136
+ }
125
137
  if (isNotePresent) {
126
138
  return size === _types.Size.Small ? '10px 16px' : size === _types.Size.Large ? '14px 24px' : '12px 20px';
127
139
  } else {
@@ -184,7 +196,7 @@ const renderArrowStyles = position => {
184
196
  ;
185
197
  const Popover = _ref => {
186
198
  let {
187
- size = _types.Size.Medium,
199
+ size,
188
200
  topSectionProps,
189
201
  bottomSectionProps,
190
202
  mainContent,
@@ -196,9 +208,10 @@ const Popover = _ref => {
196
208
  const [showPopover, setShowPopover] = React.useState(false);
197
209
  const theme = (0, _styledComponents.useTheme)();
198
210
  const popoverRef = React.useRef(null);
211
+ const wrapperRef = React.useRef(null);
199
212
  React.useEffect(() => {
200
213
  const checkIfClickedOutside = e => {
201
- if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {
214
+ if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target) && wrapperRef.current && !wrapperRef.current.contains(e.target)) {
202
215
  setShowPopover(false);
203
216
  }
204
217
  };
@@ -207,6 +220,12 @@ const Popover = _ref => {
207
220
  document.removeEventListener('mousedown', checkIfClickedOutside);
208
221
  };
209
222
  }, [showPopover]);
223
+ const handleWrapperClick = e => {
224
+ if (showOnClick) {
225
+ e.stopPropagation();
226
+ setShowPopover(!showPopover);
227
+ }
228
+ };
210
229
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PopoverWrapper, {
211
230
  $position: position,
212
231
  $showOnClick: showOnClick,
@@ -273,7 +292,8 @@ const Popover = _ref => {
273
292
  })]
274
293
  })]
275
294
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
276
- onClick: () => showOnClick && setShowPopover(!showPopover),
295
+ ref: wrapperRef,
296
+ onClick: handleWrapperClick,
277
297
  children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
278
298
  className: "pointer-space"
279
299
  })]
@@ -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","ComponentXXSStyling","ComponentTextStyle","Regular","ComponentSStyling","ComponentXSStyling","LabelContainer","Bold","ComponentLStyling","ComponentMStyling","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","Medium","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","useTheme","popoverRef","useRef","useEffect","checkIfClickedOutside","current","contains","target","document","addEventListener","removeEventListener","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 min-width: ${(props) => (props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px')};\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 height: ${(props) => (props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size: Size }>`\r\n height: ${(props) => (props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n margin: ${(props) => renderMargins(props.$note, props.$size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size: Size }>`\r\n ${(props) =>\r\n props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.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 === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(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)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \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 onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,CAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA0C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,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,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,w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,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,CAAAhH,OAAA,CAAAqH,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,CAAAhH,OAAA,CAAAiH;IAAA;IAaLX,UAAU,EAAAU,UAAA,CAAAhH,OAAA,CAAAmG,KAAA;MAvBVI,IAAI,EAAAS,UAAA,CAAAhH,OAAA,CAAAoH,IAAA,CAAAF,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,CAAAhH,OAAA,CAAAqH,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,CAAAhH,OAAA,CAAAiH;IAAA;EAAA;EAoCL1C,WAAW,EAAAyC,UAAA,CAAAhH,OAAA,CAAAoH,IAAA,CAAAF,UAAA;EAKX1C,QAAQ,EAAAwC,UAAA,CAAAhH,OAAA,CAAAoH,IAAA,CAAAF,UAAA;EAWRzC,WAAW,EAAAuC,UAAA,CAAAhH,OAAA,CAAAsH,IAAA,CAAAJ,UAAA;EAMXxC,gBAAgB,EAAAsC,UAAA,CAAAhH,OAAA,CAAAsH;AAAA;AAAA,IAAAC,QAAA,GAAAxG,OAAA,CAAAf,OAAA,GAsFHkE,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\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=\"point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AAlH,OAAA,CAAAuH,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,CAAAlH,OAAA,CAAAmH;IAAA;IAaLX,UAAU,EAAAU,UAAA,CAAAlH,OAAA,CAAAqG,KAAA;MAvBVI,IAAI,EAAAS,UAAA,CAAAlH,OAAA,CAAAsH,IAAA,CAAAF,UAAA;MAKJnB,MAAM,EAAAiB,UAAA,CAAAlH,OAAA,CAAAuH,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,UAAA,CAAAlH,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,18 +1,18 @@
1
1
  import * as React from 'react';
2
2
  import { Position, Size } from '../types';
3
3
  export declare const PopoverContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $size: Size;
4
+ $size?: Size;
5
5
  $position: Position;
6
6
  $showArrowPointer: boolean;
7
7
  }>> & string;
8
8
  export declare const PopoverTopSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
9
- $size: Size;
9
+ $size?: Size;
10
10
  }>> & string;
11
11
  export declare const PopoverMiddleSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
12
- $size: Size;
12
+ $size?: Size;
13
13
  }>> & string;
14
14
  export declare const PopoverBottomSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
15
- $size: Size;
15
+ $size?: Size;
16
16
  }>> & string;
17
17
  export declare const PopoverWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
18
18
  $position: Position;
@@ -9,7 +9,8 @@ import { Position, Size } from '../types';
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  export const PopoverContainer = styled.div`
11
11
  //height: ${props => props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px'};
12
- min-width: ${props => props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px'};
12
+ ${props => props.$size && `min-width: ${props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px'};`}
13
+ width: ${props => !props.$size ? 'fit-content' : 'auto'};
13
14
  border-radius: 4px;
14
15
  background: ${props => COLORS.generateToken({
15
16
  componentType: 'bg-surface',
@@ -33,18 +34,19 @@ export const PopoverContainer = styled.div`
33
34
  ${props => props.$showArrowPointer ? renderArrowStyles(props.$position) : ''}
34
35
  `;
35
36
  export const PopoverTopSectionContainer = styled.div`
36
- height: ${props => props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};
37
+ ${props => props.$size && `height: ${props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px'};`}
37
38
  display: flex;
38
39
  `;
39
40
  export const PopoverMiddleSectionContainer = styled.div`
40
41
  margin: 8px;
41
- height: ${props => props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px'};
42
- padding: ${props => props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px'};
43
- overflow-y: auto;
44
- ${scrollBarStyling(Size.Small)}
42
+ ${props => props.$size && `height: ${props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px'};`}
43
+ ${props => props.$size && `padding: ${props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px'};`}
44
+ ${props => !props.$size && `padding: 8px;`}
45
+ ${props => props.$size && 'overflow-y: auto;'}
46
+ ${props => props.$size && scrollBarStyling(Size.Small)}
45
47
  `;
46
48
  export const PopoverBottomSectionContainer = styled.div`
47
- height: ${props => props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px'};
49
+ ${props => props.$size && `height: ${props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px'};`}
48
50
  display: flex;
49
51
 
50
52
  .bottom-flex {
@@ -58,11 +60,15 @@ const TextContainer = styled.div`
58
60
  componentType: 'text',
59
61
  defaultVariant: 'default'
60
62
  }, props.theme)};
61
- margin: ${props => renderMargins(props.$note, props.$size)};
63
+ ${props => props.$size && `margin: ${renderMargins(props.$note, props.$size)};`}
64
+ ${props => !props.$size && `margin: 8px;`}
62
65
  flex-grow: 1;
63
66
  `;
64
67
  const NoteContainer = styled.div`
65
- ${props => props.$size === Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({
68
+ ${props => !props.$size ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({
69
+ componentType: 'text',
70
+ defaultVariant: 'subtle'
71
+ }, props.theme)) : props.$size === Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({
66
72
  componentType: 'text',
67
73
  defaultVariant: 'subtle'
68
74
  }, props.theme)) : props.$size === Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({
@@ -74,16 +80,19 @@ const NoteContainer = styled.div`
74
80
  }, props.theme))}
75
81
  `;
76
82
  const LabelContainer = styled.div`
77
- ${props => props.$size === Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : props.$size === Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null)}
83
+ ${props => !props.$size ? ComponentMStyling(ComponentTextStyle.Bold, null) : props.$size === Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : props.$size === Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null)}
78
84
  `;
79
85
  const CloseButtonContainer = styled.div`
80
- margin: ${props => props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};
86
+ ${props => props.$size && `margin: ${props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0'};`}
87
+ ${props => !props.$size && `margin: 8px;`}
81
88
  `;
82
89
  const TextButtonContainer = styled.div`
83
- margin: ${props => props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};
90
+ ${props => props.$size && `margin: ${props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px'};`}
91
+ ${props => !props.$size && `margin: 8px;`}
84
92
  `;
85
93
  const IconButtonContainer = styled.div`
86
- margin: ${props => props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};
94
+ ${props => props.$size && `margin: ${props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0'};`}
95
+ ${props => !props.$size && `margin: 8px;`}
87
96
  display: flex;
88
97
  `;
89
98
  export const PopoverWrapper = styled.div`
@@ -113,6 +122,9 @@ export const PopoverWrapper = styled.div`
113
122
  }`}
114
123
  `;
115
124
  const renderMargins = (isNotePresent, size) => {
125
+ if (!size) {
126
+ return isNotePresent ? '8px' : '12px 8px';
127
+ }
116
128
  if (isNotePresent) {
117
129
  return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';
118
130
  } else {
@@ -175,7 +187,7 @@ const renderArrowStyles = position => {
175
187
  ;
176
188
  const Popover = _ref => {
177
189
  let {
178
- size = Size.Medium,
190
+ size,
179
191
  topSectionProps,
180
192
  bottomSectionProps,
181
193
  mainContent,
@@ -187,9 +199,10 @@ const Popover = _ref => {
187
199
  const [showPopover, setShowPopover] = React.useState(false);
188
200
  const theme = useTheme();
189
201
  const popoverRef = React.useRef(null);
202
+ const wrapperRef = React.useRef(null);
190
203
  React.useEffect(() => {
191
204
  const checkIfClickedOutside = e => {
192
- if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {
205
+ if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target) && wrapperRef.current && !wrapperRef.current.contains(e.target)) {
193
206
  setShowPopover(false);
194
207
  }
195
208
  };
@@ -198,6 +211,12 @@ const Popover = _ref => {
198
211
  document.removeEventListener('mousedown', checkIfClickedOutside);
199
212
  };
200
213
  }, [showPopover]);
214
+ const handleWrapperClick = e => {
215
+ if (showOnClick) {
216
+ e.stopPropagation();
217
+ setShowPopover(!showPopover);
218
+ }
219
+ };
201
220
  return /*#__PURE__*/_jsxs(PopoverWrapper, {
202
221
  $position: position,
203
222
  $showOnClick: showOnClick,
@@ -264,7 +283,8 @@ const Popover = _ref => {
264
283
  })]
265
284
  })]
266
285
  }), /*#__PURE__*/_jsxs("div", {
267
- onClick: () => showOnClick && setShowPopover(!showPopover),
286
+ ref: wrapperRef,
287
+ onClick: handleWrapperClick,
268
288
  children: [children, /*#__PURE__*/_jsx("div", {
269
289
  className: "pointer-space"
270
290
  })]
@@ -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","Medium","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","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 min-width: ${(props) => (props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px')};\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 height: ${(props) => (props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size: Size }>`\r\n height: ${(props) => (props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n margin: ${(props) => renderMargins(props.$note, props.$size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size: Size }>`\r\n ${(props) =>\r\n props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.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 === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(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)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \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 onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";AAAA,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,IAAA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BO,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;EAoCLrC,WAAW,EAAAoC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAKXrC,QAAQ,EAAAmC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAWRpC,WAAW,EAAAkC,GAAA,CAAAM,IAAA,CAAAJ,UAAA;EAMXnC,gBAAgB,EAAAiC,GAAA,CAAAM;AAAA;AAsFlB,eAAe/C,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\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,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
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
- }
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
+ }
154
150
  }