From bada661325e2d9e1fb2c93db7ca7cc3468034c8f Mon Sep 17 00:00:00 2001 From: Kenny Lin Date: Mon, 1 Jul 2024 16:16:05 -0400 Subject: [PATCH] fixes to alert --- packages/gamut/src/Button/IconButton.tsx | 1 + .../Molecules/Modals/Modal.examples.tsx | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 packages/styleguide/stories/Molecules/Modals/Modal.examples.tsx diff --git a/packages/gamut/src/Button/IconButton.tsx b/packages/gamut/src/Button/IconButton.tsx index 7609a360f3..4dbf4e07b0 100644 --- a/packages/gamut/src/Button/IconButton.tsx +++ b/packages/gamut/src/Button/IconButton.tsx @@ -65,6 +65,7 @@ export const IconButton = forwardRef( aria-label={trueAriaLabel} ref={ref} variant={variant} + size={size} > diff --git a/packages/styleguide/stories/Molecules/Modals/Modal.examples.tsx b/packages/styleguide/stories/Molecules/Modals/Modal.examples.tsx new file mode 100644 index 0000000000..e9f831edad --- /dev/null +++ b/packages/styleguide/stories/Molecules/Modals/Modal.examples.tsx @@ -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(null); + const toggleOpen = () => setOpen(!open); + return ( + <> + + Open Popover + + + setOpen(false)} + > + + Hooray! + setOpen(false)}> + Close Popover + + + + + + ); +}; + + +export const ModalFocusExample = ({ ...rest }: ModalProps) => { + const [open, setOpen] = useState(false); + const toggleOpen = () => setOpen(!open); + + return ( + <> + + Open Popover + + + setOpen(false)} + shroud + escapeCloses + > + + setOpen(false)}> + Close Modal + + + + + + ); +};