@laerdal/life-react-components 1.9.8-dev.9.full → 1.9.9-dev.10

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.
Files changed (150) hide show
  1. package/dist/Accordion/ContentAccordion.cjs +5 -5
  2. package/dist/Accordion/ContentAccordion.cjs.map +1 -1
  3. package/dist/Accordion/ContentAccordion.js +6 -6
  4. package/dist/Accordion/ContentAccordion.js.map +1 -1
  5. package/dist/Accordion/styles.cjs +1 -1
  6. package/dist/Accordion/styles.cjs.map +1 -1
  7. package/dist/Accordion/styles.js +1 -1
  8. package/dist/Accordion/styles.js.map +1 -1
  9. package/dist/Breadcrumb/Breadcrumb.cjs +10 -46
  10. package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
  11. package/dist/Breadcrumb/Breadcrumb.js +8 -43
  12. package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
  13. package/dist/Breadcrumb/styles.cjs +55 -0
  14. package/dist/Breadcrumb/styles.cjs.map +1 -0
  15. package/dist/Breadcrumb/styles.d.ts +7 -0
  16. package/dist/Breadcrumb/styles.js +39 -0
  17. package/dist/Breadcrumb/styles.js.map +1 -0
  18. package/dist/Button/Button.cjs +3 -3
  19. package/dist/Button/Button.cjs.map +1 -1
  20. package/dist/Button/Button.js +3 -3
  21. package/dist/Button/Button.js.map +1 -1
  22. package/dist/Button/DualFunctionButton.cjs +1 -0
  23. package/dist/Button/DualFunctionButton.cjs.map +1 -1
  24. package/dist/Button/DualFunctionButton.js +1 -0
  25. package/dist/Button/DualFunctionButton.js.map +1 -1
  26. package/dist/Button/Iconbutton.cjs +2 -1
  27. package/dist/Button/Iconbutton.cjs.map +1 -1
  28. package/dist/Button/Iconbutton.d.ts +1 -0
  29. package/dist/Button/Iconbutton.js +1 -1
  30. package/dist/Button/Iconbutton.js.map +1 -1
  31. package/dist/Card/HorizontalCard/HorizontalCard.cjs +1 -1
  32. package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
  33. package/dist/Card/HorizontalCard/HorizontalCard.js +1 -1
  34. package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
  35. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +1 -1
  36. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
  37. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +1 -1
  38. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
  39. package/dist/Card/VerticalCard/Card.cjs +1 -0
  40. package/dist/Card/VerticalCard/Card.cjs.map +1 -1
  41. package/dist/Card/VerticalCard/Card.js +1 -0
  42. package/dist/Card/VerticalCard/Card.js.map +1 -1
  43. package/dist/Card/VerticalCard/CardBottomSection.cjs +2 -0
  44. package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -1
  45. package/dist/Card/VerticalCard/CardBottomSection.js +2 -0
  46. package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -1
  47. package/dist/Card/VerticalCard/CardMiddleSection.cjs +1 -0
  48. package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -1
  49. package/dist/Card/VerticalCard/CardMiddleSection.js +1 -0
  50. package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -1
  51. package/dist/Card/VerticalCard/CardTopSection.cjs +3 -0
  52. package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -1
  53. package/dist/Card/VerticalCard/CardTopSection.js +3 -0
  54. package/dist/Card/VerticalCard/CardTopSection.js.map +1 -1
  55. package/dist/ChipsInput/ChipInputField.cjs +2 -0
  56. package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
  57. package/dist/ChipsInput/ChipInputField.js +2 -0
  58. package/dist/ChipsInput/ChipInputField.js.map +1 -1
  59. package/dist/Dropdown/DropdownFilter.cjs +1 -1
  60. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  61. package/dist/Dropdown/DropdownFilter.js +1 -1
  62. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  63. package/dist/Footer/Components/FooterNavSection.cjs +1 -0
  64. package/dist/Footer/Components/FooterNavSection.cjs.map +1 -1
  65. package/dist/Footer/Components/FooterNavSection.js +1 -0
  66. package/dist/Footer/Components/FooterNavSection.js.map +1 -1
  67. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +1 -0
  68. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
  69. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +1 -0
  70. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
  71. package/dist/Footer/Components/FooterTop.cjs +1 -0
  72. package/dist/Footer/Components/FooterTop.cjs.map +1 -1
  73. package/dist/Footer/Components/FooterTop.js +1 -0
  74. package/dist/Footer/Components/FooterTop.js.map +1 -1
  75. package/dist/Footer/Footer.cjs +3 -1
  76. package/dist/Footer/Footer.cjs.map +1 -1
  77. package/dist/Footer/Footer.js +3 -1
  78. package/dist/Footer/Footer.js.map +1 -1
  79. package/dist/Footer/SiteFooter.cjs +1 -0
  80. package/dist/Footer/SiteFooter.cjs.map +1 -1
  81. package/dist/Footer/SiteFooter.js +1 -0
  82. package/dist/Footer/SiteFooter.js.map +1 -1
  83. package/dist/GlobalNavigationBar/__tests__/GlobalNavigationBar.tests.d.ts +1 -0
  84. package/dist/GlobalNavigationBar/__tests__/Logo.tests.d.ts +1 -0
  85. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -1
  86. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -1
  87. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +5 -1
  88. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -1
  89. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.d.ts +2 -0
  90. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +2 -2
  91. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -1
  92. package/dist/MenuItem/MenuItem.cjs +5 -3
  93. package/dist/MenuItem/MenuItem.cjs.map +1 -1
  94. package/dist/MenuItem/MenuItem.js +5 -3
  95. package/dist/MenuItem/MenuItem.js.map +1 -1
  96. package/dist/Popover/Popover.cjs +40 -26
  97. package/dist/Popover/Popover.cjs.map +1 -1
  98. package/dist/Popover/Popover.d.ts +1 -0
  99. package/dist/Popover/Popover.js +40 -26
  100. package/dist/Popover/Popover.js.map +1 -1
  101. package/dist/ProfileButton/ProfileButton.cjs +5 -3
  102. package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
  103. package/dist/ProfileButton/ProfileButton.d.ts +3 -0
  104. package/dist/ProfileButton/ProfileButton.js +2 -2
  105. package/dist/ProfileButton/ProfileButton.js.map +1 -1
  106. package/dist/SideMenu/SideMenu.cjs +49 -0
  107. package/dist/SideMenu/SideMenu.cjs.map +1 -0
  108. package/dist/SideMenu/SideMenu.d.ts +4 -0
  109. package/dist/SideMenu/SideMenu.js +31 -0
  110. package/dist/SideMenu/SideMenu.js.map +1 -0
  111. package/dist/SideMenu/SideMenuBody.cjs +64 -0
  112. package/dist/SideMenu/SideMenuBody.cjs.map +1 -0
  113. package/dist/SideMenu/SideMenuBody.d.ts +2 -0
  114. package/dist/SideMenu/SideMenuBody.js +43 -0
  115. package/dist/SideMenu/SideMenuBody.js.map +1 -0
  116. package/dist/SideMenu/SideMenuFooter.cjs +74 -0
  117. package/dist/SideMenu/SideMenuFooter.cjs.map +1 -0
  118. package/dist/SideMenu/SideMenuFooter.d.ts +2 -0
  119. package/dist/SideMenu/SideMenuFooter.js +51 -0
  120. package/dist/SideMenu/SideMenuFooter.js.map +1 -0
  121. package/dist/SideMenu/SideMenuHeader.cjs +68 -0
  122. package/dist/SideMenu/SideMenuHeader.cjs.map +1 -0
  123. package/dist/SideMenu/SideMenuHeader.d.ts +2 -0
  124. package/dist/SideMenu/SideMenuHeader.js +48 -0
  125. package/dist/SideMenu/SideMenuHeader.js.map +1 -0
  126. package/dist/SideMenu/index.cjs +33 -0
  127. package/dist/SideMenu/index.cjs.map +1 -0
  128. package/dist/SideMenu/index.d.ts +2 -0
  129. package/dist/SideMenu/index.js +3 -0
  130. package/dist/SideMenu/index.js.map +1 -0
  131. package/dist/SideMenu/types.cjs +6 -0
  132. package/dist/SideMenu/types.cjs.map +1 -0
  133. package/dist/SideMenu/types.d.ts +27 -0
  134. package/dist/SideMenu/types.js +2 -0
  135. package/dist/SideMenu/types.js.map +1 -0
  136. package/dist/Toggles/ToggleButton.cjs +2 -0
  137. package/dist/Toggles/ToggleButton.cjs.map +1 -1
  138. package/dist/Toggles/ToggleButton.d.ts +1 -0
  139. package/dist/Toggles/ToggleButton.js +2 -0
  140. package/dist/Toggles/ToggleButton.js.map +1 -1
  141. package/dist/Toggles/ToggleSwitch.cjs +1 -0
  142. package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
  143. package/dist/Toggles/ToggleSwitch.js +1 -0
  144. package/dist/Toggles/ToggleSwitch.js.map +1 -1
  145. package/dist/index.cjs +14 -0
  146. package/dist/index.cjs.map +1 -1
  147. package/dist/index.d.ts +1 -0
  148. package/dist/index.js +1 -0
  149. package/dist/index.js.map +1 -1
  150. package/package.json +2 -1
