@helsenorge/designsystem-react 13.5.0 → 13.6.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 (583) hide show
  1. package/lib/AnchorLink.js +2 -2
  2. package/lib/AnchorLink.js.map +1 -1
  3. package/lib/Avatar.js +2 -2
  4. package/lib/Avatar.js.map +1 -1
  5. package/lib/Badge.js +2 -2
  6. package/lib/Badge.js.map +1 -1
  7. package/lib/Button.js +6 -6
  8. package/lib/Button.js.map +1 -1
  9. package/lib/CHANGELOG.md +24 -1
  10. package/lib/Checkbox.js +6 -6
  11. package/lib/Checkbox.js.map +1 -1
  12. package/lib/Close.js +3 -3
  13. package/lib/Close.js.map +1 -1
  14. package/lib/DictionaryTrigger.js +2 -2
  15. package/lib/DictionaryTrigger.js.map +1 -1
  16. package/lib/Drawer.js +5 -5
  17. package/lib/Drawer.js.map +1 -1
  18. package/lib/Duolist.js +8 -5
  19. package/lib/Duolist.js.map +1 -1
  20. package/lib/ElementHeader.js +9 -9
  21. package/lib/ElementHeader.js.map +1 -1
  22. package/lib/ElementHeaderText.js +4 -4
  23. package/lib/ElementHeaderText.js.map +1 -1
  24. package/lib/ErrorWrapper.js +2 -2
  25. package/lib/ErrorWrapper.js.map +1 -1
  26. package/lib/Expander.js +12 -8
  27. package/lib/Expander.js.map +1 -1
  28. package/lib/FormFieldTag.js +2 -2
  29. package/lib/FormFieldTag.js.map +1 -1
  30. package/lib/FormGroup.js +9 -8
  31. package/lib/FormGroup.js.map +1 -1
  32. package/lib/FormLayout.js +3 -3
  33. package/lib/FormLayout.js.map +1 -1
  34. package/lib/HelpDetails.js +3 -3
  35. package/lib/HelpDetails.js.map +1 -1
  36. package/lib/HelpTriggerIcon.js +2 -2
  37. package/lib/HelpTriggerIcon.js.map +1 -1
  38. package/lib/HelpTriggerStandalone.js +2 -2
  39. package/lib/HelpTriggerStandalone.js.map +1 -1
  40. package/lib/HighlightPanel.js +3 -3
  41. package/lib/HighlightPanel.js.map +1 -1
  42. package/lib/HorizontalScroll.js +4 -4
  43. package/lib/HorizontalScroll.js.map +1 -1
  44. package/lib/Icon.js +2 -2
  45. package/lib/Icon.js.map +1 -1
  46. package/lib/InfoTeaser.js +5 -4
  47. package/lib/InfoTeaser.js.map +1 -1
  48. package/lib/Input.js +4 -4
  49. package/lib/Input.js.map +1 -1
  50. package/lib/Label.js +5 -5
  51. package/lib/Label.js.map +1 -1
  52. package/lib/LinkList.js +5 -5
  53. package/lib/LinkList.js.map +1 -1
  54. package/lib/List.js +2 -2
  55. package/lib/List.js.map +1 -1
  56. package/lib/ListEditMode.js +4 -4
  57. package/lib/ListEditMode.js.map +1 -1
  58. package/lib/MaxCharacters.js +2 -2
  59. package/lib/MaxCharacters.js.map +1 -1
  60. package/lib/Panel.js +63 -39
  61. package/lib/Panel.js.map +1 -1
  62. package/lib/PanelOld.js +14 -14
  63. package/lib/PanelOld.js.map +1 -1
  64. package/lib/PanelTitle.js +2 -2
  65. package/lib/PanelTitle.js.map +1 -1
  66. package/lib/PopOver.js +2 -2
  67. package/lib/PopOver.js.map +1 -1
  68. package/lib/RadioButton.js +5 -5
  69. package/lib/RadioButton.js.map +1 -1
  70. package/lib/Select.js +4 -4
  71. package/lib/Select.js.map +1 -1
  72. package/lib/SingleSelectItem.js +3 -3
  73. package/lib/SingleSelectItem.js.map +1 -1
  74. package/lib/Slider.js +4 -4
  75. package/lib/Slider.js.map +1 -1
  76. package/lib/Spacer.js +2 -2
  77. package/lib/Spacer.js.map +1 -1
  78. package/lib/StatusDot.js +4 -4
  79. package/lib/StatusDot.js.map +1 -1
  80. package/lib/StatusDotList.js +2 -2
  81. package/lib/StatusDotList.js.map +1 -1
  82. package/lib/StepButtons.js +5 -5
  83. package/lib/StepButtons.js.map +1 -1
  84. package/lib/TabList.js +8 -8
  85. package/lib/TabList.js.map +1 -1
  86. package/lib/TabPanel.js +2 -2
  87. package/lib/TabPanel.js.map +1 -1
  88. package/lib/Table.js +2 -2
  89. package/lib/Table.js.map +1 -1
  90. package/lib/TableBody.js +2 -2
  91. package/lib/TableBody.js.map +1 -1
  92. package/lib/TableCell.js +2 -2
  93. package/lib/TableCell.js.map +1 -1
  94. package/lib/TableExpandedRow.js +4 -4
  95. package/lib/TableExpandedRow.js.map +1 -1
  96. package/lib/TableExpanderCell.js +2 -2
  97. package/lib/TableExpanderCell.js.map +1 -1
  98. package/lib/TableHead.js +2 -2
  99. package/lib/TableHead.js.map +1 -1
  100. package/lib/TableHeadCell.js +3 -3
  101. package/lib/TableHeadCell.js.map +1 -1
  102. package/lib/TableRow.js +3 -3
  103. package/lib/TableRow.js.map +1 -1
  104. package/lib/Textarea.js +4 -4
  105. package/lib/Textarea.js.map +1 -1
  106. package/lib/Title.js +2 -2
  107. package/lib/Title.js.map +1 -1
  108. package/lib/Toast.js +3 -3
  109. package/lib/Toast.js.map +1 -1
  110. package/lib/__mocks__/uuid.js +0 -1
  111. package/lib/__mocks__/uuid.js.map +1 -1
  112. package/lib/components/AnchorLink/index.js +0 -13
  113. package/lib/components/ArticleTeaser/index.js +4 -4
  114. package/lib/components/ArticleTeaser/index.js.map +1 -1
  115. package/lib/components/AsChildSlot/index.js +0 -1
  116. package/lib/components/Avatar/index.js +0 -4
  117. package/lib/components/Badge/index.js +0 -8
  118. package/lib/components/Button/index.js +0 -17
  119. package/lib/components/Checkbox/index.js +0 -44
  120. package/lib/components/Chip/index.js +2 -2
  121. package/lib/components/Chip/index.js.map +1 -1
  122. package/lib/components/Close/index.js +0 -8
  123. package/lib/components/DictionaryTrigger/index.js +0 -1
  124. package/lib/components/Drawer/index.js +0 -37
  125. package/lib/components/Drawer/styles.module.scss +6 -0
  126. package/lib/components/Dropdown/SingleSelect/index.js +0 -2
  127. package/lib/components/Dropdown/SingleSelect/index.js.map +1 -1
  128. package/lib/components/Dropdown/index.js +5 -42
  129. package/lib/components/Dropdown/index.js.map +1 -1
  130. package/lib/components/DropdownOld/index.js +3 -31
  131. package/lib/components/DropdownOld/index.js.map +1 -1
  132. package/lib/components/Duolist/Duolist.d.ts +3 -1
  133. package/lib/components/Duolist/index.js +0 -4
  134. package/lib/components/ElementHeader/ElementHeaderText/index.js +0 -9
  135. package/lib/components/ElementHeader/ElementHeaderText/index.js.map +1 -1
  136. package/lib/components/ElementHeader/StatusDotList/index.js +0 -34
  137. package/lib/components/ElementHeader/index.js +0 -48
  138. package/lib/components/ElementHeader/index.js.map +1 -1
  139. package/lib/components/EmptyState/index.js +2 -4
  140. package/lib/components/EmptyState/index.js.map +1 -1
  141. package/lib/components/Expander/index.js +0 -24
  142. package/lib/components/Expander/styles.module.scss +16 -7
  143. package/lib/components/Expander/styles.module.scss.d.ts +2 -1
  144. package/lib/components/ExpanderHierarchy/index.js +7 -8
  145. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  146. package/lib/components/ExpanderList/index.js +6 -52
  147. package/lib/components/ExpanderList/index.js.map +1 -1
  148. package/lib/components/EyebrowHeader/index.js +0 -1
  149. package/lib/components/EyebrowHeader/index.js.map +1 -1
  150. package/lib/components/FavoriteButton/index.js +2 -3
  151. package/lib/components/FavoriteButton/index.js.map +1 -1
  152. package/lib/components/FormFieldTag/index.js +0 -2
  153. package/lib/components/FormGroup/FormGroup.d.ts +5 -0
  154. package/lib/components/FormGroup/index.js +0 -55
  155. package/lib/components/FormGroup/index.js.map +1 -1
  156. package/lib/components/FormLayout/index.js +0 -1
  157. package/lib/components/HelpBubble/index.js +3 -20
  158. package/lib/components/HelpBubble/index.js.map +1 -1
  159. package/lib/components/HelpDrawer/index.js +0 -36
  160. package/lib/components/HelpDrawer/index.js.map +1 -1
  161. package/lib/components/HelpExpanderInline/index.js +0 -2
  162. package/lib/components/HelpExpanderInline/index.js.map +1 -1
  163. package/lib/components/HelpExpanderStandalone/index.js +0 -6
  164. package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
  165. package/lib/components/HelpPanel/index.js +2 -34
  166. package/lib/components/HelpPanel/index.js.map +1 -1
  167. package/lib/components/HelpTeaser/HelpTeaser.d.ts +2 -0
  168. package/lib/components/HelpTeaser/index.js +2 -9
  169. package/lib/components/HelpTeaser/index.js.map +1 -1
  170. package/lib/components/HelpTooltip/index.js +0 -2
  171. package/lib/components/HelpTooltip/index.js.map +1 -1
  172. package/lib/components/HelpTriggerIcon/index.js +0 -4
  173. package/lib/components/HelpTriggerInline/index.js +2 -2
  174. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  175. package/lib/components/HelpTriggerStandalone/index.js +0 -8
  176. package/lib/components/HighlightPanel/index.js +0 -32
  177. package/lib/components/Highlighter/index.js +0 -8
  178. package/lib/components/HorizontalScroll/index.js +0 -5
  179. package/lib/components/Icons/AlarmClock.js +0 -1
  180. package/lib/components/Icons/AlarmClock.js.map +1 -1
  181. package/lib/components/Icons/AlertSignFill.js +0 -2
  182. package/lib/components/Icons/AlertSignStroke.js +0 -2
  183. package/lib/components/Icons/Archive.js +0 -1
  184. package/lib/components/Icons/Archive.js.map +1 -1
  185. package/lib/components/Icons/ArrowDown.js +0 -2
  186. package/lib/components/Icons/ArrowLeft.js +0 -1
  187. package/lib/components/Icons/ArrowLeft.js.map +1 -1
  188. package/lib/components/Icons/ArrowRight.js +0 -2
  189. package/lib/components/Icons/ArrowUp.js +0 -2
  190. package/lib/components/Icons/ArrowUpRight.js +0 -2
  191. package/lib/components/Icons/Attachment.js +0 -1
  192. package/lib/components/Icons/Attachment.js.map +1 -1
  193. package/lib/components/Icons/Avatar.js +0 -1
  194. package/lib/components/Icons/Avatar.js.map +1 -1
  195. package/lib/components/Icons/Braille.js +0 -1
  196. package/lib/components/Icons/Braille.js.map +1 -1
  197. package/lib/components/Icons/Bus.js +0 -1
  198. package/lib/components/Icons/Bus.js.map +1 -1
  199. package/lib/components/Icons/Calendar.js +0 -2
  200. package/lib/components/Icons/CalendarChange.js +0 -1
  201. package/lib/components/Icons/CalendarChange.js.map +1 -1
  202. package/lib/components/Icons/CalendarCheck.js +0 -1
  203. package/lib/components/Icons/CalendarCheck.js.map +1 -1
  204. package/lib/components/Icons/CalendarSave.js +0 -1
  205. package/lib/components/Icons/CalendarSave.js.map +1 -1
  206. package/lib/components/Icons/Candle.js +0 -1
  207. package/lib/components/Icons/Candle.js.map +1 -1
  208. package/lib/components/Icons/Change.js +0 -1
  209. package/lib/components/Icons/Change.js.map +1 -1
  210. package/lib/components/Icons/Check.js +0 -2
  211. package/lib/components/Icons/CheckFill.js +0 -2
  212. package/lib/components/Icons/ChevronDown.js +0 -2
  213. package/lib/components/Icons/ChevronLeft.js +0 -2
  214. package/lib/components/Icons/ChevronRight.js +0 -2
  215. package/lib/components/Icons/ChevronUp.js +0 -2
  216. package/lib/components/Icons/ChevronsDown.js +0 -1
  217. package/lib/components/Icons/ChevronsDown.js.map +1 -1
  218. package/lib/components/Icons/ChevronsUp.js +0 -1
  219. package/lib/components/Icons/ChevronsUp.js.map +1 -1
  220. package/lib/components/Icons/Contacts.js +0 -1
  221. package/lib/components/Icons/Contacts.js.map +1 -1
  222. package/lib/components/Icons/Copy.js +0 -1
  223. package/lib/components/Icons/Copy.js.map +1 -1
  224. package/lib/components/Icons/DotActive.js +0 -1
  225. package/lib/components/Icons/DotActive.js.map +1 -1
  226. package/lib/components/Icons/DotAlert.js +0 -1
  227. package/lib/components/Icons/DotAlert.js.map +1 -1
  228. package/lib/components/Icons/DotCancelled.js +0 -1
  229. package/lib/components/Icons/DotCancelled.js.map +1 -1
  230. package/lib/components/Icons/DotHalfDisc.js +0 -1
  231. package/lib/components/Icons/DotHalfDisc.js.map +1 -1
  232. package/lib/components/Icons/DotInactive.js +0 -1
  233. package/lib/components/Icons/DotInactive.js.map +1 -1
  234. package/lib/components/Icons/DotInfo.js +0 -1
  235. package/lib/components/Icons/DotInfo.js.map +1 -1
  236. package/lib/components/Icons/DotLookingGlass.js +0 -1
  237. package/lib/components/Icons/DotLookingGlass.js.map +1 -1
  238. package/lib/components/Icons/DotPending.js +0 -1
  239. package/lib/components/Icons/DotPending.js.map +1 -1
  240. package/lib/components/Icons/DotQuestionMark.js +0 -1
  241. package/lib/components/Icons/DotQuestionMark.js.map +1 -1
  242. package/lib/components/Icons/DotSuccess.js +0 -1
  243. package/lib/components/Icons/DotSuccess.js.map +1 -1
  244. package/lib/components/Icons/DotTransparent.js +0 -1
  245. package/lib/components/Icons/DotTransparent.js.map +1 -1
  246. package/lib/components/Icons/DotWarningTriangle.js +0 -1
  247. package/lib/components/Icons/DotWarningTriangle.js.map +1 -1
  248. package/lib/components/Icons/Download.js +0 -1
  249. package/lib/components/Icons/Download.js.map +1 -1
  250. package/lib/components/Icons/Drag.js +0 -1
  251. package/lib/components/Icons/Drag.js.map +1 -1
  252. package/lib/components/Icons/EChat.js +0 -1
  253. package/lib/components/Icons/EChat.js.map +1 -1
  254. package/lib/components/Icons/Ear.js +0 -1
  255. package/lib/components/Icons/Ear.js.map +1 -1
  256. package/lib/components/Icons/EarDeaf.js +0 -1
  257. package/lib/components/Icons/EarDeaf.js.map +1 -1
  258. package/lib/components/Icons/EarHearingAid.js +0 -1
  259. package/lib/components/Icons/EarHearingAid.js.map +1 -1
  260. package/lib/components/Icons/EarVolume.js +0 -1
  261. package/lib/components/Icons/EarVolume.js.map +1 -1
  262. package/lib/components/Icons/Edit.js +0 -1
  263. package/lib/components/Icons/Edit.js.map +1 -1
  264. package/lib/components/Icons/EmergencyCall.js +0 -1
  265. package/lib/components/Icons/EmergencyCall.js.map +1 -1
  266. package/lib/components/Icons/EmoticonAnnoyed.js +0 -1
  267. package/lib/components/Icons/EmoticonAnnoyed.js.map +1 -1
  268. package/lib/components/Icons/EmoticonDelighted.js +0 -1
  269. package/lib/components/Icons/EmoticonDelighted.js.map +1 -1
  270. package/lib/components/Icons/EmoticonDisappointed.js +0 -1
  271. package/lib/components/Icons/EmoticonDisappointed.js.map +1 -1
  272. package/lib/components/Icons/EmoticonHappy.js +0 -1
  273. package/lib/components/Icons/EmoticonHappy.js.map +1 -1
  274. package/lib/components/Icons/EmoticonMeh.js +0 -1
  275. package/lib/components/Icons/EmoticonMeh.js.map +1 -1
  276. package/lib/components/Icons/EnterFullScreen.js +0 -1
  277. package/lib/components/Icons/EnterFullScreen.js.map +1 -1
  278. package/lib/components/Icons/Envelope.js +0 -1
  279. package/lib/components/Icons/Envelope.js.map +1 -1
  280. package/lib/components/Icons/Eraser.js +0 -1
  281. package/lib/components/Icons/Eraser.js.map +1 -1
  282. package/lib/components/Icons/ErrorSignFill.js +0 -2
  283. package/lib/components/Icons/ErrorSignStroke.js +0 -1
  284. package/lib/components/Icons/ErrorSignStroke.js.map +1 -1
  285. package/lib/components/Icons/ExitFullScreen.js +0 -1
  286. package/lib/components/Icons/ExitFullScreen.js.map +1 -1
  287. package/lib/components/Icons/Eye.js +0 -1
  288. package/lib/components/Icons/Eye.js.map +1 -1
  289. package/lib/components/Icons/FallingLeaf.js +0 -1
  290. package/lib/components/Icons/FallingLeaf.js.map +1 -1
  291. package/lib/components/Icons/File.js +0 -1
  292. package/lib/components/Icons/File.js.map +1 -1
  293. package/lib/components/Icons/Filter.js +0 -1
  294. package/lib/components/Icons/Filter.js.map +1 -1
  295. package/lib/components/Icons/Form.js +0 -1
  296. package/lib/components/Icons/Form.js.map +1 -1
  297. package/lib/components/Icons/Forward.js +0 -2
  298. package/lib/components/Icons/Gallery.js +0 -1
  299. package/lib/components/Icons/Gallery.js.map +1 -1
  300. package/lib/components/Icons/Glasses.js +0 -1
  301. package/lib/components/Icons/Glasses.js.map +1 -1
  302. package/lib/components/Icons/Globe.js +0 -1
  303. package/lib/components/Icons/Globe.js.map +1 -1
  304. package/lib/components/Icons/Graph.js +0 -1
  305. package/lib/components/Icons/Graph.js.map +1 -1
  306. package/lib/components/Icons/Group.js +0 -1
  307. package/lib/components/Icons/Group.js.map +1 -1
  308. package/lib/components/Icons/GroupTwins.js +0 -1
  309. package/lib/components/Icons/GroupTwins.js.map +1 -1
  310. package/lib/components/Icons/HTMLFile.js +0 -1
  311. package/lib/components/Icons/HTMLFile.js.map +1 -1
  312. package/lib/components/Icons/HandsAndHeart.js +0 -1
  313. package/lib/components/Icons/HandsAndHeart.js.map +1 -1
  314. package/lib/components/Icons/HealthcarePerson.js +0 -1
  315. package/lib/components/Icons/HealthcarePerson.js.map +1 -1
  316. package/lib/components/Icons/HealthcarePersonell.js +0 -1
  317. package/lib/components/Icons/HealthcarePersonell.js.map +1 -1
  318. package/lib/components/Icons/HearingProtection.js +0 -1
  319. package/lib/components/Icons/HearingProtection.js.map +1 -1
  320. package/lib/components/Icons/Heart.js +0 -1
  321. package/lib/components/Icons/Heart.js.map +1 -1
  322. package/lib/components/Icons/HelpSign.js +0 -1
  323. package/lib/components/Icons/HelpSign.js.map +1 -1
  324. package/lib/components/Icons/History.js +0 -1
  325. package/lib/components/Icons/History.js.map +1 -1
  326. package/lib/components/Icons/Home.js +0 -1
  327. package/lib/components/Icons/Home.js.map +1 -1
  328. package/lib/components/Icons/HomeFill.js +0 -1
  329. package/lib/components/Icons/HomeFill.js.map +1 -1
  330. package/lib/components/Icons/Hospital.js +0 -1
  331. package/lib/components/Icons/Hospital.js.map +1 -1
  332. package/lib/components/Icons/Hourglass.js +0 -1
  333. package/lib/components/Icons/Hourglass.js.map +1 -1
  334. package/lib/components/Icons/InfoSignFill.js +0 -2
  335. package/lib/components/Icons/InfoSignStroke.js +0 -1
  336. package/lib/components/Icons/InfoSignStroke.js.map +1 -1
  337. package/lib/components/Icons/Journal.js +0 -1
  338. package/lib/components/Icons/Journal.js.map +1 -1
  339. package/lib/components/Icons/LegalDocument.js +0 -1
  340. package/lib/components/Icons/LegalDocument.js.map +1 -1
  341. package/lib/components/Icons/List.js +0 -1
  342. package/lib/components/Icons/List.js.map +1 -1
  343. package/lib/components/Icons/Location.js +0 -1
  344. package/lib/components/Icons/Location.js.map +1 -1
  345. package/lib/components/Icons/LocationFill.js +0 -1
  346. package/lib/components/Icons/LocationFill.js.map +1 -1
  347. package/lib/components/Icons/Lock.js +0 -1
  348. package/lib/components/Icons/Lock.js.map +1 -1
  349. package/lib/components/Icons/Login.js +0 -1
  350. package/lib/components/Icons/Login.js.map +1 -1
  351. package/lib/components/Icons/Logout.js +0 -1
  352. package/lib/components/Icons/Logout.js.map +1 -1
  353. package/lib/components/Icons/MaleDoctorCompact.js +0 -1
  354. package/lib/components/Icons/MaleDoctorCompact.js.map +1 -1
  355. package/lib/components/Icons/MaleDoctorCompactFill.js +0 -1
  356. package/lib/components/Icons/MaleDoctorCompactFill.js.map +1 -1
  357. package/lib/components/Icons/Medicine.js +0 -1
  358. package/lib/components/Icons/Medicine.js.map +1 -1
  359. package/lib/components/Icons/Menu.js +0 -1
  360. package/lib/components/Icons/Menu.js.map +1 -1
  361. package/lib/components/Icons/Minus.js +0 -1
  362. package/lib/components/Icons/Minus.js.map +1 -1
  363. package/lib/components/Icons/MobilePhone.js +0 -1
  364. package/lib/components/Icons/MobilePhone.js.map +1 -1
  365. package/lib/components/Icons/NoAccess.js +0 -1
  366. package/lib/components/Icons/NoAccess.js.map +1 -1
  367. package/lib/components/Icons/NoEye.js +0 -1
  368. package/lib/components/Icons/NoEye.js.map +1 -1
  369. package/lib/components/Icons/NoFilter.js +0 -1
  370. package/lib/components/Icons/NoFilter.js.map +1 -1
  371. package/lib/components/Icons/PaperPlane.js +0 -1
  372. package/lib/components/Icons/PaperPlane.js.map +1 -1
  373. package/lib/components/Icons/Pause.js +0 -1
  374. package/lib/components/Icons/Pause.js.map +1 -1
  375. package/lib/components/Icons/Pencil.js +0 -2
  376. package/lib/components/Icons/PersonCancel.js +0 -1
  377. package/lib/components/Icons/PersonCancel.js.map +1 -1
  378. package/lib/components/Icons/PersonalPlan.js +0 -1
  379. package/lib/components/Icons/PersonalPlan.js.map +1 -1
  380. package/lib/components/Icons/Play.js +0 -1
  381. package/lib/components/Icons/Play.js.map +1 -1
  382. package/lib/components/Icons/PlusLarge.js +0 -1
  383. package/lib/components/Icons/PlusLarge.js.map +1 -1
  384. package/lib/components/Icons/PlusSmall.js +0 -2
  385. package/lib/components/Icons/Printer.js +0 -1
  386. package/lib/components/Icons/Printer.js.map +1 -1
  387. package/lib/components/Icons/QrCode.js +0 -1
  388. package/lib/components/Icons/QrCode.js.map +1 -1
  389. package/lib/components/Icons/Receptionist.js +0 -1
  390. package/lib/components/Icons/Receptionist.js.map +1 -1
  391. package/lib/components/Icons/Referral.js +0 -1
  392. package/lib/components/Icons/Referral.js.map +1 -1
  393. package/lib/components/Icons/Refresh.js +0 -1
  394. package/lib/components/Icons/Refresh.js.map +1 -1
  395. package/lib/components/Icons/Reply.js +0 -1
  396. package/lib/components/Icons/Reply.js.map +1 -1
  397. package/lib/components/Icons/Save.js +0 -1
  398. package/lib/components/Icons/Save.js.map +1 -1
  399. package/lib/components/Icons/ScreenReader.js +0 -1
  400. package/lib/components/Icons/ScreenReader.js.map +1 -1
  401. package/lib/components/Icons/Search.js +0 -1
  402. package/lib/components/Icons/Search.js.map +1 -1
  403. package/lib/components/Icons/SectionSign.js +0 -1
  404. package/lib/components/Icons/SectionSign.js.map +1 -1
  405. package/lib/components/Icons/Settings.js +0 -1
  406. package/lib/components/Icons/Settings.js.map +1 -1
  407. package/lib/components/Icons/SettingsFill.js +0 -1
  408. package/lib/components/Icons/SettingsFill.js.map +1 -1
  409. package/lib/components/Icons/Share.js +0 -1
  410. package/lib/components/Icons/Share.js.map +1 -1
  411. package/lib/components/Icons/SortDown.js +0 -1
  412. package/lib/components/Icons/SortDown.js.map +1 -1
  413. package/lib/components/Icons/SortUp.js +0 -1
  414. package/lib/components/Icons/SortUp.js.map +1 -1
  415. package/lib/components/Icons/SpeechBubble.js +0 -1
  416. package/lib/components/Icons/SpeechBubble.js.map +1 -1
  417. package/lib/components/Icons/Stopwatch.js +0 -1
  418. package/lib/components/Icons/Stopwatch.js.map +1 -1
  419. package/lib/components/Icons/Sun.js +0 -1
  420. package/lib/components/Icons/Sun.js.map +1 -1
  421. package/lib/components/Icons/SupportingPerson.js +0 -1
  422. package/lib/components/Icons/SupportingPerson.js.map +1 -1
  423. package/lib/components/Icons/TimePassing.js +0 -1
  424. package/lib/components/Icons/TimePassing.js.map +1 -1
  425. package/lib/components/Icons/Tombstone.js +0 -1
  426. package/lib/components/Icons/Tombstone.js.map +1 -1
  427. package/lib/components/Icons/Toolbox.js +0 -1
  428. package/lib/components/Icons/Toolbox.js.map +1 -1
  429. package/lib/components/Icons/TrashCan.js +0 -1
  430. package/lib/components/Icons/TrashCan.js.map +1 -1
  431. package/lib/components/Icons/TreatmentAids.js +0 -1
  432. package/lib/components/Icons/TreatmentAids.js.map +1 -1
  433. package/lib/components/Icons/TriangleX.js +0 -2
  434. package/lib/components/Icons/Undo.js +0 -2
  435. package/lib/components/Icons/Upload.js +0 -1
  436. package/lib/components/Icons/Upload.js.map +1 -1
  437. package/lib/components/Icons/Vaccine.js +0 -1
  438. package/lib/components/Icons/Vaccine.js.map +1 -1
  439. package/lib/components/Icons/VerticalDots.js +0 -2
  440. package/lib/components/Icons/VideoCamera.js +0 -1
  441. package/lib/components/Icons/VideoCamera.js.map +1 -1
  442. package/lib/components/Icons/VideoChat.js +0 -1
  443. package/lib/components/Icons/VideoChat.js.map +1 -1
  444. package/lib/components/Icons/Wallet.js +0 -1
  445. package/lib/components/Icons/Wallet.js.map +1 -1
  446. package/lib/components/Icons/Watch.js +0 -2
  447. package/lib/components/Icons/X.js +0 -2
  448. package/lib/components/Icons/Zoom.js +0 -1
  449. package/lib/components/Icons/Zoom.js.map +1 -1
  450. package/lib/components/Icons/ZoomInLeft.js +0 -1
  451. package/lib/components/Icons/ZoomInLeft.js.map +1 -1
  452. package/lib/components/Icons/ZoomOutLeft.js +0 -1
  453. package/lib/components/Icons/ZoomOutLeft.js.map +1 -1
  454. package/lib/components/Illustration/index.js +0 -2
  455. package/lib/components/Illustrations/BabyMobile.js +0 -2
  456. package/lib/components/Illustrations/BabyMobile.js.map +1 -1
  457. package/lib/components/Illustrations/BabyMobileMedium.js +0 -3
  458. package/lib/components/Illustrations/Child.js +0 -2
  459. package/lib/components/Illustrations/Child.js.map +1 -1
  460. package/lib/components/Illustrations/ChildMedium.js +0 -3
  461. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +0 -2
  462. package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
  463. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js +0 -3
  464. package/lib/components/Illustrations/GiveBabyFood.js +0 -2
  465. package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
  466. package/lib/components/Illustrations/GiveBabyFoodMedium.js +0 -3
  467. package/lib/components/Illustrations/ReadLetters.js +0 -2
  468. package/lib/components/Illustrations/ReadLetters.js.map +1 -1
  469. package/lib/components/Illustrations/ReadLettersMedium.js +0 -3
  470. package/lib/components/Illustrations/Stroller.js +0 -2
  471. package/lib/components/Illustrations/Stroller.js.map +1 -1
  472. package/lib/components/Illustrations/StrollerMedium.js +0 -3
  473. package/lib/components/Illustrations/Support2.js +0 -2
  474. package/lib/components/Illustrations/Support2.js.map +1 -1
  475. package/lib/components/Illustrations/Support2Medium.js +0 -3
  476. package/lib/components/InfoTeaser/InfoTeaser.d.ts +2 -0
  477. package/lib/components/InfoTeaser/index.js +0 -8
  478. package/lib/components/InfoTeaser/styles.module.scss +0 -2
  479. package/lib/components/Input/Input.d.ts +2 -2
  480. package/lib/components/Input/index.js +0 -44
  481. package/lib/components/Label/index.js +0 -38
  482. package/lib/components/LazyIcon/index.js +0 -4
  483. package/lib/components/LazyIllustration/index.js +0 -6
  484. package/lib/components/LinkList/index.js +0 -54
  485. package/lib/components/List/index.js +0 -1
  486. package/lib/components/ListEditMode/index.js +0 -4
  487. package/lib/components/Loader/index.js +4 -5
  488. package/lib/components/Loader/index.js.map +1 -1
  489. package/lib/components/Logo/index.js +0 -4
  490. package/lib/components/Logo/index.js.map +1 -1
  491. package/lib/components/Modal/index.js +9 -30
  492. package/lib/components/Modal/index.js.map +1 -1
  493. package/lib/components/NotificationPanel/index.js +6 -34
  494. package/lib/components/NotificationPanel/index.js.map +1 -1
  495. package/lib/components/Panel/PanelTitle/index.js +0 -11
  496. package/lib/components/Panel/index.js +0 -31
  497. package/lib/components/Panel/index.js.map +1 -1
  498. package/lib/components/PanelList/PanelList.d.ts +6 -0
  499. package/lib/components/PanelList/index.js +3 -53
  500. package/lib/components/PanelList/index.js.map +1 -1
  501. package/lib/components/PanelListOld/index.js +2 -36
  502. package/lib/components/PanelListOld/index.js.map +1 -1
  503. package/lib/components/PanelOld/index.js +0 -35
  504. package/lib/components/PopMenu/index.js +3 -54
  505. package/lib/components/PopMenu/index.js.map +1 -1
  506. package/lib/components/PopOver/index.js +0 -3
  507. package/lib/components/Portal/index.js +0 -1
  508. package/lib/components/Progressbar/index.js +2 -2
  509. package/lib/components/Progressbar/index.js.map +1 -1
  510. package/lib/components/PromoPanel/index.js +2 -12
  511. package/lib/components/PromoPanel/index.js.map +1 -1
  512. package/lib/components/RadioButton/index.js +0 -43
  513. package/lib/components/Select/index.js +0 -43
  514. package/lib/components/Select/styles.module.scss +2 -0
  515. package/lib/components/ServiceMessage/index.js +5 -48
  516. package/lib/components/ServiceMessage/index.js.map +1 -1
  517. package/lib/components/SharingStatus/index.js +4 -4
  518. package/lib/components/SharingStatus/index.js.map +1 -1
  519. package/lib/components/Slider/index.js +0 -10
  520. package/lib/components/Spacer/index.js +0 -1
  521. package/lib/components/StatusDot/index.js +0 -33
  522. package/lib/components/Step/index.js +2 -2
  523. package/lib/components/Step/index.js.map +1 -1
  524. package/lib/components/StepButtons/index.js +0 -1
  525. package/lib/components/Stepper/index.js +2 -3
  526. package/lib/components/Stepper/index.js.map +1 -1
  527. package/lib/components/StickyNote/index.js +8 -11
  528. package/lib/components/StickyNote/index.js.map +1 -1
  529. package/lib/components/Table/TableBody/index.js +0 -13
  530. package/lib/components/Table/TableCell/index.js +0 -13
  531. package/lib/components/Table/TableExpandedRow/index.js +0 -29
  532. package/lib/components/Table/TableExpanderCell/index.js +0 -30
  533. package/lib/components/Table/TableHead/index.js +0 -13
  534. package/lib/components/Table/TableHeadCell/index.js +0 -16
  535. package/lib/components/Table/TableRow/index.js +0 -30
  536. package/lib/components/Table/index.js +0 -31
  537. package/lib/components/Table/index.js.map +1 -1
  538. package/lib/components/Tabs/TabList/index.js +0 -14
  539. package/lib/components/Tabs/index.js +4 -17
  540. package/lib/components/Tabs/index.js.map +1 -1
  541. package/lib/components/Tag/index.js +2 -4
  542. package/lib/components/Tag/index.js.map +1 -1
  543. package/lib/components/Textarea/Textarea.d.ts +1 -1
  544. package/lib/components/Textarea/index.js +0 -43
  545. package/lib/components/Tile/index.js +4 -6
  546. package/lib/components/Tile/index.js.map +1 -1
  547. package/lib/components/Title/index.js +0 -1
  548. package/lib/components/Toast/index.js +0 -10
  549. package/lib/components/Toast/index.js.map +1 -1
  550. package/lib/components/ToastList/index.js +0 -9
  551. package/lib/components/ToastList/index.js.map +1 -1
  552. package/lib/components/Toggle/index.js +10 -10
  553. package/lib/components/Toggle/index.js.map +1 -1
  554. package/lib/components/Validation/index.js +2 -53
  555. package/lib/components/Validation/index.js.map +1 -1
  556. package/lib/floating-ui.react.js +65 -61
  557. package/lib/floating-ui.react.js.map +1 -1
  558. package/lib/hoc/withBreakpoint/index.js +0 -2
  559. package/lib/hoc/withBreakpoint/index.js.map +1 -1
  560. package/lib/hoc/withBreakpoint/withBreakpoint.js +0 -2
  561. package/lib/hooks/useBreakpoint.js +0 -1
  562. package/lib/hooks/useExpand.js +0 -1
  563. package/lib/hooks/useFocusToggle.js +0 -2
  564. package/lib/hooks/useFocusTrap.js +0 -3
  565. package/lib/hooks/useFocusableElements.js +0 -1
  566. package/lib/hooks/useIcons.js +0 -6
  567. package/lib/hooks/useIsMobileBreakpoint.js +0 -2
  568. package/lib/hooks/useIsVisible.js +0 -1
  569. package/lib/hooks/useLayoutEvent.js +0 -1
  570. package/lib/hooks/useReturnFocusOnUnmount.js +0 -2
  571. package/lib/hooks/useRovingFocus.js +0 -2
  572. package/lib/hooks/useSize.js +0 -1
  573. package/lib/hooks/useToggle.js +0 -1
  574. package/lib/index.js +0 -9
  575. package/lib/theme/currys/color.js +0 -4
  576. package/lib/theme/currys/index.js +0 -5
  577. package/lib/theme/currys/spacing.js +0 -1
  578. package/lib/theme/index.js +0 -3
  579. package/lib/utils/uuid.js +0 -1
  580. package/lib/uuid.js +1 -1
  581. package/package.json +3 -8
  582. package/lib/scss/_figma-tokens.scss +0 -68
  583. package/scss/_figma-tokens.scss +0 -68
