summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs')
-rw-r--r--toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs67
1 files changed, 67 insertions, 0 deletions
diff --git a/toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs b/toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs
new file mode 100644
index 0000000000..139dc83441
--- /dev/null
+++ b/toolkit/content/widgets/moz-support-link/moz-support-link.stories.mjs
@@ -0,0 +1,67 @@
+/* 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 } from "../vendor/lit.all.mjs";
+// eslint-disable-next-line import/no-unassigned-import
+import "./moz-support-link.mjs";
+
+MozXULElement.insertFTLIfNeeded(
+ "locales-preview/moz-support-link-storybook.ftl"
+);
+MozXULElement.insertFTLIfNeeded("browser/components/mozSupportLink.ftl");
+
+const fluentStrings = [
+ "storybook-amo-test",
+ "storybook-fluent-test",
+ "moz-support-link-text",
+];
+
+export default {
+ title: "UI Widgets/Support Link",
+ component: "moz-support-link",
+ argTypes: {
+ "data-l10n-id": {
+ options: [fluentStrings[0], fluentStrings[1], fluentStrings[2]],
+ control: { type: "select" },
+ },
+ onClick: { action: "clicked" },
+ },
+ parameters: {
+ status: "stable",
+ },
+};
+
+const Template = ({
+ "data-l10n-id": dataL10nId,
+ "support-page": supportPage,
+ "utm-content": utmContent,
+}) => html`
+ <a
+ is="moz-support-link"
+ data-l10n-id=${ifDefined(dataL10nId)}
+ support-page=${ifDefined(supportPage)}
+ utm-content=${ifDefined(utmContent)}
+ >
+ </a>
+`;
+
+export const withAMOUrl = Template.bind({});
+withAMOUrl.args = {
+ "data-l10n-id": fluentStrings[0],
+ "support-page": "addons",
+ "utm-content": "promoted-addon-badge",
+};
+
+export const Primary = Template.bind({});
+Primary.args = {
+ "support-page": "preferences",
+ "utm-content": "",
+};
+
+export const withFluentId = Template.bind({});
+withFluentId.args = {
+ "data-l10n-id": fluentStrings[1],
+ "support-page": "preferences",
+ "utm-content": "",
+};