@helsenorge/designsystem-react 13.4.0 → 13.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/lib/CHANGELOG.md +40 -0
  2. package/lib/Checkbox.js.map +1 -1
  3. package/lib/Duolist.js +3 -0
  4. package/lib/Duolist.js.map +1 -1
  5. package/lib/Expander.js +6 -2
  6. package/lib/Expander.js.map +1 -1
  7. package/lib/FormGroup.js +4 -3
  8. package/lib/FormGroup.js.map +1 -1
  9. package/lib/HelpTriggerIcon.js.map +1 -1
  10. package/lib/HelpTriggerStandalone.js.map +1 -1
  11. package/lib/InfoTeaser.js +2 -1
  12. package/lib/InfoTeaser.js.map +1 -1
  13. package/lib/Input.js.map +1 -1
  14. package/lib/Label.js.map +1 -1
  15. package/lib/LinkList.js +8 -4
  16. package/lib/LinkList.js.map +1 -1
  17. package/lib/Panel.js +61 -37
  18. package/lib/Panel.js.map +1 -1
  19. package/lib/PanelOld.js.map +1 -1
  20. package/lib/PopOver.js.map +1 -1
  21. package/lib/RadioButton.js.map +1 -1
  22. package/lib/Select.js.map +1 -1
  23. package/lib/Slider.js.map +1 -1
  24. package/lib/Textarea.js.map +1 -1
  25. package/lib/__mocks__/uuid.js +0 -1
  26. package/lib/__mocks__/uuid.js.map +1 -1
  27. package/lib/components/AnchorLink/index.js +0 -13
  28. package/lib/components/AsChildSlot/index.js +0 -1
  29. package/lib/components/Avatar/index.js +0 -4
  30. package/lib/components/Badge/index.js +0 -8
  31. package/lib/components/Button/index.js +0 -17
  32. package/lib/components/Checkbox/index.js +0 -44
  33. package/lib/components/Close/index.js +0 -8
  34. package/lib/components/DictionaryTrigger/index.js +0 -1
  35. package/lib/components/Drawer/index.js +0 -37
  36. package/lib/components/Drawer/styles.module.scss +6 -0
  37. package/lib/components/Dropdown/SingleSelect/index.js +0 -2
  38. package/lib/components/Dropdown/SingleSelect/index.js.map +1 -1
  39. package/lib/components/Dropdown/index.js +0 -37
  40. package/lib/components/Dropdown/index.js.map +1 -1
  41. package/lib/components/DropdownOld/index.js +0 -28
  42. package/lib/components/DropdownOld/index.js.map +1 -1
  43. package/lib/components/Duolist/Duolist.d.ts +3 -1
  44. package/lib/components/Duolist/index.js +0 -4
  45. package/lib/components/ElementHeader/ElementHeaderText/index.js +0 -9
  46. package/lib/components/ElementHeader/ElementHeaderText/index.js.map +1 -1
  47. package/lib/components/ElementHeader/StatusDotList/index.js +0 -34
  48. package/lib/components/ElementHeader/index.js +0 -48
  49. package/lib/components/ElementHeader/index.js.map +1 -1
  50. package/lib/components/ElementHeader/styles.module.scss +1 -1
  51. package/lib/components/EmptyState/index.js +0 -2
  52. package/lib/components/EmptyState/index.js.map +1 -1
  53. package/lib/components/Expander/index.js +0 -24
  54. package/lib/components/Expander/styles.module.scss +16 -7
  55. package/lib/components/Expander/styles.module.scss.d.ts +2 -1
  56. package/lib/components/ExpanderHierarchy/index.js +0 -1
  57. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  58. package/lib/components/ExpanderList/index.js +0 -46
  59. package/lib/components/ExpanderList/index.js.map +1 -1
  60. package/lib/components/ExpanderList/styles.module.scss +3 -3
  61. package/lib/components/EyebrowHeader/index.js +0 -1
  62. package/lib/components/EyebrowHeader/index.js.map +1 -1
  63. package/lib/components/FavoriteButton/index.js +0 -1
  64. package/lib/components/FavoriteButton/index.js.map +1 -1
  65. package/lib/components/FormFieldTag/index.js +0 -2
  66. package/lib/components/FormGroup/FormGroup.d.ts +5 -0
  67. package/lib/components/FormGroup/index.js +0 -55
  68. package/lib/components/FormGroup/index.js.map +1 -1
  69. package/lib/components/FormLayout/index.js +0 -1
  70. package/lib/components/HelpBubble/index.js +3 -20
  71. package/lib/components/HelpBubble/index.js.map +1 -1
  72. package/lib/components/HelpDrawer/index.js +0 -36
  73. package/lib/components/HelpDrawer/index.js.map +1 -1
  74. package/lib/components/HelpExpanderInline/index.js +0 -2
  75. package/lib/components/HelpExpanderInline/index.js.map +1 -1
  76. package/lib/components/HelpExpanderStandalone/index.js +0 -6
  77. package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
  78. package/lib/components/HelpPanel/index.js +0 -32
  79. package/lib/components/HelpPanel/index.js.map +1 -1
  80. package/lib/components/HelpTeaser/HelpTeaser.d.ts +2 -0
  81. package/lib/components/HelpTeaser/index.js +2 -9
  82. package/lib/components/HelpTeaser/index.js.map +1 -1
  83. package/lib/components/HelpTooltip/index.js +0 -2
  84. package/lib/components/HelpTooltip/index.js.map +1 -1
  85. package/lib/components/HelpTriggerIcon/index.js +0 -4
  86. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  87. package/lib/components/HelpTriggerStandalone/index.js +0 -8
  88. package/lib/components/HighlightPanel/index.js +0 -32
  89. package/lib/components/Highlighter/index.js +0 -8
  90. package/lib/components/HorizontalScroll/index.js +0 -5
  91. package/lib/components/Icons/AlarmClock.js +0 -1
  92. package/lib/components/Icons/AlarmClock.js.map +1 -1
  93. package/lib/components/Icons/AlertSignFill.js +0 -2
  94. package/lib/components/Icons/AlertSignStroke.js +0 -2
  95. package/lib/components/Icons/Archive.js +0 -1
  96. package/lib/components/Icons/Archive.js.map +1 -1
  97. package/lib/components/Icons/ArrowDown.js +0 -2
  98. package/lib/components/Icons/ArrowLeft.js +0 -1
  99. package/lib/components/Icons/ArrowLeft.js.map +1 -1
  100. package/lib/components/Icons/ArrowRight.js +0 -2
  101. package/lib/components/Icons/ArrowUp.js +0 -2
  102. package/lib/components/Icons/ArrowUpRight.js +0 -2
  103. package/lib/components/Icons/Attachment.js +0 -1
  104. package/lib/components/Icons/Attachment.js.map +1 -1
  105. package/lib/components/Icons/Avatar.js +0 -1
  106. package/lib/components/Icons/Avatar.js.map +1 -1
  107. package/lib/components/Icons/Braille.js +0 -1
  108. package/lib/components/Icons/Braille.js.map +1 -1
  109. package/lib/components/Icons/Bus.js +0 -1
  110. package/lib/components/Icons/Bus.js.map +1 -1
  111. package/lib/components/Icons/Calendar.js +0 -2
  112. package/lib/components/Icons/CalendarChange.js +0 -1
  113. package/lib/components/Icons/CalendarChange.js.map +1 -1
  114. package/lib/components/Icons/CalendarCheck.js +0 -1
  115. package/lib/components/Icons/CalendarCheck.js.map +1 -1
  116. package/lib/components/Icons/CalendarSave.js +0 -1
  117. package/lib/components/Icons/CalendarSave.js.map +1 -1
  118. package/lib/components/Icons/Candle.js +0 -1
  119. package/lib/components/Icons/Candle.js.map +1 -1
  120. package/lib/components/Icons/Change.js +0 -1
  121. package/lib/components/Icons/Change.js.map +1 -1
  122. package/lib/components/Icons/Check.js +0 -2
  123. package/lib/components/Icons/CheckFill.js +0 -2
  124. package/lib/components/Icons/ChevronDown.js +0 -2
  125. package/lib/components/Icons/ChevronLeft.js +0 -2
  126. package/lib/components/Icons/ChevronRight.js +0 -2
  127. package/lib/components/Icons/ChevronUp.js +0 -2
  128. package/lib/components/Icons/ChevronsDown.js +0 -1
  129. package/lib/components/Icons/ChevronsDown.js.map +1 -1
  130. package/lib/components/Icons/ChevronsUp.js +0 -1
  131. package/lib/components/Icons/ChevronsUp.js.map +1 -1
  132. package/lib/components/Icons/Contacts.js +0 -1
  133. package/lib/components/Icons/Contacts.js.map +1 -1
  134. package/lib/components/Icons/Copy.js +0 -1
  135. package/lib/components/Icons/Copy.js.map +1 -1
  136. package/lib/components/Icons/DotActive.js +0 -1
  137. package/lib/components/Icons/DotActive.js.map +1 -1
  138. package/lib/components/Icons/DotAlert.js +0 -1
  139. package/lib/components/Icons/DotAlert.js.map +1 -1
  140. package/lib/components/Icons/DotCancelled.js +0 -1
  141. package/lib/components/Icons/DotCancelled.js.map +1 -1
  142. package/lib/components/Icons/DotHalfDisc.js +0 -1
  143. package/lib/components/Icons/DotHalfDisc.js.map +1 -1
  144. package/lib/components/Icons/DotInactive.js +0 -1
  145. package/lib/components/Icons/DotInactive.js.map +1 -1
  146. package/lib/components/Icons/DotInfo.js +0 -1
  147. package/lib/components/Icons/DotInfo.js.map +1 -1
  148. package/lib/components/Icons/DotLookingGlass.js +0 -1
  149. package/lib/components/Icons/DotLookingGlass.js.map +1 -1
  150. package/lib/components/Icons/DotPending.js +0 -1
  151. package/lib/components/Icons/DotPending.js.map +1 -1
  152. package/lib/components/Icons/DotQuestionMark.js +0 -1
  153. package/lib/components/Icons/DotQuestionMark.js.map +1 -1
  154. package/lib/components/Icons/DotSuccess.js +0 -1
  155. package/lib/components/Icons/DotSuccess.js.map +1 -1
  156. package/lib/components/Icons/DotTransparent.js +0 -1
  157. package/lib/components/Icons/DotTransparent.js.map +1 -1
  158. package/lib/components/Icons/DotWarningTriangle.js +0 -1
  159. package/lib/components/Icons/DotWarningTriangle.js.map +1 -1
  160. package/lib/components/Icons/Download.js +0 -1
  161. package/lib/components/Icons/Download.js.map +1 -1
  162. package/lib/components/Icons/Drag.js +0 -1
  163. package/lib/components/Icons/Drag.js.map +1 -1
  164. package/lib/components/Icons/EChat.js +0 -1
  165. package/lib/components/Icons/EChat.js.map +1 -1
  166. package/lib/components/Icons/Ear.js +0 -1
  167. package/lib/components/Icons/Ear.js.map +1 -1
  168. package/lib/components/Icons/EarDeaf.js +0 -1
  169. package/lib/components/Icons/EarDeaf.js.map +1 -1
  170. package/lib/components/Icons/EarHearingAid.js +0 -1
  171. package/lib/components/Icons/EarHearingAid.js.map +1 -1
  172. package/lib/components/Icons/EarVolume.js +0 -1
  173. package/lib/components/Icons/EarVolume.js.map +1 -1
  174. package/lib/components/Icons/Edit.js +0 -1
  175. package/lib/components/Icons/Edit.js.map +1 -1
  176. package/lib/components/Icons/EmergencyCall.js +0 -1
  177. package/lib/components/Icons/EmergencyCall.js.map +1 -1
  178. package/lib/components/Icons/EmoticonAnnoyed.js +0 -1
  179. package/lib/components/Icons/EmoticonAnnoyed.js.map +1 -1
  180. package/lib/components/Icons/EmoticonDelighted.js +0 -1
  181. package/lib/components/Icons/EmoticonDelighted.js.map +1 -1
  182. package/lib/components/Icons/EmoticonDisappointed.js +0 -1
  183. package/lib/components/Icons/EmoticonDisappointed.js.map +1 -1
  184. package/lib/components/Icons/EmoticonHappy.js +0 -1
  185. package/lib/components/Icons/EmoticonHappy.js.map +1 -1
  186. package/lib/components/Icons/EmoticonMeh.js +0 -1
  187. package/lib/components/Icons/EmoticonMeh.js.map +1 -1
  188. package/lib/components/Icons/EnterFullScreen.js +0 -1
  189. package/lib/components/Icons/EnterFullScreen.js.map +1 -1
  190. package/lib/components/Icons/Envelope.js +0 -1
  191. package/lib/components/Icons/Envelope.js.map +1 -1
  192. package/lib/components/Icons/Eraser.js +0 -1
  193. package/lib/components/Icons/Eraser.js.map +1 -1
  194. package/lib/components/Icons/ErrorSignFill.js +0 -2
  195. package/lib/components/Icons/ErrorSignStroke.js +0 -1
  196. package/lib/components/Icons/ErrorSignStroke.js.map +1 -1
  197. package/lib/components/Icons/ExitFullScreen.js +0 -1
  198. package/lib/components/Icons/ExitFullScreen.js.map +1 -1
  199. package/lib/components/Icons/Eye.js +0 -1
  200. package/lib/components/Icons/Eye.js.map +1 -1
  201. package/lib/components/Icons/FallingLeaf.js +0 -1
  202. package/lib/components/Icons/FallingLeaf.js.map +1 -1
  203. package/lib/components/Icons/File.js +0 -1
  204. package/lib/components/Icons/File.js.map +1 -1
  205. package/lib/components/Icons/Filter.js +0 -1
  206. package/lib/components/Icons/Filter.js.map +1 -1
  207. package/lib/components/Icons/Form.js +0 -1
  208. package/lib/components/Icons/Form.js.map +1 -1
  209. package/lib/components/Icons/Forward.js +0 -2
  210. package/lib/components/Icons/Gallery.js +0 -1
  211. package/lib/components/Icons/Gallery.js.map +1 -1
  212. package/lib/components/Icons/Glasses.js +0 -1
  213. package/lib/components/Icons/Glasses.js.map +1 -1
  214. package/lib/components/Icons/Globe.js +0 -1
  215. package/lib/components/Icons/Globe.js.map +1 -1
  216. package/lib/components/Icons/Graph.js +0 -1
  217. package/lib/components/Icons/Graph.js.map +1 -1
  218. package/lib/components/Icons/Group.js +0 -1
  219. package/lib/components/Icons/Group.js.map +1 -1
  220. package/lib/components/Icons/GroupTwins.js +0 -1
  221. package/lib/components/Icons/GroupTwins.js.map +1 -1
  222. package/lib/components/Icons/HTMLFile.js +0 -1
  223. package/lib/components/Icons/HTMLFile.js.map +1 -1
  224. package/lib/components/Icons/HandsAndHeart.js +0 -1
  225. package/lib/components/Icons/HandsAndHeart.js.map +1 -1
  226. package/lib/components/Icons/HealthcarePerson.js +0 -1
  227. package/lib/components/Icons/HealthcarePerson.js.map +1 -1
  228. package/lib/components/Icons/HealthcarePersonell.js +0 -1
  229. package/lib/components/Icons/HealthcarePersonell.js.map +1 -1
  230. package/lib/components/Icons/HearingProtection.js +0 -1
  231. package/lib/components/Icons/HearingProtection.js.map +1 -1
  232. package/lib/components/Icons/Heart.js +0 -1
  233. package/lib/components/Icons/Heart.js.map +1 -1
  234. package/lib/components/Icons/HelpSign.js +0 -1
  235. package/lib/components/Icons/HelpSign.js.map +1 -1
  236. package/lib/components/Icons/History.js +0 -1
  237. package/lib/components/Icons/History.js.map +1 -1
  238. package/lib/components/Icons/Home.js +0 -1
  239. package/lib/components/Icons/Home.js.map +1 -1
  240. package/lib/components/Icons/HomeFill.js +0 -1
  241. package/lib/components/Icons/HomeFill.js.map +1 -1
  242. package/lib/components/Icons/Hospital.js +0 -1
  243. package/lib/components/Icons/Hospital.js.map +1 -1
  244. package/lib/components/Icons/Hourglass.js +0 -1
  245. package/lib/components/Icons/Hourglass.js.map +1 -1
  246. package/lib/components/Icons/InfoSignFill.js +0 -2
  247. package/lib/components/Icons/InfoSignStroke.js +0 -1
  248. package/lib/components/Icons/InfoSignStroke.js.map +1 -1
  249. package/lib/components/Icons/Journal.js +0 -1
  250. package/lib/components/Icons/Journal.js.map +1 -1
  251. package/lib/components/Icons/LegalDocument.js +0 -1
  252. package/lib/components/Icons/LegalDocument.js.map +1 -1
  253. package/lib/components/Icons/List.js +0 -1
  254. package/lib/components/Icons/List.js.map +1 -1
  255. package/lib/components/Icons/Location.js +0 -1
  256. package/lib/components/Icons/Location.js.map +1 -1
  257. package/lib/components/Icons/LocationFill.js +0 -1
  258. package/lib/components/Icons/LocationFill.js.map +1 -1
  259. package/lib/components/Icons/Lock.js +0 -1
  260. package/lib/components/Icons/Lock.js.map +1 -1
  261. package/lib/components/Icons/Login.js +0 -1
  262. package/lib/components/Icons/Login.js.map +1 -1
  263. package/lib/components/Icons/Logout.js +0 -1
  264. package/lib/components/Icons/Logout.js.map +1 -1
  265. package/lib/components/Icons/MaleDoctorCompact.js +0 -1
  266. package/lib/components/Icons/MaleDoctorCompact.js.map +1 -1
  267. package/lib/components/Icons/MaleDoctorCompactFill.js +0 -1
  268. package/lib/components/Icons/MaleDoctorCompactFill.js.map +1 -1
  269. package/lib/components/Icons/Medicine.js +0 -1
  270. package/lib/components/Icons/Medicine.js.map +1 -1
  271. package/lib/components/Icons/Menu.js +0 -1
  272. package/lib/components/Icons/Menu.js.map +1 -1
  273. package/lib/components/Icons/Minus.js +0 -1
  274. package/lib/components/Icons/Minus.js.map +1 -1
  275. package/lib/components/Icons/MobilePhone.js +0 -1
  276. package/lib/components/Icons/MobilePhone.js.map +1 -1
  277. package/lib/components/Icons/NoAccess.js +0 -1
  278. package/lib/components/Icons/NoAccess.js.map +1 -1
  279. package/lib/components/Icons/NoEye.js +0 -1
  280. package/lib/components/Icons/NoEye.js.map +1 -1
  281. package/lib/components/Icons/NoFilter.js +0 -1
  282. package/lib/components/Icons/NoFilter.js.map +1 -1
  283. package/lib/components/Icons/PaperPlane.js +0 -1
  284. package/lib/components/Icons/PaperPlane.js.map +1 -1
  285. package/lib/components/Icons/Pause.js +0 -1
  286. package/lib/components/Icons/Pause.js.map +1 -1
  287. package/lib/components/Icons/Pencil.js +0 -2
  288. package/lib/components/Icons/PersonCancel.js +0 -1
  289. package/lib/components/Icons/PersonCancel.js.map +1 -1
  290. package/lib/components/Icons/PersonalPlan.js +0 -1
  291. package/lib/components/Icons/PersonalPlan.js.map +1 -1
  292. package/lib/components/Icons/Play.js +0 -1
  293. package/lib/components/Icons/Play.js.map +1 -1
  294. package/lib/components/Icons/PlusLarge.js +0 -1
  295. package/lib/components/Icons/PlusLarge.js.map +1 -1
  296. package/lib/components/Icons/PlusSmall.js +0 -2
  297. package/lib/components/Icons/Printer.js +0 -1
  298. package/lib/components/Icons/Printer.js.map +1 -1
  299. package/lib/components/Icons/QrCode.js +0 -1
  300. package/lib/components/Icons/QrCode.js.map +1 -1
  301. package/lib/components/Icons/Receptionist.js +0 -1
  302. package/lib/components/Icons/Receptionist.js.map +1 -1
  303. package/lib/components/Icons/Referral.js +0 -1
  304. package/lib/components/Icons/Referral.js.map +1 -1
  305. package/lib/components/Icons/Refresh.js +0 -1
  306. package/lib/components/Icons/Refresh.js.map +1 -1
  307. package/lib/components/Icons/Reply.js +0 -1
  308. package/lib/components/Icons/Reply.js.map +1 -1
  309. package/lib/components/Icons/Save.js +0 -1
  310. package/lib/components/Icons/Save.js.map +1 -1
  311. package/lib/components/Icons/ScreenReader.js +0 -1
  312. package/lib/components/Icons/ScreenReader.js.map +1 -1
  313. package/lib/components/Icons/Search.js +0 -1
  314. package/lib/components/Icons/Search.js.map +1 -1
  315. package/lib/components/Icons/SectionSign.js +0 -1
  316. package/lib/components/Icons/SectionSign.js.map +1 -1
  317. package/lib/components/Icons/Settings.js +0 -1
  318. package/lib/components/Icons/Settings.js.map +1 -1
  319. package/lib/components/Icons/SettingsFill.js +0 -1
  320. package/lib/components/Icons/SettingsFill.js.map +1 -1
  321. package/lib/components/Icons/Share.js +0 -1
  322. package/lib/components/Icons/Share.js.map +1 -1
  323. package/lib/components/Icons/SortDown.js +0 -1
  324. package/lib/components/Icons/SortDown.js.map +1 -1
  325. package/lib/components/Icons/SortUp.js +0 -1
  326. package/lib/components/Icons/SortUp.js.map +1 -1
  327. package/lib/components/Icons/SpeechBubble.js +0 -1
  328. package/lib/components/Icons/SpeechBubble.js.map +1 -1
  329. package/lib/components/Icons/Stopwatch.js +0 -1
  330. package/lib/components/Icons/Stopwatch.js.map +1 -1
  331. package/lib/components/Icons/Sun.js +0 -1
  332. package/lib/components/Icons/Sun.js.map +1 -1
  333. package/lib/components/Icons/SupportingPerson.js +0 -1
  334. package/lib/components/Icons/SupportingPerson.js.map +1 -1
  335. package/lib/components/Icons/TimePassing.js +0 -1
  336. package/lib/components/Icons/TimePassing.js.map +1 -1
  337. package/lib/components/Icons/Tombstone.js +0 -1
  338. package/lib/components/Icons/Tombstone.js.map +1 -1
  339. package/lib/components/Icons/Toolbox.js +0 -1
  340. package/lib/components/Icons/Toolbox.js.map +1 -1
  341. package/lib/components/Icons/TrashCan.js +0 -1
  342. package/lib/components/Icons/TrashCan.js.map +1 -1
  343. package/lib/components/Icons/TreatmentAids.js +0 -1
  344. package/lib/components/Icons/TreatmentAids.js.map +1 -1
  345. package/lib/components/Icons/TriangleX.js +0 -2
  346. package/lib/components/Icons/Undo.js +0 -2
  347. package/lib/components/Icons/Upload.js +0 -1
  348. package/lib/components/Icons/Upload.js.map +1 -1
  349. package/lib/components/Icons/Vaccine.js +0 -1
  350. package/lib/components/Icons/Vaccine.js.map +1 -1
  351. package/lib/components/Icons/VerticalDots.js +0 -2
  352. package/lib/components/Icons/VideoCamera.js +0 -1
  353. package/lib/components/Icons/VideoCamera.js.map +1 -1
  354. package/lib/components/Icons/VideoChat.js +0 -1
  355. package/lib/components/Icons/VideoChat.js.map +1 -1
  356. package/lib/components/Icons/Wallet.js +0 -1
  357. package/lib/components/Icons/Wallet.js.map +1 -1
  358. package/lib/components/Icons/Watch.js +0 -2
  359. package/lib/components/Icons/X.js +0 -2
  360. package/lib/components/Icons/Zoom.js +0 -1
  361. package/lib/components/Icons/Zoom.js.map +1 -1
  362. package/lib/components/Icons/ZoomInLeft.js +0 -1
  363. package/lib/components/Icons/ZoomInLeft.js.map +1 -1
  364. package/lib/components/Icons/ZoomOutLeft.js +0 -1
  365. package/lib/components/Icons/ZoomOutLeft.js.map +1 -1
  366. package/lib/components/Illustration/index.js +0 -2
  367. package/lib/components/Illustrations/BabyMobile.js +0 -2
  368. package/lib/components/Illustrations/BabyMobile.js.map +1 -1
  369. package/lib/components/Illustrations/BabyMobileMedium.js +0 -3
  370. package/lib/components/Illustrations/Child.js +0 -2
  371. package/lib/components/Illustrations/Child.js.map +1 -1
  372. package/lib/components/Illustrations/ChildMedium.js +0 -3
  373. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +0 -2
  374. package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
  375. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js +0 -3
  376. package/lib/components/Illustrations/GiveBabyFood.js +0 -2
  377. package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
  378. package/lib/components/Illustrations/GiveBabyFoodMedium.js +0 -3
  379. package/lib/components/Illustrations/ReadLetters.js +0 -2
  380. package/lib/components/Illustrations/ReadLetters.js.map +1 -1
  381. package/lib/components/Illustrations/ReadLettersMedium.js +0 -3
  382. package/lib/components/Illustrations/Stroller.js +0 -2
  383. package/lib/components/Illustrations/Stroller.js.map +1 -1
  384. package/lib/components/Illustrations/StrollerMedium.js +0 -3
  385. package/lib/components/Illustrations/Support2.js +0 -2
  386. package/lib/components/Illustrations/Support2.js.map +1 -1
  387. package/lib/components/Illustrations/Support2Medium.js +0 -3
  388. package/lib/components/InfoTeaser/InfoTeaser.d.ts +2 -0
  389. package/lib/components/InfoTeaser/index.js +0 -8
  390. package/lib/components/InfoTeaser/styles.module.scss +0 -2
  391. package/lib/components/Input/Input.d.ts +2 -2
  392. package/lib/components/Input/index.js +0 -44
  393. package/lib/components/Label/Label.d.ts +1 -1
  394. package/lib/components/Label/index.js +0 -38
  395. package/lib/components/LazyIcon/index.js +0 -4
  396. package/lib/components/LazyIllustration/index.js +0 -6
  397. package/lib/components/LinkList/LinkList.d.ts +4 -3
  398. package/lib/components/LinkList/index.js +0 -53
  399. package/lib/components/LinkList/styles.module.scss +1 -0
  400. package/lib/components/List/index.js +0 -1
  401. package/lib/components/ListEditMode/index.js +0 -4
  402. package/lib/components/Loader/index.js +0 -1
  403. package/lib/components/Loader/index.js.map +1 -1
  404. package/lib/components/Logo/index.js +0 -4
  405. package/lib/components/Logo/index.js.map +1 -1
  406. package/lib/components/Modal/index.js +0 -21
  407. package/lib/components/Modal/index.js.map +1 -1
  408. package/lib/components/NotificationPanel/index.js +0 -28
  409. package/lib/components/NotificationPanel/index.js.map +1 -1
  410. package/lib/components/Panel/PanelTitle/index.js +0 -11
  411. package/lib/components/Panel/PanelTitle/styles.module.scss +0 -1
  412. package/lib/components/Panel/index.js +0 -31
  413. package/lib/components/Panel/index.js.map +1 -1
  414. package/lib/components/PanelList/PanelList.d.ts +6 -0
  415. package/lib/components/PanelList/index.js +3 -53
  416. package/lib/components/PanelList/index.js.map +1 -1
  417. package/lib/components/PanelListOld/index.js +0 -34
  418. package/lib/components/PanelListOld/index.js.map +1 -1
  419. package/lib/components/PanelOld/index.js +0 -35
  420. package/lib/components/PopMenu/index.js +0 -50
  421. package/lib/components/PopMenu/index.js.map +1 -1
  422. package/lib/components/PopOver/PopOver.d.ts +1 -1
  423. package/lib/components/PopOver/index.js +0 -3
  424. package/lib/components/Portal/index.js +0 -1
  425. package/lib/components/PromoPanel/index.js +0 -10
  426. package/lib/components/PromoPanel/index.js.map +1 -1
  427. package/lib/components/RadioButton/index.js +0 -43
  428. package/lib/components/Select/index.js +0 -43
  429. package/lib/components/Select/styles.module.scss +2 -0
  430. package/lib/components/ServiceMessage/index.js +0 -43
  431. package/lib/components/ServiceMessage/index.js.map +1 -1
  432. package/lib/components/Slider/index.js +0 -10
  433. package/lib/components/Spacer/index.js +0 -1
  434. package/lib/components/StatusDot/index.js +0 -33
  435. package/lib/components/StepButtons/index.js +0 -1
  436. package/lib/components/Stepper/index.js +0 -1
  437. package/lib/components/Stepper/index.js.map +1 -1
  438. package/lib/components/StickyNote/index.js +0 -3
  439. package/lib/components/StickyNote/index.js.map +1 -1
  440. package/lib/components/Table/TableBody/index.js +0 -13
  441. package/lib/components/Table/TableCell/index.js +0 -13
  442. package/lib/components/Table/TableExpandedRow/index.js +0 -29
  443. package/lib/components/Table/TableExpanderCell/index.js +0 -30
  444. package/lib/components/Table/TableHead/index.js +0 -13
  445. package/lib/components/Table/TableHeadCell/index.js +0 -16
  446. package/lib/components/Table/TableRow/index.js +0 -30
  447. package/lib/components/Table/index.js +0 -31
  448. package/lib/components/Table/index.js.map +1 -1
  449. package/lib/components/Tabs/TabList/index.js +0 -14
  450. package/lib/components/Tabs/index.js +0 -13
  451. package/lib/components/Tabs/index.js.map +1 -1
  452. package/lib/components/Tag/index.js +0 -2
  453. package/lib/components/Tag/index.js.map +1 -1
  454. package/lib/components/Textarea/Textarea.d.ts +1 -1
  455. package/lib/components/Textarea/index.js +0 -43
  456. package/lib/components/Tile/index.js +0 -2
  457. package/lib/components/Tile/index.js.map +1 -1
  458. package/lib/components/Title/index.js +0 -1
  459. package/lib/components/Toast/index.js +0 -10
  460. package/lib/components/Toast/index.js.map +1 -1
  461. package/lib/components/ToastList/index.js +0 -9
  462. package/lib/components/ToastList/index.js.map +1 -1
  463. package/lib/components/Toggle/index.js +1 -1
  464. package/lib/components/Toggle/index.js.map +1 -1
  465. package/lib/components/Validation/index.js +0 -51
  466. package/lib/components/Validation/index.js.map +1 -1
  467. package/lib/constants.d.ts +2 -1
  468. package/lib/constants2.js +1 -0
  469. package/lib/constants2.js.map +1 -1
  470. package/lib/floating-ui.react.js +65 -61
  471. package/lib/floating-ui.react.js.map +1 -1
  472. package/lib/hoc/withBreakpoint/index.js +0 -2
  473. package/lib/hoc/withBreakpoint/index.js.map +1 -1
  474. package/lib/hoc/withBreakpoint/withBreakpoint.js +0 -2
  475. package/lib/hooks/useBreakpoint.js +0 -1
  476. package/lib/hooks/useExpand.js +0 -1
  477. package/lib/hooks/useFocusToggle.js +0 -2
  478. package/lib/hooks/useFocusTrap.js +0 -3
  479. package/lib/hooks/useFocusableElements.js +0 -1
  480. package/lib/hooks/useIcons.js +0 -6
  481. package/lib/hooks/useIsMobileBreakpoint.js +0 -2
  482. package/lib/hooks/useIsVisible.js +0 -1
  483. package/lib/hooks/useLayoutEvent.js +0 -1
  484. package/lib/hooks/useReturnFocusOnUnmount.js +0 -2
  485. package/lib/hooks/useRovingFocus.js +0 -2
  486. package/lib/hooks/useSize.js +0 -1
  487. package/lib/hooks/useToggle.js +0 -1
  488. package/lib/index.js +0 -9
  489. package/lib/theme/currys/color.js +0 -4
  490. package/lib/theme/currys/index.js +0 -5
  491. package/lib/theme/currys/spacing.js +0 -1
  492. package/lib/theme/index.js +0 -3
  493. package/lib/utils/uuid.js +0 -1
  494. package/lib/uuid.js +1 -1
  495. package/package.json +4 -9
  496. package/lib/scss/_figma-tokens.scss +0 -68
  497. package/scss/_figma-tokens.scss +0 -68
