@databiosphere/findable-ui 50.6.0 → 50.7.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/README.md +32 -19
- 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/types.d.ts +4 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +1 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +4 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +23 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +8 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.js +1 -0
- package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.d.ts +2 -0
- package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.js +10 -0
- package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.d.ts +7 -0
- package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.js +1 -0
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +8 -0
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +36 -0
- package/lib/components/Export/components/ExportMethod/exportMethod.stories.d.ts +22 -0
- package/lib/components/Export/components/ExportMethod/exportMethod.stories.js +20 -0
- package/lib/components/Filter/components/Filter/filter.stories.d.ts +25 -0
- package/lib/components/Filter/components/Filter/filter.stories.js +42 -0
- package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +16 -0
- package/lib/components/Filter/components/FilterTag/filterTag.stories.js +17 -0
- package/lib/components/Filter/components/Filters/components/CategoryLabel/categoryLabel.d.ts +9 -0
- package/lib/components/Filter/components/Filters/components/CategoryLabel/categoryLabel.js +15 -0
- package/lib/components/Filter/components/Filters/components/Controls/controls.d.ts +12 -0
- package/lib/components/Filter/components/Filters/components/Controls/controls.js +20 -0
- package/lib/components/Filter/components/Filters/components/Controls/controls.styles.d.ts +5 -0
- package/lib/components/Filter/components/Filters/components/Controls/controls.styles.js +7 -0
- package/lib/components/Filter/components/Filters/components/Controls/types.d.ts +6 -0
- package/lib/components/Filter/components/Filters/components/Controls/types.js +1 -0
- package/lib/components/Filter/components/Filters/filters.stories.d.ts +6 -0
- package/lib/components/Filter/components/Filters/filters.stories.js +91 -0
- package/lib/components/Filter/components/SearchAllFilters/components/AutocompletePopper/autocompletePopper.styles.d.ts +3 -0
- package/lib/components/Filter/components/SearchAllFilters/components/AutocompletePopper/autocompletePopper.styles.js +15 -0
- package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.stories.d.ts +6 -0
- package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.stories.js +82 -0
- package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.d.ts +1 -0
- package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.js +14 -0
- package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.d.ts +2 -0
- package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.js +12 -0
- package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.d.ts +5 -0
- package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.js +34 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/constants.d.ts +5 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/constants.js +5 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/endAdornment.d.ts +2 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/endAdornment.js +19 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/endAdornment.styles.d.ts +12 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/endAdornment.styles.js +22 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/types.d.ts +4 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/types.js +1 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/utils.d.ts +8 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/EndAdornment/utils.js +14 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/components/Title/title.d.ts +2 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/components/Title/title.js +15 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/components/Title/types.d.ts +7 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/components/Title/types.js +1 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/constants.d.ts +2 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/constants.js +27 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/hook.d.ts +9 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/hook.js +16 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/tooltip.d.ts +2 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/tooltip.js +11 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/types.d.ts +5 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/components/Tooltip/types.js +1 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/resultSummary.d.ts +2 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/resultSummary.js +17 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/resultSummary.styles.d.ts +5 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/resultSummary.styles.js +10 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/types.d.ts +8 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/types.js +1 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/utils.d.ts +7 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/components/ResultSummary/utils.js +19 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/constants.d.ts +2 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/constants.js +10 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/facetAssistant.d.ts +6 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/facetAssistant.js +70 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/facetAssistant.styles.d.ts +8 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/facetAssistant.styles.js +14 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/stories/aiFacetAssistant.stories.d.ts +6 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/stories/aiFacetAssistant.stories.js +12 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/types.d.ts +13 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/types.js +1 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/utils.d.ts +15 -0
- package/lib/components/Filter/components/ai/components/FacetAssistant/utils.js +91 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/aiSwitch.d.ts +9 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/aiSwitch.js +16 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/aiSwitch.styles.d.ts +3 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/aiSwitch.styles.js +9 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/stories/aiSwitch.stories.d.ts +6 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/stories/aiSwitch.stories.js +8 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/types.d.ts +4 -0
- package/lib/components/Filter/components/controls/Controls/components/AiSwitch/types.js +1 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/Button/button.d.ts +10 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/Button/button.js +16 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/Button/button.styles.d.ts +6 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/Button/button.styles.js +18 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/Button/types.d.ts +2 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/Button/types.js +1 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/constants.d.ts +2 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/constants.js +4 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/iconButton.d.ts +10 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/iconButton.js +18 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/iconButton.styles.d.ts +6 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/iconButton.styles.js +13 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/types.d.ts +2 -0
- package/lib/components/Filter/components/controls/Controls/components/FilterSort/components/IconButton/types.js +1 -0
- package/lib/components/Filter/components/surfaces/drawer/components/Button/types.d.ts +4 -0
- package/lib/components/Filter/components/surfaces/drawer/components/Button/types.js +1 -0
- package/lib/components/Index/components/Cell/cell.d.ts +7 -0
- package/lib/components/Index/components/Cell/cell.js +10 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +20 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +13 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.js +12 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +10 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +10 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +91 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +132 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +230 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.js +7 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.js +29 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.d.ts +4 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.js +70 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.d.ts +7 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +18 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/constants.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.d.ts +7 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.js +11 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +97 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +15 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +8 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/utils.d.ts +14 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +23 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.js +14 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/types.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/constants.js +1 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.js +15 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.styles.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.styles.js +20 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.js +14 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.d.ts +13 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.js +5 -0
- package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.d.ts +8 -0
- package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.js +50 -0
- package/lib/components/Index/components/EntitiesView/types.d.ts +8 -0
- package/lib/components/Index/components/EntitiesView/types.js +1 -0
- package/lib/components/Index/components/Hero/components/ExportButton/exportButton.d.ts +1 -0
- package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +13 -0
- package/lib/components/Index/components/Hero/components/ExportButton/exportButton.styles.d.ts +3 -0
- package/lib/components/Index/components/Hero/components/ExportButton/exportButton.styles.js +13 -0
- package/lib/components/Index/components/Hero/components/Summaries/stories/summaries.stories.d.ts +6 -0
- package/lib/components/Index/components/Hero/components/Summaries/stories/summaries.stories.js +14 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.d.ts +9 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.js +12 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +13 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +18 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.styles.d.ts +7 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.styles.js +26 -0
- package/lib/components/Index/components/Hero/hero.d.ts +11 -0
- package/lib/components/Index/components/Hero/hero.js +12 -0
- package/lib/components/Index/components/Hero/hero.stories.d.ts +23 -0
- package/lib/components/Index/components/Hero/hero.stories.js +22 -0
- package/lib/components/Index/components/Hero/hero.styles.d.ts +16 -0
- package/lib/components/Index/components/Hero/hero.styles.js +44 -0
- package/lib/components/Index/components/Hero/stories/hero.stories.d.ts +6 -0
- package/lib/components/Index/components/Hero/stories/hero.stories.js +16 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +8 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +57 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +4 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +10 -0
- package/lib/components/Index/components/NTag/nTag.d.ts +10 -0
- package/lib/components/Index/components/NTag/nTag.js +8 -0
- package/lib/components/Index/components/NTagCell/nTagCell.d.ts +11 -0
- package/lib/components/Index/components/NTagCell/nTagCell.js +29 -0
- package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +5 -0
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +16 -0
- package/lib/components/Index/components/Tabs/common/utils.d.ts +8 -0
- package/lib/components/Index/components/Tabs/common/utils.js +19 -0
- package/lib/components/Index/components/Tabs/tabs.d.ts +1 -0
- package/lib/components/Index/components/Tabs/tabs.js +20 -0
- package/lib/components/Index/components/TitleCell/titleCell.d.ts +6 -0
- package/lib/components/Index/components/TitleCell/titleCell.js +10 -0
- package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +3 -0
- package/lib/components/Index/components/TitleCell/titleCell.styles.js +6 -0
- package/lib/components/Index/index.stories.d.ts +6 -0
- package/lib/components/Index/index.stories.js +26 -0
- package/lib/components/Index/stories/index.stories.d.ts +6 -0
- package/lib/components/Index/stories/index.stories.js +17 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +6 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +10 -0
- package/lib/components/Layout/components/Footer/footer.stories.d.ts +27 -0
- package/lib/components/Layout/components/Footer/footer.stories.js +64 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +29 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +6 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +13 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +36 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +9 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +10 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +36 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +9 -0
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +5 -0
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +19 -0
- package/lib/components/Layout/components/Outline/common/constants.d.ts +2 -0
- package/lib/components/Layout/components/Outline/common/constants.js +1 -0
- package/lib/components/Login/login.stories.d.ts +6 -0
- package/lib/components/Login/login.stories.js +31 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +16 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +28 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +5 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +46 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +3 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +21 -0
- package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.d.ts +6 -0
- package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.js +17 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +2 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
- package/lib/components/Table/components/Pagination/pagination.d.ts +9 -0
- package/lib/components/Table/components/Pagination/pagination.js +19 -0
- package/lib/components/Table/components/Pagination/pagination.stories.d.ts +28 -0
- package/lib/components/Table/components/Pagination/pagination.stories.js +24 -0
- package/lib/components/Table/components/Pagination/pagination.styles.d.ts +4 -0
- package/lib/components/Table/components/Pagination/pagination.styles.js +15 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.d.ts +3 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.js +3 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.d.ts +8 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.js +18 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/types.d.ts +4 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/types.js +1 -0
- package/lib/components/Table/components/TableBody/utils.d.ts +12 -0
- package/lib/components/Table/components/TableBody/utils.js +17 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.js +1 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/types.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/types.js +1 -0
- package/lib/components/TableCreator/common/constants.d.ts +6 -0
- package/lib/components/TableCreator/common/constants.js +19 -0
- package/lib/components/TableCreator/common/entities.d.ts +5 -0
- package/lib/components/TableCreator/common/entities.js +1 -0
- package/lib/components/TableCreator/tableCreator.styles.d.ts +4 -0
- package/lib/components/TableCreator/tableCreator.styles.js +4 -0
- package/lib/components/common/Alert/alert.stories.d.ts +6 -0
- package/lib/components/common/Alert/alert.stories.js +36 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +4 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +19 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +7 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +5 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +3 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +19 -0
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +10 -0
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +16 -0
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +3 -0
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +21 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +3 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.js +6 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +7 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +11 -0
- package/lib/components/common/CustomIcon/components/AiIcon/aiIcon.d.ts +2 -0
- package/lib/components/common/CustomIcon/components/AiIcon/aiIcon.js +6 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +5 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +10 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +3 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +9 -0
- package/lib/components/common/Switch/provider/context.d.ts +2 -0
- package/lib/components/common/Switch/provider/context.js +6 -0
- package/lib/components/common/Switch/provider/hook.d.ts +6 -0
- package/lib/components/common/Switch/provider/hook.js +9 -0
- package/lib/components/common/Switch/provider/provider.d.ts +9 -0
- package/lib/components/common/Switch/provider/provider.js +16 -0
- package/lib/components/common/Switch/provider/types.d.ts +6 -0
- package/lib/components/common/Switch/provider/types.js +1 -0
- package/lib/hooks/useAuthentication/common/constants.d.ts +4 -0
- package/lib/hooks/useAuthentication/common/constants.js +19 -0
- package/lib/hooks/useAuthentication/common/entities.d.ts +25 -0
- package/lib/hooks/useAuthentication/common/entities.js +11 -0
- package/lib/hooks/useAuthentication/common/utils.d.ts +15 -0
- package/lib/hooks/useAuthentication/common/utils.js +25 -0
- package/lib/hooks/useAuthentication/useAuthentication.d.ts +6 -0
- package/lib/hooks/useAuthentication/useAuthentication.js +9 -0
- package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +6 -0
- package/lib/hooks/useAuthentication/useAuthenticationComplete.js +55 -0
- package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +20 -0
- package/lib/hooks/useAuthentication/useAuthenticationForm.js +88 -0
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +18 -0
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +50 -0
- package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +20 -0
- package/lib/hooks/useAuthentication/useAuthenticationStatus.js +32 -0
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +21 -0
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +41 -0
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +18 -0
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +62 -0
- package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +24 -0
- package/lib/hooks/useAuthentication/useFetchTerraProfile.js +62 -0
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +15 -0
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +62 -0
- package/lib/hooks/useAuthentication/useTokenClient.d.ts +11 -0
- package/lib/hooks/useAuthentication/useTokenClient.js +29 -0
- package/lib/hooks/useAuthenticationConfig.d.ts +6 -0
- package/lib/hooks/useAuthenticationConfig.js +14 -0
- package/lib/hooks/useCategoryConfigs.d.ts +6 -0
- package/lib/hooks/useCategoryConfigs.js +17 -0
- package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
- package/lib/hooks/useEntityListRelatedView.js +62 -0
- package/lib/hooks/useExploreMode.d.ts +14 -0
- package/lib/hooks/useExploreMode.js +20 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +15 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +27 -0
- package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +5 -0
- package/lib/hooks/useFileManifest/useFileManifestURL.js +11 -0
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +9 -0
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +37 -0
- package/lib/hooks/useLayoutState.d.ts +6 -0
- package/lib/hooks/useLayoutState.js +9 -0
- package/lib/hooks/useMenu.d.ts +10 -0
- package/lib/hooks/useMenu.js +17 -0
- package/lib/hooks/useMenuWithPosition.d.ts +14 -0
- package/lib/hooks/useMenuWithPosition.js +33 -0
- package/lib/hooks/useScroll.d.ts +10 -0
- package/lib/hooks/useScroll.js +12 -0
- package/lib/hooks/useSessionTimeout.d.ts +11 -0
- package/lib/hooks/useSessionTimeout.js +28 -0
- package/lib/mocks/@storybook/addon-actions.d.ts +9 -0
- package/lib/mocks/@storybook/addon-actions.js +9 -0
- package/lib/providers/authentication.d.ts +51 -0
- package/lib/providers/authentication.js +110 -0
- package/lib/providers/layoutState.d.ts +40 -0
- package/lib/providers/layoutState.js +47 -0
- package/lib/styles/common/mixins/colors.d.ts +25 -0
- package/lib/styles/common/mixins/colors.js +32 -0
- package/lib/styles/common/mixins/fonts.d.ts +16 -0
- package/lib/styles/common/mixins/fonts.js +30 -0
- package/lib/styles/common/mixins/shadows.d.ts +3 -0
- package/lib/styles/common/mixins/shadows.js +4 -0
- package/lib/styles/common/mui/palette.d.ts +47 -0
- package/lib/styles/common/mui/palette.js +47 -0
- package/lib/styles/common/mui/switch.d.ts +7 -0
- package/lib/styles/common/mui/switch.js +13 -0
- package/lib/theme/common/entities.d.ts +6 -0
- package/lib/theme/common/entities.js +1 -0
- package/lib/theme/components/muiSwitch.d.ts +2 -0
- package/lib/theme/components/muiSwitch.js +52 -0
- package/lib/utils/form.d.ts +8 -0
- package/lib/utils/form.js +17 -0
- package/lib/views/ExploreView/components/filters/Search/search.d.ts +12 -0
- package/lib/views/ExploreView/components/filters/Search/search.js +19 -0
- package/package.json +6 -1
- package/.eslintignore +0 -5
- package/.eslintrc.json +0 -79
- package/.github/copilot-instructions.md +0 -176
- package/.github/workflows/release-please.yml +0 -49
- package/.github/workflows/run-checks.yml +0 -57
- package/.husky/commit-msg +0 -18
- package/.husky/pre-commit +0 -43
- package/.prettierignore +0 -19
- package/.prettierrc.json +0 -1
- package/.release-please-manifest.json +0 -3
- package/.storybook/main.ts +0 -10
- package/.storybook/preview-head.html +0 -4
- package/.storybook/preview.js +0 -6
- package/CHANGELOG.md +0 -1117
- package/CLAUDE.md +0 -214
- package/backend/README.md +0 -64
- package/backend/__init__.py +0 -0
- package/backend/controllers/__init__.py +0 -0
- package/backend/controllers/facets_controller.py +0 -16
- package/backend/controllers/models.py +0 -11
- package/backend/main.py +0 -8
- package/backend/requirements.txt +0 -4
- package/backend/services/__init__.py +0 -0
- package/backend/services/facets_service.py +0 -68
- package/backend/services/models.py +0 -43
- package/commitlint.config.js +0 -1
- package/docs/TRUSTED_PUBLISHING.md +0 -132
- package/jest.config.js +0 -6
- package/release-please-config.json +0 -23
- package/tests/azulFileDownload.test.tsx +0 -96
- package/tests/buildCategoryViews.test.ts +0 -282
- package/tests/buildRequestFilters.test.ts +0 -60
- package/tests/buildRequestManifest.test.ts +0 -103
- package/tests/chart.test.tsx +0 -274
- package/tests/chartSortUtils.test.ts +0 -119
- package/tests/chartView.test.tsx +0 -48
- package/tests/dataDictionaryColumnFilters.test.tsx +0 -101
- package/tests/dataDictionary_utils.test.ts +0 -153
- package/tests/fetchApi.test.ts +0 -93
- package/tests/filter.test.tsx +0 -100
- package/tests/filterMenu.test.ts +0 -100
- package/tests/filterRange.test.tsx +0 -372
- package/tests/filterSortUtils.test.ts +0 -180
- package/tests/filters.test.tsx +0 -61
- package/tests/getFacetedMinMaxValues.test.ts +0 -166
- package/tests/getFilterSortType.test.ts +0 -45
- package/tests/getProfileStatus.test.ts +0 -290
- package/tests/linkCell.test.tsx +0 -89
- package/tests/markdownCell.test.tsx +0 -52
- package/tests/provider.test.tsx +0 -189
- package/tests/research.chatState.test.ts +0 -463
- package/tests/research.fetchResponse.test.ts +0 -164
- package/tests/research.queryProvider.test.ts +0 -321
- package/tests/research.useKeyShortCuts.test.ts +0 -256
- package/tests/rowSelectionValidation.test.ts +0 -282
- package/tests/setup.ts +0 -19
- package/tests/stepIcon.test.tsx +0 -42
- package/tests/tableFilter.test.tsx +0 -90
- package/tests/terraProfileProvider.test.tsx +0 -117
- package/tests/theme.test.ts +0 -465
- package/tests/toggleButtonGroupProvider.test.tsx +0 -125
- package/tests/transformRoute.test.ts +0 -21
- package/tests/tsconfig.json +0 -8
- package/tests/useFileLocation.test.ts +0 -36
- package/tests/useRequestManifest.test.ts +0 -201
- package/tests/useRouteHistory.test.ts +0 -97
- package/tests/useSessionActive.test.ts +0 -106
- package/tests/useWindowResize.test.ts +0 -130
- package/tests/viewModelBuilders_utils.test.ts +0 -58
- package/tests/viewToggle.test.tsx +0 -54
- package/tsconfig.json +0 -25
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { mediaDesktopUp } from "../../../../../styles/common/mixins/breakpoints";
|
|
3
|
+
import { BannerPrimary } from "../BannerPrimary/bannerPrimary";
|
|
4
|
+
export const Banner = styled(BannerPrimary) `
|
|
5
|
+
gap: 12px;
|
|
6
|
+
padding: 8px 12px;
|
|
7
|
+
|
|
8
|
+
${mediaDesktopUp} {
|
|
9
|
+
padding: 8px 16px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.MuiAlert-message {
|
|
13
|
+
align-self: center;
|
|
14
|
+
flex: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.MuiAlert-action {
|
|
18
|
+
margin: -8px;
|
|
19
|
+
padding: 0;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoginButton as Button, LoginButtonText } from "./loginButton.styles";
|
|
3
|
+
export const LoginButton = ({ children, ...props }) => {
|
|
4
|
+
return (React.createElement(Button, { fullWidth: true, ...props },
|
|
5
|
+
React.createElement(LoginButtonText, null, children)));
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const LoginButton: import("@emotion/styled").StyledComponent<Omit<import("../../button").ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
}, {}, {}>;
|
|
4
|
+
export declare const LoginButtonText: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { ButtonSecondary } from "../ButtonSecondary/buttonSecondary";
|
|
3
|
+
export const LoginButton = styled(ButtonSecondary) `
|
|
4
|
+
.MuiButton-endIcon {
|
|
5
|
+
margin-right: -6px;
|
|
6
|
+
}
|
|
7
|
+
`;
|
|
8
|
+
export const LoginButtonText = styled.span `
|
|
9
|
+
flex: 1;
|
|
10
|
+
text-align: left;
|
|
11
|
+
`;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SvgIcon } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export const AiIcon = ({ fontSize = "xsmall", viewBox = "0 0 18 18", ...props }) => {
|
|
4
|
+
return (React.createElement(SvgIcon, { fontSize: fontSize, viewBox: viewBox, ...props },
|
|
5
|
+
React.createElement("path", { d: "M11.1162 6.90234C11.2961 6.9024 11.4745 6.95105 11.6299 7.0459C11.7834 7.15171 11.9008 7.30216 11.9668 7.47656L12.4541 8.94238C12.5992 9.39219 12.8493 9.80169 13.1836 10.1357C13.5179 10.4698 13.9271 10.7196 14.377 10.8643L15.8086 11.3711C15.9838 11.4261 16.1357 11.5388 16.2393 11.6904C16.3538 11.8377 16.4141 12.0176 16.4141 12.2041C16.4201 12.3885 16.3638 12.5695 16.2539 12.7178C16.1489 12.8712 15.9952 12.9849 15.8174 13.0391L14.376 13.5176C13.9309 13.6649 13.5259 13.9143 13.1953 14.2432C12.8635 14.5732 12.6151 14.9777 12.4707 15.4229L11.9639 16.8564C11.9131 17.0291 11.8064 17.18 11.6611 17.2861C11.5075 17.3914 11.3249 17.4481 11.1387 17.4473C10.9518 17.4552 10.7677 17.4003 10.6152 17.292C10.4626 17.1835 10.3499 17.0269 10.2959 16.8477L9.81543 15.4082C9.67122 14.9623 9.42202 14.5571 9.08984 14.2266C8.75607 13.8994 8.35384 13.6486 7.91211 13.4932L6.4707 13.0225C6.30005 12.9623 6.1501 12.8536 6.04004 12.71C5.92966 12.5587 5.86835 12.3767 5.86426 12.1895C5.8602 12.0023 5.91297 11.818 6.0166 11.6621C6.12376 11.5087 6.28117 11.3967 6.46094 11.3447L7.91016 10.8643C8.36039 10.7198 8.76986 10.4698 9.10449 10.1357C9.43912 9.80168 9.68974 9.39237 9.83496 8.94238L10.3145 7.51953C10.3633 7.34377 10.4677 7.18839 10.6123 7.07715C10.7569 6.96592 10.9338 6.90453 11.1162 6.90234ZM3.95801 2.82129C4.12861 2.81526 4.29719 2.86268 4.43945 2.95703C4.58008 3.05192 4.68784 3.18609 4.75 3.34473L5.10547 4.42285C5.20929 4.72108 5.37924 4.99253 5.60254 5.21582C5.82576 5.43896 6.09645 5.60911 6.39453 5.71289L7.44824 6.07617C7.60554 6.13033 7.74148 6.23319 7.83594 6.37012C7.93346 6.50778 7.98686 6.67407 7.9873 6.84277C7.9873 7.00805 7.93636 7.17082 7.84473 7.30664C7.7462 7.44318 7.60737 7.54552 7.44824 7.60059L6.38477 7.95605C6.08795 8.05868 5.81737 8.22579 5.59277 8.44531C5.37385 8.67009 5.20759 8.94062 5.10547 9.2373L4.74219 10.2832C4.69127 10.4445 4.58709 10.5836 4.44727 10.6787C4.30958 10.7762 4.14528 10.8287 3.97656 10.8291C3.80348 10.8284 3.63463 10.7733 3.49512 10.6709C3.36155 10.5712 3.26187 10.4325 3.20898 10.2744L2.86328 9.2207C2.7618 8.92528 2.59446 8.65685 2.37402 8.43555C2.15786 8.21005 1.8886 8.04258 1.59082 7.94824L0.536133 7.59277C0.373071 7.54121 0.231772 7.43734 0.132812 7.29785C0.0654437 7.19277 0.0217393 7.074 0.00585938 6.9502C-0.00996064 6.82648 0.00237279 6.70062 0.0410156 6.58203C0.0796627 6.46357 0.143911 6.35521 0.229492 6.26465C0.315194 6.17404 0.419905 6.10284 0.536133 6.05762L1.59082 5.71387C1.88888 5.60991 2.15969 5.4401 2.38281 5.2168C2.60612 4.99321 2.77627 4.72139 2.87988 4.42285L3.22559 3.38574C3.27404 3.22976 3.36761 3.09134 3.49512 2.98926C3.6284 2.88694 3.79014 2.82858 3.95801 2.82129ZM10.5156 0C10.6744 0.00096508 10.8295 0.0481569 10.9619 0.135742C11.0814 0.223688 11.1752 0.342585 11.2324 0.479492L11.4092 1.01953C11.4462 1.12253 11.503 1.21738 11.5771 1.29785C11.6552 1.37117 11.7475 1.42785 11.8477 1.46582L12.3789 1.64258C12.5138 1.69519 12.6326 1.78307 12.7227 1.89648C12.8148 2.0212 12.8657 2.17211 12.8672 2.32715C12.8604 2.48067 12.8099 2.62938 12.7227 2.75586C12.6359 2.87601 12.5125 2.9664 12.3711 3.01074L11.8477 3.1875C11.7459 3.22224 11.6532 3.28042 11.5771 3.35645C11.5013 3.43235 11.4439 3.52446 11.4092 3.62598L11.2236 4.1582C11.1708 4.2862 11.0866 4.39887 10.9785 4.48535C10.8544 4.58537 10.6994 4.63934 10.54 4.6377C10.3947 4.6291 10.2533 4.58578 10.1279 4.51172C10.0019 4.41845 9.90815 4.28692 9.85742 4.13965L9.68066 3.61816C9.64957 3.51476 9.59193 3.42101 9.5127 3.34766C9.43748 3.26809 9.34767 3.21243 9.24414 3.17969L8.7207 3.01074C8.58124 2.95739 8.45889 2.86686 8.36719 2.74902C8.27882 2.62302 8.23145 2.47218 8.23145 2.31836C8.23828 2.1649 8.28774 2.01608 8.375 1.88965C8.46456 1.77156 8.58796 1.68372 8.72852 1.63672L9.24219 1.46582C9.34512 1.42931 9.43985 1.37247 9.52051 1.29883C9.59458 1.21843 9.65249 1.12437 9.68945 1.02148L9.86621 0.49707C9.91523 0.366571 9.99619 0.250293 10.1025 0.160156C10.2227 0.0698452 10.3661 0.0145692 10.5156 0Z", fill: "currentColor" })));
|
|
6
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoadingIcon } from "../../../CustomIcon/components/LoadingIcon/loadingIcon";
|
|
3
|
+
import { MockIconButtonPrimary } from "../../iconButton.styles";
|
|
4
|
+
/**
|
|
5
|
+
* Mock "loading" icon button - a placeholder element styled like a primary icon button without the use of a button element.
|
|
6
|
+
*/
|
|
7
|
+
export const LoadingIconButton = () => {
|
|
8
|
+
return (React.createElement(MockIconButtonPrimary, null,
|
|
9
|
+
React.createElement(LoadingIcon, { fontSize: "small" })));
|
|
10
|
+
};
|
package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, unknown>;
|
|
2
|
+
export default _default;
|
|
3
|
+
export declare const LoadingIconButtonStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, unknown>;
|
package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoadingIconButton } from "./loadingIconButton";
|
|
3
|
+
export default {
|
|
4
|
+
component: LoadingIconButton,
|
|
5
|
+
title: "Components/Common/IconButton/Download",
|
|
6
|
+
};
|
|
7
|
+
const LoadingIconButtonTemplate = () => React.createElement(LoadingIconButton, null);
|
|
8
|
+
export const LoadingIconButtonStory = LoadingIconButtonTemplate.bind({});
|
|
9
|
+
LoadingIconButtonStory.args = {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SwitchProviderProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Switch provider component.
|
|
4
|
+
* Manages switch state for child components.
|
|
5
|
+
* @param props - Component props.
|
|
6
|
+
* @param props.children - Child elements to render.
|
|
7
|
+
* @returns Switch provider component.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SwitchProvider({ children }: SwitchProviderProps): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { SwitchContext } from "./context";
|
|
3
|
+
/**
|
|
4
|
+
* Switch provider component.
|
|
5
|
+
* Manages switch state for child components.
|
|
6
|
+
* @param props - Component props.
|
|
7
|
+
* @param props.children - Child elements to render.
|
|
8
|
+
* @returns Switch provider component.
|
|
9
|
+
*/
|
|
10
|
+
export function SwitchProvider({ children }) {
|
|
11
|
+
const [checked, setChecked] = useState(false);
|
|
12
|
+
const onChange = useCallback((e) => setChecked(e.target.checked), []);
|
|
13
|
+
return (React.createElement(SwitchContext.Provider, { value: { checked, onChange } }, typeof children === "function"
|
|
14
|
+
? children({ checked, onChange })
|
|
15
|
+
: children));
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SwitchProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export type SwitchContextProps = Pick<SwitchProps, "checked" | "onChange">;
|
|
4
|
+
export type SwitchProviderProps = {
|
|
5
|
+
children: ReactNode | ((props: SwitchContextProps) => ReactNode);
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LoginResponse, LoginStatus } from "./entities";
|
|
2
|
+
export declare const LOGIN_STATUS_FAILED: LoginStatus<LoginResponse>;
|
|
3
|
+
export declare const LOGIN_STATUS_NOT_STARTED: LoginStatus<LoginResponse>;
|
|
4
|
+
export declare const LOGIN_STATUS_NOT_SUPPORTED: LoginStatus<LoginResponse>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { REQUEST_STATUS } from "./entities";
|
|
2
|
+
export const LOGIN_STATUS_FAILED = {
|
|
3
|
+
isSuccess: false,
|
|
4
|
+
isSupported: true,
|
|
5
|
+
requestStatus: REQUEST_STATUS.FAILED,
|
|
6
|
+
response: undefined,
|
|
7
|
+
};
|
|
8
|
+
export const LOGIN_STATUS_NOT_STARTED = {
|
|
9
|
+
isSuccess: false,
|
|
10
|
+
isSupported: true,
|
|
11
|
+
requestStatus: REQUEST_STATUS.NOT_STARTED,
|
|
12
|
+
response: undefined,
|
|
13
|
+
};
|
|
14
|
+
export const LOGIN_STATUS_NOT_SUPPORTED = {
|
|
15
|
+
isSuccess: false,
|
|
16
|
+
isSupported: false,
|
|
17
|
+
requestStatus: REQUEST_STATUS.NOT_STARTED,
|
|
18
|
+
response: undefined,
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GoogleResponse } from "../useFetchGoogleProfile";
|
|
2
|
+
import { TerraNIHResponse } from "../useFetchTerraNIHProfile";
|
|
3
|
+
import { TerraResponse } from "../useFetchTerraProfile";
|
|
4
|
+
import { TerraTermsOfServiceResponse } from "../useFetchTerraTermsOfService";
|
|
5
|
+
export declare enum AUTHENTICATION_STATUS {
|
|
6
|
+
COMPLETED = "COMPLETED",
|
|
7
|
+
INCOMPLETE = "INCOMPLETE"
|
|
8
|
+
}
|
|
9
|
+
export type LoginResponse = GoogleResponse | TerraResponse | TerraNIHResponse | TerraTermsOfServiceResponse;
|
|
10
|
+
export interface LoginResponseError {
|
|
11
|
+
message: string;
|
|
12
|
+
source: string;
|
|
13
|
+
statusCode: number;
|
|
14
|
+
}
|
|
15
|
+
export interface LoginStatus<T> {
|
|
16
|
+
isSuccess: boolean;
|
|
17
|
+
isSupported: boolean;
|
|
18
|
+
requestStatus: REQUEST_STATUS;
|
|
19
|
+
response: T | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare enum REQUEST_STATUS {
|
|
22
|
+
COMPLETED = "COMPLETED",
|
|
23
|
+
FAILED = "FAILED",
|
|
24
|
+
NOT_STARTED = "NOT_STARTED"
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var AUTHENTICATION_STATUS;
|
|
2
|
+
(function (AUTHENTICATION_STATUS) {
|
|
3
|
+
AUTHENTICATION_STATUS["COMPLETED"] = "COMPLETED";
|
|
4
|
+
AUTHENTICATION_STATUS["INCOMPLETE"] = "INCOMPLETE";
|
|
5
|
+
})(AUTHENTICATION_STATUS || (AUTHENTICATION_STATUS = {}));
|
|
6
|
+
export var REQUEST_STATUS;
|
|
7
|
+
(function (REQUEST_STATUS) {
|
|
8
|
+
REQUEST_STATUS["COMPLETED"] = "COMPLETED";
|
|
9
|
+
REQUEST_STATUS["FAILED"] = "FAILED";
|
|
10
|
+
REQUEST_STATUS["NOT_STARTED"] = "NOT_STARTED";
|
|
11
|
+
})(REQUEST_STATUS || (REQUEST_STATUS = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LoginResponse, LoginStatus } from "./entities";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the options for an authentication request.
|
|
4
|
+
* @param token - Token.
|
|
5
|
+
* @returns request options.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getAuthenticationRequestOptions(token: string): RequestInit;
|
|
8
|
+
/**
|
|
9
|
+
* Returns login status.
|
|
10
|
+
* An undefined endpoint will return a not supported login status,
|
|
11
|
+
* otherwise a not started login status is returned.
|
|
12
|
+
* @param endpoint - Endpoint.
|
|
13
|
+
* @returns initial login status.
|
|
14
|
+
*/
|
|
15
|
+
export declare function initLoginStatus(endpoint?: string): LoginStatus<LoginResponse>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LOGIN_STATUS_NOT_STARTED, LOGIN_STATUS_NOT_SUPPORTED, } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the options for an authentication request.
|
|
4
|
+
* @param token - Token.
|
|
5
|
+
* @returns request options.
|
|
6
|
+
*/
|
|
7
|
+
export function getAuthenticationRequestOptions(token) {
|
|
8
|
+
const headers = new Headers();
|
|
9
|
+
headers.append("authorization", "Bearer " + token);
|
|
10
|
+
return { headers };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns login status.
|
|
14
|
+
* An undefined endpoint will return a not supported login status,
|
|
15
|
+
* otherwise a not started login status is returned.
|
|
16
|
+
* @param endpoint - Endpoint.
|
|
17
|
+
* @returns initial login status.
|
|
18
|
+
*/
|
|
19
|
+
export function initLoginStatus(endpoint) {
|
|
20
|
+
if (!endpoint) {
|
|
21
|
+
// Endpoint not supported.
|
|
22
|
+
return LOGIN_STATUS_NOT_SUPPORTED;
|
|
23
|
+
}
|
|
24
|
+
return LOGIN_STATUS_NOT_STARTED;
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { AuthContext } from "../../providers/authentication";
|
|
3
|
+
/**
|
|
4
|
+
* Returns authentication context.
|
|
5
|
+
* @returns authentication context.
|
|
6
|
+
*/
|
|
7
|
+
export const useAuthentication = () => {
|
|
8
|
+
return useContext(AuthContext);
|
|
9
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AUTHENTICATION_STATUS } from "./common/entities";
|
|
2
|
+
/**
|
|
3
|
+
* Handles the completion of the authentication process.
|
|
4
|
+
* @param authenticationStatus - Authentication status.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useAuthenticationComplete: (authenticationStatus: AUTHENTICATION_STATUS) => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Router, { useRouter } from "next/router";
|
|
2
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { escapeRegExp } from "../../common/utils";
|
|
4
|
+
import { ROUTE_LOGIN } from "../../providers/authentication";
|
|
5
|
+
import { INACTIVITY_PARAM } from "../useSessionTimeout";
|
|
6
|
+
import { AUTHENTICATION_STATUS } from "./common/entities";
|
|
7
|
+
/**
|
|
8
|
+
* Handles the completion of the authentication process.
|
|
9
|
+
* @param authenticationStatus - Authentication status.
|
|
10
|
+
*/
|
|
11
|
+
export const useAuthenticationComplete = (authenticationStatus) => {
|
|
12
|
+
const { asPath } = useRouter();
|
|
13
|
+
const routeHistoryRef = useRef(initRouteHistory(asPath));
|
|
14
|
+
// Maintain a history of routes that have been visited prior to authentication.
|
|
15
|
+
routeHistoryRef.current = useMemo(() => updateRouteHistory(routeHistoryRef.current, asPath), [asPath]);
|
|
16
|
+
// Redirect to the previous route after authentication is completed.
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (authenticationStatus === AUTHENTICATION_STATUS.COMPLETED) {
|
|
19
|
+
Router.push(routeHistoryRef.current);
|
|
20
|
+
}
|
|
21
|
+
}, [authenticationStatus]);
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Initializes route history with the current path.
|
|
25
|
+
* Returns base path if current path is the login route.
|
|
26
|
+
* @param path - current browser path.
|
|
27
|
+
* @returns path to be used as the initial route history.
|
|
28
|
+
*/
|
|
29
|
+
function initRouteHistory(path) {
|
|
30
|
+
return path === ROUTE_LOGIN ? "/" : removeInactivityTimeoutQueryParam(path);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Removes the inactivity timeout query parameter from the path.
|
|
34
|
+
* the inactivity timeout parameter is used to indicate that the session has timed out; remove the parameter to
|
|
35
|
+
* clear the session timeout banner after the user logs in again.
|
|
36
|
+
* @param path - Path.
|
|
37
|
+
* @returns path without the inactivity timeout query parameter.
|
|
38
|
+
*/
|
|
39
|
+
function removeInactivityTimeoutQueryParam(path) {
|
|
40
|
+
const regex = new RegExp(`\\?${escapeRegExp(INACTIVITY_PARAM)}(?:$|[=&].*)`);
|
|
41
|
+
return path.replace(regex, "");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Updates route history with the current path, unless the current path is the LoginView page.
|
|
45
|
+
* @param prevPath - route history path.
|
|
46
|
+
* @param path - current browser path.
|
|
47
|
+
* @returns updated path to be used as the route history.
|
|
48
|
+
*/
|
|
49
|
+
function updateRouteHistory(prevPath, path) {
|
|
50
|
+
let currentPath = prevPath;
|
|
51
|
+
if (path !== ROUTE_LOGIN) {
|
|
52
|
+
currentPath = path;
|
|
53
|
+
}
|
|
54
|
+
return removeInactivityTimeoutQueryParam(currentPath);
|
|
55
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface OnboardingStatus {
|
|
2
|
+
active: boolean;
|
|
3
|
+
completed: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare enum ONBOARDING_STEP {
|
|
6
|
+
NIH_ACCOUNT = 3,
|
|
7
|
+
TERRA_ACCOUNT = 1,
|
|
8
|
+
TERRA_TOS = 2
|
|
9
|
+
}
|
|
10
|
+
interface UseAuthenticationForm {
|
|
11
|
+
isComplete: boolean;
|
|
12
|
+
isReady: boolean;
|
|
13
|
+
onboardingStatusByStep: Map<ONBOARDING_STEP, OnboardingStatus>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Handles authentication form onboarding.
|
|
17
|
+
* @returns onboarding steps and corresponding status.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useAuthenticationForm: () => UseAuthenticationForm;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { AUTHENTICATION_STATUS, } from "./common/entities";
|
|
2
|
+
import { useAuthentication } from "./useAuthentication";
|
|
3
|
+
export var ONBOARDING_STEP;
|
|
4
|
+
(function (ONBOARDING_STEP) {
|
|
5
|
+
ONBOARDING_STEP[ONBOARDING_STEP["NIH_ACCOUNT"] = 3] = "NIH_ACCOUNT";
|
|
6
|
+
ONBOARDING_STEP[ONBOARDING_STEP["TERRA_ACCOUNT"] = 1] = "TERRA_ACCOUNT";
|
|
7
|
+
ONBOARDING_STEP[ONBOARDING_STEP["TERRA_TOS"] = 2] = "TERRA_TOS";
|
|
8
|
+
})(ONBOARDING_STEP || (ONBOARDING_STEP = {}));
|
|
9
|
+
/**
|
|
10
|
+
* Handles authentication form onboarding.
|
|
11
|
+
* @returns onboarding steps and corresponding status.
|
|
12
|
+
*/
|
|
13
|
+
export const useAuthenticationForm = () => {
|
|
14
|
+
const authentication = useAuthentication();
|
|
15
|
+
const isReady = authentication.authenticationStatus === AUTHENTICATION_STATUS.COMPLETED;
|
|
16
|
+
const loginStatuses = concatLoginStatuses(authentication).filter(filterLoginStatus);
|
|
17
|
+
const onboardingStatusByStep = getOnboardingStatusByStep(loginStatuses);
|
|
18
|
+
const isComplete = isAuthenticationComplete(onboardingStatusByStep);
|
|
19
|
+
return {
|
|
20
|
+
isComplete,
|
|
21
|
+
isReady,
|
|
22
|
+
onboardingStatusByStep,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Returns true if all authentication steps are complete.
|
|
27
|
+
* @param onboardingStatusByStep - Onboarding status by step.
|
|
28
|
+
* @returns true if all authentication steps are complete.
|
|
29
|
+
*/
|
|
30
|
+
function isAuthenticationComplete(onboardingStatusByStep) {
|
|
31
|
+
for (const { completed } of onboardingStatusByStep.values()) {
|
|
32
|
+
if (!completed) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns all login statuses, ordered by onboarding step.
|
|
40
|
+
* @param authentication - Authentication.
|
|
41
|
+
* @returns login statuses.
|
|
42
|
+
*/
|
|
43
|
+
function concatLoginStatuses(authentication) {
|
|
44
|
+
const { terraNIHProfileLoginStatus, terraProfileLoginStatus, terraTOSLoginStatus, } = authentication;
|
|
45
|
+
return [
|
|
46
|
+
terraProfileLoginStatus,
|
|
47
|
+
terraTOSLoginStatus,
|
|
48
|
+
terraNIHProfileLoginStatus,
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns true if login is supported.
|
|
53
|
+
* @param loginStatus - Login status.
|
|
54
|
+
* @returns true if login is supported.
|
|
55
|
+
*/
|
|
56
|
+
function filterLoginStatus(loginStatus) {
|
|
57
|
+
return loginStatus.isSupported;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Returns a map of onboarding steps and their status.
|
|
61
|
+
* @param loginStatuses - Login statuses.
|
|
62
|
+
* @returns map of onboarding steps and their status.
|
|
63
|
+
*/
|
|
64
|
+
function getOnboardingStatusByStep(loginStatuses) {
|
|
65
|
+
const onboardingStatusByStep = new Map();
|
|
66
|
+
for (let i = 0; i < loginStatuses.length; i++) {
|
|
67
|
+
const { isSuccess } = loginStatuses[i];
|
|
68
|
+
onboardingStatusByStep.set(i + 1, {
|
|
69
|
+
active: isStepActive(isSuccess, onboardingStatusByStep),
|
|
70
|
+
completed: isSuccess,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return onboardingStatusByStep;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns true if step is active.
|
|
77
|
+
* @param isSuccess - Response is successful.
|
|
78
|
+
* @param onboardingStatusByStep - Onboarding status by step.
|
|
79
|
+
* @returns true if step is active.
|
|
80
|
+
*/
|
|
81
|
+
function isStepActive(isSuccess, onboardingStatusByStep) {
|
|
82
|
+
for (const { active } of onboardingStatusByStep.values()) {
|
|
83
|
+
if (active) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return !isSuccess;
|
|
88
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface UseAuthenticationNIHExpiry {
|
|
2
|
+
isReady: boolean;
|
|
3
|
+
linkExpired?: boolean;
|
|
4
|
+
linkExpireTime?: number;
|
|
5
|
+
linkWillExpire?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Handles authentication NIH expiry.
|
|
9
|
+
* @returns NIH expiry status.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useAuthenticationNIHExpiry: () => UseAuthenticationNIHExpiry;
|
|
12
|
+
/**
|
|
13
|
+
* Calculates the remaining time in seconds until the given expiration time.
|
|
14
|
+
* @param expireTime - Expire time in seconds.
|
|
15
|
+
* @returns remaining time in seconds.
|
|
16
|
+
*/
|
|
17
|
+
export declare function expireTimeInSeconds(expireTime: number): number;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { REQUEST_STATUS } from "./common/entities";
|
|
2
|
+
import { useAuthentication } from "./useAuthentication";
|
|
3
|
+
const WARNING_WINDOW_SECONDS = 60 * 60 * 24 * 5; // 5 days.
|
|
4
|
+
/**
|
|
5
|
+
* Handles authentication NIH expiry.
|
|
6
|
+
* @returns NIH expiry status.
|
|
7
|
+
*/
|
|
8
|
+
export const useAuthenticationNIHExpiry = () => {
|
|
9
|
+
const authentication = useAuthentication();
|
|
10
|
+
const { terraNIHProfileLoginStatus } = authentication;
|
|
11
|
+
const { requestStatus, response } = terraNIHProfileLoginStatus;
|
|
12
|
+
const { linkExpireTime } = response || {};
|
|
13
|
+
const isReady = requestStatus === REQUEST_STATUS.COMPLETED;
|
|
14
|
+
const linkExpired = hasLinkedNIHAccountExpired(linkExpireTime);
|
|
15
|
+
const linkWillExpire = isLinkedNIHAccountWillExpire(linkExpireTime);
|
|
16
|
+
return {
|
|
17
|
+
isReady,
|
|
18
|
+
linkExpireTime,
|
|
19
|
+
linkExpired,
|
|
20
|
+
linkWillExpire,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Calculates the remaining time in seconds until the given expiration time.
|
|
25
|
+
* @param expireTime - Expire time in seconds.
|
|
26
|
+
* @returns remaining time in seconds.
|
|
27
|
+
*/
|
|
28
|
+
export function expireTimeInSeconds(expireTime) {
|
|
29
|
+
return expireTime - Date.now() / 1000;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns true if the linked NIH account has expired.
|
|
33
|
+
* @param expireTime - Expire time in seconds.
|
|
34
|
+
* @returns true if the linked NIH account has expired.
|
|
35
|
+
*/
|
|
36
|
+
function hasLinkedNIHAccountExpired(expireTime) {
|
|
37
|
+
if (!expireTime)
|
|
38
|
+
return;
|
|
39
|
+
return expireTimeInSeconds(expireTime) < 0;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns true if the linked NIH account will expire in less than a week.
|
|
43
|
+
* @param expireTime - Expire time in seconds.
|
|
44
|
+
* @returns true if the linked NIH account will expire in less than a week.
|
|
45
|
+
*/
|
|
46
|
+
function isLinkedNIHAccountWillExpire(expireTime) {
|
|
47
|
+
if (!expireTime)
|
|
48
|
+
return;
|
|
49
|
+
return expireTimeInSeconds(expireTime) < WARNING_WINDOW_SECONDS;
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AUTHENTICATION_STATUS, LoginResponse, LoginStatus } from "./common/entities";
|
|
2
|
+
import { GoogleResponse } from "./useFetchGoogleProfile";
|
|
3
|
+
import { TerraNIHResponse } from "./useFetchTerraNIHProfile";
|
|
4
|
+
import { TerraResponse } from "./useFetchTerraProfile";
|
|
5
|
+
import { TerraTermsOfServiceResponse } from "./useFetchTerraTermsOfService";
|
|
6
|
+
/**
|
|
7
|
+
* Handles the status of the authentication process.
|
|
8
|
+
* @param userProfileLoginStatus - User profile login status.
|
|
9
|
+
* @param terraProfileLoginStatus - Terra profile login status.
|
|
10
|
+
* @param terraTOSLoginStatus - Terra terms of service login status.
|
|
11
|
+
* @param terraNIHProfileLoginStatus - Terra NIH profile login status.
|
|
12
|
+
* @returns authentication status.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useAuthenticationStatus: (userProfileLoginStatus: LoginStatus<GoogleResponse>, terraProfileLoginStatus: LoginStatus<TerraResponse>, terraTOSLoginStatus: LoginStatus<TerraTermsOfServiceResponse>, terraNIHProfileLoginStatus: LoginStatus<TerraNIHResponse>) => AUTHENTICATION_STATUS;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the authentication status ("INCOMPLETE" or "COMPLETE").
|
|
17
|
+
* @param loginStatuses - Login statuses.
|
|
18
|
+
* @returns authentication status.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getAuthenticationStatus(loginStatuses: LoginStatus<LoginResponse>[]): AUTHENTICATION_STATUS;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AUTHENTICATION_STATUS, REQUEST_STATUS, } from "./common/entities";
|
|
2
|
+
/**
|
|
3
|
+
* Handles the status of the authentication process.
|
|
4
|
+
* @param userProfileLoginStatus - User profile login status.
|
|
5
|
+
* @param terraProfileLoginStatus - Terra profile login status.
|
|
6
|
+
* @param terraTOSLoginStatus - Terra terms of service login status.
|
|
7
|
+
* @param terraNIHProfileLoginStatus - Terra NIH profile login status.
|
|
8
|
+
* @returns authentication status.
|
|
9
|
+
*/
|
|
10
|
+
export const useAuthenticationStatus = (userProfileLoginStatus, terraProfileLoginStatus, terraTOSLoginStatus, terraNIHProfileLoginStatus) => {
|
|
11
|
+
return getAuthenticationStatus([
|
|
12
|
+
terraNIHProfileLoginStatus,
|
|
13
|
+
terraProfileLoginStatus,
|
|
14
|
+
terraTOSLoginStatus,
|
|
15
|
+
userProfileLoginStatus,
|
|
16
|
+
]);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Returns the authentication status ("INCOMPLETE" or "COMPLETE").
|
|
20
|
+
* @param loginStatuses - Login statuses.
|
|
21
|
+
* @returns authentication status.
|
|
22
|
+
*/
|
|
23
|
+
export function getAuthenticationStatus(loginStatuses) {
|
|
24
|
+
for (const loginStatus of loginStatuses) {
|
|
25
|
+
if (!loginStatus.isSupported)
|
|
26
|
+
continue;
|
|
27
|
+
if (loginStatus.requestStatus === REQUEST_STATUS.NOT_STARTED) {
|
|
28
|
+
return AUTHENTICATION_STATUS.INCOMPLETE;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return AUTHENTICATION_STATUS.COMPLETED;
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LoginStatus } from "./common/entities";
|
|
2
|
+
export type UserProfile = GoogleResponse;
|
|
3
|
+
export interface GoogleResponse {
|
|
4
|
+
email: string;
|
|
5
|
+
email_verified: boolean;
|
|
6
|
+
family_name: string;
|
|
7
|
+
given_name: string;
|
|
8
|
+
hd: string;
|
|
9
|
+
locale: string;
|
|
10
|
+
name: string;
|
|
11
|
+
picture: string;
|
|
12
|
+
sub: string;
|
|
13
|
+
}
|
|
14
|
+
type Status = LoginStatus<GoogleResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns user profile login status from configured endpoint.
|
|
17
|
+
* @param token - Token.
|
|
18
|
+
* @returns google profile login status.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useFetchGoogleProfile: (token?: string) => Status;
|
|
21
|
+
export {};
|