summaryrefslogtreecommitdiffstats
path: root/browser/components/storybook/stories/toggle.stories.mjs
blob: af3e72c6fea53883eb500dbf3cdb1d73f471ce5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* 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";

export default {
  title: "Design System/Atoms/Toggle",
};

const Template = ({ checked, disabled }) =>
  html`
    <link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
    <link
      rel="stylesheet"
      href="chrome://global/skin/in-content/toggle-button.css"
    />
    <input
      type="checkbox"
      class="toggle-button"
      ?checked=${checked}
      ?disabled=${disabled}
    />
  `;

export const Unchecked = Template.bind({});
Unchecked.args = {
  disabled: false,
  checked: false,
};
export const Checked = Template.bind({});
Checked.args = {
  disabled: false,
  checked: true,
};
export const DisabledUnchecked = Template.bind({});
DisabledUnchecked.args = {
  disabled: true,
  checked: false,
};
export const DisabledChecked = Template.bind({});
DisabledChecked.args = {
  disabled: true,
  checked: true,
};