summaryrefslogtreecommitdiffstats
path: root/browser/components/storybook/stories/fxview-category-navigation.stories.mjs
blob: 74a379a5a802b74ebfdf2a9a896cfb82455f5b93 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* 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";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/firefoxview/fxview-category-navigation.mjs";

export default {
  title: "Domain-specific UI Widgets/Firefox View/Category Navigation",
  component: "fxview-category-navigation",
  parameters: {
    status: "in-development",
    actions: {
      handles: ["change-category"],
    },
    fluent: `
fxview-category-button-one = Category 1
  .title = Category 1
fxview-category-button-two = Category 2
  .title = Category 2
fxview-category-button-three = Category 3
  .title = Category 3
fxview-category-footer-button = Settings
  .title = Settings
     `,
  },
};

const Template = () => html`
  <style>
    #page {
      height: 100%;
      display: grid;
      grid-template-columns: var(--in-content-sidebar-width) 1fr;
    }
    fxview-category-navigation {
      margin-inline-start: 10px;
    }
    fxview-category-button[name="category-one"]::part(icon) {
      background-image: url("chrome://browser/skin/preferences/category-general.svg");
    }
    fxview-category-button[name="category-two"]::part(icon) {
      background-image: url("chrome://browser/skin/preferences/category-general.svg");
    }
    fxview-category-button[name="category-three"]::part(icon) {
      background-image: url("chrome://browser/skin/preferences/category-general.svg");
    }
    .footer-button {
      display: flex;
      gap: 12px;
      font-weight: normal;
      min-width: unset;
      padding: 8px;
      margin: 0;
    }
    .footer-button .cat-icon {
      background-image: url("chrome://browser/skin/preferences/category-general.svg");
      background-color: initial;
      background-size: 20px;
      background-repeat: no-repeat;
      background-position: center;
      height: 20px;
      width: 20px;
      display: inline-block;
      -moz-context-properties: fill;
      fill: currentColor;
    }
    @media (max-width: 52rem) {
      #page {
        grid-template-columns: 82px 1fr;
      }
      .cat-name {
        display: none;
      }
    }
  </style>
  <div id="page">
    <fxview-category-navigation>
      <h2 slot="category-nav-header">Header</h2>
      <fxview-category-button
        slot="category-button"
        name="category-one"
        data-l10n-id="fxview-category-button-one"
      >
      </fxview-category-button>
      <fxview-category-button
        slot="category-button"
        name="category-two"
        data-l10n-id="fxview-category-button-two"
      >
      </fxview-category-button>
      <fxview-category-button
        slot="category-button"
        name="category-three"
        data-l10n-id="fxview-category-button-three"
      >
      </fxview-category-button>
      <div slot="category-nav-footer" class="category-nav-footer">
        <button class="footer-button ghost-button">
          <span class="cat-icon"></span>
          <span
            class="cat-name"
            data-l10n-id="fxview-category-footer-button"
          ></span>
        </button>
      </div>
    </fxview-category-navigation>
  </div>
`;

export const Default = Template.bind({});
Default.args = {};