@helsenorge/designsystem-react 2.4.0 → 2.5.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 (352) hide show
  1. package/Button.js +1 -1
  2. package/Button.js.map +1 -1
  3. package/CHANGELOG.md +13 -0
  4. package/FormGroup.js +1 -1
  5. package/FormGroup.js.map +1 -1
  6. package/HelpBubble.js +1 -1
  7. package/HelpBubble.js.map +1 -1
  8. package/Input.js +1 -1
  9. package/Input.js.map +1 -1
  10. package/Panel.js +1 -1
  11. package/Panel.js.map +1 -1
  12. package/Select.js +2 -0
  13. package/Select.js.map +1 -0
  14. package/Textarea.js +1 -1
  15. package/Textarea.js.map +1 -1
  16. package/Tooltip.js +1 -1
  17. package/Tooltip.js.map +1 -1
  18. package/TooltipWord.js +2 -0
  19. package/TooltipWord.js.map +1 -0
  20. package/__mocks__/uuid.js +1 -1
  21. package/__mocks__/uuid.js.map +1 -1
  22. package/components/AnchorLink/index.js +1 -1
  23. package/components/Avatar/index.js +1 -1
  24. package/components/Avatar/index.js.map +1 -1
  25. package/components/Button/index.js +1 -1
  26. package/components/ButtonWithModal/index.js +1 -1
  27. package/components/ButtonWithModal/index.js.map +1 -1
  28. package/components/Checkbox/index.js +1 -1
  29. package/components/Close/index.js +1 -1
  30. package/components/Dropdown/index.js +1 -1
  31. package/components/Dropdown/index.js.map +1 -1
  32. package/components/Duolist/Duolist.d.ts +6 -4
  33. package/components/Duolist/Duolist.d.ts.map +1 -1
  34. package/components/Duolist/componentdata.json +1 -1
  35. package/components/Duolist/index.js +1 -1
  36. package/components/Duolist/index.js.map +1 -1
  37. package/components/Duolist/styles.module.scss +0 -1
  38. package/components/Expander/index.js +1 -1
  39. package/components/Expander/index.js.map +1 -1
  40. package/components/ExpanderList/index.js +1 -1
  41. package/components/ExpanderList/index.js.map +1 -1
  42. package/components/FormExample/FormExample.d.ts +2 -1
  43. package/components/FormExample/FormExample.d.ts.map +1 -1
  44. package/components/FormExample/componentdata.json +1 -1
  45. package/components/FormExample/index.js +3 -3
  46. package/components/FormExample/index.js.map +1 -1
  47. package/components/FormGroup/FormGroup.d.ts.map +1 -1
  48. package/components/FormGroup/index.js +1 -1
  49. package/components/HelpBubble/HelpBubble.d.ts +6 -3
  50. package/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  51. package/components/HelpBubble/componentdata.json +1 -1
  52. package/components/HelpBubble/index.js +1 -1
  53. package/components/HelpBubble/styles.module.scss +11 -5
  54. package/components/HelpBubble/styles.module.scss.d.ts +0 -1
  55. package/components/HelpBubbleExample/componentdata.json +1 -1
  56. package/components/HelpBubbleExample/index.js +1 -1
  57. package/components/HelpBubbleExample/index.js.map +1 -1
  58. package/components/HighlightBox/index.js +1 -1
  59. package/components/HighlightBox/index.js.map +1 -1
  60. package/components/HorizontalScroll/index.js +1 -1
  61. package/components/Icons/AcupunctureBack.js +1 -1
  62. package/components/Icons/AcupunctureBack.js.map +1 -1
  63. package/components/Icons/AlarmClock.js +1 -1
  64. package/components/Icons/AlarmClock.js.map +1 -1
  65. package/components/Icons/AlertSignFill.js +1 -1
  66. package/components/Icons/AlertSignFill.js.map +1 -1
  67. package/components/Icons/AlertSignStroke.js +1 -1
  68. package/components/Icons/AlertSignStroke.js.map +1 -1
  69. package/components/Icons/Archive.js +1 -1
  70. package/components/Icons/Archive.js.map +1 -1
  71. package/components/Icons/ArrowDown.js +1 -1
  72. package/components/Icons/ArrowDown.js.map +1 -1
  73. package/components/Icons/ArrowLeft.js +1 -1
  74. package/components/Icons/ArrowLeft.js.map +1 -1
  75. package/components/Icons/ArrowRight.js +1 -1
  76. package/components/Icons/ArrowRight.js.map +1 -1
  77. package/components/Icons/ArrowUp.js +1 -1
  78. package/components/Icons/ArrowUp.js.map +1 -1
  79. package/components/Icons/ArrowUpRight.js +1 -1
  80. package/components/Icons/ArrowUpRight.js.map +1 -1
  81. package/components/Icons/Attachment.js +1 -1
  82. package/components/Icons/Attachment.js.map +1 -1
  83. package/components/Icons/Avatar.js +1 -1
  84. package/components/Icons/Avatar.js.map +1 -1
  85. package/components/Icons/Bus.js +1 -1
  86. package/components/Icons/Bus.js.map +1 -1
  87. package/components/Icons/Calendar.js +1 -1
  88. package/components/Icons/Calendar.js.map +1 -1
  89. package/components/Icons/CalendarChange.js +1 -1
  90. package/components/Icons/CalendarChange.js.map +1 -1
  91. package/components/Icons/CalendarCheck.js +1 -1
  92. package/components/Icons/CalendarCheck.js.map +1 -1
  93. package/components/Icons/CalendarSave.js +1 -1
  94. package/components/Icons/CalendarSave.js.map +1 -1
  95. package/components/Icons/Change.js +1 -1
  96. package/components/Icons/Change.js.map +1 -1
  97. package/components/Icons/Check.js +1 -1
  98. package/components/Icons/Check.js.map +1 -1
  99. package/components/Icons/CheckFill.js +1 -1
  100. package/components/Icons/CheckFill.js.map +1 -1
  101. package/components/Icons/ChevronDown.js +1 -1
  102. package/components/Icons/ChevronDown.js.map +1 -1
  103. package/components/Icons/ChevronLeft.js +1 -1
  104. package/components/Icons/ChevronLeft.js.map +1 -1
  105. package/components/Icons/ChevronRight.js +1 -1
  106. package/components/Icons/ChevronRight.js.map +1 -1
  107. package/components/Icons/ChevronUp.js +1 -1
  108. package/components/Icons/ChevronUp.js.map +1 -1
  109. package/components/Icons/ChevronsDown.js +1 -1
  110. package/components/Icons/ChevronsDown.js.map +1 -1
  111. package/components/Icons/ChevronsUp.js +1 -1
  112. package/components/Icons/ChevronsUp.js.map +1 -1
  113. package/components/Icons/Contacts.js +1 -1
  114. package/components/Icons/Contacts.js.map +1 -1
  115. package/components/Icons/Copy.js +1 -1
  116. package/components/Icons/Copy.js.map +1 -1
  117. package/components/Icons/Download.js +1 -1
  118. package/components/Icons/Download.js.map +1 -1
  119. package/components/Icons/EChat.js +1 -1
  120. package/components/Icons/EChat.js.map +1 -1
  121. package/components/Icons/EnterFullScreen.js +1 -1
  122. package/components/Icons/EnterFullScreen.js.map +1 -1
  123. package/components/Icons/Envelope.js +1 -1
  124. package/components/Icons/Envelope.js.map +1 -1
  125. package/components/Icons/Eraser.js +1 -1
  126. package/components/Icons/Eraser.js.map +1 -1
  127. package/components/Icons/ErrorSignFill.js +1 -1
  128. package/components/Icons/ErrorSignFill.js.map +1 -1
  129. package/components/Icons/ErrorSignStroke.js +1 -1
  130. package/components/Icons/ErrorSignStroke.js.map +1 -1
  131. package/components/Icons/ExitFullScreen.js +1 -1
  132. package/components/Icons/ExitFullScreen.js.map +1 -1
  133. package/components/Icons/Eye.js +1 -1
  134. package/components/Icons/Eye.js.map +1 -1
  135. package/components/Icons/Form.js +1 -1
  136. package/components/Icons/Form.js.map +1 -1
  137. package/components/Icons/Forward.js +1 -1
  138. package/components/Icons/Forward.js.map +1 -1
  139. package/components/Icons/Gallery.js +1 -1
  140. package/components/Icons/Gallery.js.map +1 -1
  141. package/components/Icons/Globe.js +1 -1
  142. package/components/Icons/Globe.js.map +1 -1
  143. package/components/Icons/Group.js +1 -1
  144. package/components/Icons/Group.js.map +1 -1
  145. package/components/Icons/Heart.js +1 -1
  146. package/components/Icons/Heart.js.map +1 -1
  147. package/components/Icons/HelpSign.js +1 -1
  148. package/components/Icons/HelpSign.js.map +1 -1
  149. package/components/Icons/History.js +1 -1
  150. package/components/Icons/History.js.map +1 -1
  151. package/components/Icons/Home.js +1 -1
  152. package/components/Icons/Home.js.map +1 -1
  153. package/components/Icons/Hospital.js +1 -1
  154. package/components/Icons/Hospital.js.map +1 -1
  155. package/components/Icons/Hourglass.js +1 -1
  156. package/components/Icons/Hourglass.js.map +1 -1
  157. package/components/Icons/Icon.js +1 -1
  158. package/components/Icons/Icon.js.map +1 -1
  159. package/components/Icons/InfoSignFill.js +1 -1
  160. package/components/Icons/InfoSignFill.js.map +1 -1
  161. package/components/Icons/InfoSignStroke.js +1 -1
  162. package/components/Icons/InfoSignStroke.js.map +1 -1
  163. package/components/Icons/Journal.js +1 -1
  164. package/components/Icons/Journal.js.map +1 -1
  165. package/components/Icons/List.js +1 -1
  166. package/components/Icons/List.js.map +1 -1
  167. package/components/Icons/Location.js +1 -1
  168. package/components/Icons/Location.js.map +1 -1
  169. package/components/Icons/Lock.js +1 -1
  170. package/components/Icons/Lock.js.map +1 -1
  171. package/components/Icons/Medicine.js +1 -1
  172. package/components/Icons/Medicine.js.map +1 -1
  173. package/components/Icons/Menu.js +1 -1
  174. package/components/Icons/Menu.js.map +1 -1
  175. package/components/Icons/Minus.js +1 -1
  176. package/components/Icons/Minus.js.map +1 -1
  177. package/components/Icons/MobilePhone.js +1 -1
  178. package/components/Icons/MobilePhone.js.map +1 -1
  179. package/components/Icons/NoAccess.js +1 -1
  180. package/components/Icons/NoAccess.js.map +1 -1
  181. package/components/Icons/NoEye.js +1 -1
  182. package/components/Icons/NoEye.js.map +1 -1
  183. package/components/Icons/NoFilter.js +1 -1
  184. package/components/Icons/NoFilter.js.map +1 -1
  185. package/components/Icons/PaperPlane.js +1 -1
  186. package/components/Icons/PaperPlane.js.map +1 -1
  187. package/components/Icons/Pause.js +1 -1
  188. package/components/Icons/Pause.js.map +1 -1
  189. package/components/Icons/Pencil.js +1 -1
  190. package/components/Icons/Pencil.js.map +1 -1
  191. package/components/Icons/PersonalPlan.js +1 -1
  192. package/components/Icons/PersonalPlan.js.map +1 -1
  193. package/components/Icons/Play.js +1 -1
  194. package/components/Icons/Play.js.map +1 -1
  195. package/components/Icons/PlusLarge.js +1 -1
  196. package/components/Icons/PlusLarge.js.map +1 -1
  197. package/components/Icons/PlusSmall.js +1 -1
  198. package/components/Icons/PlusSmall.js.map +1 -1
  199. package/components/Icons/Printer.js +1 -1
  200. package/components/Icons/Printer.js.map +1 -1
  201. package/components/Icons/QrCode.js +1 -1
  202. package/components/Icons/QrCode.js.map +1 -1
  203. package/components/Icons/Receptionist.js +1 -1
  204. package/components/Icons/Receptionist.js.map +1 -1
  205. package/components/Icons/Referral.js +1 -1
  206. package/components/Icons/Referral.js.map +1 -1
  207. package/components/Icons/Refresh.js +1 -1
  208. package/components/Icons/Refresh.js.map +1 -1
  209. package/components/Icons/Reply.js +1 -1
  210. package/components/Icons/Reply.js.map +1 -1
  211. package/components/Icons/Save.js +1 -1
  212. package/components/Icons/Save.js.map +1 -1
  213. package/components/Icons/Search.js +1 -1
  214. package/components/Icons/Search.js.map +1 -1
  215. package/components/Icons/SectionSign.js +1 -1
  216. package/components/Icons/SectionSign.js.map +1 -1
  217. package/components/Icons/Settings.js +1 -1
  218. package/components/Icons/Settings.js.map +1 -1
  219. package/components/Icons/Share.js +1 -1
  220. package/components/Icons/Share.js.map +1 -1
  221. package/components/Icons/SpeechBubble.js +1 -1
  222. package/components/Icons/SpeechBubble.js.map +1 -1
  223. package/components/Icons/Stopwatch.js +1 -1
  224. package/components/Icons/Stopwatch.js.map +1 -1
  225. package/components/Icons/SupportingPerson.js +1 -1
  226. package/components/Icons/SupportingPerson.js.map +1 -1
  227. package/components/Icons/Syringe.js +1 -1
  228. package/components/Icons/Syringe.js.map +1 -1
  229. package/components/Icons/TimePassing.js +1 -1
  230. package/components/Icons/TimePassing.js.map +1 -1
  231. package/components/Icons/Toolbox.js +1 -1
  232. package/components/Icons/Toolbox.js.map +1 -1
  233. package/components/Icons/TrashCan.js +1 -1
  234. package/components/Icons/TrashCan.js.map +1 -1
  235. package/components/Icons/Undo.js +1 -1
  236. package/components/Icons/Undo.js.map +1 -1
  237. package/components/Icons/Upload.js +1 -1
  238. package/components/Icons/Upload.js.map +1 -1
  239. package/components/Icons/Vaccine.js +1 -1
  240. package/components/Icons/Vaccine.js.map +1 -1
  241. package/components/Icons/VerticalDots.js +1 -1
  242. package/components/Icons/VerticalDots.js.map +1 -1
  243. package/components/Icons/VideoCamera.js +1 -1
  244. package/components/Icons/VideoCamera.js.map +1 -1
  245. package/components/Icons/VideoChat.js +1 -1
  246. package/components/Icons/VideoChat.js.map +1 -1
  247. package/components/Icons/Wallet.js +1 -1
  248. package/components/Icons/Wallet.js.map +1 -1
  249. package/components/Icons/Watch.js +1 -1
  250. package/components/Icons/Watch.js.map +1 -1
  251. package/components/Icons/X.js +1 -1
  252. package/components/Icons/X.js.map +1 -1
  253. package/components/Icons/Zoom.js +1 -1
  254. package/components/Icons/Zoom.js.map +1 -1
  255. package/components/Icons/index.js +1 -1
  256. package/components/Input/Input.d.ts +0 -1
  257. package/components/Input/Input.d.ts.map +1 -1
  258. package/components/Input/index.js +1 -1
  259. package/components/LinkList/index.js +1 -1
  260. package/components/LinkList/index.js.map +1 -1
  261. package/components/Loader/index.js +1 -1
  262. package/components/Loader/index.js.map +1 -1
  263. package/components/Modal/index.js +1 -1
  264. package/components/NotificationPanel/index.js +1 -1
  265. package/components/NotificationPanel/index.js.map +1 -1
  266. package/components/Panel/index.js +1 -1
  267. package/components/PanelList/index.js +1 -1
  268. package/components/PanelList/index.js.map +1 -1
  269. package/components/Progressbar/index.js +1 -1
  270. package/components/Progressbar/index.js.map +1 -1
  271. package/components/RadioButton/index.js +1 -1
  272. package/components/Select/Select.d.ts +30 -0
  273. package/components/Select/Select.d.ts.map +1 -0
  274. package/components/Select/componentdata.json +1 -0
  275. package/components/Select/index.d.ts +4 -0
  276. package/components/Select/index.d.ts.map +1 -0
  277. package/components/Select/index.js +2 -0
  278. package/components/Select/index.js.map +1 -0
  279. package/components/Select/styles.module.scss +125 -0
  280. package/components/Select/styles.module.scss.d.ts +21 -0
  281. package/components/Slider/index.js +1 -1
  282. package/components/Slider/index.js.map +1 -1
  283. package/components/StatusDot/index.js +1 -1
  284. package/components/StatusDot/index.js.map +1 -1
  285. package/components/Table/TableExpandedRow/index.js +1 -1
  286. package/components/Table/TableExpanderCell/index.js +1 -1
  287. package/components/Table/TableHeadCell/index.js +1 -1
  288. package/components/Table/TableRow/index.js +1 -1
  289. package/components/Table/index.js +1 -1
  290. package/components/Table/index.js.map +1 -1
  291. package/components/Tag/index.js +1 -1
  292. package/components/Tag/index.js.map +1 -1
  293. package/components/Textarea/Textarea.d.ts.map +1 -1
  294. package/components/Textarea/index.js +1 -1
  295. package/components/Tile/index.js +1 -1
  296. package/components/Tile/index.js.map +1 -1
  297. package/components/Tooltip/Tooltip.d.ts +11 -12
  298. package/components/Tooltip/Tooltip.d.ts.map +1 -1
  299. package/components/Tooltip/TooltipWord/TooltipWord.d.ts +20 -0
  300. package/components/Tooltip/TooltipWord/TooltipWord.d.ts.map +1 -0
  301. package/components/Tooltip/TooltipWord/componentdata.json +1 -0
  302. package/components/Tooltip/TooltipWord/index.d.ts +4 -0
  303. package/components/Tooltip/TooltipWord/index.d.ts.map +1 -0
  304. package/components/Tooltip/TooltipWord/index.js +2 -0
  305. package/components/Tooltip/TooltipWord/index.js.map +1 -0
  306. package/components/Tooltip/{styles.module.scss → TooltipWord/styles.module.scss} +3 -6
  307. package/components/Tooltip/{styles.module.scss.d.ts → TooltipWord/styles.module.scss.d.ts} +0 -0
  308. package/components/Tooltip/componentdata.json +1 -1
  309. package/components/Tooltip/index.js +1 -1
  310. package/components/TooltipExample/TooltipExample.d.ts.map +1 -1
  311. package/components/TooltipExample/componentdata.json +1 -1
  312. package/components/TooltipExample/index.js +1 -1
  313. package/components/TooltipExample/index.js.map +1 -1
  314. package/components/Validation/index.js +1 -1
  315. package/constants.d.ts +2 -0
  316. package/constants.d.ts.map +1 -1
  317. package/constants.js +1 -1
  318. package/constants.js.map +1 -1
  319. package/hooks/useDelayedState.d.ts +9 -0
  320. package/hooks/useDelayedState.d.ts.map +1 -0
  321. package/hooks/useDelayedState.js +2 -0
  322. package/hooks/useDelayedState.js.map +1 -0
  323. package/hooks/useLayoutEvent.js +1 -1
  324. package/hooks/useLayoutEvent.js.map +1 -1
  325. package/hooks/useSize.js +1 -1
  326. package/hooks/useSize.js.map +1 -1
  327. package/hooks/useSticky.js +1 -1
  328. package/hooks/useSticky.js.map +1 -1
  329. package/hooks/useUuid.js +1 -1
  330. package/hooks/useUuid.js.map +1 -1
  331. package/index.js +1 -1
  332. package/package.json +1 -1
  333. package/utils/accessibility.js +2 -0
  334. package/utils/accessibility.js.map +1 -0
  335. package/utils/debounce.js +2 -0
  336. package/utils/debounce.js.map +1 -0
  337. package/utils/environment.js +2 -0
  338. package/utils/environment.js.map +1 -0
  339. package/utils/loremtext.js +2 -0
  340. package/utils/loremtext.js.map +1 -0
  341. package/utils/refs.js +2 -0
  342. package/utils/refs.js.map +1 -0
  343. package/utils/uuid.js +2 -0
  344. package/utils/uuid.js.map +1 -0
  345. package/utils/viewport.js +2 -0
  346. package/utils/viewport.js.map +1 -0
  347. package/uuid.js +1 -1
  348. package/uuid.js.map +1 -1
  349. package/accessibility.js +0 -2
  350. package/accessibility.js.map +0 -1
  351. package/debounce.js +0 -2
  352. package/debounce.js.map +0 -1
