@helsenorge/designsystem-react 15.7.2 → 16.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/lib/Button.js +2 -2
  2. package/lib/Button.js.map +1 -1
  3. package/lib/CHANGELOG.md +2664 -997
  4. package/lib/Close.js +1 -1
  5. package/lib/Close.js.map +1 -1
  6. package/lib/Drawer.js +3 -4
  7. package/lib/Drawer.js.map +1 -1
  8. package/lib/DrawerNavigation.js +1 -0
  9. package/lib/DrawerNavigation.js.map +1 -1
  10. package/lib/Duolist.js +5 -1
  11. package/lib/Duolist.js.map +1 -1
  12. package/lib/ElementHeader.js.map +1 -1
  13. package/lib/Expander.js +1 -0
  14. package/lib/Expander.js.map +1 -1
  15. package/lib/FilterLinkList.js +1 -1
  16. package/lib/FilterLinkList.js.map +1 -1
  17. package/lib/FormGroup.js +3 -3
  18. package/lib/FormGroup.js.map +1 -1
  19. package/lib/HelpDetails.js +1 -1
  20. package/lib/HelpTriggerIcon.js +2 -2
  21. package/lib/HelpTriggerIcon.js.map +1 -1
  22. package/lib/HelpTriggerStandalone.js +1 -1
  23. package/lib/HelpTriggerStandalone.js.map +1 -1
  24. package/lib/HorizontalScroll.js +6 -10
  25. package/lib/HorizontalScroll.js.map +1 -1
  26. package/lib/LazyIcon.js +1 -0
  27. package/lib/LazyIcon.js.map +1 -1
  28. package/lib/LazyIllustration.js +2 -0
  29. package/lib/LazyIllustration.js.map +1 -1
  30. package/lib/LinkList.js +10 -10
  31. package/lib/LinkList.js.map +1 -1
  32. package/lib/ListEditMode.js +1 -1
  33. package/lib/ListEditMode.js.map +1 -1
  34. package/lib/PopOver.js +2 -2
  35. package/lib/PopOver.js.map +1 -1
  36. package/lib/Radio.js +65 -55
  37. package/lib/Radio.js.map +1 -1
  38. package/lib/Radio2.js +74 -0
  39. package/lib/Radio2.js.map +1 -0
  40. package/lib/RadioMarker.js +2 -2
  41. package/lib/RadioMarker.js.map +1 -1
  42. package/lib/StackedCellContent.js +15 -0
  43. package/lib/StackedCellContent.js.map +1 -0
  44. package/lib/TabList.js +5 -5
  45. package/lib/TabList.js.map +1 -1
  46. package/lib/TabPanel.js +1 -0
  47. package/lib/TabPanel.js.map +1 -1
  48. package/lib/TableContext.js +26 -0
  49. package/lib/TableContext.js.map +1 -0
  50. package/lib/Toggle.js +2 -2
  51. package/lib/Toggle.js.map +1 -1
  52. package/lib/UNSAFE_TableBody.js +22 -0
  53. package/lib/UNSAFE_TableBody.js.map +1 -0
  54. package/lib/UNSAFE_TableCell.js +26 -0
  55. package/lib/UNSAFE_TableCell.js.map +1 -0
  56. package/lib/UNSAFE_TableDetail.js +17 -0
  57. package/lib/UNSAFE_TableDetail.js.map +1 -0
  58. package/lib/UNSAFE_TableExpandedRow.js +46 -0
  59. package/lib/UNSAFE_TableExpandedRow.js.map +1 -0
  60. package/lib/UNSAFE_TableHead.js +25 -0
  61. package/lib/UNSAFE_TableHead.js.map +1 -0
  62. package/lib/UNSAFE_TableHeadCell.js +182 -0
  63. package/lib/UNSAFE_TableHeadCell.js.map +1 -0
  64. package/lib/UNSAFE_TableRow.js +130 -0
  65. package/lib/UNSAFE_TableRow.js.map +1 -0
  66. package/lib/VisualRadio.js +1 -1
  67. package/lib/VisualRadio.js.map +1 -1
  68. package/lib/__mocks__/ResizeObserver.js +4 -1
  69. package/lib/__mocks__/ResizeObserver.js.map +1 -1
  70. package/lib/components/AnchorLink/styles.module.scss +3 -4
  71. package/lib/components/ArticleTeaser/styles.module.scss +12 -12
  72. package/lib/components/Button/Button.d.ts +1 -1
  73. package/lib/components/Button/styles.module.scss +111 -60
  74. package/lib/components/Button/styles.module.scss.d.ts +1 -1
  75. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +6 -6
  76. package/lib/components/Chip/styles.module.scss +2 -3
  77. package/lib/components/Close/styles.module.scss +2 -3
  78. package/lib/components/DictionaryTrigger/index.js +26 -1
  79. package/lib/{DictionaryTrigger.js.map → components/DictionaryTrigger/index.js.map} +1 -1
  80. package/lib/components/DictionaryTrigger/styles.module.scss +6 -8
  81. package/lib/components/Drawer/Drawer.d.ts +0 -4
  82. package/lib/components/Drawer/DrawerBackButton.module.scss +1 -2
  83. package/lib/components/Drawer/styles.module.scss +6 -3
  84. package/lib/components/Dropdown/SingleSelect/styles.module.scss +0 -2
  85. package/lib/components/Dropdown/index.js +9 -17
  86. package/lib/components/Dropdown/index.js.map +1 -1
  87. package/lib/components/Dropdown/styles.module.scss +12 -14
  88. package/lib/components/Duolist/Duolist.d.ts +14 -2
  89. package/lib/components/Duolist/styles.module.scss +28 -8
  90. package/lib/components/Duolist/styles.module.scss.d.ts +3 -0
  91. package/lib/components/ElementHeader/ElementHeader.d.ts +1 -1
  92. package/lib/components/ElementHeader/styles.module.scss +1 -1
  93. package/lib/components/EmptyState/styles.module.scss +1 -2
  94. package/lib/components/ErrorWrapper/styles.module.scss +3 -3
  95. package/lib/components/Expander/styles.module.scss +0 -2
  96. package/lib/components/Expander/styles.module.scss.d.ts +1 -1
  97. package/lib/components/ExpanderHierarchy/index.js +1 -0
  98. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  99. package/lib/components/ExpanderList/index.js +21 -19
  100. package/lib/components/ExpanderList/index.js.map +1 -1
  101. package/lib/components/ExpanderList/styles.module.scss +11 -11
  102. package/lib/components/FavoriteButton/index.js +3 -3
  103. package/lib/components/FavoriteButton/index.js.map +1 -1
  104. package/lib/components/FavoriteButton/styles.module.scss +0 -1
  105. package/lib/components/Filter/FilterButton/styles.module.scss +5 -6
  106. package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss +0 -1
  107. package/lib/components/Filter/FilterDrawer/styles.module.scss +0 -1
  108. package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss +5 -6
  109. package/lib/components/Filter/FilterOverviewSearch/styles.module.scss +1 -4
  110. package/lib/components/Filter/FilterSearch/styles.module.scss +14 -15
  111. package/lib/components/Filter/FilterSort/styles.module.scss +1 -2
  112. package/lib/components/Filter/FilterStateWrapper/styles.module.scss +0 -2
  113. package/lib/components/Filter/LoaderSpinner/styles.module.scss +2 -4
  114. package/lib/components/FormFieldTag/styles.module.scss +0 -1
  115. package/lib/components/FormGroup/styles.module.scss +0 -1
  116. package/lib/components/HelpBubble/styles.module.scss +0 -1
  117. package/lib/components/HelpDetails/styles.module.scss +2 -4
  118. package/lib/components/HelpDrawer/styles.module.scss +1 -2
  119. package/lib/components/HelpPanel/HelpPanel.d.ts +2 -2
  120. package/lib/components/HelpPanel/index.js +1 -17
  121. package/lib/components/HelpPanel/index.js.map +1 -1
  122. package/lib/components/HelpPanel/styles.module.scss +2 -22
  123. package/lib/components/HelpPanel/styles.module.scss.d.ts +0 -4
  124. package/lib/components/HelpTeaser/styles.module.scss +7 -9
  125. package/lib/components/HelpTriggerIcon/HelpTriggerIcon.d.ts +2 -2
  126. package/lib/components/HelpTriggerIcon/styles.module.scss +20 -22
  127. package/lib/components/HelpTriggerIcon/styles.module.scss.d.ts +1 -1
  128. package/lib/components/HelpTriggerInline/styles.module.scss +3 -5
  129. package/lib/components/HelpTriggerStandalone/styles.module.scss +3 -5
  130. package/lib/components/HighlightPanel/styles.module.scss +2 -3
  131. package/lib/components/HorizontalScroll/HorizontalScroll.d.ts +0 -4
  132. package/lib/components/HorizontalScroll/styles.module.scss +1 -4
  133. package/lib/components/HorizontalScroll/styles.module.scss.d.ts +0 -1
  134. package/lib/components/Icons/AdditionalIconInformation.d.ts +4 -0
  135. package/lib/components/Icons/AdditionalIconInformation.js +14 -10
  136. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  137. package/lib/components/Icons/HistoryDocument.js +6 -7
  138. package/lib/components/Icons/HistoryDocument.js.map +1 -1
  139. package/lib/components/Icons/IconNames.d.ts +1 -1
  140. package/lib/components/Icons/IconNames.js +1 -0
  141. package/lib/components/Icons/IconNames.js.map +1 -1
  142. package/lib/components/Icons/YesNo.d.ts +3 -0
  143. package/lib/components/Icons/YesNo.js +53 -0
  144. package/lib/components/Icons/YesNo.js.map +1 -0
  145. package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
  146. package/lib/components/Illustrations/IllustrationNames.js +2 -0
  147. package/lib/components/Illustrations/IllustrationNames.js.map +1 -1
  148. package/lib/components/Illustrations/MoveAway.d.ts +11 -0
  149. package/lib/components/Illustrations/MoveAway.js +18 -0
  150. package/lib/components/Illustrations/MoveAway.js.map +1 -0
  151. package/lib/components/Illustrations/MoveAwayMedium.d.ts +3 -0
  152. package/lib/components/Illustrations/MoveAwayMedium.js +114 -0
  153. package/lib/components/Illustrations/MoveAwayMedium.js.map +1 -0
  154. package/lib/components/InfoTeaser/styles.module.scss +6 -8
  155. package/lib/components/Label/styles.module.scss +1 -1
  156. package/lib/components/LinkList/LinkList.d.ts +1 -1
  157. package/lib/components/LinkList/styles.module.scss +9 -11
  158. package/lib/components/LinkList/styles.module.scss.d.ts +1 -1
  159. package/lib/components/ListEditMode/styles.module.scss +5 -7
  160. package/lib/components/Loader/Loader.d.ts +1 -1
  161. package/lib/components/Loader/index.js +4 -4
  162. package/lib/components/Loader/index.js.map +1 -1
  163. package/lib/components/Loader/styles.module.scss +7 -7
  164. package/lib/components/Loader/styles.module.scss.d.ts +3 -3
  165. package/lib/components/Modal/constants.d.ts +1 -1
  166. package/lib/components/Modal/index.js +6 -3
  167. package/lib/components/Modal/index.js.map +1 -1
  168. package/lib/components/Modal/styles.module.scss +14 -19
  169. package/lib/components/Modal/styles.module.scss.d.ts +2 -3
  170. package/lib/components/Panel/index.js +1 -1
  171. package/lib/components/Panel/index.js.map +1 -1
  172. package/lib/components/Panel/styles.module.scss +15 -16
  173. package/lib/components/Panel/styles.module.scss.d.ts +1 -1
  174. package/lib/components/PopMenu/PopMenu.d.ts +4 -0
  175. package/lib/components/PopMenu/index.js +10 -5
  176. package/lib/components/PopMenu/index.js.map +1 -1
  177. package/lib/components/PopOver/styles.module.scss +1 -3
  178. package/lib/components/Progressbar/Progressbar.d.ts +1 -1
  179. package/lib/components/Progressbar/constants.d.ts +1 -1
  180. package/lib/components/Progressbar/index.js +4 -4
  181. package/lib/components/Progressbar/index.js.map +1 -1
  182. package/lib/components/Radio/Radio.d.ts +28 -0
  183. package/lib/components/Radio/index.d.ts +3 -0
  184. package/lib/components/Radio/index.js +7 -0
  185. package/lib/components/Radio/index.js.map +1 -0
  186. package/lib/components/{RadioButton → Radio}/styles.module.scss +8 -9
  187. package/lib/components/Radio/styles.module.scss.d.ts +26 -0
  188. package/lib/components/ServiceMessage/styles.module.scss +20 -22
  189. package/lib/components/Slider/styles.module.scss +1 -2
  190. package/lib/components/StatusDot/styles.module.scss +4 -5
  191. package/lib/components/StickyNote/index.js +2 -2
  192. package/lib/components/StickyNote/index.js.map +1 -1
  193. package/lib/components/StickyNote/styles.module.scss +9 -10
  194. package/lib/components/Table/index.js +0 -1
  195. package/lib/components/Table/index.js.map +1 -1
  196. package/lib/components/Tabs/TabList/styles.module.scss +20 -18
  197. package/lib/components/Tabs/TabPanel/styles.module.scss +2 -3
  198. package/lib/components/Tabs/styles.module.scss +0 -1
  199. package/lib/components/Tag/styles.module.scss +0 -1
  200. package/lib/components/Tile/styles.module.scss +5 -7
  201. package/lib/components/Toast/styles.module.scss +0 -1
  202. package/lib/components/Toggle/styles.module.scss +9 -10
  203. package/lib/components/UNSAFE_Table/StackedCellContent.d.ts +9 -0
  204. package/lib/components/UNSAFE_Table/TableCaption.d.ts +10 -0
  205. package/lib/components/UNSAFE_Table/TableContext.d.ts +22 -0
  206. package/lib/components/UNSAFE_Table/UNSAFE_Table.d.ts +37 -0
  207. package/lib/components/UNSAFE_Table/UNSAFE_TableBody/UNSAFE_TableBody.d.ts +10 -0
  208. package/lib/components/UNSAFE_Table/UNSAFE_TableBody/index.d.ts +3 -0
  209. package/lib/components/UNSAFE_Table/UNSAFE_TableBody/index.js +2 -0
  210. package/lib/components/UNSAFE_Table/UNSAFE_TableCell/UNSAFE_TableCell.d.ts +15 -0
  211. package/lib/components/UNSAFE_Table/UNSAFE_TableCell/index.d.ts +3 -0
  212. package/lib/components/UNSAFE_Table/UNSAFE_TableCell/index.js +7 -0
  213. package/lib/components/UNSAFE_Table/UNSAFE_TableCell/index.js.map +1 -0
  214. package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/UNSAFE_TableDetail.d.ts +12 -0
  215. package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/index.d.ts +3 -0
  216. package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/index.js +7 -0
  217. package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/index.js.map +1 -0
  218. package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/UNSAFE_TableExpandedRow.d.ts +17 -0
  219. package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/index.d.ts +3 -0
  220. package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/index.js +7 -0
  221. package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/index.js.map +1 -0
  222. package/lib/components/UNSAFE_Table/UNSAFE_TableExpanderCell/UNSAFE_TableExpanderCellMobile.d.ts +4 -0
  223. package/lib/components/UNSAFE_Table/UNSAFE_TableHead/UNSAFE_TableHead.d.ts +8 -0
  224. package/lib/components/UNSAFE_Table/UNSAFE_TableHead/index.d.ts +3 -0
  225. package/lib/components/UNSAFE_Table/UNSAFE_TableHead/index.js +7 -0
  226. package/lib/components/UNSAFE_Table/UNSAFE_TableHead/index.js.map +1 -0
  227. package/lib/components/UNSAFE_Table/UNSAFE_TableHeadCell/UNSAFE_TableHeadCell.d.ts +15 -0
  228. package/lib/components/UNSAFE_Table/UNSAFE_TableHeadCell/index.d.ts +3 -0
  229. package/lib/components/UNSAFE_Table/UNSAFE_TableHeadCell/index.js +2 -0
  230. package/lib/components/UNSAFE_Table/UNSAFE_TablePopMenuCell/UNSAFE_TablePopMenuCell.d.ts +8 -0
  231. package/lib/components/UNSAFE_Table/UNSAFE_TableRow/UNSAFE_TableRow.d.ts +20 -0
  232. package/lib/components/UNSAFE_Table/UNSAFE_TableRow/index.d.ts +3 -0
  233. package/lib/components/UNSAFE_Table/UNSAFE_TableRow/index.js +2 -0
  234. package/lib/components/UNSAFE_Table/constants.d.ts +29 -0
  235. package/lib/components/UNSAFE_Table/index.d.ts +19 -0
  236. package/lib/components/UNSAFE_Table/index.js +182 -0
  237. package/lib/components/UNSAFE_Table/index.js.map +1 -0
  238. package/lib/components/UNSAFE_Table/resourceHelper.d.ts +3 -0
  239. package/lib/components/UNSAFE_Table/styles.module.scss +621 -0
  240. package/lib/components/UNSAFE_Table/styles.module.scss.d.ts +62 -0
  241. package/lib/components/UNSAFE_Table/useTableExpandedRows.d.ts +12 -0
  242. package/lib/components/UNSAFE_Table/useTableShowMore.d.ts +25 -0
  243. package/lib/components/UNSAFE_Table/utils.d.ts +47 -0
  244. package/lib/components/Validation/index.js +2 -2
  245. package/lib/components/Validation/index.js.map +1 -1
  246. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +0 -2
  247. package/lib/components/VisualCheckboxCloud/styles.module.scss +0 -1
  248. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +0 -2
  249. package/lib/components/VisualCheckboxGroup/styles.module.scss +0 -1
  250. package/lib/components/VisualContentgroupWithImage/styles.module.scss +0 -1
  251. package/lib/components/VisualRadioCloud/Radio/index.js +1 -1
  252. package/lib/components/VisualRadioCloud/Radio/styles.module.scss +0 -2
  253. package/lib/components/VisualRadioCloud/index.js +1 -1
  254. package/lib/components/VisualRadioCloud/styles.module.scss +0 -1
  255. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +0 -2
  256. package/lib/components/VisualRadioGroup/styles.module.scss +0 -1
  257. package/lib/constants.d.ts +2 -3
  258. package/lib/constants.js +2 -3
  259. package/lib/constants.js.map +1 -1
  260. package/lib/constants3.js +42 -0
  261. package/lib/constants3.js.map +1 -0
  262. package/lib/floating-ui.react.js +3 -460
  263. package/lib/floating-ui.react.js.map +1 -1
  264. package/lib/hooks/useDismissablePopover.d.ts +20 -0
  265. package/lib/hooks/useDismissablePopover.js +66 -0
  266. package/lib/hooks/useDismissablePopover.js.map +1 -0
  267. package/lib/hooks/useOutsideEvent.d.ts +3 -0
  268. package/lib/hooks/useOutsideEvent.js +24 -3
  269. package/lib/hooks/useOutsideEvent.js.map +1 -1
  270. package/lib/hooks/useReturnFocusOnClose.d.ts +7 -0
  271. package/lib/hooks/useReturnFocusOnClose.js +22 -0
  272. package/lib/hooks/useReturnFocusOnClose.js.map +1 -0
  273. package/lib/hooks/useSort.d.ts +88 -0
  274. package/lib/hooks/useSort.js +91 -0
  275. package/lib/hooks/useSort.js.map +1 -0
  276. package/lib/hooks/useSort.test.js +11739 -0
  277. package/lib/hooks/useSort.test.js.map +1 -0
  278. package/lib/hooks/useSynchronousResizeObserver.d.ts +11 -0
  279. package/lib/hooks/useSynchronousResizeObserver.js +29 -0
  280. package/lib/hooks/useSynchronousResizeObserver.js.map +1 -0
  281. package/lib/index.d.ts +2 -0
  282. package/lib/index.js +3 -1
  283. package/lib/resources/HN.Designsystem.Table.nb-NO.json.d.ts +9 -0
  284. package/lib/resources/Resources.d.ts +19 -0
  285. package/lib/rolldown-runtime.js +33 -0
  286. package/lib/scss/_font-mixins.scss +28 -1
  287. package/lib/scss/_visual-form.scss +47 -47
  288. package/lib/scss/helsenorge.scss +1 -0
  289. package/lib/scss/supernova/styles/colors.css +177 -122
  290. package/lib/scss/supernova/styles/typography.css +58 -51
  291. package/lib/scss/supernova-legacy/index.css +2 -0
  292. package/lib/scss/supernova-legacy/styles/legacy-colors.css +111 -0
  293. package/lib/scss/typography.module.scss +8 -0
  294. package/lib/scss/typography.module.scss.d.ts +2 -0
  295. package/lib/scss/typography.stories.tsx +8 -0
  296. package/lib/utils/formSpacing.js +3 -3
  297. package/lib/utils/formSpacing.js.map +1 -1
  298. package/lib/utils/uuid.js +1 -12
  299. package/lib/utils/uuid.js.map +1 -1
  300. package/package.json +61 -15
  301. package/scss/_font-mixins.scss +28 -1
  302. package/scss/_visual-form.scss +47 -47
  303. package/scss/helsenorge.scss +1 -0
  304. package/scss/supernova/styles/colors.css +177 -122
  305. package/scss/supernova/styles/typography.css +58 -51
  306. package/scss/supernova-legacy/index.css +2 -0
  307. package/scss/supernova-legacy/styles/legacy-colors.css +111 -0
  308. package/scss/typography.module.scss +8 -0
  309. package/scss/typography.module.scss.d.ts +2 -0
  310. package/scss/typography.stories.tsx +8 -0
  311. package/lib/DictionaryTrigger.js +0 -27
  312. package/lib/RadioButton.js +0 -84
  313. package/lib/RadioButton.js.map +0 -1
  314. package/lib/components/HelpTooltip/HelpTooltip.d.ts +0 -12
  315. package/lib/components/HelpTooltip/index.d.ts +0 -3
  316. package/lib/components/HelpTooltip/index.js +0 -48
  317. package/lib/components/HelpTooltip/index.js.map +0 -1
  318. package/lib/components/RadioButton/RadioButton.d.ts +0 -28
  319. package/lib/components/RadioButton/index.d.ts +0 -3
  320. package/lib/components/RadioButton/index.js +0 -7
  321. package/lib/components/RadioButton/index.js.map +0 -1
  322. package/lib/components/RadioButton/styles.module.scss.d.ts +0 -26
  323. package/lib/designsystem-react.css +0 -273
  324. /package/lib/components/{RadioButton → Radio}/RadioMarker/RadioMarker.d.ts +0 -0
  325. /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss +0 -0
  326. /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss.d.ts +0 -0
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Kjører measure før første paint og hver gang elementet eller dets overordnede element endrer størrelse.
4
+ * State-oppdateringer i measure rendres synkront, slik at elementet ikke vises en frame med utdatert layout
5
+ * (for eksempel når en overordnet komponent åpnes).
6
+ *
7
+ * @param ref Elementet som observeres, sammen med dets overordnede element
8
+ * @param measure Leser størrelser og setter state
9
+ * @param deps Når disse endres settes observeren opp på nytt
10
+ */
11
+ export declare const useSynchronousResizeObserver: <T extends HTMLElement>(ref: RefObject<T | null>, measure: (element: T, parentElement: HTMLElement) => void, deps?: ReadonlyArray<unknown>) => void;
@@ -0,0 +1,29 @@
1
+ import { useLayoutEffect } from "react";
2
+ import { flushSync } from "react-dom";
3
+ //#region src/hooks/useSynchronousResizeObserver.ts
4
+ /**
5
+ * Kjører measure før første paint og hver gang elementet eller dets overordnede element endrer størrelse.
6
+ * State-oppdateringer i measure rendres synkront, slik at elementet ikke vises en frame med utdatert layout
7
+ * (for eksempel når en overordnet komponent åpnes).
8
+ *
9
+ * @param ref Elementet som observeres, sammen med dets overordnede element
10
+ * @param measure Leser størrelser og setter state
11
+ * @param deps Når disse endres settes observeren opp på nytt
12
+ */
13
+ var useSynchronousResizeObserver = (ref, measure, deps = []) => {
14
+ useLayoutEffect(() => {
15
+ const element = ref.current;
16
+ const parentElement = element?.parentElement;
17
+ if (!element || !parentElement) return;
18
+ const run = () => flushSync(() => measure(element, parentElement));
19
+ run();
20
+ const observer = new ResizeObserver(run);
21
+ observer.observe(element, { box: "border-box" });
22
+ observer.observe(parentElement, { box: "border-box" });
23
+ return () => observer.disconnect();
24
+ }, deps);
25
+ };
26
+ //#endregion
27
+ export { useSynchronousResizeObserver };
28
+
29
+ //# sourceMappingURL=useSynchronousResizeObserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSynchronousResizeObserver.js","names":[],"sources":["../../src/hooks/useSynchronousResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, type RefObject } from 'react';\n\nimport { flushSync } from 'react-dom';\n\n/**\n * Kjører measure før første paint og hver gang elementet eller dets overordnede element endrer størrelse.\n * State-oppdateringer i measure rendres synkront, slik at elementet ikke vises en frame med utdatert layout\n * (for eksempel når en overordnet komponent åpnes).\n *\n * @param ref Elementet som observeres, sammen med dets overordnede element\n * @param measure Leser størrelser og setter state\n * @param deps Når disse endres settes observeren opp på nytt\n */\nexport const useSynchronousResizeObserver = <T extends HTMLElement>(\n ref: RefObject<T | null>,\n measure: (element: T, parentElement: HTMLElement) => void,\n deps: ReadonlyArray<unknown> = []\n): void => {\n useLayoutEffect(() => {\n const element = ref.current;\n const parentElement = element?.parentElement;\n if (!element || !parentElement) {\n return;\n }\n\n const run = (): void => flushSync(() => measure(element, parentElement));\n\n run();\n const observer = new ResizeObserver(run);\n observer.observe(element, { box: 'border-box' });\n observer.observe(parentElement, { box: 'border-box' });\n return (): void => observer.disconnect();\n }, deps);\n};\n"],"mappings":";;;;;;;;;;;;AAaA,IAAa,gCACX,KACA,SACA,OAA+B,CAAC,MACvB;CACT,sBAAsB;EACpB,MAAM,UAAU,IAAI;EACpB,MAAM,gBAAgB,SAAS;EAC/B,IAAI,CAAC,WAAW,CAAC,eACf;EAGF,MAAM,YAAkB,gBAAgB,QAAQ,SAAS,aAAa,CAAC;EAEvE,IAAI;EACJ,MAAM,WAAW,IAAI,eAAe,GAAG;EACvC,SAAS,QAAQ,SAAS,EAAE,KAAK,aAAa,CAAC;EAC/C,SAAS,QAAQ,eAAe,EAAE,KAAK,aAAa,CAAC;EACrD,aAAmB,SAAS,WAAW;CACzC,GAAG,IAAI;AACT"}
package/lib/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export { useResizeObserver } from './hooks/useResizeObserver';
12
12
  export { useToggle } from './hooks/useToggle';
