@helsenorge/designsystem-react 15.0.0-beta.1 → 15.0.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 (712) hide show
  1. package/lib/AnchorLink.js.map +1 -1
  2. package/lib/AsChildSlot.js.map +1 -1
  3. package/lib/Avatar.js.map +1 -1
  4. package/lib/Badge.js.map +1 -1
  5. package/lib/Button.js.map +1 -1
  6. package/lib/CHANGELOG.md +33 -0
  7. package/lib/Checkbox.js +25 -48
  8. package/lib/Checkbox.js.map +1 -1
  9. package/lib/Checkbox2.js +69 -0
  10. package/lib/Checkbox2.js.map +1 -0
  11. package/lib/CheckboxMarker.js +64 -0
  12. package/lib/CheckboxMarker.js.map +1 -0
  13. package/lib/Chip.js.map +1 -1
  14. package/lib/Close.js.map +1 -1
  15. package/lib/DictionaryTrigger.js.map +1 -1
  16. package/lib/Drawer.js.map +1 -1
  17. package/lib/DrawerNavigation.js.map +1 -1
  18. package/lib/Duolist.js.map +1 -1
  19. package/lib/ElementHeader.js.map +1 -1
  20. package/lib/ElementHeaderText.js.map +1 -1
  21. package/lib/ErrorBoundary.js.map +1 -1
  22. package/lib/ErrorWrapper.js.map +1 -1
  23. package/lib/Expander.js.map +1 -1
  24. package/lib/FilterButton.js.map +1 -1
  25. package/lib/FilterButtonAndChipsWrapper.js.map +1 -1
  26. package/lib/FilterDrawer.js +20 -10
  27. package/lib/FilterDrawer.js.map +1 -1
  28. package/lib/FilterLinkList.js.map +1 -1
  29. package/lib/FilterOverviewLinkList.js.map +1 -1
  30. package/lib/FilterOverviewSearch.js.map +1 -1
  31. package/lib/FilterResultCountAndSortWrapper.js.map +1 -1
  32. package/lib/FilterSearch.js.map +1 -1
  33. package/lib/FilterSort.js.map +1 -1
  34. package/lib/FilterStateWrapper.js.map +1 -1
  35. package/lib/FormFieldTag.js.map +1 -1
  36. package/lib/FormGroup.js +5 -5
  37. package/lib/FormGroup.js.map +1 -1
  38. package/lib/FormLayout.js.map +1 -1
  39. package/lib/HelpDetails.js.map +1 -1
  40. package/lib/HelpTriggerIcon.js.map +1 -1
  41. package/lib/HelpTriggerStandalone.js.map +1 -1
  42. package/lib/HighlightPanel.js.map +1 -1
  43. package/lib/Highlighter.js.map +1 -1
  44. package/lib/HorizontalScroll.js.map +1 -1
  45. package/lib/Icon.js.map +1 -1
  46. package/lib/Illustration.js +1 -1
  47. package/lib/Illustration.js.map +1 -1
  48. package/lib/InfoTeaser.js.map +1 -1
  49. package/lib/Input.js.map +1 -1
  50. package/lib/LazyIcon.js +1 -1
  51. package/lib/LazyIcon.js.map +1 -1
  52. package/lib/LazyIllustration.js +6 -2
  53. package/lib/LazyIllustration.js.map +1 -1
  54. package/lib/LinkList.js.map +1 -1
  55. package/lib/List.js.map +1 -1
  56. package/lib/ListEditMode.js.map +1 -1
  57. package/lib/LoaderSpinner.js +61 -0
  58. package/lib/LoaderSpinner.js.map +1 -0
  59. package/lib/MaxCharacters.js.map +1 -1
  60. package/lib/NotificationBadge.js.map +1 -1
  61. package/lib/PanelTitle.js.map +1 -1
  62. package/lib/PopOver.js.map +1 -1
  63. package/lib/Radio.js +74 -0
  64. package/lib/Radio.js.map +1 -0
  65. package/lib/RadioButton.js +84 -0
  66. package/lib/RadioButton.js.map +1 -0
  67. package/lib/RadioMarker.js +35 -0
  68. package/lib/RadioMarker.js.map +1 -0
  69. package/lib/Select.js.map +1 -1
  70. package/lib/SingleSelectItem.js.map +1 -1
  71. package/lib/Slider.js.map +1 -1
  72. package/lib/Spacer.js.map +1 -1
  73. package/lib/StatusDot.js.map +1 -1
  74. package/lib/StatusDotList.js.map +1 -1
  75. package/lib/StepButtons.js.map +1 -1
  76. package/lib/TabList.js.map +1 -1
  77. package/lib/TabPanel.js.map +1 -1
  78. package/lib/TableBody.js +3 -3
  79. package/lib/TableBody.js.map +1 -1
  80. package/lib/TableCell.js +2 -2
  81. package/lib/TableCell.js.map +1 -1
  82. package/lib/TableExpandedRow.js +4 -4
  83. package/lib/TableExpandedRow.js.map +1 -1
  84. package/lib/TableExpanderCell.js +2 -2
  85. package/lib/TableExpanderCell.js.map +1 -1
  86. package/lib/TableHead.js +7 -7
  87. package/lib/TableHead.js.map +1 -1
  88. package/lib/TableHeadCell.js +5 -5
  89. package/lib/TableHeadCell.js.map +1 -1
  90. package/lib/TableRow.js +6 -6
  91. package/lib/TableRow.js.map +1 -1
  92. package/lib/Textarea.js.map +1 -1
  93. package/lib/Title.js.map +1 -1
  94. package/lib/Toast.js.map +1 -1
  95. package/lib/VisualCheckbox.js +79 -0
  96. package/lib/VisualCheckbox.js.map +1 -0
  97. package/lib/VisualRadio.js +64 -0
  98. package/lib/VisualRadio.js.map +1 -0
  99. package/lib/__mocks__/IntersectionObserver.js.map +1 -1
  100. package/lib/__mocks__/MutationObserver.js.map +1 -1
  101. package/lib/__mocks__/ResizeObserver.js.map +1 -1
  102. package/lib/__mocks__/matchMedia.js +3 -2
  103. package/lib/__mocks__/matchMedia.js.map +1 -1
  104. package/lib/__mocks__/useLayoutEvent.js.map +1 -1
  105. package/lib/__mocks__/useOutsideEvent.js.map +1 -1
  106. package/lib/__mocks__/usePseudoClasses.js.map +1 -1
  107. package/lib/__mocks__/useSize.js.map +1 -1
  108. package/lib/__mocks__/uuid.js.map +1 -1
  109. package/lib/components/ArticleTeaser/index.js.map +1 -1
  110. package/lib/components/Checkbox/CheckboxMarker/CheckboxMarker.d.ts +20 -0
  111. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +309 -0
  112. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss.d.ts +25 -0
  113. package/lib/components/Checkbox/styles.module.scss +9 -269
  114. package/lib/components/Checkbox/styles.module.scss.d.ts +1 -17
  115. package/lib/components/Dropdown/index.js.map +1 -1
  116. package/lib/components/DropdownOld/index.js.map +1 -1
  117. package/lib/components/EmptyState/index.js.map +1 -1
  118. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  119. package/lib/components/ExpanderList/index.js.map +1 -1
  120. package/lib/components/EyebrowHeader/index.js.map +1 -1
  121. package/lib/components/FavoriteButton/index.js.map +1 -1
  122. package/lib/components/Filter/FilterDrawer/FilterDrawer.d.ts +4 -2
  123. package/lib/components/Filter/FilterDrawer/styles.module.scss +7 -0
  124. package/lib/components/Filter/FilterDrawer/styles.module.scss.d.ts +1 -0
  125. package/lib/components/Filter/LoaderSpinner/LoaderSpinner.d.ts +9 -0
  126. package/lib/components/Filter/LoaderSpinner/index.d.ts +3 -0
  127. package/lib/components/Filter/LoaderSpinner/index.js +7 -0
  128. package/lib/components/Filter/LoaderSpinner/index.js.map +1 -0
  129. package/lib/components/Filter/LoaderSpinner/styles.module.scss +27 -0
  130. package/lib/components/Filter/LoaderSpinner/styles.module.scss.d.ts +11 -0
  131. package/lib/components/Filter/index.d.ts +2 -0
  132. package/lib/components/Filter/index.js +2 -1
  133. package/lib/components/Filter/index.js.map +1 -1
  134. package/lib/components/HelpBubble/index.js.map +1 -1
  135. package/lib/components/HelpDrawer/index.js.map +1 -1
  136. package/lib/components/HelpExpanderInline/index.js.map +1 -1
  137. package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
  138. package/lib/components/HelpPanel/index.js.map +1 -1
  139. package/lib/components/HelpTeaser/index.js.map +1 -1
  140. package/lib/components/HelpTooltip/index.js.map +1 -1
  141. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  142. package/lib/components/Icons/ActiveMonitoring.js.map +1 -1
  143. package/lib/components/Icons/AcupunctureBack.js.map +1 -1
  144. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  145. package/lib/components/Icons/AlarmClock.js.map +1 -1
  146. package/lib/components/Icons/AlertSignFill.js.map +1 -1
  147. package/lib/components/Icons/AlertSignStroke.js.map +1 -1
  148. package/lib/components/Icons/Amputation.js.map +1 -1
  149. package/lib/components/Icons/Anxiety.js.map +1 -1
  150. package/lib/components/Icons/Apple.js.map +1 -1
  151. package/lib/components/Icons/Archive.js.map +1 -1
  152. package/lib/components/Icons/ArmFlexing.js.map +1 -1
  153. package/lib/components/Icons/ArrowDown.js.map +1 -1
  154. package/lib/components/Icons/ArrowLeft.js.map +1 -1
  155. package/lib/components/Icons/ArrowRight.js.map +1 -1
  156. package/lib/components/Icons/ArrowUp.js.map +1 -1
  157. package/lib/components/Icons/ArrowUpRight.js.map +1 -1
  158. package/lib/components/Icons/Attachment.js.map +1 -1
  159. package/lib/components/Icons/Atv.js.map +1 -1
  160. package/lib/components/Icons/Avatar.js.map +1 -1
  161. package/lib/components/Icons/AwakePersonOnPillow.js.map +1 -1
  162. package/lib/components/Icons/Baby.js.map +1 -1
  163. package/lib/components/Icons/BandAid.js.map +1 -1
  164. package/lib/components/Icons/BeerAndPills.js.map +1 -1
  165. package/lib/components/Icons/Bell.js.map +1 -1
  166. package/lib/components/Icons/Bike.js.map +1 -1
  167. package/lib/components/Icons/BirthControl.js.map +1 -1
  168. package/lib/components/Icons/BirthdayCake.js.map +1 -1
  169. package/lib/components/Icons/Boat.js.map +1 -1
  170. package/lib/components/Icons/Body.js.map +1 -1
  171. package/lib/components/Icons/Braille.js.map +1 -1
  172. package/lib/components/Icons/Brain.js.map +1 -1
  173. package/lib/components/Icons/BreastReconstruction.js.map +1 -1
  174. package/lib/components/Icons/BreastRemoval.js.map +1 -1
  175. package/lib/components/Icons/Breasts.js.map +1 -1
  176. package/lib/components/Icons/BrokenHeart.js.map +1 -1
  177. package/lib/components/Icons/BrokenPuzzle.js.map +1 -1
  178. package/lib/components/Icons/Bus.js.map +1 -1
  179. package/lib/components/Icons/Calendar.js.map +1 -1
  180. package/lib/components/Icons/CalendarChange.js.map +1 -1
  181. package/lib/components/Icons/CalendarCheck.js.map +1 -1
  182. package/lib/components/Icons/CalendarEvent.js.map +1 -1
  183. package/lib/components/Icons/CalendarSave.js.map +1 -1
  184. package/lib/components/Icons/Cancer.js.map +1 -1
  185. package/lib/components/Icons/Candle.js.map +1 -1
  186. package/lib/components/Icons/Car.js.map +1 -1
  187. package/lib/components/Icons/Carton.js.map +1 -1
  188. package/lib/components/Icons/Change.js.map +1 -1
  189. package/lib/components/Icons/Check.js.map +1 -1
  190. package/lib/components/Icons/CheckFill.js.map +1 -1
  191. package/lib/components/Icons/CheckOutline.js.map +1 -1
  192. package/lib/components/Icons/Chest.js.map +1 -1
  193. package/lib/components/Icons/ChevronDown.js.map +1 -1
  194. package/lib/components/Icons/ChevronLeft.js.map +1 -1
  195. package/lib/components/Icons/ChevronRight.js.map +1 -1
  196. package/lib/components/Icons/ChevronUp.js.map +1 -1
  197. package/lib/components/Icons/ChevronsDown.js.map +1 -1
  198. package/lib/components/Icons/ChevronsUp.js.map +1 -1
  199. package/lib/components/Icons/ChildPlaying.js.map +1 -1
  200. package/lib/components/Icons/Cigarette.js.map +1 -1
  201. package/lib/components/Icons/Coins.js.map +1 -1
  202. package/lib/components/Icons/Contacts.js.map +1 -1
  203. package/lib/components/Icons/Copy.js.map +1 -1
  204. package/lib/components/Icons/CoronaCertificate.js.map +1 -1
  205. package/lib/components/Icons/Coronavirus.js.map +1 -1
  206. package/lib/components/Icons/Cough.js.map +1 -1
  207. package/lib/components/Icons/CreditCard.js.map +1 -1
  208. package/lib/components/Icons/CriticalHealthInfo.js.map +1 -1
  209. package/lib/components/Icons/Cross.js.map +1 -1
  210. package/lib/components/Icons/DataExchange.js.map +1 -1
  211. package/lib/components/Icons/DataReceived.js.map +1 -1
  212. package/lib/components/Icons/DataSent.js.map +1 -1
  213. package/lib/components/Icons/Depression.js.map +1 -1
  214. package/lib/components/Icons/DigestiveSystem.js.map +1 -1
  215. package/lib/components/Icons/Dizzy.js.map +1 -1
  216. package/lib/components/Icons/Documents.js.map +1 -1
  217. package/lib/components/Icons/Dog.js.map +1 -1
  218. package/lib/components/Icons/DonorCard.js.map +1 -1
  219. package/lib/components/Icons/DotAttachment.js.map +1 -1
  220. package/lib/components/Icons/DotCheckmark.js.map +1 -1
  221. package/lib/components/Icons/DotCircleArrows.js.map +1 -1
  222. package/lib/components/Icons/DotDot.js.map +1 -1
  223. package/lib/components/Icons/DotExclamationMark.js.map +1 -1
  224. package/lib/components/Icons/DotFill.js.map +1 -1
  225. package/lib/components/Icons/DotGroup.js.map +1 -1
  226. package/lib/components/Icons/DotHalfDisc.js.map +1 -1
  227. package/lib/components/Icons/DotInfo.js.map +1 -1
  228. package/lib/components/Icons/DotLogin.js.map +1 -1
  229. package/lib/components/Icons/DotLookingGlass.js.map +1 -1
  230. package/lib/components/Icons/DotNoAccess.js.map +1 -1
  231. package/lib/components/Icons/DotNoEye.js.map +1 -1
  232. package/lib/components/Icons/DotOutline.js.map +1 -1
  233. package/lib/components/Icons/DotPencil.js.map +1 -1
  234. package/lib/components/Icons/DotQuestionMark.js.map +1 -1
  235. package/lib/components/Icons/DotTriangle.js.map +1 -1
  236. package/lib/components/Icons/DotX.js.map +1 -1
  237. package/lib/components/Icons/Download.js.map +1 -1
  238. package/lib/components/Icons/Draft.js.map +1 -1
  239. package/lib/components/Icons/Drag.js.map +1 -1
  240. package/lib/components/Icons/EChat.js.map +1 -1
  241. package/lib/components/Icons/Ear.js.map +1 -1
  242. package/lib/components/Icons/EarDeaf.js.map +1 -1
  243. package/lib/components/Icons/EarHearingAid.js.map +1 -1
  244. package/lib/components/Icons/EarNoseThroat.js.map +1 -1
  245. package/lib/components/Icons/EarVolume.js.map +1 -1
  246. package/lib/components/Icons/Edit.js.map +1 -1
  247. package/lib/components/Icons/ElderlyPerson.js.map +1 -1
  248. package/lib/components/Icons/Embolization.js.map +1 -1
  249. package/lib/components/Icons/EmergencyCall.js.map +1 -1
  250. package/lib/components/Icons/EmoticonAnnoyed.js.map +1 -1
  251. package/lib/components/Icons/EmoticonDelighted.js.map +1 -1
  252. package/lib/components/Icons/EmoticonDisappointed.js.map +1 -1
  253. package/lib/components/Icons/EmoticonHappy.js.map +1 -1
  254. package/lib/components/Icons/EmoticonMeh.js.map +1 -1
  255. package/lib/components/Icons/EmptyBox.js.map +1 -1
  256. package/lib/components/Icons/EnterFullScreen.js.map +1 -1
  257. package/lib/components/Icons/Envelope.js.map +1 -1
  258. package/lib/components/Icons/Epilepsy.js.map +1 -1
  259. package/lib/components/Icons/Eraser.js.map +1 -1
  260. package/lib/components/Icons/ErrorSignFill.js.map +1 -1
  261. package/lib/components/Icons/ErrorSignStroke.js.map +1 -1
  262. package/lib/components/Icons/EuropeanHealthCard.js.map +1 -1
  263. package/lib/components/Icons/ExitFullScreen.js.map +1 -1
  264. package/lib/components/Icons/Eye.js.map +1 -1
  265. package/lib/components/Icons/Facebook.js.map +1 -1
  266. package/lib/components/Icons/FallingLeaf.js.map +1 -1
  267. package/lib/components/Icons/Feedback.js.map +1 -1
  268. package/lib/components/Icons/Female.js.map +1 -1
  269. package/lib/components/Icons/FemaleDoctor.js.map +1 -1
  270. package/lib/components/Icons/Ferry.js.map +1 -1
  271. package/lib/components/Icons/File.js.map +1 -1
  272. package/lib/components/Icons/Filter.js +12 -12
  273. package/lib/components/Icons/Filter.js.map +1 -1
  274. package/lib/components/Icons/FingerBleed.js.map +1 -1
  275. package/lib/components/Icons/FirstAidKit.js.map +1 -1
  276. package/lib/components/Icons/Fish.js.map +1 -1
  277. package/lib/components/Icons/FloppyDisk.js.map +1 -1
  278. package/lib/components/Icons/Football.js.map +1 -1
  279. package/lib/components/Icons/Form.js.map +1 -1
  280. package/lib/components/Icons/Forward.js.map +1 -1
  281. package/lib/components/Icons/Gallery.js.map +1 -1
  282. package/lib/components/Icons/Garden.js.map +1 -1
  283. package/lib/components/Icons/GasCan.js.map +1 -1
  284. package/lib/components/Icons/GenderIdentity.js.map +1 -1
  285. package/lib/components/Icons/GlassWater.js.map +1 -1
  286. package/lib/components/Icons/Glasses.js.map +1 -1
  287. package/lib/components/Icons/Globe.js.map +1 -1
  288. package/lib/components/Icons/Grain.js.map +1 -1
  289. package/lib/components/Icons/Graph.js.map +1 -1
  290. package/lib/components/Icons/Group.js.map +1 -1
  291. package/lib/components/Icons/GroupTwins.js.map +1 -1
  292. package/lib/components/Icons/HTMLFile.js.map +1 -1
  293. package/lib/components/Icons/HandWaving.js.map +1 -1
  294. package/lib/components/Icons/HandWithDisease.js.map +1 -1
  295. package/lib/components/Icons/HandsAndHeart.js.map +1 -1
  296. package/lib/components/Icons/HealthClinic.js.map +1 -1
  297. package/lib/components/Icons/HealthMeasurements.js.map +1 -1
  298. package/lib/components/Icons/HealthWarning.js.map +1 -1
  299. package/lib/components/Icons/HealthcarePerson.js.map +1 -1
  300. package/lib/components/Icons/HealthcarePersonell.js.map +1 -1
  301. package/lib/components/Icons/HearingProtection.js.map +1 -1
  302. package/lib/components/Icons/Heart.js.map +1 -1
  303. package/lib/components/Icons/HeartHands.js.map +1 -1
  304. package/lib/components/Icons/HelpSign.js.map +1 -1
  305. package/lib/components/Icons/HelpingHand.js.map +1 -1
  306. package/lib/components/Icons/Hemodialysis.js.map +1 -1
  307. package/lib/components/Icons/Hiker.js.map +1 -1
  308. package/lib/components/Icons/Hipprosthesis.js.map +1 -1
  309. package/lib/components/Icons/History.js.map +1 -1
  310. package/lib/components/Icons/HivAndAids.js.map +1 -1
  311. package/lib/components/Icons/Home.js.map +1 -1
  312. package/lib/components/Icons/HomeFill.js.map +1 -1
  313. package/lib/components/Icons/Hormone.js.map +1 -1
  314. package/lib/components/Icons/Hospital.js.map +1 -1
  315. package/lib/components/Icons/Hourglass.js.map +1 -1
  316. package/lib/components/Icons/IconNames.js.map +1 -1
  317. package/lib/components/Icons/ImgFile.js.map +1 -1
  318. package/lib/components/Icons/Inbox.js.map +1 -1
  319. package/lib/components/Icons/InfoSignFill.js.map +1 -1
  320. package/lib/components/Icons/InfoSignStroke.js.map +1 -1
  321. package/lib/components/Icons/Instagram.js.map +1 -1
  322. package/lib/components/Icons/Intravenous.js.map +1 -1
  323. package/lib/components/Icons/JointPain.js.map +1 -1
  324. package/lib/components/Icons/Journal.js.map +1 -1
  325. package/lib/components/Icons/JpgFile.js.map +1 -1
  326. package/lib/components/Icons/Kidney.js.map +1 -1
  327. package/lib/components/Icons/KitchenScale.js.map +1 -1
  328. package/lib/components/Icons/Kjernejournal.js.map +1 -1
  329. package/lib/components/Icons/Laboratory.js.map +1 -1
  330. package/lib/components/Icons/LaptopBlog.js.map +1 -1
  331. package/lib/components/Icons/LawBook.js.map +1 -1
  332. package/lib/components/Icons/LegalDocument.js.map +1 -1
  333. package/lib/components/Icons/LightBulb.js.map +1 -1
  334. package/lib/components/Icons/List.js.map +1 -1
  335. package/lib/components/Icons/Location.js.map +1 -1
  336. package/lib/components/Icons/LocationFill.js.map +1 -1
  337. package/lib/components/Icons/Lock.js.map +1 -1
  338. package/lib/components/Icons/Login.js.map +1 -1
  339. package/lib/components/Icons/Logout.js.map +1 -1
  340. package/lib/components/Icons/Lungs.js.map +1 -1
  341. package/lib/components/Icons/Makeup.js.map +1 -1
  342. package/lib/components/Icons/MaleDoctor.js.map +1 -1
  343. package/lib/components/Icons/MaleDoctorAndPerson.js.map +1 -1
  344. package/lib/components/Icons/MaleDoctorCompact.js.map +1 -1
  345. package/lib/components/Icons/MaleDoctorCompactFill.js.map +1 -1
  346. package/lib/components/Icons/MaleGenitalia.js.map +1 -1
  347. package/lib/components/Icons/MeasuringTape.js.map +1 -1
  348. package/lib/components/Icons/Medicine.js.map +1 -1
  349. package/lib/components/Icons/MedicineWarning.js.map +1 -1
  350. package/lib/components/Icons/MentalHealthAdult.js.map +1 -1
  351. package/lib/components/Icons/MentalHealthChild.js.map +1 -1
  352. package/lib/components/Icons/Menu.js.map +1 -1
  353. package/lib/components/Icons/Microscope.js.map +1 -1
  354. package/lib/components/Icons/Minus.js.map +1 -1
  355. package/lib/components/Icons/Mirror.js.map +1 -1
  356. package/lib/components/Icons/MobilePhone.js.map +1 -1
  357. package/lib/components/Icons/MotherHoldingBaby.js.map +1 -1
  358. package/lib/components/Icons/MuscleBack.js.map +1 -1
  359. package/lib/components/Icons/MuscleLeg.js.map +1 -1
  360. package/lib/components/Icons/Mushroom.js.map +1 -1
  361. package/lib/components/Icons/Music.js.map +1 -1
  362. package/lib/components/Icons/MusselsAndSalt.js.map +1 -1
  363. package/lib/components/Icons/NoAccess.js.map +1 -1
  364. package/lib/components/Icons/NoEye.js.map +1 -1
  365. package/lib/components/Icons/NoFilter.js.map +1 -1
  366. package/lib/components/Icons/Notepad.js.map +1 -1
  367. package/lib/components/Icons/Osteotomy.js.map +1 -1
  368. package/lib/components/Icons/PaintRoller.js.map +1 -1
  369. package/lib/components/Icons/PaperPlane.js.map +1 -1
  370. package/lib/components/Icons/PatientAndPerson.js.map +1 -1
  371. package/lib/components/Icons/Pause.js.map +1 -1
  372. package/lib/components/Icons/PdfFile.js.map +1 -1
  373. package/lib/components/Icons/Pencil.js.map +1 -1
  374. package/lib/components/Icons/PeopleTalking.js.map +1 -1
  375. package/lib/components/Icons/Peritonealdialysis.js.map +1 -1
  376. package/lib/components/Icons/Person.js.map +1 -1
  377. package/lib/components/Icons/PersonAndPatient.js.map +1 -1
  378. package/lib/components/Icons/PersonCancel.js.map +1 -1
  379. package/lib/components/Icons/PersonInXRayMachine.js.map +1 -1
  380. package/lib/components/Icons/PersonOverweight.js.map +1 -1
  381. package/lib/components/Icons/PersonRelaxing.js.map +1 -1
  382. package/lib/components/Icons/PersonWithBrain.js.map +1 -1
  383. package/lib/components/Icons/PersonWithBrokenArm.js.map +1 -1
  384. package/lib/components/Icons/PersonWithCrutches.js.map +1 -1
  385. package/lib/components/Icons/PersonWithJaw.js.map +1 -1
  386. package/lib/components/Icons/PersonWithMagnifyingGlass.js.map +1 -1
  387. package/lib/components/Icons/PersonWithSenses.js.map +1 -1
  388. package/lib/components/Icons/PersonWorking.js.map +1 -1
  389. package/lib/components/Icons/PersonalPlan.js.map +1 -1
  390. package/lib/components/Icons/PizzaSlice.js.map +1 -1
  391. package/lib/components/Icons/Plane.js.map +1 -1
  392. package/lib/components/Icons/Plant.js.map +1 -1
  393. package/lib/components/Icons/PlateKnifeFork.js.map +1 -1
  394. package/lib/components/Icons/Play.js.map +1 -1
  395. package/lib/components/Icons/PlusLarge.js.map +1 -1
  396. package/lib/components/Icons/PlusSmall.js.map +1 -1
  397. package/lib/components/Icons/PngFile.js.map +1 -1
  398. package/lib/components/Icons/Podcast.js.map +1 -1
  399. package/lib/components/Icons/PoisonInformation.js.map +1 -1
  400. package/lib/components/Icons/Pregnant.js.map +1 -1
  401. package/lib/components/Icons/Printer.js.map +1 -1
  402. package/lib/components/Icons/Psychosis.js.map +1 -1
  403. package/lib/components/Icons/Publication.js.map +1 -1
  404. package/lib/components/Icons/Puzzle.js.map +1 -1
  405. package/lib/components/Icons/QrCode.js.map +1 -1
  406. package/lib/components/Icons/Quarrel.js.map +1 -1
  407. package/lib/components/Icons/RadioTherapy.js.map +1 -1
  408. package/lib/components/Icons/RadioactiveTreatment.js.map +1 -1
  409. package/lib/components/Icons/Radioiodine.js.map +1 -1
  410. package/lib/components/Icons/Receipt.js.map +1 -1
  411. package/lib/components/Icons/Receptionist.js.map +1 -1
  412. package/lib/components/Icons/Recovery.js.map +1 -1
  413. package/lib/components/Icons/Referral.js.map +1 -1
  414. package/lib/components/Icons/Refresh.js.map +1 -1
  415. package/lib/components/Icons/Refund.js.map +1 -1
  416. package/lib/components/Icons/Reminder.js.map +1 -1
  417. package/lib/components/Icons/Reply.js.map +1 -1
  418. package/lib/components/Icons/Rocket.js.map +1 -1
  419. package/lib/components/Icons/RtfFile.js.map +1 -1
  420. package/lib/components/Icons/STDs.js.map +1 -1
  421. package/lib/components/Icons/Save.js.map +1 -1
  422. package/lib/components/Icons/Scale.js.map +1 -1
  423. package/lib/components/Icons/ScreenReader.js.map +1 -1
  424. package/lib/components/Icons/Search.js +4 -4
  425. package/lib/components/Icons/Search.js.map +1 -1
  426. package/lib/components/Icons/SectionSign.js.map +1 -1
  427. package/lib/components/Icons/Settings.js.map +1 -1
  428. package/lib/components/Icons/SettingsFill.js.map +1 -1
  429. package/lib/components/Icons/Sexualorientation.js.map +1 -1
  430. package/lib/components/Icons/ShakingHand.js.map +1 -1
  431. package/lib/components/Icons/Share.js.map +1 -1
  432. package/lib/components/Icons/SharedHealthData.js.map +1 -1
  433. package/lib/components/Icons/SharedHealthMeasurements.js.map +1 -1
  434. package/lib/components/Icons/Shield.js.map +1 -1
  435. package/lib/components/Icons/ShuntOperation.js.map +1 -1
  436. package/lib/components/Icons/Skeleton.js.map +1 -1
  437. package/lib/components/Icons/Skin.js.map +1 -1
  438. package/lib/components/Icons/Snake.js.map +1 -1
  439. package/lib/components/Icons/Snapchat.js.map +1 -1
  440. package/lib/components/Icons/Sort.js +12 -12
  441. package/lib/components/Icons/Sort.js.map +1 -1
  442. package/lib/components/Icons/SortDown.js.map +1 -1
  443. package/lib/components/Icons/SortUp.js.map +1 -1
  444. package/lib/components/Icons/SpeechBubble.js.map +1 -1
  445. package/lib/components/Icons/Spray.js.map +1 -1
  446. package/lib/components/Icons/StarFill.js.map +1 -1
  447. package/lib/components/Icons/StarStroke.js.map +1 -1
  448. package/lib/components/Icons/StickyNote.js.map +1 -1
  449. package/lib/components/Icons/StickyNotes.js.map +1 -1
  450. package/lib/components/Icons/Stopwatch.js.map +1 -1
  451. package/lib/components/Icons/Sun.js.map +1 -1
  452. package/lib/components/Icons/SupportingPerson.js.map +1 -1
  453. package/lib/components/Icons/Surgery.js.map +1 -1
  454. package/lib/components/Icons/Sweets.js.map +1 -1
  455. package/lib/components/Icons/Syringe.js.map +1 -1
  456. package/lib/components/Icons/Taxi.js.map +1 -1
  457. package/lib/components/Icons/TeddyBear.js.map +1 -1
  458. package/lib/components/Icons/Teenagers.js.map +1 -1
  459. package/lib/components/Icons/ThinkingAboutBaby.js.map +1 -1
  460. package/lib/components/Icons/Ticket.js.map +1 -1
  461. package/lib/components/Icons/TimePassing.js.map +1 -1
  462. package/lib/components/Icons/Toddler.js.map +1 -1
  463. package/lib/components/Icons/Tombstone.js.map +1 -1
  464. package/lib/components/Icons/Toolbox.js.map +1 -1
  465. package/lib/components/Icons/Tooth.js.map +1 -1
  466. package/lib/components/Icons/TotalKneeProsthesis.js.map +1 -1
  467. package/lib/components/Icons/Train.js.map +1 -1
  468. package/lib/components/Icons/Transplantation.js.map +1 -1
  469. package/lib/components/Icons/TrashCan.js.map +1 -1
  470. package/lib/components/Icons/TravelRoute.js.map +1 -1
  471. package/lib/components/Icons/TreatmentAids.js.map +1 -1
  472. package/lib/components/Icons/TriangleX.js.map +1 -1
  473. package/lib/components/Icons/Twitter.js.map +1 -1
  474. package/lib/components/Icons/Undo.js.map +1 -1
  475. package/lib/components/Icons/UniProsthesis.js.map +1 -1
  476. package/lib/components/Icons/Upload.js.map +1 -1
  477. package/lib/components/Icons/UserOrganization.js.map +1 -1
  478. package/lib/components/Icons/Vaccine.js.map +1 -1
  479. package/lib/components/Icons/VerticalDots.js.map +1 -1
  480. package/lib/components/Icons/VideoCamera.js.map +1 -1
  481. package/lib/components/Icons/VideoChat.js.map +1 -1
  482. package/lib/components/Icons/Wallet.js.map +1 -1
  483. package/lib/components/Icons/Watch.js.map +1 -1
  484. package/lib/components/Icons/Website.js.map +1 -1
  485. package/lib/components/Icons/Wheelchair.js.map +1 -1
  486. package/lib/components/Icons/WheelchairActive.js.map +1 -1
  487. package/lib/components/Icons/Window.js.map +1 -1
  488. package/lib/components/Icons/WordDocument.js.map +1 -1
  489. package/lib/components/Icons/WorkSuitcase.js.map +1 -1
  490. package/lib/components/Icons/X.js.map +1 -1
  491. package/lib/components/Icons/XOutline.js.map +1 -1
  492. package/lib/components/Icons/XmlFile.js.map +1 -1
  493. package/lib/components/Icons/YouTube.js.map +1 -1
  494. package/lib/components/Icons/Zoom.js.map +1 -1
  495. package/lib/components/Icons/ZoomInLeft.js.map +1 -1
  496. package/lib/components/Icons/ZoomOutLeft.js.map +1 -1
  497. package/lib/components/Illustration/index.js +1 -1
  498. package/lib/components/Illustrations/BabyMobile.js +1 -1
  499. package/lib/components/Illustrations/BabyMobile.js.map +1 -1
  500. package/lib/components/Illustrations/BabyMobileMedium.js +1 -1
  501. package/lib/components/Illustrations/BabyMobileMedium.js.map +1 -1
  502. package/lib/components/Illustrations/Child.js +1 -1
  503. package/lib/components/Illustrations/Child.js.map +1 -1
  504. package/lib/components/Illustrations/ChildMedium.js +1 -1
  505. package/lib/components/Illustrations/ChildMedium.js.map +1 -1
  506. package/lib/components/Illustrations/Doctor.js +1 -1
  507. package/lib/components/Illustrations/Doctor.js.map +1 -1
  508. package/lib/components/Illustrations/DoctorMedium.js.map +1 -1
  509. package/lib/components/Illustrations/DoctorSmall.js.map +1 -1
  510. package/lib/components/Illustrations/EyeContact.d.ts +8 -0
  511. package/lib/components/Illustrations/EyeContact.js +17 -0
  512. package/lib/components/Illustrations/EyeContact.js.map +1 -0
  513. package/lib/components/Illustrations/EyeContactMedium.d.ts +3 -0
  514. package/lib/components/Illustrations/EyeContactMedium.js +80 -0
  515. package/lib/components/Illustrations/EyeContactMedium.js.map +1 -0
  516. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
  517. package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
  518. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js +1 -1
  519. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
  520. package/lib/components/Illustrations/GiveBabyFood.js +1 -1
  521. package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
  522. package/lib/components/Illustrations/GiveBabyFoodMedium.js +1 -1
  523. package/lib/components/Illustrations/GiveBabyFoodMedium.js.map +1 -1
  524. package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
  525. package/lib/components/Illustrations/HealthcarePersonnel.js.map +1 -1
  526. package/lib/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
  527. package/lib/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
  528. package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
  529. package/lib/components/Illustrations/IllustrationNames.js +4 -0
  530. package/lib/components/Illustrations/IllustrationNames.js.map +1 -1
  531. package/lib/components/Illustrations/ReadLetters.js +1 -1
  532. package/lib/components/Illustrations/ReadLetters.js.map +1 -1
  533. package/lib/components/Illustrations/ReadLettersMedium.js +1 -1
  534. package/lib/components/Illustrations/ReadLettersMedium.js.map +1 -1
  535. package/lib/components/Illustrations/SkinToSkin.d.ts +8 -0
  536. package/lib/components/Illustrations/SkinToSkin.js +17 -0
  537. package/lib/components/Illustrations/SkinToSkin.js.map +1 -0
  538. package/lib/components/Illustrations/SkinToSkinMedium.d.ts +3 -0
  539. package/lib/components/Illustrations/SkinToSkinMedium.js +107 -0
  540. package/lib/components/Illustrations/SkinToSkinMedium.js.map +1 -0
  541. package/lib/components/Illustrations/Stork.js +1 -1
  542. package/lib/components/Illustrations/Stork.js.map +1 -1
  543. package/lib/components/Illustrations/StorkMedium.js +1 -1
  544. package/lib/components/Illustrations/StorkMedium.js.map +1 -1
  545. package/lib/components/Illustrations/Stroller.js +1 -1
  546. package/lib/components/Illustrations/Stroller.js.map +1 -1
  547. package/lib/components/Illustrations/StrollerMedium.js +1 -1
  548. package/lib/components/Illustrations/StrollerMedium.js.map +1 -1
  549. package/lib/components/Illustrations/Support2.js +1 -1
  550. package/lib/components/Illustrations/Support2.js.map +1 -1
  551. package/lib/components/Illustrations/Support2Medium.js +1 -1
  552. package/lib/components/Illustrations/Support2Medium.js.map +1 -1
  553. package/lib/components/Illustrations/Thinking.js +1 -1
  554. package/lib/components/Illustrations/Thinking.js.map +1 -1
  555. package/lib/components/Illustrations/ThinkingMedium.js +1 -1
  556. package/lib/components/Illustrations/ThinkingMedium.js.map +1 -1
  557. package/lib/components/Loader/index.js.map +1 -1
  558. package/lib/components/Logo/index.js.map +1 -1
  559. package/lib/components/Modal/index.js.map +1 -1
  560. package/lib/components/NotificationPanel/index.js.map +1 -1
  561. package/lib/components/Panel/index.js +1 -1
  562. package/lib/components/Panel/index.js.map +1 -1
  563. package/lib/components/PanelList/index.js +1 -1
  564. package/lib/components/PanelList/index.js.map +1 -1
  565. package/lib/components/PopMenu/index.js.map +1 -1
  566. package/lib/components/Portal/index.js.map +1 -1
  567. package/lib/components/Progressbar/index.js.map +1 -1
  568. package/lib/components/PromoPanel/index.js.map +1 -1
  569. package/lib/components/RadioButton/RadioMarker/RadioMarker.d.ts +20 -0
  570. package/lib/components/RadioButton/RadioMarker/styles.module.scss +288 -0
  571. package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +20 -0
  572. package/lib/components/RadioButton/index.d.ts +0 -1
  573. package/lib/components/RadioButton/index.js +2 -2
  574. package/lib/components/RadioButton/index.js.map +1 -1
  575. package/lib/components/RadioButton/styles.module.scss +13 -275
  576. package/lib/components/RadioButton/styles.module.scss.d.ts +2 -12
  577. package/lib/components/ServiceMessage/index.js.map +1 -1
  578. package/lib/components/SharingStatus/index.js.map +1 -1
  579. package/lib/components/Step/index.js.map +1 -1
  580. package/lib/components/Stepper/index.js +1 -5
  581. package/lib/components/Stepper/index.js.map +1 -1
  582. package/lib/components/StickyNote/index.js.map +1 -1
  583. package/lib/components/Table/index.js +3 -3
  584. package/lib/components/Table/index.js.map +1 -1
  585. package/lib/components/Tabs/index.js.map +1 -1
  586. package/lib/components/Tag/index.js.map +1 -1
  587. package/lib/components/TagList/index.js.map +1 -1
  588. package/lib/components/Tile/index.js.map +1 -1
  589. package/lib/components/ToastList/index.js.map +1 -1
  590. package/lib/components/Toggle/index.js.map +1 -1
  591. package/lib/components/Validation/index.js.map +1 -1
  592. package/lib/components/VisualCheckboxCloud/Checkbox/Checkbox.d.ts +21 -0
  593. package/lib/components/VisualCheckboxCloud/Checkbox/index.d.ts +3 -0
  594. package/lib/components/VisualCheckboxCloud/Checkbox/index.js +7 -0
  595. package/lib/components/VisualCheckboxCloud/Checkbox/index.js.map +1 -0
  596. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +10 -0
  597. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss.d.ts +15 -0
  598. package/lib/components/VisualCheckboxCloud/VisualCheckboxCloud.d.ts +29 -0
  599. package/lib/components/VisualCheckboxCloud/index.d.ts +3 -0
  600. package/lib/components/VisualCheckboxCloud/index.js +42 -0
  601. package/lib/components/VisualCheckboxCloud/index.js.map +1 -0
  602. package/lib/components/VisualCheckboxCloud/styles.module.scss +6 -0
  603. package/lib/components/VisualCheckboxCloud/styles.module.scss.d.ts +9 -0
  604. package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualCheckbox.d.ts +26 -0
  605. package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualContent.d.ts +10 -0
  606. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.d.ts +3 -0
  607. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js +7 -0
  608. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js.map +1 -0
  609. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +7 -0
  610. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss.d.ts +18 -0
  611. package/lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts +33 -0
  612. package/lib/components/VisualCheckboxGroup/index.d.ts +3 -0
  613. package/lib/components/VisualCheckboxGroup/index.js +47 -0
  614. package/lib/components/VisualCheckboxGroup/index.js.map +1 -0
  615. package/lib/components/VisualCheckboxGroup/styles.module.scss +6 -0
  616. package/lib/components/VisualCheckboxGroup/styles.module.scss.d.ts +10 -0
  617. package/lib/components/VisualRadioCloud/Radio/Radio.d.ts +23 -0
  618. package/lib/components/VisualRadioCloud/Radio/index.d.ts +3 -0
  619. package/lib/components/VisualRadioCloud/Radio/index.js +7 -0
  620. package/lib/components/VisualRadioCloud/Radio/index.js.map +1 -0
  621. package/lib/components/VisualRadioCloud/Radio/styles.module.scss +7 -0
  622. package/lib/components/VisualRadioCloud/Radio/styles.module.scss.d.ts +15 -0
  623. package/lib/components/VisualRadioCloud/VisualRadioCloud.d.ts +39 -0
  624. package/lib/components/VisualRadioCloud/index.d.ts +3 -0
  625. package/lib/components/VisualRadioCloud/index.js +62 -0
  626. package/lib/components/VisualRadioCloud/index.js.map +1 -0
  627. package/lib/components/VisualRadioCloud/styles.module.scss +6 -0
  628. package/lib/components/VisualRadioCloud/styles.module.scss.d.ts +9 -0
  629. package/lib/components/VisualRadioGroup/VisualRadio/VisualContent.d.ts +10 -0
  630. package/lib/components/VisualRadioGroup/VisualRadio/VisualRadio.d.ts +26 -0
  631. package/lib/components/VisualRadioGroup/VisualRadio/index.d.ts +3 -0
  632. package/lib/components/VisualRadioGroup/VisualRadio/index.js +7 -0
  633. package/lib/components/VisualRadioGroup/VisualRadio/index.js.map +1 -0
  634. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +7 -0
  635. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss.d.ts +18 -0
  636. package/lib/components/VisualRadioGroup/VisualRadioGroup.d.ts +39 -0
  637. package/lib/components/VisualRadioGroup/index.d.ts +3 -0
  638. package/lib/components/VisualRadioGroup/index.js +67 -0
  639. package/lib/components/VisualRadioGroup/index.js.map +1 -0
  640. package/lib/components/VisualRadioGroup/styles.module.scss +6 -0
  641. package/lib/components/VisualRadioGroup/styles.module.scss.d.ts +10 -0
  642. package/lib/constants.js.map +1 -1
  643. package/lib/constants2.js +6 -6
  644. package/lib/constants2.js.map +1 -1
  645. package/lib/floating-ui.react.js +30 -30
  646. package/lib/floating-ui.react.js.map +1 -1
  647. package/lib/getFilterChips.js.map +1 -1
  648. package/lib/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
  649. package/lib/hooks/useBreakpoint.js.map +1 -1
  650. package/lib/hooks/useElementList.js.map +1 -1
  651. package/lib/hooks/useEventListenerState.js.map +1 -1
  652. package/lib/hooks/useExpand.js.map +1 -1
  653. package/lib/hooks/useFocusToggle.js.map +1 -1
  654. package/lib/hooks/useFocusTrap.js.map +1 -1
  655. package/lib/hooks/useFocusableElements.js.map +1 -1
  656. package/lib/hooks/useIcons.js.map +1 -1
  657. package/lib/hooks/useIdWithFallback.js.map +1 -1
  658. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  659. package/lib/hooks/useInterval.js.map +1 -1
  660. package/lib/hooks/useIsMobileBreakpoint.js.map +1 -1
  661. package/lib/hooks/useIsServerSide.js.map +1 -1
  662. package/lib/hooks/useIsVisible.js.map +1 -1
  663. package/lib/hooks/useKeyboardEvent.js.map +1 -1
  664. package/lib/hooks/useLanguage.js.map +1 -1
  665. package/lib/hooks/useLayoutEvent.js.map +1 -1
  666. package/lib/hooks/useOutsideEvent.js.map +1 -1
  667. package/lib/hooks/usePrevious.js.map +1 -1
  668. package/lib/hooks/usePseudoClasses.js.map +1 -1
  669. package/lib/hooks/useResizeObserver.js.map +1 -1
  670. package/lib/hooks/useReturnFocusOnUnmount.js.map +1 -1
  671. package/lib/hooks/useRovingFocus.js.map +1 -1
  672. package/lib/hooks/useSize.js.map +1 -1
  673. package/lib/hooks/useToggle.js.map +1 -1
  674. package/lib/hooks/usestopPropagation.js.map +1 -1
  675. package/lib/resourceHelper.js +12 -8
  676. package/lib/resourceHelper.js.map +1 -1
  677. package/lib/resources/HN.Designsystem.Filter.en-GB.json.d.ts +6 -4
  678. package/lib/resources/HN.Designsystem.Filter.nb-NO.json.d.ts +6 -4
  679. package/lib/resources/Resources.d.ts +11 -3
  680. package/lib/scss/_visual-form.scss +357 -0
  681. package/lib/theme/currys/color.js.map +1 -1
  682. package/lib/theme/currys/spacing.js.map +1 -1
  683. package/lib/theme/grid.js.map +1 -1
  684. package/lib/theme/index.js.map +1 -1
  685. package/lib/theme/palette.js.map +1 -1
  686. package/lib/theme/spacers.js.map +1 -1
  687. package/lib/utils/accessibility.js.map +1 -1
  688. package/lib/utils/component.js.map +1 -1
  689. package/lib/utils/debounce.js.map +1 -1
  690. package/lib/utils/deepContains.js.map +1 -1
  691. package/lib/utils/device.js.map +1 -1
  692. package/lib/utils/focus.js.map +1 -1
  693. package/lib/utils/language.js.map +1 -1
  694. package/lib/utils/mobile.js.map +1 -1
  695. package/lib/utils/refs.js.map +1 -1
  696. package/lib/utils/resource.js.map +1 -1
  697. package/lib/utils/scroll.js.map +1 -1
  698. package/lib/utils/viewport.js.map +1 -1
  699. package/lib/utils.js.map +1 -1
  700. package/lib/utils2.js.map +1 -1
  701. package/lib/utils3.js +11 -100
  702. package/lib/utils3.js.map +1 -1
  703. package/lib/utils4.js +31 -12
  704. package/lib/utils4.js.map +1 -1
  705. package/lib/utils5.js +112 -31
  706. package/lib/utils5.js.map +1 -1
  707. package/lib/uuid.js.map +1 -1
  708. package/package.json +115 -1
  709. package/scss/_visual-form.scss +357 -0
  710. package/lib/components/RadioButton/utils.d.ts +0 -2
  711. package/lib/utils6.js +0 -115
  712. package/lib/utils6.js.map +0 -1