@@ -1,31 +1,2 @@
1
- import "../../../environment.js";
2
- import "../../../constants2.js";
3
- import "../../../usePseudoClasses.js";
4
- import "../../../grid.js";
5
- import "../../../palette.js";
6
- import "../../../spacers.js";
7
- import "../../../theme.js";
8
- import "../../../color.js";
9
- import "../../../Icon.js";
10
- import "../../../_rolldown_dynamic_import_helper.js";
11
- import "../../../useIsServerSide.js";
12
- import "../../../LazyIcon.js";
13
- import "../../../component.js";
14
- import "../../../useIcons.js";
15
- import "../../../useBreakpoint.js";
16
- import "../../../useIsMobileBreakpoint.js";
17
- import "../../../ArrowRight.js";
18
- import "../../../Button.js";
19
- import "../../../accessibility.js";
20
- import "../../../useIntersectionObserver.js";
21
- import "../../../useIsVisible.js";
22
- import "../../../debounce.js";
23
- import "../../../useLayoutEvent.js";
24
- import "../../../useSize.js";
25
- import "../../../ChevronUp.js";
26
- import "../../../usestopPropagation.js";
27
- import "../../../HorizontalScroll.js";
28
- import "../../../device.js";
29
- import "../../../Table.js";
30
1
  import { n as TableExpandedRow, t as TableExpandedRow_default } from "../../../TableExpandedRow.js";