@@ -1 +1 @@
1
- {"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende hjelpeblubb","name":"children","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"ReactNode"}},"description":{"defaultValue":null,"description":"Teksten som skal vises i hjelpeblubben","name":"description","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":true,"type":{"name":"ReactNode"}},"testId":{"defaultValue":null,"description":"Valgfri test-id","name":"testId","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":false,"type":{"name":"string"}}}}
1
+ {"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende tooltip","name":"children","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"string & ReactNode"}},"description":{"defaultValue":null,"description":"Teksten som skal vises i tooltip","name":"description","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":true,"type":{"name":"ReactNode"}},"testId":{"defaultValue":null,"description":"Valgfri test-id","name":"testId","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":false,"type":{"name":"string"}}}}
@@ -1,2 +1,2 @@
1
- import"../../Tooltip.js";import{T as D,b as E,T as F,u as G,a as H}from"../../Tooltip.js";import"react";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../HelpBubble.js";import"classnames";import"../../hooks/useInterval.js";import"../../hooks/useIsVisible.js";import"../../hooks/useIntersectionObserver.js";import"../../hooks/useLayoutEvent.js";import"../../debounce.js";import"../../hooks/useSize.js";import"../../AnchorLink.js";import"../Icons/Icon.js";import"../Icons/ArrowUpRight.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../../hooks/useHover.js";import"../AnchorLink/styles.module.scss";import"../../Close.js";import"../Icons/X.js";import"../Close/styles.module.scss";import"../../hooks/useBreakpoint.js";import"../HelpBubble/styles.module.scss";import"./styles.module.scss";export{D as Tooltip,E as TooltipOpenProvider,F as default,G as useTooltipOpen,H as useTooltipOpenToggle};
1
+ import"../../Tooltip.js";import{T as G,a as H,T as I}from"../../Tooltip.js";import"react";import"../../hooks/useDelayedState.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../../HelpBubble.js";import"classnames";import"../../constants.js";import"../../hooks/useInterval.js";import"../../hooks/useIsVisible.js";import"../../hooks/useIntersectionObserver.js";import"../../hooks/useLayoutEvent.js";import"../../utils/debounce.js";import"../../hooks/useSize.js";import"../../AnchorLink.js";import"../Icons/Icon.js";import"../Icons/ArrowUpRight.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../../hooks/useHover.js";import"../AnchorLink/styles.module.scss";import"../../Close.js";import"../Icons/X.js";import"../Close/styles.module.scss";import"../../hooks/useBreakpoint.js";import"../HelpBubble/styles.module.scss";import"../../TooltipWord.js";import"./TooltipWord/styles.module.scss";export{G as Tooltip,H as TooltipOpenProvider,I as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipExample.d.ts","sourceRoot":"","sources":["../../../src/components/TooltipExample/TooltipExample.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAgB,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAGxE,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAc1C,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"TooltipExample.d.ts","sourceRoot":"","sources":["../../../src/components/TooltipExample/TooltipExample.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAgB,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAGxE,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAe1C,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende hjelpeblubb","name":"children","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"ReactNode"}},"description":{"defaultValue":null,"description":"Teksten som skal vises i hjelpeblubben","name":"description","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":true,"type":{"name":"ReactNode"}},"testId":{"defaultValue":null,"description":"Valgfri test-id","name":"testId","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":false,"type":{"name":"string"}}}}
1
+ {"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende tooltip","name":"children","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"string & ReactNode"}},"description":{"defaultValue":null,"description":"Teksten som skal vises i tooltip","name":"description","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":true,"type":{"name":"ReactNode"}},"testId":{"defaultValue":null,"description":"Valgfri test-id","name":"testId","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":false,"type":{"name":"string"}}}}
@@ -1,2 +1,2 @@
1
- import i from"react";import{b as r,T as e}from"../../Tooltip.js";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../HelpBubble.js";import"classnames";import"../../hooks/useInterval.js";import"../../hooks/useIsVisible.js";import"../../hooks/useIntersectionObserver.js";import"../../hooks/useLayoutEvent.js";import"../../debounce.js";import"../../hooks/useSize.js";import"../../AnchorLink.js";import"../Icons/Icon.js";import"../Icons/ArrowUpRight.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../../hooks/useHover.js";import"../AnchorLink/styles.module.scss";import"../../Close.js";import"../Icons/X.js";import"../Close/styles.module.scss";import"../../hooks/useBreakpoint.js";import"../HelpBubble/styles.module.scss";import"../Tooltip/styles.module.scss";const o="Dolore quis tempor culpa exercitation laboris. Enim enim pariatur veniam nisi ad quis fugiat magna occaecat nisi. Excepteur ad ad duis quis mollit ex. Laboris duis velit eu eiusmod ea in ex aliqua. Est proident proident dolor veniam nostrud aliquip occaecat dolore sunt laboris nisi ipsum Lorem nisi. Magna sunt ex occaecat amet id. Eiusmod magna Lorem proident est occaecat pariatur sunt esse nostrud. Mollit reprehenderit velit veniam amet ipsum veniam et. Dolor sunt adipisicing enim dolore quis qui occaecat esse quis ut fugiat laboris. ",z=t=>i.createElement(r,null,i.createElement(i.Fragment,null,i.createElement(e,{...t},"Et tooltip her.")," "+o,"Dette er ",i.createElement(e,{...t},t.children)," som skal ha n\xE6rmere forklaring.",o,i.createElement(e,{...t},"Enda et tooltip her.")));export{z as default};
1
+ import t from"react";import{a as e,T as o}from"../../Tooltip.js";import{longLoremText as m}from"../../utils/loremtext.js";import"../../hooks/useDelayedState.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../../HelpBubble.js";import"classnames";import"../../constants.js";import"../../hooks/useInterval.js";import"../../hooks/useIsVisible.js";import"../../hooks/useIntersectionObserver.js";import"../../hooks/useLayoutEvent.js";import"../../utils/debounce.js";import"../../hooks/useSize.js";import"../../AnchorLink.js";import"../Icons/Icon.js";import"../Icons/ArrowUpRight.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../../hooks/useHover.js";import"../AnchorLink/styles.module.scss";import"../../Close.js";import"../Icons/X.js";import"../Close/styles.module.scss";import"../../hooks/useBreakpoint.js";import"../HelpBubble/styles.module.scss";import"../../TooltipWord.js";import"../Tooltip/TooltipWord/styles.module.scss";const G=r=>t.createElement(e,null,t.createElement(t.Fragment,null,t.createElement(o,{...r},"Et tooltip her.")," "+m,t.createElement("button",null,"Knapp"),"Dette er ",t.createElement(o,{...r},r.children)," som skal ha n\xE6rmere forklaring.",m,t.createElement(o,{...r},"Enda et tooltip her.")));export{G as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/loremtext.ts","../../../src/components/TooltipExample/TooltipExample.tsx"],"sourcesContent":["export const shortLoremText = 'Officia laboris in sit nisi consectetur eu.';\nexport const mediumLoremText =\n 'Cupidatat culpa dolor id nulla sit commodo elit aliqua cillum. Reprehenderit aute aute enim non adipisicing duis adipisicing id laboris aliquip tempor amet. Non occaecat minim ad duis sunt et.';\nexport const longLoremText =\n 'Dolore quis tempor culpa exercitation laboris. Enim enim pariatur veniam nisi ad quis fugiat magna occaecat nisi. Excepteur ad ad duis quis mollit ex. Laboris duis velit eu eiusmod ea in ex aliqua. Est proident proident dolor veniam nostrud aliquip occaecat dolore sunt laboris nisi ipsum Lorem nisi. Magna sunt ex occaecat amet id. Eiusmod magna Lorem proident est occaecat pariatur sunt esse nostrud. Mollit reprehenderit velit veniam amet ipsum veniam et. Dolor sunt adipisicing enim dolore quis qui occaecat esse quis ut fugiat laboris. ';\n\nexport default longLoremText;\n","import React from 'react';\n\nimport Tooltip, { TooltipProps, TooltipOpenProvider } from '../Tooltip';\nimport longLoremText from '../../utils/loremtext';\n\nconst TooltipExample: React.FC<TooltipProps> = props => {\n return (\n <TooltipOpenProvider>\n <>\n <Tooltip {...props}>{'Et tooltip her.'}</Tooltip>\n {' ' + longLoremText}\n {'Dette er '}\n <Tooltip {...props}>{props.children}</Tooltip>\n {' som skal ha nærmere forklaring.'}\n {longLoremText}\n <Tooltip {...props}>{'Enda et tooltip her.'}</Tooltip>\n </>\n </TooltipOpenProvider>\n );\n};\n\nexport default TooltipExample;\n"],"names":["longLoremText","TooltipExample","props","React","TooltipOpenProvider","Tooltip"],"mappings":"o5BAGO,MAAMA,EACX,giBCCIC,EAAkDC,GAEpDC,EAAA,cAACC,EACC,KAAAD,EAAA,cAAAA,EAAA,SAAA,KACGA,EAAA,cAAAE,EAAA,CAAS,GAAGH,CAAA,EAAQ,iBAAkB,EACtC,IAAMF,EACN,YACAG,EAAA,cAAAE,EAAA,CAAS,GAAGH,CAAA,EAAQA,EAAM,QAAS,EACnC,sCACAF,EACAG,EAAA,cAAAE,EAAA,CAAS,GAAGH,CAAA,EAAQ,sBAAuB,CAC9C,CACF"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/TooltipExample/TooltipExample.tsx"],"sourcesContent":["import React from 'react';\n\nimport Tooltip, { TooltipProps, TooltipOpenProvider } from '../Tooltip';\nimport longLoremText from '../../utils/loremtext';\n\nconst TooltipExample: React.FC<TooltipProps> = props => {\n return (\n <TooltipOpenProvider>\n <>\n <Tooltip {...props}>{'Et tooltip her.'}</Tooltip>\n {' ' + longLoremText}\n <button>{'Knapp'}</button>\n {'Dette er '}\n <Tooltip {...props}>{props.children}</Tooltip>\n {' som skal ha nærmere forklaring.'}\n {longLoremText}\n <Tooltip {...props}>{'Enda et tooltip her.'}</Tooltip>\n </>\n </TooltipOpenProvider>\n );\n};\n\nexport default TooltipExample;\n"],"names":["TooltipExample","props","React","TooltipOpenProvider","Tooltip","longLoremText"],"mappings":"skCAKA,MAAMA,EAAkDC,GAEpDC,EAAA,cAACC,EACC,KAAAD,EAAA,cAAAA,EAAA,SAAA,KACGA,EAAA,cAAAE,EAAA,CAAS,GAAGH,CAAQ,EAAA,iBAAkB,EACtC,IAAMI,kBACN,SAAQ,KAAA,OAAQ,EAChB,YACAH,EAAA,cAAAE,EAAA,CAAS,GAAGH,CAAA,EAAQA,EAAM,QAAS,EACnC,sCACAI,EACAH,EAAA,cAAAE,EAAA,CAAS,GAAGH,CAAA,EAAQ,sBAAuB,CAC9C,CACF"}
@@ -1,2 +1,2 @@
1
- import"../../Validation.js";import{V as F,V as G}from"../../Validation.js";import"react";import"classnames";import"../../FormGroup.js";import"../FormGroup/styles.module.scss";import"../../Checkbox.js";import"../../uuid.js";import"../Icons/Check.js";import"../Icons/Icon.js";import"../../constants.js";import"../../hooks/useUuid.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../Checkbox/styles.module.scss";import"../../RadioButton.js";import"../RadioButton/styles.module.scss";import"../../Input.js";import"../../hooks/useBreakpoint.js";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../Input/styles.module.scss";import"../../Title.js";import"../Title/styles.module.scss";import"../../FormLayout.js";import"../FormLayout/styles.module.scss";import"./styles.module.scss";export{F as Validation,G as default};
1
+ import"../../Validation.js";import{V as J,V as K}from"../../Validation.js";import"react";import"classnames";import"../../FormGroup.js";import"../FormGroup/styles.module.scss";import"../../Checkbox.js";import"../../uuid.js";import"../../utils/environment.js";import"../Icons/Check.js";import"../Icons/Icon.js";import"../../constants.js";import"../../hooks/useUuid.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../Checkbox/styles.module.scss";import"../../RadioButton.js";import"../RadioButton/styles.module.scss";import"../../Input.js";import"../../hooks/useBreakpoint.js";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../Input/styles.module.scss";import"../../Title.js";import"../Title/styles.module.scss";import"../../FormLayout.js";import"../FormLayout/styles.module.scss";import"../../Select.js";import"../Select/styles.module.scss";import"../Icons/ChevronDown.js";import"./styles.module.scss";export{J as Validation,K as default};
2
2
  //# sourceMappingURL=index.js.map
package/constants.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare enum ZIndex {
10
10
  Modal = 1300000,
11
11
  ExpanderTrigger = 10000
12
12
  }
13
+ export declare const AVERAGE_CHARACTER_WIDTH_PX = 12;
13
14
  export interface HTMLButtonProps {
14
15
  autoFocus?: boolean;
15
16
  disabled?: boolean;
@@ -77,6 +78,7 @@ export declare enum AnalyticsId {
77
78
  Portal = "portal",
78
79
  Progressbar = "progressbar",
79
80
  RadioButton = "radio-button",
81
+ Select = "select",
80
82
  Slider = "slider",
81
83
  Spacer = "spacer",
82
84
  StatusDot = "status-dot",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"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"}
package/constants.js CHANGED
@@ -1,2 +1,2 @@
1
- var o=(r=>(r[r.XXSmall=24]="XXSmall",r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge",r))(o||{}),e=(r=>(r[r.Modal=13e5]="Modal",r[r.ExpanderTrigger=1e4]="ExpanderTrigger",r))(e||{}),a=(r=>(r.onwhite="onwhite",r.ongrey="ongrey",r.onblueberry="onblueberry",r.ondark="ondark",r.oninvalid="oninvalid",r))(a||{}),p=(r=>(r.normal="normal",r.bigform="bigform",r))(p||{}),g=(r=>(r.AnchorLink="anchor-link",r.Avatar="avatar",r.Badge="badge",r.Button="button",r.Checkbox="checkbox",r.Close="close",r.Dropdown="dropdown",r.Duolist="duolist",r.Expander="expander",r.ExpanderList="expander-list",r.ExpanderListExpander="expander-list-expander",r.FormGroup="form-group",r.FormLayout="form-layout",r.HelpBubble="help-bubble",r.HighlightBox="highlight-box",r.Icon="icon",r.Input="input",r.Link="link",r.LinkList="link-list",r.List="list",r.Loader="loader",r.Logo="logo",r.Modal="modal",r.NotificationPanel="notification-panel",r.Panel="panel",r.PanelList="panel-list",r.Portal="portal",r.Progressbar="progressbar",r.RadioButton="radio-button",r.Slider="slider",r.Spacer="spacer",r.StatusDot="status-dot",r.Table="table",r.Tag="tag",r.TagList="tag-list",r.Textarea="textarea",r.Tile="tile",r.Title="title",r.Tooltip="tooltip",r.Validation="validation",r))(g||{}),u=(r=>(r.Enter="Enter",r.Escape="Escape",r.ArrowDown="ArrowDown",r.ArrowUp="ArrowUp",r.Home="Home",r.End="End",r))(u||{});export{g as AnalyticsId,a as FormMode,p as FormVariant,o as IconSize,u as KeyboardEventKey,e as ZIndex};
1
+ var o=(r=>(r[r.XXSmall=24]="XXSmall",r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge",r))(o||{}),e=(r=>(r[r.Modal=13e5]="Modal",r[r.ExpanderTrigger=1e4]="ExpanderTrigger",r))(e||{});const u=12;var a=(r=>(r.onwhite="onwhite",r.ongrey="ongrey",r.onblueberry="onblueberry",r.ondark="ondark",r.oninvalid="oninvalid",r))(a||{}),p=(r=>(r.normal="normal",r.bigform="bigform",r))(p||{}),g=(r=>(r.AnchorLink="anchor-link",r.Avatar="avatar",r.Badge="badge",r.Button="button",r.Checkbox="checkbox",r.Close="close",r.Dropdown="dropdown",r.Duolist="duolist",r.Expander="expander",r.ExpanderList="expander-list",r.ExpanderListExpander="expander-list-expander",r.FormGroup="form-group",r.FormLayout="form-layout",r.HelpBubble="help-bubble",r.HighlightBox="highlight-box",r.Icon="icon",r.Input="input",r.Link="link",r.LinkList="link-list",r.List="list",r.Loader="loader",r.Logo="logo",r.Modal="modal",r.NotificationPanel="notification-panel",r.Panel="panel",r.PanelList="panel-list",r.Portal="portal",r.Progressbar="progressbar",r.RadioButton="radio-button",r.Select="select",r.Slider="slider",r.Spacer="spacer",r.StatusDot="status-dot",r.Table="table",r.Tag="tag",r.TagList="tag-list",r.Textarea="textarea",r.Tile="tile",r.Title="title",r.Tooltip="tooltip",r.Validation="validation",r))(g||{}),l=(r=>(r.Enter="Enter",r.Escape="Escape",r.ArrowDown="ArrowDown",r.ArrowUp="ArrowUp",r.Home="Home",r.End="End",r))(l||{});export{u as AVERAGE_CHARACTER_WIDTH_PX,g as AnalyticsId,a as FormMode,p as FormVariant,o as IconSize,l as KeyboardEventKey,e as ZIndex};
2
2
  //# sourceMappingURL=constants.js.map
package/constants.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n ExpanderTrigger = 10000,\n}\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormVariant {\n normal = 'normal',\n bigform = 'bigform',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n Expander = 'expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Input = 'input',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n Portal = 'portal',\n Progressbar = 'progressbar',\n RadioButton = 'radio-button',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n Home = 'Home',\n End = 'End',\n}\n"],"names":["IconSize","ZIndex","FormMode","FormVariant","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,QAAU,IAAV,UACAA,EAAAA,EAAA,OAAS,IAAT,SACAA,EAAAA,EAAA,MAAQ,IAAR,QACAA,EAAAA,EAAA,OAAS,IAAT,SACAA,EAAAA,EAAA,MAAQ,IAAR,QACAA,EAAAA,EAAA,OAAS,KAAT,SANUA,IAAAA,GAAA,CAAA,CAAA,EASAC,GAAAA,IACVA,EAAAA,EAAA,MAAQ,MAAR,QACAA,EAAAA,EAAA,gBAAkB,KAAlB,kBAFUA,IAAAA,GAAA,CAAA,CAAA,EA4CAC,GAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,UAAY,YALFA,IAAAA,GAAA,CAAA,CAAA,EAQAC,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UAFAA,IAAAA,GAAA,CAAA,CAAA,EAKAC,GAAAA,IACVA,EAAA,WAAa,cACbA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,aAAe,gBACfA,EAAA,qBAAuB,yBACvBA,EAAA,UAAY,aACZA,EAAA,WAAa,cACbA,EAAA,WAAa,cACbA,EAAA,aAAe,gBACfA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,SAAW,YACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,kBAAoB,qBACpBA,EAAA,MAAQ,QACRA,EAAA,UAAY,aACZA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,YAAc,eACdA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,aACZA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,QAAU,WACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,QAAU,UACVA,EAAA,WAAa,aAxCHA,IAAAA,GAAA,CAAA,CAAA,EA2CAC,GAAAA,IACVA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,IAAM,MANIA,IAAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n ExpanderTrigger = 10000,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormVariant {\n normal = 'normal',\n bigform = 'bigform',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n Expander = 'expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Input = 'input',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n Portal = 'portal',\n Progressbar = 'progressbar',\n RadioButton = 'radio-button',\n Select = 'select',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n Home = 'Home',\n End = 'End',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormVariant","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,QAAU,IAAV,UACAA,EAAAA,EAAA,OAAS,IAAT,SACAA,EAAAA,EAAA,MAAQ,IAAR,QACAA,EAAAA,EAAA,OAAS,IAAT,SACAA,EAAAA,EAAA,MAAQ,IAAR,QACAA,EAAAA,EAAA,OAAS,KAAT,SANUA,IAAAA,GAAA,CAAA,CAAA,EASAC,GAAAA,IACVA,EAAAA,EAAA,MAAQ,MAAR,QACAA,EAAAA,EAAA,gBAAkB,KAAlB,kBAFUA,IAAAA,GAAA,CAAA,CAAA,EAKL,MAAMC,EAA6B,GAyC9B,IAAAC,GAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,UAAY,YALFA,IAAAA,GAAA,CAAA,CAAA,EAQAC,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UAFAA,IAAAA,GAAA,CAAA,CAAA,EAKAC,GAAAA,IACVA,EAAA,WAAa,cACbA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,aAAe,gBACfA,EAAA,qBAAuB,yBACvBA,EAAA,UAAY,aACZA,EAAA,WAAa,cACbA,EAAA,WAAa,cACbA,EAAA,aAAe,gBACfA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,SAAW,YACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,kBAAoB,qBACpBA,EAAA,MAAQ,QACRA,EAAA,UAAY,aACZA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,YAAc,eACdA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,aACZA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,QAAU,WACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,QAAU,UACVA,EAAA,WAAa,aAzCHA,IAAAA,GAAA,CAAA,CAAA,EA4CAC,GAAAA,IACVA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,IAAM,MANIA,IAAAA,GAAA,CAAA,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ /**
3
+ * useState, men med mulighet for å oppdatere state etter X millisekunder
4
+ * @param initialState Verdi state skal ha ved første render
5
+ * @param delay Vent X millisekunder før state oppdateres
6
+ * @returns state, callback for å oppdatere state etter delay, og callback for å oppdatere state umiddelbart
7
+ */
8
+ export declare const useDelayedState: <S>(initialState: S, delay: number) => [S, Dispatch<SetStateAction<S>>, Dispatch<SetStateAction<S>>];
9
+ //# sourceMappingURL=useDelayedState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDelayedState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDelayedState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,8BAA+B,MAAM,kEAqBhE,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{useState as n,useRef as l,useEffect as m}from"react";const d=(u,c)=>{const[o,r]=n(u),e=l(),s=t=>{clearTimeout(e.current),e.current=window.setTimeout(()=>r(t),c)},a=t=>{clearTimeout(e.current),r(t)};return m(()=>()=>{clearTimeout(e.current)},[]),[o,s,a]};export{d as useDelayedState};
2
+ //# sourceMappingURL=useDelayedState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDelayedState.js","sources":["../../src/hooks/useDelayedState.ts"],"sourcesContent":["import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';\n\n/**\n * useState, men med mulighet for å oppdatere state etter X millisekunder\n * @param initialState Verdi state skal ha ved første render\n * @param delay Vent X millisekunder før state oppdateres\n * @returns state, callback for å oppdatere state etter delay, og callback for å oppdatere state umiddelbart\n */\nexport const useDelayedState = <S>(initialState: S, delay: number): [S, Dispatch<SetStateAction<S>>, Dispatch<SetStateAction<S>>] => {\n const [value, setValue] = useState(initialState);\n const timer = useRef<number>();\n\n const setDelayedValue = (newState: SetStateAction<S>): void => {\n clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setValue(newState), delay);\n };\n\n const setImmediateValue = (newState: SetStateAction<S>): void => {\n clearTimeout(timer.current);\n setValue(newState);\n };\n\n useEffect(() => {\n return () => {\n clearTimeout(timer.current);\n };\n }, []);\n\n return [value, setDelayedValue, setImmediateValue];\n};\n"],"names":["useDelayedState","initialState","delay","value","setValue","useState","timer","useRef","setDelayedValue","newState","setImmediateValue","useEffect"],"mappings":"4DAQa,MAAAA,EAAkB,CAAIC,EAAiBC,IAAiF,CACnI,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASJ,CAAY,EACzCK,EAAQC,IAERC,EAAmBC,GAAsC,CAC7D,aAAaH,EAAM,OAAO,EAC1BA,EAAM,QAAU,OAAO,WAAW,IAAMF,EAASK,CAAQ,EAAGP,CAAK,CAAA,EAG7DQ,EAAqBD,GAAsC,CAC/D,aAAaH,EAAM,OAAO,EAC1BF,EAASK,CAAQ,CAAA,EAGnB,OAAAE,EAAU,IACD,IAAM,CACX,aAAaL,EAAM,OAAO,CAAA,EAE3B,CAAE,CAAA,EAEE,CAACH,EAAOK,EAAiBE,CAAiB,CACnD"}
@@ -1,2 +1,2 @@
1
- import{useEffect as c}from"react";import{d as i}from"../debounce.js";const u=(n,t=["layoutchange","resize","orientationchange"],r=10)=>{c(()=>{if(typeof window!="object")return;const[e,a]=i(n,r);return t.forEach(o=>window.addEventListener(o,e)),e(),()=>{a(),t.forEach(o=>window.removeEventListener(o,e))}},[])};export{u as useLayoutEvent};
1
+ import{useEffect as c}from"react";import{debounce as i}from"../utils/debounce.js";const u=(n,t=["layoutchange","resize","orientationchange"],r=10)=>{c(()=>{if(typeof window!="object")return;const[e,a]=i(n,r);return t.forEach(o=>window.addEventListener(o,e)),e(),()=>{a(),t.forEach(o=>window.removeEventListener(o,e))}},[])};export{u as useLayoutEvent};
2
2
  //# sourceMappingURL=useLayoutEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutEvent.js","sources":["../../src/hooks/useLayoutEvent.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { debounce } from '../utils/debounce';\n\n/**\n * Lytt på ulike layout-events som har betydning for rendring og størrelse på elementer.\n *\n * @param callback Kalles for hver event\n * @param events Liste med events som skal lyttes på\n * @param debounceMs Begrens kall til callback til x antall ms\n */\nexport const useLayoutEvent = (callback: () => void, events = ['layoutchange', 'resize', 'orientationchange'], debounceMs = 10) => {\n useEffect(() => {\n if (typeof window !== 'object') return;\n const [debouncedCallback, teardown] = debounce(callback, debounceMs);\n\n events.forEach(eventName => window.addEventListener(eventName, debouncedCallback));\n\n debouncedCallback();\n\n return () => {\n teardown();\n events.forEach(eventName => window.removeEventListener(eventName, debouncedCallback));\n };\n }, []);\n};\n"],"names":["useLayoutEvent","callback","events","debounceMs","useEffect","debouncedCallback","teardown","debounce","eventName"],"mappings":"qEAWa,MAAAA,EAAiB,CAACC,EAAsBC,EAAS,CAAC,eAAgB,SAAU,mBAAmB,EAAGC,EAAa,KAAO,CACjIC,EAAU,IAAM,CACd,GAAI,OAAO,QAAW,SAAU,OAChC,KAAM,CAACC,EAAmBC,CAAQ,EAAIC,EAASN,EAAUE,CAAU,EAEnE,OAAAD,EAAO,QAAqBM,GAAA,OAAO,iBAAiBA,EAAWH,CAAiB,CAAC,EAE/DA,IAEX,IAAM,CACFC,IACTJ,EAAO,QAAqBM,GAAA,OAAO,oBAAoBA,EAAWH,CAAiB,CAAC,CAAA,CAExF,EAAG,CAAE,CAAA,CACP"}
1
+ {"version":3,"file":"useLayoutEvent.js","sources":["../../src/hooks/useLayoutEvent.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { debounce } from '../utils/debounce';\n\n/**\n * Lytt på ulike layout-events som har betydning for rendring og størrelse på elementer.\n *\n * @param callback Kalles for hver event\n * @param events Liste med events som skal lyttes på\n * @param debounceMs Begrens kall til callback til x antall ms\n */\nexport const useLayoutEvent = (callback: () => void, events = ['layoutchange', 'resize', 'orientationchange'], debounceMs = 10) => {\n useEffect(() => {\n if (typeof window !== 'object') return;\n const [debouncedCallback, teardown] = debounce(callback, debounceMs);\n\n events.forEach(eventName => window.addEventListener(eventName, debouncedCallback));\n\n debouncedCallback();\n\n return () => {\n teardown();\n events.forEach(eventName => window.removeEventListener(eventName, debouncedCallback));\n };\n }, []);\n};\n"],"names":["useLayoutEvent","callback","events","debounceMs","useEffect","debouncedCallback","teardown","debounce","eventName"],"mappings":"kFAWa,MAAAA,EAAiB,CAACC,EAAsBC,EAAS,CAAC,eAAgB,SAAU,mBAAmB,EAAGC,EAAa,KAAO,CACjIC,EAAU,IAAM,CACd,GAAI,OAAO,QAAW,SAAU,OAChC,KAAM,CAACC,EAAmBC,CAAQ,EAAIC,EAASN,EAAUE,CAAU,EAEnE,OAAAD,EAAO,QAAqBM,GAAA,OAAO,iBAAiBA,EAAWH,CAAiB,CAAC,EAE/DA,IAEX,IAAM,CACFC,IACTJ,EAAO,QAAqBM,GAAA,OAAO,oBAAoBA,EAAWH,CAAiB,CAAC,CAAA,CAExF,EAAG,CAAE,CAAA,CACP"}
package/hooks/useSize.js CHANGED
@@ -1,2 +1,2 @@
1
- import{useState as d,useEffect as r}from"react";import{d as a}from"../debounce.js";const w=e=>{const[i,c]=d();return r(()=>{if(typeof ResizeObserver<"u"){const n=new ResizeObserver(t=>{c(t[0].target.getBoundingClientRect())});return e!=null&&e.current&&n.observe(e==null?void 0:e.current),()=>{e!=null&&e.current?n.unobserve(e.current):n.disconnect()}}else if(typeof window=="object"){const n=()=>{e!=null&&e.current&&c(e.current.getBoundingClientRect())},t=["layoutchange","resize","orientationchange"],[o,u]=a(n,10);return t.forEach(s=>window.addEventListener(s,o)),o(),()=>{u(),t.forEach(s=>window.removeEventListener(s,o))}}},[e==null?void 0:e.current]),i};export{w as useSize};
1
+ import{useState as d,useEffect as r}from"react";import{debounce as a}from"../utils/debounce.js";const w=e=>{const[i,s]=d();return r(()=>{if(typeof ResizeObserver<"u"){const n=new ResizeObserver(t=>{s(t[0].target.getBoundingClientRect())});return e!=null&&e.current&&n.observe(e==null?void 0:e.current),()=>{e!=null&&e.current?n.unobserve(e.current):n.disconnect()}}else if(typeof window=="object"){const n=()=>{e!=null&&e.current&&s(e.current.getBoundingClientRect())},t=["layoutchange","resize","orientationchange"],[o,u]=a(n,10);return t.forEach(c=>window.addEventListener(c,o)),o(),()=>{u(),t.forEach(c=>window.removeEventListener(c,o))}}},[e==null?void 0:e.current]),i};export{w as useSize};
2
2
  //# sourceMappingURL=useSize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSize.js","sources":["../../src/hooks/useSize.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { debounce } from '../utils/debounce';\n\n/**\n * Lytt på endringer i størrelse på et element\n *\n * @param ref Element som skal observeres.\n * @returns Object med høyde, bredde, x og y til elementet. Merk at objektet bare oppdates når høyde eller bredde endres, ikke når\n * posisjonen (x og y) endres.\n */\nexport const useSize = (ref?: React.RefObject<HTMLElement>) => {\n const [size, setSize] = useState<DOMRect>();\n useEffect(() => {\n if (typeof ResizeObserver !== 'undefined') {\n const resizeObserver = new ResizeObserver(entries => {\n setSize(entries[0].target.getBoundingClientRect());\n });\n if (ref?.current) {\n resizeObserver.observe(ref?.current);\n }\n return (): void => {\n if (ref?.current) {\n resizeObserver.unobserve(ref.current);\n } else {\n resizeObserver.disconnect();\n }\n };\n } else if (typeof window === 'object') {\n // For nettlesere som ikke støtter ResizeObserver (iOS 13 og lavere)\n const handleLayoutEvent = () => {\n ref?.current && setSize(ref.current.getBoundingClientRect());\n };\n\n const events = ['layoutchange', 'resize', 'orientationchange'];\n const debounceMs = 10;\n\n const [debouncedCallback, teardown] = debounce(handleLayoutEvent, debounceMs);\n\n events.forEach(eventName => window.addEventListener(eventName, debouncedCallback));\n\n debouncedCallback();\n\n return () => {\n teardown();\n events.forEach(eventName => window.removeEventListener(eventName, debouncedCallback));\n };\n }\n }, [ref?.current]);\n\n return size;\n};\n"],"names":["useSize","ref","size","setSize","useState","useEffect","resizeObserver","entries","handleLayoutEvent","events","debouncedCallback","teardown","debounce","eventName"],"mappings":"mFAUa,MAAAA,EAAWC,GAAuC,CAC7D,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAkB,EAC1C,OAAAC,EAAU,IAAM,CACV,GAAA,OAAO,eAAmB,IAAa,CACnC,MAAAC,EAAiB,IAAI,eAA0BC,GAAA,CACnDJ,EAAQI,EAAQ,GAAG,OAAO,sBAAuB,CAAA,CAAA,CAClD,EACD,OAAIN,GAAA,MAAAA,EAAK,SACQK,EAAA,QAAQL,GAAA,YAAAA,EAAK,OAAO,EAE9B,IAAY,CACbA,GAAA,MAAAA,EAAK,QACQK,EAAA,UAAUL,EAAI,OAAO,EAEpCK,EAAe,WAAW,CAC5B,CACF,SACS,OAAO,QAAW,SAAU,CAErC,MAAME,EAAoB,IAAM,CAC9BP,GAAA,MAAAA,EAAK,SAAWE,EAAQF,EAAI,QAAQ,uBAAuB,CAAA,EAGvDQ,EAAS,CAAC,eAAgB,SAAU,mBAAmB,EAGvD,CAACC,EAAmBC,CAAQ,EAAIC,EAASJ,EAAmB,EAAU,EAE5E,OAAAC,EAAO,QAAqBI,GAAA,OAAO,iBAAiBA,EAAWH,CAAiB,CAAC,EAE/DA,IAEX,IAAM,CACFC,IACTF,EAAO,QAAqBI,GAAA,OAAO,oBAAoBA,EAAWH,CAAiB,CAAC,CAAA,CAExF,CAAA,EACC,CAACT,GAAA,YAAAA,EAAK,OAAO,CAAC,EAEVC,CACT"}
1
+ {"version":3,"file":"useSize.js","sources":["../../src/hooks/useSize.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { debounce } from '../utils/debounce';\n\n/**\n * Lytt på endringer i størrelse på et element\n *\n * @param ref Element som skal observeres.\n * @returns Object med høyde, bredde, x og y til elementet. Merk at objektet bare oppdates når høyde eller bredde endres, ikke når\n * posisjonen (x og y) endres.\n */\nexport const useSize = (ref?: React.RefObject<HTMLElement>) => {\n const [size, setSize] = useState<DOMRect>();\n useEffect(() => {\n if (typeof ResizeObserver !== 'undefined') {\n const resizeObserver = new ResizeObserver(entries => {\n setSize(entries[0].target.getBoundingClientRect());\n });\n if (ref?.current) {\n resizeObserver.observe(ref?.current);\n }\n return (): void => {\n if (ref?.current) {\n resizeObserver.unobserve(ref.current);\n } else {\n resizeObserver.disconnect();\n }\n };\n } else if (typeof window === 'object') {\n // For nettlesere som ikke støtter ResizeObserver (iOS 13 og lavere)\n const handleLayoutEvent = () => {\n ref?.current && setSize(ref.current.getBoundingClientRect());\n };\n\n const events = ['layoutchange', 'resize', 'orientationchange'];\n const debounceMs = 10;\n\n const [debouncedCallback, teardown] = debounce(handleLayoutEvent, debounceMs);\n\n events.forEach(eventName => window.addEventListener(eventName, debouncedCallback));\n\n debouncedCallback();\n\n return () => {\n teardown();\n events.forEach(eventName => window.removeEventListener(eventName, debouncedCallback));\n };\n }\n }, [ref?.current]);\n\n return size;\n};\n"],"names":["useSize","ref","size","setSize","useState","useEffect","resizeObserver","entries","handleLayoutEvent","events","debouncedCallback","teardown","debounce","eventName"],"mappings":"gGAUa,MAAAA,EAAWC,GAAuC,CAC7D,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAkB,EAC1C,OAAAC,EAAU,IAAM,CACV,GAAA,OAAO,eAAmB,IAAa,CACnC,MAAAC,EAAiB,IAAI,eAA0BC,GAAA,CACnDJ,EAAQI,EAAQ,GAAG,OAAO,sBAAuB,CAAA,CAAA,CAClD,EACD,OAAIN,GAAA,MAAAA,EAAK,SACQK,EAAA,QAAQL,GAAA,YAAAA,EAAK,OAAO,EAE9B,IAAY,CACbA,GAAA,MAAAA,EAAK,QACQK,EAAA,UAAUL,EAAI,OAAO,EAEpCK,EAAe,WAAW,CAC5B,CACF,SACS,OAAO,QAAW,SAAU,CAErC,MAAME,EAAoB,IAAM,CAC9BP,GAAA,MAAAA,EAAK,SAAWE,EAAQF,EAAI,QAAQ,uBAAuB,CAAA,EAGvDQ,EAAS,CAAC,eAAgB,SAAU,mBAAmB,EAGvD,CAACC,EAAmBC,CAAQ,EAAIC,EAASJ,EAAmB,EAAU,EAE5E,OAAAC,EAAO,QAAqBI,GAAA,OAAO,iBAAiBA,EAAWH,CAAiB,CAAC,EAE/DA,IAEX,IAAM,CACFC,IACTF,EAAO,QAAqBI,GAAA,OAAO,oBAAoBA,EAAWH,CAAiB,CAAC,CAAA,CAExF,CAAA,EACC,CAACT,GAAA,YAAAA,EAAK,OAAO,CAAC,EAEVC,CACT"}
@@ -1,2 +1,2 @@
1
- import{useState as t}from"react";import{useLayoutEvent as p}from"./useLayoutEvent.js";import"../debounce.js";const L=(s,c)=>{const[d,h]=t(!1),[r,u]=t(!1),[a,f]=t(),[g,l]=t();return p(()=>{var n,o,i;const{top:m=0,width:C=0,bottom:O=0}=((n=s.current)==null?void 0:n.getBoundingClientRect())||{},e=(i=(o=c.current)==null?void 0:o.getBoundingClientRect().height)!=null?i:0;h(m<=0),u(O<=e),l(C),f(e)},["resize","scroll"]),{isOutsideWindow:d,isLeavingWindow:r,offsetHeight:a,contentWidth:g}};export{L as useSticky};
1
+ import{useState as t}from"react";import{useLayoutEvent as p}from"./useLayoutEvent.js";import"../utils/debounce.js";const L=(s,c)=>{const[d,h]=t(!1),[r,u]=t(!1),[a,f]=t(),[g,l]=t();return p(()=>{var n,o,i;const{top:m=0,width:C=0,bottom:O=0}=((n=s.current)==null?void 0:n.getBoundingClientRect())||{},e=(i=(o=c.current)==null?void 0:o.getBoundingClientRect().height)!=null?i:0;h(m<=0),u(O<=e),l(C),f(e)},["resize","scroll"]),{isOutsideWindow:d,isLeavingWindow:r,offsetHeight:a,contentWidth:g}};export{L as useSticky};
2
2
  //# sourceMappingURL=useSticky.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSticky.js","sources":["../../src/hooks/useSticky.ts"],"sourcesContent":["import React, { useState } from 'react';\nimport { useLayoutEvent } from './useLayoutEvent';\n\ninterface UseStickReturnValues {\n /** Toppen av elementet er utenfor vinduet */\n isOutsideWindow: boolean;\n /** Innholdet er på vei helt ut av vinduet */\n isLeavingWindow: boolean;\n /** Høyde på det sticky elementet i pixler */\n offsetHeight: number | undefined;\n /** Bredden til innholdet i pixler */\n contentWidth: number | undefined;\n}\n/**\n * Sett et element til sticky hvis et annet element er delvis utenfor vinduet\n *\n * @param contentRef Element som sjekkes om det er utenfor eller innenfor vinduet\n * @param stickyRef Element som skal bli sticky\n * @returns Properties som kan brukes til å sette elementet sticky eller absolute\n */\nexport const useSticky = (contentRef: React.RefObject<HTMLElement>, stickyRef: React.RefObject<HTMLElement>): UseStickReturnValues => {\n const [isOutsideWindow, setIsOutsideWindow] = useState<boolean>(false);\n const [isLeavingWindow, setIsLeavingWindow] = useState<boolean>(false);\n const [offsetHeight, setOffsetHeight] = useState<number>();\n const [contentWidth, setContentWidth] = useState<number>();\n\n const handleLayoutChange = () => {\n const {\n top: topOfContentElement = 0,\n width: widthOfContentElement = 0,\n bottom: bottomOfContentElement = 0,\n } = contentRef.current?.getBoundingClientRect() || {};\n const heightOfStickyElement = stickyRef.current?.getBoundingClientRect().height ?? 0;\n setIsOutsideWindow(topOfContentElement <= 0);\n setIsLeavingWindow(bottomOfContentElement <= heightOfStickyElement);\n setContentWidth(widthOfContentElement);\n setOffsetHeight(heightOfStickyElement);\n };\n\n useLayoutEvent(handleLayoutChange, ['resize', 'scroll']);\n\n return { isOutsideWindow, isLeavingWindow, offsetHeight, contentWidth };\n};\n"],"names":["useSticky","contentRef","stickyRef","isOutsideWindow","setIsOutsideWindow","useState","isLeavingWindow","setIsLeavingWindow","offsetHeight","setOffsetHeight","contentWidth","setContentWidth","useLayoutEvent","topOfContentElement","widthOfContentElement","bottomOfContentElement","_a","heightOfStickyElement","_c","_b"],"mappings":"6GAoBa,MAAAA,EAAY,CAACC,EAA0CC,IAAkE,CACpI,KAAM,CAACC,EAAiBC,CAAkB,EAAIC,EAAkB,EAAK,EAC/D,CAACC,EAAiBC,CAAkB,EAAIF,EAAkB,EAAK,EAC/D,CAACG,EAAcC,CAAe,EAAIJ,EAAiB,EACnD,CAACK,EAAcC,CAAe,EAAIN,EAAiB,EAezD,OAAAO,EAb2B,IAAM,WACzB,KAAA,CACJ,IAAKC,EAAsB,EAC3B,MAAOC,EAAwB,EAC/B,OAAQC,EAAyB,CAC/B,IAAAC,EAAAf,EAAW,UAAX,YAAAe,EAAoB,0BAA2B,CAAA,EAC7CC,GAAwBC,GAAAC,EAAAjB,EAAU,UAAV,YAAAiB,EAAmB,wBAAwB,SAA3C,KAAAD,EAAqD,EACnFd,EAAmBS,GAAuB,CAAC,EAC3CN,EAAmBQ,GAA0BE,CAAqB,EAClEN,EAAgBG,CAAqB,EACrCL,EAAgBQ,CAAqB,CAAA,EAGJ,CAAC,SAAU,QAAQ,CAAC,EAEhD,CAAE,gBAAAd,EAAiB,gBAAAG,EAAiB,aAAAE,EAAc,aAAAE,CAAa,CACxE"}
1
+ {"version":3,"file":"useSticky.js","sources":["../../src/hooks/useSticky.ts"],"sourcesContent":["import React, { useState } from 'react';\nimport { useLayoutEvent } from './useLayoutEvent';\n\ninterface UseStickReturnValues {\n /** Toppen av elementet er utenfor vinduet */\n isOutsideWindow: boolean;\n /** Innholdet er på vei helt ut av vinduet */\n isLeavingWindow: boolean;\n /** Høyde på det sticky elementet i pixler */\n offsetHeight: number | undefined;\n /** Bredden til innholdet i pixler */\n contentWidth: number | undefined;\n}\n/**\n * Sett et element til sticky hvis et annet element er delvis utenfor vinduet\n *\n * @param contentRef Element som sjekkes om det er utenfor eller innenfor vinduet\n * @param stickyRef Element som skal bli sticky\n * @returns Properties som kan brukes til å sette elementet sticky eller absolute\n */\nexport const useSticky = (contentRef: React.RefObject<HTMLElement>, stickyRef: React.RefObject<HTMLElement>): UseStickReturnValues => {\n const [isOutsideWindow, setIsOutsideWindow] = useState<boolean>(false);\n const [isLeavingWindow, setIsLeavingWindow] = useState<boolean>(false);\n const [offsetHeight, setOffsetHeight] = useState<number>();\n const [contentWidth, setContentWidth] = useState<number>();\n\n const handleLayoutChange = () => {\n const {\n top: topOfContentElement = 0,\n width: widthOfContentElement = 0,\n bottom: bottomOfContentElement = 0,\n } = contentRef.current?.getBoundingClientRect() || {};\n const heightOfStickyElement = stickyRef.current?.getBoundingClientRect().height ?? 0;\n setIsOutsideWindow(topOfContentElement <= 0);\n setIsLeavingWindow(bottomOfContentElement <= heightOfStickyElement);\n setContentWidth(widthOfContentElement);\n setOffsetHeight(heightOfStickyElement);\n };\n\n useLayoutEvent(handleLayoutChange, ['resize', 'scroll']);\n\n return { isOutsideWindow, isLeavingWindow, offsetHeight, contentWidth };\n};\n"],"names":["useSticky","contentRef","stickyRef","isOutsideWindow","setIsOutsideWindow","useState","isLeavingWindow","setIsLeavingWindow","offsetHeight","setOffsetHeight","contentWidth","setContentWidth","useLayoutEvent","topOfContentElement","widthOfContentElement","bottomOfContentElement","_a","heightOfStickyElement","_c","_b"],"mappings":"mHAoBa,MAAAA,EAAY,CAACC,EAA0CC,IAAkE,CACpI,KAAM,CAACC,EAAiBC,CAAkB,EAAIC,EAAkB,EAAK,EAC/D,CAACC,EAAiBC,CAAkB,EAAIF,EAAkB,EAAK,EAC/D,CAACG,EAAcC,CAAe,EAAIJ,EAAiB,EACnD,CAACK,EAAcC,CAAe,EAAIN,EAAiB,EAezD,OAAAO,EAb2B,IAAM,WACzB,KAAA,CACJ,IAAKC,EAAsB,EAC3B,MAAOC,EAAwB,EAC/B,OAAQC,EAAyB,CAC/B,IAAAC,EAAAf,EAAW,UAAX,YAAAe,EAAoB,0BAA2B,CAAA,EAC7CC,GAAwBC,GAAAC,EAAAjB,EAAU,UAAV,YAAAiB,EAAmB,wBAAwB,SAA3C,KAAAD,EAAqD,EACnFd,EAAmBS,GAAuB,CAAC,EAC3CN,EAAmBQ,GAA0BE,CAAqB,EAClEN,EAAgBG,CAAqB,EACrCL,EAAgBQ,CAAqB,CAAA,EAGJ,CAAC,SAAU,QAAQ,CAAC,EAEhD,CAAE,gBAAAd,EAAiB,gBAAAG,EAAiB,aAAAE,EAAc,aAAAE,CAAa,CACxE"}
package/hooks/useUuid.js CHANGED
@@ -1,2 +1,2 @@
1
- import{useState as r}from"react";import{a as u}from"../uuid.js";const s=t=>{const[o]=r(t||u());return o};export{s as useUuid};
1
+ import{useState as r}from"react";import{a as i}from"../uuid.js";import"../utils/environment.js";const s=t=>{const[o]=r(t||i());return o};export{s as useUuid};
2
2
  //# sourceMappingURL=useUuid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUuid.js","sources":["../../src/hooks/useUuid.ts"],"sourcesContent":["import { useState } from 'react';\nimport { uuid } from '../utils/uuid';\n\n/**\n * Returner unik uuid som ikke endrer seg for hver render\n * @param initial id som vil overstyre id fra uuid-utility\n * @returns uuid-string\n */\nexport const useUuid = (initial?: string): string => {\n const [id] = useState(initial || uuid());\n\n return id;\n};\n"],"names":["useUuid","initial","id","useState","uuid"],"mappings":"gEAQa,MAAAA,EAAWC,GAA6B,CACnD,KAAM,CAACC,CAAE,EAAIC,EAASF,GAAWG,EAAM,CAAA,EAEhC,OAAAF,CACT"}
1
+ {"version":3,"file":"useUuid.js","sources":["../../src/hooks/useUuid.ts"],"sourcesContent":["import { useState } from 'react';\nimport { uuid } from '../utils/uuid';\n\n/**\n * Returner unik uuid som ikke endrer seg for hver render\n * @param initial id som vil overstyre id fra uuid-utility\n * @returns uuid-string\n */\nexport const useUuid = (initial?: string): string => {\n const [id] = useState(initial || uuid());\n\n return id;\n};\n"],"names":["useUuid","initial","id","useState","uuid"],"mappings":"gGAQa,MAAAA,EAAWC,GAA6B,CACnD,KAAM,CAACC,CAAE,EAAIC,EAASF,GAAWG,EAAM,CAAA,EAEhC,OAAAF,CACT"}
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{theme as x}from"./theme/index.js";import{Breakpoint as n,useBreakpoint as a}from"./hooks/useBreakpoint.js";import{useFocusToggle as v}from"./hooks/useFocusToggle.js";import{useFocusTrap as y}from"./hooks/useFocusTrap.js";import{useHover as I}from"./hooks/useHover.js";import{useIntersectionObserver as l}from"./hooks/useIntersectionObserver.js";import{useIsVisible as F}from"./hooks/useIsVisible.js";import{useLayoutEvent as z}from"./hooks/useLayoutEvent.js";import{usePrevious as O}from"./hooks/usePrevious.js";import{useSticky as T}from"./hooks/useSticky.js";import{useSize as V}from"./hooks/useSize.js";import{useResizeObserver as A}from"./hooks/useResizeObserver.js";import{useToggle as L}from"./hooks/useToggle.js";import{useKeyboardEvent as P}from"./hooks/useKeyboardEvent.js";import{useOutsideEvent as U}from"./hooks/useOutsideEvent.js";import{useUuid as j}from"./hooks/useUuid.js";import{a as w}from"./uuid.js";import{AnalyticsId as D,FormMode as G,FormVariant as J,IconSize as N,KeyboardEventKey as Q,ZIndex as W}from"./constants.js";import"./theme/palette.js";import"./theme/spacers.js";import"./theme/grid.js";import"react";import"./hooks/useFocusableElements.js";import"./hooks/focus-utils.js";import"./debounce.js";export{D as AnalyticsId,n as Breakpoint,G as FormMode,J as FormVariant,N as IconSize,Q as KeyboardEventKey,W as ZIndex,x as theme,a as useBreakpoint,v as useFocusToggle,y as useFocusTrap,I as useHover,l as useIntersectionObserver,F as useIsVisible,P as useKeyboardEvent,z as useLayoutEvent,U as useOutsideEvent,O as usePrevious,A as useResizeObserver,V as useSize,T as useSticky,L as useToggle,j as useUuid,w as uuid};
1
+ import{theme as f}from"./theme/index.js";import{Breakpoint as a,useBreakpoint as d}from"./hooks/useBreakpoint.js";import{useFocusToggle as E}from"./hooks/useFocusToggle.js";import{useFocusTrap as y}from"./hooks/useFocusTrap.js";import{useHover as b}from"./hooks/useHover.js";import{useIntersectionObserver as T}from"./hooks/useIntersectionObserver.js";import{useIsVisible as l}from"./hooks/useIsVisible.js";import{useLayoutEvent as R}from"./hooks/useLayoutEvent.js";import{usePrevious as z}from"./hooks/usePrevious.js";import{useSticky as K}from"./hooks/useSticky.js";import{useSize as S}from"./hooks/useSize.js";import{useResizeObserver as _}from"./hooks/useResizeObserver.js";import{useToggle as C}from"./hooks/useToggle.js";import{useKeyboardEvent as h}from"./hooks/useKeyboardEvent.js";import{useOutsideEvent as G}from"./hooks/useOutsideEvent.js";import{useUuid as M}from"./hooks/useUuid.js";import{a as W}from"./uuid.js";import{AVERAGE_CHARACTER_WIDTH_PX as Z,AnalyticsId as j,FormMode as q,FormVariant as w,IconSize as J,KeyboardEventKey as N,ZIndex as Q}from"./constants.js";import"./theme/palette.js";import"./theme/spacers.js";import"./theme/grid.js";import"react";import"./hooks/useFocusableElements.js";import"./hooks/focus-utils.js";import"./utils/debounce.js";import"./utils/environment.js";export{Z as AVERAGE_CHARACTER_WIDTH_PX,j as AnalyticsId,a as Breakpoint,q as FormMode,w as FormVariant,J as IconSize,N as KeyboardEventKey,Q as ZIndex,f as theme,d as useBreakpoint,E as useFocusToggle,y as useFocusTrap,b as useHover,T as useIntersectionObserver,l as useIsVisible,h as useKeyboardEvent,R as useLayoutEvent,G as useOutsideEvent,z as usePrevious,_ as useResizeObserver,S as useSize,K as useSticky,C as useToggle,M as useUuid,W as uuid};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "The official design system for Helsenorge built with React.",
5
5
  "homepage": "https://helsenorge.design",
6
- "version": "2.4.0",
6
+ "version": "2.5.0",
7
7
  "author": "Helsenorge",
8
8
  "license": "MIT",
9
9
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ const t=r=>{const{label:e,id:a}=r;if(a)return{"aria-labelledby":a};if(e)return{"aria-label":e}};export{t as getAriaLabelAttributes};
2
+ //# sourceMappingURL=accessibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility.js","sources":["../../src/utils/accessibility.ts"],"sourcesContent":["import { AriaAttributes } from 'react';\n\ninterface AriaLabelAttributesConfig {\n label?: string;\n id?: string;\n}\n\nexport type AriaLabelAttributes = Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'>;\n\nexport const getAriaLabelAttributes = (config: AriaLabelAttributesConfig): AriaLabelAttributes | undefined => {\n const { label, id } = config;\n\n if (id) {\n return {\n 'aria-labelledby': id,\n };\n }\n if (label) {\n return {\n 'aria-label': label,\n };\n }\n};\n"],"names":["getAriaLabelAttributes","config","label","id"],"mappings":"AASa,MAAAA,EAA0BC,GAAuE,CACtG,KAAA,CAAE,MAAAC,EAAO,GAAAC,CAAO,EAAAF,EAEtB,GAAIE,EACK,MAAA,CACL,kBAAmBA,CAAA,EAGvB,GAAID,EACK,MAAA,CACL,aAAcA,CAAA,CAGpB"}
@@ -0,0 +1,2 @@
1
+ function s(e,u,n){let t;return[function(){const o=this,c=arguments,l=()=>{t=null,n||e.apply(o,c)},r=n&&!t;t&&clearTimeout(t),t=setTimeout(l,u),r&&e.apply(o,c)},()=>{t&&clearTimeout(t)}]}export{s as debounce};
2
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.js","sources":["../../src/utils/debounce.ts"],"sourcesContent":["/**\n * debounce limits time a function can be executed\n * @param func function to debounce\n * @param wait wait for x time\n * @param immediate run now\n */\n\nexport function debounce(func: Function, wait: number, immediate?: boolean): [() => void, () => void] {\n let timeout: ReturnType<typeof setTimeout> | null;\n\n const debouncedFunc = function (this: Function): void {\n const context: Function = this,\n args: IArguments = arguments,\n later: () => void = (): void => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n },\n callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n\n const teardown = () => {\n timeout && clearTimeout(timeout);\n };\n\n return [debouncedFunc, teardown];\n}\n"],"names":["debounce","func","wait","immediate","timeout","context","args","later","callNow"],"mappings":"AAOgB,SAAAA,EAASC,EAAgBC,EAAcC,EAA+C,CAChG,IAAAC,EAwBG,MAAA,CAtBe,UAAgC,CACpD,MAAMC,EAAoB,KACxBC,EAAmB,UACnBC,EAAoB,IAAY,CACpBH,EAAA,KACLD,GACEF,EAAA,MAAMI,EAASC,CAAI,CAC1B,EAEFE,EAAUL,GAAa,CAACC,EAEtBA,GAAS,aAAaA,CAAO,EACvBA,EAAA,WAAWG,EAAOL,CAAI,EAC5BM,GACGP,EAAA,MAAMI,EAASC,CAAI,CAC1B,EAGe,IAAM,CACrBF,GAAW,aAAaA,CAAO,CAAA,CAGF,CACjC"}
@@ -0,0 +1,2 @@
1
+ const s=()=>{var e;return typeof process<"u"&&((e=process.env)==null?void 0:e.NODE_ENV)==="test"};export{s as isTest};
2
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sources":["../../src/utils/environment.ts"],"sourcesContent":["export const isTest = (): boolean => typeof process !== 'undefined' && process['env']?.NODE_ENV === 'test';\n"],"names":["isTest","_a"],"mappings":"AAAO,MAAMA,EAAS,IAAe,CAA9B,IAAAC,EAA8B,cAAO,QAAY,OAAeA,EAAA,QAAQ,MAAR,YAAAA,EAAgB,YAAa"}
@@ -0,0 +1,2 @@
1
+ const i="Officia laboris in sit nisi consectetur eu.",e="Cupidatat culpa dolor id nulla sit commodo elit aliqua cillum. Reprehenderit aute aute enim non adipisicing duis adipisicing id laboris aliquip tempor amet. Non occaecat minim ad duis sunt et.",a="Dolore quis tempor culpa exercitation laboris. Enim enim pariatur veniam nisi ad quis fugiat magna occaecat nisi. Excepteur ad ad duis quis mollit ex. Laboris duis velit eu eiusmod ea in ex aliqua. Est proident proident dolor veniam nostrud aliquip occaecat dolore sunt laboris nisi ipsum Lorem nisi. Magna sunt ex occaecat amet id. Eiusmod magna Lorem proident est occaecat pariatur sunt esse nostrud. Mollit reprehenderit velit veniam amet ipsum veniam et. Dolor sunt adipisicing enim dolore quis qui occaecat esse quis ut fugiat laboris. ";export{a as default,a as longLoremText,e as mediumLoremText,i as shortLoremText};
2
+ //# sourceMappingURL=loremtext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loremtext.js","sources":["../../src/utils/loremtext.ts"],"sourcesContent":["export const shortLoremText = 'Officia laboris in sit nisi consectetur eu.';\nexport const mediumLoremText =\n 'Cupidatat culpa dolor id nulla sit commodo elit aliqua cillum. Reprehenderit aute aute enim non adipisicing duis adipisicing id laboris aliquip tempor amet. Non occaecat minim ad duis sunt et.';\nexport const longLoremText =\n 'Dolore quis tempor culpa exercitation laboris. Enim enim pariatur veniam nisi ad quis fugiat magna occaecat nisi. Excepteur ad ad duis quis mollit ex. Laboris duis velit eu eiusmod ea in ex aliqua. Est proident proident dolor veniam nostrud aliquip occaecat dolore sunt laboris nisi ipsum Lorem nisi. Magna sunt ex occaecat amet id. Eiusmod magna Lorem proident est occaecat pariatur sunt esse nostrud. Mollit reprehenderit velit veniam amet ipsum veniam et. Dolor sunt adipisicing enim dolore quis qui occaecat esse quis ut fugiat laboris. ';\n\nexport default longLoremText;\n"],"names":["shortLoremText","mediumLoremText","longLoremText"],"mappings":"AAAO,MAAMA,EAAiB,8CACjBC,EACX,mMACWC,EACX"}
package/utils/refs.js ADDED
@@ -0,0 +1,2 @@
1
+ const o=t=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})},c=t=>typeof t!="function"&&t!==null;export{c as isMutableRefObject,o as mergeRefs};
2
+ //# sourceMappingURL=refs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.js","sources":["../../src/utils/refs.ts"],"sourcesContent":["/**\n * Slår sammen refs fra forwardRef og useRef slik at begge deler kan brukes\n * Fra https://github.com/gregberge/react-merge-refs\n * @param refs array med refs som skal slås sammen\n * @returns refcallback som kan brukes på komponent\n */\nexport const mergeRefs = <T>(refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>): React.RefCallback<T> => {\n return value => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n });\n };\n};\n\n/**\n * Sjekker om ref er et objekt (og ikke en funksjon)\n * @param ref\n * @returns type predicate\n */\nexport const isMutableRefObject = <T>(ref: React.ForwardedRef<T>): ref is React.MutableRefObject<T> => {\n return typeof ref !== 'function' && ref !== null;\n};\n"],"names":["mergeRefs","refs","value","ref","isMutableRefObject"],"mappings":"AAMa,MAAAA,EAAgBC,GACXC,GAAA,CACdD,EAAK,QAAeE,GAAA,CACd,OAAOA,GAAQ,WACjBA,EAAID,CAAK,EACAC,GAAO,OACfA,EAAyC,QAAUD,EACtD,CACD,CAAA,EASQE,EAAyBD,GAC7B,OAAOA,GAAQ,YAAcA,IAAQ"}
package/utils/uuid.js ADDED
@@ -0,0 +1,2 @@
1
+ import"./environment.js";import{a as t,a as u}from"../uuid.js";export{t as default,u as uuid};
2
+ //# sourceMappingURL=uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ const d=t=>{var{top:e,left:n,bottom:i,right:o}=t.getBoundingClientRect();return e>=0&&n>=0&&i<=(window.innerHeight||document.documentElement.clientHeight)&&o<=(window.innerWidth||document.documentElement.clientWidth)};export{d as isElementInViewport};
2
+ //# sourceMappingURL=viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.js","sources":["../../src/utils/viewport.ts"],"sourcesContent":["export const isElementInViewport = (el: HTMLElement): boolean => {\n var { top, left, bottom, right } = el.getBoundingClientRect();\n\n return (\n top >= 0 &&\n left >= 0 &&\n bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n};\n"],"names":["isElementInViewport","el","top","left","bottom","right"],"mappings":"AAAa,MAAAA,EAAuBC,GAA6B,CAC/D,GAAI,CAAE,IAAAC,EAAK,KAAAC,EAAM,OAAAC,EAAQ,MAAAC,GAAUJ,EAAG,wBAEtC,OACEC,GAAO,GACPC,GAAQ,GACRC,IAAW,OAAO,aAAe,SAAS,gBAAgB,eAC1DC,IAAU,OAAO,YAAc,SAAS,gBAAgB,YAE5D"}
package/uuid.js CHANGED
@@ -1,2 +1,2 @@
1
- const r=()=>{var x;return typeof process<"u"&&((x=process.env)==null?void 0:x.NODE_ENV)==="test"},t=()=>r()?"test":"bxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".replace(/[x]/g,function(x){const e=Math.random()*16|0;return(x=="x"?e:e&3|8).toString(16)}),o=Object.freeze(Object.defineProperty({__proto__:null,uuid:t,default:t},Symbol.toStringTag,{value:"Module"}));export{t as a,r as i,o as u};
1
+ import{isTest as r}from"./utils/environment.js";const t=()=>r()?"test":"bxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".replace(/[x]/g,function(e){const x=Math.random()*16|0;return(e=="x"?x:x&3|8).toString(16)}),u=Object.freeze(Object.defineProperty({__proto__:null,uuid:t,default:t},Symbol.toStringTag,{value:"Module"}));export{t as a,u};
2
2
  //# sourceMappingURL=uuid.js.map
package/uuid.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uuid.js","sources":["../src/utils/environment.ts","../src/utils/uuid.ts"],"sourcesContent":["export const isTest = (): boolean => typeof process !== 'undefined' && process['env']?.NODE_ENV === 'test';\n","import { isTest } from './environment';\n\nexport const uuid = (): string => {\n if (isTest()) {\n return 'test';\n }\n return 'bxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n};\n\nexport default uuid;\n"],"names":["isTest","_a","uuid","c","r"],"mappings":"AAAO,MAAMA,EAAS,IAAe,CAA9B,IAAAC,EAA8B,cAAO,QAAY,OAAeA,EAAA,QAAQ,MAAR,YAAAA,EAAgB,YAAa,QCEvFC,EAAO,IACdF,IACK,OAEF,uCAAuC,QAAQ,OAAQ,SAAUG,EAAG,CACnE,MAAAC,EAAK,KAAK,OAAW,EAAA,GAAM,EAE1B,OADDD,GAAK,IAAMC,EAAKA,EAAI,EAAO,GACxB,SAAS,EAAE,CAAA,CACrB"}
1
+ {"version":3,"file":"uuid.js","sources":["../src/utils/uuid.ts"],"sourcesContent":["import { isTest } from './environment';\n\nexport const uuid = (): string => {\n if (isTest()) {\n return 'test';\n }\n return 'bxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n};\n\nexport default uuid;\n"],"names":["uuid","isTest","c","r"],"mappings":"gDAEO,MAAMA,EAAO,IACdC,IACK,OAEF,uCAAuC,QAAQ,OAAQ,SAAUC,EAAG,CACnE,MAAAC,EAAK,KAAK,OAAW,EAAA,GAAM,EAE1B,OADDD,GAAK,IAAMC,EAAKA,EAAI,EAAO,GACxB,SAAS,EAAE,CAAA,CACrB"}
package/accessibility.js DELETED
@@ -1,2 +0,0 @@
1
- const t=r=>{const{label:a,id:e}=r;if(e)return{"aria-labelledby":e};if(a)return{"aria-label":a}};export{t as g};
2
- //# sourceMappingURL=accessibility.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accessibility.js","sources":["../src/utils/accessibility.ts"],"sourcesContent":["import { AriaAttributes } from 'react';\n\ninterface AriaLabelAttributesConfig {\n label?: string;\n id?: string;\n}\n\nexport type AriaLabelAttributes = Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'>;\n\nexport const getAriaLabelAttributes = (config: AriaLabelAttributesConfig): AriaLabelAttributes | undefined => {\n const { label, id } = config;\n\n if (id) {\n return {\n 'aria-labelledby': id,\n };\n }\n if (label) {\n return {\n 'aria-label': label,\n };\n }\n};\n"],"names":["getAriaLabelAttributes","config","label","id"],"mappings":"AASa,MAAAA,EAA0BC,GAAuE,CACtG,KAAA,CAAE,MAAAC,EAAO,GAAAC,CAAO,EAAAF,EAEtB,GAAIE,EACK,MAAA,CACL,kBAAmBA,CAAA,EAGvB,GAAID,EACK,MAAA,CACL,aAAcA,CAAA,CAGpB"}
package/debounce.js DELETED
@@ -1,2 +0,0 @@
1
- function s(e,u,n){let t;return[function(){const o=this,c=arguments,a=()=>{t=null,n||e.apply(o,c)},l=n&&!t;t&&clearTimeout(t),t=setTimeout(a,u),l&&e.apply(o,c)},()=>{t&&clearTimeout(t)}]}export{s as d};
2
- //# sourceMappingURL=debounce.js.map
package/debounce.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"debounce.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["/**\n * debounce limits time a function can be executed\n * @param func function to debounce\n * @param wait wait for x time\n * @param immediate run now\n */\n\nexport function debounce(func: Function, wait: number, immediate?: boolean): [() => void, () => void] {\n let timeout: ReturnType<typeof setTimeout> | null;\n\n const debouncedFunc = function (this: Function): void {\n const context: Function = this,\n args: IArguments = arguments,\n later: () => void = (): void => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n },\n callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n\n const teardown = () => {\n timeout && clearTimeout(timeout);\n };\n\n return [debouncedFunc, teardown];\n}\n"],"names":["debounce","func","wait","immediate","timeout","context","args","later","callNow"],"mappings":"AAOgB,SAAAA,EAASC,EAAgBC,EAAcC,EAA+C,CAChG,IAAAC,EAwBG,MAAA,CAtBe,UAAgC,CACpD,MAAMC,EAAoB,KACxBC,EAAmB,UACnBC,EAAoB,IAAY,CACpBH,EAAA,KACLD,GACEF,EAAA,MAAMI,EAASC,CAAI,CAC1B,EAEFE,EAAUL,GAAa,CAACC,EAEtBA,GAAS,aAAaA,CAAO,EACvBA,EAAA,WAAWG,EAAOL,CAAI,EAC5BM,GACGP,EAAA,MAAMI,EAASC,CAAI,CAC1B,EAGe,IAAM,CACrBF,GAAW,aAAaA,CAAO,CAAA,CAGF,CACjC"}