@helsenorge/designsystem-react 14.0.0-beta.3 → 14.0.0-beta.7

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 (342) hide show
  1. package/lib/AnchorLink.js +2 -2
  2. package/lib/AnchorLink.js.map +1 -1
  3. package/lib/Avatar.js +2 -2
  4. package/lib/Avatar.js.map +1 -1
  5. package/lib/BabyMobileMedium.js +1 -1
  6. package/lib/Badge.js +2 -2
  7. package/lib/Badge.js.map +1 -1
  8. package/lib/Button.js +6 -6
  9. package/lib/Button.js.map +1 -1
  10. package/lib/CHANGELOG.md +58 -2
  11. package/lib/Checkbox.js +17 -7
  12. package/lib/Checkbox.js.map +1 -1
  13. package/lib/ChildMedium.js +1 -1
  14. package/lib/Close.js +3 -3
  15. package/lib/Close.js.map +1 -1
  16. package/lib/DictionaryTrigger.js +2 -2
  17. package/lib/DictionaryTrigger.js.map +1 -1
  18. package/lib/Drawer.js +29 -29
  19. package/lib/Drawer.js.map +1 -1
  20. package/lib/Duolist.js +5 -5
  21. package/lib/Duolist.js.map +1 -1
  22. package/lib/ElementHeader.js +10 -10
  23. package/lib/ElementHeader.js.map +1 -1
  24. package/lib/ElementHeaderText.js +4 -4
  25. package/lib/ElementHeaderText.js.map +1 -1
  26. package/lib/ErrorWrapper.js +2 -2
  27. package/lib/ErrorWrapper.js.map +1 -1
  28. package/lib/Expander.js +12 -8
  29. package/lib/Expander.js.map +1 -1
  30. package/lib/FacialRecognitionFingerprintMedium.js +1 -1
  31. package/lib/FormFieldTag.js +2 -2
  32. package/lib/FormFieldTag.js.map +1 -1
  33. package/lib/FormGroup.js +10 -20
  34. package/lib/FormGroup.js.map +1 -1
  35. package/lib/FormLayout.js +3 -3
  36. package/lib/FormLayout.js.map +1 -1
  37. package/lib/GiveBabyFoodMedium.js +1 -1
  38. package/lib/HelpDetails.js +3 -3
  39. package/lib/HelpDetails.js.map +1 -1
  40. package/lib/HelpTriggerIcon.js +119 -44
  41. package/lib/HelpTriggerIcon.js.map +1 -1
  42. package/lib/HelpTriggerStandalone.js +2 -2
  43. package/lib/HelpTriggerStandalone.js.map +1 -1
  44. package/lib/HighlightPanel.js +3 -3
  45. package/lib/HighlightPanel.js.map +1 -1
  46. package/lib/HorizontalScroll.js +4 -4
  47. package/lib/HorizontalScroll.js.map +1 -1
  48. package/lib/Icon.js +2 -2
  49. package/lib/Icon.js.map +1 -1
  50. package/lib/Illustration.js +1 -1
  51. package/lib/Illustration.js.map +1 -1
  52. package/lib/InfoTeaser.js +5 -4
  53. package/lib/InfoTeaser.js.map +1 -1
  54. package/lib/Input.js +9 -5
  55. package/lib/Input.js.map +1 -1
  56. package/lib/Label.js +3 -90
  57. package/lib/Label.js.map +1 -1
  58. package/lib/LazyIcon.js +18 -10
  59. package/lib/LazyIcon.js.map +1 -1
  60. package/lib/LazyIllustration.js +1 -1
  61. package/lib/LinkList.js +7 -8
  62. package/lib/LinkList.js.map +1 -1
  63. package/lib/List.js +2 -2
  64. package/lib/List.js.map +1 -1
  65. package/lib/ListEditMode.js +7 -5
  66. package/lib/ListEditMode.js.map +1 -1
  67. package/lib/MaxCharacters.js +2 -2
  68. package/lib/MaxCharacters.js.map +1 -1
  69. package/lib/PanelTitle.js +2 -2
  70. package/lib/PanelTitle.js.map +1 -1
  71. package/lib/PopOver.js +2 -2
  72. package/lib/PopOver.js.map +1 -1
  73. package/lib/RadioButton.js +3 -80
  74. package/lib/RadioButton.js.map +1 -1
  75. package/lib/ReadLettersMedium.js +1 -1
  76. package/lib/Select.js +9 -5
  77. package/lib/Select.js.map +1 -1
  78. package/lib/SingleSelectItem.js +4 -4
  79. package/lib/SingleSelectItem.js.map +1 -1
  80. package/lib/Slider.js +4 -4
  81. package/lib/Slider.js.map +1 -1
  82. package/lib/Spacer.js +2 -2
  83. package/lib/Spacer.js.map +1 -1
  84. package/lib/StatusDot.js +25 -20
  85. package/lib/StatusDot.js.map +1 -1
  86. package/lib/StatusDotList.js +2 -2
  87. package/lib/StatusDotList.js.map +1 -1
  88. package/lib/StepButtons.js +5 -5
  89. package/lib/StepButtons.js.map +1 -1
  90. package/lib/StrollerMedium.js +1 -1
  91. package/lib/Support2Medium.js +1 -1
  92. package/lib/TabList.js +8 -8
  93. package/lib/TabList.js.map +1 -1
  94. package/lib/TabPanel.js +2 -2
  95. package/lib/TabPanel.js.map +1 -1
  96. package/lib/TableBody.js +4 -4
  97. package/lib/TableBody.js.map +1 -1
  98. package/lib/TableCell.js +3 -3
  99. package/lib/TableCell.js.map +1 -1
  100. package/lib/TableExpandedRow.js +5 -5
  101. package/lib/TableExpandedRow.js.map +1 -1
  102. package/lib/TableExpanderCell.js +3 -3
  103. package/lib/TableExpanderCell.js.map +1 -1
  104. package/lib/TableHead.js +4 -4
  105. package/lib/TableHead.js.map +1 -1
  106. package/lib/TableHeadCell.js +4 -4
  107. package/lib/TableHeadCell.js.map +1 -1
  108. package/lib/TableRow.js +5 -5
  109. package/lib/TableRow.js.map +1 -1
  110. package/lib/Textarea.js +9 -5
  111. package/lib/Textarea.js.map +1 -1
  112. package/lib/Title.js +2 -2
  113. package/lib/Title.js.map +1 -1
  114. package/lib/Toast.js +3 -3
  115. package/lib/Toast.js.map +1 -1
  116. package/lib/components/ArticleTeaser/index.js +4 -4
  117. package/lib/components/ArticleTeaser/index.js.map +1 -1
  118. package/lib/components/Checkbox/styles.module.scss +4 -0
  119. package/lib/components/Checkbox/styles.module.scss.d.ts +1 -0
  120. package/lib/components/Chip/index.js +2 -2
  121. package/lib/components/Chip/index.js.map +1 -1
  122. package/lib/components/Drawer/styles.module.scss +6 -0
  123. package/lib/components/Dropdown/SingleSelect/index.d.ts +1 -0
  124. package/lib/components/Dropdown/SingleSelect/index.js +2 -2
  125. package/lib/components/Dropdown/SingleSelect/index.js.map +1 -1
  126. package/lib/components/Dropdown/index.js +6 -6
  127. package/lib/components/Dropdown/index.js.map +1 -1
  128. package/lib/components/DropdownOld/index.js +3 -3
  129. package/lib/components/DropdownOld/index.js.map +1 -1
  130. package/lib/components/ElementHeader/index.d.ts +1 -0
  131. package/lib/components/ElementHeader/index.js +2 -2
  132. package/lib/components/ElementHeader/index.js.map +1 -1
  133. package/lib/components/EmptyState/index.js +2 -2
  134. package/lib/components/EmptyState/index.js.map +1 -1
  135. package/lib/components/Expander/styles.module.scss +16 -7
  136. package/lib/components/Expander/styles.module.scss.d.ts +2 -1
  137. package/lib/components/ExpanderHierarchy/Expander.d.ts +2 -0
  138. package/lib/components/ExpanderHierarchy/index.d.ts +1 -0
  139. package/lib/components/ExpanderHierarchy/index.js +10 -9
  140. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  141. package/lib/components/ExpanderList/index.js +8 -9
  142. package/lib/components/ExpanderList/index.js.map +1 -1
  143. package/lib/components/FavoriteButton/index.js +2 -2
  144. package/lib/components/FavoriteButton/index.js.map +1 -1
  145. package/lib/components/FormGroup/FormGroup.d.ts +5 -0
  146. package/lib/components/HelpBubble/index.js +3 -3
  147. package/lib/components/HelpBubble/index.js.map +1 -1
  148. package/lib/components/HelpPanel/index.js +2 -2
  149. package/lib/components/HelpPanel/index.js.map +1 -1
  150. package/lib/components/HelpTeaser/HelpTeaser.d.ts +2 -0
  151. package/lib/components/HelpTeaser/index.js +2 -1
  152. package/lib/components/HelpTeaser/index.js.map +1 -1
  153. package/lib/components/HelpTriggerIcon/HelpSign.d.ts +3 -1
  154. package/lib/components/HelpTriggerInline/index.js +2 -2
  155. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  156. package/lib/components/Icon/index.d.ts +1 -0
  157. package/lib/components/Icon/index.js +2 -1
  158. package/lib/components/Icons/AdditionalIconInformation.d.ts +41 -5
  159. package/lib/components/Icons/AdditionalIconInformation.js +41 -5
  160. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  161. package/lib/components/Icons/Attachment.js +1 -11
  162. package/lib/components/Icons/Attachment.js.map +1 -1
  163. package/lib/components/Icons/Change.js +2 -6
  164. package/lib/components/Icons/Change.js.map +1 -1
  165. package/lib/components/Icons/DotAttachment.d.ts +3 -0
  166. package/lib/components/Icons/DotAttachment.js +22 -0
  167. package/lib/components/Icons/DotAttachment.js.map +1 -0
  168. package/lib/components/Icons/DotCheckmark.d.ts +3 -0
  169. package/lib/components/Icons/{DotSuccess.js → DotCheckmark.js} +4 -4
  170. package/lib/components/Icons/DotCheckmark.js.map +1 -0
  171. package/lib/components/Icons/DotCircleArrows.d.ts +3 -0
  172. package/lib/components/Icons/DotCircleArrows.js +18 -0
  173. package/lib/components/Icons/DotCircleArrows.js.map +1 -0
  174. package/lib/components/Icons/DotDot.d.ts +3 -0
  175. package/lib/components/Icons/{DotPending.js → DotDot.js} +4 -4
  176. package/lib/components/Icons/DotDot.js.map +1 -0
  177. package/lib/components/Icons/DotExclamationMark.d.ts +3 -0
  178. package/lib/components/Icons/{DotAlert.js → DotExclamationMark.js} +4 -4
  179. package/lib/components/Icons/DotExclamationMark.js.map +1 -0
  180. package/lib/components/Icons/DotFill.d.ts +3 -0
  181. package/lib/components/Icons/{DotActive.js → DotFill.js} +4 -4
  182. package/lib/components/Icons/DotFill.js.map +1 -0
  183. package/lib/components/Icons/DotGroup.d.ts +3 -0
  184. package/lib/components/Icons/DotGroup.js +22 -0
  185. package/lib/components/Icons/DotGroup.js.map +1 -0
  186. package/lib/components/Icons/DotLogin.d.ts +3 -0
  187. package/lib/components/Icons/DotLogin.js +14 -0
  188. package/lib/components/Icons/DotLogin.js.map +1 -0
  189. package/lib/components/Icons/DotNoAccess.d.ts +3 -0
  190. package/lib/components/Icons/DotNoAccess.js +30 -0
  191. package/lib/components/Icons/DotNoAccess.js.map +1 -0
  192. package/lib/components/Icons/DotNoEye.d.ts +3 -0
  193. package/lib/components/Icons/DotNoEye.js +14 -0
  194. package/lib/components/Icons/DotNoEye.js.map +1 -0
  195. package/lib/components/Icons/DotOutline.d.ts +3 -0
  196. package/lib/components/Icons/{DotInactive.js → DotOutline.js} +4 -4
  197. package/lib/components/Icons/DotOutline.js.map +1 -0
  198. package/lib/components/Icons/DotPencil.d.ts +3 -0
  199. package/lib/components/Icons/DotPencil.js +22 -0
  200. package/lib/components/Icons/DotPencil.js.map +1 -0
  201. package/lib/components/Icons/DotTriangle.d.ts +3 -0
  202. package/lib/components/Icons/{DotWarningTriangle.js → DotTriangle.js} +4 -4
  203. package/lib/components/Icons/DotTriangle.js.map +1 -0
  204. package/lib/components/Icons/DotX.d.ts +3 -0
  205. package/lib/components/Icons/{DotCancelled.js → DotX.js} +4 -4
  206. package/lib/components/Icons/DotX.js.map +1 -0
  207. package/lib/components/Icons/Group.js +2 -2
  208. package/lib/components/Icons/Group.js.map +1 -1
  209. package/lib/components/Icons/IconNames.d.ts +1 -1
  210. package/lib/components/Icons/IconNames.js +14 -8
  211. package/lib/components/Icons/IconNames.js.map +1 -1
  212. package/lib/components/Icons/Login.js +1 -3
  213. package/lib/components/Icons/Login.js.map +1 -1
  214. package/lib/components/Icons/NoAccess.js +7 -15
  215. package/lib/components/Icons/NoAccess.js.map +1 -1
  216. package/lib/components/Icons/NoEye.js +10 -2
  217. package/lib/components/Icons/NoEye.js.map +1 -1
  218. package/lib/components/Icons/Pencil.js +1 -11
  219. package/lib/components/Icons/Pencil.js.map +1 -1
  220. package/lib/components/Illustration/index.d.ts +1 -0
  221. package/lib/components/Illustration/index.js +2 -1
  222. package/lib/components/Illustrations/BabyMobile.js +1 -1
  223. package/lib/components/Illustrations/Child.js +1 -1
  224. package/lib/components/Illustrations/Doctor.js +1 -1
  225. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
  226. package/lib/components/Illustrations/GiveBabyFood.js +1 -1
  227. package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
  228. package/lib/components/Illustrations/ReadLetters.js +1 -1
  229. package/lib/components/Illustrations/Stroller.js +1 -1
  230. package/lib/components/Illustrations/Support2.js +1 -1
  231. package/lib/components/InfoTeaser/InfoTeaser.d.ts +2 -0
  232. package/lib/components/InfoTeaser/styles.module.scss +0 -2
  233. package/lib/components/Label/Label.d.ts +2 -0
  234. package/lib/components/Label/index.d.ts +1 -0
  235. package/lib/components/Label/index.js +3 -3
  236. package/lib/components/Label/styles.module.scss +1 -1
  237. package/lib/components/Label/utils.d.ts +21 -2
  238. package/lib/components/LazyIcon/index.d.ts +1 -0
  239. package/lib/components/LazyIcon/index.js +2 -2
  240. package/lib/components/ListEditMode/index.d.ts +1 -0
  241. package/lib/components/ListEditMode/index.js +2 -2
  242. package/lib/components/Loader/index.js +4 -4
  243. package/lib/components/Loader/index.js.map +1 -1
  244. package/lib/components/Modal/index.js +9 -9
  245. package/lib/components/Modal/index.js.map +1 -1
  246. package/lib/components/NotificationPanel/index.js +6 -6
  247. package/lib/components/NotificationPanel/index.js.map +1 -1
  248. package/lib/components/Panel/index.js +13 -13
  249. package/lib/components/Panel/index.js.map +1 -1
  250. package/lib/components/PanelList/index.d.ts +1 -0
  251. package/lib/components/PanelList/index.js +5 -5
  252. package/lib/components/PanelList/index.js.map +1 -1
  253. package/lib/components/PopMenu/index.js +3 -3
  254. package/lib/components/PopMenu/index.js.map +1 -1
  255. package/lib/components/Progressbar/index.js +2 -2
  256. package/lib/components/Progressbar/index.js.map +1 -1
  257. package/lib/components/PromoPanel/index.js +2 -2
  258. package/lib/components/PromoPanel/index.js.map +1 -1
  259. package/lib/components/RadioButton/index.d.ts +1 -0
  260. package/lib/components/RadioButton/index.js +3 -3
  261. package/lib/components/RadioButton/styles.module.scss +4 -0
  262. package/lib/components/RadioButton/styles.module.scss.d.ts +1 -0
  263. package/lib/components/Select/styles.module.scss +2 -0
  264. package/lib/components/ServiceMessage/index.js +6 -6
  265. package/lib/components/ServiceMessage/index.js.map +1 -1
  266. package/lib/components/SharingStatus/index.js +4 -4
  267. package/lib/components/SharingStatus/index.js.map +1 -1
  268. package/lib/components/StatusDot/constants.d.ts +2 -1
  269. package/lib/components/StatusDot/styles.module.scss +4 -2
  270. package/lib/components/StatusDot/styles.module.scss.d.ts +1 -0
  271. package/lib/components/Step/index.js +2 -2
  272. package/lib/components/Step/index.js.map +1 -1
  273. package/lib/components/Stepper/index.d.ts +1 -0
  274. package/lib/components/Stepper/index.js +4 -3
  275. package/lib/components/Stepper/index.js.map +1 -1
  276. package/lib/components/StickyNote/index.js +8 -8
  277. package/lib/components/StickyNote/index.js.map +1 -1
  278. package/lib/components/Table/index.d.ts +1 -0
  279. package/lib/components/Table/index.js +5 -5
  280. package/lib/components/Table/index.js.map +1 -1
  281. package/lib/components/Table/styles.module.scss +1 -1
  282. package/lib/components/Tabs/index.js +4 -4
  283. package/lib/components/Tabs/index.js.map +1 -1
  284. package/lib/components/Tag/index.js +2 -2
  285. package/lib/components/Tag/index.js.map +1 -1
  286. package/lib/components/Tile/index.js +4 -4
  287. package/lib/components/Tile/index.js.map +1 -1
  288. package/lib/components/Title/styles.module.scss +0 -1
  289. package/lib/components/Toggle/index.js +18 -18
  290. package/lib/components/Toggle/index.js.map +1 -1
  291. package/lib/components/Validation/index.js +4 -4
  292. package/lib/components/Validation/index.js.map +1 -1
  293. package/lib/constants3.js +44 -4
  294. package/lib/constants3.js.map +1 -1
  295. package/lib/floating-ui.react.js +7 -3
  296. package/lib/floating-ui.react.js.map +1 -1
  297. package/lib/scss/_font-mixins.scss +2 -0
  298. package/lib/scss/_print.scss +3 -3
  299. package/lib/scss/_radio-reset.scss +1 -1
  300. package/lib/scss/_screen-reader.scss +7 -10
  301. package/lib/useElementList.js +15 -2
  302. package/lib/useElementList.js.map +1 -1
  303. package/lib/utils2.js +121 -33
  304. package/lib/utils2.js.map +1 -1
  305. package/lib/utils3.js +98 -10
  306. package/lib/utils3.js.map +1 -1
  307. package/lib/utils4.js +11 -28
  308. package/lib/utils4.js.map +1 -1
  309. package/lib/utils5.js +28 -58
  310. package/lib/utils5.js.map +1 -1
  311. package/lib/utils6.js +60 -0
  312. package/lib/utils6.js.map +1 -0
  313. package/package.json +3 -3
  314. package/scss/_font-mixins.scss +2 -0
  315. package/scss/_print.scss +3 -3
  316. package/scss/_radio-reset.scss +1 -1
  317. package/scss/_screen-reader.scss +7 -10
  318. package/lib/Label2.js +0 -5
  319. package/lib/Label2.js.map +0 -1
  320. package/lib/RadioButton2.js +0 -5
  321. package/lib/RadioButton2.js.map +0 -1
  322. package/lib/components/Icons/DotActive.d.ts +0 -3
  323. package/lib/components/Icons/DotActive.js.map +0 -1
  324. package/lib/components/Icons/DotAlert.d.ts +0 -3
  325. package/lib/components/Icons/DotAlert.js.map +0 -1
  326. package/lib/components/Icons/DotCancelled.d.ts +0 -3
  327. package/lib/components/Icons/DotCancelled.js.map +0 -1
  328. package/lib/components/Icons/DotInactive.d.ts +0 -3
  329. package/lib/components/Icons/DotInactive.js.map +0 -1
  330. package/lib/components/Icons/DotPending.d.ts +0 -3
  331. package/lib/components/Icons/DotPending.js.map +0 -1
  332. package/lib/components/Icons/DotSuccess.d.ts +0 -3
  333. package/lib/components/Icons/DotSuccess.js.map +0 -1
  334. package/lib/components/Icons/DotTransparent.d.ts +0 -3
  335. package/lib/components/Icons/DotTransparent.js +0 -22
  336. package/lib/components/Icons/DotTransparent.js.map +0 -1
  337. package/lib/components/Icons/DotWarningTriangle.d.ts +0 -3
  338. package/lib/components/Icons/DotWarningTriangle.js.map +0 -1
  339. package/lib/constants4.js +0 -46
  340. package/lib/constants4.js.map +0 -1
  341. package/lib/scss/_figma-tokens.scss +0 -68
  342. package/scss/_figma-tokens.scss +0 -68