13
13
  export { useKeyboardEvent } from './hooks/useKeyboardEvent';
14
14
  export { useOutsideEvent } from './hooks/useOutsideEvent';
15
+ export { useDismissablePopover } from './hooks/useDismissablePopover';
16
+ export { useReturnFocusOnClose } from './hooks/useReturnFocusOnClose';
15
17
  export { useLanguage } from './hooks/useLanguage';
16
18
  export { isMobileUA } from './utils/mobile';
17
19
  export { uuid } from './utils/uuid';
package/lib/index.js CHANGED
@@ -15,6 +15,8 @@ import { useResizeObserver } from "./hooks/useResizeObserver.js";
15
15
  import { useToggle } from "./hooks/useToggle.js";
16
16
  import { useKeyboardEvent } from "./hooks/useKeyboardEvent.js";
17
17
  import { useOutsideEvent } from "./hooks/useOutsideEvent.js";
18
+ import { useReturnFocusOnClose } from "./hooks/useReturnFocusOnClose.js";
19
+ import { useDismissablePopover } from "./hooks/useDismissablePopover.js";
18
20
  import { isMobileUA } from "./utils/mobile.js";
19
21
  import { formatResource } from "./utils/resource.js";
20
- export { AVERAGE_CHARACTER_WIDTH_PX, AnalyticsId, Breakpoint, FormOnColor, FormSize, IconSize, KeyboardEventKey, LanguageLocales, ZIndex, formatResource, isMobileUA, theme, useBreakpoint, useFocusToggle, useFocusTrap, useIntersectionObserver, useIsVisible, useKeyboardEvent, useLanguage, useLayoutEvent, useOutsideEvent, usePrevious, usePseudoClasses, useResizeObserver, useSize, useToggle, uuid };
22
+ export { AVERAGE_CHARACTER_WIDTH_PX, AnalyticsId, Breakpoint, FormOnColor, FormSize, IconSize, KeyboardEventKey, LanguageLocales, ZIndex, formatResource, isMobileUA, theme, useBreakpoint, useDismissablePopover, useFocusToggle, useFocusTrap, useIntersectionObserver, useIsVisible, useKeyboardEvent, useLanguage, useLayoutEvent, useOutsideEvent, usePrevious, usePseudoClasses, useResizeObserver, useReturnFocusOnClose, useSize, useToggle, uuid };
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ "showMoreButton": "Vis mer",
3
+ "menuHeadCell": "Valg",
4
+ "expandRowButton": "Vis detaljer",
5
+ "collapseRowButton": "Skjul detaljer"
6
+ }
7
+ ;
8
+
9
+ export default _default;
@@ -200,4 +200,23 @@ export type HNDesignsystemChip = {
200
200
  removeAriaLabel: string;
201
201
  };
