@repobit/dex-system-design 0.23.14 → 0.23.16
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 +3 -3
- package/src/components/Button/Button.js +60 -32
- package/src/components/Button/button.css.js +59 -75
- package/src/components/anchor/anchor-nav.css.js +3 -1
- package/src/components/anchor/anchor-nav.js +88 -119
- package/src/components/anchor/anchor.stories.js +190 -83
- package/src/components/badge/badge.css.js +15 -38
- package/src/components/badge/badge.js +15 -35
- package/src/components/compare/compare.stories.js +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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
|
+
## [0.23.16](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.23.15...@repobit/dex-system-design@0.23.16) (2026-04-23)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **DEX-1014:** fix for anchor nav functionality
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [0.23.15](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.23.14...@repobit/dex-system-design@0.23.15) (2026-04-14)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @repobit/dex-system-design
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [0.23.14](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.23.13...@repobit/dex-system-design@0.23.14) (2026-04-08)
|
|
7
22
|
|
|
8
23
|
**Note:** Version bump only for package @repobit/dex-system-design
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-system-design",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.16",
|
|
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",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"url": "https://github.com/bitdefender/dex-core/issues"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@repobit/dex-store": "^1.3.
|
|
73
|
+
"@repobit/dex-store": "^1.3.14",
|
|
74
74
|
"@repobit/dex-store-elements": "^1.4.6",
|
|
75
75
|
"lit": "^3.3.2",
|
|
76
76
|
"lit-query": "^0.0.1"
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"volta": {
|
|
90
90
|
"node": "24.14.0"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "0d063cda634ce56449d0dd9501bc86fc6d3d818e"
|
|
93
93
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { tokens } from "../../tokens/tokens.js";
|
|
3
3
|
import buttonsCSS from "./button.css.js";
|
|
4
|
-
import "./icons.js";
|
|
5
4
|
|
|
6
5
|
class Button extends LitElement {
|
|
7
6
|
static properties = {
|
|
@@ -23,22 +22,21 @@ class Button extends LitElement {
|
|
|
23
22
|
this.size = "md";
|
|
24
23
|
this.fontSize = "";
|
|
25
24
|
this.fontWeight = "";
|
|
26
|
-
this.isActive = false;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
_onFocusin(e) {
|
|
28
|
+
const el = e.currentTarget;
|
|
29
|
+
requestAnimationFrame(() =>
|
|
30
|
+
requestAnimationFrame(() => {
|
|
31
|
+
if (el.matches(':focus-visible')) {
|
|
32
|
+
this.setAttribute('data-bd-button-focus', '');
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.isActive = false;
|
|
39
|
-
this.requestUpdate();
|
|
40
|
-
this._handleClick();
|
|
41
|
-
}
|
|
38
|
+
_onFocusout() {
|
|
39
|
+
this.removeAttribute('data-bd-button-focus');
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
_handleClick() {
|
|
@@ -87,9 +85,9 @@ class Button extends LitElement {
|
|
|
87
85
|
return html`
|
|
88
86
|
<button
|
|
89
87
|
@click=${this._handleClick}
|
|
90
|
-
@
|
|
91
|
-
@
|
|
92
|
-
class="button ${this.kindClass} ${this.sizeClass} ${this.fullWidthClass} ${this.strongClass}
|
|
88
|
+
@focusin=${this._onFocusin}
|
|
89
|
+
@focusout=${this._onFocusout}
|
|
90
|
+
class="button ${this.kindClass} ${this.sizeClass} ${this.fullWidthClass} ${this.strongClass}"
|
|
93
91
|
aria-label="${this.label}"
|
|
94
92
|
style="
|
|
95
93
|
${this.fontSize ? `font-size: ${this.fontSize};` : ""}
|
|
@@ -131,6 +129,21 @@ class ButtonLink extends LitElement {
|
|
|
131
129
|
this.shadow = true;
|
|
132
130
|
}
|
|
133
131
|
|
|
132
|
+
_onFocusin(e) {
|
|
133
|
+
const el = e.currentTarget;
|
|
134
|
+
requestAnimationFrame(() =>
|
|
135
|
+
requestAnimationFrame(() => {
|
|
136
|
+
if (el.matches(':focus-visible')) {
|
|
137
|
+
this.setAttribute('data-bd-button-focus', '');
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_onFocusout() {
|
|
144
|
+
this.removeAttribute('data-bd-button-focus');
|
|
145
|
+
}
|
|
146
|
+
|
|
134
147
|
get sizeClass() {
|
|
135
148
|
switch (this.size) {
|
|
136
149
|
case "lg":
|
|
@@ -176,6 +189,8 @@ class ButtonLink extends LitElement {
|
|
|
176
189
|
class="button ${this.kindClass} ${this.sizeClass} ${this.fullWidthClass} ${this.strongClass}"
|
|
177
190
|
aria-label="${this.label}"
|
|
178
191
|
@click=${this._handleClick}
|
|
192
|
+
@focusin=${this._onFocusin}
|
|
193
|
+
@focusout=${this._onFocusout}
|
|
179
194
|
style="
|
|
180
195
|
${this.fontSize ? `font-size: ${this.fontSize};` : ""}
|
|
181
196
|
${this.fontWeight ? `font-weight: ${this.fontWeight};` : ""}
|
|
@@ -193,7 +208,6 @@ class ButtonLink extends LitElement {
|
|
|
193
208
|
}
|
|
194
209
|
}
|
|
195
210
|
|
|
196
|
-
|
|
197
211
|
class ContactButton extends LitElement {
|
|
198
212
|
static properties = {
|
|
199
213
|
label: { type: String },
|
|
@@ -206,21 +220,37 @@ class ContactButton extends LitElement {
|
|
|
206
220
|
this.href = "https://www.google.com";
|
|
207
221
|
}
|
|
208
222
|
|
|
223
|
+
_onFocusin(e) {
|
|
224
|
+
const el = e.currentTarget;
|
|
225
|
+
requestAnimationFrame(() =>
|
|
226
|
+
requestAnimationFrame(() => {
|
|
227
|
+
if (el.matches(':focus-visible')) {
|
|
228
|
+
this.setAttribute('data-bd-button-focus', '');
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
_onFocusout() {
|
|
235
|
+
this.removeAttribute('data-bd-button-focus');
|
|
236
|
+
}
|
|
237
|
+
|
|
209
238
|
render() {
|
|
210
239
|
return html`
|
|
211
|
-
<a
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
240
|
+
<a
|
|
241
|
+
class="button bd-contact-btn"
|
|
242
|
+
href="${this.href}"
|
|
243
|
+
aria-label="${this.label}"
|
|
244
|
+
@click=${this._handleClick}
|
|
245
|
+
@focusin=${this._onFocusin}
|
|
246
|
+
@focusout=${this._onFocusout}
|
|
247
|
+
style="
|
|
248
|
+
${this.fontSize ? `font-size: ${this.fontSize};` : ""}
|
|
249
|
+
${this.fontWeight ? `font-weight: ${this.fontWeight};` : ""}
|
|
250
|
+
"
|
|
251
|
+
>
|
|
252
|
+
${this.label}
|
|
253
|
+
<arrow-icon aria-hidden="true"></arrow-icon>
|
|
224
254
|
</a>
|
|
225
255
|
`;
|
|
226
256
|
}
|
|
@@ -232,10 +262,8 @@ class ContactButton extends LitElement {
|
|
|
232
262
|
|
|
233
263
|
Button.styles = [tokens, buttonsCSS];
|
|
234
264
|
ButtonLink.styles = [tokens, buttonsCSS];
|
|
235
|
-
|
|
236
265
|
ContactButton.styles = [tokens, buttonsCSS];
|
|
237
266
|
|
|
238
267
|
customElements.define("bd-button", Button);
|
|
239
268
|
customElements.define("bd-button-link", ButtonLink);
|
|
240
|
-
|
|
241
269
|
customElements.define("bd-contact-button", ContactButton);
|
|
@@ -2,6 +2,7 @@ import { css } from "lit";
|
|
|
2
2
|
|
|
3
3
|
export default css`
|
|
4
4
|
:host {
|
|
5
|
+
display: inline-flex;
|
|
5
6
|
--button-background-primary: var(--color-blue-500);
|
|
6
7
|
--button-background-primary-hover: var(--color-blue-600);
|
|
7
8
|
--button-background-primary-focus: var(--color-blue-700);
|
|
@@ -28,41 +29,39 @@ export default css`
|
|
|
28
29
|
--bd-accesibility-focus: var(--color-blue-500);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
button
|
|
33
|
-
outline: none;
|
|
34
|
-
box-shadow: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
button:focus-visible {
|
|
32
|
+
/* Double rAF focus pattern */
|
|
33
|
+
:host([data-bd-button-focus]) {
|
|
38
34
|
outline: var(--spacing-2) solid var(--bd-accesibility-focus);
|
|
39
35
|
outline-offset: var(--spacing-2);
|
|
36
|
+
border-radius: var(--radius-md);
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
|
|
39
|
+
button:focus,
|
|
40
|
+
button:focus-visible,
|
|
41
|
+
a:focus,
|
|
42
|
+
a:focus-visible {
|
|
43
43
|
outline: none;
|
|
44
|
+
box-shadow: none;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
.
|
|
47
|
-
outline: var(--spacing-2) solid var(--bd-accesibility-focus);
|
|
48
|
-
outline-offset: var(--spacing-2);
|
|
49
|
-
}
|
|
50
|
-
a.button {
|
|
51
|
-
text-decoration: none;
|
|
52
|
-
}
|
|
53
|
-
.href-button {
|
|
47
|
+
a.button {
|
|
54
48
|
text-decoration: none;
|
|
55
|
-
display: inline-flex;
|
|
56
|
-
vertical-align: middle;
|
|
57
|
-
width: 100%;
|
|
58
49
|
}
|
|
59
|
-
.button
|
|
60
|
-
|
|
50
|
+
.button,
|
|
51
|
+
.bd-contact-btn {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
text-align: center;
|
|
56
|
+
text-decoration: none;
|
|
57
|
+
color: var(--color-neutral-0);
|
|
61
58
|
border: none;
|
|
62
59
|
cursor: pointer;
|
|
63
|
-
transition: background-color
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
transition: background-color var(--transition-duration-normal) var(--transition-easing-smooth),
|
|
61
|
+
transform var(--transition-duration-normal) var(--transition-easing-smooth),
|
|
62
|
+
box-shadow var(--transition-duration-normal) var(--transition-easing-smooth),
|
|
63
|
+
color var(--transition-duration-normal) var(--transition-easing-smooth);
|
|
64
|
+
gap: var(--spacing-10);
|
|
66
65
|
vertical-align: middle;
|
|
67
66
|
line-height: 1;
|
|
68
67
|
box-sizing: border-box;
|
|
@@ -70,7 +69,7 @@ a.button {
|
|
|
70
69
|
|
|
71
70
|
.button--primary {
|
|
72
71
|
background-color: var(--button-background-primary);
|
|
73
|
-
color:
|
|
72
|
+
color: var(--color-neutral-0);
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
.button--primary:hover {
|
|
@@ -83,7 +82,7 @@ a.button {
|
|
|
83
82
|
|
|
84
83
|
.button--secondary {
|
|
85
84
|
background-color: var(--button-background-secondary);
|
|
86
|
-
color:
|
|
85
|
+
color: var(--color-neutral-0);
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
.button--secondary:hover {
|
|
@@ -96,112 +95,97 @@ a.button {
|
|
|
96
95
|
|
|
97
96
|
.button--danger {
|
|
98
97
|
background-color: var(--button-background-danger);
|
|
99
|
-
color:
|
|
98
|
+
color: var(--color-neutral-0);
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
.button--danger:hover {
|
|
103
102
|
background-color: var(--button-background-danger-hover);
|
|
104
103
|
}
|
|
105
104
|
|
|
106
|
-
.button--danger
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
105
|
+
.button--danger:active {
|
|
106
|
+
background-color: var(--button-background-danger-focus);
|
|
107
|
+
}
|
|
110
108
|
|
|
111
109
|
.button--outline {
|
|
112
110
|
background-color: transparent;
|
|
113
|
-
border:
|
|
111
|
+
border: var(--border-width-2) solid var(--border-button-background-outline);
|
|
114
112
|
color: var(--color-button-background-outline);
|
|
115
113
|
}
|
|
116
114
|
.button--outline:hover {
|
|
117
115
|
background-color: var(--button-background-outline-hover);
|
|
118
|
-
border:
|
|
116
|
+
border: var(--border-width-2) solid var(--border-button-background-outline-hover);
|
|
119
117
|
}
|
|
120
118
|
.button--outline:active {
|
|
121
119
|
background-color: var(--button-background-outline-focus);
|
|
122
|
-
color:
|
|
120
|
+
color: var(--color-neutral-0);
|
|
123
121
|
}
|
|
124
122
|
.button--primary--outline {
|
|
125
123
|
background-color: transparent;
|
|
126
|
-
border:
|
|
124
|
+
border: var(--border-width-2) solid var(--border-button-background-primary-outline);
|
|
127
125
|
color: var(--color-button-background-primary-outline);
|
|
128
126
|
}
|
|
129
127
|
.button--primary--outline:hover {
|
|
130
128
|
background-color: var(--button-background-primary-outline-hover);
|
|
131
|
-
border:
|
|
129
|
+
border: var(--border-width-2) solid var(--border-button-background-primary-outline-hover);
|
|
132
130
|
}
|
|
133
131
|
.button--primary--outline:active {
|
|
134
132
|
background-color: var(--button-background-primary-outline-focus);
|
|
135
|
-
color:
|
|
133
|
+
color: var(--color-neutral-0);
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
.button--small {
|
|
139
137
|
padding: var(--spacing-8) var(--spacing-16);
|
|
140
138
|
font-size: var(--spacing-14);
|
|
141
|
-
font-weight:
|
|
139
|
+
font-weight: var(--typography-fontWeight-normal);
|
|
142
140
|
font-family: var(--typography-fontFamily-sans);
|
|
143
|
-
border-radius:
|
|
144
|
-
min-height: 34px;
|
|
141
|
+
border-radius: var(--radius-md);
|
|
142
|
+
min-height: var(--dimension-34px);
|
|
145
143
|
min-width: 115px;
|
|
146
144
|
}
|
|
147
145
|
|
|
148
146
|
.button--medium {
|
|
149
147
|
padding: var(--spacing-12) var(--spacing-20);
|
|
150
148
|
font-size: var(--spacing-16);
|
|
151
|
-
font-weight:
|
|
149
|
+
font-weight: var(--typography-fontWeight-normal);
|
|
152
150
|
font-family: var(--typography-fontFamily-sans);
|
|
153
151
|
border-radius: var(--radius-lg);
|
|
154
|
-
min-height: 45px;
|
|
152
|
+
min-height: var(--dimension-45px);
|
|
155
153
|
min-width: 150px;
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
.button--large {
|
|
159
157
|
padding: var(--spacing-16) var(--spacing-24);
|
|
160
158
|
font-size: var(--spacing-18);
|
|
161
|
-
font-weight:
|
|
159
|
+
font-weight: var(--typography-fontWeight-normal);
|
|
162
160
|
font-family: var(--typography-fontFamily-sans);
|
|
163
161
|
border-radius: var(--radius-lg);
|
|
164
|
-
min-height: 55px;
|
|
162
|
+
min-height: var(--dimension-55px);
|
|
165
163
|
min-width: 150px;
|
|
166
164
|
}
|
|
165
|
+
|
|
167
166
|
.button--bold {
|
|
168
|
-
font-weight:
|
|
167
|
+
font-weight: var(--typography-fontWeight-semibold);
|
|
169
168
|
}
|
|
169
|
+
|
|
170
170
|
.max--width {
|
|
171
171
|
width: 100%;
|
|
172
172
|
display: block;
|
|
173
173
|
}
|
|
174
|
+
|
|
174
175
|
.button.max--width {
|
|
175
176
|
width: 100%;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
gap: 10px;
|
|
191
|
-
vertical-align: middle;
|
|
192
|
-
line-height: 1;
|
|
193
|
-
box-sizing: border-box;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/* Pentru link-uri care sunt butoane */
|
|
197
|
-
a.button {
|
|
198
|
-
text-decoration: none;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/* Asigură-te că slot-ul ocupă întreg spațiul */
|
|
202
|
-
.button > ::slotted(*) {
|
|
203
|
-
display: inline-block;
|
|
204
|
-
width: 100%;
|
|
205
|
-
text-align: center;
|
|
206
|
-
}
|
|
179
|
+
/* Asigură-te că slot-ul ocupă întreg spațiul */
|
|
180
|
+
.button > ::slotted(*) {
|
|
181
|
+
display: inline-block;
|
|
182
|
+
width: 100%;
|
|
183
|
+
text-align: center;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@media (prefers-reduced-motion: reduce) {
|
|
187
|
+
.button, .bd-contact-btn {
|
|
188
|
+
transition: none !important;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
207
191
|
`;
|
|
@@ -216,7 +216,9 @@ export const anchorNavStyles = css`
|
|
|
216
216
|
a:hover:not(.active) {
|
|
217
217
|
color: var(--color-blue-500);
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
.bd-anchor-nav__cta:hover {
|
|
220
|
+
color: var(--color-neutral-0) !important;
|
|
221
|
+
}
|
|
220
222
|
a.active:hover {
|
|
221
223
|
color: var(--color-neutral-900);
|
|
222
224
|
}
|