@@ -7,17 +7,7 @@ var Pencil = ({ size, isHovered }) => {
7
7
  normal: /* @__PURE__ */ jsx("path", { d: "M38.485 15.54l-.757.757-6.035-6.034.757-.758a4.275 4.275 0 016.035 0 4.274 4.274 0 010 6.035zm-3.083 3.083l-6.034-6.035 1.618-1.618 6.035 6.034-1.619 1.62zM19.927 34.098l-2.66-2.66L32.14 16.773l2.555 2.556-14.768 14.768zm-6.683 3.13l-2.47-2.472 2.416-5.558 5.604 5.604-5.55 2.425zm-4.373 1.908l1.475-3.394 1.914 1.914-3.389 1.48zm19.79-25.84l2.772 2.771L16.56 30.73l-2.667-2.667 14.768-14.768zm10.743-4.71a5.575 5.575 0 00-7.873 0L12.514 27.603a.655.655 0 00-.136.201l-5.359 12.33a.65.65 0 00.857.855l12.312-5.377a.63.63 0 00.199-.136L39.404 16.46a5.574 5.574 0 000-7.873z" }),
8
8
  normalHover: /* @__PURE__ */ jsx("path", { d: "M44.486 15.537l-.757.757-6.035-6.034.757-.758a4.244 4.244 0 013.017-1.25c1.14 0 2.212.445 3.018 1.25a4.274 4.274 0 010 6.035zm-3.083 3.083l-6.034-6.035 1.618-1.618 6.035 6.034-1.62 1.62zM25.928 34.096l-2.66-2.661L38.14 16.771l2.556 2.556-14.768 14.768zm-6.683 3.128l-2.47-2.47 2.415-5.56 5.605 5.606-5.55 2.424zm-4.373 1.91l1.474-3.395 1.914 1.915-3.388 1.48zm19.79-25.841l2.77 2.77-14.871 14.664-2.667-2.666 14.768-14.768zm10.743-4.71l-.46.46.459-.46a5.53 5.53 0 00-3.936-1.63 5.534 5.534 0 00-3.936 1.63L18.515 27.6a.655.655 0 00-.136.201l-5.192 11.945H7.615v1.3h6v-.005a.663.663 0 00.262-.054l12.312-5.378a.63.63 0 00.199-.136l19.017-19.017a5.574 5.574 0 000-7.872z" }),
9
9
  xSmall: /* @__PURE__ */ jsx("path", { d: "M38.188 15.243l-.754.754-5.702-5.703.753-.755c1.522-1.523 4.178-1.522 5.703 0a4.04 4.04 0 010 5.704zm-3.08 3.08l-5.702-5.704 1.61-1.61 5.703 5.703-1.61 1.61zM19.796 33.633l-2.49-2.49 14.702-14.493 2.387 2.385-14.599 14.598zm-6.856 3.28l-2.117-2.118 2.313-5.32 5.118 5.118-5.314 2.32zm-3.75 1.638l1.2-2.758 1.554 1.555-2.753 1.203zm19.501-25.218l2.602 2.602L16.592 30.43l-2.499-2.499 14.598-14.597zM39.438 8.29V8.29a5.768 5.768 0 00-4.102-1.699 5.765 5.765 0 00-4.102 1.699L12.216 27.306a.895.895 0 00-.184.274L6.673 39.91a.884.884 0 001.165 1.163l12.312-5.377a.888.888 0 00.271-.186l19.017-19.017a5.808 5.808 0 000-8.203z" }),
10
- xSmallHover: /* @__PURE__ */ jsx("path", { d: "M44.188 15.871l-.753.753-5.703-5.702.753-.754a4.04 4.04 0 015.703 0 4.003 4.003 0 011.182 2.852 4 4 0 01-1.182 2.851zM41.11 18.95l-5.703-5.702 1.61-1.612 5.703 5.703-1.61 1.61zM25.798 34.263l-2.491-2.49L38.009 17.28l2.386 2.384-14.597 14.599zm-6.857 3.28l-2.118-2.117 2.313-5.322 5.12 5.119-5.315 2.32zm-3.749 1.637l1.199-2.757 1.555 1.555-2.754 1.202zm19.5-25.217l2.602 2.602-14.702 14.493-2.497-2.498 14.597-14.597zm10.747-5.045a5.81 5.81 0 00-8.205 0L18.218 27.934a.895.895 0 00-.185.274l-5.13 11.805h-5.42v1.768h6.001v-.006c.12 0 .242-.024.355-.073l12.312-5.378a.888.888 0 00.272-.185l19.016-19.017a5.764 5.764 0 001.7-4.102c0-1.55-.605-3.006-1.7-4.102z" }),
11
- xxSmall: /* @__PURE__ */ jsx("path", {
12
- fillRule: "evenodd",
13
- clipRule: "evenodd",
14
- d: "M32.326 9.147a4 4 0 0 0-5.617.01l-17.2 17.019L8 38.555l12.152-1.803 17.13-17.066A4 4 0 0 0 37.263 14l-4.937-4.853ZM29.522 12l4.937 4.853-2.338 2.329-4.902-4.903L29.522 12Zm-5.146 5.093L13.31 28.04l-.705 5.787 5.656-.84 11.026-10.983-4.913-4.912Z"
15
- }),
16
- xxSmallHover: /* @__PURE__ */ jsx("path", {
17
- fillRule: "evenodd",
18
- clipRule: "evenodd",
19
- d: "M24.043 6.492a4 4 0 0 0-4.86 2.817l-6.387 23.339 4.883 11.474 9.623-7.637 6.303-23.344a4 4 0 0 0-2.86-4.915l-6.702-1.734Zm-1.002 3.872 6.702 1.734-.86 3.186-6.697-1.794.855-3.126Zm-1.911 6.984-4.108 15.014 2.282 5.364 4.48-3.555 4.056-15.025-6.71-1.798Z"
20
- })
10
+ xSmallHover: /* @__PURE__ */ jsx("path", { d: "M44.188 15.871l-.753.753-5.703-5.702.753-.754a4.04 4.04 0 015.703 0 4.003 4.003 0 011.182 2.852 4 4 0 01-1.182 2.851zM41.11 18.95l-5.703-5.702 1.61-1.612 5.703 5.703-1.61 1.61zM25.798 34.263l-2.491-2.49L38.009 17.28l2.386 2.384-14.597 14.599zm-6.857 3.28l-2.118-2.117 2.313-5.322 5.12 5.119-5.315 2.32zm-3.749 1.637l1.199-2.757 1.555 1.555-2.754 1.202zm19.5-25.217l2.602 2.602-14.702 14.493-2.497-2.498 14.597-14.597zm10.747-5.045a5.81 5.81 0 00-8.205 0L18.218 27.934a.895.895 0 00-.185.274l-5.13 11.805h-5.42v1.768h6.001v-.006c.12 0 .242-.024.355-.073l12.312-5.378a.888.888 0 00.272-.185l19.016-19.017a5.764 5.764 0 001.7-4.102c0-1.55-.605-3.006-1.7-4.102z" })
21
11
  });
