import React, { Fragment, useRef, useState } from 'react';
import { Card } from 'reablocks';
import { List, ListItem } from 'reablocks';
import { Menu } from 'reablocks';
import { NestedMenu, NestedMenuRef } from 'reablocks';
import { useMenu } from 'reablocks';
import { Button } from 'reablocks';
export default {
title: 'Components/Layers/Menu',
component: Menu,
subComponents: { NestedMenu }
};
export const Unstyled = () => {
const { toggleOpen, ref, Menu: MenuComponent } = useMenu();
return (
Unstyled Menu
);
};
export const NoAnimation = () => {
const { toggleOpen, ref, Menu: MenuComponent } = useMenu();
return (
No Animate Menu
);
};
export const Nested = () => {
const { toggleOpen, ref, Menu: MenuComponent } = useMenu({ open: false });
const itemStyle = { padding: 5, borderBottom: 'solid 1px black' };
const nestedMenuRef = useRef(null);
return (
My Menu
1
2.1
2.2
2.3
2.4
3.1
3.2.1
3.2.2
3.2.3
3.2.4
3.3
{
nestedMenuRef.current?.close();
}}
>
Close
4
);
};
export const AutoWidth = () => {
const { toggleOpen, ref, Menu: MenuComponent } = useMenu();
return (
Menu Item 1
Menu Item 2
Menu Item 3
Menu Item 4
);
};
export const AutoWidthModifiers = () => {
const { toggleOpen, ref, Menu: MenuComponent } = useMenu();
return (
Menu Item 1
Menu Item 2
Menu Item 3
Menu Item 4
);
};
export const Simple = () => {
const [open, setOpen] = useState(false);
const buttonRef = useRef(null);
return (
<>
>
);
};
export const CustomAnimation = () => {
const [open, setOpen] = useState(false);
const buttonRef = useRef(null);
return (
<>
>
);
};
export const Selectable = () => {
const [open, setOpen] = useState(false);
const buttonRef = useRef(null);
return (
<>
>
);
};
const Icon = () => (
);