@@ -37,47 +37,39 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
37
37
 
38
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
39
 
40
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n border-radius: 4px;\n background: ", ";\n cursor: default;\n box-shadow: ", ";\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n"])), function (props) {
40
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n //height: ", ";\n min-width: ", ";\n border-radius: 4px;\n background: ", ";\n cursor: default;\n box-shadow: ", ";\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n\n &::after {\n ", "\n"])), function (props) {
41
41
  return props.size === _types.Size.Small ? '240px' : props.size === _types.Size.Large ? '480px' : '360px';
42
42
  }, function (props) {
43
- return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
43
+ return props.size === _types.Size.Small ? '320px' : props.size === _types.Size.Large ? '640px' : '480px';
44
44
  }, _.COLORS.white, _styles.BOXSHADOWS.BOXSHADOW_CENTERED, _styles.Z_INDEXES.popover, function (props) {
45
- return props.position == _types.Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '';
46
- }, function (props) {
47
- return props.position == _types.Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '';
45
+ return props.position == _types.Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '';
48
46
  }, function (props) {
49
- return props.position == _types.Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '';
47
+ return props.position == _types.Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '';
50
48
  }, function (props) {
51
- return props.position == _types.Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '';
52
- }, _.COLORS.white, function (props) {
53
- return props.position == _types.Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '';
49
+ return props.position == _types.Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '';
54
50
  }, function (props) {
55
- return props.position == _types.Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '';
51
+ return props.position == _types.Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '';
56
52
  }, function (props) {
57
- return props.position == _types.Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '';
58
- }, function (props) {
59
- return props.position == _types.Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '';
53
+ return props.showArrowPointer ? renderArrowStyles(props.position) : '';
60
54
  });
61
55
 
62
- var TopContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
56
+ var TopContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n max-width: ", ";\n display: flex;\n"])), function (props) {
63
57
  return props.size === _types.Size.Small ? '56px' : props.size === _types.Size.Large ? '72px' : '64px';
64
58
  }, function (props) {
65
59
  return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
66
60
  });
67
61
 
68
- var MainContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", ";\n"])), function (props) {
69
- return props.size === _types.Size.Small ? '8px 0 8px 16px' : props.size === _types.Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px';
70
- });
62
+ var MainContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin: 8px;\n"])));
71
63
 
72
- var MiddleContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n padding-right: ", ";\n overflow-y: auto;\n ", "\n"])), function (props) {
64
+ var MiddleContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n max-width: ", ";\n padding: ", ";\n overflow-y: auto;\n ", "\n"])), function (props) {
73
65
  return props.size === _types.Size.Small ? '104px' : props.size === _types.Size.Large ? '304px' : '208px';
74
66
  }, function (props) {
75
67
  return props.size === _types.Size.Small ? '312px' : props.size === _types.Size.Large ? '576px' : '424px';
76
68
  }, function (props) {
77
- return props.size === _types.Size.Small ? '6px' : props.size === _types.Size.Large ? '14px' : '10px';
69
+ return props.size === _types.Size.Small ? '0 8px' : props.size === _types.Size.Large ? '0 16px' : '0 12px';
78
70
  }, (0, _styles.scrollBarStyling)(_types.Size.Small));
79
71
 
80
- var BottomContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n"])), function (props) {
72
+ var BottomContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n max-width: ", ";\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n"])), function (props) {
81
73
  return props.size === _types.Size.Small ? '64px' : props.size === _types.Size.Large ? '88px' : '72px';
82
74
  }, function (props) {
83
75
  return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
@@ -108,9 +100,9 @@ var IconButtonContainer = _styledComponents.default.div(_templateObject11 || (_t
108
100
  });
109
101
 
110
102
  var Wrapper = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n\n .pointer-space {\n height: ", ";\n width: ", ";\n position: absolute;\n\n ", ";\n ", ";\n\n ", ";\n ", ";\n }\n\n ", "\n"])), function (props) {
111
- return props.position === _types.Position.Top || props.position === _types.Position.Bottom ? '8px' : '100%';
103
+ return props.position === _types.Position.Top || props.position === _types.Position.Bottom ? '16px' : '100%';
112
104
  }, function (props) {
113
- return props.position === _types.Position.Left || props.position === _types.Position.Right ? '8px' : '100%';
105
+ return props.position === _types.Position.Left || props.position === _types.Position.Right ? '16px' : '100%';
114
106
  }, function (props) {
115
107
  return props.position === _types.Position.Left ? 'right:100%; bottom: 0%' : '';
116
108
  }, function (props) {
@@ -131,6 +123,24 @@ var renderMargins = function renderMargins(isNotePresent, size) {
131
123
  }
132
124
  };
133
125
 
126
+ var renderArrowStyles = function renderArrowStyles(position) {
127
+ if (position === _types.Position.Bottom) {
128
+ return "height: 0px;\n width: 0px;\n border-top: 16px solid transparent;\n border-right: 12px solid transparent;\n border-bottom: 16px solid rgb(255,255,255);\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n bottom: calc(100% - 1px);";
129
+ }
130
+
131
+ if (position === _types.Position.Top) {
132
+ return "height: 0px;\n width: 0px;\n border-top: 16px solid rgb(255,255,255);\n border-right: 12px solid transparent;\n border-bottom: 16px solid transparent;\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n top: calc(100% - 1px);";
133
+ }
134
+
135
+ if (position === _types.Position.Left) {
136
+ return "height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 16px solid rgb(255,255,255);\n content: \"\";\n position: absolute;\n left: calc(100% - 1px);\n bottom: calc(50% - 12px);";
137
+ }
138
+
139
+ if (position === _types.Position.Right) {
140
+ return "height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid rgb(255,255,255);\n border-bottom: 12px solid transparent;\n border-left: 16px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(100% - 1px);\n bottom: calc(50% - 12px);";
141
+ }
142
+ };
143
+
134
144
  var Popover = function Popover(_ref) {
135
145
  var _bottomSectionProps$t, _bottomSectionProps$i;
136
146
 
@@ -142,7 +152,9 @@ var Popover = function Popover(_ref) {
142
152
  children = _ref.children,
143
153
  position = _ref.position,
144
154
  _ref$showOnClick = _ref.showOnClick,
145
- showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick;
155
+ showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick,
156
+ _ref$showArrowPointer = _ref.showArrowPointer,
157
+ showArrowPointer = _ref$showArrowPointer === void 0 ? false : _ref$showArrowPointer;
146
158
 
147
159
  var _React$useState = React.useState(false),
148
160
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
@@ -157,9 +169,9 @@ var Popover = function Popover(_ref) {
157
169
  }
158
170
  };
159
171
 
160
- document.addEventListener("mousedown", checkIfClickedOutside);
172
+ document.addEventListener('mousedown', checkIfClickedOutside);
161
173
  return function () {
162
- document.removeEventListener("mousedown", checkIfClickedOutside);
174
+ document.removeEventListener('mousedown', checkIfClickedOutside);
163
175
  };
164
176
  }, [showPopover]);
