/* 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, when, ifDefined } from "../vendor/lit.all.mjs"; import "./moz-page-nav.mjs"; export default { title: "UI Widgets/Page Nav", component: "moz-page-nav", parameters: { status: "in-development", actions: { handles: ["change-view"], }, fluent: ` moz-page-nav-button-one = View 1 .title = View 1 moz-page-nav-button-two = View 2 .title = View 2 moz-page-nav-button-three = View 3 .title = View 3 moz-page-nav-button-four = Support Link .title = Support Link moz-page-nav-button-five = External Link .title = External Link moz-page-nav-heading = .heading = Heading moz-page-nav-search-input = .aria-label = Search Storybook .placeholder = Search Storybook `, }, }; const Template = ({ hasFooterLinks, hasIcons, showSearch, scrollable }) => { let iconSrc = hasIcons ? "chrome://global/skin/icons/settings.svg" : undefined; let maxHeight = scrollable ? "190px" : "initial"; return html`
${when( showSearch, () => html`` )} ${when( hasFooterLinks, () => html` ` )}
`; }; export const Default = Template.bind({}); Default.args = { hasFooterLinks: false, hasIcons: true, showSearch: false, scrollable: false, }; export const WithFooterLinks = Template.bind({}); WithFooterLinks.args = { ...Default.args, hasFooterLinks: true }; export const WithoutIcons = Template.bind({}); WithoutIcons.args = { ...Default.args, hasIcons: false }; export const WithSearch = Template.bind({}); WithSearch.args = { ...Default.args, showSearch: true }; export const WithSearchScroll = Template.bind({}); WithSearchScroll.args = { ...Default.args, showSearch: true, scrollable: true };