@databiosphere/findable-ui 23.0.0 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-please-manifest.json +1 -1
- package/.storybook/preview.js +4 -37
- package/CHANGELOG.md +64 -0
- package/jest.config.js +1 -0
- package/lib/common/entities.d.ts +1 -0
- package/lib/components/DataDictionary/components/Entities/constants.d.ts +2 -2
- package/lib/components/DataDictionary/components/Entities/constants.js +1 -1
- package/lib/components/DataDictionary/components/Entities/entities.js +3 -3
- package/lib/components/DataDictionary/components/Entity/constants.d.ts +2 -2
- package/lib/components/DataDictionary/components/Entity/constants.js +1 -1
- package/lib/components/DataDictionary/components/Entity/entity.js +4 -4
- 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/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.js +2 -2
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.js +2 -2
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +17 -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 +9 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +9 -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 +86 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +105 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +196 -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 +19 -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 +96 -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 +16 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +6 -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 +21 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.js +16 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/types.d.ts +3 -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 +14 -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/NTagCell/nTagCell.stories.d.ts +5 -16
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +8 -8
- 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.d.ts +2 -13
- package/lib/components/Index/index.js +6 -2
- package/lib/components/Index/index.stories.js +3 -2
- package/lib/components/Index/types.d.ts +12 -0
- package/lib/components/Index/types.js +1 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.d.ts +1 -1
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.js +5 -4
- package/lib/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.d.ts +6 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.js +18 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.js +3 -3
- 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/AuthenticationMenu/authenticationMenu.styles.d.ts +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/Button/button.styles.d.ts +1 -1
- 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/Menu/components/Toolbar/toolbar.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Menu/menu.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.js +5 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.d.ts +5 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.js +4 -3
- 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/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +2 -2
- 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/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Layout/components/Sidebar/components/SidebarButton/sidebarButton.js +2 -2
- package/lib/components/Loading/loading.d.ts +2 -1
- package/lib/components/Loading/loading.js +2 -2
- package/lib/components/Loading/loading.stories.d.ts +3 -31
- package/lib/components/Login/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Login/components/Section/components/Consent/consent.js +3 -3
- package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +1 -1
- package/lib/components/Login/components/Section/components/Consent/consent.styles.js +2 -2
- package/lib/components/Login/components/Section/components/Consent/types.d.ts +2 -2
- package/lib/components/Login/login.stories.d.ts +6 -0
- package/lib/components/Login/login.stories.js +31 -0
- package/lib/components/NoResults/noResults.d.ts +1 -8
- package/lib/components/NoResults/noResults.js +9 -8
- package/lib/components/NoResults/noResults.styles.d.ts +2 -2
- package/lib/components/NoResults/noResults.styles.js +4 -2
- package/lib/components/NoResults/types.d.ts +8 -0
- package/lib/components/NoResults/types.js +1 -0
- package/lib/components/Plot/components/BarX/barX.d.ts +2 -0
- package/lib/components/Plot/components/BarX/barX.js +13 -0
- package/lib/components/Plot/components/BarX/types.d.ts +5 -0
- package/lib/components/Plot/components/BarX/types.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.js +7 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.js +17 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.js +8 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.js +15 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.js +4 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/constants.d.ts +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/constants.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.js +27 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.d.ts +9 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.js +38 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.js +11 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.js +9 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.js +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.d.ts +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.js +20 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.d.ts +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.js +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.d.ts +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.js +21 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.js +5 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/constants.js +8 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.js +12 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.d.ts +4 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.js +15 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.d.ts +8 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.js +37 -0
- package/lib/components/Stepper/components/Step/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/constants.js +4 -0
- package/lib/components/Stepper/components/Step/step.d.ts +3 -0
- package/lib/components/Stepper/components/Step/step.js +6 -0
- package/lib/components/Stepper/components/Step/step.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/step.styles.js +31 -0
- package/lib/components/Stepper/components/Step/stories/contants.d.ts +4 -0
- package/lib/components/Stepper/components/Step/stories/contants.js +14 -0
- package/lib/components/Stepper/components/Step/stories/step.stories.d.ts +8 -0
- package/lib/components/Stepper/components/Step/stories/step.stories.js +62 -0
- package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.js +2 -2
- 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/EntityViewToggle/entityViewToggle.d.ts +2 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
- package/lib/components/Table/components/Pagination/pagination.js +3 -4
- package/lib/components/Table/components/TableHead/tableHead.js +2 -2
- package/lib/components/Table/table.js +11 -11
- 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.js +1 -6
- 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/AnchorLink/anchorLink.js +2 -2
- 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/Breadcrumbs/breadcrumbs.js +2 -2
- package/lib/components/common/Breadcrumbs/typeGuard.d.ts +13 -0
- package/lib/components/common/Breadcrumbs/typeGuard.js +23 -0
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.js +2 -2
- 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/Button/components/NavigationButton/navigationButton.js +2 -2
- package/lib/components/common/CopyToClipboard/copyToClipboard.js +2 -2
- package/lib/components/common/Dialog/components/DialogTitle/dialogTitle.js +2 -2
- package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.js +2 -2
- package/lib/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.d.ts +2 -3
- package/lib/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.js +3 -3
- package/lib/components/common/Form/components/UploadFile/uploadFile.js +2 -2
- 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/IconButton/iconButton.styles.d.ts +1 -1
- package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.d.ts +2 -5
- package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.js +6 -2
- package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.d.ts +2 -5
- package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.js +6 -2
- package/lib/components/common/LoginDialog/loginDialog.styles.js +1 -1
- package/lib/components/common/Paper/paper.d.ts +2 -1
- package/lib/components/common/Paper/paper.js +2 -2
- package/lib/components/common/Section/components/CollapsableSection/collapsableSection.js +2 -3
- package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.d.ts +2 -0
- package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.js +10 -0
- package/lib/components/types.d.ts +3 -0
- package/lib/config/entities.d.ts +2 -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/useCategoryFilter.js +1 -0
- package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
- package/lib/hooks/useEntityListRelatedView.js +62 -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/useResizeObserver.d.ts +2 -1
- package/lib/hooks/useResizeObserver.js +5 -2
- package/lib/hooks/useSessionTimeout.d.ts +11 -0
- package/lib/hooks/useSessionTimeout.js +28 -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/storybook/controls/constants.d.ts +4 -0
- package/lib/storybook/controls/constants.js +6 -0
- package/lib/storybook/controls/types.d.ts +4 -0
- package/lib/storybook/controls/types.js +5 -0
- package/lib/storybook/controls/utils.d.ts +9 -0
- package/lib/storybook/controls/utils.js +10 -0
- package/lib/storybook/decorators.d.ts +2 -0
- package/lib/storybook/decorators.js +11 -0
- package/lib/storybook/loremIpsum.d.ts +4 -0
- package/lib/storybook/loremIpsum.js +4 -0
- package/lib/storybook/parameters.d.ts +2 -0
- package/lib/storybook/parameters.js +12 -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/stepper.d.ts +7 -0
- package/lib/styles/common/mui/stepper.js +7 -0
- package/lib/styles/common/mui/svgIcon.d.ts +9 -0
- package/lib/styles/common/mui/svgIcon.js +26 -0
- package/lib/styles/common/mui/typography.js +1 -0
- package/lib/tests/mui/constants.d.ts +4 -0
- package/lib/tests/mui/constants.js +4 -0
- package/lib/theme/common/typography.d.ts +6 -2
- package/lib/theme/common/typography.js +10 -1
- package/lib/theme/theme.js +2 -0
- package/lib/utils/tests.d.ts +12 -0
- package/lib/utils/tests.js +20 -0
- package/lib/views/ExploreView/exploreView.js +4 -24
- package/package.json +6 -4
- package/src/common/entities.ts +1 -0
- package/src/components/DataDictionary/components/Entities/constants.ts +2 -2
- package/src/components/DataDictionary/components/Entities/entities.tsx +4 -4
- package/src/components/DataDictionary/components/Entity/constants.ts +2 -2
- package/src/components/DataDictionary/components/Entity/entity.tsx +6 -6
- package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.tsx +1 -1
- package/src/components/Filter/components/FilterLabel/filterLabel.tsx +2 -2
- package/src/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.tsx +2 -2
- package/src/components/Index/components/EntitiesView/components/ChartView/chartView.styles.ts +14 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/chartView.tsx +38 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.ts +13 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.ts +104 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.ts +229 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.ts +30 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.tsx +16 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.ts +1 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.ts +74 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.tsx +29 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.ts +9 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/constants.ts +1 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.ts +8 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.ts +29 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/stories/args.ts +99 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.tsx +25 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/types.ts +7 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/utils.ts +26 -0
- package/src/components/Index/components/EntitiesView/components/EntityList/entityList.tsx +29 -0
- package/src/components/Index/components/EntitiesView/components/EntityList/types.ts +3 -0
- package/src/components/Index/components/EntitiesView/constants.ts +1 -0
- package/src/components/Index/components/EntitiesView/entitiesView.styles.ts +21 -0
- package/src/components/Index/components/EntitiesView/entitiesView.tsx +30 -0
- package/src/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.ts +15 -0
- package/src/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.ts +16 -0
- package/src/components/Index/components/EntitiesView/stories/entitiesView.stories.tsx +76 -0
- package/src/components/Index/components/EntitiesView/types.ts +9 -0
- package/src/components/Index/index.stories.tsx +3 -2
- package/src/components/Index/index.tsx +15 -15
- package/src/components/Index/types.ts +13 -0
- package/src/components/Layout/components/BackPage/components/BackPageHero/backPageHero.tsx +19 -14
- package/src/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.tsx +24 -0
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx +3 -3
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.tsx +2 -2
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/menu.tsx +2 -2
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.ts +8 -3
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.tsx +5 -2
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.tsx +2 -2
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +2 -2
- package/src/components/Layout/components/Sidebar/components/SidebarButton/sidebarButton.tsx +2 -2
- package/src/components/Loading/loading.stories.tsx +2 -2
- package/src/components/Loading/loading.tsx +11 -3
- package/src/components/Login/components/Section/components/Consent/consent.styles.ts +2 -2
- package/src/components/Login/components/Section/components/Consent/consent.tsx +4 -4
- package/src/components/Login/components/Section/components/Consent/types.ts +2 -2
- package/src/components/NoResults/noResults.styles.ts +4 -2
- package/src/components/NoResults/noResults.tsx +16 -22
- package/src/components/NoResults/types.ts +13 -0
- package/src/components/Plot/components/BarX/barX.tsx +20 -0
- package/src/components/Plot/components/BarX/types.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepContent/stepContent.styles.ts +18 -0
- package/src/components/Stepper/components/Step/components/StepContent/stepContent.tsx +16 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.ts +19 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.tsx +20 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepIcon/constants.ts +1 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.ts +32 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.tsx +21 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.tsx +52 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.ts +14 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.tsx +13 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.tsx +30 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/constants.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.tsx +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.tsx +31 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.ts +7 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.tsx +9 -0
- package/src/components/Stepper/components/Step/components/StepLabel/constants.ts +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.ts +13 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.tsx +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stories/contants.ts +19 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.tsx +48 -0
- package/src/components/Stepper/components/Step/constants.ts +6 -0
- package/src/components/Stepper/components/Step/step.styles.ts +33 -0
- package/src/components/Stepper/components/Step/step.tsx +12 -0
- package/src/components/Stepper/components/Step/stories/contants.ts +18 -0
- package/src/components/Stepper/components/Step/stories/step.stories.tsx +87 -0
- package/src/components/Support/components/SupportRequest/components/Dialog/dialog.tsx +2 -2
- package/src/components/Table/components/Pagination/pagination.tsx +3 -4
- package/src/components/Table/components/TableHead/tableHead.tsx +2 -2
- package/src/components/Table/table.tsx +42 -38
- package/src/components/TableCreator/tableCreator.tsx +8 -18
- package/src/components/common/AnchorLink/anchorLink.tsx +2 -2
- package/src/components/common/Breadcrumbs/breadcrumbs.tsx +2 -2
- package/src/components/common/Breadcrumbs/typeGuard.ts +24 -0
- package/src/components/common/Button/components/DropdownButton/dropdownButton.tsx +2 -2
- package/src/components/common/Button/components/NavigationButton/navigationButton.tsx +2 -2
- package/src/components/common/CopyToClipboard/copyToClipboard.tsx +2 -2
- package/src/components/common/Dialog/components/DialogTitle/dialogTitle.tsx +2 -2
- package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.tsx +2 -2
- package/src/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.tsx +5 -6
- package/src/components/common/Form/components/UploadFile/uploadFile.tsx +2 -2
- package/src/components/common/KeyValuePairs/components/KeyElType/keyElType.tsx +14 -9
- package/src/components/common/KeyValuePairs/components/ValueElType/valueElType.tsx +8 -9
- package/src/components/common/LoginDialog/loginDialog.styles.ts +1 -1
- package/src/components/common/Paper/paper.tsx +9 -3
- package/src/components/common/Section/components/CollapsableSection/collapsableSection.tsx +2 -3
- package/src/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.ts +17 -0
- package/src/components/types.ts +4 -0
- package/src/config/entities.ts +2 -0
- package/src/hooks/useCategoryFilter.ts +1 -0
- package/src/hooks/useResizeObserver.ts +5 -2
- package/src/storybook/controls/constants.ts +12 -0
- package/src/storybook/controls/types.ts +4 -0
- package/src/storybook/controls/utils.ts +18 -0
- package/src/storybook/decorators.tsx +17 -0
- package/src/storybook/loremIpsum.ts +5 -0
- package/src/storybook/parameters.ts +14 -0
- package/src/styles/common/mui/palette.ts +47 -0
- package/src/styles/common/mui/stepper.ts +14 -0
- package/src/styles/common/mui/svgIcon.ts +35 -0
- package/src/styles/common/mui/typography.ts +1 -0
- package/src/tests/mui/constants.ts +4 -0
- package/src/theme/common/typography.ts +12 -1
- package/src/theme/theme.ts +2 -0
- package/src/utils/tests.ts +20 -0
- package/src/views/ExploreView/exploreView.tsx +8 -42
- package/tests/chart.test.tsx +170 -0
- package/tests/chartView.test.tsx +36 -0
- package/tests/entitiesView.test.tsx +36 -0
- package/tests/setup.ts +19 -0
- package/tests/stepIcon.test.tsx +42 -0
- package/types/data-explorer-ui.d.ts +39 -80
- package/src/components/Index/components/Cell/cell.tsx +0 -22
- package/src/components/Index/components/NTag/components/Tooltip/tooltip.styles.ts +0 -11
- package/src/components/Index/components/NTag/components/Tooltip/tooltip.tsx +0 -90
- package/src/components/Index/components/NTag/nTag.tsx +0 -25
- package/src/components/Index/components/NTagCell/nTagCell.stories.tsx +0 -22
- package/src/components/Index/components/NTagCell/nTagCell.tsx +0 -74
- package/src/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.tsx +0 -16
- package/src/components/TableCreator/tableCreator.styles.ts +0 -5
|
@@ -3,9 +3,10 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
3
3
|
* Element resizing and repositioning observer.
|
|
4
4
|
* @param ref - element to be observed for changes to its size or position.
|
|
5
5
|
* @param onResizeFn - action to be performed when the observed element is resized or repositioned.
|
|
6
|
+
* @param shouldObserve - boolean flag to determine if the observer should be active.
|
|
6
7
|
* @returns Element size and position properties for the given element.
|
|
7
8
|
*/
|
|
8
|
-
export function useResizeObserver(ref, onResizeFn) {
|
|
9
|
+
export function useResizeObserver(ref, onResizeFn, shouldObserve = true) {
|
|
9
10
|
const [elementRect, setElementRect] = useState();
|
|
10
11
|
const observerRef = useRef();
|
|
11
12
|
// Observed element is resized or repositioned - set state elementRect with the element's new dimensions or position.
|
|
@@ -19,6 +20,8 @@ export function useResizeObserver(ref, onResizeFn) {
|
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
if (!ref.current)
|
|
21
22
|
return;
|
|
23
|
+
if (!shouldObserve)
|
|
24
|
+
return;
|
|
22
25
|
observerRef.current = new ResizeObserver(onResize);
|
|
23
26
|
const observer = observerRef.current;
|
|
24
27
|
const observedEl = ref.current;
|
|
@@ -26,7 +29,7 @@ export function useResizeObserver(ref, onResizeFn) {
|
|
|
26
29
|
return () => {
|
|
27
30
|
observer.unobserve(observedEl);
|
|
28
31
|
};
|
|
29
|
-
}, [onResize, ref]);
|
|
32
|
+
}, [onResize, ref, shouldObserve]);
|
|
30
33
|
return elementRect;
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const INACTIVITY_PARAM = "inactivityTimeout";
|
|
2
|
+
interface UseSessionTimeout {
|
|
3
|
+
clearSessionTimeout: () => void;
|
|
4
|
+
isSessionTimeout: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Session timeout hook.
|
|
8
|
+
* @returns flag indicating if the session has timed out.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useSessionTimeout: () => UseSessionTimeout;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Router from "next/router";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { useConfig } from "./useConfig";
|
|
4
|
+
import { useLocation } from "./useLocation";
|
|
5
|
+
export const INACTIVITY_PARAM = "inactivityTimeout";
|
|
6
|
+
/**
|
|
7
|
+
* Session timeout hook.
|
|
8
|
+
* @returns flag indicating if the session has timed out.
|
|
9
|
+
*/
|
|
10
|
+
export const useSessionTimeout = () => {
|
|
11
|
+
const { config: { redirectRootToPath }, } = useConfig();
|
|
12
|
+
const [isSessionTimeout, setIsSessionTimeout] = useState(false);
|
|
13
|
+
// Get the session timeout from URL parameters.
|
|
14
|
+
const { search } = useLocation() || {};
|
|
15
|
+
const sessionTimeout = search?.get(INACTIVITY_PARAM);
|
|
16
|
+
// Clears session timeout state.
|
|
17
|
+
const clearSessionTimeout = useCallback(() => {
|
|
18
|
+
setIsSessionTimeout(false);
|
|
19
|
+
Router.replace(redirectRootToPath);
|
|
20
|
+
}, [redirectRootToPath]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setIsSessionTimeout(sessionTimeout === "true");
|
|
23
|
+
}, [sessionTimeout]);
|
|
24
|
+
return {
|
|
25
|
+
clearSessionTimeout,
|
|
26
|
+
isSessionTimeout,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { AUTHENTICATION_STATUS, LoginStatus } from "../hooks/useAuthentication/common/entities";
|
|
3
|
+
import { UserProfile } from "../hooks/useAuthentication/useFetchGoogleProfile";
|
|
4
|
+
import { TerraNIHResponse } from "../hooks/useAuthentication/useFetchTerraNIHProfile";
|
|
5
|
+
import { TerraResponse } from "../hooks/useAuthentication/useFetchTerraProfile";
|
|
6
|
+
import { TerraTermsOfServiceResponse } from "../hooks/useAuthentication/useFetchTerraTermsOfService";
|
|
7
|
+
export declare const ROUTE_LOGIN = "/login";
|
|
8
|
+
type AuthenticateUserFn = () => void;
|
|
9
|
+
type RequestAuthenticationFn = () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Model of authentication context.
|
|
12
|
+
*/
|
|
13
|
+
export interface AuthContextProps {
|
|
14
|
+
authenticateUser: AuthenticateUserFn;
|
|
15
|
+
authenticationStatus: AUTHENTICATION_STATUS;
|
|
16
|
+
isAuthenticated: boolean;
|
|
17
|
+
isEnabled: boolean;
|
|
18
|
+
requestAuthentication: RequestAuthenticationFn;
|
|
19
|
+
terraNIHProfileLoginStatus: LoginStatus<TerraNIHResponse>;
|
|
20
|
+
terraProfileLoginStatus: LoginStatus<TerraResponse>;
|
|
21
|
+
terraTOSLoginStatus: LoginStatus<TerraTermsOfServiceResponse>;
|
|
22
|
+
token?: string;
|
|
23
|
+
userProfile?: UserProfile;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Auth context for storing and using auth-related state.
|
|
27
|
+
*/
|
|
28
|
+
export declare const AuthContext: React.Context<AuthContextProps>;
|
|
29
|
+
interface Props {
|
|
30
|
+
children: ReactNode | ReactNode[];
|
|
31
|
+
sessionTimeout?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Auth provider for consuming components to subscribe to changes in auth-related state.
|
|
35
|
+
* @param props - Component inputs.
|
|
36
|
+
* @param props.children - Set of children components that can possibly consume the query provider.
|
|
37
|
+
* @param props.sessionTimeout - If provided, will set the value for a session timeout (in milliseconds).
|
|
38
|
+
* @returns Provider element to be used by consumers to both update authentication state and subscribe to changes in authentication state.
|
|
39
|
+
*/
|
|
40
|
+
export declare function AuthProvider({ children, sessionTimeout }: Props): JSX.Element;
|
|
41
|
+
/**
|
|
42
|
+
* Token is released for the following conditions:
|
|
43
|
+
* - Terra endpoint is configured and the terms of service response is successful, or
|
|
44
|
+
* - Terra endpoint is not configured and the user profile response is successful.
|
|
45
|
+
* @param userProfileLoginStatus - User profile login status.
|
|
46
|
+
* @param terraProfileLoginStatus - Terra profile login status.
|
|
47
|
+
* @param terraTOSLoginStatus - Terra terms of service login status.
|
|
48
|
+
* @returns true if the token should be released.
|
|
49
|
+
*/
|
|
50
|
+
export declare function shouldReleaseToken(userProfileLoginStatus: LoginStatus<UserProfile>, terraProfileLoginStatus: LoginStatus<TerraResponse>, terraTOSLoginStatus: LoginStatus<TerraTermsOfServiceResponse>): boolean;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import Router, { useRouter } from "next/router";
|
|
2
|
+
import React, { createContext, useCallback } from "react";
|
|
3
|
+
import { useIdleTimer } from "react-idle-timer";
|
|
4
|
+
import { LOGIN_STATUS_NOT_STARTED } from "../hooks/useAuthentication/common/constants";
|
|
5
|
+
import { AUTHENTICATION_STATUS, } from "../hooks/useAuthentication/common/entities";
|
|
6
|
+
import { useAuthenticationComplete } from "../hooks/useAuthentication/useAuthenticationComplete";
|
|
7
|
+
import { useAuthenticationStatus } from "../hooks/useAuthentication/useAuthenticationStatus";
|
|
8
|
+
import { useFetchGoogleProfile, } from "../hooks/useAuthentication/useFetchGoogleProfile";
|
|
9
|
+
import { useFetchTerraNIHProfile, } from "../hooks/useAuthentication/useFetchTerraNIHProfile";
|
|
10
|
+
import { useFetchTerraProfile, } from "../hooks/useAuthentication/useFetchTerraProfile";
|
|
11
|
+
import { useFetchTerraTermsOfService, } from "../hooks/useAuthentication/useFetchTerraTermsOfService";
|
|
12
|
+
import { useTokenClient } from "../hooks/useAuthentication/useTokenClient";
|
|
13
|
+
import { useConfig } from "../hooks/useConfig";
|
|
14
|
+
import { INACTIVITY_PARAM } from "../hooks/useSessionTimeout";
|
|
15
|
+
// Template constants
|
|
16
|
+
export const ROUTE_LOGIN = "/login";
|
|
17
|
+
/**
|
|
18
|
+
* Auth context for storing and using auth-related state.
|
|
19
|
+
*/
|
|
20
|
+
export const AuthContext = createContext({
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function -- allow dummy function for default state.
|
|
22
|
+
authenticateUser: () => { },
|
|
23
|
+
authenticationStatus: AUTHENTICATION_STATUS.INCOMPLETE,
|
|
24
|
+
isAuthenticated: false,
|
|
25
|
+
isEnabled: false,
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function -- allow dummy function for default state.
|
|
27
|
+
requestAuthentication: () => { },
|
|
28
|
+
terraNIHProfileLoginStatus: LOGIN_STATUS_NOT_STARTED,
|
|
29
|
+
terraProfileLoginStatus: LOGIN_STATUS_NOT_STARTED,
|
|
30
|
+
terraTOSLoginStatus: LOGIN_STATUS_NOT_STARTED,
|
|
31
|
+
token: undefined,
|
|
32
|
+
userProfile: undefined,
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Auth provider for consuming components to subscribe to changes in auth-related state.
|
|
36
|
+
* @param props - Component inputs.
|
|
37
|
+
* @param props.children - Set of children components that can possibly consume the query provider.
|
|
38
|
+
* @param props.sessionTimeout - If provided, will set the value for a session timeout (in milliseconds).
|
|
39
|
+
* @returns Provider element to be used by consumers to both update authentication state and subscribe to changes in authentication state.
|
|
40
|
+
*/
|
|
41
|
+
export function AuthProvider({ children, sessionTimeout }) {
|
|
42
|
+
const { config } = useConfig();
|
|
43
|
+
const { authentication, redirectRootToPath } = config;
|
|
44
|
+
const { basePath } = useRouter();
|
|
45
|
+
const { token, tokenClient } = useTokenClient();
|
|
46
|
+
const terraNIHProfileLoginStatus = useFetchTerraNIHProfile(token);
|
|
47
|
+
const terraProfileLoginStatus = useFetchTerraProfile(token);
|
|
48
|
+
const terraTOSLoginStatus = useFetchTerraTermsOfService(token);
|
|
49
|
+
const userProfileLoginStatus = useFetchGoogleProfile(token);
|
|
50
|
+
const isEnabled = Boolean(authentication);
|
|
51
|
+
const isAuthenticated = userProfileLoginStatus.isSuccess;
|
|
52
|
+
const releaseToken = shouldReleaseToken(userProfileLoginStatus, terraProfileLoginStatus, terraTOSLoginStatus);
|
|
53
|
+
const authenticationStatus = useAuthenticationStatus(userProfileLoginStatus, terraProfileLoginStatus, terraTOSLoginStatus, terraNIHProfileLoginStatus);
|
|
54
|
+
// Handle completion of authentication process.
|
|
55
|
+
useAuthenticationComplete(authenticationStatus);
|
|
56
|
+
/**
|
|
57
|
+
* If sessionTimeout is set and user is authenticated, the app will reload and redirect to
|
|
58
|
+
* origin, including base path, root path, and query param.
|
|
59
|
+
*/
|
|
60
|
+
useIdleTimer({
|
|
61
|
+
onIdle: () => isAuthenticated &&
|
|
62
|
+
sessionTimeout &&
|
|
63
|
+
(window.location.href =
|
|
64
|
+
window.location.origin +
|
|
65
|
+
basePath +
|
|
66
|
+
redirectRootToPath +
|
|
67
|
+
"?" +
|
|
68
|
+
`${INACTIVITY_PARAM}=true`),
|
|
69
|
+
timeout: sessionTimeout,
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* Requests access token and authenticates user.
|
|
73
|
+
*/
|
|
74
|
+
const authenticateUser = useCallback(() => {
|
|
75
|
+
tokenClient.requestAccessToken();
|
|
76
|
+
}, [tokenClient]);
|
|
77
|
+
/**
|
|
78
|
+
* Navigates to login page.
|
|
79
|
+
*/
|
|
80
|
+
const requestAuthentication = useCallback(() => {
|
|
81
|
+
Router.push(ROUTE_LOGIN);
|
|
82
|
+
}, []);
|
|
83
|
+
return (React.createElement(AuthContext.Provider, { value: {
|
|
84
|
+
authenticateUser,
|
|
85
|
+
authenticationStatus,
|
|
86
|
+
isAuthenticated,
|
|
87
|
+
isEnabled,
|
|
88
|
+
requestAuthentication,
|
|
89
|
+
terraNIHProfileLoginStatus,
|
|
90
|
+
terraProfileLoginStatus,
|
|
91
|
+
terraTOSLoginStatus,
|
|
92
|
+
token: releaseToken ? token : undefined,
|
|
93
|
+
userProfile: userProfileLoginStatus.response,
|
|
94
|
+
} }, children));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Token is released for the following conditions:
|
|
98
|
+
* - Terra endpoint is configured and the terms of service response is successful, or
|
|
99
|
+
* - Terra endpoint is not configured and the user profile response is successful.
|
|
100
|
+
* @param userProfileLoginStatus - User profile login status.
|
|
101
|
+
* @param terraProfileLoginStatus - Terra profile login status.
|
|
102
|
+
* @param terraTOSLoginStatus - Terra terms of service login status.
|
|
103
|
+
* @returns true if the token should be released.
|
|
104
|
+
*/
|
|
105
|
+
export function shouldReleaseToken(userProfileLoginStatus, terraProfileLoginStatus, terraTOSLoginStatus) {
|
|
106
|
+
if (terraProfileLoginStatus.isSupported) {
|
|
107
|
+
return terraTOSLoginStatus.isSuccess;
|
|
108
|
+
}
|
|
109
|
+
return userProfileLoginStatus.isSuccess;
|
|
110
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { Dispatch, ReactNode } from "react";
|
|
2
|
+
export declare const DEFAULT_LAYOUT_STATE: {
|
|
3
|
+
headerHeight: number;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Layout state.
|
|
7
|
+
*/
|
|
8
|
+
export type LayoutState = {
|
|
9
|
+
headerHeight: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Model of layout state context.
|
|
13
|
+
*/
|
|
14
|
+
export type LayoutStateContextProps = {
|
|
15
|
+
layoutDispatch: Dispatch<LayoutAction>;
|
|
16
|
+
layoutState: LayoutState;
|
|
17
|
+
};
|
|
18
|
+
export declare const LayoutStateContext: React.Context<LayoutStateContextProps>;
|
|
19
|
+
export interface LayoutStateProps {
|
|
20
|
+
children: ReactNode | ReactNode[];
|
|
21
|
+
}
|
|
22
|
+
export declare function LayoutStateProvider({ children, }: LayoutStateProps): JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Layout action kind.
|
|
25
|
+
*/
|
|
26
|
+
export declare enum LayoutActionKind {
|
|
27
|
+
UpdateHeaderHeight = "UPDATE_HEADER_HEIGHT"
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Layout action.
|
|
31
|
+
*/
|
|
32
|
+
export type LayoutAction = UpdateHeaderHeightAction;
|
|
33
|
+
/**
|
|
34
|
+
* Update header height action.
|
|
35
|
+
*/
|
|
36
|
+
type UpdateHeaderHeightAction = {
|
|
37
|
+
payload?: number;
|
|
38
|
+
type: LayoutActionKind.UpdateHeaderHeight;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { createContext, useReducer } from "react";
|
|
2
|
+
import { HEADER_HEIGHT } from "../components/Layout/components/Header/common/constants";
|
|
3
|
+
// Default layout state.
|
|
4
|
+
export const DEFAULT_LAYOUT_STATE = {
|
|
5
|
+
headerHeight: HEADER_HEIGHT + 1, // 1px for bottom border.
|
|
6
|
+
};
|
|
7
|
+
export const LayoutStateContext = createContext({
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function -- allow dummy function for default state.
|
|
9
|
+
layoutDispatch: () => { },
|
|
10
|
+
layoutState: DEFAULT_LAYOUT_STATE,
|
|
11
|
+
});
|
|
12
|
+
export function LayoutStateProvider({ children, }) {
|
|
13
|
+
// Layout state.
|
|
14
|
+
const [layoutState, layoutDispatch] = useReducer((s, a) => layoutReducer(s, a), DEFAULT_LAYOUT_STATE);
|
|
15
|
+
return (React.createElement(LayoutStateContext.Provider, { value: {
|
|
16
|
+
layoutDispatch,
|
|
17
|
+
layoutState,
|
|
18
|
+
} }, children));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Layout action kind.
|
|
22
|
+
*/
|
|
23
|
+
export var LayoutActionKind;
|
|
24
|
+
(function (LayoutActionKind) {
|
|
25
|
+
LayoutActionKind["UpdateHeaderHeight"] = "UPDATE_HEADER_HEIGHT";
|
|
26
|
+
})(LayoutActionKind || (LayoutActionKind = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Layout reducer.
|
|
29
|
+
* @param state - Layout state.
|
|
30
|
+
* @param action - Layout action.
|
|
31
|
+
* @returns layout state.
|
|
32
|
+
*/
|
|
33
|
+
function layoutReducer(state, action) {
|
|
34
|
+
const { payload, type } = action;
|
|
35
|
+
// eslint-disable-next-line sonarjs/no-small-switch -- allow small switch.
|
|
36
|
+
switch (type) {
|
|
37
|
+
// Updates header height.
|
|
38
|
+
case LayoutActionKind.UpdateHeaderHeight: {
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
headerHeight: payload ?? state.headerHeight,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
default:
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Args, ArgTypes } from "@storybook/react";
|
|
2
|
+
import { CONTROL_TYPE } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Configures controls for specified keys with the given control type.
|
|
5
|
+
* @param keys - ArgType keys.
|
|
6
|
+
* @param controlType - The type of control to apply (from CONTROL_TYPE enum).
|
|
7
|
+
* @returns An object of ArgTypes with the specified control configuration.
|
|
8
|
+
*/
|
|
9
|
+
export declare function configureControls<TArg = Args>(keys: (keyof TArg)[], controlType: CONTROL_TYPE): Partial<ArgTypes<TArg>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CONTROL_CONFIG_MAP } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* Configures controls for specified keys with the given control type.
|
|
4
|
+
* @param keys - ArgType keys.
|
|
5
|
+
* @param controlType - The type of control to apply (from CONTROL_TYPE enum).
|
|
6
|
+
* @returns An object of ArgTypes with the specified control configuration.
|
|
7
|
+
*/
|
|
8
|
+
export function configureControls(keys, controlType) {
|
|
9
|
+
return Object.fromEntries(keys.map((key) => [key, { control: CONTROL_CONFIG_MAP[controlType] }]));
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
2
|
+
import { CssBaseline, ThemeProvider } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { createAppTheme } from "../theme/theme";
|
|
5
|
+
export const decorators = (Story, context) => {
|
|
6
|
+
const theme = createAppTheme();
|
|
7
|
+
return (React.createElement(EmotionThemeProvider, { theme: theme },
|
|
8
|
+
React.createElement(ThemeProvider, { theme: theme },
|
|
9
|
+
React.createElement(CssBaseline, null),
|
|
10
|
+
React.createElement(Story, { ...context }))));
|
|
11
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const LOREM_IPSUM = {
|
|
2
|
+
LONG: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.",
|
|
3
|
+
SHORT: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.",
|
|
4
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const PALETTE: {
|
|
2
|
+
readonly ALERT_LIGHT: "var(--mui-palette-alert-light)";
|
|
3
|
+
readonly ALERT_LIGHTEST: "var(--mui-palette-alert-lightest)";
|
|
4
|
+
readonly ALERT_MAIN: "var(--mui-palette-alert-main)";
|
|
5
|
+
readonly BACKGROUND_DEFAULT: "var(--mui-palette-background-default)";
|
|
6
|
+
readonly BACKGROUND_PAPER: "var(--mui-palette-background-paper)";
|
|
7
|
+
readonly COMMON_BACKGROUND: "var(--mui-palette-common-background)";
|
|
8
|
+
readonly COMMON_BLACK: "var(--mui-palette-common-black)";
|
|
9
|
+
readonly COMMON_WHITE: "var(--mui-palette-common-white)";
|
|
10
|
+
readonly ERROR_CONTRAST_TEXT: "var(--mui-palette-error-contrastText)";
|
|
11
|
+
readonly ERROR_DARK: "var(--mui-palette-error-dark)";
|
|
12
|
+
readonly ERROR_LIGHT: "var(--mui-palette-error-light)";
|
|
13
|
+
readonly ERROR_MAIN: "var(--mui-palette-error-main)";
|
|
14
|
+
readonly INFO_CONTRAST_TEXT: "var(--mui-palette-info-contrastText)";
|
|
15
|
+
readonly INFO_DARK: "var(--mui-palette-info-dark)";
|
|
16
|
+
readonly INFO_LIGHT: "var(--mui-palette-info-light)";
|
|
17
|
+
readonly INFO_LIGHTEST: "var(--mui-palette-info-lightest)";
|
|
18
|
+
readonly INFO_MAIN: "var(--mui-palette-info-main)";
|
|
19
|
+
readonly INK_LIGHT: "var(--mui-palette-ink-light)";
|
|
20
|
+
readonly INK_MAIN: "var(--mui-palette-ink-main)";
|
|
21
|
+
readonly PRIMARY_CONTRAST_TEXT: "var(--mui-palette-primary-contrastText)";
|
|
22
|
+
readonly PRIMARY_DARK: "var(--mui-palette-primary-dark)";
|
|
23
|
+
readonly PRIMARY_LIGHT: "var(--mui-palette-primary-light)";
|
|
24
|
+
readonly PRIMARY_LIGHTEST: "var(--mui-palette-primary-lightest)";
|
|
25
|
+
readonly PRIMARY_MAIN: "var(--mui-palette-primary-main)";
|
|
26
|
+
readonly SECONDARY_CONTRAST_TEXT: "var(--mui-palette-secondary-contrastText)";
|
|
27
|
+
readonly SECONDARY_DARK: "var(--mui-palette-secondary-dark)";
|
|
28
|
+
readonly SECONDARY_LIGHT: "var(--mui-palette-secondary-light)";
|
|
29
|
+
readonly SECONDARY_MAIN: "var(--mui-palette-secondary-main)";
|
|
30
|
+
readonly SMOKE_DARK: "var(--mui-palette-smoke-dark)";
|
|
31
|
+
readonly SMOKE_LIGHT: "var(--mui-palette-smoke-light)";
|
|
32
|
+
readonly SMOKE_LIGHTEST: "var(--mui-palette-smoke-lightest)";
|
|
33
|
+
readonly SMOKE_MAIN: "var(--mui-palette-smoke-main)";
|
|
34
|
+
readonly SUCCESS_CONTRAST_TEXT: "var(--mui-palette-success-contrastText)";
|
|
35
|
+
readonly SUCCESS_DARK: "var(--mui-palette-success-dark)";
|
|
36
|
+
readonly SUCCESS_LIGHT: "var(--mui-palette-success-light)";
|
|
37
|
+
readonly SUCCESS_LIGHTEST: "var(--mui-palette-success-lightest)";
|
|
38
|
+
readonly SUCCESS_MAIN: "var(--mui-palette-success-main)";
|
|
39
|
+
readonly TEXT_DISABLED: "var(--mui-palette-text-disabled)";
|
|
40
|
+
readonly TEXT_PRIMARY: "var(--mui-palette-text-primary)";
|
|
41
|
+
readonly TEXT_SECONDARY: "var(--mui-palette-text-secondary)";
|
|
42
|
+
readonly WARNING_CONTRAST_TEXT: "var(--mui-palette-warning-contrastText)";
|
|
43
|
+
readonly WARNING_DARK: "var(--mui-palette-warning-dark)";
|
|
44
|
+
readonly WARNING_LIGHT: "var(--mui-palette-warning-light)";
|
|
45
|
+
readonly WARNING_LIGHTEST: "var(--mui-palette-warning-lightest)";
|
|
46
|
+
readonly WARNING_MAIN: "var(--mui-palette-warning-main)";
|
|
47
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const PALETTE = {
|
|
2
|
+
ALERT_LIGHT: `var(--mui-palette-alert-light)`,
|
|
3
|
+
ALERT_LIGHTEST: `var(--mui-palette-alert-lightest)`,
|
|
4
|
+
ALERT_MAIN: `var(--mui-palette-alert-main)`,
|
|
5
|
+
BACKGROUND_DEFAULT: `var(--mui-palette-background-default)`,
|
|
6
|
+
BACKGROUND_PAPER: `var(--mui-palette-background-paper)`,
|
|
7
|
+
COMMON_BACKGROUND: `var(--mui-palette-common-background)`,
|
|
8
|
+
COMMON_BLACK: `var(--mui-palette-common-black)`,
|
|
9
|
+
COMMON_WHITE: `var(--mui-palette-common-white)`,
|
|
10
|
+
ERROR_CONTRAST_TEXT: `var(--mui-palette-error-contrastText)`,
|
|
11
|
+
ERROR_DARK: `var(--mui-palette-error-dark)`,
|
|
12
|
+
ERROR_LIGHT: `var(--mui-palette-error-light)`,
|
|
13
|
+
ERROR_MAIN: `var(--mui-palette-error-main)`,
|
|
14
|
+
INFO_CONTRAST_TEXT: `var(--mui-palette-info-contrastText)`,
|
|
15
|
+
INFO_DARK: `var(--mui-palette-info-dark)`,
|
|
16
|
+
INFO_LIGHT: `var(--mui-palette-info-light)`,
|
|
17
|
+
INFO_LIGHTEST: `var(--mui-palette-info-lightest)`,
|
|
18
|
+
INFO_MAIN: `var(--mui-palette-info-main)`,
|
|
19
|
+
INK_LIGHT: `var(--mui-palette-ink-light)`,
|
|
20
|
+
INK_MAIN: `var(--mui-palette-ink-main)`,
|
|
21
|
+
PRIMARY_CONTRAST_TEXT: `var(--mui-palette-primary-contrastText)`,
|
|
22
|
+
PRIMARY_DARK: `var(--mui-palette-primary-dark)`,
|
|
23
|
+
PRIMARY_LIGHT: `var(--mui-palette-primary-light)`,
|
|
24
|
+
PRIMARY_LIGHTEST: `var(--mui-palette-primary-lightest)`,
|
|
25
|
+
PRIMARY_MAIN: `var(--mui-palette-primary-main)`,
|
|
26
|
+
SECONDARY_CONTRAST_TEXT: `var(--mui-palette-secondary-contrastText)`,
|
|
27
|
+
SECONDARY_DARK: `var(--mui-palette-secondary-dark)`,
|
|
28
|
+
SECONDARY_LIGHT: `var(--mui-palette-secondary-light)`,
|
|
29
|
+
SECONDARY_MAIN: `var(--mui-palette-secondary-main)`,
|
|
30
|
+
SMOKE_DARK: `var(--mui-palette-smoke-dark)`,
|
|
31
|
+
SMOKE_LIGHT: `var(--mui-palette-smoke-light)`,
|
|
32
|
+
SMOKE_LIGHTEST: `var(--mui-palette-smoke-lightest)`,
|
|
33
|
+
SMOKE_MAIN: `var(--mui-palette-smoke-main)`,
|
|
34
|
+
SUCCESS_CONTRAST_TEXT: `var(--mui-palette-success-contrastText)`,
|
|
35
|
+
SUCCESS_DARK: `var(--mui-palette-success-dark)`,
|
|
36
|
+
SUCCESS_LIGHT: `var(--mui-palette-success-light)`,
|
|
37
|
+
SUCCESS_LIGHTEST: `var(--mui-palette-success-lightest)`,
|
|
38
|
+
SUCCESS_MAIN: `var(--mui-palette-success-main)`,
|
|
39
|
+
TEXT_DISABLED: `var(--mui-palette-text-disabled)`,
|
|
40
|
+
TEXT_PRIMARY: `var(--mui-palette-text-primary)`,
|
|
41
|
+
TEXT_SECONDARY: `var(--mui-palette-text-secondary)`,
|
|
42
|
+
WARNING_CONTRAST_TEXT: `var(--mui-palette-warning-contrastText)`,
|
|
43
|
+
WARNING_DARK: `var(--mui-palette-warning-dark)`,
|
|
44
|
+
WARNING_LIGHT: `var(--mui-palette-warning-light)`,
|
|
45
|
+
WARNING_LIGHTEST: `var(--mui-palette-warning-lightest)`,
|
|
46
|
+
WARNING_MAIN: `var(--mui-palette-warning-main)`,
|
|
47
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SvgIconProps } from "@mui/material";
|
|
2
|
+
type SvgIconPropsOptions = {
|
|
3
|
+
COLOR: typeof COLOR;
|
|
4
|
+
FONT_SIZE: typeof FONT_SIZE;
|
|
5
|
+
};
|
|
6
|
+
declare const COLOR: Record<string, SvgIconProps["color"]>;
|
|
7
|
+
declare const FONT_SIZE: Record<string, SvgIconProps["fontSize"]>;
|
|
8
|
+
export declare const SVG_ICON_PROPS: SvgIconPropsOptions;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const COLOR = {
|
|
2
|
+
ACTION: "action",
|
|
3
|
+
DISABLED: "disabled",
|
|
4
|
+
ERROR: "error",
|
|
5
|
+
INFO: "info",
|
|
6
|
+
INHERIT: "inherit",
|
|
7
|
+
INK_LIGHT: "inkLight",
|
|
8
|
+
INK_MAIN: "inkMain",
|
|
9
|
+
PRIMARY: "primary",
|
|
10
|
+
SECONDARY: "secondary",
|
|
11
|
+
SUCCESS: "success",
|
|
12
|
+
WARNING: "warning",
|
|
13
|
+
};
|
|
14
|
+
const FONT_SIZE = {
|
|
15
|
+
INHERIT: "inherit",
|
|
16
|
+
LARGE: "large",
|
|
17
|
+
MEDIUM: "medium",
|
|
18
|
+
SMALL: "small",
|
|
19
|
+
XSMALL: "xsmall",
|
|
20
|
+
XXLARGE: "xxlarge",
|
|
21
|
+
XXSMALL: "xxsmall",
|
|
22
|
+
};
|
|
23
|
+
export const SVG_ICON_PROPS = {
|
|
24
|
+
COLOR,
|
|
25
|
+
FONT_SIZE,
|
|
26
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CSSProperties } from "@mui/material
|
|
1
|
+
import { CSSProperties } from "@mui/material";
|
|
2
2
|
/**
|
|
3
3
|
* Typography constants.
|
|
4
4
|
*/
|
|
5
5
|
export declare const fontFamily = "Inter";
|
|
6
|
-
export declare const TEXT_BODY_400: "text-body-400", TEXT_BODY_400_2_LINES: "text-body-400-2lines", TEXT_BODY_500: "text-body-500", TEXT_BODY_500_2_LINES: "text-body-500-2lines", TEXT_BODY_LARGE_400: "text-body-large-400", TEXT_BODY_LARGE_400_2_LINES: "text-body-large-400-2lines", TEXT_BODY_LARGE_500: "text-body-large-500", TEXT_BODY_SMALL_400: "text-body-small-400", TEXT_BODY_SMALL_400_2_LINES: "text-body-small-400-2lines", TEXT_BODY_SMALL_500: "text-body-small-500", TEXT_HEADING: "text-heading", TEXT_HEADING_LARGE: "text-heading-large", TEXT_HEADING_SMALL: "text-heading-small", TEXT_HEADING_XLARGE: "text-heading-xlarge", TEXT_UPPERCASE_500: "text-uppercase-500";
|
|
6
|
+
export declare const TEXT_BODY_400: "text-body-400", TEXT_BODY_400_2_LINES: "text-body-400-2lines", TEXT_BODY_500: "text-body-500", TEXT_BODY_500_2_LINES: "text-body-500-2lines", TEXT_BODY_LARGE_400: "text-body-large-400", TEXT_BODY_LARGE_400_2_LINES: "text-body-large-400-2lines", TEXT_BODY_LARGE_500: "text-body-large-500", TEXT_BODY_SMALL_400: "text-body-small-400", TEXT_BODY_SMALL_400_2_LINES: "text-body-small-400-2lines", TEXT_BODY_SMALL_500: "text-body-small-500", TEXT_HEADING: "text-heading", TEXT_HEADING_LARGE: "text-heading-large", TEXT_HEADING_SMALL: "text-heading-small", TEXT_HEADING_XLARGE: "text-heading-xlarge", TEXT_HEADING_XSMALL: "text-heading-xsmall", TEXT_UPPERCASE_500: "text-uppercase-500";
|
|
7
7
|
/**
|
|
8
8
|
* Typography Option "text-body-400"
|
|
9
9
|
*/
|
|
@@ -60,6 +60,10 @@ export declare const textHeadingSmall: CSSProperties;
|
|
|
60
60
|
* Typography Option "text-heading-xlarge"
|
|
61
61
|
*/
|
|
62
62
|
export declare const textHeadingXLarge: CSSProperties;
|
|
63
|
+
/**
|
|
64
|
+
* Typography Option "text-heading-xsmall"
|
|
65
|
+
*/
|
|
66
|
+
export declare const textHeadingXSmall: CSSProperties;
|
|
63
67
|
/**
|
|
64
68
|
* Typography Option "text-uppercase-500"
|
|
65
69
|
*/
|
|
@@ -18,9 +18,10 @@ const TYPOGRAPHY = {
|
|
|
18
18
|
TEXT_HEADING_LARGE: "text-heading-large",
|
|
19
19
|
TEXT_HEADING_SMALL: "text-heading-small",
|
|
20
20
|
TEXT_HEADING_XLARGE: "text-heading-xlarge",
|
|
21
|
+
TEXT_HEADING_XSMALL: "text-heading-xsmall",
|
|
21
22
|
TEXT_UPPERCASE_500: "text-uppercase-500",
|
|
22
23
|
};
|
|
23
|
-
export const { TEXT_BODY_400, TEXT_BODY_400_2_LINES, TEXT_BODY_500, TEXT_BODY_500_2_LINES, TEXT_BODY_LARGE_400, TEXT_BODY_LARGE_400_2_LINES, TEXT_BODY_LARGE_500, TEXT_BODY_SMALL_400, TEXT_BODY_SMALL_400_2_LINES, TEXT_BODY_SMALL_500, TEXT_HEADING, TEXT_HEADING_LARGE, TEXT_HEADING_SMALL, TEXT_HEADING_XLARGE, TEXT_UPPERCASE_500, } = TYPOGRAPHY;
|
|
24
|
+
export const { TEXT_BODY_400, TEXT_BODY_400_2_LINES, TEXT_BODY_500, TEXT_BODY_500_2_LINES, TEXT_BODY_LARGE_400, TEXT_BODY_LARGE_400_2_LINES, TEXT_BODY_LARGE_500, TEXT_BODY_SMALL_400, TEXT_BODY_SMALL_400_2_LINES, TEXT_BODY_SMALL_500, TEXT_HEADING, TEXT_HEADING_LARGE, TEXT_HEADING_SMALL, TEXT_HEADING_XLARGE, TEXT_HEADING_XSMALL, TEXT_UPPERCASE_500, } = TYPOGRAPHY;
|
|
24
25
|
/**
|
|
25
26
|
* Typography Option "text-body-400"
|
|
26
27
|
*/
|
|
@@ -156,6 +157,14 @@ export const textHeadingXLarge = {
|
|
|
156
157
|
lineHeight: "56px",
|
|
157
158
|
},
|
|
158
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* Typography Option "text-heading-xsmall"
|
|
162
|
+
*/
|
|
163
|
+
export const textHeadingXSmall = {
|
|
164
|
+
fontSize: 16,
|
|
165
|
+
fontWeight: 500,
|
|
166
|
+
lineHeight: "24px",
|
|
167
|
+
};
|
|
159
168
|
/**
|
|
160
169
|
* Typography Option "text-uppercase-500"
|
|
161
170
|
*/
|