165
177
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
@@ -170,6 +182,7 @@ var Popover = function Popover(_ref) {
170
182
  size: size,
171
183
  position: position,
172
184
  ref: popoverRef,
185
+ showArrowPointer: showArrowPointer,
173
186
  children: [!!topSectionProps && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TopContainer, {
174
187
  size: size,
175
188
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TextContainer, {
@@ -260,7 +273,8 @@ Popover.propTypes = {
260
273
  }),
261
274
  mainContent: _propTypes.default.node.isRequired,
262
275
  children: _propTypes.default.node.isRequired,
263
- showOnClick: _propTypes.default.bool.isRequired
276
+ showOnClick: _propTypes.default.bool.isRequired,
277
+ showArrowPointer: _propTypes.default.bool
264
278
  };
265
279
  var _default = Popover;
266
280
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Popover/Popover.tsx"],"names":["Container","styled","div","props","size","Size","Small","Large","COLORS","white","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","position","Position","Bottom","Top","Left","Right","TopContainer","MainContentWrapper","MiddleContainer","BottomContainer","TextContainer","renderMargins","note","NoteContainer","ComponentTextStyle","Regular","neutral_600","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","Wrapper","showOnClick","showPopover","isNotePresent","Popover","Medium","topSectionProps","bottomSectionProps","mainContent","children","React","useState","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","text","textButton","icon","action","label","iconButtons","map","iconButton"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,SAAS,GAAGC,0BAAOC,GAAV,weACH,UAAAC,KAAK;AAAA,SAAEA,KAAK,CAACC,IAAN,KAAaC,YAAKC,KAAlB,GAA0B,OAA1B,GAAqCH,KAAK,CAACC,IAAN,KAAaC,YAAKE,KAAlB,GAA0B,OAA1B,GAAoC,OAA3E;AAAA,CADF,EAEJ,UAAAJ,KAAK;AAAA,SAAEA,KAAK,CAACC,IAAN,KAAaC,YAAKC,KAAlB,GAA0B,OAA1B,GAAqCH,KAAK,CAACC,IAAN,KAAaC,YAAKE,KAAlB,GAA0B,OAA1B,GAAoC,OAA3E;AAAA,CAFD,EAICC,SAAOC,KAJR,EAMCC,mBAAWC,kBANZ,EAWFC,kBAAUC,OAXR,EAaX,UAAAV,KAAK;AAAA,SAAKA,KAAK,CAACW,QAAN,IAAkBC,gBAASC,MAA3B,GAAoC,gEAApC,GAAuG,EAA5G;AAAA,CAbM,EAcX,UAAAb,KAAK;AAAA,SAAKA,KAAK,CAACW,QAAN,IAAkBC,gBAASE,GAA3B,GAAiC,mEAAjC,GAAuG,EAA5G;AAAA,CAdM,EAgBX,UAA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AApG;AAAA,wBACGI,UAAU,CAACL;AADd,cAFkC;AAAA,WAArC;AADH,UAXF;AAAA,QA/BJ;AAAA,MADF,eAuDE;AAAK,MAAA,OAAO,EAAE;AAAA,eAAIzB,WAAW,IAAIW,cAAc,CAAC,CAACV,WAAF,CAAjC;AAAA,OAAd;AAAA,iBACGO,QADH,eAGE;AAAK,QAAA,SAAS,EAAC;AAAf,QAHF;AAAA,MAvDF;AAAA,IADF;AAgED,CA5FD;;;AAREH,EAAAA,e;AAjBAkB,IAAAA,I;AACAlC,IAAAA,I;;AAiBAiB,EAAAA,kB;AAPAsB,IAAAA,W;AANAH,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;AAKAH,IAAAA,U;AAPAC,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;;AAYApB,EAAAA,W;AACAC,EAAAA,Q;AAEAR,EAAAA,W;;eAiGaG,O","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\nimport { Button, IconButton } from '../Button';\nimport { SystemIcons } from '../icons';\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\nimport { Position, Size } from '../types';\n\nconst Container = styled.div<{size: Size, position: Position}>`\n height: ${props=>props.size===Size.Small ? '240px' : (props.size===Size.Large ? '480px' : '360px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n border-radius: 4px;\n background: ${COLORS.white};\n cursor: default;\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ${Z_INDEXES.popover};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '')}\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ${COLORS.white};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '')}\n`;\n\nconst TopContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '56px' : (props.size===Size.Large ? '72px' : '64px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n`;\n\nconst MainContentWrapper = styled.div<{size: Size}>`\n padding: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px')};\n`;\n\nconst MiddleContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '104px' : (props.size===Size.Large ? '304px' : '208px')};\n width: ${props=>props.size===Size.Small ? '312px' : (props.size===Size.Large ? '576px' : '424px')};\n padding-right: ${props=>props.size===Size.Small ? '6px' : (props.size===Size.Large ? '14px' : '10px')};\n overflow-y: auto;\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst BottomContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '64px' : (props.size===Size.Large ? '88px' : '72px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n`;\n\nconst TextContainer = styled.div<{note: boolean, size: Size}>`\n display: flex;\n flex-direction: column;\n margin: ${props=>renderMargins(props.note, props.size)};\n flex-grow: 1;\n`;\n\nconst NoteContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : (props.size===Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600))}\n`;\n\nconst LabelContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : (props.size===Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null))}\n`;\n\nconst CloseButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '4px 16px 4px 0' : (props.size===Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\n`;\n\nconst TextButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\n`;\n\nconst IconButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 16px 8px 0' : (props.size===Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\n display: flex;\n`;\n\nconst Wrapper = styled.div<{position: Position, showOnClick: boolean, showPopover: boolean}>`\n position: relative;\n\n .pointer-space {\n height: ${props=>props.position===Position.Top || props.position===Position.Bottom ? '8px' : '100%'};\n width: ${props=>props.position===Position.Left || props.position===Position.Right ? '8px' : '100%'};\n position: absolute;\n\n ${props=>props.position===Position.Left ? 'right:100%; bottom: 0%' : ''};\n ${props=>props.position===Position.Right ? 'left:100%; bottom: 0%' : ''};\n\n ${props=>props.position===Position.Top ? 'bottom: 100%' : ''};\n ${props=>props.position===Position.Bottom ? 'top: 100%' : ''};\n }\n\n ${props=>props.showOnClick ? \n `${Container} {\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\n opacity: ${props.showPopover ? '1' : '0'};\n }\n cursor: pointer;` \n : \n `&:hover {\n ${Container} {\n visibility: visible;\n opacity: 1;\n }\n }`\n }\n`;\n\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\n if(isNotePresent){\n return (size===Size.Small ? '10px 16px' : (size===Size.Large ? '14px 24px' : '12px 20px'));\n }\n else{\n return (size===Size.Small ? '18px 16px' : (size===Size.Large ? '24px' : '20px'));\n }\n}\n\ntype topSectionProps = {\n text: string;\n note?: string;\n}\n\ntype actionButtonProps = {\n icon: React.ReactNode;\n action: ()=>void;\n label?: string;\n}\n\ntype bottomSectionProps = {\n iconButtons?: actionButtonProps[];\n textButton?: actionButtonProps;\n}\n\ntype PopoverProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n topSectionProps?: topSectionProps;\n bottomSectionProps?: bottomSectionProps;\n mainContent: React.ReactNode;\n children: React.ReactNode;\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\n showOnClick: boolean;\n}\n\nconst Popover: React.FunctionComponent<PopoverProps> = \n({\n size=Size.Medium,\n topSectionProps,\n bottomSectionProps,\n mainContent,\n children,\n position,\n showOnClick=false\n}) => {\n\n const [showPopover, setShowPopover] = React.useState(false);\n const popoverRef = React.useRef<any>();\n\n React.useEffect(()=>{\n const checkIfClickedOutside = (e: { target: any; }) => {\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\n setShowPopover(false);\n }\n }\n\n document.addEventListener(\"mousedown\", checkIfClickedOutside)\n\n return () => {\n document.removeEventListener(\"mousedown\", checkIfClickedOutside)\n }\n },[showPopover]);\n\n return (\n <Wrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\n <Container size={size} position={position} ref={popoverRef}>\n {!!topSectionProps && \n <TopContainer size={size}>\n <TextContainer note={!!topSectionProps?.note} size={size}>\n {topSectionProps?.note && \n <NoteContainer size={size}>\n {topSectionProps.note}\n </NoteContainer>\n }\n <LabelContainer size={size}>\n {topSectionProps?.text}\n </LabelContainer>\n </TextContainer>\n\n {showOnClick && \n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\n <IconButton action={()=>setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant='secondary' shape='circular'>\n <SystemIcons.Close />\n </IconButton>\n </CloseButtonContainer>\n }\n </TopContainer>\n }\n\n <MainContentWrapper size={size}>\n <MiddleContainer size={size}>\n {mainContent}\n </MiddleContainer>\n </MainContentWrapper>\n\n {!!bottomSectionProps && \n <BottomContainer size={size}>\n {!!bottomSectionProps?.textButton?.icon && \n <TextButtonContainer size={size} data-testid={'textBtn'}>\n <Button size={size} variant='secondary' icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\n {bottomSectionProps.textButton.label}\n </Button>\n </TextButtonContainer>\n }\n\n <div className='bottom-flex'/>\n \n <IconButtonContainer size={size} data-testid={'iconBtn'}>\n {bottomSectionProps?.iconButtons?.map((iconButton) =>\n \n <IconButton action={iconButton.action} variant='secondary' shape='circular' useTransparentBackground>\n {iconButton.icon}\n </IconButton> \n )}\n </IconButtonContainer>\n </BottomContainer>\n }\n </Container>\n\n <div onClick={()=>showOnClick && setShowPopover(!showPopover)}>\n {children}\n\n <div className='pointer-space'/>\n </div>\n\n </Wrapper>\n );\n};\n\nexport default Popover;"],"file":"Popover.cjs"}
1
+ {"version":3,"sources":["../../src/Popover/Popover.tsx"],"names":["Container","styled","div","props","size","Size","Small","Large","COLORS","white","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","position","Position","Bottom","Top","Left","Right","showArrowPointer","renderArrowStyles","TopContainer","MainContentWrapper","MiddleContainer","BottomContainer","TextContainer","renderMargins","note","NoteContainer","ComponentTextStyle","Regular","neutral_600","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","Wrapper","showOnClick","showPopover","isNotePresent","Popover","Medium","topSectionProps","bottomSectionProps","mainContent","children","React","useState","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","text","textButton","icon","action","label","iconButtons","map","iconButton"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,SAAS,GAAGC,0BAAOC,GAAV,mWACD,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeC,YAAKC,KAApB,GAA4B,OAA5B,GAAsCH,KAAK,CAACC,IAAN,KAAeC,YAAKE,KAApB,GAA4B,OAA5B,GAAsC,OAAxF;AAAA,CADC,EAEA,UAACJ,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeC,YAAKC,KAApB,GAA4B,OAA5B,GAAsCH,KAAK,CAACC,IAAN,KAAeC,YAAKE,KAApB,GAA4B,OAA5B,GAAsC,OAAxF;AAAA,CAFA,EAICC,SAAOC,KAJR,EAMCC,mBAAWC,kBANZ,EAWFC,kBAAUC,OAXR,EAaX,UAACV,KAAD;AAAA,SAAYA,KAAK,CAACW,QAAN,IAAkBC,gBAASC,MAA3B,GAAoC,iEAApC,GAAwG,EAApH;AAAA,CAbW,EAcX,UAACb,KAAD;AAAA,SAAYA,KAAK,CAACW,QAAN,IAAkBC,gBAASE,GAA3B,GAAiC,oEAAjC,GAAwG,EAApH;AAAA,CAdW,EAgBX,UAACd,KAAD;AAAA,SAAYA,KAAK,CAACW,QAAN,IAAkBC,gBAASG,IAA3B,GAAkC,oEAAlC,GAAyG,EAArH;AAAA,CAhBW,EAiBX,UAACf,KAAD;AAAA,SAAYA,KAAK,CAACW,QAAN,IAAkBC,gBAASI,KAA3B,GAAmC,mEAAnC,GAAyG,EAArH;AAAA,CAjBW,EAoBT,UAAChB,KAAD;AAAA,SAAYA,KAAK,CAACiB,gBAAN,GAAyBC,iBAAiB,CAAClB,KAAK,CAACW,QAAP,CAA1C,GAA6D,EAAzE;AAAA,CApBS,CAAf;;AAuBA,IAAMQ,YAAY,GAAGrB,0BAAOC,GAAV,+IACN,UAACC,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["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\nimport { Button, IconButton } from '../Button';\nimport { SystemIcons } from '../icons';\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\nimport { Position, Size } from '../types';\n\nconst Container = styled.div<{ size: Size; position: Position; showArrowPointer: boolean }>`\n //height: ${(props) => (props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px')};\n min-width: ${(props) => (props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px')};\n border-radius: 4px;\n background: ${COLORS.white};\n cursor: default;\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ${Z_INDEXES.popover};\n\n ${(props) => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\n ${(props) => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\n\n ${(props) => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\n ${(props) => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\n\n &::after {\n ${(props) => (props.showArrowPointer ? renderArrowStyles(props.position) : '')}\n`;\n\nconst TopContainer = styled.div<{ size: Size }>`\n height: ${(props) => (props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px')};\n max-width: ${(props) => (props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px')};\n display: flex;\n`;\n\nconst MainContentWrapper = styled.div<{ size: Size }>`\n margin: 8px;\n`;\n\nconst MiddleContainer = styled.div<{ size: Size }>`\n height: ${(props) => (props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px')};\n max-width: ${(props) => (props.size === Size.Small ? '312px' : props.size === Size.Large ? '576px' : '424px')};\n padding: ${(props) => (props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px')};\n overflow-y: auto;\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst BottomContainer = styled.div<{ size: Size }>`\n height: ${(props) => (props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px')};\n max-width: ${(props) => (props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px')};\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n`;\n\nconst TextContainer = styled.div<{ note: boolean; size: Size }>`\n display: flex;\n flex-direction: column;\n margin: ${(props) => renderMargins(props.note, props.size)};\n flex-grow: 1;\n`;\n\nconst NoteContainer = styled.div<{ size: Size }>`\n ${(props) =>\n props.size === Size.Small\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\n : props.size === Size.Large\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n`;\n\nconst LabelContainer = styled.div<{ size: Size }>`\n ${(props) =>\n props.size === Size.Small\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\n : props.size === Size.Large\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\n`;\n\nconst CloseButtonContainer = styled.div<{ size: Size }>`\n margin: ${(props) => (props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\n`;\n\nconst TextButtonContainer = styled.div<{ size: Size }>`\n margin: ${(props) => (props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\n`;\n\nconst IconButtonContainer = styled.div<{ size: Size }>`\n margin: ${(props) => (props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\n display: flex;\n`;\n\nconst Wrapper = styled.div<{ position: Position; showOnClick: boolean; showPopover: boolean }>`\n position: relative;\n\n .pointer-space {\n height: ${(props) => (props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%')};\n width: ${(props) => (props.position === Position.Left || props.position === Position.Right ? '16px' : '100%')};\n position: absolute;\n\n ${(props) => (props.position === Position.Left ? 'right:100%; bottom: 0%' : '')};\n ${(props) => (props.position === Position.Right ? 'left:100%; bottom: 0%' : '')};\n\n ${(props) => (props.position === Position.Top ? 'bottom: 100%' : '')};\n ${(props) => (props.position === Position.Bottom ? 'top: 100%' : '')};\n }\n\n ${(props) =>\n props.showOnClick\n ? `${Container} {\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\n opacity: ${props.showPopover ? '1' : '0'};\n }\n cursor: pointer;`\n : `&:hover {\n ${Container} {\n visibility: visible;\n opacity: 1;\n }\n }`}\n`;\n\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\n if (isNotePresent) {\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\n } else {\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\n }\n};\n\nconst renderArrowStyles = (position: Position) => {\n if (position === Position.Bottom) {\n return `height: 0px;\n width: 0px;\n border-top: 16px solid transparent;\n border-right: 12px solid transparent;\n border-bottom: 16px solid rgb(255,255,255);\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n bottom: calc(100% - 1px);`;\n }\n\n if (position === Position.Top) {\n return `height: 0px;\n width: 0px;\n border-top: 16px solid rgb(255,255,255);\n border-right: 12px solid transparent;\n border-bottom: 16px solid transparent;\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n top: calc(100% - 1px);`;\n }\n\n if (position === Position.Left) {\n return `height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 16px solid rgb(255,255,255);\n content: \"\";\n position: absolute;\n left: calc(100% - 1px);\n bottom: calc(50% - 12px);`;\n }\n\n if (position === Position.Right) {\n return `height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid rgb(255,255,255);\n border-bottom: 12px solid transparent;\n border-left: 16px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(100% - 1px);\n bottom: calc(50% - 12px);`;\n }\n};\n\ntype topSectionProps = {\n text: string;\n note?: string;\n};\n\ntype actionButtonProps = {\n icon: React.ReactNode;\n action: () => void;\n label?: string;\n};\n\ntype bottomSectionProps = {\n iconButtons?: actionButtonProps[];\n textButton?: actionButtonProps;\n};\n\ntype PopoverProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n topSectionProps?: topSectionProps;\n bottomSectionProps?: bottomSectionProps;\n mainContent: React.ReactNode;\n children: React.ReactNode;\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\n showOnClick: boolean;\n showArrowPointer?: boolean;\n};\n\nconst Popover: React.FunctionComponent<PopoverProps> = ({\n size = Size.Medium,\n topSectionProps,\n bottomSectionProps,\n mainContent,\n children,\n position,\n showOnClick = false,\n showArrowPointer = false,\n}) => {\n const [showPopover, setShowPopover] = React.useState(false);\n const popoverRef = React.useRef<any>();\n\n React.useEffect(() => {\n const checkIfClickedOutside = (e: { target: any }) => {\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\n setShowPopover(false);\n }\n };\n\n document.addEventListener('mousedown', checkIfClickedOutside);\n\n return () => {\n document.removeEventListener('mousedown', checkIfClickedOutside);\n };\n }, [showPopover]);\n\n return (\n <Wrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\n <Container size={size} position={position} ref={popoverRef} showArrowPointer={showArrowPointer}>\n {!!topSectionProps && (\n <TopContainer size={size}>\n <TextContainer note={!!topSectionProps?.note} size={size}>\n {topSectionProps?.note && <NoteContainer size={size}>{topSectionProps.note}</NoteContainer>}\n <LabelContainer size={size}>{topSectionProps?.text}</LabelContainer>\n </TextContainer>\n\n {showOnClick && (\n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\n <IconButton action={() => setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant=\"secondary\" shape=\"circular\">\n <SystemIcons.Close />\n </IconButton>\n </CloseButtonContainer>\n )}\n </TopContainer>\n )}\n\n <MainContentWrapper size={size}>\n <MiddleContainer size={size}>{mainContent}</MiddleContainer>\n </MainContentWrapper>\n\n {!!bottomSectionProps && (\n <BottomContainer size={size}>\n {!!bottomSectionProps?.textButton?.icon && (\n <TextButtonContainer size={size} data-testid={'textBtn'}>\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\n {bottomSectionProps.textButton.label}\n </Button>\n </TextButtonContainer>\n )}\n\n <div className=\"bottom-flex\" />\n\n <IconButtonContainer size={size} data-testid={'iconBtn'}>\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\n {iconButton.icon}\n </IconButton>\n ))}\n </IconButtonContainer>\n </BottomContainer>\n )}\n </Container>\n\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\n {children}\n\n <div className=\"pointer-space\" />\n </div>\n </Wrapper>\n );\n};\n\nexport default Popover;\n"],"file":"Popover.cjs"}
@@ -21,6 +21,7 @@ declare type PopoverProps = {
21
21
  children: React.ReactNode;
22
22
  position: Position.Top | Position.Bottom | Position.Right | Position.Left;
23
23
  showOnClick: boolean;
24
+ showArrowPointer?: boolean;
24
25
  };
25
26
  declare const Popover: React.FunctionComponent<PopoverProps>;
26
27
  export default Popover;
@@ -13,43 +13,35 @@ import { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, Co
13
13
  import { Position, Size } from '../types';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
- var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n border-radius: 4px;\n background: ", ";\n cursor: default;\n box-shadow: ", ";\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n"])), function (props) {
16
+ var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n //height: ", ";\n min-width: ", ";\n border-radius: 4px;\n background: ", ";\n cursor: default;\n box-shadow: ", ";\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n\n &::after {\n ", "\n"])), function (props) {
17
17
  return props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px';
18
18
  }, function (props) {
19
- return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
19
+ return props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px';
20
20
  }, COLORS.white, BOXSHADOWS.BOXSHADOW_CENTERED, Z_INDEXES.popover, function (props) {
21
- return props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '';
22
- }, function (props) {
23
- return props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '';
21
+ return props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '';
24
22
  }, function (props) {
25
- return props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '';
23
+ return props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '';
26
24
  }, function (props) {
27
- return props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '';
28
- }, COLORS.white, function (props) {
29
- return props.position == Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '';
25
+ return props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '';
30
26
  }, function (props) {
31
- return props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '';
27
+ return props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '';
32
28
  }, function (props) {
33
- return props.position == Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '';
34
- }, function (props) {
35
- return props.position == Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '';
29
+ return props.showArrowPointer ? renderArrowStyles(props.position) : '';
36
30
  });
