@reliability-design/web 1.1.1 → 1.3.0

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 (69) hide show
  1. package/dist/components/rel-accordion/rel-accordion.ts +289 -150
  2. package/dist/components/rel-alert/rel-alert.ts +34 -34
  3. package/dist/components/rel-avatar/README.md +15 -4
  4. package/dist/components/rel-avatar/rel-avatar.ts +138 -94
  5. package/dist/components/rel-badge/README.md +7 -0
  6. package/dist/components/rel-badge/rel-badge.ts +39 -2
  7. package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +6 -6
  8. package/dist/components/rel-button/rel-button.ts +96 -28
  9. package/dist/components/rel-calendar/rel-calendar.ts +15 -8
  10. package/dist/components/rel-card/rel-card.ts +9 -17
  11. package/dist/components/rel-cardmedia/rel-cardmedia.ts +20 -23
  12. package/dist/components/rel-carousel/rel-carousel.ts +596 -468
  13. package/dist/components/rel-checkbox/rel-checkbox.ts +68 -16
  14. package/dist/components/rel-chip/README.md +7 -0
  15. package/dist/components/rel-chip/rel-chip.ts +411 -244
  16. package/dist/components/rel-container/rel-container.ts +2 -2
  17. package/dist/components/rel-date-picker/rel-date-picker.ts +23 -19
  18. package/dist/components/rel-divider/rel-divider.ts +3 -3
  19. package/dist/components/rel-drawer/rel-drawer-footer.ts +0 -2
  20. package/dist/components/rel-drawer/rel-drawer.ts +46 -90
  21. package/dist/components/rel-kbd/rel-kbd.ts +94 -118
  22. package/dist/components/rel-layout/rel-layout.ts +49 -58
  23. package/dist/components/rel-menu/rel-menu.ts +359 -359
  24. package/dist/components/rel-menubar/rel-menubar-menu.css +3 -0
  25. package/dist/components/rel-menubar/rel-menubar-menu.ts +2 -1
  26. package/dist/components/rel-menubar/rel-menubar.ts +603 -605
  27. package/dist/components/rel-otp/rel-otp.ts +22 -25
  28. package/dist/components/rel-pagination/rel-pagination.ts +442 -381
  29. package/dist/components/rel-popover/rel-popover-content.ts +6 -5
  30. package/dist/components/rel-popover/rel-popover.ts +26 -7
  31. package/dist/components/rel-progress/rel-progress.ts +10 -9
  32. package/dist/components/rel-radio/rel-radio.ts +228 -172
  33. package/dist/components/rel-range-picker/rel-range-picker.css +349 -0
  34. package/dist/components/rel-range-picker/rel-range-picker.ts +1080 -0
  35. package/dist/components/rel-resizable/rel-resizable-handle.ts +8 -7
  36. package/dist/components/rel-segmented-button/rel-segmented-button.ts +41 -20
  37. package/dist/components/rel-select/README.md +34 -28
  38. package/dist/components/rel-select/rel-select.ts +1015 -275
  39. package/dist/components/rel-sheet/rel-sheet.ts +365 -684
  40. package/dist/components/rel-skeleton/rel-skeleton.ts +139 -0
  41. package/dist/components/rel-slider/rel-slider.ts +49 -27
  42. package/dist/components/rel-snackbar/rel-snackbar.ts +28 -28
  43. package/dist/components/rel-stepper/rel-stepper.ts +11 -10
  44. package/dist/components/rel-switch/rel-switch.ts +7 -6
  45. package/dist/components/rel-tab/rel-tab.ts +15 -29
  46. package/dist/components/rel-textfield/rel-textfield.ts +192 -35
  47. package/dist/components/rel-toast/rel-toast.ts +21 -13
  48. package/dist/components/rel-tooltip/rel-tooltip.ts +123 -123
  49. package/dist/components/rel-topbar/rel-topbar-actions.ts +1 -0
  50. package/dist/components/rel-topbar/rel-topbar-brand.ts +1 -0
  51. package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +32 -2
  52. package/dist/components/rel-topbar/rel-topbar-dropdown.ts +1 -1
  53. package/dist/components/rel-topbar/rel-topbar-item.ts +15 -10
  54. package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +1 -0
  55. package/dist/components/rel-topbar/rel-topbar-profile.ts +30 -56
  56. package/dist/components/rel-topbar/rel-topbar-utilities.ts +1 -0
  57. package/dist/components/rel-topbar/rel-topbar.ts +137 -28
  58. package/dist/index.d.mts +310 -193
  59. package/dist/index.d.ts +310 -193
  60. package/dist/index.js +5562 -3526
  61. package/dist/index.js.map +1 -1
  62. package/dist/index.mjs +5328 -3284
  63. package/dist/index.mjs.map +1 -1
  64. package/dist/rel-menubar-menu-BEEQDAXW.css +3 -0
  65. package/dist/styles/vars-v2.css +525 -0
  66. package/dist/styles/vars.css +346 -346
  67. package/dist/{vars-TBB4BMSD.css → vars-I2PC74XD.css} +346 -346
  68. package/dist/vars-v2-VMGWTFJZ.css +525 -0
  69. package/package.json +2 -1