31
2
  export { TableExpandedRow, TableExpandedRow_default as default };
@@ -1,32 +1,2 @@
1
- import "../../../environment.js";
2
- import "../../../constants2.js";
3
- import "../../../usePseudoClasses.js";
4
- import "../../../grid.js";
5
- import "../../../palette.js";
6
- import "../../../spacers.js";
7
- import "../../../theme.js";
8
- import "../../../color.js";
9
- import "../../../Icon.js";
10
- import "../../../_rolldown_dynamic_import_helper.js";
11
- import "../../../useIsServerSide.js";
12
- import "../../../LazyIcon.js";
13
- import "../../../component.js";
14
- import "../../../useIcons.js";
15
- import "../../../useBreakpoint.js";
16
- import "../../../useIsMobileBreakpoint.js";
17
- import "../../../ArrowRight.js";
18
- import "../../../Button.js";
19
- import "../../../accessibility.js";
20
- import "../../../useIntersectionObserver.js";
21
- import "../../../useIsVisible.js";
22
- import "../../../debounce.js";
23
- import "../../../useLayoutEvent.js";
24
- import "../../../useSize.js";
25
- import "../../../ChevronDown.js";
26
- import "../../../ChevronUp.js";
27
- import "../../../usestopPropagation.js";
28
- import "../../../HorizontalScroll.js";
29
- import "../../../device.js";
30
- import "../../../Table.js";
31
1
  import { n as TableExpanderCell, t as TableExpanderCell_default } from "../../../TableExpanderCell.js";
32
2
  export { TableExpanderCell, TableExpanderCell_default as default };
@@ -1,15 +1,2 @@
1
- import "../../../constants2.js";
2
- import "../../../grid.js";
3
- import "../../../useBreakpoint.js";
4
- import "../../../accessibility.js";
5
- import "../../../useIntersectionObserver.js";
6
- import "../../../useIsVisible.js";
7
- import "../../../debounce.js";
8
- import "../../../useLayoutEvent.js";
9
- import "../../../useSize.js";
10
- import "../../../usestopPropagation.js";
11
- import "../../../HorizontalScroll.js";
12
- import "../../../device.js";
13
- import "../../../Table.js";
14
1
  import { n as HeaderCategory, r as TableHead, t as TableHead_default } from "../../../TableHead.js";
15
2
  export { HeaderCategory, TableHead, TableHead_default as default };
@@ -1,18 +1,2 @@
1
- import "../../../constants2.js";
2
- import "../../../grid.js";
3
- import "../../../Icon.js";
4
- import "../../../useBreakpoint.js";
5
- import "../../../accessibility.js";
6
- import "../../../useIntersectionObserver.js";
7
- import "../../../useIsVisible.js";
8
- import "../../../debounce.js";
9
- import "../../../useLayoutEvent.js";
10
- import "../../../useSize.js";
11
- import "../../../usestopPropagation.js";
12
- import "../../../HorizontalScroll.js";
13
- import "../../../ArrowDown.js";
14
- import "../../../ArrowUp.js";
15
- import "../../../device.js";
16
- import "../../../Table.js";
17
1
  import { n as SortDirection, r as TableHeadCell, t as TableHeadCell_default } from "../../../TableHeadCell.js";
18
2
  export { SortDirection, TableHeadCell, TableHeadCell_default as default };
@@ -1,32 +1,2 @@
1
- import "../../../environment.js";
2
- import "../../../constants2.js";
3
- import "../../../usePseudoClasses.js";
4
- import "../../../grid.js";
5
- import "../../../palette.js";
6
- import "../../../spacers.js";
7
- import "../../../theme.js";
8
- import "../../../color.js";
9
- import "../../../Icon.js";
10
- import "../../../_rolldown_dynamic_import_helper.js";
11
- import "../../../useIsServerSide.js";
12
- import "../../../LazyIcon.js";
13
- import "../../../component.js";
14
- import "../../../useIcons.js";
15
- import "../../../useBreakpoint.js";
16
- import "../../../useIsMobileBreakpoint.js";
17
- import "../../../ArrowRight.js";
18
- import "../../../Button.js";
19
- import "../../../accessibility.js";
20
- import "../../../useIntersectionObserver.js";
21
- import "../../../useIsVisible.js";
22
- import "../../../debounce.js";
23
- import "../../../useLayoutEvent.js";
24
- import "../../../useSize.js";
25
- import "../../../ChevronDown.js";
26
- import "../../../ChevronUp.js";
27
- import "../../../usestopPropagation.js";
28
- import "../../../HorizontalScroll.js";
29
- import "../../../device.js";
30
- import "../../../Table.js";
31
1
  import { n as TableRow, t as TableRow_default } from "../../../TableRow.js";
32
2
  export { TableRow, TableRow_default as default };
@@ -1,34 +1,3 @@
1
- import "../../environment.js";
2
- import "../../constants2.js";
3
- import "../../usePseudoClasses.js";
4
- import "../../grid.js";
5
- import "../../palette.js";
6
- import "../../spacers.js";
7
- import "../../theme.js";
8
- import "../../color.js";
9
- import "../../Icon.js";
10
- import "../../_rolldown_dynamic_import_helper.js";
11
- import "../../useIsServerSide.js";
12
- import "../../LazyIcon.js";
13
- import "../../component.js";
14
- import "../../useIcons.js";
15
- import "../../useBreakpoint.js";
16
- import "../../useIsMobileBreakpoint.js";
17
- import "../../ArrowRight.js";
18
- import "../../Button.js";
19
- import "../../accessibility.js";
20
- import "../../useIntersectionObserver.js";
21
- import "../../useIsVisible.js";
22
- import "../../debounce.js";
23
- import "../../useLayoutEvent.js";
24
- import "../../useSize.js";
25
- import "../../ChevronDown.js";
26
- import "../../ChevronUp.js";
27
- import "../../usestopPropagation.js";
28
- import "../../HorizontalScroll.js";
29
- import "../../ArrowDown.js";
30
- import "../../ArrowUp.js";
31
- import "../../device.js";
32
1
  import { a as simpleConfig, i as defaultConfig, n as ResponsiveTableVariant, r as Table, t as ModeType } from "../../Table.js";
33
2
  import { n as TableBody } from "../../TableBody.js";
34
3
  import { n as TableCell, r as TextAlign } from "../../TableCell.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Table/index.ts"],"sourcesContent":["import { Table } from './Table';\n\nexport { TableBody } from './TableBody';\nexport { TableCell, TextAlign } from './TableCell';\nexport { TableExpandedRow } from './TableExpandedRow';\nexport { TableExpanderCell } from './TableExpanderCell';\nexport { TableHead, HeaderCategory } from './TableHead';\nexport { TableHeadCell, SortDirection } from './TableHeadCell';\nexport { TableRow } from './TableRow';\n\nexport * from './Table';\n\nexport default Table;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAA,gBAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Table/index.ts"],"sourcesContent":["import { Table } from './Table';\n\nexport { TableBody } from './TableBody';\nexport { TableCell, TextAlign } from './TableCell';\nexport { TableExpandedRow } from './TableExpandedRow';\nexport { TableExpanderCell } from './TableExpanderCell';\nexport { TableHead, HeaderCategory } from './TableHead';\nexport { TableHeadCell, SortDirection } from './TableHeadCell';\nexport { TableRow } from './TableRow';\n\nexport * from './Table';\n\nexport default Table;\n"],"mappings":";;;;;;;;AAYA,IAAA,gBAAe"}
@@ -1,16 +1,2 @@
1
- import "../../../constants2.js";
2
- import "../../../usePseudoClasses.js";
3
- import "../../../palette.js";
4
- import "../../../Icon.js";
5
- import "../../../_rolldown_dynamic_import_helper.js";
6
- import "../../../useIsServerSide.js";
7
- import "../../../LazyIcon.js";
8
- import "../../../component.js";
9
- import "../../../useIntersectionObserver.js";
10
- import "../../../useIsVisible.js";
11
- import "../../../useKeyboardEvent.js";
12
- import "../../../ChevronLeft.js";
13
- import "../../../ChevronRight.js";
14
1
  import { t as TabList_default } from "../../../TabList.js";
15
- import "../../../useRovingFocus.js";
16
2
  export { TabList_default as default };
@@ -1,19 +1,6 @@
1
1
  import { s as LanguageLocales } from "../../constants2.js";
2
- import "../../usePseudoClasses.js";
3
- import "../../palette.js";
4
- import "../../Icon.js";
5
2
  import { r as useLanguage } from "../../language.js";
6
- import "../../_rolldown_dynamic_import_helper.js";
7
- import "../../useIsServerSide.js";
8
- import "../../LazyIcon.js";
9
- import "../../component.js";
10
- import "../../useIntersectionObserver.js";
11
- import "../../useIsVisible.js";
12
- import "../../useKeyboardEvent.js";
13
- import "../../ChevronLeft.js";
14
- import "../../ChevronRight.js";
15
3
  import { n as Tab_default, t as TabList_default } from "../../TabList.js";
