-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mvp-2.1.0' of https://github.com/CBIIT/crdc-datahub-ui …
…into CRDCDH-552
- Loading branch information
Showing
24 changed files
with
1,478 additions
and
706 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { FC } from 'react'; | ||
import { styled } from '@mui/material'; | ||
import Carousel, { CarouselProps } from 'react-multi-carousel'; | ||
import 'react-multi-carousel/lib/styles.css'; | ||
|
||
type Props = { | ||
children: React.ReactNode; | ||
} & Partial<CarouselProps>; | ||
|
||
const sizing = { | ||
desktop: { | ||
breakpoint: { max: 5000, min: 0 }, | ||
items: 3, | ||
partialVisibilityGutter: 40 | ||
}, | ||
}; | ||
|
||
const StyledWrapper = styled('div')({ | ||
maxWidth: "700px", | ||
minWidth: "464px", // NOTE: Without a min-width, the carousel collapses to 0px wide | ||
width: "100%", | ||
margin: "0 auto", | ||
"& .react-multi-carousel-list": { | ||
height: "206px", | ||
}, | ||
"& .react-multi-carousel-track": { | ||
margin: "0 auto", // NOTE: This centers the carousel when there are fewer than 2 items | ||
}, | ||
"& .react-multi-carousel-item": { | ||
width: "200px !important", | ||
}, | ||
"& .react-multi-carousel-list::after": { | ||
content: "''", | ||
position: "absolute", | ||
left: "calc(100% - 162px)", | ||
top: "0", | ||
bottom: "0", | ||
width: "162px", | ||
background: "linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%)", | ||
zIndex: 9, | ||
}, | ||
"& .react-multi-carousel-list::before": { | ||
content: "''", | ||
position: "absolute", | ||
right: "calc(100% - 162px)", | ||
top: "0", | ||
bottom: "0", | ||
width: "162px", | ||
background: "linear-gradient(to left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%)", | ||
zIndex: 9, | ||
}, | ||
}); | ||
|
||
/** | ||
* Provides a general carousel component for displaying multiple items | ||
* at the same time. | ||
* | ||
* @param Props | ||
* @returns {JSX.Element} | ||
*/ | ||
const ContentCarousel: FC<Props> = ({ children, ...props }: Props) => ( | ||
<StyledWrapper> | ||
<Carousel | ||
responsive={sizing} | ||
swipeable | ||
draggable | ||
infinite | ||
centerMode | ||
arrows | ||
focusOnSelect | ||
{...props} | ||
> | ||
{children} | ||
</Carousel> | ||
</StyledWrapper> | ||
); | ||
|
||
export default ContentCarousel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { FC } from 'react'; | ||
import { Box, Stack, Typography, styled } from '@mui/material'; | ||
|
||
type Props = { | ||
color: string; | ||
label: string; | ||
}; | ||
|
||
const StyledStack = styled(Stack)({ | ||
marginRight: "20px", | ||
"&:last-child": { | ||
marginRight: "0", | ||
}, | ||
}); | ||
|
||
const StyledLabel = styled(Typography)({ | ||
color: "#383838", | ||
fontSize: "13px", | ||
fontWeight: 300, | ||
fontFamily: "'Nunito Sans', 'Rubik', sans-serif", | ||
}); | ||
|
||
const StyledColorBox = styled(Box, { shouldForwardProp: (p) => p !== "color" })<{ color: string }>(({ color }) => ({ | ||
width: "22px", | ||
height: "9px", | ||
background: color, | ||
marginRight: "11px", | ||
borderRadius: "1.5px", | ||
})); | ||
|
||
/** | ||
* Represents an item in the legend of a chart | ||
* | ||
* e.g. [color box] [label] | ||
* | ||
* @param {Props} props | ||
* @returns {React.FC<Props>} | ||
*/ | ||
const LegendItem: FC<Props> = ({ color, label }: Props) => ( | ||
<StyledStack direction="row" alignItems="center"> | ||
<StyledColorBox color={color} /> | ||
<StyledLabel>{label}</StyledLabel> | ||
</StyledStack> | ||
); | ||
|
||
export default LegendItem; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { FC } from 'react'; | ||
import { Box, Stack, Typography, styled } from '@mui/material'; | ||
import LegendItem from './LegendItem'; | ||
|
||
const StyledContainer = styled(Box)({ | ||
borderRadius: "8px", | ||
background: "#F5F8F9", | ||
border: "1px solid #939393", | ||
width: "600px", | ||
paddingLeft: "18px", | ||
paddingRight: "18px", | ||
paddingTop: "3px", | ||
paddingBottom: "7px", | ||
marginTop: "20px", | ||
}); | ||
|
||
const StyledLegendTitle = styled(Typography)({ | ||
color: "#005EA2", | ||
fontFamily: "'Nunito Sans', 'Rubik', sans-serif", | ||
fontSize: "14px", | ||
fontWeight: 600, | ||
lineHeight: "27px", | ||
}); | ||
|
||
/** | ||
* A color code legend for the Data Submissions statistics chart(s) | ||
* | ||
* @returns {React.FC} | ||
*/ | ||
const StatisticLegend: FC = () => ( | ||
<StyledContainer> | ||
<StyledLegendTitle>Color Key</StyledLegendTitle> | ||
<Stack direction="row" justifyItems="center" alignItems="center"> | ||
<LegendItem color="#4D90D3" label="New Counts" /> | ||
<LegendItem color="#32E69A" label="Passed Counts" /> | ||
<LegendItem color="#D65219" label="Failed Counts" /> | ||
<LegendItem color="#FFD700" label="Warning Counts" /> | ||
</Stack> | ||
</StyledContainer> | ||
); | ||
|
||
export default StatisticLegend; |
Oops, something went wrong.