@@ -1,150 +1,289 @@
1
- import { LitElement, html, css } from "lit";
2
- import { customElement, property } from "lit/decorators.js";
3
-
4
- @customElement("rel-accordion")
5
- export class RelAccordion extends LitElement {
6
- @property({ type: String }) title = "Accordion";
7
- @property({ type: Boolean, reflect: true }) open = false;
8
-
9
- static styles = css`
10
- :host {
11
- display: block;
12
- width: 100%;
13
- font-family: var(--rel-fontFamilies-primary, sans-serif);
14
- }
15
-
16
- .accordion {
17
- background: var(--rel-colors-white, #fff);
18
- border: 1px solid var(--rel-border-default, #ddd);
19
- border-radius: var(--rel-borders-radius-border-radius-200, 8px);
20
- box-shadow: var(--rel-shadows-shadow-100);
21
- overflow: hidden;
22
- }
23
-
24
- /* HEADER --------------------------------------------------- */
25
- .header {
26
- display: flex;
27
- justify-content: space-between;
28
- align-items: center;
29
- padding: var(--rel-spacing-space-md, 16px);
30
- cursor: pointer;
31
- user-select: none;
32
- border-radius: var(--rel-borders-radius-border-radius-200, 8px);
33
- }
34
-
35
- .header:hover {
36
- background: var(--rel-surface-surface, #f5f5f5);
37
- }
38
-
39
- :host([open]) .header:hover {
40
- background: transparent;
41
- }
42
-
43
- .header:focus-visible {
44
- outline: 2px solid var(--rel-border-info, #0091ea);
45
- outline-offset: -2px;
46
- }
47
-
48
- .title {
49
- font-size: var(--rel-fontSizes-lg, 20px);
50
- font-weight: var(--rel-fontWeights-medium, 500);
51
- color: var(--rel-text-heading, #2b2b2b);
52
- }
53
-
54
- /* ICON ----------------------------------------------------- */
55
- .icon {
56
- width: 20px;
57
- height: 20px;
58
- display: flex;
59
- align-items: center;
60
- justify-content: center;
61
- transition: transform 0.25s ease;
62
- }
63
-
64
- .icon svg {
65
- width: 20px;
66
- height: 20px;
67
- stroke: var(--rel-text-primary, #333);
68
- stroke-width: 2;
69
- fill: none;
70
- stroke-linecap: round;
71
- stroke-linejoin: round;
72
- }
73
-
74
- .icon.rotated {
75
- transform: rotate(180deg);
76
- }
77
-
78
- /* BODY ------------------------------------------------------ */
79
- .body {
80
- overflow: hidden;
81
- max-height: 0;
82
- padding: 0 var(--rel-spacing-space-md, 16px);
83
- font-size: var(--rel-fontSizes-md, 14px);
84
- color: var(--rel-text-primary, #333);
85
- transition: max-height 0.25s ease, padding 0.2s ease;
86
- }
87
-
88
- .body.open {
89
- max-height: 1000px;
90
- padding: var(--rel-spacing-space-xl, 24px) var(--rel-spacing-space-md, 16px)
91
- var(--rel-spacing-space-lg, 20px);
92
- }
93
-
94
- @media (prefers-reduced-motion: reduce) {
95
- .icon,
96
- .body {
97
- transition: none;
98
- }
99
- }
100
- `;
101
-
102
- private toggle() {
103
- this.open = !this.open;
104
-
105
- this.dispatchEvent(
106
- new CustomEvent<boolean>("open-change", {
107
- detail: this.open,
108
- bubbles: true,
109
- composed: true,
110
- })
111
- );
112
- }
113
-
114
- private chevron() {
115
- return html`
116
- <svg viewBox="0 0 24 24">
117
- <polyline points="6 9 12 15 18 9"></polyline>
118
- </svg>
119
- `;
120
- }
121
-
122
- render() {
123
- return html`
124
- <div class="accordion">
125
- <div class="header"
126
- role="button"
127
- tabindex="0"
128
- aria-expanded="${this.open}"
129
- @click=${this.toggle}
130
- @keydown=${(e: KeyboardEvent) => {
131
- if (e.key === "Enter" || e.key === " ") {
132
- e.preventDefault();
133
- this.toggle();
134
- }
135
- }}>
136
- <div class="title">${this.title}</div>
137
-
138
- <div class="icon ${this.open ? "rotated" : ""}">
139
- ${this.chevron()}
140
- </div>
141
- </div>
142
-
143
- <!-- IMPORTANT: slot is ALWAYS rendered -->
144
- <div class="body ${this.open ? "open" : ""}">
145
- <slot></slot>
146
- </div>
147
- </div>
148
- `;
149
- }
150
- }
1
+ import "../../styles/vars-v2.css";
2
+ import "@reliability-design/icons/rel-icon";
3
+ import { LitElement, html, css } from "lit";
4
+ import { customElement, property } from "lit/decorators.js";
5
+
6
+ @customElement("rel-accordion")
7
+ export class RelAccordion extends LitElement {
8
+ @property({ type: String }) title = "Accordion";
9
+ @property({ type: Boolean, reflect: true }) open = false;
10
+ @property({ type: String, reflect: true }) size: "md" | "sm" = "md";
11
+ @property({ type: String, reflect: true }) type: "default" | "action" = "default";
12
+
13
+ static styles = css`
14
+ :host {
15
+ display: block;
16
+ width: 100%;
17
+ font-family: var(--rel-fontFamilies-primary, sans-serif);
18
+ }
19
+
20
+ .accordion {
21
+ background: var(--rel-color-bg-primary, #ffffff);
22
+ border-radius: 8px;
23
+ overflow: hidden;
24
+ box-shadow: 0 2px 4px rgba(11, 11, 11, 0.1);
25
+ }
26
+
27
+ /* ── Header ───────────────────────────────────────────────── */
28
+
29
+ .header {
30
+ display: flex;
31
+ justify-content: space-between;
32
+ align-items: center;
33
+ cursor: pointer;
34
+ user-select: none;
35
+ box-sizing: border-box;
36
+ /* matches .accordion's radius so the focus-visible outline isn't clipped square at the corners by the parent's overflow:hidden */
37
+ border-radius: 8px;
38
+ }
39
+
40
+ :host([size="md"]) .header {
41
+ padding: 8px 8px 8px 16px;
42
+ min-height: 56px;
43
+ }
44
+
45
+ :host([size="sm"]) .header {
46
+ padding: 8px 8px 8px 12px;
47
+ min-height: 48px;
48
+ }
49
+
50
+ .header:hover {
51
+ background: var(--rel-color-bg-secondary, #f5f5f5);
52
+ }
53
+
54
+ .header:focus-visible {
55
+ outline: 2px solid var(--rel-color-border-focus);
56
+ outline-offset: -2px;
57
+ }
58
+
59
+ /* ── Title row ────────────────────────────────────────────── */
60
+
61
+ .title-row {
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 8px;
65
+ flex: 1;
66
+ }
67
+
68
+ .title {
69
+ font-weight: var(--rel-fontWeights-semibold, 600);
70
+ color: var(--rel-color-text-default, #0b0b0b);
71
+ letter-spacing: -0.3px;
72
+ }
73
+
74
+ :host([size="md"]) .title {
75
+ font-size: var(--rel-fontSizes-lg, 20px);
76
+ line-height: 28px;
77
+ }
78
+
79
+ :host([size="sm"]) .title {
80
+ font-size: 16px;
81
+ line-height: 24px;
82
+ }
83
+
84
+ /* ── Leading icon (action type) ───────────────────────────── */
85
+
86
+ .leading-icon {
87
+ display: inline-flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ flex-shrink: 0;
91
+ color: var(--rel-color-text-default, #0b0b0b);
92
+ }
93
+
94
+ .leading-icon ::slotted(svg) {
95
+ width: 24px;
96
+ height: 24px;
97
+ }
98
+
99
+ .leading-icon rel-icon,
100
+ .leading-icon ::slotted(rel-icon) {
101
+ --rel-icon-size: 24px;
102
+ }
103
+
104
+ :host([size="sm"]) .leading-icon ::slotted(svg) {
105
+ width: 20px;
106
+ height: 20px;
107
+ }
108
+
109
+ :host([size="sm"]) .leading-icon rel-icon,
110
+ :host([size="sm"]) .leading-icon ::slotted(rel-icon) {
111
+ --rel-icon-size: 20px;
112
+ }
113
+
114
+ /* ── Chevron ──────────────────────────────────────────────── */
115
+
116
+ .chevron {
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ flex-shrink: 0;
121
+ }
122
+
123
+ :host([size="md"]) .chevron {
124
+ width: 40px;
125
+ height: 40px;
126
+ }
127
+
128
+ :host([size="sm"]) .chevron {
129
+ width: 32px;
130
+ height: 32px;
131
+ }
132
+
133
+ .chevron ::slotted(svg) {
134
+ width: 24px;
135
+ height: 24px;
136
+ }
137
+
138
+ .chevron rel-icon,
139
+ .chevron ::slotted(rel-icon) {
140
+ --rel-icon-size: 24px;
141
+ color: var(--rel-color-text-default, #0b0b0b);
142
+ }
143
+
144
+ :host([size="sm"]) .chevron ::slotted(svg) {
145
+ width: 20px;
146
+ height: 20px;
147
+ }
148
+
149
+ :host([size="sm"]) .chevron rel-icon,
150
+ :host([size="sm"]) .chevron ::slotted(rel-icon) {
151
+ --rel-icon-size: 20px;
152
+ }
153
+
154
+ /* ── Icon rotation ────────────────────────────────────────── */
155
+ /* Only the shadow-DOM fallback wrappers rotate on open.
156
+ Slotted (light-DOM) icons are never targeted, so they stay static. */
157
+
158
+ .icon-rotate-on-open,
159
+ .chevron-rotate {
160
+ display: inline-flex;
161
+ align-items: center;
162
+ transition: transform 0.25s ease;
163
+ }
164
+
165
+ /* Leading fallback chevron: 90° (points right when open) */
166
+ :host([open]) .icon-rotate-on-open {
167
+ transform: rotate(90deg);
168
+ }
169
+
170
+ /* Trailing fallback chevron (type="default" only): 180° flip */
171
+ :host([open]) .chevron-rotate {
172
+ transform: rotate(180deg);
173
+ }
174
+
175
+ /* ── Body ─────────────────────────────────────────────────── */
176
+
177
+ .body {
178
+ overflow: hidden;
179
+ max-height: 0;
180
+ padding: 0 16px;
181
+ font-size: var(--rel-fontSizes-md, 14px);
182
+ line-height: 22px;
183
+ /* Figma spec value — --rel-color-text-secondary resolves to #9e9e9e (gray-disabled-text), not this */
184
+ color: var(--rel-accordion-body-color, #525252);
185
+ transition:
186
+ max-height 0.25s ease,
187
+ padding 0.2s ease;
188
+ }
189
+
190
+ :host([size="sm"]) .body {
191
+ font-size: var(--rel-fontSizes-sm, 12px);
192
+ line-height: 20px;
193
+ }
194
+
195
+ .body.open {
196
+ max-height: 1000px;
197
+ padding: 4px 16px 16px;
198
+ }
199
+
200
+ /* ── Dark mode ────────────────────────────────────────────── */
201
+
202
+ :host-context([data-theme="dark"]) .accordion,
203
+ [data-theme="dark"] .accordion {
204
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
205
+ }
206
+
207
+ :host-context([data-theme="dark"]) .title,
208
+ [data-theme="dark"] .title {
209
+ color: var(--rel-color-text-default-dark, #f5f5f5);
210
+ }
211
+
212
+ :host-context([data-theme="dark"]) .chevron rel-icon,
213
+ [data-theme="dark"] .chevron rel-icon,
214
+ :host-context([data-theme="dark"]) .chevron ::slotted(rel-icon),
215
+ [data-theme="dark"] .chevron ::slotted(rel-icon) {
216
+ color: var(--rel-color-text-default-dark, #f5f5f5);
217
+ }
218
+
219
+ :host-context([data-theme="dark"]) .leading-icon,
220
+ [data-theme="dark"] .leading-icon {
221
+ color: var(--rel-color-text-default-dark, #f5f5f5);
222
+ }
223
+
224
+ :host-context([data-theme="dark"]) .body,
225
+ [data-theme="dark"] .body {
226
+ color: var(--rel-accordion-body-color-dark, #a3a3a3);
227
+ }
228
+
229
+ @media (prefers-reduced-motion: reduce) {
230
+ .icon-rotate-on-open,
231
+ .chevron-rotate,
232
+ .body {
233
+ transition: none;
234
+ }
235
+ }
236
+ `;
237
+
238
+ private toggle() {
239
+ this.open = !this.open;
240
+ this.dispatchEvent(
241
+ new CustomEvent<boolean>("open-change", {
242
+ detail: this.open,
243
+ bubbles: true,
244
+ composed: true,
245
+ })
246
+ );
247
+ }
248
+
249
+ render() {
250
+ return html`
251
+ <div class="accordion">
252
+ <div
253
+ class="header"
254
+ role="button"
255
+ tabindex="0"
256
+ aria-expanded="${this.open}"
257
+ @click=${this.toggle}
258
+ @keydown=${(e: KeyboardEvent) => {
259
+ if (e.key === "Enter" || e.key === " ") {
260
+ e.preventDefault();
261
+ this.toggle();
262
+ }
263
+ }}
264
+ >
265
+ <div class="title-row">
266
+ ${this.type === "action"
267
+ ? html`<span class="leading-icon">
268
+ <slot name="icon">
269
+ <span class="icon-rotate-on-open"><rel-icon name="chevron-right"></rel-icon></span>
270
+ </slot>
271
+ </span>`
272
+ : ""}
273
+ <span class="title">${this.title}</span>
274
+ </div>
275
+ <div class="chevron">
276
+ <slot name="trailing-icon">
277
+ ${this.type === "default"
278
+ ? html`<span class="chevron-rotate"><rel-icon name="chevron-down"></rel-icon></span>`
279
+ : html`<rel-icon name="arrow-expansion"></rel-icon>`}
280
+ </slot>
281
+ </div>
282
+ </div>
283
+ <div class="body ${this.open ? "open" : ""}">
284
+ <slot></slot>
285
+ </div>
286
+ </div>
287
+ `;
288
+ }
289
+ }
@@ -1,3 +1,4 @@
1
+ import "../../styles/vars-v2.css";
1
2
  import { LitElement, html, css } from "lit";
