UNPKG

@create-figma-plugin/ui

Version:

Production-grade Preact components that replicate the Figma UI design

31 lines 983 B
import { h } from 'preact'; import { useState } from 'preact/hooks'; import { Disclosure } from '../disclosure.js'; export default { parameters: { fixedWidth: true }, tags: ['1'], title: 'Components/Disclosure' }; export const Closed = function () { const [open, setOpen] = useState(false); function handleClick(event) { console.log(event); setOpen(!(open === true)); } const style = { height: '64px' }; return (h("div", { style: style }, h(Disclosure, { onClick: handleClick, open: open, title: "Title" }, "Body"))); }; export const Open = function () { const [open, setOpen] = useState(true); function handleClick(event) { console.log(event); setOpen(!(open === true)); } const style = { height: '64px' }; return (h("div", { style: style }, h(Disclosure, { onClick: handleClick, open: open, title: "Title" }, "Text"))); }; //# sourceMappingURL=disclosure.stories.js.map