generated from nventive/Template
-
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.
- Loading branch information
1 parent
9db012e
commit 1c2508c
Showing
39 changed files
with
999 additions
and
80 deletions.
There are no files selected for viewing
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
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,24 @@ | ||
import { | ||
AccordionProps, | ||
Accordion as MuiAccordion, | ||
styled, | ||
} from "@mui/material"; | ||
import style from "@styles/style.module.scss"; | ||
|
||
const StyledMuiAccordion = styled(MuiAccordion)({ | ||
border: `1px solid ${style["stone-veryLight"]}`, | ||
"&:not(:last-child)": { | ||
borderBottom: 0, | ||
}, | ||
"&::before": { | ||
display: "none", | ||
}, | ||
}); | ||
|
||
export default function Accordion({ children, ...props }: AccordionProps) { | ||
return ( | ||
<StyledMuiAccordion {...props} disableGutters elevation={0} square> | ||
{children} | ||
</StyledMuiAccordion> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
frontend/src/app/components/accordionSummary/AccordionSummary.tsx
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,30 @@ | ||
import CaretIcon from "@icons/CaretIcon"; | ||
import { | ||
AccordionSummaryProps, | ||
AccordionSummary as MuiAccordionSummary, | ||
styled, | ||
} from "@mui/material"; | ||
import style from "@styles/style.module.scss"; | ||
|
||
const StyledMuiAccordionSummary = styled(MuiAccordionSummary)({ | ||
flexDirection: "row-reverse", | ||
"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded": { | ||
transform: "rotate(90deg)", | ||
}, | ||
"& .MuiAccordionSummary-content": { | ||
marginLeft: style["spacing-md"], | ||
alignItems: "center", | ||
}, | ||
}); | ||
|
||
export default function AccordionSummary({ | ||
children, | ||
expandIcon = <CaretIcon width={16} height={16} />, | ||
...props | ||
}: AccordionSummaryProps) { | ||
return ( | ||
<StyledMuiAccordionSummary {...props} expandIcon={expandIcon}> | ||
{children} | ||
</StyledMuiAccordionSummary> | ||
); | ||
} |
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,32 @@ | ||
import Slide from "@components/slide/Slide"; | ||
import { DialogProps, Dialog as MuiDialog, styled } from "@mui/material"; | ||
import { TransitionProps } from "@mui/material/transitions"; | ||
import style from "@styles/style.module.scss"; | ||
import { forwardRef, JSXElementConstructor, ReactElement, Ref } from "react"; | ||
|
||
const StyledMuiDialog = styled(MuiDialog)({ | ||
"& .MuiDialog-paper": { | ||
margin: style["spacing-md"], | ||
}, | ||
}); | ||
|
||
const Transition = forwardRef(function Transition( | ||
props: TransitionProps & { | ||
children: ReactElement<unknown, JSXElementConstructor<unknown>>; | ||
}, | ||
ref: Ref<unknown>, | ||
) { | ||
return <Slide direction="up" ref={ref} {...props} timeout={500} />; | ||
}); | ||
|
||
export default function Dialog({ ...props }: DialogProps) { | ||
return ( | ||
<StyledMuiDialog | ||
disableScrollLock | ||
TransitionComponent={Transition} | ||
{...props} | ||
> | ||
{props.children} | ||
</StyledMuiDialog> | ||
); | ||
} |
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,5 @@ | ||
import { IconButtonProps, IconButton as MuiIconButton } from "@mui/material"; | ||
|
||
export default function IconButton({ ...props }: IconButtonProps) { | ||
return <MuiIconButton {...props} />; | ||
} |
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,9 @@ | ||
import { Slide as MuiSlide, SlideProps } from "@mui/material"; | ||
|
||
export default function Slide({ | ||
direction = "up", | ||
timeout = 500, | ||
...props | ||
}: SlideProps) { | ||
return <MuiSlide direction={direction} timeout={timeout} {...props} />; | ||
} |
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,39 @@ | ||
import { Switch as MuiSwitch, styled, SwitchProps } from "@mui/material"; | ||
import style from "@styles/style.module.scss"; | ||
|
||
const StyledMuiSwitch = styled(MuiSwitch)({ | ||
padding: style["spacing-xs"], | ||
transform: "scale(1.125)", | ||
|
||
"& .MuiSwitch-track": { | ||
borderRadius: style["border-radius-md"], | ||
|
||
"&::before, &::after": { | ||
content: '""', | ||
position: "absolute", | ||
top: "50%", | ||
transform: "translateY(-50%)", | ||
width: 16, | ||
height: 16, | ||
}, | ||
"&::before": { | ||
backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="%23fff" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"/></svg>')`, | ||
left: 12, | ||
}, | ||
"&::after": { | ||
backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="%23fff" d="M19,13H5V11H19V13Z" /></svg>')`, | ||
right: 12, | ||
}, | ||
}, | ||
|
||
"& .MuiSwitch-thumb": { | ||
boxShadow: "none", | ||
width: 16, | ||
height: 16, | ||
margin: 2, | ||
}, | ||
}); | ||
|
||
export default function Switch({ ...props }: SwitchProps) { | ||
return <StyledMuiSwitch {...props} />; | ||
} |
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,30 @@ | ||
import { | ||
Table as MuiTable, | ||
TableBody, | ||
TableCell, | ||
TableContainer, | ||
TableHead, | ||
TableProps, | ||
TableRow, | ||
} from "@mui/material"; | ||
|
||
interface ITable extends TableProps { | ||
columnTitles: Array<string>; | ||
} | ||
|
||
export default function Table({ children, columnTitles, ...props }: ITable) { | ||
return ( | ||
<TableContainer> | ||
<MuiTable {...props}> | ||
<TableHead> | ||
<TableRow> | ||
{columnTitles.map((columnTitle, index) => ( | ||
<TableCell key={index}>{columnTitle}</TableCell> | ||
))} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody>{children}</TableBody> | ||
</MuiTable> | ||
</TableContainer> | ||
); | ||
} |
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,28 @@ | ||
import { | ||
TableRow as MuiTableRow, | ||
styled, | ||
TableCell, | ||
TableRowProps, | ||
} from "@mui/material"; | ||
import style from "@styles/style.module.scss"; | ||
|
||
interface ITableRow extends TableRowProps { | ||
columns: Array<string>; | ||
} | ||
|
||
const StyledMuiTableRow = styled(MuiTableRow)({ | ||
"&:last-child td, &:last-child th": { border: 0 }, | ||
"&:nth-of-type(odd)": { | ||
backgroundColor: style["basic-background"], | ||
}, | ||
}); | ||
|
||
export default function TableRowRow({ columns, ...props }: ITableRow) { | ||
return ( | ||
<StyledMuiTableRow {...props}> | ||
{columns.map((column, index) => ( | ||
<TableCell key={index}>{column}</TableCell> | ||
))} | ||
</StyledMuiTableRow> | ||
); | ||
} |
Oops, something went wrong.