@helsenorge/designsystem-react 15.0.0-beta.1 → 15.1.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 (727) 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 +24 -19
  6. package/lib/Button.js.map +1 -1
  7. package/lib/CHANGELOG.md +46 -0
  8. package/lib/Checkbox.js +25 -48
  9. package/lib/Checkbox.js.map +1 -1
  10. package/lib/Checkbox2.js +69 -0
  11. package/lib/Checkbox2.js.map +1 -0
  12. package/lib/CheckboxMarker.js +64 -0
  13. package/lib/CheckboxMarker.js.map +1 -0
  14. package/lib/Chip.js.map +1 -1
  15. package/lib/Close.js.map +1 -1
  16. package/lib/DictionaryTrigger.js.map +1 -1
  17. package/lib/Drawer.js +46 -18
  18. package/lib/Drawer.js.map +1 -1
  19. package/lib/DrawerNavigation.js.map +1 -1
  20. package/lib/Duolist.js.map +1 -1
  21. package/lib/ElementHeader.js.map +1 -1
  22. package/lib/ElementHeaderText.js.map +1 -1
  23. package/lib/ErrorBoundary.js.map +1 -1
  24. package/lib/ErrorWrapper.js.map +1 -1
  25. package/lib/Expander.js.map +1 -1
  26. package/lib/FilterButton.js.map +1 -1
  27. package/lib/FilterButtonAndChipsWrapper.js.map +1 -1
  28. package/lib/FilterDrawer.js +20 -10
  29. package/lib/FilterDrawer.js.map +1 -1
  30. package/lib/FilterLinkList.js.map +1 -1
  31. package/lib/FilterOverviewLinkList.js.map +1 -1
  32. package/lib/FilterOverviewSearch.js.map +1 -1
  33. package/lib/FilterResultCountAndSortWrapper.js.map +1 -1
  34. package/lib/FilterSearch.js.map +1 -1
  35. package/lib/FilterSort.js.map +1 -1
  36. package/lib/FilterStateWrapper.js.map +1 -1
  37. package/lib/FormFieldTag.js.map +1 -1
  38. package/lib/FormGroup.js +5 -5
  39. package/lib/FormGroup.js.map +1 -1
  40. package/lib/FormLayout.js.map +1 -1
  41. package/lib/HelpDetails.js.map +1 -1
  42. package/lib/HelpTriggerIcon.js.map +1 -1
  43. package/lib/HelpTriggerStandalone.js.map +1 -1
  44. package/lib/HighlightPanel.js.map +1 -1
  45. package/lib/Highlighter.js.map +1 -1
  46. package/lib/HorizontalScroll.js.map +1 -1
  47. package/lib/Icon.js.map +1 -1
  48. package/lib/Illustration.js +1 -1
  49. package/lib/Illustration.js.map +1 -1
  50. package/lib/InfoTeaser.js.map +1 -1
  51. package/lib/Input.js.map +1 -1
  52. package/lib/LazyIcon.js +1 -1
  53. package/lib/LazyIcon.js.map +1 -1
  54. package/lib/LazyIllustration.js +6 -2
  55. package/lib/LazyIllustration.js.map +1 -1
  56. package/lib/LinkList.js.map +1 -1
  57. package/lib/List.js.map +1 -1
  58. package/lib/ListEditMode.js.map +1 -1
  59. package/lib/LoaderSpinner.js +61 -0
  60. package/lib/LoaderSpinner.js.map +1 -0
  61. package/lib/MaxCharacters.js.map +1 -1
  62. package/lib/NotificationBadge.js.map +1 -1
  63. package/lib/PanelTitle.js.map +1 -1
  64. package/lib/PopOver.js.map +1 -1
  65. package/lib/Radio.js +74 -0
  66. package/lib/Radio.js.map +1 -0
  67. package/lib/RadioButton.js +84 -0
  68. package/lib/RadioButton.js.map +1 -0
  69. package/lib/RadioMarker.js +35 -0
  70. package/lib/RadioMarker.js.map +1 -0
  71. package/lib/Select.js.map +1 -1
  72. package/lib/SingleSelectItem.js.map +1 -1
  73. package/lib/Slider.js.map +1 -1
  74. package/lib/Spacer.js.map +1 -1
  75. package/lib/StatusDot.js.map +1 -1
  76. package/lib/StatusDotList.js.map +1 -1
  77. package/lib/StepButtons.js.map +1 -1
  78. package/lib/TabList.js.map +1 -1
  79. package/lib/TabPanel.js.map +1 -1
  80. package/lib/TableBody.js +3 -3
  81. package/lib/TableBody.js.map +1 -1
  82. package/lib/TableCell.js +2 -2
  83. package/lib/TableCell.js.map +1 -1
  84. package/lib/TableExpandedRow.js +4 -4
  85. package/lib/TableExpandedRow.js.map +1 -1
  86. package/lib/TableExpanderCell.js +2 -2
  87. package/lib/TableExpanderCell.js.map +1 -1
  88. package/lib/TableHead.js +7 -7
  89. package/lib/TableHead.js.map +1 -1
  90. package/lib/TableHeadCell.js +5 -5
  91. package/lib/TableHeadCell.js.map +1 -1
  92. package/lib/TableRow.js +6 -6
  93. package/lib/TableRow.js.map +1 -1
  94. package/lib/Textarea.js.map +1 -1
  95. package/lib/Title.js.map +1 -1
  96. package/lib/Toast.js.map +1 -1
  97. package/lib/VisualCheckbox.js +79 -0
  98. package/lib/VisualCheckbox.js.map +1 -0
  99. package/lib/VisualRadio.js +64 -0
  100. package/lib/VisualRadio.js.map +1 -0
  101. package/lib/__mocks__/IntersectionObserver.js.map +1 -1
  102. package/lib/__mocks__/MutationObserver.js.map +1 -1
  103. package/lib/__mocks__/ResizeObserver.js.map +1 -1
  104. package/lib/__mocks__/matchMedia.js +3 -2
  105. package/lib/__mocks__/matchMedia.js.map +1 -1
  106. package/lib/__mocks__/useLayoutEvent.js.map +1 -1
  107. package/lib/__mocks__/useOutsideEvent.js.map +1 -1
  108. package/lib/__mocks__/usePseudoClasses.js.map +1 -1
  109. package/lib/__mocks__/useSize.js.map +1 -1
  110. package/lib/__mocks__/uuid.js.map +1 -1
  111. package/lib/components/ArticleTeaser/index.js.map +1 -1
  112. package/lib/components/Button/styles.module.scss +39 -16
  113. package/lib/components/Button/styles.module.scss.d.ts +3 -2
  114. package/lib/components/Checkbox/CheckboxMarker/CheckboxMarker.d.ts +20 -0
  115. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +309 -0
  116. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss.d.ts +25 -0
  117. package/lib/components/Checkbox/styles.module.scss +9 -269
  118. package/lib/components/Checkbox/styles.module.scss.d.ts +1 -17
  119. package/lib/components/Drawer/DrawerBackButton.d.ts +10 -0
  120. package/lib/components/Drawer/DrawerBackButton.module.scss +52 -0
  121. package/lib/components/Drawer/DrawerBackButton.module.scss.d.ts +10 -0
  122. package/lib/components/Drawer/styles.module.scss +0 -9
  123. package/lib/components/Dropdown/index.js.map +1 -1
  124. package/lib/components/DropdownOld/index.js.map +1 -1
  125. package/lib/components/EmptyState/index.js.map +1 -1
  126. package/lib/components/Expander/styles.module.scss.d.ts +3 -2
  127. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  128. package/lib/components/ExpanderList/index.js.map +1 -1
  129. package/lib/components/EyebrowHeader/index.js.map +1 -1
  130. package/lib/components/FavoriteButton/index.js.map +1 -1
  131. package/lib/components/Filter/FilterDrawer/FilterDrawer.d.ts +4 -2
  132. package/lib/components/Filter/FilterDrawer/styles.module.scss +7 -0
  133. package/lib/components/Filter/FilterDrawer/styles.module.scss.d.ts +1 -0
  134. package/lib/components/Filter/LoaderSpinner/LoaderSpinner.d.ts +9 -0
  135. package/lib/components/Filter/LoaderSpinner/index.d.ts +3 -0
  136. package/lib/components/Filter/LoaderSpinner/index.js +7 -0
  137. package/lib/components/Filter/LoaderSpinner/index.js.map +1 -0
  138. package/lib/components/Filter/LoaderSpinner/styles.module.scss +27 -0
  139. package/lib/components/Filter/LoaderSpinner/styles.module.scss.d.ts +11 -0
  140. package/lib/components/Filter/index.d.ts +2 -0
  141. package/lib/components/Filter/index.js +2 -1
  142. package/lib/components/Filter/index.js.map +1 -1
  143. package/lib/components/HelpBubble/index.js.map +1 -1
  144. package/lib/components/HelpDrawer/index.js.map +1 -1
  145. package/lib/components/HelpExpanderInline/index.js.map +1 -1
  146. package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
  147. package/lib/components/HelpPanel/index.js.map +1 -1
  148. package/lib/components/HelpTeaser/index.js.map +1 -1
  149. package/lib/components/HelpTooltip/index.js.map +1 -1
  150. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  151. package/lib/components/Icons/ActiveMonitoring.js.map +1 -1
  152. package/lib/components/Icons/AcupunctureBack.js.map +1 -1
  153. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  154. package/lib/components/Icons/AlarmClock.js.map +1 -1
  155. package/lib/components/Icons/AlertSignFill.js.map +1 -1
  156. package/lib/components/Icons/AlertSignStroke.js.map +1 -1
  157. package/lib/components/Icons/Amputation.js.map +1 -1
  158. package/lib/components/Icons/Anxiety.js.map +1 -1
  159. package/lib/components/Icons/Apple.js.map +1 -1
  160. package/lib/components/Icons/Archive.js.map +1 -1
  161. package/lib/components/Icons/ArmFlexing.js.map +1 -1
  162. package/lib/components/Icons/ArrowDown.js.map +1 -1
  163. package/lib/components/Icons/ArrowLeft.js.map +1 -1
  164. package/lib/components/Icons/ArrowRight.js.map +1 -1
  165. package/lib/components/Icons/ArrowUp.js.map +1 -1
  166. package/lib/components/Icons/ArrowUpRight.js.map +1 -1
  167. package/lib/components/Icons/Attachment.js.map +1 -1
  168. package/lib/components/Icons/Atv.js.map +1 -1
  169. package/lib/components/Icons/Avatar.js.map +1 -1
  170. package/lib/components/Icons/AwakePersonOnPillow.js.map +1 -1
  171. package/lib/components/Icons/Baby.js.map +1 -1
  172. package/lib/components/Icons/BandAid.js.map +1 -1
  173. package/lib/components/Icons/BeerAndPills.js.map +1 -1
  174. package/lib/components/Icons/Bell.js.map +1 -1
  175. package/lib/components/Icons/Bike.js.map +1 -1
  176. package/lib/components/Icons/BirthControl.js.map +1 -1
  177. package/lib/components/Icons/BirthdayCake.js.map +1 -1
  178. package/lib/components/Icons/Boat.js.map +1 -1
  179. package/lib/components/Icons/Body.js.map +1 -1
  180. package/lib/components/Icons/Braille.js.map +1 -1
  181. package/lib/components/Icons/Brain.js.map +1 -1
  182. package/lib/components/Icons/BreastReconstruction.js.map +1 -1
  183. package/lib/components/Icons/BreastRemoval.js.map +1 -1
  184. package/lib/components/Icons/Breasts.js.map +1 -1
  185. package/lib/components/Icons/BrokenHeart.js.map +1 -1
  186. package/lib/components/Icons/BrokenPuzzle.js.map +1 -1
  187. package/lib/components/Icons/Bus.js.map +1 -1
  188. package/lib/components/Icons/Calendar.js.map +1 -1
  189. package/lib/components/Icons/CalendarChange.js.map +1 -1
  190. package/lib/components/Icons/CalendarCheck.js.map +1 -1
  191. package/lib/components/Icons/CalendarEvent.js.map +1 -1
  192. package/lib/components/Icons/CalendarSave.js.map +1 -1
  193. package/lib/components/Icons/Cancer.js.map +1 -1
  194. package/lib/components/Icons/Candle.js.map +1 -1
  195. package/lib/components/Icons/Car.js.map +1 -1
  196. package/lib/components/Icons/Carton.js.map +1 -1
  197. package/lib/components/Icons/Change.js.map +1 -1
  198. package/lib/components/Icons/Check.js.map +1 -1
  199. package/lib/components/Icons/CheckFill.js.map +1 -1
  200. package/lib/components/Icons/CheckOutline.js.map +1 -1
  201. package/lib/components/Icons/Chest.js.map +1 -1
  202. package/lib/components/Icons/ChevronDown.js.map +1 -1
  203. package/lib/components/Icons/ChevronLeft.js.map +1 -1
  204. package/lib/components/Icons/ChevronRight.js.map +1 -1
  205. package/lib/components/Icons/ChevronUp.js.map +1 -1
  206. package/lib/components/Icons/ChevronsDown.js.map +1 -1
  207. package/lib/components/Icons/ChevronsUp.js.map +1 -1
  208. package/lib/components/Icons/ChildPlaying.js.map +1 -1
  209. package/lib/components/Icons/Cigarette.js.map +1 -1
  210. package/lib/components/Icons/Coins.js.map +1 -1
  211. package/lib/components/Icons/Contacts.js.map +1 -1
  212. package/lib/components/Icons/Copy.js.map +1 -1
  213. package/lib/components/Icons/CoronaCertificate.js.map +1 -1
  214. package/lib/components/Icons/Coronavirus.js.map +1 -1
  215. package/lib/components/Icons/Cough.js.map +1 -1
  216. package/lib/components/Icons/CreditCard.js.map +1 -1
  217. package/lib/components/Icons/CriticalHealthInfo.js.map +1 -1
  218. package/lib/components/Icons/Cross.js.map +1 -1
  219. package/lib/components/Icons/DataExchange.js.map +1 -1
  220. package/lib/components/Icons/DataReceived.js.map +1 -1
  221. package/lib/components/Icons/DataSent.js.map +1 -1
  222. package/lib/components/Icons/Depression.js.map +1 -1
  223. package/lib/components/Icons/DigestiveSystem.js.map +1 -1
  224. package/lib/components/Icons/Dizzy.js.map +1 -1
  225. package/lib/components/Icons/Documents.js.map +1 -1
  226. package/lib/components/Icons/Dog.js.map +1 -1
  227. package/lib/components/Icons/DonorCard.js.map +1 -1
  228. package/lib/components/Icons/DotAttachment.js.map +1 -1
  229. package/lib/components/Icons/DotCheckmark.js.map +1 -1
  230. package/lib/components/Icons/DotCircleArrows.js.map +1 -1
  231. package/lib/components/Icons/DotDot.js.map +1 -1
  232. package/lib/components/Icons/DotExclamationMark.js.map +1 -1
  233. package/lib/components/Icons/DotFill.js.map +1 -1
  234. package/lib/components/Icons/DotGroup.js.map +1 -1
  235. package/lib/components/Icons/DotHalfDisc.js.map +1 -1
  236. package/lib/components/Icons/DotInfo.js.map +1 -1
  237. package/lib/components/Icons/DotLogin.js.map +1 -1
  238. package/lib/components/Icons/DotLookingGlass.js.map +1 -1
  239. package/lib/components/Icons/DotNoAccess.js.map +1 -1
  240. package/lib/components/Icons/DotNoEye.js.map +1 -1
  241. package/lib/components/Icons/DotOutline.js.map +1 -1
  242. package/lib/components/Icons/DotPencil.js.map +1 -1
  243. package/lib/components/Icons/DotQuestionMark.js.map +1 -1
  244. package/lib/components/Icons/DotTriangle.js.map +1 -1
  245. package/lib/components/Icons/DotX.js.map +1 -1
  246. package/lib/components/Icons/Download.js.map +1 -1
  247. package/lib/components/Icons/Draft.js.map +1 -1
  248. package/lib/components/Icons/Drag.js.map +1 -1
  249. package/lib/components/Icons/EChat.js.map +1 -1
  250. package/lib/components/Icons/Ear.js.map +1 -1
  251. package/lib/components/Icons/EarDeaf.js.map +1 -1
  252. package/lib/components/Icons/EarHearingAid.js.map +1 -1
  253. package/lib/components/Icons/EarNoseThroat.js.map +1 -1
  254. package/lib/components/Icons/EarVolume.js.map +1 -1
  255. package/lib/components/Icons/Edit.js.map +1 -1
  256. package/lib/components/Icons/ElderlyPerson.js.map +1 -1
  257. package/lib/components/Icons/Embolization.js.map +1 -1
  258. package/lib/components/Icons/EmergencyCall.js.map +1 -1
  259. package/lib/components/Icons/EmoticonAnnoyed.js.map +1 -1
  260. package/lib/components/Icons/EmoticonDelighted.js.map +1 -1
  261. package/lib/components/Icons/EmoticonDisappointed.js.map +1 -1
  262. package/lib/components/Icons/EmoticonHappy.js.map +1 -1
  263. package/lib/components/Icons/EmoticonMeh.js.map +1 -1
  264. package/lib/components/Icons/EmptyBox.js.map +1 -1
  265. package/lib/components/Icons/EnterFullScreen.js.map +1 -1
  266. package/lib/components/Icons/Envelope.js.map +1 -1
  267. package/lib/components/Icons/Epilepsy.js.map +1 -1
  268. package/lib/components/Icons/Eraser.js.map +1 -1
  269. package/lib/components/Icons/ErrorSignFill.js.map +1 -1
  270. package/lib/components/Icons/ErrorSignStroke.js.map +1 -1
  271. package/lib/components/Icons/EuropeanHealthCard.js.map +1 -1
  272. package/lib/components/Icons/ExitFullScreen.js.map +1 -1
  273. package/lib/components/Icons/Eye.js.map +1 -1
  274. package/lib/components/Icons/Facebook.js.map +1 -1
  275. package/lib/components/Icons/FallingLeaf.js.map +1 -1
  276. package/lib/components/Icons/Feedback.js.map +1 -1
  277. package/lib/components/Icons/Female.js.map +1 -1
  278. package/lib/components/Icons/FemaleDoctor.js.map +1 -1
  279. package/lib/components/Icons/Ferry.js.map +1 -1
  280. package/lib/components/Icons/File.js.map +1 -1
  281. package/lib/components/Icons/Filter.js +12 -12
  282. package/lib/components/Icons/Filter.js.map +1 -1
  283. package/lib/components/Icons/FingerBleed.js.map +1 -1
  284. package/lib/components/Icons/FirstAidKit.js.map +1 -1
  285. package/lib/components/Icons/Fish.js.map +1 -1
  286. package/lib/components/Icons/FloppyDisk.js.map +1 -1
  287. package/lib/components/Icons/Football.js.map +1 -1
  288. package/lib/components/Icons/Form.js.map +1 -1
  289. package/lib/components/Icons/Forward.js.map +1 -1
  290. package/lib/components/Icons/Gallery.js.map +1 -1
  291. package/lib/components/Icons/Garden.js.map +1 -1
  292. package/lib/components/Icons/GasCan.js.map +1 -1
  293. package/lib/components/Icons/GenderIdentity.js.map +1 -1
  294. package/lib/components/Icons/GlassWater.js.map +1 -1
  295. package/lib/components/Icons/Glasses.js.map +1 -1
  296. package/lib/components/Icons/Globe.js.map +1 -1
  297. package/lib/components/Icons/Grain.js.map +1 -1
  298. package/lib/components/Icons/Graph.js.map +1 -1
  299. package/lib/components/Icons/Group.js.map +1 -1
  300. package/lib/components/Icons/GroupTwins.js.map +1 -1
  301. package/lib/components/Icons/HTMLFile.js.map +1 -1
  302. package/lib/components/Icons/HandWaving.js.map +1 -1
  303. package/lib/components/Icons/HandWithDisease.js.map +1 -1
  304. package/lib/components/Icons/HandsAndHeart.js.map +1 -1
  305. package/lib/components/Icons/HealthClinic.js.map +1 -1
  306. package/lib/components/Icons/HealthMeasurements.js.map +1 -1
  307. package/lib/components/Icons/HealthWarning.js.map +1 -1
  308. package/lib/components/Icons/HealthcarePerson.js.map +1 -1
  309. package/lib/components/Icons/HealthcarePersonell.js.map +1 -1
  310. package/lib/components/Icons/HearingProtection.js.map +1 -1
  311. package/lib/components/Icons/Heart.js.map +1 -1
  312. package/lib/components/Icons/HeartHands.js.map +1 -1
  313. package/lib/components/Icons/HelpSign.js.map +1 -1
  314. package/lib/components/Icons/HelpingHand.js.map +1 -1
  315. package/lib/components/Icons/Hemodialysis.js.map +1 -1
  316. package/lib/components/Icons/Hiker.js.map +1 -1
  317. package/lib/components/Icons/Hipprosthesis.js.map +1 -1
  318. package/lib/components/Icons/History.js.map +1 -1
  319. package/lib/components/Icons/HivAndAids.js.map +1 -1
  320. package/lib/components/Icons/Home.js.map +1 -1
  321. package/lib/components/Icons/HomeFill.js.map +1 -1
  322. package/lib/components/Icons/Hormone.js.map +1 -1
  323. package/lib/components/Icons/Hospital.js.map +1 -1
  324. package/lib/components/Icons/Hourglass.js.map +1 -1
  325. package/lib/components/Icons/IconNames.js.map +1 -1
  326. package/lib/components/Icons/ImgFile.js.map +1 -1
  327. package/lib/components/Icons/Inbox.js.map +1 -1
  328. package/lib/components/Icons/InfoSignFill.js.map +1 -1
  329. package/lib/components/Icons/InfoSignStroke.js.map +1 -1
  330. package/lib/components/Icons/Instagram.js.map +1 -1
  331. package/lib/components/Icons/Intravenous.js.map +1 -1
  332. package/lib/components/Icons/JointPain.js.map +1 -1
  333. package/lib/components/Icons/Journal.js.map +1 -1
  334. package/lib/components/Icons/JpgFile.js.map +1 -1
  335. package/lib/components/Icons/Kidney.js.map +1 -1
  336. package/lib/components/Icons/KitchenScale.js.map +1 -1
  337. package/lib/components/Icons/Kjernejournal.js.map +1 -1
  338. package/lib/components/Icons/Laboratory.js.map +1 -1
  339. package/lib/components/Icons/LaptopBlog.js.map +1 -1
  340. package/lib/components/Icons/LawBook.js.map +1 -1
  341. package/lib/components/Icons/LegalDocument.js.map +1 -1
  342. package/lib/components/Icons/LightBulb.js.map +1 -1
  343. package/lib/components/Icons/List.js.map +1 -1
  344. package/lib/components/Icons/Location.js.map +1 -1
  345. package/lib/components/Icons/LocationFill.js.map +1 -1
  346. package/lib/components/Icons/Lock.js.map +1 -1
  347. package/lib/components/Icons/Login.js.map +1 -1
  348. package/lib/components/Icons/Logout.js.map +1 -1
  349. package/lib/components/Icons/Lungs.js.map +1 -1
  350. package/lib/components/Icons/Makeup.js.map +1 -1
  351. package/lib/components/Icons/MaleDoctor.js.map +1 -1
  352. package/lib/components/Icons/MaleDoctorAndPerson.js.map +1 -1
  353. package/lib/components/Icons/MaleDoctorCompact.js.map +1 -1
  354. package/lib/components/Icons/MaleDoctorCompactFill.js.map +1 -1
  355. package/lib/components/Icons/MaleGenitalia.js.map +1 -1
  356. package/lib/components/Icons/MeasuringTape.js.map +1 -1
  357. package/lib/components/Icons/Medicine.js.map +1 -1
  358. package/lib/components/Icons/MedicineWarning.js.map +1 -1
  359. package/lib/components/Icons/MentalHealthAdult.js.map +1 -1
  360. package/lib/components/Icons/MentalHealthChild.js.map +1 -1
  361. package/lib/components/Icons/Menu.js.map +1 -1
  362. package/lib/components/Icons/Microscope.js.map +1 -1
  363. package/lib/components/Icons/Minus.js.map +1 -1
  364. package/lib/components/Icons/Mirror.js.map +1 -1
  365. package/lib/components/Icons/MobilePhone.js.map +1 -1
  366. package/lib/components/Icons/MotherHoldingBaby.js.map +1 -1
  367. package/lib/components/Icons/MuscleBack.js.map +1 -1
  368. package/lib/components/Icons/MuscleLeg.js.map +1 -1
  369. package/lib/components/Icons/Mushroom.js.map +1 -1
  370. package/lib/components/Icons/Music.js.map +1 -1
  371. package/lib/components/Icons/MusselsAndSalt.js.map +1 -1
  372. package/lib/components/Icons/NoAccess.js.map +1 -1
  373. package/lib/components/Icons/NoEye.js.map +1 -1
  374. package/lib/components/Icons/NoFilter.js.map +1 -1
  375. package/lib/components/Icons/Notepad.js.map +1 -1
  376. package/lib/components/Icons/Osteotomy.js.map +1 -1
  377. package/lib/components/Icons/PaintRoller.js.map +1 -1
  378. package/lib/components/Icons/PaperPlane.js.map +1 -1
  379. package/lib/components/Icons/PatientAndPerson.js.map +1 -1
  380. package/lib/components/Icons/Pause.js.map +1 -1
  381. package/lib/components/Icons/PdfFile.js.map +1 -1
  382. package/lib/components/Icons/Pencil.js.map +1 -1
  383. package/lib/components/Icons/PeopleTalking.js.map +1 -1
  384. package/lib/components/Icons/Peritonealdialysis.js.map +1 -1
  385. package/lib/components/Icons/Person.js.map +1 -1
  386. package/lib/components/Icons/PersonAndPatient.js.map +1 -1
  387. package/lib/components/Icons/PersonCancel.js.map +1 -1
  388. package/lib/components/Icons/PersonInXRayMachine.js.map +1 -1
  389. package/lib/components/Icons/PersonOverweight.js.map +1 -1
  390. package/lib/components/Icons/PersonRelaxing.js.map +1 -1
  391. package/lib/components/Icons/PersonWithBrain.js.map +1 -1
  392. package/lib/components/Icons/PersonWithBrokenArm.js.map +1 -1
  393. package/lib/components/Icons/PersonWithCrutches.js.map +1 -1
  394. package/lib/components/Icons/PersonWithJaw.js.map +1 -1
  395. package/lib/components/Icons/PersonWithMagnifyingGlass.js.map +1 -1
  396. package/lib/components/Icons/PersonWithSenses.js.map +1 -1
  397. package/lib/components/Icons/PersonWorking.js.map +1 -1
  398. package/lib/components/Icons/PersonalPlan.js.map +1 -1
  399. package/lib/components/Icons/PizzaSlice.js.map +1 -1
  400. package/lib/components/Icons/Plane.js.map +1 -1
  401. package/lib/components/Icons/Plant.js.map +1 -1
  402. package/lib/components/Icons/PlateKnifeFork.js.map +1 -1
  403. package/lib/components/Icons/Play.js.map +1 -1
  404. package/lib/components/Icons/PlusLarge.js.map +1 -1
  405. package/lib/components/Icons/PlusSmall.js.map +1 -1
  406. package/lib/components/Icons/PngFile.js.map +1 -1
  407. package/lib/components/Icons/Podcast.js.map +1 -1
  408. package/lib/components/Icons/PoisonInformation.js.map +1 -1
  409. package/lib/components/Icons/Pregnant.js.map +1 -1
  410. package/lib/components/Icons/Printer.js.map +1 -1
  411. package/lib/components/Icons/Psychosis.js.map +1 -1
  412. package/lib/components/Icons/Publication.js.map +1 -1
  413. package/lib/components/Icons/Puzzle.js.map +1 -1
  414. package/lib/components/Icons/QrCode.js.map +1 -1
  415. package/lib/components/Icons/Quarrel.js.map +1 -1
  416. package/lib/components/Icons/RadioTherapy.js.map +1 -1
  417. package/lib/components/Icons/RadioactiveTreatment.js.map +1 -1
  418. package/lib/components/Icons/Radioiodine.js.map +1 -1
  419. package/lib/components/Icons/Receipt.js.map +1 -1
  420. package/lib/components/Icons/Receptionist.js.map +1 -1
  421. package/lib/components/Icons/Recovery.js.map +1 -1
  422. package/lib/components/Icons/Referral.js.map +1 -1
  423. package/lib/components/Icons/Refresh.js.map +1 -1
  424. package/lib/components/Icons/Refund.js.map +1 -1
  425. package/lib/components/Icons/Reminder.js.map +1 -1
  426. package/lib/components/Icons/Reply.js.map +1 -1
  427. package/lib/components/Icons/Rocket.js.map +1 -1
  428. package/lib/components/Icons/RtfFile.js.map +1 -1
  429. package/lib/components/Icons/STDs.js.map +1 -1
  430. package/lib/components/Icons/Save.js.map +1 -1
  431. package/lib/components/Icons/Scale.js.map +1 -1
  432. package/lib/components/Icons/ScreenReader.js.map +1 -1
  433. package/lib/components/Icons/Search.js +4 -4
  434. package/lib/components/Icons/Search.js.map +1 -1
  435. package/lib/components/Icons/SectionSign.js.map +1 -1
  436. package/lib/components/Icons/Settings.js.map +1 -1
  437. package/lib/components/Icons/SettingsFill.js.map +1 -1
  438. package/lib/components/Icons/Sexualorientation.js.map +1 -1
  439. package/lib/components/Icons/ShakingHand.js.map +1 -1
  440. package/lib/components/Icons/Share.js.map +1 -1
  441. package/lib/components/Icons/SharedHealthData.js.map +1 -1
  442. package/lib/components/Icons/SharedHealthMeasurements.js.map +1 -1
  443. package/lib/components/Icons/Shield.js.map +1 -1
  444. package/lib/components/Icons/ShuntOperation.js.map +1 -1
  445. package/lib/components/Icons/Skeleton.js.map +1 -1
  446. package/lib/components/Icons/Skin.js.map +1 -1
  447. package/lib/components/Icons/Snake.js.map +1 -1
  448. package/lib/components/Icons/Snapchat.js.map +1 -1
  449. package/lib/components/Icons/Sort.js +12 -12
  450. package/lib/components/Icons/Sort.js.map +1 -1
  451. package/lib/components/Icons/SortDown.js.map +1 -1
  452. package/lib/components/Icons/SortUp.js.map +1 -1
  453. package/lib/components/Icons/SpeechBubble.js.map +1 -1
  454. package/lib/components/Icons/Spray.js.map +1 -1
  455. package/lib/components/Icons/StarFill.js.map +1 -1
  456. package/lib/components/Icons/StarStroke.js.map +1 -1
  457. package/lib/components/Icons/StickyNote.js.map +1 -1
  458. package/lib/components/Icons/StickyNotes.js.map +1 -1
  459. package/lib/components/Icons/Stopwatch.js.map +1 -1
  460. package/lib/components/Icons/Sun.js.map +1 -1
  461. package/lib/components/Icons/SupportingPerson.js.map +1 -1
  462. package/lib/components/Icons/Surgery.js.map +1 -1
  463. package/lib/components/Icons/Sweets.js.map +1 -1
  464. package/lib/components/Icons/Syringe.js.map +1 -1
  465. package/lib/components/Icons/Taxi.js.map +1 -1
  466. package/lib/components/Icons/TeddyBear.js.map +1 -1
  467. package/lib/components/Icons/Teenagers.js.map +1 -1
  468. package/lib/components/Icons/ThinkingAboutBaby.js.map +1 -1
  469. package/lib/components/Icons/Ticket.js.map +1 -1
  470. package/lib/components/Icons/TimePassing.js.map +1 -1
  471. package/lib/components/Icons/Toddler.js.map +1 -1
  472. package/lib/components/Icons/Tombstone.js.map +1 -1
  473. package/lib/components/Icons/Toolbox.js.map +1 -1
  474. package/lib/components/Icons/Tooth.js.map +1 -1
  475. package/lib/components/Icons/TotalKneeProsthesis.js.map +1 -1
  476. package/lib/components/Icons/Train.js.map +1 -1
  477. package/lib/components/Icons/Transplantation.js.map +1 -1
  478. package/lib/components/Icons/TrashCan.js.map +1 -1
  479. package/lib/components/Icons/TravelRoute.js.map +1 -1
  480. package/lib/components/Icons/TreatmentAids.js.map +1 -1
  481. package/lib/components/Icons/TriangleX.js.map +1 -1
  482. package/lib/components/Icons/Twitter.js.map +1 -1
  483. package/lib/components/Icons/Undo.js.map +1 -1
  484. package/lib/components/Icons/UniProsthesis.js.map +1 -1
  485. package/lib/components/Icons/Upload.js.map +1 -1
  486. package/lib/components/Icons/UserOrganization.js.map +1 -1
  487. package/lib/components/Icons/Vaccine.js.map +1 -1
  488. package/lib/components/Icons/VerticalDots.js.map +1 -1
  489. package/lib/components/Icons/VideoCamera.js.map +1 -1
  490. package/lib/components/Icons/VideoChat.js.map +1 -1
  491. package/lib/components/Icons/Wallet.js.map +1 -1
  492. package/lib/components/Icons/Watch.js.map +1 -1
  493. package/lib/components/Icons/Website.js.map +1 -1
  494. package/lib/components/Icons/Wheelchair.js.map +1 -1
  495. package/lib/components/Icons/WheelchairActive.js.map +1 -1
  496. package/lib/components/Icons/Window.js.map +1 -1
  497. package/lib/components/Icons/WordDocument.js.map +1 -1
  498. package/lib/components/Icons/WorkSuitcase.js.map +1 -1
  499. package/lib/components/Icons/X.js.map +1 -1
  500. package/lib/components/Icons/XOutline.js.map +1 -1
  501. package/lib/components/Icons/XmlFile.js.map +1 -1
  502. package/lib/components/Icons/YouTube.js.map +1 -1
  503. package/lib/components/Icons/Zoom.js.map +1 -1
  504. package/lib/components/Icons/ZoomInLeft.js.map +1 -1
  505. package/lib/components/Icons/ZoomOutLeft.js.map +1 -1
  506. package/lib/components/Illustration/index.js +1 -1
  507. package/lib/components/Illustrations/BabyMobile.js +1 -1
  508. package/lib/components/Illustrations/BabyMobile.js.map +1 -1
  509. package/lib/components/Illustrations/BabyMobileMedium.js +1 -1
  510. package/lib/components/Illustrations/BabyMobileMedium.js.map +1 -1
  511. package/lib/components/Illustrations/Child.js +1 -1
  512. package/lib/components/Illustrations/Child.js.map +1 -1
  513. package/lib/components/Illustrations/ChildMedium.js +1 -1
  514. package/lib/components/Illustrations/ChildMedium.js.map +1 -1
  515. package/lib/components/Illustrations/Doctor.js +1 -1
  516. package/lib/components/Illustrations/Doctor.js.map +1 -1
  517. package/lib/components/Illustrations/DoctorMedium.js.map +1 -1
  518. package/lib/components/Illustrations/DoctorSmall.js.map +1 -1
  519. package/lib/components/Illustrations/EyeContact.d.ts +8 -0
  520. package/lib/components/Illustrations/EyeContact.js +17 -0
  521. package/lib/components/Illustrations/EyeContact.js.map +1 -0
  522. package/lib/components/Illustrations/EyeContactMedium.d.ts +3 -0
  523. package/lib/components/Illustrations/EyeContactMedium.js +80 -0
  524. package/lib/components/Illustrations/EyeContactMedium.js.map +1 -0
  525. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
  526. package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
  527. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js +1 -1
  528. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
  529. package/lib/components/Illustrations/GiveBabyFood.js +1 -1
  530. package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
  531. package/lib/components/Illustrations/GiveBabyFoodMedium.js +1 -1
  532. package/lib/components/Illustrations/GiveBabyFoodMedium.js.map +1 -1
  533. package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
  534. package/lib/components/Illustrations/HealthcarePersonnel.js.map +1 -1
  535. package/lib/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
  536. package/lib/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
  537. package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
  538. package/lib/components/Illustrations/IllustrationNames.js +4 -0
  539. package/lib/components/Illustrations/IllustrationNames.js.map +1 -1
  540. package/lib/components/Illustrations/ReadLetters.js +1 -1
  541. package/lib/components/Illustrations/ReadLetters.js.map +1 -1
  542. package/lib/components/Illustrations/ReadLettersMedium.js +1 -1
  543. package/lib/components/Illustrations/ReadLettersMedium.js.map +1 -1
  544. package/lib/components/Illustrations/SkinToSkin.d.ts +8 -0
  545. package/lib/components/Illustrations/SkinToSkin.js +17 -0
  546. package/lib/components/Illustrations/SkinToSkin.js.map +1 -0
  547. package/lib/components/Illustrations/SkinToSkinMedium.d.ts +3 -0
  548. package/lib/components/Illustrations/SkinToSkinMedium.js +107 -0
  549. package/lib/components/Illustrations/SkinToSkinMedium.js.map +1 -0
  550. package/lib/components/Illustrations/Stork.js +1 -1
  551. package/lib/components/Illustrations/Stork.js.map +1 -1
  552. package/lib/components/Illustrations/StorkMedium.js +1 -1
  553. package/lib/components/Illustrations/StorkMedium.js.map +1 -1
  554. package/lib/components/Illustrations/Stroller.js +1 -1
  555. package/lib/components/Illustrations/Stroller.js.map +1 -1
  556. package/lib/components/Illustrations/StrollerMedium.js +1 -1
  557. package/lib/components/Illustrations/StrollerMedium.js.map +1 -1
  558. package/lib/components/Illustrations/Support2.js +1 -1
  559. package/lib/components/Illustrations/Support2.js.map +1 -1
  560. package/lib/components/Illustrations/Support2Medium.js +1 -1
  561. package/lib/components/Illustrations/Support2Medium.js.map +1 -1
  562. package/lib/components/Illustrations/Thinking.js +1 -1
  563. package/lib/components/Illustrations/Thinking.js.map +1 -1
  564. package/lib/components/Illustrations/ThinkingMedium.js +1 -1
  565. package/lib/components/Illustrations/ThinkingMedium.js.map +1 -1
  566. package/lib/components/Loader/index.js.map +1 -1
  567. package/lib/components/Logo/index.js.map +1 -1
  568. package/lib/components/Modal/index.js.map +1 -1
  569. package/lib/components/NotificationPanel/index.js.map +1 -1
  570. package/lib/components/Panel/index.js +1 -1
  571. package/lib/components/Panel/index.js.map +1 -1
  572. package/lib/components/Panel/styles.module.scss.d.ts +3 -2
  573. package/lib/components/PanelList/index.js +1 -1
  574. package/lib/components/PanelList/index.js.map +1 -1
  575. package/lib/components/PopMenu/index.js.map +1 -1
  576. package/lib/components/Portal/index.js.map +1 -1
  577. package/lib/components/Progressbar/index.js.map +1 -1
  578. package/lib/components/PromoPanel/index.js.map +1 -1
  579. package/lib/components/RadioButton/RadioMarker/RadioMarker.d.ts +20 -0
  580. package/lib/components/RadioButton/RadioMarker/styles.module.scss +288 -0
  581. package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +20 -0
  582. package/lib/components/RadioButton/index.d.ts +0 -1
  583. package/lib/components/RadioButton/index.js +2 -2
  584. package/lib/components/RadioButton/index.js.map +1 -1
  585. package/lib/components/RadioButton/styles.module.scss +13 -275
  586. package/lib/components/RadioButton/styles.module.scss.d.ts +2 -12
  587. package/lib/components/ServiceMessage/index.js.map +1 -1
  588. package/lib/components/SharingStatus/index.js.map +1 -1
  589. package/lib/components/Step/index.js.map +1 -1
  590. package/lib/components/Stepper/index.js +1 -5
  591. package/lib/components/Stepper/index.js.map +1 -1
  592. package/lib/components/StickyNote/index.js.map +1 -1
  593. package/lib/components/Table/index.js +3 -3
  594. package/lib/components/Table/index.js.map +1 -1
  595. package/lib/components/Tabs/index.js +5 -0
  596. package/lib/components/Tabs/index.js.map +1 -1
  597. package/lib/components/Tag/index.js.map +1 -1
  598. package/lib/components/TagList/index.js.map +1 -1
  599. package/lib/components/Tile/index.js.map +1 -1
  600. package/lib/components/ToastList/index.js.map +1 -1
  601. package/lib/components/Toggle/index.js.map +1 -1
  602. package/lib/components/Validation/index.js.map +1 -1
  603. package/lib/components/VisualCheckboxCloud/Checkbox/Checkbox.d.ts +21 -0
  604. package/lib/components/VisualCheckboxCloud/Checkbox/index.d.ts +3 -0
  605. package/lib/components/VisualCheckboxCloud/Checkbox/index.js +7 -0
  606. package/lib/components/VisualCheckboxCloud/Checkbox/index.js.map +1 -0
  607. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +10 -0
  608. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss.d.ts +15 -0
  609. package/lib/components/VisualCheckboxCloud/VisualCheckboxCloud.d.ts +29 -0
  610. package/lib/components/VisualCheckboxCloud/index.d.ts +3 -0
  611. package/lib/components/VisualCheckboxCloud/index.js +42 -0
  612. package/lib/components/VisualCheckboxCloud/index.js.map +1 -0
  613. package/lib/components/VisualCheckboxCloud/styles.module.scss +6 -0
  614. package/lib/components/VisualCheckboxCloud/styles.module.scss.d.ts +9 -0
  615. package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualCheckbox.d.ts +26 -0
  616. package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualContent.d.ts +10 -0
  617. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.d.ts +3 -0
  618. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js +7 -0
  619. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js.map +1 -0
  620. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +7 -0
  621. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss.d.ts +18 -0
  622. package/lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts +33 -0
  623. package/lib/components/VisualCheckboxGroup/index.d.ts +3 -0
  624. package/lib/components/VisualCheckboxGroup/index.js +47 -0
  625. package/lib/components/VisualCheckboxGroup/index.js.map +1 -0
  626. package/lib/components/VisualCheckboxGroup/styles.module.scss +6 -0
  627. package/lib/components/VisualCheckboxGroup/styles.module.scss.d.ts +10 -0
  628. package/lib/components/VisualRadioCloud/Radio/Radio.d.ts +23 -0
  629. package/lib/components/VisualRadioCloud/Radio/index.d.ts +3 -0
  630. package/lib/components/VisualRadioCloud/Radio/index.js +7 -0
  631. package/lib/components/VisualRadioCloud/Radio/index.js.map +1 -0
  632. package/lib/components/VisualRadioCloud/Radio/styles.module.scss +7 -0
  633. package/lib/components/VisualRadioCloud/Radio/styles.module.scss.d.ts +15 -0
  634. package/lib/components/VisualRadioCloud/VisualRadioCloud.d.ts +39 -0
  635. package/lib/components/VisualRadioCloud/index.d.ts +3 -0
  636. package/lib/components/VisualRadioCloud/index.js +62 -0
  637. package/lib/components/VisualRadioCloud/index.js.map +1 -0
  638. package/lib/components/VisualRadioCloud/styles.module.scss +6 -0
  639. package/lib/components/VisualRadioCloud/styles.module.scss.d.ts +9 -0
  640. package/lib/components/VisualRadioGroup/VisualRadio/VisualContent.d.ts +10 -0
  641. package/lib/components/VisualRadioGroup/VisualRadio/VisualRadio.d.ts +26 -0
  642. package/lib/components/VisualRadioGroup/VisualRadio/index.d.ts +3 -0
  643. package/lib/components/VisualRadioGroup/VisualRadio/index.js +7 -0
  644. package/lib/components/VisualRadioGroup/VisualRadio/index.js.map +1 -0
  645. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +7 -0
  646. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss.d.ts +18 -0
  647. package/lib/components/VisualRadioGroup/VisualRadioGroup.d.ts +39 -0
  648. package/lib/components/VisualRadioGroup/index.d.ts +3 -0
  649. package/lib/components/VisualRadioGroup/index.js +67 -0
  650. package/lib/components/VisualRadioGroup/index.js.map +1 -0
  651. package/lib/components/VisualRadioGroup/styles.module.scss +6 -0
  652. package/lib/components/VisualRadioGroup/styles.module.scss.d.ts +10 -0
  653. package/lib/constants.js.map +1 -1
  654. package/lib/constants2.js +6 -6
  655. package/lib/constants2.js.map +1 -1
  656. package/lib/floating-ui.react.js +30 -30
  657. package/lib/floating-ui.react.js.map +1 -1
  658. package/lib/getFilterChips.js.map +1 -1
  659. package/lib/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
  660. package/lib/hooks/useBreakpoint.js.map +1 -1
  661. package/lib/hooks/useElementList.js.map +1 -1
  662. package/lib/hooks/useEventListenerState.js.map +1 -1
  663. package/lib/hooks/useExpand.js.map +1 -1
  664. package/lib/hooks/useFocusToggle.js.map +1 -1
  665. package/lib/hooks/useFocusTrap.js.map +1 -1
  666. package/lib/hooks/useFocusableElements.js.map +1 -1
  667. package/lib/hooks/useIcons.js.map +1 -1
  668. package/lib/hooks/useIdWithFallback.js.map +1 -1
  669. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  670. package/lib/hooks/useInterval.js.map +1 -1
  671. package/lib/hooks/useIsMobileBreakpoint.js.map +1 -1
  672. package/lib/hooks/useIsServerSide.js.map +1 -1
  673. package/lib/hooks/useIsVisible.js.map +1 -1
  674. package/lib/hooks/useKeyboardEvent.js.map +1 -1
  675. package/lib/hooks/useLanguage.js.map +1 -1
  676. package/lib/hooks/useLayoutEvent.js.map +1 -1
  677. package/lib/hooks/useOutsideEvent.js.map +1 -1
  678. package/lib/hooks/usePrevious.js.map +1 -1
  679. package/lib/hooks/usePseudoClasses.js.map +1 -1
  680. package/lib/hooks/useResizeObserver.js.map +1 -1
  681. package/lib/hooks/useReturnFocusOnUnmount.js.map +1 -1
  682. package/lib/hooks/useRovingFocus.js.map +1 -1
  683. package/lib/hooks/useSize.js.map +1 -1
  684. package/lib/hooks/useToggle.js.map +1 -1
  685. package/lib/hooks/usestopPropagation.js.map +1 -1
  686. package/lib/resourceHelper.js +42 -8
  687. package/lib/resourceHelper.js.map +1 -1
  688. package/lib/resources/HN.Designsystem.Drawer.se-NO.json.d.ts +7 -0
  689. package/lib/resources/HN.Designsystem.Filter.en-GB.json.d.ts +7 -4
  690. package/lib/resources/HN.Designsystem.Filter.nb-NO.json.d.ts +7 -4
  691. package/lib/resources/HN.Designsystem.Filter.nn-NO.json.d.ts +16 -0
  692. package/lib/resources/HN.Designsystem.Filter.se-NO.json.d.ts +16 -0
  693. package/lib/resources/HN.Designsystem.Tabs.se-NO.json.d.ts +7 -0
  694. package/lib/resources/Resources.d.ts +15 -3
  695. package/lib/scss/_visual-form.scss +357 -0
  696. package/lib/theme/currys/color.js.map +1 -1
  697. package/lib/theme/currys/spacing.js.map +1 -1
  698. package/lib/theme/grid.js.map +1 -1
  699. package/lib/theme/index.js.map +1 -1
  700. package/lib/theme/palette.js.map +1 -1
  701. package/lib/theme/spacers.js.map +1 -1
  702. package/lib/utils/accessibility.js.map +1 -1
  703. package/lib/utils/component.js.map +1 -1
  704. package/lib/utils/debounce.js.map +1 -1
  705. package/lib/utils/deepContains.js.map +1 -1
  706. package/lib/utils/device.js.map +1 -1
  707. package/lib/utils/focus.js.map +1 -1
  708. package/lib/utils/language.js.map +1 -1
  709. package/lib/utils/mobile.js.map +1 -1
  710. package/lib/utils/refs.js.map +1 -1
  711. package/lib/utils/resource.js.map +1 -1
  712. package/lib/utils/scroll.js.map +1 -1
  713. package/lib/utils/viewport.js.map +1 -1
  714. package/lib/utils.js.map +1 -1
  715. package/lib/utils2.js.map +1 -1
  716. package/lib/utils3.js +11 -100
  717. package/lib/utils3.js.map +1 -1
  718. package/lib/utils4.js +31 -12
  719. package/lib/utils4.js.map +1 -1
  720. package/lib/utils5.js +112 -31
  721. package/lib/utils5.js.map +1 -1
  722. package/lib/uuid.js.map +1 -1
  723. package/package.json +133 -3
  724. package/scss/_visual-form.scss +357 -0
  725. package/lib/components/RadioButton/utils.d.ts +0 -2
  726. package/lib/utils6.js +0 -115
  727. package/lib/utils6.js.map +0 -1