37
- var TopContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
31
+ var TopContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n max-width: ", ";\n display: flex;\n"])), function (props) {
38
32
  return props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px';
39
33
  }, function (props) {
40
34
  return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
41
35
  });
42
- var MainContentWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", ";\n"])), function (props) {
43
- return props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px';
44
- });
45
- var MiddleContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n padding-right: ", ";\n overflow-y: auto;\n ", "\n"])), function (props) {
36
+ var MainContentWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 8px;\n"])));
37
+ var MiddleContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: ", ";\n max-width: ", ";\n padding: ", ";\n overflow-y: auto;\n ", "\n"])), function (props) {
46
38
  return props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px';
47
39
  }, function (props) {
48
40
  return props.size === Size.Small ? '312px' : props.size === Size.Large ? '576px' : '424px';
49
41
  }, function (props) {
50
- return props.size === Size.Small ? '6px' : props.size === Size.Large ? '14px' : '10px';
42
+ return props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px';
51
43
  }, scrollBarStyling(Size.Small));
52
- var BottomContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n"])), function (props) {
44
+ var BottomContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n height: ", ";\n max-width: ", ";\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n"])), function (props) {
53
45
  return props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px';
54
46
  }, function (props) {
55
47
  return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
@@ -73,9 +65,9 @@ var IconButtonContainer = styled.div(_templateObject11 || (_templateObject11 = _
73
65
  return props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0';
74
66
  });
75
67
  var Wrapper = styled.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: relative;\n\n .pointer-space {\n height: ", ";\n width: ", ";\n position: absolute;\n\n ", ";\n ", ";\n\n ", ";\n ", ";\n }\n\n ", "\n"])), function (props) {
76
- return props.position === Position.Top || props.position === Position.Bottom ? '8px' : '100%';
68
+ return props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%';
77
69
  }, function (props) {
78
- return props.position === Position.Left || props.position === Position.Right ? '8px' : '100%';
70
+ return props.position === Position.Left || props.position === Position.Right ? '16px' : '100%';
79
71
  }, function (props) {
80
72
  return props.position === Position.Left ? 'right:100%; bottom: 0%' : '';
81
73
  }, function (props) {
@@ -96,6 +88,24 @@ var renderMargins = function renderMargins(isNotePresent, size) {
96
88
  }
97
89
  };
