@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,37 @@
1
+ import { Box } from "@mui/material";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ import React from "react";
4
+ import { PALETTE } from "../../../../../../../styles/common/constants/palette";
5
+ import { MarkdownCell } from "../markdownCell";
6
+ import { DEFAULT_ARGS, WITH_HTML_ARGS } from "./args";
7
+
8
+ const meta: Meta<typeof MarkdownCell> = {
9
+ component: MarkdownCell,
10
+ decorators: [
11
+ (Story): JSX.Element => (
12
+ <Box
13
+ sx={{
14
+ backgroundColor: PALETTE.COMMON_WHITE,
15
+ fontSize: "14px",
16
+ lineHeight: "20px",
17
+ padding: 3,
18
+ width: 480,
19
+ }}
20
+ >
21
+ <Story />
22
+ </Box>
23
+ ),
24
+ ],
25
+ };
26
+
27
+ export default meta;
28
+
29
+ type Story = StoryObj<typeof meta>;
30
+
31
+ export const Default: Story = {
32
+ args: DEFAULT_ARGS,
33
+ };
34
+
35
+ export const WithHtml: Story = {
36
+ args: WITH_HTML_ARGS,
37
+ };
@@ -0,0 +1,4 @@
1
+ import { CellContext, RowData } from "@tanstack/react-table";
2
+ import { MarkdownCellProps } from "../types";
3
+
4
+ export type GetValue = CellContext<RowData, MarkdownCellProps>["getValue"];
@@ -0,0 +1,3 @@
1
+ export type MarkdownCellProps = {
2
+ values: string;
3
+ };
@@ -13,8 +13,8 @@ export interface CircularProgressProps extends MCircularProgressProps {
13
13
 
14
14
  export const CircularProgress = ({
15
15
  className,
16
- value,
17
16
  Track = CircularProgressTrack,
17
+ value,
18
18
  ...props /* Spread props to allow for CircularProgress specific props e.g. "disableShrink". */
19
19
  }: CircularProgressProps): JSX.Element => {
20
20
  return (
@@ -19,13 +19,13 @@ export interface StackProps {
19
19
  }
20
20
 
21
21
  export const Stack = ({
22
+ alignItems,
22
23
  children,
23
24
  className,
24
25
  direction = "column",
25
26
  divider = undefined,
26
- justifyContent,
27
- alignItems,
28
27
  gap = 0,
28
+ justifyContent,
29
29
  spacing = 0,
30
30
  }: StackProps): JSX.Element => {
31
31
  return (
@@ -6,6 +6,7 @@ type TypographyPropsOptions = {
6
6
  };
7
7
 
8
8
  const COLOR: Record<string, TypographyOwnProps["color"]> = {
9
+ ERROR: "error",
9
10
  INHERIT: "inherit",
10
11
  INK_LIGHT: "ink.light",
11
12
  INK_MAIN: "ink.main",
@@ -0,0 +1,53 @@
1
+ import { matchers } from "@emotion/jest";
2
+ import { composeStories } from "@storybook/react";
3
+ import { Column } from "@tanstack/react-table";
4
+ import "@testing-library/jest-dom";
5
+ import { render, screen } from "@testing-library/react";
6
+ import React from "react";
7
+ import {
8
+ ANCHOR_TARGET,
9
+ REL_ATTRIBUTE,
10
+ } from "../src/components/Links/common/entities";
11
+ import { STYLED_ANCHOR } from "../src/components/Table/components/TableCell/components/MarkdownCell/stories/constants";
12
+ import * as stories from "../src/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories";
13
+ import { MarkdownCellProps } from "../src/components/Table/components/TableCell/components/MarkdownCell/types";
14
+
15
+ expect.extend(matchers);
16
+
17
+ const { Default, WithHtml } = composeStories(stories);
18
+
19
+ describe("MarkdownCell", () => {
20
+ it("renders the markdown content", async () => {
21
+ render(<Default />);
22
+ expect(await screen.findByText("UBERON:0000955")).toBeInTheDocument();
23
+ });
24
+
25
+ it("renders HTML and anchor elements", async () => {
26
+ render(<WithHtml />);
27
+ const anchorEl = await screen.findByText("example link");
28
+ expect(anchorEl).toBeInTheDocument();
29
+ expect(anchorEl.getAttribute("href")).toBe("https://www.example.com");
30
+ expect(anchorEl.getAttribute("target")).toBe(ANCHOR_TARGET.BLANK);
31
+ expect(anchorEl.getAttribute("rel")).toBe(
32
+ REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
33
+ );
34
+ expect(anchorEl).toHaveClass("MuiLink-root");
35
+ });
36
+
37
+ it("applies the correct className and component", async () => {
38
+ render(
39
+ <WithHtml
40
+ className="css-pygqsj"
41
+ column={
42
+ {
43
+ columnDef: { meta: { components: { a: STYLED_ANCHOR } } },
44
+ } as unknown as Column<unknown, MarkdownCellProps>
45
+ }
46
+ />
47
+ );
48
+ const anchorEl = await screen.findByText("example link");
49
+ expect(anchorEl).toHaveStyleRule("background-color", "green");
50
+ expect(anchorEl).toHaveStyleRule("color", "white");
51
+ expect(anchorEl.closest(".css-pygqsj")).toBeInTheDocument();
52
+ });
53
+ });
@@ -172,9 +172,9 @@ describe("useRequestManifest", () => {
172
172
  * @param testObject.formFacet - Form facet.
173
173
  */
174
174
  function testRequestManifest({
175
+ expectedMethod = METHOD.PUT,
175
176
  expectedParams = undefined,
176
177
  expectedUrl = undefined,
177
- expectedMethod = METHOD.PUT,
178
178
  fileManifestFormat,
179
179
  formFacet = FORM_FACET.COMPLETE_SET,
180
180
  }: {
@@ -19,6 +19,7 @@ import type {} from "@mui/material/Toolbar";
19
19
  import type {} from "@mui/material/Typography";
20
20
  import type {} from "@tanstack/react-table";
21
21
  import { RowData } from "@tanstack/react-table";
22
+ import { Components } from "rehype-react";
22
23
  import { DataLayer } from "../src/common/analytics/entities";
23
24
  import { DataDictionaryAnnotation } from "../src/common/entities";
24
25
  import {
@@ -230,6 +231,7 @@ declare module "@tanstack/react-table" {
230
231
  align?: TableCellProps["align"];
231
232
  annotation?: DataDictionaryAnnotation;
232
233
  columnPinned?: boolean;
234
+ components?: Partial<Components>; // For `MarkdownRendererCell` component.
233
235
  header?: string;
234
236
  width?: GridTrackSize;
235
237
  }