@helsenorge/designsystem-react 8.5.0 → 8.5.1

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 (1089) hide show
  1. package/AnchorLink.js +60 -0
  2. package/AnchorLink.js.map +1 -0
  3. package/Avatar.js +34 -0
  4. package/Avatar.js.map +1 -0
  5. package/Badge.js +31 -0
  6. package/Badge.js.map +1 -0
  7. package/Button.js +130 -0
  8. package/Button.js.map +1 -0
  9. package/CHANGELOG.md +28 -3
  10. package/Checkbox.js +113 -0
  11. package/Checkbox.js.map +1 -0
  12. package/Close.js +31 -0
  13. package/Close.js.map +1 -0
  14. package/ErrorBoundary.js +35 -0
  15. package/ErrorBoundary.js.map +1 -0
  16. package/ErrorWrapper.js +14 -0
  17. package/ErrorWrapper.js.map +1 -0
  18. package/Expander.js +108 -0
  19. package/Expander.js.map +1 -0
  20. package/FormGroup.js +113 -0
  21. package/FormGroup.js.map +1 -0
  22. package/FormLayout.js +38 -0
  23. package/FormLayout.js.map +1 -0
  24. package/HelpBubble.js +68 -0
  25. package/HelpBubble.js.map +1 -0
  26. package/HighlightPanel.js +71 -0
  27. package/HighlightPanel.js.map +1 -0
  28. package/HorizontalScroll.js +49 -0
  29. package/HorizontalScroll.js.map +1 -0
  30. package/Icon.js +62 -0
  31. package/Icon.js.map +1 -0
  32. package/Illustration.js +41 -0
  33. package/Illustration.js.map +1 -0
  34. package/Input.js +140 -0
  35. package/Input.js.map +1 -0
  36. package/Label.js +108 -0
  37. package/Label.js.map +1 -0
  38. package/LazyIcon.js +30 -0
  39. package/LazyIcon.js.map +1 -0
  40. package/LazyIllustration.js +34 -0
  41. package/LazyIllustration.js.map +1 -0
  42. package/LinkList.js +63 -0
  43. package/LinkList.js.map +1 -0
  44. package/List.js +13 -0
  45. package/List.js.map +1 -0
  46. package/ListHeader.js +94 -0
  47. package/ListHeader.js.map +1 -0
  48. package/ListHeaderText.js +35 -0
  49. package/ListHeaderText.js.map +1 -0
  50. package/MaxCharacters.js +15 -0
  51. package/MaxCharacters.js.map +1 -0
  52. package/NotificationBadge.js +68 -0
  53. package/NotificationBadge.js.map +1 -0
  54. package/Panel.js +255 -0
  55. package/Panel.js.map +1 -0
  56. package/PopOver.js +85 -0
  57. package/PopOver.js.map +1 -0
  58. package/RadioButton.js +104 -0
  59. package/RadioButton.js.map +1 -0
  60. package/Select.js +76 -0
  61. package/Select.js.map +1 -0
  62. package/{components/Spacer/Spacer.js → Spacer.js} +10 -9
  63. package/Spacer.js.map +1 -0
  64. package/StatusDot.js +33 -0
  65. package/StatusDot.js.map +1 -0
  66. package/StepButtons.js +28 -0
  67. package/StepButtons.js.map +1 -0
  68. package/TabList.js +68 -0
  69. package/TabList.js.map +1 -0
  70. package/TabPanel.js +18 -0
  71. package/TabPanel.js.map +1 -0
  72. package/Table.js +98 -0
  73. package/Table.js.map +1 -0
  74. package/TableBody.js +13 -0
  75. package/TableBody.js.map +1 -0
  76. package/{components/Table/TableCell/TableCell.js → TableCell.js} +12 -13
  77. package/TableCell.js.map +1 -0
  78. package/TableExpandedRow.js +37 -0
  79. package/TableExpandedRow.js.map +1 -0
  80. package/TableExpanderCell.js +34 -0
  81. package/TableExpanderCell.js.map +1 -0
  82. package/TableHead.js +24 -0
  83. package/TableHead.js.map +1 -0
  84. package/TableHeadCell.js +44 -0
  85. package/TableHeadCell.js.map +1 -0
  86. package/TableRow.js +62 -0
  87. package/TableRow.js.map +1 -0
  88. package/Textarea.js +110 -0
  89. package/Textarea.js.map +1 -0
  90. package/Title.js +25 -0
  91. package/Title.js.map +1 -0
  92. package/TooltipWord.js +28 -0
  93. package/TooltipWord.js.map +1 -0
  94. package/Trigger.js +73 -0
  95. package/Trigger.js.map +1 -0
  96. package/__mocks__/uuid.js +1 -1
  97. package/components/AnchorLink/index.js +1 -1
  98. package/components/Avatar/index.js +3 -3
  99. package/components/Badge/index.js +1 -1
  100. package/components/Button/index.js +1 -1
  101. package/components/Checkbox/index.js +3 -3
  102. package/components/Chip/index.js +30 -6
  103. package/components/Chip/index.js.map +1 -1
  104. package/components/Close/index.js +2 -2
  105. package/components/DictionaryTrigger/index.js +25 -2
  106. package/components/DictionaryTrigger/index.js.map +1 -1
  107. package/components/Dropdown/index.js +124 -4
  108. package/components/Dropdown/index.js.map +1 -1
  109. package/components/Duolist/index.js +70 -5
  110. package/components/Duolist/index.js.map +1 -1
  111. package/components/EmptyState/index.js +159 -2
  112. package/components/EmptyState/index.js.map +1 -1
  113. package/components/ErrorWrapper/index.js +3 -3
  114. package/components/Expander/index.js +4 -4
  115. package/components/ExpanderHierarchy/index.js +102 -2
  116. package/components/ExpanderHierarchy/index.js.map +1 -1
  117. package/components/ExpanderList/index.js +139 -3
  118. package/components/ExpanderList/index.js.map +1 -1
  119. package/components/EyebrowHeader/index.js +9 -2
  120. package/components/EyebrowHeader/index.js.map +1 -1
  121. package/components/FormGroup/index.js +1 -1
  122. package/components/FormLayout/index.js +5 -5
  123. package/components/HelpBubble/index.js +4 -4
  124. package/components/HelpPanel/index.js +21 -2
  125. package/components/HelpPanel/index.js.map +1 -1
  126. package/components/HelpQuestion/index.js +31 -2
  127. package/components/HelpQuestion/index.js.map +1 -1
  128. package/components/HighlightPanel/index.js +4 -4
  129. package/components/HorizontalScroll/index.js +1 -1
  130. package/components/Icon/index.js +5 -5
  131. package/components/Icons/ActiveMonitoring.js +4 -4
  132. package/components/Icons/ActiveMonitoring.js.map +1 -1
  133. package/components/Icons/AcupunctureBack.js +6 -6
  134. package/components/Icons/AcupunctureBack.js.map +1 -1
  135. package/components/Icons/AlarmClock.js +15 -5
  136. package/components/Icons/AlarmClock.js.map +1 -1
  137. package/components/Icons/AlertSignFill.js +4 -4
  138. package/components/Icons/AlertSignFill.js.map +1 -1
  139. package/components/Icons/AlertSignStroke.js +4 -4
  140. package/components/Icons/AlertSignStroke.js.map +1 -1
  141. package/components/Icons/Amputation.js +3 -3
  142. package/components/Icons/Amputation.js.map +1 -1
  143. package/components/Icons/Anxiety.js +3 -3
  144. package/components/Icons/Anxiety.js.map +1 -1
  145. package/components/Icons/Apple.js +3 -3
  146. package/components/Icons/Apple.js.map +1 -1
  147. package/components/Icons/Archive.js +7 -7
  148. package/components/Icons/Archive.js.map +1 -1
  149. package/components/Icons/ArmFlexing.js +3 -3
  150. package/components/Icons/ArmFlexing.js.map +1 -1
  151. package/components/Icons/ArrowDown.js +7 -7
  152. package/components/Icons/ArrowDown.js.map +1 -1
  153. package/components/Icons/ArrowLeft.js +3 -3
  154. package/components/Icons/ArrowLeft.js.map +1 -1
  155. package/components/Icons/ArrowRight.js +3 -3
  156. package/components/Icons/ArrowRight.js.map +1 -1
  157. package/components/Icons/ArrowUp.js +7 -7
  158. package/components/Icons/ArrowUp.js.map +1 -1
  159. package/components/Icons/ArrowUpRight.js +4 -4
  160. package/components/Icons/ArrowUpRight.js.map +1 -1
  161. package/components/Icons/Attachment.js +4 -4
  162. package/components/Icons/Attachment.js.map +1 -1
  163. package/components/Icons/Atv.js +3 -3
  164. package/components/Icons/Atv.js.map +1 -1
  165. package/components/Icons/Avatar.js +4 -4
  166. package/components/Icons/Avatar.js.map +1 -1
  167. package/components/Icons/AwakePersonOnPillow.js +2 -2
  168. package/components/Icons/AwakePersonOnPillow.js.map +1 -1
  169. package/components/Icons/Baby.js +3 -3
  170. package/components/Icons/Baby.js.map +1 -1
  171. package/components/Icons/BandAid.js +3 -3
  172. package/components/Icons/BandAid.js.map +1 -1
  173. package/components/Icons/BeerAndPills.js +3 -3
  174. package/components/Icons/BeerAndPills.js.map +1 -1
  175. package/components/Icons/Bell.js +3 -3
  176. package/components/Icons/Bell.js.map +1 -1
  177. package/components/Icons/Bike.js +3 -3
  178. package/components/Icons/Bike.js.map +1 -1
  179. package/components/Icons/BirthControl.js +4 -4
  180. package/components/Icons/BirthControl.js.map +1 -1
  181. package/components/Icons/BirthdayCake.js +2 -2
  182. package/components/Icons/BirthdayCake.js.map +1 -1
  183. package/components/Icons/Boat.js +3 -3
  184. package/components/Icons/Boat.js.map +1 -1
  185. package/components/Icons/Body.js +4 -4
  186. package/components/Icons/Body.js.map +1 -1
  187. package/components/Icons/Braille.js +4 -4
  188. package/components/Icons/Braille.js.map +1 -1
  189. package/components/Icons/Brain.js +3 -3
  190. package/components/Icons/Brain.js.map +1 -1
  191. package/components/Icons/BreastReconstruction.js +4 -4
  192. package/components/Icons/BreastReconstruction.js.map +1 -1
  193. package/components/Icons/BreastRemoval.js +4 -4
  194. package/components/Icons/BreastRemoval.js.map +1 -1
  195. package/components/Icons/Breasts.js +2 -2
  196. package/components/Icons/Breasts.js.map +1 -1
  197. package/components/Icons/BrokenHeart.js +3 -3
  198. package/components/Icons/BrokenHeart.js.map +1 -1
  199. package/components/Icons/BrokenPuzzle.js +3 -3
  200. package/components/Icons/BrokenPuzzle.js.map +1 -1
  201. package/components/Icons/Bus.js +13 -6
  202. package/components/Icons/Bus.js.map +1 -1
  203. package/components/Icons/Calendar.js +6 -6
  204. package/components/Icons/Calendar.js.map +1 -1
  205. package/components/Icons/CalendarChange.js +7 -7
  206. package/components/Icons/CalendarChange.js.map +1 -1
  207. package/components/Icons/CalendarCheck.js +7 -7
  208. package/components/Icons/CalendarCheck.js.map +1 -1
  209. package/components/Icons/CalendarEvent.js +3 -3
  210. package/components/Icons/CalendarEvent.js.map +1 -1
  211. package/components/Icons/CalendarSave.js +4 -4
  212. package/components/Icons/CalendarSave.js.map +1 -1
  213. package/components/Icons/Cancer.js +17 -3
  214. package/components/Icons/Cancer.js.map +1 -1
  215. package/components/Icons/Candle.js +5 -5
  216. package/components/Icons/Candle.js.map +1 -1
  217. package/components/Icons/Car.js +2 -2
  218. package/components/Icons/Car.js.map +1 -1
  219. package/components/Icons/Carton.js +19 -14
  220. package/components/Icons/Carton.js.map +1 -1
  221. package/components/Icons/Change.js +14 -8
  222. package/components/Icons/Change.js.map +1 -1
  223. package/components/Icons/Check.js +4 -4
  224. package/components/Icons/Check.js.map +1 -1
  225. package/components/Icons/CheckFill.js +7 -7
  226. package/components/Icons/CheckFill.js.map +1 -1
  227. package/components/Icons/CheckOutline.js +4 -4
  228. package/components/Icons/CheckOutline.js.map +1 -1
  229. package/components/Icons/Chest.js +2 -2
  230. package/components/Icons/Chest.js.map +1 -1
  231. package/components/Icons/ChevronDown.js +3 -3
  232. package/components/Icons/ChevronDown.js.map +1 -1
  233. package/components/Icons/ChevronLeft.js +3 -3
  234. package/components/Icons/ChevronLeft.js.map +1 -1
  235. package/components/Icons/ChevronRight.js +3 -3
  236. package/components/Icons/ChevronRight.js.map +1 -1
  237. package/components/Icons/ChevronUp.js +3 -3
  238. package/components/Icons/ChevronUp.js.map +1 -1
  239. package/components/Icons/ChevronsDown.js +6 -6
  240. package/components/Icons/ChevronsDown.js.map +1 -1
  241. package/components/Icons/ChevronsUp.js +7 -7
  242. package/components/Icons/ChevronsUp.js.map +1 -1
  243. package/components/Icons/ChildPlaying.js +9 -3
  244. package/components/Icons/ChildPlaying.js.map +1 -1
  245. package/components/Icons/Cigarette.js +3 -3
  246. package/components/Icons/Cigarette.js.map +1 -1
  247. package/components/Icons/Coins.js +4 -4
  248. package/components/Icons/Coins.js.map +1 -1
  249. package/components/Icons/Contacts.js +4 -4
  250. package/components/Icons/Contacts.js.map +1 -1
  251. package/components/Icons/Copy.js +15 -4
  252. package/components/Icons/Copy.js.map +1 -1
  253. package/components/Icons/CoronaCertificate.js +3 -3
  254. package/components/Icons/CoronaCertificate.js.map +1 -1
  255. package/components/Icons/Coronavirus.js +3 -3
  256. package/components/Icons/Coronavirus.js.map +1 -1
  257. package/components/Icons/Cough.js +3 -3
  258. package/components/Icons/Cough.js.map +1 -1
  259. package/components/Icons/CreditCard.js +33 -10
  260. package/components/Icons/CreditCard.js.map +1 -1
  261. package/components/Icons/CriticalHealthInfo.js +3 -3
  262. package/components/Icons/CriticalHealthInfo.js.map +1 -1
  263. package/components/Icons/Cross.js +3 -3
  264. package/components/Icons/Cross.js.map +1 -1
  265. package/components/Icons/DataExchange.js +4 -4
  266. package/components/Icons/DataExchange.js.map +1 -1
  267. package/components/Icons/DataReceived.js +4 -4
  268. package/components/Icons/DataReceived.js.map +1 -1
  269. package/components/Icons/DataSent.js +4 -4
  270. package/components/Icons/DataSent.js.map +1 -1
  271. package/components/Icons/Depression.js +3 -3
  272. package/components/Icons/Depression.js.map +1 -1
  273. package/components/Icons/DigestiveSystem.js +9 -3
  274. package/components/Icons/DigestiveSystem.js.map +1 -1
  275. package/components/Icons/Dizzy.js +3 -3
  276. package/components/Icons/Dizzy.js.map +1 -1
  277. package/components/Icons/Documents.js +3 -3
  278. package/components/Icons/Documents.js.map +1 -1
  279. package/components/Icons/Dog.js +3 -3
  280. package/components/Icons/Dog.js.map +1 -1
  281. package/components/Icons/DonorCard.js +3 -3
  282. package/components/Icons/DonorCard.js.map +1 -1
  283. package/components/Icons/Download.js +7 -7
  284. package/components/Icons/Download.js.map +1 -1
  285. package/components/Icons/Draft.js +3 -3
  286. package/components/Icons/Draft.js.map +1 -1
  287. package/components/Icons/EChat.js +4 -4
  288. package/components/Icons/EChat.js.map +1 -1
  289. package/components/Icons/Ear.js +10 -7
  290. package/components/Icons/Ear.js.map +1 -1
  291. package/components/Icons/EarDeaf.js +4 -4
  292. package/components/Icons/EarDeaf.js.map +1 -1
  293. package/components/Icons/EarHearingAid.js +7 -7
  294. package/components/Icons/EarHearingAid.js.map +1 -1
  295. package/components/Icons/EarNoseThroat.js +11 -3
  296. package/components/Icons/EarNoseThroat.js.map +1 -1
  297. package/components/Icons/EarVolume.js +13 -8
  298. package/components/Icons/EarVolume.js.map +1 -1
  299. package/components/Icons/ElderlyPerson.js +2 -2
  300. package/components/Icons/ElderlyPerson.js.map +1 -1
  301. package/components/Icons/Embolization.js +4 -4
  302. package/components/Icons/Embolization.js.map +1 -1
  303. package/components/Icons/EmergencyCall.js +5 -5
  304. package/components/Icons/EmergencyCall.js.map +1 -1
  305. package/components/Icons/EmoticonAnnoyed.js +12 -8
  306. package/components/Icons/EmoticonAnnoyed.js.map +1 -1
  307. package/components/Icons/EmoticonDelighted.js +10 -7
  308. package/components/Icons/EmoticonDelighted.js.map +1 -1
  309. package/components/Icons/EmoticonDisappointed.js +10 -7
  310. package/components/Icons/EmoticonDisappointed.js.map +1 -1
  311. package/components/Icons/EmoticonHappy.js +10 -7
  312. package/components/Icons/EmoticonHappy.js.map +1 -1
  313. package/components/Icons/EmoticonMeh.js +10 -7
  314. package/components/Icons/EmoticonMeh.js.map +1 -1
  315. package/components/Icons/EnterFullScreen.js +13 -4
  316. package/components/Icons/EnterFullScreen.js.map +1 -1
  317. package/components/Icons/Envelope.js +4 -4
  318. package/components/Icons/Envelope.js.map +1 -1
  319. package/components/Icons/Epilepsy.js +3 -3
  320. package/components/Icons/Epilepsy.js.map +1 -1
  321. package/components/Icons/Eraser.js +10 -4
  322. package/components/Icons/Eraser.js.map +1 -1
  323. package/components/Icons/ErrorSignFill.js +4 -4
  324. package/components/Icons/ErrorSignFill.js.map +1 -1
  325. package/components/Icons/ErrorSignStroke.js +4 -4
  326. package/components/Icons/ErrorSignStroke.js.map +1 -1
  327. package/components/Icons/EuropeanHealthCard.js +6 -3
  328. package/components/Icons/EuropeanHealthCard.js.map +1 -1
  329. package/components/Icons/ExitFullScreen.js +13 -4
  330. package/components/Icons/ExitFullScreen.js.map +1 -1
  331. package/components/Icons/Eye.js +12 -4
  332. package/components/Icons/Eye.js.map +1 -1
  333. package/components/Icons/Facebook.js +3 -3
  334. package/components/Icons/Facebook.js.map +1 -1
  335. package/components/Icons/FallingLeaf.js +14 -9
  336. package/components/Icons/FallingLeaf.js.map +1 -1
  337. package/components/Icons/Female.js +3 -3
  338. package/components/Icons/Female.js.map +1 -1
  339. package/components/Icons/FemaleDoctor.js +2 -2
  340. package/components/Icons/FemaleDoctor.js.map +1 -1
  341. package/components/Icons/Ferry.js +3 -3
  342. package/components/Icons/Ferry.js.map +1 -1
  343. package/components/Icons/File.js +6 -6
  344. package/components/Icons/File.js.map +1 -1
  345. package/components/Icons/Filter.js +5 -5
  346. package/components/Icons/Filter.js.map +1 -1
  347. package/components/Icons/FingerBleed.js +3 -3
  348. package/components/Icons/FingerBleed.js.map +1 -1
  349. package/components/Icons/FirstAidKit.js +3 -3
  350. package/components/Icons/FirstAidKit.js.map +1 -1
  351. package/components/Icons/Fish.js +21 -14
  352. package/components/Icons/Fish.js.map +1 -1
  353. package/components/Icons/FloppyDisk.js +4 -4
  354. package/components/Icons/FloppyDisk.js.map +1 -1
  355. package/components/Icons/Football.js +3 -3
  356. package/components/Icons/Football.js.map +1 -1
  357. package/components/Icons/Form.js +4 -4
  358. package/components/Icons/Form.js.map +1 -1
  359. package/components/Icons/Forward.js +10 -4
  360. package/components/Icons/Forward.js.map +1 -1
  361. package/components/Icons/Gallery.js +7 -7
  362. package/components/Icons/Gallery.js.map +1 -1
  363. package/components/Icons/Garden.js +3 -3
  364. package/components/Icons/Garden.js.map +1 -1
  365. package/components/Icons/GasCan.js +3 -3
  366. package/components/Icons/GasCan.js.map +1 -1
  367. package/components/Icons/GenderIdentity.js +4 -4
  368. package/components/Icons/GenderIdentity.js.map +1 -1
  369. package/components/Icons/GlassWater.js +3 -3
  370. package/components/Icons/GlassWater.js.map +1 -1
  371. package/components/Icons/Glasses.js +4 -4
  372. package/components/Icons/Glasses.js.map +1 -1
  373. package/components/Icons/Globe.js +4 -4
  374. package/components/Icons/Globe.js.map +1 -1
  375. package/components/Icons/Grain.js +3 -3
  376. package/components/Icons/Grain.js.map +1 -1
  377. package/components/Icons/Graph.js +12 -9
  378. package/components/Icons/Graph.js.map +1 -1
  379. package/components/Icons/Group.js +8 -8
  380. package/components/Icons/Group.js.map +1 -1
  381. package/components/Icons/GroupTwins.js +35 -21
  382. package/components/Icons/GroupTwins.js.map +1 -1
  383. package/components/Icons/HTMLFile.js +10 -7
  384. package/components/Icons/HTMLFile.js.map +1 -1
  385. package/components/Icons/HandWaving.js +3 -3
  386. package/components/Icons/HandWaving.js.map +1 -1
  387. package/components/Icons/HandWithDisease.js +3 -3
  388. package/components/Icons/HandWithDisease.js.map +1 -1
  389. package/components/Icons/HandsAndHeart.js +5 -5
  390. package/components/Icons/HandsAndHeart.js.map +1 -1
  391. package/components/Icons/HealthClinic.js +4 -4
  392. package/components/Icons/HealthClinic.js.map +1 -1
  393. package/components/Icons/HealthWarning.js +4 -4
  394. package/components/Icons/HealthWarning.js.map +1 -1
  395. package/components/Icons/HealthcarePerson.js +27 -14
  396. package/components/Icons/HealthcarePerson.js.map +1 -1
  397. package/components/Icons/HealthcarePersonell.js +36 -18
  398. package/components/Icons/HealthcarePersonell.js.map +1 -1
  399. package/components/Icons/HearingProtection.js +12 -9
  400. package/components/Icons/HearingProtection.js.map +1 -1
  401. package/components/Icons/Heart.js +4 -4
  402. package/components/Icons/Heart.js.map +1 -1
  403. package/components/Icons/HeartHands.js +29 -22
  404. package/components/Icons/HeartHands.js.map +1 -1
  405. package/components/Icons/HelpSign.js +4 -4
  406. package/components/Icons/HelpSign.js.map +1 -1
  407. package/components/Icons/HelpingHand.js +3 -3
  408. package/components/Icons/HelpingHand.js.map +1 -1
  409. package/components/Icons/Hemodialysis.js +3 -3
  410. package/components/Icons/Hemodialysis.js.map +1 -1
  411. package/components/Icons/Hiker.js +2 -2
  412. package/components/Icons/Hiker.js.map +1 -1
  413. package/components/Icons/Hipprosthesis.js +4 -4
  414. package/components/Icons/Hipprosthesis.js.map +1 -1
  415. package/components/Icons/History.js +4 -4
  416. package/components/Icons/History.js.map +1 -1
  417. package/components/Icons/HivAndAids.js +3 -3
  418. package/components/Icons/HivAndAids.js.map +1 -1
  419. package/components/Icons/Home.js +7 -7
  420. package/components/Icons/Home.js.map +1 -1
  421. package/components/Icons/Hormone.js +3 -3
  422. package/components/Icons/Hormone.js.map +1 -1
  423. package/components/Icons/Hospital.js +7 -7
  424. package/components/Icons/Hospital.js.map +1 -1
  425. package/components/Icons/Hourglass.js +7 -7
  426. package/components/Icons/Hourglass.js.map +1 -1
  427. package/components/Icons/ImgFile.js +4 -4
  428. package/components/Icons/ImgFile.js.map +1 -1
  429. package/components/Icons/Inbox.js +6 -3
  430. package/components/Icons/Inbox.js.map +1 -1
  431. package/components/Icons/InfoSignFill.js +4 -4
  432. package/components/Icons/InfoSignFill.js.map +1 -1
  433. package/components/Icons/InfoSignStroke.js +4 -4
  434. package/components/Icons/InfoSignStroke.js.map +1 -1
  435. package/components/Icons/Instagram.js +9 -2
  436. package/components/Icons/Instagram.js.map +1 -1
  437. package/components/Icons/Intravenous.js +4 -4
  438. package/components/Icons/Intravenous.js.map +1 -1
  439. package/components/Icons/JointPain.js +3 -3
  440. package/components/Icons/JointPain.js.map +1 -1
  441. package/components/Icons/Journal.js +4 -4
  442. package/components/Icons/Journal.js.map +1 -1
  443. package/components/Icons/JpgFile.js +4 -4
  444. package/components/Icons/JpgFile.js.map +1 -1
  445. package/components/Icons/Kidney.js +3 -3
  446. package/components/Icons/Kidney.js.map +1 -1
  447. package/components/Icons/KitchenScale.js +4 -4
  448. package/components/Icons/KitchenScale.js.map +1 -1
  449. package/components/Icons/Kjernejournal.js +3 -3
  450. package/components/Icons/Kjernejournal.js.map +1 -1
  451. package/components/Icons/Laboratory.js +4 -4
  452. package/components/Icons/Laboratory.js.map +1 -1
  453. package/components/Icons/LaptopBlog.js +3 -3
  454. package/components/Icons/LaptopBlog.js.map +1 -1
  455. package/components/Icons/LawBook.js +6 -3
  456. package/components/Icons/LawBook.js.map +1 -1
  457. package/components/Icons/LegalDocument.js +13 -10
  458. package/components/Icons/LegalDocument.js.map +1 -1
  459. package/components/Icons/LightBulb.js +2 -2
  460. package/components/Icons/LightBulb.js.map +1 -1
  461. package/components/Icons/List.js +7 -7
  462. package/components/Icons/List.js.map +1 -1
  463. package/components/Icons/Location.js +6 -3
  464. package/components/Icons/Location.js.map +1 -1
  465. package/components/Icons/Lock.js +4 -4
  466. package/components/Icons/Lock.js.map +1 -1
  467. package/components/Icons/Login.js +20 -11
  468. package/components/Icons/Login.js.map +1 -1
  469. package/components/Icons/Logout.js +20 -11
  470. package/components/Icons/Logout.js.map +1 -1
  471. package/components/Icons/Lungs.js +3 -3
  472. package/components/Icons/Lungs.js.map +1 -1
  473. package/components/Icons/Makeup.js +2 -2
  474. package/components/Icons/Makeup.js.map +1 -1
  475. package/components/Icons/MaleDoctor.js +2 -2
  476. package/components/Icons/MaleDoctor.js.map +1 -1
  477. package/components/Icons/MaleDoctorAndPerson.js +11 -3
  478. package/components/Icons/MaleDoctorAndPerson.js.map +1 -1
  479. package/components/Icons/MaleGenitalia.js +2 -2
  480. package/components/Icons/MaleGenitalia.js.map +1 -1
  481. package/components/Icons/Medicine.js +6 -6
  482. package/components/Icons/Medicine.js.map +1 -1
  483. package/components/Icons/MedicineWarning.js +4 -4
  484. package/components/Icons/MedicineWarning.js.map +1 -1
  485. package/components/Icons/MentalHealthAdult.js +9 -3
  486. package/components/Icons/MentalHealthAdult.js.map +1 -1
  487. package/components/Icons/MentalHealthChild.js +9 -3
  488. package/components/Icons/MentalHealthChild.js.map +1 -1
  489. package/components/Icons/Menu.js +4 -4
  490. package/components/Icons/Menu.js.map +1 -1
  491. package/components/Icons/Microscope.js +4 -4
  492. package/components/Icons/Microscope.js.map +1 -1
  493. package/components/Icons/Minus.js +3 -3
  494. package/components/Icons/Minus.js.map +1 -1
  495. package/components/Icons/Mirror.js +3 -3
  496. package/components/Icons/Mirror.js.map +1 -1
  497. package/components/Icons/MobilePhone.js +4 -4
  498. package/components/Icons/MobilePhone.js.map +1 -1
  499. package/components/Icons/MotherHoldingBaby.js +2 -2
  500. package/components/Icons/MotherHoldingBaby.js.map +1 -1
  501. package/components/Icons/MuscleBack.js +11 -3
  502. package/components/Icons/MuscleBack.js.map +1 -1
  503. package/components/Icons/MuscleLeg.js +9 -3
  504. package/components/Icons/MuscleLeg.js.map +1 -1
  505. package/components/Icons/Mushroom.js +3 -3
  506. package/components/Icons/Mushroom.js.map +1 -1
  507. package/components/Icons/Music.js +3 -3
  508. package/components/Icons/Music.js.map +1 -1
  509. package/components/Icons/MusselsAndSalt.js +2 -2
  510. package/components/Icons/MusselsAndSalt.js.map +1 -1
  511. package/components/Icons/NoAccess.js +20 -17
  512. package/components/Icons/NoAccess.js.map +1 -1
  513. package/components/Icons/NoEye.js +9 -9
  514. package/components/Icons/NoEye.js.map +1 -1
  515. package/components/Icons/NoFilter.js +10 -4
  516. package/components/Icons/NoFilter.js.map +1 -1
  517. package/components/Icons/Notepad.js +2 -2
  518. package/components/Icons/Notepad.js.map +1 -1
  519. package/components/Icons/Osteotomy.js +4 -4
  520. package/components/Icons/Osteotomy.js.map +1 -1
  521. package/components/Icons/PaintRoller.js +3 -3
  522. package/components/Icons/PaintRoller.js.map +1 -1
  523. package/components/Icons/PaperPlane.js +4 -4
  524. package/components/Icons/PaperPlane.js.map +1 -1
  525. package/components/Icons/PatientAndPerson.js +2 -2
  526. package/components/Icons/PatientAndPerson.js.map +1 -1
  527. package/components/Icons/Pause.js +4 -4
  528. package/components/Icons/Pause.js.map +1 -1
  529. package/components/Icons/PdfFile.js +4 -4
  530. package/components/Icons/PdfFile.js.map +1 -1
  531. package/components/Icons/Pencil.js +4 -4
  532. package/components/Icons/Pencil.js.map +1 -1
  533. package/components/Icons/PeopleTalking.js +3 -3
  534. package/components/Icons/PeopleTalking.js.map +1 -1
  535. package/components/Icons/Peritonealdialysis.js +4 -4
  536. package/components/Icons/Peritonealdialysis.js.map +1 -1
  537. package/components/Icons/Person.js +2 -2
  538. package/components/Icons/Person.js.map +1 -1
  539. package/components/Icons/PersonAndPatient.js +2 -2
  540. package/components/Icons/PersonAndPatient.js.map +1 -1
  541. package/components/Icons/PersonCancel.js +28 -19
  542. package/components/Icons/PersonCancel.js.map +1 -1
  543. package/components/Icons/PersonInXRayMachine.js +4 -4
  544. package/components/Icons/PersonInXRayMachine.js.map +1 -1
  545. package/components/Icons/PersonOverweight.js +3 -3
  546. package/components/Icons/PersonOverweight.js.map +1 -1
  547. package/components/Icons/PersonRelaxing.js +9 -3
  548. package/components/Icons/PersonRelaxing.js.map +1 -1
  549. package/components/Icons/PersonWithBrain.js +6 -3
  550. package/components/Icons/PersonWithBrain.js.map +1 -1
  551. package/components/Icons/PersonWithBrokenArm.js +3 -3
  552. package/components/Icons/PersonWithBrokenArm.js.map +1 -1
  553. package/components/Icons/PersonWithCrutches.js +3 -3
  554. package/components/Icons/PersonWithCrutches.js.map +1 -1
  555. package/components/Icons/PersonWithJaw.js +9 -3
  556. package/components/Icons/PersonWithJaw.js.map +1 -1
  557. package/components/Icons/PersonWithMagnifyingGlass.js +8 -2
  558. package/components/Icons/PersonWithMagnifyingGlass.js.map +1 -1
  559. package/components/Icons/PersonWithSenses.js +15 -3
  560. package/components/Icons/PersonWithSenses.js.map +1 -1
  561. package/components/Icons/PersonWorking.js +9 -3
  562. package/components/Icons/PersonWorking.js.map +1 -1
  563. package/components/Icons/PersonalPlan.js +14 -11
  564. package/components/Icons/PersonalPlan.js.map +1 -1
  565. package/components/Icons/PizzaSlice.js +8 -2
  566. package/components/Icons/PizzaSlice.js.map +1 -1
  567. package/components/Icons/Plane.js +3 -3
  568. package/components/Icons/Plane.js.map +1 -1
  569. package/components/Icons/Plant.js +3 -3
  570. package/components/Icons/Plant.js.map +1 -1
  571. package/components/Icons/PlateKnifeFork.js +17 -14
  572. package/components/Icons/PlateKnifeFork.js.map +1 -1
  573. package/components/Icons/Play.js +4 -4
  574. package/components/Icons/Play.js.map +1 -1
  575. package/components/Icons/PlusLarge.js +4 -4
  576. package/components/Icons/PlusLarge.js.map +1 -1
  577. package/components/Icons/PlusSmall.js +4 -4
  578. package/components/Icons/PlusSmall.js.map +1 -1
  579. package/components/Icons/PngFile.js +4 -4
  580. package/components/Icons/PngFile.js.map +1 -1
  581. package/components/Icons/Podcast.js +4 -4
  582. package/components/Icons/Podcast.js.map +1 -1
  583. package/components/Icons/PoisonInformation.js +9 -3
  584. package/components/Icons/PoisonInformation.js.map +1 -1
  585. package/components/Icons/Pregnant.js +2 -2
  586. package/components/Icons/Pregnant.js.map +1 -1
  587. package/components/Icons/Printer.js +7 -7
  588. package/components/Icons/Printer.js.map +1 -1
  589. package/components/Icons/Psychosis.js +2 -2
  590. package/components/Icons/Psychosis.js.map +1 -1
  591. package/components/Icons/Publication.js +4 -4
  592. package/components/Icons/Publication.js.map +1 -1
  593. package/components/Icons/Puzzle.js +5 -2
  594. package/components/Icons/Puzzle.js.map +1 -1
  595. package/components/Icons/QrCode.js +7 -7
  596. package/components/Icons/QrCode.js.map +1 -1
  597. package/components/Icons/Quarrel.js +4 -4
  598. package/components/Icons/Quarrel.js.map +1 -1
  599. package/components/Icons/RadioTherapy.js +4 -4
  600. package/components/Icons/RadioTherapy.js.map +1 -1
  601. package/components/Icons/RadioactiveTreatment.js +4 -4
  602. package/components/Icons/RadioactiveTreatment.js.map +1 -1
  603. package/components/Icons/Radioiodine.js +4 -4
  604. package/components/Icons/Radioiodine.js.map +1 -1
  605. package/components/Icons/Receipt.js +2 -2
  606. package/components/Icons/Receipt.js.map +1 -1
  607. package/components/Icons/Receptionist.js +4 -4
  608. package/components/Icons/Receptionist.js.map +1 -1
  609. package/components/Icons/Recovery.js +4 -4
  610. package/components/Icons/Recovery.js.map +1 -1
  611. package/components/Icons/Referral.js +4 -4
  612. package/components/Icons/Referral.js.map +1 -1
  613. package/components/Icons/Refresh.js +4 -4
  614. package/components/Icons/Refresh.js.map +1 -1
  615. package/components/Icons/Refund.js +3 -3
  616. package/components/Icons/Refund.js.map +1 -1
  617. package/components/Icons/Reminder.js +14 -9
  618. package/components/Icons/Reminder.js.map +1 -1
  619. package/components/Icons/Reply.js +10 -4
  620. package/components/Icons/Reply.js.map +1 -1
  621. package/components/Icons/Rocket.js +3 -3
  622. package/components/Icons/Rocket.js.map +1 -1
  623. package/components/Icons/RtfFile.js +4 -4
  624. package/components/Icons/RtfFile.js.map +1 -1
  625. package/components/Icons/STDs.js +4 -4
  626. package/components/Icons/STDs.js.map +1 -1
  627. package/components/Icons/Save.js +12 -4
  628. package/components/Icons/Save.js.map +1 -1
  629. package/components/Icons/Scale.js +3 -3
  630. package/components/Icons/Scale.js.map +1 -1
  631. package/components/Icons/ScreenReader.js +18 -11
  632. package/components/Icons/ScreenReader.js.map +1 -1
  633. package/components/Icons/Search.js +4 -4
  634. package/components/Icons/Search.js.map +1 -1
  635. package/components/Icons/SectionSign.js +6 -6
  636. package/components/Icons/SectionSign.js.map +1 -1
  637. package/components/Icons/Settings.js +7 -7
  638. package/components/Icons/Settings.js.map +1 -1
  639. package/components/Icons/Sexualorientation.js +4 -4
  640. package/components/Icons/Sexualorientation.js.map +1 -1
  641. package/components/Icons/ShakingHand.js +3 -3
  642. package/components/Icons/ShakingHand.js.map +1 -1
  643. package/components/Icons/Share.js +10 -4
  644. package/components/Icons/Share.js.map +1 -1
  645. package/components/Icons/Shield.js +4 -4
  646. package/components/Icons/Shield.js.map +1 -1
  647. package/components/Icons/ShuntOperation.js +3 -3
  648. package/components/Icons/ShuntOperation.js.map +1 -1
  649. package/components/Icons/Skeleton.js +2 -2
  650. package/components/Icons/Skeleton.js.map +1 -1
  651. package/components/Icons/Skin.js +3 -3
  652. package/components/Icons/Skin.js.map +1 -1
  653. package/components/Icons/Snake.js +3 -3
  654. package/components/Icons/Snake.js.map +1 -1
  655. package/components/Icons/Snapchat.js +6 -3
  656. package/components/Icons/Snapchat.js.map +1 -1
  657. package/components/Icons/SortDown.js +19 -7
  658. package/components/Icons/SortDown.js.map +1 -1
  659. package/components/Icons/SortUp.js +19 -7
  660. package/components/Icons/SortUp.js.map +1 -1
  661. package/components/Icons/SpeechBubble.js +6 -6
  662. package/components/Icons/SpeechBubble.js.map +1 -1
  663. package/components/Icons/Spray.js +2 -2
  664. package/components/Icons/Spray.js.map +1 -1
  665. package/components/Icons/Stopwatch.js +7 -7
  666. package/components/Icons/Stopwatch.js.map +1 -1
  667. package/components/Icons/Sun.js +14 -9
  668. package/components/Icons/Sun.js.map +1 -1
  669. package/components/Icons/SupportingPerson.js +25 -22
  670. package/components/Icons/SupportingPerson.js.map +1 -1
  671. package/components/Icons/Surgery.js +3 -3
  672. package/components/Icons/Surgery.js.map +1 -1
  673. package/components/Icons/Sweets.js +19 -14
  674. package/components/Icons/Sweets.js.map +1 -1
  675. package/components/Icons/Syringe.js +6 -6
  676. package/components/Icons/Syringe.js.map +1 -1
  677. package/components/Icons/Taxi.js +2 -2
  678. package/components/Icons/Taxi.js.map +1 -1
  679. package/components/Icons/TeddyBear.js +3 -3
  680. package/components/Icons/TeddyBear.js.map +1 -1
  681. package/components/Icons/Teenagers.js +4 -4
  682. package/components/Icons/Teenagers.js.map +1 -1
  683. package/components/Icons/ThinkingAboutBaby.js +3 -3
  684. package/components/Icons/ThinkingAboutBaby.js.map +1 -1
  685. package/components/Icons/Ticket.js +3 -3
  686. package/components/Icons/Ticket.js.map +1 -1
  687. package/components/Icons/TimePassing.js +7 -7
  688. package/components/Icons/TimePassing.js.map +1 -1
  689. package/components/Icons/Tombstone.js +12 -9
  690. package/components/Icons/Tombstone.js.map +1 -1
  691. package/components/Icons/Toolbox.js +36 -30
  692. package/components/Icons/Toolbox.js.map +1 -1
  693. package/components/Icons/Tooth.js +3 -3
  694. package/components/Icons/Tooth.js.map +1 -1
  695. package/components/Icons/TotalKneeProsthesis.js +4 -4
  696. package/components/Icons/TotalKneeProsthesis.js.map +1 -1
  697. package/components/Icons/Train.js +3 -3
  698. package/components/Icons/Train.js.map +1 -1
  699. package/components/Icons/Transplantation.js +3 -3
  700. package/components/Icons/Transplantation.js.map +1 -1
  701. package/components/Icons/TrashCan.js +7 -7
  702. package/components/Icons/TrashCan.js.map +1 -1
  703. package/components/Icons/TravelRoute.js +21 -16
  704. package/components/Icons/TravelRoute.js.map +1 -1
  705. package/components/Icons/TriangleX.js +32 -35
  706. package/components/Icons/TriangleX.js.map +1 -1
  707. package/components/Icons/Twitter.js +3 -3
  708. package/components/Icons/Twitter.js.map +1 -1
  709. package/components/Icons/Undo.js +8 -8
  710. package/components/Icons/Undo.js.map +1 -1
  711. package/components/Icons/UniProsthesis.js +3 -3
  712. package/components/Icons/UniProsthesis.js.map +1 -1
  713. package/components/Icons/Upload.js +10 -4
  714. package/components/Icons/Upload.js.map +1 -1
  715. package/components/Icons/UserOrganization.js +2 -2
  716. package/components/Icons/UserOrganization.js.map +1 -1
  717. package/components/Icons/Vaccine.js +7 -7
  718. package/components/Icons/Vaccine.js.map +1 -1
  719. package/components/Icons/VerticalDots.js +4 -4
  720. package/components/Icons/VerticalDots.js.map +1 -1
  721. package/components/Icons/VideoCamera.js +7 -7
  722. package/components/Icons/VideoCamera.js.map +1 -1
  723. package/components/Icons/VideoChat.js +4 -4
  724. package/components/Icons/VideoChat.js.map +1 -1
  725. package/components/Icons/Wallet.js +4 -4
  726. package/components/Icons/Wallet.js.map +1 -1
  727. package/components/Icons/Watch.js +6 -6
  728. package/components/Icons/Watch.js.map +1 -1
  729. package/components/Icons/Website.js +4 -4
  730. package/components/Icons/Website.js.map +1 -1
  731. package/components/Icons/Wheelchair.js +4 -4
  732. package/components/Icons/Wheelchair.js.map +1 -1
  733. package/components/Icons/WheelchairActive.js +3 -3
  734. package/components/Icons/WheelchairActive.js.map +1 -1
  735. package/components/Icons/Window.js +3 -3
  736. package/components/Icons/Window.js.map +1 -1
  737. package/components/Icons/WordDocument.js +3 -3
  738. package/components/Icons/WordDocument.js.map +1 -1
  739. package/components/Icons/WorkSuitcase.js +2 -2
  740. package/components/Icons/WorkSuitcase.js.map +1 -1
  741. package/components/Icons/X.js +4 -4
  742. package/components/Icons/X.js.map +1 -1
  743. package/components/Icons/XOutline.js +3 -3
  744. package/components/Icons/XOutline.js.map +1 -1
  745. package/components/Icons/XmlFile.js +4 -4
  746. package/components/Icons/XmlFile.js.map +1 -1
  747. package/components/Icons/YouTube.js +3 -3
  748. package/components/Icons/YouTube.js.map +1 -1
  749. package/components/Icons/Zoom.js +6 -6
  750. package/components/Icons/Zoom.js.map +1 -1
  751. package/components/Illustration/index.js +3 -3
  752. package/components/Illustrations/Doctor.js +8 -8
  753. package/components/Illustrations/Doctor.js.map +1 -1
  754. package/components/Illustrations/DoctorMedium.js +49 -41
  755. package/components/Illustrations/DoctorMedium.js.map +1 -1
  756. package/components/Illustrations/DoctorSmall.js +48 -38
  757. package/components/Illustrations/DoctorSmall.js.map +1 -1
  758. package/components/Illustrations/FacialRecognitionFingerprint.js +6 -6
  759. package/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
  760. package/components/Illustrations/FacialRecognitionFingerprintMedium.js +297 -253
  761. package/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
  762. package/components/Illustrations/HealthcarePersonnel.js +7 -7
  763. package/components/Illustrations/HealthcarePersonnel.js.map +1 -1
  764. package/components/Illustrations/HealthcarePersonnelMedium.js +202 -171
  765. package/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
  766. package/components/Illustrations/HealthcarePersonnelSmall.js +190 -165
  767. package/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
  768. package/components/Input/index.js +3 -3
  769. package/components/Label/index.js +7 -8
  770. package/components/Label/index.js.map +1 -1
  771. package/components/LazyIcon/index.js +2 -2
  772. package/components/LazyIllustration/index.js +5 -5
  773. package/components/LinkList/index.js +3 -3
  774. package/components/List/index.js +2 -2
  775. package/components/ListHeader/ListHeaderText/index.js +1 -1
  776. package/components/ListHeader/index.js +5 -5
  777. package/components/Loader/index.js +67 -4
  778. package/components/Loader/index.js.map +1 -1
  779. package/components/Logo/index.js +41 -2
  780. package/components/Logo/index.js.map +1 -1
  781. package/components/Modal/index.js +162 -5
  782. package/components/Modal/index.js.map +1 -1
  783. package/components/NotificationPanel/index.js +98 -2
  784. package/components/NotificationPanel/index.js.map +1 -1
  785. package/components/Panel/index.js +4 -4
  786. package/components/PanelList/index.js +15 -2
  787. package/components/PanelList/index.js.map +1 -1
  788. package/components/PopMenu/index.js +92 -6
  789. package/components/PopMenu/index.js.map +1 -1
  790. package/components/PopOver/index.js +4 -4
  791. package/components/Portal/index.js +3 -3
  792. package/components/Progressbar/index.js +92 -6
  793. package/components/Progressbar/index.js.map +1 -1
  794. package/components/Progressbar/styles.module.scss +5 -0
  795. package/components/Progressbar/styles.module.scss.d.ts +1 -0
  796. package/components/PromoPanel/index.js +57 -2
  797. package/components/PromoPanel/index.js.map +1 -1
  798. package/components/RadioButton/index.js +5 -5
  799. package/components/Select/index.js +1 -1
  800. package/components/ServiceMessage/index.js +110 -2
  801. package/components/ServiceMessage/index.js.map +1 -1
  802. package/components/SharingStatus/index.js +16 -2
  803. package/components/SharingStatus/index.js.map +1 -1
  804. package/components/Slider/index.js +189 -3
  805. package/components/Slider/index.js.map +1 -1
  806. package/components/Spacer/index.js +2 -2
  807. package/components/StatusDot/index.js +4 -4
  808. package/components/Step/index.js +31 -2
  809. package/components/Step/index.js.map +1 -1
  810. package/components/StepButtons/index.js +1 -1
  811. package/components/Stepper/index.js +49 -2
  812. package/components/Stepper/index.js.map +1 -1
  813. package/components/Table/TableBody/index.js +3 -3
  814. package/components/Table/TableCell/index.js +5 -5
  815. package/components/Table/TableExpandedRow/index.js +1 -1
  816. package/components/Table/TableExpanderCell/index.js +3 -3
  817. package/components/Table/TableHead/index.js +4 -4
  818. package/components/Table/TableHeadCell/index.js +3 -3
  819. package/components/Table/TableRow/index.js +3 -3
  820. package/components/Table/index.js +22 -22
  821. package/components/Tabs/TabList/index.js +2 -2
  822. package/components/Tabs/TabPanel/index.js +1 -1
  823. package/components/Tabs/index.js +94 -2
  824. package/components/Tabs/index.js.map +1 -1
  825. package/components/Tag/index.js +22 -5
  826. package/components/Tag/index.js.map +1 -1
  827. package/components/TagList/index.js +6 -2
  828. package/components/TagList/index.js.map +1 -1
  829. package/components/Textarea/index.js +1 -1
  830. package/components/Tile/index.js +70 -3
  831. package/components/Tile/index.js.map +1 -1
  832. package/components/Title/index.js +5 -5
  833. package/components/Toggle/index.js +2653 -5
  834. package/components/Toggle/index.js.map +1 -1
  835. package/components/Tooltip/TooltipWord/index.js +1 -1
  836. package/components/Tooltip/index.js +54 -5
  837. package/components/Tooltip/index.js.map +1 -1
  838. package/components/Trigger/index.js +2 -2
  839. package/components/Validation/index.js +47 -3
  840. package/components/Validation/index.js.map +1 -1
  841. package/{components → docs}/ButtonWithModal/ButtonWithModal.d.ts +1 -1
  842. package/{components → docs}/HelpBubbleExample/HelpBubbleExample.d.ts +1 -1
  843. package/{components → docs}/TooltipExample/TooltipExample.d.ts +1 -1
  844. package/hoc/withBreakpoint/withBreakpoint.js +9 -8
  845. package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
  846. package/hooks/useIcons.js +9 -9
  847. package/hooks/useUuid.js +3 -3
  848. package/index.js +3 -3
  849. package/package.json +1 -1
  850. package/utils/component.js +2 -2
  851. package/utils/uuid.js +4 -7
  852. package/utils/uuid.js.map +1 -1
  853. package/{components/Illustration/utils.js → utils.js} +1 -1
  854. package/utils.js.map +1 -0
  855. package/uuid.js +14 -0
  856. package/uuid.js.map +1 -0
  857. package/_virtual/_cloneBuffer.js +0 -5
  858. package/_virtual/_cloneBuffer.js.map +0 -1
  859. package/_virtual/_commonjs-dynamic-modules.js +0 -7
  860. package/_virtual/_commonjs-dynamic-modules.js.map +0 -1
  861. package/_virtual/_commonjsHelpers.js +0 -9
  862. package/_virtual/_commonjsHelpers.js.map +0 -1
  863. package/_virtual/_nodeUtil.js +0 -5
  864. package/_virtual/_nodeUtil.js.map +0 -1
  865. package/_virtual/dynamic-import-helper.js +0 -17
  866. package/_virtual/dynamic-import-helper.js.map +0 -1
  867. package/_virtual/isBuffer.js +0 -5
  868. package/_virtual/isBuffer.js.map +0 -1
  869. package/_virtual/memoizerific.js +0 -5
  870. package/_virtual/memoizerific.js.map +0 -1
  871. package/components/AnchorLink/AnchorLink.js +0 -53
  872. package/components/AnchorLink/AnchorLink.js.map +0 -1
  873. package/components/Avatar/Avatar.js +0 -33
  874. package/components/Avatar/Avatar.js.map +0 -1
  875. package/components/Badge/Badge.js +0 -30
  876. package/components/Badge/Badge.js.map +0 -1
  877. package/components/Badge/NotificationBadge.js +0 -68
  878. package/components/Badge/NotificationBadge.js.map +0 -1
  879. package/components/Button/Button.js +0 -118
  880. package/components/Button/Button.js.map +0 -1
  881. package/components/ButtonWithModal/ButtonWithModal.js +0 -11
  882. package/components/ButtonWithModal/ButtonWithModal.js.map +0 -1
  883. package/components/ButtonWithModal/index.js +0 -5
  884. package/components/ButtonWithModal/index.js.map +0 -1
  885. package/components/Checkbox/Checkbox.js +0 -110
  886. package/components/Checkbox/Checkbox.js.map +0 -1
  887. package/components/Chip/Chip.js +0 -30
  888. package/components/Chip/Chip.js.map +0 -1
  889. package/components/Close/Close.js +0 -30
  890. package/components/Close/Close.js.map +0 -1
  891. package/components/DictionaryTrigger/DictionaryTrigger.js +0 -27
  892. package/components/DictionaryTrigger/DictionaryTrigger.js.map +0 -1
  893. package/components/Dropdown/Dropdown.js +0 -117
  894. package/components/Dropdown/Dropdown.js.map +0 -1
  895. package/components/Duolist/Duolist.js +0 -63
  896. package/components/Duolist/Duolist.js.map +0 -1
  897. package/components/EmptyState/EmptyState.js +0 -10
  898. package/components/EmptyState/EmptyState.js.map +0 -1
  899. package/components/EmptyState/NobodyHome.js +0 -155
  900. package/components/EmptyState/NobodyHome.js.map +0 -1
  901. package/components/ErrorWrapper/ErrorWrapper.js +0 -12
  902. package/components/ErrorWrapper/ErrorWrapper.js.map +0 -1
  903. package/components/Expander/Expander.js +0 -101
  904. package/components/Expander/Expander.js.map +0 -1
  905. package/components/ExpanderHierarchy/Expander.js +0 -31
  906. package/components/ExpanderHierarchy/Expander.js.map +0 -1
  907. package/components/ExpanderHierarchy/ExpanderButton.js +0 -46
  908. package/components/ExpanderHierarchy/ExpanderButton.js.map +0 -1
  909. package/components/ExpanderHierarchy/ExpanderHierarchy.js +0 -28
  910. package/components/ExpanderHierarchy/ExpanderHierarchy.js.map +0 -1
  911. package/components/ExpanderHierarchy/utils.js +0 -20
  912. package/components/ExpanderHierarchy/utils.js.map +0 -1
  913. package/components/ExpanderList/ExpanderList.js +0 -139
  914. package/components/ExpanderList/ExpanderList.js.map +0 -1
  915. package/components/EyebrowHeader/EyebrowHeader.js +0 -12
  916. package/components/EyebrowHeader/EyebrowHeader.js.map +0 -1
  917. package/components/FormExample/FormExample.js +0 -161
  918. package/components/FormExample/FormExample.js.map +0 -1
  919. package/components/FormExample/index.js +0 -8
  920. package/components/FormExample/index.js.map +0 -1
  921. package/components/FormExample/styles.module.scss +0 -33
  922. package/components/FormExample/styles.module.scss.d.ts +0 -12
  923. package/components/FormGroup/FormGroup.js +0 -101
  924. package/components/FormGroup/FormGroup.js.map +0 -1
  925. package/components/FormLayout/FormLayout.js +0 -38
  926. package/components/FormLayout/FormLayout.js.map +0 -1
  927. package/components/GridExample/GridExample.js +0 -8
  928. package/components/GridExample/GridExample.js.map +0 -1
  929. package/components/GridExample/index.js +0 -6
  930. package/components/GridExample/index.js.map +0 -1
  931. package/components/HelpBubble/HelpBubble.js +0 -61
  932. package/components/HelpBubble/HelpBubble.js.map +0 -1
  933. package/components/HelpBubbleExample/HelpBubbleExample.js +0 -20
  934. package/components/HelpBubbleExample/HelpBubbleExample.js.map +0 -1
  935. package/components/HelpBubbleExample/index.js +0 -5
  936. package/components/HelpBubbleExample/index.js.map +0 -1
  937. package/components/HelpPanel/HelpPanel.js +0 -24
  938. package/components/HelpPanel/HelpPanel.js.map +0 -1
  939. package/components/HelpQuestion/HelpQuestion.js +0 -31
  940. package/components/HelpQuestion/HelpQuestion.js.map +0 -1
  941. package/components/HighlightPanel/HighlightPanel.js +0 -61
  942. package/components/HighlightPanel/HighlightPanel.js.map +0 -1
  943. package/components/HorizontalScroll/HorizontalScroll.js +0 -47
  944. package/components/HorizontalScroll/HorizontalScroll.js.map +0 -1
  945. package/components/Icon/Icon.js +0 -60
  946. package/components/Icon/Icon.js.map +0 -1
  947. package/components/Illustration/Illustration.js +0 -41
  948. package/components/Illustration/Illustration.js.map +0 -1
  949. package/components/Illustration/utils.js.map +0 -1
  950. package/components/Input/Input.js +0 -129
  951. package/components/Input/Input.js.map +0 -1
  952. package/components/Label/Label.js +0 -79
  953. package/components/Label/Label.js.map +0 -1
  954. package/components/Label/SubLabel.js +0 -19
  955. package/components/Label/SubLabel.js.map +0 -1
  956. package/components/LazyIcon/ErrorBoundary.js +0 -21
  957. package/components/LazyIcon/ErrorBoundary.js.map +0 -1
  958. package/components/LazyIcon/LazyIcon.js +0 -31
  959. package/components/LazyIcon/LazyIcon.js.map +0 -1
  960. package/components/LazyIllustration/LazyIllustration.js +0 -35
  961. package/components/LazyIllustration/LazyIllustration.js.map +0 -1
  962. package/components/LinkList/LinkList.js +0 -60
  963. package/components/LinkList/LinkList.js.map +0 -1
  964. package/components/List/List.js +0 -13
  965. package/components/List/List.js.map +0 -1
  966. package/components/ListHeader/ListHeader.js +0 -84
  967. package/components/ListHeader/ListHeader.js.map +0 -1
  968. package/components/ListHeader/ListHeaderText/ListHeaderText.js +0 -30
  969. package/components/ListHeader/ListHeaderText/ListHeaderText.js.map +0 -1
  970. package/components/Loader/Loader.js +0 -67
  971. package/components/Loader/Loader.js.map +0 -1
  972. package/components/Logo/Logo.js +0 -40
  973. package/components/Logo/Logo.js.map +0 -1
  974. package/components/MaxCharacters/MaxCharacters.js +0 -15
  975. package/components/MaxCharacters/MaxCharacters.js.map +0 -1
  976. package/components/Modal/Modal.js +0 -145
  977. package/components/Modal/Modal.js.map +0 -1
  978. package/components/NotificationPanel/NotificationPanel.js +0 -94
  979. package/components/NotificationPanel/NotificationPanel.js.map +0 -1
  980. package/components/Panel/Panel.js +0 -191
  981. package/components/Panel/Panel.js.map +0 -1
  982. package/components/PanelList/PanelList.js +0 -17
  983. package/components/PanelList/PanelList.js.map +0 -1
  984. package/components/PopMenu/PopMenu.js +0 -89
  985. package/components/PopMenu/PopMenu.js.map +0 -1
  986. package/components/PopOver/PopOver.js +0 -56
  987. package/components/PopOver/PopOver.js.map +0 -1
  988. package/components/PopOver/utils.js +0 -33
  989. package/components/PopOver/utils.js.map +0 -1
  990. package/components/Progressbar/Progressbar.js +0 -89
  991. package/components/Progressbar/Progressbar.js.map +0 -1
  992. package/components/PromoPanel/PromoPanel.js +0 -52
  993. package/components/PromoPanel/PromoPanel.js.map +0 -1
  994. package/components/RadioButton/RadioButton.js +0 -104
  995. package/components/RadioButton/RadioButton.js.map +0 -1
  996. package/components/Select/Select.js +0 -70
  997. package/components/Select/Select.js.map +0 -1
  998. package/components/ServiceMessage/ServiceMessage.js +0 -92
  999. package/components/ServiceMessage/ServiceMessage.js.map +0 -1
  1000. package/components/SharingStatus/SharingStatus.js +0 -16
  1001. package/components/SharingStatus/SharingStatus.js.map +0 -1
  1002. package/components/Slider/Slider.js +0 -178
  1003. package/components/Slider/Slider.js.map +0 -1
  1004. package/components/Spacer/Spacer.js.map +0 -1
  1005. package/components/StatusDot/StatusDot.js +0 -29
  1006. package/components/StatusDot/StatusDot.js.map +0 -1
  1007. package/components/Step/Step.js +0 -30
  1008. package/components/Step/Step.js.map +0 -1
  1009. package/components/StepButtons/StepButtons.js +0 -21
  1010. package/components/StepButtons/StepButtons.js.map +0 -1
  1011. package/components/Stepper/Dot.js +0 -16
  1012. package/components/Stepper/Dot.js.map +0 -1
  1013. package/components/Stepper/DotList.js +0 -7
  1014. package/components/Stepper/DotList.js.map +0 -1
  1015. package/components/Stepper/Stepper.js +0 -35
  1016. package/components/Stepper/Stepper.js.map +0 -1
  1017. package/components/Stepper/utils.js +0 -16
  1018. package/components/Stepper/utils.js.map +0 -1
  1019. package/components/Table/Table.js +0 -76
  1020. package/components/Table/Table.js.map +0 -1
  1021. package/components/Table/TableBody/TableBody.js +0 -13
  1022. package/components/Table/TableBody/TableBody.js.map +0 -1
  1023. package/components/Table/TableCell/TableCell.js.map +0 -1
  1024. package/components/Table/TableExpandedRow/TableExpandedRow.js +0 -31
  1025. package/components/Table/TableExpandedRow/TableExpandedRow.js.map +0 -1
  1026. package/components/Table/TableExpanderCell/TableExpanderCell.js +0 -35
  1027. package/components/Table/TableExpanderCell/TableExpanderCell.js.map +0 -1
  1028. package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +0 -25
  1029. package/components/Table/TableExpanderCell/TableExpanderCellMobile.js.map +0 -1
  1030. package/components/Table/TableHead/TableHead.js +0 -24
  1031. package/components/Table/TableHead/TableHead.js.map +0 -1
  1032. package/components/Table/TableHeadCell/TableHeadCell.js +0 -42
  1033. package/components/Table/TableHeadCell/TableHeadCell.js.map +0 -1
  1034. package/components/Table/TableRow/TableRow.js +0 -40
  1035. package/components/Table/TableRow/TableRow.js.map +0 -1
  1036. package/components/Table/utils.js +0 -32
  1037. package/components/Table/utils.js.map +0 -1
  1038. package/components/Tabs/Tab.js +0 -6
  1039. package/components/Tabs/Tab.js.map +0 -1
  1040. package/components/Tabs/TabList/TabItem.js +0 -45
  1041. package/components/Tabs/TabList/TabItem.js.map +0 -1
  1042. package/components/Tabs/TabList/TabList.js +0 -28
  1043. package/components/Tabs/TabList/TabList.js.map +0 -1
  1044. package/components/Tabs/TabPanel/TabPanel.js +0 -17
  1045. package/components/Tabs/TabPanel/TabPanel.js.map +0 -1
  1046. package/components/Tabs/Tabs.js +0 -92
  1047. package/components/Tabs/Tabs.js.map +0 -1
  1048. package/components/Tag/Tag.js +0 -22
  1049. package/components/Tag/Tag.js.map +0 -1
  1050. package/components/TagList/TagList.js +0 -8
  1051. package/components/TagList/TagList.js.map +0 -1
  1052. package/components/Textarea/Textarea.js +0 -105
  1053. package/components/Textarea/Textarea.js.map +0 -1
  1054. package/components/Tile/Tile.js +0 -67
  1055. package/components/Tile/Tile.js.map +0 -1
  1056. package/components/Title/Title.js +0 -25
  1057. package/components/Title/Title.js.map +0 -1
  1058. package/components/Toggle/Toggle.js +0 -92
  1059. package/components/Toggle/Toggle.js.map +0 -1
  1060. package/components/Tooltip/Tooltip.js +0 -55
  1061. package/components/Tooltip/Tooltip.js.map +0 -1
  1062. package/components/Tooltip/TooltipWord/TooltipWord.js +0 -27
  1063. package/components/Tooltip/TooltipWord/TooltipWord.js.map +0 -1
  1064. package/components/TooltipExample/TooltipExample.js +0 -8
  1065. package/components/TooltipExample/TooltipExample.js.map +0 -1
  1066. package/components/TooltipExample/index.js +0 -5
  1067. package/components/TooltipExample/index.js.map +0 -1
  1068. package/components/Trigger/HelpSign.js +0 -7
  1069. package/components/Trigger/HelpSign.js.map +0 -1
  1070. package/components/Trigger/Trigger.js +0 -73
  1071. package/components/Trigger/Trigger.js.map +0 -1
  1072. package/components/Validation/ErrorList.js +0 -8
  1073. package/components/Validation/ErrorList.js.map +0 -1
  1074. package/components/Validation/ErrorListItem.js +0 -12
  1075. package/components/Validation/ErrorListItem.js.map +0 -1
  1076. package/components/Validation/Validation.js +0 -18
  1077. package/components/Validation/Validation.js.map +0 -1
  1078. package/components/Validation/ValidationSummary.js +0 -25
  1079. package/components/Validation/ValidationSummary.js.map +0 -1
  1080. package/docs/index.d.ts +0 -8
  1081. package/docs/index.js +0 -14
  1082. package/docs/index.js.map +0 -1
  1083. /package/{components → docs}/ButtonWithModal/index.d.ts +0 -0
  1084. /package/{components → docs}/FormExample/FormExample.d.ts +0 -0
  1085. /package/{components → docs}/FormExample/index.d.ts +0 -0
  1086. /package/{components → docs}/GridExample/GridExample.d.ts +0 -0
  1087. /package/{components → docs}/GridExample/index.d.ts +0 -0
  1088. /package/{components → docs}/HelpBubbleExample/index.d.ts +0 -0
  1089. /package/{components → docs}/TooltipExample/index.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"PanelList.js","sources":["../../../src/components/PanelList/PanelList.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport Panel, { PanelProps, PanelVariant } from '../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?: keyof typeof PanelVariant;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst isPanelComponent = (element: {} | null | undefined): element is React.ReactElement<PanelProps> =>\n React.isValidElement<PanelProps>(element) && (element as React.ReactElement).type === Panel;\n\nconst PanelList = React.forwardRef(function BadgeForwardedRef(props: PanelListProps, ref: React.ForwardedRef<HTMLDivElement>) {\n const { testId, children, variant = PanelVariant.fill } = props;\n\n const renderPanel = (panel: React.ReactElement<PanelProps>, firstChild: boolean) =>\n React.cloneElement(panel, {\n variant: variant,\n noTopBorder: variant === PanelVariant.line && !firstChild,\n className: classNames(panel.props.className, variant !== PanelVariant.line && styles['panel-list__panel']),\n });\n\n return (\n <div ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.PanelList}>\n {React.Children.map(children, (child, index) => (isPanelComponent(child) ? renderPanel(child, index === 0) : child))}\n </div>\n );\n});\n\nexport default PanelList;\n"],"names":["isPanelComponent","element","React","Panel","PanelList","props","ref","testId","children","variant","PanelVariant","renderPanel","panel","firstChild","classNames","styles","AnalyticsId","child","index"],"mappings":";;;;;AAkBA,MAAMA,IAAmB,CAACC,MACxBC,EAAM,eAA2BD,CAAO,KAAMA,EAA+B,SAASE,GAElFC,IAAYF,EAAM,WAAW,SAA2BG,GAAuBC,GAAyC;AAC5H,QAAM,EAAE,QAAAC,GAAQ,UAAAC,GAAU,SAAAC,IAAUC,EAAa,KAAS,IAAAL,GAEpDM,IAAc,CAACC,GAAuCC,MAC1DX,EAAM,aAAaU,GAAO;AAAA,IACxB,SAAAH;AAAA,IACA,aAAaA,MAAYC,EAAa,QAAQ,CAACG;AAAA,IAC/C,WAAWC,EAAWF,EAAM,MAAM,WAAWH,MAAYC,EAAa,QAAQK,EAAO,mBAAmB,CAAC;AAAA,EAAA,CAC1G;AAGD,SAAAb,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAAI,GAAU,eAAaC,GAAQ,oBAAkBS,EAAY,UAAA,GAC/Dd,EAAM,SAAS,IAAIM,GAAU,CAACS,GAAOC,MAAWlB,EAAiBiB,CAAK,IAAIN,EAAYM,GAAOC,MAAU,CAAC,IAAID,CAAM,CACrH;AAEJ,CAAC;"}
