summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/moz-card/moz-card.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/content/widgets/moz-card/moz-card.mjs
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-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.mjs')
-rw-r--r--toolkit/content/widgets/moz-card/moz-card.mjs20
1 files changed, 16 insertions, 4 deletions
diff --git a/toolkit/content/widgets/moz-card/moz-card.mjs b/toolkit/content/widgets/moz-card/moz-card.mjs
index 2bd6e0f987..5687608975 100644
--- a/toolkit/content/widgets/moz-card/moz-card.mjs
+++ b/toolkit/content/widgets/moz-card/moz-card.mjs
@@ -3,7 +3,11 @@
* 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 "chrome://global/content/vendor/lit.all.mjs";
+import {
+ html,
+ ifDefined,
+ when,
+} from "chrome://global/content/vendor/lit.all.mjs";
import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
/**
@@ -18,6 +22,7 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
*
*
* @property {string} heading - The heading text that will be used for the card.
+ * @property {string} icon - (optional) A flag to indicate the header should include an icon
* @property {string} type - (optional) The type of card. No type specified
* will be the default card. The other available type is "accordion"
* @slot content - The content to show inside of the card.
@@ -31,6 +36,7 @@ export default class MozCard extends MozLitElement {
static properties = {
heading: { type: String },
+ icon: { type: Boolean },
type: { type: String, reflect: true },
expanded: { type: Boolean },
};
@@ -47,9 +53,15 @@ export default class MozCard extends MozLitElement {
}
return html`
<div id="heading-wrapper">
- ${this.type == "accordion"
- ? html` <div class="chevron-icon"></div>`
- : ""}
+ ${when(
+ this.type == "accordion",
+ () => html`<div class="chevron-icon"></div>`
+ )}
+ ${when(
+ this.icon,
+ () =>
+ html`<div part="icon" id="heading-icon" role="presentation"></div>`
+ )}
<span id="heading">${this.heading}</span>
</div>
`;