@databiosphere/findable-ui 50.6.1 → 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 +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FilterMenuStory } from "../FilterMenu/filterMenu.stories";
|
|
3
|
+
import { SearchAllFilters } from "./searchAllFilters";
|
|
4
|
+
export default {
|
|
5
|
+
argTypes: {
|
|
6
|
+
onFilter: { control: { disable: true } },
|
|
7
|
+
},
|
|
8
|
+
component: SearchAllFilters,
|
|
9
|
+
decorators: [
|
|
10
|
+
(Story) => (React.createElement("div", { style: { width: 264 } },
|
|
11
|
+
React.createElement(Story, null))),
|
|
12
|
+
],
|
|
13
|
+
title: "Components/Filter/SearchAllFilters",
|
|
14
|
+
};
|
|
15
|
+
const onFilter = () => {
|
|
16
|
+
// onFilter function
|
|
17
|
+
};
|
|
18
|
+
const defaultValues = [
|
|
19
|
+
{
|
|
20
|
+
count: 1,
|
|
21
|
+
key: "item1",
|
|
22
|
+
label: "Item 1",
|
|
23
|
+
selected: false,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
count: 10,
|
|
27
|
+
key: "item2",
|
|
28
|
+
label: "Item 2",
|
|
29
|
+
selected: false,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
export const SearchAllFiltersStory = {
|
|
33
|
+
args: {
|
|
34
|
+
categoryViews: [
|
|
35
|
+
{
|
|
36
|
+
isDisabled: false,
|
|
37
|
+
key: "genusSpecies",
|
|
38
|
+
label: "Genus Species",
|
|
39
|
+
values: [
|
|
40
|
+
{
|
|
41
|
+
count: 12,
|
|
42
|
+
key: "homoSapiens",
|
|
43
|
+
label: "Homo sapiens",
|
|
44
|
+
selected: false,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
count: 6,
|
|
48
|
+
key: "musMusculus",
|
|
49
|
+
label: "Mus musculus",
|
|
50
|
+
selected: false,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
isDisabled: false,
|
|
56
|
+
key: "donorDisease",
|
|
57
|
+
label: "Donor Disease",
|
|
58
|
+
values: FilterMenuStory.args?.values || defaultValues,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
isDisabled: true,
|
|
62
|
+
key: "anatomicalEntity",
|
|
63
|
+
label: "Anatomical Entity",
|
|
64
|
+
values: [
|
|
65
|
+
{
|
|
66
|
+
count: 12,
|
|
67
|
+
key: "oralCavity",
|
|
68
|
+
label: "oral cavity",
|
|
69
|
+
selected: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
count: 6,
|
|
73
|
+
key: "pancreas",
|
|
74
|
+
label: "pancreas",
|
|
75
|
+
selected: false,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
onFilter: onFilter,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SearchCloseButton: () => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CloseRounded } from "@mui/icons-material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import React, { Fragment, useContext } from "react";
|
|
4
|
+
import { BREAKPOINT_FN_NAME, useBreakpointHelper, } from "../../../../../../hooks/useBreakpointHelper";
|
|
5
|
+
import { DESKTOP_SM } from "../../../../../../theme/common/breakpoints";
|
|
6
|
+
import { ListboxContext } from "../../../SearchAllFilters/searchAllFilters";
|
|
7
|
+
export const SearchCloseButton = () => {
|
|
8
|
+
const desktopSmDown = useBreakpointHelper(BREAKPOINT_FN_NAME.DOWN, DESKTOP_SM);
|
|
9
|
+
const { onClearSearch, onCloseSearch, open, searchTerm } = useContext(ListboxContext);
|
|
10
|
+
const showButton = open && (desktopSmDown || searchTerm);
|
|
11
|
+
const onClickFn = desktopSmDown ? onCloseSearch : onClearSearch;
|
|
12
|
+
return (React.createElement(Fragment, null, showButton && (React.createElement(IconButton, { onClick: onClickFn, size: "large" },
|
|
13
|
+
React.createElement(CloseRounded, { fontSize: "small" })))));
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { SearchIcon } from "../../../common/CustomIcon/components/SearchIcon/searchIcon";
|
|
3
|
+
import { ListboxContext } from "../SearchAllFilters/searchAllFilters";
|
|
4
|
+
import { InputField } from "./searchAllFiltersSearch.styles";
|
|
5
|
+
export const SearchAllFiltersSearch = ({ inputProps, InputProps, ...props }) => {
|
|
6
|
+
const { searchTerm } = useContext(ListboxContext);
|
|
7
|
+
delete inputProps?.value; // Control input value from the search term.
|
|
8
|
+
return (React.createElement(InputField, { ...props, fullWidth: true, InputProps: {
|
|
9
|
+
...(InputProps || {}),
|
|
10
|
+
startAdornment: React.createElement(SearchIcon, { fontSize: "small" }),
|
|
11
|
+
}, inputProps: { ...(inputProps || {}), spellCheck: false }, placeholder: "Search all filters...", size: "small", value: searchTerm, variant: "outlined" }));
|
|
12
|
+
};
|
package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const InputField: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
variant?: import("@mui/material").TextFieldVariants | undefined;
|
|
3
|
+
} & Omit<import("@mui/material").OutlinedTextFieldProps | import("@mui/material").FilledTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & {
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
}, {}, {}>;
|
package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { TextField } from "@mui/material";
|
|
3
|
+
import { inkLight, inkMain } from "../../../../styles/common/mixins/colors";
|
|
4
|
+
export const InputField = styled(TextField) `
|
|
5
|
+
&& {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
|
|
10
|
+
.MuiInputBase-root {
|
|
11
|
+
& ::placeholder {
|
|
12
|
+
color: ${inkLight};
|
|
13
|
+
opacity: 0.8;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.Mui-focused {
|
|
17
|
+
& ::placeholder {
|
|
18
|
+
opacity: 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.MuiOutlinedInput-root {
|
|
24
|
+
&.MuiInputBase-sizeSmall {
|
|
25
|
+
padding: 0 0 0 12px;
|
|
26
|
+
|
|
27
|
+
.MuiAutocomplete-input {
|
|
28
|
+
color: ${inkMain};
|
|
29
|
+
padding: 10px 14px 10px 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconButton } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ICON_BUTTON_PROPS } from "../../../../../../../../styles/common/mui/iconButton";
|
|
4
|
+
import { SVG_ICON_PROPS } from "../../../../../../../../styles/common/mui/svgIcon";
|
|
5
|
+
import { AiIcon } from "../../../../../../../common/CustomIcon/components/AiIcon/aiIcon";
|
|
6
|
+
import { ADORNMENT_TYPE } from "./constants";
|
|
7
|
+
import { StyledArrowUpwardRounded, StyledLoadingIcon, } from "./endAdornment.styles";
|
|
8
|
+
export const EndAdornment = ({ adornmentType, }) => {
|
|
9
|
+
switch (adornmentType) {
|
|
10
|
+
case ADORNMENT_TYPE.SUBMITTING:
|
|
11
|
+
return (React.createElement(StyledLoadingIcon, { color: SVG_ICON_PROPS.COLOR.PRIMARY, fontSize: SVG_ICON_PROPS.FONT_SIZE.SMALL }));
|
|
12
|
+
case ADORNMENT_TYPE.SUBMITTABLE:
|
|
13
|
+
return (React.createElement(IconButton, { color: ICON_BUTTON_PROPS.COLOR.SECONDARY, edge: ICON_BUTTON_PROPS.EDGE.END, size: ICON_BUTTON_PROPS.SIZE.XSMALL, type: "submit" },
|
|
14
|
+
React.createElement(StyledArrowUpwardRounded, { fontSize: SVG_ICON_PROPS.FONT_SIZE.SMALL })));
|
|
15
|
+
case ADORNMENT_TYPE.DEFAULT:
|
|
16
|
+
default:
|
|
17
|
+
return React.createElement(AiIcon, null);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const StyledLoadingIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
3
|
+
}, "style" | "className" | "classes" | "children" | "sx" | "color" | "fontSize" | "shapeRendering" | "viewBox" | "htmlColor" | "inheritViewBox" | "titleAccess"> & {
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
} & {
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
|
+
}, {}, {}>;
|
|
8
|
+
export declare const StyledArrowUpwardRounded: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
|
|
9
|
+
ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
10
|
+
}, "style" | "className" | "classes" | "children" | "sx" | "color" | "fontSize" | "shapeRendering" | "viewBox" | "htmlColor" | "inheritViewBox" | "titleAccess"> & {
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
12
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { ArrowUpwardRounded } from "@mui/icons-material";
|
|
3
|
+
import { PALETTE } from "../../../../../../../../styles/common/constants/palette";
|
|
4
|
+
import { LoadingIcon } from "../../../../../../../common/CustomIcon/components/LoadingIcon/loadingIcon";
|
|
5
|
+
export const StyledLoadingIcon = styled(LoadingIcon) `
|
|
6
|
+
&& {
|
|
7
|
+
color: ${PALETTE.PRIMARY_MAIN};
|
|
8
|
+
|
|
9
|
+
.Mui-focused & {
|
|
10
|
+
color: ${PALETTE.PRIMARY_MAIN};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const StyledArrowUpwardRounded = styled(ArrowUpwardRounded) `
|
|
15
|
+
&& {
|
|
16
|
+
color: ${PALETTE.INK_LIGHT};
|
|
17
|
+
|
|
18
|
+
.Mui-focused & {
|
|
19
|
+
color: ${PALETTE.INK_LIGHT};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ADORNMENT_TYPE } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the end adornment type of the input i.e. "default", "submittable", "submitting".
|
|
4
|
+
* @param isDirty - Form is dirty.
|
|
5
|
+
* @param isSubmiting - Form is submitting.
|
|
6
|
+
* @returns End adornment type.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEndAdornmentType(isDirty: boolean, isSubmiting: boolean): (typeof ADORNMENT_TYPE)[keyof typeof ADORNMENT_TYPE];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ADORNMENT_TYPE } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the end adornment type of the input i.e. "default", "submittable", "submitting".
|
|
4
|
+
* @param isDirty - Form is dirty.
|
|
5
|
+
* @param isSubmiting - Form is submitting.
|
|
6
|
+
* @returns End adornment type.
|
|
7
|
+
*/
|
|
8
|
+
export function getEndAdornmentType(isDirty, isSubmiting) {
|
|
9
|
+
if (isSubmiting)
|
|
10
|
+
return ADORNMENT_TYPE.SUBMITTING;
|
|
11
|
+
if (isDirty)
|
|
12
|
+
return ADORNMENT_TYPE.SUBMITTABLE;
|
|
13
|
+
return ADORNMENT_TYPE.DEFAULT;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Stack, Typography } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { STACK_PROPS } from "../../../../../../../../../../../../styles/common/mui/stack";
|
|
4
|
+
import { TYPOGRAPHY_PROPS } from "../../../../../../../../../../../../styles/common/mui/typography";
|
|
5
|
+
export const ResultSummarySection = ({ icon, mentionTermPair, title, }) => {
|
|
6
|
+
if (mentionTermPair.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
return (React.createElement(Stack, { gap: 2, useFlexGap: true },
|
|
9
|
+
React.createElement(Typography, { variant: TYPOGRAPHY_PROPS.VARIANT.BODY_500 }, title),
|
|
10
|
+
mentionTermPair.map(([mention, term], index) => (React.createElement(Stack, { key: `${mention}-${term}-${index}`, direction: STACK_PROPS.DIRECTION.ROW, spacing: 1, useFlexGap: true },
|
|
11
|
+
icon,
|
|
12
|
+
React.createElement("span", null, mention),
|
|
13
|
+
React.createElement(Typography, { color: TYPOGRAPHY_PROPS.COLOR.INK_LIGHT }, "="),
|
|
14
|
+
React.createElement("span", null, term))))));
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FONT } from "../../../../../../../../../../styles/common/constants/font";
|
|
2
|
+
import { PALETTE } from "../../../../../../../../../../styles/common/constants/palette";
|
|
3
|
+
export const TOOLTIP_PROPS = {
|
|
4
|
+
disableInteractive: true,
|
|
5
|
+
enterNextDelay: 250,
|
|
6
|
+
placement: "top-start",
|
|
7
|
+
slotProps: {
|
|
8
|
+
popper: {
|
|
9
|
+
modifiers: [
|
|
10
|
+
{ name: "flip", options: { padding: 8 } },
|
|
11
|
+
{ name: "offset", options: { offset: [0, 2] } },
|
|
12
|
+
{ name: "preventOverflow", options: { padding: 8 } },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
tooltip: {
|
|
16
|
+
sx: {
|
|
17
|
+
backgroundColor: PALETTE.COMMON_WHITE,
|
|
18
|
+
border: `1px solid ${PALETTE.SMOKE_DARK}`,
|
|
19
|
+
color: PALETTE.INK_MAIN,
|
|
20
|
+
font: FONT.BODY_400,
|
|
21
|
+
margin: 0,
|
|
22
|
+
maxWidth: "unset",
|
|
23
|
+
padding: 4,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to measure the width of an element and provide a ref to attach to it.
|
|
3
|
+
* Returns the measured width and a ref function to attach to the element.
|
|
4
|
+
* @returns A tuple containing the measured width and a ref function to attach to the element.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useMeasuredWidth<T extends HTMLElement>(): [
|
|
7
|
+
number | undefined,
|
|
8
|
+
(node: T | null) => void
|
|
9
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to measure the width of an element and provide a ref to attach to it.
|
|
4
|
+
* Returns the measured width and a ref function to attach to the element.
|
|
5
|
+
* @returns A tuple containing the measured width and a ref function to attach to the element.
|
|
6
|
+
*/
|
|
7
|
+
export function useMeasuredWidth() {
|
|
8
|
+
const [width, setWidth] = useState();
|
|
9
|
+
const ref = useCallback((node) => {
|
|
10
|
+
if (!node)
|
|
11
|
+
return;
|
|
12
|
+
const { width: measuredWidth } = node.getBoundingClientRect();
|
|
13
|
+
setWidth(measuredWidth);
|
|
14
|
+
}, []);
|
|
15
|
+
return [width, ref];
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tooltip as MTooltip } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TOOLTIP_PROPS } from "./constants";
|
|
4
|
+
import { useMeasuredWidth } from "./hook";
|
|
5
|
+
export const Tooltip = ({ children, ...props }) => {
|
|
6
|
+
const [minWidth = "unset", ref] = useMeasuredWidth();
|
|
7
|
+
return (React.createElement(MTooltip, { ...TOOLTIP_PROPS, slotProps: {
|
|
8
|
+
...TOOLTIP_PROPS.slotProps,
|
|
9
|
+
popper: { sx: { minWidth } },
|
|
10
|
+
}, ...props }, children(ref)));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Stack } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { SVG_ICON_PROPS } from "../../../../../../../../styles/common/mui/svgIcon";
|
|
4
|
+
import { TYPOGRAPHY_PROPS } from "../../../../../../../../styles/common/mui/typography";
|
|
5
|
+
import { ErrorIcon } from "../../../../../../../common/CustomIcon/components/ErrorIcon/errorIcon";
|
|
6
|
+
import { SuccessIcon } from "../../../../../../../common/CustomIcon/components/SuccessIcon/successIcon";
|
|
7
|
+
import { ResultSummarySection } from "./components/Tooltip/components/Title/title";
|
|
8
|
+
import { Tooltip } from "./components/Tooltip/tooltip";
|
|
9
|
+
import { StyledResultSummary } from "./resultSummary.styles";
|
|
10
|
+
import { renderSummary } from "./utils";
|
|
11
|
+
export const ResultSummary = ({ summary, }) => {
|
|
12
|
+
if (!summary)
|
|
13
|
+
return null;
|
|
14
|
+
return (React.createElement(Tooltip, { title: React.createElement(Stack, { gap: 4, useFlexGap: true },
|
|
15
|
+
React.createElement(ResultSummarySection, { icon: React.createElement(SuccessIcon, { color: SVG_ICON_PROPS.COLOR.SUCCESS }), mentionTermPair: summary.matched, title: "Matched" }),
|
|
16
|
+
React.createElement(ResultSummarySection, { icon: React.createElement(ErrorIcon, { color: SVG_ICON_PROPS.COLOR.ALERT }), mentionTermPair: summary.unmatched, title: "Unmatched" })) }, (ref) => (React.createElement(StyledResultSummary, { ref: ref, variant: TYPOGRAPHY_PROPS.VARIANT.BODY_400 }, renderSummary(summary)))));
|
|
17
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StyledResultSummary: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
3
|
+
}, "p" | "style" | "order" | "bottom" | "height" | "left" | "right" | "top" | "width" | "className" | "classes" | "children" | "sx" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "align" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { Typography } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../../../../styles/common/constants/palette";
|
|
4
|
+
export const StyledResultSummary = styled(Typography) `
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
text-decoration: underline dashed ${PALETTE.SMOKE_DARK};
|
|
7
|
+
text-decoration-skip-ink: none;
|
|
8
|
+
text-decoration-thickness: 1px;
|
|
9
|
+
text-underline-position: under;
|
|
10
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ResultSummaryData } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders a human-readable summary from the result summary data.
|
|
4
|
+
* @param summary - The result summary data.
|
|
5
|
+
* @returns A formatted string summarizing the matched and unmatched items.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderSummary(summary: ResultSummaryData): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a human-readable summary from the result summary data.
|
|
3
|
+
* @param summary - The result summary data.
|
|
4
|
+
* @returns A formatted string summarizing the matched and unmatched items.
|
|
5
|
+
*/
|
|
6
|
+
export function renderSummary(summary) {
|
|
7
|
+
const matched = summary.matched.length;
|
|
8
|
+
const unmatched = summary.unmatched.length;
|
|
9
|
+
if (!unmatched) {
|
|
10
|
+
// If there are no unmatched items, just report the matched count.
|
|
11
|
+
return `${matched} matched`;
|
|
12
|
+
}
|
|
13
|
+
if (!matched) {
|
|
14
|
+
// If there are no matched items, report only unmatched count.
|
|
15
|
+
return `${unmatched} unmatched`;
|
|
16
|
+
}
|
|
17
|
+
// Otherwise, report both matched and unmatched counts.
|
|
18
|
+
return `${matched} matched, ${unmatched} unmatched`;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TEXT_FIELD_PROPS as MUI_TEXT_FIELD_PROPS } from "../../../../../../styles/common/mui/textField";
|
|
2
|
+
export const OUTLINED_INPUT_PROPS = {
|
|
3
|
+
autoComplete: "off",
|
|
4
|
+
color: MUI_TEXT_FIELD_PROPS.COLOR.SECONDARY,
|
|
5
|
+
fullWidth: true,
|
|
6
|
+
id: "query-to-facets",
|
|
7
|
+
name: "query-to-facets",
|
|
8
|
+
placeholder: "Type what you want to find...",
|
|
9
|
+
size: MUI_TEXT_FIELD_PROPS.SIZE.SMALL,
|
|
10
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { useExploreState } from "../../../../../../hooks/useExploreState";
|
|
3
|
+
import { ExploreActionKind } from "../../../../../../providers/exploreState";
|
|
4
|
+
import { getFormValue } from "../../../../../../utils/form";
|
|
5
|
+
import { EndAdornment } from "./components/EndAdornment/endAdornment";
|
|
6
|
+
import { getEndAdornmentType } from "./components/EndAdornment/utils";
|
|
7
|
+
import { ResultSummary } from "./components/ResultSummary/resultSummary";
|
|
8
|
+
import { OUTLINED_INPUT_PROPS } from "./constants";
|
|
9
|
+
import { StyledOutlinedInput, StyledStack } from "./facetAssistant.styles";
|
|
10
|
+
import { buildSummary, mapResponse } from "./utils";
|
|
11
|
+
/**
|
|
12
|
+
* AI-powered facet assistant component.
|
|
13
|
+
* Converts a user query into facet filters (PoC implementation).
|
|
14
|
+
* TODO - clear search.
|
|
15
|
+
*/
|
|
16
|
+
export const FacetAssistant = () => {
|
|
17
|
+
const { exploreDispatch } = useExploreState();
|
|
18
|
+
const [isDirty, setIsDirty] = useState(false);
|
|
19
|
+
const [isError, setIsError] = useState(false);
|
|
20
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
21
|
+
const [response, setResponse] = useState(null);
|
|
22
|
+
const onSubmit = useCallback(async (e) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
// Get the form value.
|
|
25
|
+
const formValue = getFormValue(e, "query-to-facets");
|
|
26
|
+
if (!formValue)
|
|
27
|
+
return;
|
|
28
|
+
setIsError(false);
|
|
29
|
+
setIsSubmitting(true);
|
|
30
|
+
setResponse(null);
|
|
31
|
+
try {
|
|
32
|
+
const res = await fetch("http://localhost:8000/api/v0/facets?mode=search_agent", {
|
|
33
|
+
body: JSON.stringify({ query: formValue }),
|
|
34
|
+
headers: {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
},
|
|
37
|
+
method: "POST",
|
|
38
|
+
});
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
setIsError(true);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const data = await res.json();
|
|
44
|
+
// Set the response data
|
|
45
|
+
setResponse(data);
|
|
46
|
+
// Map the response data to facet filters.
|
|
47
|
+
const filters = mapResponse(data);
|
|
48
|
+
// Dispatch the update entity filters action.
|
|
49
|
+
exploreDispatch({
|
|
50
|
+
payload: { filters },
|
|
51
|
+
type: ExploreActionKind.UpdateEntityFilters,
|
|
52
|
+
});
|
|
53
|
+
// Reset the form.
|
|
54
|
+
setIsDirty(false);
|
|
55
|
+
e.target.reset();
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
console.error(err);
|
|
59
|
+
setResponse(null);
|
|
60
|
+
setIsError(true);
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
setIsSubmitting(false);
|
|
64
|
+
}
|
|
65
|
+
}, [exploreDispatch]);
|
|
66
|
+
return (React.createElement(StyledStack, { useFlexGap: true },
|
|
67
|
+
React.createElement("form", { onSubmit: onSubmit },
|
|
68
|
+
React.createElement(StyledOutlinedInput, { ...OUTLINED_INPUT_PROPS, endAdornment: React.createElement(EndAdornment, { adornmentType: getEndAdornmentType(isDirty, isSubmitting) }), error: isError, onChange: (e) => setIsDirty(Boolean(e.target.value)) })),
|
|
69
|
+
React.createElement(ResultSummary, { summary: buildSummary(response) })));
|
|
70
|
+
};
|
package/lib/components/Filter/components/ai/components/FacetAssistant/facetAssistant.styles.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const StyledStack: import("@emotion/styled").StyledComponent<import("@mui/material").StackOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/material").StackOwnProps> & {
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
}, {}, {}>;
|
|
6
|
+
export declare const StyledOutlinedInput: import("@emotion/styled").StyledComponent<import("@mui/material").OutlinedInputProps & {
|
|
7
|
+
theme?: import("@emotion/react").Theme;
|
|
8
|
+
}, {}, {}>;
|
package/lib/components/Filter/components/ai/components/FacetAssistant/facetAssistant.styles.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { OutlinedInput, Stack } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../../styles/common/constants/palette";
|
|
4
|
+
export const StyledStack = styled(Stack) `
|
|
5
|
+
gap: 8px;
|
|
6
|
+
grid-column: 1 / -1;
|
|
7
|
+
`;
|
|
8
|
+
export const StyledOutlinedInput = styled(OutlinedInput) `
|
|
9
|
+
&:not(:placeholder-shown) {
|
|
10
|
+
.MuiOutlinedInput-input {
|
|
11
|
+
color: ${PALETTE.INK_MAIN};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { FacetAssistant } from "../facetAssistant";
|
|
3
|
+
declare const meta: Meta<typeof FacetAssistant>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const DefaultStory: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Box } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FacetAssistant } from "../facetAssistant";
|
|
4
|
+
const meta = {
|
|
5
|
+
component: FacetAssistant,
|
|
6
|
+
decorators: [
|
|
7
|
+
(Story) => (React.createElement(Box, { sx: { width: 264 } },
|
|
8
|
+
React.createElement(Story, null))),
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const DefaultStory = {};
|