@altinn/altinn-components 0.6.1 → 0.6.2
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/.github/workflows/ci-cd-main.yml +47 -0
- package/.github/workflows/ci-cd-pull-request.yml +39 -0
- package/.github/workflows/workflow-deploy-storybook.yml +35 -0
- package/.node-version +1 -0
- package/.storybook/StoryDecorator.tsx +29 -0
- package/.storybook/ThemeProvider.tsx +16 -0
- package/.storybook/main.ts +20 -0
- package/.storybook/preview.tsx +63 -0
- package/.storybook/storyDecorator.module.css +20 -0
- package/.storybook/theme.module.css +3 -0
- package/CHANGELOG.md +111 -0
- package/CONTRIBUTING.MD +59 -0
- package/README.md +3 -15
- package/biome.jsonc +65 -0
- package/lib/components/Attachment/AttachmentLink.stories.ts +19 -0
- package/lib/components/Attachment/AttachmentLink.tsx +20 -0
- package/lib/components/Attachment/AttachmentList.stories.ts +39 -0
- package/lib/components/Attachment/AttachmentList.tsx +26 -0
- package/lib/components/Attachment/attachmentLink.module.css +20 -0
- package/lib/components/Attachment/attachmentList.module.css +12 -0
- package/lib/components/Avatar/Avatar.tsx +83 -0
- package/lib/components/Avatar/AvatarGroup.stories.ts +66 -0
- package/lib/components/Avatar/AvatarGroup.tsx +60 -0
- package/lib/components/Avatar/avatar.module.css +61 -0
- package/lib/components/Avatar/avatar.stories.tsx +40 -0
- package/lib/components/Avatar/avatarGroup.module.css +78 -0
- package/lib/components/Avatar/color.ts +71 -0
- package/lib/components/Badge/Badge.stories.ts +32 -0
- package/lib/components/Badge/Badge.tsx +22 -0
- package/lib/components/Badge/badge.module.css +27 -0
- package/lib/components/Bookmarks/BookmarksList.tsx +17 -0
- package/lib/components/Bookmarks/BookmarksListItem.stories.tsx +79 -0
- package/lib/components/Bookmarks/BookmarksListItem.tsx +32 -0
- package/lib/components/Bookmarks/QueryLabel.tsx +33 -0
- package/lib/components/Bookmarks/queryLabel.module.css +45 -0
- package/lib/components/Button/Button.stories.ts +50 -0
- package/lib/components/Button/Button.tsx +60 -0
- package/lib/components/Button/ButtonBase.tsx +54 -0
- package/lib/components/Button/ButtonIcon.tsx +16 -0
- package/lib/components/Button/ButtonLabel.tsx +18 -0
- package/lib/components/Button/Buttons.stories.tsx +64 -0
- package/lib/components/Button/ComboButton.stories.ts +45 -0
- package/lib/components/Button/ComboButton.tsx +46 -0
- package/lib/components/Button/IconButton.stories.tsx +47 -0
- package/lib/components/Button/IconButton.tsx +33 -0
- package/lib/components/Button/button.module.css +22 -0
- package/lib/components/Button/buttonBase.module.css +142 -0
- package/lib/components/Button/buttonIcon.module.css +17 -0
- package/lib/components/Button/buttonLabel.module.css +17 -0
- package/lib/components/Button/comboButton.module.css +35 -0
- package/lib/components/Button/iconButton.module.css +31 -0
- package/lib/components/ContextMenu/ContextMenu.stories.ts +49 -0
- package/lib/components/ContextMenu/ContextMenu.tsx +20 -0
- package/lib/components/ContextMenu/ContextMenuBase.tsx +35 -0
- package/lib/components/ContextMenu/contextMenuBase.module.css +35 -0
- package/lib/components/Datepicker/Datepicker.tsx +49 -0
- package/lib/components/Datepicker/DatepickerBase.tsx +12 -0
- package/lib/components/Datepicker/DatepickerHeader.tsx +20 -0
- package/lib/components/Datepicker/DatepickerTable.tsx +50 -0
- package/lib/components/Datepicker/datepickerBase.module.css +5 -0
- package/lib/components/Datepicker/datepickerHeader.module.css +17 -0
- package/lib/components/Datepicker/datepickerTable.module.css +37 -0
- package/lib/components/Datepicker/useDatepicker.tsx +146 -0
- package/lib/components/Dialog/Dialog.stories.ts +331 -0
- package/lib/components/Dialog/Dialog.tsx +111 -0
- package/lib/components/Dialog/DialogActions.stories.ts +60 -0
- package/lib/components/Dialog/DialogActions.tsx +80 -0
- package/lib/components/Dialog/DialogActivityLog.tsx +18 -0
- package/lib/components/Dialog/DialogArticleBase.tsx +10 -0
- package/lib/components/Dialog/DialogAttachments.stories.ts +38 -0
- package/lib/components/Dialog/DialogAttachments.tsx +25 -0
- package/lib/components/Dialog/DialogBase.tsx +10 -0
- package/lib/components/Dialog/DialogBodyBase.tsx +17 -0
- package/lib/components/Dialog/DialogBorder.tsx +19 -0
- package/lib/components/Dialog/DialogContent.stories.ts +26 -0
- package/lib/components/Dialog/DialogContent.tsx +23 -0
- package/lib/components/Dialog/DialogFooter.tsx +14 -0
- package/lib/components/Dialog/DialogGroup.tsx +24 -0
- package/lib/components/Dialog/DialogHeader.stories.ts +24 -0
- package/lib/components/Dialog/DialogHeader.tsx +23 -0
- package/lib/components/Dialog/DialogHeaderBase.tsx +10 -0
- package/lib/components/Dialog/DialogHeadings.stories.ts +35 -0
- package/lib/components/Dialog/DialogHeadings.tsx +77 -0
- package/lib/components/Dialog/DialogHistory.stories.ts +67 -0
- package/lib/components/Dialog/DialogHistory.tsx +19 -0
- package/lib/components/Dialog/DialogList.stories.ts +65 -0
- package/lib/components/Dialog/DialogList.tsx +35 -0
- package/lib/components/Dialog/DialogListItem.stories.tsx +238 -0
- package/lib/components/Dialog/DialogListItem.tsx +126 -0
- package/lib/components/Dialog/DialogListItemBase.tsx +52 -0
- package/lib/components/Dialog/DialogMetadata.stories.ts +75 -0
- package/lib/components/Dialog/DialogMetadata.tsx +56 -0
- package/lib/components/Dialog/DialogNav.stories.ts +88 -0
- package/lib/components/Dialog/DialogNav.tsx +56 -0
- package/lib/components/Dialog/DialogSectionBase.tsx +20 -0
- package/lib/components/Dialog/DialogSeenBy.stories.tsx +56 -0
- package/lib/components/Dialog/DialogSeenBy.tsx +36 -0
- package/lib/components/Dialog/DialogSelect.tsx +23 -0
- package/lib/components/Dialog/DialogStatus.stories.ts +57 -0
- package/lib/components/Dialog/DialogStatus.tsx +61 -0
- package/lib/components/Dialog/DialogTitle.stories.ts +31 -0
- package/lib/components/Dialog/DialogTitle.tsx +31 -0
- package/lib/components/Dialog/DialogTouchedBy.stories.tsx +27 -0
- package/lib/components/Dialog/DialogTouchedBy.tsx +19 -0
- package/lib/components/Dialog/dialog.module.css +21 -0
- package/lib/components/Dialog/dialogAction.module.css +26 -0
- package/lib/components/Dialog/dialogArticleBase.module.css +5 -0
- package/lib/components/Dialog/dialogBodyBase.module.css +13 -0
- package/lib/components/Dialog/dialogBorder.module.css +42 -0
- package/lib/components/Dialog/dialogGroup.module.css +35 -0
- package/lib/components/Dialog/dialogHeaderBase.module.css +6 -0
- package/lib/components/Dialog/dialogHeadings.module.css +24 -0
- package/lib/components/Dialog/dialogHistory.module.css +12 -0
- package/lib/components/Dialog/dialogListItem.module.css +81 -0
- package/lib/components/Dialog/dialogListItemBase.module.css +28 -0
- package/lib/components/Dialog/dialogNav.module.css +12 -0
- package/lib/components/Dialog/dialogSectionBase.module.css +11 -0
- package/lib/components/Dialog/dialogSelect.module.css +34 -0
- package/lib/components/Dialog/dialogTitle.module.css +47 -0
- package/lib/components/Dropdown/Backdrop.tsx +12 -0
- package/lib/components/Dropdown/DrawerBase.tsx +20 -0
- package/lib/components/Dropdown/DrawerBody.tsx +12 -0
- package/lib/components/Dropdown/DrawerButton.tsx +17 -0
- package/lib/components/Dropdown/DrawerFooter.tsx +12 -0
- package/lib/components/Dropdown/DrawerHeader.tsx +19 -0
- package/lib/components/Dropdown/DrawerOrDropdown.tsx +29 -0
- package/lib/components/Dropdown/DropdownBase.tsx +32 -0
- package/lib/components/Dropdown/backdrop.module.css +11 -0
- package/lib/components/Dropdown/drawerBase.module.css +17 -0
- package/lib/components/Dropdown/drawerBody.module.css +5 -0
- package/lib/components/Dropdown/drawerButton.module.css +6 -0
- package/lib/components/Dropdown/drawerFooter.module.css +13 -0
- package/lib/components/Dropdown/drawerHeader.module.css +17 -0
- package/lib/components/Dropdown/drawerOrDropdown.module.css +19 -0
- package/lib/components/Dropdown/dropdownBase.module.css +35 -0
- package/{dist/components/Dropdown/index.d.ts → lib/components/Dropdown/index.ts} +1 -0
- package/lib/components/Footer/Footer.stories.ts +37 -0
- package/lib/components/Footer/Footer.tsx +21 -0
- package/lib/components/Footer/FooterAddress.tsx +12 -0
- package/lib/components/Footer/FooterBase.tsx +16 -0
- package/lib/components/Footer/FooterLogo.tsx +17 -0
- package/lib/components/Footer/FooterMenu.tsx +43 -0
- package/lib/components/Footer/footerAddress.module.css +8 -0
- package/lib/components/Footer/footerBase.module.css +28 -0
- package/lib/components/Footer/footerLogo.module.css +12 -0
- package/lib/components/Footer/footerMenu.module.css +35 -0
- package/lib/components/GlobalMenu/AccountButton.tsx +46 -0
- package/lib/components/GlobalMenu/AccountMenu.stories.tsx +65 -0
- package/lib/components/GlobalMenu/AccountMenu.tsx +82 -0
- package/lib/components/GlobalMenu/BackButton.tsx +10 -0
- package/lib/components/GlobalMenu/GlobalMenu.stories.tsx +181 -0
- package/lib/components/GlobalMenu/GlobalMenu.tsx +86 -0
- package/lib/components/GlobalMenu/GlobalMenuBase.tsx +22 -0
- package/lib/components/GlobalMenu/LogoutButton.tsx +19 -0
- package/lib/components/GlobalMenu/globalMenuBase.module.css +39 -0
- package/lib/components/GlobalMenu/logoutButton.module.css +9 -0
- package/lib/components/Header/DigdirLogomark.tsx +23 -0
- package/lib/components/Header/Header.stories.tsx +188 -0
- package/lib/components/Header/Header.tsx +71 -0
- package/lib/components/Header/HeaderBase.tsx +21 -0
- package/lib/components/Header/HeaderButton.stories.ts +70 -0
- package/lib/components/Header/HeaderButton.tsx +68 -0
- package/lib/components/Header/HeaderLogo.stories.ts +17 -0
- package/lib/components/Header/HeaderLogo.tsx +22 -0
- package/lib/components/Header/HeaderMenu.tsx +17 -0
- package/lib/components/Header/HeaderSearch.tsx +17 -0
- package/lib/components/Header/header.module.css +24 -0
- package/lib/components/Header/headerBase.module.css +51 -0
- package/lib/components/Header/headerButton.module.css +37 -0
- package/lib/components/Header/headerLogo.module.css +24 -0
- package/lib/components/Header/headerMenu.module.css +3 -0
- package/lib/components/Header/headerSearch.module.css +21 -0
- package/lib/components/Header/mobileMenu.module.css +28 -0
- package/lib/components/History/HistoryAttachments.tsx +22 -0
- package/lib/components/History/HistoryBorder.tsx +17 -0
- package/lib/components/History/HistoryItem.stories.ts +56 -0
- package/lib/components/History/HistoryItem.tsx +56 -0
- package/lib/components/History/HistoryList.stories.ts +72 -0
- package/lib/components/History/HistoryList.tsx +26 -0
- package/lib/components/History/historyBorder.module.css +8 -0
- package/lib/components/History/historyItem.module.css +19 -0
- package/lib/components/History/historyList.module.css +12 -0
- package/lib/components/Icon/CheckboxCheckedIcon.tsx +28 -0
- package/lib/components/Icon/CheckboxIcon.stories.ts +32 -0
- package/lib/components/Icon/CheckboxIcon.tsx +17 -0
- package/lib/components/Icon/CheckboxUncheckedIcon.tsx +38 -0
- package/lib/components/Icon/Icon.stories.ts +24 -0
- package/lib/components/Icon/Icon.tsx +23 -0
- package/lib/components/Icon/ProgressIcon.stories.ts +43 -0
- package/lib/components/Icon/ProgressIcon.tsx +44 -0
- package/lib/components/Icon/RadioCheckedIcon.tsx +29 -0
- package/lib/components/Icon/RadioIcon.stories.ts +32 -0
- package/lib/components/Icon/RadioIcon.tsx +17 -0
- package/lib/components/Icon/RadioUncheckedIcon.tsx +30 -0
- package/lib/components/Icon/SvgIcon.tsx +18 -0
- package/lib/components/Icon/__AkselIcon.tsx +37 -0
- package/lib/components/Icon/checkboxIcon.module.css +23 -0
- package/lib/components/Icon/icon.module.css +4 -0
- package/lib/components/Icon/iconsMap.tsx +2078 -0
- package/lib/components/Icon/progressIcon.module.css +29 -0
- package/lib/components/Icon/radioIcon.module.css +21 -0
- package/lib/components/Layout/Layout.stories.tsx +308 -0
- package/lib/components/Layout/Layout.tsx +46 -0
- package/lib/components/Layout/LayoutBase.stories.ts +17 -0
- package/lib/components/Layout/LayoutBase.tsx +31 -0
- package/lib/components/Layout/LayoutBody.stories.ts +17 -0
- package/lib/components/Layout/LayoutBody.tsx +16 -0
- package/lib/components/Layout/LayoutContent.stories.ts +17 -0
- package/lib/components/Layout/LayoutContent.tsx +15 -0
- package/lib/components/Layout/LayoutSidebar.stories.ts +17 -0
- package/lib/components/Layout/LayoutSidebar.tsx +23 -0
- package/lib/components/Layout/layoutBase.module.css +22 -0
- package/lib/components/Layout/layoutBody.module.css +15 -0
- package/lib/components/Layout/layoutContent.module.css +13 -0
- package/lib/components/Layout/layoutSidebar.module.css +20 -0
- package/lib/components/LayoutAction/ActionFooter.stories.tsx +70 -0
- package/lib/components/LayoutAction/ActionFooter.tsx +15 -0
- package/lib/components/LayoutAction/ActionHeader.stories.ts +20 -0
- package/lib/components/LayoutAction/ActionHeader.tsx +19 -0
- package/lib/components/LayoutAction/ActionMenu.stories.tsx +40 -0
- package/lib/components/LayoutAction/ActionMenu.tsx +23 -0
- package/lib/components/LayoutAction/actionFooter.module.css +28 -0
- package/lib/components/LayoutAction/actionHeader.module.css +55 -0
- package/lib/components/LayoutAction/actionMenu.module.css +30 -0
- package/lib/components/List/List.stories.tsx +43 -0
- package/lib/components/List/List.tsx +20 -0
- package/lib/components/List/ListBase.tsx +19 -0
- package/lib/components/List/ListItem.stories.tsx +208 -0
- package/lib/components/List/ListItem.tsx +73 -0
- package/lib/components/List/ListItemBase.tsx +82 -0
- package/lib/components/List/ListItemLabel.tsx +29 -0
- package/lib/components/List/ListItemMedia.tsx +59 -0
- package/lib/components/List/listBase.module.css +30 -0
- package/lib/components/List/listItemBase.module.css +97 -0
- package/lib/components/List/listItemLabel.module.css +55 -0
- package/lib/components/List/listItemMedia.module.css +41 -0
- package/lib/components/Menu/Menu.stories.ts +514 -0
- package/lib/components/Menu/Menu.tsx +24 -0
- package/lib/components/Menu/MenuBase.tsx +63 -0
- package/lib/components/Menu/MenuHeader.tsx +13 -0
- package/lib/components/Menu/MenuInputField.tsx +38 -0
- package/lib/components/Menu/MenuItem.stories.tsx +164 -0
- package/lib/components/Menu/MenuItem.tsx +63 -0
- package/lib/components/Menu/MenuItemBase.tsx +77 -0
- package/lib/components/Menu/MenuItemLabel.tsx +30 -0
- package/lib/components/Menu/MenuItemMedia.tsx +42 -0
- package/lib/components/Menu/MenuItems.stories.ts +438 -0
- package/lib/components/Menu/MenuItems.tsx +96 -0
- package/lib/components/Menu/MenuOption.stories.ts +52 -0
- package/lib/components/Menu/MenuOption.tsx +48 -0
- package/lib/components/Menu/MenuSearch.stories.ts +18 -0
- package/lib/components/Menu/MenuSearch.tsx +25 -0
- package/lib/components/Menu/menu.module.css +25 -0
- package/lib/components/Menu/menuBase.module.css +25 -0
- package/lib/components/Menu/menuHeader.module.css +12 -0
- package/lib/components/Menu/menuInputField.module.css +54 -0
- package/lib/components/Menu/menuItemBase.module.css +79 -0
- package/lib/components/Menu/menuItemLabel.module.css +32 -0
- package/lib/components/Menu/menuItemMedia.module.css +38 -0
- package/lib/components/Menu/menuOption.module.css +27 -0
- package/lib/components/Menu/menuSearch.module.css +30 -0
- package/lib/components/Meta/MetaBase.tsx +15 -0
- package/lib/components/Meta/MetaItem.stories.ts +25 -0
- package/lib/components/Meta/MetaItem.tsx +31 -0
- package/lib/components/Meta/MetaItemBase.tsx +46 -0
- package/lib/components/Meta/MetaItemLabel.tsx +20 -0
- package/lib/components/Meta/MetaItemMedia.tsx +22 -0
- package/lib/components/Meta/MetaList.stories.ts +29 -0
- package/lib/components/Meta/MetaList.tsx +43 -0
- package/lib/components/Meta/MetaProgress.stories.ts +29 -0
- package/lib/components/Meta/MetaProgress.tsx +26 -0
- package/lib/components/Meta/MetaTimestamp.stories.ts +33 -0
- package/lib/components/Meta/MetaTimestamp.tsx +29 -0
- package/lib/components/Meta/meta.module.css +6 -0
- package/lib/components/Meta/metaItem.module.css +107 -0
- package/lib/components/Meta/metaList.module.css +15 -0
- package/lib/components/Page/PageBase.tsx +14 -0
- package/lib/components/Page/PageHeader.tsx +25 -0
- package/lib/components/Page/PageHeaderMedia.tsx +25 -0
- package/lib/components/Page/PageNav.tsx +34 -0
- package/lib/components/Page/SectionBase.tsx +52 -0
- package/lib/components/Page/SectionFooter.tsx +15 -0
- package/lib/components/Page/SectionHeader.tsx +16 -0
- package/lib/components/Page/pageHeader.module.css +18 -0
- package/lib/components/Page/pageNav.module.css +12 -0
- package/lib/components/Page/sectionBase.module.css +92 -0
- package/lib/components/Page/sectionFooter.module.css +8 -0
- package/lib/components/Page/sectionHeader.module.css +9 -0
- package/lib/components/RootProvider/RootProvider.tsx +56 -0
- package/lib/components/Searchbar/Autocomplete.stories.tsx +77 -0
- package/lib/components/Searchbar/Autocomplete.tsx +44 -0
- package/lib/components/Searchbar/AutocompleteBase.tsx +16 -0
- package/lib/components/Searchbar/AutocompleteGroup.tsx +17 -0
- package/lib/components/Searchbar/AutocompleteItem.tsx +23 -0
- package/lib/components/Searchbar/SearchField.tsx +81 -0
- package/lib/components/Searchbar/Searchbar.stories.tsx +151 -0
- package/lib/components/Searchbar/Searchbar.tsx +26 -0
- package/lib/components/Searchbar/SearchbarBase.tsx +23 -0
- package/lib/components/Searchbar/autocompleteBase.module.css +17 -0
- package/lib/components/Searchbar/autocompleteGroup.module.css +3 -0
- package/lib/components/Searchbar/autocompleteItem.module.css +19 -0
- package/lib/components/Searchbar/searchField.module.css +54 -0
- package/lib/components/Searchbar/searchbarBase.module.css +20 -0
- package/lib/components/Snackbar/Snackbar.stories.tsx +21 -0
- package/lib/components/Snackbar/Snackbar.tsx +32 -0
- package/lib/components/Snackbar/SnackbarBase.tsx +39 -0
- package/lib/components/Snackbar/SnackbarLabel.tsx +10 -0
- package/lib/components/Snackbar/SnackbarMedia.tsx +14 -0
- package/lib/components/Snackbar/snackbarBase.module.css +55 -0
- package/lib/components/Snackbar/snackbarLabel.module.css +6 -0
- package/lib/components/Snackbar/snackbarMedia.module.css +10 -0
- package/lib/components/Toolbar/Toolbar.stories.tsx +188 -0
- package/lib/components/Toolbar/Toolbar.tsx +159 -0
- package/lib/components/Toolbar/ToolbarAdd.stories.ts +23 -0
- package/lib/components/Toolbar/ToolbarAdd.tsx +26 -0
- package/lib/components/Toolbar/ToolbarBase.tsx +12 -0
- package/lib/components/Toolbar/ToolbarButton.stories.ts +32 -0
- package/lib/components/Toolbar/ToolbarButton.tsx +65 -0
- package/lib/components/Toolbar/ToolbarDate.stories.ts +62 -0
- package/lib/components/Toolbar/ToolbarDaterange.stories.ts +24 -0
- package/lib/components/Toolbar/ToolbarDaterange.tsx +73 -0
- package/lib/components/Toolbar/ToolbarFilter.stories.ts +64 -0
- package/lib/components/Toolbar/ToolbarFilter.tsx +82 -0
- package/lib/components/Toolbar/ToolbarFilterBase.tsx +15 -0
- package/lib/components/Toolbar/ToolbarMenu.stories.ts +37 -0
- package/lib/components/Toolbar/ToolbarMenu.tsx +29 -0
- package/lib/components/Toolbar/ToolbarOptions.stories.ts +108 -0
- package/lib/components/Toolbar/ToolbarOptions.tsx +74 -0
- package/lib/components/Toolbar/ToolbarSearch.stories.ts +19 -0
- package/lib/components/Toolbar/ToolbarSearch.tsx +24 -0
- package/lib/components/Toolbar/toolbarBase.module.css +19 -0
- package/lib/components/Toolbar/toolbarButton.module.css +3 -0
- package/lib/components/Toolbar/toolbarDaterange.module.css +12 -0
- package/lib/components/Toolbar/toolbarFilterBase.module.css +7 -0
- package/lib/components/Toolbar/toolbarMenu.module.css +7 -0
- package/lib/components/Toolbar/toolbarSearch.module.css +28 -0
- package/lib/components/Typography/Heading.tsx +23 -0
- package/lib/components/Typography/Typography.tsx +24 -0
- package/lib/components/Typography/heading.module.css +21 -0
- package/lib/components/Typography/typography.module.css +64 -0
- package/lib/css/colors.css +113 -0
- package/lib/css/global.css +16 -0
- package/lib/css/shadows.css +7 -0
- package/lib/css/theme-article.css +15 -0
- package/lib/css/theme-company.css +15 -0
- package/lib/css/theme-global-dark.css +19 -0
- package/lib/css/theme-global.css +15 -0
- package/lib/css/theme-neutral.css +15 -0
- package/lib/css/theme-person.css +15 -0
- package/lib/css/theme.css +22 -0
- package/lib/hooks/useClickOutside.ts +22 -0
- package/lib/hooks/useEscapeKey.ts +17 -0
- package/lib/hooks/useMenu.tsx +81 -0
- package/lib/stories/Color/MenuItem.stories.tsx +43 -0
- package/lib/stories/Color/Swatches.stories.tsx +19 -0
- package/lib/stories/Color/Swatches.tsx +42 -0
- package/lib/stories/Color/colors.json +62 -0
- package/lib/stories/Color/swatches.module.css +14 -0
- package/lib/stories/Inbox/BookmarksPage.tsx +78 -0
- package/lib/stories/Inbox/DialogPage.tsx +15 -0
- package/lib/stories/Inbox/Inbox.stories.tsx +55 -0
- package/lib/stories/Inbox/Inbox.tsx +12 -0
- package/lib/stories/Inbox/InboxLayout.tsx +51 -0
- package/lib/stories/Inbox/InboxPage.tsx +51 -0
- package/lib/stories/Inbox/InboxProvider.tsx +136 -0
- package/lib/stories/Inbox/InboxSection.tsx +39 -0
- package/lib/stories/Inbox/InboxToolbar.tsx +94 -0
- package/lib/stories/Inbox/ProfilePage.tsx +36 -0
- package/lib/stories/Inbox/SettingsPage.tsx +19 -0
- package/lib/stories/Inbox/accounts/accounts.ts +24 -0
- package/lib/stories/Inbox/accounts/index.ts +1 -0
- package/lib/stories/Inbox/actionMenu.ts +24 -0
- package/lib/stories/Inbox/dialogs/brreg-completed.json +35 -0
- package/lib/stories/Inbox/dialogs/brreg-draft.json +41 -0
- package/lib/stories/Inbox/dialogs/enova-in-progress.json +35 -0
- package/lib/stories/Inbox/dialogs/index.ts +53 -0
- package/lib/stories/Inbox/dialogs/skatt-2023.json +33 -0
- package/lib/stories/Inbox/dialogs/sykmelding-referat.json +41 -0
- package/lib/stories/Inbox/groupBy.ts +19 -0
- package/lib/stories/Inbox/inboxSection.module.css +19 -0
- package/lib/stories/Inbox/index.ts +15 -0
- package/lib/stories/Inbox/layout/footer.ts +27 -0
- package/lib/stories/Inbox/layout/header.ts +11 -0
- package/lib/stories/Inbox/layout/index.ts +3 -0
- package/lib/stories/Inbox/layout/menu.ts +64 -0
- package/package.json +19 -27
- package/renovate.json +4 -0
- package/tsconfig.json +28 -0
- package/tsconfig.node.json +11 -0
- package/typings.d.ts +1 -0
- package/vite.config.ts +20 -0
- package/dist/components/Attachment/AttachmentLink.d.ts +0 -10
- package/dist/components/Attachment/AttachmentList.d.ts +0 -7
- package/dist/components/Avatar/Avatar.d.ts +0 -27
- package/dist/components/Avatar/AvatarGroup.d.ts +0 -20
- package/dist/components/Avatar/color.d.ts +0 -4
- package/dist/components/Badge/Badge.d.ts +0 -11
- package/dist/components/Bookmarks/BookmarksList.d.ts +0 -7
- package/dist/components/Bookmarks/BookmarksListItem.d.ts +0 -21
- package/dist/components/Bookmarks/QueryLabel.d.ts +0 -11
- package/dist/components/Button/Button.d.ts +0 -8
- package/dist/components/Button/ButtonBase.d.ts +0 -20
- package/dist/components/Button/ButtonIcon.d.ts +0 -7
- package/dist/components/Button/ButtonLabel.d.ts +0 -8
- package/dist/components/Button/ComboButton.d.ts +0 -10
- package/dist/components/Button/IconButton.d.ts +0 -14
- package/dist/components/ContextMenu/ContextMenu.d.ts +0 -8
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +0 -9
- package/dist/components/Dialog/Dialog.d.ts +0 -54
- package/dist/components/Dialog/DialogActions.d.ts +0 -16
- package/dist/components/Dialog/DialogActivityLog.d.ts +0 -10
- package/dist/components/Dialog/DialogArticleBase.d.ts +0 -6
- package/dist/components/Dialog/DialogAttachments.d.ts +0 -6
- package/dist/components/Dialog/DialogBase.d.ts +0 -5
- package/dist/components/Dialog/DialogBodyBase.d.ts +0 -5
- package/dist/components/Dialog/DialogBorder.d.ts +0 -9
- package/dist/components/Dialog/DialogContent.d.ts +0 -9
- package/dist/components/Dialog/DialogFooter.d.ts +0 -4
- package/dist/components/Dialog/DialogGroup.d.ts +0 -6
- package/dist/components/Dialog/DialogHeader.d.ts +0 -10
- package/dist/components/Dialog/DialogHeaderBase.d.ts +0 -5
- package/dist/components/Dialog/DialogHeadings.d.ts +0 -24
- package/dist/components/Dialog/DialogHistory.d.ts +0 -6
- package/dist/components/Dialog/DialogList.d.ts +0 -7
- package/dist/components/Dialog/DialogListItem.d.ts +0 -59
- package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
- package/dist/components/Dialog/DialogMetadata.d.ts +0 -22
- package/dist/components/Dialog/DialogNav.d.ts +0 -21
- package/dist/components/Dialog/DialogSectionBase.d.ts +0 -6
- package/dist/components/Dialog/DialogSeenBy.d.ts +0 -19
- package/dist/components/Dialog/DialogSelect.d.ts +0 -10
- package/dist/components/Dialog/DialogStatus.d.ts +0 -25
- package/dist/components/Dialog/DialogTitle.d.ts +0 -20
- package/dist/components/Dialog/DialogTouchedBy.d.ts +0 -10
- package/dist/components/Dropdown/Backdrop.d.ts +0 -6
- package/dist/components/Dropdown/DrawerBase.d.ts +0 -9
- package/dist/components/Dropdown/DrawerBody.d.ts +0 -6
- package/dist/components/Dropdown/DrawerButton.d.ts +0 -7
- package/dist/components/Dropdown/DrawerFooter.d.ts +0 -6
- package/dist/components/Dropdown/DrawerHeader.d.ts +0 -7
- package/dist/components/Dropdown/DrawerOrDropdown.d.ts +0 -10
- package/dist/components/Dropdown/DropdownBase.d.ts +0 -10
- package/dist/components/Footer/Footer.d.ts +0 -6
- package/dist/components/Footer/FooterAddress.d.ts +0 -6
- package/dist/components/Footer/FooterBase.d.ts +0 -6
- package/dist/components/Footer/FooterLogo.d.ts +0 -5
- package/dist/components/Footer/FooterMenu.d.ts +0 -14
- package/dist/components/GlobalMenu/AccountButton.d.ts +0 -14
- package/dist/components/GlobalMenu/AccountMenu.d.ts +0 -20
- package/dist/components/GlobalMenu/BackButton.d.ts +0 -5
- package/dist/components/GlobalMenu/GlobalMenu.d.ts +0 -16
- package/dist/components/GlobalMenu/GlobalMenuBase.d.ts +0 -7
- package/dist/components/GlobalMenu/LogoutButton.d.ts +0 -7
- package/dist/components/Header/DigdirLogomark.d.ts +0 -5
- package/dist/components/Header/Header.d.ts +0 -9
- package/dist/components/Header/HeaderBase.d.ts +0 -9
- package/dist/components/Header/HeaderButton.d.ts +0 -15
- package/dist/components/Header/HeaderLogo.d.ts +0 -9
- package/dist/components/Header/HeaderMenu.d.ts +0 -7
- package/dist/components/Header/HeaderSearch.d.ts +0 -7
- package/dist/components/History/HistoryAttachments.d.ts +0 -6
- package/dist/components/History/HistoryBorder.d.ts +0 -7
- package/dist/components/History/HistoryItem.d.ts +0 -14
- package/dist/components/History/HistoryList.d.ts +0 -6
- package/dist/components/Icon/CheckboxCheckedIcon.d.ts +0 -8
- package/dist/components/Icon/CheckboxIcon.d.ts +0 -10
- package/dist/components/Icon/CheckboxUncheckedIcon.d.ts +0 -9
- package/dist/components/Icon/Icon.d.ts +0 -9
- package/dist/components/Icon/ProgressIcon.d.ts +0 -6
- package/dist/components/Icon/RadioCheckedIcon.d.ts +0 -8
- package/dist/components/Icon/RadioIcon.d.ts +0 -10
- package/dist/components/Icon/RadioUncheckedIcon.d.ts +0 -9
- package/dist/components/Icon/SvgIcon.d.ts +0 -9
- package/dist/components/Icon/iconsMap.d.ts +0 -1911
- package/dist/components/Layout/Layout.d.ts +0 -24
- package/dist/components/Layout/LayoutBase.d.ts +0 -21
- package/dist/components/Layout/LayoutBody.d.ts +0 -7
- package/dist/components/Layout/LayoutContent.d.ts +0 -7
- package/dist/components/Layout/LayoutSidebar.d.ts +0 -13
- package/dist/components/LayoutAction/ActionFooter.d.ts +0 -6
- package/dist/components/LayoutAction/ActionHeader.d.ts +0 -7
- package/dist/components/LayoutAction/ActionMenu.d.ts +0 -6
- package/dist/components/List/List.d.ts +0 -10
- package/dist/components/List/ListBase.d.ts +0 -9
- package/dist/components/List/ListItem.d.ts +0 -46
- package/dist/components/List/ListItemBase.d.ts +0 -27
- package/dist/components/List/ListItemLabel.d.ts +0 -9
- package/dist/components/List/ListItemMedia.d.ts +0 -14
- package/dist/components/Menu/Menu.d.ts +0 -8
- package/dist/components/Menu/MenuBase.d.ts +0 -27
- package/dist/components/Menu/MenuHeader.d.ts +0 -4
- package/dist/components/Menu/MenuInputField.d.ts +0 -12
- package/dist/components/Menu/MenuItem.d.ts +0 -35
- package/dist/components/Menu/MenuItemBase.d.ts +0 -23
- package/dist/components/Menu/MenuItemLabel.d.ts +0 -10
- package/dist/components/Menu/MenuItemMedia.d.ts +0 -14
- package/dist/components/Menu/MenuItems.d.ts +0 -17
- package/dist/components/Menu/MenuOption.d.ts +0 -19
- package/dist/components/Menu/MenuSearch.d.ts +0 -8
- package/dist/components/Meta/MetaBase.d.ts +0 -7
- package/dist/components/Meta/MetaItem.d.ts +0 -18
- package/dist/components/Meta/MetaItemBase.d.ts +0 -15
- package/dist/components/Meta/MetaItemLabel.d.ts +0 -11
- package/dist/components/Meta/MetaItemMedia.d.ts +0 -9
- package/dist/components/Meta/MetaList.d.ts +0 -12
- package/dist/components/Meta/MetaProgress.d.ts +0 -13
- package/dist/components/Meta/MetaTimestamp.d.ts +0 -16
- package/dist/components/Page/PageBase.d.ts +0 -6
- package/dist/components/Page/PageHeader.d.ts +0 -7
- package/dist/components/Page/PageHeaderMedia.d.ts +0 -10
- package/dist/components/Page/PageNav.d.ts +0 -14
- package/dist/components/Page/SectionBase.d.ts +0 -19
- package/dist/components/Page/SectionFooter.d.ts +0 -6
- package/dist/components/Page/SectionHeader.d.ts +0 -7
- package/dist/components/RootProvider/RootProvider.d.ts +0 -19
- package/dist/components/Searchbar/Autocomplete.d.ts +0 -9
- package/dist/components/Searchbar/AutocompleteBase.d.ts +0 -7
- package/dist/components/Searchbar/AutocompleteGroup.d.ts +0 -6
- package/dist/components/Searchbar/AutocompleteItem.d.ts +0 -13
- package/dist/components/Searchbar/SearchField.d.ts +0 -16
- package/dist/components/Searchbar/Searchbar.d.ts +0 -9
- package/dist/components/Searchbar/SearchbarBase.d.ts +0 -8
- package/dist/components/Snackbar/Snackbar.d.ts +0 -21
- package/dist/components/Snackbar/SnackbarBase.d.ts +0 -13
- package/dist/components/Snackbar/SnackbarLabel.d.ts +0 -5
- package/dist/components/Snackbar/SnackbarMedia.d.ts +0 -6
- package/dist/components/Toolbar/Toolbar.d.ts +0 -15
- package/dist/components/Toolbar/ToolbarAdd.d.ts +0 -10
- package/dist/components/Toolbar/ToolbarBase.d.ts +0 -7
- package/dist/components/Toolbar/ToolbarButton.d.ts +0 -14
- package/dist/components/Toolbar/ToolbarFilter.d.ts +0 -23
- package/dist/components/Toolbar/ToolbarFilterBase.d.ts +0 -6
- package/dist/components/Toolbar/ToolbarMenu.d.ts +0 -13
- package/dist/components/Toolbar/ToolbarOptions.d.ts +0 -18
- package/dist/components/Toolbar/ToolbarSearch.d.ts +0 -8
- package/dist/components/Typography/Heading.d.ts +0 -10
- package/dist/components/Typography/Typography.d.ts +0 -11
- package/dist/hooks/useClickOutside.d.ts +0 -2
- package/dist/hooks/useEscapeKey.d.ts +0 -1
- package/dist/hooks/useMenu.d.ts +0 -21
- package/dist/index.css +0 -1
- package/dist/index.es.js +0 -3340
- /package/{dist/components/Attachment/index.d.ts → lib/components/Attachment/index.ts} +0 -0
- /package/{dist/components/Avatar/index.d.ts → lib/components/Avatar/index.ts} +0 -0
- /package/{dist/components/Badge/index.d.ts → lib/components/Badge/index.tsx} +0 -0
- /package/{dist/components/Bookmarks/index.d.ts → lib/components/Bookmarks/index.ts} +0 -0
- /package/{dist/components/Button/index.d.ts → lib/components/Button/index.ts} +0 -0
- /package/{dist/components/ContextMenu/index.d.ts → lib/components/ContextMenu/index.ts} +0 -0
- /package/{dist/components/Datepicker/index.d.ts → lib/components/Datepicker/index.ts} +0 -0
- /package/{dist/components/Dialog/index.d.ts → lib/components/Dialog/index.ts} +0 -0
- /package/{dist/components/Footer/index.d.ts → lib/components/Footer/index.ts} +0 -0
- /package/{dist/components/GlobalMenu/index.d.ts → lib/components/GlobalMenu/index.tsx} +0 -0
- /package/{dist/components/Header/index.d.ts → lib/components/Header/index.tsx} +0 -0
- /package/{dist/components/History/index.d.ts → lib/components/History/index.ts} +0 -0
- /package/{dist/components/Icon/index.d.ts → lib/components/Icon/index.ts} +0 -0
- /package/{dist/components/Layout/index.d.ts → lib/components/Layout/index.tsx} +0 -0
- /package/{dist/components/LayoutAction/index.d.ts → lib/components/LayoutAction/index.ts} +0 -0
- /package/{dist/components/List/index.d.ts → lib/components/List/index.ts} +0 -0
- /package/{dist/components/Menu/index.d.ts → lib/components/Menu/index.ts} +0 -0
- /package/{dist/components/Meta/index.d.ts → lib/components/Meta/index.ts} +0 -0
- /package/{dist/components/Page/index.d.ts → lib/components/Page/index.ts} +0 -0
- /package/{dist/components/RootProvider/index.d.ts → lib/components/RootProvider/index.ts} +0 -0
- /package/{dist/components/Searchbar/index.d.ts → lib/components/Searchbar/index.ts} +0 -0
- /package/{dist/components/Snackbar/index.d.ts → lib/components/Snackbar/index.ts} +0 -0
- /package/{dist/components/Toolbar/index.d.ts → lib/components/Toolbar/index.ts} +0 -0
- /package/{dist/components/Typography/index.d.ts → lib/components/Typography/index.ts} +0 -0
- /package/{dist/components/index.d.ts → lib/components/index.ts} +0 -0
- /package/{dist/hooks/index.d.ts → lib/hooks/index.ts} +0 -0
- /package/{dist/index.d.ts → lib/index.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: CI/CD Main
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
deploy-documentation:
|
|
15
|
+
uses: ./.github/workflows/workflow-deploy-storybook.yml
|
|
16
|
+
release-please:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: googleapis/release-please-action@v4
|
|
20
|
+
id: release
|
|
21
|
+
env:
|
|
22
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
23
|
+
with:
|
|
24
|
+
release-type: node
|
|
25
|
+
# The logic below handles the npm publication:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
# these if statements ensure that a publication only occurs when
|
|
28
|
+
# a new release is created:
|
|
29
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
30
|
+
- uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version-file: .node-version
|
|
33
|
+
registry-url: 'https://registry.npmjs.org'
|
|
34
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
35
|
+
- name: Setup PNPM
|
|
36
|
+
uses: pnpm/action-setup@v2
|
|
37
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
38
|
+
with:
|
|
39
|
+
version: '9.12.3'
|
|
40
|
+
- run: pnpm install --frozen-lockfile
|
|
41
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
42
|
+
- run: pnpm build
|
|
43
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
44
|
+
- run: pnpm publish
|
|
45
|
+
env:
|
|
46
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
47
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: CI/CD Pull Request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
types: [opened, synchronize, reopened]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Setup Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version-file: .node-version
|
|
20
|
+
|
|
21
|
+
- name: Setup PNPM
|
|
22
|
+
uses: pnpm/action-setup@v2
|
|
23
|
+
with:
|
|
24
|
+
version: '9.12.3'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: pnpm install --frozen-lockfile
|
|
28
|
+
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: pnpm biome check ./lib
|
|
31
|
+
|
|
32
|
+
- name: Type check
|
|
33
|
+
run: pnpm typecheck
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
run: pnpm build
|
|
37
|
+
|
|
38
|
+
- name: Build Storybook
|
|
39
|
+
run: pnpm build-storybook
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Deploy Storybook to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
workflow_call:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
pages: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: "pages"
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
deploy:
|
|
18
|
+
environment:
|
|
19
|
+
name: github-pages
|
|
20
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
- name: Setup PNPM
|
|
26
|
+
uses: pnpm/action-setup@v2
|
|
27
|
+
- run: pnpm install --frozen-lockfile
|
|
28
|
+
- run: pnpm build-storybook
|
|
29
|
+
- name: Upload artifact
|
|
30
|
+
uses: actions/upload-pages-artifact@v3
|
|
31
|
+
with:
|
|
32
|
+
path: "./storybook-static"
|
|
33
|
+
- name: Deploy to GitHub Pages
|
|
34
|
+
id: deployment
|
|
35
|
+
uses: actions/deploy-pages@v4
|
package/.node-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20.15.1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {ReactNode} from "react";
|
|
2
|
+
import styles from "./storyDecorator.module.css";
|
|
3
|
+
import {RootProvider} from "../lib/components/RootProvider/";
|
|
4
|
+
|
|
5
|
+
interface StoryDecoratorProps {
|
|
6
|
+
tags: string[];
|
|
7
|
+
theme: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const StoryDecorator = ({
|
|
12
|
+
tags,
|
|
13
|
+
theme,
|
|
14
|
+
children,
|
|
15
|
+
}: StoryDecoratorProps) => {
|
|
16
|
+
const isStable = (tags || []).includes("stable");
|
|
17
|
+
const state = isStable ? "stable" : "experimental";
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<RootProvider>
|
|
21
|
+
<div className={styles.preview} data-theme={theme}>
|
|
22
|
+
<div id="story-in-story-decorator-root" className={styles.component}>{children}</div>
|
|
23
|
+
<span className={styles.tag} data-tag={state}>
|
|
24
|
+
{state}
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
</RootProvider>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import styles from "./theme.module.css";
|
|
3
|
+
|
|
4
|
+
export const ThemeProvider = <Theme,>({
|
|
5
|
+
children,
|
|
6
|
+
theme,
|
|
7
|
+
}: {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
theme?: Theme;
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className={styles.theme} data-theme={theme}>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StorybookConfig } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ["../lib/components/**/*.stories.@(ts|tsx)", "../lib/stories/**/*.stories.@(ts|tsx)"],
|
|
5
|
+
addons: [
|
|
6
|
+
"@storybook/addon-onboarding",
|
|
7
|
+
"@storybook/addon-links",
|
|
8
|
+
"@storybook/addon-essentials",
|
|
9
|
+
"@storybook/addon-themes",
|
|
10
|
+
"@chromatic-com/storybook",
|
|
11
|
+
"@storybook/addon-interactions",
|
|
12
|
+
"@storybook/addon-a11y"
|
|
13
|
+
],
|
|
14
|
+
framework: {
|
|
15
|
+
name: "@storybook/react-vite",
|
|
16
|
+
options: {},
|
|
17
|
+
},
|
|
18
|
+
docs: {},
|
|
19
|
+
};
|
|
20
|
+
export default config;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { withThemeByDataAttribute } from "@storybook/addon-themes";
|
|
2
|
+
import { Preview, StoryFn } from "@storybook/react";
|
|
3
|
+
import { StoryDecorator } from "./StoryDecorator";
|
|
4
|
+
import "../lib/css/global.css";
|
|
5
|
+
import {A11yParameters} from "@storybook/addon-a11y";
|
|
6
|
+
import { Rule, getRules } from "axe-core";
|
|
7
|
+
|
|
8
|
+
/** @type { import('@storybook/react').Preview } */
|
|
9
|
+
|
|
10
|
+
const enabledTags = [
|
|
11
|
+
"wcag2a",
|
|
12
|
+
"wcag2aa",
|
|
13
|
+
"wcag21a",
|
|
14
|
+
"wcag21aa",
|
|
15
|
+
"wcag22aa",
|
|
16
|
+
"best-practice",
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const enabledRules: Rule[] = getRules(enabledTags).map((ruleMetadata) => ({
|
|
20
|
+
id: ruleMetadata.ruleId,
|
|
21
|
+
enabled: true
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
const a11y: A11yParameters = {
|
|
25
|
+
config: {
|
|
26
|
+
rules: enabledRules,
|
|
27
|
+
},
|
|
28
|
+
element: '#story-in-story-decorator-root',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const preview: Preview = {
|
|
32
|
+
parameters: {
|
|
33
|
+
a11y,
|
|
34
|
+
controls: {
|
|
35
|
+
matchers: {
|
|
36
|
+
color: /(background|color)$/i,
|
|
37
|
+
date: /Date$/i,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
decorators: [
|
|
42
|
+
(Story: StoryFn, data) => {
|
|
43
|
+
const { tags, globals } = data;
|
|
44
|
+
return (
|
|
45
|
+
<StoryDecorator tags={tags} theme={globals?.theme}>
|
|
46
|
+
<Story />
|
|
47
|
+
</StoryDecorator>
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
withThemeByDataAttribute({
|
|
51
|
+
themes: {
|
|
52
|
+
global: "global",
|
|
53
|
+
neutral: "neutral",
|
|
54
|
+
company: "company",
|
|
55
|
+
person: "person",
|
|
56
|
+
},
|
|
57
|
+
defaultTheme: "neutral",
|
|
58
|
+
}),
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export default preview;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.preview {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
row-gap: 1rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tag {
|
|
8
|
+
font-size: 1rem;
|
|
9
|
+
color: #fff;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.tag[data-tag="experimental"] {
|
|
13
|
+
background-color: #f0ad4e;
|
|
14
|
+
padding: 0.25rem 0.5rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tag[data-tag="stable"] {
|
|
18
|
+
background-color: #5cb85c;
|
|
19
|
+
padding: 0.25rem 0.5rem;
|
|
20
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.6.2](https://github.com/Altinn/altinn-components/compare/v0.6.1...v0.6.2) (2024-11-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* bump version for alignment with npm ([#65](https://github.com/Altinn/altinn-components/issues/65)) ([1de4f0a](https://github.com/Altinn/altinn-components/commit/1de4f0a37a7d37a2c04543d4fd8f1c733005f957))
|
|
9
|
+
|
|
10
|
+
## [0.6.1](https://github.com/Altinn/altinn-components/compare/v0.6.0...v0.6.1) (2024-11-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* publish npm: revert to old working export ([#63](https://github.com/Altinn/altinn-components/issues/63)) ([448bea6](https://github.com/Altinn/altinn-components/commit/448bea64b7220ad747eddb20dc624ded055dfb60))
|
|
16
|
+
|
|
17
|
+
## [0.6.0](https://github.com/Altinn/altinn-components/compare/v0.5.2...v0.6.0) (2024-11-20)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* date picker + bookmarks + saved searches ([#60](https://github.com/Altinn/altinn-components/issues/60)) ([3cc249e](https://github.com/Altinn/altinn-components/commit/3cc249ebbd6bb1f5157524a0bfa1fa6693f38dd8))
|
|
23
|
+
|
|
24
|
+
## [0.5.2](https://github.com/Altinn/altinn-components/compare/v0.5.1...v0.5.2) (2024-11-18)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* fixing selecting current account and simplify API for Header ([#58](https://github.com/Altinn/altinn-components/issues/58)) ([b39a14a](https://github.com/Altinn/altinn-components/commit/b39a14a14014ff78209d636f3edc93507b443fd2))
|
|
30
|
+
|
|
31
|
+
## [0.5.1](https://github.com/Altinn/altinn-components/compare/v0.5.0...v0.5.1) (2024-11-16)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* add log out button and refactoring of global menu ([#50](https://github.com/Altinn/altinn-components/issues/50)) ([0fc8bfa](https://github.com/Altinn/altinn-components/commit/0fc8bfaa0feb113624da9e740aed54d61de15d4c))
|
|
37
|
+
|
|
38
|
+
## [0.5.0](https://github.com/Altinn/altinn-components/compare/v0.4.1...v0.5.0) (2024-11-15)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* search bar ([#45](https://github.com/Altinn/altinn-components/issues/45)) ([cc908e0](https://github.com/Altinn/altinn-components/commit/cc908e05957783adf97b94d5e196bf9722523471))
|
|
44
|
+
|
|
45
|
+
## [0.4.1](https://github.com/Altinn/altinn-components/compare/v0.4.0...v0.4.1) (2024-11-11)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* css changes to dialog ([#43](https://github.com/Altinn/altinn-components/issues/43)) ([79e3287](https://github.com/Altinn/altinn-components/commit/79e3287dc2efbce8ba7a9c0b94f955514289c0d3))
|
|
51
|
+
|
|
52
|
+
## [0.4.0](https://github.com/Altinn/altinn-components/compare/v0.3.0...v0.4.0) (2024-11-08)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* add footer component ([#40](https://github.com/Altinn/altinn-components/issues/40)) ([bdf5c0c](https://github.com/Altinn/altinn-components/commit/bdf5c0cd68c374ac5fe83536033074289f379abe))
|
|
58
|
+
|
|
59
|
+
## [0.3.0](https://github.com/Altinn/altinn-components/compare/v0.2.2...v0.3.0) (2024-11-08)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* add snackbar and bulk operation action components ([#38](https://github.com/Altinn/altinn-components/issues/38)) ([a39178d](https://github.com/Altinn/altinn-components/commit/a39178d060819e6943b1d1a5632832529b8f4165))
|
|
65
|
+
|
|
66
|
+
## [0.2.2](https://github.com/Altinn/altinn-components/compare/v0.2.1...v0.2.2) (2024-11-06)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* dialog-props ([#28](https://github.com/Altinn/altinn-components/issues/28)) ([59b6a8f](https://github.com/Altinn/altinn-components/commit/59b6a8fb04abece013218402587f93863c1b9012))
|
|
72
|
+
|
|
73
|
+
## [0.2.1](https://github.com/Altinn/altinn-components/compare/v0.2.0...v0.2.1) (2024-11-06)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Bug Fixes
|
|
77
|
+
|
|
78
|
+
* export members and add use client if needed for next support ([#26](https://github.com/Altinn/altinn-components/issues/26)) ([cb2c52e](https://github.com/Altinn/altinn-components/commit/cb2c52e8f8bd3b2633b439285bb8f4e5dc36d2ed))
|
|
79
|
+
|
|
80
|
+
## [0.2.0](https://github.com/Altinn/altinn-components/compare/v0.1.0...v0.2.0) (2024-11-06)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
* add dialogs as experimental ([#24](https://github.com/Altinn/altinn-components/issues/24)) ([12b3e4d](https://github.com/Altinn/altinn-components/commit/12b3e4dc81c236eff5a5ab0364b3a7e992606c3a))
|
|
86
|
+
* add meta fields ([#23](https://github.com/Altinn/altinn-components/issues/23)) ([ea8ef87](https://github.com/Altinn/altinn-components/commit/ea8ef87ca03c089e52a331ab62526be2b5acc089))
|
|
87
|
+
* list item + meta tags ([#17](https://github.com/Altinn/altinn-components/issues/17)) ([f865f6c](https://github.com/Altinn/altinn-components/commit/f865f6c226e8f7ce9d4ce18c0014fb4e1c9d0383))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* icons for checkbox and radio ([#25](https://github.com/Altinn/altinn-components/issues/25)) ([fb796e2](https://github.com/Altinn/altinn-components/commit/fb796e25636ec0b27ff643a3036ea25171202a11))
|
|
93
|
+
|
|
94
|
+
## [0.1.0](https://github.com/Altinn/altinn-components/compare/v0.0.1...v0.1.0) (2024-11-01)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Features
|
|
98
|
+
|
|
99
|
+
* mark Avatar and AvatarGroup as stable ([#14](https://github.com/Altinn/altinn-components/issues/14)) ([fd8bbce](https://github.com/Altinn/altinn-components/commit/fd8bbce2ce59954d8682527b1a9d70bd08b9ccd7))
|
|
100
|
+
|
|
101
|
+
## 0.0.1 (2024-10-31)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Features
|
|
105
|
+
|
|
106
|
+
* setup project with components: Layout, Header, Toolbar, Menu and Avatar ([f789c56](https://github.com/Altinn/altinn-components/commit/f789c5600c76339b9d1d58b92405a1a202d9b702))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Miscellaneous Chores
|
|
110
|
+
|
|
111
|
+
* release 0.0.1 ([#8](https://github.com/Altinn/altinn-components/issues/8)) ([4a38885](https://github.com/Altinn/altinn-components/commit/4a3888565d53763307882f9fcc2cca503289c2c5))
|
package/CONTRIBUTING.MD
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Contributing to altinn-components
|
|
2
|
+
|
|
3
|
+
Thank you for contributing to altinn 3 components!
|
|
4
|
+
|
|
5
|
+
This project is a collection of reusable components for building web applications for [Altinn 3](https://docs.altinn.studio/nb/community/about/), and not a general-purpose library.
|
|
6
|
+
If you are looking for a more general-purpose library, you might be looking for [Norwegian public sector's Design system](https://designsystemet.no/).
|
|
7
|
+
|
|
8
|
+
We appreciate your help in making this project better, and keep in mind that the project is in an early development stage, and we are actively working to improve both the documentation and the codebase.
|
|
9
|
+
|
|
10
|
+
## Share your feedback and report issues
|
|
11
|
+
|
|
12
|
+
You can report bugs or suggest new features by going to our [Github Issue Templates](https://github.com/Altinn/altinn-components/issues/new/choose).
|
|
13
|
+
We also welcome questions and feedback.
|
|
14
|
+
|
|
15
|
+
## I Want To Contribute
|
|
16
|
+
|
|
17
|
+
### Getting started with development
|
|
18
|
+
Follow these steps to set up Storybook and the necessary tools for development.
|
|
19
|
+
|
|
20
|
+
#### Prerequisites for local development and storybook
|
|
21
|
+
|
|
22
|
+
- The project uses `pnpm` as package manager. It is recommended to use install and use correct version of `pnpm` by using `corepack`, cf. [Using corepack section](https://pnpm.io/installation).
|
|
23
|
+
- Install dependencies with `pnpm install`
|
|
24
|
+
- Required node version is `20.x` or higher.
|
|
25
|
+
|
|
26
|
+
#### Storybook
|
|
27
|
+
Run storybook with `pnpm storybook` and navigate to `http://localhost:6006/` in your browser.
|
|
28
|
+
|
|
29
|
+
### Pull requests
|
|
30
|
+
A lot has been written already about how to write good pull requests. [Here are some](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/best-practices-for-pull-requests) tips to make the process smoother.
|
|
31
|
+
|
|
32
|
+
## Style guides
|
|
33
|
+
|
|
34
|
+
### Code Style
|
|
35
|
+
This project uses [`Biome`](https://biomejs.dev/) for linting and formatting. The configuration is found in the `biome.jsonc` file.
|
|
36
|
+
We recommend using the `biome` CLI to lint and format your code before committing, or using the `biome` extension in your IDE.
|
|
37
|
+
|
|
38
|
+
Use `pnpm format` to format staged files.
|
|
39
|
+
|
|
40
|
+
### Commit Messages
|
|
41
|
+
|
|
42
|
+
This project uses Changesets with the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
43
|
+
specification in order to generate changelogs, communicating the nature of changes.
|
|
44
|
+
|
|
45
|
+
To include commits in the changelog, please ensure that you include the following keywords:
|
|
46
|
+
|
|
47
|
+
- Start the commit with `fix:` to trigger a patch (0.0.x) version.
|
|
48
|
+
- Start the commit with `feat:` to trigger a minor (0.x.0) version.
|
|
49
|
+
|
|
50
|
+
Other keywords are also supported, but will not trigger a version bump. These keywords include:
|
|
51
|
+
- `chore:` for changes that do not affect the end user, such as refactoring or updating dependencies.
|
|
52
|
+
- `docs:` for changes to the documentation.
|
|
53
|
+
- `refactor:` for changes that neither fixes a bug nor adds a feature. but improves the codebase.
|
|
54
|
+
|
|
55
|
+
To make the changelog more specific, you have the option to scope your commits by adding a keyword in parentheses that indicates the area or aspect you are working on.
|
|
56
|
+
For example:
|
|
57
|
+
- Modifying documentation for contributing: `docs(contributing): add a section on commit messages`.
|
|
58
|
+
- Fixing a bug in the Avatar component: `fix(avatar): fix bug with incorrect image size`.
|
|
59
|
+
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Tested with Node.js 20.x <
|
|
|
19
19
|
|
|
20
20
|
## Requirements
|
|
21
21
|
|
|
22
|
-
React `>=18`in your project
|
|
22
|
+
React `>=18`in your project.
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
Wrap your application in RootProvider to enable shared context across all components. Here’s a basic setup:
|
|
@@ -44,21 +44,9 @@ import { Avatar, type AvatarVariant } from '@altinn/components';
|
|
|
44
44
|
```
|
|
45
45
|
and import the css file in your application once:
|
|
46
46
|
```ts
|
|
47
|
-
import '@altinn/altinn-components/lib/css/
|
|
47
|
+
import '@altinn/altinn-components/lib/css/global.css';
|
|
48
48
|
```
|
|
49
49
|
for correct `font-family` and minimal collection of resets.
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
You probably need to transpile the package. Add the following to your `next.config.js`:
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
/** @type {import('next').NextConfig} */
|
|
57
|
-
const nextConfig = {
|
|
58
|
-
transpilePackages: ['@altinn/components'],
|
|
59
|
-
}
|
|
60
|
-
module.exports = nextConfig
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Documentation
|
|
51
|
+
## Documentation and examples
|
|
64
52
|
The documentation for the components can be found in the [Storybook](https://altinn.github.io/altinn-components)
|
package/biome.jsonc
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"defaultBranch": "main"
|
|
7
|
+
},
|
|
8
|
+
"organizeImports": {
|
|
9
|
+
"enabled": true
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"formatWithErrors": true,
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"lineWidth": 120,
|
|
15
|
+
"lineEnding": "lf",
|
|
16
|
+
"ignore": [],
|
|
17
|
+
"indentStyle": "space",
|
|
18
|
+
"indentWidth": 2
|
|
19
|
+
},
|
|
20
|
+
"javascript": {
|
|
21
|
+
"formatter": {
|
|
22
|
+
"arrowParentheses": "always",
|
|
23
|
+
"quoteStyle": "single",
|
|
24
|
+
"jsxQuoteStyle": "double",
|
|
25
|
+
"semicolons": "always",
|
|
26
|
+
"trailingCommas": "all",
|
|
27
|
+
"quoteProperties": "asNeeded",
|
|
28
|
+
"bracketSpacing": true,
|
|
29
|
+
"bracketSameLine": false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"css": {
|
|
33
|
+
"parser": {
|
|
34
|
+
"cssModules": true
|
|
35
|
+
},
|
|
36
|
+
"formatter": {
|
|
37
|
+
"enabled": true,
|
|
38
|
+
"indentStyle": "space",
|
|
39
|
+
"indentWidth": 2
|
|
40
|
+
},
|
|
41
|
+
"linter": {
|
|
42
|
+
"enabled": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"linter": {
|
|
46
|
+
"enabled": true,
|
|
47
|
+
"rules": {
|
|
48
|
+
"suspicious": {
|
|
49
|
+
"noArrayIndexKey": "off"
|
|
50
|
+
},
|
|
51
|
+
"recommended": true,
|
|
52
|
+
"style": {
|
|
53
|
+
"noUnusedTemplateLiteral": "off",
|
|
54
|
+
"noNonNullAssertion": "off",
|
|
55
|
+
"useTemplate": "off"
|
|
56
|
+
},
|
|
57
|
+
"correctness": {
|
|
58
|
+
"useExhaustiveDependencies": "warn"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"files": {
|
|
63
|
+
"ignore": [".github", "node_modules", "dist", "build", ".storybook", "lib/stories"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AttachmentLink } from './AttachmentLink';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Atoms/Attachment/AttachmentLink',
|
|
6
|
+
component: AttachmentLink,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {},
|
|
9
|
+
args: {
|
|
10
|
+
label: 'Document.pdf',
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<typeof AttachmentLink>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {},
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Icon, type IconName } from '../Icon';
|
|
2
|
+
import styles from './attachmentLink.module.css';
|
|
3
|
+
|
|
4
|
+
export interface AttachmentLinkProps {
|
|
5
|
+
/** Link url */
|
|
6
|
+
href: string;
|
|
7
|
+
/** Label (filename) */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Icon */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const AttachmentLink = ({ icon = 'file', href, label }: AttachmentLinkProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<a href={href} className={styles.link}>
|
|
16
|
+
<Icon name={icon} className={styles.icon} />
|
|
17
|
+
<span className={styles.label}>{label}</span>
|
|
18
|
+
</a>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
|
+
|
|
4
|
+
import { AttachmentList } from './AttachmentList';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Atoms/Attachment/AttachmentList',
|
|
8
|
+
component: AttachmentList,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
items: [
|
|
15
|
+
{
|
|
16
|
+
label: '1-0 Castro.pdf',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: '2-0 Kornvig.pdf',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: '3-0 Kartum.pdf',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: '3-1 Zinkernagel.pdf',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: '4-1 Castro.pdf',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
} satisfies Meta<typeof AttachmentList>;
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
36
|
+
|
|
37
|
+
export const Default: Story = {
|
|
38
|
+
args: {},
|
|
39
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
};
|