diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/content/widgets/moz-card/moz-card.stories.mjs | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/content/widgets/moz-card/moz-card.stories.mjs')
-rw-r--r-- | toolkit/content/widgets/moz-card/moz-card.stories.mjs | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/toolkit/content/widgets/moz-card/moz-card.stories.mjs b/toolkit/content/widgets/moz-card/moz-card.stories.mjs index da3279b2a4..0430956a52 100644 --- a/toolkit/content/widgets/moz-card/moz-card.stories.mjs +++ b/toolkit/content/widgets/moz-card/moz-card.stories.mjs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // eslint-disable-next-line import/no-unresolved -import { html, ifDefined } from "lit.all.mjs"; +import { classMap, html, ifDefined } from "lit.all.mjs"; // eslint-disable-next-line import/no-unassigned-import import "./moz-card.mjs"; @@ -15,6 +15,8 @@ export default { fluent: ` moz-card-heading = .heading = This is the label +moz-card-heading-with-icon = + .heading = This is a card with a heading icon `, }, argTypes: { @@ -22,13 +24,27 @@ moz-card-heading = options: ["default", "accordion"], control: { type: "select" }, }, + hasHeadingIcon: { + options: [true, false], + control: { type: "select" }, + }, }, }; -const Template = ({ l10nId, content, type }) => html` - <main style="max-width: 400px"> +const Template = ({ l10nId, content, type, hasHeadingIcon }) => html` + <style> + main { + max-width: 400px; + } + moz-card.headingWithIcon::part(icon) { + background-image: url("chrome://browser/skin/preferences/category-general.svg"); + } + </style> + <main> <moz-card type=${ifDefined(type)} + ?icon=${hasHeadingIcon} + class=${classMap({ headingWithIcon: hasHeadingIcon })} data-l10n-id=${ifDefined(l10nId)} data-l10n-attrs="heading" > @@ -86,3 +102,13 @@ CardTypeAccordion.parameters = { }, }, }; + +export const CardWithHeadingIcon = Template.bind({}); +CardWithHeadingIcon.args = { + l10nId: "moz-card-heading-with-icon", + content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Nunc velit turpis, mollis a ultricies vitae, accumsan ut augue. + In a eros ac dolor hendrerit varius et at mauris.`, + type: "default", + hasHeadingIcon: true, +}; |