package/lib/Drawer.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","names":[],"sources":["../src/resources/HN.Designsystem.Drawer.en-GB.json","../src/resources/HN.Designsystem.Drawer.nb-NO.json","../src/resources/HN.Designsystem.Drawer.nn-NO.json","../src/components/Drawer/resourceHelper.ts","../src/components/Drawer/Drawer.tsx","../src/components/Drawer/index.ts"],"sourcesContent":["{\n \"ariaLabelCloseBtn\": \"Close\",\n \"ariaLabelBackButton\": \"Go back\"\n}\n","{\n \"ariaLabelBackButton\": \"Gå tilbake\",\n \"ariaLabelCloseBtn\": \"Lukk\"\n}\n","{\n \"ariaLabelCloseBtn\": \"Lukk\",\n \"ariaLabelBackButton\": \"Gå tilbake\"\n}\n","import type { HNDesignsystemDrawer } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Drawer.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Drawer.nb-NO.json';\nimport nnNO from '../../resources/HN.Designsystem.Drawer.nn-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemDrawer => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nnNO;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React, { useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\nimport { AnimatePresence, useAnimate, usePresence } from 'motion/react';\n\nimport type { HNDesignsystemDrawer } from '../../resources/Resources';\nimport type { TitleTags } from '../Title';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, KeyboardEventKey, LanguageLocales, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useKeyboardEvent } from '../../hooks/useKeyboardEvent';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { disableBodyScroll, enableBodyScroll } from '../../utils/scroll';\nimport uuid from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon from '../Icon';\nimport ChevronLeft from '../Icons/ChevronLeft';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\ntype DesktopDirections = 'left' | 'right';\n\nexport interface DrawerProps extends InnerDrawerProps {\n /** Opens and closes the drawer */\n isOpen: boolean;\n}\n\nexport interface InnerDrawerProps {\n /** Sets the aria-label of the drawer */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the drawer */\n ariaLabelledBy?: string;\n /** Sets the style of the Drawer Close button. Meant for use by HelpDrawer */\n closeColor?: 'blueberry' | 'plum';\n /** Direction of the drawer on desktop. Default: left */\n desktopDirection?: DesktopDirections;\n /** Sets the style of the Drawer header */\n headerClasses?: string;\n /** Title to display in the header of the drawer */\n title: string;\n /** id of the drawer title */\n titleId?: string;\n /** Changes the underlying element of the title. Default: h3 */\n titleHtmlMarkup?: TitleTags;\n /** Callback that triggers when clicking on close button or outside the drawer, update isOpen state when this triggers */\n onRequestClose?: () => void;\n /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\n /** Main content of the drawer */\n children?: React.ReactNode;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Primary CTA callback */\n onPrimaryAction?: () => void;\n /** Text for primary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n primaryActionText?: string;\n /** Text for secondary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n secondaryActionText?: string;\n /** Secondary CTA callback */\n onSecondaryAction?: () => void;\n /** Customize the z-index of the drawer */\n zIndex?: number;\n /** Resources for component */\n resources?: Partial<HNDesignsystemDrawer>;\n /** Sets mobile styling and animation from outer level Drawer */\n isMobile?: boolean;\n /** Shows a back button to the left of title */\n withBackButton?: boolean;\n /** Callback for the back button */\n onRequestBack?: () => void;\n /** Sets classname for content part in Drawer */\n contentClassName?: string;\n}\n\nconst Drawer: React.FC<DrawerProps> = props => {\n const { isOpen, ...rest } = props;\n const isMobile = useIsMobileBreakpoint();\n\n return <AnimatePresence>{isOpen && <InnerDrawer {...rest} isMobile={isMobile} />}</AnimatePresence>;\n};\n\nconst InnerDrawer: React.FC<InnerDrawerProps> = props => {\n const {\n ariaLabel,\n ariaLabelledBy,\n children,\n closeColor = 'blueberry',\n desktopDirection = 'left',\n footerContent,\n headerClasses,\n noCloseButton = false,\n onPrimaryAction,\n onRequestClose,\n onSecondaryAction,\n primaryActionText,\n secondaryActionText,\n title,\n titleHtmlMarkup = 'h3',\n titleId = uuid(),\n zIndex = ZIndex.OverlayScreen,\n resources,\n isMobile,\n withBackButton,\n onRequestBack,\n contentClassName,\n } = props;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledBy, fallbackId: titleId });\n const overlayRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n // topContent and bottomContent are used to detect scroll position for shadow effects\n const topContent = useRef<HTMLDivElement>(null);\n const bottomContent = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const footerRef = useRef<HTMLDivElement>(null);\n const titleRef = useRef<HTMLHeadingElement>(null);\n const [scope, animate] = useAnimate();\n const [isPresent, safeToRemove] = usePresence();\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const topContentVisible = useIsVisible(topContent);\n const bottomContentVisible = useIsVisible(bottomContent, 0);\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemDrawer = {\n ...defaultResources,\n ...resources,\n };\n\n // eslint-disable-next-line react-hooks/refs\n const contentIsScrollable = contentRef.current && contentRef.current.scrollHeight > contentRef.current.clientHeight;\n const headerStyling = classNames(styles.drawer__header, headerClasses);\n const hasFooterContent = (typeof footerContent !== 'undefined' && footerContent) || onPrimaryAction || onSecondaryAction;\n\n useFocusTrap(containerRef, true);\n useReturnFocusOnUnmount(containerRef);\n useOutsideEvent(containerRef, () => {\n if (onRequestClose) onRequestClose();\n });\n useKeyboardEvent(containerRef, () => onRequestClose && onRequestClose(), [KeyboardEventKey.Escape]);\n\n // Close animasjon, vi kaller `onClose()` til slutt\n const closeDrawer = (): void => {\n if (!overlayRef.current || !containerRef.current) return;\n\n animate(overlayRef.current, { opacity: 0, pointerEvents: 'none' }, { duration: 0.3, ease: 'easeInOut' });\n\n if (isMobile) {\n animate(\n containerRef.current,\n { y: '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n if (safeToRemove) safeToRemove();\n },\n }\n );\n } else {\n animate(\n containerRef.current,\n { x: desktopDirection === 'left' ? '-100%' : '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n if (safeToRemove) safeToRemove();\n },\n }\n );\n }\n };\n\n useEffect(() => {\n containerRef.current?.focus();\n disableBodyScroll();\n\n return (): void => {\n enableBodyScroll();\n };\n }, []);\n\n // Measure header and footer heights\n useEffect(() => {\n const updateHeights = (): void => {\n if (headerRef.current) {\n setHeaderHeight(headerRef.current.offsetHeight);\n }\n if (footerRef.current) {\n setFooterHeight(footerRef.current.offsetHeight);\n }\n };\n\n updateHeights();\n\n // Update heights when content changes\n const resizeObserver = new ResizeObserver(updateHeights);\n if (headerRef.current) {\n resizeObserver.observe(headerRef.current);\n }\n if (footerRef.current) {\n resizeObserver.observe(footerRef.current);\n }\n\n return (): void => {\n resizeObserver.disconnect();\n };\n }, [hasFooterContent]);\n\n // Open animation.\n useEffect(() => {\n if (!overlayRef.current || !containerRef.current) return;\n\n if (!isPresent) {\n closeDrawer();\n return;\n }\n\n if (isMobile) {\n animate(containerRef.current, { y: '0' }, { duration: 0.3, ease: 'easeInOut' });\n } else {\n animate(containerRef.current, { x: '0' }, { duration: 0.3, ease: 'easeInOut' });\n }\n\n animate(overlayRef.current, { opacity: 1, pointerEvents: 'auto' }, { duration: 0.3, ease: 'easeInOut' });\n }, [isPresent]);\n\n const handleCTA = (callback?: () => void): void => {\n if (callback) {\n callback();\n }\n };\n\n useEffect(() => {\n titleRef.current?.focus();\n }, [title]);\n\n return (\n <div className={styles.drawer} ref={scope} style={{ zIndex }} data-analyticsid={AnalyticsId.Drawer}>\n <div className={styles.drawer__overlay} ref={overlayRef} aria-hidden=\"true\" />\n <div\n className={classNames(styles.drawer__container, {\n [styles['drawer__container--right']]: desktopDirection === 'right',\n })}\n ref={containerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n {...ariaLabelAttributes}\n >\n <div className={styles.drawer__container__inner}>\n <div className={headerStyling} ref={headerRef}>\n <Title\n id={ariaLabelAttributes?.['aria-labelledby']}\n className={styles['drawer__header__title']}\n htmlMarkup={titleHtmlMarkup}\n appearance=\"title3\"\n ref={titleRef}\n tabIndex={-1}\n >\n {title}\n </Title>\n {withBackButton && onRequestBack !== undefined && (\n <Button\n ariaLabel={mergedResources.ariaLabelBackButton}\n onClick={onRequestBack}\n variant=\"borderless\"\n wrapperClassName={styles['drawer__header__back-button']}\n >\n <Icon svgIcon={ChevronLeft} />\n </Button>\n )}\n {!noCloseButton && onRequestClose != undefined && (\n <Close\n ariaLabel={mergedResources.ariaLabelCloseBtn}\n color={closeColor}\n onClick={onRequestClose}\n className={styles['drawer__header__close-button']}\n />\n )}\n </div>\n <div\n className={classNames(styles['drawer__content__shadow'], styles['drawer__content__shadow--top'])}\n style={{\n opacity: !topContentVisible && contentIsScrollable ? 1 : 0,\n top: headerHeight,\n }}\n />\n <div\n className={classNames(styles.drawer__content, contentClassName)}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\n ref={contentRef}\n >\n <div ref={topContent} />\n <div className={styles['drawer__content__children']}>{children}</div>\n <div ref={bottomContent} style={{ height: '1px' }} />\n </div>\n <div\n className={classNames(styles['drawer__content__shadow'], styles['drawer__content__shadow--bottom'])}\n style={{\n opacity: !bottomContentVisible && contentIsScrollable ? 1 : 0,\n bottom: hasFooterContent ? footerHeight : 0,\n }}\n />\n </div>\n {hasFooterContent && (\n <div className={styles.drawer__footer} ref={footerRef}>\n {footerContent ? (\n footerContent\n ) : (\n <>\n {onPrimaryAction && <Button onClick={() => handleCTA(onPrimaryAction)}>{primaryActionText}</Button>}\n {onSecondaryAction && (\n <Button variant=\"borderless\" onClick={() => handleCTA(onSecondaryAction)}>\n {secondaryActionText}\n </Button>\n )}\n </>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Drawer;\n","import Drawer from './Drawer';\nexport * from './Drawer';\nexport default Drawer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGOA,IAAa,gBAAgB,aAAoD;CAC/E,QAAQ,UAAR;EACE,KAAK,gBAAgB,SACnB,OAAO;EACT,KAAK,gBAAgB,mBACnB,OAAO;EACT,KAAK,gBAAgB;EACrB,SACE,OAAO;;;;;ACmEb,IAAM,UAAgC,UAAS;CAC7C,MAAM,EAAE,QAAQ,GAAG,SAAS;CAC5B,MAAM,WAAW,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O,gCAAgC;MAChG,OAAO;OACL,SAAS,CAAC,qBAAqB,sBAAsB,IAAI;OACzD,KAAK;OACN;MACD,CAAA;KACF,qBAAC,OAAD;MACE,WAAW,WAAW,OAAO,iBAAiB,iBAAiB;MAC/D,UAAU,sBAAsB,IAAI,KAAA;MACpC,MAAM,sBAAsB,WAAW,KAAA;MACvC,GAAK,sBAAsB,sBAAsB,EAAE;MACnD,KAAK;gBALP;OAOE,oBAAC,OAAD,EAAK,KAAK,YAAc,CAAA;OACxB,oBAAC,OAAD;QAAK,WAAW,OAAO;QAA+B;QAAe,CAAA;OACrE,oBAAC,OAAD;QAAK,KAAK;QAAe,OAAO,EAAE,QAAQ,OAAO;QAAI,CAAA;OACjD;;KACN,oBAAC,OAAD;MACE,WAAW,WAAW,OAAO,4BAA4B,OAAO,mCAAmC;MACnG,OAAO;OACL,SAAS,CAAC,wBAAwB,sBAAsB,IAAI;OAC5D,QAAQ,mBAAmB,eAAe;OAC3C;MACD,CAAA;KACE;OACL,oBACC,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAgB,KAAK;cACzC,gBACC,gBAEA,qBAAA,UAAA,EAAA,UAAA,CACG,mBAAmB,oBAAC,gBAAD;KAAQ,eAAe,UAAU,gBAAgB;eAAG;KAA2B,CAAA,EAClG,qBACC,oBAAC,gBAAD;KAAQ,SAAQ;KAAa,eAAe,UAAU,kBAAkB;eACrE;KACM,CAAA,CAEV,EAAA,CAAA;IAED,CAAA,CAEJ;KACF;;;;;AC7UV,IAAA,iBAAe"}
1
+ {"version":3,"file":"Drawer.js","names":[],"sources":["../src/resources/HN.Designsystem.Drawer.en-GB.json","../src/resources/HN.Designsystem.Drawer.nb-NO.json","../src/resources/HN.Designsystem.Drawer.nn-NO.json","../src/components/Drawer/resourceHelper.ts","../src/components/Drawer/Drawer.tsx","../src/components/Drawer/index.ts"],"sourcesContent":["{\n \"ariaLabelCloseBtn\": \"Close\",\n \"ariaLabelBackButton\": \"Go back\"\n}\n","{\n \"ariaLabelBackButton\": \"Gå tilbake\",\n \"ariaLabelCloseBtn\": \"Lukk\"\n}\n","{\n \"ariaLabelCloseBtn\": \"Lukk\",\n \"ariaLabelBackButton\": \"Gå tilbake\"\n}\n","import type { HNDesignsystemDrawer } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Drawer.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Drawer.nb-NO.json';\nimport nnNO from '../../resources/HN.Designsystem.Drawer.nn-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemDrawer => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nnNO;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React, { useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\nimport { AnimatePresence, useAnimate, usePresence } from 'motion/react';\n\nimport type { HNDesignsystemDrawer } from '../../resources/Resources';\nimport type { TitleTags } from '../Title';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, KeyboardEventKey, LanguageLocales, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useKeyboardEvent } from '../../hooks/useKeyboardEvent';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { disableBodyScroll, enableBodyScroll } from '../../utils/scroll';\nimport uuid from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon from '../Icon';\nimport ChevronLeft from '../Icons/ChevronLeft';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\ntype DesktopDirections = 'left' | 'right';\n\nexport interface DrawerProps extends InnerDrawerProps {\n /** Opens and closes the drawer */\n isOpen: boolean;\n}\n\nexport interface InnerDrawerProps {\n /** Sets the aria-label of the drawer */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the drawer */\n ariaLabelledBy?: string;\n /** Sets the style of the Drawer Close button. Meant for use by HelpDrawer */\n closeColor?: 'blueberry' | 'plum';\n /** Direction of the drawer on desktop. Default: left */\n desktopDirection?: DesktopDirections;\n /** Sets the style of the Drawer header */\n headerClasses?: string;\n /** Title to display in the header of the drawer */\n title: string;\n /** id of the drawer title */\n titleId?: string;\n /** Changes the underlying element of the title. Default: h3 */\n titleHtmlMarkup?: TitleTags;\n /** Callback that triggers when clicking on close button or outside the drawer, update isOpen state when this triggers */\n onRequestClose?: () => void;\n /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\n /** Main content of the drawer */\n children?: React.ReactNode;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Primary CTA callback */\n onPrimaryAction?: () => void;\n /** Text for primary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n primaryActionText?: string;\n /** Text for secondary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n secondaryActionText?: string;\n /** Secondary CTA callback */\n onSecondaryAction?: () => void;\n /** Customize the z-index of the drawer */\n zIndex?: number;\n /** Resources for component */\n resources?: Partial<HNDesignsystemDrawer>;\n /** Sets mobile styling and animation from outer level Drawer */\n isMobile?: boolean;\n /** Shows a back button to the left of title */\n withBackButton?: boolean;\n /** Callback for the back button */\n onRequestBack?: () => void;\n /** Sets classname for content part in Drawer */\n contentClassName?: string;\n}\n\nconst Drawer: React.FC<DrawerProps> = props => {\n const { isOpen, ...rest } = props;\n const isMobile = useIsMobileBreakpoint();\n\n return <AnimatePresence>{isOpen && <InnerDrawer {...rest} isMobile={isMobile} />}</AnimatePresence>;\n};\n\nconst InnerDrawer: React.FC<InnerDrawerProps> = props => {\n const {\n ariaLabel,\n ariaLabelledBy,\n children,\n closeColor = 'blueberry',\n desktopDirection = 'left',\n footerContent,\n headerClasses,\n noCloseButton = false,\n onPrimaryAction,\n onRequestClose,\n onSecondaryAction,\n primaryActionText,\n secondaryActionText,\n title,\n titleHtmlMarkup = 'h3',\n titleId = uuid(),\n zIndex = ZIndex.OverlayScreen,\n resources,\n isMobile,\n withBackButton,\n onRequestBack,\n contentClassName,\n } = props;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledBy, fallbackId: titleId });\n const overlayRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n // topContent and bottomContent are used to detect scroll position for shadow effects\n const topContent = useRef<HTMLDivElement>(null);\n const bottomContent = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const footerRef = useRef<HTMLDivElement>(null);\n const titleRef = useRef<HTMLHeadingElement>(null);\n const [scope, animate] = useAnimate();\n const [isPresent, safeToRemove] = usePresence();\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const topContentVisible = useIsVisible(topContent);\n const bottomContentVisible = useIsVisible(bottomContent, 0);\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemDrawer = {\n ...defaultResources,\n ...resources,\n };\n\n // eslint-disable-next-line react-hooks/refs\n const contentIsScrollable = contentRef.current && contentRef.current.scrollHeight > contentRef.current.clientHeight;\n const headerStyling = classNames(styles.drawer__header, headerClasses);\n const hasFooterContent = (typeof footerContent !== 'undefined' && footerContent) || onPrimaryAction || onSecondaryAction;\n\n useFocusTrap(containerRef, true);\n useReturnFocusOnUnmount(containerRef);\n useOutsideEvent(containerRef, () => {\n if (onRequestClose) onRequestClose();\n });\n useKeyboardEvent(containerRef, () => onRequestClose && onRequestClose(), [KeyboardEventKey.Escape]);\n\n // Close animasjon, vi kaller `onClose()` til slutt\n const closeDrawer = (): void => {\n if (!overlayRef.current || !containerRef.current) return;\n\n animate(overlayRef.current, { opacity: 0, pointerEvents: 'none' }, { duration: 0.3, ease: 'easeInOut' });\n\n if (isMobile) {\n animate(\n containerRef.current,\n { y: '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n if (safeToRemove) safeToRemove();\n },\n }\n );\n } else {\n animate(\n containerRef.current,\n { x: desktopDirection === 'left' ? '-100%' : '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n if (safeToRemove) safeToRemove();\n },\n }\n );\n }\n };\n\n useEffect(() => {\n containerRef.current?.focus();\n disableBodyScroll();\n\n return (): void => {\n enableBodyScroll();\n };\n }, []);\n\n // Measure header and footer heights\n useEffect(() => {\n const updateHeights = (): void => {\n if (headerRef.current) {\n setHeaderHeight(headerRef.current.offsetHeight);\n }\n if (footerRef.current) {\n setFooterHeight(footerRef.current.offsetHeight);\n }\n };\n\n updateHeights();\n\n // Update heights when content changes\n const resizeObserver = new ResizeObserver(updateHeights);\n if (headerRef.current) {\n resizeObserver.observe(headerRef.current);\n }\n if (footerRef.current) {\n resizeObserver.observe(footerRef.current);\n }\n\n return (): void => {\n resizeObserver.disconnect();\n };\n }, [hasFooterContent]);\n\n // Open animation.\n useEffect(() => {\n if (!overlayRef.current || !containerRef.current) return;\n\n if (!isPresent) {\n closeDrawer();\n return;\n }\n\n if (isMobile) {\n animate(containerRef.current, { y: '0' }, { duration: 0.3, ease: 'easeInOut' });\n } else {\n animate(containerRef.current, { x: '0' }, { duration: 0.3, ease: 'easeInOut' });\n }\n\n animate(overlayRef.current, { opacity: 1, pointerEvents: 'auto' }, { duration: 0.3, ease: 'easeInOut' });\n }, [isPresent]);\n\n const handleCTA = (callback?: () => void): void => {\n if (callback) {\n callback();\n }\n };\n\n useEffect(() => {\n titleRef.current?.focus();\n }, [title]);\n\n return (\n <div className={styles.drawer} ref={scope} style={{ zIndex }} data-analyticsid={AnalyticsId.Drawer}>\n <div className={styles.drawer__overlay} ref={overlayRef} aria-hidden=\"true\" />\n <div\n className={classNames(styles.drawer__container, {\n [styles['drawer__container--right']]: desktopDirection === 'right',\n })}\n ref={containerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n {...ariaLabelAttributes}\n >\n <div className={styles.drawer__container__inner}>\n <div className={headerStyling} ref={headerRef}>\n <Title\n id={ariaLabelAttributes?.['aria-labelledby']}\n className={styles['drawer__header__title']}\n htmlMarkup={titleHtmlMarkup}\n appearance=\"title3\"\n ref={titleRef}\n tabIndex={-1}\n >\n {title}\n </Title>\n {withBackButton && onRequestBack !== undefined && (\n <Button\n ariaLabel={mergedResources.ariaLabelBackButton}\n onClick={onRequestBack}\n variant=\"borderless\"\n wrapperClassName={styles['drawer__header__back-button']}\n >\n <Icon svgIcon={ChevronLeft} />\n </Button>\n )}\n {!noCloseButton && onRequestClose != undefined && (\n <Close\n ariaLabel={mergedResources.ariaLabelCloseBtn}\n color={closeColor}\n onClick={onRequestClose}\n className={styles['drawer__header__close-button']}\n />\n )}\n </div>\n <div\n className={classNames(styles['drawer__content__shadow'], styles['drawer__content__shadow--top'])}\n style={{\n opacity: !topContentVisible && contentIsScrollable ? 1 : 0,\n top: headerHeight,\n }}\n />\n <div\n className={classNames(styles.drawer__content, contentClassName)}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\n ref={contentRef}\n >\n <div ref={topContent} />\n <div className={styles['drawer__content__children']}>{children}</div>\n <div ref={bottomContent} style={{ height: '1px' }} />\n </div>\n <div\n className={classNames(styles['drawer__content__shadow'], styles['drawer__content__shadow--bottom'])}\n style={{\n opacity: !bottomContentVisible && contentIsScrollable ? 1 : 0,\n bottom: hasFooterContent ? footerHeight : 0,\n }}\n />\n </div>\n {hasFooterContent && (\n <div className={styles.drawer__footer} ref={footerRef}>\n {footerContent ? (\n footerContent\n ) : (\n <>\n {onPrimaryAction && <Button onClick={() => handleCTA(onPrimaryAction)}>{primaryActionText}</Button>}\n {onSecondaryAction && (\n <Button variant=\"borderless\" onClick={() => handleCTA(onSecondaryAction)}>\n {secondaryActionText}\n </Button>\n )}\n </>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Drawer;\n","import Drawer from './Drawer';\nexport * from './Drawer';\nexport default Drawer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGOA,IAAa,gBAAgB,aAAoD;CAC/E,QAAQ,UAAR;EACE,KAAK,gBAAgB,SACnB,OAAO;EACT,KAAK,gBAAgB,mBACnB,OAAO;EACT,KAAK,gBAAgB;EACrB,SACE,OAAO;CACX;AACF;;;ACiEA,IAAM,UAAgC,UAAS;CAC7C,MAAM,EAAE,QAAQ,GAAG,SAAS;CAC5B,MAAM,WAAW,sBAAsB;CAEvC,OAAO,oBAAC,iBAAD,EAAA,UAAkB,UAAU,oBAAC,aAAD;EAAa,GAAI;EAAgB;CAAW,CAAA,EAAmB,CAAA;AACpG;AAEA,IAAM,eAA0C,UAAS;CACvD,MAAM,EACJ,WACA,gBACA,UACA,aAAa,aACb,mBAAmB,QACnB,eACA,eACA,gBAAgB,OAChB,iBACA,gBACA,mBACA,mBACA,qBACA,OACA,kBAAkB,MAClB,UAAU,KAAK,GACf,SAAS,OAAO,eAChB,WACA,UACA,gBACA,eACA,qBACE;CAEJ,MAAM,sBAAsB,uBAAuB;EAAE,OAAO;EAAW,IAAI;EAAgB,YAAY;CAAQ,CAAC;CAChH,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,eAAe,OAAuB,IAAI;CAChD,MAAM,aAAa,OAAuB,IAAI;CAE9C,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,gBAAgB,OAAuB,IAAI;CACjD,MAAM,YAAY,OAAuB,IAAI;CAC7C,MAAM,YAAY,OAAuB,IAAI;CAC7C,MAAM,WAAW,OAA2B,IAAI;CAChD,MAAM,CAAC,O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AD;IAAK,WAAW,OAAO;IAAgB,KAAK;cACzC,gBACC,gBAEA,qBAAA,UAAA,EAAA,UAAA,CACG,mBAAmB,oBAAC,gBAAD;KAAQ,eAAe,UAAU,eAAe;eAAI;IAA0B,CAAA,GACjG,qBACC,oBAAC,gBAAD;KAAQ,SAAQ;KAAa,eAAe,UAAU,iBAAiB;eACpE;IACK,CAAA,CAEV,EAAA,CAAA;GAED,CAAA,CAEJ;IACF;;AAET;;;AC/UA,IAAA,iBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerNavigation.js","names":[],"sources":["../src/components/Filter/DrawerNavigation/useDrawerNavigation.ts","../src/components/Filter/DrawerNavigation/DrawerNavigation.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface NavigateProps<ViewId extends string = string> {\n goToView: (id: ViewId) => void;\n goBack: () => void;\n goToViewAndClearStack: (id: ViewId) => void;\n}\n\nexport const DrawerNavigationContext = createContext<NavigateProps | null>(null);\n\nexport function useDrawerNavigation<ViewId extends string = string>(): NavigateProps<ViewId> {\n const context = useContext(DrawerNavigationContext);\n if (!context) {\n throw new Error('useDrawerNavigation must be used inside a <DrawerNavigation> component');\n }\n return context as NavigateProps<ViewId>;\n}\n","import type React from 'react';\nimport { Children, isValidElement, useCallback, useMemo, useState } from 'react';\n\nimport { type NavigateProps, DrawerNavigationContext } from './useDrawerNavigation';\nimport Drawer from '../../Drawer';\n\nexport interface DrawerViewProps<ViewId extends string = string> {\n /** Id for the view. Important for navigation */\n id: ViewId;\n /** Title used for Drawer in current view */\n title: string;\n /** Mark this view as the home/default view */\n home?: boolean;\n /** Content inside the drawer for this view */\n children: React.ReactNode;\n /** Default onClose callback for drawer. Will override onCloseButton on parent */\n onCloseButton?: () => void;\n /** Content sent to footer section of Drawer. Will override footer on parent */\n footer?: React.ReactNode;\n /** Classname set on the content inside Drawer */\n drawerContentClassname?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction DrawerView<ViewId extends string>(_props: DrawerViewProps<ViewId>): React.ReactNode {\n // DrawerView is never rendered directly — DrawerNavigation reads its props\n return null;\n}\n\nexport interface DrawerNavigationProps {\n /** Views and other children components inside the Drawer navigation. Views are put in stack */\n children: React.ReactNode;\n /** Is drawer open or closed */\n isOpen: boolean;\n /** Navigate to this view when the drawer opens. Defaults to home view. */\n initialView?: string;\n /** Default onClose callback for drawer. View onCloseButton callback will override this. */\n onCloseButton?: () => void;\n /** Content sent to footer section of Drawer. View footer will override this */\n footer?: React.ReactNode;\n}\n\nfunction parseChildren(children: React.ReactNode): { views: DrawerViewProps[]; other: React.ReactNode[] } {\n const views: DrawerViewProps[] = [];\n const other: React.ReactNode[] = [];\n Children.forEach(children, child => {\n if (isValidElement<DrawerViewProps>(child) && child.type === DrawerView) {\n views.push({\n id: child.props.id,\n title: child.props.title,\n home: child.props.home,\n children: child.props.children,\n onCloseButton: child.props.onCloseButton,\n footer: child.props.footer,\n drawerContentClassname: child.props.drawerContentClassname,\n });\n } else {\n /** Added possibility of other children to support Modals that need navigation context */\n other.push(child);\n }\n });\n return { views, other };\n}\n\nfunction DrawerNavigation({ children, isOpen, initialView, onCloseButton, footer }: DrawerNavigationProps): React.ReactNode {\n const { views, other } = useMemo(() => parseChildren(children), [children]);\n\n const homeView = views.find(v => v.home) ?? views[0];\n const [viewStack, setViewStack] = useState<string[]>([homeView?.id]);\n\n const goToView = useCallback(\n (id: string): void => {\n if (views.some(v => v.id === id)) {\n setViewStack(stack => [...stack, id]);\n }\n },\n [views]\n );\n\n const goBack = useCallback((): void => {\n setViewStack(stack => (stack.length > 1 ? stack.slice(0, -1) : stack));\n }, []);\n\n const goToViewAndClearStack = useCallback(\n (id: string): void => {\n if (views.some(v => v.id === id)) {\n setViewStack(id === homeView?.id ? [homeView.id] : [homeView?.id, id]);\n }\n },\n [views, homeView]\n );\n\n const currentViewId = viewStack[viewStack.length - 1];\n const currentView = views.find(v => v.id === currentViewId);\n\n const navigate = useMemo<NavigateProps>(() => ({ goBack, goToView, goToViewAndClearStack }), [goBack, goToView, goToViewAndClearStack]);\n\n const [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n if (prevIsOpen !== isOpen) {\n setPrevIsOpen(isOpen);\n if (!isOpen) {\n setViewStack([homeView?.id]);\n } else if (initialView && views.some(v => v.id === initialView)) {\n setViewStack(initialView === homeView?.id ? [homeView.id] : [homeView?.id, initialView]);\n }\n }\n\n return (\n <DrawerNavigationContext.Provider value={navigate}>\n <Drawer\n isOpen={isOpen}\n title={currentView?.title ?? 'Filter'}\n withBackButton={viewStack.length > 1}\n onRequestBack={goBack}\n onRequestClose={currentView?.onCloseButton ?? onCloseButton}\n footerContent={currentView?.footer ?? footer}\n contentClassName={currentView?.drawerContentClassname}\n >\n {currentView?.children}\n </Drawer>\n {other}\n </DrawerNavigationContext.Provider>\n );\n}\n\nDrawerNavigation.View = DrawerView;\n\nexport default DrawerNavigation;\n"],"mappings":";;;;AAQA,IAAa,0BAA0B,cAAoC,KAAK;AAEhF,SAAgB,sBAA6E;CAC3F,MAAM,UAAU,WAAW,wBAAwB;CACnD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,yEAAyE;CAE3F,OAAO;;;;ACST,SAAS,WAAkC,QAAkD;CAE3F,OAAO;;AAgBT,SAAS,cAAc,UAAmF;CACxG,MAAM,QAA2B,EAAE;CACnC,MAAM,QAA2B,EAAE;CACnC,SAAS,QAAQ,WAAU,UAAS;EAClC,IAAI,eAAgC,MAAM,IAAI,MAAM,SAAS,YAC3D,MAAM,KAAK;GACT,IAAI,MAAM,MAAM;GAChB,OAAO,MAAM,MAAM;GACnB,MAAM,MAAM,MAAM;GAClB,UAAU,MAAM,MAAM;GACtB,eAAe,MAAM,MAAM;GAC3B,QAAQ,MAAM,MAAM;GACpB,wBAAwB,MAAM,MAAM;GACrC,CAAC;;;EAGF,MAAM,KAAK,MAAM;GAEnB;CACF,OAAO;EAAE;EAAO;EAAO;;AAGzB,SAAS,iBAAiB,EAAE,UAAU,Q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D;GACU;GACR,OAAO,aAAa,SAAS;GAC7B,gBAAgB,UAAU,SAAS;GACnC,eAAe;GACf,gBAAgB,aAAa,iBAAiB;GAC9C,eAAe,aAAa,UAAU;GACtC,kBAAkB,aAAa;aAE9B,aAAa;GACP,CAAA,EACR,MACgC;;;AAIvC,iBAAiB,OAAO"}
1
+ {"version":3,"file":"DrawerNavigation.js","names":[],"sources":["../src/components/Filter/DrawerNavigation/useDrawerNavigation.ts","../src/components/Filter/DrawerNavigation/DrawerNavigation.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface NavigateProps<ViewId extends string = string> {\n goToView: (id: ViewId) => void;\n goBack: () => void;\n goToViewAndClearStack: (id: ViewId) => void;\n}\n\nexport const DrawerNavigationContext = createContext<NavigateProps | null>(null);\n\nexport function useDrawerNavigation<ViewId extends string = string>(): NavigateProps<ViewId> {\n const context = useContext(DrawerNavigationContext);\n if (!context) {\n throw new Error('useDrawerNavigation must be used inside a <DrawerNavigation> component');\n }\n return context as NavigateProps<ViewId>;\n}\n","import type React from 'react';\nimport { Children, isValidElement, useCallback, useMemo, useState } from 'react';\n\nimport { type NavigateProps, DrawerNavigationContext } from './useDrawerNavigation';\nimport Drawer from '../../Drawer';\n\nexport interface DrawerViewProps<ViewId extends string = string> {\n /** Id for the view. Important for navigation */\n id: ViewId;\n /** Title used for Drawer in current view */\n title: string;\n /** Mark this view as the home/default view */\n home?: boolean;\n /** Content inside the drawer for this view */\n children: React.ReactNode;\n /** Default onClose callback for drawer. Will override onCloseButton on parent */\n onCloseButton?: () => void;\n /** Content sent to footer section of Drawer. Will override footer on parent */\n footer?: React.ReactNode;\n /** Classname set on the content inside Drawer */\n drawerContentClassname?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction DrawerView<ViewId extends string>(_props: DrawerViewProps<ViewId>): React.ReactNode {\n // DrawerView is never rendered directly — DrawerNavigation reads its props\n return null;\n}\n\nexport interface DrawerNavigationProps {\n /** Views and other children components inside the Drawer navigation. Views are put in stack */\n children: React.ReactNode;\n /** Is drawer open or closed */\n isOpen: boolean;\n /** Navigate to this view when the drawer opens. Defaults to home view. */\n initialView?: string;\n /** Default onClose callback for drawer. View onCloseButton callback will override this. */\n onCloseButton?: () => void;\n /** Content sent to footer section of Drawer. View footer will override this */\n footer?: React.ReactNode;\n}\n\nfunction parseChildren(children: React.ReactNode): { views: DrawerViewProps[]; other: React.ReactNode[] } {\n const views: DrawerViewProps[] = [];\n const other: React.ReactNode[] = [];\n Children.forEach(children, child => {\n if (isValidElement<DrawerViewProps>(child) && child.type === DrawerView) {\n views.push({\n id: child.props.id,\n title: child.props.title,\n home: child.props.home,\n children: child.props.children,\n onCloseButton: child.props.onCloseButton,\n footer: child.props.footer,\n drawerContentClassname: child.props.drawerContentClassname,\n });\n } else {\n /** Added possibility of other children to support Modals that need navigation context */\n other.push(child);\n }\n });\n return { views, other };\n}\n\nfunction DrawerNavigation({ children, isOpen, initialView, onCloseButton, footer }: DrawerNavigationProps): React.ReactNode {\n const { views, other } = useMemo(() => parseChildren(children), [children]);\n\n const homeView = views.find(v => v.home) ?? views[0];\n const [viewStack, setViewStack] = useState<string[]>([homeView?.id]);\n\n const goToView = useCallback(\n (id: string): void => {\n if (views.some(v => v.id === id)) {\n setViewStack(stack => [...stack, id]);\n }\n },\n [views]\n );\n\n const goBack = useCallback((): void => {\n setViewStack(stack => (stack.length > 1 ? stack.slice(0, -1) : stack));\n }, []);\n\n const goToViewAndClearStack = useCallback(\n (id: string): void => {\n if (views.some(v => v.id === id)) {\n setViewStack(id === homeView?.id ? [homeView.id] : [homeView?.id, id]);\n }\n },\n [views, homeView]\n );\n\n const currentViewId = viewStack[viewStack.length - 1];\n const currentView = views.find(v => v.id === currentViewId);\n\n const navigate = useMemo<NavigateProps>(() => ({ goBack, goToView, goToViewAndClearStack }), [goBack, goToView, goToViewAndClearStack]);\n\n const [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n if (prevIsOpen !== isOpen) {\n setPrevIsOpen(isOpen);\n if (!isOpen) {\n setViewStack([homeView?.id]);\n } else if (initialView && views.some(v => v.id === initialView)) {\n setViewStack(initialView === homeView?.id ? [homeView.id] : [homeView?.id, initialView]);\n }\n }\n\n return (\n <DrawerNavigationContext.Provider value={navigate}>\n <Drawer\n isOpen={isOpen}\n title={currentView?.title ?? 'Filter'}\n withBackButton={viewStack.length > 1}\n onRequestBack={goBack}\n onRequestClose={currentView?.onCloseButton ?? onCloseButton}\n footerContent={currentView?.footer ?? footer}\n contentClassName={currentView?.drawerContentClassname}\n >\n {currentView?.children}\n </Drawer>\n {other}\n </DrawerNavigationContext.Provider>\n );\n}\n\nDrawerNavigation.View = DrawerView;\n\nexport default DrawerNavigation;\n"],"mappings":";;;;AAQA,IAAa,0BAA0B,cAAoC,IAAI;AAE/E,SAAgB,sBAA6E;CAC3F,MAAM,UAAU,WAAW,uBAAuB;CAClD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,wEAAwE;CAE1F,OAAO;AACT;;;ACQA,SAAS,WAAkC,QAAkD;CAE3F,OAAO;AACT;AAeA,SAAS,cAAc,UAAmF;CACxG,MAAM,QAA2B,CAAC;CAClC,MAAM,QAA2B,CAAC;CAClC,SAAS,QAAQ,WAAU,UAAS;EAClC,IAAI,eAAgC,KAAK,KAAK,MAAM,SAAS,YAC3D,MAAM,KAAK;GACT,IAAI,MAAM,MAAM;GAChB,OAAO,MAAM,MAAM;GACnB,MAAM,MAAM,MAAM;GAClB,UAAU,MAAM,MAAM;GACtB,eAAe,MAAM,MAAM;GAC3B,QAAQ,MAAM,MAAM;GACpB,wBAAwB,MAAM,MAAM;EACtC,CAAC;;;EAGD,MAAM,KAAK,KAAK;CAEpB,CAAC;CACD,OAAO;EAAE;EAAO;CAAM;AACxB;AAEA,SAAS,iBAAiB,EAAE,UAAU,QAAQ,aAAa,eAAe,UAAkD;CAC1H,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,QAAQ,GAAG,CAAC,QAAQ,CAAC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gBAAgB,aAAa,iBAAiB;GAC9C,eAAe,aAAa,UAAU;GACtC,kBAAkB,aAAa;aAE9B,aAAa;EACR,CAAA,GACP,KAC+B;;AAEtC;AAEA,iBAAiB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Duolist.js","names":[],"sources":["../src/components/Duolist/Duolist.tsx","../src/components/Duolist/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { TitleProps } from '../Title';\n\nimport { AnalyticsId } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport Spacer from '../Spacer';\n\nimport duolistStyles from './styles.module.scss';\n\nexport type DuolistVariants = 'normal' | 'line';\nexport type BoldColumn = 'first' | 'second' | 'none';\nexport type Border = 'no-border' | 'border';\nexport type Formats = 'formatted' | 'non-formatted';\n\nexport interface DuolistProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Label of the Duolist */\n border?: Border;\n /** Label of the Duolist */\n label?: React.ReactElement<TitleProps>;\n /** Formatted or non-formatted visual variants */\n format?: Formats;\n /** Character separator for non-formatted format */\n separator?: string;\n /** Sets the visual variant of the Duolist. */\n variant?: DuolistVariants;\n /** Sets the content of the Duolist. */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Width of the description column in percentage */\n descriptionWidth?: number;\n /** Use collapsed mode on columns from chosen breakpoint and below. */\n useCollapsedFromAndBelowBreakpoint?: keyof typeof Breakpoint;\n}\n\nexport interface DuolistGroupProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Sets content of the <dd> tag. */\n description: React.ReactNode;\n /** Formatted or non-formatted visual variants */\n format?: Formats;\n /** Character separator for non-formatted format */\n separator?: string;\n /** Sets content of the <dt> tag. */\n term: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const DuolistGroup: React.FC<DuolistGroupProps> = props => {\n const { format = 'formatted', boldColumn = format === 'non-formatted' ? 'none' : 'first', description, separator = ': ', term } = props;\n\n const firstBold = boldColumn === 'first';\n const secondBold = boldColumn === 'second';\n const nonFormatted = format === 'non-formatted';\n\n const dtClassNames = classNames(duolistStyles['duolist__dt'], {\n [duolistStyles['duolist__dt--bold']]: firstBold,\n [duolistStyles['duolist__dt--non-formatted']]: nonFormatted,\n });\n const ddClassNames = classNames(duolistStyles['duolist__dd'], {\n [duolistStyles['duolist__dd--bold']]: secondBold,\n [duolistStyles['duolist__dd--non-formatted']]: nonFormatted,\n });\n\n const renderContent = () => {\n return (\n <>\n <dt\n data-separator={nonFormatted ? separator : undefined}\n className={dtClassNames}\n data-testid={props.testId && `${props.testId}-term`}\n >\n {term}\n </dt>\n <dd className={ddClassNames} data-testid={props.testId && `${props.testId}-description`}>\n {description}\n </dd>\n </>\n );\n };\n\n return nonFormatted ? <div>{renderContent()}</div> : <>{renderContent()}</>;\n};\n\nexport const Duolist: React.FC<DuolistProps> = props => {\n const {\n boldColumn,\n border = 'no-border',\n descriptionWidth,\n label,\n format = 'formatted',\n separator,\n variant = 'normal',\n children,\n className,\n testId,\n useCollapsedFromAndBelowBreakpoint,\n } = props;\n\n const hasBorder = border === 'border';\n const hasLines = variant === 'line';\n const extraPaddingTop = hasBorder && (label || hasLines);\n const nonFormatted = format === 'non-formatted';\n const breakpoint = useBreakpoint();\n const useCollapsedMode = useCollapsedFromAndBelowBreakpoint && breakpoint <= Breakpoint[useCollapsedFromAndBelowBreakpoint];\n\n const duolistWrapperClasses = classNames(\n {\n [duolistStyles['duolist-wrapper--border']]: hasBorder,\n [duolistStyles['duolist-wrapper--extra-padding-top']]: extraPaddingTop,\n },\n className\n );\n\n const duolistClasses = classNames(duolistStyles.duolist, {\n [duolistStyles['duolist--line']]: hasLines,\n [duolistStyles['duolist--non-formatted']]: nonFormatted,\n [duolistStyles['duolist--collapsed']]: useCollapsedMode,\n [duolistStyles['duolist--not-collapsed']]: !useCollapsedMode,\n });\n\n const duolistColumnStyle = descriptionWidth ? descriptionWidth + '%' : 'minmax(60%, 1fr)';\n\n return (\n <div className={duolistWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.Duolist}>\n {label && (\n <>\n {label}\n <Spacer />\n </>\n )}\n <dl\n style={!nonFormatted ? { gridTemplateColumns: useCollapsedMode ? `1fr` : `auto ${duolistColumnStyle}` } : undefined}\n className={duolistClasses}\n >\n {React.Children.map(children, (child: React.ReactNode | React.ReactElement<DuolistGroupProps>) => {\n if (child === null || typeof child === 'undefined') return;\n const duolistGroup = child as React.ReactElement<DuolistGroupProps>;\n if (duolistGroup.type === DuolistGroup) {\n return React.cloneElement(child as React.ReactElement<DuolistGroupProps>, {\n ...duolistGroup.props,\n boldColumn: duolistGroup.props.boldColumn ?? boldColumn,\n format: duolistGroup.props.format ?? format,\n separator: duolistGroup.props.separator ?? separator,\n });\n }\n })}\n </dl>\n </div>\n );\n};\n\nexport default Duolist;\n","import Duolist from './Duolist';\nexport * from './Duolist';\nexport default Duolist;\n"],"mappings":";;;;;;;;AAyDA,IAAa,gBAA4C,UAAS;CAChE,MAAM,EAAE,SAAS,aAAa,aAAa,WAAW,kBAAkB,SAAS,SAAS,aAAa,YAAY,MAAM,SAAS;CAElI,MAAM,YAAY,eAAe;CACjC,MAAM,aAAa,eAAe;CAClC,MAAM,eAAe,WAAW;CAEhC,MAAM,eAAe,WAAW,cAAc,gBAAgB;GAC3D,cAAc,uBAAuB;GACrC,cAAc,gCAAgC;EAChD,CAAC;CACF,MAAM,eAAe,WAAW,cAAc,gBAAgB;GAC3D,cAAc,uBAAuB;GACrC,cAAc,gCAAgC;EAChD,CAAC;CAEF,MAAM,sBAAsB;EAC1B,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;GACE,kBAAgB,eAAe,YAAY,KAAA;GAC3C,WAAW;GACX,eAAa,MAAM,UAAU,GAAG,MAAM,OAAO;aAE5C;GACE,CAAA,EACL,oBAAC,MAAD;GAAI,WAAW;GAAc,eAA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AQ,aAAa,MAAM,UAAU;KACrC,WAAW,aAAa,MAAM,aAAa;KAC5C,CAAC;KAEJ;GACC,CAAA,CACD;;;;;AC3JV,IAAA,kBAAe"}
1
+ {"version":3,"file":"Duolist.js","names":[],"sources":["../src/components/Duolist/Duolist.tsx","../src/components/Duolist/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { TitleProps } from '../Title';\n\nimport { AnalyticsId } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport Spacer from '../Spacer';\n\nimport duolistStyles from './styles.module.scss';\n\nexport type DuolistVariants = 'normal' | 'line';\nexport type BoldColumn = 'first' | 'second' | 'none';\nexport type Border = 'no-border' | 'border';\nexport type Formats = 'formatted' | 'non-formatted';\n\nexport interface DuolistProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Label of the Duolist */\n border?: Border;\n /** Label of the Duolist */\n label?: React.ReactElement<TitleProps>;\n /** Formatted or non-formatted visual variants */\n format?: Formats;\n /** Character separator for non-formatted format */\n separator?: string;\n /** Sets the visual variant of the Duolist. */\n variant?: DuolistVariants;\n /** Sets the content of the Duolist. */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Width of the description column in percentage */\n descriptionWidth?: number;\n /** Use collapsed mode on columns from chosen breakpoint and below. */\n useCollapsedFromAndBelowBreakpoint?: keyof typeof Breakpoint;\n}\n\nexport interface DuolistGroupProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Sets content of the <dd> tag. */\n description: React.ReactNode;\n /** Formatted or non-formatted visual variants */\n format?: Formats;\n /** Character separator for non-formatted format */\n separator?: string;\n /** Sets content of the <dt> tag. */\n term: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const DuolistGroup: React.FC<DuolistGroupProps> = props => {\n const { format = 'formatted', boldColumn = format === 'non-formatted' ? 'none' : 'first', description, separator = ': ', term } = props;\n\n const firstBold = boldColumn === 'first';\n const secondBold = boldColumn === 'second';\n const nonFormatted = format === 'non-formatted';\n\n const dtClassNames = classNames(duolistStyles['duolist__dt'], {\n [duolistStyles['duolist__dt--bold']]: firstBold,\n [duolistStyles['duolist__dt--non-formatted']]: nonFormatted,\n });\n const ddClassNames = classNames(duolistStyles['duolist__dd'], {\n [duolistStyles['duolist__dd--bold']]: secondBold,\n [duolistStyles['duolist__dd--non-formatted']]: nonFormatted,\n });\n\n const renderContent = () => {\n return (\n <>\n <dt\n data-separator={nonFormatted ? separator : undefined}\n className={dtClassNames}\n data-testid={props.testId && `${props.testId}-term`}\n >\n {term}\n </dt>\n <dd className={ddClassNames} data-testid={props.testId && `${props.testId}-description`}>\n {description}\n </dd>\n </>\n );\n };\n\n return nonFormatted ? <div>{renderContent()}</div> : <>{renderContent()}</>;\n};\n\nexport const Duolist: React.FC<DuolistProps> = props => {\n const {\n boldColumn,\n border = 'no-border',\n descriptionWidth,\n label,\n format = 'formatted',\n separator,\n variant = 'normal',\n children,\n className,\n testId,\n useCollapsedFromAndBelowBreakpoint,\n } = props;\n\n const hasBorder = border === 'border';\n const hasLines = variant === 'line';\n const extraPaddingTop = hasBorder && (label || hasLines);\n const nonFormatted = format === 'non-formatted';\n const breakpoint = useBreakpoint();\n const useCollapsedMode = useCollapsedFromAndBelowBreakpoint && breakpoint <= Breakpoint[useCollapsedFromAndBelowBreakpoint];\n\n const duolistWrapperClasses = classNames(\n {\n [duolistStyles['duolist-wrapper--border']]: hasBorder,\n [duolistStyles['duolist-wrapper--extra-padding-top']]: extraPaddingTop,\n },\n className\n );\n\n const duolistClasses = classNames(duolistStyles.duolist, {\n [duolistStyles['duolist--line']]: hasLines,\n [duolistStyles['duolist--non-formatted']]: nonFormatted,\n [duolistStyles['duolist--collapsed']]: useCollapsedMode,\n [duolistStyles['duolist--not-collapsed']]: !useCollapsedMode,\n });\n\n const duolistColumnStyle = descriptionWidth ? descriptionWidth + '%' : 'minmax(60%, 1fr)';\n\n return (\n <div className={duolistWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.Duolist}>\n {label && (\n <>\n {label}\n <Spacer />\n </>\n )}\n <dl\n style={!nonFormatted ? { gridTemplateColumns: useCollapsedMode ? `1fr` : `auto ${duolistColumnStyle}` } : undefined}\n className={duolistClasses}\n >\n {React.Children.map(children, (child: React.ReactNode | React.ReactElement<DuolistGroupProps>) => {\n if (child === null || typeof child === 'undefined') return;\n const duolistGroup = child as React.ReactElement<DuolistGroupProps>;\n if (duolistGroup.type === DuolistGroup) {\n return React.cloneElement(child as React.ReactElement<DuolistGroupProps>, {\n ...duolistGroup.props,\n boldColumn: duolistGroup.props.boldColumn ?? boldColumn,\n format: duolistGroup.props.format ?? format,\n separator: duolistGroup.props.separator ?? separator,\n });\n }\n })}\n </dl>\n </div>\n );\n};\n\nexport default Duolist;\n","import Duolist from './Duolist';\nexport * from './Duolist';\nexport default Duolist;\n"],"mappings":";;;;;;;;AAyDA,IAAa,gBAA4C,UAAS;CAChE,MAAM,EAAE,SAAS,aAAa,aAAa,WAAW,kBAAkB,SAAS,SAAS,aAAa,YAAY,MAAM,SAAS;CAElI,MAAM,YAAY,eAAe;CACjC,MAAM,aAAa,eAAe;CAClC,MAAM,eAAe,WAAW;CAEhC,MAAM,eAAe,WAAW,cAAc,gBAAgB;GAC3D,cAAc,uBAAuB;GACrC,cAAc,gCAAgC;CACjD,CAAC;CACD,MAAM,eAAe,WAAW,cAAc,gBAAgB;GAC3D,cAAc,uBAAuB;GACrC,cAAc,gCAAgC;CACjD,CAAC;CAED,MAAM,sBAAsB;EAC1B,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;GACE,kBAAgB,eAAe,YAAY,KAAA;GAC3C,WAAW;GACX,eAAa,MAAM,UAAU,GAAG,MAAM,OAAO;aAE5C;EACC,CAAA,GACJ,oBAAC,MAAD;GAAI,WAAW;GAAc,eAAa,MAAM,UAAU,GAAG,MAAM,OAAO;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;KACrC,WAAW,aAAa,MAAM,aAAa;IAC7C,CAAC;GAEL,CAAC;EACC,CAAA,CACD;;AAET;;;AC7JA,IAAA,kBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementHeader.js","names":[],"sources":["../src/components/ElementHeader/utils.tsx","../src/components/ElementHeader/ElementHeader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { AvatarProps } from '../Avatar';\nimport type { BadgeProps } from '../Badge';\nimport type { StatusDotProps } from '../StatusDot';\n\nimport ElementHeader, { type ElementHeaderChildren, type ElementHeaderProps } from './ElementHeader';\nimport { ElementHeaderText, type ElementHeaderTextProps } from './ElementHeaderText';\nimport { StatusDotList, type StatusDotListProps } from './StatusDotList';\nimport { isComponent, isComponentWithChildren } from '../../utils/component';\nimport Avatar from '../Avatar';\nimport Badge from '../Badge';\nimport StatusDot from '../StatusDot';\n\ntype ChildrenMapper = (children: React.ReactNode, isJsxChild?: boolean) => ElementHeaderChildren | undefined;\n\nexport const mapChildren: ChildrenMapper = (children, isJsxChild = false) => {\n let avatarChild: React.ReactElement<AvatarProps> | undefined;\n const badgeChildren: React.ReactElement<BadgeProps>[] = [];\n const statusDotChildren: React.ReactElement<StatusDotProps>[] = [];\n let statusDotMCChild: React.ReactElement<StatusDotListProps> | undefined;\n const elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[] = [];\n const stringChildren: string[] = [];\n const remainingChildren: React.ReactNode[] = [];\n\n React.Children.forEach(children, child => {\n if (child === null || typeof child === 'undefined') return;\n if (isComponent<AvatarProps>(child, Avatar)) {\n avatarChild = child;\n } else if (isComponent<ElementHeaderTextProps>(child, ElementHeaderText)) {\n elementHeaderTextChildren.push(child);\n } else if (isComponent<BadgeProps>(child, Badge)) {\n badgeChildren.push(child);\n } else if (isComponent<StatusDotListProps>(child, StatusDotList)) {\n statusDotMCChild = child;\n } else if (isComponent<StatusDotProps>(child, StatusDot)) {\n statusDotChildren.push(child);\n } else if (typeof child === 'string') {\n stringChildren.push(child);\n } else {\n remainingChildren.push(child);\n }\n });\n\n // Dette og recursive mapChildren under(gjøres en gang) er for å passe på at jsx children også sjekkes for Avatar og liknende innhold.\n // Slik opprettholder vi stylingen i tilfeller hvor vertikaler har wrappet elementer i en parent span eller div.\n const hasSpecialChildren =\n avatarChild !== undefined ||\n elementHeaderTextChildren.length > 0 ||\n statusDotChildren.length > 0 ||\n statusDotMCChild !== undefined ||\n (badgeChildren !== undefined && stringChildren.length > 0);\n const noRemainingRecursiveChildren =\n remainingChildren.length === 0 ||\n (isComponentWithChildren(remainingChildren[0]) && typeof remainingChildren[0]?.props?.children === 'undefined');\n\n if (isJsxChild || hasSpecialChildren || noRemainingRecursiveChildren) {\n return {\n avatarChild,\n elementHeaderTextChildren: elementHeaderTextChildren,\n badgeChildren,\n statusDotChildren,\n statusDotMCChild,\n stringChildren,\n remainingChildren,\n };\n }\n\n if (isComponentWithChildren(remainingChildren[0])) {\n return mapChildren(remainingChildren[0]?.props?.children, true);\n }\n};\n\nexport const renderElementHeader = (\n element: React.ReactNode,\n options: Pick<\n ElementHeaderProps,\n 'titleHtmlMarkup' | 'isHovered' | 'size' | 'parentType' | 'chevronIcon' | 'icon' | 'highlightText' | 'closeButton'\n >\n): React.ReactElement | undefined => {\n const { titleHtmlMarkup, isHovered, size, parentType, chevronIcon, icon, highlightText, closeButton } = options;\n\n if (isComponent<ElementHeaderProps>(element, ElementHeader)) {\n return React.cloneElement(element, {\n chevronIcon,\n icon,\n isHovered,\n size,\n parentType,\n highlightText,\n closeButton,\n });\n }\n if (element) {\n return (\n <ElementHeader\n highlightText={highlightText}\n titleHtmlMarkup={titleHtmlMarkup}\n parentType={parentType}\n chevronIcon={chevronIcon}\n icon={icon}\n isHovered={isHovered}\n size={size}\n closeButton={closeButton}\n >\n {element}\n </ElementHeader>\n );\n }\n};\n","import React from 'react';\n\nimport cn from 'classnames';\n\nimport type { AvatarProps, AvatarType } from '../Avatar';\nimport type { BadgeProps, BadgeType } from '../Badge';\nimport type { IconProps, SvgIcon } from '../Icon';\nimport type { LazyIconProps } from '../LazyIcon';\nimport type { StatusDotProps, StatusDotType } from '../StatusDot';\nimport type { TitleTags } from '../Title';\nimport type { ElementHeaderTextProps, ElementHeaderTextType } from './ElementHeaderText/ElementHeaderText';\nimport type { StatusDotListProps, StatusDotListType } from './StatusDotList/StatusDotList';\n\nimport ElementHeaderText from './ElementHeaderText/ElementHeaderText';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { isComponent } from '../../utils/component';\nimport { AvatarSize } from '../Avatar';\nimport Icon, { IconSize } from '../Icon';\nimport StatusDotList from './StatusDotList';\nimport Highlighter from '../Highlighter';\nimport LazyIcon from '../LazyIcon';\nimport { mapChildren } from './utils';\n\nimport styles from './styles.module.scss';\n\nexport type ElementHeaderSize = 'compact' | 'small' | 'medium' | 'large';\nexport type ParentType = 'linklist' | 'expanderlist';\n\nexport interface ElementHeaderType extends React.FC<ElementHeaderProps> {\n Avatar?: AvatarType;\n Badge?: BadgeType;\n ElementHeaderText?: ElementHeaderTextType;\n StatusDot?: StatusDotType;\n StatusDotList?: StatusDotListType;\n}\n\nexport interface ElementHeaderProps {\n /** Adds custom classes to the ElementHeader element. */\n className?: string;\n /** Chevron to render inside of the ElementHeader */\n chevronIcon?: SvgIcon;\n /** Close button to be rendered inside of ElementHeader. This renders in place of chevronIcon */\n closeButton?: React.ReactElement;\n /** Children to be rendered inside of ElementHeader */\n children: React.ReactNode;\n /** Changes the underlying element of the title. Default: h2*/\n titleHtmlMarkup?: TitleTags;\n /** icon to be rendered inside of ElementHeader */\n icon?: React.ReactElement;\n /** whether or not the parent is hovered */\n isHovered?: boolean;\n /** Adjusts styling based on parent */\n parentType?: ParentType;\n /** Changes size of the ElementHeader. */\n size?: ElementHeaderSize;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Highlights text in title. Used for search results */\n highlightText?: string;\n}\n\nexport interface ElementHeaderChildren {\n avatarChild?: React.ReactElement<AvatarProps>;\n elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[];\n badgeChildren?: React.ReactElement<BadgeProps>[];\n statusDotChildren?: React.ReactElement<StatusDotProps>[];\n statusDotMCChild?: React.ReactElement<StatusDotListProps>;\n elementChild?: React.ReactElement;\n stringChildren: string[];\n remainingChildren: React.ReactNode[];\n}\n\nexport const ElementHeaderRoot: ElementHeaderType = props => {\n const {\n className = '',\n titleHtmlMarkup = 'h2',\n parentType = 'linklist',\n chevronIcon,\n closeButton,\n children,\n icon,\n isHovered,\n size,\n testId,\n highlightText,\n } = props;\n const breakpoint = useBreakpoint();\n const showIcon = size !== 'small' && !!icon;\n const contentIsString = typeof children === 'string';\n const mappedChildren = mapChildren(children);\n const hasStatusDots = !!mappedChildren?.statusDotChildren?.length || !!mappedChildren?.statusDotMCChild;\n\n const listLabelClasses = cn(styles['element-header'], { [styles['element-header--compact']]: size === 'compact' }, className);\n const badgeContainerClasses = cn(styles['element-header__badge-container']);\n const badgeClasses = cn(styles['element-header__badge']);\n const statusdotContainerClasses = cn(styles['element-header__statusdot-container']);\n const chevronClasses = cn(styles['element-header__chevron']);\n const contentClasses = cn(styles['element-header__content'], {\n [styles['element-header__content--element']]: !contentIsString,\n [styles['element-header__content--compact']]: size === 'compact',\n });\n const iconClasses = cn(styles['element-header__icon'], { [styles['element-header__icon--with-statusdot']]: hasStatusDots });\n const avatarClasses = cn(styles['element-header__avatar'], {});\n const CustomTag = titleHtmlMarkup;\n const iconPropIsIconComponent = isComponent<IconProps>(icon, Icon);\n const iconPropIsLazyIconComponent = !iconPropIsIconComponent && isComponent<LazyIconProps>(icon, LazyIcon);\n\n let iconComponent;\n if (iconPropIsIconComponent) {\n iconComponent = React.cloneElement(icon as React.ReactElement<IconProps>, {\n size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,\n isHovered,\n });\n } else if (iconPropIsLazyIconComponent) {\n iconComponent = React.cloneElement(icon as React.ReactElement<LazyIconProps>, {\n size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,\n isHovered,\n });\n } else {\n iconComponent = icon;\n }\n\n return (\n <span data-testid={testId} className={listLabelClasses}>\n {showIcon && icon && <span className={iconClasses}>{iconComponent}</span>}\n {size !== 'small' && mappedChildren?.avatarChild && (\n <span className={avatarClasses}>{React.cloneElement(mappedChildren.avatarChild, { size: AvatarSize.xsmall })}</span>\n )}\n\n <span className={contentClasses} data-hasstatusdots={hasStatusDots}>\n {mappedChildren?.elementHeaderTextChildren}\n {!!mappedChildren?.stringChildren.length && (\n <CustomTag className={styles['element-header__title']}>\n <Highlighter searchText={highlightText}>{mappedChildren.stringChildren}</Highlighter>\n </CustomTag>\n )}\n <Highlighter searchText={highlightText}>{mappedChildren?.remainingChildren}</Highlighter>\n </span>\n\n {hasStatusDots && (\n <span className={statusdotContainerClasses}>\n {!!mappedChildren?.statusDotChildren && <StatusDotList>{mappedChildren.statusDotChildren}</StatusDotList>}\n {!!mappedChildren?.statusDotMCChild && mappedChildren?.statusDotMCChild}\n </span>\n )}\n\n <span className={badgeContainerClasses}>\n {mappedChildren?.badgeChildren &&\n mappedChildren.badgeChildren.map((badgeChild, index) => {\n return (\n <span key={index} className={badgeClasses} data-parenttype={parentType}>\n {badgeChild}\n </span>\n );\n })}\n </span>\n {chevronIcon && typeof closeButton === 'undefined' && (\n <span className={chevronClasses} data-parenttype={parentType}>\n <Icon svgIcon={chevronIcon} isHovered={isHovered} size={IconSize.XSmall} />\n </span>\n )}\n {closeButton && (\n <span className={chevronClasses} data-parenttype={parentType}>\n {closeButton}\n </span>\n )}\n </span>\n );\n};\n\ntype ElementHeaderComponent = typeof ElementHeaderRoot & {\n Text: React.FC<ElementHeaderTextProps>;\n StatusDotList: React.FC<StatusDotListProps>;\n};\nElementHeaderRoot.displayName = 'ElementHeader';\nconst ElementHeader = ElementHeaderRoot as ElementHeaderComponent;\nElementHeader.Text = ElementHeaderText;\nElementHeader.Text.displayName = 'ElementHeader.Text';\nElementHeader.StatusDotList = StatusDotList;\nEl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iB;cAC/C;IACI,CAAA;GAEJ;;;AAQX,kBAAkB,cAAc;AAChC,IAAM,gBAAgB;AACtB,cAAc,OAAO;AACrB,cAAc,KAAK,cAAc;AACjC,cAAc,gBAAgB;AAC9B,cAAc,cAAc,cAAc"}
1
+ {"version":3,"file":"ElementHeader.js","names":[],"sources":["../src/components/ElementHeader/utils.tsx","../src/components/ElementHeader/ElementHeader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { AvatarProps } from '../Avatar';\nimport type { BadgeProps } from '../Badge';\nimport type { StatusDotProps } from '../StatusDot';\n\nimport ElementHeader, { type ElementHeaderChildren, type ElementHeaderProps } from './ElementHeader';\nimport { ElementHeaderText, type ElementHeaderTextProps } from './ElementHeaderText';\nimport { StatusDotList, type StatusDotListProps } from './StatusDotList';\nimport { isComponent, isComponentWithChildren } from '../../utils/component';\nimport Avatar from '../Avatar';\nimport Badge from '../Badge';\nimport StatusDot from '../StatusDot';\n\ntype ChildrenMapper = (children: React.ReactNode, isJsxChild?: boolean) => ElementHeaderChildren | undefined;\n\nexport const mapChildren: ChildrenMapper = (children, isJsxChild = false) => {\n let avatarChild: React.ReactElement<AvatarProps> | undefined;\n const badgeChildren: React.ReactElement<BadgeProps>[] = [];\n const statusDotChildren: React.ReactElement<StatusDotProps>[] = [];\n let statusDotMCChild: React.ReactElement<StatusDotListProps> | undefined;\n const elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[] = [];\n const stringChildren: string[] = [];\n const remainingChildren: React.ReactNode[] = [];\n\n React.Children.forEach(children, child => {\n if (child === null || typeof child === 'undefined') return;\n if (isComponent<AvatarProps>(child, Avatar)) {\n avatarChild = child;\n } else if (isComponent<ElementHeaderTextProps>(child, ElementHeaderText)) {\n elementHeaderTextChildren.push(child);\n } else if (isComponent<BadgeProps>(child, Badge)) {\n badgeChildren.push(child);\n } else if (isComponent<StatusDotListProps>(child, StatusDotList)) {\n statusDotMCChild = child;\n } else if (isComponent<StatusDotProps>(child, StatusDot)) {\n statusDotChildren.push(child);\n } else if (typeof child === 'string') {\n stringChildren.push(child);\n } else {\n remainingChildren.push(child);\n }\n });\n\n // Dette og recursive mapChildren under(gjøres en gang) er for å passe på at jsx children også sjekkes for Avatar og liknende innhold.\n // Slik opprettholder vi stylingen i tilfeller hvor vertikaler har wrappet elementer i en parent span eller div.\n const hasSpecialChildren =\n avatarChild !== undefined ||\n elementHeaderTextChildren.length > 0 ||\n statusDotChildren.length > 0 ||\n statusDotMCChild !== undefined ||\n (badgeChildren !== undefined && stringChildren.length > 0);\n const noRemainingRecursiveChildren =\n remainingChildren.length === 0 ||\n (isComponentWithChildren(remainingChildren[0]) && typeof remainingChildren[0]?.props?.children === 'undefined');\n\n if (isJsxChild || hasSpecialChildren || noRemainingRecursiveChildren) {\n return {\n avatarChild,\n elementHeaderTextChildren: elementHeaderTextChildren,\n badgeChildren,\n statusDotChildren,\n statusDotMCChild,\n stringChildren,\n remainingChildren,\n };\n }\n\n if (isComponentWithChildren(remainingChildren[0])) {\n return mapChildren(remainingChildren[0]?.props?.children, true);\n }\n};\n\nexport const renderElementHeader = (\n element: React.ReactNode,\n options: Pick<\n ElementHeaderProps,\n 'titleHtmlMarkup' | 'isHovered' | 'size' | 'parentType' | 'chevronIcon' | 'icon' | 'highlightText' | 'closeButton'\n >\n): React.ReactElement | undefined => {\n const { titleHtmlMarkup, isHovered, size, parentType, chevronIcon, icon, highlightText, closeButton } = options;\n\n if (isComponent<ElementHeaderProps>(element, ElementHeader)) {\n return React.cloneElement(element, {\n chevronIcon,\n icon,\n isHovered,\n size,\n parentType,\n highlightText,\n closeButton,\n });\n }\n if (element) {\n return (\n <ElementHeader\n highlightText={highlightText}\n titleHtmlMarkup={titleHtmlMarkup}\n parentType={parentType}\n chevronIcon={chevronIcon}\n icon={icon}\n isHovered={isHovered}\n size={size}\n closeButton={closeButton}\n >\n {element}\n </ElementHeader>\n );\n }\n};\n","import React from 'react';\n\nimport cn from 'classnames';\n\nimport type { AvatarProps, AvatarType } from '../Avatar';\nimport type { BadgeProps, BadgeType } from '../Badge';\nimport type { IconProps, SvgIcon } from '../Icon';\nimport type { LazyIconProps } from '../LazyIcon';\nimport type { StatusDotProps, StatusDotType } from '../StatusDot';\nimport type { TitleTags } from '../Title';\nimport type { ElementHeaderTextProps, ElementHeaderTextType } from './ElementHeaderText/ElementHeaderText';\nimport type { StatusDotListProps, StatusDotListType } from './StatusDotList/StatusDotList';\n\nimport ElementHeaderText from './ElementHeaderText/ElementHeaderText';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { isComponent } from '../../utils/component';\nimport { AvatarSize } from '../Avatar';\nimport Icon, { IconSize } from '../Icon';\nimport StatusDotList from './StatusDotList';\nimport Highlighter from '../Highlighter';\nimport LazyIcon from '../LazyIcon';\nimport { mapChildren } from './utils';\n\nimport styles from './styles.module.scss';\n\nexport type ElementHeaderSize = 'compact' | 'small' | 'medium' | 'large';\nexport type ParentType = 'linklist' | 'expanderlist';\n\nexport interface ElementHeaderType extends React.FC<ElementHeaderProps> {\n Avatar?: AvatarType;\n Badge?: BadgeType;\n ElementHeaderText?: ElementHeaderTextType;\n StatusDot?: StatusDotType;\n StatusDotList?: StatusDotListType;\n}\n\nexport interface ElementHeaderProps {\n /** Adds custom classes to the ElementHeader element. */\n className?: string;\n /** Chevron to render inside of the ElementHeader */\n chevronIcon?: SvgIcon;\n /** Close button to be rendered inside of ElementHeader. This renders in place of chevronIcon */\n closeButton?: React.ReactElement;\n /** Children to be rendered inside of ElementHeader */\n children: React.ReactNode;\n /** Changes the underlying element of the title. Default: h2*/\n titleHtmlMarkup?: TitleTags;\n /** icon to be rendered inside of ElementHeader */\n icon?: React.ReactElement;\n /** whether or not the parent is hovered */\n isHovered?: boolean;\n /** Adjusts styling based on parent */\n parentType?: ParentType;\n /** Changes size of the ElementHeader. */\n size?: ElementHeaderSize;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Highlights text in title. Used for search results */\n highlightText?: string;\n}\n\nexport interface ElementHeaderChildren {\n avatarChild?: React.ReactElement<AvatarProps>;\n elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[];\n badgeChildren?: React.ReactElement<BadgeProps>[];\n statusDotChildren?: React.ReactElement<StatusDotProps>[];\n statusDotMCChild?: React.ReactElement<StatusDotListProps>;\n elementChild?: React.ReactElement;\n stringChildren: string[];\n remainingChildren: React.ReactNode[];\n}\n\nexport const ElementHeaderRoot: ElementHeaderType = props => {\n const {\n className = '',\n titleHtmlMarkup = 'h2',\n parentType = 'linklist',\n chevronIcon,\n closeButton,\n children,\n icon,\n isHovered,\n size,\n testId,\n highlightText,\n } = props;\n const breakpoint = useBreakpoint();\n const showIcon = size !== 'small' && !!icon;\n const contentIsString = typeof children === 'string';\n const mappedChildren = mapChildren(children);\n const hasStatusDots = !!mappedChildren?.statusDotChildren?.length || !!mappedChildren?.statusDotMCChild;\n\n const listLabelClasses = cn(styles['element-header'], { [styles['element-header--compact']]: size === 'compact' }, className);\n const badgeContainerClasses = cn(styles['element-header__badge-container']);\n const badgeClasses = cn(styles['element-header__badge']);\n const statusdotContainerClasses = cn(styles['element-header__statusdot-container']);\n const chevronClasses = cn(styles['element-header__chevron']);\n const contentClasses = cn(styles['element-header__content'], {\n [styles['element-header__content--element']]: !contentIsString,\n [styles['element-header__content--compact']]: size === 'compact',\n });\n const iconClasses = cn(styles['element-header__icon'], { [styles['element-header__icon--with-statusdot']]: hasStatusDots });\n const avatarClasses = cn(styles['element-header__avatar'], {});\n const CustomTag = titleHtmlMarkup;\n const iconPropIsIconComponent = isComponent<IconProps>(icon, Icon);\n const iconPropIsLazyIconComponent = !iconPropIsIconComponent && isComponent<LazyIconProps>(icon, LazyIcon);\n\n let iconComponent;\n if (iconPropIsIconComponent) {\n iconComponent = React.cloneElement(icon as React.ReactElement<IconProps>, {\n size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,\n isHovered,\n });\n } else if (iconPropIsLazyIconComponent) {\n iconComponent = React.cloneElement(icon as React.ReactElement<LazyIconProps>, {\n size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,\n isHovered,\n });\n } else {\n iconComponent = icon;\n }\n\n return (\n <span data-testid={testId} className={listLabelClasses}>\n {showIcon && icon && <span className={iconClasses}>{iconComponent}</span>}\n {size !== 'small' && mappedChildren?.avatarChild && (\n <span className={avatarClasses}>{React.cloneElement(mappedChildren.avatarChild, { size: AvatarSize.xsmall })}</span>\n )}\n\n <span className={contentClasses} data-hasstatusdots={hasStatusDots}>\n {mappedChildren?.elementHeaderTextChildren}\n {!!mappedChildren?.stringChildren.length && (\n <CustomTag className={styles['element-header__title']}>\n <Highlighter searchText={highlightText}>{mappedChildren.stringChildren}</Highlighter>\n </CustomTag>\n )}\n <Highlighter searchText={highlightText}>{mappedChildren?.remainingChildren}</Highlighter>\n </span>\n\n {hasStatusDots && (\n <span className={statusdotContainerClasses}>\n {!!mappedChildren?.statusDotChildren && <StatusDotList>{mappedChildren.statusDotChildren}</StatusDotList>}\n {!!mappedChildren?.statusDotMCChild && mappedChildren?.statusDotMCChild}\n </span>\n )}\n\n <span className={badgeContainerClasses}>\n {mappedChildren?.badgeChildren &&\n mappedChildren.badgeChildren.map((badgeChild, index) => {\n return (\n <span key={index} className={badgeClasses} data-parenttype={parentType}>\n {badgeChild}\n </span>\n );\n })}\n </span>\n {chevronIcon && typeof closeButton === 'undefined' && (\n <span className={chevronClasses} data-parenttype={parentType}>\n <Icon svgIcon={chevronIcon} isHovered={isHovered} size={IconSize.XSmall} />\n </span>\n )}\n {closeButton && (\n <span className={chevronClasses} data-parenttype={parentType}>\n {closeButton}\n </span>\n )}\n </span>\n );\n};\n\ntype ElementHeaderComponent = typeof ElementHeaderRoot & {\n Text: React.FC<ElementHeaderTextProps>;\n StatusDotList: React.FC<StatusDotListProps>;\n};\nElementHeaderRoot.displayName = 'ElementHeader';\nconst ElementHeader = ElementHeaderRoot as ElementHeaderComponent;\nElementHeader.Text = ElementHeaderText;\nElementHeader.Text.displayName = 'ElementHeader.Text';\nElementHeader.StatusDotList = StatusDotList;\nElementHeader.StatusDotList.displayName = 'ElementHeader.StatusDotList';\n\nexport default ElementHeader;\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAa,eAA+B,UAAU,aAAa,UAAU;CAC3E,IAAI;CACJ,MAAM,gBAAkD,CAAC;CACzD,MAAM,oBAA0D,CAAC;CACjE,IAAI;CACJ,MAAM,4BAA0E,CAAC;CACjF,MAAM,iBAA2B,CAAC;CAClC,MAAM,oBAAuC,CAAC;CAE9C,MAAM,SAAS,QAAQ,WAAU,UAAS;EACxC,IAAI,UAAU,QAAQ,OAAO,UAAU,aAAa;EACpD,IAAI,YAAyB,OAAO,cAAM,GACxC,cAAc;OACT,IAAI,YAAoC,OAAO,iBAAiB,GACrE,0BAA0B,KAAK,KAAK;OAC/B,IAAI,YAAwB,OAAO,aAAK,GAC7C,cAAc,KAAK,KAAK;OACnB,IAAI,YAAgC,OAAO,aAAa,GAC7D,mBAAmB;OACd,IAAI,YAA4B,OAAO,iBAAS,GACrD,kBAAkB,KAAK,KAAK;OACvB,IAAI,OAAO,UAAU,UAC1B,eAAe,KAAK,KAAK;OAEzB,kBAAkB,KAAK,KAAK;CAEhC,CAAC;CAID,MAAM,qBACJ,gBAAgB,KAAA,KAChB,0BAA0B,SAAS,KACnC,kBAAkB,SAAS,KAC3B,qBAAqB,KAAA,KACpB,kBAAkB,KAAA,KAAa,eAAe,SAAS;CAC1D,MAAM,+BACJ,kBAAkB,WAAW,KAC5B,wBAAwB,kBAAkB,EAAE,KAAK,OAAO,kBAAkB,IAAI,OAAO,aAAa;CAErG,IAAI,cAAc,sBAAsB,8BACtC,OAAO;EACL;EAC2B;EAC3B;EACA;EACA;EACA;EACA;CACF;CAGF,IAAI,wBAAwB,kBAAkB,EAAE,GAC9C,OAAO,YAAY,kBAAkB,IAAI,OAAO,UAAU,IAAI;AAElE;AAEA,IAAa,uBACX,SACA,YAImC;CACnC,MAAM,EAAE,iBAAiB,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,CAAA;GACtE,CAAA;GAEP,eACC,oBAAC,QAAD;IAAM,WAAW;IAAgB,mBAAiB;cAC/C;GACG,CAAA;EAEJ;;AAEV;AAMA,kBAAkB,cAAc;AAChC,IAAM,gBAAgB;AACtB,cAAc,OAAO;AACrB,cAAc,KAAK,cAAc;AACjC,cAAc,gBAAgB;AAC9B,cAAc,cAAc,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementHeaderText.js","names":[],"sources":["../src/components/ElementHeader/ElementHeaderText/ElementHeaderText.tsx","../src/components/ElementHeader/ElementHeaderText/index.ts"],"sourcesContent":["import cn from 'classnames';\n\nimport type { TitleTags } from '../../Title';\n\nimport Highlighter from '../../Highlighter';\nimport styles from '../styles.module.scss';\n\nexport type ElementHeaderTextType = typeof ElementHeaderText;\n\nexport interface ElementHeaderTextProps {\n /** The first text in the ElementHeaderText Component */\n firstText: string;\n /** Will style the first text as bold */\n firstTextEmphasised?: boolean;\n /** The second text in the ElementHeaderText Component */\n secondText?: string;\n /** Will style the second text as bold */\n secondTextEmphasised?: boolean;\n /** Whether or not this ElementHeaderText is a sub text */\n subText?: boolean;\n /** Adds custom classes to the ElementHeaderText component. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Changes the underlying element of the text. Default: span*/\n titleHtmlMarkup?: TitleTags;\n /** Highlights text. Used for search results */\n highlightText?: string;\n}\n\nexport const ElementHeaderText: React.FC<ElementHeaderTextProps> = props => {\n const {\n firstText,\n firstTextEmphasised = false,\n secondText = undefined,\n secondTextEmphasised = false,\n subText = false,\n className = '',\n testId,\n titleHtmlMarkup = 'span',\n highlightText,\n } = props;\n\n const headerTextWrapperClasses = cn(className, styles['text-wrapper'], {\n [styles['text-wrapper--sub-level']]: subText,\n });\n const firstHeaderTextSegmentClasses = cn({\n [styles['text-wrapper__text--emphasised']]: firstTextEmphasised,\n });\n const secondHeaderTextSegmentClasses = cn({\n [styles['text-wrapper__text--emphasised']]: secondTextEmphasised,\n });\n const CustomTag = titleHtmlMarkup;\n\n return (\n <span data-testid={testId} className={headerTextWrapperClasses}>\n <CustomTag className={styles['element-header__title']}>\n <Highlighter searchText={highlightText}>\n <span className={firstHeaderTextSegmentClasses}>{firstText}</span>\n {secondText && <span className={secondHeaderTextSegmentClasses}>{secondText}</span>}\n </Highlighter>\n </CustomTag>\n </span>\n );\n};\n\nexport default ElementHeaderText;\n","import ElementHeaderText from './ElementHeaderText';\nexport * from './ElementHeaderText';\nexport default ElementHeaderText;\n"],"mappings":";;;;;AA8BA,IAAa,qBAAsD,UAAS;CAC1E,MAAM,EACJ,WACA,sBAAsB,OACtB,aAAa,KAAA,GACb,uBAAuB,OACvB,UAAU,OACV,YAAY,IACZ,QACA,kBAAkB,QAClB,kBACE;CAEJ,MAAM,2BAA2B,WAAG,WAAW,OAAO,iBAAiB,GACpE,OAAO,6BAA6B,SACtC,CAAC;CACF,MAAM,gCAAgC,WAAG,GACtC,OAAO,oCAAoC,qBAC7C,CAAC;CACF,MAAM,iCAAiC,WAAG,GACvC,OAAO,oCAAoC,sBAC7C,CAAC;CAGF,OACE,oBAAC,QAAD;EAAM,eAAa;EAAQ,WAAW;YACpC,oBAAC,iBAAD;GAAW,WAAW,OAAO;aAC3B,qBAAC,qBAAD;IAAa,YAAY;cAAzB,CACE,oBAAC,QAAD;KAAM,WAAW;eAAgC;KAAiB,CAAA,EACjE,cAAc,oBAAC,QAAD;KAAM,WAAW;eAAiC;KAAkB,CAAA,CACvE;;GACJ,CAAA;EACP,CAAA;;;;AC5DX,IAAA,4BAAe"}
1
+ {"version":3,"file":"ElementHeaderText.js","names":[],"sources":["../src/components/ElementHeader/ElementHeaderText/ElementHeaderText.tsx","../src/components/ElementHeader/ElementHeaderText/index.ts"],"sourcesContent":["import cn from 'classnames';\n\nimport type { TitleTags } from '../../Title';\n\nimport Highlighter from '../../Highlighter';\nimport styles from '../styles.module.scss';\n\nexport type ElementHeaderTextType = typeof ElementHeaderText;\n\nexport interface ElementHeaderTextProps {\n /** The first text in the ElementHeaderText Component */\n firstText: string;\n /** Will style the first text as bold */\n firstTextEmphasised?: boolean;\n /** The second text in the ElementHeaderText Component */\n secondText?: string;\n /** Will style the second text as bold */\n secondTextEmphasised?: boolean;\n /** Whether or not this ElementHeaderText is a sub text */\n subText?: boolean;\n /** Adds custom classes to the ElementHeaderText component. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Changes the underlying element of the text. Default: span*/\n titleHtmlMarkup?: TitleTags;\n /** Highlights text. Used for search results */\n highlightText?: string;\n}\n\nexport const ElementHeaderText: React.FC<ElementHeaderTextProps> = props => {\n const {\n firstText,\n firstTextEmphasised = false,\n secondText = undefined,\n secondTextEmphasised = false,\n subText = false,\n className = '',\n testId,\n titleHtmlMarkup = 'span',\n highlightText,\n } = props;\n\n const headerTextWrapperClasses = cn(className, styles['text-wrapper'], {\n [styles['text-wrapper--sub-level']]: subText,\n });\n const firstHeaderTextSegmentClasses = cn({\n [styles['text-wrapper__text--emphasised']]: firstTextEmphasised,\n });\n const secondHeaderTextSegmentClasses = cn({\n [styles['text-wrapper__text--emphasised']]: secondTextEmphasised,\n });\n const CustomTag = titleHtmlMarkup;\n\n return (\n <span data-testid={testId} className={headerTextWrapperClasses}>\n <CustomTag className={styles['element-header__title']}>\n <Highlighter searchText={highlightText}>\n <span className={firstHeaderTextSegmentClasses}>{firstText}</span>\n {secondText && <span className={secondHeaderTextSegmentClasses}>{secondText}</span>}\n </Highlighter>\n </CustomTag>\n </span>\n );\n};\n\nexport default ElementHeaderText;\n","import ElementHeaderText from './ElementHeaderText';\nexport * from './ElementHeaderText';\nexport default ElementHeaderText;\n"],"mappings":";;;;;AA8BA,IAAa,qBAAsD,UAAS;CAC1E,MAAM,EACJ,WACA,sBAAsB,OACtB,aAAa,KAAA,GACb,uBAAuB,OACvB,UAAU,OACV,YAAY,IACZ,QACA,kBAAkB,QAClB,kBACE;CAEJ,MAAM,2BAA2B,WAAG,WAAW,OAAO,iBAAiB,GACpE,OAAO,6BAA6B,QACvC,CAAC;CACD,MAAM,gCAAgC,WAAG,GACtC,OAAO,oCAAoC,oBAC9C,CAAC;CACD,MAAM,iCAAiC,WAAG,GACvC,OAAO,oCAAoC,qBAC9C,CAAC;CAGD,OACE,oBAAC,QAAD;EAAM,eAAa;EAAQ,WAAW;YACpC,oBAAC,iBAAD;GAAW,WAAW,OAAO;aAC3B,qBAAC,qBAAD;IAAa,YAAY;cAAzB,CACE,oBAAC,QAAD;KAAM,WAAW;eAAgC;IAAgB,CAAA,GAChE,cAAc,oBAAC,QAAD;KAAM,WAAW;eAAiC;IAAiB,CAAA,CACvE;;EACJ,CAAA;CACP,CAAA;AAEV;;;AC9DA,IAAA,4BAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","names":[],"sources":["../src/components/LazyIcon/ErrorBoundary.tsx"],"sourcesContent":["import React from 'react';\n\ninterface ErrorBoundaryProps<T> {\n fallback: React.ReactNode;\n children: React.ReactNode;\n reset: T;\n}\n\ninterface ErrorBoundaryState {\n error: boolean;\n}\n\nclass ErrorBoundary<T> extends React.Component<ErrorBoundaryProps<T>, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryProps<T>) {\n super(props);\n this.state = {\n error: false,\n };\n }\n\n componentDidCatch(): void {\n this.setState({ error: true });\n }\n\n componentDidUpdate(prevProps: Readonly<ErrorBoundaryProps<T>>): void {\n if (prevProps.reset !== this.props.reset) {\n this.setState({ error: false });\n }\n }\n\n render(): React.ReactNode {\n return this.state.error ? this.props.fallback : this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,gBAAN,cAA+B,MAAM,UAAqD;CACxF,YAAY,OAA8B;EACxC,MAAM,MAAM;EACZ,KAAK,QAAQ,EACX,OAAO,OACR;;CAGH,oBAA0B;EACxB,KAAK,SAAS,EAAE,OAAO,MAAM,CAAC;;CAGhC,mBAAmB,WAAkD;EACnE,IAAI,UAAU,UAAU,KAAK,MAAM,OACjC,KAAK,SAAS,EAAE,OAAO,OAAO,CAAC;;CAInC,SAA0B;EACxB,OAAO,KAAK,MAAM,QAAQ,KAAK,MAAM,WAAW,KAAK,MAAM"}
1
+ {"version":3,"file":"ErrorBoundary.js","names":[],"sources":["../src/components/LazyIcon/ErrorBoundary.tsx"],"sourcesContent":["import React from 'react';\n\ninterface ErrorBoundaryProps<T> {\n fallback: React.ReactNode;\n children: React.ReactNode;\n reset: T;\n}\n\ninterface ErrorBoundaryState {\n error: boolean;\n}\n\nclass ErrorBoundary<T> extends React.Component<ErrorBoundaryProps<T>, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryProps<T>) {\n super(props);\n this.state = {\n error: false,\n };\n }\n\n componentDidCatch(): void {\n this.setState({ error: true });\n }\n\n componentDidUpdate(prevProps: Readonly<ErrorBoundaryProps<T>>): void {\n if (prevProps.reset !== this.props.reset) {\n this.setState({ error: false });\n }\n }\n\n render(): React.ReactNode {\n return this.state.error ? this.props.fallback : this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,gBAAN,cAA+B,MAAM,UAAqD;CACxF,YAAY,OAA8B;EACxC,MAAM,KAAK;EACX,KAAK,QAAQ,EACX,OAAO,MACT;CACF;CAEA,oBAA0B;EACxB,KAAK,SAAS,EAAE,OAAO,KAAK,CAAC;CAC/B;CAEA,mBAAmB,WAAkD;EACnE,IAAI,UAAU,UAAU,KAAK,MAAM,OACjC,KAAK,SAAS,EAAE,OAAO,MAAM,CAAC;CAElC;CAEA,SAA0B;EACxB,OAAO,KAAK,MAAM,QAAQ,KAAK,MAAM,WAAW,KAAK,MAAM;CAC7D;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorWrapper.js","names":[],"sources":["../src/components/ErrorWrapper/ErrorWrapper.tsx","../src/components/ErrorWrapper/index.ts"],"sourcesContent":["import cn from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface ErrorWrapperClassNameProps {\n errorWrapperClassName?: string;\n}\n\nexport interface ErrorWrapperProps {\n /** Form component */\n children?: React.ReactNode;\n /** Error message */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds a ref to the error message p tag */\n errorMessageRef?: React.Ref<HTMLDivElement>;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const ErrorWrapper: React.FC<ErrorWrapperProps> = props => {\n const { renderError = true } = props;\n\n const errorWrapperClasses = cn(props.errorText && renderError && styles[`error-wrapper--with-error`], props.className);\n\n return (\n <div className={errorWrapperClasses} data-testid={props.testId}>\n <span ref={props.errorMessageRef} tabIndex={-1}>\n {props.errorText && (\n <p className={styles['error-wrapper__errors']} id={props.errorTextId}>\n {props.errorText}\n </p>\n )}\n </span>\n {props.children}\n </div>\n );\n};\n\nexport default ErrorWrapper;\n","import ErrorWrapper from './ErrorWrapper';\nexport * from './ErrorWrapper';\nexport default ErrorWrapper;\n"],"mappings":";;;;AAyBA,IAAa,gBAA4C,UAAS;CAChE,MAAM,EAAE,cAAc,SAAS;CAI/B,OACE,qBAAC,OAAD;EAAK,WAHqB,WAAG,MAAM,aAAa,eAAe,OAAO,8BAA8B,MAAM,UAG1F;EAAqB,eAAa,MAAM;YAAxD,CACE,oBAAC,QAAD;GAAM,KAAK,MAAM;GAAiB,UAAU;aACzC,MAAM,aACL,oBAAC,KAAD;IAAG,WAAW,OAAO;IAA0B,IAAI,MAAM;cACtD,MAAM;IACL,CAAA;GAED,CAAA,EACN,MAAM,SACH;;;;;ACtCV,IAAA,uBAAe"}
1
+ {"version":3,"file":"ErrorWrapper.js","names":[],"sources":["../src/components/ErrorWrapper/ErrorWrapper.tsx","../src/components/ErrorWrapper/index.ts"],"sourcesContent":["import cn from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface ErrorWrapperClassNameProps {\n errorWrapperClassName?: string;\n}\n\nexport interface ErrorWrapperProps {\n /** Form component */\n children?: React.ReactNode;\n /** Error message */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds a ref to the error message p tag */\n errorMessageRef?: React.Ref<HTMLDivElement>;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const ErrorWrapper: React.FC<ErrorWrapperProps> = props => {\n const { renderError = true } = props;\n\n const errorWrapperClasses = cn(props.errorText && renderError && styles[`error-wrapper--with-error`], props.className);\n\n return (\n <div className={errorWrapperClasses} data-testid={props.testId}>\n <span ref={props.errorMessageRef} tabIndex={-1}>\n {props.errorText && (\n <p className={styles['error-wrapper__errors']} id={props.errorTextId}>\n {props.errorText}\n </p>\n )}\n </span>\n {props.children}\n </div>\n );\n};\n\nexport default ErrorWrapper;\n","import ErrorWrapper from './ErrorWrapper';\nexport * from './ErrorWrapper';\nexport default ErrorWrapper;\n"],"mappings":";;;;AAyBA,IAAa,gBAA4C,UAAS;CAChE,MAAM,EAAE,cAAc,SAAS;CAI/B,OACE,qBAAC,OAAD;EAAK,WAHqB,WAAG,MAAM,aAAa,eAAe,OAAO,8BAA8B,MAAM,SAG1F;EAAqB,eAAa,MAAM;YAAxD,CACE,oBAAC,QAAD;GAAM,KAAK,MAAM;GAAiB,UAAU;aACzC,MAAM,aACL,oBAAC,KAAD;IAAG,WAAW,OAAO;IAA0B,IAAI,MAAM;cACtD,MAAM;GACN,CAAA;EAED,CAAA,GACL,MAAM,QACJ;;AAET;;;ACxCA,IAAA,uBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"Expander.js","names":[],"sources":["../src/components/Expander/constants.ts","../src/components/Expander/Expander.tsx","../src/components/Expander/index.ts"],"sourcesContent":["export enum ExpanderSize {\n small = 'small',\n large = 'large',\n}\n","import { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { PaletteNames } from '../../theme/palette';\nimport type { SvgIcon } from '../Icon';\nimport type { IconName } from '../Icons/IconNames';\n\nimport { ExpanderSize } from './constants';\nimport { AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useSize } from '../../hooks/useSize';\nimport Button from '../Button';\nimport Icon, { IconSize } from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport type ExpanderColors = Extract<PaletteNames, 'banana' | 'blueberry' | 'cherry' | 'kiwi' | 'neutral' | 'plum' | 'white'>;\n\nexport interface ExpanderProps {\n buttonId?: string;\n /** Sets the trigger title */\n title: string;\n /** Sets the expanded content */\n children?: React.ReactNode;\n /** Sets classnames on the content area */\n contentClassNames?: string;\n /** Sets the size of the expander. Default: ExpanderSize.small */\n size?: ExpanderSize;\n /** Sets the background of the expander. Requires size=ExpanderSize.large. */\n color?: ExpanderColors;\n /** Adds an icon to the expander trigger. Requires size=ExpanderSize.large. */\n svgIcon?: SvgIcon | IconName;\n /** Opens or closes the expander */\n expanded?: boolean;\n /** Removes border to the left of the content. Requires size=ExpanderSize.small. */\n noNestedLine?: boolean;\n /** Stick expander trigger to top of screen while scrolling down */\n sticky?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Whether to render children when closed (in which case they are hidden with CSS). Default: false */\n renderChildrenWhenClosed?: boolean;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n /** Overrides the default z-index of the expander header */\n zIndex?: number;\n}\n\nconst Expander: React.FC<ExpanderProps> = props => {\n const {\n buttonId,\n title,\n children,\n size = ExpanderSize.small,\n color,\n contentClassNames,\n svgIcon: icon,\n expanded = false,\n noNestedLine = false,\n sticky = false,\n testId,\n onExpand,\n renderChildrenWhenClosed = false,\n zIndex,\n } = props;\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const expanderRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const { isHovered } = usePseudoClasses(triggerRef);\n const contentSize = useSize(expanderRef);\n const triggerSize = useSize(triggerRef);\n\n const isSticky = sticky && isExpanded;\n\n const renderChevron = (align: 'left' | 'right'): React.ReactNode => (\n <span className={classNames(styles['expander__icon'], styles[`expander__icon--${align}`])}>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} isHovered={isHovered} />\n </span>\n );\n\n const triggerClassName = classNames(\n styles['expander__trigger'],\n size === ExpanderSize.large && styles[`expander__trigger--${size}`],\n size === ExpanderSize.large && styles[`expander__trigger--${color || 'neutral'}`],\n size === ExpanderSize.large && icon && styles['expander__trigger--icon'],\n isExpanded && styles['expander__trigger--expanded'],\n isSticky && styles['expander__trigger--sticky']\n );\n\n const renderTrigger = (): React.ReactNode => (\n <button\n id={buttonId}\n type=\"button\"\n className={triggerClassName}\n style={{\n zIndex: isHovered || isSticky ? zIndex : undefined,\n width: isSticky && contentSize?.width ? `${contentSize.width}px` : undefined,\n }}\n aria-expanded={isExpanded}\n ref={triggerRef}\n onClick={(): void => setIsExpanded(!isExpanded)}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Expander}\n >\n {size === ExpanderSize.small && renderChevron('left')}\n {icon && (\n <span className={classNames(styles['expander__icon'], styles['expander__icon--left'])}>\n {typeof icon === 'string' ? (\n <LazyIcon iconName={icon} size={IconSize.XSmall} isHovered={isHovered} />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} isHovered={isHovered} />\n )}\n </span>\n )}\n {title}\n {size === ExpanderSize.large && renderChevron('right')}\n </button>\n );\n\n const buttonClassName = classNames(styles['expander__button'], isExpanded && styles['expander__button--expanded']);\n\n const renderButton = (): React.ReactNode => (\n <div\n style={{\n width: isSticky && triggerSize?.width ? `${triggerSize?.width}px` : undefined,\n height: isSticky && triggerSize?.height ? `${triggerSize?.height}px` : undefined,\n }}\n className={classNames({\n [styles['expander__button-container--sticky']]: isSticky,\n })}\n >\n <Button\n id={buttonId}\n variant=\"borderless\"\n textClassName={styles['expander__button__text']}\n className={buttonClassName}\n aria-expanded={isExpanded}\n ref={triggerRef}\n onClick={(): void => setIsExpanded(!isExpanded)}\n testId={testId}\n data-analyticsid={AnalyticsId.Expander}\n >\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} />\n {title}\n </Button>\n </div>\n );\n\n const renderContent = (): React.ReactNode => {\n if (!renderChildrenWhenClosed && !isExpanded) {\n return null;\n }\n\n const contentClassName = classNames(\n styles['expander__content'],\n styles[`expander__content--${size}`],\n size === ExpanderSize.large && styles[`expander__content--${color || 'neutral'}`],\n size === ExpanderSize.large && icon && styles['expander__content--icon'],\n isExpanded && styles['expander__content--expanded'],\n size === ExpanderSize.small && !noNestedLine && styles['expander__content--nested-line--inner'],\n { [styles['expander__content--sticky']]: isSticky },\n contentClassNames\n );\n const leftBorderClassName = classNames(size === ExpanderSize.small && !noNestedLine && styles['expander__content--nested-line--outer']);\n\n return (\n <div className={leftBorderClassName}>\n <div className={contentClassName}>{children}</div>\n </div>\n );\n };\n\n return (\n <div className={styles['expander']} ref={expanderRef}>\n {size === ExpanderSize.large ? renderTrigger() : renderButton()}\n {renderContent()}\n </div>\n );\n};\n\nexport default Expander;\n","import Expander from './Expander';\nexport { ExpanderSize } from './constants';\nexport * from './Expander';\nexport default Expander;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,WAAQ;CACR,aAAA,WAAQ;;KACT;;;ACkDD,IAAM,YAAoC,UAAS;CACjD,MAAM,EACJ,UACA,OACA,UACA,OAAO,aAAa,OACpB,OACA,mBACA,SAAS,MACT,WAAW,OACX,eAAe,OACf,SAAS,OACT,QACA,UACA,2BAA2B,OAC3B,WACE;CACJ,MAAM,CAAC,YAAY,iBAAiB,UAAU,UAAU,SAAS;CACjE,MAAM,cAAc,OAAuB,KAAK;CAChD,MAAM,aAAa,OAA0B,KAAK;CA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aAAa,QAAQ,GAAG,aAAa,MAAM,MAAM,KAAA;GACpE,QAAQ,YAAY,aAAa,SAAS,GAAG,aAAa,OAAO,MAAM,KAAA;GACxE;EACD,WAAW,WAAW,GACnB,OAAO,wCAAwC,UACjD,CAAC;YAEF,qBAAC,gBAAD;GACE,IAAI;GACJ,SAAQ;GACR,eAAe,OAAO;GACtB,WAAW;GACX,iBAAe;GACf,KAAK;GACL,eAAqB,cAAc,CAAC,WAAW;GACvC;GACR,oBAAkB,YAAY;aAThC,CAWE,oBAAC,cAAD;IAAM,SAAS,aAAa,YAAY;IAAa,MAAM,SAAS;IAAU,CAAA,EAC7E,MACM;;EACL,CAAA;CAGR,MAAM,sBAAuC;EAC3C,IAAI,CAAC,4BAA4B,CAAC,YAChC,OAAO;EAGT,MAAM,mBAAmB,WACvB,OAAO,sBACP,OAAO,sBAAsB,SAC7B,SAAS,aAAa,SAAS,OAAO,sBAAsB,SAAS,cACrE,SAAS,aAAa,SAAS,QAAQ,OAAO,4BAC9C,cAAc,OAAO,gCACrB,SAAS,aAAa,SAAS,CAAC,gBAAgB,OAAO,0CACvD,GAAG,OAAO,+BAA+B,UAAU,EACnD,kBACD;EAGD,OACE,oBAAC,OAAD;GAAK,WAHqB,WAAW,SAAS,aAAa,SAAS,CAAC,gBAAgB,OAAO,yCAG5E;aACd,oBAAC,OAAD;IAAK,WAAW;IAAmB;IAAe,CAAA;GAC9C,CAAA;;CAIV,OACE,qBAAC,OAAD;EAAK,WAAW,OAAO;EAAa,KAAK;YAAzC,CACG,SAAS,aAAa,QAAQ,eAAe,GAAG,cAAc,EAC9D,eAAe,CACZ;;;;;AClLV,IAAA,mBAAe"}
1
+ {"version":3,"file":"Expander.js","names":[],"sources":["../src/components/Expander/constants.ts","../src/components/Expander/Expander.tsx","../src/components/Expander/index.ts"],"sourcesContent":["export enum ExpanderSize {\n small = 'small',\n large = 'large',\n}\n","import { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { PaletteNames } from '../../theme/palette';\nimport type { SvgIcon } from '../Icon';\nimport type { IconName } from '../Icons/IconNames';\n\nimport { ExpanderSize } from './constants';\nimport { AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useSize } from '../../hooks/useSize';\nimport Button from '../Button';\nimport Icon, { IconSize } from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport type ExpanderColors = Extract<PaletteNames, 'banana' | 'blueberry' | 'cherry' | 'kiwi' | 'neutral' | 'plum' | 'white'>;\n\nexport interface ExpanderProps {\n buttonId?: string;\n /** Sets the trigger title */\n title: string;\n /** Sets the expanded content */\n children?: React.ReactNode;\n /** Sets classnames on the content area */\n contentClassNames?: string;\n /** Sets the size of the expander. Default: ExpanderSize.small */\n size?: ExpanderSize;\n /** Sets the background of the expander. Requires size=ExpanderSize.large. */\n color?: ExpanderColors;\n /** Adds an icon to the expander trigger. Requires size=ExpanderSize.large. */\n svgIcon?: SvgIcon | IconName;\n /** Opens or closes the expander */\n expanded?: boolean;\n /** Removes border to the left of the content. Requires size=ExpanderSize.small. */\n noNestedLine?: boolean;\n /** Stick expander trigger to top of screen while scrolling down */\n sticky?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Whether to render children when closed (in which case they are hidden with CSS). Default: false */\n renderChildrenWhenClosed?: boolean;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n /** Overrides the default z-index of the expander header */\n zIndex?: number;\n}\n\nconst Expander: React.FC<ExpanderProps> = props => {\n const {\n buttonId,\n title,\n children,\n size = ExpanderSize.small,\n color,\n contentClassNames,\n svgIcon: icon,\n expanded = false,\n noNestedLine = false,\n sticky = false,\n testId,\n onExpand,\n renderChildrenWhenClosed = false,\n zIndex,\n } = props;\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const expanderRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const { isHovered } = usePseudoClasses(triggerRef);\n const contentSize = useSize(expanderRef);\n const triggerSize = useSize(triggerRef);\n\n const isSticky = sticky && isExpanded;\n\n const renderChevron = (align: 'left' | 'right'): React.ReactNode => (\n <span className={classNames(styles['expander__icon'], styles[`expander__icon--${align}`])}>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} isHovered={isHovered} />\n </span>\n );\n\n const triggerClassName = classNames(\n styles['expander__trigger'],\n size === ExpanderSize.large && styles[`expander__trigger--${size}`],\n size === ExpanderSize.large && styles[`expander__trigger--${color || 'neutral'}`],\n size === ExpanderSize.large && icon && styles['expander__trigger--icon'],\n isExpanded && styles['expander__trigger--expanded'],\n isSticky && styles['expander__trigger--sticky']\n );\n\n const renderTrigger = (): React.ReactNode => (\n <button\n id={buttonId}\n type=\"button\"\n className={triggerClassName}\n style={{\n zIndex: isHovered || isSticky ? zIndex : undefined,\n width: isSticky && contentSize?.width ? `${contentSize.width}px` : undefined,\n }}\n aria-expanded={isExpanded}\n ref={triggerRef}\n onClick={(): void => setIsExpanded(!isExpanded)}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Expander}\n >\n {size === ExpanderSize.small && renderChevron('left')}\n {icon && (\n <span className={classNames(styles['expander__icon'], styles['expander__icon--left'])}>\n {typeof icon === 'string' ? (\n <LazyIcon iconName={icon} size={IconSize.XSmall} isHovered={isHovered} />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} isHovered={isHovered} />\n )}\n </span>\n )}\n {title}\n {size === ExpanderSize.large && renderChevron('right')}\n </button>\n );\n\n const buttonClassName = classNames(styles['expander__button'], isExpanded && styles['expander__button--expanded']);\n\n const renderButton = (): React.ReactNode => (\n <div\n style={{\n width: isSticky && triggerSize?.width ? `${triggerSize?.width}px` : undefined,\n height: isSticky && triggerSize?.height ? `${triggerSize?.height}px` : undefined,\n }}\n className={classNames({\n [styles['expander__button-container--sticky']]: isSticky,\n })}\n >\n <Button\n id={buttonId}\n variant=\"borderless\"\n textClassName={styles['expander__button__text']}\n className={buttonClassName}\n aria-expanded={isExpanded}\n ref={triggerRef}\n onClick={(): void => setIsExpanded(!isExpanded)}\n testId={testId}\n data-analyticsid={AnalyticsId.Expander}\n >\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} />\n {title}\n </Button>\n </div>\n );\n\n const renderContent = (): React.ReactNode => {\n if (!renderChildrenWhenClosed && !isExpanded) {\n return null;\n }\n\n const contentClassName = classNames(\n styles['expander__content'],\n styles[`expander__content--${size}`],\n size === ExpanderSize.large && styles[`expander__content--${color || 'neutral'}`],\n size === ExpanderSize.large && icon && styles['expander__content--icon'],\n isExpanded && styles['expander__content--expanded'],\n size === ExpanderSize.small && !noNestedLine && styles['expander__content--nested-line--inner'],\n { [styles['expander__content--sticky']]: isSticky },\n contentClassNames\n );\n const leftBorderClassName = classNames(size === ExpanderSize.small && !noNestedLine && styles['expander__content--nested-line--outer']);\n\n return (\n <div className={leftBorderClassName}>\n <div className={contentClassName}>{children}</div>\n </div>\n );\n };\n\n return (\n <div className={styles['expander']} ref={expanderRef}>\n {size === ExpanderSize.large ? renderTrigger() : renderButton()}\n {renderContent()}\n </div>\n );\n};\n\nexport default Expander;\n","import Expander from './Expander';\nexport { ExpanderSize } from './constants';\nexport * from './Expander';\nexport default Expander;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,WAAA;CACA,aAAA,WAAA;;AACF,EAAA,CAAA,CAAA;;;ACkDA,IAAM,YAAoC,UAAS;CACjD,MAAM,EACJ,UACA,OACA,UACA,OAAO,aAAa,OACpB,OACA,mBACA,SAAS,MACT,WAAW,OACX,eAAe,OACf,SAAS,OACT,QACA,UACA,2BAA2B,OAC3B,WACE;CACJ,MAAM,CAAC,YAAY,iBAAiB,UAAU,UAAU,QAAQ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6BAA6B;CAEjH,MAAM,qBACJ,oBAAC,OAAD;EACE,OAAO;GACL,OAAO,YAAY,aAAa,QAAQ,GAAG,aAAa,MAAM,MAAM,KAAA;GACpE,QAAQ,YAAY,aAAa,SAAS,GAAG,aAAa,OAAO,MAAM,KAAA;EACzE;EACA,WAAW,WAAW,GACnB,OAAO,wCAAwC,SAClD,CAAC;YAED,qBAAC,gBAAD;GACE,IAAI;GACJ,SAAQ;GACR,eAAe,OAAO;GACtB,WAAW;GACX,iBAAe;GACf,KAAK;GACL,eAAqB,cAAc,CAAC,UAAU;GACtC;GACR,oBAAkB,YAAY;aAThC,CAWE,oBAAC,cAAD;IAAM,SAAS,aAAa,YAAY;IAAa,MAAM,SAAS;GAAS,CAAA,GAC5E,KACK;;CACL,CAAA;CAGP,MAAM,sBAAuC;EAC3C,IAAI,CAAC,4BAA4B,CAAC,YAChC,OAAO;EAGT,MAAM,mBAAmB,WACvB,OAAO,sBACP,OAAO,sBAAsB,SAC7B,SAAS,aAAa,SAAS,OAAO,sBAAsB,SAAS,cACrE,SAAS,aAAa,SAAS,QAAQ,OAAO,4BAC9C,cAAc,OAAO,gCACrB,SAAS,aAAa,SAAS,CAAC,gBAAgB,OAAO,0CACvD,GAAG,OAAO,+BAA+B,SAAS,GAClD,iBACF;EAGA,OACE,oBAAC,OAAD;GAAK,WAHqB,WAAW,SAAS,aAAa,SAAS,CAAC,gBAAgB,OAAO,wCAG5E;aACd,oBAAC,OAAD;IAAK,WAAW;IAAmB;GAAc,CAAA;EAC9C,CAAA;CAET;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW,OAAO;EAAa,KAAK;YAAzC,CACG,SAAS,aAAa,QAAQ,cAAc,IAAI,aAAa,GAC7D,cAAc,CACZ;;AAET;;;ACpLA,IAAA,mBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterButton.js","names":[],"sources":["../src/components/Filter/FilterButton/FilterButton.tsx","../src/components/Filter/FilterButton/index.ts"],"sourcesContent":["import { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { HNDesignsystemFilter } from '../../../resources/Resources';\n\nimport { IconSize, LanguageLocales } from '../../../constants';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport { usePseudoClasses } from '../../../hooks/usePseudoClasses';\nimport Icon from '../../Icon';\nimport Filter from '../../Icons/Filter';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFilter>;\n}\n\nconst FilterButton: React.FC<FilterButtonProps> = props => {\n const { resources } = props;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources = {\n ...defaultResources,\n ...resources,\n };\n\n const buttonRef = useRef<HTMLButtonElement>(null);\n const { isHovered } = usePseudoClasses(buttonRef);\n\n return (\n <button {...props} className={styles['filter-button']} ref={buttonRef}>\n <span\n className={classNames(styles['filter-button__inner'], {\n [styles['filter-button__inner--hovered']]: isHovered,\n })}\n >\n <Icon svgIcon={Filter} isHovered={isHovered} size={IconSize.XSmall} />\n <span className={styles['filter-button__text']}>{mergedResources.filterButtonText}</span>\n </span>\n </button>\n );\n};\n\nexport default FilterButton;\n","import FilterButton from './FilterButton';\nexport * from './FilterButton';\nexport default FilterButton;\n"],"mappings":";;;;;;;;;;;AAoBA,IAAM,gBAA4C,UAAS;CACzD,MAAM,EAAE,cAAc;CAEtB,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAG5E,MAAM,kBAAkB;EACtB,GAHuB,aAAa,SAGjC;EACH,GAAG;EACJ;CAED,MAAM,YAAY,OAA0B,KAAK;CACjD,MAAM,EAAE,cAAc,iBAAiB,UAAU;CAEjD,OACE,oBAAC,UAAD;EAAQ,GAAI;EAAO,WAAW,OAAO;EAAkB,KAAK;YAC1D,qBAAC,QAAD;GACE,WAAW,WAAW,OAAO,yBAAyB,GACnD,OAAO,mCAAmC,WAC5C,CAAC;aAHJ,CAKE,oBAAC,cAAD;IAAM,SAAS;IAAmB;IAAW,MAAM,SAAS;IAAU,CAAA,EACtE,oBAAC,QAAD;IAAM,WAAW,OAAO;cAAyB,gBAAgB;IAAwB,CAAA,CACpF;;EACA,CAAA;;;;AC1Cb,IAAA,uBAAe"}
1
+ {"version":3,"file":"FilterButton.js","names":[],"sources":["../src/components/Filter/FilterButton/FilterButton.tsx","../src/components/Filter/FilterButton/index.ts"],"sourcesContent":["import { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { HNDesignsystemFilter } from '../../../resources/Resources';\n\nimport { IconSize, LanguageLocales } from '../../../constants';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport { usePseudoClasses } from '../../../hooks/usePseudoClasses';\nimport Icon from '../../Icon';\nimport Filter from '../../Icons/Filter';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFilter>;\n}\n\nconst FilterButton: React.FC<FilterButtonProps> = props => {\n const { resources } = props;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources = {\n ...defaultResources,\n ...resources,\n };\n\n const buttonRef = useRef<HTMLButtonElement>(null);\n const { isHovered } = usePseudoClasses(buttonRef);\n\n return (\n <button {...props} className={styles['filter-button']} ref={buttonRef}>\n <span\n className={classNames(styles['filter-button__inner'], {\n [styles['filter-button__inner--hovered']]: isHovered,\n })}\n >\n <Icon svgIcon={Filter} isHovered={isHovered} size={IconSize.XSmall} />\n <span className={styles['filter-button__text']}>{mergedResources.filterButtonText}</span>\n </span>\n </button>\n );\n};\n\nexport default FilterButton;\n","import FilterButton from './FilterButton';\nexport * from './FilterButton';\nexport default FilterButton;\n"],"mappings":";;;;;;;;;;;AAoBA,IAAM,gBAA4C,UAAS;CACzD,MAAM,EAAE,cAAc;CAEtB,MAAM,EAAE,aAAa,YAA6B,gBAAgB,SAAS;CAG3E,MAAM,kBAAkB;EACtB,GAHuB,aAAa,QAGjC;EACH,GAAG;CACL;CAEA,MAAM,YAAY,OAA0B,IAAI;CAChD,MAAM,EAAE,cAAc,iBAAiB,SAAS;CAEhD,OACE,oBAAC,UAAD;EAAQ,GAAI;EAAO,WAAW,OAAO;EAAkB,KAAK;YAC1D,qBAAC,QAAD;GACE,WAAW,WAAW,OAAO,yBAAyB,GACnD,OAAO,mCAAmC,UAC7C,CAAC;aAHH,CAKE,oBAAC,cAAD;IAAM,SAAS;IAAmB;IAAW,MAAM,SAAS;GAAS,CAAA,GACrE,oBAAC,QAAD;IAAM,WAAW,OAAO;cAAyB,gBAAgB;GAAuB,CAAA,CACpF;;CACA,CAAA;AAEZ;;;AC5CA,IAAA,uBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterButtonAndChipsWrapper.js","names":[],"sources":["../src/components/Filter/FilterButtonAndChipsWrapper/FilterButtonAndChipsWrapper.tsx","../src/components/Filter/FilterButtonAndChipsWrapper/index.ts"],"sourcesContent":["import type React from 'react';\n\nimport classNames from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterButtonAndChipsWrapperProps {\n /** FilterButton content area */\n filterButtonComponent: React.ReactNode;\n /** Content area for rendering filter chips */\n filterChips: React.ReactNode[];\n /** test id that is placed on the wrapper */\n testId?: string;\n}\n\nconst FilterButtonAndChipsWrapper: React.FC<FilterButtonAndChipsWrapperProps> = ({ filterButtonComponent, filterChips, testId }) => {\n return (\n <div className={classNames(styles['filter-chip-bar'])} data-testid={testId}>\n {filterButtonComponent}\n {filterChips}\n </div>\n );\n};\n\nexport default FilterButtonAndChipsWrapper;\n","import FilterButtonAndChipsWrapper from './FilterButtonAndChipsWrapper';\nexport * from './FilterButtonAndChipsWrapper';\nexport default FilterButtonAndChipsWrapper;\n"],"mappings":";;;;AAeA,IAAM,+BAA2E,EAAE,uBAAuB,aAAa,aAAa;CAClI,OACE,qBAAC,OAAD;EAAK,WAAW,WAAW,OAAO,mBAAmB;EAAE,eAAa;YAApE,CACG,uBACA,YACG;;;;;AClBV,IAAA,sCAAe"}
1
+ {"version":3,"file":"FilterButtonAndChipsWrapper.js","names":[],"sources":["../src/components/Filter/FilterButtonAndChipsWrapper/FilterButtonAndChipsWrapper.tsx","../src/components/Filter/FilterButtonAndChipsWrapper/index.ts"],"sourcesContent":["import type React from 'react';\n\nimport classNames from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterButtonAndChipsWrapperProps {\n /** FilterButton content area */\n filterButtonComponent: React.ReactNode;\n /** Content area for rendering filter chips */\n filterChips: React.ReactNode[];\n /** test id that is placed on the wrapper */\n testId?: string;\n}\n\nconst FilterButtonAndChipsWrapper: React.FC<FilterButtonAndChipsWrapperProps> = ({ filterButtonComponent, filterChips, testId }) => {\n return (\n <div className={classNames(styles['filter-chip-bar'])} data-testid={testId}>\n {filterButtonComponent}\n {filterChips}\n </div>\n );\n};\n\nexport default FilterButtonAndChipsWrapper;\n","import FilterButtonAndChipsWrapper from './FilterButtonAndChipsWrapper';\nexport * from './FilterButtonAndChipsWrapper';\nexport default FilterButtonAndChipsWrapper;\n"],"mappings":";;;;AAeA,IAAM,+BAA2E,EAAE,uBAAuB,aAAa,aAAa;CAClI,OACE,qBAAC,OAAD;EAAK,WAAW,WAAW,OAAO,kBAAkB;EAAG,eAAa;YAApE,CACG,uBACA,WACE;;AAET;;;ACpBA,IAAA,sCAAe"}
@@ -4,6 +4,7 @@ import { t as Button_default } from "./Button.js";
4
4
  import { formatResource } from "./utils/resource.js";
5
5
  import { t as DrawerNavigation } from "./DrawerNavigation.js";
6
6
  import { t as getResources } from "./resourceHelper.js";
7
+ import { t as LoaderSpinner } from "./LoaderSpinner.js";
7
8
  import { Children, isValidElement } from "react";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  import styles from "./components/Filter/FilterDrawer/styles.module.scss";
@@ -21,7 +22,7 @@ function FilterDrawerOverview(_props) {
21
22
  function FilterDrawerView(_props) {
22
23
  return null;
23
24
  }
24
- function FilterDrawer({ drawer, onClose, footer, onReset, resultCount, resources, children }) {
25
+ function FilterDrawer({ drawer, onClose, footer, isLoading, onReset, resultCount, resources, children }) {
25
26
  const { language } = useLanguage(LanguageLocales.NORWEGIAN);
26
27
  const mergedResources = {
27
28
  ...getResources(language),
@@ -31,33 +32,42 @@ function FilterDrawer({ drawer, onClose, footer, onReset, resultCount, resources
31
32
  if (onClose) onClose();
32
33
  else drawer.close();
33
34
  };
34
- const showResultButtonText = resultCount !== void 0 ? formatResource(mergedResources.showButtonText, resultCount) : mergedResources.showButtonText;
35
35
  const defaultResetButton = onReset && /* @__PURE__ */ jsx(Button_default, {
36
36
  onClick: onReset,
37
37
  variant: "borderless",
38
38
  children: mergedResources.resetButtonText
39
39
  });
40
- const defaultShowResultsButton = showResultButtonText && /* @__PURE__ */ jsx(Button_default, {
40
+ const defaultShowResultsButton = /* @__PURE__ */ jsx(Button_default, {
41
41
  onClick: handleClose,
42
- children: showResultButtonText
42
+ children: mergedResources.showButtonText
43
43
  });
44
- const defaultFooter = onReset || showResultButtonText ? /* @__PURE__ */ jsxs("div", {
44
+ const resultText = resultCount !== void 0 ? /* @__PURE__ */ jsx("span", { children: formatResource(mergedResources.resultsText, resultCount) }) : void 0;
45
+ const resultContent = isLoading ? /* @__PURE__ */ jsx(LoaderSpinner, { resources: mergedResources }) : resultText;
46
+ const defaultFooterRight = (resultContent || defaultShowResultsButton) && /* @__PURE__ */ jsxs("div", {
47
+ className: styles["filter-drawer__footer__right"],
48
+ children: [resultContent, defaultShowResultsButton]
49
+ });
50
+ const defaultFooter = onReset || resultContent ? /* @__PURE__ */ jsxs("div", {
45
51
  className: styles["filter-drawer__footer"],
46
- children: [defaultResetButton, defaultShowResultsButton]
52
+ children: [defaultResetButton, defaultFooterRight]
47
53
  }) : void 0;
48
54
  const fallbackFooter = footer ?? defaultFooter;
49
55
  const generateViewFooter = (viewOnReset, viewOnClose, noResetButton) => {
50
56
  if (!viewOnReset && !viewOnClose && !noResetButton) return;
57
+ const viewShowButton = viewOnClose ? /* @__PURE__ */ jsx(Button_default, {
58
+ onClick: viewOnClose,
59
+ children: mergedResources.showButtonText
60
+ }) : defaultShowResultsButton;
51
61
  return /* @__PURE__ */ jsxs("div", {
52
62
  className: styles["filter-drawer__footer"],
53
63
  children: [!noResetButton && (viewOnReset ? /* @__PURE__ */ jsx(Button_default, {
54
64
  onClick: viewOnReset,
55
65
  variant: "borderless",
56
66
  children: mergedResources.resetButtonText
57
- }) : defaultResetButton), viewOnClose ? /* @__PURE__ */ jsx(Button_default, {
58
- onClick: viewOnClose,
59
- children: showResultButtonText ?? mergedResources.showButtonText
60
- }) : defaultShowResultsButton]
67
+ }) : defaultResetButton), (resultContent || viewShowButton) && /* @__PURE__ */ jsxs("div", {
68
+ className: styles["filter-drawer__footer__right"],
69
+ children: [resultContent, viewShowButton]
70
+ })]
61
71
  });
62
72
  };
63
73
  const processedChildren = Children.map(children, (child) => {
@@ -1 +1 @@
1
- {"version":3,"file":"FilterDrawer.js","names":[],"sources":["../src/components/Filter/FilterDrawer/FilterDrawer.tsx","../src/components/Filter/FilterDrawer/index.ts"],"sourcesContent":["import { Children, isValidElement } from 'react';\n\nimport type { HNDesignsystemFilter } from '../../../resources/Resources';\nimport type { UseFilterDrawerReturn } from '../useFilterDrawer';\n\nimport { LanguageLocales } from '../../../constants';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport { formatResource } from '../../../utils/resource';\nimport Button from '../../Button';\nimport DrawerNavigation, { type DrawerViewProps } from '../DrawerNavigation/DrawerNavigation';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterDrawerProps<ViewId extends string = string> {\n /** The drawer state from useFilterDrawer */\n drawer: UseFilterDrawerReturn<ViewId>;\n /** Additional callback when the drawer closes (drawer.close() is always called automatically) */\n onClose?: () => void;\n /** Fully custom footer — overrides the default footer built from onReset/resultText */\n footer?: React.ReactNode;\n /** If provided, shows a \"Nullstill filter\" button in the default footer */\n onReset?: () => void;\n /** If provided, shows a result count button (e.g. \"Vis 5 treff\") that closes the drawer */\n resultCount?: number;\n /** Resources for the component */\n resources?: Partial<HNDesignsystemFilter>;\n /** DrawerNavigation.View children defining the overview and filter views */\n children: React.ReactNode;\n}\n\nexport interface FilterDrawerViewProps extends DrawerViewProps {\n /** Hide reset button for view */\n noResetButton?: boolean;\n /** View specific close handler */\n onClose?: () => void;\n /** View specific reset handler */\n onReset?: () => void;\n}\n\n/**\n * Never rendered directly — FilterDrawer reads its props and creates a DrawerNavigation.View\n * with id=\"overview\" and home=true.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction FilterDrawerOverview(_props: Omit<DrawerViewProps, 'id' | 'home'>): React.ReactNode {\n return null;\n}\n\n/**\n * Never rendered directly — FilterDrawer reads its props and creates a FilterDrawerView\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction FilterDrawerView(_props: FilterDrawerViewProps): React.ReactNode {\n // DrawerView is never rendered directly — DrawerNavigation reads its props\n return null;\n}\n\nfunction FilterDrawer<ViewId extends string>({\n drawer,\n onClose,\n footer,\n onReset,\n resultCount,\n resources,\n children,\n}: FilterDrawerProps<ViewId>): React.ReactNode {\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n const mergedResources = {\n ...defaultResources,\n ...resources,\n };\n\n const handleClose = (): void => {\n if (onClose) {\n onClose();\n } else {\n drawer.close();\n }\n };\n\n const showResultButtonText =\n resultCount !== undefined ? formatResource(mergedResources.showButtonText, resultCount) : mergedResources.showButtonText;\n\n const defaultResetButton = onReset && (\n <Button onClick={onReset} variant=\"borderless\">\n {mergedResources.resetButtonText}\n </Button>\n );\n const defaultShowResultsButton = showResultButtonText && <Button onClick={handleClose}>{showResultButtonText}</Button>;\n\n const defaultFooter =\n onReset || showResultButtonText ? (\n <div className={styles['filter-drawer__footer']}>\n {defaultResetButton}\n {defaultShowResultsButton}\n </div>\n ) : undefined;\n\n const fallbackFooter = footer ?? defaultFooter;\n\n const generateViewFooter = (viewOnReset?: () => void, viewOnClose?: () => void, noResetButton?: boolean): React.ReactNode => {\n if (!viewOnReset && !viewOnClose && !noResetButton) {\n return undefined;\n }\n\n return (\n <div className={styles['filter-drawer__footer']}>\n {!noResetButton &&\n (viewOnReset ? (\n <Button onClick={viewOnReset} variant=\"borderless\">\n {mergedResources.resetButtonText}\n </Button>\n ) : (\n defaultResetButton\n ))}\n {viewOnClose ? (\n <Button onClick={viewOnClose}>{showResultButtonText ?? mergedResources.showButtonText}</Button>\n ) : (\n defaultShowResultsButton\n )}\n </div>\n );\n };\n\n const processedChildren = Children.map(children, child => {\n if (isValidElement<Omit<FilterDrawerViewProps, 'id' | 'home'>>(child) && child.type === FilterDrawerOverview) {\n const viewDefaultFooter = generateViewFooter(child.props.onReset, child.props.onClose, child.props.noResetButton);\n const viewFooter = viewDefaultFooter ?? child.props.footer ?? fallbackFooter;\n return (\n <DrawerNavigation.View\n id=\"overview\"\n home\n title={child.props.title}\n children={child.props.children}\n drawerContentClassname={styles['filter-drawer__view']}\n footer={viewFooter}\n />\n );\n }\n if (isValidElement<FilterDrawerViewProps>(child)) {\n const viewDefaultFooter = generateViewFooter(child.props.onReset, child.props.onClose, child.props.noResetButton);\n const viewFooter = viewDefaultFooter ?? child.props.footer ?? fallbackFooter;\n return (\n <DrawerNavigation.View\n id={child.props.id}\n title={child.props.title}\n children={child.props.children}\n drawerContentClassname={styles['filter-drawer__view']}\n footer={viewFooter}\n />\n );\n } else {\n return child;\n }\n });\n\n return (\n <DrawerNavigation isOpen={drawer.isOpen} initialView={drawer.initialView} onCloseButton={handleClose} footer={footer ?? defaultFooter}>\n {processedChildren}\n </DrawerNavigation>\n );\n}\n\nFilterDrawer.Overview = FilterDrawerOverview;\nFilterDrawer.View = FilterDrawerView;\n\nexport default FilterDrawer;\n","import FilterDrawer from './FilterDrawer';\nexport * from './FilterDrawer';\nexport default FilterDrawer;\n"],"mappings":";;;;;;;;;;;;;;AA6CA,SAAS,qBAAqB,QAA+D;CAC3F,OAAO;;;;;AAOT,SAAS,iBAAiB,QAAgD;CAExE,OAAO;;AAGT,SAAS,aAAoC,EAC3C,QACA,SACA,QACA,SACA,aACA,WACA,YAC6C;CAC7C,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAE5E,MAAM,kBAAkB;EACtB,GAFuB,aAAa,SAEjC;EACH,GAAG;EACJ;CAED,MAAM,oBAA0B;EAC9B,IAAI,SACF,SAAS;OAET,OAAO,OAAO;;CAIlB,MAAM,uBACJ,gBAAgB,KAAA,IAAY,eAAe,gBAAgB,gBAAgB,YAAY,GAAG,gBAAgB;CAE5G,MAAM,qBAAqB,WACzB,oBAAC,gBAAD;EAAQ,SAAS;EAAS,SAAQ;YAC/B,gBAAgB;EACV,CAAA;CAEX,MAAM,2BAA2B,wBAAwB,oBAAC,gBAAD;EAAQ,SAAS;YAAc;EAA8B,CAAA;CAEtH,MAAM,gBACJ,WAAW,uBACT,qBAAC,OAAD;EAAK,WAAW,OAAO;YAAvB,CACG,oBACA,yBACG;MACJ,KAAA;CAEN,MAAM,iBAAiB,UAAU;CAEjC,MAAM,sBAAsB,aAA0B,aAA0B,kBAA6C;EAC3H,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,eACnC;EAGF,OACE,qBAAC,OAAD;GAAK,WAAW,OAAO;aAAvB,CACG,CAAC,kBACC,cACC,oBAAC,gBAAD;IAAQ,SAAS;IAAa,SAAQ;cACnC,gBAAgB;IACV,CAAA,GAET,qBAEH,cACC,oBAAC,gBAAD;IAAQ,SAAS;cAAc,wBAAwB,gBAAgB;IAAwB,CAAA,GAE/F,yBAEE;;;CAIV,MAAM,oBAAoB,SAAS,IAAI,WAAU,UAAS;EACxD,IAAI,eAA2D,MAAM,IAAI,MAAM,SAAS,sBAAsB;GAE5G,MAAM,aADoB,mBAAmB,MAAM,MAAM,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM,cAChF,IAAqB,MAAM,MAAM,UAAU;GAC9D,OACE,oBAAC,iBAAiB,MAAlB;IACE,IAAG;IACH,MAAA;IACA,OAAO,MAAM,MAAM;IACnB,UAAU,MAAM,MAAM;IACtB,wBAAwB,OAAO;IAC/B,QAAQ;IACR,CAAA;;EAGN,IAAI,eAAsC,MAAM,EAAE;GAEhD,MAAM,aADoB,mBAAmB,MAAM,MAAM,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM,cAChF,IAAqB,MAAM,MAAM,UAAU;GAC9D,OACE,oBAAC,iBAAiB,MAAlB;IACE,IAAI,MAAM,MAAM;IAChB,OAAO,MAAM,MAAM;IACnB,UAAU,MAAM,MAAM;IACtB,wBAAwB,OAAO;IAC/B,QAAQ;IACR,CAAA;SAGJ,OAAO;GAET;CAEF,OACE,oBAAC,kBAAD;EAAkB,QAAQ,OAAO;EAAQ,aAAa,OAAO;EAAa,eAAe;EAAa,QAAQ,UAAU;YACrH;EACgB,CAAA;;AAIvB,aAAa,WAAW;AACxB,aAAa,OAAO;;;ACpKpB,IAAA,uBAAe"}
1
+ {"version":3,"file":"FilterDrawer.js","names":[],"sources":["../src/components/Filter/FilterDrawer/FilterDrawer.tsx","../src/components/Filter/FilterDrawer/index.ts"],"sourcesContent":["import { Children, isValidElement } from 'react';\n\nimport type { HNDesignsystemFilter } from '../../../resources/Resources';\nimport type { UseFilterDrawerReturn } from '../useFilterDrawer';\n\nimport { LanguageLocales } from '../../../constants';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport { formatResource } from '../../../utils/resource';\nimport Button from '../../Button';\nimport DrawerNavigation, { type DrawerViewProps } from '../DrawerNavigation/DrawerNavigation';\nimport LoaderSpinner from '../LoaderSpinner/LoaderSpinner';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterDrawerProps<ViewId extends string = string> {\n /** The drawer state from useFilterDrawer */\n drawer: UseFilterDrawerReturn<ViewId>;\n /** Additional callback when the drawer closes (drawer.close() is always called automatically) */\n onClose?: () => void;\n /** Fully custom footer — overrides the default footer built from onReset/resultText */\n footer?: React.ReactNode;\n /** Shows LoaderSpinner in the footer when turned on */\n isLoading?: boolean;\n /** If provided, shows a \"Nullstill filter\" button in the default footer */\n onReset?: () => void;\n /** If provided, shows a result count in the footer */\n resultCount?: number;\n /** Resources for the component */\n resources?: Partial<HNDesignsystemFilter>;\n /** DrawerNavigation.View children defining the overview and filter views */\n children: React.ReactNode;\n}\n\nexport interface FilterDrawerViewProps extends DrawerViewProps {\n /** Hide reset button for view */\n noResetButton?: boolean;\n /** View specific close handler */\n onClose?: () => void;\n /** View specific reset handler */\n onReset?: () => void;\n}\n\n/**\n * Never rendered directly — FilterDrawer reads its props and creates a DrawerNavigation.View\n * with id=\"overview\" and home=true.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction FilterDrawerOverview(_props: Omit<DrawerViewProps, 'id' | 'home'>): React.ReactNode {\n return null;\n}\n\n/**\n * Never rendered directly — FilterDrawer reads its props and creates a FilterDrawerView\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction FilterDrawerView(_props: FilterDrawerViewProps): React.ReactNode {\n // DrawerView is never rendered directly — DrawerNavigation reads its props\n return null;\n}\n\nfunction FilterDrawer<ViewId extends string>({\n drawer,\n onClose,\n footer,\n isLoading,\n onReset,\n resultCount,\n resources,\n children,\n}: FilterDrawerProps<ViewId>): React.ReactNode {\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n const mergedResources = {\n ...defaultResources,\n ...resources,\n };\n\n const handleClose = (): void => {\n if (onClose) {\n onClose();\n } else {\n drawer.close();\n }\n };\n\n const defaultResetButton = onReset && (\n <Button onClick={onReset} variant=\"borderless\">\n {mergedResources.resetButtonText}\n </Button>\n );\n const defaultShowResultsButton = <Button onClick={handleClose}>{mergedResources.showButtonText}</Button>;\n\n const resultText = resultCount !== undefined ? <span>{formatResource(mergedResources.resultsText, resultCount)}</span> : undefined;\n const resultContent = isLoading ? <LoaderSpinner resources={mergedResources} /> : resultText;\n\n const defaultFooterRight = (resultContent || defaultShowResultsButton) && (\n <div className={styles['filter-drawer__footer__right']}>\n {resultContent}\n {defaultShowResultsButton}\n </div>\n );\n\n const defaultFooter =\n onReset || resultContent ? (\n <div className={styles['filter-drawer__footer']}>\n {defaultResetButton}\n {defaultFooterRight}\n </div>\n ) : undefined;\n\n const fallbackFooter = footer ?? defaultFooter;\n\n const generateViewFooter = (viewOnReset?: () => void, viewOnClose?: () => void, noResetButton?: boolean): React.ReactNode => {\n if (!viewOnReset && !viewOnClose && !noResetButton) {\n return undefined;\n }\n\n const viewShowButton = viewOnClose ? <Button onClick={viewOnClose}>{mergedResources.showButtonText}</Button> : defaultShowResultsButton;\n\n return (\n <div className={styles['filter-drawer__footer']}>\n {!noResetButton &&\n (viewOnReset ? (\n <Button onClick={viewOnReset} variant=\"borderless\">\n {mergedResources.resetButtonText}\n </Button>\n ) : (\n defaultResetButton\n ))}\n {(resultContent || viewShowButton) && (\n <div className={styles['filter-drawer__footer__right']}>\n {resultContent}\n {viewShowButton}\n </div>\n )}\n </div>\n );\n };\n\n const processedChildren = Children.map(children, child => {\n if (isValidElement<Omit<FilterDrawerViewProps, 'id' | 'home'>>(child) && child.type === FilterDrawerOverview) {\n const viewDefaultFooter = generateViewFooter(child.props.onReset, child.props.onClose, child.props.noResetButton);\n const viewFooter = viewDefaultFooter ?? child.props.footer ?? fallbackFooter;\n return (\n <DrawerNavigation.View\n id=\"overview\"\n home\n title={child.props.title}\n children={child.props.children}\n drawerContentClassname={styles['filter-drawer__view']}\n footer={viewFooter}\n />\n );\n }\n if (isValidElement<FilterDrawerViewProps>(child)) {\n const viewDefaultFooter = generateViewFooter(child.props.onReset, child.props.onClose, child.props.noResetButton);\n const viewFooter = viewDefaultFooter ?? child.props.footer ?? fallbackFooter;\n return (\n <DrawerNavigation.View\n id={child.props.id}\n title={child.props.title}\n children={child.props.children}\n drawerContentClassname={styles['filter-drawer__view']}\n footer={viewFooter}\n />\n );\n } else {\n return child;\n }\n });\n\n return (\n <DrawerNavigation isOpen={drawer.isOpen} initialView={drawer.initialView} onCloseButton={handleClose} footer={footer ?? defaultFooter}>\n {processedChildren}\n </DrawerNavigation>\n );\n}\n\nFilterDrawer.Overview = FilterDrawerOverview;\nFilterDrawer.View = FilterDrawerView;\n\nexport default FilterDrawer;\n","import FilterDrawer from './FilterDrawer';\nexport * from './FilterDrawer';\nexport default FilterDrawer;\n"],"mappings":";;;;;;;;;;;;;;;AAgDA,SAAS,qBAAqB,QAA+D;CAC3F,OAAO;AACT;;;;AAMA,SAAS,iBAAiB,QAAgD;CAExE,OAAO;AACT;AAEA,SAAS,aAAoC,EAC3C,QACA,SACA,QACA,WACA,SACA,aACA,WACA,YAC6C;CAC7C,MAAM,EAAE,aAAa,YAA6B,gBAAgB,SAAS;CAE3E,MAAM,kBAAkB;EACtB,GAFuB,aAAa,QAEjC;EACH,GAAG;CACL;CAEA,MAAM,oBAA0B;EAC9B,IAAI,SACF,QAAQ;OAER,OAAO,MAAM;CAEjB;CAEA,MAAM,qBAAqB,WACzB,oBAAC,gBAAD;EAAQ,SAAS;EAAS,SAAQ;YAC/B,gBAAgB;CACX,CAAA;CAEV,MAAM,2BAA2B,oBAAC,gBAAD;EAAQ,SAAS;YAAc,gBAAgB;CAAuB,CAAA;CAEvG,MAAM,aAAa,gBAAgB,KAAA,IAAY,oBAAC,QAAD,EAAA,UAAO,eAAe,gBAAgB,aAAa,WAAW,EAAQ,CAAA,IAAI,KAAA;CACzH,MAAM,gBAAgB,YAAY,oBAAC,eAAD,EAAe,WAAW,gBAAkB,CAAA,IAAI;CAElF,MAAM,sBAAsB,iBAAiB,6BAC3C,qBAAC,OAAD;EAAK,WAAW,OAAO;YAAvB,CACG,eACA,wBACE;;CAGP,MAAM,g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QAAQ,OAAO;EAAQ,aAAa,OAAO;EAAa,eAAe;EAAa,QAAQ,UAAU;YACrH;CACe,CAAA;AAEtB;AAEA,aAAa,WAAW;AACxB,aAAa,OAAO;;;AClLpB,IAAA,uBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterLinkList.js","names":[],"sources":["../src/components/Filter/FilterLinkList/FilterLinkList.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../../constants';\nimport { usePseudoClasses } from '../../../hooks/usePseudoClasses';\nimport Icon from '../../Icon';\nimport ChevronRight from '../../Icons/ChevronRight';\n\nimport styles from './FilterLinkList.module.scss';\n\nexport type LinkType = React.FC<LinkProps>;\n\nexport interface CompoundComponent extends React.FC<LinkListProps> {\n Link: LinkType;\n}\n\nexport interface LinkListProps {\n /** Items in the LinkList */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the ul element */\n ref?: React.Ref<HTMLUListElement | null>;\n}\n\ntype Modify<T, R> = Omit<T, keyof R> & R;\n\nexport type LinkProps = Modify<\n React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>,\n {\n /** If needed children will be content instead of title and chips. Use only in edge cases */\n children?: React.ReactNode;\n /** Title text on link element */\n title?: string;\n /** Texts rendered inside non-interactive chips on link element */\n chips?: string[];\n /** Custom classname for link element */\n className?: string;\n /** Ref for button */\n linkRef?: React.RefObject<HTMLButtonElement | null>;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the list item element */\n ref?: React.Ref<HTMLLIElement | null>;\n }\n>;\n\nexport const Link: LinkType = (props: LinkProps) => {\n const { children, title, chips, className = '', linkRef, testId, ref, ...restProps } = props;\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement | null>(linkRef);\n\n const liClasses = cn(styles['link-list__item']);\n const linkClasses = cn(styles['link-list__button'], className);\n\n return (\n <li className={liClasses} ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.Link}>\n <button className={linkClasses} ref={refObject as React.RefObject<HTMLButtonElement>} type=\"button\" {...restProps}>\n <div className={styles['link-list__button__content']}>\n {title ? (\n <>\n <span>{title}</span>\n {chips && chips.length > 0 && (\n <div className={styles['link-list__chip-list']}>\n {chips.map(chip => (\n <span className={styles['link-list__chip']} key={chip}>\n {chip}\n </span>\n ))}\n </div>\n )}\n </>\n ) : (\n <>{children}</>\n )}\n </div>\n <Icon svgIcon={ChevronRight} isHovered={isHovered} size={IconSize.XSmall} color={'var(--color-action-graphics-onlight)'} />\n </button>\n </li>\n );\n};\n\nconst LinkListComponent: React.FC<LinkListProps> = (props: LinkListProps) => {\n const { children, className = '', testId, ref } = props;\n\n const listClassNames = cn(styles['link-list'], className);\n\n return (\n <ul ref={ref} className={listClassNames} data-testid={testId} data-analyticsid={AnalyticsId.LinkList}>\n {React.Children.map(children, (child: React.ReactNode) => {\n if (React.isValidElement<LinkProps>(child) && child.type === Link) {\n return React.cloneElement(child);\n }\n })}\n </ul>\n );\n};\n\nexport const FilterLinkList = LinkListComponent as CompoundComponent;\n\nFilterLinkList.displayName = 'FilterLinkList';\nFilterLinkList.Link = Link;\nLink.displayName = 'FilterLinkList.Link';\n\nexport default FilterLinkList;\n"],"mappings":";;;;;;;;;AAkDA,IAAa,QAAkB,UAAqB;CAClD,MAAM,EAAE,UAAU,OAAO,OAAO,YAAY,IAAI,SAAS,QAAQ,KAAK,GAAG,cAAc;CACvF,MAAM,EAAE,WAAW,cAAc,iBAA2C,QAAQ;CAEpF,MAAM,YAAY,WAAG,OAAO,mBAAmB;CAC/C,MAAM,cAAc,WAAG,OAAO,sBAAsB,UAAU;CAE9D,OACE,oBAAC,MAAD;EAAI,WAAW;EAAgB;EAAK,eAAa;EAAQ,oBAAkB,YAAY;YACrF,qBAAC,UAAD;GAAQ,WAAW;GAAa,KAAK;GAAiD,MAAK;GAAS,GAAI;aAAxG,CACE,oBAAC,OAAD;IAAK,WAAW,OAAO;cACpB,QACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD,EAAA,UAAO,OAAa,CAAA,EACnB,SAAS,MAAM,SAAS,KACvB,oBAAC,OAAD;KAAK,WAAW,OAAO;eACpB,MAAM,KAAI,SACT,oBAAC,QAAD;MAAM,WAAW,OAAO;gBACrB;MACI,EAF0C,KAE1C,CACP;KACE,CAAA,CAEP,EAAA,CAAA,GAEH,oBAAA,UAAA,EAAG,UAAY,CAAA;IAEb,CAAA,EACN,oBAAC,cAAD;IAAM,SAAS;IAAyB;IAAW,MAAM,SAAS;IAAQ,OAAO;IAA0C,CAAA,CACpH;;EACN,CAAA;;AAIT,IAAM,qBAA8C,UAAyB;CAC3E,MAAM,EAAE,UAAU,YAAY,IAAI,QAAQ,QAAQ;CAIlD,OACE,oBAAC,MAAD;EAAS;EAAK,WAHO,WAAG,OAAO,cAAc,UAGpB;EAAgB,eAAa;EAAQ,oBAAkB,YAAY;YACzF,MAAM,SAAS,IAAI,WAAW,UAA2B;GACxD,IAAI,MAAM,eAA0B,MAAM,IAAI,MAAM,SAAS,MAC3D,OAAO,MAAM,aAAa,MAAM;IAElC;EACC,CAAA;;AAIT,IAAa,iBAAiB;AAE9B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,KAAK,cAAc"}
1
+ {"version":3,"file":"FilterLinkList.js","names":[],"sources":["../src/components/Filter/FilterLinkList/FilterLinkList.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../../constants';\nimport { usePseudoClasses } from '../../../hooks/usePseudoClasses';\nimport Icon from '../../Icon';\nimport ChevronRight from '../../Icons/ChevronRight';\n\nimport styles from './FilterLinkList.module.scss';\n\nexport type LinkType = React.FC<LinkProps>;\n\nexport interface CompoundComponent extends React.FC<LinkListProps> {\n Link: LinkType;\n}\n\nexport interface LinkListProps {\n /** Items in the LinkList */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the ul element */\n ref?: React.Ref<HTMLUListElement | null>;\n}\n\ntype Modify<T, R> = Omit<T, keyof R> & R;\n\nexport type LinkProps = Modify<\n React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>,\n {\n /** If needed children will be content instead of title and chips. Use only in edge cases */\n children?: React.ReactNode;\n /** Title text on link element */\n title?: string;\n /** Texts rendered inside non-interactive chips on link element */\n chips?: string[];\n /** Custom classname for link element */\n className?: string;\n /** Ref for button */\n linkRef?: React.RefObject<HTMLButtonElement | null>;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the list item element */\n ref?: React.Ref<HTMLLIElement | null>;\n }\n>;\n\nexport const Link: LinkType = (props: LinkProps) => {\n const { children, title, chips, className = '', linkRef, testId, ref, ...restProps } = props;\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement | null>(linkRef);\n\n const liClasses = cn(styles['link-list__item']);\n const linkClasses = cn(styles['link-list__button'], className);\n\n return (\n <li className={liClasses} ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.Link}>\n <button className={linkClasses} ref={refObject as React.RefObject<HTMLButtonElement>} type=\"button\" {...restProps}>\n <div className={styles['link-list__button__content']}>\n {title ? (\n <>\n <span>{title}</span>\n {chips && chips.length > 0 && (\n <div className={styles['link-list__chip-list']}>\n {chips.map(chip => (\n <span className={styles['link-list__chip']} key={chip}>\n {chip}\n </span>\n ))}\n </div>\n )}\n </>\n ) : (\n <>{children}</>\n )}\n </div>\n <Icon svgIcon={ChevronRight} isHovered={isHovered} size={IconSize.XSmall} color={'var(--color-action-graphics-onlight)'} />\n </button>\n </li>\n );\n};\n\nconst LinkListComponent: React.FC<LinkListProps> = (props: LinkListProps) => {\n const { children, className = '', testId, ref } = props;\n\n const listClassNames = cn(styles['link-list'], className);\n\n return (\n <ul ref={ref} className={listClassNames} data-testid={testId} data-analyticsid={AnalyticsId.LinkList}>\n {React.Children.map(children, (child: React.ReactNode) => {\n if (React.isValidElement<LinkProps>(child) && child.type === Link) {\n return React.cloneElement(child);\n }\n })}\n </ul>\n );\n};\n\nexport const FilterLinkList = LinkListComponent as CompoundComponent;\n\nFilterLinkList.displayName = 'FilterLinkList';\nFilterLinkList.Link = Link;\nLink.displayName = 'FilterLinkList.Link';\n\nexport default FilterLinkList;\n"],"mappings":";;;;;;;;;AAkDA,IAAa,QAAkB,UAAqB;CAClD,MAAM,EAAE,UAAU,OAAO,OAAO,YAAY,IAAI,SAAS,QAAQ,KAAK,GAAG,cAAc;CACvF,MAAM,EAAE,WAAW,cAAc,iBAA2C,OAAO;CAEnF,MAAM,YAAY,WAAG,OAAO,kBAAkB;CAC9C,MAAM,cAAc,WAAG,OAAO,sBAAsB,SAAS;CAE7D,OACE,oBAAC,MAAD;EAAI,WAAW;EAAgB;EAAK,eAAa;EAAQ,oBAAkB,YAAY;YACrF,qBAAC,UAAD;GAAQ,WAAW;GAAa,KAAK;GAAiD,MAAK;GAAS,GAAI;aAAxG,CACE,oBAAC,OAAD;IAAK,WAAW,OAAO;cACpB,QACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA,GAClB,SAAS,MAAM,SAAS,KACvB,oBAAC,OAAD;KAAK,WAAW,OAAO;eACpB,MAAM,KAAI,SACT,oBAAC,QAAD;MAAM,WAAW,OAAO;gBACrB;KACG,GAF2C,IAE3C,CACP;IACE,CAAA,CAEP,EAAA,CAAA,IAEF,oBAAA,UAAA,EAAG,SAAW,CAAA;GAEb,CAAA,GACL,oBAAC,cAAD;IAAM,SAAS;IAAyB;IAAW,MAAM,SAAS;IAAQ,OAAO;GAAyC,CAAA,CACpH;;CACN,CAAA;AAER;AAEA,IAAM,qBAA8C,UAAyB;CAC3E,MAAM,EAAE,UAAU,YAAY,IAAI,QAAQ,QAAQ;CAIlD,OACE,oBAAC,MAAD;EAAS;EAAK,WAHO,WAAG,OAAO,cAAc,SAGpB;EAAgB,eAAa;EAAQ,oBAAkB,YAAY;YACzF,MAAM,SAAS,IAAI,WAAW,UAA2B;GACxD,IAAI,MAAM,eAA0B,KAAK,KAAK,MAAM,SAAS,MAC3D,OAAO,MAAM,aAAa,KAAK;EAEnC,CAAC;CACC,CAAA;AAER;AAEA,IAAa,iBAAiB;AAE9B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,KAAK,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterOverviewLinkList.js","names":[],"sources":["../src/components/Filter/FilterOverviewLinkList/FilterOverviewLinkList.tsx","../src/components/Filter/FilterOverviewLinkList/index.ts"],"sourcesContent":["import type { FilterValues, UseFilterReturn } from '../useFilter';\n\nimport { useDrawerNavigation } from '../DrawerNavigation';\nimport FilterLinkList from '../FilterLinkList/FilterLinkList';\n\nexport interface FilterOverviewLink {\n /** The filter key to read values from */\n filterKey: string;\n /** Display title for the link */\n title: string;\n /** View ID to navigate to when clicked. Defaults to filterKey */\n viewId?: string;\n}\n\nexport interface FilterOverviewLinkListProps<T extends FilterValues> {\n /** The filter instance from useFilter */\n filter: UseFilterReturn<T>;\n /** Look up the display label for a filter key + value */\n getLabel: (key: keyof T, value: unknown) => string;\n /** Configuration for which filter keys to show as links */\n links: FilterOverviewLink[];\n}\n\nfunction FilterOverviewLinkList<T extends FilterValues>({ filter, getLabel, links }: FilterOverviewLinkListProps<T>): React.ReactNode {\n const { goToView } = useDrawerNavigation();\n\n return (\n <FilterLinkList>\n {links.map(({ filterKey, title, viewId }) => {\n const raw = filter.filters[filterKey as keyof T];\n\n let chips: string[];\n if (Array.isArray(raw)) {\n chips = raw.map(v => getLabel(filterKey as keyof T, v));\n } else if (raw !== undefined && raw !== null) {\n chips = [getLabel(filterKey as keyof T, raw)];\n } else {\n chips = [];\n }\n\n return <FilterLinkList.Link key={filterKey} title={title} chips={chips} onClick={() => goToView(viewId ?? filterKey)} />;\n })}\n </FilterLinkList>\n );\n}\n\nexport default FilterOverviewLinkList;\n","import FilterOverviewLinkList from './FilterOverviewLinkList';\nexport * from './FilterOverviewLinkList';\nexport default FilterOverviewLinkList;\n"],"mappings":";;;;AAuBA,SAAS,uBAA+C,EAAE,QAAQ,UAAU,SAA0D;CACpI,MAAM,EAAE,aAAa,qBAAqB;CAE1C,OACE,oBAAC,gBAAD,EAAA,UACG,MAAM,KAAK,EAAE,WAAW,OAAO,aAAa;EAC3C,MAAM,MAAM,OAAO,QAAQ;EAE3B,IAAI;EACJ,IAAI,MAAM,QAAQ,IAAI,EACpB,QAAQ,IAAI,KAAI,MAAK,SAAS,WAAsB,EAAE,CAAC;OAClD,IAAI,QAAQ,KAAA,KAAa,QAAQ,MACtC,QAAQ,CAAC,SAAS,WAAsB,IAAI,CAAC;OAE7C,QAAQ,EAAE;EAGZ,OAAO,oBAAC,eAAe,MAAhB;GAA4C;GAAc;GAAO,eAAe,SAAS,UAAU,UAAU;GAAI,EAAvF,UAAuF;GACxH,EACa,CAAA;;;;ACxCrB,IAAA,iCAAe"}
1
+ {"version":3,"file":"FilterOverviewLinkList.js","names":[],"sources":["../src/components/Filter/FilterOverviewLinkList/FilterOverviewLinkList.tsx","../src/components/Filter/FilterOverviewLinkList/index.ts"],"sourcesContent":["import type { FilterValues, UseFilterReturn } from '../useFilter';\n\nimport { useDrawerNavigation } from '../DrawerNavigation';\nimport FilterLinkList from '../FilterLinkList/FilterLinkList';\n\nexport interface FilterOverviewLink {\n /** The filter key to read values from */\n filterKey: string;\n /** Display title for the link */\n title: string;\n /** View ID to navigate to when clicked. Defaults to filterKey */\n viewId?: string;\n}\n\nexport interface FilterOverviewLinkListProps<T extends FilterValues> {\n /** The filter instance from useFilter */\n filter: UseFilterReturn<T>;\n /** Look up the display label for a filter key + value */\n getLabel: (key: keyof T, value: unknown) => string;\n /** Configuration for which filter keys to show as links */\n links: FilterOverviewLink[];\n}\n\nfunction FilterOverviewLinkList<T extends FilterValues>({ filter, getLabel, links }: FilterOverviewLinkListProps<T>): React.ReactNode {\n const { goToView } = useDrawerNavigation();\n\n return (\n <FilterLinkList>\n {links.map(({ filterKey, title, viewId }) => {\n const raw = filter.filters[filterKey as keyof T];\n\n let chips: string[];\n if (Array.isArray(raw)) {\n chips = raw.map(v => getLabel(filterKey as keyof T, v));\n } else if (raw !== undefined && raw !== null) {\n chips = [getLabel(filterKey as keyof T, raw)];\n } else {\n chips = [];\n }\n\n return <FilterLinkList.Link key={filterKey} title={title} chips={chips} onClick={() => goToView(viewId ?? filterKey)} />;\n })}\n </FilterLinkList>\n );\n}\n\nexport default FilterOverviewLinkList;\n","import FilterOverviewLinkList from './FilterOverviewLinkList';\nexport * from './FilterOverviewLinkList';\nexport default FilterOverviewLinkList;\n"],"mappings":";;;;AAuBA,SAAS,uBAA+C,EAAE,QAAQ,UAAU,SAA0D;CACpI,MAAM,EAAE,aAAa,oBAAoB;CAEzC,OACE,oBAAC,gBAAD,EAAA,UACG,MAAM,KAAK,EAAE,WAAW,OAAO,aAAa;EAC3C,MAAM,MAAM,OAAO,QAAQ;EAE3B,IAAI;EACJ,IAAI,MAAM,QAAQ,GAAG,GACnB,QAAQ,IAAI,KAAI,MAAK,SAAS,WAAsB,CAAC,CAAC;OACjD,IAAI,QAAQ,KAAA,KAAa,QAAQ,MACtC,QAAQ,CAAC,SAAS,WAAsB,GAAG,CAAC;OAE5C,QAAQ,CAAC;EAGX,OAAO,oBAAC,eAAe,MAAhB;GAA4C;GAAc;GAAO,eAAe,SAAS,UAAU,SAAS;EAAI,GAAtF,SAAsF;CACzH,CAAC,EACa,CAAA;AAEpB;;;AC1CA,IAAA,iCAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterOverviewSearch.js","names":[],"sources":["../src/components/Filter/FilterOverviewSearch/FilterOverviewSearch.tsx","../src/components/Filter/FilterOverviewSearch/index.ts"],"sourcesContent":["import cn from 'classnames';\n\nimport type { FilterSearchProps } from '../FilterSearch/FilterSearch';\n\nimport FilterSearch from '../FilterSearch/FilterSearch';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterOverviewSearchProps extends FilterSearchProps {\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst FilterOverviewSearch: React.FC<FilterOverviewSearchProps> = props => {\n const { wrapperClassName, testId, ...filterSearchProps } = props;\n\n return (\n <div className={cn(styles['filter-overview-search'], wrapperClassName)} data-testid={testId}>\n <FilterSearch {...filterSearchProps} />\n </div>\n );\n};\n\nexport default FilterOverviewSearch;\n","import FilterOverviewSearch from './FilterOverviewSearch';\nexport * from './FilterOverviewSearch';\nexport default FilterOverviewSearch;\n"],"mappings":";;;;;AAeA,IAAM,wBAA4D,UAAS;CACzE,MAAM,EAAE,kBAAkB,QAAQ,GAAG,sBAAsB;CAE3D,OACE,oBAAC,OAAD;EAAK,WAAW,WAAG,OAAO,2BAA2B,iBAAiB;EAAE,eAAa;YACnF,oBAAC,cAAD,EAAc,GAAI,mBAAqB,CAAA;EACnC,CAAA;;;;ACnBV,IAAA,+BAAe"}
1
+ {"version":3,"file":"FilterOverviewSearch.js","names":[],"sources":["../src/components/Filter/FilterOverviewSearch/FilterOverviewSearch.tsx","../src/components/Filter/FilterOverviewSearch/index.ts"],"sourcesContent":["import cn from 'classnames';\n\nimport type { FilterSearchProps } from '../FilterSearch/FilterSearch';\n\nimport FilterSearch from '../FilterSearch/FilterSearch';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterOverviewSearchProps extends FilterSearchProps {\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst FilterOverviewSearch: React.FC<FilterOverviewSearchProps> = props => {\n const { wrapperClassName, testId, ...filterSearchProps } = props;\n\n return (\n <div className={cn(styles['filter-overview-search'], wrapperClassName)} data-testid={testId}>\n <FilterSearch {...filterSearchProps} />\n </div>\n );\n};\n\nexport default FilterOverviewSearch;\n","import FilterOverviewSearch from './FilterOverviewSearch';\nexport * from './FilterOverviewSearch';\nexport default FilterOverviewSearch;\n"],"mappings":";;;;;AAeA,IAAM,wBAA4D,UAAS;CACzE,MAAM,EAAE,kBAAkB,QAAQ,GAAG,sBAAsB;CAE3D,OACE,oBAAC,OAAD;EAAK,WAAW,WAAG,OAAO,2BAA2B,gBAAgB;EAAG,eAAa;YACnF,oBAAC,cAAD,EAAc,GAAI,kBAAoB,CAAA;CACnC,CAAA;AAET;;;ACrBA,IAAA,+BAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterResultCountAndSortWrapper.js","names":[],"sources":["../src/components/Filter/FilterResultCountAndSortWrapper/FilterResultCountAndSortWrapper.tsx","../src/components/Filter/FilterResultCountAndSortWrapper/index.ts"],"sourcesContent":["import styles from './styles.module.scss';\n\nexport interface FilterResultCountAndSortWrapper {\n /** Result count content area */\n resultCount?: React.ReactNode;\n /** FilterSort content area */\n sortComponent?: React.ReactNode;\n}\n\nconst FilterResultCountAndSortWrapper: React.FC<FilterResultCountAndSortWrapper> = props => {\n const { resultCount, sortComponent } = props;\n\n return (\n <div className={styles['filter-result-count-and-sort-wrapper']}>\n <span className={styles['filter-result-count-and-sort-wrapper__count']}>{resultCount}</span>\n <span className={styles['filter-result-count-and-sort-wrapper__sort']}>{sortComponent}</span>\n </div>\n );\n};\n\nexport default FilterResultCountAndSortWrapper;\n","import FilterResultCountAndSortWrapper from './FilterResultCountAndSortWrapper';\nexport * from './FilterResultCountAndSortWrapper';\nexport default FilterResultCountAndSortWrapper;\n"],"mappings":";;;AASA,IAAM,mCAA6E,UAAS;CAC1F,MAAM,EAAE,aAAa,kBAAkB;CAEvC,OACE,qBAAC,OAAD;EAAK,WAAW,OAAO;YAAvB,CACE,oBAAC,QAAD;GAAM,WAAW,OAAO;aAAiD;GAAmB,CAAA,EAC5F,oBAAC,QAAD;GAAM,WAAW,OAAO;aAAgD;GAAqB,CAAA,CACzF;;;;;ACdV,IAAA,0CAAe"}
1
+ {"version":3,"file":"FilterResultCountAndSortWrapper.js","names":[],"sources":["../src/components/Filter/FilterResultCountAndSortWrapper/FilterResultCountAndSortWrapper.tsx","../src/components/Filter/FilterResultCountAndSortWrapper/index.ts"],"sourcesContent":["import styles from './styles.module.scss';\n\nexport interface FilterResultCountAndSortWrapper {\n /** Result count content area */\n resultCount?: React.ReactNode;\n /** FilterSort content area */\n sortComponent?: React.ReactNode;\n}\n\nconst FilterResultCountAndSortWrapper: React.FC<FilterResultCountAndSortWrapper> = props => {\n const { resultCount, sortComponent } = props;\n\n return (\n <div className={styles['filter-result-count-and-sort-wrapper']}>\n <span className={styles['filter-result-count-and-sort-wrapper__count']}>{resultCount}</span>\n <span className={styles['filter-result-count-and-sort-wrapper__sort']}>{sortComponent}</span>\n </div>\n );\n};\n\nexport default FilterResultCountAndSortWrapper;\n","import FilterResultCountAndSortWrapper from './FilterResultCountAndSortWrapper';\nexport * from './FilterResultCountAndSortWrapper';\nexport default FilterResultCountAndSortWrapper;\n"],"mappings":";;;AASA,IAAM,mCAA6E,UAAS;CAC1F,MAAM,EAAE,aAAa,kBAAkB;CAEvC,OACE,qBAAC,OAAD;EAAK,WAAW,OAAO;YAAvB,CACE,oBAAC,QAAD;GAAM,WAAW,OAAO;aAAiD;EAAkB,CAAA,GAC3F,oBAAC,QAAD;GAAM,WAAW,OAAO;aAAgD;EAAoB,CAAA,CACzF;;AAET;;;AChBA,IAAA,0CAAe"}