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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/dist/Breadcrumb/Breadcrumb.cjs +1 -0
  2. package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
  3. package/dist/Breadcrumb/Breadcrumb.js +1 -0
  4. package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
  5. package/dist/Button/Button.cjs +4 -4
  6. package/dist/Button/Button.cjs.map +1 -1
  7. package/dist/Button/Button.d.ts +1 -1
  8. package/dist/Button/Button.js +4 -4
  9. package/dist/Button/Button.js.map +1 -1
  10. package/dist/Button/DualFunctionButton.cjs +1 -1
  11. package/dist/Button/DualFunctionButton.cjs.map +1 -1
  12. package/dist/Button/DualFunctionButton.js +1 -1
  13. package/dist/Button/DualFunctionButton.js.map +1 -1
  14. package/dist/Button/Iconbutton.cjs +8 -2
  15. package/dist/Button/Iconbutton.cjs.map +1 -1
  16. package/dist/Button/Iconbutton.d.ts +3 -0
  17. package/dist/Button/Iconbutton.js +8 -2
  18. package/dist/Button/Iconbutton.js.map +1 -1
  19. package/dist/Chips/ChipStyles.cjs +1 -1
  20. package/dist/Chips/ChipStyles.cjs.map +1 -1
  21. package/dist/Chips/ChipStyles.js +1 -1
  22. package/dist/Chips/ChipStyles.js.map +1 -1
  23. package/dist/Chips/ChipTypes.d.ts +3 -3
  24. package/dist/Chips/ChoiceChips.cjs +1 -1
  25. package/dist/Chips/ChoiceChips.cjs.map +1 -1
  26. package/dist/Chips/ChoiceChips.js +1 -1
  27. package/dist/Chips/ChoiceChips.js.map +1 -1
  28. package/dist/Chips/FilterChip.cjs +2 -2
  29. package/dist/Chips/FilterChip.cjs.map +1 -1
  30. package/dist/Chips/FilterChip.js +2 -2
  31. package/dist/Chips/FilterChip.js.map +1 -1
  32. package/dist/Chips/InputChip.cjs.map +1 -1
  33. package/dist/Chips/InputChip.js +1 -1
  34. package/dist/Chips/InputChip.js.map +1 -1
  35. package/dist/ChipsInput/ChipDropdownInput.cjs +5 -6
  36. package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -1
  37. package/dist/ChipsInput/ChipDropdownInput.d.ts +0 -1
  38. package/dist/ChipsInput/ChipDropdownInput.js +6 -7
  39. package/dist/ChipsInput/ChipDropdownInput.js.map +1 -1
  40. package/dist/ChipsInput/ChipInput.cjs +0 -2
  41. package/dist/ChipsInput/ChipInput.cjs.map +1 -1
  42. package/dist/ChipsInput/ChipInput.js +0 -2
  43. package/dist/ChipsInput/ChipInput.js.map +1 -1
  44. package/dist/ChipsInput/ChipInputField.cjs +11 -18
  45. package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
  46. package/dist/ChipsInput/ChipInputField.d.ts +1 -1
  47. package/dist/ChipsInput/ChipInputField.js +13 -20
  48. package/dist/ChipsInput/ChipInputField.js.map +1 -1
  49. package/dist/ChipsInput/ChipInputTypes.d.ts +1 -1
  50. package/dist/Dropdown/BasicDropdown.cjs +9 -11
  51. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  52. package/dist/Dropdown/BasicDropdown.d.ts +2 -2
  53. package/dist/Dropdown/BasicDropdown.js +10 -12
  54. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  55. package/dist/Dropdown/CommonStyling.cjs +25 -13
  56. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  57. package/dist/Dropdown/CommonStyling.d.ts +7 -6
  58. package/dist/Dropdown/CommonStyling.js +11 -11
  59. package/dist/Dropdown/CommonStyling.js.map +1 -1
  60. package/dist/Dropdown/DropdownButton.cjs +76 -18
  61. package/dist/Dropdown/DropdownButton.cjs.map +1 -1
  62. package/dist/Dropdown/DropdownButton.d.ts +1 -1
  63. package/dist/Dropdown/DropdownButton.js +73 -19
  64. package/dist/Dropdown/DropdownButton.js.map +1 -1
  65. package/dist/Dropdown/DropdownButtonTypes.d.ts +16 -5
  66. package/dist/Dropdown/DropdownFilter.cjs +93 -151
  67. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  68. package/dist/Dropdown/DropdownFilter.d.ts +9 -15
  69. package/dist/Dropdown/DropdownFilter.js +94 -152
  70. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  71. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +107 -176
  72. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
  73. package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +13 -27
  74. package/dist/GlobalNavigationBar/GlobalNavigationBar.js +106 -176
  75. package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
  76. package/dist/GlobalNavigationBar/Logo.cjs +3 -5
  77. package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
  78. package/dist/GlobalNavigationBar/Logo.js +1 -1
  79. package/dist/GlobalNavigationBar/Logo.js.map +1 -1
  80. package/dist/GlobalNavigationBar/NavigationHelper.cjs +38 -0
  81. package/dist/GlobalNavigationBar/NavigationHelper.cjs.map +1 -0
  82. package/dist/GlobalNavigationBar/NavigationHelper.d.ts +4 -0
  83. package/dist/GlobalNavigationBar/NavigationHelper.js +27 -0
  84. package/dist/GlobalNavigationBar/NavigationHelper.js.map +1 -0
  85. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +129 -0
  86. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -0
  87. package/dist/GlobalNavigationBar/desktop/DesktopActions.d.ts +15 -0
  88. package/dist/GlobalNavigationBar/desktop/DesktopActions.js +99 -0
  89. package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -0
  90. package/dist/GlobalNavigationBar/{ExtendedMainMenu.cjs → desktop/ExtendedMainMenu.cjs} +7 -9
  91. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -0
  92. package/dist/GlobalNavigationBar/{ExtendedMainMenu.d.ts → desktop/ExtendedMainMenu.d.ts} +2 -2
  93. package/dist/GlobalNavigationBar/{ExtendedMainMenu.js → desktop/ExtendedMainMenu.js} +6 -6
  94. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -0
  95. package/dist/GlobalNavigationBar/{MainMenu.cjs → desktop/MainMenu.cjs} +17 -21
  96. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -0
  97. package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +8 -0
  98. package/dist/GlobalNavigationBar/{MainMenu.js → desktop/MainMenu.js} +17 -21
  99. package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -0
  100. package/dist/GlobalNavigationBar/{RightSideNav.cjs → desktop/RightSideNav.cjs} +22 -26
  101. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -0
  102. package/dist/GlobalNavigationBar/desktop/RightSideNav.d.ts +8 -0
  103. package/dist/GlobalNavigationBar/desktop/RightSideNav.js +59 -0
  104. package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -0
  105. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +204 -0
  106. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -0
  107. package/dist/GlobalNavigationBar/desktop/UserMenu.d.ts +7 -0
  108. package/dist/GlobalNavigationBar/desktop/UserMenu.js +163 -0
  109. package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -0
  110. package/dist/GlobalNavigationBar/index.cjs +15 -18
  111. package/dist/GlobalNavigationBar/index.cjs.map +1 -1
  112. package/dist/GlobalNavigationBar/index.d.ts +2 -2
  113. package/dist/GlobalNavigationBar/index.js +2 -2
  114. package/dist/GlobalNavigationBar/index.js.map +1 -1
  115. package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs +15 -21
  116. package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
  117. package/dist/GlobalNavigationBar/mobile/CommonStyles.d.ts +3 -6
  118. package/dist/GlobalNavigationBar/mobile/CommonStyles.js +14 -15
  119. package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
  120. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +117 -221
  121. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
  122. package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +6 -25
  123. package/dist/GlobalNavigationBar/mobile/MobileMenu.js +116 -216
  124. package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
  125. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs +221 -0
  126. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -0
  127. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.d.ts +11 -0
  128. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js +184 -0
  129. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -0
  130. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +160 -0
  131. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -0
  132. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.d.ts +12 -0
  133. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +139 -0
  134. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -0
  135. package/dist/GlobalNavigationBar/types.cjs +6 -0
  136. package/dist/GlobalNavigationBar/types.cjs.map +1 -0
  137. package/dist/GlobalNavigationBar/types.d.ts +120 -0
  138. package/dist/GlobalNavigationBar/types.js +2 -0
  139. package/dist/GlobalNavigationBar/types.js.map +1 -0
  140. package/dist/InputFields/Checkbox.cjs +10 -10
  141. package/dist/InputFields/Checkbox.cjs.map +1 -1
  142. package/dist/InputFields/Checkbox.d.ts +3 -3
  143. package/dist/InputFields/Checkbox.js +10 -10
  144. package/dist/InputFields/Checkbox.js.map +1 -1
  145. package/dist/InputFields/DatepickerField.cjs +15 -17
  146. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  147. package/dist/InputFields/DatepickerField.d.ts +3 -3
  148. package/dist/InputFields/DatepickerField.js +15 -21
  149. package/dist/InputFields/DatepickerField.js.map +1 -1
  150. package/dist/InputFields/Label.cjs +24 -14
  151. package/dist/InputFields/Label.cjs.map +1 -1
  152. package/dist/InputFields/Label.js +24 -16
  153. package/dist/InputFields/Label.js.map +1 -1
  154. package/dist/InputFields/NumberField.cjs +288 -0
  155. package/dist/InputFields/NumberField.cjs.map +1 -0
  156. package/dist/InputFields/NumberField.d.ts +21 -0
  157. package/dist/InputFields/NumberField.js +252 -0
  158. package/dist/InputFields/NumberField.js.map +1 -0
  159. package/dist/InputFields/PasswordField.cjs +23 -18
  160. package/dist/InputFields/PasswordField.cjs.map +1 -1
  161. package/dist/InputFields/PasswordField.d.ts +2 -3
  162. package/dist/InputFields/PasswordField.js +21 -16
  163. package/dist/InputFields/PasswordField.js.map +1 -1
  164. package/dist/InputFields/QuickSearch.cjs +2 -3
  165. package/dist/InputFields/QuickSearch.cjs.map +1 -1
  166. package/dist/InputFields/QuickSearch.js +2 -3
  167. package/dist/InputFields/QuickSearch.js.map +1 -1
  168. package/dist/InputFields/RadioButton.cjs +5 -7
  169. package/dist/InputFields/RadioButton.cjs.map +1 -1
  170. package/dist/InputFields/RadioButton.d.ts +1 -1
  171. package/dist/InputFields/RadioButton.js +5 -5
  172. package/dist/InputFields/RadioButton.js.map +1 -1
  173. package/dist/InputFields/SearchBar.cjs +2 -2
  174. package/dist/InputFields/SearchBar.cjs.map +1 -1
  175. package/dist/InputFields/SearchBar.js +3 -3
  176. package/dist/InputFields/SearchBar.js.map +1 -1
  177. package/dist/InputFields/TextField.cjs +35 -40
  178. package/dist/InputFields/TextField.cjs.map +1 -1
  179. package/dist/InputFields/TextField.d.ts +6 -6
  180. package/dist/InputFields/TextField.js +35 -41
  181. package/dist/InputFields/TextField.js.map +1 -1
  182. package/dist/InputFields/Textarea.cjs +26 -31
  183. package/dist/InputFields/Textarea.cjs.map +1 -1
  184. package/dist/InputFields/Textarea.d.ts +1 -12
  185. package/dist/InputFields/Textarea.js +31 -33
  186. package/dist/InputFields/Textarea.js.map +1 -1
  187. package/dist/InputFields/components/SearchBarInput.cjs +1 -1
  188. package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
  189. package/dist/InputFields/components/SearchBarInput.js +1 -1
  190. package/dist/InputFields/components/SearchBarInput.js.map +1 -1
  191. package/dist/InputFields/components/SearchField.cjs +1 -3
  192. package/dist/InputFields/components/SearchField.cjs.map +1 -1
  193. package/dist/InputFields/components/SearchField.js +1 -2
  194. package/dist/InputFields/components/SearchField.js.map +1 -1
  195. package/dist/InputFields/index.cjs +8 -0
  196. package/dist/InputFields/index.cjs.map +1 -1
  197. package/dist/InputFields/index.d.ts +2 -1
  198. package/dist/InputFields/index.js +2 -1
  199. package/dist/InputFields/index.js.map +1 -1
  200. package/dist/InputFields/styling.cjs +22 -28
  201. package/dist/InputFields/styling.cjs.map +1 -1
  202. package/dist/InputFields/styling.d.ts +7 -7
  203. package/dist/InputFields/styling.js +19 -23
  204. package/dist/InputFields/styling.js.map +1 -1
  205. package/dist/InputFields/types.cjs +6 -0
  206. package/dist/InputFields/types.cjs.map +1 -0
  207. package/dist/InputFields/types.d.ts +38 -0
  208. package/dist/InputFields/types.js +2 -0
  209. package/dist/InputFields/types.js.map +1 -0
  210. package/dist/List/ListRow.cjs +1 -0
  211. package/dist/List/ListRow.cjs.map +1 -1
  212. package/dist/List/ListRow.js +1 -0
  213. package/dist/List/ListRow.js.map +1 -1
  214. package/dist/MenuItem/MenuItem.cjs +26 -11
  215. package/dist/MenuItem/MenuItem.cjs.map +1 -1
  216. package/dist/MenuItem/MenuItem.d.ts +6 -4
  217. package/dist/MenuItem/MenuItem.js +26 -11
  218. package/dist/MenuItem/MenuItem.js.map +1 -1
  219. package/dist/MenuItem/index.cjs.map +1 -1
  220. package/dist/MenuItem/index.js.map +1 -1
  221. package/dist/Modals/ModalNote.cjs +1 -1
  222. package/dist/Modals/ModalNote.cjs.map +1 -1
  223. package/dist/Modals/ModalNote.js +2 -2
  224. package/dist/Modals/ModalNote.js.map +1 -1
  225. package/dist/Popover/Popover.cjs +267 -0
  226. package/dist/Popover/Popover.cjs.map +1 -0
  227. package/dist/Popover/Popover.d.ts +26 -0
  228. package/dist/Popover/Popover.js +231 -0
  229. package/dist/Popover/Popover.js.map +1 -0
  230. package/dist/Popover/index.cjs +16 -0
  231. package/dist/Popover/index.cjs.map +1 -0
  232. package/dist/Popover/index.d.ts +1 -0
  233. package/dist/Popover/index.js +2 -0
  234. package/dist/Popover/index.js.map +1 -0
  235. package/dist/ProfileButton/ProfileButton.cjs +105 -0
  236. package/dist/ProfileButton/ProfileButton.cjs.map +1 -0
  237. package/dist/ProfileButton/ProfileButton.d.ts +14 -0
  238. package/dist/ProfileButton/ProfileButton.js +79 -0
  239. package/dist/ProfileButton/ProfileButton.js.map +1 -0
  240. package/dist/ProfileButton/index.cjs +16 -0
  241. package/dist/ProfileButton/index.cjs.map +1 -0
  242. package/dist/ProfileButton/index.d.ts +1 -0
  243. package/dist/ProfileButton/index.js +2 -0
  244. package/dist/ProfileButton/index.js.map +1 -0
  245. package/dist/QuizButton/QuizButton.cjs +1 -1
  246. package/dist/QuizButton/QuizButton.cjs.map +1 -1
  247. package/dist/QuizButton/QuizButton.js +1 -1
  248. package/dist/QuizButton/QuizButton.js.map +1 -1
  249. package/dist/Switcher/MobileSwitcherMenu.cjs +24 -78
  250. package/dist/Switcher/MobileSwitcherMenu.cjs.map +1 -1
  251. package/dist/Switcher/MobileSwitcherMenu.d.ts +6 -5
  252. package/dist/Switcher/MobileSwitcherMenu.js +26 -70
  253. package/dist/Switcher/MobileSwitcherMenu.js.map +1 -1
  254. package/dist/Table/Table.cjs +22 -22
  255. package/dist/Table/Table.cjs.map +1 -1
  256. package/dist/Table/Table.js +22 -22
  257. package/dist/Table/Table.js.map +1 -1
  258. package/dist/Table/TableBody.cjs +1 -1
  259. package/dist/Table/TableBody.cjs.map +1 -1
  260. package/dist/Table/TableBody.js +1 -1
  261. package/dist/Table/TableBody.js.map +1 -1
  262. package/dist/Table/TableFooter.cjs +12 -14
  263. package/dist/Table/TableFooter.cjs.map +1 -1
  264. package/dist/Table/TableFooter.js +13 -15
  265. package/dist/Table/TableFooter.js.map +1 -1
  266. package/dist/Table/TableHeaders.cjs +1 -0
  267. package/dist/Table/TableHeaders.cjs.map +1 -1
  268. package/dist/Table/TableHeaders.js +1 -0
  269. package/dist/Table/TableHeaders.js.map +1 -1
  270. package/dist/Tabs/TabLink.cjs +2 -3
  271. package/dist/Tabs/TabLink.cjs.map +1 -1
  272. package/dist/Tabs/TabLink.d.ts +1 -2
  273. package/dist/Tabs/TabLink.js +2 -3
  274. package/dist/Tabs/TabLink.js.map +1 -1
  275. package/dist/Tile/Tile.cjs +61 -0
  276. package/dist/Tile/Tile.cjs.map +1 -0
  277. package/dist/Tile/Tile.d.ts +4 -0
  278. package/dist/Tile/Tile.js +43 -0
  279. package/dist/Tile/Tile.js.map +1 -0
  280. package/dist/Tile/TileBody.cjs +37 -0
  281. package/dist/Tile/TileBody.cjs.map +1 -0
  282. package/dist/Tile/TileBody.d.ts +6 -0
  283. package/dist/Tile/TileBody.js +22 -0
  284. package/dist/Tile/TileBody.js.map +1 -0
  285. package/dist/Tile/TileCommonItems.cjs +165 -0
  286. package/dist/Tile/TileCommonItems.cjs.map +1 -0
  287. package/dist/Tile/TileCommonItems.d.ts +9 -0
  288. package/dist/Tile/TileCommonItems.js +126 -0
  289. package/dist/Tile/TileCommonItems.js.map +1 -0
  290. package/dist/Tile/TileFooter.cjs +48 -0
  291. package/dist/Tile/TileFooter.cjs.map +1 -0
  292. package/dist/Tile/TileFooter.d.ts +7 -0
  293. package/dist/Tile/TileFooter.js +32 -0
  294. package/dist/Tile/TileFooter.js.map +1 -0
  295. package/dist/Tile/TileHeader.cjs +90 -0
  296. package/dist/Tile/TileHeader.cjs.map +1 -0
  297. package/dist/Tile/TileHeader.d.ts +7 -0
  298. package/dist/Tile/TileHeader.js +68 -0
  299. package/dist/Tile/TileHeader.js.map +1 -0
  300. package/dist/Tile/TileTypes.cjs +6 -0
  301. package/dist/Tile/TileTypes.cjs.map +1 -0
  302. package/dist/Tile/TileTypes.d.ts +57 -0
  303. package/dist/Tile/TileTypes.js +2 -0
  304. package/dist/Tile/TileTypes.js.map +1 -0
  305. package/dist/Tile/index.cjs +33 -0
  306. package/dist/Tile/index.cjs.map +1 -0
  307. package/dist/Tile/index.d.ts +3 -0
  308. package/dist/Tile/index.js +4 -0
  309. package/dist/Tile/index.js.map +1 -0
  310. package/dist/common/StackState.cjs +47 -0
  311. package/dist/common/StackState.cjs.map +1 -0
  312. package/dist/common/StackState.d.ts +7 -0
  313. package/dist/common/StackState.js +30 -0
  314. package/dist/common/StackState.js.map +1 -0
  315. package/dist/hooks/useClickOutside.cjs +6 -2
  316. package/dist/hooks/useClickOutside.cjs.map +1 -1
  317. package/dist/hooks/useClickOutside.d.ts +1 -1
  318. package/dist/hooks/useClickOutside.js +6 -2
  319. package/dist/hooks/useClickOutside.js.map +1 -1
  320. package/dist/icons/contenticons/ContentIcons.cjs +3214 -3182
  321. package/dist/icons/contenticons/ContentIcons.cjs.map +1 -1
  322. package/dist/icons/contenticons/ContentIcons.d.ts +17 -0
  323. package/dist/icons/contenticons/ContentIcons.js +3341 -3365
  324. package/dist/icons/contenticons/ContentIcons.js.map +1 -1
  325. package/dist/icons/index.cjs +22 -69
  326. package/dist/icons/index.cjs.map +1 -1
  327. package/dist/icons/index.d.ts +1 -4
  328. package/dist/icons/index.js +19 -64
  329. package/dist/icons/index.js.map +1 -1
  330. package/dist/icons/systemicons/SystemIcons.cjs +3216 -2433
  331. package/dist/icons/systemicons/SystemIcons.cjs.map +1 -1
  332. package/dist/icons/systemicons/SystemIcons.d.ts +12 -2
  333. package/dist/icons/systemicons/SystemIcons.js +3016 -2267
  334. package/dist/icons/systemicons/SystemIcons.js.map +1 -1
  335. package/dist/index.cjs +56 -0
  336. package/dist/index.cjs.map +1 -1
  337. package/dist/index.d.ts +4 -0
  338. package/dist/index.js +4 -0
  339. package/dist/index.js.map +1 -1
  340. package/dist/styles/colors.cjs +1 -0
  341. package/dist/styles/colors.cjs.map +1 -1
  342. package/dist/styles/colors.d.ts +1 -0
  343. package/dist/styles/colors.js +1 -0
  344. package/dist/styles/colors.js.map +1 -1
  345. package/dist/styles/z-indexes.cjs +2 -1
  346. package/dist/styles/z-indexes.cjs.map +1 -1
  347. package/dist/styles/z-indexes.d.ts +1 -0
  348. package/dist/styles/z-indexes.js +2 -1
  349. package/dist/styles/z-indexes.js.map +1 -1
  350. package/dist/types.cjs +20 -1
  351. package/dist/types.cjs.map +1 -1
  352. package/dist/types.d.ts +10 -31
  353. package/dist/types.js +17 -0
  354. package/dist/types.js.map +1 -1
  355. package/package.json +13 -9
  356. package/dist/GlobalNavigationBar/Actions.cjs +0 -185
  357. package/dist/GlobalNavigationBar/Actions.cjs.map +0 -1
  358. package/dist/GlobalNavigationBar/Actions.d.ts +0 -13
  359. package/dist/GlobalNavigationBar/Actions.js +0 -160
  360. package/dist/GlobalNavigationBar/Actions.js.map +0 -1
  361. package/dist/GlobalNavigationBar/Avatar.cjs +0 -104
  362. package/dist/GlobalNavigationBar/Avatar.cjs.map +0 -1
  363. package/dist/GlobalNavigationBar/Avatar.d.ts +0 -15
  364. package/dist/GlobalNavigationBar/Avatar.js +0 -77
  365. package/dist/GlobalNavigationBar/Avatar.js.map +0 -1
  366. package/dist/GlobalNavigationBar/ExtendedMainMenu.cjs.map +0 -1
  367. package/dist/GlobalNavigationBar/ExtendedMainMenu.js.map +0 -1
  368. package/dist/GlobalNavigationBar/MainMenu.cjs.map +0 -1
  369. package/dist/GlobalNavigationBar/MainMenu.d.ts +0 -8
  370. package/dist/GlobalNavigationBar/MainMenu.js.map +0 -1
  371. package/dist/GlobalNavigationBar/RightSideNav.cjs.map +0 -1
  372. package/dist/GlobalNavigationBar/RightSideNav.d.ts +0 -8
  373. package/dist/GlobalNavigationBar/RightSideNav.js +0 -61
  374. package/dist/GlobalNavigationBar/RightSideNav.js.map +0 -1
  375. package/dist/GlobalNavigationBar/UserMenu/MenuLink.cjs +0 -112
  376. package/dist/GlobalNavigationBar/UserMenu/MenuLink.cjs.map +0 -1
  377. package/dist/GlobalNavigationBar/UserMenu/MenuLink.d.ts +0 -11
  378. package/dist/GlobalNavigationBar/UserMenu/MenuLink.js +0 -86
  379. package/dist/GlobalNavigationBar/UserMenu/MenuLink.js.map +0 -1
  380. package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.cjs +0 -178
  381. package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.cjs.map +0 -1
  382. package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.d.ts +0 -16
  383. package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.js +0 -146
  384. package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +0 -1
  385. package/dist/GlobalNavigationBar/UserMenu/UserMenu.cjs +0 -168
  386. package/dist/GlobalNavigationBar/UserMenu/UserMenu.cjs.map +0 -1
  387. package/dist/GlobalNavigationBar/UserMenu/UserMenu.d.ts +0 -15
  388. package/dist/GlobalNavigationBar/UserMenu/UserMenu.js +0 -135
  389. package/dist/GlobalNavigationBar/UserMenu/UserMenu.js.map +0 -1
  390. package/dist/GlobalNavigationBar/mobile/ExitMenuButton.cjs +0 -49
  391. package/dist/GlobalNavigationBar/mobile/ExitMenuButton.cjs.map +0 -1
  392. package/dist/GlobalNavigationBar/mobile/ExitMenuButton.d.ts +0 -6
  393. package/dist/GlobalNavigationBar/mobile/ExitMenuButton.js +0 -27
  394. package/dist/GlobalNavigationBar/mobile/ExitMenuButton.js.map +0 -1
  395. package/dist/GlobalNavigationBar/mobile/MobileActionMenu.cjs +0 -91
  396. package/dist/GlobalNavigationBar/mobile/MobileActionMenu.cjs.map +0 -1
  397. package/dist/GlobalNavigationBar/mobile/MobileActionMenu.d.ts +0 -13
  398. package/dist/GlobalNavigationBar/mobile/MobileActionMenu.js +0 -70
  399. package/dist/GlobalNavigationBar/mobile/MobileActionMenu.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Modals/ModalNote.tsx"],"names":["React","COLORS","CheckComplete","Information","TechnicalWarning","ModalNoteSection","ModalNote","note","icon","size","state","stateVal","toLowerCase","correct_500","warning_500","primary_500"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,MAAT,QAAuB,IAAvB;AACA,SAASC,aAAT,EAAwBC,WAAxB,EAAqCC,gBAArC,QAA6D,kCAA7D;AACA,SAASC,gBAAT,QAAiC,eAAjC;;;AASA,OAAO,IAAMC,SAA6C,GAAG,SAAhDA,SAAgD,OAA6C;AAAA,MAA1CC,IAA0C,QAA1CA,IAA0C;AAAA,MAApCC,IAAoC,QAApCA,IAAoC;AAAA,MAA9BC,IAA8B,QAA9BA,IAA8B;AAAA,wBAAxBC,KAAwB;AAAA,MAAxBA,KAAwB,2BAAhB,SAAgB;AACxG,MAAMC,QAAQ,GAAGD,KAAK,CAACE,WAAN,EAAjB;;AAEA,UAAQD,QAAR;AACE,SAAK,UAAL;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEA,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,aAAD;AAAe,UAAA,KAAK,EAAEP,MAAM,CAACY;AAA7B,UADjB,eAEE;AAAA,oBAAON;AAAP,UAFF;AAAA,QADF;;AAOF,SAAK,SAAL;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,gBAAD;AAAkB,UAAA,KAAK,EAAEP,MAAM,CAACa;AAAhC,UADjB,eAEE;AAAA,oBAAOP;AAAP,UAFF;AAAA,QADF;;AAOF,SAAK,UAAL;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,gBAAD;AAAkB,UAAA,KAAK,EAAEP,MAAM,CAACa;AAAhC,UADjB,eAEE;AAAA,oBAAOP;AAAP,UAFF;AAAA,QADF;;AAOF;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,WAAD;AAAa,UAAA,KAAK,EAAEP,MAAM,CAACc,WAA3B;AAAwC,UAAA,SAAS,EAAEN;AAAnD,UADjB,eAEE;AAAA,oBAAOF;AAAP,UAFF;AAAA,QADF;AA1BJ;AAiCD,CApCM;;AANLA,EAAAA,I;AACAC,EAAAA,I;AACAE,EAAAA,K;AACAD,EAAAA,I;;AAyCF,eAAeH,SAAf","sourcesContent":["import * as React from 'react';\nimport { COLORS } from '..';\nimport { CheckComplete, Information, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport { ModalNoteSection } from './ModalStyles';\n\ninterface NoteProps {\n note: string | React.ReactNode;\n icon?: React.ReactNode;\n state?: string;\n size?: string;\n}\n\nexport const ModalNote: React.FunctionComponent<NoteProps> = ({ note, icon, size, state = 'neutral' }) => {\n const stateVal = state.toLowerCase();\n\n switch (stateVal) {\n case 'positive':\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <CheckComplete color={COLORS.correct_500} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n case 'warning':\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <TechnicalWarning color={COLORS.warning_500} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n case 'critical':\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <TechnicalWarning color={COLORS.warning_500} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n default:\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <Information color={COLORS.primary_500} className={size} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n }\n};\n\nexport default ModalNote;\n"],"file":"ModalNote.js"}
