-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add basic query table * build: enable alias command in publish workflow * chore: update deps * fix(ui): make account menu style consistent * fix(ui): pagination * feat(ui): add dialog and query table actions * feat(ui): set width of cols and density of rows * feat(ui): add column visibility action * feat(ui): add sort and disableMulti* * feat(ui): add active filter icon on col header * style(ui): rename RightActionBar to ActionMenu * docs: changeset * fix: improve package.json's * fix: upgrade deps, upgrade to ts-node --esm * build: remove unecessary lint-staged config
- Loading branch information
1 parent
bbbe8d4
commit 4a05c2f
Showing
38 changed files
with
3,334 additions
and
2,000 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"gboost-ui": minor | ||
--- | ||
|
||
Add QueryTable and Dialog components |
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,8 @@ | ||
--- | ||
"gboost": patch | ||
"gboost-common": patch | ||
"gboost-infra": patch | ||
"gboost-ui": patch | ||
--- | ||
|
||
Improve package.json's |
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,8 @@ | ||
--- | ||
"gboost": patch | ||
"gboost-common": patch | ||
"gboost-infra": patch | ||
"gboost-ui": patch | ||
--- | ||
|
||
Update deps |
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import { styled } from "./stitches.config.js"; | ||
|
||
/** | ||
* Unstyled div to utilize Stitches' CSS typings | ||
*/ | ||
export const Box = styled("div"); |
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,94 @@ | ||
import { ReactElement } from "react"; | ||
import { Heading, Icon } from "@aws-amplify/ui-react"; | ||
import { keyframes, styled } from "./stitches.config.js"; | ||
import * as DialogPrimitive from "@radix-ui/react-dialog"; | ||
import { Box } from "./Box.jsx"; | ||
import { MdClose } from "react-icons/md"; | ||
|
||
const overlayShow = keyframes({ | ||
"0%": { opacity: 0 }, | ||
"100%": { opacity: 1 }, | ||
}); | ||
|
||
const contentShow = keyframes({ | ||
"0%": { opacity: 0, transform: "translate(-50%, -48%) scale(.96)" }, | ||
"100%": { opacity: 1, transform: "translate(-50%, -50%) scale(1)" }, | ||
}); | ||
|
||
const StyledOverlay = styled(DialogPrimitive.Overlay, { | ||
bc: "$blackA9", | ||
position: "fixed", | ||
inset: 0, | ||
"@media (prefers-reduced-motion: no-preference)": { | ||
animation: `${overlayShow} 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards`, | ||
}, | ||
}); | ||
|
||
const StyledContent = styled(DialogPrimitive.Content, { | ||
backgroundColor: "white", | ||
borderRadius: 6, | ||
boxShadow: | ||
"hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px", | ||
position: "fixed", | ||
top: "50%", | ||
left: "50%", | ||
transform: "translate(-50%, -50%)", | ||
width: "90vw", | ||
maxWidth: "450px", | ||
maxHeight: "85vh", | ||
padding: 25, | ||
"@media (prefers-reduced-motion: no-preference)": { | ||
animation: `${contentShow} 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards`, | ||
}, | ||
"&:focus": { outline: "none" }, | ||
}); | ||
const StyledIcon = styled(Icon, { cursor: "pointer" }); | ||
|
||
interface DialogProps { | ||
children: ReactElement; | ||
title?: string; | ||
trigger: ReactElement; | ||
maxWidth?: string; | ||
} | ||
|
||
/** | ||
* Dialog for showing auxiliary content. Try to limit use of dialogs. Prefer | ||
* nested pages where possible | ||
*/ | ||
export function Dialog({ | ||
children, | ||
title, | ||
trigger, | ||
maxWidth, | ||
}: DialogProps): ReactElement { | ||
return ( | ||
<DialogPrimitive.Root> | ||
<DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger> | ||
<DialogPrimitive.Portal> | ||
<StyledOverlay /> | ||
<StyledContent css={{ maxWidth }}> | ||
<> | ||
{title && ( | ||
<Box | ||
css={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
mb: "$3", | ||
}} | ||
> | ||
<div /> | ||
<Heading level={4}>{title}</Heading> | ||
<DialogPrimitive.Close asChild> | ||
<span> | ||
<StyledIcon aria-label="close" as={MdClose} /> | ||
</span> | ||
</DialogPrimitive.Close> | ||
</Box> | ||
)} | ||
{children} | ||
</> | ||
</StyledContent> | ||
</DialogPrimitive.Portal> | ||
</DialogPrimitive.Root> | ||
); | ||
} |
Oops, something went wrong.