@databiosphere/findable-ui 35.0.2 → 35.1.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.
Files changed (161) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/lib/common/entities.d.ts +1 -0
  4. package/lib/components/DataDictionary/components/Table/hook.js +1 -0
  5. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +15 -2
  6. package/lib/providers/exploreState/entities/state.js +12 -9
  7. package/package.json +1 -1
  8. package/src/common/entities.ts +1 -0
  9. package/src/components/DataDictionary/components/Table/hook.ts +1 -0
  10. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +17 -4
  11. package/src/providers/exploreState/entities/state.ts +13 -10
  12. package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +0 -6
  13. package/lib/components/DataDictionary/components/Table/columns/columnDef.js +0 -33
  14. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +0 -5
  15. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +0 -5
  16. package/lib/components/DataDictionary/components/Table/columns/types.d.ts +0 -2
  17. package/lib/components/DataDictionary/components/Table/columns/types.js +0 -1
  18. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +0 -4
  19. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +0 -1
  20. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +0 -8
  21. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +0 -36
  22. package/lib/components/Filter/components/Filter/filter.stories.d.ts +0 -25
  23. package/lib/components/Filter/components/Filter/filter.stories.js +0 -42
  24. package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +0 -16
  25. package/lib/components/Filter/components/FilterTag/filterTag.stories.js +0 -17
  26. package/lib/components/Filter/components/Filters/filters.stories.d.ts +0 -6
  27. package/lib/components/Filter/components/Filters/filters.stories.js +0 -91
  28. package/lib/components/Index/components/Cell/cell.d.ts +0 -7
  29. package/lib/components/Index/components/Cell/cell.js +0 -10
  30. package/lib/components/Index/components/EntitiesView/constants.d.ts +0 -1
  31. package/lib/components/Index/components/EntitiesView/constants.js +0 -1
  32. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +0 -13
  33. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +0 -18
  34. package/lib/components/Index/components/Hero/hero.stories.d.ts +0 -23
  35. package/lib/components/Index/components/Hero/hero.stories.js +0 -22
  36. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +0 -8
  37. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +0 -57
  38. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +0 -4
  39. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +0 -10
  40. package/lib/components/Index/components/NTag/nTag.d.ts +0 -10
  41. package/lib/components/Index/components/NTag/nTag.js +0 -8
  42. package/lib/components/Index/components/NTagCell/nTagCell.d.ts +0 -11
  43. package/lib/components/Index/components/NTagCell/nTagCell.js +0 -29
  44. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +0 -5
  45. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +0 -16
  46. package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
  47. package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
  48. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
  49. package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
  50. package/lib/components/Index/index.stories.d.ts +0 -6
  51. package/lib/components/Index/index.stories.js +0 -26
  52. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +0 -6
  53. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +0 -10
  54. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +0 -5
  55. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +0 -29
  56. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +0 -6
  57. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +0 -13
  58. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +0 -36
  59. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +0 -9
  60. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +0 -5
  61. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +0 -10
  62. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +0 -36
  63. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +0 -9
  64. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +0 -5
  65. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +0 -19
  66. package/lib/components/Layout/components/Outline/common/constants.d.ts +0 -2
  67. package/lib/components/Layout/components/Outline/common/constants.js +0 -1
  68. package/lib/components/Login/login.stories.d.ts +0 -6
  69. package/lib/components/Login/login.stories.js +0 -31
  70. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +0 -16
  71. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +0 -28
  72. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +0 -5
  73. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +0 -46
  74. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +0 -3
  75. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +0 -21
  76. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +0 -2
  77. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +0 -37
  78. package/lib/components/TableCreator/common/constants.d.ts +0 -6
  79. package/lib/components/TableCreator/common/constants.js +0 -19
  80. package/lib/components/TableCreator/common/entities.d.ts +0 -5
  81. package/lib/components/TableCreator/common/entities.js +0 -1
  82. package/lib/components/TableCreator/tableCreator.styles.d.ts +0 -4
  83. package/lib/components/TableCreator/tableCreator.styles.js +0 -4
  84. package/lib/components/common/Alert/alert.stories.d.ts +0 -6
  85. package/lib/components/common/Alert/alert.stories.js +0 -36
  86. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
  87. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
  88. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
  89. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
  90. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
  91. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
  92. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
  93. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
  94. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
  95. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
  96. package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +0 -3
  97. package/lib/components/common/Button/components/LoginButton/loginButton.js +0 -6
  98. package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +0 -7
  99. package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +0 -11
  100. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +0 -5
  101. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +0 -10
  102. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +0 -3
  103. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +0 -9
  104. package/lib/hooks/useAuthentication/common/constants.d.ts +0 -4
  105. package/lib/hooks/useAuthentication/common/constants.js +0 -19
  106. package/lib/hooks/useAuthentication/common/entities.d.ts +0 -25
  107. package/lib/hooks/useAuthentication/common/entities.js +0 -11
  108. package/lib/hooks/useAuthentication/common/utils.d.ts +0 -15
  109. package/lib/hooks/useAuthentication/common/utils.js +0 -25
  110. package/lib/hooks/useAuthentication/useAuthentication.d.ts +0 -6
  111. package/lib/hooks/useAuthentication/useAuthentication.js +0 -9
  112. package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +0 -6
  113. package/lib/hooks/useAuthentication/useAuthenticationComplete.js +0 -55
  114. package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +0 -20
  115. package/lib/hooks/useAuthentication/useAuthenticationForm.js +0 -88
  116. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +0 -18
  117. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +0 -50
  118. package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +0 -20
  119. package/lib/hooks/useAuthentication/useAuthenticationStatus.js +0 -32
  120. package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +0 -21
  121. package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +0 -41
  122. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +0 -18
  123. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +0 -62
  124. package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +0 -24
  125. package/lib/hooks/useAuthentication/useFetchTerraProfile.js +0 -62
  126. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +0 -15
  127. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +0 -62
  128. package/lib/hooks/useAuthentication/useTokenClient.d.ts +0 -11
  129. package/lib/hooks/useAuthentication/useTokenClient.js +0 -29
  130. package/lib/hooks/useAuthenticationConfig.d.ts +0 -6
  131. package/lib/hooks/useAuthenticationConfig.js +0 -14
  132. package/lib/hooks/useCategoryConfigs.d.ts +0 -6
  133. package/lib/hooks/useCategoryConfigs.js +0 -17
  134. package/lib/hooks/useEntityListRelatedView.d.ts +0 -15
  135. package/lib/hooks/useEntityListRelatedView.js +0 -62
  136. package/lib/hooks/useExploreMode.d.ts +0 -14
  137. package/lib/hooks/useExploreMode.js +0 -20
  138. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +0 -15
  139. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +0 -27
  140. package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +0 -5
  141. package/lib/hooks/useFileManifest/useFileManifestURL.js +0 -11
  142. package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +0 -9
  143. package/lib/hooks/useFileManifest/useRequestFileManifest.js +0 -37
  144. package/lib/hooks/useLayoutState.d.ts +0 -6
  145. package/lib/hooks/useLayoutState.js +0 -9
  146. package/lib/hooks/useMenu.d.ts +0 -10
  147. package/lib/hooks/useMenu.js +0 -17
  148. package/lib/hooks/useMenuWithPosition.d.ts +0 -14
  149. package/lib/hooks/useMenuWithPosition.js +0 -33
  150. package/lib/hooks/useSessionTimeout.d.ts +0 -11
  151. package/lib/hooks/useSessionTimeout.js +0 -28
  152. package/lib/providers/authentication.d.ts +0 -51
  153. package/lib/providers/authentication.js +0 -110
  154. package/lib/providers/layoutState.d.ts +0 -40
  155. package/lib/providers/layoutState.js +0 -47
  156. package/lib/styles/common/mixins/shadows.d.ts +0 -3
  157. package/lib/styles/common/mixins/shadows.js +0 -4
  158. package/lib/styles/common/mui/palette.d.ts +0 -47
  159. package/lib/styles/common/mui/palette.js +0 -47
  160. package/lib/theme/common/entities.d.ts +0 -6
  161. package/lib/theme/common/entities.js +0 -1