2
3
  import { customElement, property } from "lit/decorators.js";
3
4
 
@@ -89,101 +90,100 @@ export class RelAlert extends LitElement {
89
90
  opacity: 1;
90
91
  }
91
92
 
92
- /* COLORS — light mode (pinned Figma hex) */
93
+ /* COLORS — light mode */
93
94
  .alert-neutral {
94
- background: #ffffff;
95
- color: #000000;
95
+ background: var(--rel-color-bg-primary);
96
+ color: var(--rel-color-text-primary);
96
97
  }
97
98
 
98
99
  .alert-info {
99
- background: #E1F2FF;
100
- color: #000000;
101
- --rel-icon-info: #0059F4;
100
+ background: var(--rel-background-info);
101
+ color: var(--rel-color-text-primary);
102
+ --rel-icon-info: var(--rel-colors-blue-tertiary);
102
103
  }
103
104
 
104
105
  .alert-success {
105
- background: #E2FEEE;
106
- color: #000000;
107
- --rel-icon-success: #00A86B;
106
+ background: var(--rel-background-success);
107
+ color: var(--rel-color-text-primary);
108
+ --rel-icon-success: var(--rel-success-surface-dark);
108
109
  }
109
110
 
110
111
  .alert-warning {
111
- background: #F6EFD7;
112
- color: #000000;
113
- --rel-icon-warning: #F2915C;
112
+ background: var(--rel-colors-gold-light);
113
+ color: var(--rel-color-text-primary);
114
+ --rel-icon-warning: var(--rel-warning-surface-dark);
114
115
  }
