@repobit/dex-system-design 2.2.2 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +12 -2
  3. package/schemas/component-manifest.json +804 -1
  4. package/src/assets/images/ai/bento-consumer-art.jpg +0 -0
  5. package/src/assets/images/ai/bento-enterprise-art.jpg +0 -0
  6. package/src/assets/images/ai/bento-labs-art.jpg +0 -0
  7. package/src/assets/images/award-marks/av-comparatives-top-rated.png +0 -0
  8. package/src/assets/images/award-marks/av-test-top-product.png +0 -0
  9. package/src/assets/images/award-marks/crn-partner-guide.png +0 -0
  10. package/src/assets/images/award-marks/forrester.png +0 -0
  11. package/src/assets/images/award-marks/gartner.png +0 -0
  12. package/src/assets/images/award-marks/idc.png +0 -0
  13. package/src/assets/images/award-marks/mitre-engenuity.png +0 -0
  14. package/src/assets/images/award-marks/omdia.png +0 -0
  15. package/src/assets/images/award-marks/pcmag-best-of-2026.png +0 -0
  16. package/src/assets/images/award-marks/pcmag-editors-choice.png +0 -0
  17. package/src/assets/images/award-marks/pcmag-readers-choice.png +0 -0
  18. package/src/assets/images/hero/ai-sphere-poster.jpg +0 -0
  19. package/src/assets/images/insights/post-1.jpg +0 -0
  20. package/src/assets/images/insights/post-2.jpg +0 -0
  21. package/src/assets/images/insights/post-3.jpg +0 -0
  22. package/src/assets/images/partner/ferrari-lockup.png +0 -0
  23. package/src/assets/images/partner/ferrari-photo.jpg +0 -0
  24. package/src/assets/images/partners/ferrari.svg +6 -0
  25. package/src/assets/images/partners/konica-minolta.svg +12 -0
  26. package/src/assets/images/partners/logmein.svg +6 -0
  27. package/src/assets/images/partners/netgear.svg +10 -0
  28. package/src/assets/images/partners/sharp.svg +5 -0
  29. package/src/assets/images/partners/spurs.svg +33 -0
  30. package/src/components/audience-card/audience-card.css.js +87 -0
  31. package/src/components/audience-card/audience-card.js +80 -0
  32. package/src/components/audience-card/audience-card.stories.js +125 -0
  33. package/src/components/bento-grid/bento-grid.stories.js +77 -1
  34. package/src/components/bento-grid/bento-item.css.js +142 -2
  35. package/src/components/bento-grid/bento-item.js +65 -1
  36. package/src/components/hero/hero.css.js +260 -0
  37. package/src/components/hero/hero.js +168 -0
  38. package/src/components/hero/hero.stories.js +145 -0
  39. package/src/components/icons/enterprise-icon.js +19 -0
  40. package/src/components/icons/home-icon.js +19 -0
  41. package/src/components/icons/icons.js +5 -0
  42. package/src/components/icons/icons.stories.js +28 -2
  43. package/src/components/icons/pause-icon.js +20 -0
  44. package/src/components/icons/play-icon.js +19 -0
  45. package/src/components/icons/small-business-icon.js +19 -0
  46. package/src/components/logo-marquee/logo-marquee.css.js +83 -0
  47. package/src/components/logo-marquee/logo-marquee.js +113 -0
  48. package/src/components/logo-marquee/logo-marquee.stories.js +123 -0
  49. package/src/components/motion-art/motion-art.js +42 -0
  50. package/src/components/motion-art/motion-art.stories.js +98 -0
  51. package/src/components/partner-banner/partner-banner.css.js +162 -0
  52. package/src/components/partner-banner/partner-banner.js +68 -0
  53. package/src/components/partner-banner/partner-banner.stories.js +86 -0
  54. package/src/components/post-card/post-card.css.js +121 -0
  55. package/src/components/post-card/post-card.js +80 -0
  56. package/src/components/post-card/post-card.stories.js +79 -0
  57. package/src/components/section-header/section-header.css.js +89 -0
  58. package/src/components/section-header/section-header.js +79 -0
  59. package/src/components/section-header/section-header.stories.js +129 -0
  60. package/src/components/stat/stat-highlight.js +75 -0
  61. package/src/components/stat/stat-tile.js +43 -0
  62. package/src/components/stat/stat.css.js +111 -0
  63. package/src/components/stat/stat.js +2 -0
  64. package/src/components/stat/stat.stories.js +92 -0
  65. package/src/vendor/motion-art/README.md +27 -0
  66. package/src/vendor/motion-art/motion-art-element.js +116 -0