98
90
 
91
+ var renderArrowStyles = function renderArrowStyles(position) {
92
+ if (position === Position.Bottom) {
93
+ return "height: 0px;\n width: 0px;\n border-top: 16px solid transparent;\n border-right: 12px solid transparent;\n border-bottom: 16px solid rgb(255,255,255);\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n bottom: calc(100% - 1px);";
94
+ }
95
+
96
+ if (position === Position.Top) {
97
+ return "height: 0px;\n width: 0px;\n border-top: 16px solid rgb(255,255,255);\n border-right: 12px solid transparent;\n border-bottom: 16px solid transparent;\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n top: calc(100% - 1px);";
98
+ }
99
+
100
+ if (position === Position.Left) {
101
+ return "height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 16px solid rgb(255,255,255);\n content: \"\";\n position: absolute;\n left: calc(100% - 1px);\n bottom: calc(50% - 12px);";
102
+ }
103
+
104
+ if (position === Position.Right) {
105
+ return "height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid rgb(255,255,255);\n border-bottom: 12px solid transparent;\n border-left: 16px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(100% - 1px);\n bottom: calc(50% - 12px);";
106
+ }
107
+ };
108
+
99
109
  var Popover = function Popover(_ref) {
100
110
  var _bottomSectionProps$t, _bottomSectionProps$i;
101
111
 
@@ -107,7 +117,9 @@ var Popover = function Popover(_ref) {
107
117
  children = _ref.children,
108
118
  position = _ref.position,
109
119
  _ref$showOnClick = _ref.showOnClick,
110
- showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick;
120
+ showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick,
121
+ _ref$showArrowPointer = _ref.showArrowPointer,
122
+ showArrowPointer = _ref$showArrowPointer === void 0 ? false : _ref$showArrowPointer;
111
123
 
112
124
  var _React$useState = React.useState(false),
113
125
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -122,9 +134,9 @@ var Popover = function Popover(_ref) {
122
134
  }
123
135
  };
124
136
 
125
- document.addEventListener("mousedown", checkIfClickedOutside);
137
+ document.addEventListener('mousedown', checkIfClickedOutside);
126
138
  return function () {
127
- document.removeEventListener("mousedown", checkIfClickedOutside);
139
+ document.removeEventListener('mousedown', checkIfClickedOutside);
128
140
  };
129
141
  }, [showPopover]);