202
202
 
203
+ export type HNDesignsystemTable = {
204
+ /**
205
+ * Vis mer
206
+ */
207
+ showMoreButton: string;
208
+ /**
209
+ * Valg
210
+ */
211
+ menuHeadCell: string;
212
+ /**
213
+ * Vis detaljer
214
+ */
215
+ expandRowButton: string;
216
+ /**
217
+ * Skjul detaljer
218
+ */
219
+ collapseRowButton: string;
220
+ };
221
+
203
222
  /* eslint:enable */
@@ -0,0 +1,33 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return target;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ //#endregion
33
+ export { __exportAll as n, __toESM as r, __commonJSMin as t };
@@ -170,8 +170,35 @@
170
170
  }
171
171
 
172
172
  @mixin table-cell {
173
+ font-size: 1rem;
174
+ line-height: 1.28rem;
175
+
176
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
177
+ font-size: 1.125rem;
178
+ line-height: 1.463rem;
179
+ }
180
+ }
181
+
182
+ @mixin table-header {
173
183
  font-size: 1.125rem;
174
- line-height: 1.4375rem;
184
+ line-height: 1.375rem;
185
+ font-weight: 600;
186
+
187
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
188
+ font-size: 1.25rem;
189
+ line-height: 1.625rem;
190
+ }
191
+ }
192
+
193
+ @mixin table-header-stack {
194
+ font-size: 1rem;
195
+ line-height: 1.28rem;
196
+ font-weight: 600;
197
+
198
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
199
+ font-size: 1.125rem;
200
+ line-height: 1.463rem;
201
+ }
175
202
  }
