@repobit/dex-system-design 3.0.0 → 3.0.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,13 @@
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
+ ## [3.0.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@3.0.0...@repobit/dex-system-design@3.0.1) (2026-10-30)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **DEX-29010:** bd-logo-marquee measures a resize on the next frame
11
+
12
+
6
13
  ## [3.0.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@2.7.1...@repobit/dex-system-design@3.0.0) (2026-10-30)
7
14
 
8
15
  ### ⚠ BREAKING CHANGES
@@ -31,6 +31,7 @@ export declare class LogoMarquee extends LitElement {
31
31
  playLabel: string;
32
32
  _copies: number;
33
33
  _resize: ResizeObserver;
34
+ _frame: number;
34
35
  static styles: import("lit").CSSResult[];
35
36
  constructor();
36
37
  connectedCallback(): void;
@@ -36,6 +36,12 @@ import { logoMarqueeCSS } from "./logo-marquee.css.js";
36
36
  */
37
37
  let LogoMarquee = class LogoMarquee extends LitElement {
38
38
  static { this.styles = [tokens, ensembleCSS, logoMarqueeCSS]; }
39
+ /* A resize is measured on the next frame, not inside the observer's
40
+ delivery. A new copy count re-renders the track, and in WebKit that
41
+ resizes a box this observer watches while the delivery is still running:
42
+ Safari reported "ResizeObserver loop completed with undelivered
43
+ notifications" on every homepage load. Measured a frame later, the new
44
+ size is an ordinary delivery of its own. */
39
45
  constructor() {
40
46
  super();
41
47
  this.label = "";
@@ -48,7 +54,11 @@ let LogoMarquee = class LogoMarquee extends LitElement {
48
54
  this.playLabel = "Play the moving logos";
49
55
  // copies of the set after the original; at least one, or there is no loop
50
56
  this._copies = 1;
51
- this._resize = new ResizeObserver(() => this._measure());
57
+ this._frame = 0;
58
+ this._resize = new ResizeObserver(() => {
59
+ cancelAnimationFrame(this._frame);
60
+ this._frame = requestAnimationFrame(() => this._measure());
61
+ });
52
62
  }
53
63
  connectedCallback() {
54
64
  super.connectedCallback();
@@ -58,6 +68,7 @@ let LogoMarquee = class LogoMarquee extends LitElement {
58
68
  disconnectedCallback() {
59
69
  super.disconnectedCallback();
60
70
  this._resize.disconnect();
71
+ cancelAnimationFrame(this._frame);
61
72
  }
62
73
  firstUpdated() {
63
74
  this._observe();
@@ -1 +1 @@
1
- {"version":3,"file":"logo-marquee.js","sourceRoot":"","sources":["../../../../src/components/logo-marquee/logo-marquee.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;aAqBlC,WAAM,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,AAAxC,CAAyC;IAEtD;QACE,KAAK,EAAE,CAAC;QAtBV,UAAK,GAAG,EAAE,CAAC;QACX,yEAAyE;QAEzE,aAAQ,GAAG,EAAE,CAAC;QACd,iDAAiD;QAEjD,QAAG,GAAG,IAAI,CAAC;QAEX,WAAM,GAAG,KAAK,CAAC;QAEf,eAAU,G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C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU;mBAC9C,IAAI,CAAC,OAAO;WACpB,IAAI,CAAC,MAAM;YACZ,CAAC,CAAC,IAAI,CAAA,yCAAyC;YAC/C,CAAC,CAAC,IAAI,CAAA,2CAA2C;;KAEtD,CAAC;IACJ,CAAC;;AAvGD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAChB;AAEX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC5B;AAEf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CACf;AAEtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAChB;AAGpC;IADC,KAAK,EAAE;4CACI;AAjBD,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CA0GvB","sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"../shared/define-element.ts\";\nimport { tokens } from \"../../tokens/tokens.ts\";\nimport \"../button/button.ts\";\nimport \"../icons/pause-icon.ts\";\nimport \"../icons/play-icon.ts\";\nimport { ensembleCSS } from \"../shared/ensemble.css.ts\";\nimport { spacing } from \"../shared/token-scales.ts\";\nimport { logoMarqueeCSS } from \"./logo-marquee.css.ts\";\n\n/**\n * A row of logos sliding sideways behind an edge fade: the homepage's trusted\n * line (\"#1 most awarded\" and the partner marks) and the award strip under\n * Proven. Drawn in the foundation Figma file as Logo marquee.\n *\n * The logos are the page's: slot them as they are (an <img> with its width\n * and height, an icon, a label). To loop without a seam the row has to be\n * longer than the window, so this element clones the slotted set into its\n * own shadow root as many times as the width needs and moves the whole track\n * by one copy -- the jump back is then exactly one repeat, and invisible. The\n * copies are aria-hidden and inert: a screen reader reads the set once.\n *\n * It moves on its own for longer than five seconds, so it has a pause button\n * (WCAG 2.2.2): holding it on hover or focus was not enough, because the\n * logos are usually images and nothing in the row takes focus. The button\n * sets `paused`, which a page can also set. The pointer or focus on the row\n * still holds it. Under prefers-reduced-motion it never moves -- the set\n * wraps in place instead, so nothing is hidden behind the fade -- and the\n * button goes with the motion.\n */\n@defineElement(\"bd-logo-marquee\")\nexport class LogoMarquee extends LitElement {\n @property({ type: String })\n label = \"\";\n // seconds for one copy to pass: 35 for the partners and the awards alike\n @property({ type: Number })\n duration = 35;\n // a step on the spacing scale, between two logos\n @property({ type: String })\n gap = \"48\";\n @property({ type: Boolean, reflect: true })\n paused = false;\n @property({ type: String, attribute: \"pause-label\" })\n pauseLabel = \"Pause the moving logos\";\n @property({ type: String, attribute: \"play-label\" })\n playLabel = \"Play the moving logos\";\n // copies of the set after the original; at least one, or there is no loop\n @state()\n _copies = 1;\n\n _resize: ResizeObserver;\n\n static styles = [tokens, ensembleCSS, logoMarqueeCSS];\n\n constructor() {\n super();\n this._resize = new ResizeObserver(() => this._measure());\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.hasUpdated) this._observe();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._resize.disconnect();\n }\n\n firstUpdated() {\n this._observe();\n }\n\n _observe() {\n this._resize.observe(this.renderRoot.querySelector(\".viewport\")!);\n this._resize.observe(this.renderRoot.querySelector(\".group\")!);\n }\n\n /* One copy must cover the window on its own while the original slides out,\n so a set narrower than the window takes more than one. */\n _measure() {\n const viewport = this.renderRoot.querySelector<HTMLElement>(\".viewport\");\n const group = this.renderRoot.querySelector<HTMLElement>(\".group\");\n if (!viewport || !group || !group.offsetWidth) return;\n const copies = Math.max(1, Math.ceil(viewport.offsetWidth / group.offsetWidth));\n if (copies !== this._copies) this._copies = copies;\n }\n\n _onSlotChange() {\n this._fillCopies();\n this._measure();\n }\n\n _fillCopies() {\n const slot = this.renderRoot.querySelector(\"slot\");\n if (!slot) return;\n const items = slot.assignedElements({ flatten: true });\n for (const copy of this.renderRoot.querySelectorAll(\".copy\")) {\n copy.replaceChildren(...items.map(item => item.cloneNode(true)));\n }\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"_copies\")) this._fillCopies();\n }\n\n _toggle() {\n this.paused = !this.paused;\n }\n\n render() {\n const copies = Array.from({ length: this._copies });\n return html`\n <section\n class=\"bd-ensemble root\"\n aria-label=\"${this.label}\"\n style=\"--bd-logo-marquee-gap: ${spacing(this.gap) || \"var(--spacing-48)\"}; --bd-logo-marquee-duration: ${this.duration}s; --bd-logo-marquee-copies: ${this._copies + 1};\"\n >\n <div class=\"viewport\">\n <div class=\"track\">\n <div class=\"group\"><slot @slotchange=${this._onSlotChange}></slot></div>\n ${copies.map(() => html`<div class=\"group copy\" aria-hidden=\"true\" inert></div>`)}\n </div>\n </div>\n <bd-button\n class=\"toggle\"\n variant=\"ghost\"\n size=\"sm\"\n icon-only\n label=\"${this.paused ? this.playLabel : this.pauseLabel}\"\n @click=${this._toggle}\n >${this.paused\n ? html`<bd-play-icon size=\"sm\"></bd-play-icon>`\n : html`<bd-pause-icon size=\"sm\"></bd-pause-icon>`}</bd-button>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-logo-marquee\": LogoMarquee;\n }\n}\n"]}
1
+ {"version":3,"file":"logo-marquee.js","sourceRoot":"","sources":["../../../../src/components/logo-marquee/logo-marquee.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAA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E,MAAM,EAAE,CAAC;6CACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAChB;AAEX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC5B;AAEf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CACf;AAEtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAChB;AAGpC;IADC,KAAK,EAAE;4CACI;AAjBD,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAqHvB","sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"../shared/define-element.ts\";\nimport { tokens } from \"../../tokens/tokens.ts\";\nimport \"../button/button.ts\";\nimport \"../icons/pause-icon.ts\";\nimport \"../icons/play-icon.ts\";\nimport { ensembleCSS } from \"../shared/ensemble.css.ts\";\nimport { spacing } from \"../shared/token-scales.ts\";\nimport { logoMarqueeCSS } from \"./logo-marquee.css.ts\";\n\n/**\n * A row of logos sliding sideways behind an edge fade: the homepage's trusted\n * line (\"#1 most awarded\" and the partner marks) and the award strip under\n * Proven. Drawn in the foundation Figma file as Logo marquee.\n *\n * The logos are the page's: slot them as they are (an <img> with its width\n * and height, an icon, a label). To loop without a seam the row has to be\n * longer than the window, so this element clones the slotted set into its\n * own shadow root as many times as the width needs and moves the whole track\n * by one copy -- the jump back is then exactly one repeat, and invisible. The\n * copies are aria-hidden and inert: a screen reader reads the set once.\n *\n * It moves on its own for longer than five seconds, so it has a pause button\n * (WCAG 2.2.2): holding it on hover or focus was not enough, because the\n * logos are usually images and nothing in the row takes focus. The button\n * sets `paused`, which a page can also set. The pointer or focus on the row\n * still holds it. Under prefers-reduced-motion it never moves -- the set\n * wraps in place instead, so nothing is hidden behind the fade -- and the\n * button goes with the motion.\n */\n@defineElement(\"bd-logo-marquee\")\nexport class LogoMarquee extends LitElement {\n @property({ type: String })\n label = \"\";\n // seconds for one copy to pass: 35 for the partners and the awards alike\n @property({ type: Number })\n duration = 35;\n // a step on the spacing scale, between two logos\n @property({ type: String })\n gap = \"48\";\n @property({ type: Boolean, reflect: true })\n paused = false;\n @property({ type: String, attribute: \"pause-label\" })\n pauseLabel = \"Pause the moving logos\";\n @property({ type: String, attribute: \"play-label\" })\n playLabel = \"Play the moving logos\";\n // copies of the set after the original; at least one, or there is no loop\n @state()\n _copies = 1;\n\n _resize: ResizeObserver;\n _frame = 0;\n\n static styles = [tokens, ensembleCSS, logoMarqueeCSS];\n\n /* A resize is measured on the next frame, not inside the observer's\n delivery. A new copy count re-renders the track, and in WebKit that\n resizes a box this observer watches while the delivery is still running:\n Safari reported \"ResizeObserver loop completed with undelivered\n notifications\" on every homepage load. Measured a frame later, the new\n size is an ordinary delivery of its own. */\n constructor() {\n super();\n this._resize = new ResizeObserver(() => {\n cancelAnimationFrame(this._frame);\n this._frame = requestAnimationFrame(() => this._measure());\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.hasUpdated) this._observe();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._resize.disconnect();\n cancelAnimationFrame(this._frame);\n }\n\n firstUpdated() {\n this._observe();\n }\n\n _observe() {\n this._resize.observe(this.renderRoot.querySelector(\".viewport\")!);\n this._resize.observe(this.renderRoot.querySelector(\".group\")!);\n }\n\n /* One copy must cover the window on its own while the original slides out,\n so a set narrower than the window takes more than one. */\n _measure() {\n const viewport = this.renderRoot.querySelector<HTMLElement>(\".viewport\");\n const group = this.renderRoot.querySelector<HTMLElement>(\".group\");\n if (!viewport || !group || !group.offsetWidth) return;\n const copies = Math.max(1, Math.ceil(viewport.offsetWidth / group.offsetWidth));\n if (copies !== this._copies) this._copies = copies;\n }\n\n _onSlotChange() {\n this._fillCopies();\n this._measure();\n }\n\n _fillCopies() {\n const slot = this.renderRoot.querySelector(\"slot\");\n if (!slot) return;\n const items = slot.assignedElements({ flatten: true });\n for (const copy of this.renderRoot.querySelectorAll(\".copy\")) {\n copy.replaceChildren(...items.map(item => item.cloneNode(true)));\n }\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"_copies\")) this._fillCopies();\n }\n\n _toggle() {\n this.paused = !this.paused;\n }\n\n render() {\n const copies = Array.from({ length: this._copies });\n return html`\n <section\n class=\"bd-ensemble root\"\n aria-label=\"${this.label}\"\n style=\"--bd-logo-marquee-gap: ${spacing(this.gap) || \"var(--spacing-48)\"}; --bd-logo-marquee-duration: ${this.duration}s; --bd-logo-marquee-copies: ${this._copies + 1};\"\n >\n <div class=\"viewport\">\n <div class=\"track\">\n <div class=\"group\"><slot @slotchange=${this._onSlotChange}></slot></div>\n ${copies.map(() => html`<div class=\"group copy\" aria-hidden=\"true\" inert></div>`)}\n </div>\n </div>\n <bd-button\n class=\"toggle\"\n variant=\"ghost\"\n size=\"sm\"\n icon-only\n label=\"${this.paused ? this.playLabel : this.pauseLabel}\"\n @click=${this._toggle}\n >${this.paused\n ? html`<bd-play-icon size=\"sm\"></bd-play-icon>`\n : html`<bd-pause-icon size=\"sm\"></bd-pause-icon>`}</bd-button>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-logo-marquee\": LogoMarquee;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobit/dex-system-design",
3
- "version": "3.0.0",
3
+ "version": "3.0.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",
@@ -413,5 +413,5 @@
413
413
  "volta": {
414
414
  "node": "24.22.1"
415
415
  },
416
- "gitHead": "57de76a42acc8a77eaac46e13ec6e8839f09ae98"
416
+ "gitHead": "e34b25e89b6e68b14f9cac3a6b2a3957f504f636"
417
417
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifestVersion": 1,
3
3
  "package": "@repobit/dex-system-design",
4
- "packageVersion": "3.0.0",
4
+ "packageVersion": "3.0.1",
5
5
  "generatedFrom": [
6
6
  "package.json exports",
7
7
  "Lit reactive properties (static properties or @property/@state)",