@databiosphere/findable-ui 50.3.0 → 50.5.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/CHANGELOG.md +20 -0
- package/lib/components/Export/components/ExportMethod/exportMethod.d.ts +2 -2
- package/lib/components/Export/components/ExportMethod/exportMethod.js +8 -7
- package/lib/components/Export/components/ExportMethod/exportMethod.styles.d.ts +2 -3
- package/lib/components/Export/components/ExportMethod/exportMethod.styles.js +37 -3
- package/lib/components/Export/components/ExportMethod/stories/exportMethod.stories.d.ts +6 -0
- package/lib/components/Export/components/ExportMethod/stories/exportMethod.stories.js +18 -0
- package/package.json +1 -1
- package/src/components/Export/components/ExportMethod/exportMethod.styles.ts +38 -4
- package/src/components/Export/components/ExportMethod/exportMethod.tsx +56 -40
- package/src/components/Export/components/ExportMethod/stories/exportMethod.stories.tsx +30 -0
- package/lib/components/Export/components/ExportMethod/exportMethod.stories.d.ts +0 -22
- package/lib/components/Export/components/ExportMethod/exportMethod.stories.js +0 -20
- package/src/components/Export/components/ExportMethod/exportMethod.stories.tsx +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [50.5.0](https://github.com/DataBiosphere/findable-ui/compare/v50.4.0...v50.5.0) (2026-04-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 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))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 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))
|
|
14
|
+
|
|
15
|
+
## [50.4.0](https://github.com/DataBiosphere/findable-ui/compare/v50.3.0...v50.4.0) (2026-03-30)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* refactor exportmethod to card-based layout ([#848](https://github.com/DataBiosphere/findable-ui/issues/848)) ([bfc09d3](https://github.com/DataBiosphere/findable-ui/commit/bfc09d35c4e3d5fa55a7ab6f9e50eb88b23f31f0))
|
|
21
|
+
* update export/download ui ([#848](https://github.com/DataBiosphere/findable-ui/issues/848)) ([#853](https://github.com/DataBiosphere/findable-ui/issues/853)) ([bfc09d3](https://github.com/DataBiosphere/findable-ui/commit/bfc09d35c4e3d5fa55a7ab6f9e50eb88b23f31f0))
|
|
22
|
+
|
|
3
23
|
## [50.3.0](https://github.com/DataBiosphere/findable-ui/compare/v50.2.1...v50.3.0) (2026-03-27)
|
|
4
24
|
|
|
5
25
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSX, ReactNode } from "react";
|
|
2
2
|
import { TrackingProps } from "../../../types";
|
|
3
3
|
export interface ExportMethodProps extends TrackingProps {
|
|
4
|
-
buttonLabel: string;
|
|
5
4
|
description: ReactNode;
|
|
6
5
|
footnote?: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
7
|
isAccessible?: boolean;
|
|
8
8
|
route: string;
|
|
9
9
|
title: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const ExportMethod: ({
|
|
11
|
+
export declare const ExportMethod: ({ description, footnote, icon, isAccessible, route, title, trackingId, }: ExportMethodProps) => JSX.Element;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { ChevronRightRounded } from "@mui/icons-material";
|
|
3
|
+
import { CardActionArea, CardActions, CardContent, Stack, Tooltip, Typography, } from "@mui/material";
|
|
3
4
|
import Link from "next/link";
|
|
4
5
|
import { useDownloadStatus } from "../../../../hooks/useDownloadStatus";
|
|
6
|
+
import { STACK_PROPS } from "../../../../styles/common/mui/stack";
|
|
7
|
+
import { SVG_ICON_PROPS } from "../../../../styles/common/mui/svgIcon";
|
|
5
8
|
import { TYPOGRAPHY_PROPS } from "../../../../styles/common/mui/typography";
|
|
6
|
-
import { FluidPaper } from "../../../common/Paper/
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { ExportButton } from "./exportMethod.styles";
|
|
10
|
-
export const ExportMethod = ({ buttonLabel, description, footnote, isAccessible = true, route, title, trackingId, }) => {
|
|
9
|
+
import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
|
|
10
|
+
import { StyledCard } from "./exportMethod.styles";
|
|
11
|
+
export const ExportMethod = ({ description, footnote, icon, isAccessible = true, route, title, trackingId, }) => {
|
|
11
12
|
const { disabled, message } = useDownloadStatus();
|
|
12
|
-
return (_jsx(
|
|
13
|
+
return (_jsx(Tooltip, { arrow: true, title: message, children: _jsxs(StyledCard, { component: FluidPaper, elevation: 1, children: [_jsx(CardActionArea, { "aria-label": title, component: Link, disabled: disabled || !isAccessible, 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: _jsx(ChevronRightRounded, { color: SVG_ICON_PROPS.COLOR.INK_LIGHT }) })] }) }));
|
|
13
14
|
};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}, {}, {}>;
|
|
1
|
+
import { Card } from "@mui/material";
|
|
2
|
+
export declare const StyledCard: typeof Card;
|
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Card } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
4
|
+
import { sectionPadding } from "../../../common/Section/section.styles";
|
|
5
|
+
export const StyledCard = styled(Card) `
|
|
6
|
+
${sectionPadding};
|
|
7
|
+
display: grid;
|
|
8
|
+
gap: 16px;
|
|
9
|
+
grid-template-columns: 1fr auto;
|
|
10
|
+
position: relative; /* positions card action area */
|
|
11
|
+
|
|
12
|
+
.MuiCardActionArea-root {
|
|
13
|
+
inset: 0;
|
|
14
|
+
position: absolute; /* covers entire card */
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
|
|
17
|
+
&.Mui-disabled {
|
|
18
|
+
background-color: ${PALETTE.COMMON_WHITE};
|
|
19
|
+
opacity: 0.6;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.MuiCardContent-root {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 4px;
|
|
27
|
+
padding: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a {
|
|
31
|
+
position: relative;
|
|
32
|
+
z-index: 1; /* Elevates links above the absolutely positioned CardActionArea overlay. */
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.MuiCardActions-root {
|
|
37
|
+
padding: 0;
|
|
38
|
+
}
|
|
5
39
|
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ExportMethod } from "../exportMethod";
|
|
3
|
+
const meta = {
|
|
4
|
+
argTypes: {
|
|
5
|
+
description: { control: false },
|
|
6
|
+
route: { control: "text" },
|
|
7
|
+
title: { control: "text" },
|
|
8
|
+
},
|
|
9
|
+
component: ExportMethod,
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const ExportMethodStory = {
|
|
13
|
+
args: {
|
|
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",
|
|
16
|
+
title: "Download Study Data and Metadata (Curl Command)",
|
|
17
|
+
},
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
2
|
+
import { Card } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
4
|
+
import { sectionPadding } from "../../../common/Section/section.styles";
|
|
3
5
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
export const StyledCard = styled(Card)`
|
|
7
|
+
${sectionPadding};
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: 16px;
|
|
10
|
+
grid-template-columns: 1fr auto;
|
|
11
|
+
position: relative; /* positions card action area */
|
|
12
|
+
|
|
13
|
+
.MuiCardActionArea-root {
|
|
14
|
+
inset: 0;
|
|
15
|
+
position: absolute; /* covers entire card */
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
|
|
18
|
+
&.Mui-disabled {
|
|
19
|
+
background-color: ${PALETTE.COMMON_WHITE};
|
|
20
|
+
opacity: 0.6;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.MuiCardContent-root {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: 4px;
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
a {
|
|
32
|
+
position: relative;
|
|
33
|
+
z-index: 1; /* Elevates links above the absolutely positioned CardActionArea overlay. */
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.MuiCardActions-root {
|
|
38
|
+
padding: 0;
|
|
39
|
+
}
|
|
40
|
+
` as typeof Card;
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChevronRightRounded } from "@mui/icons-material";
|
|
2
|
+
import {
|
|
3
|
+
CardActionArea,
|
|
4
|
+
CardActions,
|
|
5
|
+
CardContent,
|
|
6
|
+
Stack,
|
|
7
|
+
Tooltip,
|
|
8
|
+
Typography,
|
|
9
|
+
} from "@mui/material";
|
|
2
10
|
import Link from "next/link";
|
|
3
11
|
import { JSX, ReactNode } from "react";
|
|
4
12
|
import { useDownloadStatus } from "../../../../hooks/useDownloadStatus";
|
|
13
|
+
import { STACK_PROPS } from "../../../../styles/common/mui/stack";
|
|
14
|
+
import { SVG_ICON_PROPS } from "../../../../styles/common/mui/svgIcon";
|
|
5
15
|
import { TYPOGRAPHY_PROPS } from "../../../../styles/common/mui/typography";
|
|
6
|
-
import { FluidPaper } from "../../../common/Paper/
|
|
7
|
-
import { SectionTitle } from "../../../common/Section/components/SectionTitle/sectionTitle";
|
|
8
|
-
import {
|
|
9
|
-
Section,
|
|
10
|
-
SectionActions,
|
|
11
|
-
SectionContent,
|
|
12
|
-
} from "../../../common/Section/section.styles";
|
|
16
|
+
import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
|
|
13
17
|
import { TrackingProps } from "../../../types";
|
|
14
|
-
import {
|
|
18
|
+
import { StyledCard } from "./exportMethod.styles";
|
|
15
19
|
|
|
16
20
|
export interface ExportMethodProps extends TrackingProps {
|
|
17
|
-
buttonLabel: string;
|
|
18
21
|
description: ReactNode;
|
|
19
22
|
footnote?: ReactNode;
|
|
23
|
+
icon?: ReactNode;
|
|
20
24
|
isAccessible?: boolean;
|
|
21
25
|
route: string;
|
|
22
26
|
title: string;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export const ExportMethod = ({
|
|
26
|
-
buttonLabel,
|
|
27
30
|
description,
|
|
28
31
|
footnote,
|
|
32
|
+
icon,
|
|
29
33
|
isAccessible = true,
|
|
30
34
|
route,
|
|
31
35
|
title,
|
|
@@ -33,38 +37,50 @@ export const ExportMethod = ({
|
|
|
33
37
|
}: ExportMethodProps): JSX.Element => {
|
|
34
38
|
const { disabled, message } = useDownloadStatus();
|
|
35
39
|
return (
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
40
|
+
<Tooltip arrow title={message}>
|
|
41
|
+
<StyledCard component={FluidPaper} elevation={1}>
|
|
42
|
+
<CardActionArea
|
|
43
|
+
aria-label={title}
|
|
44
|
+
component={Link}
|
|
45
|
+
disabled={disabled || !isAccessible}
|
|
46
|
+
href={route}
|
|
47
|
+
id={trackingId}
|
|
48
|
+
/>
|
|
49
|
+
<CardContent>
|
|
50
|
+
<Stack
|
|
51
|
+
alignItems={STACK_PROPS.ALIGN_ITEMS.FLEX_START}
|
|
52
|
+
direction={STACK_PROPS.DIRECTION.ROW}
|
|
53
|
+
gap={2}
|
|
54
|
+
useFlexGap
|
|
55
|
+
>
|
|
56
|
+
{icon}
|
|
57
|
+
<Typography
|
|
58
|
+
component="h3"
|
|
59
|
+
variant={TYPOGRAPHY_PROPS.VARIANT.HEADING_XSMALL}
|
|
60
|
+
>
|
|
61
|
+
{title}
|
|
62
|
+
</Typography>
|
|
63
|
+
</Stack>
|
|
59
64
|
<Typography
|
|
60
|
-
color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
|
|
61
65
|
component="div"
|
|
62
|
-
variant={TYPOGRAPHY_PROPS.VARIANT.
|
|
66
|
+
variant={TYPOGRAPHY_PROPS.VARIANT.BODY_400_2_LINES}
|
|
63
67
|
>
|
|
64
|
-
{
|
|
68
|
+
{description}
|
|
65
69
|
</Typography>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
{footnote && (
|
|
71
|
+
<Typography
|
|
72
|
+
color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
|
|
73
|
+
component="div"
|
|
74
|
+
variant={TYPOGRAPHY_PROPS.VARIANT.BODY_SMALL_400_2_LINES}
|
|
75
|
+
>
|
|
76
|
+
{footnote}
|
|
77
|
+
</Typography>
|
|
78
|
+
)}
|
|
79
|
+
</CardContent>
|
|
80
|
+
<CardActions>
|
|
81
|
+
<ChevronRightRounded color={SVG_ICON_PROPS.COLOR.INK_LIGHT} />
|
|
82
|
+
</CardActions>
|
|
83
|
+
</StyledCard>
|
|
84
|
+
</Tooltip>
|
|
69
85
|
);
|
|
70
86
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { ExportMethod } from "../exportMethod";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ExportMethod> = {
|
|
5
|
+
argTypes: {
|
|
6
|
+
description: { control: false },
|
|
7
|
+
route: { control: "text" },
|
|
8
|
+
title: { control: "text" },
|
|
9
|
+
},
|
|
10
|
+
component: ExportMethod,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const ExportMethodStory: Story = {
|
|
18
|
+
args: {
|
|
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",
|
|
28
|
+
title: "Download Study Data and Metadata (Curl Command)",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
declare const meta: {
|
|
3
|
-
argTypes: {
|
|
4
|
-
buttonLabel: {
|
|
5
|
-
control: "text";
|
|
6
|
-
};
|
|
7
|
-
description: {
|
|
8
|
-
control: "text";
|
|
9
|
-
};
|
|
10
|
-
route: {
|
|
11
|
-
control: "text";
|
|
12
|
-
};
|
|
13
|
-
title: {
|
|
14
|
-
control: "text";
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
component: ({ buttonLabel, description, footnote, isAccessible, route, title, trackingId, }: import("./exportMethod").ExportMethodProps) => import("react").JSX.Element;
|
|
18
|
-
title: string;
|
|
19
|
-
};
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof meta>;
|
|
22
|
-
export declare const ExportMethodStory: Story;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ExportMethod } from "./exportMethod";
|
|
2
|
-
const meta = {
|
|
3
|
-
argTypes: {
|
|
4
|
-
buttonLabel: { control: "text" },
|
|
5
|
-
description: { control: "text" },
|
|
6
|
-
route: { control: "text" },
|
|
7
|
-
title: { control: "text" },
|
|
8
|
-
},
|
|
9
|
-
component: ExportMethod,
|
|
10
|
-
title: "Components/Section/Export/ExportMethod",
|
|
11
|
-
};
|
|
12
|
-
export default meta;
|
|
13
|
-
export const ExportMethodStory = {
|
|
14
|
-
args: {
|
|
15
|
-
buttonLabel: "Request curl Command",
|
|
16
|
-
description: "Obtain a curl command for downloading the selected data.",
|
|
17
|
-
route: "/request-curl-command",
|
|
18
|
-
title: "Download Study Data and Metadata (Curl Command)",
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { ExportMethod } from "./exportMethod";
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
argTypes: {
|
|
6
|
-
buttonLabel: { control: "text" },
|
|
7
|
-
description: { control: "text" },
|
|
8
|
-
route: { control: "text" },
|
|
9
|
-
title: { control: "text" },
|
|
10
|
-
},
|
|
11
|
-
component: ExportMethod,
|
|
12
|
-
title: "Components/Section/Export/ExportMethod",
|
|
13
|
-
} satisfies Meta<typeof ExportMethod>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const ExportMethodStory: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
buttonLabel: "Request curl Command",
|
|
22
|
-
description: "Obtain a curl command for downloading the selected data.",
|
|
23
|
-
route: "/request-curl-command",
|
|
24
|
-
title: "Download Study Data and Metadata (Curl Command)",
|
|
25
|
-
},
|
|
26
|
-
};
|