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/named-deck.stories.mjs | 165 +++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 browser/components/storybook/stories/named-deck.stories.mjs (limited to 'browser/components/storybook/stories/named-deck.stories.mjs') diff --git a/browser/components/storybook/stories/named-deck.stories.mjs b/browser/components/storybook/stories/named-deck.stories.mjs new file mode 100644 index 0000000000..21c9d62e3e --- /dev/null +++ b/browser/components/storybook/stories/named-deck.stories.mjs @@ -0,0 +1,165 @@ +/* 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/. */ + +import { html } from "lit.all.mjs"; +// Imported for side-effects. +// eslint-disable-next-line import/no-unassigned-import +import "toolkit-widgets/named-deck.js"; + +export default { + title: "UI Widgets/Named Deck", + component: "named-deck", + parameters: { + status: "stable", + fluent: ` +named-deck-tab-one = Tab 1 +named-deck-tab-two = Tab 2 +named-deck-tab-three = Tab 3 +named-deck-content-one = This is tab 1 +named-deck-content-two = This is tab 2 +named-deck-content-three = This is tab 3 +button-group-one = One +button-group-two = Two +button-group-three = Three +button-group-four = Four + `, + }, +}; + +export const Tabs = () => html` + + + + + + + +

+

+

+
+ +
+ +

+ The dashed outline is added for emphasis here. It applies to the button with + the selected attribute, but matches the deck's + selected-view name. +

+ +

+ These tabs are a combination of button-group, + named-deck-button, and named-deck. +

+

+`; + +export const ListMenu = () => html` + + +
+ + + + + +
+
+ +

This is tab 1

+
+
+ +

This is tab 2

+
+
+ +

This is tab 3

+
+
+ +
+ +

+ This is an alternate layout for creating a menu navigation. In this case, + the first view in the named-deck is the list view which + contains the named-deck-buttons to link to the other views. + Each view then includes a back named-deck-button which is used + to navigate back to the first view. +

+`; + +const FocusGroupTemplate = ({ orientation }) => html` + + + + + + + +

+ The button-group element will group focus to the buttons, + requiring left/right or up/down to switch focus between its child elements. + It accepts an orientation property, which determines if + left/right or up/down are used to change the focused button. +

+`; + +export const FocusGroup = FocusGroupTemplate.bind({}); +FocusGroup.args = { + orientation: "horizontal", +}; +FocusGroup.argTypes = { + orientation: { + options: ["horizontal", "vertical"], + control: { type: "radio" }, + }, +}; -- cgit v1.2.3