@uva-glass/component-library
Version:
React components UvA
71 lines (70 loc) • 1.75 kB
JavaScript
import { jsxs as a, jsx as e } from "react/jsx-runtime";
import { OverlayProvider as p } from "@react-aria/overlays";
import { fn as m } from "../../index-DXR-TB1d.js";
import { useState as c } from "react";
import { Drawer as r } from "./Drawer.js";
import { Button as o } from "../Buttons/Button.js";
import "../Buttons/LinkButton.js";
import "@react-aria/button";
import { ButtonGroup as u } from "../ButtonGroup/ButtonGroup.js";
const d = `
<Drawer isOpen={isOpen} onClose={onCloseFunction} title={title} buttons={buttons}> {children} </Drawer>
`, v = {
title: "Molecules/Drawer",
component: r,
argTypes: {
isOpen: {
table: {
disable: !0
}
},
buttons: {
table: {
disable: !0
}
},
closeButtonAriaValueText: {
table: {
disable: !0
}
}
},
parameters: {
inspectComponent: r,
codeString: d
}
}, i = (l) => {
const [t, n] = c(!1);
return /* @__PURE__ */ a(p, { children: [
/* @__PURE__ */ e(o, { onClick: () => n(!t), variant: "primary", children: "Open drawer" }),
t && /* @__PURE__ */ e(
r,
{
...l,
isOpen: t,
onClose: () => (m()(), n(!t)),
children: "Example Drawer Content"
}
)
] });
}, s = {
title: "Example Title",
closeButtonAriaValueText: "Close"
}, b = i.bind({});
b.args = {
...s
};
const f = i.bind({});
f.args = {
...s,
buttons: /* @__PURE__ */ a(u, { children: [
/* @__PURE__ */ e(o, { variant: "primary", children: "Primary Example Button" }),
/* @__PURE__ */ e(o, { variant: "secondary", children: "Secondary Example Button" })
] })
};
export {
b as DrawerExample,
f as WithButtons,
v as default
};
//# sourceMappingURL=Drawer.stories.js.map