176
203
 
177
204
  @mixin image-caption {
@@ -51,9 +51,9 @@
51
51
  min-height: var(--core-space-l);
52
52
  padding: $pill-padding-mobile;
53
53
  border-radius: 100px;
54
- background-color: var(--color-action-background-ondark);
55
- border: 1px solid var(--color-action-border-onlight);
56
- color: var(--color-base-text-onlight);
54
+ background-color: var(--color-action-background-light-normal);
55
+ border: 1px solid var(--color-action-border-dark-normal);
56
+ color: var(--color-base-text-dark);
57
57
 
58
58
  @include fonts.title6;
59
59
 
@@ -64,20 +64,20 @@
64
64
  }
65
65
 
66
66
  &:hover &__pill {
67
- background-color: var(--color-action-background-ondark-hover);
68
- border-color: var(--color-action-border-onlight-hover);
67
+ background-color: var(--color-action-background-light-hover);
68
+ border-color: var(--color-action-border-dark-plus1-hover);
69
69
  }
70
70
 
71
71
  &:active &__pill {
72
- background-color: var(--color-action-background-ondark-selected);
73
- border-color: var(--color-action-border-onlight-hover);
72
+ background-color: var(--color-action-background-light-selected);
73
+ border-color: var(--color-action-border-dark-plus1-hover);
74
74
  }
