@helsenorge/designsystem-react 7.12.0 → 7.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/_virtual/dynamic-import-helper.js +11 -4
  3. package/_virtual/dynamic-import-helper.js.map +1 -1
  4. package/_virtual/index.js +2 -2
  5. package/components/AnchorLink/AnchorLink.js +16 -16
  6. package/components/AnchorLink/AnchorLink.js.map +1 -1
  7. package/components/Avatar/Avatar.js +9 -9
  8. package/components/Avatar/Avatar.js.map +1 -1
  9. package/components/Badge/Badge.js +7 -7
  10. package/components/Badge/Badge.js.map +1 -1
  11. package/components/Badge/NotificationBadge.js +5 -5
  12. package/components/Badge/NotificationBadge.js.map +1 -1
  13. package/components/Button/Button.js +23 -23
  14. package/components/Button/Button.js.map +1 -1
  15. package/components/ButtonWithModal/ButtonWithModal.js +5 -5
  16. package/components/ButtonWithModal/ButtonWithModal.js.map +1 -1
  17. package/components/Checkbox/Checkbox.js +41 -42
  18. package/components/Checkbox/Checkbox.js.map +1 -1
  19. package/components/Checkbox/index.js +2 -3
  20. package/components/Checkbox/index.js.map +1 -1
  21. package/components/Checkbox/styles.module.scss +2 -2
  22. package/components/Close/Close.js +9 -9
  23. package/components/Close/Close.js.map +1 -1
  24. package/components/DictionaryTrigger/DictionaryTrigger.js +14 -15
  25. package/components/DictionaryTrigger/DictionaryTrigger.js.map +1 -1
  26. package/components/DictionaryTrigger/styles.module.scss +1 -2
  27. package/components/Dropdown/Dropdown.js +24 -24
  28. package/components/Dropdown/Dropdown.js.map +1 -1
  29. package/components/Dropdown/styles.module.scss +1 -1
  30. package/components/Duolist/Duolist.d.ts +3 -0
  31. package/components/Duolist/Duolist.js +45 -36
  32. package/components/Duolist/Duolist.js.map +1 -1
  33. package/components/Duolist/index.js +5 -5
  34. package/components/Duolist/styles.module.scss +4 -0
  35. package/components/Duolist/styles.module.scss.d.ts +1 -0
  36. package/components/EmptyState/EmptyState.js +3 -3
  37. package/components/EmptyState/EmptyState.js.map +1 -1
  38. package/components/EmptyState/NobodyHome.js +3 -3
  39. package/components/EmptyState/NobodyHome.js.map +1 -1
  40. package/components/ErrorWrapper/ErrorWrapper.js +4 -4
  41. package/components/ErrorWrapper/ErrorWrapper.js.map +1 -1
  42. package/components/ErrorWrapper/index.js +2 -3
  43. package/components/ErrorWrapper/index.js.map +1 -1
  44. package/components/Expander/Expander.js +10 -10
  45. package/components/Expander/Expander.js.map +1 -1
  46. package/components/Expander/styles.module.scss +1 -1
  47. package/components/ExpanderHierarchy/Expander.js +5 -5
  48. package/components/ExpanderHierarchy/Expander.js.map +1 -1
  49. package/components/ExpanderHierarchy/ExpanderButton.js +7 -7
  50. package/components/ExpanderHierarchy/ExpanderButton.js.map +1 -1
  51. package/components/ExpanderHierarchy/ExpanderHierarchy.js +13 -14
  52. package/components/ExpanderHierarchy/ExpanderHierarchy.js.map +1 -1
  53. package/components/ExpanderHierarchy/expander.module.scss +2 -2
  54. package/components/ExpanderList/ExpanderList.js +34 -35
  55. package/components/ExpanderList/ExpanderList.js.map +1 -1
  56. package/components/ExpanderList/index.js +2 -3
  57. package/components/ExpanderList/index.js.map +1 -1
  58. package/components/ExpanderList/styles.module.scss +1 -1
  59. package/components/FormExample/FormExample.d.ts +0 -1
  60. package/components/FormExample/FormExample.js +12 -12
  61. package/components/FormExample/FormExample.js.map +1 -1
  62. package/components/FormExample/index.js +5 -5
  63. package/components/FormGroup/FormGroup.js +37 -38
  64. package/components/FormGroup/FormGroup.js.map +1 -1
  65. package/components/FormGroup/index.js +2 -3
  66. package/components/FormGroup/index.js.map +1 -1
  67. package/components/FormLayout/FormLayout.js +16 -17
  68. package/components/FormLayout/FormLayout.js.map +1 -1
  69. package/components/FormLayout/index.js +4 -4
  70. package/components/GridExample/GridExample.js +3 -3
  71. package/components/GridExample/GridExample.js.map +1 -1
  72. package/components/GridExample/index.js +3 -4
  73. package/components/GridExample/index.js.map +1 -1
  74. package/components/HelpBubble/HelpBubble.js +26 -27
  75. package/components/HelpBubble/HelpBubble.js.map +1 -1
  76. package/components/HelpBubble/styles.module.scss +1 -1
  77. package/components/HelpBubbleExample/HelpBubbleExample.js +3 -3
  78. package/components/HelpBubbleExample/HelpBubbleExample.js.map +1 -1
  79. package/components/HelpPanel/HelpPanel.js +11 -11
  80. package/components/HelpPanel/HelpPanel.js.map +1 -1
  81. package/components/HelpQuestion/HelpQuestion.js +16 -17
  82. package/components/HelpQuestion/HelpQuestion.js.map +1 -1
  83. package/components/HighlightBox/HighlightBox.js +16 -16
  84. package/components/HighlightBox/HighlightBox.js.map +1 -1
  85. package/components/HighlightBox/styles.module.scss +4 -4
  86. package/components/HorizontalScroll/HorizontalScroll.js +4 -4
  87. package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
  88. package/components/HorizontalScroll/index.js +2 -3
  89. package/components/HorizontalScroll/index.js.map +1 -1
  90. package/components/Illustration/Illustration.js +16 -17
  91. package/components/Illustration/Illustration.js.map +1 -1
  92. package/components/Illustration/index.js +5 -5
  93. package/components/Input/Input.js +65 -67
  94. package/components/Input/Input.js.map +1 -1
  95. package/components/Label/Label.js +16 -16
  96. package/components/Label/Label.js.map +1 -1
  97. package/components/LazyIcon/ErrorBoundary.js +7 -8
  98. package/components/LazyIcon/ErrorBoundary.js.map +1 -1
  99. package/components/LazyIcon/LazyIcon.js +4 -4
  100. package/components/LazyIcon/LazyIcon.js.map +1 -1
  101. package/components/LazyIcon/index.js +3 -3
  102. package/components/LazyIllustration/LazyIllustration.js +10 -10
  103. package/components/LazyIllustration/LazyIllustration.js.map +1 -1
  104. package/components/LazyIllustration/index.js +5 -5
  105. package/components/LinkList/LinkList.js +36 -37
  106. package/components/LinkList/LinkList.js.map +1 -1
  107. package/components/LinkList/index.js +2 -3
  108. package/components/LinkList/index.js.map +1 -1
  109. package/components/List/List.js +7 -8
  110. package/components/List/List.js.map +1 -1
  111. package/components/ListHeader/ListHeader.js +1 -1
  112. package/components/ListHeader/ListHeader.js.map +1 -1
  113. package/components/ListHeader/ListHeaderText/ListHeaderText.js +18 -19
  114. package/components/ListHeader/ListHeaderText/ListHeaderText.js.map +1 -1
  115. package/components/ListHeader/ListHeaderText/index.js +2 -3
  116. package/components/ListHeader/ListHeaderText/index.js.map +1 -1
  117. package/components/Loader/Loader.js +2 -2
  118. package/components/Loader/Loader.js.map +1 -1
  119. package/components/Logo/Logo.js +5 -5
  120. package/components/Logo/Logo.js.map +1 -1
  121. package/components/MaxCharacters/MaxCharacters.js +5 -5
  122. package/components/MaxCharacters/MaxCharacters.js.map +1 -1
  123. package/components/Modal/Modal.js +32 -33
  124. package/components/Modal/Modal.js.map +1 -1
  125. package/components/Modal/styles.module.scss +8 -8
  126. package/components/NotificationPanel/NotificationPanel.js +14 -14
  127. package/components/NotificationPanel/NotificationPanel.js.map +1 -1
  128. package/components/NotificationPanel/styles.module.scss +3 -3
  129. package/components/Panel/Panel.js +25 -25
  130. package/components/Panel/Panel.js.map +1 -1
  131. package/components/Panel/styles.module.scss +3 -3
  132. package/components/PanelList/PanelList.js +8 -8
  133. package/components/PanelList/PanelList.js.map +1 -1
  134. package/components/PopMenu/PopMenu.js +14 -14
  135. package/components/PopMenu/PopMenu.js.map +1 -1
  136. package/components/PopMenu/index.js +3 -3
  137. package/components/PopOver/PopOver.js +27 -28
  138. package/components/PopOver/PopOver.js.map +1 -1
  139. package/components/Portal/index.js.map +1 -1
  140. package/components/Progressbar/Progressbar.js +13 -13
  141. package/components/Progressbar/Progressbar.js.map +1 -1
  142. package/components/PromoPanel/PromoPanel.js +16 -16
  143. package/components/PromoPanel/PromoPanel.js.map +1 -1
  144. package/components/RadioButton/RadioButton.js +52 -53
  145. package/components/RadioButton/RadioButton.js.map +1 -1
  146. package/components/RadioButton/index.js +4 -4
  147. package/components/RadioButton/styles.module.scss +2 -2
  148. package/components/Select/Select.js +21 -21
  149. package/components/Select/Select.js.map +1 -1
  150. package/components/Select/index.js +2 -3
  151. package/components/Select/index.js.map +1 -1
  152. package/components/ServiceMessage/ServiceMessage.js +30 -30
  153. package/components/ServiceMessage/ServiceMessage.js.map +1 -1
  154. package/components/ServiceMessage/styles.module.scss +10 -10
  155. package/components/SharingStatus/SharingStatus.js +7 -7
  156. package/components/SharingStatus/SharingStatus.js.map +1 -1
  157. package/components/Slider/Slider.js +15 -17
  158. package/components/Slider/Slider.js.map +1 -1
  159. package/components/Slider/index.js +2 -3
  160. package/components/Slider/index.js.map +1 -1
  161. package/components/Spacer/Spacer.js +4 -4
  162. package/components/Spacer/Spacer.js.map +1 -1
  163. package/components/StatusDot/StatusDot.js +8 -8
  164. package/components/StatusDot/StatusDot.js.map +1 -1
  165. package/components/Step/Step.js +10 -10
  166. package/components/Step/Step.js.map +1 -1
  167. package/components/StepButtons/StepButtons.js +4 -4
  168. package/components/StepButtons/StepButtons.js.map +1 -1
  169. package/components/StepButtons/index.js +2 -3
  170. package/components/StepButtons/index.js.map +1 -1
  171. package/components/Stepper/Dot.js +3 -3
  172. package/components/Stepper/Dot.js.map +1 -1
  173. package/components/Stepper/DotList.js +4 -4
  174. package/components/Stepper/DotList.js.map +1 -1
  175. package/components/Stepper/Stepper.js +10 -10
  176. package/components/Stepper/Stepper.js.map +1 -1
  177. package/components/Table/Table.js +1 -1
  178. package/components/Table/TableBody/TableBody.js +3 -3
  179. package/components/Table/TableBody/TableBody.js.map +1 -1
  180. package/components/Table/TableBody/index.js +3 -4
  181. package/components/Table/TableBody/index.js.map +1 -1
  182. package/components/Table/TableCell/TableCell.js +10 -10
  183. package/components/Table/TableCell/TableCell.js.map +1 -1
  184. package/components/Table/TableCell/index.js +4 -4
  185. package/components/Table/TableExpandedRow/TableExpandedRow.js +8 -8
  186. package/components/Table/TableExpandedRow/TableExpandedRow.js.map +1 -1
  187. package/components/Table/TableExpandedRow/index.js +3 -4
  188. package/components/Table/TableExpandedRow/index.js.map +1 -1
  189. package/components/Table/TableExpanderCell/TableExpanderCell.js +3 -3
  190. package/components/Table/TableExpanderCell/TableExpanderCell.js.map +1 -1
  191. package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +11 -11
  192. package/components/Table/TableExpanderCell/TableExpanderCellMobile.js.map +1 -1
  193. package/components/Table/TableExpanderCell/index.js +3 -4
  194. package/components/Table/TableExpanderCell/index.js.map +1 -1
  195. package/components/Table/TableHead/TableHead.js +9 -9
  196. package/components/Table/TableHead/TableHead.js.map +1 -1
  197. package/components/Table/TableHead/index.js +4 -4
  198. package/components/Table/TableHeadCell/TableHeadCell.js +15 -15
  199. package/components/Table/TableHeadCell/TableHeadCell.js.map +1 -1
  200. package/components/Table/TableHeadCell/index.js +4 -4
  201. package/components/Table/TableRow/TableRow.js +16 -16
  202. package/components/Table/TableRow/TableRow.js.map +1 -1
  203. package/components/Table/TableRow/index.js +3 -4
  204. package/components/Table/TableRow/index.js.map +1 -1
  205. package/components/Table/styles.module.scss +3 -3
  206. package/components/Table/utils.d.ts +1 -1
  207. package/components/Tabs/Tab.js +2 -2
  208. package/components/Tabs/Tab.js.map +1 -1
  209. package/components/Tabs/TabList/TabList.js +43 -38
  210. package/components/Tabs/TabList/TabList.js.map +1 -1
  211. package/components/Tabs/TabList/styles.module.scss +14 -4
  212. package/components/Tabs/TabPanel/TabPanel.d.ts +5 -1
  213. package/components/Tabs/TabPanel/TabPanel.js +13 -9
  214. package/components/Tabs/TabPanel/TabPanel.js.map +1 -1
  215. package/components/Tabs/TabPanel/styles.module.scss +48 -6
  216. package/components/Tabs/TabPanel/styles.module.scss.d.ts +4 -0
  217. package/components/Tabs/Tabs.d.ts +8 -4
  218. package/components/Tabs/Tabs.js +85 -16
  219. package/components/Tabs/Tabs.js.map +1 -1
  220. package/components/Tabs/styles.module.scss +38 -2
  221. package/components/Tabs/styles.module.scss.d.ts +7 -1
  222. package/components/Tag/Tag.js +3 -3
  223. package/components/Tag/Tag.js.map +1 -1
  224. package/components/TagList/TagList.js +1 -1
  225. package/components/TagList/TagList.js.map +1 -1
  226. package/components/Textarea/Textarea.js +48 -49
  227. package/components/Textarea/Textarea.js.map +1 -1
  228. package/components/Tile/Tile.js +14 -15
  229. package/components/Tile/Tile.js.map +1 -1
  230. package/components/Tile/index.js +2 -3
  231. package/components/Tile/index.js.map +1 -1
  232. package/components/Title/Title.js +10 -10
  233. package/components/Title/Title.js.map +1 -1
  234. package/components/Title/index.js +4 -4
  235. package/components/Tooltip/Tooltip.js +4 -4
  236. package/components/Tooltip/Tooltip.js.map +1 -1
  237. package/components/Tooltip/TooltipWord/TooltipWord.js +17 -18
  238. package/components/Tooltip/TooltipWord/TooltipWord.js.map +1 -1
  239. package/components/Tooltip/index.js +5 -5
  240. package/components/TooltipExample/TooltipExample.js +4 -4
  241. package/components/TooltipExample/TooltipExample.js.map +1 -1
  242. package/components/Trigger/HelpSign.js +3 -3
  243. package/components/Trigger/HelpSign.js.map +1 -1
  244. package/components/Trigger/Trigger.js +25 -26
  245. package/components/Trigger/Trigger.js.map +1 -1
  246. package/components/Validation/ErrorList.js +5 -5
  247. package/components/Validation/ErrorList.js.map +1 -1
  248. package/components/Validation/ErrorListItem.js +8 -8
  249. package/components/Validation/ErrorListItem.js.map +1 -1
  250. package/components/Validation/Validation.js +13 -14
  251. package/components/Validation/Validation.js.map +1 -1
  252. package/components/Validation/ValidationSummary.js +4 -4
  253. package/components/Validation/ValidationSummary.js.map +1 -1
  254. package/components/Validation/index.js +3 -4
  255. package/components/Validation/index.js.map +1 -1
  256. package/components/Validation/types.d.ts +0 -1
  257. package/constants.d.ts +2 -1
  258. package/constants.js +1 -1
  259. package/constants.js.map +1 -1
  260. package/hooks/useIcons.d.ts +0 -1
  261. package/hooks/useIcons.js +1 -1
  262. package/hooks/useLayoutEvent.js +1 -2
  263. package/hooks/useLayoutEvent.js.map +1 -1
  264. package/hooks/useSticky.d.ts +1 -1
  265. package/package.json +1 -1
  266. package/scss/_palette.scss +1 -0
  267. package/scss/typography.module.scss +1 -1
  268. package/scss/typography.module.scss.d.ts +1 -1
  269. package/scss/typography.stories.tsx +157 -0
  270. package/theme/currys/color.d.ts +1 -1
  271. package/utils/accessibility.d.ts +2 -1
  272. package/utils/accessibility.js +1 -1
  273. package/utils/accessibility.js.map +1 -1
  274. package/utils/component.d.ts +3 -3
  275. package/utils/refs.d.ts +1 -2
  276. package/_virtual/index2.js +0 -5
  277. package/_virtual/index2.js.map +0 -1
  278. package/_virtual/index3.js +0 -5
  279. package/_virtual/index3.js.map +0 -1
  280. package/components/AnchorLink/AnchorLink.stories.d.ts +0 -31
  281. package/components/Avatar/Avatar.stories.d.ts +0 -36
  282. package/components/Badge/Badge.stories.d.ts +0 -42
  283. package/components/Button/Button.stories.d.ts +0 -56
  284. package/components/Checkbox/Checkbox.stories.d.ts +0 -54
  285. package/components/Close/Close.stories.d.ts +0 -29
  286. package/components/DictionaryTrigger/DictionaryTrigger.stories.d.ts +0 -30
  287. package/components/Dropdown/Dropdown.stories.d.ts +0 -67
  288. package/components/Duolist/Duolist.stories.d.ts +0 -32
  289. package/components/EmptyState/EmptyState.stories.d.ts +0 -26
  290. package/components/Expander/Expander.stories.d.ts +0 -60
  291. package/components/ExpanderHierarchy/ExpanderHierarchy.stories.d.ts +0 -44
  292. package/components/ExpanderList/ExpanderList.stories.d.ts +0 -59
  293. package/components/FormGroup/FormGroup.stories.d.ts +0 -50
  294. package/components/FormLayout/FormLayout.stories.d.ts +0 -32
  295. package/components/HelpBubble/HelpBubble.stories.d.ts +0 -46
  296. package/components/HelpPanel/HelpPanel.stories.d.ts +0 -31
  297. package/components/HelpQuestion/HelpQuestion.stories.d.ts +0 -29
  298. package/components/HighlightBox/HighlightBox.stories.d.ts +0 -42
  299. package/components/Icon/Icon.stories.d.ts +0 -38
  300. package/components/Illustration/Illustration.stories.d.ts +0 -34
  301. package/components/Illustration/Illustrations.stories.d.ts +0 -41
  302. package/components/Input/Input.stories.d.ts +0 -94
  303. package/components/Label/Label.stories.d.ts +0 -25
  304. package/components/LazyIcon/LazyIcon.stories.d.ts +0 -25
  305. package/components/LazyIllustration/LazyIllustration.stories.d.ts +0 -38
  306. package/components/LinkList/LinkList.stories.d.ts +0 -49
  307. package/components/List/List.stories.d.ts +0 -52
  308. package/components/Loader/Loader.stories.d.ts +0 -31
  309. package/components/Logo/Logo.stories.d.ts +0 -37
  310. package/components/Modal/Modal.stories.d.ts +0 -76
  311. package/components/NotificationPanel/NotificationPanel.stories.d.ts +0 -60
  312. package/components/Panel/Panel.stories.d.ts +0 -89
  313. package/components/PanelList/PanelList.stories.d.ts +0 -27
  314. package/components/PopMenu/PopMenu.stories.d.ts +0 -39
  315. package/components/PopOver/PopOver.stories.d.ts +0 -38
  316. package/components/Progressbar/Progressbar.stories.d.ts +0 -43
  317. package/components/PromoPanel/PromoPanel.stories.d.ts +0 -45
  318. package/components/RadioButton/RadioButton.stories.d.ts +0 -57
  319. package/components/Select/Select.stories.d.ts +0 -38
  320. package/components/ServiceMessage/ServiceMessage.stories.d.ts +0 -71
  321. package/components/SharingStatus/SharingStatus.stories.d.ts +0 -31
  322. package/components/Slider/Slider.stories.d.ts +0 -52
  323. package/components/Spacer/Spacer.stories.d.ts +0 -17
  324. package/components/StatusDot/StatusDot.stories.d.ts +0 -31
  325. package/components/Step/Step.stories.d.ts +0 -32
  326. package/components/StepButtons/StepButtons.stories.d.ts +0 -19
  327. package/components/Stepper/Stepper.stories.d.ts +0 -38
  328. package/components/Table/Table.stories.d.ts +0 -90
  329. package/components/Tabs/Tabs.stories.d.ts +0 -50
  330. package/components/Tag/Tag.stories.d.ts +0 -48
  331. package/components/TagList/TagList.stories.d.ts +0 -17
  332. package/components/Textarea/Textarea.stories.d.ts +0 -94
  333. package/components/Tile/Tile.stories.d.ts +0 -65
  334. package/components/Title/Title.stories.d.ts +0 -40
  335. package/components/Tooltip/Tooltip.stories.d.ts +0 -34
  336. package/components/Trigger/Trigger.stories.d.ts +0 -52
  337. package/components/Validation/Validation.stories.d.ts +0 -37
  338. package/hoc/withBreakpoint/withBreakpoint.stories.d.ts +0 -17
  339. package/hooks/useBreakpoint.stories.d.ts +0 -16
  340. package/hooks/useDelayedState.stories.d.ts +0 -27
  341. package/hooks/useElementList.stories.d.ts +0 -16
  342. package/hooks/useFocusToggle.stories.d.ts +0 -16
  343. package/hooks/useFocusTrap.stories.d.ts +0 -16
  344. package/hooks/useFocusableElements.stories.d.ts +0 -16
  345. package/hooks/useHover.stories.d.ts +0 -16
  346. package/hooks/useIntersectionObserver.stories.d.ts +0 -16
  347. package/hooks/useInterval.stories.d.ts +0 -16
  348. package/hooks/useIsVisible.stories.d.ts +0 -27
  349. package/hooks/useKeyboardEvent.stories.d.ts +0 -16
  350. package/hooks/useLayoutEvent.stories.d.ts +0 -16
  351. package/hooks/useOutsideEvent.stories.d.ts +0 -16
  352. package/hooks/usePseudoClasses.stories.d.ts +0 -16
  353. package/hooks/useResizeObserver.stories.d.ts +0 -16
  354. package/hooks/useRovingFocus.stories.d.ts +0 -17
  355. package/hooks/useSize.stories.d.ts +0 -16
  356. package/hooks/useSticky.stories.d.ts +0 -16
  357. package/hooks/useUuid.stories.d.ts +0 -16
