@databiosphere/findable-ui 50.4.0 → 50.6.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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "50.4.0"
2
+ ".": "50.6.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [50.6.0](https://github.com/DataBiosphere/findable-ui/compare/v50.5.0...v50.6.0) (2026-04-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * add disabled prop with coming soon chip to exportmethod ([#861](https://github.com/DataBiosphere/findable-ui/issues/861)) ([#862](https://github.com/DataBiosphere/findable-ui/issues/862)) ([3fa93b2](https://github.com/DataBiosphere/findable-ui/commit/3fa93b26afbf4c7c4f86c2527d1d05af495fb343))
9
+
10
+ ## [50.5.0](https://github.com/DataBiosphere/findable-ui/compare/v50.4.0...v50.5.0) (2026-04-02)
11
+
12
+
13
+ ### Features
14
+
15
+ * add optional icon support to exportmethod component ([#857](https://github.com/DataBiosphere/findable-ui/issues/857)) ([#858](https://github.com/DataBiosphere/findable-ui/issues/858)) ([07b8a32](https://github.com/DataBiosphere/findable-ui/commit/07b8a32e4cae25085be9d178a0115fd9529a4c1a))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * allow href clicks in export text to override (and cancel) row clicks ([#855](https://github.com/DataBiosphere/findable-ui/issues/855)) ([#859](https://github.com/DataBiosphere/findable-ui/issues/859)) ([9e721fa](https://github.com/DataBiosphere/findable-ui/commit/9e721fa50492414bd6154b837ccdace4966f5b94))
21
+
3
22
  ## [50.4.0](https://github.com/DataBiosphere/findable-ui/compare/v50.3.0...v50.4.0) (2026-03-30)
4
23
 
5
24
 
@@ -0,0 +1,2 @@
1
+ import { ChipProps } from "@mui/material";
2
+ export declare const CHIP_PROPS: Partial<ChipProps>;
@@ -0,0 +1,6 @@
1
+ import { CHIP_PROPS as MUI_CHIP_PROPS } from "../../../../styles/common/mui/chip";
2
+ export const CHIP_PROPS = {
3
+ color: MUI_CHIP_PROPS.COLOR.DEFAULT,
4
+ label: "Coming Soon",
5
+ variant: MUI_CHIP_PROPS.VARIANT.STATUS,
6
+ };
@@ -1,10 +1,12 @@
1
1
  import { JSX, ReactNode } from "react";
2
2
  import { TrackingProps } from "../../../types";
3
3
  export interface ExportMethodProps extends TrackingProps {
4
+ comingSoon?: boolean;
4
5
  description: ReactNode;
5
6
  footnote?: ReactNode;
7
+ icon?: ReactNode;
6
8
  isAccessible?: boolean;
7
9
  route: string;
8
10
  title: string;
9
11
  }
10
- export declare const ExportMethod: ({ description, footnote, isAccessible, route, title, trackingId, }: ExportMethodProps) => JSX.Element;
12
+ export declare const ExportMethod: ({ comingSoon, description, footnote, icon, isAccessible, route, title, trackingId, }: ExportMethodProps) => JSX.Element;
@@ -1,13 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronRightRounded } from "@mui/icons-material";
3
- import { CardActionArea, CardActions, CardContent, Tooltip, Typography, } from "@mui/material";
3
+ import { CardActionArea, CardActions, CardContent, Chip, Stack, Tooltip, Typography, } from "@mui/material";
4
4
  import Link from "next/link";
5
5
  import { useDownloadStatus } from "../../../../hooks/useDownloadStatus";
6
+ import { STACK_PROPS } from "../../../../styles/common/mui/stack";
6
7
  import { SVG_ICON_PROPS } from "../../../../styles/common/mui/svgIcon";
7
8
  import { TYPOGRAPHY_PROPS } from "../../../../styles/common/mui/typography";
8
9
  import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
10
+ import { CHIP_PROPS } from "./constants";
9
11
  import { StyledCard } from "./exportMethod.styles";
10
- export const ExportMethod = ({ description, footnote, isAccessible = true, route, title, trackingId, }) => {
11
- const { disabled, message } = useDownloadStatus();
12
- return (_jsx(Tooltip, { arrow: true, title: message, children: _jsx(StyledCard, { component: FluidPaper, elevation: 1, children: _jsxs(CardActionArea, { component: Link, disabled: disabled || !isAccessible, href: route, id: trackingId, children: [_jsxs(CardContent, { children: [_jsx(Typography, { component: "h3", variant: TYPOGRAPHY_PROPS.VARIANT.HEADING_XSMALL, children: title }), _jsx(Typography, { component: "div", variant: TYPOGRAPHY_PROPS.VARIANT.BODY_400_2_LINES, children: description }), footnote && (_jsx(Typography, { color: TYPOGRAPHY_PROPS.COLOR.INK_LIGHT, component: "div", variant: TYPOGRAPHY_PROPS.VARIANT.BODY_SMALL_400_2_LINES, children: footnote }))] }), _jsx(CardActions, { children: _jsx(ChevronRightRounded, { color: SVG_ICON_PROPS.COLOR.INK_LIGHT }) })] }) }) }));
12
+ export const ExportMethod = ({ comingSoon, description, footnote, icon, isAccessible = true, route, title, trackingId, }) => {
13
+ const { disabled: downloadStatusDisabled, message } = useDownloadStatus();
14
+ const disabled = comingSoon || downloadStatusDisabled || !isAccessible;
15
+ return (_jsx(Tooltip, { arrow: true, title: message, children: _jsxs(StyledCard, { component: FluidPaper, disabled: disabled, elevation: 1, children: [_jsx(CardActionArea, { "aria-label": title, component: Link, disabled: disabled, href: route, id: trackingId }), _jsxs(CardContent, { children: [_jsxs(Stack, { alignItems: STACK_PROPS.ALIGN_ITEMS.FLEX_START, direction: STACK_PROPS.DIRECTION.ROW, gap: 2, useFlexGap: true, children: [icon, _jsx(Typography, { component: "h3", variant: TYPOGRAPHY_PROPS.VARIANT.HEADING_XSMALL, children: title })] }), _jsx(Typography, { component: "div", variant: TYPOGRAPHY_PROPS.VARIANT.BODY_400_2_LINES, children: description }), footnote && (_jsx(Typography, { color: TYPOGRAPHY_PROPS.COLOR.INK_LIGHT, component: "div", variant: TYPOGRAPHY_PROPS.VARIANT.BODY_SMALL_400_2_LINES, children: footnote }))] }), _jsx(CardActions, { children: comingSoon ? (_jsx(Chip, { ...CHIP_PROPS })) : (_jsx(ChevronRightRounded, { color: SVG_ICON_PROPS.COLOR.INK_LIGHT })) })] }) }));
13
16
  };
@@ -1,2 +1,8 @@
1
- import { Card } from "@mui/material";
2
- export declare const StyledCard: typeof Card;
1
+ import { CardProps } from "@mui/material";
2
+ interface Props extends CardProps {
3
+ disabled?: boolean;
4
+ }
5
+ export declare const StyledCard: import("@emotion/styled").StyledComponent<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style" | "className" | "classes" | "children" | "sx" | "square" | "elevation" | "variant" | "raised"> & {
6
+ theme?: import("@emotion/react").Theme;
7
+ } & Props, {}, {}>;
8
+ export {};
@@ -1,28 +1,37 @@
1
1
  import styled from "@emotion/styled";
2
2
  import { Card } from "@mui/material";
3
+ import { PALETTE } from "../../../../styles/common/constants/palette";
3
4
  import { sectionPadding } from "../../../common/Section/section.styles";
4
- export const StyledCard = styled(Card) `
5
+ export const StyledCard = styled(Card, {
6
+ shouldForwardProp: (prop) => prop !== "disabled",
7
+ }) `
8
+ background-color: ${({ disabled }) => (disabled ? PALETTE.SMOKE_LIGHTEST : PALETTE.COMMON_WHITE)};
9
+ ${sectionPadding};
10
+ display: grid;
11
+ gap: 16px;
12
+ grid-template-columns: 1fr auto;
13
+ position: relative; /* positions card action area */
14
+
5
15
  .MuiCardActionArea-root {
6
- display: grid;
7
- gap: 16px;
8
- grid-template-columns: 1fr auto;
9
- ${sectionPadding};
16
+ inset: 0;
17
+ position: absolute; /* covers entire card */
10
18
  text-decoration: none;
11
-
12
- &.Mui-disabled {
13
- opacity: 0.6;
14
- }
19
+ }
15
20
 
16
21
  .MuiCardContent-root {
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 4px;
17
25
  padding: 0;
18
-
19
- h3 {
20
- margin-bottom: 4px;
21
- }
22
26
  }
23
27
 
24
- .MuiCardActions-root {
25
- padding: 0;
28
+ a {
29
+ position: relative;
30
+ z-index: 1; /* Elevates links above the absolutely positioned CardActionArea overlay. */
26
31
  }
27
32
  }
33
+
34
+ .MuiCardActions-root {
35
+ padding: 0;
36
+ }
28
37
  `;
@@ -1,7 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { ExportMethod } from "../exportMethod";
2
3
  const meta = {
3
4
  argTypes: {
4
- description: { control: "text" },
5
+ description: { control: false },
5
6
  route: { control: "text" },
6
7
  title: { control: "text" },
7
8
  },
@@ -10,8 +11,8 @@ const meta = {
10
11
  export default meta;
11
12
  export const ExportMethodStory = {
12
13
  args: {
13
- description: "Obtain a curl command for downloading the selected data.",
14
- route: "/request-curl-command",
14
+ description: (_jsxs("div", { children: ["Obtain a curl command for downloading the selected data.", " ", _jsx("a", { href: "/learn-more", rel: "noopener noreferrer", target: "_blank", children: "Learn more" })] })),
15
+ route: "/export",
15
16
  title: "Download Study Data and Metadata (Curl Command)",
16
17
  },
17
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "50.4.0",
3
+ "version": "50.6.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
@@ -0,0 +1,8 @@
1
+ import { ChipProps } from "@mui/material";
2
+ import { CHIP_PROPS as MUI_CHIP_PROPS } from "../../../../styles/common/mui/chip";
3
+
4
+ export const CHIP_PROPS: Partial<ChipProps> = {
5
+ color: MUI_CHIP_PROPS.COLOR.DEFAULT,
6
+ label: "Coming Soon",
7
+ variant: MUI_CHIP_PROPS.VARIANT.STATUS,
8
+ };
@@ -1,29 +1,42 @@
1
1
  import styled from "@emotion/styled";
2
- import { Card } from "@mui/material";
2
+ import { Card, CardProps } from "@mui/material";
3
+ import { PALETTE } from "../../../../styles/common/constants/palette";
3
4
  import { sectionPadding } from "../../../common/Section/section.styles";
4
5
 
5
- export const StyledCard = styled(Card)`
6
+ interface Props extends CardProps {
7
+ disabled?: boolean;
8
+ }
9
+
10
+ export const StyledCard = styled(Card, {
11
+ shouldForwardProp: (prop) => prop !== "disabled",
12
+ })<Props>`
13
+ background-color: ${({ disabled }) => (disabled ? PALETTE.SMOKE_LIGHTEST : PALETTE.COMMON_WHITE)};
14
+ ${sectionPadding};
15
+ display: grid;
16
+ gap: 16px;
17
+ grid-template-columns: 1fr auto;
18
+ position: relative; /* positions card action area */
19
+
6
20
  .MuiCardActionArea-root {
7
- display: grid;
8
- gap: 16px;
9
- grid-template-columns: 1fr auto;
10
- ${sectionPadding};
21
+ inset: 0;
22
+ position: absolute; /* covers entire card */
11
23
  text-decoration: none;
12
-
13
- &.Mui-disabled {
14
- opacity: 0.6;
15
- }
24
+ }
16
25
 
17
26
  .MuiCardContent-root {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 4px;
18
30
  padding: 0;
19
-
20
- h3 {
21
- margin-bottom: 4px;
22
- }
23
31
  }
24
32
 
25
- .MuiCardActions-root {
26
- padding: 0;
33
+ a {
34
+ position: relative;
35
+ z-index: 1; /* Elevates links above the absolutely positioned CardActionArea overlay. */
27
36
  }
28
37
  }
29
- ` as typeof Card;
38
+
39
+ .MuiCardActions-root {
40
+ padding: 0;
41
+ }
42
+ `;
@@ -3,71 +3,92 @@ import {
3
3
  CardActionArea,
4
4
  CardActions,
5
5
  CardContent,
6
+ Chip,
7
+ Stack,
6
8
  Tooltip,
7
9
  Typography,
8
10
  } from "@mui/material";
9
11
  import Link from "next/link";
10
12
  import { JSX, ReactNode } from "react";
11
13
  import { useDownloadStatus } from "../../../../hooks/useDownloadStatus";
14
+ import { STACK_PROPS } from "../../../../styles/common/mui/stack";
12
15
  import { SVG_ICON_PROPS } from "../../../../styles/common/mui/svgIcon";
13
16
  import { TYPOGRAPHY_PROPS } from "../../../../styles/common/mui/typography";
14
17
  import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
15
18
  import { TrackingProps } from "../../../types";
19
+ import { CHIP_PROPS } from "./constants";
16
20
  import { StyledCard } from "./exportMethod.styles";
17
21
 
18
22
  export interface ExportMethodProps extends TrackingProps {
23
+ comingSoon?: boolean;
19
24
  description: ReactNode;
20
25
  footnote?: ReactNode;
26
+ icon?: ReactNode;
21
27
  isAccessible?: boolean;
22
28
  route: string;
23
29
  title: string;
24
30
  }
25
31
 
26
32
  export const ExportMethod = ({
33
+ comingSoon,
27
34
  description,
28
35
  footnote,
36
+ icon,
29
37
  isAccessible = true,
30
38
  route,
31
39
  title,
32
40
  trackingId,
33
41
  }: ExportMethodProps): JSX.Element => {
34
- const { disabled, message } = useDownloadStatus();
42
+ const { disabled: downloadStatusDisabled, message } = useDownloadStatus();
43
+ const disabled = comingSoon || downloadStatusDisabled || !isAccessible;
35
44
  return (
36
45
  <Tooltip arrow title={message}>
37
- <StyledCard component={FluidPaper} elevation={1}>
46
+ <StyledCard component={FluidPaper} disabled={disabled} elevation={1}>
38
47
  <CardActionArea
48
+ aria-label={title}
39
49
  component={Link}
40
- disabled={disabled || !isAccessible}
50
+ disabled={disabled}
41
51
  href={route}
42
52
  id={trackingId}
43
- >
44
- <CardContent>
53
+ />
54
+ <CardContent>
55
+ <Stack
56
+ alignItems={STACK_PROPS.ALIGN_ITEMS.FLEX_START}
57
+ direction={STACK_PROPS.DIRECTION.ROW}
58
+ gap={2}
59
+ useFlexGap
60
+ >
61
+ {icon}
45
62
  <Typography
46
63
  component="h3"
47
64
  variant={TYPOGRAPHY_PROPS.VARIANT.HEADING_XSMALL}
48
65
  >
49
66
  {title}
50
67
  </Typography>
68
+ </Stack>
69
+ <Typography
70
+ component="div"
71
+ variant={TYPOGRAPHY_PROPS.VARIANT.BODY_400_2_LINES}
72
+ >
73
+ {description}
74
+ </Typography>
75
+ {footnote && (
51
76
  <Typography
77
+ color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
52
78
  component="div"
53
- variant={TYPOGRAPHY_PROPS.VARIANT.BODY_400_2_LINES}
79
+ variant={TYPOGRAPHY_PROPS.VARIANT.BODY_SMALL_400_2_LINES}
54
80
  >
55
- {description}
81
+ {footnote}
56
82
  </Typography>
57
- {footnote && (
58
- <Typography
59
- color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
60
- component="div"
61
- variant={TYPOGRAPHY_PROPS.VARIANT.BODY_SMALL_400_2_LINES}
62
- >
63
- {footnote}
64
- </Typography>
65
- )}
66
- </CardContent>
67
- <CardActions>
83
+ )}
84
+ </CardContent>
85
+ <CardActions>
86
+ {comingSoon ? (
87
+ <Chip {...CHIP_PROPS} />
88
+ ) : (
68
89
  <ChevronRightRounded color={SVG_ICON_PROPS.COLOR.INK_LIGHT} />
69
- </CardActions>
70
- </CardActionArea>
90
+ )}
91
+ </CardActions>
71
92
  </StyledCard>
72
93
  </Tooltip>
73
94
  );
@@ -3,7 +3,7 @@ import { ExportMethod } from "../exportMethod";
3
3
 
4
4
  const meta: Meta<typeof ExportMethod> = {
5
5
  argTypes: {
6
- description: { control: "text" },
6
+ description: { control: false },
7
7
  route: { control: "text" },
8
8
  title: { control: "text" },
9
9
  },
@@ -16,8 +16,15 @@ type Story = StoryObj<typeof meta>;
16
16
 
17
17
  export const ExportMethodStory: Story = {
18
18
  args: {
19
- description: "Obtain a curl command for downloading the selected data.",
20
- route: "/request-curl-command",
19
+ description: (
20
+ <div>
21
+ Obtain a curl command for downloading the selected data.{" "}
22
+ <a href="/learn-more" rel="noopener noreferrer" target="_blank">
23
+ Learn more
24
+ </a>
25
+ </div>
26
+ ),
27
+ route: "/export",
21
28
  title: "Download Study Data and Metadata (Curl Command)",
22
29
  },
23
30
  };