From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../storybook/stories/panel-list.stories.mjs | 133 +++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 browser/components/storybook/stories/panel-list.stories.mjs (limited to 'browser/components/storybook/stories/panel-list.stories.mjs') diff --git a/browser/components/storybook/stories/panel-list.stories.mjs b/browser/components/storybook/stories/panel-list.stories.mjs new file mode 100644 index 0000000000..af1678b1e7 --- /dev/null +++ b/browser/components/storybook/stories/panel-list.stories.mjs @@ -0,0 +1,133 @@ +/* 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, ifDefined } from "lit.all.mjs"; + +export default { + title: "UI Widgets/Panel Menu", + component: "panel-list", + parameters: { + status: "stable", + actions: { + handles: ["click"], + }, + fluent: ` +panel-list-item-one = Item One +panel-list-item-two = Item Two (accesskey w) +panel-list-item-three = Item Three +panel-list-checked = Checked +panel-list-badged = Badged, look at me +panel-list-passwords = Passwords +panel-list-settings = Settings + `, + }, +}; + +const openMenu = e => { + e.target.getRootNode().querySelector("panel-list").toggle(e); +}; + +const Template = ({ isOpen, items, wideAnchor }) => + html` + + + + + + + ${items.map(i => + i == "
" + ? html`
` + : html` + + ` + )} +
+ `; + +export const Simple = Template.bind({}); +Simple.args = { + isOpen: false, + wideAnchor: false, + items: [ + "panel-list-item-one", + { l10nId: "panel-list-item-two", accesskey: "w" }, + "panel-list-item-three", + "
", + { l10nId: "panel-list-checked", checked: true }, + { l10nId: "panel-list-badged", badged: true, icon: "settings" }, + ], +}; + +export const Icons = Template.bind({}); +Icons.args = { + isOpen: false, + wideAnchor: false, + items: [ + { l10nId: "panel-list-passwords", icon: "passwords" }, + { l10nId: "panel-list-settings", icon: "settings" }, + ], +}; + +export const Open = Template.bind({}); +Open.args = { + ...Simple.args, + wideAnchor: false, + isOpen: true, +}; + +export const Wide = Template.bind({}); +Wide.args = { + ...Simple.args, + wideAnchor: true, +}; -- cgit v1.2.3