@@ -1,66 +1,66 @@
1
1
  import t, { useEffect as N } from "react";
2
2
  import n from "classnames";
3
- import { ZIndex as R, AnalyticsId as P, IconSize as c } from "../../constants.js";
4
- import { useFocusTrap as $ } from "../../hooks/useFocusTrap.js";
3
+ import { ZIndex as W, AnalyticsId as R, IconSize as c } from "../../constants.js";
4
+ import { useFocusTrap as P } from "../../hooks/useFocusTrap.js";
5
5
  import { useIsVisible as I } from "../../hooks/useIsVisible.js";
6
6
  import { palette as u } from "../../theme/palette.js";
7
- import { uuid as A } from "../../utils/uuid.js";
7
+ import { uuid as $ } from "../../utils/uuid.js";
8
8
  import w from "../Button/Button.js";
9
- import F from "../Close/Close.js";
9
+ import A from "../Close/Close.js";
10
10
  import { Icon as _ } from "../Icon/Icon.js";
11
- import H from "../Icons/AlertSignFill.js";
12
- import K from "../Icons/AlertSignStroke.js";
13
- import O from "../Icons/CheckOutline.js";
14
- import D from "../Portal/index.js";
15
- import M from "../Title/Title.js";
11
+ import F from "../Icons/AlertSignFill.js";
12
+ import H from "../Icons/AlertSignStroke.js";
13
+ import K from "../Icons/CheckOutline.js";
14
+ import O from "../Portal/index.js";
15
+ import { Title as D } from "../Title/Title.js";
16
16
  import a from "../Modal/styles.module.scss";