115
116
 
116
117
  .alert-error {
117
- background: #FFDEDE;
118
- color: #9C1E33;
119
- --rel-icon-error: #9C1E33;
118
+ background: var(--rel-background-error-light);
119
+ color: var(--rel-error-surface-dark);
120
+ --rel-icon-error: var(--rel-error-surface-dark);
120
121
  }
121
122
 
122
123
  .alert-error .rel-close {
123
- color: #000000;
124
+ color: var(--rel-color-text-primary);
124
125
  }
125
126
 
126
- /* COLORS — dark mode (pinned Figma hex) */
127
+ /* COLORS — dark mode */
127
128
  :host-context([data-theme="dark"]) .rel-alert,
128
129
  :host-context(.dark) .rel-alert {
129
- background: #2B2B2B;
130
- color: #ffffff;
130
+ background: var(--rel-color-bg-tertiary);
131
+ color: var(--rel-color-text-primary);
131
132
  border: none;
132
133
  }
133
134
 
134
135
  :host-context([data-theme="dark"]) .rel-close,
135
136
  :host-context(.dark) .rel-close {
136
- color: #ffffff;
137
+ color: var(--rel-color-text-primary);
137
138
  }
138
139
 
139
140
  :host-context([data-theme="dark"]) .alert-neutral,
