Skip to content

Commit

Permalink
chore: updated findable-ui to v14.0.0 (#3330) (#3331)
Browse files Browse the repository at this point in the history
Co-authored-by: Fran McDade <[email protected]>
  • Loading branch information
frano-m and Fran McDade authored Nov 8, 2024
1 parent 77797a6 commit cde9bc0
Show file tree
Hide file tree
Showing 42 changed files with 1,215 additions and 1,003 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const DataIngestionChart: FC = (): JSX.Element => {

const zr = chart.current?.getEchartsInstance().getZr();
zr?.on("mousemove", handleMouse);
return () => zr?.handler && zr.off("mousemove", handleMouse);
return (): void => zr?.handler && zr.off("mousemove", handleMouse);
});
return (
<Card component={RoundedPaper}>
Expand Down
4 changes: 2 additions & 2 deletions components/Events/components/Card/card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CardText } from "@databiosphere/findable-ui/lib/components/common/Card/components/CardText/cardText";
import { CardTitle } from "@databiosphere/findable-ui/lib/components/common/Card/components/CardTitle/cardTitle";
import { FluidPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles";
import { Card as MCard, CardActionArea } from "@mui/material";
import { CardActionArea, Card as MCard } from "@mui/material";
import Router from "next/router";
import React, { useCallback } from "react";
import { useCallback } from "react";
import { FrontmatterEvent } from "../../../../content/entities";
import { CardContent, CardSection } from "./card.styles";
import { getEventOverline, getEventTitle } from "./common/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
TEXT_HEADING_LARGE,
} from "@databiosphere/findable-ui/lib/theme/common/typography";
import { Typography } from "@mui/material";
import React from "react";
import { CardDate as Date } from "./cardDate.styles";

interface CardDateProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Dot } from "@databiosphere/findable-ui/lib/components/common/Dot/dot";
import { TEXT_BODY_SMALL_400_2_LINES } from "@databiosphere/findable-ui/lib/theme/common/typography";
import { Typography } from "@mui/material";
import React, { Fragment } from "react";
import { Fragment } from "react";
import { CardOverline as Overline } from "./cardOverline.styles";

