@altinn/altinn-components 0.5.2 → 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.
- package/README.md +14 -2
- package/dist/components/Attachment/AttachmentLink.d.ts +10 -0
- package/dist/components/Attachment/AttachmentList.d.ts +7 -0
- package/dist/components/Avatar/Avatar.d.ts +27 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +20 -0
- package/dist/components/Avatar/color.d.ts +4 -0
- package/dist/components/Badge/Badge.d.ts +11 -0
- package/dist/components/Bookmarks/BookmarksList.d.ts +7 -0
- package/dist/components/Bookmarks/BookmarksListItem.d.ts +21 -0
- package/dist/components/Bookmarks/QueryLabel.d.ts +11 -0
- package/dist/components/Bookmarks/index.d.ts +3 -0
- package/dist/components/Button/Button.d.ts +8 -0
- package/dist/components/Button/ButtonBase.d.ts +20 -0
- package/dist/components/Button/ButtonIcon.d.ts +7 -0
- package/dist/components/Button/ButtonLabel.d.ts +8 -0
- package/dist/components/Button/ComboButton.d.ts +10 -0
- package/dist/components/Button/IconButton.d.ts +14 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +8 -0
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +9 -0
- package/dist/components/Datepicker/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +54 -0
- package/dist/components/Dialog/DialogActions.d.ts +16 -0
- package/dist/components/Dialog/DialogActivityLog.d.ts +10 -0
- package/dist/components/Dialog/DialogArticleBase.d.ts +6 -0
- package/dist/components/Dialog/DialogAttachments.d.ts +6 -0
- package/dist/components/Dialog/DialogBase.d.ts +5 -0
- package/dist/components/Dialog/DialogBodyBase.d.ts +5 -0
- package/dist/components/Dialog/DialogBorder.d.ts +9 -0
- package/dist/components/Dialog/DialogContent.d.ts +9 -0
- package/dist/components/Dialog/DialogFooter.d.ts +4 -0
- package/dist/components/Dialog/DialogGroup.d.ts +6 -0
- package/dist/components/Dialog/DialogHeader.d.ts +10 -0
- package/dist/components/Dialog/DialogHeaderBase.d.ts +5 -0
- package/dist/components/Dialog/DialogHeadings.d.ts +24 -0
- package/dist/components/Dialog/DialogHistory.d.ts +6 -0
- package/dist/components/Dialog/DialogList.d.ts +7 -0
- package/dist/components/Dialog/DialogListItem.d.ts +59 -0
- package/dist/components/Dialog/DialogListItemBase.d.ts +28 -0
- package/dist/components/Dialog/DialogMetadata.d.ts +22 -0
- package/dist/components/Dialog/DialogNav.d.ts +21 -0
- package/dist/components/Dialog/DialogSectionBase.d.ts +6 -0
- package/dist/components/Dialog/DialogSeenBy.d.ts +19 -0
- package/dist/components/Dialog/DialogSelect.d.ts +10 -0
- package/dist/components/Dialog/DialogStatus.d.ts +25 -0
- package/dist/components/Dialog/DialogTitle.d.ts +20 -0
- package/dist/components/Dialog/DialogTouchedBy.d.ts +10 -0
- package/dist/components/Dropdown/Backdrop.d.ts +6 -0
- package/dist/components/Dropdown/DrawerBase.d.ts +9 -0
- package/dist/components/Dropdown/DrawerBody.d.ts +6 -0
- package/dist/components/Dropdown/DrawerButton.d.ts +7 -0
- package/dist/components/Dropdown/DrawerFooter.d.ts +6 -0
- package/dist/components/Dropdown/DrawerHeader.d.ts +7 -0
- package/dist/components/Dropdown/DrawerOrDropdown.d.ts +10 -0
- package/dist/components/Dropdown/DropdownBase.d.ts +10 -0
- package/{lib/components/Dropdown/index.ts → dist/components/Dropdown/index.d.ts} +0 -1
- package/dist/components/Footer/Footer.d.ts +6 -0
- package/dist/components/Footer/FooterAddress.d.ts +6 -0
- package/dist/components/Footer/FooterBase.d.ts +6 -0
- package/dist/components/Footer/FooterLogo.d.ts +5 -0
- package/dist/components/Footer/FooterMenu.d.ts +14 -0
- package/dist/components/GlobalMenu/AccountButton.d.ts +14 -0
- package/dist/components/GlobalMenu/AccountMenu.d.ts +20 -0
- package/dist/components/GlobalMenu/BackButton.d.ts +5 -0
- package/dist/components/GlobalMenu/GlobalMenu.d.ts +16 -0
- package/dist/components/GlobalMenu/GlobalMenuBase.d.ts +7 -0
- package/dist/components/GlobalMenu/LogoutButton.d.ts +7 -0
- package/dist/components/Header/DigdirLogomark.d.ts +5 -0
- package/dist/components/Header/Header.d.ts +9 -0
- package/dist/components/Header/HeaderBase.d.ts +9 -0
- package/dist/components/Header/HeaderButton.d.ts +15 -0
- package/dist/components/Header/HeaderLogo.d.ts +9 -0
- package/dist/components/Header/HeaderMenu.d.ts +7 -0
- package/dist/components/Header/HeaderSearch.d.ts +7 -0
- package/dist/components/History/HistoryAttachments.d.ts +6 -0
- package/dist/components/History/HistoryBorder.d.ts +7 -0
- package/dist/components/History/HistoryItem.d.ts +14 -0
- package/dist/components/History/HistoryList.d.ts +6 -0
- package/dist/components/Icon/CheckboxCheckedIcon.d.ts +8 -0
- package/dist/components/Icon/CheckboxIcon.d.ts +10 -0
- package/dist/components/Icon/CheckboxUncheckedIcon.d.ts +9 -0
- package/dist/components/Icon/Icon.d.ts +9 -0
- package/dist/components/Icon/ProgressIcon.d.ts +6 -0
- package/dist/components/Icon/RadioCheckedIcon.d.ts +8 -0
- package/dist/components/Icon/RadioIcon.d.ts +10 -0
- package/dist/components/Icon/RadioUncheckedIcon.d.ts +9 -0
- package/dist/components/Icon/SvgIcon.d.ts +9 -0
- package/dist/components/Icon/iconsMap.d.ts +1911 -0
- package/dist/components/Layout/Layout.d.ts +24 -0
- package/dist/components/Layout/LayoutBase.d.ts +21 -0
- package/dist/components/Layout/LayoutBody.d.ts +7 -0
- package/dist/components/Layout/LayoutContent.d.ts +7 -0
- package/dist/components/Layout/LayoutSidebar.d.ts +13 -0
- package/dist/components/LayoutAction/ActionFooter.d.ts +6 -0
- package/dist/components/LayoutAction/ActionHeader.d.ts +7 -0
- package/dist/components/LayoutAction/ActionMenu.d.ts +6 -0
- package/dist/components/List/List.d.ts +10 -0
- package/dist/components/List/ListBase.d.ts +9 -0
- package/dist/components/List/ListItem.d.ts +46 -0
- package/dist/components/List/ListItemBase.d.ts +27 -0
- package/dist/components/List/ListItemLabel.d.ts +9 -0
- package/dist/components/List/ListItemMedia.d.ts +14 -0
- package/dist/components/Menu/Menu.d.ts +8 -0
- package/dist/components/Menu/MenuBase.d.ts +27 -0
- package/dist/components/Menu/MenuHeader.d.ts +4 -0
- package/dist/components/Menu/MenuInputField.d.ts +12 -0
- package/dist/components/Menu/MenuItem.d.ts +35 -0
- package/dist/components/Menu/MenuItemBase.d.ts +23 -0
- package/dist/components/Menu/MenuItemLabel.d.ts +10 -0
- package/dist/components/Menu/MenuItemMedia.d.ts +14 -0
- package/dist/components/Menu/MenuItems.d.ts +17 -0
- package/dist/components/Menu/MenuOption.d.ts +19 -0
- package/dist/components/Menu/MenuSearch.d.ts +8 -0
- package/{lib/components/Menu/index.ts → dist/components/Menu/index.d.ts} +1 -0
- package/dist/components/Meta/MetaBase.d.ts +7 -0
- package/dist/components/Meta/MetaItem.d.ts +18 -0
- package/dist/components/Meta/MetaItemBase.d.ts +15 -0
- package/dist/components/Meta/MetaItemLabel.d.ts +11 -0
- package/dist/components/Meta/MetaItemMedia.d.ts +9 -0
- package/dist/components/Meta/MetaList.d.ts +12 -0
- package/dist/components/Meta/MetaProgress.d.ts +13 -0
- package/dist/components/Meta/MetaTimestamp.d.ts +16 -0
- package/dist/components/Page/PageBase.d.ts +6 -0
- package/dist/components/Page/PageHeader.d.ts +7 -0
- package/dist/components/Page/PageHeaderMedia.d.ts +10 -0
- package/dist/components/Page/PageNav.d.ts +14 -0
- package/dist/components/Page/SectionBase.d.ts +19 -0
- package/dist/components/Page/SectionFooter.d.ts +6 -0
- package/dist/components/Page/SectionHeader.d.ts +7 -0
- package/dist/components/RootProvider/RootProvider.d.ts +19 -0
- package/dist/components/Searchbar/Autocomplete.d.ts +9 -0
- package/dist/components/Searchbar/AutocompleteBase.d.ts +7 -0
- package/dist/components/Searchbar/AutocompleteGroup.d.ts +6 -0
- package/dist/components/Searchbar/AutocompleteItem.d.ts +13 -0
- package/dist/components/Searchbar/SearchField.d.ts +16 -0
- package/dist/components/Searchbar/Searchbar.d.ts +9 -0
- package/dist/components/Searchbar/SearchbarBase.d.ts +8 -0
- package/dist/components/Snackbar/Snackbar.d.ts +21 -0
- package/dist/components/Snackbar/SnackbarBase.d.ts +13 -0
- package/dist/components/Snackbar/SnackbarLabel.d.ts +5 -0
- package/dist/components/Snackbar/SnackbarMedia.d.ts +6 -0
- package/dist/components/Toolbar/Toolbar.d.ts +15 -0
- package/dist/components/Toolbar/ToolbarAdd.d.ts +10 -0
- package/dist/components/Toolbar/ToolbarBase.d.ts +7 -0
- package/dist/components/Toolbar/ToolbarButton.d.ts +14 -0
- package/dist/components/Toolbar/ToolbarFilter.d.ts +23 -0
- package/dist/components/Toolbar/ToolbarFilterBase.d.ts +6 -0
- package/dist/components/Toolbar/ToolbarMenu.d.ts +13 -0
- package/dist/components/Toolbar/ToolbarOptions.d.ts +18 -0
- package/dist/components/Toolbar/ToolbarSearch.d.ts +8 -0
- package/dist/components/Typography/Heading.d.ts +10 -0
- package/dist/components/Typography/Typography.d.ts +11 -0
- package/{lib/components/index.ts → dist/components/index.d.ts} +3 -1
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useEscapeKey.d.ts +1 -0
- package/dist/hooks/useMenu.d.ts +21 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +3340 -0
- package/package.json +27 -19
- package/.github/workflows/ci-cd-main.yml +0 -47
- package/.github/workflows/ci-cd-pull-request.yml +0 -39
- package/.github/workflows/workflow-deploy-storybook.yml +0 -35
- package/.node-version +0 -1
- package/.storybook/StoryDecorator.tsx +0 -29
- package/.storybook/ThemeProvider.tsx +0 -16
- package/.storybook/main.ts +0 -20
- package/.storybook/preview.tsx +0 -63
- package/.storybook/storyDecorator.module.css +0 -20
- package/.storybook/theme.module.css +0 -3
- package/CHANGELOG.md +0 -90
- package/CONTRIBUTING.MD +0 -59
- package/biome.jsonc +0 -65
- package/lib/components/Attachment/AttachmentLink.stories.ts +0 -19
- package/lib/components/Attachment/AttachmentLink.tsx +0 -20
- package/lib/components/Attachment/AttachmentList.stories.ts +0 -39
- package/lib/components/Attachment/AttachmentList.tsx +0 -26
- package/lib/components/Attachment/attachmentLink.module.css +0 -20
- package/lib/components/Attachment/attachmentList.module.css +0 -12
- package/lib/components/Avatar/Avatar.tsx +0 -83
- package/lib/components/Avatar/AvatarGroup.stories.ts +0 -66
- package/lib/components/Avatar/AvatarGroup.tsx +0 -60
- package/lib/components/Avatar/avatar.module.css +0 -61
- package/lib/components/Avatar/avatar.stories.tsx +0 -40
- package/lib/components/Avatar/avatarGroup.module.css +0 -78
- package/lib/components/Avatar/color.ts +0 -71
- package/lib/components/Badge/Badge.stories.ts +0 -32
- package/lib/components/Badge/Badge.tsx +0 -22
- package/lib/components/Badge/badge.module.css +0 -27
- package/lib/components/Button/Button.stories.ts +0 -50
- package/lib/components/Button/Button.tsx +0 -60
- package/lib/components/Button/ButtonBase.tsx +0 -53
- package/lib/components/Button/ButtonIcon.tsx +0 -16
- package/lib/components/Button/ButtonLabel.tsx +0 -18
- package/lib/components/Button/Buttons.stories.tsx +0 -64
- package/lib/components/Button/ComboButton.stories.ts +0 -45
- package/lib/components/Button/ComboButton.tsx +0 -46
- package/lib/components/Button/IconButton.stories.tsx +0 -47
- package/lib/components/Button/IconButton.tsx +0 -31
- package/lib/components/Button/button.module.css +0 -22
- package/lib/components/Button/buttonBase.module.css +0 -142
- package/lib/components/Button/buttonIcon.module.css +0 -17
- package/lib/components/Button/buttonLabel.module.css +0 -17
- package/lib/components/Button/comboButton.module.css +0 -35
- package/lib/components/Button/iconButton.module.css +0 -31
- package/lib/components/ContextMenu/ContextMenu.stories.ts +0 -49
- package/lib/components/ContextMenu/ContextMenu.tsx +0 -20
- package/lib/components/ContextMenu/ContextMenuBase.tsx +0 -33
- package/lib/components/ContextMenu/contextMenuBase.module.css +0 -35
- package/lib/components/Dialog/Dialog.stories.ts +0 -331
- package/lib/components/Dialog/Dialog.tsx +0 -111
- package/lib/components/Dialog/DialogActions.stories.ts +0 -60
- package/lib/components/Dialog/DialogActions.tsx +0 -80
- package/lib/components/Dialog/DialogActivityLog.tsx +0 -18
- package/lib/components/Dialog/DialogArticleBase.tsx +0 -10
- package/lib/components/Dialog/DialogAttachments.stories.ts +0 -38
- package/lib/components/Dialog/DialogAttachments.tsx +0 -25
- package/lib/components/Dialog/DialogBase.tsx +0 -10
- package/lib/components/Dialog/DialogBodyBase.tsx +0 -17
- package/lib/components/Dialog/DialogBorder.tsx +0 -19
- package/lib/components/Dialog/DialogContent.stories.ts +0 -26
- package/lib/components/Dialog/DialogContent.tsx +0 -23
- package/lib/components/Dialog/DialogFooter.tsx +0 -14
- package/lib/components/Dialog/DialogGroup.tsx +0 -24
- package/lib/components/Dialog/DialogHeader.stories.ts +0 -24
- package/lib/components/Dialog/DialogHeader.tsx +0 -23
- package/lib/components/Dialog/DialogHeaderBase.tsx +0 -10
- package/lib/components/Dialog/DialogHeadings.stories.ts +0 -35
- package/lib/components/Dialog/DialogHeadings.tsx +0 -77
- package/lib/components/Dialog/DialogHistory.stories.ts +0 -67
- package/lib/components/Dialog/DialogHistory.tsx +0 -19
- package/lib/components/Dialog/DialogList.stories.ts +0 -65
- package/lib/components/Dialog/DialogList.tsx +0 -35
- package/lib/components/Dialog/DialogListItem.stories.tsx +0 -238
- package/lib/components/Dialog/DialogListItem.tsx +0 -126
- package/lib/components/Dialog/DialogListItemBase.tsx +0 -52
- package/lib/components/Dialog/DialogMetadata.stories.ts +0 -75
- package/lib/components/Dialog/DialogMetadata.tsx +0 -56
- package/lib/components/Dialog/DialogNav.stories.ts +0 -88
- package/lib/components/Dialog/DialogNav.tsx +0 -56
- package/lib/components/Dialog/DialogSectionBase.tsx +0 -20
- package/lib/components/Dialog/DialogSeenBy.stories.tsx +0 -56
- package/lib/components/Dialog/DialogSeenBy.tsx +0 -36
- package/lib/components/Dialog/DialogSelect.tsx +0 -23
- package/lib/components/Dialog/DialogStatus.stories.ts +0 -57
- package/lib/components/Dialog/DialogStatus.tsx +0 -61
- package/lib/components/Dialog/DialogTitle.stories.ts +0 -31
- package/lib/components/Dialog/DialogTitle.tsx +0 -31
- package/lib/components/Dialog/DialogTouchedBy.stories.tsx +0 -27
- package/lib/components/Dialog/DialogTouchedBy.tsx +0 -19
- package/lib/components/Dialog/dialog.module.css +0 -21
- package/lib/components/Dialog/dialogAction.module.css +0 -26
- package/lib/components/Dialog/dialogArticleBase.module.css +0 -5
- package/lib/components/Dialog/dialogBodyBase.module.css +0 -13
- package/lib/components/Dialog/dialogBorder.module.css +0 -42
- package/lib/components/Dialog/dialogGroup.module.css +0 -35
- package/lib/components/Dialog/dialogHeaderBase.module.css +0 -6
- package/lib/components/Dialog/dialogHeadings.module.css +0 -24
- package/lib/components/Dialog/dialogHistory.module.css +0 -12
- package/lib/components/Dialog/dialogListItem.module.css +0 -81
- package/lib/components/Dialog/dialogListItemBase.module.css +0 -28
- package/lib/components/Dialog/dialogNav.module.css +0 -12
- package/lib/components/Dialog/dialogSectionBase.module.css +0 -11
- package/lib/components/Dialog/dialogSelect.module.css +0 -34
- package/lib/components/Dialog/dialogTitle.module.css +0 -47
- package/lib/components/Dropdown/Backdrop.tsx +0 -12
- package/lib/components/Dropdown/DrawerBase.tsx +0 -20
- package/lib/components/Dropdown/DrawerBody.tsx +0 -12
- package/lib/components/Dropdown/DrawerButton.tsx +0 -17
- package/lib/components/Dropdown/DrawerFooter.tsx +0 -12
- package/lib/components/Dropdown/DrawerHeader.tsx +0 -19
- package/lib/components/Dropdown/DrawerOrDropdown.tsx +0 -29
- package/lib/components/Dropdown/DropdownBase.tsx +0 -32
- package/lib/components/Dropdown/backdrop.module.css +0 -11
- package/lib/components/Dropdown/drawerBase.module.css +0 -17
- package/lib/components/Dropdown/drawerBody.module.css +0 -5
- package/lib/components/Dropdown/drawerButton.module.css +0 -6
- package/lib/components/Dropdown/drawerFooter.module.css +0 -13
- package/lib/components/Dropdown/drawerHeader.module.css +0 -17
- package/lib/components/Dropdown/drawerOrDropdown.module.css +0 -19
- package/lib/components/Dropdown/dropdownBase.module.css +0 -34
- package/lib/components/Footer/Footer.stories.ts +0 -37
- package/lib/components/Footer/Footer.tsx +0 -21
- package/lib/components/Footer/FooterAddress.tsx +0 -12
- package/lib/components/Footer/FooterBase.tsx +0 -16
- package/lib/components/Footer/FooterLogo.tsx +0 -17
- package/lib/components/Footer/FooterMenu.tsx +0 -43
- package/lib/components/Footer/footerAddress.module.css +0 -8
- package/lib/components/Footer/footerBase.module.css +0 -28
- package/lib/components/Footer/footerLogo.module.css +0 -12
- package/lib/components/Footer/footerMenu.module.css +0 -35
- package/lib/components/GlobalMenu/AccountButton.tsx +0 -30
- package/lib/components/GlobalMenu/AccountMenu.stories.tsx +0 -65
- package/lib/components/GlobalMenu/AccountMenu.tsx +0 -82
- package/lib/components/GlobalMenu/BackButton.tsx +0 -10
- package/lib/components/GlobalMenu/GlobalMenu.stories.tsx +0 -181
- package/lib/components/GlobalMenu/GlobalMenu.tsx +0 -81
- package/lib/components/GlobalMenu/GlobalMenuBase.tsx +0 -22
- package/lib/components/GlobalMenu/LogoutButton.tsx +0 -19
- package/lib/components/GlobalMenu/globalMenuBase.module.css +0 -39
- package/lib/components/GlobalMenu/logoutButton.module.css +0 -9
- package/lib/components/Header/DigdirLogomark.tsx +0 -23
- package/lib/components/Header/Header.stories.tsx +0 -188
- package/lib/components/Header/Header.tsx +0 -74
- package/lib/components/Header/HeaderBase.tsx +0 -21
- package/lib/components/Header/HeaderButton.stories.ts +0 -70
- package/lib/components/Header/HeaderButton.tsx +0 -67
- package/lib/components/Header/HeaderLogo.stories.ts +0 -17
- package/lib/components/Header/HeaderLogo.tsx +0 -22
- package/lib/components/Header/HeaderMenu.tsx +0 -17
- package/lib/components/Header/header.module.css +0 -45
- package/lib/components/Header/headerBase.module.css +0 -51
- package/lib/components/Header/headerButton.module.css +0 -37
- package/lib/components/Header/headerLogo.module.css +0 -24
- package/lib/components/Header/headerMenu.module.css +0 -3
- package/lib/components/Header/mobileMenu.module.css +0 -28
- package/lib/components/History/HistoryAttachments.tsx +0 -22
- package/lib/components/History/HistoryBorder.tsx +0 -17
- package/lib/components/History/HistoryItem.stories.ts +0 -56
- package/lib/components/History/HistoryItem.tsx +0 -56
- package/lib/components/History/HistoryList.stories.ts +0 -70
- package/lib/components/History/HistoryList.tsx +0 -26
- package/lib/components/History/historyBorder.module.css +0 -8
- package/lib/components/History/historyItem.module.css +0 -19
- package/lib/components/History/historyList.module.css +0 -12
- package/lib/components/Icon/CheckboxCheckedIcon.tsx +0 -28
- package/lib/components/Icon/CheckboxIcon.stories.ts +0 -32
- package/lib/components/Icon/CheckboxIcon.tsx +0 -17
- package/lib/components/Icon/CheckboxUncheckedIcon.tsx +0 -38
- package/lib/components/Icon/Icon.stories.ts +0 -24
- package/lib/components/Icon/Icon.tsx +0 -23
- package/lib/components/Icon/ProgressIcon.stories.ts +0 -43
- package/lib/components/Icon/ProgressIcon.tsx +0 -44
- package/lib/components/Icon/RadioCheckedIcon.tsx +0 -29
- package/lib/components/Icon/RadioIcon.stories.ts +0 -32
- package/lib/components/Icon/RadioIcon.tsx +0 -17
- package/lib/components/Icon/RadioUncheckedIcon.tsx +0 -30
- package/lib/components/Icon/SvgIcon.tsx +0 -18
- package/lib/components/Icon/__AkselIcon.tsx +0 -37
- package/lib/components/Icon/checkboxIcon.module.css +0 -23
- package/lib/components/Icon/icon.module.css +0 -4
- package/lib/components/Icon/iconsMap.tsx +0 -2078
- package/lib/components/Icon/progressIcon.module.css +0 -29
- package/lib/components/Icon/radioIcon.module.css +0 -21
- package/lib/components/Layout/Layout.stories.tsx +0 -308
- package/lib/components/Layout/Layout.tsx +0 -46
- package/lib/components/Layout/LayoutBase.stories.ts +0 -17
- package/lib/components/Layout/LayoutBase.tsx +0 -31
- package/lib/components/Layout/LayoutBody.stories.ts +0 -17
- package/lib/components/Layout/LayoutBody.tsx +0 -16
- package/lib/components/Layout/LayoutContent.stories.ts +0 -17
- package/lib/components/Layout/LayoutContent.tsx +0 -15
- package/lib/components/Layout/LayoutSidebar.stories.ts +0 -17
- package/lib/components/Layout/LayoutSidebar.tsx +0 -23
- package/lib/components/Layout/layoutBase.module.css +0 -22
- package/lib/components/Layout/layoutBody.module.css +0 -15
- package/lib/components/Layout/layoutContent.module.css +0 -13
- package/lib/components/Layout/layoutSidebar.module.css +0 -20
- package/lib/components/LayoutAction/ActionFooter.stories.tsx +0 -70
- package/lib/components/LayoutAction/ActionFooter.tsx +0 -15
- package/lib/components/LayoutAction/ActionHeader.stories.ts +0 -20
- package/lib/components/LayoutAction/ActionHeader.tsx +0 -19
- package/lib/components/LayoutAction/ActionMenu.stories.tsx +0 -40
- package/lib/components/LayoutAction/ActionMenu.tsx +0 -23
- package/lib/components/LayoutAction/actionFooter.module.css +0 -28
- package/lib/components/LayoutAction/actionHeader.module.css +0 -55
- package/lib/components/LayoutAction/actionMenu.module.css +0 -30
- package/lib/components/List/List.stories.tsx +0 -43
- package/lib/components/List/List.tsx +0 -20
- package/lib/components/List/ListBase.tsx +0 -19
- package/lib/components/List/ListItem.stories.tsx +0 -208
- package/lib/components/List/ListItem.tsx +0 -73
- package/lib/components/List/ListItemBase.tsx +0 -78
- package/lib/components/List/ListItemLabel.tsx +0 -29
- package/lib/components/List/ListItemMedia.tsx +0 -59
- package/lib/components/List/listBase.module.css +0 -16
- package/lib/components/List/listItemBase.module.css +0 -90
- package/lib/components/List/listItemLabel.module.css +0 -55
- package/lib/components/List/listItemMedia.module.css +0 -41
- package/lib/components/Menu/Menu.stories.ts +0 -514
- package/lib/components/Menu/Menu.tsx +0 -24
- package/lib/components/Menu/MenuBase.tsx +0 -63
- package/lib/components/Menu/MenuHeader.tsx +0 -13
- package/lib/components/Menu/MenuItem.stories.tsx +0 -164
- package/lib/components/Menu/MenuItem.tsx +0 -63
- package/lib/components/Menu/MenuItemBase.tsx +0 -77
- package/lib/components/Menu/MenuItemLabel.tsx +0 -30
- package/lib/components/Menu/MenuItemMedia.tsx +0 -42
- package/lib/components/Menu/MenuItems.stories.ts +0 -438
- package/lib/components/Menu/MenuItems.tsx +0 -96
- package/lib/components/Menu/MenuOption.stories.ts +0 -52
- package/lib/components/Menu/MenuOption.tsx +0 -48
- package/lib/components/Menu/MenuSearch.stories.ts +0 -18
- package/lib/components/Menu/MenuSearch.tsx +0 -25
- package/lib/components/Menu/menu.module.css +0 -25
- package/lib/components/Menu/menuBase.module.css +0 -25
- package/lib/components/Menu/menuHeader.module.css +0 -12
- package/lib/components/Menu/menuItemBase.module.css +0 -72
- package/lib/components/Menu/menuItemLabel.module.css +0 -32
- package/lib/components/Menu/menuItemMedia.module.css +0 -38
- package/lib/components/Menu/menuOption.module.css +0 -27
- package/lib/components/Menu/menuSearch.module.css +0 -30
- package/lib/components/Meta/MetaBase.tsx +0 -15
- package/lib/components/Meta/MetaItem.stories.ts +0 -25
- package/lib/components/Meta/MetaItem.tsx +0 -31
- package/lib/components/Meta/MetaItemBase.tsx +0 -46
- package/lib/components/Meta/MetaItemLabel.tsx +0 -20
- package/lib/components/Meta/MetaItemMedia.tsx +0 -22
- package/lib/components/Meta/MetaList.stories.ts +0 -29
- package/lib/components/Meta/MetaList.tsx +0 -43
- package/lib/components/Meta/MetaProgress.stories.ts +0 -29
- package/lib/components/Meta/MetaProgress.tsx +0 -26
- package/lib/components/Meta/MetaTimestamp.stories.ts +0 -33
- package/lib/components/Meta/MetaTimestamp.tsx +0 -29
- package/lib/components/Meta/meta.module.css +0 -6
- package/lib/components/Meta/metaItem.module.css +0 -107
- package/lib/components/Meta/metaList.module.css +0 -15
- package/lib/components/Page/PageBase.tsx +0 -14
- package/lib/components/Page/PageHeader.tsx +0 -21
- package/lib/components/Page/PageHeaderMedia.tsx +0 -25
- package/lib/components/Page/SectionBase.tsx +0 -52
- package/lib/components/Page/SectionFooter.tsx +0 -15
- package/lib/components/Page/SectionHeader.tsx +0 -16
- package/lib/components/Page/pageHeader.module.css +0 -5
- package/lib/components/Page/sectionBase.module.css +0 -82
- package/lib/components/Page/sectionFooter.module.css +0 -8
- package/lib/components/Page/sectionHeader.module.css +0 -9
- package/lib/components/RootProvider/RootProvider.tsx +0 -55
- package/lib/components/Searchbar/Autocomplete.stories.tsx +0 -77
- package/lib/components/Searchbar/Autocomplete.tsx +0 -44
- package/lib/components/Searchbar/AutocompleteBase.tsx +0 -16
- package/lib/components/Searchbar/AutocompleteGroup.tsx +0 -17
- package/lib/components/Searchbar/AutocompleteItem.tsx +0 -23
- package/lib/components/Searchbar/SearchField.tsx +0 -78
- package/lib/components/Searchbar/Searchbar.stories.tsx +0 -151
- package/lib/components/Searchbar/Searchbar.tsx +0 -18
- package/lib/components/Searchbar/SearchbarBase.tsx +0 -23
- package/lib/components/Searchbar/autocompleteBase.module.css +0 -17
- package/lib/components/Searchbar/autocompleteGroup.module.css +0 -3
- package/lib/components/Searchbar/autocompleteItem.module.css +0 -19
- package/lib/components/Searchbar/searchField.module.css +0 -54
- package/lib/components/Searchbar/searchbarBase.module.css +0 -20
- package/lib/components/Snackbar/Snackbar.stories.tsx +0 -21
- package/lib/components/Snackbar/Snackbar.tsx +0 -32
- package/lib/components/Snackbar/SnackbarBase.tsx +0 -39
- package/lib/components/Snackbar/SnackbarLabel.tsx +0 -10
- package/lib/components/Snackbar/SnackbarMedia.tsx +0 -14
- package/lib/components/Snackbar/snackbarBase.module.css +0 -55
- package/lib/components/Snackbar/snackbarLabel.module.css +0 -6
- package/lib/components/Snackbar/snackbarMedia.module.css +0 -10
- package/lib/components/Toolbar/Toolbar.stories.tsx +0 -188
- package/lib/components/Toolbar/Toolbar.tsx +0 -156
- package/lib/components/Toolbar/ToolbarAdd.stories.ts +0 -23
- package/lib/components/Toolbar/ToolbarAdd.tsx +0 -26
- package/lib/components/Toolbar/ToolbarBase.tsx +0 -12
- package/lib/components/Toolbar/ToolbarButton.stories.ts +0 -32
- package/lib/components/Toolbar/ToolbarButton.tsx +0 -65
- package/lib/components/Toolbar/ToolbarFilter.stories.ts +0 -64
- package/lib/components/Toolbar/ToolbarFilter.tsx +0 -75
- package/lib/components/Toolbar/ToolbarMenu.stories.ts +0 -37
- package/lib/components/Toolbar/ToolbarMenu.tsx +0 -29
- package/lib/components/Toolbar/ToolbarOptions.stories.ts +0 -108
- package/lib/components/Toolbar/ToolbarOptions.tsx +0 -74
- package/lib/components/Toolbar/ToolbarSearch.stories.ts +0 -19
- package/lib/components/Toolbar/ToolbarSearch.tsx +0 -24
- package/lib/components/Toolbar/toolbarAdd.module.css +0 -7
- package/lib/components/Toolbar/toolbarBase.module.css +0 -19
- package/lib/components/Toolbar/toolbarButton.module.css +0 -3
- package/lib/components/Toolbar/toolbarFilter.module.css +0 -25
- package/lib/components/Toolbar/toolbarMenu.module.css +0 -7
- package/lib/components/Toolbar/toolbarSearch.module.css +0 -28
- package/lib/components/Typography/Heading.tsx +0 -23
- package/lib/components/Typography/Typography.tsx +0 -24
- package/lib/components/Typography/heading.module.css +0 -21
- package/lib/components/Typography/typography.module.css +0 -64
- package/lib/css/colors.css +0 -113
- package/lib/css/global.css +0 -15
- package/lib/css/shadows.css +0 -7
- package/lib/css/theme-article.css +0 -15
- package/lib/css/theme-company.css +0 -15
- package/lib/css/theme-global-dark.css +0 -19
- package/lib/css/theme-global.css +0 -15
- package/lib/css/theme-neutral.css +0 -15
- package/lib/css/theme-person.css +0 -15
- package/lib/css/theme.css +0 -22
- package/lib/hooks/useClickOutside.ts +0 -22
- package/lib/hooks/useEscapeKey.ts +0 -17
- package/lib/hooks/useMenu.tsx +0 -80
- package/lib/stories/Color/MenuItem.stories.tsx +0 -43
- package/lib/stories/Color/Swatches.stories.tsx +0 -19
- package/lib/stories/Color/Swatches.tsx +0 -42
- package/lib/stories/Color/colors.json +0 -62
- package/lib/stories/Color/swatches.module.css +0 -14
- package/lib/stories/Inbox/BookmarksPage.tsx +0 -52
- package/lib/stories/Inbox/DialogPage.tsx +0 -15
- package/lib/stories/Inbox/Inbox.stories.tsx +0 -55
- package/lib/stories/Inbox/Inbox.tsx +0 -12
- package/lib/stories/Inbox/InboxLayout.tsx +0 -51
- package/lib/stories/Inbox/InboxPage.tsx +0 -50
- package/lib/stories/Inbox/InboxProvider.tsx +0 -135
- package/lib/stories/Inbox/InboxSection.tsx +0 -39
- package/lib/stories/Inbox/InboxToolbar.tsx +0 -94
- package/lib/stories/Inbox/ProfilePage.tsx +0 -35
- package/lib/stories/Inbox/SettingsPage.tsx +0 -19
- package/lib/stories/Inbox/accounts/accounts.ts +0 -24
- package/lib/stories/Inbox/accounts/index.ts +0 -1
- package/lib/stories/Inbox/actionMenu.ts +0 -24
- package/lib/stories/Inbox/dialogs/brreg-completed.json +0 -35
- package/lib/stories/Inbox/dialogs/brreg-draft.json +0 -45
- package/lib/stories/Inbox/dialogs/index.ts +0 -10
- package/lib/stories/Inbox/dialogs/skatt-2023.json +0 -33
- package/lib/stories/Inbox/groupBy.ts +0 -19
- package/lib/stories/Inbox/inboxSection.module.css +0 -19
- package/lib/stories/Inbox/index.ts +0 -15
- package/lib/stories/Inbox/layout/footer.ts +0 -27
- package/lib/stories/Inbox/layout/header.ts +0 -11
- package/lib/stories/Inbox/layout/index.ts +0 -3
- package/lib/stories/Inbox/layout/menu.ts +0 -64
- package/renovate.json +0 -4
- package/tsconfig.json +0 -28
- package/tsconfig.node.json +0 -11
- package/typings.d.ts +0 -1
- package/vite.config.ts +0 -20
- /package/{lib/components/Attachment/index.ts → dist/components/Attachment/index.d.ts} +0 -0
- /package/{lib/components/Avatar/index.ts → dist/components/Avatar/index.d.ts} +0 -0
- /package/{lib/components/Badge/index.tsx → dist/components/Badge/index.d.ts} +0 -0
- /package/{lib/components/Button/index.ts → dist/components/Button/index.d.ts} +0 -0
- /package/{lib/components/ContextMenu/index.ts → dist/components/ContextMenu/index.d.ts} +0 -0
- /package/{lib/components/Dialog/index.ts → dist/components/Dialog/index.d.ts} +0 -0
- /package/{lib/components/Footer/index.ts → dist/components/Footer/index.d.ts} +0 -0
- /package/{lib/components/GlobalMenu/index.tsx → dist/components/GlobalMenu/index.d.ts} +0 -0
- /package/{lib/components/Header/index.tsx → dist/components/Header/index.d.ts} +0 -0
- /package/{lib/components/History/index.ts → dist/components/History/index.d.ts} +0 -0
- /package/{lib/components/Icon/index.ts → dist/components/Icon/index.d.ts} +0 -0
- /package/{lib/components/Layout/index.tsx → dist/components/Layout/index.d.ts} +0 -0
- /package/{lib/components/LayoutAction/index.ts → dist/components/LayoutAction/index.d.ts} +0 -0
- /package/{lib/components/List/index.ts → dist/components/List/index.d.ts} +0 -0
- /package/{lib/components/Meta/index.ts → dist/components/Meta/index.d.ts} +0 -0
- /package/{lib/components/Page/index.ts → dist/components/Page/index.d.ts} +0 -0
- /package/{lib/components/RootProvider/index.ts → dist/components/RootProvider/index.d.ts} +0 -0
- /package/{lib/components/Searchbar/index.ts → dist/components/Searchbar/index.d.ts} +0 -0
- /package/{lib/components/Snackbar/index.ts → dist/components/Snackbar/index.d.ts} +0 -0
- /package/{lib/components/Toolbar/index.ts → dist/components/Toolbar/index.d.ts} +0 -0
- /package/{lib/components/Typography/index.ts → dist/components/Typography/index.d.ts} +0 -0
- /package/{lib/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
- /package/{lib/index.ts → dist/index.d.ts} +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { type MouseEventHandler, useMemo, useState } from 'react';
|
|
3
|
-
import { Button, ComboButton } from '../Button';
|
|
4
|
-
import { Menu, type MenuItemProps } from '../Menu';
|
|
5
|
-
import styles from './dialogAction.module.css';
|
|
6
|
-
|
|
7
|
-
export type DialogButtonPriority = 'primary' | 'secondary' | 'tertiary';
|
|
8
|
-
|
|
9
|
-
export interface DialogActionButtonProps {
|
|
10
|
-
id: string;
|
|
11
|
-
priority: DialogButtonPriority;
|
|
12
|
-
label?: string;
|
|
13
|
-
onClick?: MouseEventHandler;
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface DialogActionsProps {
|
|
18
|
-
/** List of actions */
|
|
19
|
-
items: DialogActionButtonProps[];
|
|
20
|
-
/** How many actions to display before turning into a ComboButton */
|
|
21
|
-
maxItems?: number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const DialogActions = ({ items, maxItems = 2 }: DialogActionsProps) => {
|
|
25
|
-
const [expanded, setExpanded] = useState<boolean>(false);
|
|
26
|
-
const sortedItems = useMemo(() => {
|
|
27
|
-
return (items || []).sort((a, b) => {
|
|
28
|
-
const priorityOrder = ['primary', 'secondary', 'tertiary'];
|
|
29
|
-
return priorityOrder.indexOf(a?.priority) - priorityOrder.indexOf(b?.priority);
|
|
30
|
-
});
|
|
31
|
-
}, [items]);
|
|
32
|
-
|
|
33
|
-
if (!sortedItems.length || maxItems <= 0) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (sortedItems.length > maxItems) {
|
|
38
|
-
const remainingItems: MenuItemProps[] = sortedItems.slice(1).map((item) => ({
|
|
39
|
-
id: item.id,
|
|
40
|
-
title: item.label,
|
|
41
|
-
onClick: item.onClick,
|
|
42
|
-
group: item.priority,
|
|
43
|
-
}));
|
|
44
|
-
return (
|
|
45
|
-
<section className={styles.comboButton}>
|
|
46
|
-
<ComboButton
|
|
47
|
-
color="primary"
|
|
48
|
-
variant="solid"
|
|
49
|
-
icon={expanded ? 'chevron-up' : 'chevron-down'}
|
|
50
|
-
size="lg"
|
|
51
|
-
onIconClick={() => setExpanded((expanded) => !expanded)}
|
|
52
|
-
>
|
|
53
|
-
{sortedItems[0].label}
|
|
54
|
-
</ComboButton>
|
|
55
|
-
<div className={styles.dropdown} aria-expanded={expanded}>
|
|
56
|
-
<Menu items={remainingItems} theme="global" />
|
|
57
|
-
</div>
|
|
58
|
-
</section>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<section className={styles.action}>
|
|
64
|
-
{sortedItems.map((item, index) => {
|
|
65
|
-
return (
|
|
66
|
-
<Button
|
|
67
|
-
key={'button-' + index}
|
|
68
|
-
onClick={item.onClick}
|
|
69
|
-
color="primary"
|
|
70
|
-
variant={item.priority === 'primary' ? 'solid' : 'outline'}
|
|
71
|
-
size="lg"
|
|
72
|
-
loading={item.loading}
|
|
73
|
-
>
|
|
74
|
-
{item.label}
|
|
75
|
-
</Button>
|
|
76
|
-
);
|
|
77
|
-
})}
|
|
78
|
-
</section>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ElementType, MouseEventHandler } from 'react';
|
|
2
|
-
import { MetaItem, type MetaItemSize } from '../Meta';
|
|
3
|
-
|
|
4
|
-
export interface DialogActivityLogProps {
|
|
5
|
-
size?: MetaItemSize;
|
|
6
|
-
label?: string;
|
|
7
|
-
as?: ElementType;
|
|
8
|
-
onClick?: MouseEventHandler;
|
|
9
|
-
href?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const DialogActivityLog = ({ size = 'xs', label = 'Activity log', ...rest }: DialogActivityLogProps) => {
|
|
13
|
-
return (
|
|
14
|
-
<MetaItem {...rest} size={size} icon={'clock-dashed'}>
|
|
15
|
-
{label}
|
|
16
|
-
</MetaItem>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import styles from './dialogArticleBase.module.css';
|
|
3
|
-
|
|
4
|
-
interface ArticleBaseProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const DialogArticleBase = ({ children }: ArticleBaseProps) => {
|
|
9
|
-
return <article className={styles.article}>{children}</article>;
|
|
10
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogAttachments } from './DialogAttachments';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Dialog/Sections/DialogAttachments',
|
|
6
|
-
component: DialogAttachments,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
title: '6 vedlegg',
|
|
10
|
-
items: [
|
|
11
|
-
{
|
|
12
|
-
label: 'A10-01 Situasjonsplan.pdf',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
label: 'A40-01 Fasade Nord Ny.pdf',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
label: 'A40-01 Fasade Øst.pdf',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
label: 'Tegning ny fasade.pdf',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: 'Tegning nytt snitt.pdf',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Redegjørelse estetikk.pdf',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
} satisfies Meta<typeof DialogAttachments>;
|
|
32
|
-
|
|
33
|
-
export default meta;
|
|
34
|
-
type Story = StoryObj<typeof meta>;
|
|
35
|
-
|
|
36
|
-
export const Default: Story = {
|
|
37
|
-
args: {},
|
|
38
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type AttachmentLinkProps, AttachmentList } from '../Attachment';
|
|
2
|
-
import { MetaItem } from '../Meta';
|
|
3
|
-
import { Typography } from '../Typography';
|
|
4
|
-
|
|
5
|
-
export interface DialogAttachmentsProps {
|
|
6
|
-
title?: string;
|
|
7
|
-
items?: AttachmentLinkProps[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const DialogAttachments = ({ title = 'Attachments', items }: DialogAttachmentsProps) => {
|
|
11
|
-
if (!items?.length) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<section>
|
|
17
|
-
<MetaItem as="h2" size="xs">
|
|
18
|
-
{title}
|
|
19
|
-
</MetaItem>
|
|
20
|
-
<Typography size="lg">
|
|
21
|
-
<AttachmentList size="lg" items={items} />
|
|
22
|
-
</Typography>
|
|
23
|
-
</section>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import styles from './dialog.module.css';
|
|
3
|
-
|
|
4
|
-
export interface DialogBaseProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const DialogBase = ({ children }: DialogBaseProps) => {
|
|
9
|
-
return <div className={styles.dialog}>{children}</div>;
|
|
10
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { DialogBorder } from './DialogBorder';
|
|
3
|
-
import styles from './dialogBodyBase.module.css';
|
|
4
|
-
|
|
5
|
-
export interface DialogBodyProps {
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const DialogBodyBase = ({ children }: DialogBodyProps) => {
|
|
10
|
-
return (
|
|
11
|
-
<DialogBorder className={styles.border}>
|
|
12
|
-
<div className={styles.body} data-theme="article">
|
|
13
|
-
{children}
|
|
14
|
-
</div>
|
|
15
|
-
</DialogBorder>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import type { DialogListItemSize } from './DialogListItemBase';
|
|
4
|
-
import styles from './dialogBorder.module.css';
|
|
5
|
-
|
|
6
|
-
export interface DialogBorderProps {
|
|
7
|
-
seen?: boolean;
|
|
8
|
-
size?: DialogListItemSize;
|
|
9
|
-
className?: string;
|
|
10
|
-
children?: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const DialogBorder = ({ seen = true, size = 'lg', className, children }: DialogBorderProps) => {
|
|
14
|
-
return (
|
|
15
|
-
<div className={cx(styles.border, className)} data-size={size} data-seen={seen}>
|
|
16
|
-
{children}
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogContent } from './DialogContent';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Dialog/DialogContent',
|
|
6
|
-
component: DialogContent,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
updatedAt: '1999-05-26 22:59:00',
|
|
10
|
-
summary: 'Summary',
|
|
11
|
-
body: 'Body',
|
|
12
|
-
},
|
|
13
|
-
} satisfies Meta<typeof DialogContent>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
|
|
18
|
-
export const Default: Story = {
|
|
19
|
-
args: {},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const UpdatedByName: Story = {
|
|
23
|
-
args: {
|
|
24
|
-
updatedByName: 'Ole Gunnar Solskjær',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { Typography } from '../Typography';
|
|
3
|
-
import { DialogMetadata } from './DialogMetadata';
|
|
4
|
-
|
|
5
|
-
export interface DialogContentProps {
|
|
6
|
-
updatedAt?: string;
|
|
7
|
-
updatedAtLabel?: string;
|
|
8
|
-
summary?: string;
|
|
9
|
-
body?: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** Main textual content of a dialog, including summary, body and a timestamp */
|
|
13
|
-
export const DialogContent = ({ updatedAt, updatedAtLabel, summary, body }: DialogContentProps) => {
|
|
14
|
-
return (
|
|
15
|
-
<section>
|
|
16
|
-
<DialogMetadata updatedAt={updatedAt} updatedAtLabel={updatedAtLabel} />
|
|
17
|
-
<Typography size="lg">
|
|
18
|
-
<p>{summary}</p>
|
|
19
|
-
{body}
|
|
20
|
-
</Typography>
|
|
21
|
-
</section>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Typography } from '../Typography';
|
|
2
|
-
import { DialogSectionBase } from './DialogSectionBase';
|
|
3
|
-
|
|
4
|
-
export interface DialogFooterProps {
|
|
5
|
-
additionalInfo?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const DialogFooter = ({ additionalInfo }: DialogFooterProps) => {
|
|
9
|
-
return (
|
|
10
|
-
<DialogSectionBase>
|
|
11
|
-
<Typography size="md">{additionalInfo}</Typography>
|
|
12
|
-
</DialogSectionBase>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { Heading, ListBase, SectionBase, SectionHeader } from '../';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
|
|
5
|
-
export interface DialogGroupProps {
|
|
6
|
-
title?: string;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const DialogGroup = ({ title, children }: DialogGroupProps) => {
|
|
11
|
-
return (
|
|
12
|
-
<SectionBase spacing="md">
|
|
13
|
-
{title && (
|
|
14
|
-
<SectionHeader padding margin>
|
|
15
|
-
<Heading>{title}</Heading>
|
|
16
|
-
<Button variant="text" icon="checkmark" size="sm" reverse>
|
|
17
|
-
Velg alle
|
|
18
|
-
</Button>
|
|
19
|
-
</SectionHeader>
|
|
20
|
-
)}
|
|
21
|
-
<ListBase spacing="md">{children}</ListBase>
|
|
22
|
-
</SectionBase>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogHeader } from './DialogHeader';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Dialog/Sections/DialogHeader',
|
|
6
|
-
component: DialogHeader,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
title: 'Title',
|
|
10
|
-
sender: {
|
|
11
|
-
name: 'Sender',
|
|
12
|
-
},
|
|
13
|
-
recipient: {
|
|
14
|
-
name: 'Recipient',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
} satisfies Meta<typeof DialogHeader>;
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj<typeof meta>;
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
args: {},
|
|
24
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DialogHeaderBase } from './DialogHeaderBase';
|
|
2
|
-
import { DialogHeadings, type DialogRecipientProps, type DialogSenderProps } from './DialogHeadings';
|
|
3
|
-
import type { DialogListItemVariant } from './DialogListItemBase.tsx';
|
|
4
|
-
import { DialogTitle } from './DialogTitle';
|
|
5
|
-
|
|
6
|
-
export interface DialogHeaderProps {
|
|
7
|
-
title: string;
|
|
8
|
-
seen: boolean;
|
|
9
|
-
variant: DialogListItemVariant;
|
|
10
|
-
sender?: DialogSenderProps;
|
|
11
|
-
recipient?: DialogRecipientProps;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const DialogHeader = ({ title, sender, recipient, seen, variant }: DialogHeaderProps) => {
|
|
15
|
-
return (
|
|
16
|
-
<DialogHeaderBase>
|
|
17
|
-
<DialogTitle seen={seen} size="xl" variant={variant}>
|
|
18
|
-
{title}
|
|
19
|
-
</DialogTitle>
|
|
20
|
-
<DialogHeadings size="xl" sender={sender} recipient={recipient} />
|
|
21
|
-
</DialogHeaderBase>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import styles from './dialogHeaderBase.module.css';
|
|
3
|
-
|
|
4
|
-
export interface DialogHeaderBaseProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const DialogHeaderBase = ({ children }: DialogHeaderBaseProps) => {
|
|
9
|
-
return <header className={styles.header}>{children}</header>;
|
|
10
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogHeadings } from './DialogHeadings';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Dialog/DialogHeadings',
|
|
6
|
-
component: DialogHeadings,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {},
|
|
9
|
-
args: {
|
|
10
|
-
sender: {
|
|
11
|
-
name: 'Sender',
|
|
12
|
-
},
|
|
13
|
-
recipient: {
|
|
14
|
-
type: 'person',
|
|
15
|
-
name: 'Recipient',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
} satisfies Meta<typeof DialogHeadings>;
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof meta>;
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {};
|
|
24
|
-
|
|
25
|
-
export const Company: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
grouped: true,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const Grouped: Story = {
|
|
32
|
-
args: {
|
|
33
|
-
grouped: true,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Avatar, AvatarGroup, type AvatarSize } from '../Avatar';
|
|
2
|
-
import { MetaItem } from '../Meta';
|
|
3
|
-
import styles from './dialogHeadings.module.css';
|
|
4
|
-
|
|
5
|
-
export type DialogSenderType = 'company' | 'person';
|
|
6
|
-
export type DialogRecipientType = 'company' | 'person';
|
|
7
|
-
|
|
8
|
-
export interface DialogSenderProps {
|
|
9
|
-
type?: DialogSenderType;
|
|
10
|
-
name: string;
|
|
11
|
-
imageUrl?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface DialogRecipientProps {
|
|
15
|
-
type?: DialogRecipientType;
|
|
16
|
-
name: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
type DialogHeadingsSize = 'sm' | 'xs' | 'sm' | 'lg' | 'xl';
|
|
20
|
-
|
|
21
|
-
const sizeMap = {
|
|
22
|
-
avatar: {
|
|
23
|
-
xs: 'xs',
|
|
24
|
-
sm: 'xs',
|
|
25
|
-
md: 'xs',
|
|
26
|
-
lg: 'xs',
|
|
27
|
-
xl: 'lg',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export interface DialogHeadingsProps {
|
|
32
|
-
size: DialogHeadingsSize;
|
|
33
|
-
/** Group sender and recipient avatars */
|
|
34
|
-
grouped?: boolean;
|
|
35
|
-
/** Sender */
|
|
36
|
-
sender?: DialogSenderProps;
|
|
37
|
-
/** Recipient */
|
|
38
|
-
recipient?: DialogRecipientProps;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Dialog headings for sender and recipient. Should present an avatar for the sender. */
|
|
42
|
-
|
|
43
|
-
export const DialogHeadings = ({
|
|
44
|
-
grouped,
|
|
45
|
-
size = 'lg',
|
|
46
|
-
sender = { type: 'company', name: 'Sender' },
|
|
47
|
-
recipient = { type: 'person', name: 'Recipient' },
|
|
48
|
-
}: DialogHeadingsProps) => {
|
|
49
|
-
return (
|
|
50
|
-
<div className={styles.headings} data-size={size}>
|
|
51
|
-
{grouped ? (
|
|
52
|
-
<AvatarGroup
|
|
53
|
-
items={[{ ...sender, type: 'company' }, recipient]}
|
|
54
|
-
size={sizeMap?.avatar[size] as AvatarSize}
|
|
55
|
-
className={styles.avatar}
|
|
56
|
-
/>
|
|
57
|
-
) : (
|
|
58
|
-
<Avatar
|
|
59
|
-
type="company"
|
|
60
|
-
imageUrl={sender?.imageUrl}
|
|
61
|
-
name={sender.name}
|
|
62
|
-
size={sizeMap?.avatar[size] as AvatarSize}
|
|
63
|
-
className={styles.avatar}
|
|
64
|
-
/>
|
|
65
|
-
)}
|
|
66
|
-
<MetaItem size="xs" className={styles.text}>
|
|
67
|
-
<span className={styles.sender}>{sender.name}</span>
|
|
68
|
-
{recipient?.name && (
|
|
69
|
-
<span>
|
|
70
|
-
{' til '}
|
|
71
|
-
<span>{recipient.name}</span>
|
|
72
|
-
</span>
|
|
73
|
-
)}
|
|
74
|
-
</MetaItem>
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogHistory } from './DialogHistory';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Dialog/Sections/DialogHistory',
|
|
6
|
-
component: DialogHistory,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {},
|
|
9
|
-
args: {
|
|
10
|
-
items: [
|
|
11
|
-
{
|
|
12
|
-
createdBy: {
|
|
13
|
-
name: 'Kari Nordmann',
|
|
14
|
-
},
|
|
15
|
-
createdAt: '2023-03-11 08:00',
|
|
16
|
-
summary: 'Skattemeldingen ble levert.',
|
|
17
|
-
attachments: [
|
|
18
|
-
{
|
|
19
|
-
label: 'Kvittering på innsendt skattemelding.pdf',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
createdBy: {
|
|
25
|
-
type: 'company',
|
|
26
|
-
name: 'Skatteetaten',
|
|
27
|
-
imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/Skatteetaten.636ef817.png',
|
|
28
|
-
},
|
|
29
|
-
createdAt: '2023-03-11 08:00',
|
|
30
|
-
summary: 'Vi har mottatt nye opplysninger og oppdatert skattemeldingen din.',
|
|
31
|
-
attachments: [
|
|
32
|
-
{
|
|
33
|
-
label: 'Nye opplysninger til Skattemeldingen.pdf',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
createdBy: {
|
|
39
|
-
name: 'Kari Nordmann',
|
|
40
|
-
},
|
|
41
|
-
createdAt: '2023-03-11 08:00',
|
|
42
|
-
summary: 'Skattemeldingen ble levert.',
|
|
43
|
-
attachments: [
|
|
44
|
-
{
|
|
45
|
-
label: 'Kvittering på innsendt skattemelding.pdf',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
createdBy: {
|
|
51
|
-
type: 'company',
|
|
52
|
-
name: 'Skatteetaten',
|
|
53
|
-
imageUrl: 'https://digdir-proto-proto.vercel.app/_next/static/media/Skatteetaten.636ef817.png',
|
|
54
|
-
},
|
|
55
|
-
createdAt: '2023-03-11 08:00',
|
|
56
|
-
summary: 'Skattemeldingen din for 2022 er tilgjengelig.',
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
} satisfies Meta<typeof DialogHistory>;
|
|
61
|
-
|
|
62
|
-
export default meta;
|
|
63
|
-
type Story = StoryObj<typeof meta>;
|
|
64
|
-
|
|
65
|
-
export const Default: Story = {
|
|
66
|
-
args: {},
|
|
67
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type HistoryItemProps, HistoryList } from '../History/';
|
|
2
|
-
import { DialogSectionBase } from './DialogSectionBase';
|
|
3
|
-
|
|
4
|
-
export interface DialogHistoryProps {
|
|
5
|
-
title?: string;
|
|
6
|
-
items?: HistoryItemProps[];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const DialogHistory = ({ title = 'History', items }: DialogHistoryProps) => {
|
|
10
|
-
if (!items) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<DialogSectionBase title={title}>
|
|
16
|
-
<HistoryList items={items} />
|
|
17
|
-
</DialogSectionBase>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogList } from './DialogList';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Dialog/DialogList',
|
|
6
|
-
component: DialogList,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'fullscreen',
|
|
10
|
-
},
|
|
11
|
-
args: {
|
|
12
|
-
items: [
|
|
13
|
-
{
|
|
14
|
-
title: 'Støtte til utbygging av solceller',
|
|
15
|
-
summary: 'Din støtte er innvilget',
|
|
16
|
-
status: { value: 'draft' },
|
|
17
|
-
groupId: '2024-01',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: 'Støtte til utbygging av solceller',
|
|
21
|
-
summary: 'Din støtte er innvilget',
|
|
22
|
-
status: { value: 'sent' },
|
|
23
|
-
groupId: '2024-02',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: 'Støtte til utbygging av solceller',
|
|
27
|
-
summary: 'Din støtte er innvilget',
|
|
28
|
-
status: { value: 'requires-attention' },
|
|
29
|
-
groupId: '2024-01',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: 'Støtte til utbygging av solceller',
|
|
33
|
-
summary: 'Din støtte er innvilget',
|
|
34
|
-
status: { value: 'in-progress' },
|
|
35
|
-
groupId: '2024-02',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
title: 'Støtte til utbygging av solceller',
|
|
39
|
-
summary: 'Din støtte er innvilget.',
|
|
40
|
-
status: { value: 'completed' },
|
|
41
|
-
groupId: '2024-01',
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
} satisfies Meta<typeof DialogList>;
|
|
46
|
-
|
|
47
|
-
export default meta;
|
|
48
|
-
type Story = StoryObj<typeof meta>;
|
|
49
|
-
|
|
50
|
-
export const Default: Story = {
|
|
51
|
-
args: {},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Grouped: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
groups: {
|
|
57
|
-
'2024-01': {
|
|
58
|
-
title: 'Januar 2024',
|
|
59
|
-
},
|
|
60
|
-
'2024-02': {
|
|
61
|
-
title: 'Februar 2024',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SectionBase } from '../';
|
|
2
|
-
import { useMenu } from '../../hooks';
|
|
3
|
-
import { DialogGroup, type DialogGroupProps } from './DialogGroup';
|
|
4
|
-
import { DialogListItem, type DialogListItemProps } from './DialogListItem';
|
|
5
|
-
|
|
6
|
-
export interface DialogListProps {
|
|
7
|
-
items: DialogListItemProps[];
|
|
8
|
-
groups?: Record<string, DialogGroupProps>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const DialogList = ({ items, groups = {} }: DialogListProps) => {
|
|
12
|
-
const { menu } = useMenu<DialogListItemProps, DialogGroupProps>({
|
|
13
|
-
items,
|
|
14
|
-
groups,
|
|
15
|
-
groupByKey: 'groupId',
|
|
16
|
-
keyboardEvents: false,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<SectionBase spacing="none" margin="md">
|
|
21
|
-
{menu?.map((group, groupIndex) => {
|
|
22
|
-
const groupProps = group.props || {};
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<DialogGroup {...groupProps} key={groupIndex}>
|
|
26
|
-
{group?.items.map((item, index) => {
|
|
27
|
-
const itemProps = item.props || {};
|
|
28
|
-
return <DialogListItem {...itemProps} key={index} />;
|
|
29
|
-
})}
|
|
30
|
-
</DialogGroup>
|
|
31
|
-
);
|
|
32
|
-
})}
|
|
33
|
-
</SectionBase>
|
|
34
|
-
);
|
|
35
|
-
};
|