@repobit/dex-system-design 0.24.3 → 0.24.5

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 +15 -0
  2. package/package.json +4 -4
  3. package/src/components/accordion/accordion-bg.css.js +6 -1
  4. package/src/components/accordion/accordion-bg.js +3 -1
  5. package/src/components/accordion/accordion-bg.stories.js +49 -0
  6. package/src/components/accordion/accordion.css.js +40 -0
  7. package/src/components/accordion/accordion.js +31 -0
  8. package/src/components/accordion/accordion.stories.js +147 -4
  9. package/src/components/agent-endpoints/agent-endpoints.css.js +92 -0
  10. package/src/components/agent-endpoints/agent-endpoints.js +86 -0
  11. package/src/components/agent-endpoints/agent-endpoints.stories.js +148 -0
  12. package/src/components/ai-guardian-demo.stories.js +669 -0
  13. package/src/components/awards/awards-flex.css.js +169 -0
  14. package/src/components/awards/awards-flex.js +269 -0
  15. package/src/components/awards/awards-flex.stories.js +657 -0
  16. package/src/components/bento-grid/bento-grid.css.js +57 -0
  17. package/src/components/bento-grid/bento-grid.js +186 -0
  18. package/src/components/bento-grid/bento-grid.stories.js +440 -0
  19. package/src/components/bento-grid/bento-item.css.js +79 -0
  20. package/src/components/bento-grid/bento-item.js +54 -0
  21. package/src/components/button/button.css.js +26 -0
  22. package/src/components/button/button.js +8 -0
  23. package/src/components/button/button.stories.js +12 -0
  24. package/src/components/comparison-panel/comparison-panel.css.js +104 -0
  25. package/src/components/comparison-panel/comparison-panel.js +100 -0
  26. package/src/components/comparison-panel/comparison-panel.stories.js +223 -0
  27. package/src/components/compatibility-table/compatibility-table.css.js +243 -0
  28. package/src/components/compatibility-table/compatibility-table.js +123 -0
  29. package/src/components/compatibility-table/compatibility-table.stories.js +189 -0
  30. package/src/components/cta-banner/cta-banner.css.js +60 -0
  31. package/src/components/cta-banner/cta-banner.js +63 -0
  32. package/src/components/dropdown/dropdown.css.js +1 -1
  33. package/src/components/footer/footer.css.js +0 -1
  34. package/src/components/header/header-code.css.js +125 -0
  35. package/src/components/header/header-code.js +69 -0
  36. package/src/components/header/header-code.stories.js +226 -0
  37. package/src/components/heading/heading.css.js +3 -0
  38. package/src/components/icons/bd-ai-icon.js +27 -0
  39. package/src/components/list/list-item/list-item.css.js +3 -3
  40. package/src/components/list/list-item/list-item.js +10 -4
  41. package/src/components/overview/overview.css.js +121 -0
  42. package/src/components/overview/overview.js +63 -0
  43. package/src/components/overview/overview.stories.js +193 -0
  44. package/src/components/page-switcher/page-switcher.css.js +100 -0
  45. package/src/components/page-switcher/page-switcher.js +42 -0
  46. package/src/components/paragraph/paragraph.js +7 -3
  47. package/src/components/process-steps/process-steps.css.js +95 -0
  48. package/src/components/process-steps/process-steps.js +72 -0
  49. package/src/components/process-steps/process-steps.stories.js +144 -0
  50. package/src/components/quick-answer/quick-answer.css.js +67 -0
  51. package/src/components/quick-answer/quick-answer.js +59 -0
  52. package/src/components/quick-answer/quick-answer.stories.js +160 -0
  53. package/src/components/terminal/terminal-cursor.js +49 -0
  54. package/src/components/terminal/terminal-message.css.js +161 -0
  55. package/src/components/terminal/terminal-message.js +169 -0
  56. package/src/components/terminal/terminal-message.stories.js +321 -0
  57. package/src/components/trust-panel/trust-panel.css.js +167 -0
  58. package/src/components/trust-panel/trust-panel.js +116 -0
  59. package/src/components/trust-panel/trust-panel.stories.js +234 -0
  60. package/src/tokens/tokens.css +1 -1
  61. package/src/components/tabsComponent/tabsComponent.css.js +0 -267
  62. package/src/components/tabsComponent/tabsComponent.js +0 -193
  63. package/src/components/tabsComponent/tabsComponent.stories.js +0 -134
  64. package/src/components/tabsComponentFamily/tabsComponentFamily.css.js +0 -181
  65. package/src/components/tabsComponentFamily/tabsComponentFamily.js +0 -180
  66. package/src/components/tabsComponentFamily/tabsComponentFamily.stories.js +0 -319
