@repobit/dex-system-design 2.4.0 → 2.5.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.5.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@2.5.0...@repobit/dex-system-design@2.5.1) (2026-10-28)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **DEX-29010:** give bd-bento-item the listitem role
11
+
12
+
13
+ ## [2.5.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@2.4.0...@repobit/dex-system-design@2.5.0) (2026-10-28)
14
+
15
+ ### Features
16
+
17
+ * **DEX-29014:** bd-section, the page's vertical rhythm
18
+
19
+ ### Bug Fixes
20
+
21
+ * **DEX-29014:** keep brand bento cards one per row until lg
22
+ * **DEX-29014:** set the stat highlight in Regular, as Figma draws it
23
+
24
+
6
25
  ## [2.4.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@2.3.2...@repobit/dex-system-design@2.4.0) (2026-10-27)
7
26
 
8
27
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobit/dex-system-design",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "description": "Design system based on Web Components.",
5
5
  "author": "Iordache Matei Cezar <miordache@bitdefender.com>",
6
6
  "homepage": "https://github.com/bitdefender/dex-core#readme",
@@ -79,6 +79,7 @@
79
79
  "./radio": "./src/components/radio/radio.js",
80
80
  "./review": "./src/components/review/review.js",
81
81
  "./review-grid": "./src/components/review/review-grid.js",
82
+ "./section": "./src/components/section/section.js",
82
83
  "./section-header": "./src/components/section-header/section-header.js",
83
84
  "./skeleton": "./src/components/skeleton/skeleton.js",
84
85
  "./spinner": "./src/components/spinner/spinner.js",
@@ -192,5 +193,5 @@
192
193
  "volta": {
193
194
  "node": "24.22.1"
194
195
  },
195
- "gitHead": "2b38c249e4240fc489fb4a1a9338cd04a675c08f"
196
+ "gitHead": "c27c30dc4d3a807f5c4c0288f041ab116be8777c"
196
197
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifestVersion": 1,
3
3
  "package": "@repobit/dex-system-design",
4
- "packageVersion": "2.4.0",
4
+ "packageVersion": "2.5.1",
5
5
  "generatedFrom": [
6
6
  "package.json exports",
7
7
  "Lit static properties",
@@ -4091,6 +4091,30 @@
4091
4091
  }
4092
4092
  ]
4093
4093
  },
