Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Alert): height was too large #2902

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/gamut/src/Button/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const IconButton = forwardRef<ButtonBaseElements, IconButtonProps>(
aria-label={trueAriaLabel}
ref={ref}
variant={variant}
size={size}
>
<Icon size={iconSize} />
</IconButtonBase>
Expand Down
59 changes: 59 additions & 0 deletions packages/styleguide/stories/Molecules/Modals/Modal.examples.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Box, FillButton, FlexBox, Modal, ModalProps } from "@codecademy/gamut";
import { useState } from "react";

export const PopoverExample = ({ p = 16, ...rest }: PopoverExampleProps) => {
const [open, setOpen] = useState(false);
const activeElRef = useRef<HTMLDivElement>(null);
const toggleOpen = () => setOpen(!open);
return (
<>
<Box ref={activeElRef}>
<FillButton onClick={toggleOpen}>Open Popover</FillButton>
</Box>
<FlexBox>
<Popover

Check failure on line 14 in packages/styleguide/stories/Molecules/Modals/Modal.examples.tsx

View workflow job for this annotation

GitHub Actions / lint (lint)

'Popover' is not defined
{...rest}
isOpen={open}
targetRef={activeElRef}
onRequestClose={() => setOpen(false)}
>
<FlexBox flexDirection="column" p={p} alignItems="flex-start">
<Box mb={8}>Hooray!</Box>
<FillButton size="small" onClick={() => setOpen(false)}>
Close Popover
</FillButton>
</FlexBox>
</Popover>
</FlexBox>
</>
);
};


export const ModalFocusExample = ({ ...rest }: ModalProps) => {
const [open, setOpen] = useState(false);
const toggleOpen = () => setOpen(!open);

return (
<>
<Box >
<FillButton onClick={toggleOpen}>Open Popover</FillButton>
</Box>
<FlexBox>
<Modal
{...rest}
isOpen={open}
onRequestClose={() => setOpen(false)}
shroud
escapeCloses
>
<FlexBox flexDirection="column" alignItems="flex-start">
<FillButton size="small" onClick={() => setOpen(false)}>
Close Modal
</FillButton>
</FlexBox>
</Modal>
</FlexBox>
</>
);
};
Loading