@altinn/altinn-components 0.5.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/components/Attachment/AttachmentLink.d.ts +10 -0
- package/dist/components/Attachment/AttachmentList.d.ts +7 -0
- package/dist/components/Avatar/Avatar.d.ts +27 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +20 -0
- package/dist/components/Avatar/color.d.ts +4 -0
- package/dist/components/Badge/Badge.d.ts +11 -0
- package/dist/components/Bookmarks/BookmarksList.d.ts +7 -0
- package/dist/components/Bookmarks/BookmarksListItem.d.ts +21 -0
- package/dist/components/Bookmarks/QueryLabel.d.ts +11 -0
- package/dist/components/Bookmarks/index.d.ts +3 -0
- package/dist/components/Button/Button.d.ts +8 -0
- package/dist/components/Button/ButtonBase.d.ts +20 -0
- package/dist/components/Button/ButtonIcon.d.ts +7 -0
- package/dist/components/Button/ButtonLabel.d.ts +8 -0
- package/dist/components/Button/ComboButton.d.ts +10 -0
- package/dist/components/Button/IconButton.d.ts +14 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +8 -0
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +9 -0
- package/dist/components/Datepicker/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +54 -0
- package/dist/components/Dialog/DialogActions.d.ts +16 -0
- package/dist/components/Dialog/DialogActivityLog.d.ts +10 -0
- package/dist/components/Dialog/DialogArticleBase.d.ts +6 -0
- package/dist/components/Dialog/DialogAttachments.d.ts +6 -0
- package/dist/components/Dialog/DialogBase.d.ts +5 -0
- package/dist/components/Dialog/DialogBodyBase.d.ts +5 -0
- package/dist/components/Dialog/DialogBorder.d.ts +9 -0
- package/dist/components/Dialog/DialogContent.d.ts +9 -0
- package/dist/components/Dialog/DialogFooter.d.ts +4 -0
- package/dist/components/Dialog/DialogGroup.d.ts +6 -0
- package/dist/components/Dialog/DialogHeader.d.ts +10 -0
- package/dist/components/Dialog/DialogHeaderBase.d.ts +5 -0
- package/dist/components/Dialog/DialogHeadings.d.ts +24 -0
- package/dist/components/Dialog/DialogHistory.d.ts +6 -0
- package/dist/components/Dialog/DialogList.d.ts +7 -0
- package/dist/components/Dialog/DialogListItem.d.ts +59 -0
- package/dist/components/Dialog/DialogListItemBase.d.ts +28 -0
- package/dist/components/Dialog/DialogMetadata.d.ts +22 -0
- package/dist/components/Dialog/DialogNav.d.ts +21 -0
- package/dist/components/Dialog/DialogSectionBase.d.ts +6 -0
- package/dist/components/Dialog/DialogSeenBy.d.ts +19 -0
- package/dist/components/Dialog/DialogSelect.d.ts +10 -0
- package/dist/components/Dialog/DialogStatus.d.ts +25 -0
- package/dist/components/Dialog/DialogTitle.d.ts +20 -0
- package/dist/components/Dialog/DialogTouchedBy.d.ts +10 -0
- package/dist/components/Dropdown/Backdrop.d.ts +6 -0
- package/dist/components/Dropdown/DrawerBase.d.ts +9 -0
- package/dist/components/Dropdown/DrawerBody.d.ts +6 -0
- package/dist/components/Dropdown/DrawerButton.d.ts +7 -0
- package/dist/components/Dropdown/DrawerFooter.d.ts +6 -0
- package/dist/components/Dropdown/DrawerHeader.d.ts +7 -0
- package/dist/components/Dropdown/DrawerOrDropdown.d.ts +10 -0
- package/dist/components/Dropdown/DropdownBase.d.ts +10 -0
- package/{lib/components/Dropdown/index.ts → dist/components/Dropdown/index.d.ts} +0 -1
- package/dist/components/Footer/Footer.d.ts +6 -0
- package/dist/components/Footer/FooterAddress.d.ts +6 -0
- package/dist/components/Footer/FooterBase.d.ts +6 -0
- package/dist/components/Footer/FooterLogo.d.ts +5 -0
- package/dist/components/Footer/FooterMenu.d.ts +14 -0
- package/dist/components/GlobalMenu/AccountButton.d.ts +14 -0
- package/dist/components/GlobalMenu/AccountMenu.d.ts +20 -0
- package/dist/components/GlobalMenu/BackButton.d.ts +5 -0
- package/dist/components/GlobalMenu/GlobalMenu.d.ts +16 -0
- package/dist/components/GlobalMenu/GlobalMenuBase.d.ts +7 -0
- package/dist/components/GlobalMenu/LogoutButton.d.ts +7 -0
- package/dist/components/Header/DigdirLogomark.d.ts +5 -0
- package/dist/components/Header/Header.d.ts +9 -0
- package/dist/components/Header/HeaderBase.d.ts +9 -0
- package/dist/components/Header/HeaderButton.d.ts +15 -0
- package/dist/components/Header/HeaderLogo.d.ts +9 -0
- package/dist/components/Header/HeaderMenu.d.ts +7 -0
- package/dist/components/Header/HeaderSearch.d.ts +7 -0
- package/dist/components/History/HistoryAttachments.d.ts +6 -0
- package/dist/components/History/HistoryBorder.d.ts +7 -0
- package/dist/components/History/HistoryItem.d.ts +14 -0
- package/dist/components/History/HistoryList.d.ts +6 -0
- package/dist/components/Icon/CheckboxCheckedIcon.d.ts +8 -0
- package/dist/components/Icon/CheckboxIcon.d.ts +10 -0
- package/dist/components/Icon/CheckboxUncheckedIcon.d.ts +9 -0
- package/dist/components/Icon/Icon.d.ts +9 -0
- package/dist/components/Icon/ProgressIcon.d.ts +6 -0
- package/dist/components/Icon/RadioCheckedIcon.d.ts +8 -0
- package/dist/components/Icon/RadioIcon.d.ts +10 -0
- package/dist/components/Icon/RadioUncheckedIcon.d.ts +9 -0
- package/dist/components/Icon/SvgIcon.d.ts +9 -0
- package/dist/components/Icon/iconsMap.d.ts +1911 -0
- package/dist/components/Layout/Layout.d.ts +24 -0
- package/dist/components/Layout/LayoutBase.d.ts +21 -0
- package/dist/components/Layout/LayoutBody.d.ts +7 -0
- package/dist/components/Layout/LayoutContent.d.ts +7 -0
- package/dist/components/Layout/LayoutSidebar.d.ts +13 -0
- package/dist/components/LayoutAction/ActionFooter.d.ts +6 -0
- package/dist/components/LayoutAction/ActionHeader.d.ts +7 -0
- package/dist/components/LayoutAction/ActionMenu.d.ts +6 -0
- package/dist/components/List/List.d.ts +10 -0
- package/dist/components/List/ListBase.d.ts +9 -0
- package/dist/components/List/ListItem.d.ts +46 -0
- package/dist/components/List/ListItemBase.d.ts +27 -0
- package/dist/components/List/ListItemLabel.d.ts +9 -0
- package/dist/components/List/ListItemMedia.d.ts +14 -0
- package/dist/components/Menu/Menu.d.ts +8 -0
- package/dist/components/Menu/MenuBase.d.ts +27 -0
- package/dist/components/Menu/MenuHeader.d.ts +4 -0
- package/dist/components/Menu/MenuInputField.d.ts +12 -0
- package/dist/components/Menu/MenuItem.d.ts +35 -0
- package/dist/components/Menu/MenuItemBase.d.ts +23 -0
- package/dist/components/Menu/MenuItemLabel.d.ts +10 -0
- package/dist/components/Menu/MenuItemMedia.d.ts +14 -0
- package/dist/components/Menu/MenuItems.d.ts +17 -0
- package/dist/components/Menu/MenuOption.d.ts +19 -0
- package/dist/components/Menu/MenuSearch.d.ts +8 -0
- package/{lib/components/Menu/index.ts → dist/components/Menu/index.d.ts} +1 -0
- package/dist/components/Meta/MetaBase.d.ts +7 -0
- package/dist/components/Meta/MetaItem.d.ts +18 -0
- package/dist/components/Meta/MetaItemBase.d.ts +15 -0
- package/dist/components/Meta/MetaItemLabel.d.ts +11 -0
- package/dist/components/Meta/MetaItemMedia.d.ts +9 -0
- package/dist/components/Meta/MetaList.d.ts +12 -0
- package/dist/components/Meta/MetaProgress.d.ts +13 -0
- package/dist/components/Meta/MetaTimestamp.d.ts +16 -0
- package/dist/components/Page/PageBase.d.ts +6 -0
- package/dist/components/Page/PageHeader.d.ts +7 -0
- package/dist/components/Page/PageHeaderMedia.d.ts +10 -0
- package/dist/components/Page/PageNav.d.ts +14 -0
- package/dist/components/Page/SectionBase.d.ts +19 -0
- package/dist/components/Page/SectionFooter.d.ts +6 -0
- package/dist/components/Page/SectionHeader.d.ts +7 -0
- package/dist/components/RootProvider/RootProvider.d.ts +19 -0
- package/dist/components/Searchbar/Autocomplete.d.ts +9 -0
- package/dist/components/Searchbar/AutocompleteBase.d.ts +7 -0
- package/dist/components/Searchbar/AutocompleteGroup.d.ts +6 -0
- package/dist/components/Searchbar/AutocompleteItem.d.ts +13 -0
- package/dist/components/Searchbar/SearchField.d.ts +16 -0
- package/dist/components/Searchbar/Searchbar.d.ts +9 -0
- package/dist/components/Searchbar/SearchbarBase.d.ts +8 -0
- package/dist/components/Snackbar/Snackbar.d.ts +21 -0
- package/dist/components/Snackbar/SnackbarBase.d.ts +13 -0
- package/dist/components/Snackbar/SnackbarLabel.d.ts +5 -0
- package/dist/components/Snackbar/SnackbarMedia.d.ts +6 -0
- package/dist/components/Toolbar/Toolbar.d.ts +15 -0
- package/dist/components/Toolbar/ToolbarAdd.d.ts +10 -0
- package/dist/components/Toolbar/ToolbarBase.d.ts +7 -0
- package/dist/components/Toolbar/ToolbarButton.d.ts +14 -0
- package/dist/components/Toolbar/ToolbarFilter.d.ts +23 -0
- package/dist/components/Toolbar/ToolbarFilterBase.d.ts +6 -0
- package/dist/components/Toolbar/ToolbarMenu.d.ts +13 -0
- package/dist/components/Toolbar/ToolbarOptions.d.ts +18 -0
- package/dist/components/Toolbar/ToolbarSearch.d.ts +8 -0
- package/dist/components/Typography/Heading.d.ts +10 -0
- package/dist/components/Typography/Typography.d.ts +11 -0
- package/{lib/components/index.ts → dist/components/index.d.ts} +3 -1
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useEscapeKey.d.ts +1 -0
- package/dist/hooks/useMenu.d.ts +21 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +3340 -0
- package/package.json +27 -19
- package/.github/workflows/ci-cd-main.yml +0 -47
- package/.github/workflows/ci-cd-pull-request.yml +0 -39
- package/.github/workflows/workflow-deploy-storybook.yml +0 -35
- package/.node-version +0 -1
- package/.storybook/StoryDecorator.tsx +0 -29
- package/.storybook/ThemeProvider.tsx +0 -16
- package/.storybook/main.ts +0 -20
- package/.storybook/preview.tsx +0 -63
- package/.storybook/storyDecorator.module.css +0 -20
- package/.storybook/theme.module.css +0 -3
- package/CHANGELOG.md +0 -90
- package/CONTRIBUTING.MD +0 -59
- package/biome.jsonc +0 -65
- package/lib/components/Attachment/AttachmentLink.stories.ts +0 -19
- package/lib/components/Attachment/AttachmentLink.tsx +0 -20
- package/lib/components/Attachment/AttachmentList.stories.ts +0 -39
- package/lib/components/Attachment/AttachmentList.tsx +0 -26
- package/lib/components/Attachment/attachmentLink.module.css +0 -20
- package/lib/components/Attachment/attachmentList.module.css +0 -12
- package/lib/components/Avatar/Avatar.tsx +0 -83
- package/lib/components/Avatar/AvatarGroup.stories.ts +0 -66
- package/lib/components/Avatar/AvatarGroup.tsx +0 -60
- package/lib/components/Avatar/avatar.module.css +0 -61
- package/lib/components/Avatar/avatar.stories.tsx +0 -40
- package/lib/components/Avatar/avatarGroup.module.css +0 -78
- package/lib/components/Avatar/color.ts +0 -71
- package/lib/components/Badge/Badge.stories.ts +0 -32
- package/lib/components/Badge/Badge.tsx +0 -22
- package/lib/components/Badge/badge.module.css +0 -27
- package/lib/components/Button/Button.stories.ts +0 -50
- package/lib/components/Button/Button.tsx +0 -60
- package/lib/components/Button/ButtonBase.tsx +0 -53
- package/lib/components/Button/ButtonIcon.tsx +0 -16
- package/lib/components/Button/ButtonLabel.tsx +0 -18
- package/lib/components/Button/Buttons.stories.tsx +0 -64
- package/lib/components/Button/ComboButton.stories.ts +0 -45
- package/lib/components/Button/ComboButton.tsx +0 -46
- package/lib/components/Button/IconButton.stories.tsx +0 -47
- package/lib/components/Button/IconButton.tsx +0 -31
- package/lib/components/Button/button.module.css +0 -22
- package/lib/components/Button/buttonBase.module.css +0 -142
- package/lib/components/Button/buttonIcon.module.css +0 -17
- package/lib/components/Button/buttonLabel.module.css +0 -17
- package/lib/components/Button/comboButton.module.css +0 -35
- package/lib/components/Button/iconButton.module.css +0 -31
- package/lib/components/ContextMenu/ContextMenu.stories.ts +0 -49
- package/lib/components/ContextMenu/ContextMenu.tsx +0 -20
- package/lib/components/ContextMenu/ContextMenuBase.tsx +0 -33
- package/lib/components/ContextMenu/contextMenuBase.module.css +0 -35
- package/lib/components/Dialog/Dialog.stories.ts +0 -331
- package/lib/components/Dialog/Dialog.tsx +0 -111
- package/lib/components/Dialog/DialogActions.stories.ts +0 -60
- package/lib/components/Dialog/DialogActions.tsx +0 -80
- package/lib/components/Dialog/DialogActivityLog.tsx +0 -18
- package/lib/components/Dialog/DialogArticleBase.tsx +0 -10
- package/lib/components/Dialog/DialogAttachments.stories.ts +0 -38
- package/lib/components/Dialog/DialogAttachments.tsx +0 -25
- package/lib/components/Dialog/DialogBase.tsx +0 -10
- package/lib/components/Dialog/DialogBodyBase.tsx +0 -17
- package/lib/components/Dialog/DialogBorder.tsx +0 -19
- package/lib/components/Dialog/DialogContent.stories.ts +0 -26
- package/lib/components/Dialog/DialogContent.tsx +0 -23
- package/lib/components/Dialog/DialogFooter.tsx +0 -14
- package/lib/components/Dialog/DialogGroup.tsx +0 -24
- package/lib/components/Dialog/DialogHeader.stories.ts +0 -24
- package/lib/components/Dialog/DialogHeader.tsx +0 -23
- package/lib/components/Dialog/DialogHeaderBase.tsx +0 -10
- package/lib/components/Dialog/DialogHeadings.stories.ts +0 -35
- package/lib/components/Dialog/DialogHeadings.tsx +0 -77
- package/lib/components/Dialog/DialogHistory.stories.ts +0 -67
- package/lib/components/Dialog/DialogHistory.tsx +0 -19
- package/lib/components/Dialog/DialogList.stories.ts +0 -65
- package/lib/components/Dialog/DialogList.tsx +0 -35
- package/lib/components/Dialog/DialogListItem.stories.tsx +0 -238
- package/lib/components/Dialog/DialogListItem.tsx +0 -126
- package/lib/components/Dialog/DialogListItemBase.tsx +0 -52
- package/lib/components/Dialog/DialogMetadata.stories.ts +0 -75
- package/lib/components/Dialog/DialogMetadata.tsx +0 -56
- package/lib/components/Dialog/DialogNav.stories.ts +0 -88
- package/lib/components/Dialog/DialogNav.tsx +0 -56
- package/lib/components/Dialog/DialogSectionBase.tsx +0 -20
- package/lib/components/Dialog/DialogSeenBy.stories.tsx +0 -56
- package/lib/components/Dialog/DialogSeenBy.tsx +0 -36
- package/lib/components/Dialog/DialogSelect.tsx +0 -23
- package/lib/components/Dialog/DialogStatus.stories.ts +0 -57
- package/lib/components/Dialog/DialogStatus.tsx +0 -61
- package/lib/components/Dialog/DialogTitle.stories.ts +0 -31
- package/lib/components/Dialog/DialogTitle.tsx +0 -31
- package/lib/components/Dialog/DialogTouchedBy.stories.tsx +0 -27
- package/lib/components/Dialog/DialogTouchedBy.tsx +0 -19
- package/lib/components/Dialog/dialog.module.css +0 -21
- package/lib/components/Dialog/dialogAction.module.css +0 -26
- package/lib/components/Dialog/dialogArticleBase.module.css +0 -5
- package/lib/components/Dialog/dialogBodyBase.module.css +0 -13
- package/lib/components/Dialog/dialogBorder.module.css +0 -42
- package/lib/components/Dialog/dialogGroup.module.css +0 -35
- package/lib/components/Dialog/dialogHeaderBase.module.css +0 -6
- package/lib/components/Dialog/dialogHeadings.module.css +0 -24
- package/lib/components/Dialog/dialogHistory.module.css +0 -12
- package/lib/components/Dialog/dialogListItem.module.css +0 -81
- package/lib/components/Dialog/dialogListItemBase.module.css +0 -28
- package/lib/components/Dialog/dialogNav.module.css +0 -12
- package/lib/components/Dialog/dialogSectionBase.module.css +0 -11
- package/lib/components/Dialog/dialogSelect.module.css +0 -34
- package/lib/components/Dialog/dialogTitle.module.css +0 -47
- package/lib/components/Dropdown/Backdrop.tsx +0 -12
- package/lib/components/Dropdown/DrawerBase.tsx +0 -20
- package/lib/components/Dropdown/DrawerBody.tsx +0 -12
- package/lib/components/Dropdown/DrawerButton.tsx +0 -17
- package/lib/components/Dropdown/DrawerFooter.tsx +0 -12
- package/lib/components/Dropdown/DrawerHeader.tsx +0 -19
- package/lib/components/Dropdown/DrawerOrDropdown.tsx +0 -29
- package/lib/components/Dropdown/DropdownBase.tsx +0 -32
- package/lib/components/Dropdown/backdrop.module.css +0 -11
- package/lib/components/Dropdown/drawerBase.module.css +0 -17
- package/lib/components/Dropdown/drawerBody.module.css +0 -5
- package/lib/components/Dropdown/drawerButton.module.css +0 -6
- package/lib/components/Dropdown/drawerFooter.module.css +0 -13
- package/lib/components/Dropdown/drawerHeader.module.css +0 -17
- package/lib/components/Dropdown/drawerOrDropdown.module.css +0 -19
- package/lib/components/Dropdown/dropdownBase.module.css +0 -34
- package/lib/components/Footer/Footer.stories.ts +0 -37
- package/lib/components/Footer/Footer.tsx +0 -21
- package/lib/components/Footer/FooterAddress.tsx +0 -12
- package/lib/components/Footer/FooterBase.tsx +0 -16
- package/lib/components/Footer/FooterLogo.tsx +0 -17
- package/lib/components/Footer/FooterMenu.tsx +0 -43
- package/lib/components/Footer/footerAddress.module.css +0 -8
- package/lib/components/Footer/footerBase.module.css +0 -28
- package/lib/components/Footer/footerLogo.module.css +0 -12
- package/lib/components/Footer/footerMenu.module.css +0 -35
- package/lib/components/GlobalMenu/AccountButton.tsx +0 -30
- package/lib/components/GlobalMenu/AccountMenu.stories.tsx +0 -65
- package/lib/components/GlobalMenu/AccountMenu.tsx +0 -82
- package/lib/components/GlobalMenu/BackButton.tsx +0 -10
- package/lib/components/GlobalMenu/GlobalMenu.stories.tsx +0 -181
- package/lib/components/GlobalMenu/GlobalMenu.tsx +0 -81
- package/lib/components/GlobalMenu/GlobalMenuBase.tsx +0 -22
- package/lib/components/GlobalMenu/LogoutButton.tsx +0 -19
- package/lib/components/GlobalMenu/globalMenuBase.module.css +0 -39
- package/lib/components/GlobalMenu/logoutButton.module.css +0 -9
- package/lib/components/Header/DigdirLogomark.tsx +0 -23
- package/lib/components/Header/Header.stories.tsx +0 -188
- package/lib/components/Header/Header.tsx +0 -74
- package/lib/components/Header/HeaderBase.tsx +0 -21
- package/lib/components/Header/HeaderButton.stories.ts +0 -70
- package/lib/components/Header/HeaderButton.tsx +0 -67
- package/lib/components/Header/HeaderLogo.stories.ts +0 -17
- package/lib/components/Header/HeaderLogo.tsx +0 -22
- package/lib/components/Header/HeaderMenu.tsx +0 -17
- package/lib/components/Header/header.module.css +0 -45
- package/lib/components/Header/headerBase.module.css +0 -51
- package/lib/components/Header/headerButton.module.css +0 -37
- package/lib/components/Header/headerLogo.module.css +0 -24
- package/lib/components/Header/headerMenu.module.css +0 -3
- package/lib/components/Header/mobileMenu.module.css +0 -28
- package/lib/components/History/HistoryAttachments.tsx +0 -22
- package/lib/components/History/HistoryBorder.tsx +0 -17
- package/lib/components/History/HistoryItem.stories.ts +0 -56
- package/lib/components/History/HistoryItem.tsx +0 -56
- package/lib/components/History/HistoryList.stories.ts +0 -70
- package/lib/components/History/HistoryList.tsx +0 -26
- package/lib/components/History/historyBorder.module.css +0 -8
- package/lib/components/History/historyItem.module.css +0 -19
- package/lib/components/History/historyList.module.css +0 -12
- package/lib/components/Icon/CheckboxCheckedIcon.tsx +0 -28
- package/lib/components/Icon/CheckboxIcon.stories.ts +0 -32
- package/lib/components/Icon/CheckboxIcon.tsx +0 -17
- package/lib/components/Icon/CheckboxUncheckedIcon.tsx +0 -38
- package/lib/components/Icon/Icon.stories.ts +0 -24
- package/lib/components/Icon/Icon.tsx +0 -23
- package/lib/components/Icon/ProgressIcon.stories.ts +0 -43
- package/lib/components/Icon/ProgressIcon.tsx +0 -44
- package/lib/components/Icon/RadioCheckedIcon.tsx +0 -29
- package/lib/components/Icon/RadioIcon.stories.ts +0 -32
- package/lib/components/Icon/RadioIcon.tsx +0 -17
- package/lib/components/Icon/RadioUncheckedIcon.tsx +0 -30
- package/lib/components/Icon/SvgIcon.tsx +0 -18
- package/lib/components/Icon/__AkselIcon.tsx +0 -37
- package/lib/components/Icon/checkboxIcon.module.css +0 -23
- package/lib/components/Icon/icon.module.css +0 -4
- package/lib/components/Icon/iconsMap.tsx +0 -2078
- package/lib/components/Icon/progressIcon.module.css +0 -29
- package/lib/components/Icon/radioIcon.module.css +0 -21
- package/lib/components/Layout/Layout.stories.tsx +0 -308
- package/lib/components/Layout/Layout.tsx +0 -46
- package/lib/components/Layout/LayoutBase.stories.ts +0 -17
- package/lib/components/Layout/LayoutBase.tsx +0 -31
- package/lib/components/Layout/LayoutBody.stories.ts +0 -17
- package/lib/components/Layout/LayoutBody.tsx +0 -16
- package/lib/components/Layout/LayoutContent.stories.ts +0 -17
- package/lib/components/Layout/LayoutContent.tsx +0 -15
- package/lib/components/Layout/LayoutSidebar.stories.ts +0 -17
- package/lib/components/Layout/LayoutSidebar.tsx +0 -23
- package/lib/components/Layout/layoutBase.module.css +0 -22
- package/lib/components/Layout/layoutBody.module.css +0 -15
- package/lib/components/Layout/layoutContent.module.css +0 -13
- package/lib/components/Layout/layoutSidebar.module.css +0 -20
- package/lib/components/LayoutAction/ActionFooter.stories.tsx +0 -70
- package/lib/components/LayoutAction/ActionFooter.tsx +0 -15
- package/lib/components/LayoutAction/ActionHeader.stories.ts +0 -20
- package/lib/components/LayoutAction/ActionHeader.tsx +0 -19
- package/lib/components/LayoutAction/ActionMenu.stories.tsx +0 -40
- package/lib/components/LayoutAction/ActionMenu.tsx +0 -23
- package/lib/components/LayoutAction/actionFooter.module.css +0 -28
- package/lib/components/LayoutAction/actionHeader.module.css +0 -55
- package/lib/components/LayoutAction/actionMenu.module.css +0 -30
- package/lib/components/List/List.stories.tsx +0 -43
- package/lib/components/List/List.tsx +0 -20
- package/lib/components/List/ListBase.tsx +0 -19
- package/lib/components/List/ListItem.stories.tsx +0 -208
- package/lib/components/List/ListItem.tsx +0 -73
- package/lib/components/List/ListItemBase.tsx +0 -78
- package/lib/components/List/ListItemLabel.tsx +0 -29
- package/lib/components/List/ListItemMedia.tsx +0 -59
- package/lib/components/List/listBase.module.css +0 -16
- package/lib/components/List/listItemBase.module.css +0 -90
- package/lib/components/List/listItemLabel.module.css +0 -55
- package/lib/components/List/listItemMedia.module.css +0 -41
- package/lib/components/Menu/Menu.stories.ts +0 -514
- package/lib/components/Menu/Menu.tsx +0 -24
- package/lib/components/Menu/MenuBase.tsx +0 -63
- package/lib/components/Menu/MenuHeader.tsx +0 -13
- package/lib/components/Menu/MenuItem.stories.tsx +0 -164
- package/lib/components/Menu/MenuItem.tsx +0 -63
- package/lib/components/Menu/MenuItemBase.tsx +0 -77
- package/lib/components/Menu/MenuItemLabel.tsx +0 -30
- package/lib/components/Menu/MenuItemMedia.tsx +0 -42
- package/lib/components/Menu/MenuItems.stories.ts +0 -438
- package/lib/components/Menu/MenuItems.tsx +0 -96
- package/lib/components/Menu/MenuOption.stories.ts +0 -52
- package/lib/components/Menu/MenuOption.tsx +0 -48
- package/lib/components/Menu/MenuSearch.stories.ts +0 -18
- package/lib/components/Menu/MenuSearch.tsx +0 -25
- package/lib/components/Menu/menu.module.css +0 -25
- package/lib/components/Menu/menuBase.module.css +0 -25
- package/lib/components/Menu/menuHeader.module.css +0 -12
- package/lib/components/Menu/menuItemBase.module.css +0 -72
- package/lib/components/Menu/menuItemLabel.module.css +0 -32
- package/lib/components/Menu/menuItemMedia.module.css +0 -38
- package/lib/components/Menu/menuOption.module.css +0 -27
- package/lib/components/Menu/menuSearch.module.css +0 -30
- package/lib/components/Meta/MetaBase.tsx +0 -15
- package/lib/components/Meta/MetaItem.stories.ts +0 -25
- package/lib/components/Meta/MetaItem.tsx +0 -31
- package/lib/components/Meta/MetaItemBase.tsx +0 -46
- package/lib/components/Meta/MetaItemLabel.tsx +0 -20
- package/lib/components/Meta/MetaItemMedia.tsx +0 -22
- package/lib/components/Meta/MetaList.stories.ts +0 -29
- package/lib/components/Meta/MetaList.tsx +0 -43
- package/lib/components/Meta/MetaProgress.stories.ts +0 -29
- package/lib/components/Meta/MetaProgress.tsx +0 -26
- package/lib/components/Meta/MetaTimestamp.stories.ts +0 -33
- package/lib/components/Meta/MetaTimestamp.tsx +0 -29
- package/lib/components/Meta/meta.module.css +0 -6
- package/lib/components/Meta/metaItem.module.css +0 -107
- package/lib/components/Meta/metaList.module.css +0 -15
- package/lib/components/Page/PageBase.tsx +0 -14
- package/lib/components/Page/PageHeader.tsx +0 -21
- package/lib/components/Page/PageHeaderMedia.tsx +0 -25
- package/lib/components/Page/SectionBase.tsx +0 -52
- package/lib/components/Page/SectionFooter.tsx +0 -15
- package/lib/components/Page/SectionHeader.tsx +0 -16
- package/lib/components/Page/pageHeader.module.css +0 -5
- package/lib/components/Page/sectionBase.module.css +0 -82
- package/lib/components/Page/sectionFooter.module.css +0 -8
- package/lib/components/Page/sectionHeader.module.css +0 -9
- package/lib/components/RootProvider/RootProvider.tsx +0 -55
- package/lib/components/Searchbar/Autocomplete.stories.tsx +0 -77
- package/lib/components/Searchbar/Autocomplete.tsx +0 -44
- package/lib/components/Searchbar/AutocompleteBase.tsx +0 -16
- package/lib/components/Searchbar/AutocompleteGroup.tsx +0 -17
- package/lib/components/Searchbar/AutocompleteItem.tsx +0 -23
- package/lib/components/Searchbar/SearchField.tsx +0 -78
- package/lib/components/Searchbar/Searchbar.stories.tsx +0 -151
- package/lib/components/Searchbar/Searchbar.tsx +0 -18
- package/lib/components/Searchbar/SearchbarBase.tsx +0 -23
- package/lib/components/Searchbar/autocompleteBase.module.css +0 -17
- package/lib/components/Searchbar/autocompleteGroup.module.css +0 -3
- package/lib/components/Searchbar/autocompleteItem.module.css +0 -19
- package/lib/components/Searchbar/searchField.module.css +0 -54
- package/lib/components/Searchbar/searchbarBase.module.css +0 -20
- package/lib/components/Snackbar/Snackbar.stories.tsx +0 -21
- package/lib/components/Snackbar/Snackbar.tsx +0 -32
- package/lib/components/Snackbar/SnackbarBase.tsx +0 -39
- package/lib/components/Snackbar/SnackbarLabel.tsx +0 -10
- package/lib/components/Snackbar/SnackbarMedia.tsx +0 -14
- package/lib/components/Snackbar/snackbarBase.module.css +0 -55
- package/lib/components/Snackbar/snackbarLabel.module.css +0 -6
- package/lib/components/Snackbar/snackbarMedia.module.css +0 -10
- package/lib/components/Toolbar/Toolbar.stories.tsx +0 -188
- package/lib/components/Toolbar/Toolbar.tsx +0 -156
- package/lib/components/Toolbar/ToolbarAdd.stories.ts +0 -23
- package/lib/components/Toolbar/ToolbarAdd.tsx +0 -26
- package/lib/components/Toolbar/ToolbarBase.tsx +0 -12
- package/lib/components/Toolbar/ToolbarButton.stories.ts +0 -32
- package/lib/components/Toolbar/ToolbarButton.tsx +0 -65
- package/lib/components/Toolbar/ToolbarFilter.stories.ts +0 -64
- package/lib/components/Toolbar/ToolbarFilter.tsx +0 -75
- package/lib/components/Toolbar/ToolbarMenu.stories.ts +0 -37
- package/lib/components/Toolbar/ToolbarMenu.tsx +0 -29
- package/lib/components/Toolbar/ToolbarOptions.stories.ts +0 -108
- package/lib/components/Toolbar/ToolbarOptions.tsx +0 -74
- package/lib/components/Toolbar/ToolbarSearch.stories.ts +0 -19
- package/lib/components/Toolbar/ToolbarSearch.tsx +0 -24
- package/lib/components/Toolbar/toolbarAdd.module.css +0 -7
- package/lib/components/Toolbar/toolbarBase.module.css +0 -19
- package/lib/components/Toolbar/toolbarButton.module.css +0 -3
- package/lib/components/Toolbar/toolbarFilter.module.css +0 -25
- package/lib/components/Toolbar/toolbarMenu.module.css +0 -7
- package/lib/components/Toolbar/toolbarSearch.module.css +0 -28
- package/lib/components/Typography/Heading.tsx +0 -23
- package/lib/components/Typography/Typography.tsx +0 -24
- package/lib/components/Typography/heading.module.css +0 -21
- package/lib/components/Typography/typography.module.css +0 -64
- package/lib/css/colors.css +0 -113
- package/lib/css/global.css +0 -15
- package/lib/css/shadows.css +0 -7
- package/lib/css/theme-article.css +0 -15
- package/lib/css/theme-company.css +0 -15
- package/lib/css/theme-global-dark.css +0 -19
- package/lib/css/theme-global.css +0 -15
- package/lib/css/theme-neutral.css +0 -15
- package/lib/css/theme-person.css +0 -15
- package/lib/css/theme.css +0 -22
- package/lib/hooks/useClickOutside.ts +0 -22
- package/lib/hooks/useEscapeKey.ts +0 -17
- package/lib/hooks/useMenu.tsx +0 -80
- package/lib/stories/Color/MenuItem.stories.tsx +0 -43
- package/lib/stories/Color/Swatches.stories.tsx +0 -19
- package/lib/stories/Color/Swatches.tsx +0 -42
- package/lib/stories/Color/colors.json +0 -62
- package/lib/stories/Color/swatches.module.css +0 -14
- package/lib/stories/Inbox/BookmarksPage.tsx +0 -52
- package/lib/stories/Inbox/DialogPage.tsx +0 -15
- package/lib/stories/Inbox/Inbox.stories.tsx +0 -55
- package/lib/stories/Inbox/Inbox.tsx +0 -12
- package/lib/stories/Inbox/InboxLayout.tsx +0 -51
- package/lib/stories/Inbox/InboxPage.tsx +0 -50
- package/lib/stories/Inbox/InboxProvider.tsx +0 -135
- package/lib/stories/Inbox/InboxSection.tsx +0 -39
- package/lib/stories/Inbox/InboxToolbar.tsx +0 -94
- package/lib/stories/Inbox/ProfilePage.tsx +0 -35
- package/lib/stories/Inbox/SettingsPage.tsx +0 -19
- package/lib/stories/Inbox/accounts/accounts.ts +0 -24
- package/lib/stories/Inbox/accounts/index.ts +0 -1
- package/lib/stories/Inbox/actionMenu.ts +0 -24
- package/lib/stories/Inbox/dialogs/brreg-completed.json +0 -35
- package/lib/stories/Inbox/dialogs/brreg-draft.json +0 -45
- package/lib/stories/Inbox/dialogs/index.ts +0 -10
- package/lib/stories/Inbox/dialogs/skatt-2023.json +0 -33
- package/lib/stories/Inbox/groupBy.ts +0 -19
- package/lib/stories/Inbox/inboxSection.module.css +0 -19
- package/lib/stories/Inbox/index.ts +0 -15
- package/lib/stories/Inbox/layout/footer.ts +0 -27
- package/lib/stories/Inbox/layout/header.ts +0 -11
- package/lib/stories/Inbox/layout/index.ts +0 -3
- package/lib/stories/Inbox/layout/menu.ts +0 -64
- package/renovate.json +0 -4
- package/tsconfig.json +0 -28
- package/tsconfig.node.json +0 -11
- package/typings.d.ts +0 -1
- package/vite.config.ts +0 -20
- /package/{lib/components/Attachment/index.ts → dist/components/Attachment/index.d.ts} +0 -0
- /package/{lib/components/Avatar/index.ts → dist/components/Avatar/index.d.ts} +0 -0
- /package/{lib/components/Badge/index.tsx → dist/components/Badge/index.d.ts} +0 -0
- /package/{lib/components/Button/index.ts → dist/components/Button/index.d.ts} +0 -0
- /package/{lib/components/ContextMenu/index.ts → dist/components/ContextMenu/index.d.ts} +0 -0
- /package/{lib/components/Dialog/index.ts → dist/components/Dialog/index.d.ts} +0 -0
- /package/{lib/components/Footer/index.ts → dist/components/Footer/index.d.ts} +0 -0
- /package/{lib/components/GlobalMenu/index.tsx → dist/components/GlobalMenu/index.d.ts} +0 -0
- /package/{lib/components/Header/index.tsx → dist/components/Header/index.d.ts} +0 -0
- /package/{lib/components/History/index.ts → dist/components/History/index.d.ts} +0 -0
- /package/{lib/components/Icon/index.ts → dist/components/Icon/index.d.ts} +0 -0
- /package/{lib/components/Layout/index.tsx → dist/components/Layout/index.d.ts} +0 -0
- /package/{lib/components/LayoutAction/index.ts → dist/components/LayoutAction/index.d.ts} +0 -0
- /package/{lib/components/List/index.ts → dist/components/List/index.d.ts} +0 -0
- /package/{lib/components/Meta/index.ts → dist/components/Meta/index.d.ts} +0 -0
- /package/{lib/components/Page/index.ts → dist/components/Page/index.d.ts} +0 -0
- /package/{lib/components/RootProvider/index.ts → dist/components/RootProvider/index.d.ts} +0 -0
- /package/{lib/components/Searchbar/index.ts → dist/components/Searchbar/index.d.ts} +0 -0
- /package/{lib/components/Snackbar/index.ts → dist/components/Snackbar/index.d.ts} +0 -0
- /package/{lib/components/Toolbar/index.ts → dist/components/Toolbar/index.d.ts} +0 -0
- /package/{lib/components/Typography/index.ts → dist/components/Typography/index.d.ts} +0 -0
- /package/{lib/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
- /package/{lib/index.ts → dist/index.d.ts} +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { TypographySize } from '../Typography';
|
|
2
|
-
import { AttachmentLink, type AttachmentLinkProps } from './AttachmentLink';
|
|
3
|
-
import styles from './attachmentList.module.css';
|
|
4
|
-
|
|
5
|
-
export interface AttachmentListProps {
|
|
6
|
-
items: AttachmentLinkProps[];
|
|
7
|
-
size?: TypographySize;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const AttachmentList = ({ size, items }: AttachmentListProps) => {
|
|
11
|
-
if (!items.length) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<ul className={styles.list} data-size={size}>
|
|
17
|
-
{items.map((item, index) => {
|
|
18
|
-
return (
|
|
19
|
-
<li key={index} className={styles.item}>
|
|
20
|
-
<AttachmentLink {...item} key={'attachment' + index} />
|
|
21
|
-
</li>
|
|
22
|
-
);
|
|
23
|
-
})}
|
|
24
|
-
</ul>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
.link {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: start;
|
|
4
|
-
column-gap: 0.25em;
|
|
5
|
-
color: var(--theme-base-default);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.link:hover {
|
|
9
|
-
color: var(--theme-base-hover);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.label {
|
|
13
|
-
text-decoration: underline;
|
|
14
|
-
text-decoration-thickness: 2px;
|
|
15
|
-
text-underline-offset: 2px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.icon {
|
|
19
|
-
font-size: 1.5em;
|
|
20
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import cx from 'classnames';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import styles from './avatar.module.css';
|
|
5
|
-
import { fromStringToColor } from './color';
|
|
6
|
-
|
|
7
|
-
export type AvatarType = 'company' | 'person' | 'custom';
|
|
8
|
-
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
-
|
|
10
|
-
type AvatarVariant = 'square' | 'circle';
|
|
11
|
-
type AvatarColor = 'dark' | 'light';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Props for the Avatar component.
|
|
15
|
-
*/
|
|
16
|
-
export interface AvatarProps {
|
|
17
|
-
/** The name to display in the avatar. */
|
|
18
|
-
name: string;
|
|
19
|
-
/** The type of avatar. */
|
|
20
|
-
type?: AvatarType;
|
|
21
|
-
/** The size of the avatar. */
|
|
22
|
-
size?: AvatarSize;
|
|
23
|
-
/** Additional class names to apply to the avatar. */
|
|
24
|
-
className?: string;
|
|
25
|
-
/** URL of the image to display in the avatar. */
|
|
26
|
-
imageUrl?: string;
|
|
27
|
-
/** Alt text for the image. */
|
|
28
|
-
imageUrlAlt?: string;
|
|
29
|
-
/** Whether to display an outline around the avatar. */
|
|
30
|
-
outline?: boolean;
|
|
31
|
-
/** Custom label to display inside the avatar. */
|
|
32
|
-
customLabel?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Avatar component to display user or company avatars with various customization options.
|
|
37
|
-
*/
|
|
38
|
-
export const Avatar = ({
|
|
39
|
-
type = 'person',
|
|
40
|
-
size = 'sm',
|
|
41
|
-
name = 'Avatar',
|
|
42
|
-
outline = false,
|
|
43
|
-
imageUrl,
|
|
44
|
-
imageUrlAlt,
|
|
45
|
-
customLabel,
|
|
46
|
-
className,
|
|
47
|
-
}: AvatarProps): JSX.Element => {
|
|
48
|
-
const [hasImageError, setHasImageError] = useState<boolean>(false);
|
|
49
|
-
const variant: AvatarVariant = type === 'person' ? 'circle' : 'square';
|
|
50
|
-
const color: AvatarColor = type === 'person' ? 'light' : 'dark';
|
|
51
|
-
|
|
52
|
-
const { backgroundColor, foregroundColor } = fromStringToColor(name, color);
|
|
53
|
-
const initials = (name[0] ?? '').toUpperCase();
|
|
54
|
-
const usingImageUrl = imageUrl && !hasImageError;
|
|
55
|
-
|
|
56
|
-
const inlineStyles = !usingImageUrl
|
|
57
|
-
? {
|
|
58
|
-
backgroundColor,
|
|
59
|
-
color: foregroundColor,
|
|
60
|
-
}
|
|
61
|
-
: undefined;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div
|
|
65
|
-
className={cx(styles.avatar, styles[variant], styles[size], { [styles.outline]: outline }, className)}
|
|
66
|
-
style={inlineStyles}
|
|
67
|
-
aria-hidden
|
|
68
|
-
>
|
|
69
|
-
{usingImageUrl ? (
|
|
70
|
-
<img
|
|
71
|
-
src={imageUrl}
|
|
72
|
-
className={styles.image}
|
|
73
|
-
alt={imageUrlAlt || imageUrl}
|
|
74
|
-
onError={() => {
|
|
75
|
-
setHasImageError(true);
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
) : (
|
|
79
|
-
<span>{customLabel || initials}</span>
|
|
80
|
-
)}
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { AvatarGroup } from './AvatarGroup';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Avatar/AvatarGroup',
|
|
6
|
-
component: AvatarGroup,
|
|
7
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
8
|
-
tags: ['autodocs', 'stable'],
|
|
9
|
-
parameters: {
|
|
10
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
11
|
-
// layout: 'fullscreen',
|
|
12
|
-
},
|
|
13
|
-
args: {},
|
|
14
|
-
} satisfies Meta<typeof AvatarGroup>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const People: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
defaultType: 'person',
|
|
22
|
-
items: [
|
|
23
|
-
{
|
|
24
|
-
name: 'Albert Åberg',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'Birger Meling',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Celine Dion',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Companies: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
defaultType: 'company',
|
|
39
|
-
items: [
|
|
40
|
-
{
|
|
41
|
-
name: 'Albert Åberg',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'Birger Meling',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'Celine Dion',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const CompanyAndPerson: Story = {
|
|
54
|
-
args: {
|
|
55
|
-
items: [
|
|
56
|
-
{
|
|
57
|
-
type: 'company',
|
|
58
|
-
name: 'Albert Åberg',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: 'person',
|
|
62
|
-
name: 'Birger Meling',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import cx from 'classnames';
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { Avatar, type AvatarProps, type AvatarSize, type AvatarType } from '.';
|
|
5
|
-
import styles from './avatarGroup.module.css';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Props for the AvatarGroup components.
|
|
9
|
-
*/
|
|
10
|
-
export interface AvatarGroupProps {
|
|
11
|
-
/** Array of avatars to display in the group, each specified by AvatarProps. */
|
|
12
|
-
items?: AvatarProps[];
|
|
13
|
-
/** Maximum number of avatars to show in the group. Remaining avatars are summarized in a "+X" label. */
|
|
14
|
-
maxItemsCount?: number;
|
|
15
|
-
/** Default avatar type to apply if not specified in individual items. This affects the styling. */
|
|
16
|
-
defaultType?: AvatarType;
|
|
17
|
-
/** Size of all avatars in the group (e.g., 'sm', 'md', 'lg'). */
|
|
18
|
-
size?: AvatarSize;
|
|
19
|
-
/** Additional CSS class for styling the avatar group container. */
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Avatar group component for displaying multiple avatars as a group.
|
|
25
|
-
*/
|
|
26
|
-
export const AvatarGroup = ({
|
|
27
|
-
items = [],
|
|
28
|
-
maxItemsCount = 4,
|
|
29
|
-
defaultType,
|
|
30
|
-
size = 'sm',
|
|
31
|
-
className,
|
|
32
|
-
}: AvatarGroupProps) => {
|
|
33
|
-
const maxItems = useMemo(() => items.slice(0, maxItemsCount), [items, maxItemsCount]);
|
|
34
|
-
|
|
35
|
-
if (items?.length === 0) {
|
|
36
|
-
return <div className={styles.avatarGroup} />;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<ul className={cx(styles.reset, styles.group, styles[size], className)} data-count={maxItems?.length}>
|
|
41
|
-
{maxItems.map((avatar, index) => {
|
|
42
|
-
const lastLegalAvatarReached = index === maxItemsCount - 1;
|
|
43
|
-
const customLabel = avatar.customLabel || lastLegalAvatarReached ? items.length.toString() : undefined;
|
|
44
|
-
return (
|
|
45
|
-
<li className={cx(styles.reset, styles.item)} key={avatar.name}>
|
|
46
|
-
<Avatar
|
|
47
|
-
name={avatar.name}
|
|
48
|
-
customLabel={customLabel}
|
|
49
|
-
imageUrl={avatar.imageUrl}
|
|
50
|
-
imageUrlAlt={avatar.imageUrlAlt}
|
|
51
|
-
type={avatar?.type || defaultType}
|
|
52
|
-
size={size}
|
|
53
|
-
outline
|
|
54
|
-
/>
|
|
55
|
-
</li>
|
|
56
|
-
);
|
|
57
|
-
})}
|
|
58
|
-
</ul>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
.avatar {
|
|
2
|
-
flex-grow: 0;
|
|
3
|
-
flex-shrink: 0;
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
--avatar-font-size-xs: 0.75rem;
|
|
9
|
-
--avatar-font-size-sm: 0.875rem;
|
|
10
|
-
--avatar-font-size-md: 1.125rem;
|
|
11
|
-
--avatar-font-size-lg: 1.25rem;
|
|
12
|
-
--avatar-font-size-xl: 1.5rem;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.circle {
|
|
16
|
-
border-radius: 50%;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.square {
|
|
20
|
-
border-radius: 5%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.outline {
|
|
24
|
-
outline: 1px solid #ffffff;
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.xs {
|
|
29
|
-
font-size: var(--avatar-font-size-xs);
|
|
30
|
-
width: 20px;
|
|
31
|
-
height: 20px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.sm {
|
|
35
|
-
font-size: var(--avatar-font-size-sm);
|
|
36
|
-
width: 24px;
|
|
37
|
-
height: 24px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.md {
|
|
41
|
-
font-size: var(--avatar-font-size-md);
|
|
42
|
-
width: 30px;
|
|
43
|
-
height: 30px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.lg {
|
|
47
|
-
font-size: var(--avatar-font-size-lg);
|
|
48
|
-
width: 36px;
|
|
49
|
-
height: 36px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.xl {
|
|
53
|
-
font-size: var(--avatar-font-size-xl);
|
|
54
|
-
width: 44px;
|
|
55
|
-
height: 44px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.image {
|
|
59
|
-
width: 100%;
|
|
60
|
-
height: 100%;
|
|
61
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Avatar } from './';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Avatar/Avatar',
|
|
6
|
-
component: Avatar,
|
|
7
|
-
tags: ['autodocs', 'stable'],
|
|
8
|
-
parameters: {},
|
|
9
|
-
args: {
|
|
10
|
-
name: 'Jane Doe',
|
|
11
|
-
type: 'person',
|
|
12
|
-
size: 'xl',
|
|
13
|
-
},
|
|
14
|
-
} satisfies Meta<typeof Avatar>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const Person: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
type: 'person',
|
|
22
|
-
name: 'Jane Doe',
|
|
23
|
-
size: 'xl',
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Company: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
type: 'company',
|
|
30
|
-
name: 'Boligeksperten',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Logo: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
type: 'company',
|
|
37
|
-
imageUrl: 'https://avatars.githubusercontent.com/u/1536293?s=200&v=4',
|
|
38
|
-
size: 'xl',
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
.group {
|
|
2
|
-
display: flex;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.reset {
|
|
6
|
-
margin: 0;
|
|
7
|
-
padding: 0;
|
|
8
|
-
text-indent: 0;
|
|
9
|
-
list-style-type: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.item {
|
|
13
|
-
position: relative;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.xs {
|
|
17
|
-
width: 32px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.xs[data-count="2"] * + * {
|
|
21
|
-
margin-left: -8px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.xs[data-count="3"] * + * {
|
|
25
|
-
margin-left: -14px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.xs[data-count="4"] * + * {
|
|
29
|
-
margin-left: -16px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.sm {
|
|
33
|
-
width: 42px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sm[data-count="2"] * + * {
|
|
37
|
-
margin-left: -6px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.sm[data-count="3"] * + * {
|
|
41
|
-
margin-left: -15px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.sm[data-count="4"] * + * {
|
|
45
|
-
margin-left: -18px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.md {
|
|
49
|
-
width: 54px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.md[data-count="2"] * + * {
|
|
53
|
-
margin-left: -6px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.md[data-count="3"] * + * {
|
|
57
|
-
margin-left: -18px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.md[data-count="4"] * + * {
|
|
61
|
-
margin-left: -22px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.lg {
|
|
65
|
-
width: 66px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.lg[data-count="2"] * + * {
|
|
69
|
-
margin-left: -6px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.lg[data-count="3"] * + * {
|
|
73
|
-
margin-left: -21px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.lg[data-count="4"] * + * {
|
|
77
|
-
margin-left: -26px;
|
|
78
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
type RGB = { r: number; g: number; b: number };
|
|
2
|
-
|
|
3
|
-
function generateHashCode(str: string): number {
|
|
4
|
-
return str.split('').reduce((hash, char) => {
|
|
5
|
-
return char.charCodeAt(0) + ((hash << 5) - hash);
|
|
6
|
-
}, 0);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function hashCodeToHexColor(hash: number): string {
|
|
10
|
-
return (hash & 0x00ffffff).toString(16).toUpperCase().padStart(6, '0');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function luminance(hexCode: string): number {
|
|
14
|
-
const { r, g, b } = hexToRgb(hexCode);
|
|
15
|
-
const [lR, lG, lB] = [r, g, b].map((v) => {
|
|
16
|
-
const normalized = v / 255;
|
|
17
|
-
return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
18
|
-
});
|
|
19
|
-
return lR * 0.2126 + lG * 0.7152 + lB * 0.0722;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function hexToRgb(hex: string): RGB {
|
|
23
|
-
const bigint = Number.parseInt(hex, 16);
|
|
24
|
-
return {
|
|
25
|
-
r: (bigint >> 16) & 255,
|
|
26
|
-
g: (bigint >> 8) & 255,
|
|
27
|
-
b: bigint & 255,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function rgbToHex(r: number, g: number, b: number): string {
|
|
32
|
-
return ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function adjustToDarkerColor(hexCode: string): string {
|
|
36
|
-
const { r, g, b } = hexToRgb(hexCode);
|
|
37
|
-
const rNew = Math.floor(r * 0.5);
|
|
38
|
-
const gNew = Math.floor(g * 0.5);
|
|
39
|
-
const bNew = Math.floor(b * 0.5);
|
|
40
|
-
return rgbToHex(rNew, gNew, bNew);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function adjustToLighterColor(hexCode: string): string {
|
|
44
|
-
const { r, g, b } = hexToRgb(hexCode);
|
|
45
|
-
const rNew = Math.min(255, Math.floor(r + (255 - r) * 0.5));
|
|
46
|
-
const gNew = Math.min(255, Math.floor(g + (255 - g) * 0.5));
|
|
47
|
-
const bNew = Math.min(255, Math.floor(b + (255 - b) * 0.5));
|
|
48
|
-
return rgbToHex(rNew, gNew, bNew);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function fromStringToColor(
|
|
52
|
-
name: string,
|
|
53
|
-
profile: 'light' | 'dark',
|
|
54
|
-
): { backgroundColor: string; foregroundColor: string } {
|
|
55
|
-
const hash = generateHashCode(name);
|
|
56
|
-
let hexColor = hashCodeToHexColor(hash);
|
|
57
|
-
const bgLuminance = luminance(hexColor);
|
|
58
|
-
|
|
59
|
-
if (profile === 'light' && bgLuminance <= 0.7) {
|
|
60
|
-
hexColor = adjustToLighterColor(hexColor);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (profile === 'dark' && bgLuminance > 0.1) {
|
|
64
|
-
hexColor = adjustToDarkerColor(hexColor);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
backgroundColor: `#${hexColor}`,
|
|
69
|
-
foregroundColor: profile === 'light' ? '#000000' : '#ffffff',
|
|
70
|
-
};
|
|
71
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Badge } from './Badge';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Atoms/Badge/Badge',
|
|
6
|
-
component: Badge,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {},
|
|
9
|
-
args: {
|
|
10
|
-
label: 'Badge',
|
|
11
|
-
},
|
|
12
|
-
} satisfies Meta<typeof Badge>;
|
|
13
|
-
|
|
14
|
-
export default meta;
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
|
|
17
|
-
export const Default: Story = {
|
|
18
|
-
args: {},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const Alert: Story = {
|
|
22
|
-
args: {
|
|
23
|
-
color: 'alert',
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const UnreadCount: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
label: '2',
|
|
30
|
-
color: 'alert',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import styles from './badge.module.css';
|
|
4
|
-
|
|
5
|
-
export type BadgeColor = 'subtle' | 'alert';
|
|
6
|
-
export type BadgeSize = 'sm';
|
|
7
|
-
|
|
8
|
-
export interface BadgeProps {
|
|
9
|
-
label?: string | number;
|
|
10
|
-
color?: BadgeColor;
|
|
11
|
-
size?: BadgeSize;
|
|
12
|
-
className?: string;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const Badge = ({ label, color = 'subtle', size = 'sm', className, children }: BadgeProps) => {
|
|
17
|
-
return (
|
|
18
|
-
<span className={cx(styles.badge, className)} data-color={color} data-size={size}>
|
|
19
|
-
<span className={styles.label}>{label || children}</span>
|
|
20
|
-
</span>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
.badge {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
white-space: nowrap;
|
|
6
|
-
|
|
7
|
-
font-weight: 500;
|
|
8
|
-
line-height: 1;
|
|
9
|
-
padding: 0.5em 0.5em;
|
|
10
|
-
|
|
11
|
-
min-width: 2em;
|
|
12
|
-
border-radius: 2em;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.badge[data-size="sm"] {
|
|
16
|
-
font-size: 0.75rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.badge[data-color="subtle"] {
|
|
20
|
-
background-color: var(--theme-surface-default);
|
|
21
|
-
color: var(--theme-text-subtle);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.badge[data-color="alert"] {
|
|
25
|
-
background-color: #e02e49;
|
|
26
|
-
color: white;
|
|
27
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Atoms/Button/Button',
|
|
7
|
-
component: Button,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {},
|
|
10
|
-
args: {
|
|
11
|
-
children: 'Button',
|
|
12
|
-
},
|
|
13
|
-
} satisfies Meta<typeof Button>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
|
|
18
|
-
export const Default: Story = {
|
|
19
|
-
args: {},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Solid: Story = {
|
|
23
|
-
args: {
|
|
24
|
-
variant: 'solid',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const Outline: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
variant: 'outline',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Text: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
variant: 'text',
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Loading: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
loading: true,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const Disabled: Story = {
|
|
47
|
-
args: {
|
|
48
|
-
disabled: true,
|
|
49
|
-
},
|
|
50
|
-
};
|