interface CardOverlineProps {
Expand Down
1 change: 0 additions & 1 deletion components/Events/events.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Card as DXCard } from "@databiosphere/findable-ui/lib/components/common/Card/card";
import { FluidPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles";
import { Tabs } from "@databiosphere/findable-ui/lib/components/common/Tabs/tabs";
import React from "react";
import { FrontmatterEvent } from "../../content/entities";
import { EVENTS_VIEW_TABS } from "./common/constants";
import { Card } from "./components/Card/card";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useIntersectionObserver(
if (ref.current?.lastElementChild) {
observerRef.current.observe(ref.current.lastElementChild);
}
return () => {
return (): void => {
observerRef.current?.disconnect();
};
}, [onIntersection, ref]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixi
import { smokeLightest } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors";
import styled from "@emotion/styled";
import {
Section as DefaultSection,
SectionLayout as DefaultLayout,
Section as DefaultSection,
} from "../../section.styles";

export const Section = styled(DefaultSection)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { textBody400 } from "@databiosphere/findable-ui/lib/styles/common/mixins
import styled from "@emotion/styled";
import {
CardContent as DefaultContent,
CardSection as DefaultSection,
Grid as DefaultGrid,
CardSection as DefaultSection,
GridCard,
} from "../../../../../Card/card.styles";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixi
import { smokeLightest } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors";
import styled from "@emotion/styled";
import {
Section as DefaultSection,
sectionGrid,
SectionHeadline as DefaultHeadline,
SectionLayout as DefaultLayout,
Section as DefaultSection,
sectionGrid,
} from "../../section.styles";

export const Section = styled(DefaultSection)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
import styled from "@emotion/styled";
import { Card as MCard } from "@mui/material";
import {
GridCardContent as DefaultContent,
CardSection as DefaultSection,
GridCard,
GridCardContent as DefaultContent,
} from "../../../../../../../Card/card.styles";

export const Card = styled(GridCard)`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Divider } from "@mui/material";
import {
Count,
Metrics as DatasetMetrics,
Label,
Metric,
Metrics as DatasetMetrics,
} from "./metrics.styles";

export const Metrics = (): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import styled from "@emotion/styled";
import { mediaTabletLargeUp } from "../../../../../../styles/common/mixins/breakpoints";
import {
SectionActions as DefaultActions,
sectionGrid,
SectionHeadline as DefaultHeadline,
SectionTitle as DefaultTitle,
sectionGrid,
} from "../../section.styles";

export const Headline = styled(DefaultHeadline)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { css } from "@emotion/react";
import styled from "@emotion/styled";
import { IconButton as MIconButton } from "@mui/material";
import {
SwipeAction,
SWIPE_ACTION,
SwipeAction,
} from "../../../../../../../../hooks/useSwipeInteraction/common/entities";
import { MAX_DECK_SIZE } from "../../common/constants";
import { getArrowTransform } from "../../common/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { textBodyLarge4002Lines } from "@databiosphere/findable-ui/lib/styles/co
import styled from "@emotion/styled";
import {
SectionActions as DefaultActions,
sectionGrid,
SectionHeadline as DefaultHeadline,
SectionLayout as DefaultLayout,
sectionGrid,
} from "../../section.styles";

export const SectionLayout = styled(DefaultLayout)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { VISIBILITY_MODE_LABEL } from "../../../../../../../../common/constants"
import { VISIBILITY_MODE } from "../../../../../../../../common/entities";
import { updateVisibilityMode } from "../../../../../../../../common/utils";
import { PublicationCard } from "../../../../common/entities";
import { Card as GridCard, CardContent, CardSection } from "./card.styles";
import { CardContent, CardSection, Card as GridCard } from "./card.styles";

const MAX_AUTHORS = 5;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import styled from "@emotion/styled";
import { Card as MCard } from "@mui/material";
import {
CardContent as DefaultContent,
CardSection as DefaultSection,
Grid as DefaultGrid,
CardSection as DefaultSection,
GridCard,
} from "../../../../../Card/card.styles";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints";
import styled from "@emotion/styled";
import {
sectionGrid,
SectionHeadline as DefaultHeadline,
SectionLayout as DefaultLayout,
sectionGrid,
} from "../../section.styles";

export const SectionLayout = styled(DefaultLayout)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
DEFAULT_ACTIVE_INDEX,
DEFAULT_SWIPE_COORDINATES,
} from "./common/constants";
import { SwipeAction, SwipeCoordinates, SWIPE_ACTION } from "./common/entities";
import { SWIPE_ACTION, SwipeAction, SwipeCoordinates } from "./common/entities";

export interface InteractiveAction {
onMouseDown: (mouseEvent: MouseEvent) => void;
Expand Down Expand Up @@ -127,7 +127,7 @@ export function useSwipeInteraction(
const timeout = setTimeout(() => {
onSwipeToIndex(1);
}, swipeDelay);
return () => clearTimeout(timeout);
return (): void => clearTimeout(timeout);
}, [activeIndex, swipeDelay, onSwipeToIndex]);

if (!swipeEnabled) {
Expand Down
22 changes: 10 additions & 12 deletions components/Layout/components/Content/content.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,23 @@ const image = (props: ThemeProps) => css`
const muiAlert = (props: ThemeProps) => css`
.MuiAlert-root {
margin: 24px 0;
&.MuiAlert-standardWarning {
margin: 16px 0;
}
padding: 24px;
&:last-child {
margin-bottom: 0;
}
.MuiAlert-icon {
padding: 4px 0;
}
.MuiAlert-message {
${textBodyLarge4002Lines(props)};
gap: 16px;
.MuiAlertTitle-root {
${textHeadingSmall(props)};
}
ol > li,
ul > li {
Expand All @@ -73,14 +79,6 @@ const muiAlert = (props: ThemeProps) => css`
}
}
}
.MuiAlert-message:first-of-type {
gap: 16px;
.MuiAlertTitle-root {
${textHeadingSmall(props)};
}
}
}
`;

Expand Down
2 changes: 1 addition & 1 deletion components/News/news.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CardSecondaryText } from "@databiosphere/findable-ui/lib/components/com
import { CardText } from "@databiosphere/findable-ui/lib/components/common/Card/components/CardText/cardText";
import { CardTitle } from "@databiosphere/findable-ui/lib/components/common/Card/components/CardTitle/cardTitle";
import { FluidPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles";
import { Card as MCard, CardActionArea } from "@mui/material";
import { CardActionArea, Card as MCard } from "@mui/material";
import { useRouter } from "next/router";
import { FrontmatterNews } from "../../content/entities";
import { CardSection, NewsView } from "./news.styles";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
PublicationCard,
PUBLICATION_CATEGORY,
PublicationCard,
} from "../../../Home/components/Section/components/SectionPublications/common/entities";
import { Card } from "../../../Home/components/Section/components/SectionPublications/components/Publications/components/Card/card";
import { PublicationView } from "./publications.styles";
Expand Down
1 change: 0 additions & 1 deletion components/Search/components/Pagination/pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { IconButton } from "@databiosphere/findable-ui/lib/components/common/IconButton/iconButton";
import EastRoundedIcon from "@mui/icons-material/EastRounded";
import WestRoundedIcon from "@mui/icons-material/WestRounded";
import React from "react";
import { OnSearchFn, SearchPagination } from "../../hooks/common/entities";
import { PaginationActions, PaginationView } from "./pagination.styles";

Expand Down
1 change: 0 additions & 1 deletion components/Search/components/Results/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { RoundedCard } from "@databiosphere/findable-ui/lib/components/common/Ca
import { NoResults } from "@databiosphere/findable-ui/lib/components/NoResults/noResults";
import { TEXT_BODY_SMALL_400 } from "@databiosphere/findable-ui/lib/theme/common/typography";
import { Typography as MTypography } from "@mui/material";
import React from "react";
import { ResultsView } from "./results.styles";

interface ResultsProps {
Expand Down
2 changes: 1 addition & 1 deletion components/Search/search.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LoadingIcon } from "@databiosphere/findable-ui/lib/components/common/CustomIcon/components/LoadingIcon/loadingIcon";
import { Tabs } from "@databiosphere/findable-ui/lib/components/common/Tabs/tabs";
import { NoResults } from "@databiosphere/findable-ui/lib/components/NoResults/noResults";
import React, { Fragment } from "react";
import { Fragment } from "react";
import { Heading } from "../common/Typography/components/Heading/heading";
import { TABS } from "./common/constants";
import { Pagination } from "./components/Pagination/pagination";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { CustomSVGIconProps } from "@databiosphere/findable-ui/lib/components/common/CustomIcon/common/entities";
import { SvgIcon } from "@mui/material";
import React from "react";

/**
* Custom code pull request icon.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AnchorLink } from "@databiosphere/findable-ui/lib/components/common/AnchorLink/anchorLink";
import { TEXT_HEADING_LARGE } from "@databiosphere/findable-ui/lib/theme/common/typography";
import { Typography } from "@mui/material";
import React from "react";
import { slugifyHeading } from "../../../../../plugins/common/utils";

export interface HeadingProps {
Expand Down
1 change: 1 addition & 0 deletions components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export { NavBarHero } from "@databiosphere/findable-ui/lib/components/Layout/com
export { Nav } from "@databiosphere/findable-ui/lib/components/Layout/components/Nav/nav";
export { Link } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link";
export { ContentView } from "@databiosphere/findable-ui/lib/views/ContentView/contentView";
export { AlertTitle } from "@mui/material";
export { Figure } from "./common/Figure/figure";
export { NonBreakingSpace as NBS } from "./common/Typography/components/NonBreakingSpace/nonBreakingSpace";
export { Subheader } from "./common/Typography/components/Subheader/subheader";
Expand Down
1 change: 1 addition & 0 deletions docs/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const DOC_SITE_FOLDER_NAME = "docs";

export const MDX_COMPONENTS = {
Alert: C.Alert,
AlertTitle: C.AlertTitle,
AnVILPublications: C.AnVILPublications,
AnalysisPortals: C.AnalysisPortals,
AnchorLink: C.AnchorLink,
Expand Down
7 changes: 5 additions & 2 deletions docs/guides.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ The guides below are meant to help you get started working on content. Please fe

The content for the portal is located in the [/content](https://github.com/anvilproject/anvil-portal/tree/main/content) folder of the [anvil-portal](https://github.com/anvilproject/anvil-portal/tree/main) GitHub repository. Each page of the site, and some page components, are represented as [markdown](https://en.wikipedia.org/wiki/Markdown) files in this folder.

<Alert severity="warning" title="Tip">
We use the **main** branch of the repository as the base for modifying the content.
<Alert severity="warning">
<AlertTitle>Tip</AlertTitle>

We use the **main** branch of the repository as the base for modifying the content.

</Alert>

## Content Lifecycle
Expand Down
15 changes: 11 additions & 4 deletions docs/guides/content/creating-a-new-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ Typically the folder structure mirrors the structure or the site. This is not st
src="/consortia/guides/create-new-file.png"
/>

<Alert severity="warning" title="Tip">
Note that you can not create an empty directory using the GitHub interface. However you can create a directory while adding a file by adding the new directory name before the file name then hitting the "/" character.
<Alert severity="warning">
<AlertTitle>Tip</AlertTitle>

Note that you can not create an empty directory using the GitHub interface. However you can create a directory while adding a file by adding the new directory name before the file name then hitting the "/" character.

</Alert>

<Figure
Expand All @@ -47,10 +50,14 @@ Metadata describing the page and indicating its publication date, and author are
---
```