140
141
  :host-context(.dark) .alert-neutral {
141
- border: 1px solid #ffffff;
142
- --rel-colors-black: #ffffff;
142
+ border: 1px solid var(--rel-color-border-strong);
143
143
  }
144
144
 
145
145
  :host-context([data-theme="dark"]) .alert-info,
146
146
  :host-context(.dark) .alert-info {
147
- border: 1px solid #0059F4;
148
- --rel-icon-info: #0059F4;
147
+ border: 1px solid var(--rel-colors-blue-tertiary);
148
+ --rel-icon-info: var(--rel-colors-blue-tertiary);
149
149
  }
150
150
 
151
151
  :host-context([data-theme="dark"]) .alert-info .rel-message2,
152
152
  :host-context(.dark) .alert-info .rel-message2 {
153
- color: #0059F4;
153
+ color: var(--rel-colors-blue-tertiary);
154
154
  }
155
155
 
156
156
  :host-context([data-theme="dark"]) .alert-warning,
157
157
  :host-context(.dark) .alert-warning {
158
- border: 1px solid #F2915C;
159
- --rel-icon-warning: #F2915C;
158
+ border: 1px solid var(--rel-warning-surface-dark);
159
+ --rel-icon-warning: var(--rel-warning-surface-dark);
160
160
  }
