-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from codytodonnell/main
Update cookiecutter and other comments
- Loading branch information
Showing
66 changed files
with
1,795 additions
and
1,211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,6 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Test taskflow configs | ||
_*.config.ts |
18 changes: 0 additions & 18 deletions
18
strudel-cookiecutter/base/{@cookiecutter.name@}/.eslintrc.cjs
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
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
77 changes: 77 additions & 0 deletions
77
strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/ArrayWithPopover.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,77 @@ | ||
import { Box, Stack, Chip, Popover, Grid } from "@mui/material"; | ||
import { useState } from "react"; | ||
|
||
interface ArrayWithPopoverProps { | ||
values: string[] | number[] | ||
} | ||
|
||
/** | ||
* Array of Chips with a popover to show the full list. | ||
* This is used to render arrays in table cells where the | ||
* list is cut off by the edge of the cell. | ||
*/ | ||
export const ArrayWithPopover: React.FC<ArrayWithPopoverProps> = ({ values }) => { | ||
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null); | ||
|
||
const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => { | ||
setAnchorEl(event.currentTarget); | ||
}; | ||
|
||
const handlePopoverClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
const open = Boolean(anchorEl); | ||
return ( | ||
<Box | ||
sx={{ height: '100%' }} | ||
> | ||
<Stack | ||
direction="row" | ||
spacing={1} | ||
alignItems="center" | ||
onMouseEnter={handlePopoverOpen} | ||
onMouseLeave={handlePopoverClose} | ||
sx={{ height: '100%' }} | ||
> | ||
{values.map((v) => ( | ||
<Chip key={v} label={v} size="small" /> | ||
))} | ||
</Stack> | ||
<Popover | ||
id="mouse-over-popover" | ||
sx={{ | ||
pointerEvents: 'none', | ||
}} | ||
open={open} | ||
anchorEl={anchorEl} | ||
anchorOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'left', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'left', | ||
}} | ||
onClose={handlePopoverClose} | ||
disableRestoreFocus | ||
> | ||
<Grid | ||
container | ||
rowGap={1} | ||
columnGap={1} | ||
sx={{ | ||
maxWidth: '300px', | ||
padding: 2, | ||
}} | ||
> | ||
{values.map((v) => ( | ||
<Grid key={v} item> | ||
<Chip label={v} size="small" /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
</Popover> | ||
</Box> | ||
) | ||
} |
65 changes: 65 additions & 0 deletions
65
strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/CellWithPopover.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,65 @@ | ||
import { Box, Popover } from "@mui/material"; | ||
import { PropsWithChildren, useState } from "react"; | ||
|
||
/** | ||
* Generic inner cell content with a popover to show the full contents. | ||
* This is used to render cells with too much content to display | ||
* inside a single cell. Full content is displayed on hover in a popover box. | ||
*/ | ||
export const CellWithPopover: React.FC<PropsWithChildren> = ({ children }) => { | ||
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null); | ||
|
||
const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => { | ||
setAnchorEl(event.currentTarget); | ||
}; | ||
|
||
const handlePopoverClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
const open = Boolean(anchorEl); | ||
return ( | ||
<Box | ||
sx={{ height: '100%' }} | ||
> | ||
<Box | ||
onMouseEnter={handlePopoverOpen} | ||
onMouseLeave={handlePopoverClose} | ||
sx={{ | ||
height: '100%', | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
<Popover | ||
id="mouse-over-popover" | ||
sx={{ | ||
pointerEvents: 'none', | ||
}} | ||
open={open} | ||
anchorEl={anchorEl} | ||
anchorOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'left', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'left', | ||
}} | ||
onClose={handlePopoverClose} | ||
disableRestoreFocus | ||
> | ||
<Box | ||
sx={{ | ||
maxWidth: '300px', | ||
padding: 2, | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
</Popover> | ||
</Box> | ||
) | ||
} |
49 changes: 32 additions & 17 deletions
49
strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/CheckboxList.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
Oops, something went wrong.