<Alert severity="warning" title="Tip">
The front matter goes at the very top or each new page.
<Alert severity="warning">
<AlertTitle>Tip</AlertTitle>

The front matter goes at the very top or each new page.

</Alert>


## Add the Page Content

With the front matter created, it is time to add the page content in markdown. See one of the many [markdown guides](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) on the internet.
Expand Down
7 changes: 5 additions & 2 deletions docs/guides/content/creating-links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ Putting this all together an internal link looks like:

This renders as: [An Internal Link](/guides/content/editing-an-existing-page)

<Alert severity="warning" title="Tip">
Don't forget the leading slash "/" in the internal link paths.
<Alert severity="warning">
<AlertTitle>Tip</AlertTitle>

Don't forget the leading slash "/" in the internal link paths.

</Alert>

### Linking to an Internal Page Heading
Expand Down
7 changes: 5 additions & 2 deletions docs/guides/content/using-images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ This renders like:
src="/consortia/guides/anvil-image.png"
/>

<Alert severity="warning" title="Tip">
You can check if the image link is correct by using the preview link in the markdown editor.
<Alert severity="warning">
<AlertTitle>Tip</AlertTitle>

You can check if the image link is correct by using the preview link in the markdown editor.

</Alert>

## Controlling Image Size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ An exploration of elements of reproducible research with the AnVILPublish packag