16
- import "../../useRovingFocus.js";
17
4
  import { t as TabPanel_default } from "../../TabPanel.js";
18
5
  import React, { useRef, useState } from "react";
19
6
  import classNames from "classnames";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["TabsRoot: React.FC<TabsProps>","mergedResources: HNDesignsystemTabs","onColorUsed: TabsOnColor"],"sources":["../../../src/resources/HN.Designsystem.Tabs.en-GB.json","../../../src/resources/HN.Designsystem.Tabs.nb-NO.json","../../../src/components/Tabs/resourceHelper.ts","../../../src/components/Tabs/Tabs.tsx","../../../src/components/Tabs/index.ts"],"sourcesContent":["{\n \"ariaLabelRightButton\": \"Scroll right\",\n \"ariaLabelLeftButton\": \"Scroll left\"\n}\n","{\n \"ariaLabelRightButton\": \"Scroll til høyre\",\n \"ariaLabelLeftButton\": \"Scroll til venstre\"\n}\n","import { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Tabs.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Tabs.nb-NO.json';\nimport { HNDesignsystemTabs } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemTabs => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport Tab from './Tab';\nimport TabList from './TabList';\nimport TabPanel from './TabPanel';\nimport { LanguageLocales } from '../../constants';\nimport { HNDesignsystemTabs } from '../../resources/Resources';\nimport designsystemlayout from '../../scss/layout.module.scss';\nimport { PaletteNames } from '../../theme/palette';\nimport { useLanguage } from '../../utils/language';\n\nimport styles from './styles.module.scss';\n\nexport type { TabProps } from './Tab';\nexport type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;\nexport type TabsOnColor = 'onblueberry' | 'onneutral' | 'onwhite';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n /** Controlled state for Tabs component */\n activeTab?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the color of the tabs. Default: white */\n color?: TabsColors;\n /** Sets wether the component should use the container-breakout class. Default: true */\n containerBreakout?: boolean;\n /** Sets the background color of the tabs. Can only be used when the color is set to white. Default: onwhite */\n onColor?: TabsOnColor;\n /** Whether the tab list should be sticky */\n sticky?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** @deprecated Sets aria label on the \"scroll to the right\" button in TabList */\n ariaLabelRightButton?: string;\n /** @deprecated Sets aria label on the \"scroll to the left\" button in TabList */\n ariaLabelLeftButton?: string;\n /** Resources for component */\n resources?: Partial<HNDesignsystemTabs>;\n /** Overrides the default z-index of the tabs header */\n zIndex?: number;\n}\n\nexport const TabsRoot: React.FC<TabsProps> = ({\n activeTab,\n children,\n className,\n color = 'white',\n containerBreakout = true,\n onColor = 'onwhite',\n sticky = true,\n testId,\n ariaLabelRightButton,\n ariaLabelLeftButton,\n resources,\n zIndex,\n}) => {\n const isControlled = activeTab !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(0);\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabPanelRef = useRef<HTMLDivElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemTabs = {\n ...defaultResources,\n ...resources,\n ariaLabelRightButton: ariaLabelRightButton || resources?.ariaLabelRightButton || defaultResources.ariaLabelRightButton,\n ariaLabelLeftButton: ariaLabelLeftButton || resources?.ariaLabelLeftButton || defaultResources.ariaLabelLeftButton,\n };\n\n let onColorUsed: TabsOnColor = 'onwhite';\n if (color === 'white') {\n onColorUsed = onColor;\n }\n\n const onValueChange = (newValue: number): void => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n };\n\n const activeTabIndex = isControlled ? activeTab : uncontrolledValue;\n\n return (\n <div className={classNames(className, containerBreakout && designsystemlayout['container-breakout'])} data-testid={testId}>\n <div\n ref={tabListRef}\n className={classNames(styles['tab-list-wrapper'], {\n [styles['tab-list-wrapper--sticky']]: sticky,\n })}\n style={{\n zIndex: zIndex,\n }}\n >\n <TabList\n onTabListClick={(index: number) => onValueChange(index)}\n selectedTab={activeTabIndex}\n color={color}\n onColor={onColorUsed}\n ariaLabelLeftButton={mergedResources.ariaLabelLeftButton}\n ariaLabelRightButton={mergedResources.ariaLabelRightButton}\n >\n {children}\n </TabList>\n <div className={classNames(styles['panel-wrapper'], styles[`panel-wrapper--${color}`])}></div>\n </div>\n <div ref={tabsRef} style={{ marginTop: '-50px' }}>\n <TabPanel ref={tabPanelRef} color={color} isFirst={activeTabIndex == 0}>\n {React.Children.toArray(children)[activeTabIndex]}\n </TabPanel>\n </div>\n </div>\n );\n};\n\ntype TabsComponent = typeof TabsRoot & {\n Tab: typeof Tab;\n};\nconst Tabs = TabsRoot as TabsComponent;\nTabsRoot.displayName = 'Tabs';\nTabs.displayName = 'Tabs';\nTabs.Tab = Tab;\nTabs.Tab.displayName = 'Tabs.Tab';\n\nexport default Tabs;\n","import Tabs from './Tabs';\nexport * from './Tabs';\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEKA,MAAa,gBAAgB,aAAkD;AAC7E,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACmCb,MAAaA,YAAiC,EAC5C,WACA,UACA,WACA,QAAQ,SACR,oBAAoB,MACpB,UAAU,WACV,SAAS,MACT,QACA,sBAAA,wBACA,qBAAA,uBACA,WACA,aACI;CACJ,MAAM,eAAe,cAAc,KAAA;CACnC,MAAM,CAAC,mBAAmB,wBAAwB,SAAS,EAAE;CAC7D,MAAM,UAAU,OAAuB,KAAK;CAC5C,MAAM,cAAc,OAAuB,KAAK;CAChD,MAAM,aAAa,OAAuB,KAAK;CAC/C,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAC5E,MAAM,mBAAmB,aAAa,SAAS;CAE/C,MAAMC,kBAAsC;EAC1C,GAAG;EACH,GAAG;EACH,sBAAsB,0BAAwB,WAAW,wBAAwB,iBAAiB;EAClG,qBAAqB,yBAAuB,WAAW,uBAAuB,iBAAiB;EAChG;CAED,IAAIC,cAA2B;AAC/B,KAAI,UAAU,QACZ,eAAc;CAGhB,MAAM,iBAAiB,aAA2B;AAChD,MAAI,CAAC,aACH,sBAAqB,SAAS;;CAIlC,MAAM,iBAAiB,eAAe,YAAY;AAElD,QACE,qBAAC,OAAA;EAAI,WAAW,WAAW,WAAW,qBAAqB,mBAAmB,sBAAsB;EAAE,eAAa;aACjH,qBAAC,OAAA;GACC,KAAK;GACL,WAAW,WAAW,OAAO,qBAAqB,GAC/C,OAAO,8BAA8B,QACvC,CAAC;GACF,OAAO,EACG,QACT;cAED,oBAAC,iBAAA;IACC,iBAAiB,UAAkB,cAAc,MAAM;IACvD,aAAa;IACN;IACP,SAAS;IACT,qBAAqB,gBAAgB;IACrC,sBAAsB,gBAAgB;IAErC;KACO,EACV,oBAAC,OAAA,EAAI,WAAW,WAAW,OAAO,kBAAkB,OAAO,kBAAkB,SAAS,EAAA,CAAQ,CAAA;IAC1F,EACN,oBAAC,OAAA;GAAI,KAAK;GAAS,OAAO,EAAE,WAAW,SAAS;aAC9C,oBAAC,kBAAA;IAAS,KAAK;IAAoB;IAAO,SAAS,kBAAkB;cAClE,MAAM,SAAS,QAAQ,SAAS,CAAC;KACzB;IACP,CAAA;GACF;;AAOV,IAAM,OAAO;AACb,SAAS,cAAc;AACvB,KAAK,cAAc;AACnB,KAAK,MAAM;AACX,KAAK,IAAI,cAAc;AC7HvB,IAAA,eD+He"}
1
+ {"version":3,"file":"index.js","names":["TabsRoot: React.FC<TabsProps>","mergedResources: HNDesignsystemTabs","onColorUsed: TabsOnColor"],"sources":["../../../src/resources/HN.Designsystem.Tabs.en-GB.json","../../../src/resources/HN.Designsystem.Tabs.nb-NO.json","../../../src/components/Tabs/resourceHelper.ts","../../../src/components/Tabs/Tabs.tsx","../../../src/components/Tabs/index.ts"],"sourcesContent":["{\n \"ariaLabelRightButton\": \"Scroll right\",\n \"ariaLabelLeftButton\": \"Scroll left\"\n}\n","{\n \"ariaLabelRightButton\": \"Scroll til høyre\",\n \"ariaLabelLeftButton\": \"Scroll til venstre\"\n}\n","import { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Tabs.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Tabs.nb-NO.json';\nimport { HNDesignsystemTabs } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemTabs => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport Tab from './Tab';\nimport TabList from './TabList';\nimport TabPanel from './TabPanel';\nimport { LanguageLocales } from '../../constants';\nimport { HNDesignsystemTabs } from '../../resources/Resources';\nimport designsystemlayout from '../../scss/layout.module.scss';\nimport { PaletteNames } from '../../theme/palette';\nimport { useLanguage } from '../../utils/language';\n\nimport styles from './styles.module.scss';\n\nexport type { TabProps } from './Tab';\nexport type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;\nexport type TabsOnColor = 'onblueberry' | 'onneutral' | 'onwhite';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n /** Controlled state for Tabs component */\n activeTab?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the color of the tabs. Default: white */\n color?: TabsColors;\n /** Sets wether the component should use the container-breakout class. Default: true */\n containerBreakout?: boolean;\n /** Sets the background color of the tabs. Can only be used when the color is set to white. Default: onwhite */\n onColor?: TabsOnColor;\n /** Whether the tab list should be sticky */\n sticky?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** @deprecated Sets aria label on the \"scroll to the right\" button in TabList */\n ariaLabelRightButton?: string;\n /** @deprecated Sets aria label on the \"scroll to the left\" button in TabList */\n ariaLabelLeftButton?: string;\n /** Resources for component */\n resources?: Partial<HNDesignsystemTabs>;\n /** Overrides the default z-index of the tabs header */\n zIndex?: number;\n}\n\nexport const TabsRoot: React.FC<TabsProps> = ({\n activeTab,\n children,\n className,\n color = 'white',\n containerBreakout = true,\n onColor = 'onwhite',\n sticky = true,\n testId,\n ariaLabelRightButton,\n ariaLabelLeftButton,\n resources,\n zIndex,\n}) => {\n const isControlled = activeTab !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(0);\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabPanelRef = useRef<HTMLDivElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemTabs = {\n ...defaultResources,\n ...resources,\n ariaLabelRightButton: ariaLabelRightButton || resources?.ariaLabelRightButton || defaultResources.ariaLabelRightButton,\n ariaLabelLeftButton: ariaLabelLeftButton || resources?.ariaLabelLeftButton || defaultResources.ariaLabelLeftButton,\n };\n\n let onColorUsed: TabsOnColor = 'onwhite';\n if (color === 'white') {\n onColorUsed = onColor;\n }\n\n const onValueChange = (newValue: number): void => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n };\n\n const activeTabIndex = isControlled ? activeTab : uncontrolledValue;\n\n return (\n <div className={classNames(className, containerBreakout && designsystemlayout['container-breakout'])} data-testid={testId}>\n <div\n ref={tabListRef}\n className={classNames(styles['tab-list-wrapper'], {\n [styles['tab-list-wrapper--sticky']]: sticky,\n })}\n style={{\n zIndex: zIndex,\n }}\n >\n <TabList\n onTabListClick={(index: number) => onValueChange(index)}\n selectedTab={activeTabIndex}\n color={color}\n onColor={onColorUsed}\n ariaLabelLeftButton={mergedResources.ariaLabelLeftButton}\n ariaLabelRightButton={mergedResources.ariaLabelRightButton}\n >\n {children}\n </TabList>\n <div className={classNames(styles['panel-wrapper'], styles[`panel-wrapper--${color}`])}></div>\n </div>\n <div ref={tabsRef} style={{ marginTop: '-50px' }}>\n <TabPanel ref={tabPanelRef} color={color} isFirst={activeTabIndex == 0}>\n {React.Children.toArray(children)[activeTabIndex]}\n </TabPanel>\n </div>\n </div>\n );\n};\n\ntype TabsComponent = typeof TabsRoot & {\n Tab: typeof Tab;\n};\nconst Tabs = TabsRoot as TabsComponent;\nTabsRoot.displayName = 'Tabs';\nTabs.displayName = 'Tabs';\nTabs.Tab = Tab;\nTabs.Tab.displayName = 'Tabs.Tab';\n\nexport default Tabs;\n","import Tabs from './Tabs';\nexport * from './Tabs';\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;;;;;;;AEKA,MAAa,gBAAgB,aAAkD;AAC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AAS,OAAO,EAAE,WAAW,SAAS;aAC9C,oBAAC,kBAAA;IAAS,KAAK;IAAoB;IAAO,SAAS,kBAAkB;cAClE,MAAM,SAAS,QAAQ,SAAS,CAAC;KACzB;IACP,CAAA;GACF;;AAOV,IAAM,OAAO;AACb,SAAS,cAAc;AACvB,KAAK,cAAc;AACnB,KAAK,MAAM;AACX,KAAK,IAAI,cAAc;AC7HvB,IAAA,eD+He"}
@@ -1,8 +1,6 @@
1
1
  import { a as IconSize, n as AnalyticsId } from "../../constants2.js";
2
2
  import { t as palette } from "../../palette.js";
3
3
  import { t as Icon_default } from "../../Icon.js";
4
- import "../../_rolldown_dynamic_import_helper.js";
5
- import "../../useIsServerSide.js";
6
4
  import { t as LazyIcon_default } from "../../LazyIcon.js";
7
5
  import React from "react";
8
6
  import classNames from "classnames";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Tag: React.FC<TagProps>"],"sources":["../../../src/components/Tag/Tag.tsx","../../../src/components/Tag/index.ts"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { palette, PaletteNames } from '../../theme/palette';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport enum TagSize {\n medium = 'medium',\n large = 'large',\n}\n\nexport enum TagVariant {\n normal = 'normal',\n oncolor = 'oncolor',\n emphasised = 'emphasised',\n}\n\nexport type TagColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'cherry' | 'banana' | 'kiwi' | 'plum'>;\n\nexport interface TagProps {\n /** Sets the text of the tag */\n children: string;\n /** Sets the size of the tag. Default: medium */\n size?: keyof typeof TagSize;\n /** Sets the background of the tag. Default: blueberry */\n color?: TagColors;\n /** Adds an icon to the tag. */\n svgIcon?: SvgIcon | IconName;\n /* Changes the appearance of the tag. Default: normal */\n variant?: keyof typeof TagVariant;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\nconst Tag: React.FC<TagProps> = props => {\n const { children, size = TagSize.medium, color = 'blueberry', svgIcon, variant = 'normal', testId } = props;\n\n const tagClasses = cn(styles.tag, styles[`tag--${size}`], styles[`tag--${color}`], {\n [styles['tag--has-icon']]: svgIcon,\n [styles['tag--emphasised']]: variant == TagVariant.emphasised,\n });\n\n return (\n <span className={tagClasses} data-testid={testId} data-analyticsid={AnalyticsId.Tag}>\n {svgIcon &&\n (typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ) : (\n <Icon svgIcon={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ))}\n {children}\n </span>\n );\n};\n\nexport default Tag;\n","import Tag from './Tag';\nexport * from './Tag';\nexport default Tag;\n"],"mappings":";;;;;;;;;;AAYA,IAAY,UAAA,yBAAA,WAAL;AACL,WAAA,YAAA;AACA,WAAA,WAAA;;;AAGF,IAAY,aAAA,yBAAA,cAAL;AACL,cAAA,YAAA;AACA,cAAA,aAAA;AACA,cAAA,gBAAA;;;AAoBF,IAAMA,OAA0B,UAAS;CACvC,MAAM,EAAE,UAAU,OAAO,QAAQ,QAAQ,QAAQ,aAAa,SAAS,UAAU,UAAU,WAAW;AAOtG,QACE,qBAAC,QAAA;EAAK,WANW,WAAG,OAAO,KAAK,OAAO,QAAQ,SAAS,OAAO,QAAQ,UAAU;IAChF,OAAO,mBAAmB;IAC1B,OAAO,qBAAqB,WAAW,WAAW;GACpD,CAAC;EAG6B,eAAa;EAAQ,oBAAkB,YAAY;aAC7E,YACE,OAAO,YAAY,WAClB,oBAAC,kBAAA;GAAS,UAAU;GAAS,MAAM,SAAS;GAAS,OAAO,QAAQ,GAAG,MAAM;GAAO,WAAW,OAAO;IAAa,GAEnH,oBAAC,cAAA;GAAc;GAAS,MAAM,SAAS;GAAS,OAAO,QAAQ,GAAG,MAAM;GAAO,WAAW,OAAO;IAAa,GAEjH,SAAA;GACI;;ACvDX,IAAA,cD2De"}