22
12
  };
23
13
  var Pencil_default = Pencil;
@@ -1 +1 @@
1
- {"version":3,"file":"Pencil.js","names":["Pencil: React.FC<SvgPathProps>"],"sources":["../../../src/components/Icons/Pencil.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Pencil: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"M38.485 15.54l-.757.757-6.035-6.034.757-.758a4.275 4.275 0 016.035 0 4.274 4.274 0 010 6.035zm-3.083 3.083l-6.034-6.035 1.618-1.618 6.035 6.034-1.619 1.62zM19.927 34.098l-2.66-2.66L32.14 16.773l2.555 2.556-14.768 14.768zm-6.683 3.13l-2.47-2.472 2.416-5.558 5.604 5.604-5.55 2.425zm-4.373 1.908l1.475-3.394 1.914 1.914-3.389 1.48zm19.79-25.84l2.772 2.771L16.56 30.73l-2.667-2.667 14.768-14.768zm10.743-4.71a5.575 5.575 0 00-7.873 0L12.514 27.603a.655.655 0 00-.136.201l-5.359 12.33a.65.65 0 00.857.855l12.312-5.377a.63.63 0 00.199-.136L39.404 16.46a5.574 5.574 0 000-7.873z\" />\n );\n\n const normalHover = (\n <path d=\"M44.486 15.537l-.757.757-6.035-6.034.757-.758a4.244 4.244 0 013.017-1.25c1.14 0 2.212.445 3.018 1.25a4.274 4.274 0 010 6.035zm-3.083 3.083l-6.034-6.035 1.618-1.618 6.035 6.034-1.62 1.62zM25.928 34.096l-2.66-2.661L38.14 16.771l2.556 2.556-14.768 14.768zm-6.683 3.128l-2.47-2.47 2.415-5.56 5.605 5.606-5.55 2.424zm-4.373 1.91l1.474-3.395 1.914 1.915-3.388 1.48zm19.79-25.841l2.77 2.77-14.871 14.664-2.667-2.666 14.768-14.768zm10.743-4.71l-.46.46.459-.46a5.53 5.53 0 00-3.936-1.63 5.534 5.534 0 00-3.936 1.63L18.515 27.6a.655.655 0 00-.136.201l-5.192 11.945H7.615v1.3h6v-.005a.663.663 0 00.262-.054l12.312-5.378a.63.63 0 00.199-.136l19.017-19.017a5.574 5.574 0 000-7.872z\" />\n );\n\n const xSmall = (\n <path d=\"M38.188 15.243l-.754.754-5.702-5.703.753-.755c1.522-1.523 4.178-1.522 5.703 0a4.04 4.04 0 010 5.704zm-3.08 3.08l-5.702-5.704 1.61-1.61 5.703 5.703-1.61 1.61zM19.796 33.633l-2.49-2.49 14.702-14.493 2.387 2.385-14.599 14.598zm-6.856 3.28l-2.117-2.118 2.313-5.32 5.118 5.118-5.314 2.32zm-3.75 1.638l1.2-2.758 1.554 1.555-2.753 1.203zm19.501-25.218l2.602 2.602L16.592 30.43l-2.499-2.499 14.598-14.597zM39.438 8.29V8.29a5.768 5.768 0 00-4.102-1.699 5.765 5.765 0 00-4.102 1.699L12.216 27.306a.895.895 0 00-.184.274L6.673 39.91a.884.884 0 001.165 1.163l12.312-5.377a.888.888 0 00.271-.186l19.017-19.017a5.808 5.808 0 000-8.203z\" />\n );\n\n const xSmallHover = (\n <path d=\"M44.188 15.871l-.753.753-5.703-5.702.753-.754a4.04 4.04 0 015.703 0 4.003 4.003 0 011.182 2.852 4 4 0 01-1.182 2.851zM41.11 18.95l-5.703-5.702 1.61-1.612 5.703 5.703-1.61 1.61zM25.798 34.263l-2.491-2.49L38.009 17.28l2.386 2.384-14.597 14.599zm-6.857 3.28l-2.118-2.117 2.313-5.322 5.12 5.119-5.315 2.32zm-3.749 1.637l1.199-2.757 1.555 1.555-2.754 1.202zm19.5-25.217l2.602 2.602-14.702 14.493-2.497-2.498 14.597-14.597zm10.747-5.045a5.81 5.81 0 00-8.205 0L18.218 27.934a.895.895 0 00-.185.274l-5.13 11.805h-5.42v1.768h6.001v-.006c.12 0 .242-.024.355-.073l12.312-5.378a.888.888 0 00.272-.185l19.016-19.017a5.764 5.764 0 001.7-4.102c0-1.55-.605-3.006-1.7-4.102z\" />\n );\n\n const xxSmall = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M32.326 9.147a4 4 0 0 0-5.617.01l-17.2 17.019L8 38.555l12.152-1.803 17.13-17.066A4 4 0 0 0 37.263 14l-4.937-4.853ZM29.522 12l4.937 4.853-2.338 2.329-4.902-4.903L29.522 12Zm-5.146 5.093L13.31 28.04l-.705 5.787 5.656-.84 11.026-10.983-4.913-4.912Z\"\n />\n );\n\n const xxSmallHover = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M24.043 6.492a4 4 0 0 0-4.86 2.817l-6.387 23.339 4.883 11.474 9.623-7.637 6.303-23.344a4 4 0 0 0-2.86-4.915l-6.702-1.734Zm-1.002 3.872 6.702 1.734-.86 3.186-6.697-1.794.855-3.126Zm-1.911 6.984-4.108 15.014 2.282 5.364 4.48-3.555 4.056-15.025-6.71-1.798Z\"\n />\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover, xxSmall, xxSmallHover });\n};\n\nexport default Pencil;\n"],"mappings":";;AAIA,IAAMA,UAAkC,EAAE,MAAM,gBAAkD;AAiChG,QAAO,QAAQ;EAAE;EAAM;EAAW,QA/BhC,oBAAC,QAAA,EAAK,GAAE,gkBAAA,CAAikB;EA+BjiB,aA3BxC,oBAAC,QAAA,EAAK,GAAE,gqBAAA,CAAiqB;EA2BpnB,QAvBrD,oBAAC,QAAA,EAAK,GAAE,inBAAA,CAAknB;EAuB7jB,aAnB7D,oBAAC,QAAA,EAAK,GAAE,qpBAAA,CAAspB;EAmBplB,SAf1E,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAWiF,cAPnF,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAG+F,CAAC;;AAGtG,IAAA,iBAAe"}
1
+ {"version":3,"file":"Pencil.js","names":["Pencil: React.FC<SvgPathProps>"],"sources":["../../../src/components/Icons/Pencil.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Pencil: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"M38.485 15.54l-.757.757-6.035-6.034.757-.758a4.275 4.275 0 016.035 0 4.274 4.274 0 010 6.035zm-3.083 3.083l-6.034-6.035 1.618-1.618 6.035 6.034-1.619 1.62zM19.927 34.098l-2.66-2.66L32.14 16.773l2.555 2.556-14.768 14.768zm-6.683 3.13l-2.47-2.472 2.416-5.558 5.604 5.604-5.55 2.425zm-4.373 1.908l1.475-3.394 1.914 1.914-3.389 1.48zm19.79-25.84l2.772 2.771L16.56 30.73l-2.667-2.667 14.768-14.768zm10.743-4.71a5.575 5.575 0 00-7.873 0L12.514 27.603a.655.655 0 00-.136.201l-5.359 12.33a.65.65 0 00.857.855l12.312-5.377a.63.63 0 00.199-.136L39.404 16.46a5.574 5.574 0 000-7.873z\" />\n );\n\n const normalHover = (\n <path d=\"M44.486 15.537l-.757.757-6.035-6.034.757-.758a4.244 4.244 0 013.017-1.25c1.14 0 2.212.445 3.018 1.25a4.274 4.274 0 010 6.035zm-3.083 3.083l-6.034-6.035 1.618-1.618 6.035 6.034-1.62 1.62zM25.928 34.096l-2.66-2.661L38.14 16.771l2.556 2.556-14.768 14.768zm-6.683 3.128l-2.47-2.47 2.415-5.56 5.605 5.606-5.55 2.424zm-4.373 1.91l1.474-3.395 1.914 1.915-3.388 1.48zm19.79-25.841l2.77 2.77-14.871 14.664-2.667-2.666 14.768-14.768zm10.743-4.71l-.46.46.459-.46a5.53 5.53 0 00-3.936-1.63 5.534 5.534 0 00-3.936 1.63L18.515 27.6a.655.655 0 00-.136.201l-5.192 11.945H7.615v1.3h6v-.005a.663.663 0 00.262-.054l12.312-5.378a.63.63 0 00.199-.136l19.017-19.017a5.574 5.574 0 000-7.872z\" />\n );\n\n const xSmall = (\n <path d=\"M38.188 15.243l-.754.754-5.702-5.703.753-.755c1.522-1.523 4.178-1.522 5.703 0a4.04 4.04 0 010 5.704zm-3.08 3.08l-5.702-5.704 1.61-1.61 5.703 5.703-1.61 1.61zM19.796 33.633l-2.49-2.49 14.702-14.493 2.387 2.385-14.599 14.598zm-6.856 3.28l-2.117-2.118 2.313-5.32 5.118 5.118-5.314 2.32zm-3.75 1.638l1.2-2.758 1.554 1.555-2.753 1.203zm19.501-25.218l2.602 2.602L16.592 30.43l-2.499-2.499 14.598-14.597zM39.438 8.29V8.29a5.768 5.768 0 00-4.102-1.699 5.765 5.765 0 00-4.102 1.699L12.216 27.306a.895.895 0 00-.184.274L6.673 39.91a.884.884 0 001.165 1.163l12.312-5.377a.888.888 0 00.271-.186l19.017-19.017a5.808 5.808 0 000-8.203z\" />\n );\n\n const xSmallHover = (\n <path d=\"M44.188 15.871l-.753.753-5.703-5.702.753-.754a4.04 4.04 0 015.703 0 4.003 4.003 0 011.182 2.852 4 4 0 01-1.182 2.851zM41.11 18.95l-5.703-5.702 1.61-1.612 5.703 5.703-1.61 1.61zM25.798 34.263l-2.491-2.49L38.009 17.28l2.386 2.384-14.597 14.599zm-6.857 3.28l-2.118-2.117 2.313-5.322 5.12 5.119-5.315 2.32zm-3.749 1.637l1.199-2.757 1.555 1.555-2.754 1.202zm19.5-25.217l2.602 2.602-14.702 14.493-2.497-2.498 14.597-14.597zm10.747-5.045a5.81 5.81 0 00-8.205 0L18.218 27.934a.895.895 0 00-.185.274l-5.13 11.805h-5.42v1.768h6.001v-.006c.12 0 .242-.024.355-.073l12.312-5.378a.888.888 0 00.272-.185l19.016-19.017a5.764 5.764 0 001.7-4.102c0-1.55-.605-3.006-1.7-4.102z\" />\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover });\n};\n\nexport default Pencil;\n"],"mappings":";;AAIA,IAAMA,UAAkC,EAAE,MAAM,gBAAkD;AAiBhG,QAAO,QAAQ;EAAE;EAAM;EAAW,QAfhC,oBAAC,QAAA,EAAK,GAAE,gkBAAA,CAAikB;EAejiB,aAXxC,oBAAC,QAAA,EAAK,GAAE,gqBAAA,CAAiqB;EAWpnB,QAPrD,oBAAC,QAAA,EAAK,GAAE,inBAAA,CAAknB;EAO7jB,aAH7D,oBAAC,QAAA,EAAK,GAAE,qpBAAA,CAAspB;EAGplB,CAAC;;AAG/E,IAAA,iBAAe"}
@@ -1,3 +1,4 @@
1
1
  import { default as Illustration } from './Illustration';
