@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,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);
@@ -0,0 +1,111 @@
1
+ import { css } from "lit";
2
+
3
+ /* A tile on surface/info: the value at display-md, the caption at body-small,
4
+ pinned to the foot. On the info tint the value's text-primary measures
5
+ 16.65:1 and the caption's the same. The tile takes the card corner one step
6
+ up, 3xl, as the design draws it; it is not a card -- it holds no controls
7
+ and no heading, only a figure. */
8
+ export const statTileCSS = css`
9
+ /* the full cell, both ways, so a row of tiles is one height and one width
10
+ whatever each one holds */
11
+ :host {
12
+ display: block;
13
+ width: 100%;
14
+ height: 100%;
15
+ }
16
+
17
+ .tile {
18
+ box-sizing: border-box;
19
+ height: 100%;
20
+ display: flex;
21
+ flex-direction: column;
22
+ justify-content: space-between;
23
+ gap: var(--spacing-48);
24
+ padding: var(--spacing-24);
25
+ text-align: start;
26
+ background: var(--color-surface-info);
27
+ border-radius: var(--shape-radius-3xl);
28
+ }
29
+
30
+ .value,
31
+ .caption {
32
+ margin: 0;
33
+ color: var(--color-text-primary);
34
+ }
35
+
36
+ .value {
37
+ font-family: var(--typography-display-md-fontFamily);
38
+ font-size: var(--typography-display-md-fontSize);
39
+ font-weight: var(--typography-display-md-fontWeight);
40
+ line-height: var(--typography-display-md-lineHeight);
41
+ letter-spacing: var(--typography-display-md-letterSpacing);
42
+ font-variant-numeric: tabular-nums;
43
+ }
44
+
45
+ .caption {
46
+ font-family: var(--typography-body-small-fontFamily);
47
+ font-size: var(--typography-body-small-fontSize);
48
+ font-weight: var(--typography-body-small-fontWeight);
49
+ line-height: var(--typography-body-small-lineHeight);
50
+ letter-spacing: var(--typography-body-small-letterSpacing);
51
+ }
52
+ `;
53
+
54
+ /* The leading figure. Its size is the one value here off the type scale: the
55
+ display family stops at 3xl (128) and the design draws this at 180, as a
56
+ deliberate one-off rather than a role, so it is spelled once, here.
57
+ Each digit is a reel of 0-9 in a one-line window, moved up by its own
58
+ value. */
59
+ export const statHighlightCSS = css`
60
+ :host {
61
+ display: block;
62
+ }
63
+
64
+ .highlight {
65
+ margin: 0;
66
+ text-align: start;
67
+ color: var(--color-text-primary);
68
+ font-family: var(--typography-display-3xl-fontFamily);
69
+ font-weight: var(--typography-display-3xl-fontWeight);
70
+ letter-spacing: var(--typography-display-3xl-letterSpacing);
71
+ /* no token: the one-off 180 the design sets, falling to 80 on a phone
72
+ through the viewport; the display scale stops at 128 */
73
+ font-size: clamp(5rem, 12.5vw, 11.25rem);
74
+ /* no token: a reel of digits needs a line box exactly one digit tall, so
75
+ the window and the steps the reel moves by are the same length */
76
+ line-height: 1;
77
+ font-variant-numeric: tabular-nums;
78
+ }
79
+
80
+ .chars {
81
+ display: inline-flex;
82
+ align-items: flex-end;
83
+ }
84
+
85
+ .char {
86
+ display: inline-block;
87
+ height: 1em;
88
+ }
89
+
90
+ .digit {
91
+ overflow: hidden;
92
+ }
93
+
94
+ .reel {
95
+ display: flex;
96
+ flex-direction: column;
97
+ transform: translateY(calc(var(--bd-stat-digit) * -1em));
98
+ transition: transform var(--transition-duration-slower) var(--transition-easing-smooth);
99
+ transition-delay: calc(var(--bd-stat-order) * var(--transition-duration-fast));
100
+ }
101
+
102
+ .reel > span {
103
+ height: 1em;
104
+ }
105
+
106
+ @media (prefers-reduced-motion: reduce) {
107
+ .reel {
108
+ transition: none;
109
+ }
110
+ }
111
+ `;
@@ -0,0 +1,2 @@
1
+ import "./stat-highlight.js";
2
+ import "./stat-tile.js";