@@ -1,89 +0,0 @@
1
- import e, { useRef as m, useState as W } from "react";
2
- import u from "classnames";
3
- import { IconSize as p, AnalyticsId as $ } from "../../constants.js";
4
- import { useBreakpoint as j } from "../../hooks/useBreakpoint.js";
5
- import { useHover as q } from "../../hooks/useHover.js";
6
- import { useOutsideEvent as F } from "../../hooks/useOutsideEvent.js";
7
- import { getColor as E } from "../../theme/currys/color.js";
8
- import { breakpoints as J } from "../../theme/grid.js";
9
- import { isComponent as y } from "../../utils/component.js";
10
- import { Icon as f } from "../Icon/Icon.js";
11
- import K from "../Icons/VerticalDots.js";
12
- import Q from "../Icons/X.js";
13
- import { LazyIcon as U } from "../LazyIcon/LazyIcon.js";
14
- import { LinkList as h } from "../LinkList/LinkList.js";
15
- import V from "../PopOver/PopOver.js";
16
- import l from "../PopMenu/styles.module.scss";
17
- var Y = /* @__PURE__ */ ((o) => (o.onWhite = "on-white", o.onGray = "on-gray", o.onBlueberry = "on-blueberry", o))(Y || {}), Z = /* @__PURE__ */ ((o) => (o.right = "right", o.left = "left", o))(Z || {});
18
- const ge = (o) => {
19
- const d = m(null), v = m(null), B = m(null), b = m(null), [r, c] = W(!1), {
20
- children: g,
21
- popOverClassName: O,
22
- popMenuClassName: N,
23
- openButtonTestId: z,
24
- closeButtonTestId: H,
25
- popOverTestId: R,
26
- popMenuVariant: C = "on-white",
27
- openButtonAriaLabel: S,
28
- closeButtonAriaLabel: _,
29
- svgIcon: n,
30
- labelText: a,
31
- labelTextPosition: I = "right"
32
- /* right */
33
- } = o, L = u(l["pop-menu-button"], {
34
- [l[`pop-menu-button--${C}`]]: C
35
- }), T = j() < J.md;
36
- F(b, () => {
37
- c(!1);
38
- });
39
- const { isHovered: i } = q(d), k = T ? p.XSmall : p.Small, w = (t) => {
40
- c(!1), t && t();
41
- }, x = () => {
42
- if (y(g, h))
43
- return /* @__PURE__ */ e.createElement(
44
- V,
45
- {
46
- testId: R,
47
- className: u(l["pop-menu__pop-over"], O),
48
- arrowClassName: l["pop-menu__pop-over-arrow"],
49
- controllerRef: v,
50
- popOverRef: B
51
- },
52
- e.Children.map(
53
- g,
54
- (t) => e.cloneElement(t, {
55
- children: e.Children.map(
56
- t.props.children,
57
- (s) => y(s, h.Link) ? e.cloneElement(s, {
58
- onClick: (P) => w(() => s.props.onClick && s.props.onClick(P))
59
- }) : s
60
- )
61
- })
62
- )
63
- );
64
- }, X = (t) => {
65
- t && t.stopPropagation(), c(!r);
66
- }, A = n && typeof n == "string" ? /* @__PURE__ */ e.createElement(U, { iconName: n, size: p.XSmall, isHovered: i }) : n && /* @__PURE__ */ e.createElement(f, { svgIcon: n, size: p.XSmall, isHovered: i }), D = n ? A : /* @__PURE__ */ e.createElement(f, { svgIcon: n ?? K, color: E("black"), size: k, isHovered: i }), G = /* @__PURE__ */ e.createElement(f, { svgIcon: Q, color: E("black"), size: k, isHovered: i }), M = /* @__PURE__ */ e.createElement(
67
- "button",
68
- {
69
- ref: d,
70
- "data-testid": r ? H : z,
71
- className: L,
72
- "aria-label": r ? _ : S,
73
- "aria-expanded": r,
74
- onClick: X,
75
- type: "button"
76
- },
77
- a && I == "left" && /* @__PURE__ */ e.createElement("span", null, a),
78
- /* @__PURE__ */ e.createElement("div", { ref: v }, r ? G : D),
79
- a && I == "right" && /* @__PURE__ */ e.createElement("span", null, a)
80
- );
81
- return /* @__PURE__ */ e.createElement("div", { ref: b, className: u(l["pop-menu-button"], N), "data-analyticsid": $.PopMenu }, M, r && x());
82
- };
83
- export {
84
- ge as PopMenu,
85
- Z as PopMenuLabelPosition,
86
- Y as PopMenuVariant,
87
- ge as default
88
- };
89
- //# sourceMappingURL=PopMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PopMenu.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { isComponent } from '../../utils/component';\nimport Icon, { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport VerticalDots from '../Icons/VerticalDots';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\nimport LinkList, { LinkListProps, LinkProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport enum PopMenuLabelPosition {\n right = 'right',\n left = 'left',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n /** Sets the icon on the trigger button. */\n svgIcon?: SvgIcon | IconName;\n /** Optional text next to the trigger button. */\n labelText?: string;\n /** Placement of the label text relative to the trigger button. */\n labelTextPosition?: PopMenuLabelPosition;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const triggerButtonRef = useRef<HTMLButtonElement>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n const popOverRef = useRef<HTMLDivElement>(null);\n const outerRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n svgIcon,\n labelText,\n labelTextPosition = PopMenuLabelPosition.right,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n\n useOutsideEvent(outerRef, () => {\n setIsOpen(false);\n });\n\n const { isHovered: triggerButtonIsHovered } = useHover(triggerButtonRef);\n const mobileIconSize = mobile ? IconSize.XSmall : IconSize.Small;\n\n const handleClick = (cb?: () => void): void => {\n setIsOpen(false);\n cb && cb();\n };\n\n const renderChildren = () => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n arrowClassName={styles['pop-menu__pop-over-arrow']}\n controllerRef={iconRef}\n popOverRef={popOverRef}\n >\n {React.Children.map(children, child =>\n React.cloneElement(child, {\n children: React.Children.map(child.props.children, child =>\n isComponent<LinkProps>(child, LinkList.Link)\n ? React.cloneElement(child, {\n onClick: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) =>\n handleClick(() => child.props.onClick && child.props.onClick(event)),\n })\n : child\n ),\n })\n )}\n </PopOver>\n );\n }\n };\n\n const toggleOpenOnClick = (e?: React.MouseEvent<HTMLElement, MouseEvent>): void => {\n e && e.stopPropagation();\n setIsOpen(!isOpen);\n };\n\n const iconComponent =\n svgIcon && typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n ) : (\n svgIcon && <Icon svgIcon={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n );\n\n const openIcon = svgIcon ? (\n iconComponent\n ) : (\n <Icon svgIcon={svgIcon ?? VerticalDots} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />\n );\n\n const closeIcon = <Icon svgIcon={X} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />;\n\n const triggerButton = (\n <button\n ref={triggerButtonRef}\n data-testid={isOpen ? closeButtonTestId : openButtonTestId}\n className={buttonClasses}\n aria-label={isOpen ? closeButtonAriaLabel : openButtonAriaLabel}\n aria-expanded={isOpen}\n onClick={toggleOpenOnClick}\n type=\"button\"\n >\n {labelText && labelTextPosition == PopMenuLabelPosition.left && <span>{labelText}</span>}\n {<div ref={iconRef}>{isOpen ? closeIcon : openIcon}</div>}\n {labelText && labelTextPosition == PopMenuLabelPosition.right && <span>{labelText}</span>}\n </button>\n );\n\n return (\n <div ref={outerRef} className={classNames(styles['pop-menu-button'], popMenuClassName)} data-analyticsid={AnalyticsId.PopMenu}>\n {triggerButton}\n {isOpen && renderChildren()}\n </div>\n );\n};\n\nexport default PopMenu;\n"],"names":["PopMenuVariant","PopMenuLabelPosition","PopMenu","props","triggerButtonRef","useRef","iconRef","popOverRef","outerRef","isOpen","setIsOpen","useState","children","popOverClassName","popMenuClassName","openButtonTestId","closeButtonTestId","popOverTestId","popMenuVariant","openButtonAriaLabel","closeButtonAriaLabel","svgIcon","labelText","labelTextPosition","buttonClasses","classNames","styles","mobile","useBreakpoint","breakpoints","useOutsideEvent","triggerButtonIsHovered","useHover","mobileIconSize","IconSize","handleClick","cb","renderChildren","isComponent","LinkList","React","PopOver","child","event","toggleOpenOnClick","e","iconComponent","LazyIcon","Icon","openIcon","VerticalDots","getColor","closeIcon","X","triggerButton","AnalyticsId"],"mappings":";;;;;;;;;;;;;;;;AAqBY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,YACVA,EAAA,SAAS,WACTA,EAAA,cAAc,gBAHJA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA;AAgCC,MAAAC,KAAkC,CAAC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AA,KAAKhB,KAAUG,IAAS2C,IAAYH,CAAS;AAAA,IAClD3B,KAAaC,KAAqB,WAA8BiB,gBAAAA,EAAA,cAAC,cAAMlB,CAAU;AAAA,EAAA;AAItF,yCACG,OAAI,EAAA,KAAKd,GAAU,WAAWiB,EAAWC,EAAO,iBAAiB,GAAGZ,CAAgB,GAAG,oBAAkByC,EAAY,WACnHD,GACA7C,KAAU4B,GACb;AAEJ;"}
@@ -1,56 +0,0 @@
1
- import r, { useRef as w, useState as h, useEffect as A } from "react";
2
- import y from "classnames";
3
- import { getVerticalPosition as B, getBubbleStyle as F, getArrowStyle as L } from "./utils.js";
4
- import { ZIndex as T, AnalyticsId as V } from "../../constants.js";
5
- import { useInterval as Z } from "../../hooks/useInterval.js";
6
- import { useIsVisible as j } from "../../hooks/useIsVisible.js";
7
- import { useLayoutEvent as k } from "../../hooks/useLayoutEvent.js";
8
- import { useSize as q } from "../../hooks/useSize.js";
9
- import { mergeRefs as D } from "../../utils/refs.js";
10
- import t from "../PopOver/styles.module.scss";
11
- var G = /* @__PURE__ */ ((e) => (e.positionautomatic = "positionautomatic", e.positionbelow = "positionbelow", e.positionabove = "positionabove", e))(G || {});
12
- const H = r.forwardRef((e, S) => {
13
- const {
14
- id: _,
15
- children: R,
16
- controllerRef: n,
17
- popOverRef: g,
18
- show: p = !1,
19
- className: z = "",
20
- variant: c = "positionautomatic",
21
- role: m,
22
- testId: C,
23
- arrowClassName: I,
24
- zIndex: u = T.PopOver
25
- } = e, f = g || w(null), N = w(null), s = q(f), [o, E] = h(), v = j(n, 0), l = () => {
26
- var d;
27
- E((d = n.current) == null ? void 0 : d.getBoundingClientRect());
28
- };
29
- Z(l, 500), k(l, ["scroll", "resize"], 10), A(() => {
30
- l();
31
- }, []);
32
- const b = m === "tooltip", O = y(t.popover, { [t["popover--visible"]]: b ? p : v }, z), i = o && s && B(o, s, c), P = y(t.popover__arrow, I, {
33
- [t["popover__arrow--over"]]: i === "positionbelow",
34
- [t["popover__arrow--under"]]: i === "positionabove",
35
- [t["popover__arrow--visible"]]: b ? p : v
36
- }), a = o && s && F(o, s, c), x = a && o && i && L(a, o, i);
37
- return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
38
- "div",
39
- {
40
- id: _,
41
- ref: D([S, f]),
42
- className: O,
43
- style: { ...a, zIndex: u },
44
- "data-testid": C,
45
- "data-analyticsid": V.PopOver,
46
- role: m
47
- },
48
- R
49
- ), /* @__PURE__ */ r.createElement("div", { ref: N, className: P, style: { ...x, zIndex: u } }));
50
- });
51
- H.displayName = "PopOver";
52
- export {
53
- G as PopOverVariant,
54
- H as default
55
- };
56
- //# sourceMappingURL=PopOver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PopOver.js","sources":["../../../src/components/PopOver/PopOver.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getArrowStyle, getBubbleStyle, getVerticalPosition } from './utils';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { useInterval } from '../../hooks/useInterval';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useLayoutEvent } from '../../hooks/useLayoutEvent';\nimport { useSize } from '../../hooks/useSize';\nimport { mergeRefs } from '../../utils/refs';\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';\n\nexport interface PopOverProps {\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 /** Ref for the element the PopOver is placed upon */\n popOverRef?: React.RefObject<HTMLDivElement>;\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 /** Adds custom classes to the arrow element. */\n arrowClassName?: string;\n /** Determines the placement of the popover. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\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, PopOverProps>((props, ref) => {\n const {\n id,\n children,\n controllerRef,\n popOverRef,\n show = false,\n className = '',\n variant = PopOverVariant.positionautomatic,\n role,\n testId,\n arrowClassName,\n zIndex = ZIndex.PopOver,\n } = props;\n\n const bubbleRef = popOverRef || useRef<HTMLDivElement>(null);\n const arrowRef = useRef<HTMLDivElement>(null);\n const bubbleSize = useSize(bubbleRef);\n const [controllerSize, setControllerSize] = useState<DOMRect>();\n const controllerisVisible = useIsVisible(controllerRef, 0);\n\n const updateControllerSize = (): void => {\n setControllerSize(controllerRef.current?.getBoundingClientRect());\n };\n\n useInterval(updateControllerSize, 500);\n useLayoutEvent(updateControllerSize, ['scroll', 'resize'], 10);\n\n useEffect(() => {\n updateControllerSize();\n }, []);\n\n const isTooltip = role === 'tooltip';\n\n const popOverClasses = classNames(styles.popover, { [styles['popover--visible']]: isTooltip ? show : controllerisVisible }, className);\n const verticalPosition = controllerSize && bubbleSize && getVerticalPosition(controllerSize, bubbleSize, variant);\n const arrowClasses = classNames(styles.popover__arrow, arrowClassName, {\n [styles['popover__arrow--over']]: verticalPosition === PopOverVariant.positionbelow,\n [styles['popover__arrow--under']]: verticalPosition === PopOverVariant.positionabove,\n [styles['popover__arrow--visible']]: isTooltip ? show : controllerisVisible,\n });\n\n const bubbleStyle = controllerSize && bubbleSize && getBubbleStyle(controllerSize, bubbleSize, variant);\n const arrowStyle = bubbleStyle && controllerSize && verticalPosition && getArrowStyle(bubbleStyle, controllerSize, verticalPosition);\n\n return (\n <>\n <div\n id={id}\n ref={mergeRefs([ref, bubbleRef])}\n className={popOverClasses}\n style={{ ...bubbleStyle, zIndex }}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PopOver}\n role={role}\n >\n {children}\n </div>\n <div ref={arrowRef} className={arrowClasses} style={{ ...arrowStyle, zIndex }} />\n </>\n );\n});\n\nPopOver.displayName = 'PopOver';\n\nexport default PopOver;\n"],"names":["PopOverVariant","PopOver","React","props","ref","id","children","controllerRef","popOverRef","show","className","variant","role","testId","arrowClassName","zIndex","ZIndex","bubbleRef","useRef","arrowRef","bubbleSize","useSize","controllerSize","setControllerSize","useState","controllerisVisible","useIsVisible","updateControllerSize","_a","useInterval","useLayoutEvent","useEffect","isTooltip","popOverClasses","classNames","styles","verticalPosition","getVerticalPosition","arrowClasses","bubbleStyle","getBubbleStyle","arrowStyle","getArrowStyle","mergeRefs","AnalyticsId"],"mappings":";;;;;;;;;;AAcY,IAAAA,sBAAAA,OACVA,EAAA,oBAAoB,qBACpBA,EAAA,gBAAgB,iBAChBA,EAAA,gBAAgB,iBAHNA,IAAAA,KAAA,CAAA,CAAA;AAiCZ,MAAMC,IAAUC,EAAM,WAAyD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC,IAASC,EAAO;AAAA,EACd,IAAAb,GAEEc,IAAYT,KAAcU,EAAuB,IAAI,GACrDC,IAAWD,EAAuB,IAAI,GACtCE,IAAaC,EAAQJ,CAAS,GAC9B,CAACK,GAAgBC,CAAiB,IAAIC,EAAkB,GACxDC,IAAsBC,EAAanB,GAAe,CAAC,GAEnDoB,IAAuB,MAAY;;AACrB,IAAAJ,GAAAK,IAAArB,EAAc,YAAd,gBAAAqB,EAAuB,uBAAuB;AAAA,EAAA;AAGlE,EAAAC,EAAYF,GAAsB,GAA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 373, r = 12, h = 16, l = 20, x = 4, P = 12, a = (t, o, n) => n !== s.positionautomatic ? n : t.top > o.height + h ? s.positionabove : s.positionbelow, p = (t) => t.left + t.width / 2, m = (t) => document.documentElement.clientWidth - t.right + t.width / 2, u = (t, o) => p(t) - o.width / 2, R = (t, o) => u(t, o) + o.width, B = (t, o) => u(t, o) > r, _ = (t, o) => R(t, o) < document.documentElement.clientWidth - r, L = (t, o) => _(t, o) ? B(t, o) ? "floating" : "left" : "right", b = (t, o) => t.top - h - o.height, c = (t) => t.bottom + h, W = () => document.documentElement.clientWidth - r * 2, v = () => document.documentElement.clientWidth > w + r * 2, d = (t) => t.top - h - x, A = (t) => p(t) - l / 2, E = (t) => m(t) - l / 2, I = (t, o, n) => {
3
- const i = L(t, o), e = a(t, o, n);
4
- return i === "left" ? e === s.positionabove ? "leftabove" : "leftbelow" : i === "right" ? e === s.positionabove ? "rightabove" : "rightbelow" : e === s.positionabove ? "floatingabove" : "floatingbelow";
5
- }, C = (t, o, n) => {
6
- const i = I(t, o, n), e = v() ? void 0 : W();
7
- return i === "leftabove" ? {
8
- left: r,
9
- top: b(t, o),
10
- width: e
11
- } : i === "leftbelow" ? { left: r, top: c(t), width: e } : i === "rightabove" ? { right: r, top: b(t, o), width: e } : i === "rightbelow" ? { right: r, top: c(t), width: e } : i === "floatingbelow" ? { left: u(t, o), top: c(t), width: e } : { left: u(t, o), top: b(t, o), width: e };
12
- }, T = (t, o, n) => {
13
- const i = A(o), e = E(o), f = t.left + P, g = t.right + P;
14
- return t.right ? n === s.positionabove ? {
15
- right: e > g ? e : g,
16
- top: d(o)
17
- } : {
18
- right: e > g ? e : g,
19
- top: o.bottom
20
- } : n === s.positionabove ? {
21
- left: i > f ? i : f,
22
- top: d(o)
23
- } : {
24
- left: i > f ? i : f,
25
- top: o.bottom
26
- };
27
- };
28
- export {
29
- T as getArrowStyle,
30
- C as getBubbleStyle,
31
- a as getVerticalPosition
32
- };
33
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/components/PopOver/utils.ts"],"sourcesContent":["import { CSSProperties } from 'react';\n\nimport { PopOverVariant } from './PopOver';\n\ntype HorizontalPosition = 'left' | 'right' | 'floating';\ntype BubblePosition = 'leftabove' | 'leftbelow' | 'rightabove' | 'rightbelow' | 'floatingabove' | 'floatingbelow';\n\n/** Bredde på hjelpeboble */\nconst BUBBLE_WIDTH_PX = 373;\n/** Hjelpeboblen skal holde avstand til venstre/høyre kant på vinduet */\nconst WINDOW_MARGIN_PX = 12;\n/** Vertikal avstand fra hjelpeboble til kontroller */\nconst BUBBLE_VERTICAL_OFFSET_PX = 16;\n/** Høyde/bredde på pil */\nconst ARROW_WIDTH_PX = 20;\n/** Avstand fra pil til hjelpeboble */\nconst ARROW_VERTICAL_OFFSET_PX = 4;\n/** Pilen skal holde avstand til venstre/høyre kant av hjelpeboblen */\nconst ARROW_HORIZONTAL_MARGIN_PX = 12;\n\n/**\n * Beregn om hjelpeboblen skal vises over eller under kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under/automatisk)\n * @returns Om hjelpeboblen skal vises over eller under\n */\nexport const getVerticalPosition = (\n controllerSize: DOMRect,\n bubbleSize: DOMRect,\n variant: keyof typeof PopOverVariant\n): keyof typeof PopOverVariant => {\n if (variant !== PopOverVariant.positionautomatic) {\n return variant;\n }\n if (controllerSize.top > bubbleSize.height + BUBBLE_VERTICAL_OFFSET_PX) {\n return PopOverVariant.positionabove;\n } else {\n return PopOverVariant.positionbelow;\n }\n};\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerLeftCenterPx = (controllerSize: DOMRect): number => controllerSize.left + controllerSize.width / 2;\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til høyre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerRightCenterPx = (controllerSize: DOMRect): number =>\n document.documentElement.clientWidth - controllerSize.right + controllerSize.width / 2;\n\n/**\n * Finn venstre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Venstre kant av hjelpeboblen i px\n */\nconst getBubbleLeftPx = (controllerSize: DOMRect, bubbleSize: DOMRect): number => {\n const controllerHorizontalCenterPx = getControllerLeftCenterPx(controllerSize);\n\n return controllerHorizontalCenterPx - bubbleSize.width / 2;\n};\n\n/**\n * Finn høyre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Høyre kant av hjelpeboblen i px\n */\nconst getBubbleRightPx = (controllerSize: DOMRect, bubbleSize: DOMRect): number => {\n const bubbleLeftPx = getBubbleLeftPx(controllerSize, bubbleSize);\n\n return bubbleLeftPx + bubbleSize.width;\n};\n\n/**\n * Sjekk om venstre kant av hjelpeboblen er innenfor vinduet\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns true dersom venstre kant er innenfor vinduet\n */\nconst getBubbleLeftVisible = (controllerSize: DOMRect, bubbleSize: DOMRect): boolean => {\n const bubbleLeftPx = getBubbleLeftPx(controllerSize, bubbleSize);\n\n return bubbleLeftPx > WINDOW_MARGIN_PX;\n};\n\n/**\n * Sjekk om høyre kant av hjelpeboblen er innenfor vinduet\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns true dersom høyre kant er innenfor vinduet\n */\nconst getBubbleRightIsVisible = (controllerSize: DOMRect, bubbleSize: DOMRect): boolean => {\n const bubbleRightPx = getBubbleRightPx(controllerSize, bubbleSize);\n\n return bubbleRightPx < document.documentElement.clientWidth - WINDOW_MARGIN_PX;\n};\n\n/**\n * Finn riktig horisontal plassering til hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns left, right eller floating\n */\nconst getHorizontalPosition = (controllerSize: DOMRect, bubbleSize: DOMRect): HorizontalPosition => {\n if (!getBubbleRightIsVisible(controllerSize, bubbleSize)) {\n return 'right';\n }\n if (!getBubbleLeftVisible(controllerSize, bubbleSize)) {\n return 'left';\n }\n\n return 'floating';\n};\n\n/**\n * Finn vertikal plassering av hjelpeboblen når den skal vises over\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns \"Top\" for hjelpeboblen i px\n */\nconst getBubbleAbovePx = (controllerSize: DOMRect, bubbleSize: DOMRect): number =>\n controllerSize.top - BUBBLE_VERTICAL_OFFSET_PX - bubbleSize.height;\n\n/**\n * Finn vertikal plassering av hjelpeboblen når den skal vises under\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns \"Top\" for hjelpeboblen i px\n */\nconst getBubbleBelowPx = (controllerSize: DOMRect): number => controllerSize.bottom + BUBBLE_VERTICAL_OFFSET_PX;\n\n/**\n * Finn maks bredde på hjelpeboblen i forhold til vinduet\n * @returns Bredde på hjelpeboblen i px\n */\nconst getBubbleWidth = (): number => document.documentElement.clientWidth - WINDOW_MARGIN_PX * 2;\n\n/**\n * Sjekk om hjelpeboblen har plass i vinduet\n * @returns true dersom det er plass til hjelpeboblen i vinduet\n */\nconst getBubbleFitsInWindow = (): boolean => {\n return document.documentElement.clientWidth > BUBBLE_WIDTH_PX + WINDOW_MARGIN_PX * 2;\n};\n\n/**\n * Finn vertikal plassering av pilen når den skal vises over\n * @param controllerSize DOMRect for controlleren\n * @returns \"Top\" for pilen i px\n */\nconst getArrowTopxPx = (controllerSize: DOMRect): number => controllerSize.top - BUBBLE_VERTICAL_OFFSET_PX - ARROW_VERTICAL_OFFSET_PX;\n\n/**\n * Finn horisontal plassering av pilen i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Venstre kant av pilen i px\n */\nconst getArrowLeftPx = (controllerSize: DOMRect): number => getControllerLeftCenterPx(controllerSize) - ARROW_WIDTH_PX / 2;\n\n/**\n * Finn horisontal plassering av pilen\n * @param controllerSize DOMRect for controlleren\n * @returns Venstre kant av pilen i px\n */\nconst getArrowRightPx = (controllerSize: DOMRect): number => getControllerRightCenterPx(controllerSize) - ARROW_WIDTH_PX / 2;\n\n/**\n * Finn riktig plassering av hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under)\n * @returns Beste mulige plassering av hjelpeboblen\n */\nconst getBubblePosition = (controllerSize: DOMRect, bubbleSize: DOMRect, variant: keyof typeof PopOverVariant): BubblePosition => {\n const horizontalPosition = getHorizontalPosition(controllerSize, bubbleSize);\n const verticalPosition = getVerticalPosition(controllerSize, bubbleSize, variant);\n\n if (horizontalPosition === 'left') {\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'leftabove';\n }\n return 'leftbelow';\n }\n\n if (horizontalPosition === 'right') {\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'rightabove';\n }\n return 'rightbelow';\n }\n\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'floatingabove';\n }\n\n return 'floatingbelow';\n};\n\n/**\n * Finn riktig plassering av hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under)\n * @returns CSSProperties som plasserer hjelpeboblen riktig\n */\nexport const getBubbleStyle = (controllerSize: DOMRect, bubbleSize: DOMRect, variant: keyof typeof PopOverVariant): CSSProperties => {\n const bubblePosition = getBubblePosition(controllerSize, bubbleSize, variant);\n const bubbleWidth = !getBubbleFitsInWindow() ? getBubbleWidth() : undefined;\n\n if (bubblePosition === 'leftabove') {\n return {\n left: WINDOW_MARGIN_PX,\n top: getBubbleAbovePx(controllerSize, bubbleSize),\n width: bubbleWidth,\n };\n }\n if (bubblePosition === 'leftbelow') {\n return { left: WINDOW_MARGIN_PX, top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n if (bubblePosition === 'rightabove') {\n return { right: WINDOW_MARGIN_PX, top: getBubbleAbovePx(controllerSize, bubbleSize), width: bubbleWidth };\n }\n if (bubblePosition === 'rightbelow') {\n return { right: WINDOW_MARGIN_PX, top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n\n if (bubblePosition === 'floatingbelow') {\n return { left: getBubbleLeftPx(controllerSize, bubbleSize), top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n\n return { left: getBubbleLeftPx(controllerSize, bubbleSize), top: getBubbleAbovePx(controllerSize, bubbleSize), width: bubbleWidth };\n};\n\n/**\n * Finn riktig plassering av pilen\n * @param bubbleStyle CSSProperties for hjelpeboblen\n * @param controllerSize DOMRect for kontrolleren\n * @param verticalPosition Ønsket plassering av hjelpeboblen (over/under)\n * @returns CSSProperties som plasserer pilen riktig\n */\nexport const getArrowStyle = (\n bubbleStyle: CSSProperties,\n controllerSize: DOMRect,\n verticalPosition: keyof typeof PopOverVariant\n): CSSProperties => {\n const leftPx = getArrowLeftPx(controllerSize);\n const rightPx = getArrowRightPx(controllerSize);\n const minLeftPx = (bubbleStyle.left as number) + ARROW_HORIZONTAL_MARGIN_PX;\n const minRightPx = (bubbleStyle.right as number) + ARROW_HORIZONTAL_MARGIN_PX;\n\n if (bubbleStyle.right) {\n if (verticalPosition === PopOverVariant.positionabove) {\n return {\n right: rightPx > minRightPx ? rightPx : minRightPx,\n top: getArrowTopxPx(controllerSize),\n };\n }\n\n return {\n right: rightPx > minRightPx ? rightPx : minRightPx,\n top: controllerSize.bottom,\n };\n }\n\n if (verticalPosition === PopOverVariant.positionabove) {\n return {\n left: leftPx > minLeftPx ? leftPx : minLeftPx,\n top: getArrowTopxPx(controllerSize),\n };\n }\n\n return {\n left: leftPx > minLeftPx ? leftPx : minLeftPx,\n top: controllerSize.bottom,\n };\n};\n"],"names":["BUBBLE_WIDTH_PX","WINDOW_MARGIN_PX","BUBBLE_VERTICAL_OFFSET_PX","ARROW_WIDTH_PX","ARROW_VERTICAL_OFFSET_PX","ARROW_HORIZONTAL_MARGIN_PX","getVerticalPosition","controllerSize","bubbleSize","variant","PopOverVariant","getControllerLeftCenterPx","getControllerRightCenterPx","getBubbleLeftPx","getBubbleRightPx","getBubbleLeftVisible","getBubbleRightIsVisible","getHorizontalPosition","getBubbleAbovePx","getBubbleBelowPx","getBubbleWidth","getBubbleFitsInWindow","getArrowTopxPx","getArrowLeftPx","getArrowRightPx","getBubblePosition","horizontalPosition","verticalPosition","getBubbleStyle","bubblePosition","bubbleWidth","getArrowStyle","bubbleStyle","leftPx","rightPx","minLeftPx","minRightPx"],"mappings":";AAQA,MAAMA,IAAkB,KAElBC,IAAmB,IAEnBC,IAA4B,IAE5BC,IAAiB,IAEjBC,IAA2B,GAE3BC,IAA6B,IAStBC,IAAsB,CACjCC,GACAC,GACAC,MAEIA,MAAYC,EAAe,oBACtBD,IAELF,EAAe,MAAMC,EAAW,SAASN,IACpCQ,EAAe,gBAEfA,EAAe,eASpBC,IAA4B,CAACJ,MAAoCA,EAAe,OAAOA,EAAe,QAAQ,GAO9GK,IAA6B,CAACL,MAClC,SAAS,gBAAgB,cAAcA,EAAe,QAAQA,EAAe,QAAQ,GAQjFM,IAAkB,CAACN,GAAyBC,MACXG,EAA0BJ,CAAc,IAEvCC,EAAW,QAAQ,GASrDM,IAAmB,CAACP,GAAyBC,MAC5BK,EAAgBN,GAAgBC,CAAU,IAEzCA,EAAW,OAS7BO,IAAuB,CAACR,GAAyBC,MAChCK,EAAgBN,GAAgBC,CAAU,IAEzCP,GASlBe,IAA0B,CAACT,GAAyBC,MAClCM,EAAiBP,GAAgBC,CAAU,IAE1C,SAAS,gBAAgB,cAAcP,GAS1DgB,IAAwB,CAACV,GAAyBC,MACjDQ,EAAwBT,GAA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B,KAAKkB,EAAiBZ,CAAc,GAAG,OAAOuB,MAG9ED,MAAmB,kBACd,EAAE,MAAMhB,EAAgBN,GAAgBC,CAAU,GAAG,KAAKW,EAAiBZ,CAAc,GAAG,OAAOuB,EAAY,IAGjH,EAAE,MAAMjB,EAAgBN,GAAgBC,CAAU,GAAG,KAAKU,EAAiBX,GAAgBC,CAAU,GAAG,OAAOsB,EAAY;AACpI,GASaC,IAAgB,CAC3BC,GACAzB,GACAoB,MACkB;AACZ,QAAAM,IAASV,EAAehB,CAAc,GACtC2B,IAAUV,EAAgBjB,CAAc,GACxC4B,IAAaH,EAAY,OAAkB3B,GAC3C+B,IAAcJ,EAAY,QAAmB3B;AAEnD,SAAI2B,EAAY,QACVL,MAAqBjB,EAAe,gBAC/B;AAAA,IACL,OAAOwB,IAAUE,IAAaF,IAAUE;AAAA,IACxC,KAAKd,EAAef,CAAc;AAAA,EAAA,IAI/B;AAAA,IACL,OAAO2B,IAAUE,IAAaF,IAAUE;AAAA,IACxC,KAAK7B,EAAe;AAAA,EAAA,IAIpBoB,MAAqBjB,EAAe,gBAC/B;AAAA,IACL,MAAMuB,IAASE,IAAYF,IAASE;AAAA,IACpC,KAAKb,EAAef,CAAc;AAAA,EAAA,IAI/B;AAAA,IACL,MAAM0B,IAASE,IAAYF,IAASE;AAAA,IACpC,KAAK5B,EAAe;AAAA,EAAA;AAExB;"}
@@ -1,89 +0,0 @@
1
- import a, { useRef as _, useEffect as v } from "react";
2
- import N from "classnames";
3
- import { ZIndex as $ } from "../../constants.js";
4
- import { palette as o } from "../../theme/palette.js";
5
- import s from "../Progressbar/styles.module.scss";
6
- var B = /* @__PURE__ */ ((e) => (e.small = "small", e.medium = "medium", e.large = "large", e))(B || {}), C = /* @__PURE__ */ ((e) => (e.ondark = "ondark", e.onlight = "onlight", e))(C || {}), R = /* @__PURE__ */ ((e) => (e.screen = "screen", e.parent = "parent", e))(R || {});
7
- const W = ({
8
- value: e,
9
- size: i = "large",
10
- mode: c = "onlight",
11
- overlay: t,
12
- testId: b,
13
- ariaLabel: w
14
- }) => {
15
- t && (c = "ondark"), e = Math.max(0, Math.min(e, 100));
16
- let n;
17
- i === "large" ? n = 96 : i === "medium" ? n = 50 : n = 44;
18
- const m = n / 2, p = 8, f = m - p / 2, l = m * 2, r = m, k = c === "onlight" ? o.blueberry100 : o.neutral700, h = c === "onlight" ? o.blueberry600 : o.white, g = 2 * Math.PI * f, y = g - e / 100 * g, d = _(null);
19
- v(() => {
20
- var u, x;
21
- t === "parent" && ((x = (u = d.current) == null ? void 0 : u.parentElement) != null && x.style) && (d.current.parentElement.style.position = "relative");
22
- }, []);
23
- const E = N({
24
- [s["progressbar--overlay"]]: t,
25
- [s["progressbar--overlay-screen"]]: t === "screen",
26
- [s["progressbar--overlay-parent"]]: t === "parent"
27
- /* parent */
28
- });
29
- return /* @__PURE__ */ a.createElement(
30
- "div",
31
- {
32
- ref: d,
33
- className: E,
34
- "data-testid": b,
35
- role: "progressbar",
36
- "aria-valuenow": e,
37
- "aria-label": w,
38
- "aria-live": "polite",
39
- style: t === "screen" ? { zIndex: $.OverlayScreen } : {}
40
- },
41
- /* @__PURE__ */ a.createElement(
42
- "svg",
43
- {
44
- role: "presentation",
45
- width: l,
46
- height: l,
47
- viewBox: `0 0 ${l} ${l}`,
48
- className: s.progressbar__svg
49
- },
50
- /* @__PURE__ */ a.createElement("circle", { cx: r, cy: r, r: f, stroke: k, strokeWidth: p, fill: "none" }),
51
- /* @__PURE__ */ a.createElement(
52
- "circle",
53
- {
54
- cx: r,
55
- cy: r,
56
- r: f,
57
- stroke: h,
58
- strokeWidth: p,
59
- fill: "none",
60
- strokeDasharray: g,
61
- strokeDashoffset: y,
62
- className: s["progressbar__progress-circle"],
63
- transform: `rotate(-90 ${r} ${r})`
64
- }
65
- ),
66
- " ",
67
- /* @__PURE__ */ a.createElement(
68
- "text",
69
- {
70
- className: "progress-wheel__text--large",
71
- fontSize: "1.5rem",
72
- fill: h,
73
- x: r,
74
- y: r,
75
- textAnchor: "middle",
76
- alignmentBaseline: "middle"
77
- },
78
- i == "large" && `${e}%`
79
- )
80
- )
81
- );
82
- };
83
- export {
84
- R as Overlay,
85
- C as ProgressBarMode,
86
- B as ProgressbarSize,
87
- W as default
88
- };
89
- //# sourceMappingURL=Progressbar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Progressbar.js","sources":["../../../src/components/Progressbar/Progressbar.tsx"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\n\nimport classNames from 'classnames';\n\nimport { ZIndex } from '../../constants';\nimport { palette } from '../../theme/palette';\n\nimport styles from './styles.module.scss';\n\nexport enum ProgressbarSize {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\n\nexport enum ProgressBarMode {\n ondark = 'ondark',\n onlight = 'onlight',\n}\n\nexport enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\nexport interface ProgressbarProps {\n /** The value of the progressbar given in percent. Value between 0 and 100 */\n value: number;\n /** Size of the progressbar. Default is large */\n size?: ProgressbarSize;\n /** Changes the visuals of the ProgressBar. Default is onLight */\n mode?: ProgressBarMode;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Aria label for the progressbar */\n ariaLabel?: string;\n /** Sets the data-testid attribute */\n testId?: string;\n}\n\nconst Progressbar: React.FC<ProgressbarProps> = ({\n value,\n size = ProgressbarSize.large,\n mode = ProgressBarMode.onlight,\n overlay,\n testId,\n ariaLabel,\n}: ProgressbarProps) => {\n if (overlay) {\n mode = ProgressBarMode.ondark;\n }\n // Restrict value to be between 0 and 100\n value = Math.max(0, Math.min(value, 100));\n\n let width;\n if (size === ProgressbarSize.large) {\n width = 96;\n } else if (size === ProgressbarSize.medium) {\n width = 50;\n } else {\n width = 44;\n }\n\n const totalRadius = width / 2;\n const strokeWidth = 8;\n const radius = totalRadius - strokeWidth / 2;\n const viewBoxSize = totalRadius * 2;\n const viewBoxCenter = totalRadius;\n const circleBackgroundColor = mode === ProgressBarMode.onlight ? palette.blueberry100 : palette.neutral700;\n const mainColor = mode === ProgressBarMode.onlight ? palette.blueberry600 : palette.white;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (value / 100) * circumference;\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (overlay === Overlay.parent && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.position = 'relative';\n }\n }, []);\n\n const wrapperClasses = classNames({\n [styles['progressbar--overlay']]: overlay,\n [styles['progressbar--overlay-screen']]: overlay === Overlay.screen,\n [styles['progressbar--overlay-parent']]: overlay === Overlay.parent,\n });\n\n return (\n <div\n ref={wrapperRef}\n className={wrapperClasses}\n data-testid={testId}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-label={ariaLabel}\n aria-live=\"polite\"\n style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}\n >\n <svg\n role=\"presentation\"\n width={viewBoxSize}\n height={viewBoxSize}\n viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}\n className={styles['progressbar__svg']}\n >\n <circle cx={viewBoxCenter} cy={viewBoxCenter} r={radius} stroke={circleBackgroundColor} strokeWidth={strokeWidth} fill=\"none\" />\n <circle\n cx={viewBoxCenter}\n cy={viewBoxCenter}\n r={radius}\n stroke={mainColor}\n strokeWidth={strokeWidth}\n fill=\"none\"\n strokeDasharray={circumference}\n strokeDashoffset={strokeDashoffset}\n className={styles['progressbar__progress-circle']}\n transform={`rotate(-90 ${viewBoxCenter} ${viewBoxCenter})`}\n />{' '}\n <text\n className=\"progress-wheel__text--large\"\n fontSize={'1.5rem'}\n fill={mainColor}\n x={viewBoxCenter}\n y={viewBoxCenter}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {size == ProgressbarSize.large && `${value}%`}\n </text>\n </svg>\n </div>\n );\n};\n\nexport default Progressbar;\n"],"names":["ProgressbarSize","ProgressBarMode","Overlay","Progressbar","value","size","mode","overlay","testId","ariaLabel","width","totalRadius","strokeWidth","radius","viewBoxSize","viewBoxCenter","circleBackgroundColor","palette","mainColor","circumference","strokeDashoffset","wrapperRef","useRef","useEffect","_b","_a","wrapperClasses","classNames","styles","React","ZIndex"],"mappings":";;;;;AASY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WAFAA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AAmBZ,MAAMC,IAA0C,CAAC;AAAA,EAC/C,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AACF,MAAwB;AACtB,EAAIF,MACKD,IAAA,WAGTF,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAIA,GAAO,GAAG,CAAC;AAEpC,MAAAM;AACJ,EAAIL,MAAS,UACHK,IAAA,KACCL,MAAS,WACVK,IAAA,KAEAA,IAAA;AAGV,QAAMC,IAAcD,IAAQ,GACtBE,IAAc,GACdC,IAASF,IAAcC,IAAc,GACrCE,IAAcH,IAAc,GAC5BI,IAAgBJ,GAChBK,IAAwBV,MAAS,YAA0BW,EAAQ,eAAeA,EAAQ,YAC1FC,IAAYZ,MAAS,YAA0BW,EAAQ,eAAeA,EAAQ,OAC9EE,IAAgB,IAAI,KAAK,KAAKN,GAC9BO,IAAmBD,IAAiBf,IAAQ,MAAOe,GAEnDE,IAAaC,EAAuB,IAAI;AAE9C,EAAAC,EAAU,MAAM;;AACd,IAAIhB,MAAY,cAAkBiB,KAAAC,IAAAJ,EAAW,YAAX,gBAAAI,EAAoB,kBAApB,QAAAD,EAAmC,WACxDH,EAAA,QAAQ,cAAc,MAAM,WAAW;AA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X;AAAA,UACN,GAAGH;AAAA,UACH,GAAGA;AAAA,UACH,YAAW;AAAA,UACX,mBAAkB;AAAA,QAAA;AAAA,QAEjBV,KAAQ,WAAyB,GAAGD,CAAK;AAAA,MAC5C;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,52 +0,0 @@
1
- import t from "react";
2
- import h from "classnames";
3
- import { AnalyticsId as C, IconSize as o } from "../../constants.js";
4
- import { useBreakpoint as b, Breakpoint as a } from "../../hooks/useBreakpoint.js";
5
- import { useHover as g } from "../../hooks/useHover.js";
6
- import { getColor as m } from "../../theme/currys/color.js";
7
- import { Icon as E } from "../Icon/Icon.js";
8
- import _ from "../Icons/ArrowRight.js";
9
- import P from "../Icons/ArrowUpRight.js";
10
- import { LazyIllustration as v } from "../LazyIllustration/LazyIllustration.js";
11
- import { Title as y } from "../Title/Title.js";
12
- import n from "../PromoPanel/styles.module.scss";
13
- const I = (e) => e.linkComponent ? t.cloneElement(e.linkComponent, { children: e.children }) : e.linkHtmlMarkup === "button" ? /* @__PURE__ */ t.createElement("button", { type: "button", onClick: e.linkOnClick }, e.children) : /* @__PURE__ */ t.createElement("a", { href: e.href, target: e.target, onClick: e.linkOnClick }, e.children), T = (e) => {
14
- const { isHovered: c, hoverRef: u } = g(), { color: l = "neutral", titleHtmlMarkup: k = "h2", linkHtmlMarkup: f = "a" } = e, r = b(), s = h(
15
- n.promopanel,
16
- n[`promopanel--${l}`],
17
- !e.illustration && n["promopanel--no-illustration"]
18
- ), i = /* @__PURE__ */ t.createElement(
19
- I,
20
- {
21
- href: e.href,
22
- target: e.target,
23
- linkComponent: e.linkComponent,
24
- linkHtmlMarkup: f,
25
- linkOnClick: e.linkOnClick
26
- },
27
- e.title || e.children
28
- ), d = r >= a.md ? 156 : 110;
29
- return /* @__PURE__ */ t.createElement("div", { className: s, "data-testid": e.testId, "data-analyticsid": C.PromoPanel, ref: u }, e.illustration && /* @__PURE__ */ t.createElement(
30
- v,
31
- {
32
- illustrationName: e.illustration,
33
- size: d,
34
- color: l,
35
- className: n.promopanel__illustration
36
- }
37
- ), /* @__PURE__ */ t.createElement("div", { className: n.promopanel__content }, e.title && /* @__PURE__ */ t.createElement(y, { htmlMarkup: k, appearance: "title3" }, i), e.title ? e.children : i), /* @__PURE__ */ t.createElement(
38
- E,
39
- {
40
- className: n.promopanel__icon,
41
- svgIcon: e.target === "_blank" ? P : _,
42
- size: r >= a.md ? o.Small : o.XSmall,
43
- isHovered: c,
44
- color: m("blueberry", 500),
45
- hoverColor: m("blueberry", 600)
46
- }
47
- ));
48
- };
49
- export {
50
- T as default
51
- };
52
- //# sourceMappingURL=PromoPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromoPanel.js","sources":["../../../src/components/PromoPanel/PromoPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { getColor } from '../../theme/currys/color';\nimport { PaletteNames } from '../../theme/palette';\nimport { AnchorLinkTags, AnchorLinkTargets } from '../AnchorLink';\nimport Icon from '../Icon';\nimport ArrowRight from '../Icons/ArrowRight';\nimport ArrowUpRight from '../Icons/ArrowUpRight';\nimport LazyIllustration from '../LazyIllustration';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type PromoPanelColors = Extract<PaletteNames, 'neutral' | 'blueberry' | 'cherry'>;\n\nexport interface PromoPanelProps {\n /** Used as the link text if set. title or children must be set for the link to have accessible text. */\n title?: string;\n /** Used as the link text if title is not set. */\n children?: string;\n /** Illustration element */\n illustration?: 'Doctor' | 'HealthcarePersonnel';\n /** Changes the underlying element of the title. */\n titleHtmlMarkup?: TitleTags;\n /** Changes the background color. Default: white */\n color?: PromoPanelColors;\n /** Not used if linkComponent is set */\n href?: string;\n /** Anchor link target. If linkComponent is set, this prop is only used to display the right icon for external links. */\n target?: AnchorLinkTargets;\n /** HTML markup for anchor link. Not used if linkComponent is set. Default: a */\n linkHtmlMarkup?: AnchorLinkTags;\n /** Function that is called when clicked. Not used if linkComponent is set. */\n linkOnClick?: () => void;\n /** Custom link component. Must be \"a\" a or \"button\" element with no styling. */\n linkComponent?: React.ReactElement;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface PromoPanelLinkProps {\n children?: string;\n href?: string;\n target?: AnchorLinkTargets;\n linkComponent?: React.ReactElement;\n linkHtmlMarkup?: AnchorLinkTags;\n linkOnClick?: () => void;\n}\n\nconst PromoPanelLink: React.FC<PromoPanelLinkProps> = props => {\n if (props.linkComponent) {\n return React.cloneElement(props.linkComponent, { children: props.children });\n }\n\n if (props.linkHtmlMarkup === 'button') {\n return (\n <button type={'button'} onClick={props.linkOnClick}>\n {props.children}\n </button>\n );\n }\n return (\n <a href={props.href} target={props.target} onClick={props.linkOnClick}>\n {props.children}\n </a>\n );\n};\n\nconst PromoPanel: React.FC<PromoPanelProps> = props => {\n const { isHovered, hoverRef } = useHover<HTMLDivElement>();\n\n const { color = 'neutral', titleHtmlMarkup = 'h2', linkHtmlMarkup = 'a' } = props;\n\n const breakpoint = useBreakpoint();\n\n const promoPanelClasses = classNames(\n styles.promopanel,\n styles[`promopanel--${color}`],\n !props.illustration && styles['promopanel--no-illustration']\n );\n\n const promoPanelLink = (\n <PromoPanelLink\n href={props.href}\n target={props.target}\n linkComponent={props.linkComponent}\n linkHtmlMarkup={linkHtmlMarkup}\n linkOnClick={props.linkOnClick}\n >\n {props.title || props.children}\n </PromoPanelLink>\n );\n\n const illustrationSize = ((): number => {\n if (breakpoint >= Breakpoint.md) {\n return 156;\n }\n\n return 110;\n })();\n\n return (\n <div className={promoPanelClasses} data-testid={props.testId} data-analyticsid={AnalyticsId.PromoPanel} ref={hoverRef}>\n {props.illustration && (\n <LazyIllustration\n illustrationName={props.illustration}\n size={illustrationSize}\n color={color}\n className={styles.promopanel__illustration}\n />\n )}\n <div className={styles.promopanel__content}>\n {props.title && (\n <Title htmlMarkup={titleHtmlMarkup} appearance={'title3'}>\n {promoPanelLink}\n </Title>\n )}\n {!props.title ? promoPanelLink : props.children}\n </div>\n <Icon\n className={styles.promopanel__icon}\n svgIcon={props.target === '_blank' ? ArrowUpRight : ArrowRight}\n size={breakpoint >= Breakpoint.md ? IconSize.Small : IconSize.XSmall}\n isHovered={isHovered}\n color={getColor('blueberry', 500)}\n hoverColor={getColor('blueberry', 600)}\n />\n </div>\n );\n};\n\nexport default PromoPanel;\n"],"names":["PromoPanelLink","props","React","PromoPanel","isHovered","hoverRef","useHover","color","titleHtmlMarkup","linkHtmlMarkup","breakpoint","useBreakpoint","promoPanelClasses","classNames","styles","promoPanelLink","illustrationSize","Breakpoint","AnalyticsId","LazyIllustration","Title","Icon","ArrowUpRight","ArrowRight","IconSize","getColor"],"mappings":";;;;;;;;;;;;AAsDA,MAAMA,IAAgD,CAASC,MACzDA,EAAM,gBACDC,EAAM,aAAaD,EAAM,eAAe,EAAE,UAAUA,EAAM,UAAU,IAGzEA,EAAM,mBAAmB,WAEzBC,gBAAAA,EAAA,cAAC,YAAO,MAAM,UAAU,SAASD,EAAM,YAAA,GACpCA,EAAM,QACT,IAIDC,gBAAAA,EAAA,cAAA,KAAA,EAAE,MAAMD,EAAM,MAAM,QAAQA,EAAM,QAAQ,SAASA,EAAM,YACvD,GAAAA,EAAM,QACT,GAIEE,IAAwC,CAASF,MAAA;AACrD,QAAM,EAAE,WAAAG,GAAW,UAAAC,EAAS,IAAIC,EAAyB,GAEnD,EAAE,OAAAC,IAAQ,WAAW,iBAAAC,IAAkB,MAAM,gBAAAC,IAAiB,IAAQ,IAAAR,GAEtES,IAAaC,KAEbC,IAAoBC;AAAA,IACxBC,EAAO;AAAA,IACPA,EAAO,eAAeP,CAAK,EAAE;AAAA,IAC7B,CAACN,EAAM,gBAAgBa,EAAO,6BAA6B;AAAA,EAAA,GAGvDC,IACJb,gBAAAA,EAAA;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,MAAMC,EAAM;AAAA,MACZ,QAAQA,EAAM;AAAA,MACd,eAAeA,EAAM;AAAA,MACrB,gBAAAQ;AAAA,MACA,aAAaR,EAAM;AAAA,IAAA;AAAA,IAElBA,EAAM,SAASA,EAAM;AAAA,EAAA,GAIpBe,IACAN,KAAcO,EAAW,KACpB,MAGF;AAGT,SACGf,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWU,GAAmB,eAAaX,EAAM,QAAQ,oBAAkBiB,EAAY,YAAY,KAAKb,EAAA,GAC1GJ,EAAM,gBACLC,gBAAAA,EAAA;AAAA,IAACiB;AAAA,IAAA;AAAA,MACC,kBAAkBlB,EAAM;AAAA,MACxB,MAAMe;AAAA,MACN,OAAAT;AAAA,MACA,WAAWO,EAAO;AAAA,IAAA;AAAA,EACpB,mCAED,OAAI,EAAA,WAAWA,EAAO,oBACpB,GAAAb,EAAM,SACLC,gBAAAA,EAAA,cAACkB,GAAM,EAAA,YAAYZ,GAAiB,YAAY,YAC7CO,CACH,GAEAd,EAAM,QAAyBA,EAAM,WAAvBc,CAClB,GACAb,gBAAAA,EAAA;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,WAAWP,EAAO;AAAA,MAClB,SAASb,EAAM,WAAW,WAAWqB,IAAeC;AAAA,MACpD,MAAMb,KAAcO,EAAW,KAAKO,EAAS,QAAQA,EAAS;AAAA,MAC9D,WAAApB;AAAA,MACA,OAAOqB,EAAS,aAAa,GAAG;AAAA,MAChC,YAAYA,EAAS,aAAa,GAAG;AAAA,IAAA;AAAA,EAAA,CAEzC;AAEJ;"}
@@ -1,104 +0,0 @@
1
- import u, { useState as P } from "react";
2
- import c from "classnames";
3
- import { FormMode as i, FormSize as U, AnalyticsId as W } from "../../constants.js";
4
- import { usePseudoClasses as q } from "../../hooks/usePseudoClasses.js";
5
- import { useUuid as G } from "../../hooks/useUuid.js";
6
- import { getAriaDescribedBy as H } from "../../utils/accessibility.js";
7
- import { isMutableRefObject as J, mergeRefs as K } from "../../utils/refs.js";
8
- import { uuid as Q } from "../../utils/uuid.js";
9
- import { ErrorWrapper as V } from "../ErrorWrapper/ErrorWrapper.js";
10
- import { getLabelText as X, renderLabelAsParent as Y } from "../Label/Label.js";
11
- import e from "../RadioButton/styles.module.scss";
12
- const be = (l, o, a, m) => {
13
- const n = o === "oninvalid", t = l === m;
14
- return c({
15
- [e["radio-button-label__large--on-grey"]]: a && o === "ongrey" && !t,
16
- [e["radio-button-label__large--on-blueberry"]]: o === "onblueberry" && !t && a,
17
- [e["radio-button-label__large--selected"]]: a && t && !n,
18
- [e["radio-button-label__large--selected-invalid"]]: a && t && n
19
- });
20
- }, Z = u.forwardRef((l, o) => {
21
- const {
22
- className: a,
23
- defaultChecked: m,
24
- onChange: n,
25
- disabled: t,
26
- label: f,
27
- inputId: p = Q(),
28
- mode: d = i.onwhite,
29
- name: v = p,
30
- size: w,
31
- errorText: _,
32
- error: k = !!_,
33
- errorTextId: B,
34
- value: R = X(f),
35
- testId: x,
36
- required: L,
37
- labelClassNames: N,
38
- ...I
39
- } = l, g = k || d === i.oninvalid, y = d === i.ondark, h = d === i.onblueberry, T = d === i.oninvalid, r = w === U.large, [E, A] = P(), { refObject: F, isFocused: s } = q(J(o) ? o : null), S = K([o, F]), C = G(B), j = c(e["radio-button-wrapper"], {
40
- [e["radio-button-wrapper--with-error"]]: _,
41
- [e["radio-button-wrapper__large"]]: r,
42
- [e["radio-button-wrapper__large--focused"]]: r && s,
43
- [e["radio-button-wrapper__large--selected"]]: r && E && s,
44
- [e["radio-button-wrapper__large--invalid"]]: r && T && s,
45
- [e["radio-button-wrapper__large--on-blueberry"]]: r && h && s
46
- }), z = c(
47
- e["radio-button-label"],
48
- {
49
- [e["radio-button-label--disabled"]]: t,
50
- [e["radio-button-label--on-dark"]]: y,
51
- [e["radio-button-label--invalid"]]: g,
52
- [e["radio-button-label__large"]]: r,
53
- [e["radio-button-label__large--disabled"]]: r && t
54
- },
55
- N
56
- ), D = c(
57
- e["radio-button"],
58
- {
59
- [e["radio-button--on-dark"]]: y,
60
- [e["radio-button--disabled"]]: t,
61
- [e["radio-button--on-blueberry"]]: h,
62
- [e["radio-button--invalid"]]: g,
63
- [e["radio-button__large"]]: r,
64
- [e["radio-button__large--disabled"]]: r && t,
65
- [e["radio-button__large--invalid"]]: r && g
66
- },
67
- a
68
- ), M = (b) => {
69
- A(b.target.checked), n && n(b);
70
- }, O = () => /* @__PURE__ */ u.createElement(
71
- "input",
72
- {
73
- id: p,
74
- name: v,
75
- className: D,
76
- type: "radio",
77
- disabled: t,
78
- value: R,
79
- ref: S,
80
- defaultChecked: m,
81
- "aria-describedby": H(l, C),
82
- required: L,
83
- ...I,
84
- onChange: (b) => M(b)
85
- }
86
- );
87
- return /* @__PURE__ */ u.createElement(V, { errorText: _, errorTextId: C }, /* @__PURE__ */ u.createElement("div", { "data-testid": x, "data-analyticsid": W.RadioButton, className: j }, Y(
88
- f,
89
- O(),
90
- p,
91
- d,
92
- z,
93
- void 0,
94
- e["radiobutton-sublabel-wrapper"],
95
- r
96
- )));
97
- });
98
- Z.displayName = "RadioButton";
99
- export {
100
- Z as RadioButton,
101
- Z as default,
102
- be as getRadioLabelClasses
103
- };
104
- //# sourceMappingURL=RadioButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton.js","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormMode, FormSize } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends 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 mode?: keyof typeof FormMode;\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 = (radioId: string, mode: FormMode, large: boolean, checkedRadioId?: string): string | undefined => {\n const onCherry = mode === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && mode === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: mode === '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 mode = FormMode.onwhite,\n name = inputId,\n size,\n errorText,\n error = !!errorText,\n errorTextId,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ...rest\n } = props;\n const invalid = error || mode === FormMode.oninvalid;\n const onDark = mode === FormMode.ondark;\n const onBlueberry = mode === FormMode.onblueberry;\n const onCherry = mode === FormMode.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 errorTextUuid = useUuid(errorTextId);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper--with-error']]: errorText,\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--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 onChange && onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\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, errorTextUuid)}\n required={required}\n {...rest}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n mode as FormMode,\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"],"names":["getRadioLabelClasses","radioId","mode","large","checkedRadioId","onCherry","checked","classNames","radioButtonStyles","RadioButton","React","props","ref","className","defaultChecked","onChange","disabled","label","inputId","uuid","FormMode","name","size","errorText","error","errorTextId","value","getLabelText","testId","required","labelClassNames","rest","invalid","onDark","onBlueberry","isLarge","FormSize","changeChecked","useState","refObject","isFocused","usePseudoClasses","isMutableRefObject","mergedRefs","mergeRefs","errorTextUuid","useUuid","radioButtonWrapperClasses","radioButtonLabelClasses","radioButtonClasses","change","e","getLabelContent","getAriaDescribedBy","ErrorWrapper","AnalyticsId","renderLabelAsParent"],"mappings":";;;;;;;;;;;AA0CO,MAAMA,KAAuB,CAACC,GAAiBC,GAAgBC,GAAgBC,MAAgD;AACpI,QAAMC,IAAWH,MAAS,aACpBI,IAAUL,MAAYG;AAE5B,SAAOG,EAAW;AAAA,IAChB,CAACC,EAAkB,oCAAoC,CAAC,GAAGL,KAASD,MAAS,YAAY,CAACI;AAAA,IAC1F,CAACE,EAAkB,yCAAyC,CAAC,GAAGN,MAAS,iBAAiB,CAACI,KAAWH;AAAA,IACtG,CAACK,EAAkB,qCAAqC,CAAC,GAAGL,KAASG,KAAW,CAACD;AAAA,IACjF,CAACG,EAAkB,6CAA6C,CAAC,GAAGL,KAASG,KAAWD;AAAA,EAAA,CACzF;AACH,GAEaI,IAAcC,EAAM,WAAW,CAACC,GAAyBC,MAAqC;AACnG,QAAA;AAAA,IACJ,WAA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