4094
+ {
4095
+ "tag": "bd-section",
4096
+ "packageExport": "./section",
4097
+ "module": "./src/components/section/section.js",
4098
+ "role": "layout",
4099
+ "contentModel": "children",
4100
+ "props": [
4101
+ {
4102
+ "name": "noPaddingTop",
4103
+ "type": "boolean",
4104
+ "attributeName": "no-padding-top",
4105
+ "description": "Turns the top inset off, for a block that meets what is above it (the hero under the site menu)."
4106
+ },
4107
+ {
4108
+ "name": "noPaddingBottom",
4109
+ "type": "boolean",
4110
+ "attributeName": "no-padding-bottom",
4111
+ "description": "Turns the bottom inset off, for a block that meets what is below it."
4112
+ }
4113
+ ],
4114
+ "notes": [
4115
+ "The page's vertical rhythm: pads its top and bottom by the section inset (24 below md, 32 from md) and stacks its children twice that apart. No width, no inline padding, no ground: the children bring their own page column. A full-bleed band goes in a section of its own. An edge's inset is on or off, never another size."
4116
+ ]
4117
+ },
4094
4118
  {
4095
4119
  "tag": "bd-section-header",
4096
4120
  "packageExport": "./section-header",
@@ -4,6 +4,7 @@ import "../heading/heading.js";
4
4
  import "../paragraph/paragraph.js";
5
5
  import bentoGridCSS from "./bento-grid.css.js";
6
6
  import { ensembleCSS } from "../shared/ensemble.css.js";
7
+ import { above } from "../shared/token-scales.js";
7
8
  import "./bento-item.js";
8
9
 
9
10
  const BREAKPOINT_WIDTHS = { xl: 1280, lg: 960, md: 640 };
@@ -178,10 +179,13 @@ class BentoGrid extends LitElement {
178
179
  stacked cards match whatever their copy runs to. Only when every card is
179
180
  brand-toned -- the default cards are content-sized tiles, and evening
180
181
  those out would pad the short ones with empty space. */
181
- _applyRowHeight() {
182
+ get _isBrandSet() {
182
183
  const items = this._items;
183
- const uniform = items.length > 1 && items.every((el) => el.getAttribute("tone") === "brand");
184
- if (uniform) this.style.setProperty("--bd-bento-row-height", "1fr");
184
+ return items.length > 1 && items.every((el) => el.getAttribute("tone") === "brand");
185
+ }
186
+
187
+ _applyRowHeight() {
188
+ if (this._isBrandSet) this.style.setProperty("--bd-bento-row-height", "1fr");
185
189
  else this.style.removeProperty("--bd-bento-row-height");
186
190
  }
187
191
 
@@ -190,6 +194,20 @@ class BentoGrid extends LitElement {
190
194
  this.style.setProperty("--bd-bento-total-units", String(TOTAL_UNITS));
191
195
  this._applyRowHeight();
192
196
 
197
+ /* Brand cards keep the tablet layout, one full row each, until the
198
+ viewport reaches lg, like every other section on the page: from md to
199
+ lg bento-item.css.js draws each one as a full-width row, and its paired
200
+ art only starts at lg. A container-width pairing put two half cards
201
+ side by side at 960-991px, where the 300 copy column ran under the art. */
202
+ if (this._isBrandSet && !window.matchMedia?.(above("lg")).matches) {
203
+ this._columns = 1;
204
+ this._gap = DEFAULT_GAP.sm;
205
+ this.style.setProperty("--bd-bento-gap", `${this._gap}px`);
206
+ this.style.setProperty("--bd-bento-total-units", "1");
207
+ this._items.forEach((item) => item.style.setProperty("--bd-bento-span", "1"));
208
+ return;
209
+ }
210
+
193
211
  if (this.variant === "equal") {
194
212
  const { columns, gap } = resolveEqualColumns(width, this.equalColumns, this.minCardWidth);
195
213
  this._columns = columns;
@@ -42,6 +42,8 @@ class BentoItem extends LitElement {
42
42
 
43
43
  connectedCallback() {
44
44
  super.connectedCallback();
45
+ // The grid's track is a role="list"; each card is one of its items.
46
+ if (!this.hasAttribute("role")) this.setAttribute("role", "listitem");
45
47
  this._phone?.addEventListener("change", this._onPhone);
46
48
  }
47
49
 
@@ -0,0 +1,38 @@
1
+ import { css, unsafeCSS } from "lit";
2
+ import { above } from "../shared/token-scales.js";
3
+
4
+ /* One distance, and twice it. Every section of the Figma homepage frames sits
5
+ the same inset in from its top and its bottom -- 24 on the 390 phone frame,
6
+ 32 on the 768 tablet and the 1440 desktop -- so two sections stand twice
7
+ that apart, 48 and 64. The blocks inside a section take the same doubled
8
+ gap, so two blocks of one section sit as far apart as two sections do, and
9
+ one rhythm runs down the whole page.
10
+
11
+ Vertical only. The page column is each module's own (ensembleCSS), so a
12
+ section never sets a width, an inline padding or a ground. */
13
+ export default css`
14
+ :host {
15
+ --bd-section-padding: var(--spacing-24);
16
+
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: calc(var(--bd-section-padding) * 2);
20
+ padding-block: var(--bd-section-padding);
21
+ }
22
+
23
+ @media ${unsafeCSS(above("md"))} {
24
+ :host {
25
+ --bd-section-padding: var(--spacing-32);
26
+ }
27
+ }
28
+
29
+ /* An edge is on or off, never another size: the block meets its neighbour
30
+ there, and keeps the inset everywhere else. */
31
+ :host([no-padding-top]) {
32
+ padding-block-start: 0;
33
+ }
34
+
35
+ :host([no-padding-bottom]) {
36
+ padding-block-end: 0;
37
+ }
38
+ `;
@@ -0,0 +1,43 @@
1
+ import { LitElement, html } from "lit";
2
+ // Installs the design tokens into document scope; see src/tokens/tokens.js
3
+ import "../../tokens/tokens.js";
4
+ import sectionCSS from "./section.css.js";
5
+
6
+ /**
7
+ * A page section: the vertical rhythm a page is built on, and nothing else.
8
+ * It pads its top and bottom by the section inset (24 on a phone, 32 from md)
9
+ * and stacks its blocks twice that apart, so every section and every block on
10
+ * a page sits on one distance. The inset is not a choice a page makes: it can
11
+ * only be on or off at either edge, never a different size, so the rhythm
12
+ * cannot drift.
13
+ *
14
+ * `no-padding-top` and `no-padding-bottom` turn one edge off, for a block that
15
+ * must meet what is above or below it -- the hero, whose band starts under the
16
+ * site menu, takes `no-padding-top`. The block keeps the rest of the rhythm:
17
+ * the hero still stands twice the inset clear of the section after it.
18
+ *
19
+ * It sets no width and no ground. The blocks inside bring their own page
20
+ * column; a full-bleed band is a block like any other, so it stands twice the
21
+ * inset clear of its neighbours. It carries no semantics either -- a page that
22
+ * wants a landmark puts one inside.
23
+ */
24
+ class BdSection extends LitElement {
25
+ static properties = {
26
+ noPaddingTop : { type: Boolean, reflect: true, attribute: "no-padding-top" },
27
+ noPaddingBottom: { type: Boolean, reflect: true, attribute: "no-padding-bottom" }
28
+ };
29
+
30
+ static styles = [sectionCSS];
31
+
32
+ constructor() {
33
+ super();
34
+ this.noPaddingTop = false;
35
+ this.noPaddingBottom = false;
36
+ }
37
+
38
+ render() {
39
+ return html`<slot></slot>`;
40
+ }
41
+ }
42
+
43
+ customElements.define("bd-section", BdSection);
@@ -0,0 +1,246 @@
1
+ import { html } from "lit";
2
+ import "./section.js";
3
+ import "../section-header/section-header.js";
4
+ import "../grid/grid.js";
5
+ import "../link/link.js";
6
+ import "../paragraph/paragraph.js";
7
+ import "../button/button.js";
8
+ import { Homepage as HeroHomepage } from "../hero/hero.stories.js";
9
+ import { Partners, Awards } from "../logo-marquee/logo-marquee.stories.js";
10
+ import { BrandAICards } from "../bento-grid/bento-grid.stories.js";
11
+ import { WhyTrustRow } from "../stat/stat.stories.js";
12
+ import { Default as AwardsSpotlight } from "../awards/awards-spotlight.stories.js";
13
+ import { Ferrari } from "../partner-banner/partner-banner.stories.js";
14
+ import { Feed } from "../post-card/post-card.stories.js";
15
+
16
+ export default {
17
+ title : "Layout/Section",
18
+ component : "bd-section",
19
+ tags : ["autodocs"],
20
+ parameters: {
21
+ layout: "fullscreen",
22
+ docs : {
23
+ description: {
24
+ component: `
25
+ The vertical rhythm of a page. Every section of the Figma homepage frames sits
26
+ the same inset in from its top and its bottom -- **24** on the 390 phone frame,
27
+ **32** on the 768 tablet and the 1440 desktop -- so two sections stand twice
28
+ that apart, **48** and **64**. \`bd-section\` is that inset, and it stacks the
29
+ blocks inside it twice the inset apart too, so a block sits as far from the
30
+ next block as a section sits from the next section.
31
+
32
+ \`\`\`html
33
+ <bd-section>
34
+ <bd-section-header eyebrow="…" heading="…" layout="split"></bd-section-header>
35
+ <bd-bento-grid>…</bd-bento-grid>
36
+ </bd-section>
37
+ \`\`\`
38
+
39
+ It sets **no width, no inline padding and no ground**: each block brings its
40
+ own page column, and a full-bleed band (the partner banner) is a block of its
41
+ own section, which is what puts it twice the inset clear of its neighbours, as
42
+ the frames draw it.
43
+
44
+ The inset is one distance everywhere, and a page can only turn it off at an
45
+ edge, never make it another size:
46
+
47
+ | Attribute | Effect |
48
+ |---|---|
49
+ | \`no-padding-top\` | No inset at the top: the block meets what is above it (the hero, under the site menu) |
50
+ | \`no-padding-bottom\` | No inset at the bottom: the block meets what is below it |
51
+
52
+ Turn on **guides** (or the floating button on the page) to tint the section's
53
+ padding and the gaps between its blocks.
54
+ `
55
+ }
56
+ }
57
+ },
58
+ argTypes: {
59
+ guides: { control: "boolean", description: "Tint each section's padding and the gaps between its blocks" }
60
+ },
61
+ args: { guides: false }
62
+ };
63
+
64
+ /* The guides tint the section (its padding and the gaps show through) and
65
+ put the page ground back under each block, so only the rhythm is coloured.
66
+ Story chrome, not the component's: bd-section draws nothing. */
67
+ const guidesStyle = html`
68
+ <style>
69
+ .guides bd-section {
70
+ background: var(--color-surface-info);
71
+ outline: var(--border-width-1) dashed var(--color-border-brand);
72
+ outline-offset: calc(-1 * var(--border-width-1));
73
+ }
74
+
75
+ .guides bd-section > * {
76
+ background: var(--color-surface-default);
77
+ }
78
+
79
+ .guides-toggle {
80
+ position: fixed;
81
+ z-index: var(--z-overlay);
82
+ inset-block-end: var(--spacing-16);
83
+ inset-inline-end: var(--spacing-16);
84
+ padding: var(--spacing-8) var(--spacing-16);
85
+ font-family: var(--typography-label-small-fontFamily);
86
+ font-size: var(--typography-label-small-fontSize);
87
+ font-weight: var(--typography-label-small-fontWeight);
88
+ line-height: var(--typography-label-small-lineHeight);
89
+ color: var(--color-text-primary);
90
+ background: var(--color-surface-default);
91
+ border: var(--border-width-1) solid var(--color-border-brand);
92
+ border-radius: var(--radius-full);
93
+ box-shadow: var(--shadow-md);
94
+ cursor: pointer;
95
+ }
96
+
97
+ .guides-toggle[aria-pressed="true"] {
98
+ color: var(--color-brand-on-fill);
99
+ background: var(--color-surface-brand);
100
+ }
101
+ </style>
102
+ `;
103
+
104
+ /* The button flips the tint in place, so the spacing and the page itself can
105
+ be compared without reloading; the guides arg is only where it starts. */
106
+ const toggleGuides = (event) => {
107
+ const button = event.currentTarget;
108
+ const on = button.getAttribute("aria-pressed") !== "true";
109
+ button.setAttribute("aria-pressed", String(on));
110
+ button.previousElementSibling.classList.toggle("guides", on);
111
+ };
112
+
113
+ const page = (guides, content) => html`
114
+ ${guidesStyle}
115
+ <div class="${guides ? "guides" : ""}">${content}</div>
116
+ <button type="button" class="guides-toggle" aria-pressed="${String(Boolean(guides))}" @click=${toggleGuides}>
117
+ Spacing guides
118
+ </button>
119
+ `;
120
+
121
+ const block = (label) => html`
122
+ <div class="bd-container">
123
+ <div style="padding: var(--spacing-24); border: var(--border-width-1) solid var(--color-border-container); border-radius: var(--card-radius);">
124
+ <bd-p variant="small">${label}</bd-p>
125
+ </div>
126
+ </div>
127
+ `;
128
+
129
+ export const Rhythm = {
130
+ name : "Rhythm (three sections)",
131
+ render: ({ guides }) => page(guides, html`
132
+ <bd-section>${block("Section 1, block 1")}${block("Section 1, block 2")}</bd-section>
133
+ <bd-section>${block("Section 2, one block")}</bd-section>
134
+ <bd-section>${block("Section 3, block 1")}${block("Section 3, block 2")}${block("Section 3, block 3")}</bd-section>
135
+ `),
136
+ args : { guides: true },
137
+ parameters: {
138
+ docs: {
139
+ description: {
140
+ story: "Placeholder blocks, guides on: the padding at each section's top and bottom, and the gap between blocks twice it. Two sections meet at padding + padding, the same distance as the gap inside one."
141
+ }
142
+ }
143
+ }
144
+ };
145
+
146
+ export const NoPadding = {
147
+ name : "No padding at an edge",
148
+ render: ({ guides }) => page(guides, html`
149
+ <bd-section no-padding-top>${block("no-padding-top: meets the page's top edge")}</bd-section>
150
+ <bd-section>${block("A section with both insets")}</bd-section>
151
+ <bd-section no-padding-bottom>${block("no-padding-bottom: meets the section below")}</bd-section>
152
+ <bd-section no-padding-top>${block("no-padding-top: meets the section above")}</bd-section>
153
+ `),
154
+ args : { guides: true },
155
+ parameters: {
156
+ docs: {
157
+ description: {
158
+ story: "Each attribute turns one edge's inset off and leaves the rest of the rhythm alone. The last two sections meet with no inset between them, the way two bands that belong together would."
159
+ }
160
+ }
161
+ }
162
+ };
163
+
164
+ const splitterColumns = [
165
+ ["For Individuals", "AI-Powered security, privacy, and scam protection for everyday digital life."],
166
+ ["For Small Business", "Effective protection for users, devices, and business operations."],
167
+ ["For Enterprise", "Advanced cybersecurity for prevention, detection, and response."],
168
+ ["For MSPs", "Security built for managed service providers and the customers they protect."]
169
+ ];
170
+
171
+ /* The homepage as the site assembles it, block for block, each one the
172
+ component's own story, every one in a section. The hero's band starts
173
+ under the site menu, so its section turns the top inset off; its bottom
174
+ inset stays, so the cards stand twice the inset clear of the marquee. */
175
+ const homepage = ({ guides }) => page(guides, html`
176
+ <bd-section no-padding-top>${HeroHomepage.render(HeroHomepage.args)}</bd-section>
177
+
178
+ <bd-section>${Partners.render(Partners.args)}</bd-section>
179
+
180
+ <bd-section>
181
+ <bd-section-header layout="split" as="h2"
182
+ eyebrow="15+ years of AI-driven security innovation"
183
+ heading="AI Across Bitdefender"
184
+ lead="Bitdefender is applying AI across consumer protection, enterprise security, and threat research to help people and organizations stay ahead of evolving threats."></bd-section-header>
185
+ ${BrandAICards.render()}
186
+ </bd-section>
187
+
188
+ <bd-section>
189
+ <bd-section-header layout="split" as="h2"
190
+ eyebrow="25 years of Cybersecurity Excellence"
191
+ heading="Why Millions Trust Bitdefender"
192
+ lead="Bitdefender protects millions across 170+ countries, combining deep security expertise with cutting-edge AI innovation and a commitment to fighting cybercrime alongside global law enforcement."></bd-section-header>
193
+ <div class="bd-container">${WhyTrustRow.render()}</div>
194
+ </bd-section>
195
+
196
+ <bd-section>
197
+ <bd-section-header layout="centered" as="h2"
198
+ heading="Proven by Independent Testing and Industry Analysts"
199
+ lead="Independent analysts and testing organizations consistently recognize Bitdefender for its security performance, innovation, and trusted protection."></bd-section-header>
200
+ ${AwardsSpotlight.render(AwardsSpotlight.args)}
201
+ ${Awards.render(Awards.args)}
202
+ </bd-section>
203
+
204
+ <bd-section>${Ferrari.render()}</bd-section>
205
+
206
+ <bd-section>
207
+ <bd-section-header layout="split" as="h2" heading="Latest cybersecurity insights"></bd-section-header>
208
+ <div class="bd-container">${Feed.render()}</div>
209
+ </bd-section>
210
+
211
+ <bd-section>
212
+ <bd-section-header layout="split" as="h2"
213
+ heading="Find the Bitdefender solution built for you"
214
+ lead="Whether you are protecting personal devices, running a growing business, or securing a complex organization, Bitdefender has solutions designed for your environment."></bd-section-header>
215
+ <div class="bd-container">
216
+ <bd-grid cols="1" cols-sm="1" cols-md="2" cols-lg="4" gap="md">
217
+ ${splitterColumns.map(([title, body]) => html`
218
+ <div>
219
+ <bd-link href="#" variant="bold" arrow>${title}</bd-link>
220
+ <bd-p variant="small">${body}</bd-p>
221
+ </div>
222
+ `)}
223
+ </bd-grid>
224
+ </div>
225
+ </bd-section>
226
+ `);
227
+
228
+ const homepageDocs = "The homepage from the existing components, every block after the hero in a `bd-section`. Turn on guides to see the one distance at work: the same padding at the top and bottom of every section, twice it between blocks and between sections.";
229
+
230
+ export const Homepage = {
231
+ name : "Homepage (desktop)",
232
+ render : homepage,
233
+ parameters: { docs: { description: { story: homepageDocs } } }
234
+ };
235
+
236
+ export const HomepageTablet = {
237
+ name : "Homepage (tablet 768)",
238
+ render : homepage,
239
+ parameters: { viewport: { defaultViewport: "tablet" } }
240
+ };
241
+
242
+ export const HomepageMobile = {
243
+ name : "Homepage (mobile)",
244
+ render : homepage,
245
+ parameters: { viewport: { defaultViewport: "mobile1" } }
246
+ };
@@ -84,7 +84,10 @@ export const statHighlightCSS = css`
84
84
  text-align: start;
85
85
  color: var(--color-text-primary);
86
86
  font-family: var(--typography-display-3xl-fontFamily);
87
- font-weight: var(--typography-display-3xl-fontWeight);
87
+ /* no role: every display role is bold, and the design sets this one-off
88
+ figure in IBM Plex Sans Text (450), a cut the system does not ship;
89
+ Regular is the nearest it does */
90
+ font-weight: var(--typography-fontWeight-normal);
88
91
  letter-spacing: var(--typography-display-3xl-letterSpacing);
89
92
  /* no token: the one-off 180 the design sets, falling to 80 on a phone
90
93
  through the viewport; the display scale stops at 128 */