@altinn/altinn-components 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (569) hide show
  1. package/README.md +14 -2
  2. package/dist/components/Attachment/AttachmentLink.d.ts +10 -0
  3. package/dist/components/Attachment/AttachmentList.d.ts +7 -0
  4. package/dist/components/Avatar/Avatar.d.ts +27 -0
  5. package/dist/components/Avatar/AvatarGroup.d.ts +20 -0
  6. package/dist/components/Avatar/color.d.ts +4 -0
  7. package/dist/components/Badge/Badge.d.ts +11 -0
  8. package/dist/components/Bookmarks/BookmarksList.d.ts +7 -0
  9. package/dist/components/Bookmarks/BookmarksListItem.d.ts +21 -0
  10. package/dist/components/Bookmarks/QueryLabel.d.ts +11 -0
  11. package/dist/components/Button/Button.d.ts +8 -0
  12. package/dist/components/Button/ButtonBase.d.ts +20 -0
  13. package/dist/components/Button/ButtonIcon.d.ts +7 -0
  14. package/dist/components/Button/ButtonLabel.d.ts +8 -0
  15. package/dist/components/Button/ComboButton.d.ts +10 -0
  16. package/dist/components/Button/IconButton.d.ts +14 -0
  17. package/dist/components/ContextMenu/ContextMenu.d.ts +8 -0
  18. package/dist/components/ContextMenu/ContextMenuBase.d.ts +9 -0
  19. package/dist/components/Dialog/Dialog.d.ts +54 -0
  20. package/dist/components/Dialog/DialogActions.d.ts +16 -0
  21. package/dist/components/Dialog/DialogActivityLog.d.ts +10 -0
  22. package/dist/components/Dialog/DialogArticleBase.d.ts +6 -0
  23. package/dist/components/Dialog/DialogAttachments.d.ts +6 -0
  24. package/dist/components/Dialog/DialogBase.d.ts +5 -0
  25. package/dist/components/Dialog/DialogBodyBase.d.ts +5 -0
  26. package/dist/components/Dialog/DialogBorder.d.ts +9 -0
  27. package/dist/components/Dialog/DialogContent.d.ts +9 -0
  28. package/dist/components/Dialog/DialogFooter.d.ts +4 -0
  29. package/dist/components/Dialog/DialogGroup.d.ts +6 -0
  30. package/dist/components/Dialog/DialogHeader.d.ts +10 -0
  31. package/dist/components/Dialog/DialogHeaderBase.d.ts +5 -0
  32. package/dist/components/Dialog/DialogHeadings.d.ts +24 -0
  33. package/dist/components/Dialog/DialogHistory.d.ts +6 -0
  34. package/dist/components/Dialog/DialogList.d.ts +7 -0
  35. package/dist/components/Dialog/DialogListItem.d.ts +59 -0
  36. package/dist/components/Dialog/DialogListItemBase.d.ts +28 -0
  37. package/dist/components/Dialog/DialogMetadata.d.ts +22 -0
  38. package/dist/components/Dialog/DialogNav.d.ts +21 -0
  39. package/dist/components/Dialog/DialogSectionBase.d.ts +6 -0
  40. package/dist/components/Dialog/DialogSeenBy.d.ts +19 -0
  41. package/dist/components/Dialog/DialogSelect.d.ts +10 -0
  42. package/dist/components/Dialog/DialogStatus.d.ts +25 -0
  43. package/dist/components/Dialog/DialogTitle.d.ts +20 -0
  44. package/dist/components/Dialog/DialogTouchedBy.d.ts +10 -0
  45. package/dist/components/Dropdown/Backdrop.d.ts +6 -0
  46. package/dist/components/Dropdown/DrawerBase.d.ts +9 -0
  47. package/dist/components/Dropdown/DrawerBody.d.ts +6 -0
  48. package/dist/components/Dropdown/DrawerButton.d.ts +7 -0
  49. package/dist/components/Dropdown/DrawerFooter.d.ts +6 -0
  50. package/dist/components/Dropdown/DrawerHeader.d.ts +7 -0
  51. package/dist/components/Dropdown/DrawerOrDropdown.d.ts +10 -0
  52. package/dist/components/Dropdown/DropdownBase.d.ts +10 -0
  53. package/{lib/components/Dropdown/index.ts → dist/components/Dropdown/index.d.ts} +0 -1
  54. package/dist/components/Footer/Footer.d.ts +6 -0
  55. package/dist/components/Footer/FooterAddress.d.ts +6 -0
  56. package/dist/components/Footer/FooterBase.d.ts +6 -0
  57. package/dist/components/Footer/FooterLogo.d.ts +5 -0
  58. package/dist/components/Footer/FooterMenu.d.ts +14 -0
  59. package/dist/components/GlobalMenu/AccountButton.d.ts +14 -0
  60. package/dist/components/GlobalMenu/AccountMenu.d.ts +20 -0
  61. package/dist/components/GlobalMenu/BackButton.d.ts +5 -0
  62. package/dist/components/GlobalMenu/GlobalMenu.d.ts +16 -0
  63. package/dist/components/GlobalMenu/GlobalMenuBase.d.ts +7 -0
  64. package/dist/components/GlobalMenu/LogoutButton.d.ts +7 -0
  65. package/dist/components/Header/DigdirLogomark.d.ts +5 -0
  66. package/dist/components/Header/Header.d.ts +9 -0
  67. package/dist/components/Header/HeaderBase.d.ts +9 -0
  68. package/dist/components/Header/HeaderButton.d.ts +15 -0
  69. package/dist/components/Header/HeaderLogo.d.ts +9 -0
  70. package/dist/components/Header/HeaderMenu.d.ts +7 -0
  71. package/dist/components/Header/HeaderSearch.d.ts +7 -0
  72. package/dist/components/History/HistoryAttachments.d.ts +6 -0
  73. package/dist/components/History/HistoryBorder.d.ts +7 -0
  74. package/dist/components/History/HistoryItem.d.ts +14 -0
  75. package/dist/components/History/HistoryList.d.ts +6 -0
  76. package/dist/components/Icon/CheckboxCheckedIcon.d.ts +8 -0
  77. package/dist/components/Icon/CheckboxIcon.d.ts +10 -0
  78. package/dist/components/Icon/CheckboxUncheckedIcon.d.ts +9 -0
  79. package/dist/components/Icon/Icon.d.ts +9 -0
  80. package/dist/components/Icon/ProgressIcon.d.ts +6 -0
  81. package/dist/components/Icon/RadioCheckedIcon.d.ts +8 -0
  82. package/dist/components/Icon/RadioIcon.d.ts +10 -0
  83. package/dist/components/Icon/RadioUncheckedIcon.d.ts +9 -0
  84. package/dist/components/Icon/SvgIcon.d.ts +9 -0
  85. package/dist/components/Icon/iconsMap.d.ts +1911 -0
  86. package/dist/components/Layout/Layout.d.ts +24 -0
  87. package/dist/components/Layout/LayoutBase.d.ts +21 -0
  88. package/dist/components/Layout/LayoutBody.d.ts +7 -0
  89. package/dist/components/Layout/LayoutContent.d.ts +7 -0
  90. package/dist/components/Layout/LayoutSidebar.d.ts +13 -0
  91. package/dist/components/LayoutAction/ActionFooter.d.ts +6 -0
  92. package/dist/components/LayoutAction/ActionHeader.d.ts +7 -0
  93. package/dist/components/LayoutAction/ActionMenu.d.ts +6 -0
  94. package/dist/components/List/List.d.ts +10 -0
  95. package/dist/components/List/ListBase.d.ts +9 -0
  96. package/dist/components/List/ListItem.d.ts +46 -0
  97. package/dist/components/List/ListItemBase.d.ts +27 -0
  98. package/dist/components/List/ListItemLabel.d.ts +9 -0
  99. package/dist/components/List/ListItemMedia.d.ts +14 -0
  100. package/dist/components/Menu/Menu.d.ts +8 -0
  101. package/dist/components/Menu/MenuBase.d.ts +27 -0
  102. package/dist/components/Menu/MenuHeader.d.ts +4 -0
  103. package/dist/components/Menu/MenuInputField.d.ts +12 -0
  104. package/dist/components/Menu/MenuItem.d.ts +35 -0
  105. package/dist/components/Menu/MenuItemBase.d.ts +23 -0
  106. package/dist/components/Menu/MenuItemLabel.d.ts +10 -0
  107. package/dist/components/Menu/MenuItemMedia.d.ts +14 -0
  108. package/dist/components/Menu/MenuItems.d.ts +17 -0
  109. package/dist/components/Menu/MenuOption.d.ts +19 -0
  110. package/dist/components/Menu/MenuSearch.d.ts +8 -0
  111. package/dist/components/Meta/MetaBase.d.ts +7 -0
  112. package/dist/components/Meta/MetaItem.d.ts +18 -0
  113. package/dist/components/Meta/MetaItemBase.d.ts +15 -0
  114. package/dist/components/Meta/MetaItemLabel.d.ts +11 -0
  115. package/dist/components/Meta/MetaItemMedia.d.ts +9 -0
  116. package/dist/components/Meta/MetaList.d.ts +12 -0
  117. package/dist/components/Meta/MetaProgress.d.ts +13 -0
  118. package/dist/components/Meta/MetaTimestamp.d.ts +16 -0
  119. package/dist/components/Page/PageBase.d.ts +6 -0
  120. package/dist/components/Page/PageHeader.d.ts +7 -0
  121. package/dist/components/Page/PageHeaderMedia.d.ts +10 -0
  122. package/dist/components/Page/PageNav.d.ts +14 -0
  123. package/dist/components/Page/SectionBase.d.ts +19 -0
  124. package/dist/components/Page/SectionFooter.d.ts +6 -0
  125. package/dist/components/Page/SectionHeader.d.ts +7 -0
  126. package/dist/components/RootProvider/RootProvider.d.ts +19 -0
  127. package/dist/components/Searchbar/Autocomplete.d.ts +9 -0
  128. package/dist/components/Searchbar/AutocompleteBase.d.ts +7 -0
  129. package/dist/components/Searchbar/AutocompleteGroup.d.ts +6 -0
  130. package/dist/components/Searchbar/AutocompleteItem.d.ts +13 -0
  131. package/dist/components/Searchbar/SearchField.d.ts +16 -0
  132. package/dist/components/Searchbar/Searchbar.d.ts +9 -0
  133. package/dist/components/Searchbar/SearchbarBase.d.ts +8 -0
  134. package/dist/components/Snackbar/Snackbar.d.ts +21 -0
  135. package/dist/components/Snackbar/SnackbarBase.d.ts +13 -0
  136. package/dist/components/Snackbar/SnackbarLabel.d.ts +5 -0
  137. package/dist/components/Snackbar/SnackbarMedia.d.ts +6 -0
  138. package/dist/components/Toolbar/Toolbar.d.ts +15 -0
  139. package/dist/components/Toolbar/ToolbarAdd.d.ts +10 -0
  140. package/dist/components/Toolbar/ToolbarBase.d.ts +7 -0
  141. package/dist/components/Toolbar/ToolbarButton.d.ts +14 -0
  142. package/dist/components/Toolbar/ToolbarFilter.d.ts +23 -0
  143. package/dist/components/Toolbar/ToolbarFilterBase.d.ts +6 -0
  144. package/dist/components/Toolbar/ToolbarMenu.d.ts +13 -0
  145. package/dist/components/Toolbar/ToolbarOptions.d.ts +18 -0
  146. package/dist/components/Toolbar/ToolbarSearch.d.ts +8 -0
  147. package/dist/components/Typography/Heading.d.ts +10 -0
  148. package/dist/components/Typography/Typography.d.ts +11 -0
  149. package/dist/hooks/useClickOutside.d.ts +2 -0
  150. package/dist/hooks/useEscapeKey.d.ts +1 -0
  151. package/dist/hooks/useMenu.d.ts +21 -0
  152. package/dist/index.css +1 -0
  153. package/dist/index.es.js +3340 -0
  154. package/package.json +27 -19
  155. package/.github/workflows/ci-cd-main.yml +0 -47
  156. package/.github/workflows/ci-cd-pull-request.yml +0 -39
  157. package/.github/workflows/workflow-deploy-storybook.yml +0 -35
  158. package/.node-version +0 -1
  159. package/.storybook/StoryDecorator.tsx +0 -29
  160. package/.storybook/ThemeProvider.tsx +0 -16
  161. package/.storybook/main.ts +0 -20
  162. package/.storybook/preview.tsx +0 -63
  163. package/.storybook/storyDecorator.module.css +0 -20
  164. package/.storybook/theme.module.css +0 -3
  165. package/CHANGELOG.md +0 -97
  166. package/CONTRIBUTING.MD +0 -59
  167. package/biome.jsonc +0 -65
  168. package/lib/components/Attachment/AttachmentLink.stories.ts +0 -19
  169. package/lib/components/Attachment/AttachmentLink.tsx +0 -20
  170. package/lib/components/Attachment/AttachmentList.stories.ts +0 -39
  171. package/lib/components/Attachment/AttachmentList.tsx +0 -26
  172. package/lib/components/Attachment/attachmentLink.module.css +0 -20
  173. package/lib/components/Attachment/attachmentList.module.css +0 -12
  174. package/lib/components/Avatar/Avatar.tsx +0 -83
  175. package/lib/components/Avatar/AvatarGroup.stories.ts +0 -66
  176. package/lib/components/Avatar/AvatarGroup.tsx +0 -60
  177. package/lib/components/Avatar/avatar.module.css +0 -61
  178. package/lib/components/Avatar/avatar.stories.tsx +0 -40
  179. package/lib/components/Avatar/avatarGroup.module.css +0 -78
  180. package/lib/components/Avatar/color.ts +0 -71
  181. package/lib/components/Badge/Badge.stories.ts +0 -32
  182. package/lib/components/Badge/Badge.tsx +0 -22
  183. package/lib/components/Badge/badge.module.css +0 -27
  184. package/lib/components/Bookmarks/BookmarksList.tsx +0 -17
  185. package/lib/components/Bookmarks/BookmarksListItem.stories.tsx +0 -79
  186. package/lib/components/Bookmarks/BookmarksListItem.tsx +0 -32
  187. package/lib/components/Bookmarks/QueryLabel.tsx +0 -33
  188. package/lib/components/Bookmarks/queryLabel.module.css +0 -45
  189. package/lib/components/Button/Button.stories.ts +0 -50
  190. package/lib/components/Button/Button.tsx +0 -60
  191. package/lib/components/Button/ButtonBase.tsx +0 -54
  192. package/lib/components/Button/ButtonIcon.tsx +0 -16
  193. package/lib/components/Button/ButtonLabel.tsx +0 -18
  194. package/lib/components/Button/Buttons.stories.tsx +0 -64
  195. package/lib/components/Button/ComboButton.stories.ts +0 -45
  196. package/lib/components/Button/ComboButton.tsx +0 -46
  197. package/lib/components/Button/IconButton.stories.tsx +0 -47
  198. package/lib/components/Button/IconButton.tsx +0 -33
  199. package/lib/components/Button/button.module.css +0 -22
  200. package/lib/components/Button/buttonBase.module.css +0 -142
  201. package/lib/components/Button/buttonIcon.module.css +0 -17
  202. package/lib/components/Button/buttonLabel.module.css +0 -17
  203. package/lib/components/Button/comboButton.module.css +0 -35
  204. package/lib/components/Button/iconButton.module.css +0 -31
  205. package/lib/components/ContextMenu/ContextMenu.stories.ts +0 -49
  206. package/lib/components/ContextMenu/ContextMenu.tsx +0 -20
  207. package/lib/components/ContextMenu/ContextMenuBase.tsx +0 -35
  208. package/lib/components/ContextMenu/contextMenuBase.module.css +0 -35
  209. package/lib/components/Datepicker/Datepicker.tsx +0 -49
  210. package/lib/components/Datepicker/DatepickerBase.tsx +0 -12
  211. package/lib/components/Datepicker/DatepickerHeader.tsx +0 -20
  212. package/lib/components/Datepicker/DatepickerTable.tsx +0 -50
  213. package/lib/components/Datepicker/datepickerBase.module.css +0 -5
  214. package/lib/components/Datepicker/datepickerHeader.module.css +0 -17
  215. package/lib/components/Datepicker/datepickerTable.module.css +0 -37
  216. package/lib/components/Datepicker/useDatepicker.tsx +0 -146
  217. package/lib/components/Dialog/Dialog.stories.ts +0 -331
  218. package/lib/components/Dialog/Dialog.tsx +0 -111
  219. package/lib/components/Dialog/DialogActions.stories.ts +0 -60
  220. package/lib/components/Dialog/DialogActions.tsx +0 -80
  221. package/lib/components/Dialog/DialogActivityLog.tsx +0 -18
  222. package/lib/components/Dialog/DialogArticleBase.tsx +0 -10
  223. package/lib/components/Dialog/DialogAttachments.stories.ts +0 -38
  224. package/lib/components/Dialog/DialogAttachments.tsx +0 -25
  225. package/lib/components/Dialog/DialogBase.tsx +0 -10
  226. package/lib/components/Dialog/DialogBodyBase.tsx +0 -17
  227. package/lib/components/Dialog/DialogBorder.tsx +0 -19
  228. package/lib/components/Dialog/DialogContent.stories.ts +0 -26
  229. package/lib/components/Dialog/DialogContent.tsx +0 -23
  230. package/lib/components/Dialog/DialogFooter.tsx +0 -14
  231. package/lib/components/Dialog/DialogGroup.tsx +0 -24
  232. package/lib/components/Dialog/DialogHeader.stories.ts +0 -24
  233. package/lib/components/Dialog/DialogHeader.tsx +0 -23
  234. package/lib/components/Dialog/DialogHeaderBase.tsx +0 -10
  235. package/lib/components/Dialog/DialogHeadings.stories.ts +0 -35
  236. package/lib/components/Dialog/DialogHeadings.tsx +0 -77
  237. package/lib/components/Dialog/DialogHistory.stories.ts +0 -67
  238. package/lib/components/Dialog/DialogHistory.tsx +0 -19
  239. package/lib/components/Dialog/DialogList.stories.ts +0 -65
  240. package/lib/components/Dialog/DialogList.tsx +0 -35
  241. package/lib/components/Dialog/DialogListItem.stories.tsx +0 -238
  242. package/lib/components/Dialog/DialogListItem.tsx +0 -126
  243. package/lib/components/Dialog/DialogListItemBase.tsx +0 -52
  244. package/lib/components/Dialog/DialogMetadata.stories.ts +0 -75
  245. package/lib/components/Dialog/DialogMetadata.tsx +0 -56
  246. package/lib/components/Dialog/DialogNav.stories.ts +0 -88
  247. package/lib/components/Dialog/DialogNav.tsx +0 -56
  248. package/lib/components/Dialog/DialogSectionBase.tsx +0 -20
  249. package/lib/components/Dialog/DialogSeenBy.stories.tsx +0 -56
  250. package/lib/components/Dialog/DialogSeenBy.tsx +0 -36
  251. package/lib/components/Dialog/DialogSelect.tsx +0 -23
  252. package/lib/components/Dialog/DialogStatus.stories.ts +0 -57
  253. package/lib/components/Dialog/DialogStatus.tsx +0 -61
  254. package/lib/components/Dialog/DialogTitle.stories.ts +0 -31
  255. package/lib/components/Dialog/DialogTitle.tsx +0 -31
  256. package/lib/components/Dialog/DialogTouchedBy.stories.tsx +0 -27
  257. package/lib/components/Dialog/DialogTouchedBy.tsx +0 -19
  258. package/lib/components/Dialog/dialog.module.css +0 -21
  259. package/lib/components/Dialog/dialogAction.module.css +0 -26
  260. package/lib/components/Dialog/dialogArticleBase.module.css +0 -5
  261. package/lib/components/Dialog/dialogBodyBase.module.css +0 -13
  262. package/lib/components/Dialog/dialogBorder.module.css +0 -42
  263. package/lib/components/Dialog/dialogGroup.module.css +0 -35
  264. package/lib/components/Dialog/dialogHeaderBase.module.css +0 -6
  265. package/lib/components/Dialog/dialogHeadings.module.css +0 -24
  266. package/lib/components/Dialog/dialogHistory.module.css +0 -12
  267. package/lib/components/Dialog/dialogListItem.module.css +0 -81
  268. package/lib/components/Dialog/dialogListItemBase.module.css +0 -28
  269. package/lib/components/Dialog/dialogNav.module.css +0 -12
  270. package/lib/components/Dialog/dialogSectionBase.module.css +0 -11
  271. package/lib/components/Dialog/dialogSelect.module.css +0 -34
  272. package/lib/components/Dialog/dialogTitle.module.css +0 -47
  273. package/lib/components/Dropdown/Backdrop.tsx +0 -12
  274. package/lib/components/Dropdown/DrawerBase.tsx +0 -20
  275. package/lib/components/Dropdown/DrawerBody.tsx +0 -12
  276. package/lib/components/Dropdown/DrawerButton.tsx +0 -17
  277. package/lib/components/Dropdown/DrawerFooter.tsx +0 -12
  278. package/lib/components/Dropdown/DrawerHeader.tsx +0 -19
  279. package/lib/components/Dropdown/DrawerOrDropdown.tsx +0 -29
  280. package/lib/components/Dropdown/DropdownBase.tsx +0 -32
  281. package/lib/components/Dropdown/backdrop.module.css +0 -11
  282. package/lib/components/Dropdown/drawerBase.module.css +0 -17
  283. package/lib/components/Dropdown/drawerBody.module.css +0 -5
  284. package/lib/components/Dropdown/drawerButton.module.css +0 -6
  285. package/lib/components/Dropdown/drawerFooter.module.css +0 -13
  286. package/lib/components/Dropdown/drawerHeader.module.css +0 -17
  287. package/lib/components/Dropdown/drawerOrDropdown.module.css +0 -19
  288. package/lib/components/Dropdown/dropdownBase.module.css +0 -35
  289. package/lib/components/Footer/Footer.stories.ts +0 -37
  290. package/lib/components/Footer/Footer.tsx +0 -21
  291. package/lib/components/Footer/FooterAddress.tsx +0 -12
  292. package/lib/components/Footer/FooterBase.tsx +0 -16
  293. package/lib/components/Footer/FooterLogo.tsx +0 -17
  294. package/lib/components/Footer/FooterMenu.tsx +0 -43
  295. package/lib/components/Footer/footerAddress.module.css +0 -8
  296. package/lib/components/Footer/footerBase.module.css +0 -28
  297. package/lib/components/Footer/footerLogo.module.css +0 -12
  298. package/lib/components/Footer/footerMenu.module.css +0 -35
  299. package/lib/components/GlobalMenu/AccountButton.tsx +0 -46
  300. package/lib/components/GlobalMenu/AccountMenu.stories.tsx +0 -65
  301. package/lib/components/GlobalMenu/AccountMenu.tsx +0 -82
  302. package/lib/components/GlobalMenu/BackButton.tsx +0 -10
  303. package/lib/components/GlobalMenu/GlobalMenu.stories.tsx +0 -181
  304. package/lib/components/GlobalMenu/GlobalMenu.tsx +0 -86
  305. package/lib/components/GlobalMenu/GlobalMenuBase.tsx +0 -22
  306. package/lib/components/GlobalMenu/LogoutButton.tsx +0 -19
  307. package/lib/components/GlobalMenu/globalMenuBase.module.css +0 -39
  308. package/lib/components/GlobalMenu/logoutButton.module.css +0 -9
  309. package/lib/components/Header/DigdirLogomark.tsx +0 -23
  310. package/lib/components/Header/Header.stories.tsx +0 -188
  311. package/lib/components/Header/Header.tsx +0 -71
  312. package/lib/components/Header/HeaderBase.tsx +0 -21
  313. package/lib/components/Header/HeaderButton.stories.ts +0 -70
  314. package/lib/components/Header/HeaderButton.tsx +0 -68
  315. package/lib/components/Header/HeaderLogo.stories.ts +0 -17
  316. package/lib/components/Header/HeaderLogo.tsx +0 -22
  317. package/lib/components/Header/HeaderMenu.tsx +0 -17
  318. package/lib/components/Header/HeaderSearch.tsx +0 -17
  319. package/lib/components/Header/header.module.css +0 -24
  320. package/lib/components/Header/headerBase.module.css +0 -51
  321. package/lib/components/Header/headerButton.module.css +0 -37
  322. package/lib/components/Header/headerLogo.module.css +0 -24
  323. package/lib/components/Header/headerMenu.module.css +0 -3
  324. package/lib/components/Header/headerSearch.module.css +0 -21
  325. package/lib/components/Header/mobileMenu.module.css +0 -28
  326. package/lib/components/History/HistoryAttachments.tsx +0 -22
  327. package/lib/components/History/HistoryBorder.tsx +0 -17
  328. package/lib/components/History/HistoryItem.stories.ts +0 -56
  329. package/lib/components/History/HistoryItem.tsx +0 -56
  330. package/lib/components/History/HistoryList.stories.ts +0 -72
  331. package/lib/components/History/HistoryList.tsx +0 -26
  332. package/lib/components/History/historyBorder.module.css +0 -8
  333. package/lib/components/History/historyItem.module.css +0 -19
  334. package/lib/components/History/historyList.module.css +0 -12
  335. package/lib/components/Icon/CheckboxCheckedIcon.tsx +0 -28
  336. package/lib/components/Icon/CheckboxIcon.stories.ts +0 -32
  337. package/lib/components/Icon/CheckboxIcon.tsx +0 -17
  338. package/lib/components/Icon/CheckboxUncheckedIcon.tsx +0 -38
  339. package/lib/components/Icon/Icon.stories.ts +0 -24
  340. package/lib/components/Icon/Icon.tsx +0 -23
  341. package/lib/components/Icon/ProgressIcon.stories.ts +0 -43
  342. package/lib/components/Icon/ProgressIcon.tsx +0 -44
  343. package/lib/components/Icon/RadioCheckedIcon.tsx +0 -29
  344. package/lib/components/Icon/RadioIcon.stories.ts +0 -32
  345. package/lib/components/Icon/RadioIcon.tsx +0 -17
  346. package/lib/components/Icon/RadioUncheckedIcon.tsx +0 -30
  347. package/lib/components/Icon/SvgIcon.tsx +0 -18
  348. package/lib/components/Icon/__AkselIcon.tsx +0 -37
  349. package/lib/components/Icon/checkboxIcon.module.css +0 -23
  350. package/lib/components/Icon/icon.module.css +0 -4
  351. package/lib/components/Icon/iconsMap.tsx +0 -2078
  352. package/lib/components/Icon/progressIcon.module.css +0 -29
  353. package/lib/components/Icon/radioIcon.module.css +0 -21
  354. package/lib/components/Layout/Layout.stories.tsx +0 -308
  355. package/lib/components/Layout/Layout.tsx +0 -46
  356. package/lib/components/Layout/LayoutBase.stories.ts +0 -17
  357. package/lib/components/Layout/LayoutBase.tsx +0 -31
  358. package/lib/components/Layout/LayoutBody.stories.ts +0 -17
  359. package/lib/components/Layout/LayoutBody.tsx +0 -16
  360. package/lib/components/Layout/LayoutContent.stories.ts +0 -17
  361. package/lib/components/Layout/LayoutContent.tsx +0 -15
  362. package/lib/components/Layout/LayoutSidebar.stories.ts +0 -17
  363. package/lib/components/Layout/LayoutSidebar.tsx +0 -23
  364. package/lib/components/Layout/layoutBase.module.css +0 -22
  365. package/lib/components/Layout/layoutBody.module.css +0 -15
  366. package/lib/components/Layout/layoutContent.module.css +0 -13
  367. package/lib/components/Layout/layoutSidebar.module.css +0 -20
  368. package/lib/components/LayoutAction/ActionFooter.stories.tsx +0 -70
  369. package/lib/components/LayoutAction/ActionFooter.tsx +0 -15
  370. package/lib/components/LayoutAction/ActionHeader.stories.ts +0 -20
  371. package/lib/components/LayoutAction/ActionHeader.tsx +0 -19
  372. package/lib/components/LayoutAction/ActionMenu.stories.tsx +0 -40
  373. package/lib/components/LayoutAction/ActionMenu.tsx +0 -23
  374. package/lib/components/LayoutAction/actionFooter.module.css +0 -28
  375. package/lib/components/LayoutAction/actionHeader.module.css +0 -55
  376. package/lib/components/LayoutAction/actionMenu.module.css +0 -30
  377. package/lib/components/List/List.stories.tsx +0 -43
  378. package/lib/components/List/List.tsx +0 -20
  379. package/lib/components/List/ListBase.tsx +0 -19
  380. package/lib/components/List/ListItem.stories.tsx +0 -208
  381. package/lib/components/List/ListItem.tsx +0 -73
  382. package/lib/components/List/ListItemBase.tsx +0 -82
  383. package/lib/components/List/ListItemLabel.tsx +0 -29
  384. package/lib/components/List/ListItemMedia.tsx +0 -59
  385. package/lib/components/List/listBase.module.css +0 -30
  386. package/lib/components/List/listItemBase.module.css +0 -97
  387. package/lib/components/List/listItemLabel.module.css +0 -55
  388. package/lib/components/List/listItemMedia.module.css +0 -41
  389. package/lib/components/Menu/Menu.stories.ts +0 -514
  390. package/lib/components/Menu/Menu.tsx +0 -24
  391. package/lib/components/Menu/MenuBase.tsx +0 -63
  392. package/lib/components/Menu/MenuHeader.tsx +0 -13
  393. package/lib/components/Menu/MenuInputField.tsx +0 -38
  394. package/lib/components/Menu/MenuItem.stories.tsx +0 -164
  395. package/lib/components/Menu/MenuItem.tsx +0 -63
  396. package/lib/components/Menu/MenuItemBase.tsx +0 -77
  397. package/lib/components/Menu/MenuItemLabel.tsx +0 -30
  398. package/lib/components/Menu/MenuItemMedia.tsx +0 -42
  399. package/lib/components/Menu/MenuItems.stories.ts +0 -438
  400. package/lib/components/Menu/MenuItems.tsx +0 -96
  401. package/lib/components/Menu/MenuOption.stories.ts +0 -52
  402. package/lib/components/Menu/MenuOption.tsx +0 -48
  403. package/lib/components/Menu/MenuSearch.stories.ts +0 -18
  404. package/lib/components/Menu/MenuSearch.tsx +0 -25
  405. package/lib/components/Menu/menu.module.css +0 -25
  406. package/lib/components/Menu/menuBase.module.css +0 -25
  407. package/lib/components/Menu/menuHeader.module.css +0 -12
  408. package/lib/components/Menu/menuInputField.module.css +0 -54
  409. package/lib/components/Menu/menuItemBase.module.css +0 -79
  410. package/lib/components/Menu/menuItemLabel.module.css +0 -32
  411. package/lib/components/Menu/menuItemMedia.module.css +0 -38
  412. package/lib/components/Menu/menuOption.module.css +0 -27
  413. package/lib/components/Menu/menuSearch.module.css +0 -30
  414. package/lib/components/Meta/MetaBase.tsx +0 -15
  415. package/lib/components/Meta/MetaItem.stories.ts +0 -25
  416. package/lib/components/Meta/MetaItem.tsx +0 -31
  417. package/lib/components/Meta/MetaItemBase.tsx +0 -46
  418. package/lib/components/Meta/MetaItemLabel.tsx +0 -20
  419. package/lib/components/Meta/MetaItemMedia.tsx +0 -22
  420. package/lib/components/Meta/MetaList.stories.ts +0 -29
  421. package/lib/components/Meta/MetaList.tsx +0 -43
  422. package/lib/components/Meta/MetaProgress.stories.ts +0 -29
  423. package/lib/components/Meta/MetaProgress.tsx +0 -26
  424. package/lib/components/Meta/MetaTimestamp.stories.ts +0 -33
  425. package/lib/components/Meta/MetaTimestamp.tsx +0 -29
  426. package/lib/components/Meta/meta.module.css +0 -6
  427. package/lib/components/Meta/metaItem.module.css +0 -107
  428. package/lib/components/Meta/metaList.module.css +0 -15
  429. package/lib/components/Page/PageBase.tsx +0 -14
  430. package/lib/components/Page/PageHeader.tsx +0 -25
  431. package/lib/components/Page/PageHeaderMedia.tsx +0 -25
  432. package/lib/components/Page/PageNav.tsx +0 -34
  433. package/lib/components/Page/SectionBase.tsx +0 -52
  434. package/lib/components/Page/SectionFooter.tsx +0 -15
  435. package/lib/components/Page/SectionHeader.tsx +0 -16
  436. package/lib/components/Page/pageHeader.module.css +0 -18
  437. package/lib/components/Page/pageNav.module.css +0 -12
  438. package/lib/components/Page/sectionBase.module.css +0 -92
  439. package/lib/components/Page/sectionFooter.module.css +0 -8
  440. package/lib/components/Page/sectionHeader.module.css +0 -9
  441. package/lib/components/RootProvider/RootProvider.tsx +0 -56
  442. package/lib/components/Searchbar/Autocomplete.stories.tsx +0 -77
  443. package/lib/components/Searchbar/Autocomplete.tsx +0 -44
  444. package/lib/components/Searchbar/AutocompleteBase.tsx +0 -16
  445. package/lib/components/Searchbar/AutocompleteGroup.tsx +0 -17
  446. package/lib/components/Searchbar/AutocompleteItem.tsx +0 -23
  447. package/lib/components/Searchbar/SearchField.tsx +0 -81
  448. package/lib/components/Searchbar/Searchbar.stories.tsx +0 -151
  449. package/lib/components/Searchbar/Searchbar.tsx +0 -26
  450. package/lib/components/Searchbar/SearchbarBase.tsx +0 -23
  451. package/lib/components/Searchbar/autocompleteBase.module.css +0 -17
  452. package/lib/components/Searchbar/autocompleteGroup.module.css +0 -3
  453. package/lib/components/Searchbar/autocompleteItem.module.css +0 -19
  454. package/lib/components/Searchbar/searchField.module.css +0 -54
  455. package/lib/components/Searchbar/searchbarBase.module.css +0 -20
  456. package/lib/components/Snackbar/Snackbar.stories.tsx +0 -21
  457. package/lib/components/Snackbar/Snackbar.tsx +0 -32
  458. package/lib/components/Snackbar/SnackbarBase.tsx +0 -39
  459. package/lib/components/Snackbar/SnackbarLabel.tsx +0 -10
  460. package/lib/components/Snackbar/SnackbarMedia.tsx +0 -14
  461. package/lib/components/Snackbar/snackbarBase.module.css +0 -55
  462. package/lib/components/Snackbar/snackbarLabel.module.css +0 -6
  463. package/lib/components/Snackbar/snackbarMedia.module.css +0 -10
  464. package/lib/components/Toolbar/Toolbar.stories.tsx +0 -188
  465. package/lib/components/Toolbar/Toolbar.tsx +0 -159
  466. package/lib/components/Toolbar/ToolbarAdd.stories.ts +0 -23
  467. package/lib/components/Toolbar/ToolbarAdd.tsx +0 -26
  468. package/lib/components/Toolbar/ToolbarBase.tsx +0 -12
  469. package/lib/components/Toolbar/ToolbarButton.stories.ts +0 -32
  470. package/lib/components/Toolbar/ToolbarButton.tsx +0 -65
  471. package/lib/components/Toolbar/ToolbarDate.stories.ts +0 -62
  472. package/lib/components/Toolbar/ToolbarDaterange.stories.ts +0 -24
  473. package/lib/components/Toolbar/ToolbarDaterange.tsx +0 -73
  474. package/lib/components/Toolbar/ToolbarFilter.stories.ts +0 -64
  475. package/lib/components/Toolbar/ToolbarFilter.tsx +0 -82
  476. package/lib/components/Toolbar/ToolbarFilterBase.tsx +0 -15
  477. package/lib/components/Toolbar/ToolbarMenu.stories.ts +0 -37
  478. package/lib/components/Toolbar/ToolbarMenu.tsx +0 -29
  479. package/lib/components/Toolbar/ToolbarOptions.stories.ts +0 -108
  480. package/lib/components/Toolbar/ToolbarOptions.tsx +0 -74
  481. package/lib/components/Toolbar/ToolbarSearch.stories.ts +0 -19
  482. package/lib/components/Toolbar/ToolbarSearch.tsx +0 -24
  483. package/lib/components/Toolbar/toolbarBase.module.css +0 -19
  484. package/lib/components/Toolbar/toolbarButton.module.css +0 -3
  485. package/lib/components/Toolbar/toolbarDaterange.module.css +0 -12
  486. package/lib/components/Toolbar/toolbarFilterBase.module.css +0 -7
  487. package/lib/components/Toolbar/toolbarMenu.module.css +0 -7
  488. package/lib/components/Toolbar/toolbarSearch.module.css +0 -28
  489. package/lib/components/Typography/Heading.tsx +0 -23
  490. package/lib/components/Typography/Typography.tsx +0 -24
  491. package/lib/components/Typography/heading.module.css +0 -21
  492. package/lib/components/Typography/typography.module.css +0 -64
  493. package/lib/css/colors.css +0 -113
  494. package/lib/css/global.css +0 -16
  495. package/lib/css/shadows.css +0 -7
  496. package/lib/css/theme-article.css +0 -15
  497. package/lib/css/theme-company.css +0 -15
  498. package/lib/css/theme-global-dark.css +0 -19
  499. package/lib/css/theme-global.css +0 -15
  500. package/lib/css/theme-neutral.css +0 -15
  501. package/lib/css/theme-person.css +0 -15
  502. package/lib/css/theme.css +0 -22
  503. package/lib/hooks/useClickOutside.ts +0 -22
  504. package/lib/hooks/useEscapeKey.ts +0 -17
  505. package/lib/hooks/useMenu.tsx +0 -81
  506. package/lib/stories/Color/MenuItem.stories.tsx +0 -43
  507. package/lib/stories/Color/Swatches.stories.tsx +0 -19
  508. package/lib/stories/Color/Swatches.tsx +0 -42
  509. package/lib/stories/Color/colors.json +0 -62
  510. package/lib/stories/Color/swatches.module.css +0 -14
  511. package/lib/stories/Inbox/BookmarksPage.tsx +0 -78
  512. package/lib/stories/Inbox/DialogPage.tsx +0 -15
  513. package/lib/stories/Inbox/Inbox.stories.tsx +0 -55
  514. package/lib/stories/Inbox/Inbox.tsx +0 -12
  515. package/lib/stories/Inbox/InboxLayout.tsx +0 -51
  516. package/lib/stories/Inbox/InboxPage.tsx +0 -51
  517. package/lib/stories/Inbox/InboxProvider.tsx +0 -136
  518. package/lib/stories/Inbox/InboxSection.tsx +0 -39
  519. package/lib/stories/Inbox/InboxToolbar.tsx +0 -94
  520. package/lib/stories/Inbox/ProfilePage.tsx +0 -36
  521. package/lib/stories/Inbox/SettingsPage.tsx +0 -19
  522. package/lib/stories/Inbox/accounts/accounts.ts +0 -24
  523. package/lib/stories/Inbox/accounts/index.ts +0 -1
  524. package/lib/stories/Inbox/actionMenu.ts +0 -24
  525. package/lib/stories/Inbox/dialogs/brreg-completed.json +0 -35
  526. package/lib/stories/Inbox/dialogs/brreg-draft.json +0 -41
  527. package/lib/stories/Inbox/dialogs/enova-in-progress.json +0 -35
  528. package/lib/stories/Inbox/dialogs/index.ts +0 -53
  529. package/lib/stories/Inbox/dialogs/skatt-2023.json +0 -33
  530. package/lib/stories/Inbox/dialogs/sykmelding-referat.json +0 -41
  531. package/lib/stories/Inbox/groupBy.ts +0 -19
  532. package/lib/stories/Inbox/inboxSection.module.css +0 -19
  533. package/lib/stories/Inbox/index.ts +0 -15
  534. package/lib/stories/Inbox/layout/footer.ts +0 -27
  535. package/lib/stories/Inbox/layout/header.ts +0 -11
  536. package/lib/stories/Inbox/layout/index.ts +0 -3
  537. package/lib/stories/Inbox/layout/menu.ts +0 -64
  538. package/renovate.json +0 -4
  539. package/tsconfig.json +0 -28
  540. package/tsconfig.node.json +0 -11
  541. package/typings.d.ts +0 -1
  542. package/vite.config.ts +0 -20
  543. /package/{lib/components/Attachment/index.ts → dist/components/Attachment/index.d.ts} +0 -0
  544. /package/{lib/components/Avatar/index.ts → dist/components/Avatar/index.d.ts} +0 -0
  545. /package/{lib/components/Badge/index.tsx → dist/components/Badge/index.d.ts} +0 -0
  546. /package/{lib/components/Bookmarks/index.ts → dist/components/Bookmarks/index.d.ts} +0 -0
  547. /package/{lib/components/Button/index.ts → dist/components/Button/index.d.ts} +0 -0
  548. /package/{lib/components/ContextMenu/index.ts → dist/components/ContextMenu/index.d.ts} +0 -0
  549. /package/{lib/components/Datepicker/index.ts → dist/components/Datepicker/index.d.ts} +0 -0
  550. /package/{lib/components/Dialog/index.ts → dist/components/Dialog/index.d.ts} +0 -0
  551. /package/{lib/components/Footer/index.ts → dist/components/Footer/index.d.ts} +0 -0
  552. /package/{lib/components/GlobalMenu/index.tsx → dist/components/GlobalMenu/index.d.ts} +0 -0
  553. /package/{lib/components/Header/index.tsx → dist/components/Header/index.d.ts} +0 -0
  554. /package/{lib/components/History/index.ts → dist/components/History/index.d.ts} +0 -0
  555. /package/{lib/components/Icon/index.ts → dist/components/Icon/index.d.ts} +0 -0
  556. /package/{lib/components/Layout/index.tsx → dist/components/Layout/index.d.ts} +0 -0
  557. /package/{lib/components/LayoutAction/index.ts → dist/components/LayoutAction/index.d.ts} +0 -0
  558. /package/{lib/components/List/index.ts → dist/components/List/index.d.ts} +0 -0
  559. /package/{lib/components/Menu/index.ts → dist/components/Menu/index.d.ts} +0 -0
  560. /package/{lib/components/Meta/index.ts → dist/components/Meta/index.d.ts} +0 -0
  561. /package/{lib/components/Page/index.ts → dist/components/Page/index.d.ts} +0 -0
  562. /package/{lib/components/RootProvider/index.ts → dist/components/RootProvider/index.d.ts} +0 -0
  563. /package/{lib/components/Searchbar/index.ts → dist/components/Searchbar/index.d.ts} +0 -0
  564. /package/{lib/components/Snackbar/index.ts → dist/components/Snackbar/index.d.ts} +0 -0
  565. /package/{lib/components/Toolbar/index.ts → dist/components/Toolbar/index.d.ts} +0 -0
  566. /package/{lib/components/Typography/index.ts → dist/components/Typography/index.d.ts} +0 -0
  567. /package/{lib/components/index.ts → dist/components/index.d.ts} +0 -0
  568. /package/{lib/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
  569. /package/{lib/index.ts → dist/index.d.ts} +0 -0
@@ -1,146 +0,0 @@
1
- 'use client';
2
- import { useMemo } from 'react';
3
-
4
- export interface DatepickerDate {
5
- /** Day of the month */
6
- day: number;
7
- /** ISO date string in YYYY-MM-DD format */
8
- date: string;
9
- /** Indicates if the day is selected */
10
- selected: boolean;
11
- /** Indicates if the day belongs to the current month */
12
- isCurrentMonth: boolean;
13
- }
14
-
15
- /**
16
- * Represents a day object in the datepicker.
17
- */
18
- interface DayObject extends DatepickerDate {
19
- /** Year of the date */
20
- year: number;
21
- /** Zero-based month (0 = January, 11 = December) */
22
- month: number;
23
- }
24
-
25
- interface UseDatepickerOutput {
26
- /** Year of the calendar */
27
- year: number;
28
- /** Zero-based month of the calendar (0 = January, 11 = December) */
29
- month: number;
30
- /** Weeks in the calendar */
31
- rows: DayObject[][];
32
- /** Day of the month */
33
- day: number;
34
- /** ISO date string for the next month */
35
- next: string;
36
- /** ISO date string for the previous month */
37
- prev: string;
38
- }
39
-
40
- /**
41
- * Props for the useDatepicker hook.
42
- */
43
- interface UseDatepickerProps {
44
- /** ISO date string for the calendar month */
45
- date?: string;
46
- /** Optional ISO date string for the start of the selection range */
47
- selectFrom?: string;
48
- /** Optional ISO date string for the end of the selection range */
49
- selectTo?: string;
50
- }
51
-
52
- export const useDatepicker = ({ date, selectFrom, selectTo }: UseDatepickerProps): UseDatepickerOutput => {
53
- return useMemo(() => {
54
- const generateIsoDate = (year: number, month: number, day: number) => {
55
- const paddedMonth = String(month + 1).padStart(2, '0');
56
- const paddedDay = String(day).padStart(2, '0');
57
- return `${year}-${paddedMonth}-${paddedDay}`;
58
- };
59
-
60
- const isSelected = (isoDate: string) => {
61
- if (!fromTimestamp && !toTimestamp) {
62
- return false;
63
- }
64
-
65
- const dateTimestamp = new Date(isoDate).getTime();
66
- return (
67
- (fromTimestamp === null || dateTimestamp >= fromTimestamp) &&
68
- (toTimestamp === null || dateTimestamp <= toTimestamp)
69
- );
70
- };
71
-
72
- const baseDate = date ? new Date(date) : new Date();
73
- const year = baseDate.getFullYear();
74
- const month = baseDate.getMonth();
75
-
76
- const fromTimestamp = selectFrom ? new Date(selectFrom).getTime() : null;
77
- const toTimestamp = selectTo ? new Date(selectTo).getTime() : null;
78
-
79
- const daysInMonth = new Date(year, month + 1, 0).getDate();
80
- const firstDayOfMonth = (new Date(year, month, 1).getDay() + 6) % 7; // Start weeks on Monday
81
- const daysInPrevMonth = new Date(year, month, 0).getDate();
82
-
83
- const rows: DayObject[][] = [];
84
- let currentDay = 1;
85
-
86
- for (let i = 0; i < 6; i++) {
87
- const week: DayObject[] = [];
88
- for (let j = 0; j < 7; j++) {
89
- if (i === 0 && j < firstDayOfMonth) {
90
- // Days from the previous month
91
- const day = daysInPrevMonth - firstDayOfMonth + j + 1;
92
- const prevMonth = month === 0 ? 11 : month - 1;
93
- const prevYear = month === 0 ? year - 1 : year;
94
- const isoDate = generateIsoDate(prevYear, prevMonth, day);
95
- week.push({
96
- year: prevYear,
97
- month: prevMonth,
98
- day,
99
- isCurrentMonth: false,
100
- date: isoDate,
101
- selected: isSelected(isoDate),
102
- });
103
- } else if (currentDay > daysInMonth) {
104
- // Days from the next month
105
- const day = currentDay - daysInMonth;
106
- const nextMonth = month === 11 ? 0 : month + 1;
107
- const nextYear = month === 11 ? year + 1 : year;
108
- const isoDate = generateIsoDate(nextYear, nextMonth, day);
109
- week.push({
110
- year: nextYear,
111
- month: nextMonth,
112
- day,
113
- isCurrentMonth: false,
114
- date: isoDate,
115
- selected: isSelected(isoDate),
116
- });
117
- currentDay++;
118
- } else {
119
- // Days from the current month
120
- const isoDate = generateIsoDate(year, month, currentDay);
121
- week.push({
122
- year,
123
- month,
124
- day: currentDay,
125
- isCurrentMonth: true,
126
- date: isoDate,
127
- selected: isSelected(isoDate),
128
- });
129
- currentDay++;
130
- }
131
- }
132
- rows.push(week);
133
- if (currentDay > daysInMonth) break; // Stop once we've covered all days
134
- }
135
-
136
- const prevMonth = month === 0 ? 11 : month - 1;
137
- const prevYear = month === 0 ? year - 1 : year;
138
- const prev = generateIsoDate(prevYear, prevMonth, 1);
139
-
140
- const nextMonth = month === 11 ? 0 : month + 1;
141
- const nextYear = month === 11 ? year + 1 : year;
142
- const next = generateIsoDate(nextYear, nextMonth, 1);
143
-
144
- return { year, month, rows, day: currentDay, next, prev };
145
- }, [date, selectFrom, selectTo]);
146
- };
@@ -1,331 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Dialog } from './Dialog';
3
-
4
- const meta = {
5
- title: 'Dialog/Dialog',
6
- component: Dialog,
7
- tags: ['autodocs'],
8
- parameters: {},
9
- argTypes: { body: { control: 'text' } },
10
- args: {
11
- menu: {
12
- id: 'context-menu',
13
- items: [
14
- {
15
- label: 'Fjern',
16
- id: 'remove',
17
- },
18
- ],
19
- },
20
- updatedAt: '1999-05-26',
21
- updatedAtLabel: '26. mai 1999',
22
- title: 'Title',
23
- summary: 'Summary',
24
- },
25
- } satisfies Meta<typeof Dialog>;
26
-
27
- export default meta;
28
- type Story = StoryObj<typeof meta>;
29
-
30
- export const Body: Story = {
31
- args: {
32
- body:
33
- '## Body\n\n' +
34
- 'Body will be loaded async.\n\n' +
35
- '### Syntax\n\n' +
36
- 'body supporters basic headings from h2 -> h4 + lists.\n\n' +
37
- '- List 1\n' +
38
- '- List 2\n' +
39
- '- List 3\n',
40
- },
41
- };
42
-
43
- export const Attachments: Story = {
44
- args: {
45
- attachments: {
46
- items: [
47
- {
48
- label: 'Dokument 1.pdf',
49
- href: '',
50
- },
51
- {
52
- label: 'Dokument 2.pdf',
53
- href: '',
54
- },
55
- ],
56
- },
57
- },
58
- };
59
-
60
- export const Action: Story = {
61
- args: {
62
- action: [
63
- {
64
- label: 'Primary',
65
- },
66
- {
67
- label: 'Secondary',
68
- },
69
- ],
70
- },
71
- };
72
-
73
- export const SeenBy: Story = {
74
- args: {
75
- ...Action.args,
76
- seenBy: {
77
- as: 'a',
78
- href: '#',
79
- label: 'Sett av deg + 24',
80
- seenByEndUser: true,
81
- seenByOthersCount: 24,
82
- },
83
- activityLog: {
84
- as: 'a',
85
- href: '#',
86
- label: 'Aktivitetslogg',
87
- },
88
- },
89
- };
90
-
91
- export const Example: Story = {
92
- args: {
93
- status: { value: 'requires-attention' },
94
- sender: {
95
- name: 'Statistisk sentralbyrå',
96
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
97
- },
98
- recipient: {
99
- name: 'Bergen Bar',
100
- },
101
- title: 'Rapportering av bedriftsdata',
102
- summary: 'Du må levere bedriftsdata innen 31. oktober.',
103
- additionalInfo:
104
- 'Din bedrift er pålagt å rapportere inn bedriftsdata innen **31. oktober**. ' +
105
- 'Vi bruker svarene dine kun til å utarbeide statistikk, og enkeltsvar vil aldri bli offentliggjort. Du kan når som helst kontakte oss og kreve av opplysningene om deg blir slettet.',
106
- action: [
107
- {
108
- label: 'Rapporter bedriftsdata',
109
- },
110
- ],
111
- attachments: {
112
- items: [
113
- {
114
- label: 'Vedtak om innlevering av bedriftsdata.pdf',
115
- href: '',
116
- },
117
- ],
118
- },
119
- },
120
- };
121
-
122
- export const HistoryContact: Story = {
123
- args: {
124
- status: { value: 'requires-attention' },
125
- sender: {
126
- name: 'Statistisk sentralbyrå',
127
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
128
- },
129
- recipient: {
130
- name: 'Bergen Bar',
131
- },
132
- title: 'Rapportering av bedriftsdata',
133
- summary: 'Innrapporteringen inneholder feil. Se over og lever på nytt.',
134
- additionalInfo:
135
- 'Din bedrift er pålagt å rapportere inn bedriftsdata innen **31. oktober**. ' +
136
- 'Vi bruker svarene dine kun til å utarbeide statistikk, og enkeltsvar vil aldri bli offentliggjort. Du kan når som helst kontakte oss og kreve av opplysningene om deg blir slettet.',
137
- action: [
138
- {
139
- label: 'Rapporter bedriftsdata',
140
- },
141
- ],
142
- attachments: {
143
- items: [
144
- {
145
- label: 'Feilliste.pdf',
146
- },
147
- ],
148
- },
149
- history: [
150
- {
151
- createdAt: '2004-01-01 13:34',
152
- createdBy: {
153
- name: 'Eirik Horneland',
154
- },
155
- summary: 'Rapportering ble sendt inn.',
156
- attachments: [
157
- {
158
- label: 'Kvittering.pdf',
159
- },
160
- ],
161
- },
162
- {
163
- createdAt: '2004-01-01 13:34',
164
- createdBy: {
165
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
166
-
167
- name: 'Statistisk sentralbyrå',
168
- },
169
- summary: 'Du må levere bedriftsdata innen 31. oktober.',
170
- attachments: [
171
- {
172
- label: 'Vedtak om innlevering av bedriftsdata.pdf',
173
- },
174
- ],
175
- },
176
- ],
177
- contactInfo:
178
- 'Kontakt oss på svar@ssb.no eller ring 62 88 56 08.\n\n' +
179
- 'Svartjenesten er åpen alle hverdager fra kl. 9-21 og lørdager fra kl. 10-16.',
180
- },
181
- };
182
-
183
- export const Signering: Story = {
184
- args: {
185
- status: { value: 'requires-attention' },
186
-
187
- sender: {
188
- name: 'Statistisk sentralbyrå',
189
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
190
- },
191
-
192
- recipient: {
193
- name: 'Bergen Bar',
194
- },
195
-
196
- title: 'Registrere enkeltmannsforetak',
197
- summary: 'Skjema er klar til signering.',
198
- additionalInfo:
199
- 'Din bedrift er pålagt å rapportere inn bedriftsdata innen **31. oktober**. Vi bruker svarene dine kun til å utarbeide statistikk, og enkeltsvar vil aldri bli offentliggjort. Du kan når som helst kontakte oss og kreve av opplysningene om deg blir slettet.',
200
-
201
- action: [
202
- {
203
- label: 'Gå til signering',
204
- },
205
- ],
206
-
207
- attachments: {},
208
-
209
- history: {
210
- items: [
211
- {
212
- updatedAt: '2004-01-01 13:34',
213
-
214
- updatedBy: {
215
- name: 'Eirik Horneland',
216
- },
217
-
218
- summary: 'Rapportering ble sendt inn.',
219
-
220
- attachments: [
221
- {
222
- label: 'Kvittering.pdf',
223
- },
224
- ],
225
- },
226
- {
227
- updatedAt: '2004-01-01 13:34',
228
-
229
- updatedBy: {
230
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
231
- name: 'Statistisk sentralbyrå',
232
- },
233
-
234
- summary: 'Du må levere bedriftsdata innen 31. oktober.',
235
-
236
- attachments: [
237
- {
238
- label: 'Vedtak om innlevering av bedriftsdata.pdf',
239
- },
240
- ],
241
- },
242
- ],
243
- },
244
-
245
- contact: {
246
- title: 'Ta kontakt',
247
- body: 'Ta kontakt for mer informasjon på telefon 99 00 00 00.',
248
- },
249
- },
250
- };
251
-
252
- export const BrregDraft: Story = {
253
- args: {
254
- status: { value: 'draft' },
255
-
256
- sender: {
257
- name: 'Statistisk sentralbyrå',
258
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
259
- },
260
-
261
- recipient: {
262
- name: 'Bergen Bar',
263
- },
264
-
265
- title: 'Registrere enkeltmannsforetak',
266
- summary: 'Skjema er opprettet.',
267
-
268
- action: [
269
- {
270
- label: 'Gå til skjema',
271
- },
272
- {
273
- label: 'Forkast',
274
- },
275
- ],
276
-
277
- attachments: {},
278
- additionalInfo:
279
- 'Enkeltpersonforetak må registreres i Enhetsregisteret for å få et organisasjonsnummer. Enkelte må også registreres i Foretaksregisteret.',
280
- },
281
- };
282
-
283
- export const BrregSign: Story = {
284
- args: {
285
- ...BrregDraft.args,
286
- status: { value: 'requires-attention' },
287
- summary: 'Skjema er klar til signering.',
288
-
289
- action: [
290
- {
291
- label: 'Til signering',
292
- },
293
- {
294
- label: 'Avslå signering',
295
- },
296
- ],
297
-
298
- history: {
299
- items: [
300
- {
301
- createdAt: '2004-01-01 13:34',
302
- createdBy: {
303
- type: 'person',
304
- name: 'Eirik Horneland',
305
- },
306
- summary: 'Rapportering ble sendt inn.',
307
- attachments: [
308
- {
309
- label: 'Kvittering.pdf',
310
- },
311
- ],
312
- },
313
- {
314
- createdAt: '2004-01-01 13:34',
315
- createdBy: {
316
- imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/SSB.0ca4474e.png',
317
- name: 'Statistisk sentralbyrå',
318
- },
319
-
320
- summary: 'Du må levere bedriftsdata innen 31. oktober.',
321
-
322
- attachments: [
323
- {
324
- label: 'Vedtak om innlevering av bedriftsdata.pdf',
325
- },
326
- ],
327
- },
328
- ],
329
- },
330
- },
331
- };
@@ -1,111 +0,0 @@
1
- import { MetaBase } from '../Meta';
2
- import { DialogActivityLog, type DialogActivityLogProps } from './DialogActivityLog';
3
- import { DialogArticleBase } from './DialogArticleBase';
4
- import { DialogAttachments, type DialogAttachmentsProps } from './DialogAttachments';
5
- import { DialogBase } from './DialogBase';
6
- import { DialogBodyBase } from './DialogBodyBase';
7
- import { DialogContent } from './DialogContent';
8
- import { DialogFooter } from './DialogFooter';
9
- import { DialogHeader } from './DialogHeader';
10
- import { DialogSeenBy, type DialogSeenByProps } from './DialogSeenBy';
11
-
12
- import type { ContextMenuProps } from '../ContextMenu/';
13
-
14
- import type { ReactNode } from 'react';
15
- import { type DialogActionButtonProps, DialogActions } from './DialogActions.tsx';
16
- import type { DialogRecipientProps, DialogSenderProps } from './DialogHeadings.tsx';
17
- import { DialogHistory, type DialogHistoryProps } from './DialogHistory';
18
- import { type DialogBackButtonProps, DialogNav } from './DialogNav';
19
- import type { DialogStatusProps } from './DialogStatus';
20
-
21
- export interface DialogProps {
22
- /** Dialog id */
23
- id: string;
24
- /** Title */
25
- title: string;
26
- /** Back button */
27
- backButton?: DialogBackButtonProps;
28
- /** Context menu */
29
- menu?: ContextMenuProps;
30
- /** Dialog status */
31
- status?: DialogStatusProps;
32
- /** Updated date time */
33
- updatedAt?: string;
34
- /** Updated label */
35
- updatedAtLabel?: string;
36
- /** Due date */
37
- dueAt?: string;
38
- /** Due at label */
39
- dueAtLabel?: string;
40
- /** Sender */
41
- sender?: DialogSenderProps;
42
- /** Recipient */
43
- recipient?: DialogRecipientProps;
44
- /** Summary */
45
- summary?: string;
46
- /** Body (should be an output markdown/html rendered to React / HTML) */
47
- body?: ReactNode;
48
- /** List of action (buttons) */
49
- actions?: DialogActionButtonProps[];
50
- /** Dialog attachments */
51
- attachments?: DialogAttachmentsProps;
52
- /** Dialog is seen by the end user or others */
53
- seenBy?: DialogSeenByProps;
54
- /** Activity Log */
55
- activityLog?: DialogActivityLogProps;
56
- /** More information about the dialog, process, etc. */
57
- additionalInfo?: string;
58
- /** History */
59
- history?: DialogHistoryProps;
60
- }
61
-
62
- /**
63
- * Full representation of a dialog, including attachments, actions and history,
64
- */
65
-
66
- export const Dialog = ({
67
- backButton,
68
- menu,
69
- updatedAt,
70
- updatedAtLabel,
71
- dueAt,
72
- dueAtLabel,
73
- status,
74
- title,
75
- sender,
76
- recipient,
77
- summary = 'Summary.',
78
- body,
79
- actions = [],
80
- attachments,
81
- history,
82
- seenBy,
83
- activityLog,
84
- additionalInfo,
85
- }: DialogProps) => {
86
- return (
87
- <DialogBase>
88
- <DialogNav status={status} dueAt={dueAt} dueAtLabel={dueAtLabel} backButton={backButton} menu={menu} />
89
- <DialogArticleBase>
90
- <DialogHeader
91
- title={title}
92
- sender={sender}
93
- recipient={recipient}
94
- seen={seenBy?.seenByEndUser ?? false}
95
- variant="neutral"
96
- />
97
- <DialogBodyBase>
98
- <DialogContent updatedAt={updatedAt} updatedAtLabel={updatedAtLabel} summary={summary} body={body} />
99
- {attachments && <DialogAttachments {...attachments} />}
100
- {actions?.length > 0 && <DialogActions items={actions} />}
101
- <MetaBase>
102
- {seenBy && <DialogSeenBy {...seenBy} />}
103
- {activityLog && <DialogActivityLog {...activityLog} />}
104
- </MetaBase>
105
- </DialogBodyBase>
106
- {additionalInfo && <DialogFooter additionalInfo={additionalInfo} />}
107
- {history && <DialogHistory {...history} />}
108
- </DialogArticleBase>
109
- </DialogBase>
110
- );
111
- };
@@ -1,60 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { DialogActions } from './DialogActions';
3
-
4
- const meta = {
5
- title: 'Dialog/Sections/DialogActions',
6
- component: DialogActions,
7
- tags: ['autodocs'],
8
- args: {
9
- items: [
10
- {
11
- label: 'Primary',
12
- priority: 'primary',
13
- id: 'primary',
14
- },
15
- {
16
- label: 'Secondary',
17
- priority: 'secondary',
18
- id: 'secondary',
19
- },
20
- ],
21
- },
22
- } satisfies Meta<typeof DialogActions>;
23
-
24
- export default meta;
25
- type Story = StoryObj<typeof meta>;
26
-
27
- export const Default: Story = {
28
- args: {},
29
- };
30
-
31
- export const Secondary: Story = {
32
- args: {},
33
- };
34
-
35
- export const MultipleButtons: Story = {
36
- args: {
37
- items: [
38
- {
39
- id: 'primary',
40
- label: 'Primary',
41
- priority: 'primary',
42
- },
43
- {
44
- id: 'secondary-1',
45
- label: 'Secondary',
46
- priority: 'secondary',
47
- },
48
- {
49
- id: 'tertiary-1',
50
- label: 'Third action',
51
- priority: 'tertiary',
52
- },
53
- {
54
- id: 'tertiary-2',
55
- label: 'Fourth action',
56
- priority: 'tertiary',
57
- },
58
- ],
59
- },
60
- };