package/lib/Panel.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.js","names":["mergedResources: HNDesignsystemPanel","newPreContainer: React.ReactNode[]","newTitle: React.ReactNode[]","newContent: React.ReactNode[]","newExpandableContent: React.ReactNode[]","PreContainer: React.FC<ContentProps>","A: React.FC<ContentProps>","B: React.FC<ContentProps>","C: React.FC<ContentProps>","ExpandedContent: React.FC<ContentProps>"],"sources":["../src/resources/HN.Designsystem.Panel.en-GB.json","../src/resources/HN.Designsystem.Panel.nb-NO.json","../src/components/Panel/resourceHelper.ts","../src/components/Panel/Panel.tsx"],"sourcesContent":["{\n \"expandButtonOpen\": \"See details\",\n \"expandButtonClose\": \"Hide details\"\n}\n","{\n \"expandButtonOpen\": \"Se detaljer\",\n \"expandButtonClose\": \"Skjul detaljer\"\n}\n","import { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Panel.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Panel.nb-NO.json';\nimport { HNDesignsystemPanel } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemPanel => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { LanguageLocales } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { PaletteNames } from '../../theme/palette';\nimport Button from '../Button';\nimport Icon, { IconSize } from '../Icon';\nimport PanelTitle, { PanelTitleProps } from './PanelTitle';\nimport { getResources } from './resourceHelper';\nimport { HNDesignsystemPanel } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport Highlighter from '../Highlighter';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronRight from '../Icons/ChevronRight';\nimport ChevronUp from '../Icons/ChevronUp';\n\nimport styles from './styles.module.scss';\n\nexport enum PanelLayout {\n vertical = 'vertical',\n horizontal = 'horizontal',\n combined = 'combined',\n bAsRightCol = 'bAsRightCol',\n}\n\nexport type PanelColors = Extract<PaletteNames, 'white' | 'neutral'>;\n\nexport enum PanelVariant {\n fill = 'fill',\n line = 'line',\n outline = 'outline',\n}\n\nexport enum PanelStacking {\n default = 'default',\n bFirst = 'bFirst',\n}\n\nexport enum PanelStatus {\n none = 'none',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n\nexport interface PanelProps {\n /** Aria label on call to action button */\n buttonBottomAriaLabel?: string;\n /** Sets the text on the bottom call to action button */\n buttonBottomText?: string;\n /** Sets the action on the bottom call to action button */\n buttonBottomOnClick?: () => void;\n /** Expands or collapses the panel. Only applicable when ExpandedContent is used */\n expanded?: boolean;\n /** Whether the panel can be focused */\n focusable?: boolean;\n /** Sets the layout and order of the content boxes */\n layout?: PanelLayout;\n /** Sets the visual variant of panel */\n variant?: PanelVariant;\n /** Sets the color for panel if it has variant fill */\n color?: PanelColors;\n /** Sets classes on the outermost container of the panel */\n className?: string;\n /** Action called when toggling expansion of ExpandedContent */\n onExpand?: (isExpanded?: boolean) => void;\n /** Sets the stacking order of the content boxes */\n stacking?: PanelStacking;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Children elements to be rendered inside the panel */\n children?: React.ReactNode;\n /** Displays a status on the left side: default normal */\n status?: PanelStatus;\n /** Resources for component */\n resources?: Partial<HNDesignsystemPanel>;\n /** Highlights text in title and content. Used for search results */\n highlightText?: string;\n}\n\nconst ExpandButton = ({\n onClick,\n isExpanded,\n resources,\n}: {\n onClick: () => void;\n isExpanded: boolean | undefined;\n resources: Partial<HNDesignsystemPanel>;\n}): React.JSX.Element => {\n const buttonClassName = classNames(styles['expander__button'], isExpanded && styles['expander__button--expanded']);\n\n return (\n <Button\n variant=\"borderless\"\n textClassName={styles['expander__button__text']}\n wrapperClassName={buttonClassName}\n aria-expanded={isExpanded}\n onClick={onClick}\n >\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} />\n <span>{isExpanded ? resources.expandButtonClose : resources.expandButtonOpen}</span>\n </Button>\n );\n};\nconst PanelRoot = React.forwardRef(function PanelForwardedRef(\n {\n layout = PanelLayout.vertical,\n variant = PanelVariant.fill,\n color = 'neutral',\n stacking = PanelStacking.default,\n testId,\n children,\n expanded = false,\n focusable,\n status = PanelStatus.none,\n buttonBottomAriaLabel,\n buttonBottomOnClick,\n buttonBottomText,\n className,\n resources,\n onExpand,\n highlightText,\n }: PanelProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const [preContainer, setPreContainer] = React.useState<React.ReactNode[]>([]);\n const [title, setTitle] = React.useState<React.ReactNode[]>([]);\n const [content, setContent] = React.useState<React.ReactNode[]>([]);\n const [expandableContent, setExpandableContent] = React.useState<React.ReactNode[]>([]);\n const [hasIcon, setHasIcon] = React.useState(false);\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const localRef = React.useRef<HTMLDivElement>(null);\n const panelRef = ref ?? localRef;\n const expandedContentRef = React.useRef<HTMLDivElement>(null);\n const defaultScroll = 100;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemPanel = {\n ...defaultResources,\n ...resources,\n };\n\n React.useEffect(() => {\n let index = 0;\n let localHasIcon = false;\n const newPreContainer: React.ReactNode[] = [];\n const newTitle: React.ReactNode[] = [];\n const newContent: React.ReactNode[] = [];\n const newExpandableContent: React.ReactNode[] = [];\n\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n const key = child.key ?? `panel-child-${index++}`;\n\n if (child.type === PreContainer) {\n newPreContainer.push(React.cloneElement(child, { key }));\n } else if (child.type === PanelTitle) {\n newTitle.push(\n React.cloneElement(child as React.ReactElement<PanelTitleProps>, {\n key,\n highlightText: child.props.highlightText || highlightText,\n })\n );\n if (child.props.icon) {\n localHasIcon = true;\n }\n } else if (child.type === A || child.type === B || child.type === C) {\n newContent.push(React.cloneElement(child, { key }));\n } else if (child.type === ExpandedContent) {\n newExpandableContent.push(React.cloneElement(child, { key }));\n }\n }\n });\n\n setPreContainer(newPreContainer);\n setTitle(newTitle);\n setContent(newContent);\n setExpandableContent(newExpandableContent);\n setHasIcon(localHasIcon);\n }, [children]);\n\n React.useEffect(() => {\n if (expanded) {\n // Hvis panel åpnes controlled skal ikke scroll skje\n return;\n }\n // Scroller oppover når expanded content åpnes uncontrolled\n if (isExpanded) {\n if ('current' in panelRef && panelRef.current && expandedContentRef.current) {\n const panelRect = panelRef.current.getBoundingClientRect();\n const expandedContentRect = expandedContentRef.current.getBoundingClientRect();\n\n const scrollAmount = Math.min(defaultScroll, panelRect.top - 20);\n\n // Scroller kun oppover, og kun dersom expandedContent havner utenfor skjermen når åpnet\n if (scrollAmount > 0 && expandedContentRect.bottom > window.innerHeight) {\n const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n if (prefersReducedMotion) {\n return;\n }\n window.scrollBy({\n top: scrollAmount,\n behavior: 'smooth',\n });\n }\n }\n }\n }, [isExpanded]);\n\n const colorScheme = variant === PanelVariant.fill ? color : 'white';\n\n const outerClassnames = classNames(className, {\n [styles['panel__border--outline--outer']]: variant === PanelVariant.outline,\n [styles['panel__border--line']]: variant === PanelVariant.line,\n [styles['panel__border--fill--neutral']]: variant === PanelVariant.fill && colorScheme === 'neutral',\n [styles['panel__border--fill--new']]: variant === PanelVariant.fill && status === PanelStatus.new,\n [styles['panel__border--fill--status']]: variant === PanelVariant.fill && status !== PanelStatus.none,\n });\n const panelClassnames = classNames(styles['panel'], styles[`panel--${colorScheme}`], styles['panel--status'], {\n [styles['panel--line']]: variant === PanelVariant.line,\n [styles['panel--new']]: status === PanelStatus.new,\n [styles['panel--draft']]: status === PanelStatus.draft,\n [styles['panel--error']]: status === PanelStatus.error,\n [styles['panel--icon']]: hasIcon,\n });\n const contentContainerLayout = classNames(styles['panel__content'], styles[`panel__content--${layout}`], {\n [styles[`panel__content--b-first`]]: stacking === PanelStacking.bFirst,\n });\n const expanderBorderLayout = classNames({\n [styles['panel__expander__border--expanded']]: isExpanded && status === PanelStatus.none,\n [styles[`panel__expander__border--not-expanded--${colorScheme}`]]: !isExpanded && status === PanelStatus.none,\n [styles[`panel__expander__border--not-expanded--line`]]: !isExpanded && status === PanelStatus.none && variant === PanelVariant.line,\n });\n\n const handleExpandClick = (): void => {\n setIsExpanded(!isExpanded);\n };\n\n return expandableContent.length > 0 ? (\n <div className={outerClassnames}>\n <div className={classNames({ [styles['panel__border--outline--inner']]: variant === PanelVariant.outline })}>\n <div className={expanderBorderLayout}>\n <div className={panelClassnames} data-testid={testId} ref={panelRef} tabIndex={focusable ? -1 : undefined}>\n <Highlighter searchText={highlightText}>\n {preContainer}\n {title}\n </Highlighter>\n <div className={contentContainerLayout}>\n <Highlighter searchText={highlightText}>{content}</Highlighter>\n </div>\n <ExpandButton onClick={handleExpandClick} isExpanded={isExpanded} resources={mergedResources} />\n {isExpanded && (\n <div ref={expandedContentRef} data-testid={testId + '-details'}>\n <div className={styles['panel__expander__separator']} />\n <Highlighter searchText={highlightText}>{expandableContent}</Highlighter>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n ) : (\n <div className={outerClassnames}>\n <div className={classNames({ [styles['panel__border--outline--inner']]: variant === PanelVariant.outline })}>\n <div className={panelClassnames} data-testid={testId} ref={panelRef} tabIndex={focusable ? -1 : undefined}>\n <Highlighter searchText={highlightText}>\n {preContainer}\n {title}\n </Highlighter>\n <div className={contentContainerLayout}>\n <Highlighter searchText={highlightText}>{content}</Highlighter>\n </div>\n {buttonBottomText && buttonBottomOnClick && (\n <div className={styles['panel__button-bottom']}>\n <Button variant=\"borderless\" type=\"button\" size=\"medium\" onClick={buttonBottomOnClick} aria-label={buttonBottomAriaLabel}>\n {buttonBottomText}\n <Icon svgIcon={ChevronRight} size={IconSize.XSmall} />\n </Button>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n});\n\nexport interface ContentProps {\n /** Children elements to be rendered inside the content box */\n children?: React.ReactNode;\n}\n\nexport const PreContainer: React.FC<ContentProps> = ({ children }) => {\n return <div className={styles['panel__pre-container']}>{children}</div>;\n};\n\nexport const A: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__content__item'], styles['panel__content__item--a']);\n return <div className={styling}>{children}</div>;\n};\n\nexport const B: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__content__item'], styles['panel__content__item--b']);\n return <div className={styling}>{children}</div>;\n};\n\nexport const C: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__content__item'], styles['panel__content__item--c']);\n return <div className={styling}>{children}</div>;\n};\n\nexport const ExpandedContent: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__expander__content']);\n return <div className={styling}>{children}</div>;\n};\n\ntype PanelComponent = typeof PanelRoot & {\n PreContainer: React.FC<ContentProps>;\n Title: React.FC<PanelTitleProps>;\n A: React.FC<ContentProps>;\n B: React.FC<ContentProps>;\n C: React.FC<ContentProps>;\n ExpandedContent: React.FC<ContentProps>;\n};\nPanelRoot.displayName = 'Panel';\nconst Panel = PanelRoot as PanelComponent;\nPanel.PreContainer = PreContainer;\nPanel.Title = PanelTitle;\nPanel.A = A;\nPanel.B = B;\nPanel.C = C;\nPanel.ExpandedContent = ExpandedContent;\n\nexport default Panel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AEKA,MAAa,gBAAgB,aAAmD;AAC9E,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACSb,IAAY,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,OAAO;EAA0B;GAAe;;AAGzE,MAAaC,KAA6B,EAAE,eAAe;AAEzD,QAAO,oBAAC,OAAA;EAAI,WADI,GAAW,OAAO,yBAAyB,OAAO,2BAA2B;EAC5D;GAAe;;AAGlD,MAAaC,KAA6B,EAAE,eAAe;AAEzD,QAAO,oBAAC,OAAA;EAAI,WADI,GAAW,OAAO,yBAAyB,OAAO,2BAA2B;EAC5D;GAAe;;AAGlD,MAAaC,KAA6B,EAAE,eAAe;AAEzD,QAAO,oBAAC,OAAA;EAAI,WADI,GAAW,OAAO,yBAAyB,OAAO,2BAA2B;EAC5D;GAAe;;AAGlD,MAAaC,mBAA2C,EAAE,eAAe;AAEvE,QAAO,oBAAC,OAAA;EAAI,WADI,GAAW,OAAO,4BAA4B;EAC7B;GAAe;;AAWlD,UAAU,cAAc;AACxB,IAAM,QAAQ;AACd,MAAM,eAAe;AACrB,MAAM,QAAQ;AACd,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,kBAAkB;AAExB,IAAA,gBAAe"}
1
+ {"version":3,"file":"Panel.js","names":["contextValue: PanelListContextValue","mergedResources: HNDesignsystemPanel","newPreContainer: React.ReactNode[]","newTitle: React.ReactNode[]","newContent: React.ReactNode[]","newExpandableContent: React.ReactNode[]","PreContainer: React.FC<ContentProps>","A: React.FC<ContentProps>","B: React.FC<ContentProps>","C: React.FC<ContentProps>","ExpandedContent: React.FC<ContentProps>"],"sources":["../src/resources/HN.Designsystem.Panel.en-GB.json","../src/resources/HN.Designsystem.Panel.nb-NO.json","../src/components/Panel/resourceHelper.ts","../src/components/PanelList/PanelList.tsx","../src/components/Panel/Panel.tsx"],"sourcesContent":["{\n \"expandButtonOpen\": \"See details\",\n \"expandButtonClose\": \"Hide details\"\n}\n","{\n \"expandButtonOpen\": \"Se detaljer\",\n \"expandButtonClose\": \"Skjul detaljer\"\n}\n","import { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Panel.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Panel.nb-NO.json';\nimport { HNDesignsystemPanel } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemPanel => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { PanelVariant } from '../Panel/Panel';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelListProps {\n /** Panels to render inside the PanelList */\n children?: React.ReactNode;\n /** Changes the visual representation of the panel. Default: fill */\n variant?: PanelVariant;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Highlights text in title and content. Used for search results */\n highlightText?: string;\n}\n\ninterface PanelListContextValue {\n variant: PanelVariant;\n highlightText?: string;\n applyPanelClassName: (existingClassName?: string) => string;\n}\n\nexport const PanelListContext = React.createContext<PanelListContextValue | null>(null);\n\nconst PanelList = React.forwardRef(function BadgeForwardedRef(props: PanelListProps, ref: React.ForwardedRef<HTMLDivElement>) {\n const { testId, children, variant = PanelVariant.fill, highlightText } = props;\n\n const contextValue: PanelListContextValue = React.useMemo(\n () => ({\n variant,\n highlightText,\n applyPanelClassName: (existingClassName?: string) => classNames(existingClassName, styles[`panel-list__panel--${variant}`]),\n }),\n [variant, highlightText]\n );\n\n return (\n <PanelListContext.Provider value={contextValue}>\n <div\n ref={ref}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PanelList}\n className={classNames({ [styles['panel-list--outline']]: variant === PanelVariant.outline })}\n >\n {children}\n </div>\n </PanelListContext.Provider>\n );\n});\n\nexport default PanelList;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { LanguageLocales } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { PaletteNames } from '../../theme/palette';\nimport Button from '../Button';\nimport Icon, { IconSize } from '../Icon';\nimport PanelTitle, { PanelTitleProps } from './PanelTitle';\nimport { getResources } from './resourceHelper';\nimport { HNDesignsystemPanel } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport Highlighter from '../Highlighter';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronRight from '../Icons/ChevronRight';\nimport ChevronUp from '../Icons/ChevronUp';\nimport { PanelListContext } from '../PanelList/PanelList';\n\nimport styles from './styles.module.scss';\n\nexport enum PanelLayout {\n vertical = 'vertical',\n horizontal = 'horizontal',\n combined = 'combined',\n bAsRightCol = 'bAsRightCol',\n}\n\nexport type PanelColors = Extract<PaletteNames, 'white' | 'neutral'>;\n\nexport enum PanelVariant {\n fill = 'fill',\n line = 'line',\n outline = 'outline',\n}\n\nexport enum PanelStacking {\n default = 'default',\n bFirst = 'bFirst',\n}\n\nexport enum PanelStatus {\n none = 'none',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n\nexport interface PanelProps {\n /** Aria label on call to action button */\n buttonBottomAriaLabel?: string;\n /** Sets the text on the bottom call to action button */\n buttonBottomText?: string;\n /** Sets the action on the bottom call to action button */\n buttonBottomOnClick?: () => void;\n /** Expands or collapses the panel. Only applicable when ExpandedContent is used */\n expanded?: boolean;\n /** Whether the panel can be focused */\n focusable?: boolean;\n /** Sets the layout and order of the content boxes */\n layout?: PanelLayout;\n /** Sets the visual variant of panel */\n variant?: PanelVariant;\n /** Sets the color for panel if it has variant fill */\n color?: PanelColors;\n /** Sets classes on the outermost container of the panel */\n className?: string;\n /** Action called when toggling expansion of ExpandedContent */\n onExpand?: (isExpanded?: boolean) => void;\n /** Sets the stacking order of the content boxes */\n stacking?: PanelStacking;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Children elements to be rendered inside the panel */\n children?: React.ReactNode;\n /** Displays a status on the left side: default normal */\n status?: PanelStatus;\n /** Resources for component */\n resources?: Partial<HNDesignsystemPanel>;\n /** Highlights text in title and content. Used for search results */\n highlightText?: string;\n}\n\nconst ExpandButton = ({\n onClick,\n isExpanded,\n resources,\n}: {\n onClick: () => void;\n isExpanded: boolean | undefined;\n resources: Partial<HNDesignsystemPanel>;\n}): React.JSX.Element => {\n const buttonClassName = classNames(styles['expander__button'], isExpanded && styles['expander__button--expanded']);\n\n return (\n <Button\n variant=\"borderless\"\n textClassName={styles['expander__button__text']}\n wrapperClassName={buttonClassName}\n aria-expanded={isExpanded}\n onClick={onClick}\n >\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} />\n <span>{isExpanded ? resources.expandButtonClose : resources.expandButtonOpen}</span>\n </Button>\n );\n};\nconst PanelRoot = React.forwardRef(function PanelForwardedRef(\n {\n layout = PanelLayout.vertical,\n variant = PanelVariant.fill,\n color = 'neutral',\n stacking = PanelStacking.default,\n testId,\n children,\n expanded = false,\n focusable,\n status = PanelStatus.none,\n buttonBottomAriaLabel,\n buttonBottomOnClick,\n buttonBottomText,\n className,\n resources,\n onExpand,\n highlightText,\n }: PanelProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const panelListContext = React.useContext(PanelListContext);\n const [preContainer, setPreContainer] = React.useState<React.ReactNode[]>([]);\n const [title, setTitle] = React.useState<React.ReactNode[]>([]);\n const [content, setContent] = React.useState<React.ReactNode[]>([]);\n const [expandableContent, setExpandableContent] = React.useState<React.ReactNode[]>([]);\n const [hasIcon, setHasIcon] = React.useState(false);\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const localRef = React.useRef<HTMLDivElement>(null);\n const panelRef = ref ?? localRef;\n const expandedContentRef = React.useRef<HTMLDivElement>(null);\n const defaultScroll = 100;\n\n // Use context values if available, otherwise use props\n const effectiveVariant = panelListContext?.variant ?? variant;\n const effectiveHighlightText = panelListContext?.highlightText ?? highlightText;\n const effectiveClassName = panelListContext?.applyPanelClassName(className) ?? className;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemPanel = {\n ...defaultResources,\n ...resources,\n };\n\n React.useEffect(() => {\n let index = 0;\n let localHasIcon = false;\n const newPreContainer: React.ReactNode[] = [];\n const newTitle: React.ReactNode[] = [];\n const newContent: React.ReactNode[] = [];\n const newExpandableContent: React.ReactNode[] = [];\n\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n const key = child.key ?? `panel-child-${index++}`;\n\n if (child.type === PreContainer) {\n newPreContainer.push(React.cloneElement(child, { key }));\n } else if (child.type === PanelTitle) {\n newTitle.push(\n React.cloneElement(child as React.ReactElement<PanelTitleProps>, {\n key,\n highlightText: child.props.highlightText || effectiveHighlightText,\n })\n );\n if (child.props.icon) {\n localHasIcon = true;\n }\n } else if (child.type === A || child.type === B || child.type === C) {\n newContent.push(React.cloneElement(child, { key }));\n } else if (child.type === ExpandedContent) {\n newExpandableContent.push(React.cloneElement(child, { key }));\n }\n }\n });\n\n setPreContainer(newPreContainer);\n setTitle(newTitle);\n setContent(newContent);\n setExpandableContent(newExpandableContent);\n setHasIcon(localHasIcon);\n }, [children]);\n\n React.useEffect(() => {\n if (expanded) {\n // Hvis panel åpnes controlled skal ikke scroll skje\n return;\n }\n // Scroller oppover når expanded content åpnes uncontrolled\n if (isExpanded) {\n if ('current' in panelRef && panelRef.current && expandedContentRef.current) {\n const panelRect = panelRef.current.getBoundingClientRect();\n const expandedContentRect = expandedContentRef.current.getBoundingClientRect();\n\n const scrollAmount = Math.min(defaultScroll, panelRect.top - 20);\n\n // Scroller kun oppover, og kun dersom expandedContent havner utenfor skjermen når åpnet\n if (scrollAmount > 0 && expandedContentRect.bottom > window.innerHeight) {\n const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n if (prefersReducedMotion) {\n return;\n }\n window.scrollBy({\n top: scrollAmount,\n behavior: 'smooth',\n });\n }\n }\n }\n }, [isExpanded]);\n\n const colorScheme = effectiveVariant === PanelVariant.fill ? color : 'white';\n\n const outerClassnames = classNames(effectiveClassName, {\n [styles['panel__border--outline--outer']]: effectiveVariant === PanelVariant.outline,\n [styles['panel__border--line']]: effectiveVariant === PanelVariant.line,\n [styles['panel__border--fill--neutral']]: effectiveVariant === PanelVariant.fill && colorScheme === 'neutral',\n [styles['panel__border--fill--new']]: effectiveVariant === PanelVariant.fill && status === PanelStatus.new,\n [styles['panel__border--fill--status']]: effectiveVariant === PanelVariant.fill && status !== PanelStatus.none,\n });\n const panelClassnames = classNames(styles['panel'], styles[`panel--${colorScheme}`], styles['panel--status'], {\n [styles['panel--line']]: effectiveVariant === PanelVariant.line,\n [styles['panel--new']]: status === PanelStatus.new,\n [styles['panel--draft']]: status === PanelStatus.draft,\n [styles['panel--error']]: status === PanelStatus.error,\n [styles['panel--icon']]: hasIcon,\n });\n const contentContainerLayout = classNames(styles['panel__content'], styles[`panel__content--${layout}`], {\n [styles[`panel__content--b-first`]]: stacking === PanelStacking.bFirst,\n });\n const expanderBorderLayout = classNames({\n [styles['panel__expander__border--expanded']]: isExpanded && status === PanelStatus.none,\n [styles[`panel__expander__border--not-expanded--${colorScheme}`]]: !isExpanded && status === PanelStatus.none,\n [styles[`panel__expander__border--not-expanded--line`]]:\n !isExpanded && status === PanelStatus.none && effectiveVariant === PanelVariant.line,\n });\n\n const handleExpandClick = (): void => {\n setIsExpanded(!isExpanded);\n };\n\n return expandableContent.length > 0 ? (\n <div className={outerClassnames}>\n <div className={classNames({ [styles['panel__border--outline--inner']]: effectiveVariant === PanelVariant.outline })}>\n <div className={expanderBorderLayout}>\n <div className={panelClassnames} data-testid={testId} ref={panelRef} tabIndex={focusable ? -1 : undefined}>\n <Highlighter searchText={effectiveHighlightText}>\n {preContainer}\n {title}\n </Highlighter>\n <div className={contentContainerLayout}>\n <Highlighter searchText={effectiveHighlightText}>{content}</Highlighter>\n </div>\n <ExpandButton onClick={handleExpandClick} isExpanded={isExpanded} resources={mergedResources} />\n {isExpanded && (\n <div ref={expandedContentRef} data-testid={testId + '-details'}>\n <div className={styles['panel__expander__separator']} />\n <Highlighter searchText={effectiveHighlightText}>{expandableContent}</Highlighter>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n ) : (\n <div className={outerClassnames}>\n <div className={classNames({ [styles['panel__border--outline--inner']]: effectiveVariant === PanelVariant.outline })}>\n <div className={panelClassnames} data-testid={testId} ref={panelRef} tabIndex={focusable ? -1 : undefined}>\n <Highlighter searchText={effectiveHighlightText}>\n {preContainer}\n {title}\n </Highlighter>\n <div className={contentContainerLayout}>\n <Highlighter searchText={effectiveHighlightText}>{content}</Highlighter>\n </div>\n {buttonBottomText && buttonBottomOnClick && (\n <div className={styles['panel__button-bottom']}>\n <Button variant=\"borderless\" type=\"button\" size=\"medium\" onClick={buttonBottomOnClick} aria-label={buttonBottomAriaLabel}>\n {buttonBottomText}\n <Icon svgIcon={ChevronRight} size={IconSize.XSmall} />\n </Button>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n});\n\nexport interface ContentProps {\n /** Children elements to be rendered inside the content box */\n children?: React.ReactNode;\n}\n\nexport const PreContainer: React.FC<ContentProps> = ({ children }) => {\n return <div className={styles['panel__pre-container']}>{children}</div>;\n};\n\nexport const A: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__content__item'], styles['panel__content__item--a']);\n return <div className={styling}>{children}</div>;\n};\n\nexport const B: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__content__item'], styles['panel__content__item--b']);\n return <div className={styling}>{children}</div>;\n};\n\nexport const C: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__content__item'], styles['panel__content__item--c']);\n return <div className={styling}>{children}</div>;\n};\n\nexport const ExpandedContent: React.FC<ContentProps> = ({ children }) => {\n const styling = classNames(styles['panel__expander__content']);\n return <div className={styling}>{children}</div>;\n};\n\ntype PanelComponent = typeof PanelRoot & {\n PreContainer: React.FC<ContentProps>;\n Title: React.FC<PanelTitleProps>;\n A: React.FC<ContentProps>;\n B: React.FC<ContentProps>;\n C: React.FC<ContentProps>;\n ExpandedContent: React.FC<ContentProps>;\n};\nPanelRoot.displayName = 'Panel';\nconst Panel = PanelRoot as PanelComponent;\nPanel.PreContainer = PreContainer;\nPanel.Title = PanelTitle;\nPanel.A = A;\nPanel.B = B;\nPanel.C = C;\nPanel.ExpandedContent = ExpandedContent;\n\nexport default Panel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AEKA,MAAa,gBAAgB,aAAmD;AAC9E,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACeb,MAAa,mBAAmB,MAAM,cAA4C,KAAK;AA4BvF,IAAA,oBA1BkB,MAAM,WAAW,SAAS,kBAAkB,OAAuB,KAAyC;CAC5H,MAAM,EAAE,QAAQ,UAAU,UAAU,aAAa,MAAM,kBAAkB;CAEzE,MAAMA,eAAsC,MAAM,eACzC;EACL;EACA;EACA,sBAAsB,sBAA+B,WAAW,mBAAmB,OAAO,sBAAsB,WAAW;EAC5H,GACD,CAAC,SAAS,cAAc,CACzB;AAED,QACE,oBAAC,iBAAiB,UAAA;EAAS,OAAO;YAChC,oBAAC,OAAA;GACM;GACL,eAAa;GACb,oBAAkB,YAAY;GAC9B,WAAW,WAAW,GAAG,OAAO,yBAAyB,YAAY,aAAa,SAAS,CAAC;GAE3F;IACG;GACoB;EAE9B;AC/BF,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,cAAA;AACA,eAAA,gBAAA;AACA,eAAA,cAAA;AACA,eAAA,iBAAA;;;AAKF,IAAY,eAAA,yBAAA,gBAAL;AACL,gBAAA,UAAA;AACA,gBAAA,UAAA;AACA,gBAAA,aAAA;;;AAGF,IAAY,gBAAA,yBAAA,iBAAL;AACL,iBAAA,aAAA;AACA,iBAAA,YAAA;;;AAGF,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,UAAA;AACA,eAAA,SAAA;AACA,eAAA,WAAA;AACA,eAAA,WAAA;;;AAsCF,IAAM,gBAAgB,EACpB,SACA,YACA,gBAKuB;CACvB,MAAM,kBAAkB,WAAW,SAAO,qBAAqB,cAAc,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;;AAGlD,MAAaC,KAA6B,EAAE,eAAe;AAEzD,QAAO,oBAAC,OAAA;EAAI,WADI,WAAW,SAAO,yBAAyB,SAAO,2BAA2B;EAC5D;GAAe;;AAGlD,MAAaC,mBAA2C,EAAE,eAAe;AAEvE,QAAO,oBAAC,OAAA;EAAI,WADI,WAAW,SAAO,4BAA4B;EAC7B;GAAe;;AAWlD,UAAU,cAAc;AACxB,IAAM,QAAQ;AACd,MAAM,eAAe;AACrB,MAAM,QAAQ;AACd,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,kBAAkB;AAExB,IAAA,gBAAe"}
package/lib/PanelOld.js CHANGED
@@ -14,7 +14,7 @@ import { t as Calendar_default } from "./Calendar.js";
14
14
  import { t as Pencil_default } from "./Pencil.js";
15
15
  import { t as Watch_default } from "./Watch.js";
16
16
  import React, { useId } from "react";
17
- import cn from "classnames";
17
+ import classNames from "classnames";
18
18
  import { jsx, jsxs } from "react/jsx-runtime";
19
19
  import panelStyles from "./components/PanelOld/styles.module.scss";
20
20
  let PanelOldStatus = /* @__PURE__ */ function(PanelOldStatus$1) {
@@ -50,7 +50,7 @@ var StatusText = ({ status, statusMessage }) => {
50
50
  svgIcon: Pencil_default
51
51
  };
52
52
  };
53
- const statusMessageClass = cn(panelStyles["status-message"], { [panelStyles["status-message--new"]]: status === PanelOldStatus.new });
53
+ const statusMessageClass = classNames(panelStyles["status-message"], { [panelStyles["status-message--new"]]: status === PanelOldStatus.new });
54
54
  if ((status === PanelOldStatus.error || status === PanelOldStatus.draft) && statusMessage) return /* @__PURE__ */ jsxs("div", {
55
55
  className: statusMessageClass,
56
56
  "data-testid": "display-status",
@@ -93,8 +93,8 @@ var DateTime = ({ date, time }) => {
93
93
  return null;
94
94
  };
95
95
  var PanelLayout1 = ({ contentA, contentB, contentHeader, ctaContainer, icon, status, statusMessage, titleElement }) => {
96
- const panelLayoutClasses = cn(panelStyles["panel__layout-1"], { [panelStyles["panel__layout-1--with-icon"]]: icon });
97
- const iconClasses = cn(panelStyles.panel__icon, panelStyles["panel__icon--layout-1"], { [panelStyles["panel__icon--no-content"]]: !contentA && !contentB });
96
+ const panelLayoutClasses = classNames(panelStyles["panel__layout-1"], { [panelStyles["panel__layout-1--with-icon"]]: icon });
97
+ const iconClasses = classNames(panelStyles.panel__icon, panelStyles["panel__icon--layout-1"], { [panelStyles["panel__icon--no-content"]]: !contentA && !contentB });
98
98
  return /* @__PURE__ */ jsxs("div", {
99
99
  className: panelLayoutClasses,
100
100
  children: [
@@ -117,8 +117,8 @@ var PanelLayout1 = ({ contentA, contentB, contentHeader, ctaContainer, icon, sta
117
117
  });
118
118
  };
119
119
  var PanelLayout2 = ({ contentA, contentB, contentHeader, ctaContainer, icon, status, statusMessage, titleElement }) => {
120
- const panelLayoutClasses = cn(panelStyles["panel__layout-2"], { [panelStyles["panel__layout-2--with-icon"]]: icon });
121
- const iconClasses = cn(panelStyles.panel__icon, panelStyles["panel__icon--layout-2"], { [panelStyles["panel__icon--no-content"]]: !contentA && !contentB });
120
+ const panelLayoutClasses = classNames(panelStyles["panel__layout-2"], { [panelStyles["panel__layout-2--with-icon"]]: icon });
121
+ const iconClasses = classNames(panelStyles.panel__icon, panelStyles["panel__icon--layout-2"], { [panelStyles["panel__icon--no-content"]]: !contentA && !contentB });
122
122
  const lastColumnClass = panelStyles["panel__layout-2__last-column"];
123
123
  return /* @__PURE__ */ jsxs("div", {
124
124
  className: panelLayoutClasses,
@@ -148,13 +148,13 @@ var PanelLayout2 = ({ contentA, contentB, contentHeader, ctaContainer, icon, sta
148
148
  });
149
149
  };
150
150
  var PanelLayout3 = ({ contentA, contentB, contentHeader, ctaContainer, icon, layout, status, statusMessage, titleElement }) => {
151
- const layoutClasses = cn(panelStyles["panel__layout-3"], {
151
+ const layoutClasses = classNames(panelStyles["panel__layout-3"], {
152
152
  [panelStyles["panel__layout-3--with-icon"]]: icon,
153
153
  [panelStyles["panel__layout-3--a"]]: layout === PanelOldLayout.layout3a,
154
154
  [panelStyles["panel__layout-3--b"]]: layout === PanelOldLayout.layout3b,
155
155
  [panelStyles["panel__layout-3--c"]]: layout === PanelOldLayout.layout3c
156
156
  });
157
- const iconClasses = cn(panelStyles.panel__icon, panelStyles["panel__icon--layout-3"], { [panelStyles["panel__icon--no-content"]]: !contentA && !contentB });
157
+ const iconClasses = classNames(panelStyles.panel__icon, panelStyles["panel__icon--layout-3"], { [panelStyles["panel__icon--no-content"]]: !contentA && !contentB });
158
158
  return /* @__PURE__ */ jsxs("div", {
159
159
  className: layoutClasses,
160
160
  children: [
@@ -188,8 +188,8 @@ var PanelOld_default$1 = React.forwardRef(function PanelForwardedRef(props, ref)
188
188
  const layout1 = layout === "layout1" || noContentB;
189
189
  const layout2 = !noContentB && layout === "layout2";
190
190
  const layout3 = !noContentB && (layout === "layout3a" || layout === "layout3b" || layout === "layout3c");
191
- const panelWrapperClasses = cn(panelStyles["panel-wrapper"], className);
192
- const panelClasses = cn(panelStyles.panel, {
191
+ const panelWrapperClasses = classNames(panelStyles["panel-wrapper"], className);
192
+ const panelClasses = classNames(panelStyles.panel, {
193
193
  [panelStyles["panel--fill"]]: variant === PanelOldVariant.fill,
194
194
  [panelStyles["panel--stroke"]]: variant === PanelOldVariant.stroke,
195
195
  [panelStyles["panel--white"]]: variant === PanelOldVariant.white,
@@ -206,7 +206,7 @@ var PanelOld_default$1 = React.forwardRef(function PanelForwardedRef(props, ref)
206
206
  });
207
207
  const renderCTAContainer = () => {
208
208
  const hasButton = children || url || buttonOnClick;
209
- const btnContainerClasses = cn(panelStyles["panel__btn-container"], {
209
+ const btnContainerClasses = classNames(panelStyles["panel__btn-container"], {
210
210
  [panelStyles["panel__btn-container--no-content-b"]]: noContentB,
211
211
  [panelStyles["panel__btn-container--no-button"]]: !hasButton
212
212
  });
@@ -258,7 +258,7 @@ var PanelOld_default$1 = React.forwardRef(function PanelForwardedRef(props, ref)
258
258
  const renderContent = () => {
259
259
  if (!children || !renderChildrenWhenClosed && !isExpanded) return null;
260
260
  return /* @__PURE__ */ jsx("div", {
261
- className: cn(panelStyles["panel-details"], {
261
+ className: classNames(panelStyles["panel-details"], {
262
262
  [panelStyles["panel-details--open"]]: isExpanded,
263
263
  [panelStyles["panel-details--line"]]: variant === PanelOldVariant.line,
264
264
  [panelStyles["panel-details--white"]]: variant === PanelOldVariant.white
@@ -268,8 +268,8 @@ var PanelOld_default$1 = React.forwardRef(function PanelForwardedRef(props, ref)
268
268
  });
269
269
  };
270
270
  const renderTitle = () => {
271
- const titleContainerClasses = cn(panelStyles["title-container"], { [panelStyles["title-container--no-content-a"]]: !contentA });
272
- const titleClasses = cn(panelStyles["title-container__title"], { [panelStyles["title-container__title--badge"]]: hasBadge });
271
+ const titleContainerClasses = classNames(panelStyles["title-container"], { [panelStyles["title-container--no-content-a"]]: !contentA });
272
+ const titleClasses = classNames(panelStyles["title-container__title"], { [panelStyles["title-container__title--badge"]]: hasBadge });
273
273
  return title && /* @__PURE__ */ jsxs("div", {
274
274
  className: titleContainerClasses,
275
275
  children: [/* @__PURE__ */ jsx(Title_default, {
@@ -1 +1 @@
1
- {"version":3,"file":"PanelOld.js","names":["StatusText: React.FC<{ status?: keyof typeof PanelOldStatus; statusMessage?: string }>","PreContainer: React.FC<{ children?: React.ReactNode }>","DateTime: React.FC<{ date?: string; time?: string }>","PanelLayout1: React.FC<LayoutProps>","PanelLayout2: React.FC<LayoutProps>","PanelLayout3: React.FC<LayoutProps>","commonProps: Partial<ButtonProps> & AriaLabelAttributes","layoutProps: LayoutProps"],"sources":["../src/components/PanelOld/PanelOld.tsx","../src/components/PanelOld/index.tsx"],"sourcesContent":["import React, { useId } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnchorTarget, AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { palette } from '../../theme/palette';\nimport { AriaLabelAttributes, getAriaLabelAttributes } from '../../utils/accessibility';\nimport Badge from '../Badge';\nimport Button, { ButtonProps, ButtonTags } from '../Button';\nimport Icon, { IconSize, SvgPathProps } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport ArrowRight from '../Icons/ArrowRight';\nimport Calendar from '../Icons/Calendar';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport Pencil from '../Icons/Pencil';\nimport Watch from '../Icons/Watch';\nimport Title, { TitleTags } from '../Title';\n\nimport panelStyles from './styles.module.scss';\n\nexport enum PanelOldStatus {\n normal = 'normal',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n\nexport enum PanelOldVariant {\n fill = 'fill',\n white = 'white',\n stroke = 'stroke',\n line = 'line',\n}\n\nexport enum PanelOldLayout {\n layout1 = 'layout1',\n layout2 = 'layout2',\n layout3a = 'layout3a',\n layout3b = 'layout3b',\n layout3c = 'layout3c',\n}\n\nexport interface PanelOldProps {\n /** Adds custom classes to the element. */\n className?: string;\n /** Panel section A content */\n contentA?: React.ReactNode | string;\n /** Panel section B content */\n contentB?: React.ReactNode | string;\n /** Content for a container that renders above A and B regardless of layout */\n contentHeader?: React.ReactNode;\n /** Container acts as a button, clicking anywhere triggers a panel button click */\n containerAsButton?: boolean;\n /** Panel children */\n children?: React.ReactNode;\n /** Displays date with icon */\n date?: string;\n /** Expands or collapses the panel */\n expanded?: boolean;\n /** Whether the panel can be focused */\n focusable?: boolean;\n /** Icon displayed in title */\n icon?: React.ReactNode;\n /** Panel button text */\n buttonText?: string;\n /** Panel button close text */\n buttonTextClose?: string;\n /** HTML markup for panel button. Default: a */\n buttonHtmlMarkup?: ButtonTags;\n /** Callback when the panel button is clicked */\n buttonOnClick?: ButtonProps['onClick'];\n /** Panel button is aria-labelledby the text in the button itself + the element set in buttonAriaLabelledById. Default: auto-generated id for title (if title is set). */\n buttonAriaLabelledById?: string;\n /** Panel button aria label */\n buttonAriaLabel?: string;\n /** Layout of the panel */\n layout?: keyof typeof PanelOldLayout;\n /** Removes top border when variant is \"line\" */\n noTopBorder?: boolean;\n /** Called when the panel is opened/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 /** Displays a status on the left side: default normal */\n status?: keyof typeof PanelOldStatus;\n /** Displayed on top of the panel with a status icon */\n statusMessage?: string;\n /** Sets the data-testid attribute for testing purposes */\n testId?: string;\n /** Displays time with icon */\n time?: string;\n /** Title of the panel */\n title?: string;\n /** Changes the underlying element of the title. Default: h2 */\n titleHtmlMarkup?: TitleTags;\n /** Changes the visual representation of the panel */\n variant?: keyof typeof PanelOldVariant;\n /** URL to details, renders as a button with anchor tag */\n url?: string;\n /** target used in the button: default is _self */\n target?: AnchorTarget;\n}\n\nexport interface LayoutProps\n extends Pick<PanelOldProps, 'contentA' | 'contentB' | 'contentHeader' | 'icon' | 'layout' | 'status' | 'statusMessage'> {\n ctaContainer?: React.ReactNode;\n titleElement: React.ReactNode;\n}\n\nconst StatusText: React.FC<{ status?: keyof typeof PanelOldStatus; statusMessage?: string }> = ({ status, statusMessage }) => {\n const statusIcon = (): { color: string; svgIcon: React.FC<SvgPathProps> } => {\n if (status === PanelOldStatus.error) {\n return { color: palette.cherry500, svgIcon: AlertSignFill };\n }\n\n return { color: palette.black, svgIcon: Pencil };\n };\n\n const statusMessageClass = classNames(panelStyles['status-message'], {\n [panelStyles['status-message--new']]: status === PanelOldStatus.new,\n });\n\n if ((status === PanelOldStatus.error || status === PanelOldStatus.draft) && statusMessage) {\n return (\n <div className={statusMessageClass} data-testid=\"display-status\">\n {<Icon {...statusIcon()} size={IconSize.XSmall} />} <span>{statusMessage}</span>\n </div>\n );\n }\n\n return null;\n};\n\nconst PreContainer: React.FC<{ children?: React.ReactNode }> = ({ children }) => {\n if (typeof children === 'undefined') return null;\n return <div className={panelStyles['header-container']}>{children}</div>;\n};\n\nconst DateTime: React.FC<{ date?: string; time?: string }> = ({ date, time }) => {\n if (date || time) {\n return (\n <div className={panelStyles['datetime-container']} data-testid=\"datetime\">\n {date && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Calendar} size={IconSize.XSmall} />\n <span>{date}</span>\n </div>\n )}\n {time && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Watch} size={IconSize.XSmall} />\n <span>{time}</span>\n </div>\n )}\n </div>\n );\n }\n\n return null;\n};\n\nconst PanelLayout1: React.FC<LayoutProps> = ({\n contentA,\n contentB,\n contentHeader,\n ctaContainer,\n icon,\n status,\n statusMessage,\n titleElement,\n}) => {\n const panelLayoutClasses = classNames(panelStyles['panel__layout-1'], {\n [panelStyles['panel__layout-1--with-icon']]: icon,\n });\n const iconClasses = classNames(panelStyles.panel__icon, panelStyles['panel__icon--layout-1'], {\n [panelStyles['panel__icon--no-content']]: !contentA && !contentB,\n });\n\n return (\n <div className={panelLayoutClasses}>\n <StatusText status={status} statusMessage={statusMessage} />\n <PreContainer>{contentHeader}</PreContainer>\n {icon && <div className={iconClasses}>{icon}</div>}\n <div className={panelStyles['panel__layout-1__content-a']}>\n {titleElement}\n {contentA}\n </div>\n {contentB && <div>{contentB}</div>}\n {ctaContainer}\n </div>\n );\n};\n\nconst PanelLayout2: React.FC<LayoutProps> = ({\n contentA,\n contentB,\n contentHeader,\n ctaContainer,\n icon,\n status,\n statusMessage,\n titleElement,\n}) => {\n const panelLayoutClasses = classNames(panelStyles['panel__layout-2'], {\n [panelStyles['panel__layout-2--with-icon']]: icon,\n });\n const iconClasses = classNames(panelStyles.panel__icon, panelStyles['panel__icon--layout-2'], {\n [panelStyles['panel__icon--no-content']]: !contentA && !contentB,\n });\n const lastColumnClass = panelStyles['panel__layout-2__last-column'];\n\n return (\n <div className={panelLayoutClasses}>\n <StatusText status={status} statusMessage={statusMessage} />\n <PreContainer>{contentHeader}</PreContainer>\n {icon && <div className={iconClasses}>{icon}</div>}\n <div className={panelStyles['panel__layout-2__content-a']}>\n {titleElement}\n {contentA}\n </div>\n {contentB && <div className={lastColumnClass}>{contentB}</div>}\n {ctaContainer && <div className={lastColumnClass}>{ctaContainer}</div>}\n </div>\n );\n};\n\nconst PanelLayout3: React.FC<LayoutProps> = ({\n contentA,\n contentB,\n contentHeader,\n ctaContainer,\n icon,\n layout,\n status,\n statusMessage,\n titleElement,\n}) => {\n const layoutClasses = classNames(panelStyles['panel__layout-3'], {\n [panelStyles['panel__layout-3--with-icon']]: icon,\n [panelStyles['panel__layout-3--a']]: layout === PanelOldLayout.layout3a,\n [panelStyles['panel__layout-3--b']]: layout === PanelOldLayout.layout3b,\n [panelStyles['panel__layout-3--c']]: layout === PanelOldLayout.layout3c,\n });\n const iconClasses = classNames(panelStyles.panel__icon, panelStyles['panel__icon--layout-3'], {\n [panelStyles['panel__icon--no-content']]: !contentA && !contentB,\n });\n\n return (\n <div className={layoutClasses}>\n <StatusText status={status} statusMessage={statusMessage} />\n <PreContainer>{contentHeader}</PreContainer>\n {icon && <div className={iconClasses}>{icon}</div>}\n <div>\n {titleElement}\n {contentA}\n </div>\n <div className={panelStyles['panel__layout-3__last-column']}>\n {contentB && <div className={panelStyles['panel__layout-3__last-column__content-b']}>{contentB}</div>}\n {ctaContainer}\n </div>\n </div>\n );\n};\n\nconst PanelOld = React.forwardRef(function PanelForwardedRef(props: PanelOldProps, ref: React.ForwardedRef<HTMLHeadingElement>) {\n const {\n buttonAriaLabel,\n buttonAriaLabelledById,\n buttonText = 'Se detaljer',\n buttonTextClose = 'Skjul detaljer',\n buttonHtmlMarkup = 'a',\n buttonOnClick,\n children,\n className,\n containerAsButton = false,\n contentA,\n contentB,\n contentHeader,\n date,\n expanded = false,\n focusable = false,\n icon,\n layout = PanelOldLayout.layout2,\n noTopBorder,\n onExpand,\n renderChildrenWhenClosed = false,\n status = PanelOldStatus.normal,\n statusMessage,\n target = '_self',\n testId,\n time,\n title,\n titleHtmlMarkup = 'h2',\n url,\n variant = PanelOldVariant.fill,\n } = props;\n\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const titleId = useId();\n const buttonTextId = useId();\n const hasBadge = statusMessage && status === PanelOldStatus.new;\n const noContentB = typeof contentB === 'undefined';\n const layout1 = layout === 'layout1' || noContentB;\n const layout2 = !noContentB && layout === 'layout2';\n const layout3 = !noContentB && (layout === 'layout3a' || layout === 'layout3b' || layout === 'layout3c');\n const panelWrapperClasses = classNames(panelStyles['panel-wrapper'], className);\n\n const panelClasses = classNames(panelStyles.panel, {\n [panelStyles['panel--fill']]: variant === PanelOldVariant.fill,\n [panelStyles['panel--stroke']]: variant === PanelOldVariant.stroke,\n [panelStyles['panel--white']]: variant === PanelOldVariant.white,\n [panelStyles['panel--line']]: variant === PanelOldVariant.line,\n [panelStyles['panel--no-top-border']]: variant === PanelOldVariant.line && noTopBorder,\n [panelStyles['panel--selected']]: isExpanded,\n [panelStyles['panel--new']]: status === PanelOldStatus.new,\n [panelStyles['panel--draft']]: status === PanelOldStatus.draft,\n [panelStyles['panel--error']]: status === PanelOldStatus.error,\n [panelStyles['panel--status']]: status && status !== PanelOldStatus.normal,\n [panelStyles['panel--with-icon']]: icon,\n [panelStyles['panel--button']]: containerAsButton,\n [panelStyles['panel--clickable']]: children || url || onExpand || buttonOnClick || containerAsButton,\n });\n\n const renderCTAContainer = () => {\n const hasButton = children || url || buttonOnClick;\n const btnContainerClasses = classNames(panelStyles['panel__btn-container'], {\n [panelStyles['panel__btn-container--no-content-b']]: noContentB,\n [panelStyles['panel__btn-container--no-button']]: !hasButton,\n });\n\n return (\n (hasButton || date || time) && (\n <div className={btnContainerClasses}>\n {<DateTime date={date} time={time} />}\n {hasButton && <div className={panelStyles['panel__details-btn']}>{renderDetailsButton()}</div>}\n </div>\n )\n );\n };\n\n const renderDetailsButton = (): React.ReactNode => {\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: buttonAriaLabel,\n id: (buttonAriaLabelledById && `${buttonTextId} ${buttonAriaLabelledById}`) || (title && titleId && `${buttonTextId} ${titleId}`),\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: buttonOnClick ? buttonOnClick : (): void => setIsExpanded(!isExpanded),\n className: containerAsButton ? panelStyles['panel__expand'] : undefined,\n variant: 'borderless',\n ellipsis: true,\n ...ariaLabelAttributes,\n };\n\n if (children) {\n return (\n <Button testId=\"expand\" aria-expanded={isExpanded} {...commonProps}>\n <span id={buttonTextId}>{isExpanded ? buttonTextClose : buttonText}</span>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n );\n }\n\n return (\n <Button testId=\"url\" htmlMarkup={buttonHtmlMarkup} href={url} target={target} {...commonProps}>\n <span id={buttonTextId}>{buttonText}</span>\n <Icon svgIcon={ArrowRight} />\n </Button>\n );\n };\n\n const renderContent = (): React.ReactNode | null => {\n if (!children || (!renderChildrenWhenClosed && !isExpanded)) {\n return null;\n }\n\n const panelDetailsClasses = classNames(panelStyles['panel-details'], {\n [panelStyles['panel-details--open']]: isExpanded,\n [panelStyles['panel-details--line']]: variant === PanelOldVariant.line,\n [panelStyles['panel-details--white']]: variant === PanelOldVariant.white,\n });\n\n return (\n <div className={panelDetailsClasses} data-testid=\"panel-details\">\n <div>{children}</div>\n </div>\n );\n };\n\n const renderTitle = () => {\n const titleContainerClasses = classNames(panelStyles['title-container'], {\n [panelStyles['title-container--no-content-a']]: !contentA,\n });\n const titleClasses = classNames(panelStyles['title-container__title'], {\n [panelStyles['title-container__title--badge']]: hasBadge,\n });\n\n return (\n title && (\n <div className={titleContainerClasses}>\n <Title appearance=\"title3\" htmlMarkup={titleHtmlMarkup} id={titleId} className={titleClasses}>\n {title}\n </Title>\n {hasBadge && (\n <div className={panelStyles.panel__badge}>\n <Badge color=\"blueberry\" testId=\"badge-status\">\n {statusMessage}\n </Badge>\n </div>\n )}\n </div>\n )\n );\n };\n\n const layoutProps: LayoutProps = {\n contentA: contentA,\n contentB: contentB,\n contentHeader: contentHeader,\n ctaContainer: renderCTAContainer(),\n icon: icon,\n status: status,\n statusMessage: statusMessage,\n titleElement: renderTitle(),\n };\n\n return (\n <div\n tabIndex={focusable ? -1 : undefined}\n ref={ref}\n data-testid={testId}\n className={panelWrapperClasses}\n data-analyticsid={AnalyticsId.PanelOld}\n >\n <div className={panelClasses}>\n {layout1 && <PanelLayout1 {...layoutProps} />}\n {layout2 && <PanelLayout2 {...layoutProps} />}\n {layout3 && <PanelLayout3 {...layoutProps} layout={layout} />}\n </div>\n {renderContent()}\n </div>\n );\n});\n\nexport default PanelOld;\n","import PanelOld from './PanelOld';\nexport * from './PanelOld';\nexport default PanelOld;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,YAAA;AACA,kBAAA,SAAA;AACA,kBAAA,WAAA;AACA,kBAAA,WAAA;;;AAGF,IAAY,kBAAA,yBAAA,mBAAL;AACL,mBAAA,UAAA;AACA,mBAAA,WAAA;AACA,mBAAA,YAAA;AACA,mBAAA,UAAA;;;AAGF,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,aAAA;AACA,kBAAA,aAAA;AACA,kBAAA,cAAA;AACA,kBAAA,cAAA;AACA,kBAAA,cAAA;;;AAsEF,IAAMA,cAA0F,EAAE,QAAQ,oBAAoB;CAC5H,MAAM,mBAAuE;AAC3E,MAAI,WAAW,eAAe,MAC5B,QAAO;GAAE,OAAO,QAAQ;GAAW,SAAS;GAAe;AAG7D,SAAO;GAAE,OAAO,QAAQ;GAAO,SAAS;GAAQ;;CAGlD,MAAM,qBAAqB,GAAW,YAAY,mBAAmB,GAClE,YAAY,yBAAyB,WAAW,eAAe,KACjE,CAAC;AAEF,MAAK,WAAW,eAAe,SAAS,WAAW,eAAe,UAAU,cAC1E,QACE,qBAAC,OAAA;EAAI,WAAW;EAAoB,eAAY;;GAC7C,oBAAC,cAAA;IAAK,GAAI,YAAY;IAAE,MAAM,SAAS;KAAU;GAAC;GAAC,oBAAC,QAAA,EAAA,UAAM,eAAA,CAAqB;;GAC5E;AAIV,QAAO;;AAGT,IAAMC,gBAA0D,EAAE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M,wBAAwB,GAAW,YAAY,oBAAoB,GACtE,YAAY,mCAAmC,CAAC,UAClD,CAAC;EACF,MAAM,eAAe,GAAW,YAAY,2BAA2B,GACpE,YAAY,mCAAmC,UACjD,CAAC;AAEF,SACE,SACE,qBAAC,OAAA;GAAI,WAAW;cACd,oBAAC,eAAA;IAAM,YAAW;IAAS,YAAY;IAAiB,IAAI;IAAS,WAAW;cAC7E;KACK,EACP,YACC,oBAAC,OAAA;IAAI,WAAW,YAAY;cAC1B,oBAAC,eAAA;KAAM,OAAM;KAAY,QAAO;eAC7B;MACK;KACJ,CAAA;IAEJ;;CAKZ,MAAMC,cAA2B;EACrB;EACA;EACK;EACf,cAAc,oBAAoB;EAC5B;EACE;EACO;EACf,cAAc,aAAa;EAC5B;AAED,QACE,qBAAC,OAAA;EACC,UAAU,YAAY,KAAK,KAAA;EACtB;EACL,eAAa;EACb,WAAW;EACX,oBAAkB,YAAY;aAE9B,qBAAC,OAAA;GAAI,WAAW;;IACb,WAAW,oBAAC,cAAA,EAAa,GAAI,aAAA,CAAe;IAC5C,WAAW,oBAAC,cAAA,EAAa,GAAI,aAAA,CAAe;IAC5C,WAAW,oBAAC,cAAA;KAAa,GAAI;KAAqB;MAAU;;IACzD,EACL,eAAe,CAAA;GACZ;EAER"}
1
+ {"version":3,"file":"PanelOld.js","names":["StatusText: React.FC<{ status?: keyof typeof PanelOldStatus; statusMessage?: string }>","PreContainer: React.FC<{ children?: React.ReactNode }>","DateTime: React.FC<{ date?: string; time?: string }>","PanelLayout1: React.FC<LayoutProps>","PanelLayout2: React.FC<LayoutProps>","PanelLayout3: React.FC<LayoutProps>","commonProps: Partial<ButtonProps> & AriaLabelAttributes","layoutProps: LayoutProps"],"sources":["../src/components/PanelOld/PanelOld.tsx","../src/components/PanelOld/index.tsx"],"sourcesContent":["import React, { useId } from 'react';\n\nimport classNames from 'classnames';\n\nimport { type AnchorTarget, AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { palette } from '../../theme/palette';\nimport { type AriaLabelAttributes, getAriaLabelAttributes } from '../../utils/accessibility';\nimport Badge from '../Badge';\nimport Button, { type ButtonProps, type ButtonTags } from '../Button';\nimport Icon, { IconSize, type SvgPathProps } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport ArrowRight from '../Icons/ArrowRight';\nimport Calendar from '../Icons/Calendar';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport Pencil from '../Icons/Pencil';\nimport Watch from '../Icons/Watch';\nimport Title, { type TitleTags } from '../Title';\n\nimport panelStyles from './styles.module.scss';\n\nexport enum PanelOldStatus {\n normal = 'normal',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n\nexport enum PanelOldVariant {\n fill = 'fill',\n white = 'white',\n stroke = 'stroke',\n line = 'line',\n}\n\nexport enum PanelOldLayout {\n layout1 = 'layout1',\n layout2 = 'layout2',\n layout3a = 'layout3a',\n layout3b = 'layout3b',\n layout3c = 'layout3c',\n}\n\nexport interface PanelOldProps {\n /** Adds custom classes to the element. */\n className?: string;\n /** Panel section A content */\n contentA?: React.ReactNode | string;\n /** Panel section B content */\n contentB?: React.ReactNode | string;\n /** Content for a container that renders above A and B regardless of layout */\n contentHeader?: React.ReactNode;\n /** Container acts as a button, clicking anywhere triggers a panel button click */\n containerAsButton?: boolean;\n /** Panel children */\n children?: React.ReactNode;\n /** Displays date with icon */\n date?: string;\n /** Expands or collapses the panel */\n expanded?: boolean;\n /** Whether the panel can be focused */\n focusable?: boolean;\n /** Icon displayed in title */\n icon?: React.ReactNode;\n /** Panel button text */\n buttonText?: string;\n /** Panel button close text */\n buttonTextClose?: string;\n /** HTML markup for panel button. Default: a */\n buttonHtmlMarkup?: ButtonTags;\n /** Callback when the panel button is clicked */\n buttonOnClick?: ButtonProps['onClick'];\n /** Panel button is aria-labelledby the text in the button itself + the element set in buttonAriaLabelledById. Default: auto-generated id for title (if title is set). */\n buttonAriaLabelledById?: string;\n /** Panel button aria label */\n buttonAriaLabel?: string;\n /** Layout of the panel */\n layout?: keyof typeof PanelOldLayout;\n /** Removes top border when variant is \"line\" */\n noTopBorder?: boolean;\n /** Called when the panel is opened/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 /** Displays a status on the left side: default normal */\n status?: keyof typeof PanelOldStatus;\n /** Displayed on top of the panel with a status icon */\n statusMessage?: string;\n /** Sets the data-testid attribute for testing purposes */\n testId?: string;\n /** Displays time with icon */\n time?: string;\n /** Title of the panel */\n title?: string;\n /** Changes the underlying element of the title. Default: h2 */\n titleHtmlMarkup?: TitleTags;\n /** Changes the visual representation of the panel */\n variant?: keyof typeof PanelOldVariant;\n /** URL to details, renders as a button with anchor tag */\n url?: string;\n /** target used in the button: default is _self */\n target?: AnchorTarget;\n}\n\nexport interface LayoutProps extends Pick<\n PanelOldProps,\n 'contentA' | 'contentB' | 'contentHeader' | 'icon' | 'layout' | 'status' | 'statusMessage'\n> {\n ctaContainer?: React.ReactNode;\n titleElement: React.ReactNode;\n}\n\nconst StatusText: React.FC<{ status?: keyof typeof PanelOldStatus; statusMessage?: string }> = ({ status, statusMessage }) => {\n const statusIcon = (): { color: string; svgIcon: React.FC<SvgPathProps> } => {\n if (status === PanelOldStatus.error) {\n return { color: palette.cherry500, svgIcon: AlertSignFill };\n }\n\n return { color: palette.black, svgIcon: Pencil };\n };\n\n const statusMessageClass = classNames(panelStyles['status-message'], {\n [panelStyles['status-message--new']]: status === PanelOldStatus.new,\n });\n\n if ((status === PanelOldStatus.error || status === PanelOldStatus.draft) && statusMessage) {\n return (\n <div className={statusMessageClass} data-testid=\"display-status\">\n {<Icon {...statusIcon()} size={IconSize.XSmall} />} <span>{statusMessage}</span>\n </div>\n );\n }\n\n return null;\n};\n\nconst PreContainer: React.FC<{ children?: React.ReactNode }> = ({ children }) => {\n if (typeof children === 'undefined') return null;\n return <div className={panelStyles['header-container']}>{children}</div>;\n};\n\nconst DateTime: React.FC<{ date?: string; time?: string }> = ({ date, time }) => {\n if (date || time) {\n return (\n <div className={panelStyles['datetime-container']} data-testid=\"datetime\">\n {date && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Calendar} size={IconSize.XSmall} />\n <span>{date}</span>\n </div>\n )}\n {time && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Watch} size={IconSize.XSmall} />\n <span>{time}</span>\n </div>\n )}\n </div>\n );\n }\n\n return null;\n};\n\nconst PanelLayout1: React.FC<LayoutProps> = ({\n contentA,\n contentB,\n contentHeader,\n ctaContainer,\n icon,\n status,\n statusMessage,\n titleElement,\n}) => {\n const panelLayoutClasses = classNames(panelStyles['panel__layout-1'], {\n [panelStyles['panel__layout-1--with-icon']]: icon,\n });\n const iconClasses = classNames(panelStyles.panel__icon, panelStyles['panel__icon--layout-1'], {\n [panelStyles['panel__icon--no-content']]: !contentA && !contentB,\n });\n\n return (\n <div className={panelLayoutClasses}>\n <StatusText status={status} statusMessage={statusMessage} />\n <PreContainer>{contentHeader}</PreContainer>\n {icon && <div className={iconClasses}>{icon}</div>}\n <div className={panelStyles['panel__layout-1__content-a']}>\n {titleElement}\n {contentA}\n </div>\n {contentB && <div>{contentB}</div>}\n {ctaContainer}\n </div>\n );\n};\n\nconst PanelLayout2: React.FC<LayoutProps> = ({\n contentA,\n contentB,\n contentHeader,\n ctaContainer,\n icon,\n status,\n statusMessage,\n titleElement,\n}) => {\n const panelLayoutClasses = classNames(panelStyles['panel__layout-2'], {\n [panelStyles['panel__layout-2--with-icon']]: icon,\n });\n const iconClasses = classNames(panelStyles.panel__icon, panelStyles['panel__icon--layout-2'], {\n [panelStyles['panel__icon--no-content']]: !contentA && !contentB,\n });\n const lastColumnClass = panelStyles['panel__layout-2__last-column'];\n\n return (\n <div className={panelLayoutClasses}>\n <StatusText status={status} statusMessage={statusMessage} />\n <PreContainer>{contentHeader}</PreContainer>\n {icon && <div className={iconClasses}>{icon}</div>}\n <div className={panelStyles['panel__layout-2__content-a']}>\n {titleElement}\n {contentA}\n </div>\n {contentB && <div className={lastColumnClass}>{contentB}</div>}\n {ctaContainer && <div className={lastColumnClass}>{ctaContainer}</div>}\n </div>\n );\n};\n\nconst PanelLayout3: React.FC<LayoutProps> = ({\n contentA,\n contentB,\n contentHeader,\n ctaContainer,\n icon,\n layout,\n status,\n statusMessage,\n titleElement,\n}) => {\n const layoutClasses = classNames(panelStyles['panel__layout-3'], {\n [panelStyles['panel__layout-3--with-icon']]: icon,\n [panelStyles['panel__layout-3--a']]: layout === PanelOldLayout.layout3a,\n [panelStyles['panel__layout-3--b']]: layout === PanelOldLayout.layout3b,\n [panelStyles['panel__layout-3--c']]: layout === PanelOldLayout.layout3c,\n });\n const iconClasses = classNames(panelStyles.panel__icon, panelStyles['panel__icon--layout-3'], {\n [panelStyles['panel__icon--no-content']]: !contentA && !contentB,\n });\n\n return (\n <div className={layoutClasses}>\n <StatusText status={status} statusMessage={statusMessage} />\n <PreContainer>{contentHeader}</PreContainer>\n {icon && <div className={iconClasses}>{icon}</div>}\n <div>\n {titleElement}\n {contentA}\n </div>\n <div className={panelStyles['panel__layout-3__last-column']}>\n {contentB && <div className={panelStyles['panel__layout-3__last-column__content-b']}>{contentB}</div>}\n {ctaContainer}\n </div>\n </div>\n );\n};\n\nconst PanelOld = React.forwardRef(function PanelForwardedRef(props: PanelOldProps, ref: React.ForwardedRef<HTMLHeadingElement>) {\n const {\n buttonAriaLabel,\n buttonAriaLabelledById,\n buttonText = 'Se detaljer',\n buttonTextClose = 'Skjul detaljer',\n buttonHtmlMarkup = 'a',\n buttonOnClick,\n children,\n className,\n containerAsButton = false,\n contentA,\n contentB,\n contentHeader,\n date,\n expanded = false,\n focusable = false,\n icon,\n layout = PanelOldLayout.layout2,\n noTopBorder,\n onExpand,\n renderChildrenWhenClosed = false,\n status = PanelOldStatus.normal,\n statusMessage,\n target = '_self',\n testId,\n time,\n title,\n titleHtmlMarkup = 'h2',\n url,\n variant = PanelOldVariant.fill,\n } = props;\n\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const titleId = useId();\n const buttonTextId = useId();\n const hasBadge = statusMessage && status === PanelOldStatus.new;\n const noContentB = typeof contentB === 'undefined';\n const layout1 = layout === 'layout1' || noContentB;\n const layout2 = !noContentB && layout === 'layout2';\n const layout3 = !noContentB && (layout === 'layout3a' || layout === 'layout3b' || layout === 'layout3c');\n const panelWrapperClasses = classNames(panelStyles['panel-wrapper'], className);\n\n const panelClasses = classNames(panelStyles.panel, {\n [panelStyles['panel--fill']]: variant === PanelOldVariant.fill,\n [panelStyles['panel--stroke']]: variant === PanelOldVariant.stroke,\n [panelStyles['panel--white']]: variant === PanelOldVariant.white,\n [panelStyles['panel--line']]: variant === PanelOldVariant.line,\n [panelStyles['panel--no-top-border']]: variant === PanelOldVariant.line && noTopBorder,\n [panelStyles['panel--selected']]: isExpanded,\n [panelStyles['panel--new']]: status === PanelOldStatus.new,\n [panelStyles['panel--draft']]: status === PanelOldStatus.draft,\n [panelStyles['panel--error']]: status === PanelOldStatus.error,\n [panelStyles['panel--status']]: status && status !== PanelOldStatus.normal,\n [panelStyles['panel--with-icon']]: icon,\n [panelStyles['panel--button']]: containerAsButton,\n [panelStyles['panel--clickable']]: children || url || onExpand || buttonOnClick || containerAsButton,\n });\n\n const renderCTAContainer = () => {\n const hasButton = children || url || buttonOnClick;\n const btnContainerClasses = classNames(panelStyles['panel__btn-container'], {\n [panelStyles['panel__btn-container--no-content-b']]: noContentB,\n [panelStyles['panel__btn-container--no-button']]: !hasButton,\n });\n\n return (\n (hasButton || date || time) && (\n <div className={btnContainerClasses}>\n {<DateTime date={date} time={time} />}\n {hasButton && <div className={panelStyles['panel__details-btn']}>{renderDetailsButton()}</div>}\n </div>\n )\n );\n };\n\n const renderDetailsButton = (): React.ReactNode => {\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: buttonAriaLabel,\n id: (buttonAriaLabelledById && `${buttonTextId} ${buttonAriaLabelledById}`) || (title && titleId && `${buttonTextId} ${titleId}`),\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: buttonOnClick ? buttonOnClick : (): void => setIsExpanded(!isExpanded),\n className: containerAsButton ? panelStyles['panel__expand'] : undefined,\n variant: 'borderless',\n ellipsis: true,\n ...ariaLabelAttributes,\n };\n\n if (children) {\n return (\n <Button testId=\"expand\" aria-expanded={isExpanded} {...commonProps}>\n <span id={buttonTextId}>{isExpanded ? buttonTextClose : buttonText}</span>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n );\n }\n\n return (\n <Button testId=\"url\" htmlMarkup={buttonHtmlMarkup} href={url} target={target} {...commonProps}>\n <span id={buttonTextId}>{buttonText}</span>\n <Icon svgIcon={ArrowRight} />\n </Button>\n );\n };\n\n const renderContent = (): React.ReactNode | null => {\n if (!children || (!renderChildrenWhenClosed && !isExpanded)) {\n return null;\n }\n\n const panelDetailsClasses = classNames(panelStyles['panel-details'], {\n [panelStyles['panel-details--open']]: isExpanded,\n [panelStyles['panel-details--line']]: variant === PanelOldVariant.line,\n [panelStyles['panel-details--white']]: variant === PanelOldVariant.white,\n });\n\n return (\n <div className={panelDetailsClasses} data-testid=\"panel-details\">\n <div>{children}</div>\n </div>\n );\n };\n\n const renderTitle = () => {\n const titleContainerClasses = classNames(panelStyles['title-container'], {\n [panelStyles['title-container--no-content-a']]: !contentA,\n });\n const titleClasses = classNames(panelStyles['title-container__title'], {\n [panelStyles['title-container__title--badge']]: hasBadge,\n });\n\n return (\n title && (\n <div className={titleContainerClasses}>\n <Title appearance=\"title3\" htmlMarkup={titleHtmlMarkup} id={titleId} className={titleClasses}>\n {title}\n </Title>\n {hasBadge && (\n <div className={panelStyles.panel__badge}>\n <Badge color=\"blueberry\" testId=\"badge-status\">\n {statusMessage}\n </Badge>\n </div>\n )}\n </div>\n )\n );\n };\n\n const layoutProps: LayoutProps = {\n contentA: contentA,\n contentB: contentB,\n contentHeader: contentHeader,\n ctaContainer: renderCTAContainer(),\n icon: icon,\n status: status,\n statusMessage: statusMessage,\n titleElement: renderTitle(),\n };\n\n return (\n <div\n tabIndex={focusable ? -1 : undefined}\n ref={ref}\n data-testid={testId}\n className={panelWrapperClasses}\n data-analyticsid={AnalyticsId.PanelOld}\n >\n <div className={panelClasses}>\n {layout1 && <PanelLayout1 {...layoutProps} />}\n {layout2 && <PanelLayout2 {...layoutProps} />}\n {layout3 && <PanelLayout3 {...layoutProps} layout={layout} />}\n </div>\n {renderContent()}\n </div>\n );\n});\n\nexport default PanelOld;\n","import PanelOld from './PanelOld';\nexport * from './PanelOld';\nexport default PanelOld;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,YAAA;AACA,kBAAA,SAAA;AACA,kBAAA,WAAA;AACA,kBAAA,WAAA;;;AAGF,IAAY,kBAAA,yBAAA,mBAAL;AACL,mBAAA,UAAA;AACA,mBAAA,WAAA;AACA,mBAAA,YAAA;AACA,mBAAA,UAAA;;;AAGF,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,aAAA;AACA,kBAAA,aAAA;AACA,kBAAA,cAAA;AACA,kBAAA,cAAA;AACA,kBAAA,cAAA;;;AAwEF,IAAMA,cAA0F,EAAE,QAAQ,oBAAoB;CAC5H,MAAM,mBAAuE;AAC3E,MAAI,WAAW,eAAe,MAC5B,QAAO;GAAE,OAAO,QAAQ;GAAW,SAAS;GAAe;AAG7D,SAAO;GAAE,OAAO,QAAQ;GAAO,SAAS;GAAQ;;CAGlD,MAAM,qBAAqB,WAAW,YAAY,mBAAmB,GAClE,YAAY,yBAAyB,WAAW,eAAe,KACjE,CAAC;AAEF,MAAK,WAAW,eAAe,SAAS,WAAW,eAAe,UAAU,cAC1E,QACE,qBAAC,OAAA;EAAI,WAAW;EAAoB,eAAY;;GAC7C,oBAAC,cAAA;IAAK,GAAI,YAAY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0BAA0B,YAAY,gBAAgB;IACpE,CAAC;GAGqC,eAAY;aAC/C,oBAAC,OAAA,EAAK,UAAA,CAAe;IACjB;;CAIV,MAAM,oBAAoB;EACxB,MAAM,wBAAwB,WAAW,YAAY,oBAAoB,GACtE,YAAY,mCAAmC,CAAC,UAClD,CAAC;EACF,MAAM,eAAe,WAAW,YAAY,2BAA2B,GACpE,YAAY,mCAAmC,UACjD,CAAC;AAEF,SACE,SACE,qBAAC,OAAA;GAAI,WAAW;cACd,oBAAC,eAAA;IAAM,YAAW;IAAS,YAAY;IAAiB,IAAI;IAAS,WAAW;cAC7E;KACK,EACP,YACC,oBAAC,OAAA;IAAI,WAAW,YAAY;cAC1B,oBAAC,eAAA;KAAM,OAAM;KAAY,QAAO;eAC7B;MACK;KACJ,CAAA;IAEJ;;CAKZ,MAAMC,cAA2B;EACrB;EACA;EACK;EACf,cAAc,oBAAoB;EAC5B;EACE;EACO;EACf,cAAc,aAAa;EAC5B;AAED,QACE,qBAAC,OAAA;EACC,UAAU,YAAY,KAAK,KAAA;EACtB;EACL,eAAa;EACb,WAAW;EACX,oBAAkB,YAAY;aAE9B,qBAAC,OAAA;GAAI,WAAW;;IACb,WAAW,oBAAC,cAAA,EAAa,GAAI,aAAA,CAAe;IAC5C,WAAW,oBAAC,cAAA,EAAa,GAAI,aAAA,CAAe;IAC5C,WAAW,oBAAC,cAAA;KAAa,GAAI;KAAqB;MAAU;;IACzD,EACL,eAAe,CAAA;GACZ;EAER"}
package/lib/PanelTitle.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { t as Title_default } from "./Title2.js";
2
2
  import { t as Highlighter_default } from "./Highlighter.js";
3
3
  import React from "react";
4
- import cn from "classnames";
4
+ import classNames from "classnames";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import styles from "./components/Panel/PanelTitle/styles.module.scss";
7
7
  var PanelTitle = (props) => {
8
8
  const { testId, icon, badge, title, titleMarkup = "h3", highlightText } = props;
9
9
  return /* @__PURE__ */ jsxs("div", {
10
- className: cn(styles["paneltitle"], { [styles["paneltitle--has-icon"]]: icon }),
10
+ className: classNames(styles["paneltitle"], { [styles["paneltitle--has-icon"]]: icon }),
11
11
  "data-testid": testId,
12
12
  children: [icon && /* @__PURE__ */ jsx("div", {
13
13
  className: styles["paneltitle__icon"],
@@ -1 +1 @@
1
- {"version":3,"file":"PanelTitle.js","names":["PanelTitle: React.FC<PanelTitleProps>"],"sources":["../src/components/Panel/PanelTitle/PanelTitle.tsx","../src/components/Panel/PanelTitle/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Highlighter from '../../Highlighter';\nimport Title from '../../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelTitleProps {\n /** Badge displayed in title */\n badge?: React.ReactNode;\n /** Icon displayed in title. Only IconSize Small is supported */\n icon?: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Title text */\n title: string | React.ReactNode;\n /** Title HTML markup */\n titleMarkup?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** Highlights text in title and content. Used for search results */\n highlightText?: string;\n}\n\nconst PanelTitle: React.FC<PanelTitleProps> = (props: PanelTitleProps) => {\n const { testId, icon, badge, title, titleMarkup = 'h3', highlightText } = props;\n return (\n <div className={classNames(styles['paneltitle'], { [styles['paneltitle--has-icon']]: icon })} data-testid={testId}>\n {icon && <div className={styles['paneltitle__icon']}>{icon}</div>}\n {title && (\n <div className={styles['paneltitle__title']}>\n <Title appearance=\"title3\" htmlMarkup={titleMarkup}>\n <Highlighter searchText={highlightText}>{title}</Highlighter>\n </Title>\n {badge && <div className={styles['paneltitle__badge']}>{badge}</div>}\n </div>\n )}\n </div>\n );\n};\n\nexport default PanelTitle;\n","import PanelTitle from './PanelTitle';\nexport * from './PanelTitle';\nexport default PanelTitle;\n"],"mappings":";;;;;;AAwBA,IAAMA,cAAyC,UAA2B;CACxE,MAAM,EAAE,QAAQ,MAAM,OAAO,OAAO,cAAc,MAAM,kBAAkB;AAC1E,QACE,qBAAC,OAAA;EAAI,WAAW,GAAW,OAAO,eAAe,GAAG,OAAO,0BAA0B,MAAM,CAAC;EAAE,eAAa;aACxG,QAAQ,oBAAC,OAAA;GAAI,WAAW,OAAO;aAAsB;IAAW,EAChE,SACC,qBAAC,OAAA;GAAI,WAAW,OAAO;cACrB,oBAAC,eAAA;IAAM,YAAW;IAAS,YAAY;cACrC,oBAAC,qBAAA;KAAY,YAAY;eAAgB;MAAoB;KACvD,EACP,SAAS,oBAAC,OAAA;IAAI,WAAW,OAAO;cAAuB;KAAY,CAAA;IAChE,CAAA;GAEJ;;ACnCV,IAAA,uBDuCe"}
1
+ {"version":3,"file":"PanelTitle.js","names":["PanelTitle: React.FC<PanelTitleProps>"],"sources":["../src/components/Panel/PanelTitle/PanelTitle.tsx","../src/components/Panel/PanelTitle/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Highlighter from '../../Highlighter';\nimport Title from '../../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelTitleProps {\n /** Badge displayed in title */\n badge?: React.ReactNode;\n /** Icon displayed in title. Only IconSize Small is supported */\n icon?: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Title text */\n title: string | React.ReactNode;\n /** Title HTML markup */\n titleMarkup?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** Highlights text in title and content. Used for search results */\n highlightText?: string;\n}\n\nconst PanelTitle: React.FC<PanelTitleProps> = (props: PanelTitleProps) => {\n const { testId, icon, badge, title, titleMarkup = 'h3', highlightText } = props;\n return (\n <div className={classNames(styles['paneltitle'], { [styles['paneltitle--has-icon']]: icon })} data-testid={testId}>\n {icon && <div className={styles['paneltitle__icon']}>{icon}</div>}\n {title && (\n <div className={styles['paneltitle__title']}>\n <Title appearance=\"title3\" htmlMarkup={titleMarkup}>\n <Highlighter searchText={highlightText}>{title}</Highlighter>\n </Title>\n {badge && <div className={styles['paneltitle__badge']}>{badge}</div>}\n </div>\n )}\n </div>\n );\n};\n\nexport default PanelTitle;\n","import PanelTitle from './PanelTitle';\nexport * from './PanelTitle';\nexport default PanelTitle;\n"],"mappings":";;;;;;AAwBA,IAAMA,cAAyC,UAA2B;CACxE,MAAM,EAAE,QAAQ,MAAM,OAAO,OAAO,cAAc,MAAM,kBAAkB;AAC1E,QACE,qBAAC,OAAA;EAAI,WAAW,WAAW,OAAO,eAAe,GAAG,OAAO,0BAA0B,MAAM,CAAC;EAAE,eAAa;aACxG,QAAQ,oBAAC,OAAA;GAAI,WAAW,OAAO;aAAsB;IAAW,EAChE,SACC,qBAAC,OAAA;GAAI,WAAW,OAAO;cACrB,oBAAC,eAAA;IAAM,YAAW;IAAS,YAAY;cACrC,oBAAC,qBAAA;KAAY,YAAY;eAAgB;MAAoB;KACvD,EACP,SAAS,oBAAC,OAAA;IAAI,WAAW,OAAO;cAAuB;KAAY,CAAA;IAChE,CAAA;GAEJ;;ACnCV,IAAA,uBDuCe"}
package/lib/PopOver.js CHANGED
@@ -2,7 +2,7 @@ import { c as ZIndex, n as AnalyticsId } from "./constants2.js";
2
2
  import { n as getAriaLabelAttributes } from "./accessibility.js";
3
3
  import { _ as autoUpdate, a as useDismiss, d as arrow, f as flip, h as shift, i as useClick, l as useInteractions, m as offset, o as useFloating, p as hide, r as FloatingFocusManager, t as FloatingArrow, u as useMergeRefs } from "./floating-ui.react.js";
4
4
  import React, { useRef } from "react";
5
- import cn from "classnames";
5
+ import classNames from "classnames";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import styles from "./components/PopOver/styles.module.scss";
8
8
  let PopOverVariant = /* @__PURE__ */ function(PopOverVariant$1) {
@@ -44,7 +44,7 @@ var PopOver = React.forwardRef((props, ref) => {
44
44
  visibility: isVisible ? "visible" : "hidden",
45
45
  zIndex
46
46
  },
47
- className: cn(styles.popover, className),
47
+ className: classNames(styles.popover, className),
48
48
  ...getFloatingProps(),
49
49
  role,
50
50
  "data-testid": testId,
@@ -1 +1 @@
1
- {"version":3,"file":"PopOver.js","names":[],"sources":["../src/components/PopOver/PopOver.tsx","../src/components/PopOver/index.ts"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport {\n autoUpdate,\n flip,\n offset,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n FloatingArrow,\n arrow,\n hide,\n FloatingFocusManager,\n useMergeRefs,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\nexport enum PopOverVariant {\n positionautomatic = 'positionautomatic',\n positionbelow = 'positionbelow',\n positionabove = 'positionabove',\n}\n\nexport type PopOverRole = 'tooltip' | 'dialog' | 'group';\n\nexport type PopOverPlacement = 'top' | 'bottom';\n\nexport interface PopOverProps {\n /** Sets aria-label of the bubble. If role is set to dialog ariaLabel or ariaLabelledById MUST be set! */\n ariaLabel?: string;\n /** Sets aria-labelledby of the bubble. If role is set to dialog ariaLabel or ariaLabelledById MUST be set! */\n ariaLabelledById?: string;\n /** Id of the PopOver */\n id?: string;\n /** Content shown inside PopOver. Note that if role=\"tooltip\", you must not include interactive/focusable elements. */\n children: React.ReactNode;\n /** Ref for the element the PopOver is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Show the popover. Only applies when role=tooltip. Default: false. */\n show?: boolean;\n /** Adds custom classes to the element. */\n className?: string;\n /** @deprecated Adds custom classes to the arrow element. */\n arrowClassName?: string;\n /** @deprecated use placement instead. Determines the placement of the popover. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\n /** Sets the placement of the popover relative to the trigger if there is space, otherwise automatic. */\n placement?: PopOverPlacement;\n /** Sets role of the PopOver element */\n role?: PopOverRole;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Overrides the default z-index of PopOver */\n zIndex?: number;\n}\n\nconst PopOver = React.forwardRef<HTMLDivElement | SVGSVGElement | HTMLElement, PopOverProps>((props, ref) => {\n const {\n ariaLabel,\n ariaLabelledById,\n id,\n children,\n controllerRef,\n show = false,\n className = '',\n variant = PopOverVariant.positionautomatic,\n role = 'dialog',\n testId,\n zIndex = ZIndex.PopOver,\n placement,\n } = props;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n\n const placementProp = placement ?? (variant === PopOverVariant.positionabove ? 'top' : 'bottom');\n\n const arrowRef = useRef(null);\n const { refs, floatingStyles, context, middlewareData } = useFloating({\n middleware: [offset(10), flip(), shift({ padding: 8 }), hide(), arrow({ element: arrowRef })],\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: {\n reference: controllerRef.current,\n },\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n\n const { getFloatingProps } = useInteractions([click, dismiss]);\n\n const isVisible = show && !middlewareData.hide?.referenceHidden;\n\n const mergedRef = useMergeRefs<HTMLElement | SVGSVGElement>([refs.setFloating, ref]);\n\n return (\n <FloatingFocusManager context={context} modal={false}>\n <div\n id={id}\n ref={mergedRef}\n style={{ ...floatingStyles, visibility: isVisible ? 'visible' : 'hidden', zIndex: zIndex }}\n className={classNames(styles.popover, className)}\n {...getFloatingProps()}\n role={role}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PopOver}\n {...ariaLabelAttributes}\n >\n {children}\n <FloatingArrow\n ref={arrowRef}\n className={styles['popover__arrow']}\n context={context}\n fill={'var(--core-color-white)'}\n stroke={'var(--color-base-border-onlight)'}\n strokeWidth={1}\n />\n </div>\n </FloatingFocusManager>\n );\n});\n\nPopOver.displayName = 'PopOver';\n\nexport default PopOver;\n","import PopOver from './PopOver';\nexport * from './PopOver';\nexport default PopOver;\n"],"mappings":";;;;;;;AAwBA,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,uBAAA;AACA,kBAAA,mBAAA;AACA,kBAAA,mBAAA;;;AAoCF,IAAM,UAAU,MAAM,YAAwE,OAAO,QAAQ;CAC3G,MAAM,EACJ,WACA,kBACA,IACA,UACA,eACA,OAAO,OACP,YAAY,IACZ,UAAU,eAAe,mBACzB,OAAO,UACP,QACA,SAAS,OAAO,SAChB,cACE;CAEJ,MAAM,sBAAsB,uBAAuB;EAAE,OAAO;EAAW,IAAI;EAAkB,CAAC;CAE9F,MAAM,gBAAgB,cAAc,YAAY,eAAe,gBAAgB,QAAQ;CAEvF,MAAM,WAAW,OAAO,KAAK;CAC7B,MAAM,EAAE,MAAM,gBAAgB,SAAS,mBAAmB,YAAY;EACpE,YAAY;GAAC,OAAO,GAAG;GAAE,MAAM;GAAE,MAAM,EAAE,SAAS,GAAG,CAAC;GAAE,MAAM;GAAE,MAAM,EAAE,SAAS,UAAU,CAAC;GAAC;EAC7F,WAAW;EACX,sBAAsB;EACtB,UAAU,EACR,WAAW,cAAc,SAC1B;EACF,CAAC;CAKF,MAAM,EAAE,qBAAqB,gBAAgB,CAH/B,SAAS,QAAQ,EACf,WAAW,QAAQ,CAE0B,CAAC;CAE9D,MAAM,YAAY,QAAQ,CAAC,eAAe,MAAM;AAIhD,QACE,oBAAC,sBAAA;EAA8B;EAAS,OAAO;YAC7C,qBAAC,OAAA;GACK;GACJ,KANY,aAA0C,CAAC,KAAK,aAAa,IAAI,CAAC;GAO9E,OAAO;IAAE,GAAG;IAAgB,YAAY,YAAY,YAAY;IAAkB;IAAQ;GAC1F,WAAW,GAAW,OAAO,SAAS,UAAU;GAChD,GAAI,kBAAkB;GAChB;GACN,eAAa;GACb,oBAAkB,YAAY;GAC9B,GAAI;cAEH,UACD,oBAAC,eAAA;IACC,KAAK;IACL,WAAW,OAAO;IACT;IACT,MAAM;IACN,QAAQ;IACR,aAAa;KACb,CAAA;IACE;GACe;EAEzB;AAEF,QAAQ,cAAc;AC/HtB,IAAA,oBDiIe"}
1
+ {"version":3,"file":"PopOver.js","names":[],"sources":["../src/components/PopOver/PopOver.tsx","../src/components/PopOver/index.ts"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport {\n autoUpdate,\n flip,\n offset,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n FloatingArrow,\n arrow,\n hide,\n FloatingFocusManager,\n useMergeRefs,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\nexport enum PopOverVariant {\n positionautomatic = 'positionautomatic',\n positionbelow = 'positionbelow',\n positionabove = 'positionabove',\n}\n\nexport type PopOverRole = 'tooltip' | 'dialog' | 'group';\n\nexport type PopOverPlacement = 'top' | 'bottom';\n\nexport interface PopOverProps {\n /** Sets aria-label of the bubble. If role is set to dialog ariaLabel or ariaLabelledById MUST be set! */\n ariaLabel?: string;\n /** Sets aria-labelledby of the bubble. If role is set to dialog ariaLabel or ariaLabelledById MUST be set! */\n ariaLabelledById?: string;\n /** Id of the PopOver */\n id?: string;\n /** Content shown inside PopOver. Note that if role=\"tooltip\", you must not include interactive/focusable elements. */\n children: React.ReactNode;\n /** Ref for the element the PopOver is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Show the popover. Only applies when role=tooltip. Default: false. */\n show?: boolean;\n /** Adds custom classes to the element. */\n className?: string;\n /** @deprecated Adds custom classes to the arrow element. */\n arrowClassName?: string;\n /** @deprecated use placement instead. Determines the placement of the popover. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\n /** Sets the placement of the popover relative to the trigger if there is space, otherwise automatic. */\n placement?: PopOverPlacement;\n /** Sets role of the PopOver element */\n role?: PopOverRole;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Overrides the default z-index of PopOver */\n zIndex?: number;\n}\n\nconst PopOver = React.forwardRef<HTMLDivElement | SVGSVGElement | HTMLElement, PopOverProps>((props, ref) => {\n const {\n ariaLabel,\n ariaLabelledById,\n id,\n children,\n controllerRef,\n show = false,\n className = '',\n variant = PopOverVariant.positionautomatic,\n role = 'dialog',\n testId,\n zIndex = ZIndex.PopOver,\n placement,\n } = props;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n\n const placementProp = placement ?? (variant === PopOverVariant.positionabove ? 'top' : 'bottom');\n\n const arrowRef = useRef(null);\n const { refs, floatingStyles, context, middlewareData } = useFloating({\n middleware: [offset(10), flip(), shift({ padding: 8 }), hide(), arrow({ element: arrowRef })],\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: {\n reference: controllerRef.current,\n },\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n\n const { getFloatingProps } = useInteractions([click, dismiss]);\n\n const isVisible = show && !middlewareData.hide?.referenceHidden;\n\n const mergedRef = useMergeRefs<HTMLElement | SVGSVGElement>([refs.setFloating, ref]);\n\n return (\n <FloatingFocusManager context={context} modal={false}>\n <div\n id={id}\n ref={mergedRef}\n style={{ ...floatingStyles, visibility: isVisible ? 'visible' : 'hidden', zIndex: zIndex }}\n className={classNames(styles.popover, className)}\n {...getFloatingProps()}\n role={role}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PopOver}\n {...ariaLabelAttributes}\n >\n {children}\n <FloatingArrow\n ref={arrowRef}\n className={styles['popover__arrow']}\n context={context}\n fill={'var(--core-color-white)'}\n stroke={'var(--color-base-border-onlight)'}\n strokeWidth={1}\n />\n </div>\n </FloatingFocusManager>\n );\n});\n\nPopOver.displayName = 'PopOver';\n\nexport default PopOver;\n","import PopOver from './PopOver';\nexport * from './PopOver';\nexport default PopOver;\n"],"mappings":";;;;;;;AAwBA,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,uBAAA;AACA,kBAAA,mBAAA;AACA,kBAAA,mBAAA;;;AAoCF,IAAM,UAAU,MAAM,YAAwE,OAAO,QAAQ;CAC3G,MAAM,EACJ,WACA,kBACA,IACA,UACA,eACA,OAAO,OACP,YAAY,IACZ,UAAU,eAAe,mBACzB,OAAO,UACP,QACA,SAAS,OAAO,SAChB,cACE;CAEJ,MAAM,sBAAsB,uBAAuB;EAAE,OAAO;EAAW,IAAI;EAAkB,CAAC;CAE9F,MAAM,gBAAgB,cAAc,YAAY,eAAe,gBAAgB,QAAQ;CAEvF,MAAM,WAAW,OAAO,KAAK;CAC7B,MAAM,EAAE,MAAM,gBAAgB,SAAS,mBAAmB,YAAY;EACpE,YAAY;GAAC,OAAO,GAAG;GAAE,MAAM;GAAE,MAAM,EAAE,SAAS,GAAG,CAAC;GAAE,MAAM;GAAE,MAAM,EAAE,SAAS,UAAU,CAAC;GAAC;EAC7F,WAAW;EACX,sBAAsB;EACtB,UAAU,EACR,WAAW,cAAc,SAC1B;EACF,CAAC;CAKF,MAAM,EAAE,qBAAqB,gBAAgB,CAH/B,SAAS,QAAQ,EACf,WAAW,QAAQ,CAE0B,CAAC;CAE9D,MAAM,YAAY,QAAQ,CAAC,eAAe,MAAM;AAIhD,QACE,oBAAC,sBAAA;EAA8B;EAAS,OAAO;YAC7C,qBAAC,OAAA;GACK;GACJ,KANY,aAA0C,CAAC,KAAK,aAAa,IAAI,CAAC;GAO9E,OAAO;IAAE,GAAG;IAAgB,YAAY,YAAY,YAAY;IAAkB;IAAQ;GAC1F,WAAW,WAAW,OAAO,SAAS,UAAU;GAChD,GAAI,kBAAkB;GAChB;GACN,eAAa;GACb,oBAAkB,YAAY;GAC9B,GAAI;cAEH,UACD,oBAAC,eAAA;IACC,KAAK;IACL,WAAW,OAAO;IACT;IACT,MAAM;IACN,QAAQ;IACR,aAAa;KACb,CAAA;IACE;GACe;EAEzB;AAEF,QAAQ,cAAc;AC/HtB,IAAA,oBDiIe"}
@@ -7,13 +7,13 @@ import { t as getAriaDescribedBy } from "./accessibility.js";
7
7
  import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
8
8
  import { i as renderLabelAsParent, n as getLabelText } from "./Label.js";
9
9
  import React, { useState } from "react";
10
- import cn from "classnames";
10
+ import classNames from "classnames";
11
11
  import { jsx } from "react/jsx-runtime";
12
12
  import radioButtonStyles from "./components/RadioButton/styles.module.scss";
13
13
  const getRadioLabelClasses = (radioId, onColor, large, checkedRadioId) => {
14
14
  const onCherry = onColor === "oninvalid";
15
15
  const checked = radioId === checkedRadioId;
16
- return cn({
16
+ return classNames({
17
17
  [radioButtonStyles["radio-button-label__large--on-grey"]]: large && onColor === "ongrey" && !checked,
18
18
  [radioButtonStyles["radio-button-label__large--on-blueberry"]]: onColor === "onblueberry" && !checked && large,
19
19
  [radioButtonStyles["radio-button-label__large--selected"]]: large && checked && !onCherry,
@@ -31,14 +31,14 @@ const RadioButton = React.forwardRef((props, ref) => {
31
31
  const { refObject, isFocused } = usePseudoClasses(isMutableRefObject(ref) ? ref : null);
32
32
  const mergedRefs = mergeRefs([ref, refObject]);
33
33
  const errorTextId = useIdWithFallback(errorTextIdProp);
34
- const radioButtonWrapperClasses = cn(radioButtonStyles["radio-button-wrapper"], {
34
+ const radioButtonWrapperClasses = classNames(radioButtonStyles["radio-button-wrapper"], {
35
35
  [radioButtonStyles["radio-button-wrapper__large"]]: isLarge,
36
36
  [radioButtonStyles["radio-button-wrapper__large--focused"]]: isLarge && isFocused,
37
37
  [radioButtonStyles["radio-button-wrapper__large--selected"]]: isLarge && checked && isFocused,
38
38
  [radioButtonStyles["radio-button-wrapper__large--invalid"]]: isLarge && onCherry && isFocused,
39
39
  [radioButtonStyles["radio-button-wrapper__large--on-blueberry"]]: isLarge && onBlueberry && isFocused
40
40
  });
41
- const radioButtonLabelClasses = cn(radioButtonStyles["radio-button-label"], {
41
+ const radioButtonLabelClasses = classNames(radioButtonStyles["radio-button-label"], {
42
42
  [radioButtonStyles["radio-button-label--disabled"]]: disabled,
43
43
  [radioButtonStyles["radio-button-label--on-dark"]]: onDark,
44
44
  [radioButtonStyles["radio-button-label--invalid"]]: invalid,
@@ -46,7 +46,7 @@ const RadioButton = React.forwardRef((props, ref) => {
46
46
  [radioButtonStyles["radio-button-label__large--focused"]]: isFocused && isLarge,
47
47
  [radioButtonStyles["radio-button-label__large--disabled"]]: isLarge && disabled
48
48
  }, labelClassNames);
49
- const radioButtonClasses = cn(radioButtonStyles["radio-button"], {
49
+ const radioButtonClasses = classNames(radioButtonStyles["radio-button"], {
50
50
  [radioButtonStyles["radio-button--on-dark"]]: onDark,
51
51
  [radioButtonStyles["radio-button--disabled"]]: disabled,
52
52
  [radioButtonStyles["radio-button--on-blueberry"]]: onBlueberry,
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","names":[],"sources":["../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'defaultChecked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the radioButton - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** Adds custom classes to the label element. */\n labelClassNames?: string;\n /** input id of the radioButton */\n inputId?: string;\n /** Changes the visuals of the radioButton */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the radioButton. Large version only works when used inside a FormGroup wrapper. */\n size?: keyof typeof FormSize;\n /** Activates Error style for the radioButton - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const getRadioLabelClasses = (\n radioId: string,\n onColor: FormOnColor,\n large: boolean,\n checkedRadioId?: string\n): string | undefined => {\n const onCherry = onColor === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && onColor === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: onColor === 'onblueberry' && !checked && large,\n [radioButtonStyles['radio-button-label__large--selected']]: large && checked && !onCherry,\n [radioButtonStyles['radio-button-label__large--selected-invalid']]: large && checked && onCherry,\n });\n};\n\nexport const RadioButton = React.forwardRef((props: RadioButtonProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n defaultChecked,\n onChange,\n disabled,\n label,\n inputId = uuid(),\n onColor = FormOnColor.onwhite,\n name = inputId,\n size,\n errorText,\n errorTextId: errorTextIdProp,\n error = !!errorText,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n const [checked, changeChecked] = useState<boolean>();\n const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--focused']]: isLarge && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--selected']]: isLarge && checked && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry && isFocused,\n });\n const radioButtonLabelClasses = classNames(\n radioButtonStyles['radio-button-label'],\n {\n [radioButtonStyles['radio-button-label--disabled']]: disabled,\n [radioButtonStyles['radio-button-label--on-dark']]: onDark,\n [radioButtonStyles['radio-button-label--invalid']]: invalid,\n [radioButtonStyles['radio-button-label__large']]: isLarge,\n [radioButtonStyles['radio-button-label__large--focused']]: isFocused && isLarge,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(\n radioButtonStyles['radio-button'],\n {\n [radioButtonStyles['radio-button--on-dark']]: onDark,\n [radioButtonStyles['radio-button--disabled']]: disabled,\n [radioButtonStyles['radio-button--on-blueberry']]: onBlueberry,\n [radioButtonStyles['radio-button--invalid']]: invalid,\n [radioButtonStyles['radio-button__large']]: isLarge,\n [radioButtonStyles['radio-button__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button__large--invalid']]: isLarge && invalid,\n },\n className\n );\n\n const change = (e: React.ChangeEvent<HTMLInputElement>): void => {\n changeChecked(e.target.checked);\n if (onChange) onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n required={required}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n onColor as FormOnColor,\n radioButtonLabelClasses,\n undefined,\n radioButtonStyles['radiobutton-sublabel-wrapper'],\n isLarge\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"mappings":";;;;;;;;;;;;AA2CA,MAAa,wBACX,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AAwC,aAAa;GACvE,kBAAkB,yCAAyC,WAAW;EACxE,EACD,gBACD;CACD,MAAM,qBAAqB,GACzB,kBAAkB,iBAClB;GACG,kBAAkB,2BAA2B;GAC7C,kBAAkB,4BAA4B;GAC9C,kBAAkB,gCAAgC;GAClD,kBAAkB,2BAA2B;GAC7C,kBAAkB,yBAAyB;GAC3C,kBAAkB,mCAAmC,WAAW;GAChE,kBAAkB,kCAAkC,WAAW;EACjE,EACD,UACD;CAED,MAAM,UAAU,MAAiD;AAC/D,gBAAc,EAAE,OAAO,QAAQ;AAC/B,MAAI,SAAU,UAAS,EAAE;;CAG3B,MAAM,wBACJ,oBAAC,SAAA;EACC,GAAI;EACJ,IAAI;EACE;EACN,WAAW;EACX,MAAK;EACK;EACH;EACP,KAAK;EACW;EAChB,oBAAkB,mBAAmB,OAAO,YAAY;EAC9C;EACV,WAAW,MAAY,OAAO,EAAE;GAChC;AAGJ,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAwB;YACjF,oBAAC,OAAA;GAAI,eAAa;GAAQ,oBAAkB,YAAY;GAAa,WAAW;aAC7E,oBACC,OACA,iBAAiB,EACjB,SACA,SACA,yBACA,KAAA,GACA,kBAAkB,iCAClB,QACD;IACG;GACO;EAEjB;AAEF,YAAY,cAAc;AAE1B,IAAA,sBAAe"}
1
+ {"version":3,"file":"RadioButton.js","names":[],"sources":["../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper, { type ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'defaultChecked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the radioButton - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** Adds custom classes to the label element. */\n labelClassNames?: string;\n /** input id of the radioButton */\n inputId?: string;\n /** Changes the visuals of the radioButton */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the radioButton. Large version only works when used inside a FormGroup wrapper. */\n size?: keyof typeof FormSize;\n /** Activates Error style for the radioButton - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const getRadioLabelClasses = (\n radioId: string,\n onColor: FormOnColor,\n large: boolean,\n checkedRadioId?: string\n): string | undefined => {\n const onCherry = onColor === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && onColor === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: onColor === 'onblueberry' && !checked && large,\n [radioButtonStyles['radio-button-label__large--selected']]: large && checked && !onCherry,\n [radioButtonStyles['radio-button-label__large--selected-invalid']]: large && checked && onCherry,\n });\n};\n\nexport const RadioButton = React.forwardRef((props: RadioButtonProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n defaultChecked,\n onChange,\n disabled,\n label,\n inputId = uuid(),\n onColor = FormOnColor.onwhite,\n name = inputId,\n size,\n errorText,\n errorTextId: errorTextIdProp,\n error = !!errorText,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n const [checked, changeChecked] = useState<boolean>();\n const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--focused']]: isLarge && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--selected']]: isLarge && checked && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry && isFocused,\n });\n const radioButtonLabelClasses = classNames(\n radioButtonStyles['radio-button-label'],\n {\n [radioButtonStyles['radio-button-label--disabled']]: disabled,\n [radioButtonStyles['radio-button-label--on-dark']]: onDark,\n [radioButtonStyles['radio-button-label--invalid']]: invalid,\n [radioButtonStyles['radio-button-label__large']]: isLarge,\n [radioButtonStyles['radio-button-label__large--focused']]: isFocused && isLarge,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(\n radioButtonStyles['radio-button'],\n {\n [radioButtonStyles['radio-button--on-dark']]: onDark,\n [radioButtonStyles['radio-button--disabled']]: disabled,\n [radioButtonStyles['radio-button--on-blueberry']]: onBlueberry,\n [radioButtonStyles['radio-button--invalid']]: invalid,\n [radioButtonStyles['radio-button__large']]: isLarge,\n [radioButtonStyles['radio-button__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button__large--invalid']]: isLarge && invalid,\n },\n className\n );\n\n const change = (e: React.ChangeEvent<HTMLInputElement>): void => {\n changeChecked(e.target.checked);\n if (onChange) onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n required={required}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n onColor as FormOnColor,\n radioButtonLabelClasses,\n undefined,\n radioButtonStyles['radiobutton-sublabel-wrapper'],\n isLarge\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"mappings":";;;;;;;;;;;;AA4CA,MAAa,wBACX,SACA,SACA,OACA,mBACuB;CACvB,MAAM,WAAW,YAAY;CAC7B,MAAM,UAAU,YAAY;AAE5B,QAAO,WAAW;GACf,kBAAkB,wCAAwC,SAAS,YAAY,YAAY,CAAC;GAC5F,kBAAkB,6CAA6C,YAAY,iBAAiB,CAAC,WAAW;GACxG,kBAAkB,yCAAyC,SAAS,WAAW,CAAC;GAChF,kBAAkB,iDAAiD,SAAS,WAAW;EACzF,CAAC;;AAGJ,MAAa,cAAc,MAAM,YAAY,OAAyB,QAAqC;CACzG,MAAM,EACJ,WACA,gBACA,UACA,UACA,OACA,UAAU,MAAM,EAChB,UAAU,YAAY,SACtB,OAAO,SACP,MACA,WACA,aAAa,iBACb,QAAQ,CAAC,CAAC,WACV,uBACA,QAAQ,aAAa,MAAM,EAC3B,QACA,UACA,iBACA,GAAG,SACD;CACJ,MAAM,UAAU,SAAS,YAAY,YAAY;CACjD,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,cAAc,YAAY,YAAY;CAC5C,MAAM,WAAW,YAAY,YAAY;CACzC,MAAM,UAAU,SAAS,SA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;GAAa,WAAW;aAC7E,oBACC,OACA,iBAAiB,EACjB,SACA,SACA,yBACA,KAAA,GACA,kBAAkB,iCAClB,QACD;IACG;GACO;EAEjB;AAEF,YAAY,cAAc;AAE1B,IAAA,sBAAe"}
package/lib/Select.js CHANGED
@@ -7,7 +7,7 @@ import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
7
7
  import { r as renderLabel } from "./Label.js";
8
8
  import { t as ChevronDown_default } from "./ChevronDown.js";
9
9
  import React from "react";
10
- import cn from "classnames";
10
+ import classNames from "classnames";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import selectStyles from "./components/Select/styles.module.scss";
13
13
  var getSelectMaxWidth = (characters) => {
@@ -24,17 +24,17 @@ const Select = React.forwardRef(function SelectForwardedRef(props, ref) {
24
24
  const invalid = onColor === "oninvalid" || !!errorText || !!error;
25
25
  const iconColor = getIconColor(invalid, !!disabled);
26
26
  const maxWidth = width ? getSelectMaxWidth(width) : void 0;
27
- const selectInnerWrapperClasses = cn(selectStyles["select-inner-wrapper"], {
27
+ const selectInnerWrapperClasses = classNames(selectStyles["select-inner-wrapper"], {
28
28
  [selectStyles["select-inner-wrapper--transparent"]]: concept === "transparent",
29
29
  [selectStyles["select-inner-wrapper--on-blueberry"]]: onBlueberry,
30
30
  [selectStyles["select-inner-wrapper--invalid"]]: invalid,
31
31
  [selectStyles["select-inner-wrapper--disabled"]]: disabled
32
32
  }, className);
33
- const selectClasses = cn(selectStyles.select, {
33
+ const selectClasses = classNames(selectStyles.select, {
34
34
  [selectStyles["select--on-blueberry"]]: onBlueberry,
35
35
  [selectStyles["select--invalid"]]: invalid
36
36
  });
37
- const selectWrapperClasses = cn(selectStyles["select-wrapper"], wrapperClassName);
37
+ const selectWrapperClasses = classNames(selectStyles["select-wrapper"], wrapperClassName);
38
38
  return /* @__PURE__ */ jsx(ErrorWrapper_default, {
39
39
  className: errorWrapperClassName,
40
40
  errorText,
package/lib/Select.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":[],"sources":["../src/components/Select/Select.tsx","../src/components/Select/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX, FormOnColor, IconSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { getColor } from '../../theme/currys';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport Icon from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport { renderLabel } from '../Label';\n\nimport selectStyles from './styles.module.scss';\n\ntype SelectConcept = 'normal' | 'transparent';\n\nexport interface SelectProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'aria-describedby' | 'name' | 'disabled' | 'required' | 'value' | 'onChange' | 'autoComplete'\n > {\n /** Sets the content of the select element. */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Changes the visuals of the component */\n concept?: SelectConcept;\n /** The label text above the select */\n label?: React.ReactNode;\n /** Changes the visuals of the component */\n onColor?: keyof typeof FormOnColor;\n /** Activates Error style for the select component - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** select id of the select element */\n selectId?: string;\n /** Width of select in characters (approximate) */\n width?: number;\n /** Gives defaultvalue to the comp. Preferred over selected prop on option by react */\n defaultValue?: string | number;\n /** Adds custom classes to the wrapper tag */\n wrapperClassName?: string;\n}\n\nconst getSelectMaxWidth = (characters: number): string => {\n const paddingWidth = '2rem';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth})`;\n};\n\nconst getIconColor = (invalid: boolean, disabled: boolean): string => {\n const iconColor = invalid ? 'cherry' : 'blueberry';\n return disabled ? getColor('neutral', 500) : getColor(iconColor, 600);\n};\n\nexport const Select = React.forwardRef(function SelectForwardedRef(props: SelectProps, ref: React.Ref<HTMLSelectElement>) {\n const {\n className,\n children,\n concept = 'normal',\n disabled,\n error,\n errorText,\n errorTextId: errorTextIdProp,\n selectId: selectIdProp,\n errorWrapperClassName,\n label,\n name = props.selectId,\n onColor = FormOnColor.onwhite,\n testId,\n width,\n required,\n value,\n defaultValue,\n autoComplete = 'off',\n wrapperClassName,\n ...rest\n } = props;\n\n const selectId = useIdWithFallback(selectIdProp);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const onBlueberry = onColor === 'onblueberry';\n const invalid = onColor === 'oninvalid' || !!errorText || !!error;\n const iconColor = getIconColor(invalid, !!disabled);\n const maxWidth = width ? getSelectMaxWidth(width) : undefined;\n\n const selectInnerWrapperClasses = classNames(\n selectStyles['select-inner-wrapper'],\n {\n [selectStyles['select-inner-wrapper--transparent']]: concept === 'transparent',\n [selectStyles['select-inner-wrapper--on-blueberry']]: onBlueberry,\n [selectStyles['select-inner-wrapper--invalid']]: invalid,\n [selectStyles['select-inner-wrapper--disabled']]: disabled,\n },\n className\n );\n\n const selectClasses = classNames(selectStyles.select, {\n [selectStyles['select--on-blueberry']]: onBlueberry,\n [selectStyles['select--invalid']]: invalid,\n });\n\n const selectWrapperClasses = classNames(selectStyles['select-wrapper'], wrapperClassName);\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Select} className={selectWrapperClasses} style={{ maxWidth }}>\n {renderLabel(label, selectId, onColor as FormOnColor)}\n <div className={selectInnerWrapperClasses} data-testid={testId + '-inner-wrapper'}>\n <Icon\n className={selectStyles['select-arrow']}\n svgIcon={ChevronDown}\n color={iconColor}\n size={IconSize.XSmall}\n testId={testId + '-icon'}\n />\n <select\n {...rest}\n aria-invalid={!!invalid}\n id={selectId}\n name={name}\n className={selectClasses}\n disabled={disabled}\n ref={ref}\n required={required}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n aria-required={!!required}\n value={value}\n defaultValue={defaultValue}\n autoComplete={autoComplete ? autoComplete : undefined}\n >\n {children}\n </select>\n </div>\n </div>\n </ErrorWrapper>\n );\n});\n\nexport default Select;\n","import Select from './Select';\nexport * from './Select';\nexport default Select;\n"],"mappings":";;;;;;;;;;;;AAmDA,IAAM,qBAAqB,eAA+B;AAGxD,QAAO,QAAQ,aAAA,GAAwC;;AAGzD,IAAM,gBAAgB,SAAkB,aAA8B;AAEpE,QAAO,WAAW,SAAS,WAAW,IAAI,GAAG,SAD3B,UAAU,WAAW,aAC0B,IAAI;;AAGvE,MAAa,SAAS,MAAM,WAAW,SAAS,mBAAmB,OAAoB,KAAmC;CACxH,MAAM,EACJ,WACA,UACA,UAAU,UACV,UACA,OACA,WACA,aAAa,iBACb,UAAU,cACV,uBACA,OACA,OAAO,MAAM,UACb,UAAU,YAAY,SACtB,QACA,OACA,UACA,OACA,cACA,eAAe,OACf,kBACA,GAAG,SACD;CAEJ,MAAM,WAAW,kBAAkB,aAAa;CAChD,MAAM,cAAc,kBAAkB,gBAAgB;CACtD,MAAM,cAAc,YAAY;CAChC,MAAM,UAAU,YAAY,eAAe,CAAC,CAAC,aAAa,CAAC,CAAC;CAC5D,MAAM,YAAY,aAAa,SAAS,CAAC,CAAC,SAAS;CACnD,MAAM,WAAW,QAAQ,kBAAkB,MAAM,GAAG,KAAA;CAEpD,MAAM,4BAA4B,GAChC,aAAa,yBACb;GACG,aAAa,uCAAuC,YAAY;GAChE,aAAa,wCAAwC;GACrD,aAAa,mCAAmC;GAChD,aAAa,oCAAoC;EACnD,EACD,UACD;CAED,MAAM,gBAAgB,GAAW,aAAa,QAAQ;GACnD,aAAa,0BAA0B;GACvC,aAAa,qBAAqB;EACpC,CAAC;CAEF,MAAM,uBAAuB,GAAW,aAAa,mBAAmB,iBAAiB;AAEzF,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAwB;YACjF,qBAAC,OAAA;GAAI,eAAa;GAAQ,oBAAkB,YAAY;GAAQ,WAAW;GAAsB,OAAO,EAAE,UAAU;cACjH,YAAY,OAAO,UAAU,QAAuB,EACrD,qBAAC,OAAA;IAAI,WAAW;IAA2B,eAAa,SAAS;eAC/D,oBAAC,cAAA;KACC,WAAW,aAAa;KACxB,SAAS;KACT,OAAO;KACP,MAAM,SAAS;KACf,QAAQ,SAAS;MACjB,EACF,oBAAC,UAAA;KACC,GAAI;KACJ,gBAAc,CAAC,CAAC;KAChB,IAAI;KACE;KACN,WAAW;KACD;KACL;KACK;KACV,oBAAkB,mBAAmB,OAAO,YAAY;KACxD,iBAAe,CAAC,CAAC;KACV;KACO;KACd,cAAc,eAAe,eAAe,KAAA;KAE3C;MACM,CAAA;KACL,CAAA;IACF;GACO;EAEjB;AC9IF,IAAA,mBDgJe"}
1
+ {"version":3,"file":"Select.js","names":[],"sources":["../src/components/Select/Select.tsx","../src/components/Select/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX, FormOnColor, IconSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { getColor } from '../../theme/currys';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport ErrorWrapper, { type ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport Icon from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport { renderLabel } from '../Label';\n\nimport selectStyles from './styles.module.scss';\n\ntype SelectConcept = 'normal' | 'transparent';\n\nexport interface SelectProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'aria-describedby' | 'name' | 'disabled' | 'required' | 'value' | 'onChange' | 'autoComplete'\n > {\n /** Sets the content of the select element. */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Changes the visuals of the component */\n concept?: SelectConcept;\n /** The label text above the select */\n label?: React.ReactNode;\n /** Changes the visuals of the component */\n onColor?: keyof typeof FormOnColor;\n /** Activates Error style for the select component - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** select id of the select element */\n selectId?: string;\n /** Width of select in characters (approximate) */\n width?: number;\n /** Gives defaultvalue to the comp. Preferred over selected prop on option by react */\n defaultValue?: string | number;\n /** Adds custom classes to the wrapper tag */\n wrapperClassName?: string;\n}\n\nconst getSelectMaxWidth = (characters: number): string => {\n const paddingWidth = '2rem';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth})`;\n};\n\nconst getIconColor = (invalid: boolean, disabled: boolean): string => {\n const iconColor = invalid ? 'cherry' : 'blueberry';\n return disabled ? getColor('neutral', 500) : getColor(iconColor, 600);\n};\n\nexport const Select = React.forwardRef(function SelectForwardedRef(props: SelectProps, ref: React.Ref<HTMLSelectElement>) {\n const {\n className,\n children,\n concept = 'normal',\n disabled,\n error,\n errorText,\n errorTextId: errorTextIdProp,\n selectId: selectIdProp,\n errorWrapperClassName,\n label,\n name = props.selectId,\n onColor = FormOnColor.onwhite,\n testId,\n width,\n required,\n value,\n defaultValue,\n autoComplete = 'off',\n wrapperClassName,\n ...rest\n } = props;\n\n const selectId = useIdWithFallback(selectIdProp);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const onBlueberry = onColor === 'onblueberry';\n const invalid = onColor === 'oninvalid' || !!errorText || !!error;\n const iconColor = getIconColor(invalid, !!disabled);\n const maxWidth = width ? getSelectMaxWidth(width) : undefined;\n\n const selectInnerWrapperClasses = classNames(\n selectStyles['select-inner-wrapper'],\n {\n [selectStyles['select-inner-wrapper--transparent']]: concept === 'transparent',\n [selectStyles['select-inner-wrapper--on-blueberry']]: onBlueberry,\n [selectStyles['select-inner-wrapper--invalid']]: invalid,\n [selectStyles['select-inner-wrapper--disabled']]: disabled,\n },\n className\n );\n\n const selectClasses = classNames(selectStyles.select, {\n [selectStyles['select--on-blueberry']]: onBlueberry,\n [selectStyles['select--invalid']]: invalid,\n });\n\n const selectWrapperClasses = classNames(selectStyles['select-wrapper'], wrapperClassName);\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Select} className={selectWrapperClasses} style={{ maxWidth }}>\n {renderLabel(label, selectId, onColor as FormOnColor)}\n <div className={selectInnerWrapperClasses} data-testid={testId + '-inner-wrapper'}>\n <Icon\n className={selectStyles['select-arrow']}\n svgIcon={ChevronDown}\n color={iconColor}\n size={IconSize.XSmall}\n testId={testId + '-icon'}\n />\n <select\n {...rest}\n aria-invalid={!!invalid}\n id={selectId}\n name={name}\n className={selectClasses}\n disabled={disabled}\n ref={ref}\n required={required}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n aria-required={!!required}\n value={value}\n defaultValue={defaultValue}\n autoComplete={autoComplete ? autoComplete : undefined}\n >\n {children}\n </select>\n </div>\n </div>\n </ErrorWrapper>\n );\n});\n\nexport default Select;\n","import Select from './Select';\nexport * from './Select';\nexport default Select;\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAM,qBAAqB,eAA+B;AAGxD,QAAO,QAAQ,aAAA,GAAwC;;AAGzD,IAAM,gBAAgB,SAAkB,aAA8B;AAEpE,QAAO,WAAW,SAAS,WAAW,IAAI,GAAG,SAD3B,UAAU,WAAW,aAC0B,IAAI;;AAGvE,MAAa,SAAS,MAAM,WAAW,SAAS,mBAAmB,OAAoB,KAAmC;CACxH,MAAM,EACJ,WACA,UACA,UAAU,UACV,UACA,OACA,WACA,aAAa,iBACb,UAAU,cACV,uBACA,OACA,OAAO,MAAM,UACb,UAAU,YAAY,SACtB,QACA,OACA,UACA,OACA,cACA,eAAe,OACf,kBACA,GAAG,SACD;CAEJ,MAAM,WAAW,kBAAkB,aAAa;CAChD,MAAM,cAAc,kBAAkB,gBAAgB;CACtD,MAAM,cAAc,YAAY;CAChC,MAAM,UAAU,YAAY,eAAe,CAAC,CAAC,aAAa,CAAC,CAAC;CAC5D,MAAM,YAAY,aAAa,SAAS,CAAC,CAAC,SAAS;CACnD,MAAM,WAAW,QAAQ,kBAAkB,MAAM,GAAG,KAAA;CAEpD,MAAM,4BAA4B,WAChC,aAAa,yBACb;GACG,aAAa,uCAAuC,YAAY;GAChE,aAAa,wCAAwC;GACrD,aAAa,mCAAmC;GAChD,aAAa,oCAAoC;EACnD,EACD,UACD;CAED,MAAM,gBAAgB,WAAW,aAAa,QAAQ;GACnD,aAAa,0BAA0B;GACvC,aAAa,qBAAqB;EACpC,CAAC;CAEF,MAAM,uBAAuB,WAAW,aAAa,mBAAmB,iBAAiB;AAEzF,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAwB;YACjF,qBAAC,OAAA;GAAI,eAAa;GAAQ,oBAAkB,YAAY;GAAQ,WAAW;GAAsB,OAAO,EAAE,UAAU;cACjH,YAAY,OAAO,UAAU,QAAuB,EACrD,qBAAC,OAAA;IAAI,WAAW;IAA2B,eAAa,SAAS;eAC/D,oBAAC,cAAA;KACC,WAAW,aAAa;KACxB,SAAS;KACT,OAAO;KACP,MAAM,SAAS;KACf,QAAQ,SAAS;MACjB,EACF,oBAAC,UAAA;KACC,GAAI;KACJ,gBAAc,CAAC,CAAC;KAChB,IAAI;KACE;KACN,WAAW;KACD;KACL;KACK;KACV,oBAAkB,mBAAmB,OAAO,YAAY;KACxD,iBAAe,CAAC,CAAC;KACV;KACO;KACd,cAAc,eAAe,eAAe,KAAA;KAE3C;MACM,CAAA;KACL,CAAA;IACF;GACO;EAEjB;AC/IF,IAAA,mBDiJe"}
@@ -1,6 +1,6 @@
1
1
  import { t as AsChildSlot_default } from "./AsChildSlot.js";
2
2
  import React, { useId } from "react";
3
- import cn from "classnames";
3
+ import classNames from "classnames";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  import styles from "./components/Dropdown/SingleSelect/styles.module.scss";
6
6
  var SingleSelectContext = React.createContext(null);
@@ -42,8 +42,8 @@ const SingleSelectItem = React.forwardRef((props, ref) => {
42
42
  group,
43
43
  optionValue
44
44
  ]);
45
- const contentClasses = cn(styles["single-select-item__content"], { [styles["single-select-item__content--disabled"]]: isDisabled });
46
- const dotClasses = cn(styles["single-select-item__dot"], {
45
+ const contentClasses = classNames(styles["single-select-item__content"], { [styles["single-select-item__content--disabled"]]: isDisabled });
46
+ const dotClasses = classNames(styles["single-select-item__dot"], {
47
47
  [styles["single-select-item__dot--disabled"]]: isDisabled,
48
48
  [styles["single-select-item__dot--checked"]]: isSelected
49
49
  });