@databiosphere/findable-ui 38.1.1 → 38.2.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 +12 -0
- package/lib/components/DataDictionary/components/Description/description.d.ts +2 -0
- package/lib/components/DataDictionary/components/Description/description.js +8 -0
- package/lib/components/DataDictionary/components/Description/description.styles.d.ts +10 -0
- package/lib/components/DataDictionary/components/Description/description.styles.js +51 -0
- package/lib/components/DataDictionary/components/Description/types.d.ts +3 -0
- package/lib/components/DataDictionary/components/Description/types.js +1 -0
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +2 -0
- package/lib/components/DataDictionary/dataDictionary.js +3 -1
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.js +1 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.d.ts +1 -0
- package/lib/components/Filter/components/FilterRange/filterRange.styles.js +1 -0
- package/package.json +1 -1
- package/src/components/DataDictionary/components/Description/description.styles.ts +56 -0
- package/src/components/DataDictionary/components/Description/description.tsx +17 -0
- package/src/components/DataDictionary/components/Description/types.ts +3 -0
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +2 -0
- package/src/components/DataDictionary/dataDictionary.tsx +3 -1
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.ts +1 -0
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/types.ts +1 -0
- package/src/components/Filter/components/FilterRange/filterRange.styles.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [38.2.0](https://github.com/DataBiosphere/findable-ui/compare/v38.1.1...v38.2.0) (2025-07-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add 'introduction' section to data dictionary ([#566](https://github.com/DataBiosphere/findable-ui/issues/566)) ([#567](https://github.com/DataBiosphere/findable-ui/issues/567)) ([5aeb758](https://github.com/DataBiosphere/findable-ui/commit/5aeb758792532a78fa4ec71dc0f7b3ad8c80c376))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* align range filter toggle button styles with design ([#563](https://github.com/DataBiosphere/findable-ui/issues/563)) ([#564](https://github.com/DataBiosphere/findable-ui/issues/564)) ([1cc1ffd](https://github.com/DataBiosphere/findable-ui/commit/1cc1ffd88ae3b2f436717b494e425614412cface))
|
|
14
|
+
|
|
3
15
|
## [38.1.1](https://github.com/DataBiosphere/findable-ui/compare/v38.1.0...v38.1.1) (2025-07-09)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyledMarkdownRenderer, StyledRoundedPaper, } from "./description.styles";
|
|
3
|
+
export const Description = ({ description, }) => {
|
|
4
|
+
if (!description)
|
|
5
|
+
return null;
|
|
6
|
+
return (React.createElement(StyledRoundedPaper, { elevation: 0 },
|
|
7
|
+
React.createElement(StyledMarkdownRenderer, { value: description })));
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const StyledRoundedPaper: import("@emotion/styled").StyledComponent<import("../../../types").BaseComponentProps & import("@mui/material").PaperOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
+
}, "style" | "className" | "classes" | "children" | "sx" | "elevation" | "square" | "variant"> & {
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
} & {
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
|
+
}, {}, {}>;
|
|
8
|
+
export declare const StyledMarkdownRenderer: import("@emotion/styled").StyledComponent<import("../../../MarkdownRenderer/types").MarkdownRendererProps & {
|
|
9
|
+
theme?: import("@emotion/react").Theme;
|
|
10
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
3
|
+
import { mediaTabletDown, mediaTabletUp, } from "../../../../styles/common/mixins/breakpoints";
|
|
4
|
+
import { textHeadingSmall } from "../../../../styles/common/mixins/fonts";
|
|
5
|
+
import { RoundedPaper } from "../../../common/Paper/components/RoundedPaper/roundedPaper";
|
|
6
|
+
import { MarkdownRenderer } from "../../../MarkdownRenderer/markdownRenderer";
|
|
7
|
+
export const StyledRoundedPaper = styled(RoundedPaper) `
|
|
8
|
+
padding: 20px;
|
|
9
|
+
|
|
10
|
+
${mediaTabletDown} {
|
|
11
|
+
padding: 20px 16px;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const StyledMarkdownRenderer = styled(MarkdownRenderer) `
|
|
15
|
+
align-self: flex-start;
|
|
16
|
+
|
|
17
|
+
code {
|
|
18
|
+
all: unset;
|
|
19
|
+
font: inherit;
|
|
20
|
+
font-family: Roboto Mono, monospace;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h2,
|
|
24
|
+
h3,
|
|
25
|
+
h4,
|
|
26
|
+
h5,
|
|
27
|
+
h6 {
|
|
28
|
+
margin: 8px 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
h2 {
|
|
32
|
+
${textHeadingSmall};
|
|
33
|
+
font-size: 18px;
|
|
34
|
+
line-height: 26px;
|
|
35
|
+
|
|
36
|
+
${mediaTabletUp} {
|
|
37
|
+
font-size: 18px;
|
|
38
|
+
line-height: 26px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
hr {
|
|
43
|
+
border: none;
|
|
44
|
+
border-bottom: 1px solid ${PALETTE.SMOKE_MAIN};
|
|
45
|
+
margin: 16px 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
p {
|
|
49
|
+
font: inherit;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,8 @@ import { LAYOUT_SPACING } from "../../constants";
|
|
|
4
4
|
const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
5
5
|
const PT = LAYOUT_SPACING.CONTENT_PADDING_TOP; /* top padding */
|
|
6
6
|
export const Layout = styled("div") `
|
|
7
|
+
display: grid;
|
|
8
|
+
gap: 16px;
|
|
7
9
|
grid-column: 2;
|
|
8
10
|
grid-row: 1;
|
|
9
11
|
padding-bottom: ${PB}px;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fade } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useLayoutSpacing } from "../../hooks/UseLayoutSpacing/hook";
|
|
4
|
+
import { Description } from "./components/Description/description";
|
|
4
5
|
import { Entities } from "./components/Entities/entities";
|
|
5
6
|
import { ColumnFilterTags } from "./components/Filters/components/ColumnFilterTags/columnFilterTags";
|
|
6
7
|
import { Filters } from "./components/Filters/filters";
|
|
@@ -17,7 +18,7 @@ import { useDataDictionaryConfig } from "./hooks/UseDataDictionaryConfig/hook";
|
|
|
17
18
|
import { useMeasureFilters } from "./hooks/UseMeasureFilters/hook";
|
|
18
19
|
export const DataDictionary = ({ className, dictionary, EntitiesLayout = DefaultEntitiesLayout, FiltersLayout = DefaultFiltersLayout, Outline = DefaultOutline, OutlineLayout = DefaultOutlineLayout, Title = DefaultTitle, TitleLayout = DefaultTitleLayout, }) => {
|
|
19
20
|
// Get dictionary configuration.
|
|
20
|
-
const { classes, tableOptions, title } = useDataDictionaryConfig(dictionary);
|
|
21
|
+
const { classes, description, tableOptions, title } = useDataDictionaryConfig(dictionary);
|
|
21
22
|
// Layout measurements.
|
|
22
23
|
// Get header and footer dimensions.
|
|
23
24
|
const { spacing } = useLayoutSpacing();
|
|
@@ -40,5 +41,6 @@ export const DataDictionary = ({ className, dictionary, EntitiesLayout = Default
|
|
|
40
41
|
React.createElement(ColumnFilterTags, { table: table })),
|
|
41
42
|
React.createElement(Fade, { in: dimensions.height > 0 },
|
|
42
43
|
React.createElement(EntitiesLayout, { spacing: entitiesSpacing },
|
|
44
|
+
React.createElement(Description, { description: description }),
|
|
43
45
|
React.createElement(Entities, { spacing: entitiesSpacing, table: table }))))));
|
|
44
46
|
};
|
|
@@ -20,6 +20,7 @@ export const useDataDictionaryConfig = (dictionary) => {
|
|
|
20
20
|
// exists above and would have thrown an error if undefined.
|
|
21
21
|
return {
|
|
22
22
|
classes: dataDictionaryConfig.dataDictionary.classes,
|
|
23
|
+
description: dataDictionaryConfig.dataDictionary.description,
|
|
23
24
|
tableOptions: dataDictionaryConfig.tableOptions,
|
|
24
25
|
title: dataDictionaryConfig.dataDictionary.title,
|
|
25
26
|
};
|
|
@@ -2,6 +2,7 @@ import { RowData, TableOptions } from "@tanstack/react-table";
|
|
|
2
2
|
import { Attribute, Class } from "../../../../common/entities";
|
|
3
3
|
export interface UseDataDictionaryConfig<T extends RowData = Attribute> {
|
|
4
4
|
classes: Class<T>[];
|
|
5
|
+
description?: string;
|
|
5
6
|
tableOptions: Omit<TableOptions<T>, "data" | "getCoreRowModel">;
|
|
6
7
|
title: string;
|
|
7
8
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
3
|
+
import {
|
|
4
|
+
mediaTabletDown,
|
|
5
|
+
mediaTabletUp,
|
|
6
|
+
} from "../../../../styles/common/mixins/breakpoints";
|
|
7
|
+
import { textHeadingSmall } from "../../../../styles/common/mixins/fonts";
|
|
8
|
+
import { RoundedPaper } from "../../../common/Paper/components/RoundedPaper/roundedPaper";
|
|
9
|
+
import { MarkdownRenderer } from "../../../MarkdownRenderer/markdownRenderer";
|
|
10
|
+
|
|
11
|
+
export const StyledRoundedPaper = styled(RoundedPaper)`
|
|
12
|
+
padding: 20px;
|
|
13
|
+
|
|
14
|
+
${mediaTabletDown} {
|
|
15
|
+
padding: 20px 16px;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const StyledMarkdownRenderer = styled(MarkdownRenderer)`
|
|
20
|
+
align-self: flex-start;
|
|
21
|
+
|
|
22
|
+
code {
|
|
23
|
+
all: unset;
|
|
24
|
+
font: inherit;
|
|
25
|
+
font-family: Roboto Mono, monospace;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
h2,
|
|
29
|
+
h3,
|
|
30
|
+
h4,
|
|
31
|
+
h5,
|
|
32
|
+
h6 {
|
|
33
|
+
margin: 8px 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h2 {
|
|
37
|
+
${textHeadingSmall};
|
|
38
|
+
font-size: 18px;
|
|
39
|
+
line-height: 26px;
|
|
40
|
+
|
|
41
|
+
${mediaTabletUp} {
|
|
42
|
+
font-size: 18px;
|
|
43
|
+
line-height: 26px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
hr {
|
|
48
|
+
border: none;
|
|
49
|
+
border-bottom: 1px solid ${PALETTE.SMOKE_MAIN};
|
|
50
|
+
margin: 16px 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
p {
|
|
54
|
+
font: inherit;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
StyledMarkdownRenderer,
|
|
4
|
+
StyledRoundedPaper,
|
|
5
|
+
} from "./description.styles";
|
|
6
|
+
import { DescriptionProps } from "./types";
|
|
7
|
+
|
|
8
|
+
export const Description = ({
|
|
9
|
+
description,
|
|
10
|
+
}: DescriptionProps): JSX.Element | null => {
|
|
11
|
+
if (!description) return null;
|
|
12
|
+
return (
|
|
13
|
+
<StyledRoundedPaper elevation={0}>
|
|
14
|
+
<StyledMarkdownRenderer value={description} />
|
|
15
|
+
</StyledRoundedPaper>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -7,6 +7,8 @@ const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
|
7
7
|
const PT = LAYOUT_SPACING.CONTENT_PADDING_TOP; /* top padding */
|
|
8
8
|
|
|
9
9
|
export const Layout = styled("div")<LayoutSpacing>`
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: 16px;
|
|
10
12
|
grid-column: 2;
|
|
11
13
|
grid-row: 1;
|
|
12
14
|
padding-bottom: ${PB}px;
|
|
@@ -3,6 +3,7 @@ import { RowData } from "@tanstack/react-table";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Attribute } from "../../common/entities";
|
|
5
5
|
import { useLayoutSpacing } from "../../hooks/UseLayoutSpacing/hook";
|
|
6
|
+
import { Description } from "./components/Description/description";
|
|
6
7
|
import { Entities } from "./components/Entities/entities";
|
|
7
8
|
import { ColumnFilterTags } from "./components/Filters/components/ColumnFilterTags/columnFilterTags";
|
|
8
9
|
import { Filters } from "./components/Filters/filters";
|
|
@@ -30,7 +31,7 @@ export const DataDictionary = <T extends RowData = Attribute>({
|
|
|
30
31
|
TitleLayout = DefaultTitleLayout,
|
|
31
32
|
}: DataDictionaryProps): JSX.Element => {
|
|
32
33
|
// Get dictionary configuration.
|
|
33
|
-
const { classes, tableOptions, title } =
|
|
34
|
+
const { classes, description, tableOptions, title } =
|
|
34
35
|
useDataDictionaryConfig<T>(dictionary);
|
|
35
36
|
|
|
36
37
|
// Layout measurements.
|
|
@@ -64,6 +65,7 @@ export const DataDictionary = <T extends RowData = Attribute>({
|
|
|
64
65
|
<Fade in={dimensions.height > 0}>
|
|
65
66
|
{/* Fade in entities when filters are measured. */}
|
|
66
67
|
<EntitiesLayout spacing={entitiesSpacing}>
|
|
68
|
+
<Description description={description} />
|
|
67
69
|
<Entities spacing={entitiesSpacing} table={table} />
|
|
68
70
|
</EntitiesLayout>
|
|
69
71
|
</Fade>
|
|
@@ -31,6 +31,7 @@ export const useDataDictionaryConfig = <T extends RowData = Attribute>(
|
|
|
31
31
|
// exists above and would have thrown an error if undefined.
|
|
32
32
|
return {
|
|
33
33
|
classes: dataDictionaryConfig!.dataDictionary.classes,
|
|
34
|
+
description: dataDictionaryConfig!.dataDictionary.description,
|
|
34
35
|
tableOptions: dataDictionaryConfig!.tableOptions,
|
|
35
36
|
title: dataDictionaryConfig!.dataDictionary.title,
|
|
36
37
|
};
|
|
@@ -3,6 +3,7 @@ import { Attribute, Class } from "../../../../common/entities";
|
|
|
3
3
|
|
|
4
4
|
export interface UseDataDictionaryConfig<T extends RowData = Attribute> {
|
|
5
5
|
classes: Class<T>[];
|
|
6
|
+
description?: string;
|
|
6
7
|
tableOptions: Omit<TableOptions<T>, "data" | "getCoreRowModel">;
|
|
7
8
|
title: string;
|
|
8
9
|
}
|