75
75
 
76
76
  &--checked &__pill,
77
77
  &:has(input:checked) &__pill {
78
- background-color: var(--color-action-background-onlight);
79
- color: var(--color-action-text-ondark);
80
- border-color: var(--color-action-background-onlight);
78
+ background-color: var(--color-action-background-dark-normal);
79
+ color: var(--color-action-text-light-normal);
80
+ border-color: var(--color-action-background-dark-normal);
81
81
  padding: var(--core-space-3xs) var(--core-space-s);
82
82
 
83
83
  @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
@@ -87,52 +87,52 @@
87
87
 
88
88
  &--checked:hover &__pill,
89
89
  &:has(input:checked):hover &__pill {
90
- background-color: var(--color-action-graphics-onlight-hover);
91
- border-color: var(--color-action-graphics-onlight-hover);
90
+ background-color: var(--color-action-graphics-dark-hover);
91
+ border-color: var(--color-action-graphics-dark-hover);
92
92
  }
93
93
 
94
94
  &--checked:active &__pill,
95
95
  &:has(input:checked):active &__pill {
96
- background-color: var(--color-action-background-onlight-active);
97
- border-color: var(--color-action-background-onlight-active);
96
+ background-color: var(--color-action-background-dark-plus1-active);
97
+ border-color: var(--color-action-background-dark-plus1-active);
98
98
  }
99
99
 
100
100
  &--invalid &__pill {
101
- background-color: var(--color-action-background-ondark);
102
- border-color: var(--color-destructive-border-normal);
101
+ background-color: var(--color-action-background-light-normal);
102
+ border-color: var(--color-destructive-border-dark-normal);
103
103
  }
104
104
 
105
105
  &--invalid:hover &__pill {
106
- background-color: var(--color-destructive-background-normal);
107
- border-color: var(--color-destructive-border-normal);
106
+ background-color: var(--color-destructive-background-light-plus1-normal);
107
+ border-color: var(--color-destructive-border-dark-normal);
108
108
  }
109
109
 
110
110
  &--invalid:active &__pill {
111
- background-color: var(--color-destructive-background-emphasized);
112
- border-color: var(--color-destructive-border-normal);
111
+ background-color: var(--color-destructive-background-light-plus1-hover);
112
+ border-color: var(--color-destructive-border-dark-normal);
113
113
  }
114
114
 
115
115
  &--invalid#{&}--checked &__pill,
116
116
  &--invalid:has(input:checked) &__pill {
117
- background-color: var(--color-destructive-graphics-normal);
118
- border-color: var(--color-destructive-graphics-normal);
117
+ background-color: var(--color-destructive-graphics-dark-normal);
118
+ border-color: var(--color-destructive-graphics-dark-normal);
119
119
  }
120
120
 
121
121
  &--invalid#{&}--checked:hover &__pill,
122
122
  &--invalid:has(input:checked):hover &__pill {
123
- background-color: var(--color-destructive-graphics-hover);
124
- border-color: var(--color-destructive-graphics-hover);
123
+ background-color: var(--color-destructive-graphics-dark-hover);
124
+ border-color: var(--color-destructive-graphics-dark-hover);
125
125
  }
126
126
 
127
127
  &--invalid#{&}--checked:active &__pill,
128
128
  &--invalid:has(input:checked):active &__pill {
129
- background-color: var(--color-destructive-graphics-emphasized-onlight);
130
- border-color: var(--color-destructive-graphics-emphasized-onlight);
129
+ background-color: var(--color-destructive-graphics-dark-active);
130
+ border-color: var(--color-destructive-graphics-dark-active);
131
131
  }
132
132
 
133
133
  &__input:focus-visible + &__pill {
134
- outline: 3px solid var(--color-action-border-onlight-focus);
135
- border-color: var(--color-action-border-ondark);
134
+ outline: 3px solid var(--color-action-border-dark-focus);
135
+ border-color: var(--color-action-border-light-normal);
136
136
  }
137
137
 
138
138
  &__icon {
@@ -141,7 +141,7 @@
141
141
  justify-content: center;
142
142
 
143
143
  svg {
144
- fill: var(--color-action-graphics-ondark);
144
+ fill: var(--color-action-graphics-light-normal);
145
145
  }
146
146
  }
147
147
 
@@ -206,9 +206,9 @@
206
206
  z-index: 1;
207
207
  display: inline-flex;
208
208
  border-radius: 4px;
209
- background: var(--color-action-background-ondark);
210
- border: 2px solid var(--color-action-border-onlight);
211
- color: var(--color-base-text-onlight);
209
+ background: var(--color-action-background-light-normal);
210
+ border: 2px solid var(--color-action-border-dark-normal);
211
+ color: var(--color-base-text-dark);
212
212
  }
