@databiosphere/findable-ui 30.0.0 → 32.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.
Files changed (127) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +24 -0
  3. package/lib/common/entities.d.ts +8 -26
  4. package/lib/components/DataDictionary/components/Entities/entities.d.ts +3 -1
  5. package/lib/components/DataDictionary/components/Entities/entities.js +1 -1
  6. package/lib/components/DataDictionary/components/Entities/types.d.ts +5 -5
  7. package/lib/components/DataDictionary/components/Entity/entity.d.ts +3 -1
  8. package/lib/components/DataDictionary/components/Entity/entity.js +6 -6
  9. package/lib/components/DataDictionary/components/Entity/types.d.ts +5 -5
  10. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.d.ts +1 -1
  11. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.d.ts +2 -2
  12. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.d.ts +1 -1
  13. package/lib/components/DataDictionary/components/Outline/utils.d.ts +3 -2
  14. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.d.ts +2 -2
  15. package/lib/components/DataDictionary/components/Table/hook.d.ts +3 -3
  16. package/lib/components/DataDictionary/components/Table/hook.js +3 -1
  17. package/lib/components/DataDictionary/components/Table/options/core/constants.d.ts +2 -3
  18. package/lib/components/DataDictionary/components/Table/options/hook.d.ts +2 -2
  19. package/lib/components/DataDictionary/components/Table/options/sorting/constants.d.ts +2 -3
  20. package/lib/components/DataDictionary/components/Table/table.d.ts +2 -1
  21. package/lib/components/DataDictionary/components/Table/table.js +1 -1
  22. package/lib/components/DataDictionary/components/Table/types.d.ts +3 -4
  23. package/lib/components/DataDictionary/dataDictionary.d.ts +3 -1
  24. package/lib/components/DataDictionary/dataDictionary.styles.d.ts +1 -1
  25. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +3 -1
  26. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +5 -5
  27. package/lib/components/Error/error.styles.d.ts +1 -1
  28. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/formStep.styles.d.ts +1 -1
  29. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/terraSetUpForm.styles.d.ts +4 -4
  30. package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.styles.d.ts +1 -1
  31. package/lib/components/Filter/components/FilterRange/filterRange.styles.d.ts +1 -1
  32. package/lib/components/Filter/components/Filters/filters.styles.d.ts +2 -2
  33. package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +1 -1
  34. package/lib/components/Filter/components/VariableSizeList/VariableSizeList.js +1 -1
  35. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +1 -1
  36. package/lib/components/Index/index.styles.d.ts +1 -1
  37. package/lib/components/Layout/components/ContentLayout/contentLayout.styles.d.ts +1 -1
  38. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
  39. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.styles.d.ts +1 -1
  40. package/lib/components/Layout/components/Main/main.styles.d.ts +2 -2
  41. package/lib/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.d.ts +1 -1
  42. package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +1 -1
  43. package/lib/components/MarkdownRenderer/components/Anchor/anchor.d.ts +19 -0
  44. package/lib/components/MarkdownRenderer/components/Anchor/anchor.js +21 -0
  45. package/lib/components/MarkdownRenderer/components/Table/table.d.ts +3 -0
  46. package/lib/components/MarkdownRenderer/components/Table/table.js +5 -0
  47. package/lib/components/MarkdownRenderer/components/Table/table.styles.d.ts +4 -0
  48. package/lib/components/MarkdownRenderer/components/Table/table.styles.js +40 -0
  49. package/lib/components/MarkdownRenderer/constants.d.ts +2 -0
  50. package/lib/components/MarkdownRenderer/constants.js +6 -0
  51. package/lib/components/MarkdownRenderer/markdownRenderer.d.ts +14 -0
  52. package/lib/components/MarkdownRenderer/markdownRenderer.js +56 -0
  53. package/lib/components/MarkdownRenderer/markdownRenderer.styles.d.ts +4 -0
  54. package/lib/components/MarkdownRenderer/markdownRenderer.styles.js +13 -0
  55. package/lib/components/MarkdownRenderer/types.d.ts +7 -0
  56. package/lib/components/MarkdownRenderer/types.js +1 -0
  57. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +1 -1
  58. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +1 -1
  59. package/lib/components/Support/components/ViewSupport/viewSupport.styles.d.ts +1 -1
  60. package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.d.ts +2 -1
  61. package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.js +2 -2
  62. package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.d.ts +1 -1
  63. package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.js +2 -2
  64. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.d.ts +4 -0
  65. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.js +13 -0
  66. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.d.ts +3 -0
  67. package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.js +30 -0
  68. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/args.d.ts +4 -0
  69. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/args.js +10 -0
  70. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/constants.d.ts +5 -0
  71. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/constants.js +9 -0
  72. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.d.ts +7 -0
  73. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.js +25 -0
  74. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.d.ts +3 -0
  75. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.js +1 -0
  76. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.d.ts +3 -0
  77. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.js +1 -0
  78. package/lib/components/common/AnchorLink/anchorLink.styles.d.ts +7 -7
  79. package/lib/components/common/Card/components/CardSecondaryTitle/cardSecondaryTitle.styles.d.ts +1 -1
  80. package/lib/components/common/Code/code.styles.d.ts +1 -1
  81. package/lib/components/common/Dot/dot.styles.d.ts +1 -1
  82. package/lib/components/common/EllipsisContent/ellipsisContent.styles.d.ts +1 -1
  83. package/lib/components/common/Progress/components/CircularProgress/circularProgress.d.ts +1 -1
  84. package/lib/components/common/Progress/components/CircularProgress/circularProgress.js +1 -1
  85. package/lib/components/common/Stack/stack.d.ts +1 -1
  86. package/lib/components/common/Stack/stack.js +1 -1
  87. package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.d.ts +1 -1
  88. package/lib/styles/common/mui/typography.js +1 -0
  89. package/package.json +8 -1
  90. package/src/common/entities.ts +8 -31
  91. package/src/components/DataDictionary/components/Entities/entities.tsx +7 -5
  92. package/src/components/DataDictionary/components/Entities/types.ts +5 -9
  93. package/src/components/DataDictionary/components/Entity/entity.tsx +9 -7
  94. package/src/components/DataDictionary/components/Entity/types.ts +5 -9
  95. package/src/components/DataDictionary/components/Outline/utils.ts +5 -2
  96. package/src/components/DataDictionary/components/Table/hook.ts +16 -8
  97. package/src/components/DataDictionary/components/Table/options/core/constants.ts +2 -3
  98. package/src/components/DataDictionary/components/Table/options/hook.ts +3 -3
  99. package/src/components/DataDictionary/components/Table/options/sorting/constants.ts +2 -6
  100. package/src/components/DataDictionary/components/Table/table.tsx +4 -1
  101. package/src/components/DataDictionary/components/Table/types.ts +3 -4
  102. package/src/components/DataDictionary/dataDictionary.tsx +4 -2
  103. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +9 -2
  104. package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +5 -9
  105. package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +1 -1
  106. package/src/components/MarkdownRenderer/components/Anchor/anchor.tsx +34 -0
  107. package/src/components/MarkdownRenderer/components/Table/table.styles.ts +41 -0
  108. package/src/components/MarkdownRenderer/components/Table/table.tsx +13 -0
  109. package/src/components/MarkdownRenderer/constants.ts +8 -0
  110. package/src/components/MarkdownRenderer/markdownRenderer.styles.ts +16 -0
  111. package/src/components/MarkdownRenderer/markdownRenderer.tsx +74 -0
  112. package/src/components/MarkdownRenderer/types.ts +10 -0
  113. package/src/components/Table/components/TableCell/components/ChipCell/chipCell.tsx +4 -2
  114. package/src/components/Table/components/TableCell/components/LinkCell/linkCell.tsx +1 -1
  115. package/src/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.ts +31 -0
  116. package/src/components/Table/components/TableCell/components/MarkdownCell/markdownCell.tsx +29 -0
  117. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/args.ts +17 -0
  118. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/constants.ts +11 -0
  119. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.tsx +37 -0
  120. package/src/components/Table/components/TableCell/components/MarkdownCell/stories/types.ts +4 -0
  121. package/src/components/Table/components/TableCell/components/MarkdownCell/types.ts +3 -0
  122. package/src/components/common/Progress/components/CircularProgress/circularProgress.tsx +1 -1
  123. package/src/components/common/Stack/stack.tsx +2 -2
  124. package/src/styles/common/mui/typography.ts +1 -0
  125. package/tests/markdownCell.test.tsx +53 -0
  126. package/tests/useRequestManifest.test.ts +1 -1
  127. package/types/data-explorer-ui.d.ts +2 -0
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { StyledTable } from "./table.styles";
3
+ export const Table = (props) => {
4
+ return (React.createElement(StyledTable, { className: props.className }, props.children));
5
+ };
@@ -0,0 +1,4 @@
1
+ export declare const StyledTable: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
@@ -0,0 +1,40 @@
1
+ import styled from "@emotion/styled";
2
+ import { PALETTE } from "../../../../styles/common/constants/palette";
3
+ import { textBody500 } from "../../../../styles/common/mixins/fonts";
4
+ export const StyledTable = styled("table") `
5
+ border-collapse: collapse;
6
+ margin: 16px 0;
7
+ table-layout: fixed;
8
+ width: 100%;
9
+
10
+ thead {
11
+ all: unset;
12
+ display: table-header-group;
13
+ }
14
+
15
+ tbody {
16
+ all: unset;
17
+ display: table-row-group;
18
+ }
19
+
20
+ tr {
21
+ all: unset;
22
+ display: table-row;
23
+ }
24
+
25
+ td,
26
+ th {
27
+ display: table-cell;
28
+ padding: 2px 4px;
29
+ }
30
+
31
+ th {
32
+ ${textBody500}
33
+ border-bottom: 1px solid ${PALETTE.SMOKE_MAIN};
34
+ }
35
+
36
+ td {
37
+ font: inherit;
38
+ overflow-wrap: break-word;
39
+ }
40
+ `;
@@ -0,0 +1,2 @@
1
+ import { MarkdownRendererComponents } from "./types";
2
+ export declare const COMPONENTS: MarkdownRendererComponents;
@@ -0,0 +1,6 @@
1
+ import { Anchor } from "./components/Anchor/anchor";
2
+ import { Table } from "./components/Table/table";
3
+ export const COMPONENTS = {
4
+ a: Anchor,
5
+ table: Table,
6
+ };
@@ -0,0 +1,14 @@
1
+ import { MarkdownRendererProps } from "./types";
2
+ /**
3
+ * Markdown Rendering - Pipeline Version Constraints
4
+ *
5
+ * next-mdx-remote and @next/mdx currently embed MDX v3. MDX v3 is compiled
6
+ * for the "Unified 10" tool-chain and therefore only functions with unified
7
+ * 10.x, remark-parse 10.x, remark-rehype 10.x and, critically, remark-gfm 3.x.
8
+ *
9
+ * Because remark-gfm 3.x is required, migrating to Unified 11 is not yet possible.
10
+ *
11
+ * rehype plug-ins are chosen from versions that still target Unified 10:
12
+ * rehype-raw 7.x, rehype-sanitize 5.x and rehype-react 7.x.
13
+ */
14
+ export declare const MarkdownRenderer: ({ className, components: componentOptions, value, }: MarkdownRendererProps) => JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { Typography } from "@mui/material";
2
+ import React, { Fragment, createElement, useEffect, useState } from "react";
3
+ import rehypeRaw from "rehype-raw";
4
+ import rehypeReact from "rehype-react";
5
+ import rehypeSanitize from "rehype-sanitize";
6
+ import remarkGfm from "remark-gfm";
7
+ import remarkParse from "remark-parse";
8
+ import remarkRehype from "remark-rehype";
9
+ import { unified } from "unified";
10
+ import { TYPOGRAPHY_PROPS } from "../../styles/common/mui/typography";
11
+ import { COMPONENTS } from "./constants";
12
+ import { StyledContainer } from "./markdownRenderer.styles";
13
+ /**
14
+ * Markdown Rendering - Pipeline Version Constraints
15
+ *
16
+ * next-mdx-remote and @next/mdx currently embed MDX v3. MDX v3 is compiled
17
+ * for the "Unified 10" tool-chain and therefore only functions with unified
18
+ * 10.x, remark-parse 10.x, remark-rehype 10.x and, critically, remark-gfm 3.x.
19
+ *
20
+ * Because remark-gfm 3.x is required, migrating to Unified 11 is not yet possible.
21
+ *
22
+ * rehype plug-ins are chosen from versions that still target Unified 10:
23
+ * rehype-raw 7.x, rehype-sanitize 5.x and rehype-react 7.x.
24
+ */
25
+ export const MarkdownRenderer = ({ className, components: componentOptions = COMPONENTS, value, }) => {
26
+ const [element, setElement] = useState(null);
27
+ const [error, setError] = useState(null);
28
+ const [components] = useState(componentOptions);
29
+ useEffect(() => {
30
+ let cancelled = false;
31
+ setError(null);
32
+ const processor = unified()
33
+ .use(remarkParse)
34
+ .use(remarkGfm)
35
+ .use(remarkRehype, { allowDangerousHtml: true })
36
+ .use(rehypeRaw)
37
+ .use(rehypeSanitize)
38
+ .use(rehypeReact, { Fragment, components, createElement });
39
+ processor
40
+ .process(value)
41
+ .then(({ result }) => {
42
+ if (!cancelled)
43
+ setElement(result);
44
+ })
45
+ .catch((err) => {
46
+ if (!cancelled)
47
+ setError(err.message);
48
+ });
49
+ return () => {
50
+ cancelled = true;
51
+ };
52
+ }, [components, value]);
53
+ if (error)
54
+ return (React.createElement(Typography, { color: TYPOGRAPHY_PROPS.COLOR.ERROR, variant: TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_SMALL_400 }, error));
55
+ return React.createElement(StyledContainer, { className: className }, element);
56
+ };
@@ -0,0 +1,4 @@
1
+ export declare const StyledContainer: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,13 @@
1
+ import styled from "@emotion/styled";
2
+ // See https://github.com/emotion-js/emotion/issues/1105.
3
+ // See https://github.com/emotion-js/emotion/releases/tag/%40emotion%2Fcache%4011.10.2.
4
+ const ignoreSsrWarning = "/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
5
+ export const StyledContainer = styled("div") `
6
+ > *:first-child:not(style)${ignoreSsrWarning} {
7
+ margin-top: 0;
8
+ }
9
+
10
+ > *:last-child:not(style)${ignoreSsrWarning} {
11
+ margin-bottom: 0;
12
+ }
13
+ `;
@@ -0,0 +1,7 @@
1
+ import { ComponentType } from "react";
2
+ import { BaseComponentProps } from "../types";
3
+ export type MarkdownRendererComponents = Record<string, ComponentType<any>>;
4
+ export interface MarkdownRendererProps extends BaseComponentProps {
5
+ components?: MarkdownRendererComponents;
6
+ value: string;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  export declare const StyledSvgIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
2
2
  ref?: ((instance: SVGSVGElement | 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<SVGSVGElement> | null | undefined;
3
- }, "fontSize" | "style" | "className" | "classes" | "color" | "children" | "shapeRendering" | "sx" | "viewBox" | "htmlColor" | "inheritViewBox" | "titleAccess"> & {
3
+ }, "style" | "fontSize" | "className" | "classes" | "color" | "children" | "shapeRendering" | "sx" | "viewBox" | "htmlColor" | "inheritViewBox" | "titleAccess"> & {
4
4
  theme?: import("@emotion/react").Theme;
5
5
  }, {}, {}>;
@@ -1,5 +1,5 @@
1
1
  export declare const StyledTypography: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
2
2
  ref?: ((instance: HTMLSpanElement | 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<HTMLSpanElement> | null | undefined;
3
- }, "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "p" | "style" | "className" | "classes" | "color" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontStyle" | "textAlign" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
3
+ }, "p" | "style" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "className" | "classes" | "color" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontStyle" | "textAlign" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
4
4
  theme?: import("@emotion/react").Theme;
5
5
  }, {}, {}>;
@@ -1,4 +1,4 @@
1
1
  export declare const Fab: import("@emotion/styled").StyledComponent<{
2
2
  theme?: import("@emotion/react").Theme;
3
- as?: import("react").ElementType;
3
+ as?: React.ElementType;
4
4
  }, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
@@ -1,3 +1,4 @@
1
1
  import { ChipProps } from "@mui/material";
2
2
  import { CellContext, RowData } from "@tanstack/react-table";
3
- export declare const ChipCell: <T extends RowData, TValue extends ChipProps = ChipProps>({ getValue, }: CellContext<T, TValue>) => JSX.Element | null;
3
+ import { BaseComponentProps } from "../../../../../types";
4
+ export declare const ChipCell: <T extends RowData, TValue extends ChipProps = ChipProps>({ className, getValue, }: BaseComponentProps & CellContext<T, TValue>) => JSX.Element | null;
@@ -1,8 +1,8 @@
1
1
  import { Chip } from "@mui/material";
2
2
  import React from "react";
3
- export const ChipCell = ({ getValue, }) => {
3
+ export const ChipCell = ({ className, getValue, }) => {
4
4
  const props = getValue();
5
5
  if (!props)
6
6
  return null;
7
- return React.createElement(Chip, { ...props });
7
+ return React.createElement(Chip, { className: className, ...props });
8
8
  };
@@ -1,4 +1,4 @@
1
1
  import { LinkProps } from "@mui/material";
2
2
  import { CellContext, RowData } from "@tanstack/react-table";
3
3
  import { BaseComponentProps } from "components/types";
4
- export declare const LinkCell: <T extends RowData, TValue extends LinkProps = LinkProps>({ getValue, }: BaseComponentProps & CellContext<T, TValue>) => JSX.Element | null;
4
+ export declare const LinkCell: <T extends RowData, TValue extends LinkProps = LinkProps>({ className, getValue, }: BaseComponentProps & CellContext<T, TValue>) => JSX.Element | null;
@@ -4,11 +4,11 @@ import { isValidUrl } from "../../../../../../common/utils";
4
4
  import { TYPOGRAPHY_PROPS } from "../../../../../../styles/common/mui/typography";
5
5
  import { isClientSideNavigation } from "../../../../../Links/common/utils";
6
6
  import { getComponent, getRelAttribute, getTargetAttribute } from "./utils";
7
- export const LinkCell = ({ getValue, }) => {
7
+ export const LinkCell = ({ className, getValue, }) => {
8
8
  const props = getValue();
9
9
  if (!props)
10
10
  return null;
11
- const { children, className, color, href = "", rel, target, underline, ...linkProps } = props;
11
+ const { children, color, href = "", rel, target, underline, ...linkProps } = props;
12
12
  // Determine if the href should use client-side navigation.
13
13
  const isClientSide = isClientSideNavigation(href);
14
14
  // Determine if the href is valid.
@@ -0,0 +1,4 @@
1
+ import { CellContext, RowData } from "@tanstack/react-table";
2
+ import { BaseComponentProps } from "components/types";
3
+ import { MarkdownCellProps } from "./types";
4
+ export declare const MarkdownCell: <T extends RowData, TValue extends MarkdownCellProps = MarkdownCellProps>({ className, column, getValue, }: BaseComponentProps & CellContext<T, TValue>) => JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { COMPONENTS } from "../../../../../MarkdownRenderer/constants";
3
+ import { StyledMarkdownRenderer } from "./markdownCell.styles";
4
+ export const MarkdownCell = ({ className, column, getValue, }) => {
5
+ const props = getValue();
6
+ if (!props)
7
+ return null;
8
+ const { values } = props;
9
+ const columnDef = column?.columnDef;
10
+ const columnMeta = columnDef?.meta;
11
+ const components = columnMeta?.components;
12
+ return (React.createElement(StyledMarkdownRenderer, { className: className, components: { ...COMPONENTS, ...components }, value: values }));
13
+ };
@@ -0,0 +1,3 @@
1
+ export declare const StyledMarkdownRenderer: import("@emotion/styled").StyledComponent<import("../../../../../MarkdownRenderer/types").MarkdownRendererProps & {
2
+ theme?: import("@emotion/react").Theme;
3
+ }, {}, {}>;
@@ -0,0 +1,30 @@
1
+ import styled from "@emotion/styled";
2
+ import { PALETTE } from "../../../../../../styles/common/constants/palette";
3
+ import { MarkdownRenderer } from "../../../../../MarkdownRenderer/markdownRenderer";
4
+ export const StyledMarkdownRenderer = styled(MarkdownRenderer) `
5
+ align-self: flex-start;
6
+
7
+ code {
8
+ all: unset;
9
+ font: inherit;
10
+ font-family: Roboto Mono, monospace;
11
+ }
12
+
13
+ h2,
14
+ h3,
15
+ h4,
16
+ h5,
17
+ h6 {
18
+ margin: 8px 0;
19
+ }
20
+
21
+ hr {
22
+ border: none;
23
+ border-bottom: 1px solid ${PALETTE.SMOKE_MAIN};
24
+ margin: 16px 0;
25
+ }
26
+
27
+ p {
28
+ font: inherit;
29
+ }
30
+ `;
@@ -0,0 +1,4 @@
1
+ import { ComponentProps } from "react";
2
+ import { MarkdownCell } from "../markdownCell";
3
+ export declare const DEFAULT_ARGS: Partial<ComponentProps<typeof MarkdownCell>>;
4
+ export declare const WITH_HTML_ARGS: Partial<ComponentProps<typeof MarkdownCell>>;
@@ -0,0 +1,10 @@
1
+ export const DEFAULT_ARGS = {
2
+ getValue: (() => ({
3
+ values: '| Key | Annotator | Value |\n| --- | --- | --- |\n| `tissue_ontology_term_id` | Curator | categorical with `str` categories. This **MUST** be the UBERON or CL term that best describes the tissue the cell was derived from, depending on the sample type. |\n\n**Mapping guidance**\n\n| For | Use |\n| --- | --- |\n| Tissue | STRONGLY RECOMMENDED to be an UBERON term&nbsp;<br />(e.g. [`UBERON:0008930`](http://purl.obolibrary.org/obo/UBERON_0008930) for a *somatosensory cortex* tissue sample) |\n| Cell culture | MUST be a CL term appended with \\" (cell culture)\\"&nbsp;<br />(e.g. [`CL:0000057`](http://purl.obolibrary.org/obo/CL_0000057) **(cell culture)** for the *WTC-11* cell line) |\n| Organoid | MUST be an UBERON term appended with \\" (organoid)\\"&nbsp;<br />(e.g. [`UBERON:0000955`](http://purl.obolibrary.org/obo/UBERON_0000955) **(organoid)** for a *brain organoid*) |\n| Enriched / sorted / isolated cells from a tissue | MUST be an UBERON or CL term and **SHOULD NOT** use terms that do not capture the tissue of origin.<br /><br />• *CD3+ kidney cells* → [`UBERON:0002113`](https://www.ebi.ac.uk/ols/ontologies/uberon/terms?iri=http://purl.obolibrary.org/obo/UBERON_0002113) (*kidney*) instead of [`CL:000084`](https://www.ebi.ac.uk/ols/ontologies/cl/terms?iri=http://purl.obolibrary.org/obo/CL_0000084) (*T cell*).<br />• *EPCAM+ cervical cells* → [`CL:0000066`](https://www.ebi.ac.uk/ols/ontologies/cl/terms?iri=http://purl.obolibrary.org/obo/CL_0000066) (*epithelial cell* of the cervix). |\n\n---\n\nWhen a dataset is uploaded, the **cellxgene Data Portal** MUST automatically add the matching human-readable name for the corresponding ontology term to the `obs` dataframe. Curators **MUST NOT** annotate the following columns.\n\n### `assay`\n\n| Key | Annotator | Value |\n| --- | --- | --- |\n| `assay` | Data Portal | categorical with `str` categories. This **MUST** be the human-readable name assigned to the value of `assay_ontology_term_id`. |',
4
+ })),
5
+ };
6
+ export const WITH_HTML_ARGS = {
7
+ getValue: (() => ({
8
+ values: "Hello <br />World <a href='https://www.example.com'>example link</a>",
9
+ })),
10
+ };
@@ -0,0 +1,5 @@
1
+ import { Anchor } from "../../../../../../MarkdownRenderer/components/Anchor/anchor";
2
+ /**
3
+ * Styled anchor component for testing purposes.
4
+ */
5
+ export declare const STYLED_ANCHOR: typeof Anchor;
@@ -0,0 +1,9 @@
1
+ import styled from "@emotion/styled";
2
+ import { Anchor } from "../../../../../../MarkdownRenderer/components/Anchor/anchor";
3
+ /**
4
+ * Styled anchor component for testing purposes.
5
+ */
6
+ export const STYLED_ANCHOR = styled(Anchor) `
7
+ background-color: green;
8
+ color: white;
9
+ `;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { MarkdownCell } from "../markdownCell";
3
+ declare const meta: Meta<typeof MarkdownCell>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const WithHtml: Story;
@@ -0,0 +1,25 @@
1
+ import { Box } from "@mui/material";
2
+ import React from "react";
3
+ import { PALETTE } from "../../../../../../../styles/common/constants/palette";
4
+ import { MarkdownCell } from "../markdownCell";
5
+ import { DEFAULT_ARGS, WITH_HTML_ARGS } from "./args";
6
+ const meta = {
7
+ component: MarkdownCell,
8
+ decorators: [
9
+ (Story) => (React.createElement(Box, { sx: {
10
+ backgroundColor: PALETTE.COMMON_WHITE,
11
+ fontSize: "14px",
12
+ lineHeight: "20px",
13
+ padding: 3,
14
+ width: 480,
15
+ } },
16
+ React.createElement(Story, null))),
17
+ ],
18
+ };
19
+ export default meta;
20
+ export const Default = {
21
+ args: DEFAULT_ARGS,
22
+ };
23
+ export const WithHtml = {
24
+ args: WITH_HTML_ARGS,
25
+ };
@@ -0,0 +1,3 @@
1
+ import { CellContext, RowData } from "@tanstack/react-table";
2
+ import { MarkdownCellProps } from "../types";
3
+ export type GetValue = CellContext<RowData, MarkdownCellProps>["getValue"];
@@ -0,0 +1,3 @@
1
+ export type MarkdownCellProps = {
2
+ values: string;
3
+ };
@@ -8,9 +8,9 @@ export declare const AnchorLink: import("@emotion/styled").StyledComponent<Omit<
8
8
  prefetch?: boolean | null;
9
9
  locale?: string | false;
10
10
  legacyBehavior?: boolean;
11
- onMouseEnter?: import("react").MouseEventHandler<HTMLAnchorElement>;
12
- onTouchStart?: import("react").TouchEventHandler<HTMLAnchorElement>;
13
- onClick?: import("react").MouseEventHandler<HTMLAnchorElement>;
11
+ onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>;
12
+ onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>;
13
+ onClick?: React.MouseEventHandler<HTMLAnchorElement>;
14
14
  }> & {
15
15
  href: string | import("url").UrlObject;
16
16
  as?: string | import("url").UrlObject;
@@ -21,11 +21,11 @@ export declare const AnchorLink: import("@emotion/styled").StyledComponent<Omit<
21
21
  prefetch?: boolean | null;
22
22
  locale?: string | false;
23
23
  legacyBehavior?: boolean;
24
- onMouseEnter?: import("react").MouseEventHandler<HTMLAnchorElement>;
25
- onTouchStart?: import("react").TouchEventHandler<HTMLAnchorElement>;
26
- onClick?: import("react").MouseEventHandler<HTMLAnchorElement>;
24
+ onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>;
25
+ onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>;
26
+ onClick?: React.MouseEventHandler<HTMLAnchorElement>;
27
27
  } & {
28
- children?: import("react").ReactNode;
28
+ children?: React.ReactNode;
29
29
  } & import("react").RefAttributes<HTMLAnchorElement> & {
30
30
  theme?: import("@emotion/react").Theme;
31
31
  }, {}, {}>;
@@ -1,5 +1,5 @@
1
1
  export declare const CardSecondaryTitle: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
2
2
  ref?: ((instance: HTMLSpanElement | 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<HTMLSpanElement> | null | undefined;
3
- }, "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "p" | "style" | "className" | "classes" | "color" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontStyle" | "textAlign" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
3
+ }, "p" | "style" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "className" | "classes" | "color" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontStyle" | "textAlign" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
4
4
  theme?: import("@emotion/react").Theme;
5
5
  }, {}, {}>;
@@ -3,6 +3,6 @@ interface Props {
3
3
  }
4
4
  export declare const CodeBlock: import("@emotion/styled").StyledComponent<{
5
5
  theme?: import("@emotion/react").Theme;
6
- as?: import("react").ElementType;
6
+ as?: React.ElementType;
7
7
  } & Props, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, {}>;
8
8
  export {};
@@ -1,4 +1,4 @@
1
1
  export declare const DotSeparator: import("@emotion/styled").StyledComponent<{
2
2
  theme?: import("@emotion/react").Theme;
3
- as?: import("react").ElementType;
3
+ as?: React.ElementType;
4
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -4,7 +4,7 @@ interface Props {
4
4
  }
5
5
  export declare const Content: import("@emotion/styled").StyledComponent<{
6
6
  theme?: import("@emotion/react").Theme;
7
- as?: import("react").ElementType;
7
+ as?: React.ElementType;
8
8
  } & Props, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
9
  export declare const Button: import("@emotion/styled").StyledComponent<{
10
10
  [x: string]: any;
@@ -4,4 +4,4 @@ export interface CircularProgressProps extends MCircularProgressProps {
4
4
  className?: string;
5
5
  Track?: ElementType<CircularProgressProps>;
6
6
  }
7
- export declare const CircularProgress: ({ className, value, Track, ...props }: CircularProgressProps) => JSX.Element;
7
+ export declare const CircularProgress: ({ className, Track, value, ...props }: CircularProgressProps) => JSX.Element;
@@ -2,7 +2,7 @@ import { CircularProgress as MCircularProgress, } from "@mui/material";
2
2
  import React from "react";
3
3
  import { ProgressPositioner } from "./circularProgress.styles";
4
4
  import { CircularProgressTrack } from "./components/CircularProgressTrack/circularProgressTrack";
5
- export const CircularProgress = ({ className, value, Track = CircularProgressTrack, ...props /* Spread props to allow for CircularProgress specific props e.g. "disableShrink". */ }) => {
5
+ export const CircularProgress = ({ className, Track = CircularProgressTrack, value, ...props /* Spread props to allow for CircularProgress specific props e.g. "disableShrink". */ }) => {
6
6
  return (React.createElement(ProgressPositioner, { className: className },
7
7
  React.createElement(Track, { ...props }),
8
8
  React.createElement(MCircularProgress, { value: value, ...props })));
@@ -15,4 +15,4 @@ export interface StackProps {
15
15
  justifyContent?: MStackProps["justifyContent"];
16
16
  spacing?: number;
17
17
  }
18
- export declare const Stack: ({ children, className, direction, divider, justifyContent, alignItems, gap, spacing, }: StackProps) => JSX.Element;
18
+ export declare const Stack: ({ alignItems, children, className, direction, divider, gap, justifyContent, spacing, }: StackProps) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { Stack as MStack } from "@mui/material";
2
2
  import React from "react";
3
- export const Stack = ({ children, className, direction = "column", divider = undefined, justifyContent, alignItems, gap = 0, spacing = 0, }) => {
3
+ export const Stack = ({ alignItems, children, className, direction = "column", divider = undefined, gap = 0, justifyContent, spacing = 0, }) => {
4
4
  return (React.createElement(MStack, { className: className, direction: direction, divider: divider, justifyContent: justifyContent, alignItems: alignItems, gap: gap, spacing: spacing }, children));
5
5
  };
@@ -1,2 +1,2 @@
1
1
  import { ToggleButtonGroupProps } from "@mui/material";
2
- export declare const useToggleButtonGroup: <TValue extends unknown>(initialValue?: TValue | null) => ToggleButtonGroupProps;
2
+ export declare const useToggleButtonGroup: <TValue extends ToggleButtonGroupProps["value"]>(initialValue?: TValue | null) => ToggleButtonGroupProps;
@@ -1,4 +1,5 @@
1
1
  const COLOR = {
2
+ ERROR: "error",
2
3
  INHERIT: "inherit",
3
4
  INK_LIGHT: "ink.light",
4
5
  INK_MAIN: "ink.main",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "30.0.0",
3
+ "version": "32.0.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
@@ -85,6 +85,13 @@
85
85
  "react-gtm-module": "2.0.11",
86
86
  "react-idle-timer": "^5.7.2",
87
87
  "react-window": "1.8.9",
88
+ "rehype-raw": "^7.0.0",
89
+ "rehype-react": "^7.2.0",
90
+ "rehype-sanitize": "^5.0.1",
91
+ "remark-gfm": "^3.0.1",
92
+ "remark-parse": "^10.0.2",
93
+ "remark-rehype": "^10.1.0",
94
+ "unified": "^10.1.2",
88
95
  "uuid": "8.3.2",
89
96
  "yup": "^1.6.1"
90
97
  },
@@ -1,5 +1,4 @@
1
- import { ColumnDef } from "@tanstack/react-table";
2
- import { GridTrackSize } from "../config/entities";
1
+ import { ColumnDef, RowData } from "@tanstack/react-table";
3
2
 
4
3
  /**
5
4
  * Model of a value of a metadata class.
@@ -19,11 +18,6 @@ export interface Attribute {
19
18
  values?: string; // Free text description of attribute values
20
19
  }
21
20
 
22
- /**
23
- * Model of attribute key types; used mostly when building data dictionary column definitions.
24
- */
25
- export type AttributeValueTypes<TValue = unknown> = TValue;
26
-
27
21
  /**
28
22
  * Filterable metadata keys.
29
23
  */
@@ -41,8 +35,8 @@ export interface CategoryTag {
41
35
  /**
42
36
  * Model of a metadata class, to be specified manually or built from LinkML schema.
43
37
  */
44
- export interface Class {
45
- attributes: Attribute[];
38
+ export interface Class<T extends RowData = Attribute> {
39
+ attributes: T[];
46
40
  description: string;
47
41
  name: string; // Programmatic name or key (e.g. cell, sample)
48
42
  title: string; // Display name
@@ -62,41 +56,24 @@ export type DataDictionaryPrefix = Record<string, string>;
62
56
  /**
63
57
  * Model of a metadata dictionary containing a set of classes and their definitions.
64
58
  */
65
- export interface DataDictionary {
59
+ export interface DataDictionary<T extends RowData = Attribute> {
66
60
  annotations?: {
67
61
  [key in keyof DataDictionaryPrefix]: string; // Prefix to title e.g. "cxg": "CELLxGENE"
68
62
  };
69
- classes: Class[];
63
+ classes: Class<T>[];
70
64
  description?: string; // Free text description of data dictionary
71
65
  name: string; // Programmatic name or key (e.g. tier1, hca)
72
66
  prefixes?: DataDictionaryPrefix;
73
67
  title: string; // Display name
74
68
  }
75
69
 
76
- /**
77
- * Display model of a data dictionary column.
78
- */
79
- export interface DataDictionaryColumnDef {
80
- attributeAccessorFnName?: string; // Name of accessor function to map to.
81
- attributeCellName?: string; // Name of cell renderer component to map to.
82
- attributeDisplayName: string;
83
- attributeSlotName: string;
84
- // Adding width here for now; possibly revisit separating column def and UI.
85
- width:
86
- | Omit<GridTrackSize, "GridTrackMinMax">
87
- | {
88
- max: string;
89
- min: string;
90
- };
91
- }
92
-
93
70
  /**
94
71
  * Configuration of data dictionary; contains schema definition (that is, the actual data
95
72
  * dictionary) as well as column def for displaying the data dictionary.
96
73
  */
97
- export interface DataDictionaryConfig {
98
- columnDefs: ColumnDef<Attribute, AttributeValueTypes>[];
99
- dataDictionary: DataDictionary;
74
+ export interface DataDictionaryConfig<T extends RowData = Attribute> {
75
+ columnDefs: ColumnDef<T, T[keyof T]>[];
76
+ dataDictionary: DataDictionary<T>;
100
77
  }
101
78
 
102
79
  /**