| 102 | } |
| 103 | |
| 104 | export let Example = ({isPortaled, contain}: FocusScopeProps & StoryProps): JSX.Element => { |
| 105 | let [open, setOpen] = useState(false); |
| 106 | |
| 107 | return ( |
| 108 | <div> |
| 109 | <input aria-label="input before" /> |
| 110 | <button type="button" onClick={() => setOpen(true)}> |
| 111 | Open dialog |
| 112 | </button> |
| 113 | <input aria-label="input after" /> |
| 114 | {open && ( |
| 115 | <NestedDialog onClose={() => setOpen(false)} isPortaled={isPortaled} contain={contain} /> |
| 116 | )} |
| 117 | |
| 118 | <div id={dialogsRoot} /> |
| 119 | </div> |
| 120 | ); |
| 121 | }; |
| 122 | |
| 123 | export let ExampleStory: FocusScopeStory = args => <Example {...args} />; |
| 124 | ExampleStory.storyName = 'Example'; |