17
17
  var V = /* @__PURE__ */ ((e) => (e.normal = "normal", e.warning = "warning", e.error = "error", e.success = "success", e.image = "image", e))(V || {}), Z = /* @__PURE__ */ ((e) => (e.large = "large", e.medium = "medium", e))(Z || {});
18
18
  const j = {
19
19
  variant: "normal",
20
20
  primaryButtonText: "OK",
21
- titleId: A(),
21
+ titleId: $(),
22
22
  className: "",
23
23
  size: "large",
24
- zIndex: R.Modal
25
- }, q = (e) => e === "error" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: H, color: u.cherry500 }) : e === "warning" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: K, color: u.black }) : e === "success" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: O, color: u.kiwi900 }) : null, G = (e, r) => {
24
+ zIndex: W.Modal
25
+ }, q = (e) => e === "error" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: F, color: u.cherry500 }) : e === "warning" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: H, color: u.black }) : e === "success" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: K, color: u.kiwi900 }) : null, G = (e, r) => {
26
26
  const o = q(e);
27
27
  return o ? /* @__PURE__ */ t.createElement("div", { className: a.modal__iconWrapper }, o) : r ? /* @__PURE__ */ t.createElement("div", { className: a.modal__iconWrapper }, t.cloneElement(r, {
28
28
  size: c.Small
29
29
  })) : null;
30
- }, B = (e) => {
30
+ }, J = (e) => {
31
31
  var C, h;
32
32
  const r = t.useRef(null), o = t.useRef(null), m = t.useRef(null);
33
- $(m, !0);
34
- const k = I(r), f = t.useRef(null), z = I(f), s = o.current && o.current.scrollHeight > o.current.clientHeight;
33
+ P(m, !0);
34
+ const B = I(r), f = t.useRef(null), k = I(f), s = o.current && o.current.scrollHeight > o.current.clientHeight;
35
35
  function v(l) {
36
36
  l.key === "Escape" && e.onClose && (l.stopPropagation(), e.onClose());
37
37
  }
38
38
  function E(l) {
39
39
  l.target && d.current === l.target && e.onClose && (l.stopPropagation(), e.onClose());
40
40
  }
41
- function x() {
41
+ function z() {
42
42
  document.body.style.overflow = "hidden";
43
43
  }
44
- function L() {
44
+ function x() {
45
45
  document.body.style.removeProperty("overflow");
46
46
  }
47
- const i = e.variant === "image", d = t.useRef(null), g = e.secondaryButtonText && ((C = e.secondaryButtonText) == null ? void 0 : C.length) > 0 || e.onSuccess, S = e.ariaLabelledBy ? void 0 : e.ariaLabel, y = e.ariaLabelledBy ? e.ariaLabelledBy : e.ariaLabel ? void 0 : e.titleId;
47
+ const i = e.variant === "image", d = t.useRef(null), g = e.secondaryButtonText && ((C = e.secondaryButtonText) == null ? void 0 : C.length) > 0 || e.onSuccess, L = e.ariaLabelledBy ? void 0 : e.ariaLabel, y = e.ariaLabelledBy ? e.ariaLabelledBy : e.ariaLabel ? void 0 : e.titleId;
48
48
  N(() => {
49
49
  const l = d.current;
50
- return x(), !e.disableCloseEvents && l && (l.addEventListener("keydown", v), l.addEventListener("click", E)), () => {
51
- L(), !e.disableCloseEvents && l && (l.removeEventListener("keydown", v), l.removeEventListener("click", E));
50
+ return z(), !e.disableCloseEvents && l && (l.addEventListener("keydown", v), l.addEventListener("click", E)), () => {
51
+ x(), !e.disableCloseEvents && l && (l.removeEventListener("keydown", v), l.removeEventListener("click", E));
52
52
  };
53
53
  }, [e.disableCloseEvents]), N(() => {
54
54
  var l;
55
55
  (l = m.current) == null || l.focus();
56
56
  }, []);
57
- const T = n(
57
+ const S = n(
58
58
  e.className,
59
59
  a.modal,
60
60
  e.variant && a[`modal--${e.variant}`],
61
61
  e.size && a[`modal--${e.size}`],
62
62
  s && !g && a["modal--no-actions"]
63
- ), W = n({
63
+ ), T = n({
64
64
  [a["modal__title--error"]]: e.variant === "error",
65
65
  [a["modal__title--success"]]: e.variant === "success"
66
66
  /* success */
@@ -70,17 +70,17 @@ const j = {
70
70
  ref: d,
71
71
  className: a["modal-overlay"],
72
72
  "data-testid": e.testId,
73
- "data-analyticsid": P.Modal,
73
+ "data-analyticsid": R.Modal,
74
74
  style: { zIndex: e.zIndex }
75
75
  },
76
76
  /* @__PURE__ */ t.createElement("div", { className: a.align }, /* @__PURE__ */ t.createElement(
77
77
  "div",
78
78
  {
79
- className: T,
79
+ className: S,
80
80
  role: "dialog",
81
81
  "aria-modal": "true",
82
82
  tabIndex: -1,
83
- "aria-label": S,
83
+ "aria-label": L,
84
84
  "aria-labelledby": y,
85
85
  ref: m
86
86
  },
@@ -88,7 +88,7 @@ const j = {
88
88
  "div",
89
89
  {
90
90
  className: n(a.modal__shadow, a["modal__shadow--top"], {
91
- [a["modal__shadow--show"]]: !k && s
91
+ [a["modal__shadow--show"]]: !B && s
92
92
  })
93
93
  }
94
94
  ),
@@ -100,7 +100,7 @@ const j = {
100
100
  }),
101
101
  ref: o
102
102
  },
103
- !e.noCloseButton && /* @__PURE__ */ t.createElement("div", { className: a.modal__closeWrapper }, /* @__PURE__ */ t.createElement("div", { className: n(a.modal__closeWrapper__close) }, /* @__PURE__ */ t.createElement(F, { onClick: e.onClose, ariaLabel: e.ariaLabelCloseBtn }))),
103
+ !e.noCloseButton && /* @__PURE__ */ t.createElement("div", { className: a.modal__closeWrapper }, /* @__PURE__ */ t.createElement("div", { className: n(a.modal__closeWrapper__close) }, /* @__PURE__ */ t.createElement(A, { onClick: e.onClose, ariaLabel: e.ariaLabelCloseBtn }))),
104
104
  /* @__PURE__ */ t.createElement(
105
105
  "div",
106
106
  {
@@ -109,7 +109,7 @@ const j = {
109
109
  })
110
110
  },
111
111
  /* @__PURE__ */ t.createElement("div", { ref: r }),
112
- /* @__PURE__ */ t.createElement("div", { className: a.modal__contentWrapper__title }, G(e.variant, e.icon), /* @__PURE__ */ t.createElement(M, { id: y, htmlMarkup: "h3", appearance: "title3", className: W }, e.title), e.afterTitleChildren && /* @__PURE__ */ t.createElement("div", { className: a.modal__afterTitleChildren }, e.afterTitleChildren)),
112
+ /* @__PURE__ */ t.createElement("div", { className: a.modal__contentWrapper__title }, G(e.variant, e.icon), /* @__PURE__ */ t.createElement(D, { id: y, htmlMarkup: "h3", appearance: "title3", className: T }, e.title), e.afterTitleChildren && /* @__PURE__ */ t.createElement("div", { className: a.modal__afterTitleChildren }, e.afterTitleChildren)),
113
113
  i && /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { className: a.modal__contentWrapper__imageWrapper }, e.children), /* @__PURE__ */ t.createElement("span", { className: a.modal__contentWrapper__imageDescription }, e.description)),
114
114
  !i && e.children && /* @__PURE__ */ t.createElement("div", null, e.children),
115
115
  !i && !e.children && /* @__PURE__ */ t.createElement("p", { className: a.modal__description }, e.description),
@@ -120,7 +120,7 @@ const j = {
120
120
  "div",
121
121
  {
122
122
  className: n(a.modal__shadow, a["modal__shadow--bottom"], {
123
- [a["modal__shadow--show"]]: !z && s
123
+ [a["modal__shadow--show"]]: !k && s
124
124
  })
125
125
  }
126
126
  ),
@@ -129,15 +129,14 @@ const j = {
129
129
  ));
130
130
  if (e.printable) {
131
131
  const l = "print-modal";
132
- return /* @__PURE__ */ t.createElement(D, { className: l, testId: "print-modal" }, /* @__PURE__ */ t.createElement("style", { media: "print" }, `body > *:not(.${l}) {display: none;}`), b);
132
+ return /* @__PURE__ */ t.createElement(O, { className: l, testId: "print-modal" }, /* @__PURE__ */ t.createElement("style", { media: "print" }, `body > *:not(.${l}) {display: none;}`), b);
133
133
  }
134
134
  return b;
135
135
  };
136
- B.defaultProps = j;
137
- const se = B;
136
+ J.defaultProps = j;
138
137
  export {
139
138
  Z as ModalSize,
140
139
  V as ModalVariants,
141
- se as default
140
+ J as default
142
141
  };
143
142
  //# sourceMappingURL=Modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { palette } from '../../theme/palette';\nimport { uuid } from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon, { IconSize } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport AlertSignStroke from '../Icons/AlertSignStroke';\nimport CheckOutline from '../Icons/CheckOutline';\nimport Portal from '../Portal';\nimport Title from '../Title/Title';\n\nimport styles from './styles.module.scss';\n\nexport enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n image = 'image',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n\nexport interface ModalProps {\n /** Title of the modal */\n title: string;\n /** id of the modal title */\n titleId?: string;\n /** Description of the modal. Will not render if the modal has children. */\n description?: string;\n /** Changes the visual representation of the modal */\n variant?: keyof typeof ModalVariants;\n /** Change width of the modal (default: large) */\n size?: keyof typeof ModalSize;\n /** Icon displayed in title */\n icon?: React.ReactElement;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Primary button text */\n primaryButtonText?: string;\n /** Secondary button text */\n secondaryButtonText?: string;\n /** Sets the aria-label of the modal */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the modal */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Alternative component to modal */\n children?: React.ReactNode;\n /** Component shown after title */\n afterTitleChildren?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Customize the z-index of the modal */\n zIndex?: number;\n /** Function is called when user clicks primary button */\n onSuccess?: () => void;\n /** Function is called when user clicks secondary button, clicks escape or outside the modal */\n onClose?: () => void;\n /** When enabled the component will be rendered in the bottom of document.body */\n printable?: boolean;\n /** If disabled, clicking escape or outside the modal will not close it */\n disableCloseEvents?: boolean;\n}\n\nconst defaultProps = {\n variant: ModalVariants.normal,\n primaryButtonText: 'OK',\n titleId: uuid(),\n className: '',\n size: ModalSize.large,\n zIndex: ZIndex.Modal,\n};\n\nconst getVariantIcon = (variant?: ModalProps['variant']): JSX.Element | null => {\n if (variant === ModalVariants.error) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignFill} color={palette.cherry500} />;\n } else if (variant === ModalVariants.warning) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignStroke} color={palette.black} />;\n } else if (variant === ModalVariants.success) {\n return <Icon size={IconSize.Small} svgIcon={CheckOutline} color={palette.kiwi900} />;\n }\n return null;\n};\n\nconst getIcon = (variant?: ModalProps['variant'], icon?: ModalProps['icon']): JSX.Element | null => {\n const variantIcon = getVariantIcon(variant);\n if (variantIcon) {\n return <div className={styles.modal__iconWrapper}>{variantIcon}</div>;\n }\n if (icon) {\n return (\n <div className={styles.modal__iconWrapper}>\n {React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal = (props: ModalProps): JSX.Element => {\n const topContent = React.useRef<HTMLDivElement>(null);\n const modalContentRef = React.useRef<HTMLDivElement>(null);\n const dialogRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(dialogRef, true);\n const topContentVisible = useIsVisible(topContent);\n const bottomContent = React.useRef<HTMLDivElement>(null);\n const bottomContentVisible = useIsVisible(bottomContent);\n const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;\n\n function handleKeyboardEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape' && props.onClose) {\n e.stopPropagation();\n props.onClose();\n }\n }\n\n function handleClickEvent(event: MouseEvent): void {\n if (event.target && overlayRef.current === event.target && props.onClose) {\n event.stopPropagation();\n props.onClose();\n }\n }\n\n function disableBodyScroll(): void {\n document.body.style.overflow = 'hidden';\n }\n\n function enableBodyScroll(): void {\n document.body.style.removeProperty('overflow');\n }\n\n /* Displays a full window size modal with image */\n const imageView = props.variant === ModalVariants.image;\n\n const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess;\n\n // ariaLabelledBy prioriteres over ariaLabel, men dersom ariaLabel brukes trengs ikke ariaLabelledBy\n const ariaLabel = !props.ariaLabelledBy ? props.ariaLabel : undefined;\n const ariaLabelledBy = props.ariaLabelledBy ? props.ariaLabelledBy : !props.ariaLabel ? props.titleId : undefined;\n\n useEffect(() => {\n const overlayElement = overlayRef.current;\n disableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.addEventListener('keydown', handleKeyboardEvent);\n overlayElement.addEventListener('click', handleClickEvent);\n }\n return (): void => {\n enableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.removeEventListener('keydown', handleKeyboardEvent);\n overlayElement.removeEventListener('click', handleClickEvent);\n }\n };\n }, [props.disableCloseEvents]);\n\n useEffect(() => {\n dialogRef.current?.focus();\n }, []);\n\n const dialogClasses = cn(\n props.className,\n styles.modal,\n props.variant && styles[`modal--${props.variant}`],\n props.size && styles[`modal--${props.size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: props.variant === ModalVariants.error,\n [styles['modal__title--success']]: props.variant === ModalVariants.success,\n });\n\n const Component = (\n <div data-testid=\"dialog-container\">\n <div\n ref={overlayRef}\n className={styles['modal-overlay']}\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.Modal}\n style={{ zIndex: props.zIndex }}\n >\n <div className={styles.align}>\n <div\n className={dialogClasses}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={dialogRef}\n >\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--top'], {\n [styles['modal__shadow--show']]: !topContentVisible && contentIsScrollable,\n })}\n />\n <div\n className={cn(styles.modal__contentWrapper, {\n [styles['modal__contentWrapper--image']]: imageView,\n })}\n ref={modalContentRef}\n >\n {!props.noCloseButton && (\n <div className={styles.modal__closeWrapper}>\n <div className={cn(styles.modal__closeWrapper__close)}>\n <Close onClick={props.onClose} ariaLabel={props.ariaLabelCloseBtn} />\n </div>\n </div>\n )}\n <div\n className={cn(props.size && styles[`modal__contentWrapper__scroll--${props.size}`], {\n [styles['modal__contentWrapper__scroll--image']]: imageView,\n })}\n >\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(props.variant, props.icon)}\n <Title id={ariaLabelledBy} htmlMarkup=\"h3\" appearance=\"title3\" className={titleClasses}>\n {props.title}\n </Title>\n {props.afterTitleChildren && <div className={styles['modal__afterTitleChildren']}>{props.afterTitleChildren}</div>}\n </div>\n {imageView && (\n <div>\n <div className={styles['modal__contentWrapper__imageWrapper']}>{props.children}</div>\n <span className={styles['modal__contentWrapper__imageDescription']}>{props.description}</span>\n </div>\n )}\n {!imageView && props.children && <div>{props.children}</div>}\n {!imageView && !props.children && <p className={styles.modal__description}>{props.description}</p>}\n <div ref={bottomContent} />\n </div>\n </div>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--bottom'], {\n [styles['modal__shadow--show']]: !bottomContentVisible && contentIsScrollable,\n })}\n />\n {showActions && (\n <div className={cn(styles['modal__call-to-action'], props.size && styles[`modal__call-to-action--${props.size}`])}>\n {props.onSuccess && <Button onClick={props.onSuccess}>{props.primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n\n if (props.printable) {\n const printModal = 'print-modal';\n return (\n <Portal className={printModal} testId=\"print-modal\">\n <style media=\"print\">{`body > *:not(.${printModal}) {display: none;}`}</style>\n {Component}\n </Portal>\n );\n }\n\n return Component;\n};\n\nModal.defaultProps = defaultProps;\n\nexport default Modal;\n"],"names":["ModalVariants","ModalSize","defaultProps","uuid","ZIndex","getVariantIcon","variant","React","Icon","IconSize","AlertSignFill","palette","AlertSignStroke","CheckOutline","getIcon","icon","variantIcon","styles","Modal","props","topContent","modalContentRef","dialogRef","useFocusTrap","topContentVisible","useIsVisible","bottomContent","bottomContentVisible","contentIsScrollable","handleKeyboardEvent","e","handleClickEvent","event","overlayRef","disableBodyScroll","enableBodyScroll","imageView","showActions","_a","ariaLabel","ariaLabelledBy","useEffect","overlayElement","dialogClasses","cn","titleClasses","Component","AnalyticsId","Close","Title","Button","_b","printModal","Portal","Modal$1"],"mappings":";;;;;;;;;;;;;;;;AAoBY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,QAAQ,SALEA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AAkDZ,MAAMC,IAAe;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAASC,EAAK;AAAA,EACd,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQC,EAAO;AACjB,GAEMC,IAAiB,CAACC,MAClBA,MAAY,UACPC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASC,GAAe,OAAOC,EAAQ,UAAW,CAAA,IAC5EL,MAAY,YACdC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASG,GAAiB,OAAOD,EAAQ,MAAO,CAAA,IAC1EL,MAAY,YACdC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASI,GAAc,OAAOF,EAAQ,QAAS,CAAA,IAE7E,MAGHG,IAAU,CAACR,GAAiCS,MAAkD;AAC5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,cAAA2C,GAAA,EAAO,SAAQ,cAAa,SAAS/B,EAAM,QACzC,GAAAA,EAAM,mBACT,CAEJ;AAAA,IAAA,CAGN;AAAA,EAAA,CAEJ;AAGF,MAAIA,EAAM,WAAW;AACnB,UAAMiC,IAAa;AACnB,WACG7C,gBAAAA,EAAA,cAAA8C,GAAA,EAAO,WAAWD,GAAY,QAAO,cACpC,GAAA7C,gBAAAA,EAAA,cAAC,SAAM,EAAA,OAAM,QAAS,GAAA,iBAAiB6C,CAAU,oBAAqB,GACrEN,CACH;AAAA,EAEJ;AAEO,SAAAA;AACT;AAEA5B,EAAM,eAAehB;AAErB,MAAAoD,KAAepC;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { palette } from '../../theme/palette';\nimport { uuid } from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon, { IconSize } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport AlertSignStroke from '../Icons/AlertSignStroke';\nimport CheckOutline from '../Icons/CheckOutline';\nimport Portal from '../Portal';\nimport Title from '../Title/Title';\n\nimport styles from './styles.module.scss';\n\nexport enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n image = 'image',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n\nexport interface ModalProps {\n /** Title of the modal */\n title: string;\n /** id of the modal title */\n titleId?: string;\n /** Description of the modal. Will not render if the modal has children. */\n description?: string;\n /** Changes the visual representation of the modal */\n variant?: keyof typeof ModalVariants;\n /** Change width of the modal (default: large) */\n size?: keyof typeof ModalSize;\n /** Icon displayed in title */\n icon?: React.ReactElement;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Primary button text */\n primaryButtonText?: string;\n /** Secondary button text */\n secondaryButtonText?: string;\n /** Sets the aria-label of the modal */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the modal */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Alternative component to modal */\n children?: React.ReactNode;\n /** Component shown after title */\n afterTitleChildren?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Customize the z-index of the modal */\n zIndex?: number;\n /** Function is called when user clicks primary button */\n onSuccess?: () => void;\n /** Function is called when user clicks secondary button, clicks escape or outside the modal */\n onClose?: () => void;\n /** When enabled the component will be rendered in the bottom of document.body */\n printable?: boolean;\n /** If disabled, clicking escape or outside the modal will not close it */\n disableCloseEvents?: boolean;\n}\n\nconst defaultProps = {\n variant: ModalVariants.normal,\n primaryButtonText: 'OK',\n titleId: uuid(),\n className: '',\n size: ModalSize.large,\n zIndex: ZIndex.Modal,\n};\n\nconst getVariantIcon = (variant?: ModalProps['variant']): JSX.Element | null => {\n if (variant === ModalVariants.error) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignFill} color={palette.cherry500} />;\n } else if (variant === ModalVariants.warning) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignStroke} color={palette.black} />;\n } else if (variant === ModalVariants.success) {\n return <Icon size={IconSize.Small} svgIcon={CheckOutline} color={palette.kiwi900} />;\n }\n return null;\n};\n\nconst getIcon = (variant?: ModalProps['variant'], icon?: ModalProps['icon']): JSX.Element | null => {\n const variantIcon = getVariantIcon(variant);\n if (variantIcon) {\n return <div className={styles.modal__iconWrapper}>{variantIcon}</div>;\n }\n if (icon) {\n return (\n <div className={styles.modal__iconWrapper}>\n {React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal = (props: ModalProps): JSX.Element => {\n const topContent = React.useRef<HTMLDivElement>(null);\n const modalContentRef = React.useRef<HTMLDivElement>(null);\n const dialogRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(dialogRef, true);\n const topContentVisible = useIsVisible(topContent);\n const bottomContent = React.useRef<HTMLDivElement>(null);\n const bottomContentVisible = useIsVisible(bottomContent);\n const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;\n\n function handleKeyboardEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape' && props.onClose) {\n e.stopPropagation();\n props.onClose();\n }\n }\n\n function handleClickEvent(event: MouseEvent): void {\n if (event.target && overlayRef.current === event.target && props.onClose) {\n event.stopPropagation();\n props.onClose();\n }\n }\n\n function disableBodyScroll(): void {\n document.body.style.overflow = 'hidden';\n }\n\n function enableBodyScroll(): void {\n document.body.style.removeProperty('overflow');\n }\n\n /* Displays a full window size modal with image */\n const imageView = props.variant === ModalVariants.image;\n\n const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess;\n\n // ariaLabelledBy prioriteres over ariaLabel, men dersom ariaLabel brukes trengs ikke ariaLabelledBy\n const ariaLabel = !props.ariaLabelledBy ? props.ariaLabel : undefined;\n const ariaLabelledBy = props.ariaLabelledBy ? props.ariaLabelledBy : !props.ariaLabel ? props.titleId : undefined;\n\n useEffect(() => {\n const overlayElement = overlayRef.current;\n disableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.addEventListener('keydown', handleKeyboardEvent);\n overlayElement.addEventListener('click', handleClickEvent);\n }\n return (): void => {\n enableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.removeEventListener('keydown', handleKeyboardEvent);\n overlayElement.removeEventListener('click', handleClickEvent);\n }\n };\n }, [props.disableCloseEvents]);\n\n useEffect(() => {\n dialogRef.current?.focus();\n }, []);\n\n const dialogClasses = cn(\n props.className,\n styles.modal,\n props.variant && styles[`modal--${props.variant}`],\n props.size && styles[`modal--${props.size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: props.variant === ModalVariants.error,\n [styles['modal__title--success']]: props.variant === ModalVariants.success,\n });\n\n const Component = (\n <div data-testid=\"dialog-container\">\n <div\n ref={overlayRef}\n className={styles['modal-overlay']}\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.Modal}\n style={{ zIndex: props.zIndex }}\n >\n <div className={styles.align}>\n <div\n className={dialogClasses}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={dialogRef}\n >\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--top'], {\n [styles['modal__shadow--show']]: !topContentVisible && contentIsScrollable,\n })}\n />\n <div\n className={cn(styles.modal__contentWrapper, {\n [styles['modal__contentWrapper--image']]: imageView,\n })}\n ref={modalContentRef}\n >\n {!props.noCloseButton && (\n <div className={styles.modal__closeWrapper}>\n <div className={cn(styles.modal__closeWrapper__close)}>\n <Close onClick={props.onClose} ariaLabel={props.ariaLabelCloseBtn} />\n </div>\n </div>\n )}\n <div\n className={cn(props.size && styles[`modal__contentWrapper__scroll--${props.size}`], {\n [styles['modal__contentWrapper__scroll--image']]: imageView,\n })}\n >\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(props.variant, props.icon)}\n <Title id={ariaLabelledBy} htmlMarkup=\"h3\" appearance=\"title3\" className={titleClasses}>\n {props.title}\n </Title>\n {props.afterTitleChildren && <div className={styles['modal__afterTitleChildren']}>{props.afterTitleChildren}</div>}\n </div>\n {imageView && (\n <div>\n <div className={styles['modal__contentWrapper__imageWrapper']}>{props.children}</div>\n <span className={styles['modal__contentWrapper__imageDescription']}>{props.description}</span>\n </div>\n )}\n {!imageView && props.children && <div>{props.children}</div>}\n {!imageView && !props.children && <p className={styles.modal__description}>{props.description}</p>}\n <div ref={bottomContent} />\n </div>\n </div>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--bottom'], {\n [styles['modal__shadow--show']]: !bottomContentVisible && contentIsScrollable,\n })}\n />\n {showActions && (\n <div className={cn(styles['modal__call-to-action'], props.size && styles[`modal__call-to-action--${props.size}`])}>\n {props.onSuccess && <Button onClick={props.onSuccess}>{props.primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n\n if (props.printable) {\n const printModal = 'print-modal';\n return (\n <Portal className={printModal} testId=\"print-modal\">\n <style media=\"print\">{`body > *:not(.${printModal}) {display: none;}`}</style>\n {Component}\n </Portal>\n );\n }\n\n return Component;\n};\n\nModal.defaultProps = defaultProps;\n\nexport default Modal;\n"],"names":["ModalVariants","ModalSize","defaultProps","uuid","ZIndex","getVariantIcon","variant","React","Icon","IconSize","AlertSignFill","palette","AlertSignStroke","CheckOutline","getIcon","icon","variantIcon","styles","Modal","props","topContent","modalContentRef","dialogRef","useFocusTrap","topContentVisible","useIsVisible","bottomContent","bottomContentVisible","contentIsScrollable","handleKeyboardEvent","e","handleClickEvent","event","overlayRef","disableBodyScroll","enableBodyScroll","imageView","showActions","_a","ariaLabel","ariaLabelledBy","useEffect","overlayElement","dialogClasses","cn","titleClasses","Component","AnalyticsId","Close","Title","Button","_b","printModal","Portal"],"mappings":";;;;;;;;;;;;;;;;AAoBY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,QAAQ,SALEA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AAkDZ,MAAMC,IAAe;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAASC,EAAK;AAAA,EACd,WAAW;AAAA,EACX,MAAM;AA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O,qBAAqB,CAAC,GAAG,CAACU,KAAwBC;AAAA,UAAA,CAC3D;AAAA,QAAA;AAAA,MACH;AAAA,MACCS,KACE9B,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWqC,EAAG3B,EAAO,uBAAuB,GAAGE,EAAM,QAAQF,EAAO,0BAA0BE,EAAM,IAAI,EAAE,CAAC,KAC7GA,EAAM,aAAcZ,gBAAAA,EAAA,cAAA2C,GAAA,EAAO,SAAS/B,EAAM,aAAYA,EAAM,iBAAkB,GAC9EA,EAAM,yBAAuBgC,IAAAhC,EAAM,wBAAN,gBAAAgC,EAA2B,UAAS,KAC/D5C,gBAAAA,EAAA,cAAA2C,GAAA,EAAO,SAAQ,cAAa,SAAS/B,EAAM,QACzC,GAAAA,EAAM,mBACT,CAEJ;AAAA,IAAA,CAGN;AAAA,EAAA,CAEJ;AAGF,MAAIA,EAAM,WAAW;AACnB,UAAMiC,IAAa;AACnB,WACG7C,gBAAAA,EAAA,cAAA8C,GAAA,EAAO,WAAWD,GAAY,QAAO,cACpC,GAAA7C,gBAAAA,EAAA,cAAC,SAAM,EAAA,OAAM,QAAS,GAAA,iBAAiB6C,CAAU,oBAAqB,GACrEN,CACH;AAAA,EAEJ;AAEO,SAAAA;AACT;AAEA5B,EAAM,eAAehB;"}
@@ -175,22 +175,22 @@
175
175
 
176
176
  &__scroll {
177
177
  &--large {
178
- padding: getSpacer(xl) getSpacer(m) getSpacer(2xs) getSpacer(m);
178
+ padding: getSpacer(xl) getSpacer(m) getSpacer(2xs);
179
179
 
180
180
  @media (min-width: map.get($grid-breakpoints, md)) {
181
- padding: getSpacer(xl) getSpacer(xl) getSpacer(2xs) getSpacer(xl);
181
+ padding: getSpacer(xl) getSpacer(xl) getSpacer(2xs);
182
182
  }
183
183
  }
184
184
 
185
185
  &--medium {
186
- padding: getSpacer(l) getSpacer(m) getSpacer(2xs) getSpacer(m);
186
+ padding: getSpacer(l) getSpacer(m) getSpacer(2xs);
187
187
 
188
188
  @media (min-width: map.get($grid-breakpoints, md)) {
189
- padding: getSpacer(xl) getSpacer(m) getSpacer(2xs) getSpacer(m);
189
+ padding: getSpacer(xl) getSpacer(m) getSpacer(2xs);
190
190
  }
191
191
  }
192
192
  &--large#{&}--image {
193
- padding: getSpacer(xl) getSpacer(2xs) getSpacer(l) getSpacer(2xs);
193
+ padding: getSpacer(xl) getSpacer(2xs) getSpacer(l);
194
194
  }
195
195
  }
196
196
 
@@ -234,15 +234,15 @@
234
234
  }
235
235
 
236
236
  &--large {
237
- padding: getSpacer(l) getSpacer(m) 0 getSpacer(m);
237
+ padding: getSpacer(l) getSpacer(m) 0;
238
238
 
239
239
  @media (min-width: map.get($grid-breakpoints, md)) {
240
- padding: getSpacer(l) getSpacer(xl) 0 getSpacer(xl);
240
+ padding: getSpacer(l) getSpacer(xl) 0;
241
241
  }
242
242
  }
243
243
 
244
244
  &--medium {
245
- padding: getSpacer(m) getSpacer(m) 0 getSpacer(m);
245
+ padding: getSpacer(m) getSpacer(m) 0;
246
246
  }
247
247
  }
248
248
 
@@ -2,9 +2,9 @@ import t from "react";
2
2
  import c from "classnames";
3
3
  import { AnalyticsId as R, IconSize as C } from "../../constants.js";
4
4
  import { useUuid as T } from "../../hooks/useUuid.js";
5
- import { getColor as $ } from "../../theme/currys/color.js";
6
- import { getAriaLabelAttributes as F } from "../../utils/accessibility.js";
7
- import V from "../Badge/NotificationBadge.js";
5
+ import { getColor as F } from "../../theme/currys/color.js";
6
+ import { getAriaLabelAttributes as V } from "../../utils/accessibility.js";
7
+ import $ from "../Badge/NotificationBadge.js";
8
8
  import H from "../Close/Close.js";
9
9
  import M from "../Expander/Expander.js";
10
10
  import e from "../NotificationPanel/styles.module.scss";
@@ -14,7 +14,7 @@ const U = ({ fluid: r, children: s }) => {
14
14
  return /* @__PURE__ */ t.createElement("div", { className: i }, s);
15
15
  }
16
16
  return s;
17
- }, W = t.forwardRef((r, s) => {
17
+ }, Z = t.forwardRef((r, s) => {
18
18
  const {
19
19
  children: i,
20
20
  variant: o = "info",
@@ -34,20 +34,20 @@ const U = ({ fluid: r, children: s }) => {
34
34
  role: g,
35
35
  testId: w
36
36
  } = r, p = T(S), A = () => {
37
- const b = a === "outline", P = c(e["notification-panel__content"]), k = c(e["notification-panel__label"], {
37
+ const b = a === "outline", k = c(e["notification-panel__content"]), y = c(e["notification-panel__label"], {
38
38
  [e["notification-panel__label--no-content"]]: !i && !l,
39
39
  [e["notification-panel__label--compact"]]: !!a,
40
40
  [e["notification-panel__label--outline"]]: b
41
- }), y = c(e["notification-panel__children"], {
41
+ }), z = c(e["notification-panel__children"], {
42
42
  [e["notification-panel__children--with-label"]]: n,
43
43
  [e["notification-panel__children--expander-no-label"]]: l && !n,
44
44
  [e["notification-panel__children--outline"]]: b
45
- }), z = h, [x, O] = t.useState(N);
46
- return /* @__PURE__ */ t.createElement("div", { className: P, id: n ? void 0 : p }, n && /* @__PURE__ */ t.createElement(z, { className: k, id: p }, n), i && /* @__PURE__ */ t.createElement("div", { className: y }, i), l && d && f && !a && /* @__PURE__ */ t.createElement(
45
+ }), O = h, [x, P] = t.useState(N);
46
+ return /* @__PURE__ */ t.createElement("div", { className: k, id: n ? void 0 : p }, n && /* @__PURE__ */ t.createElement(O, { className: y, id: p }, n), i && /* @__PURE__ */ t.createElement("div", { className: z }, i), l && d && f && !a && /* @__PURE__ */ t.createElement(
47
47
  M,
48
48
  {
49
49
  title: x ? d : f,
50
- onExpand: O,
50
+ onExpand: P,
51
51
  expanded: x,
52
52
  testId: "expand"
53
53
  },
@@ -65,7 +65,7 @@ const U = ({ fluid: r, children: s }) => {
65
65
  [e["notification-panel--dismissable"]]: m
66
66
  },
67
67
  I
68
- ), _ = g || (o === "alert" || o === "error") && "alert" || void 0, L = _ ? F({ label: n, id: p }) : void 0;
68
+ ), _ = g || (o === "alert" || o === "error") && "alert" || void 0, L = _ ? V({ label: n, id: p }) : void 0;
69
69
  return /* @__PURE__ */ t.createElement(U, { fluid: v }, /* @__PURE__ */ t.createElement(
70
70
  "div",
71
71
  {
@@ -77,18 +77,18 @@ const U = ({ fluid: r, children: s }) => {
77
77
  ...L
78
78
  },
79
79
  /* @__PURE__ */ t.createElement(
80
- V,
80
+ $,
81
81
  {
82
82
  variant: o == "alert" ? "error" : o,
83
83
  size: a ? C.XSmall : C.Small,
84
84
  className: e["notification-panel__icon"]
85
85
  }
86
86
  ),
87
- m && /* @__PURE__ */ t.createElement("span", { className: e["notification-panel__close"] }, /* @__PURE__ */ t.createElement(H, { ariaLabel: r.ariaLabelCloseBtn, onClick: E, color: $("black") })),
87
+ m && /* @__PURE__ */ t.createElement("span", { className: e["notification-panel__close"] }, /* @__PURE__ */ t.createElement(H, { ariaLabel: r.ariaLabelCloseBtn, onClick: E, color: F("black") })),
88
88
  A()
89
89
  ));
90
- }), ee = W;
90
+ });
91
91
  export {
92
- ee as default
92
+ Z as default
93
93
  };
94
94
  //# sourceMappingURL=NotificationPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPanel.js","sources":["../../../src/components/NotificationPanel/NotificationPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport NotificationBadge from '../Badge/NotificationBadge';\nimport Close from '../Close';\nimport Expander from '../Expander';\n\nimport styles from './styles.module.scss';\n\nexport type NotificationPanelVariants = 'info' | 'warn' | 'alert' | 'error' | 'success';\nexport type NotificationCompactVariants = 'basic' | 'outline';\nexport type NotificationPanelSizes = 'small' | 'medium' | 'large';\nexport type LabelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'span';\n\nexport interface NotificationPanelProps {\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds inner child elements. */\n children?: React.ReactNode;\n /** Adds inner expander elements. */\n expanderChildren?: React.ReactNode;\n /** Text for expanderButton. */\n expanderButtonText?: string;\n /** Text for expanderButton when closed. */\n expanderButtonClosedText?: string;\n /** Makes expander be open from start. */\n expanderOpenFromStart?: boolean;\n /** Changes the visual representation of the notification panel. */\n variant?: NotificationPanelVariants;\n /** Makes the panel more compact. Available in basic and outline. */\n compactVariant?: NotificationCompactVariants;\n /** Sets a fixed size for the content container. */\n size?: NotificationPanelSizes;\n /** Used in combination with dismissiable property to close the notification panel. */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Toggles the close button in the top right corner. */\n dismissable?: boolean;\n /** Enables a fluid outer container that spans the entire width of parent. */\n fluid?: boolean;\n /** Sets a label for the notification panel. */\n label?: string;\n /** Changes the underlying element of the label. */\n labelHtmlMarkup?: LabelTags;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Custom id for the label */\n labelId?: string;\n /** Custom role for the panel. Default is no role. If variant is alert or crisis, the aria role will be set to \"alert\" unless the role-prop is also set. */\n role?: 'region' | 'alert';\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ntype WrapFluidProps = Pick<NotificationPanelProps, 'fluid'> & {\n children: React.ReactElement;\n};\n\nconst FluidWrapper: React.FC<WrapFluidProps> = ({ fluid, children }) => {\n if (fluid) {\n const fluidClasses = classNames(styles['fluid-wrapper']);\n\n return <div className={fluidClasses}>{children}</div>;\n }\n return children;\n};\n\nconst NotificationPanel = React.forwardRef<HTMLDivElement, NotificationPanelProps>((props, ref) => {\n const {\n children,\n variant = 'info',\n dismissable = false,\n onClick,\n expanderChildren,\n expanderButtonText,\n expanderButtonClosedText,\n expanderOpenFromStart = false,\n compactVariant,\n label,\n labelHtmlMarkup = 'h1',\n fluid = false,\n size,\n className,\n labelId,\n role,\n testId,\n } = props;\n const uuid = useUuid(labelId);\n const renderContent = (): JSX.Element => {\n const outlineVariant = compactVariant === 'outline';\n const contentClasses = classNames(styles['notification-panel__content']);\n const labelClasses = classNames(styles['notification-panel__label'], {\n [styles['notification-panel__label--no-content']]: !children && !expanderChildren,\n [styles['notification-panel__label--compact']]: !!compactVariant,\n [styles['notification-panel__label--outline']]: outlineVariant,\n });\n const childrenClasses = classNames(styles['notification-panel__children'], {\n [styles['notification-panel__children--with-label']]: label,\n [styles['notification-panel__children--expander-no-label']]: expanderChildren && !label,\n [styles['notification-panel__children--outline']]: outlineVariant,\n });\n const CustomTag = labelHtmlMarkup;\n\n const [expanderOpen, setExpanderOpen] = React.useState(expanderOpenFromStart);\n return (\n <div className={contentClasses} id={!label ? uuid : undefined}>\n {label && (\n <CustomTag className={labelClasses} id={uuid}>\n {label}\n </CustomTag>\n )}\n {children && <div className={childrenClasses}>{children}</div>}\n {expanderChildren && expanderButtonText && expanderButtonClosedText && !compactVariant && (\n <Expander\n title={expanderOpen ? expanderButtonText : expanderButtonClosedText}\n onExpand={setExpanderOpen}\n expanded={expanderOpen}\n testId=\"expand\"\n >\n {expanderChildren}\n </Expander>\n )}\n </div>\n );\n };\n\n const notificationPanelClasses = classNames(\n styles['notification-panel'],\n styles[`notification-panel--${variant}`],\n size && styles[`notification-panel--${size}`],\n {\n [styles['notification-panel--compact']]: !!compactVariant,\n [styles['notification-panel--compact--basic']]: compactVariant === 'basic',\n [styles['notification-panel--compact--outline']]: compactVariant === 'outline',\n [styles['notification-panel--with-content']]: expanderChildren || (label && children),\n [styles['notification-panel--dismissable']]: dismissable,\n },\n className\n );\n\n const ariaRole = role || ((variant === 'alert' || variant === 'error') && 'alert') || undefined;\n const ariaLabelAttributes = ariaRole ? getAriaLabelAttributes({ label, id: uuid }) : undefined;\n\n return (\n <FluidWrapper fluid={fluid}>\n <div\n ref={ref}\n role={ariaRole}\n data-testid={testId}\n data-analyticsid={AnalyticsId.NotificationPanel}\n className={notificationPanelClasses}\n {...ariaLabelAttributes}\n >\n <NotificationBadge\n variant={variant == 'alert' ? 'error' : variant}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n className={styles['notification-panel__icon']}\n />\n {dismissable && (\n <span className={styles['notification-panel__close']}>\n <Close ariaLabel={props.ariaLabelCloseBtn} onClick={onClick} color={getColor('black')} />\n </span>\n )}\n {renderContent()}\n </div>\n </FluidWrapper>\n );\n});\n\nexport default NotificationPanel;\n"],"names":["FluidWrapper","fluid","children","fluidClasses","classNames","styles","React","NotificationPanel","props","ref","variant","dismissable","onClick","expanderChildren","expanderButtonText","expanderButtonClosedText","expanderOpenFromStart","compactVariant","label","labelHtmlMarkup","size","className","labelId","role","testId","uuid","useUuid","renderContent","outlineVariant","contentClasses","labelClasses","childrenClasses","CustomTag","expanderOpen","setExpanderOpen","Expander","notificationPanelClasses","ariaRole","ariaLabelAttributes","getAriaLabelAttributes","AnalyticsId","NotificationBadge","IconSize","Close","getColor","NotificationPanel$1"],"mappings":";;;;;;;;;;AA8DA,MAAMA,IAAyC,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AACtE,MAAID,GAAO;AACT,UAAME,IAAeC,EAAWC,EAAO,eAAe,CAAC;AAEvD,WAAQC,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWH,EAAA,GAAeD,CAAS;AAAA,EACjD;AACO,SAAAA;AACT,GAEMK,IAAoBD,EAAM,WAAmD,CAACE,GAAOC,MAAQ;AAC3F,QAAA;AAAA,IACJ,UAAAP;AAAA,IACA,SAAAQ,IAAU;AAAA,IACV,aAAAC,IAAc;AAAA,IACd,SAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,uBAAAC,IAAwB;AAAA,IACxB,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,OAAAlB,IAAQ;AAAA,IACR,MAAAmB;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAhB,GACEiB,IAAOC,EAAQJ,CAAO,GACtBK,IAAgB,MAAmB;AACvC,UAAMC,IAAiBX,MAAmB,WACpCY,IAAiBzB,EAAWC,EAAO,6BAA6B,C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O,oCAAoC,CAAC,GAAGY,MAAmB;AAAA,MACnE,CAACZ,EAAO,sCAAsC,CAAC,GAAGY,MAAmB;AAAA,MACrE,CAACZ,EAAO,kCAAkC,CAAC,GAAGQ,KAAqBK,KAAShB;AAAA,MAC5E,CAACG,EAAO,iCAAiC,CAAC,GAAGM;AAAA,IAC/C;AAAA,IACAU;AAAA,EAAA,GAGIgB,IAAWd,MAAUb,MAAY,WAAWA,MAAY,YAAY,WAAY,QAChF4B,IAAsBD,IAAWE,EAAuB,EAAE,OAAArB,GAAO,IAAIO,EAAA,CAAM,IAAI;AAGnF,SAAAnB,gBAAAA,EAAA,cAACN,KAAa,OAAAC,EACZ,GAAAK,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAG;AAAA,MACA,MAAM4B;AAAA,MACN,eAAab;AAAA,MACb,oBAAkBgB,EAAY;AAAA,MAC9B,WAAWJ;AAAA,MACV,GAAGE;AAAA,IAAA;AAAA,IAEJhC,gBAAAA,EAAA;AAAA,MAACmC;AAAA,MAAA;AAAA,QACC,SAAS/B,KAAW,UAAU,UAAUA;AAAA,QACxC,MAAMO,IAAiByB,EAAS,SAASA,EAAS;AAAA,QAClD,WAAWrC,EAAO,0BAA0B;AAAA,MAAA;AAAA,IAC9C;AAAA,IACCM,KACEL,gBAAAA,EAAA,cAAA,QAAA,EAAK,WAAWD,EAAO,2BAA2B,EACjD,GAAAC,gBAAAA,EAAA,cAACqC,GAAM,EAAA,WAAWnC,EAAM,mBAAmB,SAAAI,GAAkB,OAAOgC,EAAS,OAAO,GAAG,CACzF;AAAA,IAEDjB,EAAc;AAAA,EAAA,CAEnB;AAEJ,CAAC,GAEDkB,KAAetC;"}
1
+ {"version":3,"file":"NotificationPanel.js","sources":["../../../src/components/NotificationPanel/NotificationPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport NotificationBadge from '../Badge/NotificationBadge';\nimport Close from '../Close';\nimport Expander from '../Expander';\n\nimport styles from './styles.module.scss';\n\nexport type NotificationPanelVariants = 'info' | 'warn' | 'alert' | 'error' | 'success';\nexport type NotificationCompactVariants = 'basic' | 'outline';\nexport type NotificationPanelSizes = 'small' | 'medium' | 'large';\nexport type LabelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'span';\n\nexport interface NotificationPanelProps {\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds inner child elements. */\n children?: React.ReactNode;\n /** Adds inner expander elements. */\n expanderChildren?: React.ReactNode;\n /** Text for expanderButton. */\n expanderButtonText?: string;\n /** Text for expanderButton when closed. */\n expanderButtonClosedText?: string;\n /** Makes expander be open from start. */\n expanderOpenFromStart?: boolean;\n /** Changes the visual representation of the notification panel. */\n variant?: NotificationPanelVariants;\n /** Makes the panel more compact. Available in basic and outline. */\n compactVariant?: NotificationCompactVariants;\n /** Sets a fixed size for the content container. */\n size?: NotificationPanelSizes;\n /** Used in combination with dismissiable property to close the notification panel. */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Toggles the close button in the top right corner. */\n dismissable?: boolean;\n /** Enables a fluid outer container that spans the entire width of parent. */\n fluid?: boolean;\n /** Sets a label for the notification panel. */\n label?: string;\n /** Changes the underlying element of the label. */\n labelHtmlMarkup?: LabelTags;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Custom id for the label */\n labelId?: string;\n /** Custom role for the panel. Default is no role. If variant is alert or crisis, the aria role will be set to \"alert\" unless the role-prop is also set. */\n role?: 'region' | 'alert';\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ntype WrapFluidProps = Pick<NotificationPanelProps, 'fluid'> & {\n children: React.ReactElement;\n};\n\nconst FluidWrapper: React.FC<WrapFluidProps> = ({ fluid, children }) => {\n if (fluid) {\n const fluidClasses = classNames(styles['fluid-wrapper']);\n\n return <div className={fluidClasses}>{children}</div>;\n }\n return children;\n};\n\nconst NotificationPanel = React.forwardRef<HTMLDivElement, NotificationPanelProps>((props, ref) => {\n const {\n children,\n variant = 'info',\n dismissable = false,\n onClick,\n expanderChildren,\n expanderButtonText,\n expanderButtonClosedText,\n expanderOpenFromStart = false,\n compactVariant,\n label,\n labelHtmlMarkup = 'h1',\n fluid = false,\n size,\n className,\n labelId,\n role,\n testId,\n } = props;\n const uuid = useUuid(labelId);\n const renderContent = (): JSX.Element => {\n const outlineVariant = compactVariant === 'outline';\n const contentClasses = classNames(styles['notification-panel__content']);\n const labelClasses = classNames(styles['notification-panel__label'], {\n [styles['notification-panel__label--no-content']]: !children && !expanderChildren,\n [styles['notification-panel__label--compact']]: !!compactVariant,\n [styles['notification-panel__label--outline']]: outlineVariant,\n });\n const childrenClasses = classNames(styles['notification-panel__children'], {\n [styles['notification-panel__children--with-label']]: label,\n [styles['notification-panel__children--expander-no-label']]: expanderChildren && !label,\n [styles['notification-panel__children--outline']]: outlineVariant,\n });\n const CustomTag = labelHtmlMarkup;\n\n const [expanderOpen, setExpanderOpen] = React.useState(expanderOpenFromStart);\n return (\n <div className={contentClasses} id={!label ? uuid : undefined}>\n {label && (\n <CustomTag className={labelClasses} id={uuid}>\n {label}\n </CustomTag>\n )}\n {children && <div className={childrenClasses}>{children}</div>}\n {expanderChildren && expanderButtonText && expanderButtonClosedText && !compactVariant && (\n <Expander\n title={expanderOpen ? expanderButtonText : expanderButtonClosedText}\n onExpand={setExpanderOpen}\n expanded={expanderOpen}\n testId=\"expand\"\n >\n {expanderChildren}\n </Expander>\n )}\n </div>\n );\n };\n\n const notificationPanelClasses = classNames(\n styles['notification-panel'],\n styles[`notification-panel--${variant}`],\n size && styles[`notification-panel--${size}`],\n {\n [styles['notification-panel--compact']]: !!compactVariant,\n [styles['notification-panel--compact--basic']]: compactVariant === 'basic',\n [styles['notification-panel--compact--outline']]: compactVariant === 'outline',\n [styles['notification-panel--with-content']]: expanderChildren || (label && children),\n [styles['notification-panel--dismissable']]: dismissable,\n },\n className\n );\n\n const ariaRole = role || ((variant === 'alert' || variant === 'error') && 'alert') || undefined;\n const ariaLabelAttributes = ariaRole ? getAriaLabelAttributes({ label, id: uuid }) : undefined;\n\n return (\n <FluidWrapper fluid={fluid}>\n <div\n ref={ref}\n role={ariaRole}\n data-testid={testId}\n data-analyticsid={AnalyticsId.NotificationPanel}\n className={notificationPanelClasses}\n {...ariaLabelAttributes}\n >\n <NotificationBadge\n variant={variant == 'alert' ? 'error' : variant}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n className={styles['notification-panel__icon']}\n />\n {dismissable && (\n <span className={styles['notification-panel__close']}>\n <Close ariaLabel={props.ariaLabelCloseBtn} onClick={onClick} color={getColor('black')} />\n </span>\n )}\n {renderContent()}\n </div>\n </FluidWrapper>\n );\n});\n\nexport default NotificationPanel;\n"],"names":["FluidWrapper","fluid","children","fluidClasses","classNames","styles","React","NotificationPanel","props","ref","variant","dismissable","onClick","expanderChildren","expanderButtonText","expanderButtonClosedText","expanderOpenFromStart","compactVariant","label","labelHtmlMarkup","size","className","labelId","role","testId","uuid","useUuid","renderContent","outlineVariant","contentClasses","labelClasses","childrenClasses","CustomTag","expanderOpen","setExpanderOpen","Expander","notificationPanelClasses","ariaRole","ariaLabelAttributes","getAriaLabelAttributes","AnalyticsId","NotificationBadge","IconSize","Close","getColor"],"mappings":";;;;;;;;;;AA8DA,MAAMA,IAAyC,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AACtE,MAAID,GAAO;AACT,UAAME,IAAeC,EAAWC,EAAO,eAAe,CAAC;AAEvD,WAAQC,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWH,EAAA,GAAeD,CAAS;AAAA,EACjD;AACO,SAAAA;AACT,GAEMK,IAAoBD,EAAM,WAAmD,CAACE,GAAOC,MAAQ;AAC3F,QAAA;AAAA,IACJ,UAAAP;AAAA,IACA,SAAAQ,IA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AA;AAAA,IAC9C;AAAA,IACCM,KACEL,gBAAAA,EAAA,cAAA,QAAA,EAAK,WAAWD,EAAO,2BAA2B,EACjD,GAAAC,gBAAAA,EAAA,cAACqC,GAAM,EAAA,WAAWnC,EAAM,mBAAmB,SAAAI,GAAkB,OAAOgC,EAAS,OAAO,GAAG,CACzF;AAAA,IAEDjB,EAAc;AAAA,EAAA,CAEnB;AAEJ,CAAC;"}
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  &--dismissable {
44
- padding: getSpacer(2xs) getSpacer(2xs) getSpacer(m) getSpacer(2xs);
44
+ padding: getSpacer(2xs) getSpacer(2xs) getSpacer(m);
45
45
  }
46
46
 
47
47
  &--small {
@@ -155,7 +155,7 @@
155
155
 
156
156
  &__label {
157
157
  font-weight: 700;
158
- margin: getSpacer(2xs) 0 0 0;
158
+ margin: getSpacer(2xs) 0 0;
159
159
 
160
160
  &--compact {
161
161
  font-size: $font-size-xs;
@@ -185,7 +185,7 @@
185
185
  }
186
186
 
187
187
  &--expander-no-label {
188
- margin: getSpacer(2xs) 0 0 0;
188
+ margin: getSpacer(2xs) 0 0;
189
189
 
190
190
  @media (max-width: map.get($grid-breakpoints, lg)) {
191
191
  padding-top: 0;
@@ -15,7 +15,7 @@ import pe from "../Icons/ChevronDown.js";
15
15
  import _e from "../Icons/ChevronUp.js";
16
16
  import Ee from "../Icons/Pencil.js";
17
17
  import fe from "../Icons/Watch.js";
18
- import ye from "../Title/Title.js";
18
+ import { Title as ye } from "../Title/Title.js";
19
19
  import e from "../Panel/styles.module.scss";
20
20
  var ve = /* @__PURE__ */ ((a) => (a.normal = "normal", a.new = "new", a.error = "error", a.draft = "draft", a))(ve || {}), be = /* @__PURE__ */ ((a) => (a.fill = "fill", a.white = "white", a.stroke = "stroke", a.line = "line", a))(be || {}), Ce = /* @__PURE__ */ ((a) => (a.layout1 = "layout1", a.layout2 = "layout2", a.layout3a = "layout3a", a.layout3b = "layout3b", a.layout3c = "layout3c", a))(Ce || {});
21
21
  const S = ({ status: a, statusMessage: n }) => {
@@ -77,7 +77,7 @@ const S = ({ status: a, statusMessage: n }) => {
77
77
  [e["panel__icon--no-content"]]: !a && !n
78
78
  });
79
79
  return /* @__PURE__ */ t.createElement("div", { className: o }, /* @__PURE__ */ t.createElement(S, { status: d, statusMessage: p }), /* @__PURE__ */ t.createElement(L, null, m), l && /* @__PURE__ */ t.createElement("div", { className: y }, l), /* @__PURE__ */ t.createElement("div", null, i, a), /* @__PURE__ */ t.createElement("div", { className: e["panel__layout-3__last-column"] }, n && /* @__PURE__ */ t.createElement("div", { className: e["panel__layout-3__last-column__content-b"] }, n), s));
80
- }, ge = t.forwardRef(function(n, m) {
80
+ }, Oe = t.forwardRef(function(n, m) {
81
81
  const {
82
82
  buttonAriaLabel: s,
83
83
  buttonAriaLabelledById: l,
@@ -89,46 +89,46 @@ const S = ({ status: a, statusMessage: n }) => {
89
89
  className: y,
90
90
  containerAsButton: w = !1,
91
91
  contentA: M,
92
- contentB: $,
92
+ contentB: z,
93
93
  contentHeader: F,
94
- date: z,
94
+ date: B,
95
95
  expanded: U = !1,
96
96
  focusable: O = !1,
97
- icon: B,
97
+ icon: D,
98
98
  layout: v = "layout2",
99
- noTopBorder: P,
100
- onExpand: D,
101
- renderChildrenWhenClosed: q = !1,
99
+ noTopBorder: q,
100
+ onExpand: R,
101
+ renderChildrenWhenClosed: G = !1,
102
102
  status: _ = "normal",
103
103
  statusMessage: I,
104
- target: G = "_self",
105
- testId: J,
106
- time: R,
104
+ target: J = "_self",
105
+ testId: K,
106
+ time: $,
107
107
  title: g,
108
- titleHtmlMarkup: K = "h2",
108
+ titleHtmlMarkup: P = "h2",
109
109
  url: x,
110
110
  variant: E = "fill"
111
111
  /* fill */
112
- } = n, [f, Q] = se(U, D), k = H(), N = H(), j = I && _ === "new", h = typeof $ > "u", Y = v === "layout1" || h, Z = !h && v === "layout2", V = !h && (v === "layout3a" || v === "layout3b" || v === "layout3c"), ee = r(e["panel-wrapper"], y), te = r(e.panel, {
112
+ } = n, [f, Q] = se(U, R), k = H(), N = H(), j = I && _ === "new", h = typeof z > "u", Y = v === "layout1" || h, Z = !h && v === "layout2", V = !h && (v === "layout3a" || v === "layout3b" || v === "layout3c"), ee = r(e["panel-wrapper"], y), te = r(e.panel, {
113
113
  [e["panel--fill"]]: E === "fill",
114
114
  [e["panel--stroke"]]: E === "stroke",
115
115
  [e["panel--white"]]: E === "white",
116
116
  [e["panel--line"]]: E === "line",
117
- [e["panel--no-top-border"]]: E === "line" && P,
117
+ [e["panel--no-top-border"]]: E === "line" && q,
118
118
  [e["panel--selected"]]: f,
119
119
  [e["panel--new"]]: _ === "new",
120
120
  [e["panel--draft"]]: _ === "draft",
121
121
  [e["panel--error"]]: _ === "error",
122
122
  [e["panel--status"]]: _ && _ !== "normal",
123
- [e["panel--with-icon"]]: B,
123
+ [e["panel--with-icon"]]: D,
124
124
  [e["panel--button"]]: w,
125
- [e["panel--clickable"]]: o || x || D || i || w
125
+ [e["panel--clickable"]]: o || x || R || i || w
126
126
  }), ae = () => {
127
127
  const u = o || x || i, b = r(e["panel__btn-container"], {
128
128
  [e["panel__btn-container--no-content-b"]]: h,
129
129
  [e["panel__btn-container--no-button"]]: !u
130
130
  });
131
- return (u || z || R) && /* @__PURE__ */ t.createElement("div", { className: b }, /* @__PURE__ */ t.createElement(Ne, { date: z, time: R }), u && /* @__PURE__ */ t.createElement("div", { className: e["panel__details-btn"] }, ne()));
131
+ return (u || B || $) && /* @__PURE__ */ t.createElement("div", { className: b }, /* @__PURE__ */ t.createElement(Ne, { date: B, time: $ }), u && /* @__PURE__ */ t.createElement("div", { className: e["panel__details-btn"] }, ne()));
132
132
  }, ne = () => {
133
133
  const u = ce({
134
134
  label: s,
@@ -141,9 +141,9 @@ const S = ({ status: a, statusMessage: n }) => {
141
141
  ellipsis: !0,
142
142
  ...u
143
143
  };
144
- return o ? /* @__PURE__ */ t.createElement(X, { testId: "expand", "aria-expanded": f, ...b }, /* @__PURE__ */ t.createElement("span", { id: N }, f ? d : c), /* @__PURE__ */ t.createElement(C, { svgIcon: f ? _e : pe })) : /* @__PURE__ */ t.createElement(X, { testId: "url", htmlMarkup: p, href: x, target: G, ...b }, /* @__PURE__ */ t.createElement("span", { id: N }, c), /* @__PURE__ */ t.createElement(C, { svgIcon: ue }));
144
+ return o ? /* @__PURE__ */ t.createElement(X, { testId: "expand", "aria-expanded": f, ...b }, /* @__PURE__ */ t.createElement("span", { id: N }, f ? d : c), /* @__PURE__ */ t.createElement(C, { svgIcon: f ? _e : pe })) : /* @__PURE__ */ t.createElement(X, { testId: "url", htmlMarkup: p, href: x, target: J, ...b }, /* @__PURE__ */ t.createElement("span", { id: N }, c), /* @__PURE__ */ t.createElement(C, { svgIcon: ue }));
145
145
  }, le = () => {
146
- if (!o || !q && !f)
146
+ if (!o || !G && !f)
147
147
  return null;
148
148
  const u = r(e["panel-details"], {
149
149
  [e["panel-details--open"]]: f,
@@ -158,13 +158,13 @@ const S = ({ status: a, statusMessage: n }) => {
158
158
  }), b = r(e["title-container__title"], {
159
159
  [e["title-container__title--badge"]]: j
160
160
  });
161
- return g && /* @__PURE__ */ t.createElement("div", { className: u }, /* @__PURE__ */ t.createElement(ye, { appearance: "title3", htmlMarkup: K, id: k, className: b }, g), j && /* @__PURE__ */ t.createElement("div", { className: e.panel__badge }, /* @__PURE__ */ t.createElement(ie, { color: "blueberry", testId: "badge-status" }, I)));
161
+ return g && /* @__PURE__ */ t.createElement("div", { className: u }, /* @__PURE__ */ t.createElement(ye, { appearance: "title3", htmlMarkup: P, id: k, className: b }, g), j && /* @__PURE__ */ t.createElement("div", { className: e.panel__badge }, /* @__PURE__ */ t.createElement(ie, { color: "blueberry", testId: "badge-status" }, I)));
162
162
  }, T = {
163
163
  contentA: M,
164
- contentB: $,
164
+ contentB: z,
165
165
  contentHeader: F,
166
166
  ctaContainer: ae(),
167
- icon: B,
167
+ icon: D,
168
168
  status: _,
169
169
  statusMessage: I,
170
170
  titleElement: re()
@@ -174,18 +174,18 @@ const S = ({ status: a, statusMessage: n }) => {
174
174
  {
175
175
  tabIndex: O ? -1 : void 0,
176
176
  ref: m,
177
- "data-testid": J,
177
+ "data-testid": K,
178
178
  className: ee,
179
179
  "data-analyticsid": oe.Panel
180
180
  },
181
181
  /* @__PURE__ */ t.createElement("div", { className: te }, Y && /* @__PURE__ */ t.createElement(he, { ...T }), Z && /* @__PURE__ */ t.createElement(we, { ...T }), V && /* @__PURE__ */ t.createElement(Ie, { ...T, layout: v })),
182
182
  le()
183
183
  );
184
- }), Pe = ge;
184
+ });
185
185
  export {
186
186
  Ce as PanelLayout,
187
187
  ve as PanelStatus,
188
188
  be as PanelVariant,
189
- Pe as default
189
+ Oe as default
190
190
  };
191
191
  //# sourceMappingURL=Panel.js.map