@@ -1,21 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { Menu as MMenu } from "@mui/material";
3
- export const Menu = styled(MMenu) `
4
- .MuiPaper-menu {
5
- margin: 4px 0;
6
- }
7
-
8
- // List item button
9
- .MuiListItemButton-root {
10
- gap: 8px;
11
- }
12
-
13
- // List item
14
- .MuiListItem-root {
15
- padding: 10px 16px;
16
- }
17
-
18
- .MuiListItemButton-root.Mui-disabled {
19
- opacity: 1;
20
- }
21
- `;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const EntityViewToggle: () => JSX.Element;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EntityViewToggle = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const useExploreState_1 = require("../../../../hooks/useExploreState");
9
- const exploreState_1 = require("../../../../providers/exploreState");
10
- const toggleButtonGroup_1 = require("../../../common/ToggleButtonGroup/toggleButtonGroup");
11
- const EntityViewToggle = () => {
12
- const { exploreDispatch } = (0, useExploreState_1.useExploreState)();
13
- const toggleButtons = [
14
- {
15
- label: "Exact Match",
16
- onToggle: () => onChange(exploreState_1.ENTITY_VIEW.EXACT),
17
- value: exploreState_1.ENTITY_VIEW.EXACT,
18
- },
19
- {
20
- label: "Related Match",
21
- onToggle: () => onChange(exploreState_1.ENTITY_VIEW.RELATED),
22
- value: exploreState_1.ENTITY_VIEW.RELATED,
23
- },
24
- ];
25
- /**
26
- * Callback fired when toggle button value changes.
27
- * @param entityView - Entity list view.
28
- */
29
- const onChange = (entityView) => {
30
- exploreDispatch({
31
- payload: entityView,
32
- type: exploreState_1.ExploreActionKind.ToggleEntityView,
33
- });
34
- };
35
- return react_1.default.createElement(toggleButtonGroup_1.ToggleButtonGroup, { toggleButtons: toggleButtons });
36
- };
37
- exports.EntityViewToggle = EntityViewToggle;
@@ -1,6 +0,0 @@
1
- import { RowData } from "@tanstack/react-table";
2
- import { BaseColumnConfig } from "./entities";
3
- export declare const ACCESSOR_KEYS: {
4
- SELECT: string;
5
- };
6
- export declare const COLUMN_CONFIGS: Record<string, BaseColumnConfig<RowData, unknown>>;
@@ -1,19 +0,0 @@
1
- import { RowSelectionCell } from "../../Table/components/TableCell/components/RowSelectionCell/rowSelectionCell";
2
- export const ACCESSOR_KEYS = {
3
- SELECT: "select",
4
- };
5
- export const COLUMN_CONFIGS = {
6
- SELECT: {
7
- columnPinned: false,
8
- columnVisible: false,
9
- componentConfig: { component: RowSelectionCell },
10
- disableHiding: true,
11
- disableSorting: true,
12
- header: ACCESSOR_KEYS.SELECT,
13
- id: ACCESSOR_KEYS.SELECT,
14
- meta: {
15
- header: "",
16
- },
17
- width: "max-content",
18
- },
19
- };
@@ -1,5 +0,0 @@
1
- import { ColumnMeta } from "@tanstack/react-table";
2
- import { ColumnConfig } from "../../../config/entities";
3
- export interface BaseColumnConfig<T, TValue> extends ColumnConfig<T> {
4
- meta?: ColumnMeta<T, TValue>;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export declare const TableCreator: import("@emotion/styled").StyledComponent<{
2
- theme?: import("@emotion/react").Theme;
3
- as?: React.ElementType;
4
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,4 +0,0 @@
1
- import styled from "@emotion/styled";
2
- export const TableCreator = styled.div `
3
- position: relative; // Required; when the table mounts, the loading element should not transition in and therefore to position the loading element correctly, the parent container must be styled with position relative.
4
- `;
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Alert } from "./alert";
3
- declare const _default: Meta<typeof Alert>;
4
- export default _default;
5
- type Story = StoryObj<typeof Alert>;
6
- export declare const AlertStory: Story;
@@ -1,36 +0,0 @@
1
- import { Alert } from "./alert";
2
- export default {
3
- argTypes: {
4
- children: {
5
- control: "text",
6
- description: "Inner text",
7
- },
8
- color: {
9
- description: "Color of alert",
10
- },
11
- icon: {
12
- control: "text",
13
- description: "Top left icon. If provided will replace severity.",
14
- },
15
- severity: {
16
- description: "Top left predefined icon. Combine with color.",
17
- },
18
- title: {
19
- control: "text",
20
- description: "Highlighted text",
21
- },
22
- variant: {
23
- description: "Type of the alert",
24
- },
25
- },
26
- component: Alert,
27
- title: "Components/Common/Alert",
28
- };
29
- export const AlertStory = {
30
- args: {
31
- children: "Something certainly happened",
32
- color: "warning",
33
- severity: "warning",
34
- title: "Ouch!",
35
- },
36
- };
@@ -1,4 +0,0 @@
1
- export declare const AlertText: import("@emotion/styled").StyledComponent<{
2
- theme?: import("@emotion/react").Theme;
3
- as?: React.ElementType;
4
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,19 +0,0 @@
1
- import styled from "@emotion/styled";
2
- export const AlertText = styled.div `
3
- ul {
4
- padding-left: 24px;
5
- margin: 8px 0;
6
-
7
- li {
8
- margin: 4px 0;
9
-
10
- &:last-child {
11
- margin-bottom: 0;
12
- }
13
- }
14
- }
15
-
16
- *:last-child {
17
- margin-bottom: 0;
18
- }
19
- `;
@@ -1,7 +0,0 @@
1
- import { AlertProps as MAlertProps } from "@mui/material";
2
- import { ReactNode } from "react";
3
- export interface BannerPrimaryProps extends MAlertProps {
4
- children: ReactNode;
5
- className?: string;
6
- }
7
- export declare const BannerPrimary: ({ children, className, ...props }: BannerPrimaryProps) => JSX.Element;
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import { Alert } from "./bannerPrimary.styles";
3
- export const BannerPrimary = ({ children, className, ...props /* Spread props to allow for Mui AlertProps specific prop overrides. */ }) => {
4
- return (React.createElement(Alert, { className: className, color: "primary", elevation: 0, icon: false, variant: "standard", ...props }, children));
5
- };
@@ -1,3 +0,0 @@
1
- export declare const Alert: import("@emotion/styled").StyledComponent<import("@mui/material").AlertProps & {
2
- theme?: import("@emotion/react").Theme;
3
- }, {}, {}>;
@@ -1,19 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { Alert as MAlert } from "@mui/material";
3
- import { primaryMain, white } from "../../../../../styles/common/mixins/colors";
4
- import { textBodySmall400 } from "../../../../../styles/common/mixins/fonts";
5
- export const Alert = styled(MAlert) `
6
- border-radius: 0;
7
- justify-content: center;
8
- padding: 8px;
9
-
10
- &.MuiAlert-standardPrimary {
11
- background-color: ${primaryMain};
12
- color: ${white};
13
- }
14
-
15
- .MuiAlert-message {
16
- ${textBodySmall400};
17
- text-align: center;
18
- }
19
- `;
@@ -1,10 +0,0 @@
1
- import { AlertProps as MAlertProps } from "@mui/material";
2
- import { ElementType, ReactNode } from "react";
3
- export interface CookieBannerProps extends MAlertProps {
4
- Alert?: ElementType;
5
- children: ReactNode;
6
- className?: string;
7
- onDismiss?: () => void;
8
- open: boolean;
9
- }
10
- export declare const DismissibleBanner: ({ Alert, className, children, onDismiss, open, ...props }: CookieBannerProps) => JSX.Element;
@@ -1,16 +0,0 @@
1
- import { Fade, Alert as MAlert, } from "@mui/material";
2
- import React, { useEffect, useState } from "react";
3
- export const DismissibleBanner = ({ Alert = MAlert /* Requires forwardRef to be used as a child of Fade. */, className, children, onDismiss, open, ...props /* Spread props to allow for Mui AlertProps specific prop overrides. */ }) => {
4
- const [isIn, setIsIn] = useState(false);
5
- // Callback fired when the component requests to be closed.
6
- const onClose = () => {
7
- onDismiss?.();
8
- setIsIn(false);
9
- };
10
- // Sets the open state.
11
- useEffect(() => {
12
- setIsIn(open);
13
- }, [open]);
14
- return (React.createElement(Fade, { in: isIn, unmountOnExit: true },
15
- React.createElement(Alert, { className: className, onClose: onClose, ...props }, children)));
16
- };
@@ -1,3 +0,0 @@
1
- export declare const Banner: import("@emotion/styled").StyledComponent<import("../BannerPrimary/bannerPrimary").BannerPrimaryProps & {
2
- theme?: import("@emotion/react").Theme;
3
- }, {}, {}>;
@@ -1,21 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { mediaDesktopUp } from "../../../../../styles/common/mixins/breakpoints";
3
- import { BannerPrimary } from "../BannerPrimary/bannerPrimary";
4
- export const Banner = styled(BannerPrimary) `
5
- gap: 12px;
6
- padding: 8px 12px;
7
-
8
- ${mediaDesktopUp} {
9
- padding: 8px 16px;
10
- }
11
-
12
- .MuiAlert-message {
13
- align-self: center;
14
- flex: 1;
15
- }
16
-
17
- .MuiAlert-action {
18
- margin: -8px;
19
- padding: 0;
20
- }
21
- `;
@@ -1,3 +0,0 @@
1
- import { ButtonProps } from "../../button";
2
- export type LoginButtonProps = Exclude<ButtonProps, "StartIcon">;
3
- export declare const LoginButton: ({ children, ...props }: LoginButtonProps) => JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { LoginButton as Button, LoginButtonText } from "./loginButton.styles";
3
- export const LoginButton = ({ children, ...props }) => {
4
- return (React.createElement(Button, { fullWidth: true, ...props },
5
- React.createElement(LoginButtonText, null, children)));
6
- };
@@ -1,7 +0,0 @@
1
- export declare const LoginButton: import("@emotion/styled").StyledComponent<Omit<import("../../button").ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
2
- theme?: import("@emotion/react").Theme;
3
- }, {}, {}>;
4
- export declare const LoginButtonText: import("@emotion/styled").StyledComponent<{
5
- theme?: import("@emotion/react").Theme;
6
- as?: React.ElementType;
7
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,11 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { ButtonSecondary } from "../ButtonSecondary/buttonSecondary";
3
- export const LoginButton = styled(ButtonSecondary) `
4
- .MuiButton-endIcon {
5
- margin-right: -6px;
6
- }
7
- `;
8
- export const LoginButtonText = styled.span `
9
- flex: 1;
10
- text-align: left;
11
- `;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * Mock "loading" icon button - a placeholder element styled like a primary icon button without the use of a button element.
4
- */
5
- export declare const LoadingIconButton: () => JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { LoadingIcon } from "../../../CustomIcon/components/LoadingIcon/loadingIcon";
3
- import { MockIconButtonPrimary } from "../../iconButton.styles";
4
- /**
5
- * Mock "loading" icon button - a placeholder element styled like a primary icon button without the use of a button element.
6
- */
7
- export const LoadingIconButton = () => {
8
- return (React.createElement(MockIconButtonPrimary, null,
9
- React.createElement(LoadingIcon, { fontSize: "small" })));
10
- };
@@ -1,3 +0,0 @@
1
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, unknown>;
2
- export default _default;
3
- export declare const LoadingIconButtonStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, unknown>;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import { LoadingIconButton } from "./loadingIconButton";
3
- export default {
4
- component: LoadingIconButton,
5
- title: "Components/Common/IconButton/Download",
6
- };
7
- const LoadingIconButtonTemplate = () => React.createElement(LoadingIconButton, null);
8
- export const LoadingIconButtonStory = LoadingIconButtonTemplate.bind({});
9
- LoadingIconButtonStory.args = {};
@@ -1,4 +0,0 @@
1
- import { LoginResponse, LoginStatus } from "./entities";
2
- export declare const LOGIN_STATUS_FAILED: LoginStatus<LoginResponse>;
3
- export declare const LOGIN_STATUS_NOT_STARTED: LoginStatus<LoginResponse>;
4
- export declare const LOGIN_STATUS_NOT_SUPPORTED: LoginStatus<LoginResponse>;
@@ -1,19 +0,0 @@
1
- import { REQUEST_STATUS } from "./entities";
2
- export const LOGIN_STATUS_FAILED = {
3
- isSuccess: false,
4
- isSupported: true,
5
- requestStatus: REQUEST_STATUS.FAILED,
6
- response: undefined,
7
- };
8
- export const LOGIN_STATUS_NOT_STARTED = {
9
- isSuccess: false,
10
- isSupported: true,
11
- requestStatus: REQUEST_STATUS.NOT_STARTED,
12
- response: undefined,
13
- };
14
- export const LOGIN_STATUS_NOT_SUPPORTED = {
15
- isSuccess: false,
16
- isSupported: false,
17
- requestStatus: REQUEST_STATUS.NOT_STARTED,
18
- response: undefined,
19
- };
@@ -1,25 +0,0 @@
1
- import { GoogleResponse } from "../useFetchGoogleProfile";
2
- import { TerraNIHResponse } from "../useFetchTerraNIHProfile";
3
- import { TerraResponse } from "../useFetchTerraProfile";
4
- import { TerraTermsOfServiceResponse } from "../useFetchTerraTermsOfService";
5
- export declare enum AUTHENTICATION_STATUS {
6
- COMPLETED = "COMPLETED",
7
- INCOMPLETE = "INCOMPLETE"
8
- }
9
- export type LoginResponse = GoogleResponse | TerraResponse | TerraNIHResponse | TerraTermsOfServiceResponse;
10
- export interface LoginResponseError {
11
- message: string;
12
- source: string;
13
- statusCode: number;
14
- }
15
- export interface LoginStatus<T> {
16
- isSuccess: boolean;
17
- isSupported: boolean;
18
- requestStatus: REQUEST_STATUS;
19
- response: T | undefined;
20
- }
21
- export declare enum REQUEST_STATUS {
22
- COMPLETED = "COMPLETED",
23
- FAILED = "FAILED",
24
- NOT_STARTED = "NOT_STARTED"
25
- }
@@ -1,11 +0,0 @@
1
- export var AUTHENTICATION_STATUS;
2
- (function (AUTHENTICATION_STATUS) {
3
- AUTHENTICATION_STATUS["COMPLETED"] = "COMPLETED";
4
- AUTHENTICATION_STATUS["INCOMPLETE"] = "INCOMPLETE";
5
- })(AUTHENTICATION_STATUS || (AUTHENTICATION_STATUS = {}));
6
- export var REQUEST_STATUS;
7
- (function (REQUEST_STATUS) {
8
- REQUEST_STATUS["COMPLETED"] = "COMPLETED";
9
- REQUEST_STATUS["FAILED"] = "FAILED";
10
- REQUEST_STATUS["NOT_STARTED"] = "NOT_STARTED";
11
- })(REQUEST_STATUS || (REQUEST_STATUS = {}));
@@ -1,15 +0,0 @@
1
- import { LoginResponse, LoginStatus } from "./entities";
2
- /**
3
- * Returns the options for an authentication request.
4
- * @param token - Token.
5
- * @returns request options.
6
- */
7
- export declare function getAuthenticationRequestOptions(token: string): RequestInit;
8
- /**
9
- * Returns login status.
10
- * An undefined endpoint will return a not supported login status,
11
- * otherwise a not started login status is returned.
12
- * @param endpoint - Endpoint.
13
- * @returns initial login status.
14
- */
15
- export declare function initLoginStatus(endpoint?: string): LoginStatus<LoginResponse>;
@@ -1,25 +0,0 @@
1
- import { LOGIN_STATUS_NOT_STARTED, LOGIN_STATUS_NOT_SUPPORTED, } from "./constants";
2
- /**
3
- * Returns the options for an authentication request.
4
- * @param token - Token.
5
- * @returns request options.
6
- */
7
- export function getAuthenticationRequestOptions(token) {
8
- const headers = new Headers();
9
- headers.append("authorization", "Bearer " + token);
10
- return { headers };
11
- }
12
- /**
13
- * Returns login status.
14
- * An undefined endpoint will return a not supported login status,
15
- * otherwise a not started login status is returned.
16
- * @param endpoint - Endpoint.
17
- * @returns initial login status.
18
- */
19
- export function initLoginStatus(endpoint) {
20
- if (!endpoint) {
21
- // Endpoint not supported.
22
- return LOGIN_STATUS_NOT_SUPPORTED;
23
- }
24
- return LOGIN_STATUS_NOT_STARTED;
25
- }
@@ -1,6 +0,0 @@
1
- import { AuthContextProps } from "../../providers/authentication";
2
- /**
3
- * Returns authentication context.
4
- * @returns authentication context.
5
- */
6
- export declare const useAuthentication: () => AuthContextProps;
@@ -1,9 +0,0 @@
1
- import { useContext } from "react";
2
- import { AuthContext } from "../../providers/authentication";
3
- /**
4
- * Returns authentication context.
5
- * @returns authentication context.
6
- */
7
- export const useAuthentication = () => {
8
- return useContext(AuthContext);
9
- };
@@ -1,6 +0,0 @@
1
- import { AUTHENTICATION_STATUS } from "./common/entities";
2
- /**
3
- * Handles the completion of the authentication process.
4
- * @param authenticationStatus - Authentication status.
5
- */
6
- export declare const useAuthenticationComplete: (authenticationStatus: AUTHENTICATION_STATUS) => void;
@@ -1,55 +0,0 @@
1
- import Router, { useRouter } from "next/router";
2
- import { useEffect, useMemo, useRef } from "react";
3
- import { escapeRegExp } from "../../common/utils";
4
- import { ROUTE_LOGIN } from "../../providers/authentication";
5
- import { INACTIVITY_PARAM } from "../useSessionTimeout";
6
- import { AUTHENTICATION_STATUS } from "./common/entities";
7
- /**
8
- * Handles the completion of the authentication process.
9
- * @param authenticationStatus - Authentication status.
10
- */
11
- export const useAuthenticationComplete = (authenticationStatus) => {
12
- const { asPath } = useRouter();
13
- const routeHistoryRef = useRef(initRouteHistory(asPath));
14
- // Maintain a history of routes that have been visited prior to authentication.
15
- routeHistoryRef.current = useMemo(() => updateRouteHistory(routeHistoryRef.current, asPath), [asPath]);
16
- // Redirect to the previous route after authentication is completed.
17
- useEffect(() => {
18
- if (authenticationStatus === AUTHENTICATION_STATUS.COMPLETED) {
19
- Router.push(routeHistoryRef.current);
20
- }
21
- }, [authenticationStatus]);
22
- };
23
- /**
24
- * Initializes route history with the current path.
25
- * Returns base path if current path is the login route.
26
- * @param path - current browser path.
27
- * @returns path to be used as the initial route history.
28
- */
29
- function initRouteHistory(path) {
30
- return path === ROUTE_LOGIN ? "/" : removeInactivityTimeoutQueryParam(path);
31
- }
32
- /**
33
- * Removes the inactivity timeout query parameter from the path.
34
- * the inactivity timeout parameter is used to indicate that the session has timed out; remove the parameter to
35
- * clear the session timeout banner after the user logs in again.
36
- * @param path - Path.
37
- * @returns path without the inactivity timeout query parameter.
38
- */
39
- function removeInactivityTimeoutQueryParam(path) {
40
- const regex = new RegExp(`\\?${escapeRegExp(INACTIVITY_PARAM)}(?:$|[=&].*)`);
41
- return path.replace(regex, "");
42
- }
43
- /**
44
- * Updates route history with the current path, unless the current path is the LoginView page.
45
- * @param prevPath - route history path.
46
- * @param path - current browser path.
47
- * @returns updated path to be used as the route history.
48
- */
49
- function updateRouteHistory(prevPath, path) {
50
- let currentPath = prevPath;
51
- if (path !== ROUTE_LOGIN) {
52
- currentPath = path;
53
- }
54
- return removeInactivityTimeoutQueryParam(currentPath);
55
- }
@@ -1,20 +0,0 @@
1
- export interface OnboardingStatus {
2
- active: boolean;
3
- completed: boolean;
4
- }
5
- export declare enum ONBOARDING_STEP {
6
- NIH_ACCOUNT = 3,
7
- TERRA_ACCOUNT = 1,
8
- TERRA_TOS = 2
9
- }
10
- interface UseAuthenticationForm {
11
- isComplete: boolean;
12
- isReady: boolean;
13
- onboardingStatusByStep: Map<ONBOARDING_STEP, OnboardingStatus>;
14
- }
15
- /**
16
- * Handles authentication form onboarding.
17
- * @returns onboarding steps and corresponding status.
18
- */
19
- export declare const useAuthenticationForm: () => UseAuthenticationForm;
20
- export {};