@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,107 +0,0 @@
|
|
|
1
|
-
.item {
|
|
2
|
-
border: 1px;
|
|
3
|
-
border-radius: 2px;
|
|
4
|
-
color: var(--neutral-text-subtle);
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
column-gap: 0.25em;
|
|
8
|
-
white-space: nowrap;
|
|
9
|
-
text-decoration: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
button.item:hover,
|
|
13
|
-
a.item:hover {
|
|
14
|
-
color: var(--theme-base-hover);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.label {
|
|
18
|
-
font-weight: normal;
|
|
19
|
-
line-height: 1;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* xs = 24, sm = 30, md = 36? */
|
|
23
|
-
|
|
24
|
-
.item[data-size="xs"] {
|
|
25
|
-
font-size: 0.875rem;
|
|
26
|
-
height: 1.5rem;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.item[data-size="sm"] {
|
|
30
|
-
font-size: 1rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.item[data-size="md"] {
|
|
34
|
-
font-size: 1.125rem;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* media */
|
|
38
|
-
|
|
39
|
-
.media {
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* text */
|
|
46
|
-
|
|
47
|
-
.item[data-variant="text"] {
|
|
48
|
-
border-color: transparent;
|
|
49
|
-
padding-left: 0;
|
|
50
|
-
padding-right: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* outline */
|
|
54
|
-
|
|
55
|
-
.item[data-variant="outline"] {
|
|
56
|
-
border-color: var(--theme-base-hover);
|
|
57
|
-
border-style: solid;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.item[data-variant="dotted"] {
|
|
61
|
-
border-color: var(--theme-base-hover);
|
|
62
|
-
border-style: dashed;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.item[data-variant="solid"] {
|
|
66
|
-
border-color: var(--theme-base-hover);
|
|
67
|
-
background-color: var(--theme-base-hover);
|
|
68
|
-
color: white;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.item[data-variant="outline"],
|
|
72
|
-
.item[data-variant="dotted"],
|
|
73
|
-
.item[data-variant="solid"] {
|
|
74
|
-
padding: 0 0.25em;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.label[data-variant="outline"],
|
|
78
|
-
.label[data-variant="dotted"],
|
|
79
|
-
.label[data-variant="solid"] {
|
|
80
|
-
font-size: 0.875em;
|
|
81
|
-
font-weight: 500;
|
|
82
|
-
padding: 0 0.25em;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/* xs */
|
|
86
|
-
|
|
87
|
-
.item[data-size="xs"] {
|
|
88
|
-
font-size: 0.875rem;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.media[data-size="xs"] {
|
|
92
|
-
font-size: 1rem;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* sm */
|
|
96
|
-
|
|
97
|
-
.item[data-size="sm"] {
|
|
98
|
-
font-size: 1rem;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.media[data-size="sm"] {
|
|
102
|
-
font-size: 1.25rem;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.label[data-size="sm"] {
|
|
106
|
-
font-size: 1rem;
|
|
107
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { SectionBase, type SectionBaseProps } from './SectionBase';
|
|
3
|
-
|
|
4
|
-
export interface PageBaseProps extends SectionBaseProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const PageBase = ({ children, ...props }: PageBaseProps) => {
|
|
9
|
-
return (
|
|
10
|
-
<SectionBase as="main" {...props}>
|
|
11
|
-
{children}
|
|
12
|
-
</SectionBase>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Heading } from '../';
|
|
2
|
-
import { PageHeaderMedia, type PageHeaderMediaProps } from './PageHeaderMedia';
|
|
3
|
-
import { PageNav } from './PageNav';
|
|
4
|
-
import { SectionBase, type SectionBaseProps } from './SectionBase';
|
|
5
|
-
import styles from './pageHeader.module.css';
|
|
6
|
-
|
|
7
|
-
export interface PageHeaderProps extends SectionBaseProps, PageHeaderMediaProps {
|
|
8
|
-
title?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const PageHeader = ({ title, description, icon, avatar, avatarGroup, children, ...props }: PageHeaderProps) => {
|
|
13
|
-
return (
|
|
14
|
-
<SectionBase as="header" {...props}>
|
|
15
|
-
<PageNav />
|
|
16
|
-
<section className={styles.header}>
|
|
17
|
-
<PageHeaderMedia icon={icon} avatar={avatar} avatarGroup={avatarGroup} />
|
|
18
|
-
<div className={styles.title}>
|
|
19
|
-
<Heading size="md">{title}</Heading>
|
|
20
|
-
<div className="description">{description}</div>
|
|
21
|
-
</div>
|
|
22
|
-
</section>
|
|
23
|
-
</SectionBase>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps } from '../Avatar';
|
|
3
|
-
import { Icon, type IconName } from '../Icon';
|
|
4
|
-
import styles from './pageHeader.module.css';
|
|
5
|
-
|
|
6
|
-
export interface PageHeaderMediaProps {
|
|
7
|
-
icon?: IconName;
|
|
8
|
-
avatar?: AvatarProps;
|
|
9
|
-
avatarGroup?: AvatarGroupProps;
|
|
10
|
-
children?: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const PageHeaderMedia = ({ icon, avatar, avatarGroup }: PageHeaderMediaProps) => {
|
|
14
|
-
if (!icon && !avatar && !avatarGroup) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className={styles.media}>
|
|
20
|
-
{(icon && <Icon name={icon} variant="outline" className={styles.icon} />) ||
|
|
21
|
-
(avatar && <Avatar {...avatar} size="xl" className={styles.avatar} />) ||
|
|
22
|
-
(avatarGroup && <AvatarGroup {...avatarGroup} size="lg" className={styles.avatarGroup} />)}
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { Button } from '../Button';
|
|
3
|
-
import styles from './pageNav.module.css';
|
|
4
|
-
|
|
5
|
-
export interface PageBackButtonProps {
|
|
6
|
-
as?: ElementType;
|
|
7
|
-
href?: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface PageNavProps {
|
|
12
|
-
backButton?: PageBackButtonProps;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Page navigation bar with back button or breadcrumbs.
|
|
18
|
-
*/
|
|
19
|
-
export const PageNav = ({
|
|
20
|
-
backButton = {
|
|
21
|
-
as: 'a',
|
|
22
|
-
label: 'Back',
|
|
23
|
-
},
|
|
24
|
-
children,
|
|
25
|
-
}: PageNavProps) => {
|
|
26
|
-
return (
|
|
27
|
-
<nav className={styles.nav}>
|
|
28
|
-
<Button {...backButton} variant="text" color="secondary" icon="arrow-left" reverse>
|
|
29
|
-
{backButton?.label || 'Back'}
|
|
30
|
-
</Button>
|
|
31
|
-
<div className={styles.action}>{children}</div>
|
|
32
|
-
</nav>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import styles from './sectionBase.module.css';
|
|
4
|
-
|
|
5
|
-
export type SectionElement = 'section' | 'main' | 'header' | 'footer' | 'div';
|
|
6
|
-
export type SectionColor = 'transparent' | 'white' | 'subtle' | 'accent';
|
|
7
|
-
export type SectionSpacing = 'none' | 'sm' | 'md' | 'lg';
|
|
8
|
-
export type SectionMargin = 'none' | 'sm' | 'md' | 'lg';
|
|
9
|
-
export type SectionShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
|
-
|
|
11
|
-
export interface SectionBaseProps {
|
|
12
|
-
as?: SectionElement;
|
|
13
|
-
color?: SectionColor;
|
|
14
|
-
padding?: boolean;
|
|
15
|
-
spacing?: SectionSpacing;
|
|
16
|
-
margin?: SectionMargin;
|
|
17
|
-
shadow?: SectionShadow;
|
|
18
|
-
inset?: boolean;
|
|
19
|
-
children?: ReactNode;
|
|
20
|
-
className?: string;
|
|
21
|
-
style?: CSSProperties;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const SectionBase = ({
|
|
25
|
-
as = 'section',
|
|
26
|
-
color = 'transparent',
|
|
27
|
-
padding = false,
|
|
28
|
-
spacing = 'none',
|
|
29
|
-
margin = 'none',
|
|
30
|
-
shadow = 'none',
|
|
31
|
-
inset = false,
|
|
32
|
-
className,
|
|
33
|
-
style,
|
|
34
|
-
children,
|
|
35
|
-
}: SectionBaseProps) => {
|
|
36
|
-
const Component = as;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Component
|
|
40
|
-
className={cx(styles.section, className)}
|
|
41
|
-
style={style}
|
|
42
|
-
data-color={color}
|
|
43
|
-
data-inset={inset}
|
|
44
|
-
data-padding={padding}
|
|
45
|
-
data-spacing={spacing}
|
|
46
|
-
data-margin={margin}
|
|
47
|
-
data-shadow={shadow}
|
|
48
|
-
>
|
|
49
|
-
{children}
|
|
50
|
-
</Component>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import styles from './sectionFooter.module.css';
|
|
3
|
-
|
|
4
|
-
export interface SectionFooterProps {
|
|
5
|
-
margin?: boolean;
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const SectionFooter = ({ margin = false, children }: SectionFooterProps) => {
|
|
10
|
-
return (
|
|
11
|
-
<footer data-margin={margin} className={styles.footer}>
|
|
12
|
-
{children}
|
|
13
|
-
</footer>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import styles from './sectionHeader.module.css';
|
|
3
|
-
|
|
4
|
-
export interface SectionHeaderProps {
|
|
5
|
-
padding?: boolean;
|
|
6
|
-
margin?: boolean;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const SectionHeader = ({ margin = false, children }: SectionHeaderProps) => {
|
|
11
|
-
return (
|
|
12
|
-
<header data-margin={margin} className={styles.header}>
|
|
13
|
-
{children}
|
|
14
|
-
</header>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
.header {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
align-items: start;
|
|
5
|
-
justify-content: start;
|
|
6
|
-
column-gap: 0.5rem;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.title {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
align-items: center;
|
|
13
|
-
column-gap: 0.5rem;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.description {
|
|
17
|
-
margin: 0;
|
|
18
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
.section {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/* inset on small screens */
|
|
7
|
-
|
|
8
|
-
@media (max-width: 1024px) {
|
|
9
|
-
.section[data-inset="true"] {
|
|
10
|
-
margin-left: -1rem;
|
|
11
|
-
margin-right: -1rem;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/* spacing */
|
|
16
|
-
|
|
17
|
-
.section[data-spacing="sm"] {
|
|
18
|
-
row-gap: 0.25rem;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.section[data-spacing="md"] {
|
|
22
|
-
row-gap: 0.5rem;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.section[data-spacing="lg"] {
|
|
26
|
-
row-gap: 1rem;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.section[data-spacing="xl"] {
|
|
30
|
-
row-gap: 1.5rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* margin */
|
|
34
|
-
|
|
35
|
-
.section[data-margin="sm"] {
|
|
36
|
-
margin: 0.25rem 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.section[data-margin="md"] {
|
|
40
|
-
margin: 0.5rem 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.section[data-margin="lg"] {
|
|
44
|
-
margin: 1rem 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* padding */
|
|
48
|
-
|
|
49
|
-
.section[data-padding="true"] {
|
|
50
|
-
padding: 1.5rem;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@media (max-width: 1024px) {
|
|
54
|
-
.section[data-padding="true"] {
|
|
55
|
-
padding: 1.5rem 1rem;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* color */
|
|
60
|
-
|
|
61
|
-
.section[data-color="white"] {
|
|
62
|
-
background-color: #fff;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.section[data-color="subtle"] {
|
|
66
|
-
background-color: var(--theme-surface-default);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.section[data-color="accent"] {
|
|
70
|
-
background-color: var(--theme-base-default);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* size */
|
|
74
|
-
|
|
75
|
-
.section[data-shadow="xs"] {
|
|
76
|
-
box-shadow: var(--ds-shadow-xs);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.section[data-shadow="sm"] {
|
|
80
|
-
box-shadow: var(--ds-shadow-sm);
|
|
81
|
-
}
|
|
82
|
-
.section[data-shadow="md"] {
|
|
83
|
-
box-shadow: var(--ds-shadow-md);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.section[data-shadow="lg"] {
|
|
87
|
-
box-shadow: var(--ds-shadow-lg);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.section[data-shadow="xl"] {
|
|
91
|
-
box-shadow: var(--ds-shadow-xl);
|
|
92
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { type ReactNode, createContext, useContext, useState } from 'react';
|
|
3
|
-
|
|
4
|
-
type OpenElementId = 'search' | 'menu' | string;
|
|
5
|
-
|
|
6
|
-
interface RootContextProvider {
|
|
7
|
-
currentId: OpenElementId;
|
|
8
|
-
toggleId: (elementId: OpenElementId) => void;
|
|
9
|
-
closeAll: () => void;
|
|
10
|
-
openId: (elementId: OpenElementId) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const initialValue = {
|
|
14
|
-
currentId: '',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
interface RootContextInitialValue {
|
|
18
|
-
currentId: OpenElementId;
|
|
19
|
-
setCurrentId?: (elementId: OpenElementId) => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const RootContext = createContext<RootContextInitialValue>(initialValue);
|
|
23
|
-
|
|
24
|
-
interface ProviderProps {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
initialValue?: RootContextInitialValue;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const RootProvider = ({ children, initialValue }: ProviderProps) => {
|
|
30
|
-
const [currentId, setCurrentId] = useState<OpenElementId>(initialValue?.currentId || '');
|
|
31
|
-
return (
|
|
32
|
-
<RootContext.Provider
|
|
33
|
-
value={{
|
|
34
|
-
currentId,
|
|
35
|
-
setCurrentId,
|
|
36
|
-
}}
|
|
37
|
-
>
|
|
38
|
-
{children}
|
|
39
|
-
</RootContext.Provider>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const useRootContext = (): RootContextProvider => {
|
|
44
|
-
const { currentId, setCurrentId } = useContext(RootContext);
|
|
45
|
-
const toggleId = (elementId: OpenElementId) => setCurrentId!(currentId === elementId ? '' : elementId);
|
|
46
|
-
const closeAll = () => {
|
|
47
|
-
setCurrentId!('');
|
|
48
|
-
};
|
|
49
|
-
const openId = (elementId: OpenElementId) => setCurrentId!(elementId);
|
|
50
|
-
return {
|
|
51
|
-
currentId,
|
|
52
|
-
toggleId,
|
|
53
|
-
closeAll,
|
|
54
|
-
openId,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Autocomplete } from './Autocomplete';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Header/Autocomplete',
|
|
6
|
-
component: Autocomplete,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {},
|
|
9
|
-
args: {},
|
|
10
|
-
} satisfies Meta<typeof Autocomplete>;
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
|
|
15
|
-
export const Scopes: Story = {
|
|
16
|
-
args: {
|
|
17
|
-
groups: {},
|
|
18
|
-
items: [
|
|
19
|
-
{
|
|
20
|
-
id: '1a',
|
|
21
|
-
groupId: '1',
|
|
22
|
-
href: '#',
|
|
23
|
-
label: 'Alt i innboks',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: '1b',
|
|
27
|
-
groupId: '1',
|
|
28
|
-
href: '#',
|
|
29
|
-
label: 'Alt i hele Altinn',
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const ScopesAndSuggestions: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
groups: {
|
|
38
|
-
'2': {
|
|
39
|
-
title: '2 treff i innboksen',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
items: [
|
|
43
|
-
{
|
|
44
|
-
id: '1a',
|
|
45
|
-
groupId: '1',
|
|
46
|
-
href: '#',
|
|
47
|
-
label: () => (
|
|
48
|
-
<span>
|
|
49
|
-
<mark>skatt</mark> i innboks
|
|
50
|
-
</span>
|
|
51
|
-
),
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: '1b',
|
|
55
|
-
groupId: '1',
|
|
56
|
-
href: '#',
|
|
57
|
-
label: () => (
|
|
58
|
-
<span>
|
|
59
|
-
<mark>skatt</mark> i hele Altinn
|
|
60
|
-
</span>
|
|
61
|
-
),
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: '2a',
|
|
65
|
-
groupId: '2',
|
|
66
|
-
href: '#',
|
|
67
|
-
label: 'Skattemeldingen 2023',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: '2b',
|
|
71
|
-
groupId: '2',
|
|
72
|
-
href: '#',
|
|
73
|
-
label: 'Skattemeldingen 2022',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useMenu } from '../../hooks';
|
|
2
|
-
import { AutocompleteBase } from './AutocompleteBase';
|
|
3
|
-
import { AutocompleteGroup, type AutocompleteGroupProps } from './AutocompleteGroup';
|
|
4
|
-
import { AutocompleteItem, type AutocompleteItemProps } from './AutocompleteItem';
|
|
5
|
-
|
|
6
|
-
export interface AutocompleteProps {
|
|
7
|
-
items: AutocompleteItemProps[];
|
|
8
|
-
groups?: Record<string, AutocompleteGroupProps>;
|
|
9
|
-
expanded?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const Autocomplete = ({ className, items, groups = {}, expanded }: AutocompleteProps) => {
|
|
14
|
-
const { menu, setActiveIndex } = useMenu<AutocompleteItemProps, AutocompleteGroupProps>({
|
|
15
|
-
items,
|
|
16
|
-
groups,
|
|
17
|
-
groupByKey: 'groupId',
|
|
18
|
-
keyboardEvents: true,
|
|
19
|
-
});
|
|
20
|
-
return (
|
|
21
|
-
<AutocompleteBase className={className} expanded={expanded}>
|
|
22
|
-
{menu.map((group, index) => {
|
|
23
|
-
return (
|
|
24
|
-
<AutocompleteGroup {...group.props} key={index}>
|
|
25
|
-
<ul>
|
|
26
|
-
{group.items.map((item, index) => {
|
|
27
|
-
const {
|
|
28
|
-
active,
|
|
29
|
-
menuIndex,
|
|
30
|
-
props: { groupId, ...itemProps },
|
|
31
|
-
} = item;
|
|
32
|
-
return (
|
|
33
|
-
<li key={index} tabIndex={-1} onMouseEnter={() => setActiveIndex(menuIndex)}>
|
|
34
|
-
<AutocompleteItem {...itemProps} active={active} />
|
|
35
|
-
</li>
|
|
36
|
-
);
|
|
37
|
-
})}
|
|
38
|
-
</ul>
|
|
39
|
-
</AutocompleteGroup>
|
|
40
|
-
);
|
|
41
|
-
})}
|
|
42
|
-
</AutocompleteBase>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import styles from './autocompleteBase.module.css';
|
|
4
|
-
export interface AutocompleteBaseProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
expanded?: boolean;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const AutocompleteBase = ({ expanded, children, className }: AutocompleteBaseProps) => {
|
|
11
|
-
return (
|
|
12
|
-
<nav className={cx(styles.autocomplete, className)} aria-expanded={expanded}>
|
|
13
|
-
{children}
|
|
14
|
-
</nav>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { MenuHeader } from '../Menu';
|
|
3
|
-
import styles from './autocompleteGroup.module.css';
|
|
4
|
-
|
|
5
|
-
export interface AutocompleteGroupProps {
|
|
6
|
-
title?: string;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const AutocompleteGroup = ({ title, children }: AutocompleteGroupProps) => {
|
|
11
|
-
return (
|
|
12
|
-
<section className={styles.group}>
|
|
13
|
-
{title && <MenuHeader title={title} />}
|
|
14
|
-
{children}
|
|
15
|
-
</section>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { ListItemBase, ListItemLabel } from '../List/';
|
|
3
|
-
import styles from './autocompleteItem.module.css';
|
|
4
|
-
|
|
5
|
-
export interface AutocompleteItemProps {
|
|
6
|
-
as?: ElementType;
|
|
7
|
-
href?: string;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
active?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
label?: string | (() => ReactNode);
|
|
13
|
-
groupId?: string;
|
|
14
|
-
style?: React.CSSProperties;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const AutocompleteItem = ({ as = 'a', label, active, ...rest }: AutocompleteItemProps) => {
|
|
18
|
-
return (
|
|
19
|
-
<ListItemBase className={styles.item} as={as} size="sm" active={active} linkIcon="chevron-right" {...rest}>
|
|
20
|
-
<ListItemLabel size="sm">{typeof label === 'function' ? label() : label}</ListItemLabel>
|
|
21
|
-
</ListItemBase>
|
|
22
|
-
);
|
|
23
|
-
};
|