@@ -0,0 +1,42 @@
1
+ // Installs the design tokens into document scope; see src/tokens/tokens.js
2
+ import "../../tokens/tokens.js";
3
+ import { BdHero as MotionArtElement } from "../../vendor/motion-art/motion-art-element.js";
4
+
5
+ /**
6
+ * The homepage's animated illustrations, one canvas each, square:
7
+ * brand-surface the B on a glass sphere of network (bd-hero, media slot)
8
+ * mesh-globe a turning globe with three badges (consumer AI card)
9
+ * layer-stack four platform layers with captions (enterprise AI card)
10
+ * geo-core a geodesic cage round a core (Labs AI card)
11
+ *
12
+ * The element is generated outside this package and vendored as is; see
13
+ * src/vendor/motion-art/README.md. The generated class is still called BdHero;
14
+ * this module imports it as MotionArtElement and registers it under the
15
+ * package's own name, because bd-hero is the homepage band.
16
+ *
17
+ * Two defaults differ from the generated element's:
18
+ * - no substrate: it draws on a transparent canvas, so the ground is the
19
+ * component's own --color-surface-brand and a partner brand shows through;
20
+ * - the pill and badge type is the foundation's sans, read from the token.
21
+ *
22
+ * It draws only while on screen, holds a still frame under
23
+ * prefers-reduced-motion, and stops on `paused`. It draws no control of its
24
+ * own, and the hero and the brand bento card that hold it add none.
25
+ */
26
+ export class MotionArt extends MotionArtElement {
27
+ constructor() {
28
+ super();
29
+ this.substrate = false;
30
+ }
31
+
32
+ connectedCallback() {
33
+ super.connectedCallback();
34
+ if (!this.labelFont) {
35
+ const sans = getComputedStyle(this).getPropertyValue("--typography-fontFamily-sans")
36
+ .trim();
37
+ if (sans) this.labelFont = sans;
38
+ }
39
+ }
40
+ }
41
+
42
+ customElements.define("bd-motion-art", MotionArt);
@@ -0,0 +1,98 @@
1
+ import { html } from "lit";
2
+ import "./motion-art.js";
3
+
4
+ export default {
5
+ title : "Atoms/Motion Art",
6
+ component : "bd-motion-art",
7
+ tags : ["autodocs"],
8
+ parameters: {
9
+ layout: "padded",
10
+ docs : {
11
+ description: {
12
+ component: `
13
+ **Motion Art** is the homepage's animated illustrations, one canvas each,
14
+ square. Generated outside this package and vendored (\`src/vendor/motion-art/\`);
15
+ this atom registers it as \`bd-motion-art\`, because \`bd-hero\` is the homepage
16
+ band.
17
+
18
+ | \`object\` | Where it goes | Text |
19
+ |---|---|---|
20
+ | \`brand-surface\` | \`bd-hero\`, slot \`media\` | none |
21
+ | \`mesh-globe\` | consumer AI card, \`bd-bento-item tone="brand"\`, slot \`media\` | \`badges="Scams\\|Child Safety\\|Fraud"\` |
22
+ | \`layer-stack\` | enterprise AI card | \`labels="Manage\\|Respond\\|Prevent\\|AI Foundation"\` |
23
+ | \`geo-core\` | Labs AI card | \`label="LABS"\` |
24
+
25
+ \`\`\`html
26
+ <bd-hero …>
27
+ <bd-motion-art slot="media" object="brand-surface"></bd-motion-art>
28
+ </bd-hero>
29
+ <bd-bento-item tone="brand" …>
30
+ <bd-motion-art slot="media" object="mesh-globe" badges="Scams|Child Safety|Fraud"></bd-motion-art>
31
+ </bd-bento-item>
32
+ \`\`\`
33
+
34
+ The holding component sizes it; standing alone it fills its container's
35
+ width, or takes \`size\`. Brand-surface is drawn for 600, the others for 320,
36
+ each with a version for 96; badges and captions show from 200 up.
37
+
38
+ It draws on a transparent canvas here (\`substrate\` is off), so the ground is
39
+ the component's \`--color-surface-brand\`. It draws only while on screen, holds
40
+ a still frame under \`prefers-reduced-motion\`, and stops on \`paused\`.
41
+ `
42
+ }
43
+ }
44
+ },
45
+ argTypes: {
46
+ object : { control: "select", options: ["brand-surface", "mesh-globe", "layer-stack", "geo-core"] },
47
+ quality: { control: "select", options: ["auto", "full", "lite"] },
48
+ speed : { control: { type: "number", step: 0.25 } },
49
+ paused : { control: "boolean" }
50
+ }
51
+ };
52
+
53
+ /* The art is drawn for the brand ground; the story paints it, as the hero and
54
+ the bento card do. */
55
+ const ground = (content, width) => html`
56
+ <div style="background: var(--color-surface-brand); max-width: ${width}px;">${content}</div>
57
+ `;
58
+
59
+ export const BrandSurface = {
60
+ name : "brand-surface (hero)",
61
+ args : { object: "brand-surface", quality: "auto", speed: 1, paused: false },
62
+ render: ({ object, quality, speed, paused }) => ground(html`
63
+ <bd-motion-art object="${object}" quality="${quality}" speed="${speed}" ?paused=${paused}></bd-motion-art>
64
+ `, 600)
65
+ };
66
+
67
+ export const MeshGlobe = {
68
+ name : "mesh-globe (consumer AI card)",
69
+ render: () => ground(html`
70
+ <bd-motion-art object="mesh-globe" badges="Scams|Child Safety|Fraud"></bd-motion-art>
71
+ `, 320)
72
+ };
73
+
74
+ export const LayerStack = {
75
+ name : "layer-stack (enterprise AI card)",
76
+ render: () => ground(html`
77
+ <bd-motion-art object="layer-stack" labels="Manage|Respond|Prevent|AI Foundation"></bd-motion-art>
78
+ `, 320)
79
+ };
80
+
81
+ export const GeoCore = {
82
+ name : "geo-core (Labs AI card)",
83
+ render: () => ground(html`
84
+ <bd-motion-art object="geo-core" label="LABS"></bd-motion-art>
85
+ `, 320)
86
+ };
87
+
88
+ export const Small = {
89
+ name : "At 96",
90
+ render: () => html`
91
+ <div style="display: flex; gap: var(--spacing-16); background: var(--color-surface-brand); padding: var(--spacing-16);">
92
+ <bd-motion-art object="brand-surface" size="96"></bd-motion-art>
93
+ <bd-motion-art object="mesh-globe" size="96"></bd-motion-art>
94
+ <bd-motion-art object="layer-stack" size="96"></bd-motion-art>
95
+ <bd-motion-art object="geo-core" size="96"></bd-motion-art>
96
+ </div>
97
+ `
98
+ };
@@ -0,0 +1,162 @@
1
+ import { css, unsafeCSS } from "lit";
2
+ import { above } from "../shared/token-scales.js";
3
+
4
+ /* Mobile first, in the Figma Partner banner's three frames.
5
+ below md the photo (260), then the card as a solid brand band under it
6
+ md to lg the photo (320), the card rising 64 over its lower edge
7
+ lg and up the photo (600), the card rising 128, in two columns
8
+ Everything on the card is in the brand's own ink, --color-brand-on-fill. */
9
+ export const partnerBannerCSS = css`
10
+ :host {
11
+ display: block;
12
+ }
13
+
14
+ .photo {
15
+ /* no token: the photo band's height in each frame -- 260, 320, 600; the
16
+ dimension scale stops at 64 */
17
+ height: 260px;
18
+ overflow: hidden;
19
+ }
20
+
21
+ ::slotted([slot="photo"]) {
22
+ display: block;
23
+ width: 100%;
24
+ height: 100%;
25
+ object-fit: cover;
26
+ }
27
+
28
+ /* below md the card is a band, so the column gives up its gutter */
29
+ .column {
30
+ --bd-ensemble-inline-padding: 0;
31
+ }
32
+
33
+ .card {
34
+ display: flex;
35
+ flex-direction: column;
36
+ gap: var(--spacing-24);
37
+ padding: var(--spacing-24);
38
+ background: var(--color-surface-brand);
39
+ color: var(--color-brand-on-fill);
40
+ }
41
+
42
+ .intro,
43
+ .detail {
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: flex-start;
47
+ gap: var(--spacing-24);
48
+ min-width: 0;
49
+ }
50
+
51
+ .lockup {
52
+ display: flex;
53
+ }
54
+
55
+ ::slotted([slot="lockup"]) {
56
+ display: block;
57
+ max-width: 100%;
58
+ }
59
+
60
+ .heading {
61
+ margin: 0;
62
+ }
63
+
64
+ .quote {
65
+ display: flex;
66
+ flex-direction: column;
67
+ gap: var(--spacing-4);
68
+ margin: 0;
69
+ }
70
+
71
+ blockquote {
72
+ margin: 0;
73
+ font-family: var(--typography-heading-h4-fontFamily);
74
+ font-size: var(--typography-heading-h4-fontSize);
75
+ font-weight: var(--typography-heading-h4-fontWeight);
76
+ line-height: var(--typography-heading-h4-lineHeight);
77
+ letter-spacing: var(--typography-heading-h4-letterSpacing);
78
+ }
79
+
80
+ figcaption {
81
+ font-family: var(--typography-label-large-fontFamily);
82
+ font-size: var(--typography-label-large-fontSize);
83
+ font-weight: var(--typography-label-large-fontWeight);
84
+ line-height: var(--typography-label-large-lineHeight);
85
+ letter-spacing: var(--typography-label-large-letterSpacing);
86
+ }
87
+
88
+ .lead {
89
+ margin: 0;
90
+ font-family: var(--typography-body-regular-fontFamily);
91
+ font-size: var(--typography-body-regular-fontSize);
92
+ font-weight: var(--typography-body-regular-fontWeight);
93
+ line-height: var(--typography-body-regular-lineHeight);
94
+ letter-spacing: var(--typography-body-regular-letterSpacing);
95
+ }
96
+
97
+ .actions {
98
+ display: flex;
99
+ flex-wrap: wrap;
100
+ gap: var(--spacing-16);
101
+ }
102
+
103
+ @media ${unsafeCSS(above("md"))} {
104
+ .photo {
105
+ /* no token: the tablet frame's photo band */
106
+ height: 320px;
107
+ }
108
+
109
+ .column {
110
+ --bd-ensemble-inline-padding: initial;
111
+ position: relative;
112
+ margin-block-start: calc(-1 * var(--spacing-64));
113
+ }
114
+
115
+ /* The card over the photo: the brand from translucent to solid behind a
116
+ blur, so the photo shows through at the top and the copy sits on solid
117
+ brand. No token: a gradient's stops and a blur radius. The draft starts
118
+ the brand at 35%, where the attribution measures 3.6-4.1:1 over the
119
+ photo; it starts at 75% here, so every line of copy sits on ground at
120
+ least 4.5:1 against the brand's ink. */
121
+ .card {
122
+ padding: var(--spacing-32);
123
+ border-radius: var(--shape-radius-3xl);
124
+ background: linear-gradient(
125
+ to bottom,
126
+ color-mix(in srgb, var(--color-surface-brand) 75%, transparent) 0%,
127
+ var(--color-surface-brand) 55%
128
+ );
129
+ backdrop-filter: blur(29px);
130
+ }
131
+
132
+ .lead {
133
+ font-size: var(--typography-body-large-fontSize);
134
+ font-weight: var(--typography-body-large-fontWeight);
135
+ line-height: var(--typography-body-large-lineHeight);
136
+ letter-spacing: var(--typography-body-large-letterSpacing);
137
+ }
138
+ }
139
+
140
+ @media ${unsafeCSS(above("lg"))} {
141
+ .photo {
142
+ /* no token: the desktop frame's photo band */
143
+ height: 600px;
144
+ }
145
+
146
+ .column {
147
+ margin-block-start: calc(-1 * var(--spacing-128));
148
+ }
149
+
150
+ .card {
151
+ flex-direction: row;
152
+ align-items: center;
153
+ gap: var(--spacing-64);
154
+ padding: var(--spacing-64);
155
+ }
156
+
157
+ .intro,
158
+ .detail {
159
+ flex: 1 1 0;
160
+ }
161
+ }
162
+ `;
@@ -0,0 +1,68 @@
1
+ import { LitElement, html, nothing } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import "../heading/heading.js";
4
+ import { ensembleCSS } from "../shared/ensemble.css.js";
5
+ import { partnerBannerCSS } from "./partner-banner.css.js";
6
+
7
+ /**
8
+ * A partnership band: a full-bleed photo with a brand card that rises over
9
+ * its lower edge, holding the partner lockup, a headline, a quote with its
10
+ * attribution, a lead and two CTAs. The homepage's Ferrari section; drawn in
11
+ * the foundation Figma file as Partner banner.
12
+ *
13
+ * Not bd-cta-banner, which has no image, and not bd-spotlight-section, which
14
+ * sets its picture beside the copy rather than behind it.
15
+ *
16
+ * Slots: `photo` (an <img> or <picture>, cover-fitted), `lockup` (the partner
17
+ * mark, drawn in the brand's ink), `actions` (white and outline-white
18
+ * bd-button-links). Below md the card stops overlapping and becomes a solid
19
+ * band under the photo.
20
+ */
21
+ export class PartnerBanner extends LitElement {
22
+ static properties = {
23
+ heading : { type: String },
24
+ quote : { type: String },
25
+ attribution: { type: String },
26
+ lead : { type: String },
27
+ as : { type: String }
28
+ };
29
+
30
+ static styles = [tokens, ensembleCSS, partnerBannerCSS];
31
+
32
+ constructor() {
33
+ super();
34
+ this.heading = "";
35
+ this.quote = "";
36
+ this.attribution = "";
37
+ this.lead = "";
38
+ this.as = "h2";
39
+ }
40
+
41
+ render() {
42
+ return html`
43
+ <section class="root">
44
+ <div class="photo"><slot name="photo"></slot></div>
45
+ <div class="bd-ensemble column">
46
+ <div class="card">
47
+ <div class="intro">
48
+ <div class="lockup"><slot name="lockup"></slot></div>
49
+ <bd-h as="${this.as}" visual-level="h2" color="on-brand" class="heading">${this.heading}</bd-h>
50
+ </div>
51
+ <div class="detail">
52
+ ${this.quote
53
+ ? html`<figure class="quote">
54
+ <blockquote>${this.quote}</blockquote>
55
+ ${this.attribution ? html`<figcaption>${this.attribution}</figcaption>` : nothing}
56
+ </figure>`
57
+ : nothing}
58
+ ${this.lead ? html`<p class="lead">${this.lead}</p>` : nothing}
59
+ <div class="actions"><slot name="actions"></slot></div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </section>
64
+ `;
65
+ }
66
+ }
67
+
68
+ customElements.define("bd-partner-banner", PartnerBanner);
@@ -0,0 +1,86 @@
1
+ import { html } from "lit";
2
+ import "../button/button.js";
3
+ import "./partner-banner.js";
4
+
5
+ export default {
6
+ title : "Modules/Partner Banner",
7
+ component : "bd-partner-banner",
8
+ tags : ["autodocs"],
9
+ parameters: {
10
+ layout: "fullscreen",
11
+ docs : {
12
+ description: {
13
+ component: `
14
+ **PartnerBanner** is a partnership band: a full-bleed photo with a brand card
15
+ rising over its lower edge, holding the partner lockup, a headline, a quote
16
+ with its attribution, a lead and two CTAs. The homepage's Ferrari section;
17
+ drawn in the foundation Figma file as **Partner banner**.
18
+
19
+ \`\`\`html
20
+ <bd-partner-banner heading="Trusted by Ferrari as their Exclusive Cybersecurity Partner."
21
+ quote="“I’m proud to have Bitdefender riding with me in 2026.”"
22
+ attribution="Lewis Hamilton, Scuderia Ferrari HP Driver"
23
+ lead="The same intelligence trusted by Ferrari now protects …">
24
+ <img slot="photo" src="/ferrari.jpg" alt="">
25
+ <img slot="lockup" src="/lockup.png" alt="Bitdefender, Scuderia Ferrari HP Team Partner">
26
+ <bd-button-link slot="actions" variant="white" href="…">Read more</bd-button-link>
27
+ <bd-button-link slot="actions" variant="outline-white" href="…">Watch the Ferrari story</bd-button-link>
28
+ </bd-partner-banner>
29
+ \`\`\`
30
+
31
+ | Width | Layout |
32
+ |---|---|
33
+ | below \`md\` | photo 260, then the card as a solid brand band under it |
34
+ | \`md\` to \`lg\` | photo 320, the card rising 64 over it, one column |
35
+ | \`lg\` and up | photo 600, the card rising 128 over it, headline left and quote right |
36
+
37
+ ### Properties
38
+
39
+ | Property | Type | Default | Description |
40
+ |---|---|---|---|
41
+ | \`heading\` | String | \`""\` | The section's title, at the h2 role |
42
+ | \`quote\` | String | \`""\` | The quotation, at h4 |
43
+ | \`attribution\` | String | \`""\` | Who said it, at label-large |
44
+ | \`lead\` | String | \`""\` | The paragraph under the quote |
45
+ | \`as\` | String | \`"h2"\` | The title's level in the outline |
46
+
47
+ Slots: \`photo\`, \`lockup\`, \`actions\`.
48
+
49
+ ### Contrast
50
+
51
+ The draft starts the card's gradient at 35% brand, where the attribution
52
+ measures 3.6–4.1:1 over the photo. Here it starts at 75%, so every line sits on
53
+ ground at least 4.5:1 against the brand's ink.
54
+ `
55
+ }
56
+ }
57
+ }
58
+ };
59
+
60
+ const render = () => html`
61
+ <bd-partner-banner
62
+ heading="Trusted by Ferrari as their Exclusive Cybersecurity Partner."
63
+ quote="“I’m proud to have Bitdefender riding with me in 2026.”"
64
+ attribution="Lewis Hamilton, Scuderia Ferrari HP Driver"
65
+ lead="The same intelligence trusted by Ferrari now protects millions of homes and businesses worldwide, sharpened daily by AI and 25+ years of threat research."
66
+ >
67
+ <img slot="photo" src="/images/partner/ferrari-photo.jpg" alt="">
68
+ <img slot="lockup" src="/images/partner/ferrari-lockup.png" alt="Bitdefender, Ferrari Team Partner" width="205" height="32">
69
+ <bd-button-link slot="actions" variant="white" href="#">Read more</bd-button-link>
70
+ <bd-button-link slot="actions" variant="outline-white" href="#">Watch the Ferrari story</bd-button-link>
71
+ </bd-partner-banner>
72
+ `;
73
+
74
+ export const Ferrari = { render };
75
+
76
+ export const Tablet = {
77
+ name : "Tablet (768px)",
78
+ render,
79
+ parameters: { viewport: { defaultViewport: "tablet" } }
80
+ };
81
+
82
+ export const Mobile = {
83
+ name : "Mobile (375px)",
84
+ render,
85
+ parameters: { viewport: { defaultViewport: "mobile1" } }
86
+ };
@@ -0,0 +1,121 @@
1
+ import { css, unsafeCSS } from "lit";
2
+ import { above, below } from "../shared/token-scales.js";
3
+
4
+ /* A post card on the page ground beside two others, where the design draws
5
+ an edge: surface/default with a border/container edge, at the card corner.
6
+ The cover runs to the card's edges and the copy takes the compact inset. */
7
+ export const postCardCSS = css`
8
+ :host {
9
+ display: block;
10
+ height: 100%;
11
+ }
12
+
13
+ .card {
14
+ position: relative;
15
+ box-sizing: border-box;
16
+ height: 100%;
17
+ display: flex;
18
+ flex-direction: column;
19
+ overflow: hidden;
20
+ background: var(--color-surface-default);
21
+ border: var(--border-width-1) solid var(--color-border-container);
22
+ border-radius: var(--card-radius);
23
+ }
24
+
25
+ .cover {
26
+ position: relative;
27
+ flex: none;
28
+ /* no token: the cover's height in the desktop and phone frames; the
29
+ dimension scale stops at 64 */
30
+ height: 196px;
31
+ background: var(--color-surface-muted);
32
+ }
33
+
34
+ .cover img,
35
+ ::slotted([slot="image"]) {
36
+ display: block;
37
+ width: 100%;
38
+ height: 100%;
39
+ object-fit: cover;
40
+ }
41
+
42
+ .badge {
43
+ position: absolute;
44
+ inset-block-start: var(--spacing-20);
45
+ inset-inline-start: var(--spacing-24);
46
+ }
47
+
48
+ .body {
49
+ flex: 1 1 auto;
50
+ display: flex;
51
+ flex-direction: column;
52
+ justify-content: space-between;
53
+ gap: var(--spacing-24);
54
+ padding: var(--spacing-24);
55
+ }
56
+
57
+ .heading {
58
+ margin: 0;
59
+ font-family: var(--typography-heading-h5-fontFamily);
60
+ font-size: var(--typography-heading-h5-fontSize);
61
+ font-weight: var(--typography-heading-h5-fontWeight);
62
+ line-height: var(--typography-heading-h5-lineHeight);
63
+ letter-spacing: var(--typography-heading-h5-letterSpacing);
64
+ color: var(--color-text-primary);
65
+ }
66
+
67
+ .link {
68
+ color: inherit;
69
+ text-decoration: none;
70
+ }
71
+
72
+ /* the title's box stretched over the card: one target, the whole card */
73
+ .link::after {
74
+ content: "";
75
+ position: absolute;
76
+ inset: 0;
77
+ /* the card's corner (--card-radius is --shape-radius-2xl), so the focus
78
+ ring follows the card's outline */
79
+ border-radius: var(--shape-radius-2xl);
80
+ }
81
+
82
+ .link:hover {
83
+ text-decoration: underline;
84
+ }
85
+
86
+ /* The ring is drawn on the stretched box below; the title's own outline
87
+ stays transparent rather than none, so forced-colors mode still marks
88
+ the focus. */
89
+ .link:focus-visible {
90
+ outline: var(--border-width-2) solid transparent;
91
+ }
92
+
93
+ /* The focus ring belongs to the card, since the card is the target. */
94
+ .link:focus-visible::after {
95
+ outline: var(--focus-outline-traditional);
96
+ outline-offset: var(--focus-outline-offset);
97
+ }
98
+
99
+ .more {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ gap: var(--spacing-4);
103
+ font-family: var(--typography-link-standalone-fontFamily);
104
+ font-size: var(--typography-link-standalone-fontSize);
105
+ font-weight: var(--typography-link-standalone-fontWeight);
106
+ line-height: var(--typography-link-standalone-lineHeight);
107
+ color: var(--color-text-brand);
108
+ }
109
+
110
+ /* The tablet row: the cover on the left. */
111
+ @media ${unsafeCSS(above("md"))} and ${unsafeCSS(below("lg"))} {
112
+ .card {
113
+ flex-direction: row;
114
+ }
115
+
116
+ .cover {
117
+ width: 40%;
118
+ height: auto;
119
+ }
120
+ }
121
+ `;
@@ -0,0 +1,80 @@
1
+ import { LitElement, html, nothing } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import "../badge/badge.js";
4
+ import "../icons/arrow-icon.js";
5
+ import { postCardCSS } from "./post-card.css.js";
6
+
7
+ /**
8
+ * An article card for a feed of posts: a cover with a category badge laid
9
+ * over it, the title and a "Read more" with an arrow. The homepage's Latest
10
+ * insights; drawn in the foundation Figma file as Post card.
11
+ *
12
+ * One link per card. The title is the link and its box is stretched over the
13
+ * whole card, so a click anywhere follows it; "Read more" is the visual cue
14
+ * and is hidden from a screen reader, which would otherwise hear the same
15
+ * destination twice per card, three cards a row.
16
+ *
17
+ * Not blog-related-articles, which lives in the blog sub-system outside the
18
+ * token system and has no "Read more" and no row form. Between md and lg
19
+ * the card is a row, the cover on the left.
20
+ */
21
+ export class PostCard extends LitElement {
22
+ static properties = {
23
+ href : { type: String },
24
+ heading : { type: String },
25
+ badge : { type: String },
26
+ image : { type: String },
27
+ imageAlt : { type: String, attribute: "image-alt" },
28
+ readMore : { type: String, attribute: "read-more" },
29
+ as : { type: String }
30
+ };
31
+
32
+ static styles = [tokens, postCardCSS];
33
+
34
+ constructor() {
35
+ super();
36
+ this.href = "";
37
+ this.heading = "";
38
+ this.badge = "";
39
+ this.image = "";
40
+ // the cover illustrates the title beside it, so it is decorative by default
41
+ this.imageAlt = "";
42
+ this.readMore = "Read more";
43
+ this.as = "h3";
44
+ }
45
+
46
+ _renderHeading() {
47
+ const text = this.href
48
+ ? html`<a class="link" href="${this.href}">${this.heading}</a>`
49
+ : this.heading;
50
+ switch (this.as) {
51
+ case "h2": return html`<h2 class="heading">${text}</h2>`;
52
+ case "h4": return html`<h4 class="heading">${text}</h4>`;
53
+ case "h5": return html`<h5 class="heading">${text}</h5>`;
54
+ default : return html`<h3 class="heading">${text}</h3>`;
55
+ }
56
+ }
57
+
58
+ render() {
59
+ return html`
60
+ <article class="card">
61
+ <div class="cover">
62
+ <slot name="image">
63
+ ${this.image ? html`<img src="${this.image}" alt="${this.imageAlt}" loading="lazy">` : nothing}
64
+ </slot>
65
+ ${this.badge
66
+ ? html`<bd-badge class="badge" tone="info" variant="shade" size="sm">${this.badge}</bd-badge>`
67
+ : nothing}
68
+ </div>
69
+ <div class="body">
70
+ ${this._renderHeading()}
71
+ ${this.href
72
+ ? html`<span class="more" aria-hidden="true">${this.readMore}<bd-arrow-icon size="sm"></bd-arrow-icon></span>`
73
+ : nothing}
74
+ </div>
75
+ </article>
76
+ `;
77
+ }
78
+ }
79
+
80
+ customElements.define("bd-post-card", PostCard);