sync-device-name.stories.mjs (1209B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 import { html } from "chrome://global/content/vendor/lit.all.mjs"; 6 import "chrome://browser/content/preferences/widgets/sync-device-name.mjs"; 7 8 export default { 9 title: "Domain-specific UI Widgets/Settings/Sync Device Name", 10 component: "sync-device-name", 11 parameters: { 12 status: "in-development", 13 }, 14 }; 15 16 window.MozXULElement.insertFTLIfNeeded("browser/preferences/preferences.ftl"); 17 18 const Template = ({ value = "", defaultValue = "", disabled = false }) => html` 19 <div style="max-width: 500px"> 20 <sync-device-name 21 value=${value} 22 defaultvalue=${defaultValue} 23 ?disabled=${disabled} 24 ></sync-device-name> 25 </div> 26 `; 27 28 export const Default = Template.bind({}); 29 Default.args = { 30 value: "My Device Name", 31 disabled: false, 32 }; 33 34 export const WithDefaultValue = Template.bind({}); 35 WithDefaultValue.args = { 36 ...Default.args, 37 defaultValue: "My Default Device Name", 38 }; 39 40 export const Disabled = Template.bind({}); 41 Disabled.args = { 42 ...Default.args, 43 disabled: true, 44 };