1
+ {"version":3,"sources":["../../src/Modals/ModalNote.tsx"],"names":["React","COLORS","CheckMark","Information","TechnicalWarning","ModalNoteSection","ModalNote","note","icon","size","state","stateVal","toLowerCase","correct_500","warning_500","primary_500"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,MAAT,QAAuB,IAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,EAAiCC,gBAAjC,QAAyD,kCAAzD;AACA,SAASC,gBAAT,QAAiC,eAAjC;;;AASA,OAAO,IAAMC,SAA6C,GAAG,SAAhDA,SAAgD,OAA6C;AAAA,MAA1CC,IAA0C,QAA1CA,IAA0C;AAAA,MAApCC,IAAoC,QAApCA,IAAoC;AAAA,MAA9BC,IAA8B,QAA9BA,IAA8B;AAAA,wBAAxBC,KAAwB;AAAA,MAAxBA,KAAwB,2BAAhB,SAAgB;AACxG,MAAMC,QAAQ,GAAGD,KAAK,CAACE,WAAN,EAAjB;;AAEA,UAAQD,QAAR;AACE,SAAK,UAAL;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEA,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,SAAD;AAAW,UAAA,KAAK,EAAEP,MAAM,CAACY;AAAzB,UADjB,eAEE;AAAA,oBAAON;AAAP,UAFF;AAAA,QADF;;AAOF,SAAK,SAAL;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,gBAAD;AAAkB,UAAA,KAAK,EAAEP,MAAM,CAACa;AAAhC,UADjB,eAEE;AAAA,oBAAOP;AAAP,UAFF;AAAA,QADF;;AAOF,SAAK,UAAL;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,gBAAD;AAAkB,UAAA,KAAK,EAAEP,MAAM,CAACa;AAAhC,UADjB,eAEE;AAAA,oBAAOP;AAAP,UAFF;AAAA,QADF;;AAOF;AACE,0BACE,MAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF,IAAzC;AAAA,mBACGD,IAAI,GAAGA,IAAH,gBAAU,KAAC,WAAD;AAAa,UAAA,KAAK,EAAEP,MAAM,CAACc,WAA3B;AAAwC,UAAA,SAAS,EAAEN;AAAnD,UADjB,eAEE;AAAA,oBAAOF;AAAP,UAFF;AAAA,QADF;AA1BJ;AAiCD,CApCM;;AANLA,EAAAA,I;AACAC,EAAAA,I;AACAE,EAAAA,K;AACAD,EAAAA,I;;AAyCF,eAAeH,SAAf","sourcesContent":["import * as React from 'react';\nimport { COLORS } from '..';\nimport { CheckMark, Information, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport { ModalNoteSection } from './ModalStyles';\n\ninterface NoteProps {\n note: string | React.ReactNode;\n icon?: React.ReactNode;\n state?: string;\n size?: string;\n}\n\nexport const ModalNote: React.FunctionComponent<NoteProps> = ({ note, icon, size, state = 'neutral' }) => {\n const stateVal = state.toLowerCase();\n\n switch (stateVal) {\n case 'positive':\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <CheckMark color={COLORS.correct_500} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n case 'warning':\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <TechnicalWarning color={COLORS.warning_500} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n case 'critical':\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <TechnicalWarning color={COLORS.warning_500} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n default:\n return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <Information color={COLORS.primary_500} className={size} />}\n <span>{note}</span>\n </ModalNoteSection>\n );\n }\n};\n\nexport default ModalNote;\n"],"file":"ModalNote.js"}
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = void 0;
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var React = _interopRequireWildcard(require("react"));
19
+
20
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
21
+
22
+ var _ = require("..");
23
+
24
+ var _Button = require("../Button");
25
+
26
+ var _icons = require("../icons");
27
+
28
+ var _styles = require("../styles");
29
+
30
+ var _types = require("../types");
31
+
32
+ var _jsxRuntime = require("react/jsx-runtime");
33
+
34
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
35
+
36
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
+
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
+
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) {
41
+ return props.size === _types.Size.Small ? '240px' : props.size === _types.Size.Large ? '480px' : '360px';
42
+ }, function (props) {
43
+ return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
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%);' : '';
48
+ }, function (props) {
49
+ return props.position == _types.Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '';
50
+ }, 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);' : '';
54
+ }, function (props) {
55
+ return props.position == _types.Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '';
56
+ }, 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);' : '';
60
+ });
61
+
62
+ var TopContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
63
+ return props.size === _types.Size.Small ? '56px' : props.size === _types.Size.Large ? '72px' : '64px';
64
+ }, function (props) {
65
+ return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
66
+ });
67
+
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
+ });
71
+
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) {
73
+ return props.size === _types.Size.Small ? '104px' : props.size === _types.Size.Large ? '304px' : '208px';
74
+ }, function (props) {
75
+ return props.size === _types.Size.Small ? '312px' : props.size === _types.Size.Large ? '576px' : '424px';
76
+ }, function (props) {
77
+ return props.size === _types.Size.Small ? '6px' : props.size === _types.Size.Large ? '14px' : '10px';
78
+ }, (0, _styles.scrollBarStyling)(_types.Size.Small));
79
+
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) {
81
+ return props.size === _types.Size.Small ? '64px' : props.size === _types.Size.Large ? '88px' : '72px';
82
+ }, function (props) {
83
+ return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
84
+ });
85
+
86
+ var TextContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n flex-grow: 1;\n"])), function (props) {
87
+ return renderMargins(props.note, props.size);
88
+ });
89
+
90
+ var NoteContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), function (props) {
91
+ return props.size === _types.Size.Small ? (0, _styles.ComponentXXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600) : props.size === _types.Size.Large ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600) : (0, _.ComponentXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600);
92
+ });
93
+
94
+ var LabelContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), function (props) {
95
+ return 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);
96
+ });
97
+
98
+ var CloseButtonContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", ";\n"])), function (props) {
99
+ return props.size === _types.Size.Small ? '4px 16px 4px 0' : props.size === _types.Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0';
100
+ });
101
+
102
+ var TextButtonContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", ";\n"])), function (props) {
103
+ return props.size === _types.Size.Small ? '8px 0 8px 16px' : props.size === _types.Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px';
104
+ });
105
+
106
+ var IconButtonContainer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", ";\n display: flex;\n"])), function (props) {
107
+ return props.size === _types.Size.Small ? '8px 16px 8px 0' : props.size === _types.Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0';
108
+ });
109
+
110
+ 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%';
112
+ }, function (props) {
113
+ return props.position === _types.Position.Left || props.position === _types.Position.Right ? '8px' : '100%';
114
+ }, function (props) {
115
+ return props.position === _types.Position.Left ? 'right:100%; bottom: 0%' : '';
116
+ }, function (props) {
117
+ return props.position === _types.Position.Right ? 'left:100%; bottom: 0%' : '';
118
+ }, function (props) {
119
+ return props.position === _types.Position.Top ? 'bottom: 100%' : '';
120
+ }, function (props) {
121
+ return props.position === _types.Position.Bottom ? 'top: 100%' : '';
122
+ }, function (props) {
123
+ return props.showOnClick ? "".concat(Container, " {\n visibility: ").concat(props.showPopover ? 'visible' : 'hidden', ";\n opacity: ").concat(props.showPopover ? '1' : '0', ";\n }\n cursor: pointer;") : "&:hover {\n ".concat(Container, " {\n visibility: visible;\n opacity: 1;\n }\n }");
124
+ });
125
+
126
+ var renderMargins = function renderMargins(isNotePresent, size) {
127
+ if (isNotePresent) {
128
+ return size === _types.Size.Small ? '10px 16px' : size === _types.Size.Large ? '14px 24px' : '12px 20px';
129
+ } else {
130
+ return size === _types.Size.Small ? '18px 16px' : size === _types.Size.Large ? '24px' : '20px';
131
+ }
132
+ };
133
+
134
+ var Popover = function Popover(_ref) {
135
+ var _bottomSectionProps$t, _bottomSectionProps$i;
136
+
137
+ var _ref$size = _ref.size,
138
+ size = _ref$size === void 0 ? _types.Size.Medium : _ref$size,
139
+ topSectionProps = _ref.topSectionProps,
140
+ bottomSectionProps = _ref.bottomSectionProps,
141
+ mainContent = _ref.mainContent,
142
+ children = _ref.children,
143
+ position = _ref.position,
144
+ _ref$showOnClick = _ref.showOnClick,
145
+ showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick;
146
+
147
+ var _React$useState = React.useState(false),
148
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
149
+ showPopover = _React$useState2[0],
150
+ setShowPopover = _React$useState2[1];
151
+
152
+ var popoverRef = React.useRef();
153
+ React.useEffect(function () {
154
+ var checkIfClickedOutside = function checkIfClickedOutside(e) {
155
+ if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {
156
+ setShowPopover(false);
157
+ }
158
+ };
159
+
160
+ document.addEventListener("mousedown", checkIfClickedOutside);
161
+ return function () {
162
+ document.removeEventListener("mousedown", checkIfClickedOutside);
163
+ };
164
+ }, [showPopover]);
165
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
166
+ position: position,
167
+ showOnClick: showOnClick,
168
+ showPopover: showPopover,
169
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
170
+ size: size,
171
+ position: position,
172
+ ref: popoverRef,
173
+ children: [!!topSectionProps && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TopContainer, {
174
+ size: size,
175
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TextContainer, {
176
+ note: !!(topSectionProps !== null && topSectionProps !== void 0 && topSectionProps.note),
177
+ size: size,
178
+ children: [(topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.note) && /*#__PURE__*/(0, _jsxRuntime.jsx)(NoteContainer, {
179
+ size: size,
180
+ children: topSectionProps.note
181
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelContainer, {
182
+ size: size,
183
+ children: topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.text
184
+ })]
185
+ }), showOnClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButtonContainer, {
186
+ size: size,
187
+ "data-testid": 'closeBtn',
188
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
189
+ action: function action() {
190
+ return setShowPopover(false);
191
+ },
192
+ useTransparentBackground: true,
193
+ iconColor: _.COLORS.neutral_600,
194
+ variant: "secondary",
195
+ shape: "circular",
196
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.Close, {})
197
+ })
198
+ })]
199
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(MainContentWrapper, {
200
+ size: size,
201
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(MiddleContainer, {
202
+ size: size,
203
+ children: mainContent
204
+ })
205
+ }), !!bottomSectionProps && /*#__PURE__*/(0, _jsxRuntime.jsxs)(BottomContainer, {
206
+ size: size,
207
+ children: [!!(bottomSectionProps !== null && bottomSectionProps !== void 0 && (_bottomSectionProps$t = bottomSectionProps.textButton) !== null && _bottomSectionProps$t !== void 0 && _bottomSectionProps$t.icon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(TextButtonContainer, {
208
+ size: size,
209
+ "data-testid": 'textBtn',
210
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
211
+ size: size,
212
+ variant: "secondary",
213
+ icon: bottomSectionProps.textButton.icon,
214
+ onClick: bottomSectionProps.textButton.action,
215
+ children: bottomSectionProps.textButton.label
216
+ })
217
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
218
+ className: "bottom-flex"
219
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButtonContainer, {
220
+ size: size,
221
+ "data-testid": 'iconBtn',
222
+ children: bottomSectionProps === null || bottomSectionProps === void 0 ? void 0 : (_bottomSectionProps$i = bottomSectionProps.iconButtons) === null || _bottomSectionProps$i === void 0 ? void 0 : _bottomSectionProps$i.map(function (iconButton) {
223
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
224
+ action: iconButton.action,
225
+ variant: "secondary",
226
+ shape: "circular",
227
+ useTransparentBackground: true,
228
+ children: iconButton.icon
229
+ });
230
+ })
231
+ })]
232
+ })]
233
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
234
+ onClick: function onClick() {
235
+ return showOnClick && setShowPopover(!showPopover);
236
+ },
237
+ children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
238
+ className: "pointer-space"
239
+ })]
240
+ })]
241
+ });
242
+ };
243
+
244
+ Popover.propTypes = {
245
+ topSectionProps: _propTypes.default.shape({
246
+ text: _propTypes.default.string.isRequired,
247
+ note: _propTypes.default.string
248
+ }),
249
+ bottomSectionProps: _propTypes.default.shape({
250
+ iconButtons: _propTypes.default.arrayOf(_propTypes.default.shape({
251
+ icon: _propTypes.default.node.isRequired,
252
+ action: _propTypes.default.func.isRequired,
253
+ label: _propTypes.default.string
254
+ })),
255
+ textButton: _propTypes.default.shape({
256
+ icon: _propTypes.default.node.isRequired,
257
+ action: _propTypes.default.func.isRequired,
258
+ label: _propTypes.default.string
259
+ })
260
+ }),
261
+ mainContent: _propTypes.default.node.isRequired,
262
+ children: _propTypes.default.node.isRequired,
263
+ showOnClick: _propTypes.default.bool.isRequired
264
+ };
265
+ var _default = Popover;
266
+ exports.default = _default;
267
+ //# sourceMappingURL=Popover.cjs.map
@@ -0,0 +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,UAAAd,KAAK;AAAA,SAAKA,KAAK,CAACW,QAAN,IAAkBC,gBAASG,IAA3B,GAAkC,mEAAlC,GAAwG,EAA7G;AAAA,CAhBM,EAiBX,UAAAf,KAAK;AAAA,SAAKA,KAAK,CAACW,QAAN,IAAkBC,gBAASI,KAA3B,GAAmC,kEAAnC,GAAwG,EAA7G;AAAA,CAjBM,EAwBGX,SAAOC,KAxBV,EA0B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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"}
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import { Position, Size } from '../types';
3
+ declare type topSectionProps = {
4
+ text: string;
5
+ note?: string;
6
+ };
7
+ declare type actionButtonProps = {
8
+ icon: React.ReactNode;
9
+ action: () => void;
10
+ label?: string;
11
+ };
12
+ declare type bottomSectionProps = {
13
+ iconButtons?: actionButtonProps[];
14
+ textButton?: actionButtonProps;
15
+ };
16
+ declare type PopoverProps = {
17
+ size?: Size.Small | Size.Medium | Size.Large;
18
+ topSectionProps?: topSectionProps;
19
+ bottomSectionProps?: bottomSectionProps;
20
+ mainContent: React.ReactNode;
21
+ children: React.ReactNode;
22
+ position: Position.Top | Position.Bottom | Position.Right | Position.Left;
23
+ showOnClick: boolean;
24
+ };
25
+ declare const Popover: React.FunctionComponent<PopoverProps>;
26
+ export default Popover;
@@ -0,0 +1,231 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
3
+ import _pt from "prop-types";
4
+
5
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
6
+
7
+ import * as React from 'react';
8
+ import styled from 'styled-components';
9
+ import { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';
10
+ import { Button, IconButton } from '../Button';
11
+ import { SystemIcons } from '../icons';
12
+ import { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';
13
+ import { Position, Size } from '../types';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
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) {
17
+ return props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px';
18
+ }, function (props) {
19
+ return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
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%);' : '';
24
+ }, function (props) {
25
+ return props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '';
26
+ }, 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);' : '';
30
+ }, function (props) {
31
+ return props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '';
32
+ }, 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);' : '';
36
+ });
37
+ var TopContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
38
+ return props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px';
39
+ }, function (props) {
40
+ return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
41
+ });
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) {
46
+ return props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px';
47
+ }, function (props) {
48
+ return props.size === Size.Small ? '312px' : props.size === Size.Large ? '576px' : '424px';
49
+ }, function (props) {
50
+ return props.size === Size.Small ? '6px' : props.size === Size.Large ? '14px' : '10px';
51
+ }, 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) {
53
+ return props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px';
54
+ }, function (props) {
55
+ return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
56
+ });
57
+ var TextContainer = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n flex-grow: 1;\n"])), function (props) {
58
+ return renderMargins(props.note, props.size);
59
+ });
60
+ var NoteContainer = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
61
+ return 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);
62
+ });
63
+ var LabelContainer = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
64
+ return props.size === Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : props.size === Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null);
65
+ });
66
+ var CloseButtonContainer = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: ", ";\n"])), function (props) {
67
+ return props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0';
68
+ });
69
+ var TextButtonContainer = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin: ", ";\n"])), function (props) {
70
+ return props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px';
71
+ });
72
+ var IconButtonContainer = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin: ", ";\n display: flex;\n"])), function (props) {
73
+ return props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0';
74
+ });
75
+ 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%';
77
+ }, function (props) {
78
+ return props.position === Position.Left || props.position === Position.Right ? '8px' : '100%';
79
+ }, function (props) {
80
+ return props.position === Position.Left ? 'right:100%; bottom: 0%' : '';
81
+ }, function (props) {
82
+ return props.position === Position.Right ? 'left:100%; bottom: 0%' : '';
83
+ }, function (props) {
84
+ return props.position === Position.Top ? 'bottom: 100%' : '';
85
+ }, function (props) {
86
+ return props.position === Position.Bottom ? 'top: 100%' : '';
87
+ }, function (props) {
88
+ return props.showOnClick ? "".concat(Container, " {\n visibility: ").concat(props.showPopover ? 'visible' : 'hidden', ";\n opacity: ").concat(props.showPopover ? '1' : '0', ";\n }\n cursor: pointer;") : "&:hover {\n ".concat(Container, " {\n visibility: visible;\n opacity: 1;\n }\n }");
89
+ });
90
+
91
+ var renderMargins = function renderMargins(isNotePresent, size) {
92
+ if (isNotePresent) {
93
+ return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';
94
+ } else {
95
+ return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';
96
+ }
97
+ };
98
+
99
+ var Popover = function Popover(_ref) {
100
+ var _bottomSectionProps$t, _bottomSectionProps$i;
101
+
102
+ var _ref$size = _ref.size,
103
+ size = _ref$size === void 0 ? Size.Medium : _ref$size,
104
+ topSectionProps = _ref.topSectionProps,
105
+ bottomSectionProps = _ref.bottomSectionProps,
106
+ mainContent = _ref.mainContent,
107
+ children = _ref.children,
108
+ position = _ref.position,
109
+ _ref$showOnClick = _ref.showOnClick,
110
+ showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick;
111
+
112
+ var _React$useState = React.useState(false),
113
+ _React$useState2 = _slicedToArray(_React$useState, 2),
114
+ showPopover = _React$useState2[0],
115
+ setShowPopover = _React$useState2[1];
116
+
117
+ var popoverRef = React.useRef();
118
+ React.useEffect(function () {
119
+ var checkIfClickedOutside = function checkIfClickedOutside(e) {
120
+ if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {
121
+ setShowPopover(false);
122
+ }
123
+ };
124
+
125
+ document.addEventListener("mousedown", checkIfClickedOutside);
126
+ return function () {
127
+ document.removeEventListener("mousedown", checkIfClickedOutside);
128
+ };
129
+ }, [showPopover]);
130
+ return /*#__PURE__*/_jsxs(Wrapper, {
131
+ position: position,
132
+ showOnClick: showOnClick,
133
+ showPopover: showPopover,
134
+ children: [/*#__PURE__*/_jsxs(Container, {
135
+ size: size,
136
+ position: position,
137
+ ref: popoverRef,
138
+ children: [!!topSectionProps && /*#__PURE__*/_jsxs(TopContainer, {
139
+ size: size,
140
+ children: [/*#__PURE__*/_jsxs(TextContainer, {
141
+ note: !!(topSectionProps !== null && topSectionProps !== void 0 && topSectionProps.note),
142
+ size: size,
143
+ children: [(topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.note) && /*#__PURE__*/_jsx(NoteContainer, {
144
+ size: size,
145
+ children: topSectionProps.note
146
+ }), /*#__PURE__*/_jsx(LabelContainer, {
147
+ size: size,
148
+ children: topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.text
149
+ })]
150
+ }), showOnClick && /*#__PURE__*/_jsx(CloseButtonContainer, {
151
+ size: size,
152
+ "data-testid": 'closeBtn',
153
+ children: /*#__PURE__*/_jsx(IconButton, {
154
+ action: function action() {
155
+ return setShowPopover(false);
156
+ },
157
+ useTransparentBackground: true,
158
+ iconColor: COLORS.neutral_600,
159
+ variant: "secondary",
160
+ shape: "circular",
161
+ children: /*#__PURE__*/_jsx(SystemIcons.Close, {})
162
+ })
163
+ })]
164
+ }), /*#__PURE__*/_jsx(MainContentWrapper, {
165
+ size: size,
166
+ children: /*#__PURE__*/_jsx(MiddleContainer, {
167
+ size: size,
168
+ children: mainContent
169
+ })
170
+ }), !!bottomSectionProps && /*#__PURE__*/_jsxs(BottomContainer, {
171
+ size: size,
172
+ children: [!!(bottomSectionProps !== null && bottomSectionProps !== void 0 && (_bottomSectionProps$t = bottomSectionProps.textButton) !== null && _bottomSectionProps$t !== void 0 && _bottomSectionProps$t.icon) && /*#__PURE__*/_jsx(TextButtonContainer, {
173
+ size: size,
174
+ "data-testid": 'textBtn',
175
+ children: /*#__PURE__*/_jsx(Button, {
176
+ size: size,
177
+ variant: "secondary",
178
+ icon: bottomSectionProps.textButton.icon,
179
+ onClick: bottomSectionProps.textButton.action,
180
+ children: bottomSectionProps.textButton.label
181
+ })
182
+ }), /*#__PURE__*/_jsx("div", {
183
+ className: "bottom-flex"
184
+ }), /*#__PURE__*/_jsx(IconButtonContainer, {
185
+ size: size,
186
+ "data-testid": 'iconBtn',
187
+ children: bottomSectionProps === null || bottomSectionProps === void 0 ? void 0 : (_bottomSectionProps$i = bottomSectionProps.iconButtons) === null || _bottomSectionProps$i === void 0 ? void 0 : _bottomSectionProps$i.map(function (iconButton) {
188
+ return /*#__PURE__*/_jsx(IconButton, {
189
+ action: iconButton.action,
190
+ variant: "secondary",
191
+ shape: "circular",
192
+ useTransparentBackground: true,
193
+ children: iconButton.icon
194
+ });
195
+ })
196
+ })]
197
+ })]
198
+ }), /*#__PURE__*/_jsxs("div", {
199
+ onClick: function onClick() {
200
+ return showOnClick && setShowPopover(!showPopover);
201
+ },
202
+ children: [children, /*#__PURE__*/_jsx("div", {
203
+ className: "pointer-space"
204
+ })]
205
+ })]
206
+ });
207
+ };
208
+
209
+ Popover.propTypes = {
210
+ topSectionProps: _pt.shape({
211
+ text: _pt.string.isRequired,
212
+ note: _pt.string
213
+ }),
214
+ bottomSectionProps: _pt.shape({
215
+ iconButtons: _pt.arrayOf(_pt.shape({
216
+ icon: _pt.node.isRequired,
217
+ action: _pt.func.isRequired,
218
+ label: _pt.string
219
+ })),
220
+ textButton: _pt.shape({
221
+ icon: _pt.node.isRequired,
222
+ action: _pt.func.isRequired,
223
+ label: _pt.string
224
+ })
225
+ }),
226
+ mainContent: _pt.node.isRequired,
227
+ children: _pt.node.isRequired,
228
+ showOnClick: _pt.bool.isRequired
229
+ };
230
+ export default Popover;
231
+ //# sourceMappingURL=Popover.js.map