2
2
  export * from './Illustration';
3
+ export * from './utils';
3
4
  export default Illustration;
@@ -1,2 +1,3 @@
1
+ import { n as getIllustration, t as ViewBoxSize } from "../../utils4.js";
1
2
  import { n as Illustration, t as Illustration_default } from "../../Illustration.js";
2
- export { Illustration, Illustration_default as default };
3
+ export { Illustration, ViewBoxSize, Illustration_default as default, getIllustration };
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as BabyMobileMedium_default } from "../../BabyMobileMedium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var BabyMobile = ({ size = 512, color, ...rest }) => {
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as ChildMedium_default } from "../../ChildMedium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var Child = ({ size = 512, color, ...rest }) => {
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as DoctorMedium_default } from "../../DoctorMedium.js";
3
3
  import { t as DoctorSmall_default } from "../../DoctorSmall.js";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as FacialRecognitionFingerprintMedium_default } from "../../FacialRecognitionFingerprintMedium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var FacialRecognitionFingerprint = ({ size = 512, color, ...rest }) => {
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as GiveBabyFoodMedium_default } from "../../GiveBabyFoodMedium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var GiveBabyFood = ({ size = 512, color, ...rest }) => {
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as HealthcarePersonnelMedium_default } from "../../HealthcarePersonnelMedium.js";
3
3
  import { t as HealthcarePersonnelSmall_default } from "../../HealthcarePersonnelSmall.js";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as ReadLettersMedium_default } from "../../ReadLettersMedium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var ReadLetters = ({ size = 512, color, ...rest }) => {
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as StrollerMedium_default } from "../../StrollerMedium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var Stroller = ({ size = 512, color, ...rest }) => {
@@ -1,4 +1,4 @@
1
- import { n as getIllustration } from "../../utils3.js";
1
+ import { n as getIllustration } from "../../utils4.js";
2
2
  import { t as Support2Medium_default } from "../../Support2Medium.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var Support2 = ({ size = 512, color, ...rest }) => {
