@databiosphere/findable-ui 21.3.0 → 22.0.0
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/.release-please-manifest.json +1 -1
- package/.storybook/main.ts +7 -1
- package/CHANGELOG.md +25 -0
- package/lib/components/DataDictionary/components/Entities/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Entities/constants.js +6 -0
- package/lib/components/DataDictionary/components/Entities/entities.d.ts +2 -0
- package/lib/components/DataDictionary/components/Entities/entities.js +7 -0
- package/lib/components/DataDictionary/components/Entities/types.d.ts +4 -0
- package/lib/components/DataDictionary/components/Entities/types.js +1 -0
- package/lib/components/DataDictionary/components/Entity/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Entity/constants.js +5 -0
- package/lib/components/DataDictionary/components/Entity/entity.d.ts +2 -0
- package/lib/components/DataDictionary/components/Entity/entity.js +14 -0
- package/lib/components/DataDictionary/components/Entity/types.d.ts +4 -0
- package/lib/components/DataDictionary/components/Entity/types.js +1 -0
- package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +6 -0
- package/lib/components/DataDictionary/components/Table/columns/columnDef.js +33 -0
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +5 -0
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +5 -0
- package/lib/components/DataDictionary/components/Table/columns/types.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/columns/types.js +1 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.js +6 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +4 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +1 -0
- package/lib/components/DataDictionary/components/Table/hook.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/hook.js +11 -0
- package/lib/components/DataDictionary/components/Table/options/core/constants.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/options/core/constants.js +7 -0
- package/lib/components/DataDictionary/components/Table/options/hook.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/options/hook.js +8 -0
- package/lib/components/DataDictionary/components/Table/options/sorting/constants.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/options/sorting/constants.js +3 -0
- package/lib/components/DataDictionary/components/Table/table.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/table.js +17 -0
- package/lib/components/DataDictionary/components/Table/table.styles.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/table.styles.js +5 -0
- package/lib/components/DataDictionary/components/Table/types.d.ts +5 -0
- package/lib/components/DataDictionary/components/Table/types.js +1 -0
- package/lib/components/DataDictionary/dataDictionary.d.ts +2 -0
- package/lib/components/DataDictionary/dataDictionary.js +9 -0
- package/lib/components/DataDictionary/dataDictionary.styles.d.ts +1 -0
- package/lib/components/DataDictionary/dataDictionary.styles.js +7 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +2 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +5 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +4 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.js +1 -0
- package/lib/components/Detail/detail.stories.d.ts +36 -5
- package/lib/components/Detail/detail.stories.js +27 -18
- package/lib/components/Export/components/ExportForm/components/ExportButton/exportButton.js +6 -1
- package/lib/components/Export/components/ExportMethod/exportMethod.stories.d.ts +22 -5
- package/lib/components/Export/components/ExportMethod/exportMethod.stories.js +9 -9
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.js +5 -2
- package/lib/components/Filter/components/Filter/filter.stories.d.ts +25 -5
- package/lib/components/Filter/components/Filter/filter.stories.js +25 -24
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.d.ts +31 -5
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.js +10 -8
- package/lib/components/Filter/components/FilterMenu/filterMenu.stories.d.ts +38 -5
- package/lib/components/Filter/components/FilterMenu/filterMenu.stories.js +107 -104
- package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +16 -5
- package/lib/components/Filter/components/FilterTag/filterTag.stories.js +8 -7
- package/lib/components/Filter/components/FilterTags/filterTags.stories.d.ts +18 -5
- package/lib/components/Filter/components/FilterTags/filterTags.stories.js +40 -39
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.js +10 -5
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.stories.d.ts +8 -5
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.stories.js +9 -6
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +13 -5
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +11 -11
- package/lib/components/Index/components/Hero/hero.stories.d.ts +23 -5
- package/lib/components/Index/components/Hero/hero.stories.js +8 -6
- package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +16 -5
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +8 -8
- package/lib/components/Index/index.stories.js +2 -1
- package/lib/components/Layout/components/BackPage/backPageView.stories.d.ts +31 -5
- package/lib/components/Layout/components/BackPage/backPageView.stories.js +27 -18
- package/lib/components/Layout/components/Footer/footer.stories.d.ts +24 -3
- package/lib/components/Layout/components/Footer/footer.stories.js +4 -3
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.js +20 -21
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/constants.d.ts +1 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/constants.js +1 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.d.ts +2 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.js +16 -17
- package/lib/components/Layout/components/Header/header.js +2 -1
- package/lib/components/Layout/components/Header/header.stories.js +1 -1
- package/lib/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.d.ts +13 -5
- package/lib/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.js +6 -6
- package/lib/components/Layout/components/Sidebar/sidebar.stories.js +2 -0
- package/lib/components/Links/links.stories.d.ts +13 -5
- package/lib/components/Links/links.stories.js +14 -14
- package/lib/components/Loading/loading.stories.d.ts +34 -5
- package/lib/components/Loading/loading.stories.js +8 -6
- package/lib/components/Login/components/Button/types.d.ts +1 -1
- package/lib/components/Login/components/Buttons/buttons.d.ts +2 -0
- package/lib/components/Login/components/Buttons/buttons.js +5 -0
- package/lib/components/Login/components/Buttons/types.d.ts +8 -0
- package/lib/components/Login/components/Buttons/types.js +1 -0
- package/lib/components/Login/components/Section/components/Consent/consent.d.ts +3 -0
- package/lib/components/Login/components/Section/components/Consent/consent.js +14 -0
- package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +7 -0
- package/lib/components/Login/components/Section/components/Consent/consent.styles.js +14 -0
- package/lib/components/Login/components/Section/components/Consent/types.d.ts +6 -0
- package/lib/components/Login/components/Section/components/Consent/types.js +1 -0
- package/lib/components/Login/components/Section/components/Warning/warning.d.ts +3 -0
- package/lib/components/Login/components/Section/components/Warning/warning.js +9 -0
- package/lib/components/Login/hooks/useUserConsent/types.d.ts +10 -0
- package/lib/components/Login/hooks/useUserConsent/types.js +1 -0
- package/lib/components/Login/hooks/useUserConsent/useUserConsent.d.ts +2 -0
- package/lib/components/Login/hooks/useUserConsent/useUserConsent.js +24 -0
- package/lib/components/Login/hooks/useUserLogin/types.d.ts +6 -0
- package/lib/components/Login/hooks/useUserLogin/types.js +1 -0
- package/lib/components/Login/hooks/useUserLogin/useUserLogin.d.ts +2 -0
- package/lib/components/Login/hooks/useUserLogin/useUserLogin.js +21 -0
- package/lib/components/Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories.d.ts +13 -5
- package/lib/components/Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories.js +20 -20
- package/lib/components/Project/components/Contacts/contacts.stories.d.ts +13 -5
- package/lib/components/Project/components/Contacts/contacts.stories.js +18 -18
- package/lib/components/Project/components/Contributors/contributors.stories.d.ts +8 -5
- package/lib/components/Project/components/Contributors/contributors.stories.js +27 -27
- package/lib/components/Project/components/DataCurators/dataCurators.stories.d.ts +13 -5
- package/lib/components/Project/components/DataCurators/dataCurators.stories.js +7 -7
- package/lib/components/Project/components/DataReleasePolicy/dataReleasePolicy.stories.d.ts +8 -5
- package/lib/components/Project/components/DataReleasePolicy/dataReleasePolicy.stories.js +3 -4
- package/lib/components/Project/components/Description/description.stories.d.ts +8 -5
- package/lib/components/Project/components/Description/description.stories.js +6 -6
- package/lib/components/Project/components/Details/details.stories.d.ts +16 -5
- package/lib/components/Project/components/Details/details.stories.js +7 -7
- package/lib/components/Project/components/Publications/publications.stories.d.ts +8 -5
- package/lib/components/Project/components/Publications/publications.stories.js +17 -17
- package/lib/components/Project/components/SupplementaryLinks/supplementaryLinks.stories.d.ts +8 -5
- package/lib/components/Project/components/SupplementaryLinks/supplementaryLinks.stories.js +18 -18
- package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/common/constants.d.ts +16 -33
- package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/common/constants.js +10 -9
- package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.js +26 -14
- package/lib/components/Support/components/ViewSupport/types.d.ts +6 -0
- package/lib/components/Support/components/ViewSupport/types.js +1 -0
- package/lib/components/Support/components/ViewSupport/viewSupport.d.ts +2 -9
- package/lib/components/Support/components/ViewSupport/viewSupport.js +7 -3
- package/lib/components/Table/components/Pagination/pagination.stories.d.ts +28 -5
- package/lib/components/Table/components/Pagination/pagination.stories.js +11 -7
- package/lib/components/common/Accordion/accordion.stories.d.ts +6 -3
- package/lib/components/common/Accordion/accordion.stories.js +2 -1
- package/lib/components/common/Breadcrumbs/breadcrumbs.stories.d.ts +10 -7
- package/lib/components/common/Breadcrumbs/breadcrumbs.stories.js +42 -43
- package/lib/components/common/Button/components/CallToActionButton/callToActionButton.stories.d.ts +9 -6
- package/lib/components/common/Button/components/CallToActionButton/callToActionButton.stories.js +13 -15
- package/lib/components/common/Button/components/HelpIconButton/helpIconButton.stories.d.ts +19 -2
- package/lib/components/common/Button/components/HelpIconButton/helpIconButton.stories.js +2 -2
- package/lib/components/common/Card/card.stories.d.ts +6 -3
- package/lib/components/common/Card/card.stories.js +2 -1
- package/lib/components/common/Code/code.stories.d.ts +5 -3
- package/lib/components/common/CopyToClipboard/copyToClipboard.stories.d.ts +11 -3
- package/lib/components/common/CopyToClipboard/copyToClipboard.stories.js +2 -1
- package/lib/components/common/CustomIcon/components/CloseIcon/closeIcon.d.ts +2 -0
- package/lib/components/common/CustomIcon/components/CloseIcon/closeIcon.js +6 -0
- package/lib/components/common/LoginDialog/constants.d.ts +6 -0
- package/lib/components/common/LoginDialog/constants.js +21 -0
- package/lib/components/common/LoginDialog/loginDialog.d.ts +2 -0
- package/lib/components/common/LoginDialog/loginDialog.js +27 -0
- package/lib/components/common/LoginDialog/loginDialog.styles.d.ts +3 -0
- package/lib/components/common/LoginDialog/loginDialog.styles.js +50 -0
- package/lib/components/common/LoginDialog/types.d.ts +4 -0
- package/lib/components/common/LoginDialog/types.js +1 -0
- package/lib/components/common/Section/components/SectionTitle/sectionTitle.stories.d.ts +13 -5
- package/lib/components/common/Section/components/SectionTitle/sectionTitle.stories.js +6 -6
- package/lib/components/common/Socials/socials.stories.d.ts +11 -3
- package/lib/components/common/Socials/socials.stories.js +2 -1
- package/lib/components/common/StaticImage/staticImage.stories.d.ts +22 -5
- package/lib/components/common/StaticImage/staticImage.stories.js +8 -8
- package/lib/components/common/StatusIcon/statusIcon.stories.d.ts +19 -5
- package/lib/components/common/StatusIcon/statusIcon.stories.js +7 -7
- package/lib/components/common/Tag/tag.stories.d.ts +15 -5
- package/lib/components/common/Tag/tag.stories.js +7 -5
- package/lib/components/common/ToggleButtonGroup/toggleButtonGroup.stories.d.ts +18 -5
- package/lib/components/common/ToggleButtonGroup/toggleButtonGroup.stories.js +19 -19
- package/lib/config/entities.d.ts +1 -0
- package/lib/providers/loginGuard/common/types.d.ts +18 -0
- package/lib/providers/loginGuard/common/types.js +1 -0
- package/lib/providers/loginGuard/context.d.ts +6 -0
- package/lib/providers/loginGuard/context.js +10 -0
- package/lib/providers/loginGuard/hook.d.ts +9 -0
- package/lib/providers/loginGuard/hook.js +12 -0
- package/lib/providers/loginGuard/provider.d.ts +11 -0
- package/lib/providers/loginGuard/provider.js +55 -0
- package/lib/styles/common/mui/typography.d.ts +1 -0
- package/lib/styles/common/mui/typography.js +8 -0
- package/lib/views/DataDictionaryView/dataDictionaryView.d.ts +2 -0
- package/lib/views/DataDictionaryView/dataDictionaryView.js +5 -0
- package/package.json +13 -13
- package/src/components/DataDictionary/components/Entities/constants.ts +8 -0
- package/src/components/DataDictionary/components/Entities/entities.tsx +15 -0
- package/src/components/DataDictionary/components/Entities/types.ts +5 -0
- package/src/components/DataDictionary/components/Entity/constants.ts +7 -0
- package/src/components/DataDictionary/components/Entity/entity.tsx +28 -0
- package/src/components/DataDictionary/components/Entity/types.ts +5 -0
- package/src/components/DataDictionary/components/Table/columns/columnDef.ts +47 -0
- package/src/components/DataDictionary/components/Table/columns/columnIdentifier.ts +5 -0
- package/src/components/DataDictionary/components/Table/columns/types.ts +3 -0
- package/src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx +8 -0
- package/src/components/DataDictionary/components/Table/components/BasicCell/types.ts +5 -0
- package/src/components/DataDictionary/components/Table/hook.ts +13 -0
- package/src/components/DataDictionary/components/Table/options/core/constants.ts +12 -0
- package/src/components/DataDictionary/components/Table/options/hook.ts +14 -0
- package/src/components/DataDictionary/components/Table/options/sorting/constants.ts +9 -0
- package/src/components/DataDictionary/components/Table/table.styles.ts +6 -0
- package/src/components/DataDictionary/components/Table/table.tsx +35 -0
- package/src/components/DataDictionary/components/Table/types.ts +6 -0
- package/src/components/DataDictionary/dataDictionary.styles.ts +8 -0
- package/src/components/DataDictionary/dataDictionary.tsx +16 -0
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +9 -0
- package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +5 -0
- package/src/components/Detail/detail.stories.tsx +41 -36
- package/src/components/Export/components/ExportForm/components/ExportButton/exportButton.tsx +8 -1
- package/src/components/Export/components/ExportMethod/exportMethod.stories.tsx +13 -13
- package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.tsx +11 -3
- package/src/components/Filter/components/Filter/filter.stories.tsx +29 -28
- package/src/components/Filter/components/FilterLabel/filterLabel.stories.tsx +14 -12
- package/src/components/Filter/components/FilterMenu/filterMenu.stories.tsx +111 -108
- package/src/components/Filter/components/FilterTag/filterTag.stories.tsx +12 -11
- package/src/components/Filter/components/FilterTags/filterTags.stories.tsx +44 -43
- package/src/components/Index/components/AzulFileDownload/azulFileDownload.stories.tsx +13 -10
- package/src/components/Index/components/AzulFileDownload/azulFileDownload.tsx +12 -5
- package/src/components/Index/components/Hero/components/Summaries/summaries.stories.tsx +15 -15
- package/src/components/Index/components/Hero/hero.stories.tsx +12 -8
- package/src/components/Index/components/NTagCell/nTagCell.stories.tsx +12 -12
- package/src/components/Index/index.stories.tsx +2 -1
- package/src/components/Layout/components/BackPage/backPageView.stories.tsx +42 -36
- package/src/components/Layout/components/Footer/footer.stories.tsx +6 -4
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +1 -1
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.tsx +16 -15
- package/src/components/Layout/components/Header/components/Content/components/Navigation/constants.ts +1 -0
- package/src/components/Layout/components/Header/components/Content/components/Navigation/navigation.tsx +26 -18
- package/src/components/Layout/components/Header/header.stories.tsx +1 -1
- package/src/components/Layout/components/Header/header.tsx +6 -1
- package/src/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.tsx +10 -10
- package/src/components/Layout/components/Sidebar/sidebar.stories.tsx +2 -0
- package/src/components/Links/links.stories.tsx +18 -18
- package/src/components/Loading/loading.stories.tsx +12 -10
- package/src/components/Login/components/Button/types.ts +1 -1
- package/src/components/Login/components/Buttons/buttons.tsx +22 -0
- package/src/components/Login/components/Buttons/types.ts +9 -0
- package/src/components/Login/components/Section/components/Consent/consent.styles.ts +15 -0
- package/src/components/Login/components/Section/components/Consent/consent.tsx +30 -0
- package/src/components/Login/components/Section/components/Consent/types.ts +10 -0
- package/src/components/Login/components/Section/components/Warning/warning.tsx +24 -0
- package/src/components/Login/hooks/useUserConsent/types.ts +11 -0
- package/src/components/Login/hooks/useUserConsent/useUserConsent.ts +32 -0
- package/src/components/Login/hooks/useUserLogin/types.ts +8 -0
- package/src/components/Login/hooks/useUserLogin/useUserLogin.ts +29 -0
- package/src/components/Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories.tsx +24 -25
- package/src/components/Project/components/Contacts/contacts.stories.tsx +22 -22
- package/src/components/Project/components/Contributors/contributors.stories.tsx +31 -31
- package/src/components/Project/components/DataCurators/dataCurators.stories.tsx +11 -11
- package/src/components/Project/components/DataReleasePolicy/dataReleasePolicy.stories.tsx +7 -8
- package/src/components/Project/components/Description/description.stories.tsx +11 -11
- package/src/components/Project/components/Details/details.stories.tsx +11 -11
- package/src/components/Project/components/Publications/publications.stories.tsx +23 -23
- package/src/components/Project/components/SupplementaryLinks/supplementaryLinks.stories.tsx +22 -22
- package/src/components/Support/components/SupportRequest/components/SupportRequestForm/common/constants.ts +10 -9
- package/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx +44 -15
- package/src/components/Support/components/ViewSupport/types.ts +9 -0
- package/src/components/Support/components/ViewSupport/viewSupport.tsx +6 -10
- package/src/components/Table/components/Pagination/pagination.stories.tsx +15 -11
- package/src/components/common/Accordion/accordion.stories.tsx +4 -2
- package/src/components/common/Breadcrumbs/breadcrumbs.stories.tsx +46 -47
- package/src/components/common/Button/components/CallToActionButton/callToActionButton.stories.tsx +17 -20
- package/src/components/common/Button/components/HelpIconButton/helpIconButton.stories.tsx +4 -4
- package/src/components/common/Card/card.stories.tsx +4 -2
- package/src/components/common/Code/code.stories.tsx +1 -1
- package/src/components/common/CopyToClipboard/copyToClipboard.stories.tsx +4 -2
- package/src/components/common/CustomIcon/components/CloseIcon/closeIcon.tsx +17 -0
- package/src/components/common/LoginDialog/constants.ts +33 -0
- package/src/components/common/LoginDialog/loginDialog.styles.ts +51 -0
- package/src/components/common/LoginDialog/loginDialog.tsx +56 -0
- package/src/components/common/LoginDialog/types.ts +4 -0
- package/src/components/common/Section/components/SectionTitle/sectionTitle.stories.tsx +10 -10
- package/src/components/common/Socials/socials.stories.tsx +4 -2
- package/src/components/common/StaticImage/staticImage.stories.tsx +12 -12
- package/src/components/common/StatusIcon/statusIcon.stories.tsx +11 -11
- package/src/components/common/Tag/tag.stories.tsx +11 -9
- package/src/components/common/ToggleButtonGroup/toggleButtonGroup.stories.tsx +23 -23
- package/src/config/entities.ts +1 -0
- package/src/providers/loginGuard/common/types.ts +21 -0
- package/src/providers/loginGuard/context.ts +12 -0
- package/src/providers/loginGuard/hook.ts +14 -0
- package/src/providers/loginGuard/provider.tsx +76 -0
- package/src/styles/common/mui/typography.ts +9 -0
- package/src/views/DataDictionaryView/dataDictionaryView.tsx +9 -0
- package/tests/provider.test.tsx +191 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
2
|
import { Summaries } from "./summaries";
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
const meta = {
|
|
6
5
|
argTypes: {
|
|
7
|
-
summaries: { control: "
|
|
6
|
+
summaries: { control: "object" },
|
|
8
7
|
},
|
|
9
8
|
component: Summaries,
|
|
10
9
|
title: "Components/Summary",
|
|
11
|
-
}
|
|
10
|
+
} satisfies Meta<typeof Summaries>;
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
<Summaries {...args} />
|
|
15
|
-
);
|
|
12
|
+
export default meta;
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const SummariesStory: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
summaries: [
|
|
19
|
+
{ count: "1", label: "Species" },
|
|
20
|
+
{ count: "1.1k", label: "Donors" },
|
|
21
|
+
{ count: "508.5k", label: "Files" },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
24
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { Summaries } from "./components/Summaries/summaries";
|
|
3
4
|
import { SummariesStory } from "./components/Summaries/summaries.stories";
|
|
4
5
|
import { Hero } from "./hero";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const meta = {
|
|
7
8
|
argTypes: {
|
|
8
9
|
Summaries: { table: { disable: true } },
|
|
9
10
|
title: { table: { disable: true } },
|
|
@@ -13,12 +14,15 @@ export default {
|
|
|
13
14
|
layout: "fullscreen",
|
|
14
15
|
},
|
|
15
16
|
title: "Components/Hero/ExploreView",
|
|
16
|
-
}
|
|
17
|
+
} satisfies Meta<typeof Hero>;
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
export default meta;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const HeroStory: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
Summaries: <Summaries {...SummariesStory.args} />,
|
|
26
|
+
title: "Data Explorer",
|
|
27
|
+
},
|
|
24
28
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
2
|
import { NTagCell } from "./nTagCell";
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
const meta = {
|
|
6
5
|
argTypes: {
|
|
7
6
|
label: { control: "text" },
|
|
8
|
-
values: { control: "
|
|
7
|
+
values: { control: "object" },
|
|
9
8
|
},
|
|
10
9
|
component: NTagCell,
|
|
11
10
|
title: "Components/Table/Cell/NTagCell",
|
|
12
|
-
}
|
|
11
|
+
} satisfies Meta<typeof NTagCell>;
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
<NTagCell {...args} />
|
|
16
|
-
);
|
|
13
|
+
export default meta;
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const NTagCellStory: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
label: "species",
|
|
20
|
+
values: ["Homo sapiens", "Mus musculus"],
|
|
21
|
+
},
|
|
22
22
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { Summaries } from "./components/Hero/components/Summaries/summaries";
|
|
3
4
|
import { SummariesStory } from "./components/Hero/components/Summaries/summaries.stories";
|
|
4
5
|
import { Index } from "./index";
|
|
5
6
|
|
|
@@ -22,7 +23,7 @@ type Story = StoryObj<typeof Index>;
|
|
|
22
23
|
export const IndexStory: Story = {
|
|
23
24
|
args: {
|
|
24
25
|
List: undefined,
|
|
25
|
-
Summaries: <
|
|
26
|
+
Summaries: <Summaries {...SummariesStory.args} />,
|
|
26
27
|
Tabs: undefined,
|
|
27
28
|
title: "Explore Data",
|
|
28
29
|
},
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { CollaboratingOrganizations } from "../../../Project/components/CollaboratingOrganizations/collaboratingOrganizations";
|
|
3
4
|
import { CollaboratingOrganizationsStory } from "../../../Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories";
|
|
5
|
+
import { Contacts } from "../../../Project/components/Contacts/contacts";
|
|
4
6
|
import { ContactsStory } from "../../../Project/components/Contacts/contacts.stories";
|
|
7
|
+
import { Contributors } from "../../../Project/components/Contributors/contributors";
|
|
5
8
|
import { ContributorsStory } from "../../../Project/components/Contributors/contributors.stories";
|
|
9
|
+
import { DataCurators } from "../../../Project/components/DataCurators/dataCurators";
|
|
6
10
|
import { DataCuratorsStory } from "../../../Project/components/DataCurators/dataCurators.stories";
|
|
7
|
-
import {
|
|
11
|
+
import { DataReleasePolicy } from "../../../Project/components/DataReleasePolicy/dataReleasePolicy";
|
|
12
|
+
import { Description } from "../../../Project/components/Description/description";
|
|
8
13
|
import { DescriptionStory } from "../../../Project/components/Description/description.stories";
|
|
14
|
+
import { Details } from "../../../Project/components/Details/details";
|
|
9
15
|
import { DetailsStory } from "../../../Project/components/Details/details.stories";
|
|
16
|
+
import { Publications } from "../../../Project/components/Publications/publications";
|
|
10
17
|
import { PublicationsStory } from "../../../Project/components/Publications/publications.stories";
|
|
18
|
+
import { SupplementaryLinks } from "../../../Project/components/SupplementaryLinks/supplementaryLinks";
|
|
11
19
|
import { SupplementaryLinksStory } from "../../../Project/components/SupplementaryLinks/supplementaryLinks.stories";
|
|
12
20
|
import { BackPageView } from "./backPageView";
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
const meta = {
|
|
15
23
|
argTypes: {
|
|
16
24
|
isDetailOverview: { control: "boolean" },
|
|
17
25
|
mainColumn: { table: { disable: true } },
|
|
@@ -23,39 +31,37 @@ export default {
|
|
|
23
31
|
layout: "fullscreen",
|
|
24
32
|
},
|
|
25
33
|
title: "Views/BackPage",
|
|
26
|
-
}
|
|
34
|
+
} satisfies Meta<typeof BackPageView>;
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
<BackPageView {...args} />
|
|
30
|
-
);
|
|
36
|
+
export default meta;
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{...
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
39
|
+
|
|
40
|
+
export const BackPageViewStory: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
isDetailOverview: true,
|
|
43
|
+
mainColumn: (
|
|
44
|
+
<>
|
|
45
|
+
<Description
|
|
46
|
+
projectDescription={
|
|
47
|
+
DescriptionStory.args?.projectDescription || "None"
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
50
|
+
<Contacts {...ContactsStory.args} />
|
|
51
|
+
<Publications {...PublicationsStory.args} />
|
|
52
|
+
<Contributors {...ContributorsStory.args} />
|
|
53
|
+
<CollaboratingOrganizations {...CollaboratingOrganizationsStory.args} />
|
|
54
|
+
<DataCurators {...DataCuratorsStory.args} />
|
|
55
|
+
{/*<Citation {...CitationStory.args} />*/}
|
|
56
|
+
<SupplementaryLinks {...SupplementaryLinksStory.args} />
|
|
57
|
+
<DataReleasePolicy />
|
|
58
|
+
</>
|
|
59
|
+
),
|
|
60
|
+
sideColumn: (
|
|
61
|
+
<>
|
|
62
|
+
<Details {...DetailsStory.args} />
|
|
63
|
+
</>
|
|
64
|
+
),
|
|
65
|
+
top: <></>,
|
|
66
|
+
},
|
|
61
67
|
};
|
|
@@ -9,10 +9,10 @@ import { YouTubeIcon } from "../../../common/CustomIcon/components/YouTubeIcon/y
|
|
|
9
9
|
import { Logo } from "../Header/components/Content/components/Logo/logo";
|
|
10
10
|
import { Footer } from "./footer";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const meta = {
|
|
13
13
|
argTypes: {
|
|
14
14
|
Branding: { control: { disabled: true } },
|
|
15
|
-
navLinks: { control: "
|
|
15
|
+
navLinks: { control: "object" },
|
|
16
16
|
socials: { control: { disabled: true } },
|
|
17
17
|
},
|
|
18
18
|
component: Footer,
|
|
@@ -20,13 +20,15 @@ export default {
|
|
|
20
20
|
layout: "fullscreen",
|
|
21
21
|
},
|
|
22
22
|
title: "Components/Layout/Footer",
|
|
23
|
-
}
|
|
23
|
+
} satisfies Meta<typeof Footer>;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
24
26
|
|
|
25
27
|
type Story = StoryObj<typeof Footer>;
|
|
26
28
|
|
|
27
29
|
export const FooterStory: Story = {
|
|
28
30
|
args: {
|
|
29
|
-
Branding: <Logo alt="logo" height={24} link={"/"} src={logo} />,
|
|
31
|
+
Branding: <Logo alt="logo" height={24} link={"/"} src={logo.src} />,
|
|
30
32
|
navLinks: [
|
|
31
33
|
{
|
|
32
34
|
label: "Help",
|
|
@@ -2,9 +2,10 @@ import {
|
|
|
2
2
|
Divider,
|
|
3
3
|
ListItemIcon,
|
|
4
4
|
ListItemText,
|
|
5
|
+
Link as MLink,
|
|
5
6
|
MenuItem as MMenuItem,
|
|
6
7
|
} from "@mui/material";
|
|
7
|
-
import
|
|
8
|
+
import Link from "next/link";
|
|
8
9
|
import React, { Fragment, ReactNode } from "react";
|
|
9
10
|
import {
|
|
10
11
|
TEXT_BODY_400,
|
|
@@ -38,7 +39,6 @@ export const NavigationMenuItems = ({
|
|
|
38
39
|
menuItems,
|
|
39
40
|
pathname,
|
|
40
41
|
}: NavLinkMenuProps): JSX.Element => {
|
|
41
|
-
const router = useRouter();
|
|
42
42
|
return (
|
|
43
43
|
<>
|
|
44
44
|
{menuItems.map(
|
|
@@ -54,8 +54,9 @@ export const NavigationMenuItems = ({
|
|
|
54
54
|
url,
|
|
55
55
|
},
|
|
56
56
|
i
|
|
57
|
-
) =>
|
|
58
|
-
|
|
57
|
+
) => {
|
|
58
|
+
const isClientSide = isClientSideNavigation(url);
|
|
59
|
+
return nestedMenuItems ? (
|
|
59
60
|
<NavigationMenu
|
|
60
61
|
key={i}
|
|
61
62
|
closeAncestor={closeMenu}
|
|
@@ -69,18 +70,17 @@ export const NavigationMenuItems = ({
|
|
|
69
70
|
) : (
|
|
70
71
|
<Fragment key={i}>
|
|
71
72
|
<MMenuItem
|
|
73
|
+
component={isClientSide ? Link : MLink}
|
|
72
74
|
disabled={!url}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
81
|
-
);
|
|
82
|
-
}}
|
|
75
|
+
href={url}
|
|
76
|
+
onClick={(): void => closeMenu()}
|
|
77
|
+
rel={
|
|
78
|
+
isClientSide
|
|
79
|
+
? REL_ATTRIBUTE.NO_OPENER
|
|
80
|
+
: REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
81
|
+
}
|
|
83
82
|
selected={isNavigationLinkSelected(pathname, selectedPatterns)}
|
|
83
|
+
target={target}
|
|
84
84
|
>
|
|
85
85
|
{icon && <ListItemIcon>{icon}</ListItemIcon>}
|
|
86
86
|
<ListItemText
|
|
@@ -100,7 +100,8 @@ export const NavigationMenuItems = ({
|
|
|
100
100
|
</MMenuItem>
|
|
101
101
|
{divider && <Divider />}
|
|
102
102
|
</Fragment>
|
|
103
|
-
)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
104
105
|
)}
|
|
105
106
|
</>
|
|
106
107
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const NAVIGATION_TEST_ID = "navigation";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button, Divider } from "@mui/material";
|
|
2
|
-
import
|
|
1
|
+
import { Button, Divider, Link as MLink } from "@mui/material";
|
|
2
|
+
import Link from "next/link";
|
|
3
3
|
import React, { CSSProperties, forwardRef, Fragment, ReactNode } from "react";
|
|
4
4
|
import { BreakpointKey } from "../../../../../../../../hooks/useBreakpointHelper";
|
|
5
5
|
import {
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
REL_ATTRIBUTE,
|
|
8
8
|
} from "../../../../../../../Links/common/entities";
|
|
9
9
|
import { isClientSideNavigation } from "../../../../../../../Links/common/utils";
|
|
10
|
+
import { TestIdProps } from "../../../../../../../types";
|
|
10
11
|
import { SelectedMatch } from "../../../../common/entities";
|
|
11
12
|
import { HeaderProps } from "../../../../header";
|
|
12
13
|
import { isNavigationLinkSelected } from "./common/utils";
|
|
@@ -28,7 +29,7 @@ export interface NavLinkItem {
|
|
|
28
29
|
visible?: Partial<Record<BreakpointKey, boolean>>;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
export interface NavigationProps {
|
|
32
|
+
export interface NavigationProps extends TestIdProps {
|
|
32
33
|
className?: string;
|
|
33
34
|
closeAncestor?: () => void;
|
|
34
35
|
headerProps?: HeaderProps;
|
|
@@ -48,12 +49,18 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
|
|
|
48
49
|
links,
|
|
49
50
|
pathname,
|
|
50
51
|
style,
|
|
52
|
+
testId,
|
|
51
53
|
}: NavigationProps,
|
|
52
54
|
ref
|
|
53
55
|
): JSX.Element {
|
|
54
|
-
const router = useRouter();
|
|
55
56
|
return (
|
|
56
|
-
<Links
|
|
57
|
+
<Links
|
|
58
|
+
ref={ref}
|
|
59
|
+
className={className}
|
|
60
|
+
data-testid={testId}
|
|
61
|
+
isMenuIn={isMenuIn}
|
|
62
|
+
style={style}
|
|
63
|
+
>
|
|
57
64
|
{links.map(
|
|
58
65
|
(
|
|
59
66
|
{
|
|
@@ -65,8 +72,9 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
|
|
|
65
72
|
url,
|
|
66
73
|
},
|
|
67
74
|
i
|
|
68
|
-
) =>
|
|
69
|
-
|
|
75
|
+
) => {
|
|
76
|
+
const isClientSide = isClientSideNavigation(url);
|
|
77
|
+
return menuItems ? (
|
|
70
78
|
<Fragment key={i}>
|
|
71
79
|
{isMenuIn ? (
|
|
72
80
|
<NavigationDrawer
|
|
@@ -98,17 +106,16 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
|
|
|
98
106
|
) : (
|
|
99
107
|
<Fragment key={i}>
|
|
100
108
|
<Button
|
|
109
|
+
component={isClientSide ? Link : MLink}
|
|
101
110
|
disabled={!url}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
);
|
|
111
|
-
}}
|
|
111
|
+
href={url}
|
|
112
|
+
onClick={(): void => closeAncestor?.()}
|
|
113
|
+
rel={
|
|
114
|
+
isClientSide
|
|
115
|
+
? REL_ATTRIBUTE.NO_OPENER
|
|
116
|
+
: REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
117
|
+
}
|
|
118
|
+
target={target}
|
|
112
119
|
variant={
|
|
113
120
|
isNavigationLinkSelected(pathname, selectedPatterns)
|
|
114
121
|
? "activeNav"
|
|
@@ -119,7 +126,8 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
|
|
|
119
126
|
</Button>
|
|
120
127
|
{divider && <Divider />}
|
|
121
128
|
</Fragment>
|
|
122
|
-
)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
123
131
|
)}
|
|
124
132
|
</Links>
|
|
125
133
|
);
|
|
@@ -31,7 +31,7 @@ const url = "/";
|
|
|
31
31
|
export const HeaderStory: Story = {
|
|
32
32
|
args: {
|
|
33
33
|
authenticationEnabled: false,
|
|
34
|
-
logo: <Logo alt="Logo" height={40} link="/" src={logo} />,
|
|
34
|
+
logo: <Logo alt="Logo" height={40} link="/" src={logo.src} />,
|
|
35
35
|
navigation: [
|
|
36
36
|
undefined,
|
|
37
37
|
[
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
renderIconButton as renderSearchIconButton,
|
|
22
22
|
Search,
|
|
23
23
|
} from "./components/Content/components/Actions/components/Search/search";
|
|
24
|
+
import { NAVIGATION_TEST_ID } from "./components/Content/components/Navigation/constants";
|
|
24
25
|
import { Navigation as DXNavigation } from "./components/Content/components/Navigation/navigation";
|
|
25
26
|
import { Slogan } from "./components/Content/components/Slogan/slogan";
|
|
26
27
|
import { Divider } from "./components/Content/components/Slogan/slogan.styles";
|
|
@@ -92,7 +93,11 @@ export const Header = ({ ...headerProps }: HeaderProps): JSX.Element => {
|
|
|
92
93
|
<Center>
|
|
93
94
|
{/* Center navigation */}
|
|
94
95
|
{isIn.isCenterNavigationIn && (
|
|
95
|
-
<DXNavigation
|
|
96
|
+
<DXNavigation
|
|
97
|
+
{...navigationProps}
|
|
98
|
+
testId={NAVIGATION_TEST_ID}
|
|
99
|
+
links={navItemsC}
|
|
100
|
+
/>
|
|
96
101
|
)}
|
|
97
102
|
</Center>
|
|
98
103
|
</Fade>
|
package/src/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.tsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
2
|
import { SidebarLabel } from "./sidebarLabel";
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
const meta = {
|
|
6
5
|
argTypes: {
|
|
7
6
|
label: { control: "text" },
|
|
8
7
|
},
|
|
9
8
|
component: SidebarLabel,
|
|
10
9
|
title: "Components/Label",
|
|
11
|
-
}
|
|
10
|
+
} satisfies Meta<typeof SidebarLabel>;
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
<SidebarLabel {...args} />
|
|
15
|
-
);
|
|
12
|
+
export default meta;
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const SidebarLabelStory: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
label: "Filter",
|
|
19
|
+
},
|
|
20
20
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { fn } from "@storybook/test";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { Sidebar } from "./sidebar";
|
|
4
5
|
|
|
@@ -46,5 +47,6 @@ export const TemporaryOpenSidebarStory: Story = {
|
|
|
46
47
|
args: {
|
|
47
48
|
children: <div />,
|
|
48
49
|
drawerOpen: true,
|
|
50
|
+
onDrawerClose: fn(),
|
|
49
51
|
},
|
|
50
52
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
2
|
import { Links } from "./links";
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
const FACEBOOK_URL = "https://www.facebook.com";
|
|
5
|
+
const GOOGLE_URL = "https://www.google.com";
|
|
6
|
+
const TWITTER_URL = "https://www.twitter.com";
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
6
9
|
argTypes: {
|
|
7
|
-
links: { control: "
|
|
10
|
+
links: { control: "object" },
|
|
8
11
|
},
|
|
9
12
|
component: Links,
|
|
10
13
|
title: "Components/Deprecated/Links",
|
|
11
|
-
}
|
|
14
|
+
} satisfies Meta<typeof Links>;
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
<Links {...args} />
|
|
15
|
-
);
|
|
16
|
+
export default meta;
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
const GOOGLE_URL = "https://www.google.com";
|
|
19
|
-
const TWITTER_URL = "https://www.twitter.com";
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
20
19
|
|
|
21
|
-
export const LinksStory =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
export const LinksStory: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
links: [
|
|
23
|
+
{ label: "Facebook", url: FACEBOOK_URL },
|
|
24
|
+
{ label: "Google", url: GOOGLE_URL },
|
|
25
|
+
{ label: "Twitter", url: TWITTER_URL },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
28
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { PAPER_PANEL_STYLE } from "../common/Paper/paper";
|
|
4
4
|
import { Loading } from "./loading";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const meta = {
|
|
7
7
|
argTypes: {
|
|
8
|
-
|
|
8
|
+
appear: { control: "boolean" },
|
|
9
|
+
iconSize: { control: "select", options: ["small", "medium", "large"] },
|
|
9
10
|
loading: { control: "boolean" },
|
|
10
11
|
panelStyle: {
|
|
11
12
|
control: "select",
|
|
@@ -29,13 +30,14 @@ export default {
|
|
|
29
30
|
),
|
|
30
31
|
],
|
|
31
32
|
title: "Components/Communication/Loading",
|
|
32
|
-
}
|
|
33
|
+
} satisfies Meta<typeof Loading>;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
<Loading {...args} />
|
|
36
|
-
);
|
|
35
|
+
export default meta;
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
38
|
+
|
|
39
|
+
export const LoadingStory: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
loading: true,
|
|
42
|
+
},
|
|
41
43
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "../Button/button";
|
|
3
|
+
import { Props } from "./types";
|
|
4
|
+
|
|
5
|
+
export const Buttons = <P,>({
|
|
6
|
+
className,
|
|
7
|
+
handleLogin,
|
|
8
|
+
providers = [],
|
|
9
|
+
...props /* Mui ButtonProps */
|
|
10
|
+
}: Props<P>): JSX.Element[] => {
|
|
11
|
+
return providers?.map((provider) => (
|
|
12
|
+
<Button
|
|
13
|
+
key={provider.id}
|
|
14
|
+
className={className}
|
|
15
|
+
endIcon={"icon" in provider && provider.icon}
|
|
16
|
+
onClick={() => handleLogin(provider.id)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{provider.name}
|
|
20
|
+
</Button>
|
|
21
|
+
));
|
|
22
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps } from "@mui/material";
|
|
2
|
+
import { ClientSafeProvider } from "next-auth/react";
|
|
3
|
+
import { OAuthProvider } from "../../../../config/entities";
|
|
4
|
+
import { BaseComponentProps } from "../../../../theme/common/entities";
|
|
5
|
+
|
|
6
|
+
export interface Props<P> extends BaseComponentProps, ButtonProps {
|
|
7
|
+
handleLogin: (providerId: string) => void;
|
|
8
|
+
providers?: ClientSafeProvider[] | OAuthProvider<P>[];
|
|
9
|
+
}
|