@repobit/dex-system-design 2.2.1 → 2.3.0
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.
- package/CHANGELOG.md +15 -0
- package/package.json +12 -2
- package/schemas/component-manifest.json +816 -1
- package/src/assets/images/ai/bento-consumer-art.jpg +0 -0
- package/src/assets/images/ai/bento-enterprise-art.jpg +0 -0
- package/src/assets/images/ai/bento-labs-art.jpg +0 -0
- package/src/assets/images/award-marks/av-comparatives-top-rated.png +0 -0
- package/src/assets/images/award-marks/av-test-top-product.png +0 -0
- package/src/assets/images/award-marks/crn-partner-guide.png +0 -0
- package/src/assets/images/award-marks/forrester.png +0 -0
- package/src/assets/images/award-marks/gartner.png +0 -0
- package/src/assets/images/award-marks/idc.png +0 -0
- package/src/assets/images/award-marks/mitre-engenuity.png +0 -0
- package/src/assets/images/award-marks/omdia.png +0 -0
- package/src/assets/images/award-marks/pcmag-best-of-2026.png +0 -0
- package/src/assets/images/award-marks/pcmag-editors-choice.png +0 -0
- package/src/assets/images/award-marks/pcmag-readers-choice.png +0 -0
- package/src/assets/images/hero/ai-sphere-poster.jpg +0 -0
- package/src/assets/images/insights/post-1.jpg +0 -0
- package/src/assets/images/insights/post-2.jpg +0 -0
- package/src/assets/images/insights/post-3.jpg +0 -0
- package/src/assets/images/partner/ferrari-lockup.png +0 -0
- package/src/assets/images/partner/ferrari-photo.jpg +0 -0
- package/src/assets/images/partners/ferrari.svg +6 -0
- package/src/assets/images/partners/konica-minolta.svg +12 -0
- package/src/assets/images/partners/logmein.svg +6 -0
- package/src/assets/images/partners/netgear.svg +10 -0
- package/src/assets/images/partners/sharp.svg +5 -0
- package/src/assets/images/partners/spurs.svg +33 -0
- package/src/components/accordion/accordion.css.js +1 -5
- package/src/components/audience-card/audience-card.css.js +87 -0
- package/src/components/audience-card/audience-card.js +80 -0
- package/src/components/audience-card/audience-card.stories.js +125 -0
- package/src/components/bento-grid/bento-grid.stories.js +77 -1
- package/src/components/bento-grid/bento-item.css.js +142 -2
- package/src/components/bento-grid/bento-item.js +65 -1
- package/src/components/hero/hero.css.js +260 -0
- package/src/components/hero/hero.js +168 -0
- package/src/components/hero/hero.stories.js +145 -0
- package/src/components/icons/enterprise-icon.js +19 -0
- package/src/components/icons/home-icon.js +19 -0
- package/src/components/icons/icons.js +5 -0
- package/src/components/icons/icons.stories.js +28 -2
- package/src/components/icons/pause-icon.js +20 -0
- package/src/components/icons/play-icon.js +19 -0
- package/src/components/icons/small-business-icon.js +19 -0
- package/src/components/logo-marquee/logo-marquee.css.js +88 -0
- package/src/components/logo-marquee/logo-marquee.js +135 -0
- package/src/components/logo-marquee/logo-marquee.stories.js +125 -0
- package/src/components/motion-art/motion-art.js +42 -0
- package/src/components/motion-art/motion-art.stories.js +98 -0
- package/src/components/partner-banner/partner-banner.css.js +162 -0
- package/src/components/partner-banner/partner-banner.js +68 -0
- package/src/components/partner-banner/partner-banner.stories.js +86 -0
- package/src/components/post-card/post-card.css.js +121 -0
- package/src/components/post-card/post-card.js +80 -0
- package/src/components/post-card/post-card.stories.js +79 -0
- package/src/components/section-header/section-header.css.js +89 -0
- package/src/components/section-header/section-header.js +79 -0
- package/src/components/section-header/section-header.stories.js +129 -0
- package/src/components/stat/stat-highlight.js +75 -0
- package/src/components/stat/stat-tile.js +43 -0
- package/src/components/stat/stat.css.js +111 -0
- package/src/components/stat/stat.js +2 -0
- package/src/components/stat/stat.stories.js +92 -0
- package/src/vendor/motion-art/README.md +27 -0
- package/src/vendor/motion-art/motion-art-element.js +116 -0
|
@@ -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);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import "../grid/grid.js";
|
|
3
|
+
import "./post-card.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title : "Components/Post Card",
|
|
7
|
+
component : "bd-post-card",
|
|
8
|
+
tags : ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded",
|
|
11
|
+
docs : {
|
|
12
|
+
description: {
|
|
13
|
+
component: `
|
|
14
|
+
**PostCard** is an article card for a feed of posts: a cover with a category
|
|
15
|
+
badge over it, the title and a "Read more" with an arrow. The homepage's
|
|
16
|
+
Latest insights; drawn in the foundation Figma file as **Post card**.
|
|
17
|
+
|
|
18
|
+
\`\`\`html
|
|
19
|
+
<bd-post-card href="/blog/…" heading="They Wear Our Faces: …" badge="Consumer Insights" image="/cover.jpg"></bd-post-card>
|
|
20
|
+
\`\`\`
|
|
21
|
+
|
|
22
|
+
### Properties
|
|
23
|
+
|
|
24
|
+
| Property | Type | Default | Description |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| \`href\` | String | \`""\` | The post. Without it the card is not a link |
|
|
27
|
+
| \`heading\` | String | \`""\` | The post's title, at the h5 role |
|
|
28
|
+
| \`badge\` | String | \`""\` | The category, over the cover |
|
|
29
|
+
| \`image\` | String | \`""\` | The cover. Slot \`image\` takes a \`<picture>\` instead |
|
|
30
|
+
| \`image-alt\` | String | \`""\` | The cover's alt; decorative by default |
|
|
31
|
+
| \`read-more\` | String | \`"Read more"\` | The cue's words, in the page's language |
|
|
32
|
+
| \`as\` | String | \`"h3"\` | The title's level in the outline |
|
|
33
|
+
|
|
34
|
+
### One link per card
|
|
35
|
+
|
|
36
|
+
The title is the link and its box is stretched over the card, so a click
|
|
37
|
+
anywhere follows it. "Read more" is the visual cue and is hidden from a screen
|
|
38
|
+
reader, which would otherwise hear the same destination twice per card.
|
|
39
|
+
Between \`md\` and \`lg\` the card is a row, the cover on the left.
|
|
40
|
+
`
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const posts = [
|
|
47
|
+
["Consumer Insights", "They Wear Our Faces: How Scammers Are Using AI to Swindle American Families", "post-1.jpg"],
|
|
48
|
+
["Business Insights", "‘Your Account Has Been Hacked’: Crypto and Bank Phishing Scams Surge Across Australia", "post-2.jpg"],
|
|
49
|
+
["Labs", "WhatsApp Shuts Down 6.8 Million Scam Accounts Linked to Worldwide Fraud Networks", "post-3.jpg"]
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const card = ([badge, heading, image]) => html`
|
|
53
|
+
<bd-post-card href="#" badge="${badge}" heading="${heading}" image="/images/insights/${image}"></bd-post-card>
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const Single = {
|
|
57
|
+
render: () => html`<div style="max-width: 384px;">${card(posts[0])}</div>`
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const feed = () => html`
|
|
61
|
+
<bd-grid cols="1" cols-sm="1" cols-md="1" cols-lg="3" gap="md">${posts.map(card)}</bd-grid>
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export const Feed = {
|
|
65
|
+
name : "Feed of three (desktop)",
|
|
66
|
+
render: feed
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Tablet = {
|
|
70
|
+
name : "Tablet (768px)",
|
|
71
|
+
render : feed,
|
|
72
|
+
parameters: { viewport: { defaultViewport: "tablet" } }
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Mobile = {
|
|
76
|
+
name : "Mobile (375px)",
|
|
77
|
+
render : feed,
|
|
78
|
+
parameters: { viewport: { defaultViewport: "mobile1" } }
|
|
79
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { css, unsafeCSS } from "lit";
|
|
2
|
+
import { above } from "../shared/token-scales.js";
|
|
3
|
+
|
|
4
|
+
/* Mobile first. Everything stacks 16 apart until lg, where "split" sets the
|
|
5
|
+
headline and the lead side by side, 24 apart, under the eyebrow -- the
|
|
6
|
+
steps the Figma Section header draws at 390, 768 and 1440. */
|
|
7
|
+
export const sectionHeaderCSS = css`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.root {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--spacing-16);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* bd-p closes every paragraph with a flow margin inside its own shadow
|
|
19
|
+
root; the gap above is this header's spacing, so the switch turns it off */
|
|
20
|
+
.eyebrow {
|
|
21
|
+
--bd-paragraph-margin-bottom: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.row {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: var(--spacing-16);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.heading {
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.lead[hidden] {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* The lead is body-regular below lg and body-large from lg, the two roles
|
|
39
|
+
the design binds. Set on the wrapper so slotted copy inherits it: the
|
|
40
|
+
page writes the words and this header owns their type. */
|
|
41
|
+
.lead {
|
|
42
|
+
font-family: var(--typography-body-regular-fontFamily);
|
|
43
|
+
font-size: var(--typography-body-regular-fontSize);
|
|
44
|
+
font-weight: var(--typography-body-regular-fontWeight);
|
|
45
|
+
line-height: var(--typography-body-regular-lineHeight);
|
|
46
|
+
letter-spacing: var(--typography-body-regular-letterSpacing);
|
|
47
|
+
color: var(--color-text-primary);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
::slotted(*) {
|
|
51
|
+
margin: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([layout="centered"]) .root {
|
|
55
|
+
align-items: center;
|
|
56
|
+
text-align: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([layout="centered"]) .row {
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: var(--spacing-24);
|
|
62
|
+
/* not the column: the centred measure the design sets on Proven, a
|
|
63
|
+
heading and lead deliberately narrower than the page.
|
|
64
|
+
no token: 588 is a measure, and the dimension scale stops at 64 */
|
|
65
|
+
max-width: 588px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media ${unsafeCSS(above("lg"))} {
|
|
69
|
+
.lead {
|
|
70
|
+
font-size: var(--typography-body-large-fontSize);
|
|
71
|
+
font-weight: var(--typography-body-large-fontWeight);
|
|
72
|
+
line-height: var(--typography-body-large-lineHeight);
|
|
73
|
+
letter-spacing: var(--typography-body-large-letterSpacing);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([layout="split"]) .row {
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
align-items: flex-start;
|
|
79
|
+
gap: var(--spacing-24);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* two equal halves, so the lead starts on the page's centre line */
|
|
83
|
+
:host([layout="split"]) .heading,
|
|
84
|
+
:host([layout="split"]) .lead {
|
|
85
|
+
flex: 1 1 0;
|
|
86
|
+
min-width: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from "lit";
|
|
2
|
+
import { tokens } from "../../tokens/tokens.js";
|
|
3
|
+
import "../heading/heading.js";
|
|
4
|
+
import "../paragraph/paragraph.js";
|
|
5
|
+
import { resolveEnum } from "../shared/prop-vocabulary.js";
|
|
6
|
+
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
7
|
+
import { sectionHeaderCSS } from "./section-header.css.js";
|
|
8
|
+
|
|
9
|
+
const LAYOUTS = ["stacked", "split", "centered"];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The header that opens a page section: an eyebrow, the section's h2 and a
|
|
13
|
+
* lead. The homepage opens five sections with it -- AI, Why trust, Proven,
|
|
14
|
+
* Insights and the solution splitter -- where each module used to spell its
|
|
15
|
+
* own (bd-overview, bd-bento-grid, bd-trust-panel). Drawn in the foundation
|
|
16
|
+
* Figma file as Section header.
|
|
17
|
+
*
|
|
18
|
+
* layout="split" puts the headline and lead side by side from lg; below lg,
|
|
19
|
+
* and in "stacked", everything stacks. layout="centered" centres the three on
|
|
20
|
+
* a narrower measure. Leave eyebrow and lead out for a title-only header.
|
|
21
|
+
*
|
|
22
|
+
* The lead is an attribute for plain copy, or the `lead` slot when it carries
|
|
23
|
+
* a link -- `<bd-link inline underline>`, since colour alone measures 2.91:1
|
|
24
|
+
* against the body text and fails WCAG 1.4.1. Slotted copy takes the lead's
|
|
25
|
+
* role from here, so the page writes words, not typography.
|
|
26
|
+
*/
|
|
27
|
+
export class SectionHeader extends LitElement {
|
|
28
|
+
static properties = {
|
|
29
|
+
eyebrow : { type: String },
|
|
30
|
+
heading : { type: String },
|
|
31
|
+
lead : { type: String },
|
|
32
|
+
as : { type: String },
|
|
33
|
+
layout : { type: String, reflect: true },
|
|
34
|
+
_hasLead: { state: true }
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
static styles = [tokens, ensembleCSS, sectionHeaderCSS];
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
this.eyebrow = "";
|
|
42
|
+
this.heading = "";
|
|
43
|
+
this.lead = "";
|
|
44
|
+
// a page section's title: the outline is the page's, so it can say otherwise
|
|
45
|
+
this.as = "h2";
|
|
46
|
+
this.layout = "stacked";
|
|
47
|
+
this._hasLead = false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
willUpdate(changed) {
|
|
51
|
+
if (changed.has("layout")) {
|
|
52
|
+
this.layout = resolveEnum(this.layout, { allowed: LAYOUTS, fallback: "stacked" });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_onLeadSlot(e) {
|
|
57
|
+
this._hasLead = e.target.assignedNodes({ flatten: true })
|
|
58
|
+
.some(n => n.nodeType === Node.ELEMENT_NODE || n.textContent.trim());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
render() {
|
|
62
|
+
const showLead = this.lead || this._hasLead;
|
|
63
|
+
return html`
|
|
64
|
+
<header class="bd-ensemble root">
|
|
65
|
+
${this.eyebrow
|
|
66
|
+
? html`<bd-p variant="eyebrow" class="eyebrow">${this.eyebrow}</bd-p>`
|
|
67
|
+
: nothing}
|
|
68
|
+
<div class="row">
|
|
69
|
+
<bd-h as="${this.as}" visual-level="h2" class="heading">${this.heading}</bd-h>
|
|
70
|
+
<div class="lead" ?hidden=${!showLead}>
|
|
71
|
+
<slot name="lead" @slotchange=${this._onLeadSlot}>${this.lead}</slot>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</header>
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
customElements.define("bd-section-header", SectionHeader);
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { html, nothing } from "lit";
|
|
2
|
+
import "../link/link.js";
|
|
3
|
+
import "./section-header.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title : "Components/Section Header",
|
|
7
|
+
component : "bd-section-header",
|
|
8
|
+
tags : ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "fullscreen",
|
|
11
|
+
docs : {
|
|
12
|
+
description: {
|
|
13
|
+
component: `
|
|
14
|
+
**SectionHeader** opens a page section: an eyebrow, the section's h2 and a
|
|
15
|
+
lead. The homepage opens five sections with it (AI, Why trust, Proven,
|
|
16
|
+
Insights, the solution splitter). Drawn in the foundation Figma file as
|
|
17
|
+
**Section header**.
|
|
18
|
+
|
|
19
|
+
\`\`\`html
|
|
20
|
+
<bd-section-header layout="split" eyebrow="15+ years of AI-driven security innovation" heading="AI Across Bitdefender">
|
|
21
|
+
<p slot="lead">Bitdefender is <bd-link inline underline href="/ai">applying AI</bd-link> across …</p>
|
|
22
|
+
</bd-section-header>
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
| Layout | Below \`lg\` | \`lg\` and up |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| \`stacked\` (default) | stacked, 16 apart | stacked |
|
|
28
|
+
| \`split\` | stacked | headline and lead side by side, two equal halves, 24 apart |
|
|
29
|
+
| \`centered\` | centred on a 588 measure, lead 24 under the title | the same |
|
|
30
|
+
|
|
31
|
+
### Properties
|
|
32
|
+
|
|
33
|
+
| Property | Type | Default | Description |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| \`eyebrow\` | String | \`""\` | Brand label above the title; left out when empty |
|
|
36
|
+
| \`heading\` | String | \`""\` | The section title, at the page-section role (\`visual-level="h2"\`) |
|
|
37
|
+
| \`lead\` | String | \`""\` | Plain-text lead. For a lead with a link, use the \`lead\` slot |
|
|
38
|
+
| \`as\` | String | \`"h2"\` | The title's level in the outline; it still looks like an h2 |
|
|
39
|
+
| \`layout\` | String | \`"stacked"\` | \`stacked\`, \`split\` or \`centered\` |
|
|
40
|
+
|
|
41
|
+
The lead is \`body-regular\` below \`lg\` and \`body-large\` from \`lg\`. Slotted
|
|
42
|
+
copy takes that role from the header, so a page writes words, not type.
|
|
43
|
+
A link inside it should be \`bd-link inline underline\`: colour alone is
|
|
44
|
+
2.91:1 against the body text and fails WCAG 1.4.1.
|
|
45
|
+
`
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
argTypes: {
|
|
50
|
+
eyebrow: { control: "text" },
|
|
51
|
+
heading: { control: "text" },
|
|
52
|
+
lead : { control: "text" },
|
|
53
|
+
as : { control: "select", options: ["h1", "h2", "h3"] },
|
|
54
|
+
layout : { control: "select", options: ["stacked", "split", "centered"] }
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const render = ({ eyebrow, heading, lead, as, layout, withLink }) => html`
|
|
59
|
+
<bd-section-header
|
|
60
|
+
eyebrow="${eyebrow}"
|
|
61
|
+
heading="${heading}"
|
|
62
|
+
lead="${withLink ? "" : lead}"
|
|
63
|
+
as="${as}"
|
|
64
|
+
layout="${layout}"
|
|
65
|
+
>
|
|
66
|
+
${withLink
|
|
67
|
+
? html`<p slot="lead">
|
|
68
|
+
Bitdefender is <bd-link inline underline href="#">applying AI</bd-link>
|
|
69
|
+
across consumer protection, enterprise security, and threat research
|
|
70
|
+
to help people and organizations stay ahead of evolving threats.
|
|
71
|
+
</p>`
|
|
72
|
+
: nothing}
|
|
73
|
+
</bd-section-header>
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
const split = {
|
|
77
|
+
eyebrow : "15+ years of AI-driven security innovation",
|
|
78
|
+
heading : "AI Across Bitdefender",
|
|
79
|
+
lead : "",
|
|
80
|
+
as : "h2",
|
|
81
|
+
layout : "split",
|
|
82
|
+
withLink: true
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Split = {
|
|
86
|
+
name: "Split (AI, Why trust)",
|
|
87
|
+
args: { ...split },
|
|
88
|
+
render
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const Centered = {
|
|
92
|
+
name: "Centered (Proven)",
|
|
93
|
+
args: {
|
|
94
|
+
eyebrow : "",
|
|
95
|
+
heading : "Proven by Independent Testing and Industry Analysts",
|
|
96
|
+
lead : "Independent analysts and testing organizations consistently recognize Bitdefender for its security performance, innovation, and trusted protection.",
|
|
97
|
+
as : "h2",
|
|
98
|
+
layout : "centered",
|
|
99
|
+
withLink: false
|
|
100
|
+
},
|
|
101
|
+
render
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const TitleOnly = {
|
|
105
|
+
name: "Title only (Insights)",
|
|
106
|
+
args: {
|
|
107
|
+
eyebrow : "",
|
|
108
|
+
heading : "Latest cybersecurity insights",
|
|
109
|
+
lead : "",
|
|
110
|
+
as : "h2",
|
|
111
|
+
layout : "stacked",
|
|
112
|
+
withLink: false
|
|
113
|
+
},
|
|
114
|
+
render
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const Tablet = {
|
|
118
|
+
name : "Tablet (768px)",
|
|
119
|
+
args : { ...split },
|
|
120
|
+
render,
|
|
121
|
+
parameters: { viewport: { defaultViewport: "tablet" } }
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const Mobile = {
|
|
125
|
+
name : "Mobile (375px)",
|
|
126
|
+
args : { ...split },
|
|
127
|
+
render,
|
|
128
|
+
parameters: { viewport: { defaultViewport: "mobile1" } }
|
|
129
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from "lit";
|
|
2
|
+
import { tokens } from "../../tokens/tokens.js";
|
|
3
|
+
import { statHighlightCSS } from "./stat.css.js";
|
|
4
|
+
|
|
5
|
+
const DIGITS = "0123456789";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The one oversized figure a section leads with -- the Why-trust "$1.5B+".
|
|
9
|
+
* The digits roll up into place the first time the figure comes into view;
|
|
10
|
+
* everything that is not a digit ($, ., B, +) stands still.
|
|
11
|
+
*
|
|
12
|
+
* Split into one box per character so each digit can roll, which leaves a
|
|
13
|
+
* screen reader nothing sensible to read -- so the visible characters are
|
|
14
|
+
* hidden from it and `label` is the figure's full name ("$1.5 billion plus").
|
|
15
|
+
* Without a label the value itself is used.
|
|
16
|
+
*
|
|
17
|
+
* Under prefers-reduced-motion the digits are already in place; nothing moves.
|
|
18
|
+
*/
|
|
19
|
+
export class StatHighlight extends LitElement {
|
|
20
|
+
static properties = {
|
|
21
|
+
value : { type: String },
|
|
22
|
+
label : { type: String },
|
|
23
|
+
_rolled : { state: true }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
static styles = [tokens, statHighlightCSS];
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.value = "";
|
|
31
|
+
this.label = "";
|
|
32
|
+
this._rolled = false;
|
|
33
|
+
this._observer = null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
firstUpdated() {
|
|
37
|
+
const still = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
38
|
+
if (still || !("IntersectionObserver" in window)) {
|
|
39
|
+
this._rolled = true;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this._observer = new IntersectionObserver(entries => {
|
|
43
|
+
if (entries.some(e => e.isIntersecting)) {
|
|
44
|
+
this._rolled = true;
|
|
45
|
+
this._observer.disconnect();
|
|
46
|
+
}
|
|
47
|
+
}, { threshold: 0.5 });
|
|
48
|
+
this._observer.observe(this);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
disconnectedCallback() {
|
|
52
|
+
super.disconnectedCallback();
|
|
53
|
+
this._observer?.disconnect();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_renderChar(ch, i) {
|
|
57
|
+
const digit = DIGITS.indexOf(ch);
|
|
58
|
+
if (digit < 0) return html`<span class="char">${ch}</span>`;
|
|
59
|
+
// each digit rolls a little later than the one before it
|
|
60
|
+
return html`<span class="char digit" style="--bd-stat-digit: ${this._rolled ? digit : 0}; --bd-stat-order: ${i};">
|
|
61
|
+
<span class="reel">${[...DIGITS].map(d => html`<span>${d}</span>`)}</span>
|
|
62
|
+
</span>`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
render() {
|
|
66
|
+
if (!this.value) return nothing;
|
|
67
|
+
return html`
|
|
68
|
+
<p class="highlight" role="img" aria-label="${this.label || this.value}">
|
|
69
|
+
<span class="chars" aria-hidden="true">${[...this.value].map((ch, i) => this._renderChar(ch, i))}</span>
|
|
70
|
+
</p>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
customElements.define("bd-stat-highlight", StatHighlight);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from "lit";
|
|
2
|
+
import { tokens } from "../../tokens/tokens.js";
|
|
3
|
+
import { statTileCSS } from "./stat.css.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* One figure from the Why-trust stat grid: a display value over a short
|
|
7
|
+
* caption, on surface/info. The caption is pinned to the tile's foot so a row
|
|
8
|
+
* of tiles lines its captions up, whatever each value's length. Drawn in the
|
|
9
|
+
* foundation Figma file as Stat tile.
|
|
10
|
+
*
|
|
11
|
+
* The value and caption are read as one statement -- "580+ patents filed" --
|
|
12
|
+
* so the tile is a group named by both, and `label` can spell the value out
|
|
13
|
+
* where its short form reads badly aloud ("50 billion plus").
|
|
14
|
+
*/
|
|
15
|
+
export class StatTile extends LitElement {
|
|
16
|
+
static properties = {
|
|
17
|
+
value : { type: String },
|
|
18
|
+
caption: { type: String },
|
|
19
|
+
label : { type: String }
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
static styles = [tokens, statTileCSS];
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.value = "";
|
|
27
|
+
this.caption = "";
|
|
28
|
+
this.label = "";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
return html`
|
|
33
|
+
<div class="tile" role="group" aria-label="${this.label ? `${this.label} ${this.caption}`.trim() : nothing}">
|
|
34
|
+
<p class="value" aria-hidden="${this.label ? "true" : nothing}">${this.value}</p>
|
|
35
|
+
${this.caption
|
|
36
|
+
? html`<p class="caption" aria-hidden="${this.label ? "true" : nothing}">${this.caption}</p>`
|
|
37
|
+
: nothing}
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
customElements.define("bd-stat-tile", StatTile);
|