/* 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, ifDefined, classMap } from "../vendor/lit.all.mjs"; import "./moz-visual-picker.mjs"; export default { title: "UI Widgets/Visual Picker", component: "moz-visual-picker", argTypes: { value: { options: ["1", "2", "3"], control: { type: "select" }, }, slottedItem: { options: ["card", "avatar"], control: { type: "select" }, }, pickerL10nId: { options: ["moz-visual-picker", "moz-visual-picker-description"], control: { type: "select" }, }, }, parameters: { actions: { handles: ["click", "input", "change"], }, status: "in-development", fluent: ` moz-visual-picker = .label = Pick something moz-visual-picker-description = .label = Pick something .description = Pick one of these cool things please `, }, }; const AVATAR_ICONS = [ "chrome://global/skin/icons/defaultFavicon.svg", "chrome://global/skin/icons/experiments.svg", "chrome://global/skin/icons/heart.svg", ]; function getSlottedContent(type, index) { if (type == "card") { return html`
I'm card number ${index + 1}
`; } return html`
`; } const Template = ({ value, slottedItem, pickerL10nId, supportPage }) => { return html` ${[...Array.from({ length: 3 })].map( (_, i) => html` ${getSlottedContent(slottedItem, i)} ` )} `; }; export const Default = Template.bind({}); Default.args = { pickerL10nId: "moz-visual-picker", slottedItem: "card", value: "1", supportPage: "", }; export const WithPickerDescription = Template.bind({}); WithPickerDescription.args = { ...Default.args, pickerL10nId: "moz-visual-picker-description", }; export const WithPickerSupportLink = Template.bind({}); WithPickerSupportLink.args = { ...WithPickerDescription.args, supportPage: "foo", }; export const AllUnselected = Template.bind({}); AllUnselected.args = { ...Default.args, value: "", };