/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // eslint-disable-next-line import/no-unassigned-import import "toolkit-widgets/panel-list.js"; import { html } from "lit"; import { ifDefined } from "lit/directives/if-defined.js"; export default { title: "Design System/Components/Panel Menu", parameters: { actions: { handles: ["click"], }, }, }; const openMenu = e => document.querySelector("panel-list").toggle(e); const Template = ({ open, items }) => html` ${items.map(i => i == "
" ? html`
` : html` ${i.text ?? i} ` )}
`; export const Simple = Template.bind({}); Simple.args = { open: false, items: [ "Item One", { text: "Item Two (accesskey w)", accesskey: "w" }, "Item Three", "
", { text: "Checked", checked: true }, { text: "Badged, look at me", badged: true, icon: "settings" }, ], }; export const Icons = Template.bind({}); Icons.args = { open: false, items: [ { text: "Passwords", icon: "passwords" }, { text: "Settings", icon: "settings" }, ], }; export const Open = Template.bind({}); Open.args = { ...Simple.args, open: true, };