<Video url="https://youtu.be/19upPoqNpx0" />

<Alert icon={false} severity="info" title="Notes">
<Alert icon={false} severity="info">
<AlertTitle>Notes</AlertTitle>

1. Visit the [course schedule](/events/bioconductor-popup-workshops-20210531#other-sessions) for links to the recorded session, and to other workshops in the series.
1. The material below requires a billing account. We provide a billing account during the workshop, but if you're following along on your own see '[Next Steps](/learn/data-analysts/reproducible-research-with-anvilpublish#next-steps)' for how to create a billing account.
1. Access to the workspaces we use may require registration; please [sign up](https://forms.gle/HCY2DM2QsuxAwdhv6) with your AnVIL email address.
1. Visit the [course schedule](/events/bioconductor-popup-workshops-20210531#other-sessions) for links to the recorded session, and to other workshops in the series.
1. The material below requires a billing account. We provide a billing account during the workshop, but if you're following along on your own see '[Next Steps](/learn/data-analysts/reproducible-research-with-anvilpublish#next-steps)' for how to create a billing account.
1. Access to the workspaces we use may require registration; please [sign up](https://forms.gle/HCY2DM2QsuxAwdhv6) with your AnVIL email address.

</Alert>

Expand Down
Loading

0 comments on commit cde9bc0

Please sign in to comment.