213
213
 
214
214
  &--variant-line &__frame {
@@ -243,8 +243,8 @@
243
243
  justify-content: center;
244
244
  overflow: hidden;
245
245
  border-radius: 100%;
246
- background: var(--color-action-background-ondark);
247
- border: 2px solid var(--color-action-border-ondark);
246
+ background: var(--color-action-background-light-normal);
247
+ border: 2px solid var(--color-action-border-light-normal);
248
248
 
249
249
  > * {
250
250
  width: 100%;
@@ -272,35 +272,35 @@
272
272
 
273
273
  &--checked &__frame,
274
274
  &:has(input:checked) &__frame {
275
- background: var(--color-action-background-onlight);
276
- color: var(--color-action-text-ondark);
277
- border-color: var(--color-action-background-onlight);
275
+ background: var(--color-action-background-dark-normal);
276
+ color: var(--color-action-text-light-normal);
277
+ border-color: var(--color-action-background-dark-normal);
278
278
  }
279
279
 
280
280
  &--invalid &__frame {
281
- background: var(--color-action-background-ondark);
281
+ background: var(--color-action-background-light-normal);
282
282
  border-color: var(--core-color-cherry-500);
283
283
  }
284
284
 
285
285
  &:hover &__frame {
286
286
  background: var(--core-color-neutral-50);
287
- border-color: var(--color-action-border-onlight-hover);
287
+ border-color: var(--color-action-border-dark-plus1-hover);
288
288
  }
289
289
 
290
290
  &:active &__frame {
291
291
  background: var(--core-color-neutral-100);
292
- border-color: var(--color-action-border-onlight-hover);
292
+ border-color: var(--color-action-border-dark-plus1-hover);
293
293
  }
294
294
 
295
295
  &--checked:hover &__frame,
296
296
  &:has(input:checked):hover &__frame {
297
- background: var(--color-action-background-onlight-hover);
297
+ background: var(--color-action-background-dark-plus1-hover);
298
298
  }
299
299
 
300
300
  &--checked:active &__frame,
301
301
  &:has(input:checked):active &__frame {
302
- background: var(--color-action-background-onlight-active);
303
- border-color: var(--color-action-background-onlight-active);
302
+ background: var(--color-action-background-dark-plus1-active);
303
+ border-color: var(--color-action-background-dark-plus1-active);
304
304
  }
305
305
 
306
306
  &--invalid:hover &__frame {
@@ -316,7 +316,7 @@
316
316
  &--invalid#{&}--checked &__frame,
317
317
  &--invalid:has(input:checked) &__frame {
318
318
  background: var(--core-color-cherry-50);
319
- color: var(--color-base-text-onlight);
319
+ color: var(--color-base-text-dark);
320
320
  border-color: var(--core-color-cherry-500);
321
321
  }
322
322
 
@@ -333,8 +333,8 @@
333
333
  }
334
334
 
335
335
  &__input:focus-visible + &__frame {
336
- outline: 4px solid var(--color-action-border-onlight-focus);
337
- border-color: var(--color-action-border-ondark);
336
+ outline: 4px solid var(--color-action-border-dark-focus);
337
+ border-color: var(--color-action-border-light-normal);
338
338
  }
339
339
 
340
340
  &__icon {
@@ -343,7 +343,7 @@
343
343
  justify-content: center;
344
344
 
345
345
  svg {
346
- fill: var(--color-action-graphics-ondark);
346
+ fill: var(--color-action-graphics-light-normal);
347
347
  }
348
348
  }
349
349
 
@@ -6,6 +6,7 @@
6
6
  @forward 'body';
7
7
  @forward 'print';
8
8
  @forward 'radio-reset';
9
+ @use './supernova-legacy/styles/legacy-colors.css';
9
10
  @import './bootstrap/scss/bootstrap-grid';
10
11
  @import './supernova/styles/colors.css';
11
12
  @import './supernova/styles/spacers.css';