130
142
  return /*#__PURE__*/_jsxs(Wrapper, {
@@ -135,6 +147,7 @@ var Popover = function Popover(_ref) {
135
147
  size: size,
136
148
  position: position,
137
149
  ref: popoverRef,
150
+ showArrowPointer: showArrowPointer,
138
151
  children: [!!topSectionProps && /*#__PURE__*/_jsxs(TopContainer, {
139
152
  size: size,
140
153
  children: [/*#__PURE__*/_jsxs(TextContainer, {
@@ -225,7 +238,8 @@ Popover.propTypes = {
225
238
  }),
226
239
  mainContent: _pt.node.isRequired,
227
240
  children: _pt.node.isRequired,
228
- showOnClick: _pt.bool.isRequired
241
+ showOnClick: _pt.bool.isRequired,
242
+ showArrowPointer: _pt.bool
229
243
  };
230
244
  export default Popover;
231
245
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Popover/Popover.tsx"],"names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Button","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","Container","div","props","size","Small","Large","white","BOXSHADOW_CENTERED","popover","position","Bottom","Top","Left","Right","TopContainer","MainContentWrapper","MiddleContainer","BottomContainer","TextContainer","renderMargins","note","NoteContainer","Regular","neutral_600","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","Wrapper","showOnClick","showPopover","isNotePresent","Popover","Medium","topSectionProps","bottomSectionProps","mainContent","children","useState","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","remove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AAS,EAAC;AAAf,UATF,eAWE,KAAC,mBAAD;AAAqB,UAAA,IAAI,EAAErD,IAA3B;AAAiC,yBAAa,SAA9C;AAAA,oBACGiC,kBADH,aACGA,kBADH,gDACGA,kBAAkB,CAAEqB,WADvB,0DACG,sBAAiCC,GAAjC,CAAqC,UAACC,UAAD;AAAA,gCAElC,KAAC,UAAD;AAAY,cAAA,MAAM,EAAEA,UAAU,CAACJ,MAA/B;AAAuC,cAAA,OAAO,EAAC,WAA/C;AAA2D,cAAA,KAAK,EAAC,UAAjE;AAA4E,cAAA,wBAAwB,MAApG;AAAA,wBACGI,UAAU,CAACL;AADd,cAFkC;AAAA,WAArC;AADH,UAXF;AAAA,QA/BJ;AAAA,MADF,eAuDE;AAAK,MAAA,OAAO,EAAE;AAAA,eAAIxB,WAAW,IAAIU,cAAc,CAAC,CAACT,WAAF,CAAjC;AAAA,OAAd;AAAA,iBACGO,QADH,eAGE;AAAK,QAAA,SAAS,EAAC;AAAf,QAHF;AAAA,MAvDF;AAAA,IADF;AAgED,CA5FD;;;AAREH,EAAAA,e;AAjBAiB,IAAAA,I;AACAhC,IAAAA,I;;AAiBAgB,EAAAA,kB;AAPAqB,IAAAA,W;AANAH,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;AAKAH,IAAAA,U;AAPAC,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;;AAYAnB,EAAAA,W;AACAC,EAAAA,Q;AAEAR,EAAAA,W;;AAiGF,eAAeG,OAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\nimport { Button, IconButton } from '../Button';\nimport { SystemIcons } from '../icons';\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\nimport { Position, Size } from '../types';\n\nconst Container = styled.div<{size: Size, position: Position}>`\n height: ${props=>props.size===Size.Small ? '240px' : (props.size===Size.Large ? '480px' : '360px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n border-radius: 4px;\n background: ${COLORS.white};\n cursor: default;\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ${Z_INDEXES.popover};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '')}\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ${COLORS.white};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '')}\n`;\n\nconst TopContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '56px' : (props.size===Size.Large ? '72px' : '64px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n`;\n\nconst MainContentWrapper = styled.div<{size: Size}>`\n padding: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px')};\n`;\n\nconst MiddleContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '104px' : (props.size===Size.Large ? '304px' : '208px')};\n width: ${props=>props.size===Size.Small ? '312px' : (props.size===Size.Large ? '576px' : '424px')};\n padding-right: ${props=>props.size===Size.Small ? '6px' : (props.size===Size.Large ? '14px' : '10px')};\n overflow-y: auto;\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst BottomContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '64px' : (props.size===Size.Large ? '88px' : '72px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n`;\n\nconst TextContainer = styled.div<{note: boolean, size: Size}>`\n display: flex;\n flex-direction: column;\n margin: ${props=>renderMargins(props.note, props.size)};\n flex-grow: 1;\n`;\n\nconst NoteContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : (props.size===Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600))}\n`;\n\nconst LabelContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : (props.size===Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null))}\n`;\n\nconst CloseButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '4px 16px 4px 0' : (props.size===Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\n`;\n\nconst TextButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\n`;\n\nconst IconButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 16px 8px 0' : (props.size===Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\n display: flex;\n`;\n\nconst Wrapper = styled.div<{position: Position, showOnClick: boolean, showPopover: boolean}>`\n position: relative;\n\n .pointer-space {\n height: ${props=>props.position===Position.Top || props.position===Position.Bottom ? '8px' : '100%'};\n width: ${props=>props.position===Position.Left || props.position===Position.Right ? '8px' : '100%'};\n position: absolute;\n\n ${props=>props.position===Position.Left ? 'right:100%; bottom: 0%' : ''};\n ${props=>props.position===Position.Right ? 'left:100%; bottom: 0%' : ''};\n\n ${props=>props.position===Position.Top ? 'bottom: 100%' : ''};\n ${props=>props.position===Position.Bottom ? 'top: 100%' : ''};\n }\n\n ${props=>props.showOnClick ? \n `${Container} {\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\n opacity: ${props.showPopover ? '1' : '0'};\n }\n cursor: pointer;` \n : \n `&:hover {\n ${Container} {\n visibility: visible;\n opacity: 1;\n }\n }`\n }\n`;\n\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\n if(isNotePresent){\n return (size===Size.Small ? '10px 16px' : (size===Size.Large ? '14px 24px' : '12px 20px'));\n }\n else{\n return (size===Size.Small ? '18px 16px' : (size===Size.Large ? '24px' : '20px'));\n }\n}\n\ntype topSectionProps = {\n text: string;\n note?: string;\n}\n\ntype actionButtonProps = {\n icon: React.ReactNode;\n action: ()=>void;\n label?: string;\n}\n\ntype bottomSectionProps = {\n iconButtons?: actionButtonProps[];\n textButton?: actionButtonProps;\n}\n\ntype PopoverProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n topSectionProps?: topSectionProps;\n bottomSectionProps?: bottomSectionProps;\n mainContent: React.ReactNode;\n children: React.ReactNode;\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\n showOnClick: boolean;\n}\n\nconst Popover: React.FunctionComponent<PopoverProps> = \n({\n size=Size.Medium,\n topSectionProps,\n bottomSectionProps,\n mainContent,\n children,\n position,\n showOnClick=false\n}) => {\n\n const [showPopover, setShowPopover] = React.useState(false);\n const popoverRef = React.useRef<any>();\n\n React.useEffect(()=>{\n const checkIfClickedOutside = (e: { target: any; }) => {\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\n setShowPopover(false);\n }\n }\n\n document.addEventListener(\"mousedown\", checkIfClickedOutside)\n\n return () => {\n document.removeEventListener(\"mousedown\", checkIfClickedOutside)\n }\n },[showPopover]);\n\n return (\n <Wrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\n <Container size={size} position={position} ref={popoverRef}>\n {!!topSectionProps && \n <TopContainer size={size}>\n <TextContainer note={!!topSectionProps?.note} size={size}>\n {topSectionProps?.note && \n <NoteContainer size={size}>\n {topSectionProps.note}\n </NoteContainer>\n }\n <LabelContainer size={size}>\n {topSectionProps?.text}\n </LabelContainer>\n </TextContainer>\n\n {showOnClick && \n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\n <IconButton action={()=>setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant='secondary' shape='circular'>\n <SystemIcons.Close />\n </IconButton>\n </CloseButtonContainer>\n }\n </TopContainer>\n }\n\n <MainContentWrapper size={size}>\n <MiddleContainer size={size}>\n {mainContent}\n </MiddleContainer>\n </MainContentWrapper>\n\n {!!bottomSectionProps && \n <BottomContainer size={size}>\n {!!bottomSectionProps?.textButton?.icon && \n <TextButtonContainer size={size} data-testid={'textBtn'}>\n <Button size={size} variant='secondary' icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\n {bottomSectionProps.textButton.label}\n </Button>\n </TextButtonContainer>\n }\n\n <div className='bottom-flex'/>\n \n <IconButtonContainer size={size} data-testid={'iconBtn'}>\n {bottomSectionProps?.iconButtons?.map((iconButton) =>\n \n <IconButton action={iconButton.action} variant='secondary' shape='circular' useTransparentBackground>\n {iconButton.icon}\n </IconButton> \n )}\n </IconButtonContainer>\n </BottomContainer>\n }\n </Container>\n\n <div onClick={()=>showOnClick && setShowPopover(!showPopover)}>\n {children}\n\n <div className='pointer-space'/>\n </div>\n\n </Wrapper>\n );\n};\n\nexport default Popover;"],"file":"Popover.js"}
1
+ {"version":3,"sources":["../../src/Popover/Popover.tsx"],"names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Button","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","Container","div","props","size","Small","Large","white","BOXSHADOW_CENTERED","popover","position","Bottom","Top","Left","Right","showArrowPointer","renderArrowStyles","TopContainer","MainContentWrapper","MiddleContainer","BottomContainer","TextContainer","renderMargins","note","NoteContainer","Regular","neutral_600","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","Wrapper","showOnClick","showPopover","isNotePresent","Popover","Medium","topSectionProps","bottomSectionProps","mainContent","children","useState","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","text","textButton","icon","action","label","iconButtons","map","iconButton"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,MAAT,EAAiBC,kBAAjB,EAAqCC,kBAArC,QAA+D,IAA/D;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,WAAnC;AACA,SAASC,WAAT,QAA4B,UAA5B;AACA,SAASC,UAAT,EAAqBC,iBAArB,EAAwCC,iBAAxC,EAA2DC,iBAA3D,EAA8EC,mBAA9E,EAAmGC,gBAAnG,EAAqHC,SAArH,QAAsI,WAAtI;AACA,SAASC,QAAT,EAAmBC,IAAnB,QAA+B,UAA/B;;;AAEA,IAAMC,SAAS,GAAGhB,MAAM,CAACiB,GAAV,qVACD,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeJ,IAAI,CAACK,KAApB,GAA4B,OAA5B,GAAsCF,KAAK,CAACC,IAAN,KAAeJ,IAAI,CAACM,KAApB,GAA4B,OAA5B,GAAsC,OAAxF;AAAA,CADC,EAEA,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeJ,IAAI,CAACK,KAApB,GAA4B,OA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from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\nimport { Button, IconButton } from '../Button';\nimport { SystemIcons } from '../icons';\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\nimport { Position, Size } from '../types';\n\nconst Container = styled.div<{ size: Size; position: Position; showArrowPointer: boolean }>`\n //height: ${(props) => (props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px')};\n min-width: ${(props) => (props.size === Size.Small ? '320px' : props.size === Size.Large ? '640px' : '480px')};\n border-radius: 4px;\n background: ${COLORS.white};\n cursor: default;\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ${Z_INDEXES.popover};\n\n ${(props) => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\n ${(props) => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\n\n ${(props) => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\n ${(props) => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\n\n &::after {\n ${(props) => (props.showArrowPointer ? renderArrowStyles(props.position) : '')}\n`;\n\nconst TopContainer = styled.div<{ size: Size }>`\n height: ${(props) => (props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px')};\n max-width: ${(props) => (props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px')};\n display: flex;\n`;\n\nconst MainContentWrapper = styled.div<{ size: Size }>`\n margin: 8px;\n`;\n\nconst MiddleContainer = styled.div<{ size: Size }>`\n height: ${(props) => (props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px')};\n max-width: ${(props) => (props.size === Size.Small ? '312px' : props.size === Size.Large ? '576px' : '424px')};\n padding: ${(props) => (props.size === Size.Small ? '0 8px' : props.size === Size.Large ? '0 16px' : '0 12px')};\n overflow-y: auto;\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst BottomContainer = styled.div<{ size: Size }>`\n height: ${(props) => (props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px')};\n max-width: ${(props) => (props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px')};\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n`;\n\nconst TextContainer = styled.div<{ note: boolean; size: Size }>`\n display: flex;\n flex-direction: column;\n margin: ${(props) => renderMargins(props.note, props.size)};\n flex-grow: 1;\n`;\n\nconst NoteContainer = styled.div<{ size: Size }>`\n ${(props) =>\n props.size === Size.Small\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\n : props.size === Size.Large\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n`;\n\nconst LabelContainer = styled.div<{ size: Size }>`\n ${(props) =>\n props.size === Size.Small\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\n : props.size === Size.Large\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\n`;\n\nconst CloseButtonContainer = styled.div<{ size: Size }>`\n margin: ${(props) => (props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\n`;\n\nconst TextButtonContainer = styled.div<{ size: Size }>`\n margin: ${(props) => (props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\n`;\n\nconst IconButtonContainer = styled.div<{ size: Size }>`\n margin: ${(props) => (props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\n display: flex;\n`;\n\nconst Wrapper = styled.div<{ position: Position; showOnClick: boolean; showPopover: boolean }>`\n position: relative;\n\n .pointer-space {\n height: ${(props) => (props.position === Position.Top || props.position === Position.Bottom ? '16px' : '100%')};\n width: ${(props) => (props.position === Position.Left || props.position === Position.Right ? '16px' : '100%')};\n position: absolute;\n\n ${(props) => (props.position === Position.Left ? 'right:100%; bottom: 0%' : '')};\n ${(props) => (props.position === Position.Right ? 'left:100%; bottom: 0%' : '')};\n\n ${(props) => (props.position === Position.Top ? 'bottom: 100%' : '')};\n ${(props) => (props.position === Position.Bottom ? 'top: 100%' : '')};\n }\n\n ${(props) =>\n props.showOnClick\n ? `${Container} {\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\n opacity: ${props.showPopover ? '1' : '0'};\n }\n cursor: pointer;`\n : `&:hover {\n ${Container} {\n visibility: visible;\n opacity: 1;\n }\n }`}\n`;\n\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\n if (isNotePresent) {\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\n } else {\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\n }\n};\n\nconst renderArrowStyles = (position: Position) => {\n if (position === Position.Bottom) {\n return `height: 0px;\n width: 0px;\n border-top: 16px solid transparent;\n border-right: 12px solid transparent;\n border-bottom: 16px solid rgb(255,255,255);\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n bottom: calc(100% - 1px);`;\n }\n\n if (position === Position.Top) {\n return `height: 0px;\n width: 0px;\n border-top: 16px solid rgb(255,255,255);\n border-right: 12px solid transparent;\n border-bottom: 16px solid transparent;\n border-left: 12px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(50% - 12px);\n top: calc(100% - 1px);`;\n }\n\n if (position === Position.Left) {\n return `height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 16px solid rgb(255,255,255);\n content: \"\";\n position: absolute;\n left: calc(100% - 1px);\n bottom: calc(50% - 12px);`;\n }\n\n if (position === Position.Right) {\n return `height: 0px;\n width: 0px;\n border-top: 12px solid transparent;\n border-right: 16px solid rgb(255,255,255);\n border-bottom: 12px solid transparent;\n border-left: 16px solid transparent;\n content: \"\";\n position: absolute;\n right: calc(100% - 1px);\n bottom: calc(50% - 12px);`;\n }\n};\n\ntype topSectionProps = {\n text: string;\n note?: string;\n};\n\ntype actionButtonProps = {\n icon: React.ReactNode;\n action: () => void;\n label?: string;\n};\n\ntype bottomSectionProps = {\n iconButtons?: actionButtonProps[];\n textButton?: actionButtonProps;\n};\n\ntype PopoverProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n topSectionProps?: topSectionProps;\n bottomSectionProps?: bottomSectionProps;\n mainContent: React.ReactNode;\n children: React.ReactNode;\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\n showOnClick: boolean;\n showArrowPointer?: boolean;\n};\n\nconst Popover: React.FunctionComponent<PopoverProps> = ({\n size = Size.Medium,\n topSectionProps,\n bottomSectionProps,\n mainContent,\n children,\n position,\n showOnClick = false,\n showArrowPointer = false,\n}) => {\n const [showPopover, setShowPopover] = React.useState(false);\n const popoverRef = React.useRef<any>();\n\n React.useEffect(() => {\n const checkIfClickedOutside = (e: { target: any }) => {\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\n setShowPopover(false);\n }\n };\n\n document.addEventListener('mousedown', checkIfClickedOutside);\n\n return () => {\n document.removeEventListener('mousedown', checkIfClickedOutside);\n };\n }, [showPopover]);\n\n return (\n <Wrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\n <Container size={size} position={position} ref={popoverRef} showArrowPointer={showArrowPointer}>\n {!!topSectionProps && (\n <TopContainer size={size}>\n <TextContainer note={!!topSectionProps?.note} size={size}>\n {topSectionProps?.note && <NoteContainer size={size}>{topSectionProps.note}</NoteContainer>}\n <LabelContainer size={size}>{topSectionProps?.text}</LabelContainer>\n </TextContainer>\n\n {showOnClick && (\n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\n <IconButton action={() => setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant=\"secondary\" shape=\"circular\">\n <SystemIcons.Close />\n </IconButton>\n </CloseButtonContainer>\n )}\n </TopContainer>\n )}\n\n <MainContentWrapper size={size}>\n <MiddleContainer size={size}>{mainContent}</MiddleContainer>\n </MainContentWrapper>\n\n {!!bottomSectionProps && (\n <BottomContainer size={size}>\n {!!bottomSectionProps?.textButton?.icon && (\n <TextButtonContainer size={size} data-testid={'textBtn'}>\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\n {bottomSectionProps.textButton.label}\n </Button>\n </TextButtonContainer>\n )}\n\n <div className=\"bottom-flex\" />\n\n <IconButtonContainer size={size} data-testid={'iconBtn'}>\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\n {iconButton.icon}\n </IconButton>\n ))}\n </IconButtonContainer>\n </BottomContainer>\n )}\n </Container>\n\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\n {children}\n\n <div className=\"pointer-space\" />\n </div>\n </Wrapper>\n );\n};\n\nexport default Popover;\n"],"file":"Popover.js"}
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.default = void 0;
10
+ exports.default = exports.ProfileButtonContainer = void 0;
11
11
 
12
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
13
 
@@ -35,10 +35,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
35
35
 
36
36
  var PortraitOverlay = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ", ";\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n"])), _.COLORS.black);
37
37
 
38
- var Container = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ", " {\n display: ", ";\n\n ", " {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ", " {\n background-color: ", ";\n\n svg, svg path {\n fill: ", ";\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ", " {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ", " {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n"])), _Iconbutton.StyledPrimaryIconButton, function (props) {
38
+ var ProfileButtonContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ", " {\n display: ", ";\n\n ", " {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ", " {\n background-color: ", ";\n\n svg, svg path {\n fill: ", ";\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ", " {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ", " {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n"])), _Iconbutton.StyledPrimaryIconButton, function (props) {
39
39
  return props.hideOnLowWidth ? 'none' : 'inline';
40
40
  }, _styles.BREAKPOINTS.MEDIUM, _Iconbutton.IconButtonContent, _.COLORS.neutral_100, _.COLORS.neutral_300, PortraitOverlay, PortraitOverlay);
41
41
 
42
+ exports.ProfileButtonContainer = ProfileButtonContainer;
43
+
42
44
  var NotificationContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n left: 30px;\n bottom: 30px;\n"])));
43
45
 
44
46
  var ImageWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n"])));
@@ -69,7 +71,7 @@ var ProfileButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
69
71
  });
70
72
  };
71
73
 
72
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ProfileButtonContainer, {
73
75
  hideOnLowWidth: hideOnLowWidth,
74
76
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.IconButton, {
75
77
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["PortraitOverlay","styled","div","COLORS","black","Container","StyledPrimaryIconButton","props","hideOnLowWidth","BREAKPOINTS","MEDIUM","IconButtonContent","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","React","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","renderIcon","ComponentTextStyle","Bold","white","Size","Medium"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAcA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,0OAICC,SAAOC,KAJR,CAArB;;AAWA,IAAMC,SAAS,GAAGJ,0BAAOC,GAAV,8vBAMXI,mCANW,EAOA,UAAAC,KAAK;AAAA,SAAKA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,QAArC;AAAA,CAPL,EASTC,oBAAYC,MATH,EAkBPC,6BAlBO,EAmBaR,SAAOS,WAnBpB,EAsBGT,SAAOU,WAtBV,EA6BPb,eA7BO,EAqCPA,eArCO,CAAf;;AA6CA,IAAMc,qBAAqB,GAAGb,0BAAOC,GAAV,8IAA3B;;AAMA,IAAMa,YAAY,GAAGd,0BAAOC,G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A,IAAI,EAAEO,OAAKC,MAA5B;AAAoC,UAAA,OAAO,EAAER;AAA7C;AADF,QAVJ;AAAA;AADF,IADF;AAmBD,CA/CqB,CAAtB;;AAtFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,mB,4BAAsB,U,EAAa,U;AACnCC,EAAAA,S;AACAlB,EAAAA,c;AACAmB,EAAAA,Q;;eA+HaX,a","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\ntype ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n disabled?: boolean;\n notificationVariant?: 'positive' | 'critical';\n className?: string;\n hideOnLowWidth?: boolean;\n tabIndex?: number;\n};\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nconst Container = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <Container hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </Container>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.cjs"}
1
+ {"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["PortraitOverlay","styled","div","COLORS","black","ProfileButtonContainer","StyledPrimaryIconButton","props","hideOnLowWidth","BREAKPOINTS","MEDIUM","IconButtonContent","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","React","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","renderIcon","ComponentTextStyle","Bold","white","Size","Medium"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;A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AAAH,MAZR;AAcD,GAfD;;AAiBA,sBACE,qBAAC,sBAAD;AAAwB,IAAA,cAAc,EAAEb,cAAxC;AAAA,2BACE,sBAAC,YAAD;AAAY,MAAA,GAAG,EAAEW,GAAjB;AACY,MAAA,SAAS,EAAEO,SADvB;AAEY,MAAA,QAAQ,EAAEF,QAFtB;AAGY,MAAA,MAAM,EAAED,OAHpB;AAIY,MAAA,OAAO,EAAC,SAJpB;AAKY,MAAA,QAAQ,EAAEI,QALtB;AAMY,MAAA,KAAK,EAAC,UANlB;AAOY,MAAA,cAAc,EAAEnB,cAP5B;AAAA,iBAQGoB,UAAU,EARb,EASGH,mBAAmB,iBAClB,qBAAC,qBAAD;AAAA,+BACE,qBAAC,gCAAD;AAAiB,UAAA,IAAI,EAAEO,OAAKC,MAA5B;AAAoC,UAAA,OAAO,EAAER;AAA7C;AADF,QAVJ;AAAA;AADF,IADF;AAmBD,CA/CqB,CAAtB;;AAtFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,mB,4BAAsB,U,EAAa,U;AACnCC,EAAAA,S;AACAlB,EAAAA,c;AACAmB,EAAAA,Q;;eA+HaX,a","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\ntype ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n disabled?: boolean;\n notificationVariant?: 'positive' | 'critical';\n className?: string;\n hideOnLowWidth?: boolean;\n tabIndex?: number;\n};\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nexport const ProfileButtonContainer = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <ProfileButtonContainer hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </ProfileButtonContainer>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.cjs"}
@@ -10,5 +10,8 @@ declare type ProfileButtonProps = {
10
10
  hideOnLowWidth?: boolean;
11
11
  tabIndex?: number;
12
12
  };
13
+ export declare const ProfileButtonContainer: import("styled-components").StyledComponent<"div", any, {
14
+ hideOnLowWidth?: boolean | undefined;
15
+ }, never>;
13
16
  declare const ProfileButton: React.ForwardRefExoticComponent<ProfileButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
17
  export default ProfileButton;