@@ -8,6 +8,8 @@ export interface InfoTeaserProps {
8
8
  buttonClassName?: string;
9
9
  /** What's in the box? */
10
10
  children: React.ReactNode;
11
+ /** Override the default max height for collapsed teaser. Default is 12.25rem */
12
+ collapsedMaxHeight?: string;
11
13
  /** For overriding styling on infoteaser box */
12
14
  className?: string;
13
15
  /** Changes the underlying element of the wrapper */
@@ -27,8 +27,6 @@
27
27
  }
28
28
 
29
29
  &--collapsed {
30
- max-height: 12.25rem;
31
-
32
30
  &::after {
33
31
  content: '';
34
32
  position: absolute;
@@ -37,6 +37,8 @@ export interface LabelProps {
37
37
  sublabelWrapperClassName?: string;
38
38
  /** Sets the data-testid attribute. */
39
39
  testId?: string;
40
+ /** Gives a custom classname to the afterLabelChildren wrapper. Used in checkbox and radiobutton */
41
+ afterLabelChildrenClassName?: string;
40
42
  }
41
43
  declare const Label: FunctionComponent<LabelProps>;
42
44
  export default Label;
@@ -1,4 +1,5 @@
1
1
  import { default as Label } from './Label';
2
2
  export { Sublabel } from './SubLabel';
3
3
  export * from './Label';
4
+ export * from './utils';
4
5
  export default Label;
@@ -1,3 +1,3 @@
1
- import { n as Sublabel } from "../../Label.js";
2
- import { t as Label_default } from "../../Label2.js";
3
- export { Sublabel, Label_default as default };
1
+ import { a as Sublabel, n as renderLabel, r as renderLabelAsParent, t as getLabelText } from "../../utils2.js";
2
+ import { t as Label_default } from "../../Label.js";
3
+ export { Sublabel, Label_default as default, getLabelText, renderLabel, renderLabelAsParent };
@@ -19,7 +19,7 @@
19
19
 
20
20
  &--after-label-children {
21
21
  display: flex;
22
- align-items: flex-end;
22
+ align-items: flex-start;
23
23
  }
24
24
  }
25
25
 
@@ -2,5 +2,24 @@ import { default as React } from 'react';
2
2
  import { LabelTags } from './Label';
3
3
  import { FormOnColor } from '../../constants';
4
4
  export declare const getLabelText: (label: React.ReactNode) => string;
5
- export declare const renderLabel: (label: React.ReactNode, inputId: string, onColor: FormOnColor, markup?: LabelTags) => React.ReactNode;
6
- export declare const renderLabelAsParent: (label: React.ReactNode, children: React.ReactNode, inputId: string, onColor: FormOnColor, labelClassName?: string, labelTextClassName?: string, sublabelWrapperClassName?: string, large?: boolean, markup?: LabelTags) => React.ReactNode;
5
+ interface RenderLabelProps {
6
+ label: React.ReactNode;
7
+ inputId: string;
8
+ onColor: FormOnColor;
9
+ markup?: LabelTags;
10
+ }
11
+ export declare const renderLabel: (props: RenderLabelProps) => React.ReactNode;
12
+ interface RenderLabelAsParentProps {
13
+ label: React.ReactNode;
14
+ children: React.ReactNode;
15
+ inputId: string;
16
+ onColor: FormOnColor;
17
+ labelClassName?: string;
18
+ labelTextClassName?: string;
19
+ sublabelWrapperClassName?: string;
20
+ large?: boolean;
21
+ markup?: LabelTags;
22
+ afterLabelChildrenClassName?: string;
23
+ }
24
+ export declare const renderLabelAsParent: (props: RenderLabelAsParentProps) => React.ReactNode;
25
+ export {};
@@ -1,3 +1,4 @@
1
1
  import { default as LazyIcon } from './LazyIcon';
2
2
  export * from './LazyIcon';
3
+ export * from './utils';
3
4
  export default LazyIcon;
@@ -1,2 +1,2 @@
1
- import { n as LazyIcon, t as LazyIcon_default } from "../../LazyIcon.js";
2
- export { LazyIcon, LazyIcon_default as default };
1
+ import { n as isServerSide, r as LazyIcon, t as LazyIcon_default } from "../../LazyIcon.js";
2
+ export { LazyIcon, LazyIcon_default as default, isServerSide };
@@ -1,3 +1,4 @@
1
1
  import { default as ListEditModeItem } from './ListEditMode';
2
2
  export * from './ListEditMode';
3
+ export * from './constants';
3
4
  export default ListEditModeItem;
@@ -1,2 +1,2 @@
1
- import { n as IconButton, r as ListEditModeItem, t as ListEditMode_default } from "../../ListEditMode.js";
2
- export { IconButton, ListEditModeItem, ListEditMode_default as default };
1
+ import { i as ListEditModeItem, n as listEditModeWrapperClassnames, r as IconButton, t as ListEditMode_default } from "../../ListEditMode.js";
2
+ export { IconButton, ListEditModeItem, ListEditMode_default as default, listEditModeWrapperClassnames };
@@ -1,6 +1,6 @@
1
1
  import { t as uuid } from "../../uuid.js";
2
2
  import { c as ZIndex, n as AnalyticsId } from "../../constants2.js";
3
- import classNames from "classnames";
3
+ import cn from "classnames";
4
4
  import { useEffect, useRef, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import loaderStyles from "./styles.module.scss";
@@ -20,19 +20,19 @@ var Loader = (props) => {
20
20
  const isSmall = size === "small";
21
21
  const isMedium = size === "medium";
22
22
  const isLarge = size === "large";
23
- const loaderWrapperClasses = classNames({
23
+ const loaderWrapperClasses = cn({
24
24
  [loaderStyles["loader-wrapper--center"]]: center,
25
25
  [loaderStyles["loader-wrapper--overlay"]]: overlay,
26
26
  [loaderStyles["loader-wrapper--overlay-screen"]]: overlay === Overlay.screen,
27
27
  [loaderStyles["loader-wrapper--overlay-parent"]]: overlay === Overlay.parent && display,
28
28
  [loaderStyles["loader-wrapper--inline"]]: inline && display
29
29
  });
30
- const loaderClasses = classNames(loaderStyles.loader, {
30
+ const loaderClasses = cn(loaderStyles.loader, {
31
31
  [loaderStyles["loader--small"]]: isSmall,
32
32
  [loaderStyles["loader--medium"]]: isMedium,
33
33
  [loaderStyles["loader--large"]]: isLarge
34
34
  }, className);
35
- const loaderDotClasses = classNames(loaderStyles.loader__dot, {
35
+ const loaderDotClasses = cn(loaderStyles.loader__dot, {
36
36
  [loaderStyles["loader__dot--small"]]: isSmall,
37
37
  [loaderStyles["loader__dot--medium"]]: isMedium,
38
38
  [loaderStyles["loader__dot--large"]]: isLarge,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Loader: React.FC<LoaderProps>"],"sources":["../../../src/components/Loader/constants.ts","../../../src/components/Loader/Loader.tsx","../../../src/components/Loader/index.ts"],"sourcesContent":["export enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { PaletteNames } from '../../theme/palette';\n\nimport { Overlay } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { uuid } from '../../utils/uuid';\n\nimport loaderStyles from './styles.module.scss';\n\nexport type LoaderColors = PaletteNames;\nexport type LoaderSizes = 'tiny' | 'small' | 'medium' | 'large';\n\nexport interface LoaderProps {\n /** Sets the color of the loader. If overlay is used, the color will always be white. */\n color?: LoaderColors;\n /**\tAdds custom classes to the element. */\n className?: string;\n /** Changes the size of the loader. */\n size?: LoaderSizes;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** id of the label */\n labelId?: string;\n /** Centers the loader in a container */\n center?: boolean;\n /** Inline the loader so it can be used in a span or paragraph */\n inline?: boolean;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Individual id for loading icon (aria-labelledby). */\n ariaLabelledById?: string;\n /** String that labels the current loading element */\n ariaLabel?: string;\n}\n\nconst Loader: React.FC<LoaderProps> = props => {\n const {\n overlay,\n size = 'small',\n className = '',\n labelId = uuid(),\n testId,\n center,\n inline,\n ariaLabelledById,\n ariaLabel = 'Laster inn',\n } = props;\n const color = props.overlay ? 'white' : props.color || 'neutral';\n\n const showLoader = (): boolean => {\n if (overlay === Overlay.parent || inline) {\n return false;\n }\n\n return true;\n };\n\n const [display, setDisplay] = useState(showLoader());\n\n const isSmall = size === 'small';\n const isMedium = size === 'medium';\n const isLarge = size === 'large';\n\n const loaderWrapperClasses = classNames({\n [loaderStyles['loader-wrapper--center']]: center,\n [loaderStyles['loader-wrapper--overlay']]: overlay,\n [loaderStyles['loader-wrapper--overlay-screen']]: overlay === Overlay.screen,\n [loaderStyles['loader-wrapper--overlay-parent']]: overlay === Overlay.parent && display,\n [loaderStyles['loader-wrapper--inline']]: inline && display,\n });\n const loaderClasses = classNames(\n loaderStyles.loader,\n {\n [loaderStyles['loader--small']]: isSmall,\n [loaderStyles['loader--medium']]: isMedium,\n [loaderStyles['loader--large']]: isLarge,\n },\n className\n );\n const loaderDotClasses = classNames(loaderStyles.loader__dot, {\n [loaderStyles['loader__dot--small']]: isSmall,\n [loaderStyles['loader__dot--medium']]: isMedium,\n [loaderStyles['loader__dot--large']]: isLarge,\n [loaderStyles['loader__dot--banana']]: color === 'banana',\n [loaderStyles['loader__dot--cherry']]: color === 'cherry',\n [loaderStyles['loader__dot--kiwi']]: color === 'kiwi',\n [loaderStyles['loader__dot--neutral']]: color === 'neutral',\n [loaderStyles['loader__dot--plum']]: color === 'plum',\n [loaderStyles['loader__dot--black']]: color === 'black',\n [loaderStyles['loader__dot--white']]: color === 'white',\n });\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (overlay === Overlay.parent && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.position = 'relative';\n setDisplay(true);\n }\n\n if (inline && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.display = 'flex';\n setDisplay(true);\n }\n }, []);\n\n return (\n <div className={loaderWrapperClasses} ref={wrapperRef} style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}>\n {display && (\n <div\n data-testid={testId}\n data-analyticsid={AnalyticsId.Loader}\n role=\"progressbar\"\n aria-labelledby={ariaLabelledById || labelId}\n className={loaderClasses}\n >\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n {!ariaLabelledById && (\n <span id={labelId} className={loaderStyles['loader__hidden-text']}>\n {ariaLabel}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Loader;\n","import Loader from './Loader';\nexport { Overlay } from './constants';\nexport * from './Loader';\nexport default Loader;\n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WAAW,SAAS,eAAe,OAAO;AACtD,cAAW,QAAQ,cAAc,MAAM,UAAU;AACjD,cAAW,KAAK;;IAEjB,EAAE,CAAC;AAEN,QACE,oBAAC,OAAA;EAAI,WAAW;EAAsB,KAAK;EAAY,OAAO,YAAY,QAAQ,SAAS,EAAE,QAAQ,OAAO,eAAe,GAAG,EAAE;YAC7H,WACC,qBAAC,OAAA;GACC,eAAa;GACb,oBAAkB,YAAY;GAC9B,MAAK;GACL,mBAAiB,oBAAoB;GACrC,WAAW;;IAEX,oBAAC,OAAA,EAAI,WAAW,kBAAA,CAAoB;IACpC,oBAAC,OAAA,EAAI,WAAW,kBAAA,CAAoB;IACpC,oBAAC,OAAA,EAAI,WAAW,kBAAA,CAAoB;IACpC,oBAAC,OAAA,EAAI,WAAW,kBAAA,CAAoB;IACnC,CAAC,oBACA,oBAAC,QAAA;KAAK,IAAI;KAAS,WAAW,aAAa;eACxC;MACI;;IAEL;GAEJ;;AC/HV,IAAA,iBDmIe"}
1
+ {"version":3,"file":"index.js","names":["Loader: React.FC<LoaderProps>"],"sources":["../../../src/components/Loader/constants.ts","../../../src/components/Loader/Loader.tsx","../../../src/components/Loader/index.ts"],"sourcesContent":["export enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { PaletteNames } from '../../theme/palette';\n\nimport { Overlay } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { uuid } from '../../utils/uuid';\n\nimport loaderStyles from './styles.module.scss';\n\nexport type LoaderColors = PaletteNames;\nexport type LoaderSizes = 'tiny' | 'small' | 'medium' | 'large';\n\nexport interface LoaderProps {\n /** Sets the color of the loader. If overlay is used, the color will always be white. */\n color?: LoaderColors;\n /**\tAdds custom classes to the element. */\n className?: string;\n /** Changes the size of the loader. */\n size?: LoaderSizes;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** id of the label */\n labelId?: string;\n /** Centers the loader in a container */\n center?: boolean;\n /** Inline the loader so it can be used in a span or paragraph */\n inline?: boolean;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Individual id for loading icon (aria-labelledby). */\n ariaLabelledById?: string;\n /** String that labels the current loading element */\n ariaLabel?: string;\n}\n\nconst Loader: React.FC<LoaderProps> = props => {\n const {\n overlay,\n size = 'small',\n className = '',\n labelId = uuid(),\n testId,\n center,\n inline,\n ariaLabelledById,\n ariaLabel = 'Laster inn',\n } = props;\n const color = props.overlay ? 'white' : props.color || 'neutral';\n\n const showLoader = (): boolean => {\n if (overlay === Overlay.parent || inline) {\n return false;\n }\n\n return true;\n };\n\n const [display, setDisplay] = useState(showLoader());\n\n const isSmall = size === 'small';\n const isMedium = size === 'medium';\n const isLarge = size === 'large';\n\n const loaderWrapperClasses = classNames({\n [loaderStyles['loader-wrapper--center']]: center,\n [loaderStyles['loader-wrapper--overlay']]: overlay,\n [loaderStyles['loader-wrapper--overlay-screen']]: overlay === Overlay.screen,\n [loaderStyles['loader-wrapper--overlay-parent']]: overlay === Overlay.parent && display,\n [loaderStyles['loader-wrapper--inline']]: inline && display,\n });\n const loaderClasses = classNames(\n loaderStyles.loader,\n {\n [loaderStyles['loader--small']]: isSmall,\n [loaderStyles['loader--medium']]: isMedium,\n [loaderStyles['loader--large']]: isLarge,\n },\n className\n );\n const loaderDotClasses = classNames(loaderStyles.loader__dot, {\n [loaderStyles['loader__dot--small']]: isSmall,\n [loaderStyles['loader__dot--medium']]: isMedium,\n [loaderStyles['loader__dot--large']]: isLarge,\n [loaderStyles['loader__dot--banana']]: color === 'banana',\n [loaderStyles['loader__dot--cherry']]: color === 'cherry',\n [loaderStyles['loader__dot--kiwi']]: color === 'kiwi',\n [loaderStyles['loader__dot--neutral']]: color === 'neutral',\n [loaderStyles['loader__dot--plum']]: color === 'plum',\n [loaderStyles['loader__dot--black']]: color === 'black',\n [loaderStyles['loader__dot--white']]: color === 'white',\n });\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (overlay === Overlay.parent && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.position = 'relative';\n setDisplay(true);\n }\n\n if (inline && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.display = 'flex';\n setDisplay(true);\n }\n }, []);\n\n return (\n <div className={loaderWrapperClasses} ref={wrapperRef} style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}>\n {display && (\n <div\n data-testid={testId}\n data-analyticsid={AnalyticsId.Loader}\n role=\"progressbar\"\n aria-labelledby={ariaLabelledById || labelId}\n className={loaderClasses}\n >\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n {!ariaLabelledById && (\n <span id={labelId} className={loaderStyles['loader__hidden-text']}>\n {ariaLabel}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Loader;\n","import Loader from './Loader';\nexport { Overlay } from './constants';\nexport * from './Loader';\nexport default Loader;\n"],"mappings":";;;;;;AAAA,IAAY,UAAA,yBAAA,WAAL;AACL,WAAA,YAAA;AACA,WAAA,YAAA;;;ACoCF,IAAMA,UAAgC,UAAS;CAC7C,MAAM,EACJ,SACA,OAAO,SACP,YAAY,IACZ,UAAU,MAAM,EAChB,QACA,QACA,QACA,kBACA,YAAY,iBACV;CACJ,MAAM,QAAQ,MAAM,UAAU,UAAU,MAAM,SAAS;CAEvD,MAAM,mBAA4B;AAChC,MAAI,YAAY,QAAQ,UAAU,OAChC,QAAO;AAGT,SAAO;;CAGT,MAAM,CAAC,SAAS,cAAc,SAAS,YAAY,CAAC;CAEpD,MAAM,UAAU,SAAS;CACzB,MAAM,WAAW,SAAS;CAC1B,MAAM,UAAU,SAAS;CAEzB,MAAM,uBAAuB,GAAW;GACrC,aAAa,4BAA4B;GACzC,aAAa,6BAA6B;GAC1C,aAAa,oCAAoC,YAAY,QAAQ;GACrE,aAAa,oCAAoC,YAAY,Q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;;AC/HV,IAAA,iBDmIe"}
@@ -15,7 +15,7 @@ import { t as AlertSignFill_default } from "../../AlertSignFill.js";
15
15
  import { t as AlertSignStroke_default } from "../../AlertSignStroke.js";
16
16
  import { t as CheckOutline_default } from "../../CheckOutline.js";
17
17
  import { t as Portal } from "../../Portal.js";
18
- import classNames from "classnames";
18
+ import cn from "classnames";
19
19
  import React, { useEffect } from "react";
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
21
21
  import styles from "./styles.module.scss";
@@ -109,8 +109,8 @@ var Modal = (props) => {
109
109
  useEffect(() => {
110
110
  dialogRef.current?.focus();
111
111
  }, []);
112
- const dialogClasses = classNames(className, styles.modal, variant && styles[`modal--${variant}`], size && styles[`modal--${size}`], contentIsScrollable && !showActions && styles["modal--no-actions"]);
113
- const titleClasses = classNames({
112
+ const dialogClasses = cn(className, styles.modal, variant && styles[`modal--${variant}`], size && styles[`modal--${size}`], contentIsScrollable && !showActions && styles["modal--no-actions"]);
113
+ const titleClasses = cn({
114
114
  [styles["modal__title--error"]]: variant === ModalVariants.error,
115
115
  [styles["modal__title--success"]]: variant === ModalVariants.success
116
116
  });
@@ -132,9 +132,9 @@ var Modal = (props) => {
132
132
  ...ariaLabelAttributes,
133
133
  ref: dialogRef,
134
134
  children: [
135
- /* @__PURE__ */ jsx("div", { className: classNames(styles["modal__shadow"], styles["modal__shadow--top"], { [styles["modal__shadow--show"]]: !topContentVisible && contentIsScrollable }) }),
135
+ /* @__PURE__ */ jsx("div", { className: cn(styles["modal__shadow"], styles["modal__shadow--top"], { [styles["modal__shadow--show"]]: !topContentVisible && contentIsScrollable }) }),
136
136
  /* @__PURE__ */ jsxs("div", {
137
- className: classNames(styles.modal__contentWrapper),
137
+ className: cn(styles.modal__contentWrapper),
138
138
  tabIndex: contentIsScrollable ? 0 : void 0,
139
139
  role: contentIsScrollable ? "region" : void 0,
140
140
  ...contentIsScrollable ? ariaLabelAttributes : {},
@@ -142,14 +142,14 @@ var Modal = (props) => {
142
142
  children: [!props.noCloseButton && /* @__PURE__ */ jsx("div", {
143
143
  className: styles.modal__closeWrapper,
144
144
  children: /* @__PURE__ */ jsx("div", {
145
- className: classNames(styles.modal__closeWrapper__close),
145
+ className: cn(styles.modal__closeWrapper__close),
146
146
  children: /* @__PURE__ */ jsx(Close_default, {
147
147
  onClick: props.onClose,
148
148
  ariaLabel: props.ariaLabelCloseBtn
149
149
  })
150
150
  })
151
151
  }), /* @__PURE__ */ jsxs("div", {
152
- className: classNames(size && styles[`modal__contentWrapper__scroll--${size}`]),
152
+ className: cn(size && styles[`modal__contentWrapper__scroll--${size}`]),
153
153
  children: [
154
154
  /* @__PURE__ */ jsx("div", { ref: topContent }),
155
155
  /* @__PURE__ */ jsxs("div", {
@@ -178,9 +178,9 @@ var Modal = (props) => {
178
178
  ]
179
179
  })]
180
180
  }),
181
- /* @__PURE__ */ jsx("div", { className: classNames(styles["modal__shadow"], styles["modal__shadow--bottom"], { [styles["modal__shadow--show"]]: !bottomContentVisible && contentIsScrollable }) }),
181
+ /* @__PURE__ */ jsx("div", { className: cn(styles["modal__shadow"], styles["modal__shadow--bottom"], { [styles["modal__shadow--show"]]: !bottomContentVisible && contentIsScrollable }) }),
182
182
  showActions && /* @__PURE__ */ jsxs("div", {
183
- className: classNames(styles["modal__call-to-action"], size && styles[`modal__call-to-action--${size}`]),
183
+ className: cn(styles["modal__call-to-action"], size && styles[`modal__call-to-action--${size}`]),
184
184
  children: [
185
185
  props.onSuccess && primaryButtonText && /* @__PURE__ */ jsx(Button_default, {
186
186
  onClick: props.onSuccess,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Modal: React.FC<ModalProps>"],"sources":["../../../src/components/Modal/constants.ts","../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/index.ts"],"sourcesContent":["export enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n","import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport type { IconProps } from '../Icon';\n\nimport { ModalSize, ModalVariants } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { isComponent } from '../../utils/component';\nimport { disableBodyScroll, enableBodyScroll } from '../../utils/scroll';\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 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 /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\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 /** Aria role used for the Modal. Default is dialog */\n role?: 'dialog' | 'alertdialog';\n}\n\nconst getVariantIcon = (variant?: ModalProps['variant']): React.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']): React.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 {isComponent<IconProps>(icon, Icon) &&\n React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal: React.FC<ModalProps> = props => {\n const {\n footerContent,\n variant = ModalVariants.normal,\n primaryButtonText = 'OK',\n titleId = uuid(),\n className = '',\n size = ModalSize.large,\n zIndex = ZIndex.OverlayScreen,\n role = 'dialog',\n } = props;\n\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 useReturnFocusOnUnmount(dialogRef);\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 const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess || footerContent;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: props.ariaLabel, id: props.ariaLabelledBy, fallbackId: titleId });\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 className,\n styles.modal,\n variant && styles[`modal--${variant}`],\n size && styles[`modal--${size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: variant === ModalVariants.error,\n [styles['modal__title--success']]: 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 }}\n >\n <div className={styles.align}>\n <div className={dialogClasses} role={role} aria-modal=\"true\" tabIndex={-1} {...ariaLabelAttributes} ref={dialogRef}>\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 tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\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 className={cn(size && styles[`modal__contentWrapper__scroll--${size}`])}>\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(variant, props.icon)}\n <Title id={ariaLabelAttributes?.['aria-labelledby']} 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 {props.children && <div>{props.children}</div>}\n {!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'], size && styles[`modal__call-to-action--${size}`])}>\n {props.onSuccess && primaryButtonText && <Button onClick={props.onSuccess}>{primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n {footerContent}\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\nexport default Modal;\n","import Modal from './Modal';\nexport { ModalVariants, ModalSize } from './constants';\nexport * from './Modal';\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAY,gBAAA,yBAAA,iBAAL;AACL,iBAAA,YAAA;AACA,iBAAA,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A0B,GACrE,OAAO,yBAAyB,CAAC,wBAAwB,qBAC3D,CAAC,EAAA,CACF;MACD,eACC,qBAAC,OAAA;OAAI,WAAW,WAAG,OAAO,0BAA0B,QAAQ,OAAO,0BAA0B,QAAQ;;QAClG,MAAM,aAAa,qBAAqB,oBAAC,gBAAA;SAAO,SAAS,MAAM;mBAAY;UAA2B;QACtG,MAAM,uBAAuB,MAAM,qBAAqB,SAAS,KAChE,oBAAC,gBAAA;SAAO,SAAQ;SAAa,SAAS,MAAM;mBACzC,MAAM;UACA;QAEV;;QACG;;MAEJ;KACF;IACF;GACF;AAGR,KAAI,MAAM,WAAW;EACnB,MAAM,aAAa;AACnB,SACE,qBAAC,QAAA;GAAO,WAAW;GAAY,QAAO;cACpC,oBAAC,SAAA;IAAM,OAAM;cAAS,iBAAiB,WAAW;KAA4B,EAC7E,UAAA;IACM;;AAIb,QAAO;;AC7PT,IAAA,gBDgQe"}
1
+ {"version":3,"file":"index.js","names":["Modal: React.FC<ModalProps>"],"sources":["../../../src/components/Modal/constants.ts","../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/index.ts"],"sourcesContent":["export enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n","import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport type { IconProps } from '../Icon';\n\nimport { ModalSize, ModalVariants } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { isComponent } from '../../utils/component';\nimport { disableBodyScroll, enableBodyScroll } from '../../utils/scroll';\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 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 /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\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 /** Aria role used for the Modal. Default is dialog */\n role?: 'dialog' | 'alertdialog';\n}\n\nconst getVariantIcon = (variant?: ModalProps['variant']): React.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']): React.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 {isComponent<IconProps>(icon, Icon) &&\n React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal: React.FC<ModalProps> = props => {\n const {\n footerContent,\n variant = ModalVariants.normal,\n primaryButtonText = 'OK',\n titleId = uuid(),\n className = '',\n size = ModalSize.large,\n zIndex = ZIndex.OverlayScreen,\n role = 'dialog',\n } = props;\n\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 useReturnFocusOnUnmount(dialogRef);\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 const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess || footerContent;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: props.ariaLabel, id: props.ariaLabelledBy, fallbackId: titleId });\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 className,\n styles.modal,\n variant && styles[`modal--${variant}`],\n size && styles[`modal--${size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: variant === ModalVariants.error,\n [styles['modal__title--success']]: 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 }}\n >\n <div className={styles.align}>\n <div className={dialogClasses} role={role} aria-modal=\"true\" tabIndex={-1} {...ariaLabelAttributes} ref={dialogRef}>\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 tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\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 className={cn(size && styles[`modal__contentWrapper__scroll--${size}`])}>\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(variant, props.icon)}\n <Title id={ariaLabelAttributes?.['aria-labelledby']} 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 {props.children && <div>{props.children}</div>}\n {!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'], size && styles[`modal__call-to-action--${size}`])}>\n {props.onSuccess && primaryButtonText && <Button onClick={props.onSuccess}>{primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n {footerContent}\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\nexport default Modal;\n","import Modal from './Modal';\nexport { ModalVariants, ModalSize } from './constants';\nexport * from './Modal';\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAY,gBAAA,yBAAA,iBAAL;AACL,iBAAA,YAAA;AACA,iBAAA,aAAA;AACA,iBAAA,WAAA;AACA,iBAAA,aAAA;;;AAGF,IAAY,YAAA,yBAAA,aAAL;AACL,aAAA,WAAA;AACA,aAAA,YAAA;;;ACmEF,IAAM,kBAAkB,YAA8D;AACpF,KAAI,YAAY,cAAc,MAC5B,QAAO,oBAAC,cAAA;EAAK,MAAM,SAAS;EAAO,SAAS;EAAe,OAAO,QAAQ;GAAa;UAC9E,YAAY,cAAc,QACnC,QAAO,oBAAC,cAAA;EAAK,MAAM,SAAS;EAAO,SAAS;EAAiB,OAAO,QAAQ;GAAS;UAC5E,YAAY,cAAc,QACnC,QAAO,oBAAC,cAAA;EAAK,MAAM,S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aAAa;AACnB,SACE,qBAAC,QAAA;GAAO,WAAW;GAAY,QAAO;cACpC,oBAAC,SAAA;IAAM,OAAM;cAAS,iBAAiB,WAAW;KAA4B,EAC7E,UAAA;IACM;;AAIb,QAAO;;AC7PT,IAAA,gBDgQe"}
@@ -5,13 +5,13 @@ import { t as useIdWithFallback } from "../../useIdWithFallback.js";
5
5
  import { n as getAriaLabelAttributes } from "../../accessibility.js";
6
6
  import { t as Close_default } from "../../Close.js";
7
7
  import { t as Expander_default } from "../../Expander.js";
8
- import classNames from "classnames";
8
+ import cn from "classnames";
9
9
  import React from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import styles from "./styles.module.scss";
12
12
  var FluidWrapper = ({ fluid, children }) => {
13
13
  if (fluid) return /* @__PURE__ */ jsx("div", {
14
- className: classNames(styles["fluid-wrapper"]),
14
+ className: cn(styles["fluid-wrapper"]),
15
15
  children
16
16
  });
17
17
  return children;
@@ -23,13 +23,13 @@ var NotificationPanel = (props) => {
23
23
  const isMobile = useIsMobileBreakpoint();
24
24
  const renderContent = () => {
25
25
  const outlineVariant = compactVariant === "outline";
26
- const contentClasses = classNames(styles["notification-panel__content"]);
27
- const labelClasses = classNames(styles["notification-panel__label"], {
26
+ const contentClasses = cn(styles["notification-panel__content"]);
27
+ const labelClasses = cn(styles["notification-panel__label"], {
28
28
  [styles["notification-panel__label--no-content"]]: !children && !expanderChildren,
29
29
  [styles["notification-panel__label--compact"]]: !!compactVariant,
30
30
  [styles["notification-panel__label--outline"]]: outlineVariant
31
31
  });
32
- const childrenClasses = classNames(styles["notification-panel__children"], {
32
+ const childrenClasses = cn(styles["notification-panel__children"], {
33
33
  [styles["notification-panel__children--with-label"]]: label,
34
34
  [styles["notification-panel__children--expander-no-label"]]: expanderChildren && !label,
35
35
  [styles["notification-panel__children--outline"]]: outlineVariant
@@ -57,7 +57,7 @@ var NotificationPanel = (props) => {
57
57
  ]
58
58
  });
59
59
  };
60
- const notificationPanelClasses = classNames(styles["notification-panel"], styles[`notification-panel--${variant}`], size && styles[`notification-panel--${size}`], {
60
+ const notificationPanelClasses = cn(styles["notification-panel"], styles[`notification-panel--${variant}`], size && styles[`notification-panel--${size}`], {
61
61
  [styles["notification-panel--compact"]]: !!compactVariant,
62
62
  [styles["notification-panel--compact--basic"]]: compactVariant === "basic",
63
63
  [styles["notification-panel--compact--outline"]]: compactVariant === "outline",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FluidWrapper: React.FC<WrapFluidProps>","NotificationPanel: React.FC<NotificationPanelProps>"],"sources":["../../../src/components/NotificationPanel/NotificationPanel.tsx","../../../src/components/NotificationPanel/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\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' | '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' | 'status';\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the component */\n ref?: React.Ref<HTMLDivElement | null>;\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.FC<NotificationPanelProps> = props => {\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 labelId: labelIdProp,\n labelHtmlMarkup = 'h1',\n fluid = false,\n size,\n className,\n role,\n testId,\n ref,\n } = props;\n const labelId = useIdWithFallback(labelIdProp);\n const [expanderOpen, setExpanderOpen] = React.useState(expanderOpenFromStart);\n const isMobile = useIsMobileBreakpoint();\n\n const renderContent = (): React.ReactNode => {\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 return (\n <div className={contentClasses} id={!label ? labelId : undefined}>\n {label && (\n <CustomTag className={labelClasses} id={labelId}>\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 === 'error' && 'alert') || undefined;\n const ariaLabelAttributes = ariaRole ? getAriaLabelAttributes({ label, id: labelId }) : 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}\n size={compactVariant || isMobile ? 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=\"black\" />\n </span>\n )}\n {renderContent()}\n </div>\n </FluidWrapper>\n );\n};\n\nexport default NotificationPanel;\n","import NotificationPanel from './NotificationPanel';\nexport * from './NotificationPanel';\nexport default NotificationPanel;\n"],"m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AAO,iCAAiC,CAAC,CAAC;GAC1C,OAAO,wCAAwC,mBAAmB;GAClE,OAAO,0CAA0C,mBAAmB;GACpE,OAAO,sCAAsC,oBAAqB,SAAS;GAC3E,OAAO,qCAAqC;EAC9C,EACD,UACD;CAED,MAAM,WAAW,QAAS,YAAY,WAAW,WAAY,KAAA;CAC7D,MAAM,sBAAsB,WAAW,uBAAuB;EAAE;EAAO,IAAI;EAAS,CAAC,GAAG,KAAA;AAExF,QACE,oBAAC,cAAA;EAAoB;YACnB,qBAAC,OAAA;GACM;GACL,MAAM;GACN,eAAa;GACb,oBAAkB,YAAY;GAC9B,WAAW;GACX,GAAI;;IAEJ,oBAAC,2BAAA;KACU;KACT,MAAM,kBAAkB,WAAW,SAAS,SAAS,SAAS;KAC9D,WAAW,OAAO;MAClB;IACD,eACC,oBAAC,QAAA;KAAK,WAAW,OAAO;eACtB,oBAAC,eAAA;MAAM,WAAW,MAAM;MAA4B;MAAS,OAAM;OAAU;MACxE;IAER,eAAe;;IACZ;GACO;;AC5KnB,IAAA,4BDgLe"}
1
+ {"version":3,"file":"index.js","names":["FluidWrapper: React.FC<WrapFluidProps>","NotificationPanel: React.FC<NotificationPanelProps>"],"sources":["../../../src/components/NotificationPanel/NotificationPanel.tsx","../../../src/components/NotificationPanel/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\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' | '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' | 'status';\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the component */\n ref?: React.Ref<HTMLDivElement | null>;\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.FC<NotificationPanelProps> = props => {\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 labelId: labelIdProp,\n labelHtmlMarkup = 'h1',\n fluid = false,\n size,\n className,\n role,\n testId,\n ref,\n } = props;\n const labelId = useIdWithFallback(labelIdProp);\n const [expanderOpen, setExpanderOpen] = React.useState(expanderOpenFromStart);\n const isMobile = useIsMobileBreakpoint();\n\n const renderContent = (): React.ReactNode => {\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 return (\n <div className={contentClasses} id={!label ? labelId : undefined}>\n {label && (\n <CustomTag className={labelClasses} id={labelId}>\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 === 'error' && 'alert') || undefined;\n const ariaLabelAttributes = ariaRole ? getAriaLabelAttributes({ label, id: labelId }) : 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}\n size={compactVariant || isMobile ? 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=\"black\" />\n </span>\n )}\n {renderContent()}\n </div>\n </FluidWrapper>\n );\n};\n\nexport default NotificationPanel;\n","import NotificationPanel from './NotificationPanel';\nexport * from './NotificationPanel';\nexport default NotificationPanel;\n"],"mappings":";;;;;;;;;;;AAgEA,IAAMA,gBAA0C,EAAE,OAAO,eAAe;AACtE,KAAI,MAGF,QAAO,oBAAC,OAAA;EAAI,WAFS,GAAW,OAAO,iBAAiB;EAElB;GAAe;AAEvD,QAAO;;AAGT,IAAMC,qBAAsD,UAAS;CACnE,MAAM,EACJ,UACA,UAAU,QACV,cAAc,OACd,SACA,kBACA,oBACA,0BACA,wBAAwB,OACxB,gBACA,OACA,SAAS,aACT,kBAAkB,MAClB,QAAQ,OACR,MACA,WACA,MACA,QACA,QACE;CACJ,MAAM,UAAU,kBAAkB,YAAY;CAC9C,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,sBAAsB;CAC7E,MAAM,WAAW,uBAAuB;CAExC,MAAM,sBAAuC;EAC3C,MAAM,iBAAiB,mBAAmB;EAC1C,MAAM,iBAAiB,GAAW,OAAO,+BAA+B;EACxE,MAAM,eAAe,GAAW,OAAO,8BAA8B;IAClE,OAAO,2CAA2C,CAAC,YAAY,CAAC;IAChE,OAAO,wCAAwC,CAAC,CAAC;IACjD,OAAO,wCAAwC;GACjD,CAAC;EACF,MAAM,kBAAkB,GAAW,OAAO,iCAAiC;IACxE,OAAO,8CAA8C;IACrD,OAAO,qDAAqD,oBAAoB,CAAC;IACjF,OAAO,2CAA2C;GACpD,CAAC;AAGF,SACE,qBAAC,OAAA;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