161
161
 
162
162
  :host-context([data-theme="dark"]) .alert-warning .rel-message2,
163
163
  :host-context(.dark) .alert-warning .rel-message2 {
164
- color: #F2915C;
164
+ color: var(--rel-warning-surface-dark);
165
165
  }
166
166
 
167
167
  :host-context([data-theme="dark"]) .alert-success,
168
168
  :host-context(.dark) .alert-success {
169
- border: 1px solid #00A86B;
170
- --rel-icon-success: #00A86B;
169
+ border: 1px solid var(--rel-success-surface-dark);
170
+ --rel-icon-success: var(--rel-success-surface-dark);
171
171
  }
172
172
 
173
173
  :host-context([data-theme="dark"]) .alert-success .rel-message2,
174
174
  :host-context(.dark) .alert-success .rel-message2 {
175
- color: #00A86B;
175
+ color: var(--rel-success-surface-dark);
176
176
  }
177
177
 
178
178
  :host-context([data-theme="dark"]) .alert-error,
179
179
  :host-context(.dark) .alert-error {
180
- border: 1px solid #9C1E33;
181
- --rel-icon-error: #9C1E33;
180
+ border: 1px solid var(--rel-error-surface-dark);
181
+ --rel-icon-error: var(--rel-error-surface-dark);
182
182
  }
