@cgi-learning-hub/ui
Version:
@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features
52 lines (51 loc) • 1.3 kB
JavaScript
import { jsxs as a, Fragment as u, jsx as o } from "react/jsx-runtime";
import { useState as m } from "react";
import p from "../Button/Button.es.js";
import { M as d } from "../../Menu-9BK8jmzW.js";
import { M as t } from "../../MenuItem-C8nduSzJ.js";
const h = (c) => {
const [r, i] = m(null), e = !!r, l = (s) => {
i(s.currentTarget);
}, n = () => i(null);
return /* @__PURE__ */ a(u, { children: [
/* @__PURE__ */ o(
p,
{
variant: "text",
id: "basic-button",
"aria-controls": e ? "basic-menu" : void 0,
"aria-haspopup": "true",
"aria-expanded": e ? "true" : void 0,
onClick: l,
children: "Open menu"
}
),
/* @__PURE__ */ a(
d,
{
...c,
id: "basic-menu",
anchorEl: r,
open: e,
onClose: n,
MenuListProps: {
"aria-labelledby": "basic-button"
},
children: [
/* @__PURE__ */ o(t, { onClick: n, children: "Profile" }),
/* @__PURE__ */ o(t, { onClick: n, children: "My account" }),
/* @__PURE__ */ o(t, { onClick: n, children: "Logout" })
]
}
)
] });
}, x = {
title: "Components/Menu",
component: h
}, g = {
args: {}
};
export {
g as Default,
x as default
};