@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.
- 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/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/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/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/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 -97
- 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/Bookmarks/BookmarksList.tsx +0 -17
- package/lib/components/Bookmarks/BookmarksListItem.stories.tsx +0 -79
- package/lib/components/Bookmarks/BookmarksListItem.tsx +0 -32
- package/lib/components/Bookmarks/QueryLabel.tsx +0 -33
- package/lib/components/Bookmarks/queryLabel.module.css +0 -45
- package/lib/components/Button/Button.stories.ts +0 -50
- package/lib/components/Button/Button.tsx +0 -60
- package/lib/components/Button/ButtonBase.tsx +0 -54
- 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 -33
- 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 -35
- package/lib/components/ContextMenu/contextMenuBase.module.css +0 -35
- package/lib/components/Datepicker/Datepicker.tsx +0 -49
- package/lib/components/Datepicker/DatepickerBase.tsx +0 -12
- package/lib/components/Datepicker/DatepickerHeader.tsx +0 -20
- package/lib/components/Datepicker/DatepickerTable.tsx +0 -50
- package/lib/components/Datepicker/datepickerBase.module.css +0 -5
- package/lib/components/Datepicker/datepickerHeader.module.css +0 -17
- package/lib/components/Datepicker/datepickerTable.module.css +0 -37
- package/lib/components/Datepicker/useDatepicker.tsx +0 -146
- 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 -35
- 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 -46
- 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 -86
- 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 -71
- package/lib/components/Header/HeaderBase.tsx +0 -21
- package/lib/components/Header/HeaderButton.stories.ts +0 -70
- package/lib/components/Header/HeaderButton.tsx +0 -68
- 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/HeaderSearch.tsx +0 -17
- package/lib/components/Header/header.module.css +0 -24
- 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/headerSearch.module.css +0 -21
- 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 -72
- 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 -82
- package/lib/components/List/ListItemLabel.tsx +0 -29
- package/lib/components/List/ListItemMedia.tsx +0 -59
- package/lib/components/List/listBase.module.css +0 -30
- package/lib/components/List/listItemBase.module.css +0 -97
- 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/MenuInputField.tsx +0 -38
- 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/menuInputField.module.css +0 -54
- package/lib/components/Menu/menuItemBase.module.css +0 -79
- 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 -25
- package/lib/components/Page/PageHeaderMedia.tsx +0 -25
- package/lib/components/Page/PageNav.tsx +0 -34
- 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 -18
- package/lib/components/Page/pageNav.module.css +0 -12
- package/lib/components/Page/sectionBase.module.css +0 -92
- 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 -56
- 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 -81
- package/lib/components/Searchbar/Searchbar.stories.tsx +0 -151
- package/lib/components/Searchbar/Searchbar.tsx +0 -26
- 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 -159
- 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/ToolbarDate.stories.ts +0 -62
- package/lib/components/Toolbar/ToolbarDaterange.stories.ts +0 -24
- package/lib/components/Toolbar/ToolbarDaterange.tsx +0 -73
- package/lib/components/Toolbar/ToolbarFilter.stories.ts +0 -64
- package/lib/components/Toolbar/ToolbarFilter.tsx +0 -82
- package/lib/components/Toolbar/ToolbarFilterBase.tsx +0 -15
- 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/toolbarBase.module.css +0 -19
- package/lib/components/Toolbar/toolbarButton.module.css +0 -3
- package/lib/components/Toolbar/toolbarDaterange.module.css +0 -12
- package/lib/components/Toolbar/toolbarFilterBase.module.css +0 -7
- 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 -16
- 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 -81
- 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 -78
- 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 -51
- package/lib/stories/Inbox/InboxProvider.tsx +0 -136
- package/lib/stories/Inbox/InboxSection.tsx +0 -39
- package/lib/stories/Inbox/InboxToolbar.tsx +0 -94
- package/lib/stories/Inbox/ProfilePage.tsx +0 -36
- 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 -41
- package/lib/stories/Inbox/dialogs/enova-in-progress.json +0 -35
- package/lib/stories/Inbox/dialogs/index.ts +0 -53
- package/lib/stories/Inbox/dialogs/skatt-2023.json +0 -33
- package/lib/stories/Inbox/dialogs/sykmelding-referat.json +0 -41
- 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/Bookmarks/index.ts → dist/components/Bookmarks/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/Datepicker/index.ts → dist/components/Datepicker/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/Menu/index.ts → dist/components/Menu/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/components/index.ts → dist/components/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,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { AccountMenu } from './AccountMenu';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'GlobalMenu/AccountMenu',
|
|
7
|
-
component: AccountMenu,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {},
|
|
10
|
-
args: {
|
|
11
|
-
accountGroups: {
|
|
12
|
-
primary: {
|
|
13
|
-
title: 'Deg selv og favoritter',
|
|
14
|
-
},
|
|
15
|
-
secondary: {
|
|
16
|
-
title: 'Andre kontoer',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
accounts: [
|
|
20
|
-
{
|
|
21
|
-
groupId: 'primary',
|
|
22
|
-
type: 'person',
|
|
23
|
-
name: 'Aurora Mikalsen',
|
|
24
|
-
selected: true,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
groupId: 'favourites',
|
|
28
|
-
type: 'company',
|
|
29
|
-
name: 'Bergen Bar',
|
|
30
|
-
selected: false,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
groupId: 'secondary',
|
|
34
|
-
type: 'company',
|
|
35
|
-
name: 'Keeperhansker AS',
|
|
36
|
-
selected: false,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
groupId: 'secondary',
|
|
40
|
-
type: 'company',
|
|
41
|
-
name: 'Stadion drift AS',
|
|
42
|
-
selected: false,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
groupId: 'favourites',
|
|
46
|
-
type: 'company',
|
|
47
|
-
name: 'Sportsklubben Brann',
|
|
48
|
-
selected: false,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
groupId: 'secondary',
|
|
52
|
-
type: 'company',
|
|
53
|
-
name: 'Landslaget',
|
|
54
|
-
selected: false,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
} satisfies Meta<typeof AccountMenu>;
|
|
59
|
-
|
|
60
|
-
export default meta;
|
|
61
|
-
type Story = StoryObj<typeof meta>;
|
|
62
|
-
|
|
63
|
-
export const Default: Story = {
|
|
64
|
-
args: {},
|
|
65
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Menu, type MenuItemGroups, type MenuItemProps, type MenuSearchProps } from '../Menu';
|
|
4
|
-
|
|
5
|
-
export interface AccountSearch extends MenuSearchProps {
|
|
6
|
-
getResultsLabel?: (hits: number) => string;
|
|
7
|
-
hidden?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface AccountMenuItem {
|
|
11
|
-
type: 'person' | 'company';
|
|
12
|
-
name: string;
|
|
13
|
-
id: string;
|
|
14
|
-
groupId?: string;
|
|
15
|
-
selected?: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface AccountMenuProps {
|
|
19
|
-
accounts?: AccountMenuItem[];
|
|
20
|
-
accountGroups?: MenuItemGroups;
|
|
21
|
-
accountSearch?: AccountSearch;
|
|
22
|
-
currentAccount?: AccountMenuItem;
|
|
23
|
-
onSelectAccount?: (id: string) => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const defaultResultLabel = (hits: number) => `${hits} hits`;
|
|
27
|
-
|
|
28
|
-
export const AccountMenu = ({
|
|
29
|
-
accounts = [],
|
|
30
|
-
accountGroups = {},
|
|
31
|
-
accountSearch,
|
|
32
|
-
onSelectAccount,
|
|
33
|
-
currentAccount,
|
|
34
|
-
}: AccountMenuProps) => {
|
|
35
|
-
const accountMenu: MenuItemProps[] = accounts.map((account) => ({
|
|
36
|
-
id: account.id || account.name,
|
|
37
|
-
groupId: account.groupId || 'search',
|
|
38
|
-
selected: account.selected ?? currentAccount?.id === account.id,
|
|
39
|
-
title: account.name,
|
|
40
|
-
avatar: {
|
|
41
|
-
type: account.type,
|
|
42
|
-
name: account.name,
|
|
43
|
-
},
|
|
44
|
-
onClick: () => onSelectAccount?.(account.id || account.name),
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
const [filterString, setFilterString] = useState<string>('');
|
|
48
|
-
|
|
49
|
-
const filteredAccountMenu = filterString
|
|
50
|
-
? accountMenu
|
|
51
|
-
.filter((item) => item?.title?.toLowerCase().includes(filterString.toLowerCase()))
|
|
52
|
-
.map((item) => {
|
|
53
|
-
return {
|
|
54
|
-
...item,
|
|
55
|
-
groupId: 'search',
|
|
56
|
-
};
|
|
57
|
-
})
|
|
58
|
-
: accountMenu;
|
|
59
|
-
|
|
60
|
-
const filterAccountGroups = filterString
|
|
61
|
-
? {
|
|
62
|
-
search: {
|
|
63
|
-
title:
|
|
64
|
-
accountSearch?.getResultsLabel?.(filteredAccountMenu.length) ??
|
|
65
|
-
defaultResultLabel(filteredAccountMenu.length),
|
|
66
|
-
},
|
|
67
|
-
}
|
|
68
|
-
: accountGroups;
|
|
69
|
-
|
|
70
|
-
const accountSearchItem: MenuSearchProps = {
|
|
71
|
-
name: 'account-search',
|
|
72
|
-
value: filterString,
|
|
73
|
-
placeholder: accountSearch?.placeholder ?? 'Find account',
|
|
74
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => setFilterString(event.target.value),
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const accountSwitcher: MenuItemProps[] = [
|
|
78
|
-
...(filteredAccountMenu.length > 0 ? filteredAccountMenu : [{ id: 'search', groupId: 'search', hidden: true }]),
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
return <Menu theme="global" search={accountSearchItem} groups={filterAccountGroups} items={accountSwitcher} />;
|
|
82
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { MenuItem } from '../Menu';
|
|
2
|
-
|
|
3
|
-
export interface BackButtonProps {
|
|
4
|
-
label: string;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const BackButton = ({ label, onClick }: BackButtonProps) => {
|
|
9
|
-
return <MenuItem id="back" icon="arrow-left" title={label} onClick={onClick} />;
|
|
10
|
-
};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { GlobalMenu } from './GlobalMenu';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'GlobalMenu/GlobalMenu',
|
|
7
|
-
component: GlobalMenu,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {},
|
|
10
|
-
args: {
|
|
11
|
-
accountGroups: {
|
|
12
|
-
primary: {
|
|
13
|
-
title: 'Deg selv og favoritter',
|
|
14
|
-
},
|
|
15
|
-
secondary: {
|
|
16
|
-
title: 'Andre kontoer',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
currentAccount: {
|
|
20
|
-
type: 'person',
|
|
21
|
-
name: 'Mathias Dyngeland',
|
|
22
|
-
description: 'Fødselsnr. 07101995 XXXXXX',
|
|
23
|
-
},
|
|
24
|
-
accounts: [
|
|
25
|
-
{
|
|
26
|
-
id: 'party:mathias',
|
|
27
|
-
groupId: 'primary',
|
|
28
|
-
type: 'person',
|
|
29
|
-
name: 'Mathias Dyngeland',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: 'party:bergerbar',
|
|
33
|
-
groupId: 'favourites',
|
|
34
|
-
type: 'company',
|
|
35
|
-
name: 'Bergen bar',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: 'party:keeperhansker',
|
|
39
|
-
groupId: 'secondary',
|
|
40
|
-
type: 'company',
|
|
41
|
-
name: 'Keeperhansker AS',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: 'party:stadiondrift',
|
|
45
|
-
groupId: 'secondary',
|
|
46
|
-
type: 'company',
|
|
47
|
-
name: 'Stadion drift AS',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: 'party:brann',
|
|
51
|
-
groupId: 'favourites',
|
|
52
|
-
type: 'company',
|
|
53
|
-
name: 'Sportsklubben Brann',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'party:landslaget',
|
|
57
|
-
groupId: 'secondary',
|
|
58
|
-
type: 'company',
|
|
59
|
-
name: 'Landslaget',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
groups: {
|
|
63
|
-
apps: {
|
|
64
|
-
divider: true,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
items: [
|
|
68
|
-
{
|
|
69
|
-
id: 'inbox',
|
|
70
|
-
groupId: 'apps',
|
|
71
|
-
size: 'lg',
|
|
72
|
-
icon: 'inbox',
|
|
73
|
-
title: 'Innboks',
|
|
74
|
-
badge: {
|
|
75
|
-
color: 'alert',
|
|
76
|
-
label: '4',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'access',
|
|
81
|
-
groupId: 'apps',
|
|
82
|
-
size: 'lg',
|
|
83
|
-
icon: 'bookmark',
|
|
84
|
-
title: 'Tilganger',
|
|
85
|
-
badge: {
|
|
86
|
-
color: 'alert',
|
|
87
|
-
label: '2',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 'access',
|
|
92
|
-
groupId: 'apps',
|
|
93
|
-
size: 'lg',
|
|
94
|
-
icon: 'menu-grid',
|
|
95
|
-
title: 'Alle skjema',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'startup',
|
|
99
|
-
groupId: 'help',
|
|
100
|
-
color: 'neutral',
|
|
101
|
-
size: 'sm',
|
|
102
|
-
icon: 'buildings2',
|
|
103
|
-
title: 'Starte og drive bedrift',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: 'help',
|
|
107
|
-
groupId: 'help',
|
|
108
|
-
size: 'sm',
|
|
109
|
-
color: 'neutral',
|
|
110
|
-
icon: 'chat-exclamationmark',
|
|
111
|
-
title: 'Trenger du hjelp?',
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
} satisfies Meta<typeof GlobalMenu>;
|
|
116
|
-
|
|
117
|
-
export default meta;
|
|
118
|
-
type Story = StoryObj<typeof meta>;
|
|
119
|
-
|
|
120
|
-
export const Default: Story = {};
|
|
121
|
-
|
|
122
|
-
export const Login: Story = {
|
|
123
|
-
args: {
|
|
124
|
-
currentAccount: undefined,
|
|
125
|
-
items: [
|
|
126
|
-
{
|
|
127
|
-
id: 'login',
|
|
128
|
-
groupId: 'login',
|
|
129
|
-
size: 'lg',
|
|
130
|
-
color: 'strong',
|
|
131
|
-
icon: 'padlock-locked',
|
|
132
|
-
title: 'Logg inn',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: 'startup',
|
|
136
|
-
groupId: 'help',
|
|
137
|
-
color: 'neutral',
|
|
138
|
-
size: 'sm',
|
|
139
|
-
icon: 'buildings2',
|
|
140
|
-
title: 'Starte og drive bedrift',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: 'help',
|
|
144
|
-
groupId: 'help',
|
|
145
|
-
color: 'neutral',
|
|
146
|
-
size: 'sm',
|
|
147
|
-
icon: 'chat-exclamationmark',
|
|
148
|
-
title: 'Trenger du hjelp?',
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export const Company: Story = {
|
|
155
|
-
args: {
|
|
156
|
-
currentAccount: {
|
|
157
|
-
type: 'company',
|
|
158
|
-
name: 'Sportsklubben Brann',
|
|
159
|
-
description: 'Org. nr. 934908988',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const CustomLabels: Story = {
|
|
165
|
-
args: {
|
|
166
|
-
logoutLabel: 'Logg ut',
|
|
167
|
-
menuLabel: 'Meny',
|
|
168
|
-
backLabel: 'Tilbake',
|
|
169
|
-
changeLabel: 'Endre konto',
|
|
170
|
-
accountSearch: {
|
|
171
|
-
placeholder: 'Søk etter konto',
|
|
172
|
-
getResultsLabel: (hits = 0) => {
|
|
173
|
-
if (hits) {
|
|
174
|
-
return hits + ' treff';
|
|
175
|
-
}
|
|
176
|
-
return 'Ingen treff';
|
|
177
|
-
},
|
|
178
|
-
hidden: false,
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Menu, type MenuItemGroups, type MenuItemProps } from '../Menu';
|
|
4
|
-
import { type Account, AccountButton } from './AccountButton';
|
|
5
|
-
import { AccountMenu, type AccountMenuProps } from './AccountMenu';
|
|
6
|
-
import { BackButton } from './BackButton';
|
|
7
|
-
import { GlobalMenuBase, GlobalMenuFooter, GlobalMenuHeader } from './GlobalMenuBase';
|
|
8
|
-
import { LogoutButton, type LogoutButtonProps } from './LogoutButton';
|
|
9
|
-
|
|
10
|
-
export interface GlobalMenuProps extends AccountMenuProps {
|
|
11
|
-
items: MenuItemProps[];
|
|
12
|
-
groups?: MenuItemGroups;
|
|
13
|
-
menuLabel?: string;
|
|
14
|
-
backLabel?: string;
|
|
15
|
-
logoutButton?: LogoutButtonProps;
|
|
16
|
-
changeLabel?: string;
|
|
17
|
-
className?: string;
|
|
18
|
-
currentAccount?: Account;
|
|
19
|
-
changeCurrentAccount?: (id: string) => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const GlobalMenu = ({
|
|
23
|
-
accounts = [],
|
|
24
|
-
accountGroups = {},
|
|
25
|
-
accountSearch,
|
|
26
|
-
items = [],
|
|
27
|
-
groups,
|
|
28
|
-
changeLabel = 'Change',
|
|
29
|
-
backLabel = 'Back',
|
|
30
|
-
currentAccount,
|
|
31
|
-
changeCurrentAccount,
|
|
32
|
-
logoutButton,
|
|
33
|
-
}: GlobalMenuProps) => {
|
|
34
|
-
const [selectingAccount, setSelectingAccount] = useState<boolean>(false);
|
|
35
|
-
|
|
36
|
-
const onToggleAccounts = () => {
|
|
37
|
-
setSelectingAccount((prevState) => !prevState);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const onSelectAccount = (id: string) => {
|
|
41
|
-
onToggleAccounts();
|
|
42
|
-
changeCurrentAccount?.(id);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
if (selectingAccount) {
|
|
46
|
-
return (
|
|
47
|
-
<GlobalMenuBase>
|
|
48
|
-
<BackButton onClick={onToggleAccounts} label={backLabel} />
|
|
49
|
-
<AccountMenu
|
|
50
|
-
currentAccount={currentAccount}
|
|
51
|
-
accounts={accounts}
|
|
52
|
-
accountGroups={accountGroups}
|
|
53
|
-
accountSearch={accountSearch}
|
|
54
|
-
onSelectAccount={onSelectAccount}
|
|
55
|
-
/>
|
|
56
|
-
</GlobalMenuBase>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (currentAccount) {
|
|
61
|
-
return (
|
|
62
|
-
<GlobalMenuBase>
|
|
63
|
-
<GlobalMenuHeader>
|
|
64
|
-
<AccountButton
|
|
65
|
-
account={currentAccount}
|
|
66
|
-
linkText={changeLabel}
|
|
67
|
-
multipleAccounts={accounts.length > 1}
|
|
68
|
-
onClick={onToggleAccounts}
|
|
69
|
-
/>
|
|
70
|
-
</GlobalMenuHeader>
|
|
71
|
-
<Menu groups={groups} items={items} />
|
|
72
|
-
{logoutButton && (
|
|
73
|
-
<GlobalMenuFooter>
|
|
74
|
-
<LogoutButton {...logoutButton} />
|
|
75
|
-
</GlobalMenuFooter>
|
|
76
|
-
)}
|
|
77
|
-
</GlobalMenuBase>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<GlobalMenuBase>
|
|
83
|
-
<Menu groups={groups} items={items} />
|
|
84
|
-
</GlobalMenuBase>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import styles from './globalMenuBase.module.css';
|
|
3
|
-
|
|
4
|
-
export interface GlobalMenuBaseProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const GlobalMenuBase = ({ children }: GlobalMenuBaseProps) => {
|
|
9
|
-
return (
|
|
10
|
-
<nav className={styles.nav} data-theme="global">
|
|
11
|
-
{children}
|
|
12
|
-
</nav>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const GlobalMenuHeader = ({ children }: GlobalMenuBaseProps) => {
|
|
17
|
-
return <header className={styles.header}>{children}</header>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const GlobalMenuFooter = ({ children }: GlobalMenuBaseProps) => {
|
|
21
|
-
return <footer className={styles.footer}>{children}</footer>;
|
|
22
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
import { ButtonBase, ButtonLabel } from '../Button';
|
|
3
|
-
import styles from './logoutButton.module.css';
|
|
4
|
-
|
|
5
|
-
export interface LogoutButtonProps {
|
|
6
|
-
label?: string;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
onClick?: MouseEventHandler;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const LogoutButton = ({ label = 'Logout', children, onClick }: LogoutButtonProps) => {
|
|
12
|
-
return (
|
|
13
|
-
<ButtonBase className={styles.button} variant="outline" size="lg" onClick={onClick}>
|
|
14
|
-
<ButtonLabel className={styles.label} size="lg">
|
|
15
|
-
{children || label}
|
|
16
|
-
</ButtonLabel>
|
|
17
|
-
</ButtonBase>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.nav {
|
|
2
|
-
background-color: #fff;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
padding: 0 0.5rem;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.header {
|
|
9
|
-
border-bottom: 1px solid var(--theme-border-subtle);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.footer {
|
|
13
|
-
border-top: 1px solid var(--theme-border-subtle);
|
|
14
|
-
padding: 1rem 0.5rem;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: stretch;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.drawer[aria-expanded="true"] {
|
|
21
|
-
display: block;
|
|
22
|
-
padding: 0.5rem;
|
|
23
|
-
z-index: 2;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.dropdown[aria-expanded="true"] {
|
|
27
|
-
display: none;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@media (min-width: 1024px) {
|
|
31
|
-
.drawer[aria-expanded="true"] {
|
|
32
|
-
display: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.dropdown[aria-expanded="true"] {
|
|
36
|
-
display: block;
|
|
37
|
-
z-index: 2;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface SymbolProps {
|
|
2
|
-
className?: string;
|
|
3
|
-
title?: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const DigdirLogomark = ({ className, title = 'Digdir logomark' }: SymbolProps) => {
|
|
7
|
-
return (
|
|
8
|
-
<svg
|
|
9
|
-
width="1em"
|
|
10
|
-
height="1em"
|
|
11
|
-
viewBox="0 0 24 24"
|
|
12
|
-
fill="none"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
className={className}
|
|
15
|
-
>
|
|
16
|
-
<title>{title}</title>
|
|
17
|
-
<path
|
|
18
|
-
d="M12.3167 0H0.486059C0.357148 0 0.233518 0.0511029 0.142363 0.142066C0.0512097 0.23303 0 0.356402 0 0.485044V23.515C0 23.6436 0.0512097 23.767 0.142363 23.8579C0.233518 23.9489 0.357148 24 0.486059 24H12.3167C15.4455 23.9112 18.4163 22.6085 20.5979 20.3686C22.7795 18.1288 24 15.1284 24 12.0049C24 8.88133 22.7795 5.88089 20.5979 3.64106C18.4163 1.40122 15.4455 0.0985018 12.3167 0.00970113V0ZM13.4735 20.3815C11.6835 20.689 9.84199 20.4199 8.21543 19.6132C6.58891 18.8066 5.26188 17.5042 4.42651 15.8948C3.59114 14.2853 3.29078 12.4523 3.56892 10.6611C3.84707 8.86999 4.68929 7.2137 5.97362 5.93205C7.25795 4.6504 8.91774 3.80994 10.7126 3.53237C12.5075 3.25481 14.3444 3.55454 15.9572 4.38817C17.57 5.2218 18.875 6.54605 19.6834 8.16918C20.4918 9.79233 20.7614 11.6301 20.4534 13.4163C20.1535 15.1547 19.3216 16.7576 18.0717 18.0049C16.8218 19.2521 15.2155 20.0824 13.4735 20.3815Z"
|
|
19
|
-
fill="currentColor"
|
|
20
|
-
/>
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
};
|