1
+ {"version":3,"file":"index.js","names":["Tag: React.FC<TagProps>"],"sources":["../../../src/components/Tag/Tag.tsx","../../../src/components/Tag/index.ts"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { palette, PaletteNames } from '../../theme/palette';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport enum TagSize {\n medium = 'medium',\n large = 'large',\n}\n\nexport enum TagVariant {\n normal = 'normal',\n oncolor = 'oncolor',\n emphasised = 'emphasised',\n}\n\nexport type TagColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'cherry' | 'banana' | 'kiwi' | 'plum'>;\n\nexport interface TagProps {\n /** Sets the text of the tag */\n children: string;\n /** Sets the size of the tag. Default: medium */\n size?: keyof typeof TagSize;\n /** Sets the background of the tag. Default: blueberry */\n color?: TagColors;\n /** Adds an icon to the tag. */\n svgIcon?: SvgIcon | IconName;\n /* Changes the appearance of the tag. Default: normal */\n variant?: keyof typeof TagVariant;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\nconst Tag: React.FC<TagProps> = props => {\n const { children, size = TagSize.medium, color = 'blueberry', svgIcon, variant = 'normal', testId } = props;\n\n const tagClasses = cn(styles.tag, styles[`tag--${size}`], styles[`tag--${color}`], {\n [styles['tag--has-icon']]: svgIcon,\n [styles['tag--emphasised']]: variant == TagVariant.emphasised,\n });\n\n return (\n <span className={tagClasses} data-testid={testId} data-analyticsid={AnalyticsId.Tag}>\n {svgIcon &&\n (typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ) : (\n <Icon svgIcon={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ))}\n {children}\n </span>\n );\n};\n\nexport default Tag;\n","import Tag from './Tag';\nexport * from './Tag';\nexport default Tag;\n"],"mappings":";;;;;;;;AAYA,IAAY,UAAA,yBAAA,WAAL;AACL,WAAA,YAAA;AACA,WAAA,WAAA;;;AAGF,IAAY,aAAA,yBAAA,cAAL;AACL,cAAA,YAAA;AACA,cAAA,aAAA;AACA,cAAA,gBAAA;;;AAoBF,IAAMA,OAA0B,UAAS;CACvC,MAAM,EAAE,UAAU,OAAO,QAAQ,QAAQ,QAAQ,aAAa,SAAS,UAAU,UAAU,WAAW;AAOtG,QACE,qBAAC,QAAA;EAAK,WANW,WAAG,OAAO,KAAK,OAAO,QAAQ,SAAS,OAAO,QAAQ,UAAU;IAChF,OAAO,mBAAmB;IAC1B,OAAO,qBAAqB,WAAW,WAAW;GACpD,CAAC;EAG6B,eAAa;EAAQ,oBAAkB,YAAY;aAC7E,YACE,OAAO,YAAY,WAClB,oBAAC,kBAAA;GAAS,UAAU;GAAS,MAAM,SAAS;GAAS,OAAO,QAAQ,GAAG,MAAM;GAAO,WAAW,OAAO;IAAa,GAEnH,oBAAC,cAAA;GAAc;GAAS,MAAM,SAAS;GAAS,OAAO,QAAQ,GAAG,MAAM;GAAO,WAAW,OAAO;IAAa,GAEjH,SAAA;GACI;;ACvDX,IAAA,cD2De"}
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { FormOnColor } from '../../constants';
3
2
  import { HNDesignsystemTextArea } from '../../resources/Resources';
3
+ import { FormOnColor } from '../../constants';
4
4
  import { ErrorWrapperClassNameProps } from '../ErrorWrapper';
5
5
  export interface TextareaProps extends ErrorWrapperClassNameProps, Pick<React.InputHTMLAttributes<HTMLTextAreaElement>, 'aria-describedby' | 'autoFocus' | 'disabled' | 'name' | 'autoComplete' | 'placeholder' | 'readOnly' | 'required' | 'defaultValue' | 'onChange' | 'value'> {
6
6
  /** max character limit in textarea */
@@ -1,45 +1,2 @@
1
- import "../../uuid.js";
2
- import "../../environment.js";
3
- import "../../constants2.js";
4
- import "../../usePseudoClasses.js";
5
- import "../../grid.js";
6
- import "../../palette.js";
7
- import "../../spacers.js";
8
- import "../../theme.js";
9
- import "../../color.js";
10
- import "../../spacing.js";
11
- import "../../currys.js";
12
- import "../../Icon.js";
13
- import "../../language.js";
14
- import "../../_rolldown_dynamic_import_helper.js";
15
- import "../../useIsServerSide.js";
16
- import "../../LazyIcon.js";
17
- import "../../component.js";
18
- import "../../useBreakpoint.js";
19
- import "../../useIdWithFallback.js";
20
- import "../../accessibility.js";
21
- import "../../ErrorWrapper.js";
22
- import "../../Spacer.js";
23
- import "../../Label.js";
24
- import "../../FormFieldTag.js";
25
- import "../../useElementList.js";
26
- import "../../useFocusableElements.js";
27
- import "../../useFocusToggle.js";
28
- import "../../focus.js";
29
- import "../../useFocusTrap.js";
30
- import "../../useIntersectionObserver.js";
31
- import "../../useIsVisible.js";
32
- import "../../debounce.js";
33
- import "../../useLayoutEvent.js";
34
- import "../../usePrevious.js";
35
- import "../../useSize.js";
36
- import "../../useResizeObserver.js";
37
- import "../../useToggle.js";
38
- import "../../useKeyboardEvent.js";
39
- import "../../useOutsideEvent.js";
40
- import "../../mobile.js";
41
- import "../../src.js";
42
- import "../../StatusDot.js";
43
- import "../../MaxCharacters.js";
44
1
  import { t as Textarea_default } from "../../Textarea.js";
45
2
  export { Textarea_default as default };
@@ -1,8 +1,6 @@
1
1
  import { a as IconSize, n as AnalyticsId } from "../../constants2.js";
2
2
  import { t as usePseudoClasses } from "../../usePseudoClasses.js";
3
- import "../../grid.js";
4
3
  import { n as mergeRefs } from "../../refs.js";
5
- import "../../Icon.js";
6
4
  import { n as useBreakpoint, t as Breakpoint } from "../../useBreakpoint.js";
7
5
  import React from "react";
8
6
  import classNames from "classnames";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Tile/Tile.tsx","../../../src/components/Tile/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { TitleTags } from './../Title/Title';\nimport { useBreakpoint, Breakpoint } from '../../hooks/useBreakpoint';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../utils/refs';\nimport { IconSize } from '../Icon';\n\nimport tileStyles from './styles.module.scss';\n\nexport type TileVariants = 'normal' | 'compact';\n\ninterface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /**\tSets the icon to be displayed inside the tile. */\n icon: React.ReactElement;\n /**\tSets the title to be displayed inside the tile. */\n title: React.ReactElement;\n /** Toggles the highlighted style of the tile. */\n highlighted?: boolean;\n /** Sets the description to be displayed inside the tile. */\n description?: string;\n /** Sets a fixed max and min width for the tile. */\n fixed?: boolean;\n /** Sets the visual variant of the component */\n variant?: TileVariants;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface TileTitleProps {\n children: React.ReactNode;\n className?: string;\n htmlMarkup?: TitleTags;\n highlighted?: boolean;\n compact?: boolean;\n}\n\nexport interface TileCompound extends React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLAnchorElement>> {\n Title: React.ForwardRefExoticComponent<TileTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n}\n\nconst Title = React.forwardRef<HTMLHeadingElement, TileTitleProps>((props, ref) => {\n const { compact, children, className, htmlMarkup = 'span', highlighted } = props;\n const titleClasses = classNames(\n tileStyles['tile__title'],\n {\n [tileStyles['tile__title--highlighted']]: highlighted,\n [tileStyles['tile__title--compact']]: compact,\n },\n className\n );\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={titleClasses} ref={ref}>\n {children}\n </CustomTag>\n );\n});\n\nTitle.displayName = 'Title';\n\nexport const Tile = React.forwardRef<HTMLAnchorElement, TileProps>((props, ref) => {\n const {\n children,\n icon,\n title,\n className = '',\n description,\n fixed = false,\n highlighted = false,\n testId,\n target,\n rel,\n variant = 'normal',\n href,\n onClick,\n } = props;\n const { refObject, isHovered } = usePseudoClasses<HTMLAnchorElement>();\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < Breakpoint.md;\n const compact = variant === 'compact';\n const tileClasses = classNames(\n tileStyles.tile,\n {\n [tileStyles['tile--fixed']]: fixed,\n [tileStyles['tile--compact']]: compact,\n [tileStyles['tile--highlighted']]: highlighted,\n },\n className\n );\n const tileTitleWrapperClasses = classNames(tileStyles['title-wrapper'], {\n [tileStyles['title-wrapper--compact']]: compact,\n });\n\n return (\n <a\n ref={mergeRefs([ref, refObject])}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : rel}\n className={tileClasses}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Tile}\n onClick={onClick}\n >\n <div className={tileTitleWrapperClasses}>\n {React.cloneElement(icon, { size: mobile ? IconSize.Small : IconSize.Medium, isHovered, color: highlighted ? 'white' : 'black' })}\n {React.cloneElement(title, { highlighted: highlighted, compact: compact })}\n </div>\n {!compact && !mobile && <p className={tileStyles.tile__description}>{description}</p>}\n {children && <div className={tileStyles.tile__children}>{children}</div>}\n </a>\n );\n}) as TileCompound;\n\nTile.displayName = 'Tile';\nTile.Title = Title;\n\nexport default Tile;\n","import Tile from './Tile';\nexport * from './Tile';\nexport default Tile;\n"],"mappings":";;;;;;;;;;AA+CA,IAAM,QAAQ,MAAM,YAAgD,OAAO,QAAQ;CACjF,MAAM,EAAE,SAAS,UAAU,WAAW,aAAa,QAAQ,gBAAgB;AAW3E,QACE,oBAHgB,YAGf;EAAU,WAXQ,WACnB,WAAW,gBACX;IACG,WAAW,8BAA8B;IACzC,WAAW,0BAA0B;GACvC,EACD,UACD;EAI0C;EACtC;GACS;EAEd;AAEF,MAAM,cAAc;AAEpB,MAAa,OAAO,MAAM,YAA0C,OAAO,QAAQ;CACjF,MAAM,EACJ,UACA,MACA,OACA,YAAY,IACZ,aACA,QAAQ,OACR,cAAc,OACd,QACA,QACA,KACA,UAAU,UACV,MACA,YACE;CACJ,MAAM,EAAE,WAAW,cAAc,kBAAqC;CAEtE,MAAM,SADa,eAAe,GACN,WAAW;CACvC,MAAM,UAAU,YAAY;CAC5B,MAAM,cAAc,WAClB,WAAW,MACX;GACG,WAAW,iBAAiB;GAC5B,WAAW,mBAAmB;GAC9B,WAAW,uBAAuB;EACpC,EACD,UACD;CACD,MAAM,0BAA0B,WAAW,WAAW,kBAAkB,GACrE,WAAW,4BAA4B,SACzC,CAAC;AAEF,QACE,qBAAC,KAAA;EACC,KAAK,UAAU,CAAC,KAAK,UAAU,CAAC;EAC1B;EACE;EACR,KAAK,WAAW,WAAW,wBAAwB;EACnD,WAAW;EACX,eAAa;EACb,oBAAkB,YAAY;EACrB;;GAET,qBAAC,OAAA;IAAI,WAAW;eACb,MAAM,aAAa,MAAM;KAAE,MAAM,SAAS,SAAS,QAAQ,SAAS;KAAQ;KAAW,OAAO,cAAc,UAAU;KAAS,CAAC,EAChI,MAAM,aAAa,OAAO;KAAe;KAAsB;KAAS,CAAC,CAAA;KACtE;GACL,CAAC,WAAW,CAAC,UAAU,oBAAC,KAAA;IAAE,WAAW,WAAW;cAAoB;KAAgB;GACpF,YAAY,oBAAC,OAAA;IAAI,WAAW,WAAW;IAAiB;KAAe;;GACtE;EAEN;AAEF,KAAK,cAAc;AACnB,KAAK,QAAQ;ACzHb,IAAA,eD2He"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Tile/Tile.tsx","../../../src/components/Tile/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { TitleTags } from './../Title/Title';\nimport { useBreakpoint, Breakpoint } from '../../hooks/useBreakpoint';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../utils/refs';\nimport { IconSize } from '../Icon';\n\nimport tileStyles from './styles.module.scss';\n\nexport type TileVariants = 'normal' | 'compact';\n\ninterface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /**\tSets the icon to be displayed inside the tile. */\n icon: React.ReactElement;\n /**\tSets the title to be displayed inside the tile. */\n title: React.ReactElement;\n /** Toggles the highlighted style of the tile. */\n highlighted?: boolean;\n /** Sets the description to be displayed inside the tile. */\n description?: string;\n /** Sets a fixed max and min width for the tile. */\n fixed?: boolean;\n /** Sets the visual variant of the component */\n variant?: TileVariants;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface TileTitleProps {\n children: React.ReactNode;\n className?: string;\n htmlMarkup?: TitleTags;\n highlighted?: boolean;\n compact?: boolean;\n}\n\nexport interface TileCompound extends React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLAnchorElement>> {\n Title: React.ForwardRefExoticComponent<TileTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n}\n\nconst Title = React.forwardRef<HTMLHeadingElement, TileTitleProps>((props, ref) => {\n const { compact, children, className, htmlMarkup = 'span', highlighted } = props;\n const titleClasses = classNames(\n tileStyles['tile__title'],\n {\n [tileStyles['tile__title--highlighted']]: highlighted,\n [tileStyles['tile__title--compact']]: compact,\n },\n className\n );\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={titleClasses} ref={ref}>\n {children}\n </CustomTag>\n );\n});\n\nTitle.displayName = 'Title';\n\nexport const Tile = React.forwardRef<HTMLAnchorElement, TileProps>((props, ref) => {\n const {\n children,\n icon,\n title,\n className = '',\n description,\n fixed = false,\n highlighted = false,\n testId,\n target,\n rel,\n variant = 'normal',\n href,\n onClick,\n } = props;\n const { refObject, isHovered } = usePseudoClasses<HTMLAnchorElement>();\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < Breakpoint.md;\n const compact = variant === 'compact';\n const tileClasses = classNames(\n tileStyles.tile,\n {\n [tileStyles['tile--fixed']]: fixed,\n [tileStyles['tile--compact']]: compact,\n [tileStyles['tile--highlighted']]: highlighted,\n },\n className\n );\n const tileTitleWrapperClasses = classNames(tileStyles['title-wrapper'], {\n [tileStyles['title-wrapper--compact']]: compact,\n });\n\n return (\n <a\n ref={mergeRefs([ref, refObject])}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : rel}\n className={tileClasses}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Tile}\n onClick={onClick}\n >\n <div className={tileTitleWrapperClasses}>\n {React.cloneElement(icon, { size: mobile ? IconSize.Small : IconSize.Medium, isHovered, color: highlighted ? 'white' : 'black' })}\n {React.cloneElement(title, { highlighted: highlighted, compact: compact })}\n </div>\n {!compact && !mobile && <p className={tileStyles.tile__description}>{description}</p>}\n {children && <div className={tileStyles.tile__children}>{children}</div>}\n </a>\n );\n}) as TileCompound;\n\nTile.displayName = 'Tile';\nTile.Title = Title;\n\nexport default Tile;\n","import Tile from './Tile';\nexport * from './Tile';\nexport default Tile;\n"],"mappings":";;;;;;;;AA+CA,IAAM,QAAQ,MAAM,YAAgD,OAAO,QAAQ;CACjF,MAAM,EAAE,SAAS,UAAU,WAAW,aAAa,QAAQ,gBAAgB;AAW3E,QACE,oBAHgB,YAGf;EAAU,WAXQ,WACnB,WAAW,gBACX;IACG,WAAW,8BAA8B;IACzC,WAAW,0BAA0B;GACvC,EACD,UACD;EAI0C;EACtC;GACS;EAEd;AAEF,MAAM,cAAc;AAEpB,MAAa,OAAO,MAAM,YAA0C,OAAO,QAAQ;CACjF,MAAM,EACJ,UACA,MACA,OACA,YAAY,IACZ,aACA,QAAQ,OACR,cAAc,OACd,QACA,QACA,KACA,UAAU,UACV,MACA,YACE;CACJ,MAAM,EAAE,WAAW,cAAc,kBAAqC;CAEtE,MAAM,SADa,eAAe,GACN,WAAW;CACvC,MAAM,UAAU,YAAY;CAC5B,MAAM,cAAc,WAClB,WAAW,MACX;GACG,WAAW,iBAAiB;GAC5B,WAAW,mBAAmB;GAC9B,WAAW,uBAAuB;EACpC,EACD,UACD;CACD,MAAM,0BAA0B,WAAW,WAAW,kBAAkB,GACrE,WAAW,4BAA4B,SACzC,CAAC;AAEF,QACE,qBAAC,KAAA;EACC,KAAK,UAAU,CAAC,KAAK,UAAU,CAAC;EAC1B;EACE;EACR,KAAK,WAAW,WAAW,wBAAwB;EACnD,WAAW;EACX,eAAa;EACb,oBAAkB,YAAY;EACrB;;GAET,qBAAC,OAAA;IAAI,WAAW;eACb,MAAM,aAAa,MAAM;KAAE,MAAM,SAAS,SAAS,QAAQ,SAAS;KAAQ;KAAW,OAAO,cAAc,UAAU;KAAS,CAAC,EAChI,MAAM,aAAa,OAAO;KAAe;KAAsB;KAAS,CAAC,CAAA;KACtE;GACL,CAAC,WAAW,CAAC,UAAU,oBAAC,KAAA;IAAE,WAAW,WAAW;cAAoB;KAAgB;GACpF,YAAY,oBAAC,OAAA;IAAI,WAAW,WAAW;IAAiB;KAAe;;GACtE;EAEN;AAEF,KAAK,cAAc;AACnB,KAAK,QAAQ;ACzHb,IAAA,eD2He"}
@@ -1,4 +1,3 @@
1
- import "../../constants2.js";
2
1
  import { r as instanceOfTitleMargin, t as Title } from "../../Title.js";
3
2
  import { t as Title_default } from "../../Title2.js";
4
3
  export { Title, Title_default as default, instanceOfTitleMargin };
@@ -1,13 +1,3 @@
1
- import "../../constants2.js";
2
- import "../../usePseudoClasses.js";
3
- import "../../grid.js";
4
- import "../../refs.js";
5
- import "../../Icon.js";
6
- import "../../CheckFill.js";
7
- import "../../useBreakpoint.js";
8
- import "../../useIsMobileBreakpoint.js";
9
- import "../../X.js";
10
- import "../../Close.js";
11
1
  import { t as Toast_default$1 } from "../../Toast.js";
12
2
  var Toast_default = Toast_default$1;
13
3
  export { Toast_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Toast/index.ts"],"sourcesContent":["import Toast from './Toast';\nexport * from './Toast';\nexport default Toast;\n"],"mappings":";;;;;;;;;;;AAEA,IAAA,gBAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Toast/index.ts"],"sourcesContent":["import Toast from './Toast';\nexport * from './Toast';\nexport default Toast;\n"],"mappings":";AAEA,IAAA,gBAAe"}
@@ -1,13 +1,4 @@
1
- import "../../constants2.js";
2
- import "../../usePseudoClasses.js";
3
- import "../../grid.js";
4
1
  import { n as mergeRefs } from "../../refs.js";
5
- import "../../Icon.js";
6
- import "../../CheckFill.js";
7
- import "../../useBreakpoint.js";
8
- import "../../useIsMobileBreakpoint.js";
9
- import "../../X.js";
10
- import "../../Close.js";
11
2
  import { t as Toast_default } from "../../Toast.js";
12
3
  import React from "react";
13
4
  import { jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/ToastList/ToastList.tsx","../../../src/components/ToastList/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport { mergeRefs } from '../../utils/refs';\nimport Toast from '../Toast/Toast';\n\nimport styles from './styles.module.scss';\n\nexport interface ToastData {\n id: string;\n title: string;\n message?: string;\n}\n\nexport interface ToastListProps {\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Array of toast data to display */\n toasts?: ToastData[];\n}\n\nconst DURATION = 8000;\n\nconst ToastList = React.forwardRef<HTMLElement, ToastListProps>((props, ref) => {\n const { testId, toasts = [] } = props;\n const internalRef = React.useRef<HTMLElement | null>(null);\n const [visibleToasts, setVisibleToasts] = React.useState<ToastData[]>([]);\n const [removedToastIds, setRemovedToastIds] = React.useState<Set<string>>(new Set());\n const timeoutRefs = React.useRef<Map<string, NodeJS.Timeout>>(new Map());\n\n React.useEffect(() => {\n const newToasts = toasts.filter(toast => !visibleToasts.some(vt => vt.id === toast.id) && !removedToastIds.has(toast.id));\n if (newToasts.length > 0) {\n setVisibleToasts(prev => [...prev, ...newToasts]);\n }\n }, [toasts, visibleToasts, removedToastIds]);\n\n // Handles removal of a toast\n const handleRemoveToast = React.useCallback((id: string): void => {\n setVisibleToasts(prev => prev.filter(t => t.id !== id));\n // Add to removed IDs to prevent re-appearance\n setRemovedToastIds(prev => new Set([...prev, id]));\n\n // Clear timeout if exists\n const timeout = timeoutRefs.current.get(id);\n if (timeout) {\n clearTimeout(timeout);\n timeoutRefs.current.delete(id);\n }\n }, []);\n\n // Handle auto-removal of toasts after duration\n React.useEffect(() => {\n const timeouts = timeoutRefs.current;\n\n // Set up timeouts for new visible toasts that don't have timeout yet\n visibleToasts.forEach(toast => {\n if (!timeouts.has(toast.id)) {\n const timeout = setTimeout(() => {\n handleRemoveToast(toast.id);\n }, DURATION);\n\n timeouts.set(toast.id, timeout);\n }\n });\n }, [visibleToasts, handleRemoveToast]);\n\n // Cleanup timeouts for removed toasts\n React.useEffect(() => {\n const timeouts = timeoutRefs.current;\n const currentToastIds = new Set(visibleToasts.map(t => t.id));\n\n timeouts.forEach((timeout, id) => {\n if (!currentToastIds.has(id)) {\n clearTimeout(timeout);\n timeouts.delete(id);\n }\n });\n }, [visibleToasts]);\n\n // Cleanup all timeouts on unmount\n React.useEffect(() => {\n return (): void => {\n timeoutRefs.current.forEach(timeout => clearTimeout(timeout));\n timeoutRefs.current.clear();\n };\n }, []);\n\n const setRefs = mergeRefs([internalRef, ref]);\n\n return (\n <section ref={setRefs} className={styles['toast-list']} data-testid={testId}>\n <AnimatePresence mode=\"popLayout\">\n {visibleToasts.map(toast => (\n <motion.div\n key={toast.id}\n layout\n initial={{ opacity: 0, y: 50 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -20 }}\n transition={{\n layout: { type: 'spring', duration: 0.4, bounce: 0.1 },\n }}\n >\n <Toast\n testId={`${testId}-${toast.id}`}\n title={toast.title}\n message={toast.message}\n onClose={() => handleRemoveToast(toast.id)}\n />\n </motion.div>\n ))}\n </AnimatePresence>\n </section>\n );\n});\n\nToastList.displayName = 'ToastList';\n\nexport default ToastList;\n","import ToastList from './ToastList';\nexport * from './ToastList';\nexport default ToastList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AM,WAAW,YAAY;EAC7B,MAAM,kBAAkB,IAAI,IAAI,cAAc,KAAI,MAAK,EAAE,GAAG,CAAC;AAE7D,WAAS,SAAS,SAAS,OAAO;AAChC,OAAI,CAAC,gBAAgB,IAAI,GAAG,EAAE;AAC5B,iBAAa,QAAQ;AACrB,aAAS,OAAO,GAAG;;IAErB;IACD,CAAC,cAAc,CAAC;AAGnB,OAAM,gBAAgB;AACpB,eAAmB;AACjB,eAAY,QAAQ,SAAQ,YAAW,aAAa,QAAQ,CAAC;AAC7D,eAAY,QAAQ,OAAO;;IAE5B,EAAE,CAAC;AAIN,QACE,oBAAC,WAAA;EAAQ,KAHK,UAAU,CAAC,aAAa,IAAI,CAAC;EAGpB,WAAW,OAAO;EAAe,eAAa;YACnE,oBAAC,iBAAA;GAAgB,MAAK;aACnB,cAAc,KAAI,UACjB,oBAAC,OAAO,KAAA;IAEN,QAAA;IACA,SAAS;KAAE,SAAS;KAAG,GAAG;KAAI;IAC9B,SAAS;KAAE,SAAS;KAAG,GAAG;KAAG;IAC7B,MAAM;KAAE,SAAS;KAAG,GAAG;KAAK;IAC5B,YAAY,EACV,QAAQ;KAAE,MAAM;KAAU,UAAU;KAAK,QAAQ;KAAK,EACvD;cAED,oBAAC,eAAA;KACC,QAAQ,GAAG,OAAO,GAAG,MAAM;KAC3B,OAAO,MAAM;KACb,SAAS,MAAM;KACf,eAAe,kBAAkB,MAAM,GAAG;MAC1C;MAdG,MAAM,GAeA,CACb;IACc;GACV;EAEZ;AAEF,UAAU,cAAc;ACpHxB,IAAA,oBDsHe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/ToastList/ToastList.tsx","../../../src/components/ToastList/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport { mergeRefs } from '../../utils/refs';\nimport Toast from '../Toast/Toast';\n\nimport styles from './styles.module.scss';\n\nexport interface ToastData {\n id: string;\n title: string;\n message?: string;\n}\n\nexport interface ToastListProps {\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Array of toast data to display */\n toasts?: ToastData[];\n}\n\nconst DURATION = 8000;\n\nconst ToastList = React.forwardRef<HTMLElement, ToastListProps>((props, ref) => {\n const { testId, toasts = [] } = props;\n const internalRef = React.useRef<HTMLElement | null>(null);\n const [visibleToasts, setVisibleToasts] = React.useState<ToastData[]>([]);\n const [removedToastIds, setRemovedToastIds] = React.useState<Set<string>>(new Set());\n const timeoutRefs = React.useRef<Map<string, NodeJS.Timeout>>(new Map());\n\n React.useEffect(() => {\n const newToasts = toasts.filter(toast => !visibleToasts.some(vt => vt.id === toast.id) && !removedToastIds.has(toast.id));\n if (newToasts.length > 0) {\n setVisibleToasts(prev => [...prev, ...newToasts]);\n }\n }, [toasts, visibleToasts, removedToastIds]);\n\n // Handles removal of a toast\n const handleRemoveToast = React.useCallback((id: string): void => {\n setVisibleToasts(prev => prev.filter(t => t.id !== id));\n // Add to removed IDs to prevent re-appearance\n setRemovedToastIds(prev => new Set([...prev, id]));\n\n // Clear timeout if exists\n const timeout = timeoutRefs.current.get(id);\n if (timeout) {\n clearTimeout(timeout);\n timeoutRefs.current.delete(id);\n }\n }, []);\n\n // Handle auto-removal of toasts after duration\n React.useEffect(() => {\n const timeouts = timeoutRefs.current;\n\n // Set up timeouts for new visible toasts that don't have timeout yet\n visibleToasts.forEach(toast => {\n if (!timeouts.has(toast.id)) {\n const timeout = setTimeout(() => {\n handleRemoveToast(toast.id);\n }, DURATION);\n\n timeouts.set(toast.id, timeout);\n }\n });\n }, [visibleToasts, handleRemoveToast]);\n\n // Cleanup timeouts for removed toasts\n React.useEffect(() => {\n const timeouts = timeoutRefs.current;\n const currentToastIds = new Set(visibleToasts.map(t => t.id));\n\n timeouts.forEach((timeout, id) => {\n if (!currentToastIds.has(id)) {\n clearTimeout(timeout);\n timeouts.delete(id);\n }\n });\n }, [visibleToasts]);\n\n // Cleanup all timeouts on unmount\n React.useEffect(() => {\n return (): void => {\n timeoutRefs.current.forEach(timeout => clearTimeout(timeout));\n timeoutRefs.current.clear();\n };\n }, []);\n\n const setRefs = mergeRefs([internalRef, ref]);\n\n return (\n <section ref={setRefs} className={styles['toast-list']} data-testid={testId}>\n <AnimatePresence mode=\"popLayout\">\n {visibleToasts.map(toast => (\n <motion.div\n key={toast.id}\n layout\n initial={{ opacity: 0, y: 50 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -20 }}\n transition={{\n layout: { type: 'spring', duration: 0.4, bounce: 0.1 },\n }}\n >\n <Toast\n testId={`${testId}-${toast.id}`}\n title={toast.title}\n message={toast.message}\n onClose={() => handleRemoveToast(toast.id)}\n />\n </motion.div>\n ))}\n </AnimatePresence>\n </section>\n );\n});\n\nToastList.displayName = 'ToastList';\n\nexport default ToastList;\n","import ToastList from './ToastList';\nexport * from './ToastList';\nexport default ToastList;\n"],"mappings":";;;;;;AAsBA,IAAM,WAAW;AAEjB,IAAM,YAAY,MAAM,YAAyC,OAAO,QAAQ;CAC9E,MAAM,EAAE,QAAQ,SAAS,EAAE,KAAK;CAChC,MAAM,cAAc,MAAM,OAA2B,KAAK;CAC1D,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAsB,EAAE,CAAC;CACzE,MAAM,CAAC,iBAAiB,sBAAsB,MAAM,yBAAsB,IAAI,KAAK,CAAC;CACpF,MAAM,cAAc,MAAM,uBAAoC,IAAI,KAAK,CAAC;AAExE,OAAM,gBAAgB;EACpB,MAAM,YAAY,OAAO,QAAO,UAAS,CAAC,cAAc,MAAK,OAAM,GAAG,OAAO,MAAM,GAAG,IAAI,CAAC,gBAAgB,IAAI,MAAM,GAAG,CAAC;AACzH,MAAI,UAAU,SAAS,EACrB,mBAAiB,SAAQ,CAAC,GAAG,MAAM,GAAG,UAAU,CAAC;IAElD;EAAC;EAAQ;EAAe;EAAgB,CAAC;CAG5C,MAAM,oBAAoB,MAAM,aAAa,OAAqB;AAChE,oBAAiB,SAAQ,KAAK,QAAO,MAAK,EAAE,OAA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AE,MAAM;KAAU,UAAU;KAAK,QAAQ;KAAK,EACvD;cAED,oBAAC,eAAA;KACC,QAAQ,GAAG,OAAO,GAAG,MAAM;KAC3B,OAAO,MAAM;KACb,SAAS,MAAM;KACf,eAAe,kBAAkB,MAAM,GAAG;MAC1C;MAdG,MAAM,GAeA,CACb;IACc;GACV;EAEZ;AAEF,UAAU,cAAc;ACpHxB,IAAA,oBDsHe"}
@@ -98,7 +98,7 @@ var Toggle = ({ checked = false, label, onChange, onColor = ToggleOnColor.onwhit
98
98
  onChange: handleChange,
99
99
  className: styles["toggle-container__input"],
100
100
  "aria-label": label.map((l) => l.text).join(" "),
101
- "aria-describedby": `${subLabel ? subLabelId + " " : void 0} ${statusText ? toggleId + "-status" : void 0}`,
101
+ "aria-describedby": [subLabel ? subLabelId : null, statusText ? toggleId + "-status" : null].filter(Boolean).join(" ") || void 0,
102
102
  role: "switch"
103
103
  }), /* @__PURE__ */ jsx("span", {
104
104
  id: toggleId,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Toggle: React.FC<ToggleProps>"],"sources":["../../../src/components/Toggle/Toggle.tsx","../../../src/components/Toggle/index.ts"],"sourcesContent":["import React, { useState, useEffect, useId } from 'react';\n\nimport classNames from 'classnames';\nimport { useAnimate } from 'motion/react';\n\nimport { AnalyticsId } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\n\nimport styles from './styles.module.scss';\nimport '../../scss/supernova/styles/colors.css';\n\nexport type LabelText = {\n text: string;\n type?: 'subdued' | 'normal';\n};\n\nexport type StatusTextType = {\n checked: string;\n unchecked: string;\n};\n\nexport enum TogglePosition {\n left = 'left',\n right = 'right',\n}\n\nexport enum ToggleOnColor {\n onwhite = 'onwhite',\n onneutral = 'onneutral',\n onblueberry = 'onblueberry',\n}\n\nexport interface ToggleProps extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /** Determines if the Toggle is checked */\n checked?: boolean;\n /** Sets the label of the Toggle */\n label: LabelText[];\n /** Defines the color of the toggle */\n onColor?: keyof typeof ToggleOnColor;\n /** A text that is shown under the Toggle switch */\n statusText?: StatusTextType;\n /** Sets the sublabel of the Toggle */\n subLabel?: string;\n /** Sets the position of the toggle relative to the label */\n togglePosition?: keyof typeof TogglePosition;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst Toggle: React.FC<ToggleProps> = ({\n checked = false,\n label,\n onChange,\n onColor = ToggleOnColor.onwhite,\n statusText,\n subLabel,\n togglePosition = TogglePosition.left,\n testId,\n}: ToggleProps) => {\n const [checkedState, setCheckedState] = useState(checked);\n const [showToggleAnimation, setShowToggleAnimation] = useState(false);\n const [scope, animate] = useAnimate();\n const baseId = useId();\n const toggleId = 'toggle-' + baseId;\n const inputId = 'input-' + baseId;\n const labelId = 'label-' + baseId;\n const subLabelId = 'sublabel-' + baseId;\n const toggleRef = React.useRef<HTMLSpanElement>(null);\n const toggleDotRef = React.useRef<HTMLSpanElement>(null);\n const { refObject, isHovered, isActive } = usePseudoClasses<HTMLLabelElement>(scope);\n const showHoveredStyling = isHovered && !showToggleAnimation;\n const isOnWhite = onColor === ToggleOnColor.onwhite;\n\n useEffect(() => {\n if (showToggleAnimation) {\n const timer = setTimeout(() => setShowToggleAnimation(false), 300);\n return (): void => clearTimeout(timer);\n }\n }, [showToggleAnimation]);\n\n useEffect(() => {\n setCheckedState(checked);\n }, [checked]);\n\n useEffect(() => {\n if (!toggleRef.current || !toggleDotRef.current) return;\n animate(toggleRef.current, { background: getBackgroundColor() }, { duration: 0.2, ease: 'easeInOut' });\n animate(\n toggleDotRef.current,\n { background: checkedState ? 'var(--color-action-graphics-ondark)' : 'var(--core-color-neutral-700)' },\n { duration: 0.2, ease: 'easeInOut' }\n );\n animate(toggleDotRef.current, { x: showHoveredStyling ? 9 : checkedState ? 18 : 0 }, { duration: 0.2, ease: 'easeInOut' });\n animate('svg', { opacity: checkedState ? 1 : 0 }, { duration: 0.2, ease: 'easeInOut' });\n }, [checkedState, showHoveredStyling, isActive]);\n\n const getBackgroundColor = (): string => {\n if (checkedState && isActive) {\n return 'var(--core-color-blueberry-800)';\n } else if (checkedState) {\n return showHoveredStyling ? 'var(--color-action-graphics-onlight-hover)' : 'var(--color-action-graphics-onlight)';\n } else if (isOnWhite && isActive) {\n return 'var(--core-color-neutral-400)';\n } else if (isOnWhite) {\n return showHoveredStyling ? 'var(--core-color-neutral-200)' : 'var(--core-color-neutral-50)';\n } else if (isActive) {\n return 'var(--core-color-neutral-200)';\n } else {\n return showHoveredStyling ? 'var(--core-color-neutral-50)' : 'var(--core-color-white)';\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setCheckedState(event.target.checked);\n setShowToggleAnimation(true);\n onChange?.(event);\n };\n\n const toggleContainerClassNames = classNames(styles['toggle-container'], {\n [styles['toggle-container--position-right']]: togglePosition === TogglePosition.right,\n [styles['toggle-container--with-status']]: statusText !== undefined && statusText !== null,\n });\n\n const subLabelClassNames = classNames(styles['toggle-container__sublabel']);\n\n const statusTextClassNames = classNames(styles['toggle-container__status'], {\n [styles['toggle-container__status--checked']]: checkedState,\n });\n\n const toggleClassNames = classNames(styles['toggle-container__toggle'], {\n [styles['toggle-container__toggle--ignore-hover']]: showToggleAnimation,\n [styles['toggle-container__toggle--on-white']]: onColor === ToggleOnColor.onwhite,\n });\n\n const toggleDotClassNames = classNames(styles['toggle-container__toggle__dot'], {\n [styles['toggle-container__toggle__dot--ignore-hover']]: showToggleAnimation,\n });\n\n const renderToggle = (): React.ReactElement => (\n <div className={styles['toggle-container__outer-toggle']}>\n <label ref={refObject} className={classNames(styles['toggle-container__toggle-group'])}>\n <input\n id={inputId}\n type=\"checkbox\"\n checked={checkedState}\n onChange={handleChange}\n className={styles['toggle-container__input']}\n aria-label={label.map(l => l.text).join(' ')}\n aria-describedby={`${subLabel ? subLabelId + ' ' : undefined} ${statusText ? toggleId + '-status' : undefined}`}\n role=\"switch\"\n />\n <span id={toggleId} ref={toggleRef} className={toggleClassNames} aria-hidden=\"true\">\n <span ref={toggleDotRef} className={toggleDotClassNames} aria-hidden=\"true\">\n <svg\n width=\"17\"\n height=\"13\"\n viewBox=\"0 0 17 13\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={styles['toggle-container__toggle__dot__icon']}\n >\n <path d=\"M15 2L6.80839 10.548L2 5.53145\" fill=\"none\" strokeWidth=\"3\" />\n </svg>\n </span>\n </span>\n </label>\n {statusText && (\n <span className={statusTextClassNames} id={toggleId + '-status'}>\n {checkedState ? statusText.checked : statusText.unchecked}\n </span>\n )}\n </div>\n );\n\n const renderLabelText = (): React.ReactElement => {\n return (\n <div className={styles['toggle-container__outer-label']}>\n <span id={labelId} className={classNames(styles['toggle-container__label'])}>\n {label.map(labelText => {\n const labelClassNames = classNames({\n [styles['toggle-container__label__text--subdued']]: labelText.type === 'subdued',\n });\n\n return (\n <span key={labelId + labelText.text} className={labelClassNames}>\n {labelText.text}\n </span>\n );\n })}\n </span>\n {subLabel && (\n <div id={subLabelId} className={subLabelClassNames}>\n {subLabel}\n </div>\n )}\n </div>\n );\n };\n\n return (\n <div className={toggleContainerClassNames} data-testid={testId} data-analyticsid={AnalyticsId.Toggle}>\n {togglePosition === TogglePosition.left && (\n <>\n {renderToggle()}\n {renderLabelText()}\n </>\n )}\n {togglePosition === TogglePosition.right && (\n <>\n {renderLabelText()}\n {renderToggle()}\n </>\n )}\n </div>\n );\n};\n\nexport default Toggle;\n","import Toggle from './Toggle';\nexport * from './Toggle';\nexport default Toggle;\n"],"mappings":";;;;;;;AAqBA,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,UAAA;AACA,kBAAA,WAAA;;;AAGF,IAAY,gBAAA,yBAAA,iBAAL;AACL,iBAAA,aAAA;AACA,iBAAA,eAAA;AACA,iBAAA,iBAAA;;;AAoBF,IAAMA,UAAiC,EACrC,UAAU,OACV,OACA,UACA,UAAU,cAAc,SACxB,YACA,UACA,iBAAiB,eAAe,MAChC,aACiB;CACjB,MA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;OAAO,aAAY;QAAM;OACnE;MACD;KACF,CAAA;IACD,EACP,cACC,oBAAC,QAAA;GAAK,WAAW;GAAsB,IAAI,WAAW;aACnD,eAAe,WAAW,UAAU,WAAW;IAC3C,CAAA;GAEL;CAGR,MAAM,wBAA4C;AAChD,SACE,qBAAC,OAAA;GAAI,WAAW,OAAO;cACrB,oBAAC,QAAA;IAAK,IAAI;IAAS,WAAW,WAAW,OAAO,2BAA2B;cACxE,MAAM,KAAI,cAAa;AAKtB,YACE,oBAAC,QAAA;MAAoC,WALf,WAAW,GAChC,OAAO,4CAA4C,UAAU,SAAS,WACxE,CAAC;gBAIG,UAAU;QADF,UAAU,UAAU,KAExB;MAET;KACG,EACN,YACC,oBAAC,OAAA;IAAI,IAAI;IAAY,WAAW;cAC7B;KACG,CAAA;IAEJ;;AAIV,QACE,qBAAC,OAAA;EAAI,WAAW;EAA2B,eAAa;EAAQ,oBAAkB,YAAY;aAC3F,mBAAmB,eAAe,QACjC,qBAAA,UAAA,EAAA,UAAA,CACG,cAAc,EACd,iBAAiB,CAAA,EAAA,CACjB,EAEJ,mBAAmB,eAAe,SACjC,qBAAA,UAAA,EAAA,UAAA,CACG,iBAAiB,EACjB,cAAc,CAAA,EAAA,CACd,CAAA;GAED;;AClNV,IAAA,iBDsNe"}
1
+ {"version":3,"file":"index.js","names":["Toggle: React.FC<ToggleProps>"],"sources":["../../../src/components/Toggle/Toggle.tsx","../../../src/components/Toggle/index.ts"],"sourcesContent":["import React, { useState, useEffect, useId } from 'react';\n\nimport classNames from 'classnames';\nimport { useAnimate } from 'motion/react';\n\nimport { AnalyticsId } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\n\nimport styles from './styles.module.scss';\nimport '../../scss/supernova/styles/colors.css';\n\nexport type LabelText = {\n text: string;\n type?: 'subdued' | 'normal';\n};\n\nexport type StatusTextType = {\n checked: string;\n unchecked: string;\n};\n\nexport enum TogglePosition {\n left = 'left',\n right = 'right',\n}\n\nexport enum ToggleOnColor {\n onwhite = 'onwhite',\n onneutral = 'onneutral',\n onblueberry = 'onblueberry',\n}\n\nexport interface ToggleProps extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /** Determines if the Toggle is checked */\n checked?: boolean;\n /** Sets the label of the Toggle */\n label: LabelText[];\n /** Defines the color of the toggle */\n onColor?: keyof typeof ToggleOnColor;\n /** A text that is shown under the Toggle switch */\n statusText?: StatusTextType;\n /** Sets the sublabel of the Toggle */\n subLabel?: string;\n /** Sets the position of the toggle relative to the label */\n togglePosition?: keyof typeof TogglePosition;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst Toggle: React.FC<ToggleProps> = ({\n checked = false,\n label,\n onChange,\n onColor = ToggleOnColor.onwhite,\n statusText,\n subLabel,\n togglePosition = TogglePosition.left,\n testId,\n}: ToggleProps) => {\n const [checkedState, setCheckedState] = useState(checked);\n const [showToggleAnimation, setShowToggleAnimation] = useState(false);\n const [scope, animate] = useAnimate();\n const baseId = useId();\n const toggleId = 'toggle-' + baseId;\n const inputId = 'input-' + baseId;\n const labelId = 'label-' + baseId;\n const subLabelId = 'sublabel-' + baseId;\n const toggleRef = React.useRef<HTMLSpanElement>(null);\n const toggleDotRef = React.useRef<HTMLSpanElement>(null);\n const { refObject, isHovered, isActive } = usePseudoClasses<HTMLLabelElement>(scope);\n const showHoveredStyling = isHovered && !showToggleAnimation;\n const isOnWhite = onColor === ToggleOnColor.onwhite;\n\n useEffect(() => {\n if (showToggleAnimation) {\n const timer = setTimeout(() => setShowToggleAnimation(false), 300);\n return (): void => clearTimeout(timer);\n }\n }, [showToggleAnimation]);\n\n useEffect(() => {\n setCheckedState(checked);\n }, [checked]);\n\n useEffect(() => {\n if (!toggleRef.current || !toggleDotRef.current) return;\n animate(toggleRef.current, { background: getBackgroundColor() }, { duration: 0.2, ease: 'easeInOut' });\n animate(\n toggleDotRef.current,\n { background: checkedState ? 'var(--color-action-graphics-ondark)' : 'var(--core-color-neutral-700)' },\n { duration: 0.2, ease: 'easeInOut' }\n );\n animate(toggleDotRef.current, { x: showHoveredStyling ? 9 : checkedState ? 18 : 0 }, { duration: 0.2, ease: 'easeInOut' });\n animate('svg', { opacity: checkedState ? 1 : 0 }, { duration: 0.2, ease: 'easeInOut' });\n }, [checkedState, showHoveredStyling, isActive]);\n\n const getBackgroundColor = (): string => {\n if (checkedState && isActive) {\n return 'var(--core-color-blueberry-800)';\n } else if (checkedState) {\n return showHoveredStyling ? 'var(--color-action-graphics-onlight-hover)' : 'var(--color-action-graphics-onlight)';\n } else if (isOnWhite && isActive) {\n return 'var(--core-color-neutral-400)';\n } else if (isOnWhite) {\n return showHoveredStyling ? 'var(--core-color-neutral-200)' : 'var(--core-color-neutral-50)';\n } else if (isActive) {\n return 'var(--core-color-neutral-200)';\n } else {\n return showHoveredStyling ? 'var(--core-color-neutral-50)' : 'var(--core-color-white)';\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setCheckedState(event.target.checked);\n setShowToggleAnimation(true);\n onChange?.(event);\n };\n\n const toggleContainerClassNames = classNames(styles['toggle-container'], {\n [styles['toggle-container--position-right']]: togglePosition === TogglePosition.right,\n [styles['toggle-container--with-status']]: statusText !== undefined && statusText !== null,\n });\n\n const subLabelClassNames = classNames(styles['toggle-container__sublabel']);\n\n const statusTextClassNames = classNames(styles['toggle-container__status'], {\n [styles['toggle-container__status--checked']]: checkedState,\n });\n\n const toggleClassNames = classNames(styles['toggle-container__toggle'], {\n [styles['toggle-container__toggle--ignore-hover']]: showToggleAnimation,\n [styles['toggle-container__toggle--on-white']]: onColor === ToggleOnColor.onwhite,\n });\n\n const toggleDotClassNames = classNames(styles['toggle-container__toggle__dot'], {\n [styles['toggle-container__toggle__dot--ignore-hover']]: showToggleAnimation,\n });\n\n const renderToggle = (): React.ReactElement => (\n <div className={styles['toggle-container__outer-toggle']}>\n <label ref={refObject} className={classNames(styles['toggle-container__toggle-group'])}>\n <input\n id={inputId}\n type=\"checkbox\"\n checked={checkedState}\n onChange={handleChange}\n className={styles['toggle-container__input']}\n aria-label={label.map(l => l.text).join(' ')}\n aria-describedby={[subLabel ? subLabelId : null, statusText ? toggleId + '-status' : null].filter(Boolean).join(' ') || undefined}\n role=\"switch\"\n />\n <span id={toggleId} ref={toggleRef} className={toggleClassNames} aria-hidden=\"true\">\n <span ref={toggleDotRef} className={toggleDotClassNames} aria-hidden=\"true\">\n <svg\n width=\"17\"\n height=\"13\"\n viewBox=\"0 0 17 13\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={styles['toggle-container__toggle__dot__icon']}\n >\n <path d=\"M15 2L6.80839 10.548L2 5.53145\" fill=\"none\" strokeWidth=\"3\" />\n </svg>\n </span>\n </span>\n </label>\n {statusText && (\n <span className={statusTextClassNames} id={toggleId + '-status'}>\n {checkedState ? statusText.checked : statusText.unchecked}\n </span>\n )}\n </div>\n );\n\n const renderLabelText = (): React.ReactElement => {\n return (\n <div className={styles['toggle-container__outer-label']}>\n <span id={labelId} className={classNames(styles['toggle-container__label'])}>\n {label.map(labelText => {\n const labelClassNames = classNames({\n [styles['toggle-container__label__text--subdued']]: labelText.type === 'subdued',\n });\n\n return (\n <span key={labelId + labelText.text} className={labelClassNames}>\n {labelText.text}\n </span>\n );\n })}\n </span>\n {subLabel && (\n <div id={subLabelId} className={subLabelClassNames}>\n {subLabel}\n </div>\n )}\n </div>\n );\n };\n\n return (\n <div className={toggleContainerClassNames} data-testid={testId} data-analyticsid={AnalyticsId.Toggle}>\n {togglePosition === TogglePosition.left && (\n <>\n {renderToggle()}\n {renderLabelText()}\n </>\n )}\n {togglePosition === TogglePosition.right && (\n <>\n {renderLabelText()}\n {renderToggle()}\n </>\n )}\n </div>\n );\n};\n\nexport default Toggle;\n","import Toggle from './Toggle';\nexport * from './Toggle';\nexport default Toggle;\n"],"mappings":";;;;;;;AAqBA,IAAY,iBAAA,yBAAA,kBAAL;AACL,kBAAA,UAAA;AACA,kBAAA,WAAA;;;AAGF,IAAY,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;IAAU,KAAK;IAAW,WAAW;IAAkB,eAAY;cAC3E,oBAAC,QAAA;KAAK,KAAK;KAAc,WAAW;KAAqB,eAAY;eACnE,oBAAC,OAAA;MACC,OAAM;MACN,QAAO;MACP,SAAQ;MACR,OAAM;MACN,WAAW,OAAO;gBAElB,oBAAC,QAAA;OAAK,GAAE;OAAiC,MAAK;OAAO,aAAY;QAAM;OACnE;MACD;KACF,CAAA;IACD,EACP,cACC,oBAAC,QAAA;GAAK,WAAW;GAAsB,IAAI,WAAW;aACnD,eAAe,WAAW,UAAU,WAAW;IAC3C,CAAA;GAEL;CAGR,MAAM,wBAA4C;AAChD,SACE,qBAAC,OAAA;GAAI,WAAW,OAAO;cACrB,oBAAC,QAAA;IAAK,IAAI;IAAS,WAAW,WAAW,OAAO,2BAA2B;cACxE,MAAM,KAAI,cAAa;AAKtB,YACE,oBAAC,QAAA;MAAoC,WALf,WAAW,GAChC,OAAO,4CAA4C,UAAU,SAAS,WACxE,CAAC;gBAIG,UAAU;QADF,UAAU,UAAU,KAExB;MAET;KACG,EACN,YACC,oBAAC,OAAA;IAAI,IAAI;IAAY,WAAW;cAC7B;KACG,CAAA;IAEJ;;AAIV,QACE,qBAAC,OAAA;EAAI,WAAW;EAA2B,eAAa;EAAQ,oBAAkB,YAAY;aAC3F,mBAAmB,eAAe,QACjC,qBAAA,UAAA,EAAA,UAAA,CACG,cAAc,EACd,iBAAiB,CAAA,EAAA,CACjB,EAEJ,mBAAmB,eAAe,SACjC,qBAAA,UAAA,EAAA,UAAA,CACG,iBAAiB,EACjB,cAAc,CAAA,EAAA,CACd,CAAA;GAED;;AClNV,IAAA,iBDsNe"}
@@ -1,59 +1,8 @@
1
- import "../../uuid.js";
2
- import "../../environment.js";
3
1
  import { n as AnalyticsId } from "../../constants2.js";
4
- import "../../usePseudoClasses.js";
5
- import "../../grid.js";
6
- import "../../palette.js";
7
- import "../../spacers.js";
8
- import "../../theme.js";
9
- import "../../color.js";
10
- import "../../spacing.js";
11
- import "../../currys.js";
12
- import "../../refs.js";
13
- import "../../AsChildSlot.js";
14
- import "../../Icon.js";
15
- import "../../ArrowUpRight.js";
16
2
  import { t as AnchorLink_default } from "../../AnchorLink.js";
17
- import "../../language.js";
18
- import "../../Check.js";
19
- import "../../_rolldown_dynamic_import_helper.js";
20
- import "../../useIsServerSide.js";
21
- import "../../LazyIcon.js";
22
3
  import { r as isComponentWithDisplayName, t as isComponent } from "../../component.js";
23
- import "../../useBreakpoint.js";
24
- import "../../useIdWithFallback.js";
25
- import "../../accessibility.js";
26
- import "../../ErrorWrapper.js";
27
- import "../../Spacer.js";
28
- import "../../Label.js";
29
- import "../../FormFieldTag.js";
30
- import "../../useElementList.js";
31
- import "../../useFocusableElements.js";
32
- import "../../useFocusToggle.js";
33
- import "../../focus.js";
34
- import "../../useFocusTrap.js";
35
- import "../../useIntersectionObserver.js";
36
- import "../../useIsVisible.js";
37
- import "../../debounce.js";
38
- import "../../useLayoutEvent.js";
39
- import "../../usePrevious.js";
40
- import "../../useSize.js";
41
- import "../../useResizeObserver.js";
42
- import "../../useToggle.js";
43
- import "../../useKeyboardEvent.js";
44
- import "../../useOutsideEvent.js";
45
- import "../../mobile.js";
46
- import "../../src.js";
47
- import "../../StatusDot.js";
48
- import "../../Checkbox.js";
49
4
  import { t as Checkbox_default } from "../../Checkbox2.js";
50
- import "../../Title.js";
51
5
  import { t as Title_default } from "../../Title2.js";
52
- import "../../ChevronDown.js";
53
- import "../../FormLayout.js";
54
- import "../../Input.js";
55
- import "../../MaxCharacters.js";
56
- import "../../RadioButton.js";
57
6
  import { t as Select_default } from "../../Select.js";
58
7
  import { t as Slider_default } from "../../Slider.js";
59
8
  import { t as Textarea_default } from "../../Textarea.js";