@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.
- package/dist/components/rel-accordion/rel-accordion.ts +289 -150
- package/dist/components/rel-alert/rel-alert.ts +34 -34
- package/dist/components/rel-avatar/README.md +15 -4
- package/dist/components/rel-avatar/rel-avatar.ts +138 -94
- package/dist/components/rel-badge/README.md +7 -0
- package/dist/components/rel-badge/rel-badge.ts +39 -2
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +6 -6
- package/dist/components/rel-button/rel-button.ts +96 -28
- package/dist/components/rel-calendar/rel-calendar.ts +15 -8
- package/dist/components/rel-card/rel-card.ts +9 -17
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +20 -23
- package/dist/components/rel-carousel/rel-carousel.ts +596 -468
- package/dist/components/rel-checkbox/rel-checkbox.ts +68 -16
- package/dist/components/rel-chip/README.md +7 -0
- package/dist/components/rel-chip/rel-chip.ts +411 -244
- package/dist/components/rel-container/rel-container.ts +2 -2
- package/dist/components/rel-date-picker/rel-date-picker.ts +23 -19
- package/dist/components/rel-divider/rel-divider.ts +3 -3
- package/dist/components/rel-drawer/rel-drawer-footer.ts +0 -2
- package/dist/components/rel-drawer/rel-drawer.ts +46 -90
- package/dist/components/rel-kbd/rel-kbd.ts +94 -118
- package/dist/components/rel-layout/rel-layout.ts +49 -58
- package/dist/components/rel-menu/rel-menu.ts +359 -359
- package/dist/components/rel-menubar/rel-menubar-menu.css +3 -0
- package/dist/components/rel-menubar/rel-menubar-menu.ts +2 -1
- package/dist/components/rel-menubar/rel-menubar.ts +603 -605
- package/dist/components/rel-otp/rel-otp.ts +22 -25
- package/dist/components/rel-pagination/rel-pagination.ts +442 -381
- package/dist/components/rel-popover/rel-popover-content.ts +6 -5
- package/dist/components/rel-popover/rel-popover.ts +26 -7
- package/dist/components/rel-progress/rel-progress.ts +10 -9
- package/dist/components/rel-radio/rel-radio.ts +228 -172
- package/dist/components/rel-range-picker/rel-range-picker.css +349 -0
- package/dist/components/rel-range-picker/rel-range-picker.ts +1080 -0
- package/dist/components/rel-resizable/rel-resizable-handle.ts +8 -7
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +41 -20
- package/dist/components/rel-select/README.md +34 -28
- package/dist/components/rel-select/rel-select.ts +1015 -275
- package/dist/components/rel-sheet/rel-sheet.ts +365 -684
- package/dist/components/rel-skeleton/rel-skeleton.ts +139 -0
- package/dist/components/rel-slider/rel-slider.ts +49 -27
- package/dist/components/rel-snackbar/rel-snackbar.ts +28 -28
- package/dist/components/rel-stepper/rel-stepper.ts +11 -10
- package/dist/components/rel-switch/rel-switch.ts +7 -6
- package/dist/components/rel-tab/rel-tab.ts +15 -29
- package/dist/components/rel-textfield/rel-textfield.ts +192 -35
- package/dist/components/rel-toast/rel-toast.ts +21 -13
- package/dist/components/rel-tooltip/rel-tooltip.ts +123 -123
- package/dist/components/rel-topbar/rel-topbar-actions.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar-brand.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +32 -2
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-item.ts +15 -10
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar-profile.ts +30 -56
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar.ts +137 -28
- package/dist/index.d.mts +310 -193
- package/dist/index.d.ts +310 -193
- package/dist/index.js +5562 -3526
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5328 -3284
- package/dist/index.mjs.map +1 -1
- package/dist/rel-menubar-menu-BEEQDAXW.css +3 -0
- package/dist/styles/vars-v2.css +525 -0
- package/dist/styles/vars.css +346 -346
- package/dist/{vars-TBB4BMSD.css → vars-I2PC74XD.css} +346 -346
- package/dist/vars-v2-VMGWTFJZ.css +525 -0
- package/package.json +2 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
2
|
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
4
|
+
import "@reliability-design/icons/rel-icon";
|
|
3
5
|
|
|
4
6
|
export type TextFieldState = "default" | "error" | "disabled";
|
|
5
7
|
export type TextFieldSize = "small" | "medium" | "large";
|
|
8
|
+
export type TextFieldVariant = "default" | "underline";
|
|
6
9
|
|
|
7
10
|
@customElement("rel-textfield")
|
|
8
11
|
export class RelTextfield extends LitElement {
|
|
@@ -15,30 +18,107 @@ export class RelTextfield extends LitElement {
|
|
|
15
18
|
@property({ type: String }) supportingText?: string;
|
|
16
19
|
@property({ type: String }) state: TextFieldState = "default";
|
|
17
20
|
@property({ type: String }) size: TextFieldSize = "medium";
|
|
21
|
+
@property({ type: Boolean, reflect: true }) floatingLabel = false;
|
|
22
|
+
@property({ type: String, reflect: true }) variant: TextFieldVariant = "default";
|
|
18
23
|
|
|
19
24
|
@state() private internalState: "default" | "focused" = "default";
|
|
25
|
+
private _wasError = false;
|
|
20
26
|
|
|
21
27
|
private uniqueId = `textfield-${Math.random().toString(36).slice(2)}`;
|
|
22
28
|
|
|
23
29
|
static styles = css`
|
|
24
30
|
:host {
|
|
25
31
|
display: block;
|
|
26
|
-
font-family: var(--rel-fontFamilies-primary
|
|
32
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
/* Wrapper */
|
|
30
36
|
.textfield-wrapper {
|
|
31
37
|
display: flex;
|
|
32
38
|
flex-direction: column;
|
|
33
|
-
gap: var(--rel-spacing-space-2xs
|
|
39
|
+
gap: var(--rel-spacing-space-2xs);
|
|
34
40
|
width: 100%;
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
/* Label */
|
|
38
44
|
.textfield-label {
|
|
39
|
-
font-size: var(--rel-fontSizes-sm
|
|
40
|
-
font-weight: var(--rel-fontWeights-medium
|
|
41
|
-
color: var(--rel-text-heading
|
|
45
|
+
font-size: var(--rel-fontSizes-sm);
|
|
46
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
47
|
+
color: var(--rel-color-text-heading);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Floating label variant */
|
|
51
|
+
:host([floatinglabel]) .textfield-wrapper {
|
|
52
|
+
gap: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([floatinglabel]) .textfield-container {
|
|
56
|
+
overflow: visible;
|
|
57
|
+
position: relative;
|
|
58
|
+
padding-top: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([floatinglabel]) .textfield-label {
|
|
62
|
+
position: absolute;
|
|
63
|
+
left: var(--rel-spacing-space-sm);
|
|
64
|
+
top: 50%;
|
|
65
|
+
transform: translateY(-50%);
|
|
66
|
+
font-size: var(--rel-fontSizes-md);
|
|
67
|
+
font-weight: var(--rel-fontWeights-regular);
|
|
68
|
+
color: var(--rel-color-text-placeholder);
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease, transform 0.15s ease;
|
|
71
|
+
background: var(--rel-color-bg-primary);
|
|
72
|
+
padding: 0 2px;
|
|
73
|
+
z-index: 1;
|
|
74
|
+
line-height: 1;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([floatinglabel]) .textfield-wrapper.focused .textfield-label,
|
|
79
|
+
:host([floatinglabel]) .textfield-wrapper.has-value .textfield-label {
|
|
80
|
+
top: 0;
|
|
81
|
+
transform: translateY(-50%);
|
|
82
|
+
font-size: var(--rel-fontSizes-xs);
|
|
83
|
+
color: var(--rel-color-text-primary);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([floatinglabel]) .textfield-wrapper.error .textfield-label {
|
|
87
|
+
color: var(--rel-error-text);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([floatinglabel]) .textfield-wrapper.focused:not(.error) .textfield-label {
|
|
91
|
+
color: var(--rel-color-text-primary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([floatinglabel]) .textfield-wrapper.focused.error .textfield-label,
|
|
95
|
+
:host([floatinglabel]) .textfield-wrapper.has-value.error .textfield-label {
|
|
96
|
+
top: 0;
|
|
97
|
+
transform: translateY(-50%);
|
|
98
|
+
font-size: var(--rel-fontSizes-xs);
|
|
99
|
+
color: var(--rel-error-text);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([floatinglabel]) .textfield-input {
|
|
103
|
+
padding-top: var(--rel-spacing-space-sm);
|
|
104
|
+
padding-bottom: var(--rel-spacing-space-sm);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host([floatinglabel]) .textfield-input.has-left-icon {
|
|
108
|
+
padding-left: var(--rel-spacing-space-2xl);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host([floatinglabel]) .textfield-label.has-left-icon {
|
|
112
|
+
left: var(--rel-spacing-space-2xl);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host([floatinglabel]) .textfield-wrapper.focused .textfield-label.has-left-icon,
|
|
116
|
+
:host([floatinglabel]) .textfield-wrapper.has-value .textfield-label.has-left-icon {
|
|
117
|
+
left: var(--rel-spacing-space-sm);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([floatinglabel]) .textfield-wrapper.disabled .textfield-label {
|
|
121
|
+
background: var(--rel-color-bg-tertiary);
|
|
42
122
|
}
|
|
43
123
|
|
|
44
124
|
/* Container */
|
|
@@ -46,14 +126,15 @@ export class RelTextfield extends LitElement {
|
|
|
46
126
|
display: flex;
|
|
47
127
|
align-items: center;
|
|
48
128
|
position: relative;
|
|
49
|
-
border: 1px solid var(--rel-border-default
|
|
50
|
-
border-radius: var(--rel-borders-radius-border-radius-
|
|
51
|
-
background: var(--rel-
|
|
129
|
+
border: 1px solid var(--rel-color-border-default);
|
|
130
|
+
border-radius: var(--rel-borders-radius-border-radius-100);
|
|
131
|
+
background: var(--rel-color-bg-primary);
|
|
132
|
+
overflow: hidden;
|
|
52
133
|
transition: border 0.2s;
|
|
53
134
|
}
|
|
54
135
|
|
|
55
136
|
.textfield-container.disabled {
|
|
56
|
-
background: var(--rel-
|
|
137
|
+
background: var(--rel-color-bg-tertiary);
|
|
57
138
|
cursor: not-allowed;
|
|
58
139
|
}
|
|
59
140
|
|
|
@@ -62,23 +143,23 @@ export class RelTextfield extends LitElement {
|
|
|
62
143
|
flex: 1;
|
|
63
144
|
border: none;
|
|
64
145
|
outline: none;
|
|
65
|
-
font-size: var(--rel-fontSizes-md
|
|
66
|
-
padding: var(--rel-spacing-space-xs
|
|
146
|
+
font-size: var(--rel-fontSizes-md);
|
|
147
|
+
padding: var(--rel-spacing-space-xs) var(--rel-spacing-space-sm);
|
|
67
148
|
background: transparent;
|
|
68
|
-
font-family: var(--rel-fontFamilies-primary
|
|
69
|
-
color: var(--rel-text-primary
|
|
149
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
150
|
+
color: var(--rel-color-text-primary);
|
|
70
151
|
}
|
|
71
152
|
|
|
72
153
|
.textfield-input:disabled {
|
|
73
154
|
cursor: not-allowed;
|
|
74
|
-
color: var(--rel-text-disabled
|
|
155
|
+
color: var(--rel-color-text-disabled);
|
|
75
156
|
}
|
|
76
157
|
|
|
77
158
|
.icon {
|
|
78
159
|
position: absolute;
|
|
79
160
|
display: flex;
|
|
80
161
|
pointer-events: none;
|
|
81
|
-
color: var(--rel-text-placeholder
|
|
162
|
+
color: var(--rel-color-text-placeholder);
|
|
82
163
|
}
|
|
83
164
|
|
|
84
165
|
.icon.left {
|
|
@@ -90,32 +171,32 @@ export class RelTextfield extends LitElement {
|
|
|
90
171
|
}
|
|
91
172
|
|
|
92
173
|
.textfield-wrapper.small .textfield-input {
|
|
93
|
-
padding: var(--rel-spacing-space-xs
|
|
94
|
-
font-size: var(--rel-fontSizes-sm
|
|
174
|
+
padding: var(--rel-spacing-space-xs) var(--rel-spacing-space-sm);
|
|
175
|
+
font-size: var(--rel-fontSizes-sm);
|
|
95
176
|
}
|
|
96
177
|
|
|
97
178
|
.textfield-wrapper.medium .textfield-input {
|
|
98
|
-
padding: var(--rel-spacing-space-sm
|
|
99
|
-
font-size: var(--rel-fontSizes-md
|
|
179
|
+
padding: var(--rel-spacing-space-sm) var(--rel-spacing-space-md);
|
|
180
|
+
font-size: var(--rel-fontSizes-md);
|
|
100
181
|
}
|
|
101
182
|
|
|
102
183
|
.textfield-wrapper.large .textfield-input {
|
|
103
|
-
padding: var(--rel-spacing-space-md
|
|
104
|
-
font-size: var(--rel-fontSizes-lg
|
|
184
|
+
padding: var(--rel-spacing-space-md) var(--rel-spacing-space-md);
|
|
185
|
+
font-size: var(--rel-fontSizes-lg);
|
|
105
186
|
}
|
|
106
187
|
|
|
107
188
|
/* Adjust padding when icons are present */
|
|
108
189
|
.textfield-wrapper .textfield-input.has-left-icon {
|
|
109
|
-
padding-left: var(--rel-spacing-space-2xl
|
|
190
|
+
padding-left: var(--rel-spacing-space-2xl);
|
|
110
191
|
}
|
|
111
192
|
|
|
112
193
|
.textfield-wrapper .textfield-input.has-right-icon {
|
|
113
|
-
padding-right: var(--rel-spacing-space-2xl
|
|
194
|
+
padding-right: var(--rel-spacing-space-2xl);
|
|
114
195
|
}
|
|
115
196
|
|
|
116
197
|
/* States */
|
|
117
198
|
.textfield-wrapper.focused .textfield-container {
|
|
118
|
-
border-color: var(--rel-
|
|
199
|
+
border-color: var(--rel-color-text-primary);
|
|
119
200
|
}
|
|
120
201
|
|
|
121
202
|
.textfield-input:focus-visible {
|
|
@@ -124,34 +205,97 @@ export class RelTextfield extends LitElement {
|
|
|
124
205
|
|
|
125
206
|
.textfield-wrapper.focused .textfield-container,
|
|
126
207
|
.textfield-container:focus-within {
|
|
127
|
-
border-color: var(--rel-
|
|
128
|
-
box-shadow: 0 0 0 1px var(--rel-
|
|
208
|
+
border-color: var(--rel-color-text-primary);
|
|
209
|
+
box-shadow: 0 0 0 1px var(--rel-color-text-primary);
|
|
129
210
|
}
|
|
130
211
|
|
|
131
212
|
.textfield-wrapper.error .textfield-container {
|
|
132
|
-
border-color: var(--rel-
|
|
213
|
+
border-color: var(--rel-error-surface-default);
|
|
214
|
+
box-shadow: none;
|
|
133
215
|
}
|
|
134
216
|
|
|
135
217
|
.textfield-wrapper.disabled .textfield-container {
|
|
136
|
-
border-color: var(--rel-border-default
|
|
218
|
+
border-color: var(--rel-color-border-default);
|
|
137
219
|
}
|
|
138
220
|
|
|
139
221
|
/* Supporting text */
|
|
140
222
|
.textfield-support {
|
|
141
|
-
font-size: var(--rel-fontSizes-xs
|
|
142
|
-
color: var(--rel-text-placeholder
|
|
223
|
+
font-size: var(--rel-fontSizes-xs);
|
|
224
|
+
color: var(--rel-color-text-placeholder);
|
|
143
225
|
}
|
|
144
226
|
|
|
145
227
|
.textfield-support.error {
|
|
146
|
-
color: var(--rel-
|
|
228
|
+
color: var(--rel-error-surface-default, #CC0000);
|
|
147
229
|
}
|
|
148
230
|
|
|
149
231
|
/* Placeholder */
|
|
150
232
|
.textfield-input::placeholder {
|
|
151
|
-
color: var(--rel-text-placeholder
|
|
233
|
+
color: var(--rel-color-text-placeholder);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
:host([floatinglabel]) .textfield-input::placeholder {
|
|
237
|
+
opacity: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host([floatinglabel]) .textfield-wrapper.focused .textfield-input::placeholder {
|
|
241
|
+
opacity: 1;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Suppress Chrome autofill blue background */
|
|
245
|
+
.textfield-input:-webkit-autofill,
|
|
246
|
+
.textfield-input:-webkit-autofill:hover,
|
|
247
|
+
.textfield-input:-webkit-autofill:focus {
|
|
248
|
+
-webkit-box-shadow: 0 0 0px 1000px var(--rel-color-bg-primary) inset;
|
|
249
|
+
-webkit-text-fill-color: var(--rel-color-text-primary);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* ── Underline variant ── */
|
|
253
|
+
:host([variant="underline"]) .textfield-container {
|
|
254
|
+
border: none;
|
|
255
|
+
border-bottom: 2px solid var(--rel-color-border-default);
|
|
256
|
+
border-radius: 0;
|
|
257
|
+
background: var(--rel-color-bg-tertiary, #f5f5f5);
|
|
258
|
+
box-shadow: none;
|
|
259
|
+
overflow: visible;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:host([variant="underline"]) .textfield-wrapper.focused .textfield-container,
|
|
263
|
+
:host([variant="underline"]) .textfield-container:focus-within {
|
|
264
|
+
border-bottom: 2px solid var(--rel-color-text-primary);
|
|
265
|
+
box-shadow: none;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
:host([variant="underline"]) .textfield-wrapper.error .textfield-container {
|
|
269
|
+
border-bottom: 2px solid var(--rel-error-surface-default, #CC0000);
|
|
270
|
+
box-shadow: none;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:host([variant="underline"]) .textfield-wrapper.disabled .textfield-container {
|
|
274
|
+
border-bottom: 2px solid var(--rel-color-border-default);
|
|
275
|
+
background: var(--rel-color-bg-tertiary);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* Remove border radius on input for underline variant */
|
|
279
|
+
:host([variant="underline"]) .textfield-input {
|
|
280
|
+
background: transparent;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Dark mode — underline variant uses same border colors as default */
|
|
284
|
+
:host-context([data-theme="dark"]) :host([variant="underline"]) .textfield-container,
|
|
285
|
+
:host-context(.dark) :host([variant="underline"]) .textfield-container {
|
|
286
|
+
background: var(--rel-color-bg-tertiary);
|
|
287
|
+
border-bottom-color: var(--rel-color-border-default);
|
|
152
288
|
}
|
|
153
289
|
`;
|
|
154
290
|
|
|
291
|
+
connectedCallback() {
|
|
292
|
+
super.connectedCallback();
|
|
293
|
+
const leftIcon = this.getAttribute('lefticon') || this.getAttribute('leftIcon');
|
|
294
|
+
if (leftIcon) this.leftIcon = leftIcon;
|
|
295
|
+
const rightIcon = this.getAttribute('righticon') || this.getAttribute('rightIcon');
|
|
296
|
+
if (rightIcon) this.rightIcon = rightIcon;
|
|
297
|
+
}
|
|
298
|
+
|
|
155
299
|
private handleFocus() {
|
|
156
300
|
if (this.state !== "disabled") {
|
|
157
301
|
this.internalState = "focused";
|
|
@@ -167,6 +311,13 @@ export class RelTextfield extends LitElement {
|
|
|
167
311
|
private handleInput(e: Event) {
|
|
168
312
|
const input = e.target as HTMLInputElement;
|
|
169
313
|
this.value = input.value;
|
|
314
|
+
if (this.state === "error" && this.value) {
|
|
315
|
+
this._wasError = true;
|
|
316
|
+
this.state = "default";
|
|
317
|
+
} else if (this._wasError && !this.value) {
|
|
318
|
+
this._wasError = false;
|
|
319
|
+
this.state = "error";
|
|
320
|
+
}
|
|
170
321
|
this.dispatchEvent(
|
|
171
322
|
new CustomEvent<string>("rel-change", {
|
|
172
323
|
detail: this.value,
|
|
@@ -182,6 +333,7 @@ export class RelTextfield extends LitElement {
|
|
|
182
333
|
this.size,
|
|
183
334
|
this.state,
|
|
184
335
|
this.internalState === "focused" ? "focused" : "",
|
|
336
|
+
this.value ? "has-value" : "",
|
|
185
337
|
].filter(Boolean).join(" ");
|
|
186
338
|
|
|
187
339
|
const inputClasses = [
|
|
@@ -194,7 +346,7 @@ export class RelTextfield extends LitElement {
|
|
|
194
346
|
|
|
195
347
|
return html`
|
|
196
348
|
<div class="${wrapperClasses}">
|
|
197
|
-
${this.label
|
|
349
|
+
${!this.floatingLabel && this.label
|
|
198
350
|
? html`<label class="textfield-label" for="${this.uniqueId}">${this.label}</label>`
|
|
199
351
|
: ""}
|
|
200
352
|
|
|
@@ -203,8 +355,13 @@ export class RelTextfield extends LitElement {
|
|
|
203
355
|
? "disabled"
|
|
204
356
|
: ""}"
|
|
205
357
|
>
|
|
358
|
+
${this.floatingLabel && this.label
|
|
359
|
+
? html`<label
|
|
360
|
+
class="textfield-label${this.leftIcon ? ' has-left-icon' : ''}"
|
|
361
|
+
for="${this.uniqueId}">${this.label}</label>`
|
|
362
|
+
: ""}
|
|
206
363
|
${this.leftIcon
|
|
207
|
-
? html`<
|
|
364
|
+
? html`<rel-icon name="${this.leftIcon}" size="sm" class="icon left"></rel-icon>`
|
|
208
365
|
: ""}
|
|
209
366
|
|
|
210
367
|
<input
|
|
@@ -221,7 +378,7 @@ export class RelTextfield extends LitElement {
|
|
|
221
378
|
/>
|
|
222
379
|
|
|
223
380
|
${this.rightIcon
|
|
224
|
-
? html`<
|
|
381
|
+
? html`<rel-icon name="${this.rightIcon}" size="sm" class="icon right"></rel-icon>`
|
|
225
382
|
: ""}
|
|
226
383
|
</div>
|
|
227
384
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
2
|
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
3
4
|
|
|
4
5
|
export type ToastType = "default" | "error";
|
|
5
6
|
|
|
@@ -32,20 +33,20 @@ export class RelToast extends LitElement {
|
|
|
32
33
|
.toast {
|
|
33
34
|
display: inline-flex;
|
|
34
35
|
align-items: center;
|
|
35
|
-
gap: var(--rel-spacing-space-sm
|
|
36
|
-
background-color: var(--rel-
|
|
37
|
-
color: var(--rel-
|
|
38
|
-
font-family: var(--rel-fontFamilies-primary
|
|
39
|
-
font-size: var(--rel-fontSizes-md
|
|
40
|
-
border-radius: var(--rel-borders-radius-border-radius-200
|
|
41
|
-
padding: var(--rel-spacing-space-md
|
|
36
|
+
gap: var(--rel-spacing-space-sm);
|
|
37
|
+
background-color: var(--rel-color-text-primary);
|
|
38
|
+
color: var(--rel-color-bg-primary);
|
|
39
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
40
|
+
font-size: var(--rel-fontSizes-md);
|
|
41
|
+
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
42
|
+
padding: var(--rel-spacing-space-md);
|
|
42
43
|
box-shadow: var(--rel-shadows-shadow-300);
|
|
43
44
|
pointer-events: all;
|
|
44
45
|
animation: fadeInUp 0.25s ease;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.toast.error {
|
|
48
|
-
background-color: var(--rel-
|
|
49
|
+
background-color: var(--rel-error-surface-default);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
.toast.hidden {
|
|
@@ -61,7 +62,7 @@ export class RelToast extends LitElement {
|
|
|
61
62
|
.toast-action {
|
|
62
63
|
background: transparent;
|
|
63
64
|
border: none;
|
|
64
|
-
color:
|
|
65
|
+
color: inherit;
|
|
65
66
|
font-weight: 600;
|
|
66
67
|
font-size: 0.85rem;
|
|
67
68
|
cursor: pointer;
|
|
@@ -74,7 +75,7 @@ export class RelToast extends LitElement {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
.toast-action:focus-visible {
|
|
77
|
-
outline: 2px solid
|
|
78
|
+
outline: 2px solid #FFFFFF;
|
|
78
79
|
outline-offset: 2px;
|
|
79
80
|
border-radius: 2px;
|
|
80
81
|
}
|
|
@@ -87,8 +88,8 @@ export class RelToast extends LitElement {
|
|
|
87
88
|
font-size: 1rem;
|
|
88
89
|
cursor: pointer;
|
|
89
90
|
line-height: 1;
|
|
90
|
-
padding: var(--rel-spacing-space-2xs
|
|
91
|
-
margin-left: var(--rel-spacing-space-2xs
|
|
91
|
+
padding: var(--rel-spacing-space-2xs);
|
|
92
|
+
margin-left: var(--rel-spacing-space-2xs);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
.toast-close:hover {
|
|
@@ -96,11 +97,18 @@ export class RelToast extends LitElement {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
.toast-close:focus-visible {
|
|
99
|
-
outline: 2px solid
|
|
100
|
+
outline: 2px solid #FFFFFF;
|
|
100
101
|
outline-offset: 2px;
|
|
101
102
|
border-radius: 2px;
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
/* Dark mode overrides */
|
|
106
|
+
:host-context([data-theme="dark"]) .toast.error,
|
|
107
|
+
:host-context(.dark) .toast.error {
|
|
108
|
+
background-color: var(--rel-error-surface-default);
|
|
109
|
+
color: #ffffff;
|
|
110
|
+
}
|
|
111
|
+
|
|
104
112
|
@media (prefers-reduced-motion: reduce) {
|
|
105
113
|
.toast {
|
|
106
114
|
animation: none;
|