@repobit/dex-system-design 0.23.15 → 0.23.17

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,20 @@
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.17](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.23.16...@repobit/dex-system-design@0.23.17) (2026-04-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **DEX-1014:** adjustments for anchor-nav. Modified structure
11
+
12
+
13
+ ## [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)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **DEX-1014:** fix for anchor nav functionality
18
+
19
+
6
20
  ## [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)
7
21
 
8
22
  **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.15",
3
+ "version": "0.23.17",
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",
@@ -89,5 +89,5 @@
89
89
  "volta": {
90
90
  "node": "24.14.0"
91
91
  },
92
- "gitHead": "b5e5567f6d68800a73154c9da2e4a3023eb18945"
92
+ "gitHead": "7e0f9b42767c23f33e6b6b79665bec599b432a69"
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
- _handleKeyDown(event) {
30
- if (event.key === "Enter" || event.key === " ") {
31
- this.isActive = true;
32
- this.requestUpdate();
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
- _handleKeyUp(event) {
37
- if (event.key === "Enter" || event.key === " ") {
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
- @keydown=${this._handleKeyDown}
91
- @keyup=${this._handleKeyUp}
92
- class="button ${this.kindClass} ${this.sizeClass} ${this.fullWidthClass} ${this.strongClass} ${this.isActive ? 'active' : ''}"
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};` : ""}
@@ -109,7 +107,7 @@ class ButtonLink extends LitElement {
109
107
  size : { type: String },
110
108
  customClass: { type: String },
111
109
  kind : { type: String },
112
- fullWidth : { type: Boolean },
110
+ fullWidth : { type: Boolean, attribute: "fullwidth" },
113
111
  strong : { type: Boolean },
114
112
  fontSize : { type: String, attribute: "font-size" },
115
113
  fontWeight : { type: String, attribute: "font-weight" },
@@ -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 class="href-button" href="${this.href}" aria-label="${this.label}">
212
- <button
213
- class="bd-contact-btn"
214
- @click=${this._handleClick}
215
- aria-label="${this.label}"
216
- style="
217
- ${this.fontSize ? `font-size: ${this.fontSize};` : ""}
218
- ${this.fontWeight ? `font-weight: ${this.fontWeight};` : ""}
219
- "
220
- >
221
- ${this.label}
222
- <arrow-icon></arrow-icon>
223
- </button>
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,47 @@ export default css`
28
29
  --bd-accesibility-focus: var(--color-blue-500);
29
30
  }
30
31
 
31
- button:focus,
32
- button:focus-visible {
33
- outline: none;
34
- box-shadow: none;
35
- }
32
+ :host([fullwidth]) {
33
+ display: block;
34
+ width: 100%;
35
+ }
36
36
 
37
- button:focus-visible {
37
+ .max--width {
38
+ width: 100%;
39
+ display: flex;
40
+ }
41
+ :host([data-bd-button-focus]) {
38
42
  outline: var(--spacing-2) solid var(--bd-accesibility-focus);
39
43
  outline-offset: var(--spacing-2);
44
+ border-radius: var(--radius-md);
40
45
  }
41
- .href-button:focus,
42
- .href-button:focus-visible {
46
+
47
+ button:focus,
48
+ button:focus-visible,
49
+ a:focus,
50
+ a:focus-visible {
43
51
  outline: none;
52
+ box-shadow: none;
44
53
  }
45
54
 
46
- .href-button:focus-visible button {
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 {
55
+ a.button {
54
56
  text-decoration: none;
55
- display: inline-flex;
56
- vertical-align: middle;
57
- width: 100%;
58
57
  }
59
- .button {
60
- color: white;
58
+ .button,
59
+ .bd-contact-btn {
60
+ display: inline-flex;
61
+ justify-content: center;
62
+ align-items: center;
63
+ text-align: center;
64
+ text-decoration: none;
65
+ color: var(--color-neutral-0);
61
66
  border: none;
62
67
  cursor: pointer;
63
- transition: background-color 0.3s ease, transform 0.2s ease,
64
- box-shadow 0.2s ease;
65
- gap: 10px;
68
+ transition: background-color var(--transition-duration-normal) var(--transition-easing-smooth),
69
+ transform var(--transition-duration-normal) var(--transition-easing-smooth),
70
+ box-shadow var(--transition-duration-normal) var(--transition-easing-smooth),
71
+ color var(--transition-duration-normal) var(--transition-easing-smooth);
72
+ gap: var(--spacing-10);
66
73
  vertical-align: middle;
67
74
  line-height: 1;
68
75
  box-sizing: border-box;
@@ -70,7 +77,7 @@ a.button {
70
77
 
71
78
  .button--primary {
72
79
  background-color: var(--button-background-primary);
73
- color: white;
80
+ color: var(--color-neutral-0);
74
81
  }
75
82
 
76
83
  .button--primary:hover {
@@ -83,7 +90,7 @@ a.button {
83
90
 
84
91
  .button--secondary {
85
92
  background-color: var(--button-background-secondary);
86
- color: white;
93
+ color: var(--color-neutral-0);
87
94
  }
88
95
 
89
96
  .button--secondary:hover {
@@ -96,112 +103,89 @@ a.button {
96
103
 
97
104
  .button--danger {
98
105
  background-color: var(--button-background-danger);
99
- color: white;
106
+ color: var(--color-neutral-0);
100
107
  }
101
108
 
102
109
  .button--danger:hover {
103
110
  background-color: var(--button-background-danger-hover);
104
111
  }
105
112
 
106
- .button--danger.active,
107
- .button--danger:active {
108
- background-color: var(--button-background-danger-focus);
109
- }
113
+ .button--danger:active {
114
+ background-color: var(--button-background-danger-focus);
115
+ }
110
116
 
111
117
  .button--outline {
112
118
  background-color: transparent;
113
- border: 2px solid var(--border-button-background-outline);
119
+ border: var(--border-width-2) solid var(--border-button-background-outline);
114
120
  color: var(--color-button-background-outline);
115
121
  }
116
122
  .button--outline:hover {
117
123
  background-color: var(--button-background-outline-hover);
118
- border: 2px solid var(--border-button-background-outline-hover);
124
+ border: var(--border-width-2) solid var(--border-button-background-outline-hover);
119
125
  }
120
126
  .button--outline:active {
121
127
  background-color: var(--button-background-outline-focus);
122
- color: white;
128
+ color: var(--color-neutral-0);
123
129
  }
124
130
  .button--primary--outline {
125
131
  background-color: transparent;
126
- border: 2px solid var(--border-button-background-primary-outline);
132
+ border: var(--border-width-2) solid var(--border-button-background-primary-outline);
127
133
  color: var(--color-button-background-primary-outline);
128
134
  }
129
135
  .button--primary--outline:hover {
130
136
  background-color: var(--button-background-primary-outline-hover);
131
- border: 2px solid var(--border-button-background-primary-outline-hover);
137
+ border: var(--border-width-2) solid var(--border-button-background-primary-outline-hover);
132
138
  }
133
139
  .button--primary--outline:active {
134
140
  background-color: var(--button-background-primary-outline-focus);
135
- color: white;
141
+ color: var(--color-neutral-0);
136
142
  }
137
143
 
138
144
  .button--small {
139
145
  padding: var(--spacing-8) var(--spacing-16);
140
146
  font-size: var(--spacing-14);
141
- font-weight: 400;
147
+ font-weight: var(--typography-fontWeight-normal);
142
148
  font-family: var(--typography-fontFamily-sans);
143
- border-radius: 6px;
144
- min-height: 34px;
149
+ border-radius: var(--radius-md);
150
+ min-height: var(--dimension-34px);
145
151
  min-width: 115px;
146
152
  }
147
153
 
148
154
  .button--medium {
149
155
  padding: var(--spacing-12) var(--spacing-20);
150
156
  font-size: var(--spacing-16);
151
- font-weight: 400;
157
+ font-weight: var(--typography-fontWeight-normal);
152
158
  font-family: var(--typography-fontFamily-sans);
153
159
  border-radius: var(--radius-lg);
154
- min-height: 45px;
160
+ min-height: var(--dimension-45px);
155
161
  min-width: 150px;
156
162
  }
157
163
 
158
164
  .button--large {
159
165
  padding: var(--spacing-16) var(--spacing-24);
160
166
  font-size: var(--spacing-18);
161
- font-weight: 400;
167
+ font-weight: var(--typography-fontWeight-normal);
162
168
  font-family: var(--typography-fontFamily-sans);
163
169
  border-radius: var(--radius-lg);
164
- min-height: 55px;
170
+ min-height: var(--dimension-55px);
165
171
  min-width: 150px;
166
172
  }
173
+
167
174
  .button--bold {
168
- font-weight: 600;
175
+ font-weight: var(--typography-fontWeight-semibold);
169
176
  }
170
- .max--width {
171
- width: 100%;
172
- display: block;
173
- }
174
- .button.max--width {
177
+
178
+
179
+ /* Asigură-te că slot-ul ocupă întreg spațiul */
180
+ .button > ::slotted(*) {
181
+ display: inline-block;
175
182
  width: 100%;
183
+ text-align: center;
176
184
  }
177
185
 
178
- .button,
179
- a.button {
180
- display: inline-flex;
181
- justify-content: center;
182
- align-items: center;
183
- text-align: center;
184
- text-decoration: none;
185
- // color: white;
186
- // border: none;
187
- cursor: pointer;
188
- transition: background-color 0.3s ease, transform 0.2s ease,
189
- box-shadow 0.2s ease;
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
- }
186
+ @media (prefers-reduced-motion: reduce) {
187
+ .button, .bd-contact-btn {
188
+ transition: none !important;
189
+ }
190
+ }
207
191
  `;