183
183
 
184
184
  :host-context([data-theme="dark"]) .alert-error .rel-message2,
185
185
  :host-context(.dark) .alert-error .rel-message2 {
186
- color: #9C1E33;
186
+ color: var(--rel-error-surface-dark);
187
187
  }
188
188
  `;
189
189
 
@@ -1,7 +1,7 @@
1
1
  # rel-avatar
2
2
 
3
3
  ## Overview
4
- A circular avatar component supporting three display types: image, text initials, or custom icon content. Provides four size variants with automatic text transformation and SVG sizing for icons.
4
+ A circular avatar component supporting three display types: image, text initials, or custom icon content. Provides four size variants and three style variants (fill, subtle, outline), with automatic text transformation and SVG sizing for icons.
5
5
 
6
6
  ## Usage
7
7
  ```html
@@ -31,6 +31,11 @@ A circular avatar component supporting three display types: image, text initials
31
31
  <rel-avatar type="text" text="MD" size="md"></rel-avatar>
32
32
  <rel-avatar type="text" text="LG" size="lg"></rel-avatar>
33
33
 
34
+ <!-- Style variants -->
35
+ <rel-avatar type="text" text="AA" variant="fill"></rel-avatar>
36
+ <rel-avatar type="text" text="AA" variant="subtle"></rel-avatar>
37
+ <rel-avatar type="text" text="AA" variant="outline"></rel-avatar>
38
+
34
39
  <!-- User list with avatars -->
35
40
  <div style="display: flex; gap: 8px; align-items: center;">
36
41
  <rel-avatar type="image" src="user1.jpg" size="sm"></rel-avatar>
@@ -52,9 +57,11 @@ A circular avatar component supporting three display types: image, text initials
52
57
  |------|------|---------|-------------|
53
58
  | `size` (reflected) | `"lg" \| "md" \| "sm" \| "xs"` | `"md"` | Avatar size variant |
54
59
  | `type` (reflected) | `"image" \| "text" \| "icon"` | `"image"` | Display type |
60
+ | `variant` (reflected) | `"fill" \| "subtle" \| "outline"` | `"fill"` | Style variant |
55
61
  | `src` | `string` | `""` | Image URL (for `type="image"`) |
56
62
  | `text` | `string` | `""` | Text content (for `type="text"`, usually initials) |
57
63
  | `alt` | `string` | `"Avatar"` | Alt text for the image |
64
+ | `bg` | `string` | `""` | Direct CSS background-color override (any valid CSS color), takes precedence over `variant` |
58
65
 
59
66
  ## Events
60
67
  None.
@@ -79,9 +86,13 @@ None exposed.
79
86
  - `--rel-fontSizes-xs` - Extra small avatar text size
80
87
  - `--rel-fontWeights-bold` - Text font weight
81
88
 
82
- ### Color Tokens
83
- - `--rel-colors-gray-heading` - Avatar background color
84
- - `--rel-colors-white` - Text/icon color
89
+ ### Color Tokens (by variant)
90
+ - **fill** (default): `--rel-avatar-bg-fill` (default `--rel-colors-gray-disabled-text`), `--rel-avatar-color-fill` (default `#ffffff`)
91
+ - **subtle**: `--rel-avatar-bg-subtle` (default `--rel-color-bg-tertiary`), `--rel-avatar-color-subtle` (default `--rel-color-text-heading`)
92
+ - **outline**: `--rel-avatar-bg-outline` (default `--rel-color-bg-primary`), `--rel-avatar-border-outline` (default `--rel-color-border-default`), `--rel-avatar-color-outline` (default `--rel-color-text-heading`)
93
+ - `--rel-borders-width-stroke-100` - Border width (all variants; `fill`/`subtle` use a transparent border to keep sizing consistent)
94
+
95
+ All of the above semantic tokens (`--rel-color-bg-*`, `--rel-color-text-heading`, `--rel-color-border-*`, `--rel-colors-gray-disabled-text`) have dark-mode overrides defined in `vars-v2.css` under `:root[data-theme="dark"]`, so all three variants automatically adapt to dark mode with no extra configuration.
85
96
 
86
97
  ## Accessibility
87
98
  - Image avatars include `alt` attribute for screen readers