import React, { useCallback, useState, useMemo } from "react"; import ModalContent from "../../../components/Modal/ModalContent/ModalContent"; import Dropdown from "../../../components/Dropdown/Dropdown"; import { DropdownOption } from "../../../components/Dropdown/Dropdown.types"; import Modal from "../../../components/Modal/Modal"; import ModalExampleContent from "./ModalExampleContent"; import Box from "../../../components/Box/Box"; import Flex from "../../../components/Flex/Flex"; import Dialog from "../../../components/Dialog/Dialog"; import Button from "../../../components/Button/Button"; import DialogContentContainer from "../../../components/DialogContentContainer/DialogContentContainer"; export default { title: "Technical Patterns/Dropdowns inside pop-overs" }; export const ModalWithDamagedDropdown: React.FC = () => { const [show, setShow] = useState(false); const closeModal = useCallback(() => { setShow(false); }, [setShow]); const options: DropdownOption[] = [ { value: "1", label: "Option 1" }, { value: "2", label: "Option 2" }, { value: "3", label: "Option 3" }, { value: "4", label: "Option 4" }, { value: "5", label: "Option 5" }, { value: "6", label: "Option 6" }, { value: "7", label: "Option 7" }, { value: "8", label: "Option 8" }, { value: "9", label: "Option 9" }, { value: "10", label: "Option 10" }, { value: "11", label: "Option 11" }, { value: "12", label: "Option 12" }, { value: "13", label: "Option 13" }, { value: "14", label: "Option 14" }, { value: "15", label: "Option 15" } ]; return (
); }; export const MenuPosition: React.FC = () => { const [show, setShow] = useState(false); const closeModal = useCallback(() => { setShow(false); }, [setShow]); const options: DropdownOption[] = useMemo( () => [ { value: "1", label: "Option 1" }, { value: "2", label: "Option 2" }, { value: "3", label: "Option 3" }, { value: "4", label: "Option 4" }, { value: "5", label: "Option 5" }, { value: "6", label: "Option 6" }, { value: "7", label: "Option 7" }, { value: "8", label: "Option 8" }, { value: "9", label: "Option 9" }, { value: "10", label: "Option 10" }, { value: "11", label: "Option 11" }, { value: "12", label: "Option 12" }, { value: "13", label: "Option 13" }, { value: "14", label: "Option 14" }, { value: "15", label: "Option 15" } ], [] ); const dialogStyle: React.CSSProperties = { width: "350px", height: "200px", overflow: "auto" }; const modifiers = [ { name: "preventOverflow", options: { mainAxis: false } } ]; return (
} >
); }; export const InsideOverflowContainer: React.FC = () => { const [show, setShow] = useState(false); const closeModal = useCallback(() => { setShow(false); }, [setShow]); const options: DropdownOption[] = useMemo( () => [ { value: "1", label: "Option 1" }, { value: "2", label: "Option 2" }, { value: "3", label: "Option 3" }, { value: "4", label: "Option 4" }, { value: "5", label: "Option 5" }, { value: "6", label: "Option 6" }, { value: "7", label: "Option 7" }, { value: "8", label: "Option 8" }, { value: "9", label: "Option 9" }, { value: "10", label: "Option 10" }, { value: "11", label: "Option 11" }, { value: "12", label: "Option 12" }, { value: "13", label: "Option 13" }, { value: "14", label: "Option 14" }, { value: "15", label: "Option 15" } ], [] ); const modifiers = [ { name: "preventOverflow", options: { mainAxis: false } } ]; const dialogStyle: React.CSSProperties = { width: "350px", height: "200px", overflow: "auto" }; return (
} >
); }; export const InsideOverflowWithTransformContainer: React.FC = () => { const options: DropdownOption[] = useMemo( () => [ { value: "1", label: "Option 1" }, { value: "2", label: "Option 2" }, { value: "3", label: "Option 3" }, { value: "4", label: "Option 4" }, { value: "5", label: "Option 5" }, { value: "6", label: "Option 6" }, { value: "7", label: "Option 7" }, { value: "8", label: "Option 8" }, { value: "9", label: "Option 9" }, { value: "10", label: "Option 10" }, { value: "11", label: "Option 11" }, { value: "12", label: "Option 12" }, { value: "13", label: "Option 13" }, { value: "14", label: "Option 14" }, { value: "15", label: "Option 15" } ], [] ); const dialogStyle: React.CSSProperties = { width: "300px", height: "200px", overflow: "auto" }; const secondDialogContent = ( ); return ( ); };