@@ -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":"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"}
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":"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"}
@@ -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,gBACJ,WAAW,gBACT,qBAAC,OAAD;EAAK,WAAW,OAAO;YAAvB,CACG,oBACA,kBACE;MACH,KAAA;CAEN,MAAM,iBAAiB,UAAU;CAEjC,MAAM,sBAAsB,aAA0B,aAA0B,kBAA6C;EAC3H,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,eACnC;EAGF,MAAM,iBAAiB,cAAc,oBAAC,gBAAD;GAAQ,SAAS;aAAc,gBAAgB;EAAuB,CAAA,IAAI;EAE/G,OACE,qBAAC,OAAD;GAAK,WAAW,OAAO;aAAvB,CACG,CAAC,kBACC,cACC,oBAAC,gBAAD;IAAQ,SAAS;IAAa,SAAQ;cACnC,gBAAgB;GACX,CAAA,IAER,sBAEF,iBAAiB,mBACjB,qBAAC,OAAD;IAAK,WAAW,OAAO;cAAvB,CACG,eACA,cACE;KAEJ;;CAET;CAEA,MAAM,oBAAoB,SAAS,IAAI,WAAU,UAAS;EACxD,IAAI,eAA2D,KAAK,KAAK,MAAM,SAAS,sBAAsB;GAE5G,MAAM,aADoB,mBAAmB,MAAM,MAAM,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM,aAChF,KAAqB,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;GACT,CAAA;EAEL;EACA,IAAI,eAAsC,KAAK,GAAG;GAEhD,MAAM,aADoB,mBAAmB,MAAM,MAAM,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM,aAChF,KAAqB,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;GACT,CAAA;EAEL,OACE,OAAO;CAEX,CAAC;CAED,OACE,oBAAC,kBAAD;EAAkB,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterSearch.js","names":[],"sources":["../src/components/Filter/FilterSearch/FilterSearch.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { HNDesignsystemFilter } from '../../../resources/Resources';\n\nimport { IconSize, LanguageLocales } from '../../../constants';\nimport { useIsMobileBreakpoint } from '../../../hooks/useIsMobileBreakpoint';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport { usePseudoClasses } from '../../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../../utils/refs';\nimport Icon from '../../Icon';\nimport Search from '../../Icons/Search';\nimport X from '../../Icons/X';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterSearchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className' | 'value' | 'onChange'> {\n /** Adds custom classes to the component */\n className?: string;\n /** The value given by the user in the input field */\n value: string | undefined;\n /** onChange handler for the input field */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Props for the search button */\n buttonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Props for the clear button */\n clearButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFilter>;\n /** Ref passed to the input element */\n ref?: React.Ref<HTMLInputElement | null>;\n}\n\nconst FilterSearch: React.FC<FilterSearchProps> = props => {\n const { className, value, onChange, resources, buttonProps, clearButtonProps, ref, ...inputProps } = props;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const inputWrapperRef = useRef<HTMLLabelElement>(null);\n const { isHovered: isWrapperHovered } = usePseudoClasses(inputWrapperRef);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const { isHovered: isButtonHovered } = usePseudoClasses(buttonRef);\n const clearButtonRef = useRef<HTMLButtonElement>(null);\n const { isHovered: isClearButtonHovered } = usePseudoClasses(clearButtonRef);\n\n const isMobile = useIsMobileBreakpoint();\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 inputHasValue = !!value;\n\n return (\n <div className={classNames(styles['filter-search__wrapper'], className)}>\n <label className={styles['filter-search__input-wrapper']} ref={inputWrapperRef}>\n <span className={styles['filter-search__input__label']}>{inputProps['aria-label'] ?? mergedResources.searchPlaceholder}</span>\n <input\n {...inputProps}\n ref={mergeRefs([inputRef, ref])}\n value={value}\n onChange={onChange}\n className={classNames(styles['filter-search__input'], {\n [styles['filter-search__input--hovered']]: isWrapperHovered,\n })}\n placeholder={mergedResources.searchPlaceholder}\n />\n </label>\n {inputHasValue && (\n <button\n type=\"button\"\n aria-label={mergedResources.searchClearButtonAriaLabel}\n disabled={inputProps.disabled}\n {...clearButtonProps}\n onClick={e => {\n clearButtonProps?.onClick?.(e);\n inputRef.current?.focus();\n }}\n ref={clearButtonRef}\n className={classNames(styles['filter-search__clear-button'], clearButtonProps?.className)}\n >\n <Icon svgIcon={X} size={IconSize.XXSmall} isHovered={!isMobile && isClearButtonHovered} />\n </button>\n )}\n <button\n type={'button'}\n aria-label={mergedResources.searchButtonAriaLabel}\n disabled={inputProps.disabled}\n {...buttonProps}\n ref={buttonRef}\n className={classNames(styles['filter-search__search-button'], buttonProps?.className)}\n >\n <div className={classNames(styles['filter-search__search-button--inner'])}>\n <Icon svgIcon={Search} size={isMobile ? IconSize.XXSmall : IconSize.XSmall} isHovered={!inputProps.disabled && isButtonHovered} />\n </div>\n </button>\n </div>\n );\n};\n\nexport default FilterSearch;\n"],"mappings":";;;;;;;;;;;;;;AAmCA,IAAM,gBAA4C,UAAS;CACzD,MAAM,EAAE,WAAW,OAAO,UAAU,WAAW,aAAa,kBAAkB,KAAK,GAAG,eAAe;CAErG,MAAM,WAAW,OAAyB,KAAK;CAC/C,MAAM,kBAAkB,OAAyB,KAAK;CACtD,MAAM,EAAE,WAAW,qBAAqB,iBAAiB,gBAAgB;CACzE,MAAM,YAAY,OAA0B,KAAK;CACjD,MAAM,EAAE,WAAW,oBAAoB,iBAAiB,UAAU;CAClE,MAAM,iBAAiB,OAA0B,KAAK;CACtD,MAAM,EAAE,WAAW,yBAAyB,iBAAiB,eAAe;CAE5E,MAAM,WAAW,uBAAuB;CAExC,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAG5E,MAAM,kBAAkB;EACtB,GAHuB,aAAa,SAGjC;EACH,GAAG;EACJ;CAED,MAAM,gBAAgB,CAAC,CAAC;CAExB,OACE,qBAAC,OAAD;EAAK,WAAW,WAAW,OAAO,2BAA2B,UAAU;YAAvE;GACE,qBAAC,SAAD;IAAO,WAAW,OAAO;IAAiC,KAAK;cAA/D,CACE,oBAAC,QAAD;KAAM,WAAW,OAAO;eAAiC,WAAW,iBAAiB,gBAAgB;KAAyB,CAAA,EAC9H,oBAAC,SAAD;KACE,GAAI;KACJ,KAAK,UAAU,CAAC,UAAU,IAAI,CAAC;KACxB;KACG;KACV,WAAW,WAAW,OAAO,yBAAyB,GACnD,OAAO,mCAAmC,kBAC5C,CAAC;KACF,aAAa,gBAAgB;KAC7B,CAAA,CACI;;GACP,iBACC,oBAAC,UAAD;IACE,MAAK;IACL,cAAY,gBAAgB;IAC5B,UAAU,WAAW;IACrB,GAAI;IACJ,UAAS,MAAK;KACZ,kBAAkB,UAAU,EAAE;KAC9B,SAAS,SAAS,OAAO;;IAE3B,KAAK;IACL,WAAW,WAAW,OAAO,gCAAgC,kBAAkB,UAAU;cAEzF,oBAAC,cAAD;KAAM,SAAS;KAAG,MAAM,SAAS;KAAS,WAAW,CAAC,YAAY;KAAwB,CAAA;IACnF,CAAA;GAEX,oBAAC,UAAD;IACE,MAAM;IACN,cAAY,gBAAgB;IAC5B,UAAU,WAAW;IACrB,GAAI;IACJ,KAAK;IACL,WAAW,WAAW,OAAO,iCAAiC,aAAa,UAAU;cAErF,oBAAC,OAAD;KAAK,WAAW,WAAW,OAAO,uCAAuC;eACvE,oBAAC,cAAD;MAAM,SAAS;MAAQ,MAAM,WAAW,SAAS,UAAU,SAAS;MAAQ,WAAW,CAAC,WAAW,YAAY;MAAmB,CAAA;KAC9H,CAAA;IACC,CAAA;GACL"}
1
+ {"version":3,"file":"FilterSearch.js","names":[],"sources":["../src/components/Filter/FilterSearch/FilterSearch.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { HNDesignsystemFilter } from '../../../resources/Resources';\n\nimport { IconSize, LanguageLocales } from '../../../constants';\nimport { useIsMobileBreakpoint } from '../../../hooks/useIsMobileBreakpoint';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport { usePseudoClasses } from '../../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../../utils/refs';\nimport Icon from '../../Icon';\nimport Search from '../../Icons/Search';\nimport X from '../../Icons/X';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterSearchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className' | 'value' | 'onChange'> {\n /** Adds custom classes to the component */\n className?: string;\n /** The value given by the user in the input field */\n value: string | undefined;\n /** onChange handler for the input field */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Props for the search button */\n buttonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Props for the clear button */\n clearButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFilter>;\n /** Ref passed to the input element */\n ref?: React.Ref<HTMLInputElement | null>;\n}\n\nconst FilterSearch: React.FC<FilterSearchProps> = props => {\n const { className, value, onChange, resources, buttonProps, clearButtonProps, ref, ...inputProps } = props;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const inputWrapperRef = useRef<HTMLLabelElement>(null);\n const { isHovered: isWrapperHovered } = usePseudoClasses(inputWrapperRef);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const { isHovered: isButtonHovered } = usePseudoClasses(buttonRef);\n const clearButtonRef = useRef<HTMLButtonElement>(null);\n const { isHovered: isClearButtonHovered } = usePseudoClasses(clearButtonRef);\n\n const isMobile = useIsMobileBreakpoint();\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 inputHasValue = !!value;\n\n return (\n <div className={classNames(styles['filter-search__wrapper'], className)}>\n <label className={styles['filter-search__input-wrapper']} ref={inputWrapperRef}>\n <span className={styles['filter-search__input__label']}>{inputProps['aria-label'] ?? mergedResources.searchPlaceholder}</span>\n <input\n {...inputProps}\n ref={mergeRefs([inputRef, ref])}\n value={value}\n onChange={onChange}\n className={classNames(styles['filter-search__input'], {\n [styles['filter-search__input--hovered']]: isWrapperHovered,\n })}\n placeholder={mergedResources.searchPlaceholder}\n />\n </label>\n {inputHasValue && (\n <button\n type=\"button\"\n aria-label={mergedResources.searchClearButtonAriaLabel}\n disabled={inputProps.disabled}\n {...clearButtonProps}\n onClick={e => {\n clearButtonProps?.onClick?.(e);\n inputRef.current?.focus();\n }}\n ref={clearButtonRef}\n className={classNames(styles['filter-search__clear-button'], clearButtonProps?.className)}\n >\n <Icon svgIcon={X} size={IconSize.XXSmall} isHovered={!isMobile && isClearButtonHovered} />\n </button>\n )}\n <button\n type={'button'}\n aria-label={mergedResources.searchButtonAriaLabel}\n disabled={inputProps.disabled}\n {...buttonProps}\n ref={buttonRef}\n className={classNames(styles['filter-search__search-button'], buttonProps?.className)}\n >\n <div className={classNames(styles['filter-search__search-button--inner'])}>\n <Icon svgIcon={Search} size={isMobile ? IconSize.XXSmall : IconSize.XSmall} isHovered={!inputProps.disabled && isButtonHovered} />\n </div>\n </button>\n </div>\n );\n};\n\nexport default FilterSearch;\n"],"mappings":";;;;;;;;;;;;;;AAmCA,IAAM,gBAA4C,UAAS;CACzD,MAAM,EAAE,WAAW,OAAO,UAAU,WAAW,aAAa,kBAAkB,KAAK,GAAG,eAAe;CAErG,MAAM,WAAW,OAAyB,IAAI;CAC9C,MAAM,kBAAkB,OAAyB,IAAI;CACrD,MAAM,EAAE,WAAW,qBAAqB,iBAAiB,eAAe;CACxE,MAAM,YAAY,OAA0B,IAAI;CAChD,MAAM,EAAE,WAAW,oBAAoB,iBAAiB,SAAS;CACjE,MAAM,iBAAiB,OAA0B,IAAI;CACrD,MAAM,EAAE,WAAW,yBAAyB,iBAAiB,cAAc;CAE3E,MAAM,WAAW,sBAAsB;CAEvC,MAAM,EAAE,aAAa,YAA6B,gBAAgB,SAAS;CAG3E,MAAM,kBAAkB;EACtB,GAHuB,aAAa,QAGjC;EACH,GAAG;CACL;CAEA,MAAM,gBAAgB,CAAC,CAAC;CAExB,OACE,qBAAC,OAAD;EAAK,WAAW,WAAW,OAAO,2BAA2B,SAAS;YAAtE;GACE,qBAAC,SAAD;IAAO,WAAW,OAAO;IAAiC,KAAK;cAA/D,CACE,oBAAC,QAAD;KAAM,WAAW,OAAO;eAAiC,WAAW,iBAAiB,gBAAgB;IAAwB,CAAA,GAC7H,oBAAC,SAAD;KACE,GAAI;KACJ,KAAK,UAAU,CAAC,UAAU,GAAG,CAAC;KACvB;KACG;KACV,WAAW,WAAW,OAAO,yBAAyB,GACnD,OAAO,mCAAmC,iBAC7C,CAAC;KACD,aAAa,gBAAgB;IAC9B,CAAA,CACI;;GACN,iBACC,oBAAC,UAAD;IACE,MAAK;IACL,cAAY,gBAAgB;IAC5B,UAAU,WAAW;IACrB,GAAI;IACJ,UAAS,MAAK;KACZ,kBAAkB,UAAU,CAAC;KAC7B,SAAS,SAAS,MAAM;IAC1B;IACA,KAAK;IACL,WAAW,WAAW,OAAO,gCAAgC,kBAAkB,SAAS;cAExF,oBAAC,cAAD;KAAM,SAAS;KAAG,MAAM,SAAS;KAAS,WAAW,CAAC,YAAY;IAAuB,CAAA;GACnF,CAAA;GAEV,oBAAC,UAAD;IACE,MAAM;IACN,cAAY,gBAAgB;IAC5B,UAAU,WAAW;IACrB,GAAI;IACJ,KAAK;IACL,WAAW,WAAW,OAAO,iCAAiC,aAAa,SAAS;cAEpF,oBAAC,OAAD;KAAK,WAAW,WAAW,OAAO,sCAAsC;eACtE,oBAAC,cAAD;MAAM,SAAS;MAAQ,MAAM,WAAW,SAAS,UAAU,SAAS;MAAQ,WAAW,CAAC,WAAW,YAAY;KAAkB,CAAA;IAC9H,CAAA;GACC,CAAA;EACL;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterSort.js","names":[],"sources":["../src/components/Filter/FilterSort/FilterSort.tsx","../src/components/Filter/FilterSort/index.ts"],"sourcesContent":["import type { HNDesignsystemFilter } from '../../../resources/Resources';\n\nimport { LanguageLocales } from '../../../constants';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport Label from '../../Label';\nimport Select, { type SelectProps } from '../../Select';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterSortProps extends SelectProps {\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFilter>;\n}\n\nconst FilterSort: React.FC<FilterSortProps> = props => {\n const { children, 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 return (\n <Select\n {...props}\n label={<Label labelTexts={[{ text: `${mergedResources.sortLabel}:`, type: 'subdued' }]} />}\n labelClassName={styles['select__label']}\n className={styles['select']}\n wrapperClassName={styles['select__wrapper']}\n >\n {children}\n </Select>\n );\n};\n\nexport default FilterSort;\n","import FilterSort from './FilterSort';\nexport * from './FilterSort';\nexport default FilterSort;\n"],"mappings":";;;;;;;;AAeA,IAAM,cAAwC,UAAS;CACrD,MAAM,EAAE,UAAU,cAAc;CAEhC,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAG5E,MAAM,kBAAkB;EACtB,GAHuB,aAAa,SAGjC;EACH,GAAG;EACJ;CAED,OACE,oBAAC,gBAAD;EACE,GAAI;EACJ,OAAO,oBAAC,eAAD,EAAO,YAAY,CAAC;GAAE,MAAM,GAAG,gBAAgB,UAAU;GAAI,MAAM;GAAW,CAAC,EAAI,CAAA;EAC1F,gBAAgB,OAAO;EACvB,WAAW,OAAO;EAClB,kBAAkB,OAAO;EAExB;EACM,CAAA;;;;ACjCb,IAAA,qBAAe"}
1
+ {"version":3,"file":"FilterSort.js","names":[],"sources":["../src/components/Filter/FilterSort/FilterSort.tsx","../src/components/Filter/FilterSort/index.ts"],"sourcesContent":["import type { HNDesignsystemFilter } from '../../../resources/Resources';\n\nimport { LanguageLocales } from '../../../constants';\nimport { useLanguage } from '../../../hooks/useLanguage';\nimport Label from '../../Label';\nimport Select, { type SelectProps } from '../../Select';\nimport { getResources } from '../resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterSortProps extends SelectProps {\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFilter>;\n}\n\nconst FilterSort: React.FC<FilterSortProps> = props => {\n const { children, 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 return (\n <Select\n {...props}\n label={<Label labelTexts={[{ text: `${mergedResources.sortLabel}:`, type: 'subdued' }]} />}\n labelClassName={styles['select__label']}\n className={styles['select']}\n wrapperClassName={styles['select__wrapper']}\n >\n {children}\n </Select>\n );\n};\n\nexport default FilterSort;\n","import FilterSort from './FilterSort';\nexport * from './FilterSort';\nexport default FilterSort;\n"],"mappings":";;;;;;;;AAeA,IAAM,cAAwC,UAAS;CACrD,MAAM,EAAE,UAAU,cAAc;CAEhC,MAAM,EAAE,aAAa,YAA6B,gBAAgB,SAAS;CAG3E,MAAM,kBAAkB;EACtB,GAHuB,aAAa,QAGjC;EACH,GAAG;CACL;CAEA,OACE,oBAAC,gBAAD;EACE,GAAI;EACJ,OAAO,oBAAC,eAAD,EAAO,YAAY,CAAC;GAAE,MAAM,GAAG,gBAAgB,UAAU;GAAI,MAAM;EAAU,CAAC,EAAI,CAAA;EACzF,gBAAgB,OAAO;EACvB,WAAW,OAAO;EAClB,kBAAkB,OAAO;EAExB;CACK,CAAA;AAEZ;;;ACnCA,IAAA,qBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterStateWrapper.js","names":[],"sources":["../src/components/Filter/FilterStateWrapper/FilterStateWrapper.tsx","../src/components/Filter/FilterStateWrapper/index.ts"],"sourcesContent":["import type React from 'react';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterStateWrapperProps {\n /** Content to be rendered inside the wrapper */\n children: React.ReactNode;\n /** test id that is placed on the wrapper */\n testId?: string;\n}\n\nconst FilterStateWrapper: React.FC<FilterStateWrapperProps> = ({ children, testId }) => {\n return (\n <div className={styles['filter-state-wrapper']} data-testid={testId}>\n {children}\n </div>\n );\n};\n\nexport default FilterStateWrapper;\n","import FilterStateWrapper from './FilterStateWrapper';\nexport * from './FilterStateWrapper';\nexport default FilterStateWrapper;\n"],"mappings":";;;AAWA,IAAM,sBAAyD,EAAE,UAAU,aAAa;CACtF,OACE,oBAAC,OAAD;EAAK,WAAW,OAAO;EAAyB,eAAa;EAC1D;EACG,CAAA;;;;ACbV,IAAA,6BAAe"}
1
+ {"version":3,"file":"FilterStateWrapper.js","names":[],"sources":["../src/components/Filter/FilterStateWrapper/FilterStateWrapper.tsx","../src/components/Filter/FilterStateWrapper/index.ts"],"sourcesContent":["import type React from 'react';\n\nimport styles from './styles.module.scss';\n\nexport interface FilterStateWrapperProps {\n /** Content to be rendered inside the wrapper */\n children: React.ReactNode;\n /** test id that is placed on the wrapper */\n testId?: string;\n}\n\nconst FilterStateWrapper: React.FC<FilterStateWrapperProps> = ({ children, testId }) => {\n return (\n <div className={styles['filter-state-wrapper']} data-testid={testId}>\n {children}\n </div>\n );\n};\n\nexport default FilterStateWrapper;\n","import FilterStateWrapper from './FilterStateWrapper';\nexport * from './FilterStateWrapper';\nexport default FilterStateWrapper;\n"],"mappings":";;;AAWA,IAAM,sBAAyD,EAAE,UAAU,aAAa;CACtF,OACE,oBAAC,OAAD;EAAK,WAAW,OAAO;EAAyB,eAAa;EAC1D;CACE,CAAA;AAET;;;ACfA,IAAA,6BAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldTag.js","names":[],"sources":["../src/resources/HN.Designsystem.FormFieldTag.en-GB.json","../src/resources/HN.Designsystem.FormFieldTag.nb-NO.json","../src/resources/HN.Designsystem.FormFieldTag.nn-NO.json","../src/resources/HN.Designsystem.FormFieldTag.se-NO.json","../src/components/FormFieldTag/resourceHelper.ts","../src/components/FormFieldTag/FormFieldTag.tsx","../src/components/FormFieldTag/index.ts"],"sourcesContent":["{\n \"allRequired\": \"All fields must be filled out\",\n \"requiredField\": \"Required\",\n \"optional\": \"Optional\",\n \"allOptional\": \"All fields are optional\",\n \"requiredRadiobuttonList\": \"Select one\",\n \"requiredCheckboxList\": \"Select one or more\",\n \"requiredSingleCheckbox\": \"Must be selected\"\n}\n","{\n \"allRequired\": \"Alle felt må fylles ut\",\n \"requiredField\": \"Må fylles ut\",\n \"optional\": \"Valgfritt\",\n \"allOptional\": \"Alle felt er valgfrie\",\n \"requiredRadiobuttonList\": \"Velg én\",\n \"requiredCheckboxList\": \"Velg én eller flere\",\n \"requiredSingleCheckbox\": \"Må velges\"\n}\n","{\n \"allRequired\": \"Alle felt må fyllast ut\",\n \"requiredField\": \"Må fyllast ut\",\n \"optional\": \"Valfritt\",\n \"allOptional\": \"Alle felt er valfrie\",\n \"requiredRadiobuttonList\": \"Vel éin\",\n \"requiredCheckboxList\": \"Vel éin eller fleire\",\n \"requiredSingleCheckbox\": \"Må veljast\"\n}\n","{\n \"allRequired\": \"Buot sajiid ferte deavdit\",\n \"requiredField\": \"Ferte devdojuvvot\",\n \"optional\": \"Válljenláhkái\",\n \"allOptional\": \"Buot sajit eat válljenláhkái\",\n \"requiredRadiobuttonList\": \"Vállje ovtta\",\n \"requiredCheckboxList\": \"Vállje ovtta dahje máŋga\",\n \"requiredSingleCheckbox\": \"Ferte válljejuvvot\"\n}\n","import type { HNDesignsystemFormFieldTag } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.FormFieldTag.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.FormFieldTag.nb-NO.json';\nimport nnNO from '../../resources/HN.Designsystem.FormFieldTag.nn-NO.json';\nimport seNO from '../../resources/HN.Designsystem.FormFieldTag.se-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFormFieldTag => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nnNO;\n case LanguageLocales.SAMI_NORTHERN:\n return seNO;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import classNames from 'classnames';\n\nimport type { HNDesignsystemFormFieldTag } from '../../resources/Resources';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { useLanguage } from '../../hooks/useLanguage';\n\nimport styles from './styles.module.scss';\n\nexport type FormFieldTagLevel =\n | 'all-required'\n | 'required-field'\n | 'optional'\n | 'all-optional'\n | 'required-radiobutton-list'\n | 'required-checkbox-list'\n | 'required-single-checkbox';\n\nexport interface FormFieldTagProps {\n /** Id that is placed on the component */\n id?: string;\n /** What level is the required tag, sets the styling and the text. */\n level: FormFieldTagLevel;\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFormFieldTag>;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst FormFieldTag: React.FC<FormFieldTagProps> = props => {\n const { id, level, resources, testId } = props;\n const isOptional = level === 'optional' || level === 'all-optional';\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemFormFieldTag = {\n ...defaultResources,\n ...resources,\n };\n\n const textMap = {\n 'all-required': mergedResources.allRequired,\n 'required-field': mergedResources.requiredField,\n optional: mergedResources.optional,\n 'all-optional': mergedResources.allOptional,\n 'required-radiobutton-list': mergedResources.requiredRadiobuttonList,\n 'required-checkbox-list': mergedResources.requiredCheckboxList,\n 'required-single-checkbox': mergedResources.requiredSingleCheckbox,\n };\n\n return (\n <span\n id={id}\n data-testid={testId}\n data-analyticsid={AnalyticsId.FormFieldTag}\n className={classNames(styles['form-field-tag'], { [styles['form-field-tag--optional']]: isOptional })}\n >\n {textMap[level]}\n </span>\n );\n};\n\nexport default FormFieldTag;\n","import FormFieldTag from './FormFieldTag';\nexport * from './FormFieldTag';\nexport default FormFieldTag;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIQA,IAAa,gBAAgB,aAA0D;CACrF,QAAQ,UAAR;EACE,KAAK,gBAAgB,SACnB,OAAO;EACT,KAAK,gBAAgB,mBACnB,OAAO;EACT,KAAK,gBAAgB,eACnB,OAAO;EACT,KAAK,gBAAgB;EACrB,SACE,OAAO;;;;;ACYb,IAAM,gBAA4C,UAAS;CACzD,MAAM,EAAE,IAAI,OAAO,WAAW,WAAW;CACzC,MAAM,aAAa,UAAU,cAAc,UAAU;CAErD,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAG5E,MAAM,kBAA8C;EAClD,GAHuB,aAAa,SAGjC;EACH,GAAG;EACJ;CAED,MAAM,UAAU;EACd,gBAAgB,gBAAgB;EAChC,kBAAkB,gBAAgB;EAClC,UAAU,gBAAgB;EAC1B,gBAAgB,gBAAgB;EAChC,6BAA6B,gBAAgB;EAC7C,0BAA0B,gBAAgB;EAC1C,4BAA4B,gBAAgB;EAC7C;CAED,OACE,oBAAC,QAAD;EACM;EACJ,eAAa;EACb,oBAAkB,YAAY;EAC9B,WAAW,WAAW,OAAO,mBAAmB,GAAG,OAAO,8BAA8B,YAAY,CAAC;YAEpG,QAAQ;EACJ,CAAA;;;;AC1DX,IAAA,uBAAe"}
1
+ {"version":3,"file":"FormFieldTag.js","names":[],"sources":["../src/resources/HN.Designsystem.FormFieldTag.en-GB.json","../src/resources/HN.Designsystem.FormFieldTag.nb-NO.json","../src/resources/HN.Designsystem.FormFieldTag.nn-NO.json","../src/resources/HN.Designsystem.FormFieldTag.se-NO.json","../src/components/FormFieldTag/resourceHelper.ts","../src/components/FormFieldTag/FormFieldTag.tsx","../src/components/FormFieldTag/index.ts"],"sourcesContent":["{\n \"allRequired\": \"All fields must be filled out\",\n \"requiredField\": \"Required\",\n \"optional\": \"Optional\",\n \"allOptional\": \"All fields are optional\",\n \"requiredRadiobuttonList\": \"Select one\",\n \"requiredCheckboxList\": \"Select one or more\",\n \"requiredSingleCheckbox\": \"Must be selected\"\n}\n","{\n \"allRequired\": \"Alle felt må fylles ut\",\n \"requiredField\": \"Må fylles ut\",\n \"optional\": \"Valgfritt\",\n \"allOptional\": \"Alle felt er valgfrie\",\n \"requiredRadiobuttonList\": \"Velg én\",\n \"requiredCheckboxList\": \"Velg én eller flere\",\n \"requiredSingleCheckbox\": \"Må velges\"\n}\n","{\n \"allRequired\": \"Alle felt må fyllast ut\",\n \"requiredField\": \"Må fyllast ut\",\n \"optional\": \"Valfritt\",\n \"allOptional\": \"Alle felt er valfrie\",\n \"requiredRadiobuttonList\": \"Vel éin\",\n \"requiredCheckboxList\": \"Vel éin eller fleire\",\n \"requiredSingleCheckbox\": \"Må veljast\"\n}\n","{\n \"allRequired\": \"Buot sajiid ferte deavdit\",\n \"requiredField\": \"Ferte devdojuvvot\",\n \"optional\": \"Válljenláhkái\",\n \"allOptional\": \"Buot sajit eat válljenláhkái\",\n \"requiredRadiobuttonList\": \"Vállje ovtta\",\n \"requiredCheckboxList\": \"Vállje ovtta dahje máŋga\",\n \"requiredSingleCheckbox\": \"Ferte válljejuvvot\"\n}\n","import type { HNDesignsystemFormFieldTag } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.FormFieldTag.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.FormFieldTag.nb-NO.json';\nimport nnNO from '../../resources/HN.Designsystem.FormFieldTag.nn-NO.json';\nimport seNO from '../../resources/HN.Designsystem.FormFieldTag.se-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFormFieldTag => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nnNO;\n case LanguageLocales.SAMI_NORTHERN:\n return seNO;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import classNames from 'classnames';\n\nimport type { HNDesignsystemFormFieldTag } from '../../resources/Resources';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { useLanguage } from '../../hooks/useLanguage';\n\nimport styles from './styles.module.scss';\n\nexport type FormFieldTagLevel =\n | 'all-required'\n | 'required-field'\n | 'optional'\n | 'all-optional'\n | 'required-radiobutton-list'\n | 'required-checkbox-list'\n | 'required-single-checkbox';\n\nexport interface FormFieldTagProps {\n /** Id that is placed on the component */\n id?: string;\n /** What level is the required tag, sets the styling and the text. */\n level: FormFieldTagLevel;\n /** Texts if overriding SOT */\n resources?: Partial<HNDesignsystemFormFieldTag>;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst FormFieldTag: React.FC<FormFieldTagProps> = props => {\n const { id, level, resources, testId } = props;\n const isOptional = level === 'optional' || level === 'all-optional';\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemFormFieldTag = {\n ...defaultResources,\n ...resources,\n };\n\n const textMap = {\n 'all-required': mergedResources.allRequired,\n 'required-field': mergedResources.requiredField,\n optional: mergedResources.optional,\n 'all-optional': mergedResources.allOptional,\n 'required-radiobutton-list': mergedResources.requiredRadiobuttonList,\n 'required-checkbox-list': mergedResources.requiredCheckboxList,\n 'required-single-checkbox': mergedResources.requiredSingleCheckbox,\n };\n\n return (\n <span\n id={id}\n data-testid={testId}\n data-analyticsid={AnalyticsId.FormFieldTag}\n className={classNames(styles['form-field-tag'], { [styles['form-field-tag--optional']]: isOptional })}\n >\n {textMap[level]}\n </span>\n );\n};\n\nexport default FormFieldTag;\n","import FormFieldTag from './FormFieldTag';\nexport * from './FormFieldTag';\nexport default FormFieldTag;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIQA,IAAa,gBAAgB,aAA0D;CACrF,QAAQ,UAAR;EACE,KAAK,gBAAgB,SACnB,OAAO;EACT,KAAK,gBAAgB,mBACnB,OAAO;EACT,KAAK,gBAAgB,eACnB,OAAO;EACT,KAAK,gBAAgB;EACrB,SACE,OAAO;CACX;AACF;;;ACUA,IAAM,gBAA4C,UAAS;CACzD,MAAM,EAAE,IAAI,OAAO,WAAW,WAAW;CACzC,MAAM,aAAa,UAAU,cAAc,UAAU;CAErD,MAAM,EAAE,aAAa,YAA6B,gBAAgB,SAAS;CAG3E,MAAM,kBAA8C;EAClD,GAHuB,aAAa,QAGjC;EACH,GAAG;CACL;CAEA,MAAM,UAAU;EACd,gBAAgB,gBAAgB;EAChC,kBAAkB,gBAAgB;EAClC,UAAU,gBAAgB;EAC1B,gBAAgB,gBAAgB;EAChC,6BAA6B,gBAAgB;EAC7C,0BAA0B,gBAAgB;EAC1C,4BAA4B,gBAAgB;CAC9C;CAEA,OACE,oBAAC,QAAD;EACM;EACJ,eAAa;EACb,oBAAkB,YAAY;EAC9B,WAAW,WAAW,OAAO,mBAAmB,GAAG,OAAO,8BAA8B,WAAW,CAAC;YAEnG,QAAQ;CACL,CAAA;AAEV;;;AC5DA,IAAA,uBAAe"}
package/lib/FormGroup.js CHANGED
@@ -8,7 +8,7 @@ import Title_default from "./components/Title/index.js";
8
8
  import { t as Select_default } from "./Select.js";
9
9
  import { t as FormLayout_default } from "./FormLayout.js";
10
10
  import { t as Input } from "./Input.js";
11
- import { n as RadioButton, t as getRadioLabelClasses } from "./utils3.js";
11
+ import { t as RadioButton } from "./RadioButton.js";
12
12
  import { t as Slider_default } from "./Slider.js";
13
13
  import { t as Textarea_default } from "./Textarea.js";
14
14
  import classNames from "classnames";
@@ -18,11 +18,10 @@ import formGroupStyles from "./components/FormGroup/styles.module.scss";
18
18
  //#region src/components/FormGroup/FormGroup.tsx
19
19
  var FormGroup = (props) => {
20
20
  const { ariaLabelledBy, className, errorTextId: errorTextIdProp, fieldsetClassName, formFieldTag, legendClassName, legendId, onColor = FormOnColor.onwhite, size = FormSize.medium, error, name, htmlMarkup = "fieldset", renderError = true, errorWrapperClassName, errorWrapperTestId, errorMessageRef, legendHtmlMarkup = "h5", titleHtmlMarkup = "h4" } = props;
21
- const [checkedRadioId, setCheckedRadioId] = useState();
22
21
  const radioGroupId = useId();
22
+ const [checkedRadioId, setCheckedRadioId] = useState();
23
23
  const errorTextId = useIdWithFallback(errorTextIdProp);
24
24
  const onDark = onColor === FormOnColor.ondark;
25
- const isLarge = size === FormSize.large;
26
25
  const formGroupWrapperClasses = classNames(formGroupStyles["form-group-wrapper"], className);
27
26
  const titleClasses = classNames({ [formGroupStyles["form-group-wrapper__title--on-dark"]]: onDark && !error });
28
27
  const CustomTagForLegend = legendHtmlMarkup;
@@ -49,18 +48,19 @@ var FormGroup = (props) => {
49
48
  });
50
49
  else if (isComponent(child, RadioButton)) {
51
50
  const radioId = typeof child.props.inputId === "undefined" ? radioGroupId + index : child.props.inputId;
51
+ const groupChecked = child.props.checked !== void 0 ? child.props.checked : checkedRadioId !== void 0 ? checkedRadioId === radioId : void 0;
52
52
  return React.cloneElement(child, {
53
53
  inputId: radioId,
54
54
  name: name ?? child.props.name,
55
55
  onColor,
56
56
  size,
57
+ checked: groupChecked,
57
58
  onChange: (event) => {
58
59
  setCheckedRadioId(event.target.id);
59
60
  if (child.props.onChange) child.props.onChange(event);
60
61
  },
61
62
  error: !!error,
62
- errorTextId,
63
- labelClassNames: getRadioLabelClasses(radioId, onColor, isLarge, checkedRadioId)
63
+ errorTextId
64
64
  });
65
65
  } else if (isComponent(child, Input)) return React.cloneElement(child, {
66
66
  name: name ?? child.props.name,
@@ -1 +1 @@
1
- {"version":3,"file":"FormGroup.js","names":[],"sources":["../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { CheckboxProps } from '../Checkbox/Checkbox';\nimport type { FormFieldTagProps } from '../FormFieldTag';\nimport type { FormLayoutProps } from '../FormLayout';\nimport type { InputProps } from '../Input/Input';\nimport type { RadioButtonProps } from '../RadioButton/RadioButton';\nimport type { SelectProps } from '../Select';\nimport type { SliderProps } from '../Slider';\nimport type { TextareaProps } from '../Textarea';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { isComponent } from '../../utils/component';\nimport Checkbox from '../Checkbox/Checkbox';\nimport ErrorWrapper from '../ErrorWrapper';\nimport FormFieldTag from '../FormFieldTag';\nimport FormLayout from '../FormLayout';\nimport Input from '../Input/Input';\nimport RadioButton from '../RadioButton/RadioButton';\nimport { getRadioLabelClasses } from '../RadioButton/utils';\nimport Select from '../Select';\nimport Slider from '../Slider';\nimport Textarea from '../Textarea';\nimport Title, { type TitleTags } from '../Title';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport type FormGroupTags = 'fieldset' | 'div';\n\nexport interface FormGroupProps {\n /** Can be used as a replacement text for legend in cases where the group title already exists externally */\n ariaLabelledBy?: string;\n /** title for the the fieldset */\n title?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** id for the legend tag */\n legendId?: string;\n /** Items in the FormGroup component */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the errorWrapper. */\n errorWrapperClassName?: string;\n /** Adds custom classes to the fieldset element. */\n fieldsetClassName?: string;\n /** Sets a tag that describes whether the form group is required or optional */\n formFieldTag?: React.ReactNode;\n /** Adds custom classes to the legend element. */\n legendClassName?: string;\n /** Changes the visuals of the formgroup */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Error message */\n error?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error-wrapper. */\n errorWrapperTestId?: string;\n /** Unique name for the child input element */\n name?: string;\n /** Unique name for the fieldset */\n fieldsetName?: string;\n /** Sets div instead of fieldset tag */\n htmlMarkup?: FormGroupTags;\n /** Markup for legend if formgroup htmlMarkup is div*/\n legendHtmlMarkup?: TitleTags;\n /** Markup for title */\n titleHtmlMarkup?: TitleTags;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n}\n\nexport const FormGroup: React.FC<FormGroupProps> = (props: FormGroupProps) => {\n const {\n ariaLabelledBy,\n className,\n errorTextId: errorTextIdProp,\n fieldsetClassName,\n formFieldTag,\n legendClassName,\n legendId,\n onColor = FormOnColor.onwhite,\n size = FormSize.medium,\n error,\n name,\n htmlMarkup = 'fieldset',\n renderError = true,\n errorWrapperClassName,\n errorWrapperTestId,\n errorMessageRef,\n legendHtmlMarkup = 'h5',\n titleHtmlMarkup = 'h4',\n } = props;\n const [checkedRadioId, setCheckedRadioId] = useState<string>();\n const radioGroupId = useId();\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const onDark = onColor === FormOnColor.ondark;\n const isLarge = size === FormSize.large;\n const formGroupWrapperClasses = classNames(formGroupStyles['form-group-wrapper'], className);\n const titleClasses = classNames({\n [formGroupStyles['form-group-wrapper__title--on-dark']]: onDark && !error,\n });\n\n const CustomTagForLegend = legendHtmlMarkup;\n\n const legendClasses = classNames(\n formGroupStyles['field-set__legend'],\n {\n [formGroupStyles['field-set__legend--on-dark']]: onDark && !error,\n },\n legendClassName\n );\n\n const fieldsetClasses = classNames(formGroupStyles['field-set'], fieldsetClassName);\n\n const mapFormComponent = (child: React.ReactNode, index: number): React.ReactNode => {\n if (isComponent<FormLayoutProps>(child, FormLayout)) {\n return React.cloneElement(child, {\n size,\n mapHelper: mapFormComponent,\n });\n } else if (isComponent<FormGroupProps>(child, FormGroup)) {\n return React.cloneElement(child, {\n onColor,\n size,\n error,\n renderError: false,\n errorTextId: errorTextId,\n });\n } else if (isComponent<CheckboxProps>(child, Checkbox)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<RadioButtonProps>(child, RadioButton)) {\n const radioId = typeof child.props.inputId === 'undefined' ? radioGroupId + index : child.props.inputId;\n return React.cloneElement(child, {\n inputId: radioId,\n name: name ?? child.props.name,\n onColor,\n size,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n setCheckedRadioId(event.target.id);\n if (child.props.onChange) child.props.onChange(event);\n },\n error: !!error,\n errorTextId: errorTextId,\n labelClassNames: getRadioLabelClasses(radioId, onColor as FormOnColor, isLarge, checkedRadioId),\n });\n } else if (isComponent<InputProps>(child, Input)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<TextareaProps>(child, Textarea)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SelectProps>(child, Select)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SliderProps>(child, Slider)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n error: !!error,\n errorTextId: errorTextId,\n });\n }\n return child;\n };\n\n const formGroupContent = (): React.ReactNode => {\n return (\n <div>\n {htmlMarkup === 'div' && (\n <div className={fieldsetClasses}>\n {props.legend && (\n <>\n <CustomTagForLegend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </CustomTagForLegend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </div>\n )}\n {htmlMarkup === 'fieldset' && (\n <fieldset aria-labelledby={ariaLabelledBy} name={props.fieldsetName} className={fieldsetClasses}>\n {props.legend && (\n <>\n <legend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </legend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </fieldset>\n )}\n </div>\n );\n };\n\n return (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.FormGroup} className={formGroupWrapperClasses}>\n {props.title && (\n <Title\n className={titleClasses}\n htmlMarkup={titleHtmlMarkup}\n appearance={'title4'}\n margin={{ marginTop: 0, marginBottom: error ? 1 : 2 }}\n >\n {props.title}\n </Title>\n )}\n <ErrorWrapper\n className={errorWrapperClassName}\n errorText={error}\n testId={errorWrapperTestId}\n errorTextId={errorTextId}\n errorMessageRef={errorMessageRef}\n renderError={renderError}\n >\n {formGroupContent()}\n </ErrorWrapper>\n </div>\n );\n};\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":"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"}
1
+ {"version":3,"file":"FormGroup.js","names":[],"sources":["../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { CheckboxProps } from '../Checkbox/Checkbox';\nimport type { FormFieldTagProps } from '../FormFieldTag';\nimport type { FormLayoutProps } from '../FormLayout';\nimport type { InputProps } from '../Input/Input';\nimport type { RadioButtonProps } from '../RadioButton/RadioButton';\nimport type { SelectProps } from '../Select';\nimport type { SliderProps } from '../Slider';\nimport type { TextareaProps } from '../Textarea';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { isComponent } from '../../utils/component';\nimport Checkbox from '../Checkbox/Checkbox';\nimport ErrorWrapper from '../ErrorWrapper';\nimport FormFieldTag from '../FormFieldTag';\nimport FormLayout from '../FormLayout';\nimport Input from '../Input/Input';\nimport RadioButton from '../RadioButton/RadioButton';\nimport Select from '../Select';\nimport Slider from '../Slider';\nimport Textarea from '../Textarea';\nimport Title, { type TitleTags } from '../Title';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport type FormGroupTags = 'fieldset' | 'div';\n\nexport interface FormGroupProps {\n /** Can be used as a replacement text for legend in cases where the group title already exists externally */\n ariaLabelledBy?: string;\n /** title for the the fieldset */\n title?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** id for the legend tag */\n legendId?: string;\n /** Items in the FormGroup component */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the errorWrapper. */\n errorWrapperClassName?: string;\n /** Adds custom classes to the fieldset element. */\n fieldsetClassName?: string;\n /** Sets a tag that describes whether the form group is required or optional */\n formFieldTag?: React.ReactNode;\n /** Adds custom classes to the legend element. */\n legendClassName?: string;\n /** Changes the visuals of the formgroup */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Error message */\n error?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error-wrapper. */\n errorWrapperTestId?: string;\n /** Unique name for the child input element */\n name?: string;\n /** Unique name for the fieldset */\n fieldsetName?: string;\n /** Sets div instead of fieldset tag */\n htmlMarkup?: FormGroupTags;\n /** Markup for legend if formgroup htmlMarkup is div*/\n legendHtmlMarkup?: TitleTags;\n /** Markup for title */\n titleHtmlMarkup?: TitleTags;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n}\n\nexport const FormGroup: React.FC<FormGroupProps> = (props: FormGroupProps) => {\n const {\n ariaLabelledBy,\n className,\n errorTextId: errorTextIdProp,\n fieldsetClassName,\n formFieldTag,\n legendClassName,\n legendId,\n onColor = FormOnColor.onwhite,\n size = FormSize.medium,\n error,\n name,\n htmlMarkup = 'fieldset',\n renderError = true,\n errorWrapperClassName,\n errorWrapperTestId,\n errorMessageRef,\n legendHtmlMarkup = 'h5',\n titleHtmlMarkup = 'h4',\n } = props;\n const radioGroupId = useId();\n const [checkedRadioId, setCheckedRadioId] = useState<string>();\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const onDark = onColor === FormOnColor.ondark;\n const formGroupWrapperClasses = classNames(formGroupStyles['form-group-wrapper'], className);\n const titleClasses = classNames({\n [formGroupStyles['form-group-wrapper__title--on-dark']]: onDark && !error,\n });\n\n const CustomTagForLegend = legendHtmlMarkup;\n\n const legendClasses = classNames(\n formGroupStyles['field-set__legend'],\n {\n [formGroupStyles['field-set__legend--on-dark']]: onDark && !error,\n },\n legendClassName\n );\n\n const fieldsetClasses = classNames(formGroupStyles['field-set'], fieldsetClassName);\n\n const mapFormComponent = (child: React.ReactNode, index: number): React.ReactNode => {\n if (isComponent<FormLayoutProps>(child, FormLayout)) {\n return React.cloneElement(child, {\n size,\n mapHelper: mapFormComponent,\n });\n } else if (isComponent<FormGroupProps>(child, FormGroup)) {\n return React.cloneElement(child, {\n onColor,\n size,\n error,\n renderError: false,\n errorTextId: errorTextId,\n });\n } else if (isComponent<CheckboxProps>(child, Checkbox)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<RadioButtonProps>(child, RadioButton)) {\n const radioId = typeof child.props.inputId === 'undefined' ? radioGroupId + index : child.props.inputId;\n const groupChecked =\n child.props.checked !== undefined ? child.props.checked : checkedRadioId !== undefined ? checkedRadioId === radioId : undefined;\n return React.cloneElement(child, {\n inputId: radioId,\n name: name ?? child.props.name,\n onColor,\n size,\n checked: groupChecked,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n setCheckedRadioId(event.target.id);\n if (child.props.onChange) child.props.onChange(event);\n },\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<InputProps>(child, Input)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<TextareaProps>(child, Textarea)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SelectProps>(child, Select)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SliderProps>(child, Slider)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n error: !!error,\n errorTextId: errorTextId,\n });\n }\n return child;\n };\n\n const formGroupContent = (): React.ReactNode => {\n return (\n <div>\n {htmlMarkup === 'div' && (\n <div className={fieldsetClasses}>\n {props.legend && (\n <>\n <CustomTagForLegend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </CustomTagForLegend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </div>\n )}\n {htmlMarkup === 'fieldset' && (\n <fieldset aria-labelledby={ariaLabelledBy} name={props.fieldsetName} className={fieldsetClasses}>\n {props.legend && (\n <>\n <legend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </legend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </fieldset>\n )}\n </div>\n );\n };\n\n return (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.FormGroup} className={formGroupWrapperClasses}>\n {props.title && (\n <Title\n className={titleClasses}\n htmlMarkup={titleHtmlMarkup}\n appearance={'title4'}\n margin={{ marginTop: 0, marginBottom: error ? 1 : 2 }}\n >\n {props.title}\n </Title>\n )}\n <ErrorWrapper\n className={errorWrapperClassName}\n errorText={error}\n testId={errorWrapperTestId}\n errorTextId={errorTextId}\n errorMessageRef={errorMessageRef}\n renderError={renderError}\n >\n {formGroupContent()}\n </ErrorWrapper>\n </div>\n );\n};\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormLayout.js","names":[],"sources":["../src/components/FormLayout/constants.ts","../src/components/FormLayout/FormLayout.tsx","../src/components/FormLayout/index.ts"],"sourcesContent":["export enum FormLayoutColumns {\n one = 'one',\n two = 'two',\n three = 'three',\n four = 'four',\n five = 'five',\n}\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { FormLayoutColumns } from './constants';\nimport { AnalyticsId, FormSize } from '../../constants';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport interface FormLayoutProps {\n /** The max number of columns that will exist if space is available */\n maxColumns?: keyof typeof FormLayoutColumns;\n /** Sets the minimum width for the columns in pixels - this determines how many will fit on a row */\n colMinWidth?: number;\n /** Items in the FormLayout component */\n children?: React.ReactNode;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Function that helps map the form children */\n mapHelper?: (child: React.ReactNode, index: number) => React.ReactNode;\n /** Ref passed to the root div */\n ref?: React.Ref<HTMLDivElement | null>;\n}\n\nexport const FormLayout: React.FC<FormLayoutProps> = (props: FormLayoutProps) => {\n const { maxColumns: columns = FormLayoutColumns.one, colMinWidth = 300, size, className, mapHelper, ref } = props;\n\n const cssVariable = { '--min-col-width': `${colMinWidth}px` } as React.CSSProperties;\n const formLayoutContainerClasses = classNames(\n formGroupStyles['form-layout-container'],\n {\n [formGroupStyles['form-layout-container--large']]: size === FormSize.large,\n },\n className\n );\n const formLayoutChildClasses = classNames(formGroupStyles['form-layout-child'], {\n [formGroupStyles['form-layout-child--two']]: columns === FormLayoutColumns.two,\n [formGroupStyles['form-layout-child--three']]: columns === FormLayoutColumns.three,\n [formGroupStyles['form-layout-child--four']]: columns === FormLayoutColumns.four,\n [formGroupStyles['form-layout-child--five']]: columns === FormLayoutColumns.five,\n });\n\n return (\n <div\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.FormLayout}\n style={cssVariable}\n className={formLayoutContainerClasses}\n ref={ref}\n >\n {React.Children.map(props.children, (child: React.ReactNode, index: number) => {\n return <div className={formLayoutChildClasses}>{mapHelper ? mapHelper(child, index) : child}</div>;\n })}\n </div>\n );\n};\n\nFormLayout.displayName = 'FormLayout';\n\nexport default FormLayout;\n","import FormLayout from './FormLayout';\nexport { FormLayoutColumns } from './constants';\nexport * from './FormLayout';\nexport default FormLayout;\n"],"mappings":";;;;;;AAAA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,SAAM;CACN,kBAAA,SAAM;CACN,kBAAA,WAAQ;CACR,kBAAA,UAAO;CACP,kBAAA,UAAO;;KACR;;;ACsBD,IAAa,cAAyC,UAA2B;CAC/E,MAAM,EAAE,YAAY,UAAU,kBAAkB,KAAK,cAAc,KAAK,MAAM,WAAW,WAAW,QAAQ;CAE5G,MAAM,cAAc,EAAE,mBAAmB,GAAG,YAAY,KAAK;CAC7D,MAAM,6BAA6B,WACjC,gBAAgB,0BAChB,GACG,gBAAgB,kCAAkC,SAAS,SAAS,OACtE,EACD,UACD;CACD,MAAM,yBAAyB,WAAW,gBAAgB,sBAAsB;GAC7E,gBAAgB,4BAA4B,YAAY,kBAAkB;GAC1E,gBAAgB,8BAA8B,YAAY,kBAAkB;GAC5E,gBAAgB,6BAA6B,YAAY,kBAAkB;GAC3E,gBAAgB,6BAA6B,YAAY,kBAAkB;EAC7E,CAAC;CAEF,OACE,oBAAC,OAAD;EACE,eAAa,MAAM;EACnB,oBAAkB,YAAY;EAC9B,OAAO;EACP,WAAW;EACN;YAEJ,MAAM,SAAS,IAAI,MAAM,WAAW,OAAwB,UAAkB;GAC7E,OAAO,oBAAC,OAAD;IAAK,WAAW;cAAyB,YAAY,UAAU,OAAO,MAAM,GAAG;IAAY,CAAA;IAClG;EACE,CAAA;;AAIV,WAAW,cAAc;;;AC1DzB,IAAA,qBAAe"}
1
+ {"version":3,"file":"FormLayout.js","names":[],"sources":["../src/components/FormLayout/constants.ts","../src/components/FormLayout/FormLayout.tsx","../src/components/FormLayout/index.ts"],"sourcesContent":["export enum FormLayoutColumns {\n one = 'one',\n two = 'two',\n three = 'three',\n four = 'four',\n five = 'five',\n}\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { FormLayoutColumns } from './constants';\nimport { AnalyticsId, FormSize } from '../../constants';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport interface FormLayoutProps {\n /** The max number of columns that will exist if space is available */\n maxColumns?: keyof typeof FormLayoutColumns;\n /** Sets the minimum width for the columns in pixels - this determines how many will fit on a row */\n colMinWidth?: number;\n /** Items in the FormLayout component */\n children?: React.ReactNode;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Function that helps map the form children */\n mapHelper?: (child: React.ReactNode, index: number) => React.ReactNode;\n /** Ref passed to the root div */\n ref?: React.Ref<HTMLDivElement | null>;\n}\n\nexport const FormLayout: React.FC<FormLayoutProps> = (props: FormLayoutProps) => {\n const { maxColumns: columns = FormLayoutColumns.one, colMinWidth = 300, size, className, mapHelper, ref } = props;\n\n const cssVariable = { '--min-col-width': `${colMinWidth}px` } as React.CSSProperties;\n const formLayoutContainerClasses = classNames(\n formGroupStyles['form-layout-container'],\n {\n [formGroupStyles['form-layout-container--large']]: size === FormSize.large,\n },\n className\n );\n const formLayoutChildClasses = classNames(formGroupStyles['form-layout-child'], {\n [formGroupStyles['form-layout-child--two']]: columns === FormLayoutColumns.two,\n [formGroupStyles['form-layout-child--three']]: columns === FormLayoutColumns.three,\n [formGroupStyles['form-layout-child--four']]: columns === FormLayoutColumns.four,\n [formGroupStyles['form-layout-child--five']]: columns === FormLayoutColumns.five,\n });\n\n return (\n <div\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.FormLayout}\n style={cssVariable}\n className={formLayoutContainerClasses}\n ref={ref}\n >\n {React.Children.map(props.children, (child: React.ReactNode, index: number) => {\n return <div className={formLayoutChildClasses}>{mapHelper ? mapHelper(child, index) : child}</div>;\n })}\n </div>\n );\n};\n\nFormLayout.displayName = 'FormLayout';\n\nexport default FormLayout;\n","import FormLayout from './FormLayout';\nexport { FormLayoutColumns } from './constants';\nexport * from './FormLayout';\nexport default FormLayout;\n"],"mappings":";;;;;;AAAA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,SAAA;CACA,kBAAA,SAAA;CACA,kBAAA,WAAA;CACA,kBAAA,UAAA;CACA,kBAAA,UAAA;;AACF,EAAA,CAAA,CAAA;;;ACsBA,IAAa,cAAyC,UAA2B;CAC/E,MAAM,EAAE,YAAY,UAAU,kBAAkB,KAAK,cAAc,KAAK,MAAM,WAAW,WAAW,QAAQ;CAE5G,MAAM,cAAc,EAAE,mBAAmB,GAAG,YAAY,IAAI;CAC5D,MAAM,6BAA6B,WACjC,gBAAgB,0BAChB,GACG,gBAAgB,kCAAkC,SAAS,SAAS,MACvE,GACA,SACF;CACA,MAAM,yBAAyB,WAAW,gBAAgB,sBAAsB;GAC7E,gBAAgB,4BAA4B,YAAY,kBAAkB;GAC1E,gBAAgB,8BAA8B,YAAY,kBAAkB;GAC5E,gBAAgB,6BAA6B,YAAY,kBAAkB;GAC3E,gBAAgB,6BAA6B,YAAY,kBAAkB;CAC9E,CAAC;CAED,OACE,oBAAC,OAAD;EACE,eAAa,MAAM;EACnB,oBAAkB,YAAY;EAC9B,OAAO;EACP,WAAW;EACN;YAEJ,MAAM,SAAS,IAAI,MAAM,WAAW,OAAwB,UAAkB;GAC7E,OAAO,oBAAC,OAAD;IAAK,WAAW;cAAyB,YAAY,UAAU,OAAO,KAAK,IAAI;GAAW,CAAA;EACnG,CAAC;CACE,CAAA;AAET;AAEA,WAAW,cAAc;;;AC1DzB,IAAA,qBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"HelpDetails.js","names":[],"sources":["../src/components/HelpDetails/HelpDetails.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport { arrow, FloatingArrow, autoUpdate, useFloating, offset, size } from '@floating-ui/react';\nimport classNames from 'classnames';\n\nimport styles from './styles.module.scss';\n\nconst BUBBLE_WIDTH_OFFSET = 26;\nconst BUBBLE_Y_OFFSET = 1;\n\nexport interface HelpDetailsProps {\n /** Sets the text content of the HelpDetails. */\n children: React.ReactNode;\n /** Ref for the element the HelpDetails is placed upon */\n controllerRef?: React.RefObject<HTMLButtonElement | null>;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the component */\n ref?: React.Ref<HTMLDivElement | null>;\n}\nconst HelpDetails: React.FC<HelpDetailsProps> = props => {\n const { children, controllerRef, testId, ref } = props;\n const arrowRef = useRef(null);\n const [bubbleMinWidth, setBubbleMinWidth] = React.useState<number | null>(null);\n const [arrowYOffsetValue, setArrowYOffsetValue] = useState<number>();\n\n const { refs, context, floatingStyles } = useFloating({\n middleware: [\n offset(arrowYOffsetValue),\n controllerRef && arrow({ element: arrowRef }),\n size({\n apply({ rects }) {\n // Vi setter minimum bredde på bubble basert på controllerRef sin x posisjon og halve bredden\n setBubbleMinWidth(rects.reference.x + rects.reference.width / 2);\n\n // Vi kalkulerer pilens y-offset basert på avstand mellom controllerRef og bubble\n const { reference, floating } = rects;\n const controllerBottom = reference.y + reference.height;\n const bubbleTop = floating.y;\n const distance = bubbleTop - controllerBottom + BUBBLE_Y_OFFSET;\n setArrowYOffsetValue(distance);\n },\n }),\n ],\n placement: 'bottom',\n whileElementsMounted: autoUpdate,\n elements: {\n reference: controllerRef?.current,\n },\n });\n\n const helpDetailsClasses = classNames(\n styles['help-details'],\n controllerRef ? styles['help-details--inline'] : styles['help-details--standalone']\n );\n const contentClasses = classNames(controllerRef ? styles['help-details__content--inline'] : styles['help-details__content--standalone']);\n\n return (\n <div\n className={helpDetailsClasses}\n data-testid={testId}\n ref={ref}\n style={{ minWidth: bubbleMinWidth ? `${bubbleMinWidth + BUBBLE_WIDTH_OFFSET}px` : undefined }}\n >\n <div style={floatingStyles} ref={refs.setFloating}>\n {controllerRef && typeof arrowYOffsetValue !== 'undefined' && (\n <FloatingArrow\n ref={arrowRef}\n context={context}\n fill={'var(--core-color-plum-50)'}\n stroke={'var(--core-color-plum-400)'}\n strokeWidth={1}\n />\n )}\n </div>\n <div className={contentClasses}>{children}</div>\n </div>\n );\n};\n\nHelpDetails.displayName = 'HelpDetails';\n\nexport default HelpDetails;\n"],"mappings":";;;;;;AAOA,IAAM,sBAAsB;AAC5B,IAAM,kBAAkB;AAYxB,IAAM,eAA0C,UAAS;CACvD,MAAM,EAAE,UAAU,eAAe,QAAQ,QAAQ;CACjD,MAAM,WAAW,OAAO,KAAK;CAC7B,MAAM,CAAC,gBAAgB,qBAAqB,MAAM,SAAwB,KAAK;CAC/E,MAAM,CAAC,mBAAmB,wBAAwB,UAAkB;CAEpE,MAAM,EAAE,MAAM,SAAS,mBAAmB,YAAY;EACpD,YAAY;GACV,OAAO,kBAAkB;GACzB,iBAAiB,MAAM,EAAE,SAAS,UAAU,CAAC;GAC7C,KAAK,EACH,MAAM,EAAE,SAAS;IAEf,kBAAkB,MAAM,UAAU,IAAI,MAAM,UAAU,QAAQ,EAAE;IAGhE,MAAM,EAAE,WAAW,aAAa;IAChC,MAAM,mBAAmB,UAAU,IAAI,UAAU;IAGjD,qBAFkB,SAAS,IACE,mBAAmB,gBAClB;MAEjC,CAAC;GACH;EACD,WAAW;EACX,sBAAsB;EACtB,UAAU,EACR,WAAW,eAAe,SAC3B;EACF,CAAC;CAEF,MAAM,qBAAqB,WACzB,OAAO,iBACP,gBAAgB,OAAO,0BAA0B,OAAO,4BACzD;CACD,MAAM,iBAAiB,WAAW,gBAAgB,OAAO,mCAAmC,OAAO,qCAAqC;CAExI,OACE,qBAAC,OAAD;EACE,WAAW;EACX,eAAa;EACR;EACL,OAAO,EAAE,UAAU,iBAAiB,GAAG,iBAAiB,oBAAoB,MAAM,KAAA,GAAW;YAJ/F,CAME,oBAAC,OAAD;GAAK,OAAO;GAAgB,KAAK,KAAK;aACnC,iBAAiB,OAAO,sBAAsB,eAC7C,oBAAC,eAAD;IACE,KAAK;IACI;IACT,MAAM;IACN,QAAQ;IACR,aAAa;IACb,CAAA;GAEA,CAAA,EACN,oBAAC,OAAD;GAAK,WAAW;GAAiB;GAAe,CAAA,CAC5C;;;AAIV,YAAY,cAAc"}
1
+ {"version":3,"file":"HelpDetails.js","names":[],"sources":["../src/components/HelpDetails/HelpDetails.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport { arrow, FloatingArrow, autoUpdate, useFloating, offset, size } from '@floating-ui/react';\nimport classNames from 'classnames';\n\nimport styles from './styles.module.scss';\n\nconst BUBBLE_WIDTH_OFFSET = 26;\nconst BUBBLE_Y_OFFSET = 1;\n\nexport interface HelpDetailsProps {\n /** Sets the text content of the HelpDetails. */\n children: React.ReactNode;\n /** Ref for the element the HelpDetails is placed upon */\n controllerRef?: React.RefObject<HTMLButtonElement | null>;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the component */\n ref?: React.Ref<HTMLDivElement | null>;\n}\nconst HelpDetails: React.FC<HelpDetailsProps> = props => {\n const { children, controllerRef, testId, ref } = props;\n const arrowRef = useRef(null);\n const [bubbleMinWidth, setBubbleMinWidth] = React.useState<number | null>(null);\n const [arrowYOffsetValue, setArrowYOffsetValue] = useState<number>();\n\n const { refs, context, floatingStyles } = useFloating({\n middleware: [\n offset(arrowYOffsetValue),\n controllerRef && arrow({ element: arrowRef }),\n size({\n apply({ rects }) {\n // Vi setter minimum bredde på bubble basert på controllerRef sin x posisjon og halve bredden\n setBubbleMinWidth(rects.reference.x + rects.reference.width / 2);\n\n // Vi kalkulerer pilens y-offset basert på avstand mellom controllerRef og bubble\n const { reference, floating } = rects;\n const controllerBottom = reference.y + reference.height;\n const bubbleTop = floating.y;\n const distance = bubbleTop - controllerBottom + BUBBLE_Y_OFFSET;\n setArrowYOffsetValue(distance);\n },\n }),\n ],\n placement: 'bottom',\n whileElementsMounted: autoUpdate,\n elements: {\n reference: controllerRef?.current,\n },\n });\n\n const helpDetailsClasses = classNames(\n styles['help-details'],\n controllerRef ? styles['help-details--inline'] : styles['help-details--standalone']\n );\n const contentClasses = classNames(controllerRef ? styles['help-details__content--inline'] : styles['help-details__content--standalone']);\n\n return (\n <div\n className={helpDetailsClasses}\n data-testid={testId}\n ref={ref}\n style={{ minWidth: bubbleMinWidth ? `${bubbleMinWidth + BUBBLE_WIDTH_OFFSET}px` : undefined }}\n >\n <div style={floatingStyles} ref={refs.setFloating}>\n {controllerRef && typeof arrowYOffsetValue !== 'undefined' && (\n <FloatingArrow\n ref={arrowRef}\n context={context}\n fill={'var(--core-color-plum-50)'}\n stroke={'var(--core-color-plum-400)'}\n strokeWidth={1}\n />\n )}\n </div>\n <div className={contentClasses}>{children}</div>\n </div>\n );\n};\n\nHelpDetails.displayName = 'HelpDetails';\n\nexport default HelpDetails;\n"],"mappings":";;;;;;AAOA,IAAM,sBAAsB;AAC5B,IAAM,kBAAkB;AAYxB,IAAM,eAA0C,UAAS;CACvD,MAAM,EAAE,UAAU,eAAe,QAAQ,QAAQ;CACjD,MAAM,WAAW,OAAO,IAAI;CAC5B,MAAM,CAAC,gBAAgB,qBAAqB,MAAM,SAAwB,IAAI;CAC9E,MAAM,CAAC,mBAAmB,wBAAwB,SAAiB;CAEnE,MAAM,EAAE,MAAM,SAAS,mBAAmB,YAAY;EACpD,YAAY;GACV,OAAO,iBAAiB;GACxB,iBAAiB,MAAM,EAAE,SAAS,SAAS,CAAC;GAC5C,KAAK,EACH,MAAM,EAAE,SAAS;IAEf,kBAAkB,MAAM,UAAU,IAAI,MAAM,UAAU,QAAQ,CAAC;IAG/D,MAAM,EAAE,WAAW,aAAa;IAChC,MAAM,mBAAmB,UAAU,IAAI,UAAU;IAGjD,qBAFkB,SAAS,IACE,mBAAmB,eACnB;GAC/B,EACF,CAAC;EACH;EACA,WAAW;EACX,sBAAsB;EACtB,UAAU,EACR,WAAW,eAAe,QAC5B;CACF,CAAC;CAED,MAAM,qBAAqB,WACzB,OAAO,iBACP,gBAAgB,OAAO,0BAA0B,OAAO,2BAC1D;CACA,MAAM,iBAAiB,WAAW,gBAAgB,OAAO,mCAAmC,OAAO,oCAAoC;CAEvI,OACE,qBAAC,OAAD;EACE,WAAW;EACX,eAAa;EACR;EACL,OAAO,EAAE,UAAU,iBAAiB,GAAG,iBAAiB,oBAAoB,MAAM,KAAA,EAAU;YAJ9F,CAME,oBAAC,OAAD;GAAK,OAAO;GAAgB,KAAK,KAAK;aACnC,iBAAiB,OAAO,sBAAsB,eAC7C,oBAAC,eAAD;IACE,KAAK;IACI;IACT,MAAM;IACN,QAAQ;IACR,aAAa;GACd,CAAA;EAEA,CAAA,GACL,oBAAC,OAAD;GAAK,WAAW;GAAiB;EAAc,CAAA,CAC5C;;AAET;AAEA,YAAY,cAAc"}