// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import styled from 'styled-components'; import PopOver from './'; import PopOverItem from './PopOverItem'; import PopOverSubMenu from './PopOverSubMenu'; import PopOverSeparator from './PopOverSeparator'; import PopOverHeader from './PopOverHeader'; import Meeting from '../icons/Meeting'; import Flex from '../Flex'; import Heading from '../Heading'; export default { title: 'UI Components/PopOver', component: PopOver, }; const StyledContents = styled.span` background-color: #0042bb; display: inline-block; border-radius: 100%; color: white; width: 2rem; height: 2rem; svg { fill: white; } `; const getButtonContents = (isOpen: boolean) => { const foo = isOpen ? `#0042bb` : '#075fff'; // avoiding TS prop problems. return ( ); }; export const BasicPopOverMenu = () => ( <> Click the button icon to trigger the popover getButtonContents(isOpen)} > Visit amazon.com} /> console.log('clicked')} children={More test content} /> console.log('clicked')} children={Also test content} checked /> console.log('clicked')} children={This has very long text} /> ); BasicPopOverMenu.story = { name: 'Basic PopOver Menu', }; export const PersistentPopOverMenu = () => ( <> Click the button icon to trigger the popover getButtonContents(isOpen)} closeOnClick={false} > console.log('clicked Option 1')} children={Option 1} /> console.log('clicked Option 2')} children={Option 2} /> console.log('clicked Option 3')} children={Option 3} /> ); PersistentPopOverMenu.story = { name: 'Persistent PopOver Menu', }; export const PopOverMenuWithHeader = () => ( Click the button icon to trigger the popover getButtonContents(isOpen)} > console.log('clicked')} children={Test content} /> console.log('clicked')} children={More test content} /> console.log('clicked')} children={This has very long text} /> ); PopOverMenuWithHeader.story = { name: 'PopOver Menu with Header', }; export const PopOverMenuWithSubmenu = () => ( Click the button icon to trigger the popover getButtonContents(isOpen)} > console.log('clicked')} children={Also test content} checked /> console.log('clicked')} children={This is more test content} /> console.log('clicked')} children={This is also a submenu component} /> console.log('clicked')} children={This is also a submenu component} /> console.log('clicked')} children={This has very long text} /> ); PopOverMenuWithSubmenu.story = { name: 'PopOver Menu with Submenu', };