@@ -0,0 +1,169 @@
1
+ import { css } from "lit";
2
+
3
+ export const awardsFlexCSS = css`
4
+ .bd-awardsflex-root {
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ gap: var(--spacing-8);
9
+ width: 100%;
10
+ box-sizing: border-box;
11
+ padding: var(--spacing-32);
12
+ border-radius: var(--radius-2xl, 16px);
13
+ text-align: center;
14
+ font-family: var(--typography-fontFamily-sans);
15
+ min-height: var(--bd-awardsflex-min-height, 320px);
16
+ }
17
+
18
+ .bd-awardsflex-root--white {
19
+ background: var(--color-neutral-0, #fff);
20
+ border: var(--spacing-2) solid var(--color-blue-50);
21
+ border-radius: var(--spacing-20);
22
+ padding: var(--spacing-64) var(--spacing-32) var(--spacing-64) var(--spacing-32);
23
+ }
24
+
25
+ .bd-awardsflex-root--tint {
26
+ background: var(--color-blue-50, #eef4ff);
27
+ }
28
+
29
+ /* === LAUREL ICON (always centered, above the headline) === */
30
+ .bd-awardsflex-laurel {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ color: var(--color-blue-500);
35
+ margin-bottom: var(--spacing-8);
36
+ }
37
+
38
+ .bd-awardsflex-text-group {
39
+ display: flex;
40
+ flex-direction: column;
41
+ align-items: center;
42
+ gap: var(--spacing-8);
43
+ margin-bottom: var(--spacing-32);
44
+ }
45
+
46
+ .bd-awardsflex-headline {
47
+ color: var(--color-neutral-1000);
48
+ margin: 0;
49
+ }
50
+
51
+ .bd-awardsflex-subtext {
52
+ color: var(--color-neutral-600);
53
+ max-width: 640px;
54
+ margin: 0; /* was: margin: 0 0 var(--spacing-8); */
55
+ }
56
+
57
+ /* === BADGES ROW (compact / grid layouts) === */
58
+ .bd-awardsflex-badges-row {
59
+ display: flex;
60
+ flex-wrap: wrap;
61
+ justify-content: center;
62
+ align-items: center;
63
+ gap: var(--spacing-24);
64
+ min-height: 64px;
65
+ }
66
+
67
+ .bd-awardsflex-badge {
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ flex-shrink: 0;
72
+ }
73
+
74
+ /* === QUOTES LAYOUT — no card background, sits directly on the section bg === */
75
+ .bd-awardsflex-quotes-row {
76
+ display: flex;
77
+ flex-wrap: wrap;
78
+ justify-content: center;
79
+ gap: var(--spacing-32);
80
+ width: 100%;
81
+ }
82
+
83
+ .bd-awardsflex-carousel-viewport {
84
+ width: 100%;
85
+ overflow: hidden;
86
+ }
87
+
88
+ .bd-awardsflex-carousel-track {
89
+ display: flex;
90
+ transition: transform 0.4s ease;
91
+ will-change: transform;
92
+ }
93
+
94
+ /* each slide/page holds a group of quote cards (default 3), shown side by side */
95
+ .bd-awardsflex-carousel-slide {
96
+ flex: 0 0 100%;
97
+ display: flex;
98
+ justify-content: center;
99
+ gap: var(--spacing-32);
100
+ box-sizing: border-box;
101
+ }
102
+
103
+ .bd-awardsflex-quote-card {
104
+ display: flex;
105
+ flex-direction: column;
106
+ align-items: center;
107
+ gap: var(--spacing-8);
108
+ background: transparent;
109
+ padding: 0;
110
+ max-width: 220px;
111
+ flex: 1 1 200px;
112
+ box-sizing: border-box;
113
+ min-height: 160px;
114
+ }
115
+
116
+ .bd-awardsflex-quote-text {
117
+ font-size: var(--typography-fontSize-sm);
118
+ font-style: italic;
119
+ color: var(--color-neutral-800);
120
+ margin: 0;
121
+ }
122
+
123
+ .bd-awardsflex-quote-source {
124
+ font-size: var(--typography-fontSize-xs);
125
+ color: var(--color-neutral-500);
126
+ margin: 0;
127
+ }
128
+
129
+ /* === DOTS === */
130
+ .bd-awardsflex-dots {
131
+ display: flex;
132
+ gap: var(--spacing-8);
133
+ margin-top: var(--spacing-8);
134
+ }
135
+
136
+ .bd-awardsflex-dot {
137
+ width: var(--spacing-8);
138
+ height: var(--spacing-8);
139
+ border-radius: 50%;
140
+ border: none;
141
+ background: var(--color-neutral-300);
142
+ padding: 0;
143
+ cursor: pointer;
144
+ transition: background 0.2s ease, transform 0.2s ease;
145
+ }
146
+
147
+ .bd-awardsflex-dot.active {
148
+ background: var(--color-blue-500);
149
+ transform: scale(1.2);
150
+ }
151
+
152
+ @media (max-width: 599px) {
153
+ .bd-awardsflex-root {
154
+ padding: var(--spacing-24);
155
+ gap: var(--spacing-8);
156
+ min-height: var(--bd-awardsflex-min-height-mobile, 280px);
157
+ }
158
+
159
+ .bd-awardsflex-quotes-row,
160
+ .bd-awardsflex-carousel-slide {
161
+ flex-direction: column;
162
+ align-items: center;
163
+ }
164
+
165
+ .bd-awardsflex-quote-card {
166
+ max-width: none;
167
+ }
168
+ }
169
+ `;
@@ -0,0 +1,269 @@
1
+ import { LitElement, html, nothing } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import "../icons/av-comparatives-icon.js";
4
+ import "../icons/best-brands-icon.js";
5
+ import "../icons/laurel-icon.js";
6
+ import "../icons/pc-mag-2024-icon.js";
7
+ import "../icons/pc-mag-business-icon.js";
8
+ import "../icons/pc-mag-icon.js";
9
+ import "../icons/pc-mag-readers-icon.js";
10
+ import "../icons/top-product-icon.js";
11
+ import { awardsFlexCSS } from "./awards-flex.css.js";
12
+
13
+
14
+ const GROUP_SIZE = 3; // how many quote cards are visible per carousel page
15
+
16
+ export class AwardsFlex extends LitElement {
17
+ static properties = {
18
+ background : { type: String },
19
+ layout : { type: String },
20
+ carousel : { type: Boolean },
21
+ autoplay : { type: Boolean },
22
+ autoplayDelay: { type: Number, attribute: "autoplay-delay" },
23
+ headline : { type: String },
24
+ subtext : { type: String },
25
+ badges : { type: Array },
26
+ _slide : { state: true },
27
+ _paused : { state: true }
28
+ };
29
+
30
+ static styles = [tokens, awardsFlexCSS];
31
+
32
+ constructor() {
33
+ super();
34
+ this.background = "white";
35
+ this.layout = "compact";
36
+ this.carousel = false;
37
+ this.autoplay = false;
38
+ this.autoplayDelay = 4000;
39
+ this.headline = "";
40
+ this.subtext = "";
41
+ this.badges = [];
42
+ this._slide = 0;
43
+ this._paused = false;
44
+ this._timer = null;
45
+ }
46
+
47
+ connectedCallback() {
48
+ super.connectedCallback();
49
+ this._maybeStartAutoplay();
50
+ }
51
+
52
+ disconnectedCallback() {
53
+ super.disconnectedCallback();
54
+ this._stopAutoplay();
55
+ }
56
+
57
+ updated(changed) {
58
+ if (
59
+ changed.has("autoplay") ||
60
+ changed.has("carousel") ||
61
+ changed.has("layout") ||
62
+ changed.has("badges") ||
63
+ changed.has("_paused")
64
+ ) {
65
+ // if the badge set shrank, make sure the current slide index is still valid
66
+ if (this._slide >= this._slidesCount) {
67
+ this._slide = 0;
68
+ }
69
+ this._maybeStartAutoplay();
70
+ }
71
+ }
72
+
73
+ get _groups() {
74
+ // chunk badges into pages of GROUP_SIZE for the carousel
75
+ const groups = [];
76
+ for (let i = 0; i < this.badges.length; i += GROUP_SIZE) {
77
+ groups.push(this.badges.slice(i, i + GROUP_SIZE));
78
+ }
79
+ return groups;
80
+ }
81
+
82
+ get _slidesCount() {
83
+ return this.layout === "quotes" ? this._groups.length : 0;
84
+ }
85
+
86
+ _maybeStartAutoplay() {
87
+ this._stopAutoplay();
88
+ const canAutoplay =
89
+ this.autoplay &&
90
+ this.carousel &&
91
+ this.layout === "quotes" &&
92
+ this._slidesCount > 1 &&
93
+ !this._paused;
94
+
95
+ if (!canAutoplay) return;
96
+
97
+ this._timer = setInterval(() => {
98
+ this._slide = (this._slide + 1) % this._slidesCount;
99
+ }, Math.max(1000, this.autoplayDelay));
100
+ }
101
+
102
+ _stopAutoplay() {
103
+ if (this._timer) {
104
+ clearInterval(this._timer);
105
+ this._timer = null;
106
+ }
107
+ }
108
+
109
+ _onMouseEnter() {
110
+ if (this.autoplay) this._paused = true;
111
+ }
112
+
113
+ _onMouseLeave() {
114
+ if (this.autoplay) this._paused = false;
115
+ }
116
+
117
+ _goTo(i) {
118
+ this._slide = i;
119
+ }
120
+
121
+ _iconHeight() {
122
+ if (this.layout === "grid") return 64;
123
+ if (this.layout === "quotes") return 56;
124
+ return 56;
125
+ }
126
+
127
+ _renderIcon(iconKey) {
128
+ const h = this._iconHeight();
129
+
130
+ switch (iconKey) {
131
+ case "pc-mag":
132
+ return html`<bd-pc-mag-icon height=${h}></bd-pc-mag-icon>`;
133
+ case "pc-mag-2024":
134
+ return html`<bd-pc-mag-2024-icon height=${h}></bd-pc-mag-2024-icon>`;
135
+ case "pc-mag-business":
136
+ return html`<bd-pc-mag-business-icon height=${h}></bd-pc-mag-business-icon>`;
137
+ case "pc-mag-readers":
138
+ return html`<bd-pc-mag-readers-icon height=${h}></bd-pc-mag-readers-icon>`;
139
+ case "av-comparatives":
140
+ return html`<bd-av-comparatives-icon height=${h}></bd-av-comparatives-icon>`;
141
+ case "best-brands":
142
+ return html`<bd-best-brands-icon height=${h}></bd-best-brands-icon>`;
143
+ case "top-product":
144
+ return html`<bd-top-product-icon height=${h}></bd-top-product-icon>`;
145
+ default:
146
+ return html`<span class="bd-awardsflex-badge-fallback" aria-hidden="true">?</span>`;
147
+ }
148
+ }
149
+
150
+ _renderBadge(award) {
151
+ const classes = `bd-awardsflex-badge ${award.type === "dark" ? "bd-awardsflex-badge--dark" : ""}`;
152
+ return html`
153
+ <div class="${classes}" data-award-id="${award.id}" role="listitem" aria-label="${award.label || ""}">
154
+ ${this._renderIcon(award.icon)}
155
+ </div>
156
+ `;
157
+ }
158
+
159
+ _renderQuoteCard(award) {
160
+ if (!award.quote) return nothing;
161
+ return html`
162
+ <div class="bd-awardsflex-quote-card">
163
+ ${this._renderBadge(award)}
164
+ <p class="bd-awardsflex-quote-text">"${award.quote}"</p>
165
+ ${award.source
166
+ ? html`<p class="bd-awardsflex-quote-source">${award.source}${award.date ? html`, ${award.date}` : nothing}</p>`
167
+ : nothing}
168
+ </div>
169
+ `;
170
+ }
171
+
172
+ _renderDots() {
173
+ if (!this.carousel || this._slidesCount < 2) return nothing;
174
+ return html`
175
+ <div class="bd-awardsflex-dots" role="tablist" aria-label="Slide navigation">
176
+ ${this._groups.map(
177
+ (_, i) => html`
178
+ <button
179
+ class="bd-awardsflex-dot ${i === this._slide ? "active" : ""}"
180
+ role="tab"
181
+ aria-selected="${i === this._slide}"
182
+ aria-label="Go to page ${i + 1}"
183
+ @click=${() => this._goTo(i)}
184
+ ></button>
185
+ `
186
+ )}
187
+ </div>
188
+ `;
189
+ }
190
+
191
+ _renderCarousel() {
192
+ const offset = -100 * this._slide;
193
+ return html`
194
+ <div
195
+ class="bd-awardsflex-carousel-viewport"
196
+ @mouseenter=${this._onMouseEnter}
197
+ @mouseleave=${this._onMouseLeave}
198
+ @focusin=${this._onMouseEnter}
199
+ @focusout=${this._onMouseLeave}
200
+ >
201
+ <div
202
+ class="bd-awardsflex-carousel-track"
203
+ style="transform: translateX(${offset}%);"
204
+ >
205
+ ${this._groups.map(
206
+ (group) => html`
207
+ <div class="bd-awardsflex-carousel-slide">
208
+ ${group.map((a) => this._renderQuoteCard(a))}
209
+ </div>
210
+ `
211
+ )}
212
+ </div>
213
+ </div>
214
+ `;
215
+ }
216
+
217
+ _renderLaurel() {
218
+ // slot lets a consumer override the icon while bd-laurel-icon remains
219
+ // the default, matching the reference design (centered above the headline)
220
+ return html`
221
+ <div class="bd-awardsflex-laurel">
222
+ <slot name="icon">
223
+ <bd-laurel-icon width="80" height="64"></bd-laurel-icon>
224
+ </slot>
225
+ </div>
226
+ `;
227
+ }
228
+
229
+ render() {
230
+ const rootClasses = `bd-awardsflex-root bd-awardsflex-root--${this.background} bd-awardsflex-root--${this.layout}`;
231
+
232
+ return html`
233
+ <section class="${rootClasses}" aria-label="Awards and recognition">
234
+ ${this._renderLaurel()}
235
+ ${(this.headline || this.subtext)
236
+ ? html`
237
+ <div class="bd-awardsflex-text-group">
238
+ ${this.headline
239
+ ? html`<bd-h as="h3" class="bd-awardsflex-headline">${this.headline}</bd-h>`
240
+ : nothing}
241
+ ${this.subtext
242
+ ? html`<bd-p kind="large" class="bd-awardsflex-subtext">${this.subtext}</bd-p>`
243
+ : nothing}
244
+ </div>
245
+ `
246
+ : nothing}
247
+
248
+ ${this.layout === "quotes"
249
+ ? html`
250
+ ${this.carousel
251
+ ? this._renderCarousel()
252
+ : html`
253
+ <div class="bd-awardsflex-quotes-row" role="list">
254
+ ${this.badges.map((a) => this._renderQuoteCard(a))}
255
+ </div>
256
+ `}
257
+ ${this._renderDots()}
258
+ `
259
+ : html`
260
+ <div class="bd-awardsflex-badges-row" role="list">
261
+ ${this.badges.map((a) => this._renderBadge(a))}
262
+ </div>
263
+ `}
264
+ </section>
265
+ `;
266
+ }
267
+ }
268
+
269
+ customElements.define("bd-awards-flex", AwardsFlex);