@reliability-design/web 1.0.2
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.stories.ts +313 -0
- package/dist/components/rel-accordion/rel-accordion.ts +114 -0
- package/dist/components/rel-alert/rel-alert.stories.ts +412 -0
- package/dist/components/rel-alert/rel-alert.ts +194 -0
- package/dist/components/rel-avatar/rel-avatar.stories.ts +327 -0
- package/dist/components/rel-avatar/rel-avatar.ts +100 -0
- package/dist/components/rel-badge/rel-badge.stories.ts +350 -0
- package/dist/components/rel-badge/rel-badge.ts +70 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +306 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +97 -0
- package/dist/components/rel-button/rel-button.stories.ts +356 -0
- package/dist/components/rel-button/rel-button.ts +204 -0
- package/dist/components/rel-card/rel-card.stories.ts +299 -0
- package/dist/components/rel-card/rel-card.ts +33 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +368 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +80 -0
- package/dist/components/rel-checkbox/rel-checkbox.stories.ts +414 -0
- package/dist/components/rel-checkbox/rel-checkbox.ts +164 -0
- package/dist/components/rel-chip/rel-chip.stories.ts +552 -0
- package/dist/components/rel-chip/rel-chip.ts +261 -0
- package/dist/components/rel-container/rel-container.stories.ts +239 -0
- package/dist/components/rel-container/rel-container.ts +74 -0
- package/dist/components/rel-divider/rel-divider.stories.ts +229 -0
- package/dist/components/rel-divider/rel-divider.ts +44 -0
- package/dist/components/rel-layout/rel-layout.stories.ts +713 -0
- package/dist/components/rel-layout/rel-layout.ts +60 -0
- package/dist/components/rel-menu/rel-menu.stories.ts +910 -0
- package/dist/components/rel-menu/rel-menu.ts +319 -0
- package/dist/components/rel-progress/rel-progress.stories.ts +817 -0
- package/dist/components/rel-progress/rel-progress.ts +182 -0
- package/dist/components/rel-radio/rel-radio.stories.ts +1048 -0
- package/dist/components/rel-radio/rel-radio.ts +187 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +1079 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +150 -0
- package/dist/components/rel-select/rel-select.stories.ts +1201 -0
- package/dist/components/rel-select/rel-select.ts +261 -0
- package/dist/components/rel-slider/rel-slider.stories.ts +730 -0
- package/dist/components/rel-slider/rel-slider.ts +440 -0
- package/dist/components/rel-snackbar/rel-snackbar.stories.ts +808 -0
- package/dist/components/rel-snackbar/rel-snackbar.ts +212 -0
- package/dist/components/rel-stepper/rel-stepper.stories.ts +752 -0
- package/dist/components/rel-stepper/rel-stepper.ts +425 -0
- package/dist/components/rel-switch/rel-switch.stories.ts +441 -0
- package/dist/components/rel-switch/rel-switch.ts +161 -0
- package/dist/components/rel-tab/rel-tab.stories.ts +492 -0
- package/dist/components/rel-tab/rel-tab.ts +145 -0
- package/dist/components/rel-textfield/rel-textfield.stories.ts +710 -0
- package/dist/components/rel-textfield/rel-textfield.ts +224 -0
- package/dist/components/rel-toast/rel-toast.stories.ts +394 -0
- package/dist/components/rel-toast/rel-toast.ts +154 -0
- package/dist/components/rel-tooltip/rel-tooltip.stories.ts +364 -0
- package/dist/components/rel-tooltip/rel-tooltip.ts +80 -0
- package/dist/index.d.mts +372 -0
- package/dist/index.d.ts +372 -0
- package/dist/index.js +4593 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4544 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles/vars.css +184 -0
- package/package.json +32 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,4544 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/components/rel-accordion/rel-accordion.ts
|
|
13
|
+
import { LitElement, html, css } from "lit";
|
|
14
|
+
import { customElement, property } from "lit/decorators.js";
|
|
15
|
+
var RelAccordion = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.title = "Accordion";
|
|
19
|
+
this.open = false;
|
|
20
|
+
}
|
|
21
|
+
toggle() {
|
|
22
|
+
this.open = !this.open;
|
|
23
|
+
}
|
|
24
|
+
chevron() {
|
|
25
|
+
return html`
|
|
26
|
+
<svg viewBox="0 0 24 24">
|
|
27
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
28
|
+
</svg>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html`
|
|
33
|
+
<div class="accordion">
|
|
34
|
+
<div class="header" @click=${this.toggle}>
|
|
35
|
+
<div class="title">${this.title}</div>
|
|
36
|
+
|
|
37
|
+
<div class="icon ${this.open ? "rotated" : ""}">
|
|
38
|
+
${this.chevron()}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
${this.open ? html`<div class="body"><slot></slot></div>` : ""}
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
RelAccordion.styles = css`
|
|
48
|
+
:host {
|
|
49
|
+
display: block;
|
|
50
|
+
width: 100%;
|
|
51
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.accordion {
|
|
55
|
+
background: var(--rel-colors-white);
|
|
56
|
+
border: 1px solid var(--rel-border-default);
|
|
57
|
+
border-radius: var(--rel-borders-radius-border-radius-200); /* 8px */
|
|
58
|
+
box-shadow: var(--rel-shadows-shadow-100);
|
|
59
|
+
transition: all 0.2s ease;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* HEADER --------------------------------------------------- */
|
|
64
|
+
.header {
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: var(--rel-spacing-space-md); /* 16px */
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
user-select: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.title {
|
|
74
|
+
font-size: var(--rel-fontSizes-lg); /* 20px */
|
|
75
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
76
|
+
color: var(--rel-colors-black);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ICON ----------------------------------------------------- */
|
|
80
|
+
.icon {
|
|
81
|
+
width: 20px;
|
|
82
|
+
height: 20px;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
transition: transform 0.25s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.icon svg {
|
|
90
|
+
width: 20px;
|
|
91
|
+
height: 20px;
|
|
92
|
+
stroke: var(--rel-colors-gray-primary);
|
|
93
|
+
stroke-width: 2;
|
|
94
|
+
fill: none;
|
|
95
|
+
stroke-linecap: round;
|
|
96
|
+
stroke-linejoin: round;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.rotated {
|
|
100
|
+
transform: rotate(180deg);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* BODY ------------------------------------------------------ */
|
|
104
|
+
.body {
|
|
105
|
+
padding: var(--rel-spacing-space-xl) var(--rel-spacing-space-md)
|
|
106
|
+
var(--rel-spacing-space-lg);
|
|
107
|
+
/* 24px 16px 20px */
|
|
108
|
+
font-size: var(--rel-fontSizes-lg); /* 20px */
|
|
109
|
+
color: var(--rel-colors-gray-primary);
|
|
110
|
+
animation: fadeIn 0.2s ease;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@keyframes fadeIn {
|
|
114
|
+
from {
|
|
115
|
+
opacity: 0;
|
|
116
|
+
transform: translateY(-4px);
|
|
117
|
+
}
|
|
118
|
+
to {
|
|
119
|
+
opacity: 1;
|
|
120
|
+
transform: translateY(0);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
__decorateClass([
|
|
125
|
+
property({ type: String })
|
|
126
|
+
], RelAccordion.prototype, "title", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
property({ type: Boolean })
|
|
129
|
+
], RelAccordion.prototype, "open", 2);
|
|
130
|
+
RelAccordion = __decorateClass([
|
|
131
|
+
customElement("rel-accordion")
|
|
132
|
+
], RelAccordion);
|
|
133
|
+
|
|
134
|
+
// src/components/rel-alert/rel-alert.ts
|
|
135
|
+
import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
|
|
136
|
+
import { customElement as customElement2, property as property2 } from "lit/decorators.js";
|
|
137
|
+
var RelAlert = class extends LitElement2 {
|
|
138
|
+
constructor() {
|
|
139
|
+
super(...arguments);
|
|
140
|
+
this.type = "neutral";
|
|
141
|
+
this.message1 = "";
|
|
142
|
+
this.dismissible = true;
|
|
143
|
+
this.dismissed = false;
|
|
144
|
+
}
|
|
145
|
+
get iconSvg() {
|
|
146
|
+
switch (this.type) {
|
|
147
|
+
case "info":
|
|
148
|
+
return html2`<svg viewBox="0 0 18 18" fill="none">
|
|
149
|
+
<path
|
|
150
|
+
d="M9 4.75c-.24 0-.44.08-.61.25-.16.16-.24.36-.24.6 0 .24.08.44.24.61.17.17.37.25.61.25.24 0 .44-.08.61-.25.17-.16.24-.36.24-.61 0-.24-.08-.44-.24-.6-.17-.17-.37-.25-.61-.25Zm.85 3.4h-1.7v5.1h1.7V8.15ZM9 .5c1.18 0 2.29.22 3.32.67 1.03.45 1.93 1.05 2.69 1.81.75.76 1.35 1.66 1.8 2.69.46 1.03.68 2.14.68 3.33 0 1.18-.22 2.29-.68 3.32-.45 1.04-1.05 1.93-1.8 2.69-.76.75-1.66 1.35-2.69 1.8-1.04.46-2.15.68-3.32.68-1.18 0-2.29-.22-3.32-.68-1.04-.45-1.93-1.05-2.69-1.8-.75-.76-1.35-1.66-1.8-2.69C1.92 11.28 1.7 10.17 1.7 9c0-1.18.22-2.29.68-3.32.45-1.04 1.05-1.93 1.8-2.69.76-.75 1.66-1.35 2.69-1.8C6.71.73 7.82.5 9 .5Z"
|
|
151
|
+
fill="#4A90E2"
|
|
152
|
+
/>
|
|
153
|
+
</svg>`;
|
|
154
|
+
case "success":
|
|
155
|
+
return html2`<svg viewBox="0 0 18 18" fill="none">
|
|
156
|
+
<path
|
|
157
|
+
d="M7.81 12.91 13.8 6.92l-1.19-1.19L7.81 10.53 5.39 8.11 4.2 9.3l3.61 3.61ZM9 17.5a8.49 8.49 0 1 1 0-17 8.49 8.49 0 0 1 0 17Z"
|
|
158
|
+
fill="#4CAA47"
|
|
159
|
+
/>
|
|
160
|
+
</svg>`;
|
|
161
|
+
case "warning":
|
|
162
|
+
return html2`<svg viewBox="0 0 16 14" fill="none">
|
|
163
|
+
<path
|
|
164
|
+
d="M0 14 8 0l8 14H0Zm2.51-1.47h10.98L8 2.95 2.51 12.53ZM8 11.79c.21 0 .38-.07.52-.21.14-.14.21-.31.21-.52 0-.21-.07-.38-.21-.52A.7.7 0 0 0 8 10.32a.7.7 0 0 0-.52.21c-.14.14-.21.31-.21.52 0 .21.07.38.21.52.14.14.31.21.52.21Zm-.73-2.21h1.46V5.89H7.27v3.69Z"
|
|
165
|
+
fill="#FF6D00"
|
|
166
|
+
/>
|
|
167
|
+
</svg>`;
|
|
168
|
+
case "error":
|
|
169
|
+
return html2`<svg viewBox="0 0 18 18" fill="none">
|
|
170
|
+
<path
|
|
171
|
+
d="M9 13.25c.24 0 .44-.08.61-.24.17-.17.24-.38.24-.61 0-.24-.08-.44-.24-.61-.17-.16-.37-.24-.61-.24-.24 0-.44.08-.61.24-.17.17-.24.37-.24.61 0 .24.08.44.24.61.17.16.37.24.61.24Zm-.85-3.4h1.7V4.75h-1.7v5.1ZM9 17.5c-1.18 0-2.29-.23-3.32-.68C4.64 16.37 3.74 15.77 2.99 15.02c-.75-.75-1.35-1.65-1.8-2.69C.73 11.29.5 10.18.5 9c0-1.18.23-2.29.68-3.32.45-1.03 1.05-1.93 1.8-2.69C5.03 1.23 5.94.63 6.97.18 8 .72 9.12.5 10.3.5c1.17 0 2.28.23 3.32.68 1.03.45 1.93 1.05 2.68 1.8.75.76 1.35 1.66 1.8 2.69.46 1.03.68 2.14.68 3.33 0 1.18-.22 2.29-.68 3.32-.45 1.04-1.05 1.93-1.8 2.69-.76.75-1.66 1.35-2.69 1.8-1.04.46-2.15.68-3.32.68Z"
|
|
172
|
+
fill="#C62828"
|
|
173
|
+
/>
|
|
174
|
+
</svg>`;
|
|
175
|
+
default:
|
|
176
|
+
return html2``;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
dismissAlert() {
|
|
180
|
+
this.dismissed = true;
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
if (this.dismissed) return null;
|
|
184
|
+
return html2`
|
|
185
|
+
<div class="rel-alert alert-${this.type}">
|
|
186
|
+
<div class="rel-icon">${this.iconSvg}</div>
|
|
187
|
+
|
|
188
|
+
<div class="rel-content">
|
|
189
|
+
<p class="rel-message1">${this.message1}</p>
|
|
190
|
+
|
|
191
|
+
${this.message2 ? html2`<p class="rel-message2">${this.message2}</p>` : ""}
|
|
192
|
+
${this.urlText && this.urlHref ? html2`<a class="rel-link" href="${this.urlHref}"
|
|
193
|
+
>${this.urlText}</a
|
|
194
|
+
>` : ""}
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
${this.dismissible ? html2`<button class="rel-close" @click=${this.dismissAlert}>
|
|
198
|
+
✕
|
|
199
|
+
</button>` : ""}
|
|
200
|
+
</div>
|
|
201
|
+
`;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
RelAlert.styles = css2`
|
|
205
|
+
:host {
|
|
206
|
+
display: block;
|
|
207
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.rel-alert {
|
|
211
|
+
display: flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
gap: var(--rel-spacing-space-xs); /* 8px */
|
|
214
|
+
padding: var(--rel-spacing-space-sm) var(--rel-spacing-space-md);
|
|
215
|
+
/* 12px vertical, 16px horizontal */
|
|
216
|
+
border-radius: var(--rel-borders-radius-border-radius-200); /* 8px */
|
|
217
|
+
width: fit-content;
|
|
218
|
+
min-width: 360px;
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.rel-content {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-direction: column;
|
|
225
|
+
gap: 4px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.rel-message1 {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
margin: 0;
|
|
232
|
+
font-size: var(--rel-fontSizes-md);
|
|
233
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.rel-message2 {
|
|
237
|
+
margin: 0;
|
|
238
|
+
font-size: var(--rel-fontSizes-sm);
|
|
239
|
+
font-weight: var(--rel-fontWeights-regular);
|
|
240
|
+
opacity: 0.9;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.rel-icon {
|
|
244
|
+
display: flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: center;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.rel-icon svg {
|
|
250
|
+
width: 16px;
|
|
251
|
+
height: 16px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.rel-link {
|
|
255
|
+
font-size: var(--rel-fontSizes-sm);
|
|
256
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
257
|
+
text-decoration: underline;
|
|
258
|
+
margin-top: 2px;
|
|
259
|
+
color: inherit;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.rel-close {
|
|
263
|
+
margin-left: auto;
|
|
264
|
+
background: none;
|
|
265
|
+
border: none;
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
width: 16px;
|
|
268
|
+
height: 16px;
|
|
269
|
+
opacity: 0.6;
|
|
270
|
+
padding: 0;
|
|
271
|
+
display: flex;
|
|
272
|
+
align-items: center;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.rel-close:hover {
|
|
277
|
+
opacity: 1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/* COLORS — using token system */
|
|
281
|
+
|
|
282
|
+
.alert-info {
|
|
283
|
+
background: var(--rel-background-info);
|
|
284
|
+
color: var(--rel-text-info);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.alert-success {
|
|
288
|
+
background: var(--rel-background-success);
|
|
289
|
+
color: var(--rel-text-success);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.alert-warning {
|
|
293
|
+
background: var(--rel-background-warning);
|
|
294
|
+
color: var(--rel-text-warning);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.alert-error {
|
|
298
|
+
background: var(--rel-background-error);
|
|
299
|
+
color: var(--rel-text-error);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.alert-neutral {
|
|
303
|
+
background: var(--rel-colors-white);
|
|
304
|
+
color: var(--rel-text-primary);
|
|
305
|
+
border: 1px solid var(--rel-border-default);
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
__decorateClass([
|
|
309
|
+
property2({ type: String })
|
|
310
|
+
], RelAlert.prototype, "type", 2);
|
|
311
|
+
__decorateClass([
|
|
312
|
+
property2({ type: String })
|
|
313
|
+
], RelAlert.prototype, "message1", 2);
|
|
314
|
+
__decorateClass([
|
|
315
|
+
property2({ type: String })
|
|
316
|
+
], RelAlert.prototype, "message2", 2);
|
|
317
|
+
__decorateClass([
|
|
318
|
+
property2({ type: String })
|
|
319
|
+
], RelAlert.prototype, "urlText", 2);
|
|
320
|
+
__decorateClass([
|
|
321
|
+
property2({ type: String })
|
|
322
|
+
], RelAlert.prototype, "urlHref", 2);
|
|
323
|
+
__decorateClass([
|
|
324
|
+
property2({ type: Boolean })
|
|
325
|
+
], RelAlert.prototype, "dismissible", 2);
|
|
326
|
+
__decorateClass([
|
|
327
|
+
property2({ type: Boolean })
|
|
328
|
+
], RelAlert.prototype, "dismissed", 2);
|
|
329
|
+
RelAlert = __decorateClass([
|
|
330
|
+
customElement2("rel-alert")
|
|
331
|
+
], RelAlert);
|
|
332
|
+
|
|
333
|
+
// src/components/rel-avatar/rel-avatar.ts
|
|
334
|
+
import { LitElement as LitElement3, html as html3, css as css3 } from "lit";
|
|
335
|
+
import { customElement as customElement3, property as property3 } from "lit/decorators.js";
|
|
336
|
+
var RelAvatar = class extends LitElement3 {
|
|
337
|
+
constructor() {
|
|
338
|
+
super(...arguments);
|
|
339
|
+
this.size = "md";
|
|
340
|
+
this.type = "image";
|
|
341
|
+
this.src = "";
|
|
342
|
+
this.text = "";
|
|
343
|
+
this.alt = "Avatar";
|
|
344
|
+
}
|
|
345
|
+
render() {
|
|
346
|
+
return html3`
|
|
347
|
+
<div class="avatar avatar-${this.size}">
|
|
348
|
+
${this.type === "image" ? html3`<img src=${this.src} alt=${this.alt} />` : this.type === "text" ? html3`<span>${this.text}</span>` : html3`<span class="icon-slot"><slot></slot></span>`}
|
|
349
|
+
</div>
|
|
350
|
+
`;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
RelAvatar.styles = css3`
|
|
354
|
+
:host {
|
|
355
|
+
display: inline-flex;
|
|
356
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.avatar {
|
|
360
|
+
display: inline-flex;
|
|
361
|
+
align-items: center;
|
|
362
|
+
justify-content: center;
|
|
363
|
+
border-radius: 50%;
|
|
364
|
+
overflow: hidden;
|
|
365
|
+
|
|
366
|
+
background-color: var(--rel-colors-gray-heading);
|
|
367
|
+
color: var(--rel-colors-white);
|
|
368
|
+
font-weight: var(--rel-fontWeights-bold);
|
|
369
|
+
|
|
370
|
+
user-select: none;
|
|
371
|
+
text-transform: uppercase;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* -------------------------
|
|
375
|
+
CORRECTED SIZE CLASSES
|
|
376
|
+
------------------------- */
|
|
377
|
+
.avatar-lg {
|
|
378
|
+
width: 40px;
|
|
379
|
+
height: 40px;
|
|
380
|
+
font-size: var(--rel-fontSizes-xl);
|
|
381
|
+
line-height: 38px;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.avatar-md {
|
|
385
|
+
width: 32px;
|
|
386
|
+
height: 32px;
|
|
387
|
+
font-size: var(--rel-fontSizes-lg);
|
|
388
|
+
line-height: 32px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.avatar-sm {
|
|
392
|
+
width: 24px;
|
|
393
|
+
height: 24px;
|
|
394
|
+
font-size: var(--rel-fontSizes-md);
|
|
395
|
+
line-height: 24px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.avatar-xs {
|
|
399
|
+
width: 18px;
|
|
400
|
+
height: 18px;
|
|
401
|
+
font-size: var(--rel-fontSizes-xs);
|
|
402
|
+
line-height: 18px;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
img {
|
|
406
|
+
width: 100%;
|
|
407
|
+
height: 100%;
|
|
408
|
+
object-fit: cover;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.icon-slot {
|
|
412
|
+
width: 100%;
|
|
413
|
+
height: 100%;
|
|
414
|
+
display: inline-flex;
|
|
415
|
+
align-items: center;
|
|
416
|
+
justify-content: center;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.icon-slot ::slotted(*) {
|
|
420
|
+
font-size: var(--rel-fontSizes-md);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.icon-slot ::slotted(svg) {
|
|
424
|
+
width: 50%;
|
|
425
|
+
height: 50%;
|
|
426
|
+
}
|
|
427
|
+
`;
|
|
428
|
+
__decorateClass([
|
|
429
|
+
property3({ type: String })
|
|
430
|
+
], RelAvatar.prototype, "size", 2);
|
|
431
|
+
__decorateClass([
|
|
432
|
+
property3({ type: String })
|
|
433
|
+
], RelAvatar.prototype, "type", 2);
|
|
434
|
+
__decorateClass([
|
|
435
|
+
property3({ type: String })
|
|
436
|
+
], RelAvatar.prototype, "src", 2);
|
|
437
|
+
__decorateClass([
|
|
438
|
+
property3({ type: String })
|
|
439
|
+
], RelAvatar.prototype, "text", 2);
|
|
440
|
+
__decorateClass([
|
|
441
|
+
property3({ type: String })
|
|
442
|
+
], RelAvatar.prototype, "alt", 2);
|
|
443
|
+
RelAvatar = __decorateClass([
|
|
444
|
+
customElement3("rel-avatar")
|
|
445
|
+
], RelAvatar);
|
|
446
|
+
|
|
447
|
+
// src/components/rel-badge/rel-badge.ts
|
|
448
|
+
import { LitElement as LitElement4, html as html4, css as css4 } from "lit";
|
|
449
|
+
import { customElement as customElement4, property as property4 } from "lit/decorators.js";
|
|
450
|
+
var RelBadge = class extends LitElement4 {
|
|
451
|
+
constructor() {
|
|
452
|
+
super(...arguments);
|
|
453
|
+
this.number = "";
|
|
454
|
+
this.size = "md";
|
|
455
|
+
this.variant = "number";
|
|
456
|
+
}
|
|
457
|
+
get classes() {
|
|
458
|
+
return ["badge", `badge-${this.size}`, `badge-${this.variant}`].join(" ");
|
|
459
|
+
}
|
|
460
|
+
render() {
|
|
461
|
+
const isDot = this.variant === "dot";
|
|
462
|
+
return html4`
|
|
463
|
+
<span class="${this.classes}">${isDot ? "" : this.number}</span>
|
|
464
|
+
`;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
RelBadge.styles = css4`
|
|
468
|
+
:host {
|
|
469
|
+
display: inline-flex;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.badge {
|
|
473
|
+
display: inline-flex;
|
|
474
|
+
align-items: center;
|
|
475
|
+
justify-content: center;
|
|
476
|
+
font-family: "Poppins", sans-serif;
|
|
477
|
+
font-weight: 600;
|
|
478
|
+
background-color: var(--rel-colors-red-primary);
|
|
479
|
+
color: var(--rel-colors-white);
|
|
480
|
+
border-radius: 50%;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* PERFECT CIRCLES — FIXED SIZES */
|
|
484
|
+
.badge-sm {
|
|
485
|
+
width: 20px;
|
|
486
|
+
height: 20px;
|
|
487
|
+
font-size: 12px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.badge-md {
|
|
491
|
+
width: 28px;
|
|
492
|
+
height: 28px;
|
|
493
|
+
font-size: 14px;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.badge-lg {
|
|
497
|
+
width: 40px;
|
|
498
|
+
height: 40px;
|
|
499
|
+
font-size: 20px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/* DOT — smaller circle */
|
|
503
|
+
.badge-dot {
|
|
504
|
+
width: 10px !important;
|
|
505
|
+
height: 10px !important;
|
|
506
|
+
padding: 0 !important;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.badge-number {
|
|
510
|
+
display: flex;
|
|
511
|
+
align-items: center;
|
|
512
|
+
justify-content: center;
|
|
513
|
+
}
|
|
514
|
+
`;
|
|
515
|
+
__decorateClass([
|
|
516
|
+
property4({ type: String })
|
|
517
|
+
], RelBadge.prototype, "number", 2);
|
|
518
|
+
__decorateClass([
|
|
519
|
+
property4({ type: String })
|
|
520
|
+
], RelBadge.prototype, "size", 2);
|
|
521
|
+
__decorateClass([
|
|
522
|
+
property4({ type: String })
|
|
523
|
+
], RelBadge.prototype, "variant", 2);
|
|
524
|
+
RelBadge = __decorateClass([
|
|
525
|
+
customElement4("rel-badge")
|
|
526
|
+
], RelBadge);
|
|
527
|
+
|
|
528
|
+
// src/components/rel-breadcrumb/rel-breadcrumb.ts
|
|
529
|
+
import { LitElement as LitElement5, html as html5, css as css5 } from "lit";
|
|
530
|
+
import { customElement as customElement5, property as property5 } from "lit/decorators.js";
|
|
531
|
+
var RelBreadcrumbs = class extends LitElement5 {
|
|
532
|
+
constructor() {
|
|
533
|
+
super(...arguments);
|
|
534
|
+
this.items = [];
|
|
535
|
+
}
|
|
536
|
+
render() {
|
|
537
|
+
return html5`
|
|
538
|
+
<nav aria-label="Breadcrumb">
|
|
539
|
+
<ol>
|
|
540
|
+
${this.items.map((item, index) => {
|
|
541
|
+
const last = index === this.items.length - 1;
|
|
542
|
+
return html5`
|
|
543
|
+
<li>
|
|
544
|
+
${item.url && !last ? html5`<a href="${item.url}">${item.label}</a>` : html5`<span class="current">${item.label}</span>`}
|
|
545
|
+
${!last ? html5`
|
|
546
|
+
<svg viewBox="0 0 24 24">
|
|
547
|
+
<polyline
|
|
548
|
+
points="9 18 15 12 9 6"
|
|
549
|
+
fill="none"
|
|
550
|
+
stroke="currentColor"
|
|
551
|
+
stroke-width="2"
|
|
552
|
+
stroke-linecap="round"
|
|
553
|
+
stroke-linejoin="round"
|
|
554
|
+
></polyline>
|
|
555
|
+
</svg>
|
|
556
|
+
` : ""}
|
|
557
|
+
</li>
|
|
558
|
+
`;
|
|
559
|
+
})}
|
|
560
|
+
</ol>
|
|
561
|
+
</nav>
|
|
562
|
+
`;
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
RelBreadcrumbs.styles = css5`
|
|
566
|
+
:host {
|
|
567
|
+
display: block;
|
|
568
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
569
|
+
font-size: var(--rel-fontSizes-md);
|
|
570
|
+
color: var(--rel-colors-gray-text);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
nav {
|
|
574
|
+
display: block;
|
|
575
|
+
width: 100%;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
ol {
|
|
579
|
+
display: flex;
|
|
580
|
+
flex-wrap: wrap;
|
|
581
|
+
padding: 0;
|
|
582
|
+
margin: 0;
|
|
583
|
+
list-style: none;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
li {
|
|
587
|
+
display: flex;
|
|
588
|
+
align-items: center;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
a {
|
|
592
|
+
text-decoration: none;
|
|
593
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
594
|
+
color: var(--rel-colors-gray-heading);
|
|
595
|
+
transition: color 0.2s ease;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
a:hover {
|
|
599
|
+
text-decoration: underline;
|
|
600
|
+
color: var(--rel-colors-primary);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.current {
|
|
604
|
+
font-weight: var(--rel-fontWeights-bold);
|
|
605
|
+
color: var(--rel-colors-black);
|
|
606
|
+
cursor: default;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
svg {
|
|
610
|
+
stroke: var(--rel-colors-gray-text);
|
|
611
|
+
width: 16px;
|
|
612
|
+
height: 16px;
|
|
613
|
+
margin: 0 10px;
|
|
614
|
+
}
|
|
615
|
+
`;
|
|
616
|
+
__decorateClass([
|
|
617
|
+
property5({ type: Array })
|
|
618
|
+
], RelBreadcrumbs.prototype, "items", 2);
|
|
619
|
+
RelBreadcrumbs = __decorateClass([
|
|
620
|
+
customElement5("rel-breadcrumbs")
|
|
621
|
+
], RelBreadcrumbs);
|
|
622
|
+
|
|
623
|
+
// src/components/rel-button/rel-button.ts
|
|
624
|
+
import { LitElement as LitElement6, html as html6, css as css6 } from "lit";
|
|
625
|
+
import { customElement as customElement6, property as property6 } from "lit/decorators.js";
|
|
626
|
+
var RelButton = class extends LitElement6 {
|
|
627
|
+
constructor() {
|
|
628
|
+
super(...arguments);
|
|
629
|
+
this.variant = "default";
|
|
630
|
+
this.tone = "default";
|
|
631
|
+
this.size = "medium";
|
|
632
|
+
this.border = "corner-radius";
|
|
633
|
+
this.disabled = false;
|
|
634
|
+
}
|
|
635
|
+
get classes() {
|
|
636
|
+
return [
|
|
637
|
+
`btn-${this.variant}`,
|
|
638
|
+
`tone-${this.tone}`,
|
|
639
|
+
`size-${this.size}`,
|
|
640
|
+
`border-${this.border}`,
|
|
641
|
+
this.disabled ? "btn-disabled" : ""
|
|
642
|
+
].join(" ");
|
|
643
|
+
}
|
|
644
|
+
render() {
|
|
645
|
+
return html6`
|
|
646
|
+
<button class="${this.classes}" ?disabled=${this.disabled}>
|
|
647
|
+
<slot></slot>
|
|
648
|
+
</button>
|
|
649
|
+
`;
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
RelButton.styles = css6`
|
|
653
|
+
:host {
|
|
654
|
+
display: inline-flex;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
button {
|
|
658
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
659
|
+
font-weight: var(--rel-fontWeights-semibold);
|
|
660
|
+
cursor: pointer;
|
|
661
|
+
border: none;
|
|
662
|
+
transition: all 0.15s ease;
|
|
663
|
+
display: inline-flex;
|
|
664
|
+
align-items: center;
|
|
665
|
+
justify-content: center;
|
|
666
|
+
gap: var(--rel-spacing-space-2xs);
|
|
667
|
+
outline: none;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/* -------------------------
|
|
671
|
+
SIZES (Figma)
|
|
672
|
+
-------------------------- */
|
|
673
|
+
.size-small {
|
|
674
|
+
height: 32px;
|
|
675
|
+
padding: 0 var(--rel-spacing-space-md);
|
|
676
|
+
font-size: var(--rel-fontSizes-sm);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.size-medium {
|
|
680
|
+
height: 40px;
|
|
681
|
+
padding: 0 var(--rel-spacing-space-lg);
|
|
682
|
+
font-size: var(--rel-fontSizes-md);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.size-large {
|
|
686
|
+
height: 48px;
|
|
687
|
+
padding: 0 var(--rel-spacing-space-xl);
|
|
688
|
+
font-size: var(--rel-fontSizes-lg);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/* -------------------------
|
|
692
|
+
BORDER RADII (Tokens)
|
|
693
|
+
-------------------------- */
|
|
694
|
+
.border-corner-radius {
|
|
695
|
+
border-radius: var(--rel-borders-radius-border-radius-500);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.border-small-corner-radius {
|
|
699
|
+
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.border-no-corner-radius {
|
|
703
|
+
border-radius: var(--rel-borders-radius-border-radius-0);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/* -------------------------
|
|
707
|
+
DISABLED STATE
|
|
708
|
+
-------------------------- */
|
|
709
|
+
:host([disabled]) button,
|
|
710
|
+
button:disabled {
|
|
711
|
+
cursor: not-allowed;
|
|
712
|
+
background-color: var(--rel-colors-gray-border) !important;
|
|
713
|
+
color: var(--rel-colors-gray-disabled-text) !important;
|
|
714
|
+
border-color: var(--rel-colors-gray-border) !important;
|
|
715
|
+
opacity: 1;
|
|
716
|
+
pointer-events: none;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/* -------------------------
|
|
720
|
+
VARIANTS & TONES
|
|
721
|
+
-------------------------- */
|
|
722
|
+
|
|
723
|
+
/* DEFAULT */
|
|
724
|
+
.btn-default.tone-default {
|
|
725
|
+
background: var(--rel-colors-gray-primary);
|
|
726
|
+
color: var(--rel-colors-white);
|
|
727
|
+
}
|
|
728
|
+
.btn-default.tone-critical {
|
|
729
|
+
background: var(--rel-colors-red-primary);
|
|
730
|
+
color: var(--rel-colors-white);
|
|
731
|
+
}
|
|
732
|
+
.btn-default.tone-success {
|
|
733
|
+
background: var(--rel-colors-green-success);
|
|
734
|
+
color: var(--rel-colors-white);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/* PRIMARY */
|
|
738
|
+
.btn-primary.tone-default {
|
|
739
|
+
background: var(--rel-colors-green-primary);
|
|
740
|
+
color: var(--rel-colors-black);
|
|
741
|
+
}
|
|
742
|
+
.btn-primary.tone-critical {
|
|
743
|
+
background: var(--rel-colors-red-primary);
|
|
744
|
+
color: var(--rel-colors-white);
|
|
745
|
+
}
|
|
746
|
+
.btn-primary.tone-success {
|
|
747
|
+
background: var(--rel-colors-green-success);
|
|
748
|
+
color: var(--rel-colors-white);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/* SECONDARY */
|
|
752
|
+
.btn-secondary {
|
|
753
|
+
background: var(--rel-colors-white);
|
|
754
|
+
border: 1px solid var(--rel-colors-black);
|
|
755
|
+
color: var(--rel-colors-black);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/* TEXT */
|
|
759
|
+
.btn-text {
|
|
760
|
+
background: transparent;
|
|
761
|
+
color: var(--rel-colors-black);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/* LINK */
|
|
765
|
+
.btn-link {
|
|
766
|
+
background: transparent;
|
|
767
|
+
color: var(--rel-colors-blue-primary);
|
|
768
|
+
text-decoration: underline;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/* ICON */
|
|
772
|
+
.btn-icon {
|
|
773
|
+
width: 40px;
|
|
774
|
+
height: 40px;
|
|
775
|
+
padding: 0;
|
|
776
|
+
border-radius: 50%;
|
|
777
|
+
background: var(--rel-colors-gray-light);
|
|
778
|
+
color: var(--rel-colors-black);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/* -------------------------
|
|
782
|
+
STATES: Hover / Active
|
|
783
|
+
-------------------------- */
|
|
784
|
+
button:hover:not(.btn-disabled) {
|
|
785
|
+
filter: brightness(0.92);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
button:active:not(.btn-disabled) {
|
|
789
|
+
transform: scale(0.97);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/* TEXT BUTTON — hover border */
|
|
793
|
+
.btn-text:not(.btn-disabled):hover {
|
|
794
|
+
border: 1px solid var(--rel-colors-black);
|
|
795
|
+
text-decoration: none;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/* LINK BUTTON — hover border */
|
|
799
|
+
.btn-link:not(.btn-disabled):hover {
|
|
800
|
+
border: 1px solid var(--rel-colors-blue-primary);
|
|
801
|
+
text-decoration: underline;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/* -------------------------
|
|
805
|
+
FOCUS RING
|
|
806
|
+
-------------------------- */
|
|
807
|
+
button:focus-visible {
|
|
808
|
+
outline: 2px solid var(--rel-colors-blue-primary);
|
|
809
|
+
outline-offset: 2px;
|
|
810
|
+
}
|
|
811
|
+
`;
|
|
812
|
+
__decorateClass([
|
|
813
|
+
property6({ type: String })
|
|
814
|
+
], RelButton.prototype, "variant", 2);
|
|
815
|
+
__decorateClass([
|
|
816
|
+
property6({ type: String })
|
|
817
|
+
], RelButton.prototype, "tone", 2);
|
|
818
|
+
__decorateClass([
|
|
819
|
+
property6({ type: String })
|
|
820
|
+
], RelButton.prototype, "size", 2);
|
|
821
|
+
__decorateClass([
|
|
822
|
+
property6({ type: String })
|
|
823
|
+
], RelButton.prototype, "border", 2);
|
|
824
|
+
__decorateClass([
|
|
825
|
+
property6({ type: Boolean, reflect: true })
|
|
826
|
+
], RelButton.prototype, "disabled", 2);
|
|
827
|
+
RelButton = __decorateClass([
|
|
828
|
+
customElement6("rel-button")
|
|
829
|
+
], RelButton);
|
|
830
|
+
|
|
831
|
+
// src/components/rel-card/rel-card.ts
|
|
832
|
+
import { LitElement as LitElement7, html as html7, css as css7 } from "lit";
|
|
833
|
+
import { customElement as customElement7 } from "lit/decorators.js";
|
|
834
|
+
var RelCard = class extends LitElement7 {
|
|
835
|
+
render() {
|
|
836
|
+
return html7` <div class="card"><slot></slot></div> `;
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
RelCard.styles = css7`
|
|
840
|
+
:host {
|
|
841
|
+
display: block;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.card {
|
|
845
|
+
background-color: var(--rel-colors-white, #ffffff);
|
|
846
|
+
border-radius: var(--rel-borderRadius-lg, 12px);
|
|
847
|
+
padding: var(--rel-spacing-space-md, 16px);
|
|
848
|
+
|
|
849
|
+
box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.3),
|
|
850
|
+
0px 6px 10px 4px rgba(0, 0, 0, 0.15);
|
|
851
|
+
|
|
852
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
853
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.card:hover {
|
|
857
|
+
transform: translateY(-3px);
|
|
858
|
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.35),
|
|
859
|
+
0px 8px 14px 4px rgba(0, 0, 0, 0.2);
|
|
860
|
+
}
|
|
861
|
+
`;
|
|
862
|
+
RelCard = __decorateClass([
|
|
863
|
+
customElement7("rel-card")
|
|
864
|
+
], RelCard);
|
|
865
|
+
|
|
866
|
+
// src/components/rel-cardmedia/rel-cardmedia.ts
|
|
867
|
+
import { LitElement as LitElement8, html as html8, css as css8 } from "lit";
|
|
868
|
+
import { customElement as customElement8, property as property7 } from "lit/decorators.js";
|
|
869
|
+
var RelCardMedia = class extends LitElement8 {
|
|
870
|
+
constructor() {
|
|
871
|
+
super(...arguments);
|
|
872
|
+
this.imageSrc = "";
|
|
873
|
+
this.imageAlt = "Card image";
|
|
874
|
+
this.title = "";
|
|
875
|
+
this.subtitle = "";
|
|
876
|
+
}
|
|
877
|
+
render() {
|
|
878
|
+
return html8`
|
|
879
|
+
<div class="card-media">
|
|
880
|
+
${this.imageSrc ? html8`
|
|
881
|
+
<div class="card-image">
|
|
882
|
+
<img src="${this.imageSrc}" alt="${this.imageAlt}" />
|
|
883
|
+
</div>
|
|
884
|
+
` : null}
|
|
885
|
+
|
|
886
|
+
<div class="card-content">
|
|
887
|
+
${this.title ? html8`<h3>${this.title}</h3>` : null}
|
|
888
|
+
${this.subtitle ? html8`<p>${this.subtitle}</p>` : null}
|
|
889
|
+
|
|
890
|
+
<!-- Slot for extra content such as buttons, descriptions, etc -->
|
|
891
|
+
<slot></slot>
|
|
892
|
+
</div>
|
|
893
|
+
</div>
|
|
894
|
+
`;
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
RelCardMedia.styles = css8`
|
|
898
|
+
:host {
|
|
899
|
+
display: block;
|
|
900
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.card-media {
|
|
904
|
+
background-color: var(--rel-colors-white, #ffffff);
|
|
905
|
+
border-radius: var(--rel-borderRadius-lg, 12px);
|
|
906
|
+
overflow: hidden;
|
|
907
|
+
|
|
908
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.3),
|
|
909
|
+
0px 8px 12px 6px rgba(0, 0, 0, 0.15);
|
|
910
|
+
|
|
911
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.card-media:hover {
|
|
915
|
+
transform: translateY(-4px);
|
|
916
|
+
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.35),
|
|
917
|
+
0px 10px 16px 6px rgba(0, 0, 0, 0.2);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.card-image img {
|
|
921
|
+
display: block;
|
|
922
|
+
width: 100%;
|
|
923
|
+
height: auto;
|
|
924
|
+
object-fit: cover;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.card-content {
|
|
928
|
+
padding: var(--rel-spacing-space-md, 16px);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
.card-content h3 {
|
|
932
|
+
margin: 0 0 4px 0;
|
|
933
|
+
font-size: var(--rel-fontSizes-md, 16px);
|
|
934
|
+
font-weight: var(--rel-fontWeights-semibold, 600);
|
|
935
|
+
color: var(--rel-colors-gray-heading, #2b2b2b);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.card-content p {
|
|
939
|
+
margin: 0 0 8px 0;
|
|
940
|
+
font-size: var(--rel-fontSizes-sm, 14px);
|
|
941
|
+
color: var(--rel-colors-gray-text, #555);
|
|
942
|
+
}
|
|
943
|
+
`;
|
|
944
|
+
__decorateClass([
|
|
945
|
+
property7({ type: String })
|
|
946
|
+
], RelCardMedia.prototype, "imageSrc", 2);
|
|
947
|
+
__decorateClass([
|
|
948
|
+
property7({ type: String })
|
|
949
|
+
], RelCardMedia.prototype, "imageAlt", 2);
|
|
950
|
+
__decorateClass([
|
|
951
|
+
property7({ type: String })
|
|
952
|
+
], RelCardMedia.prototype, "title", 2);
|
|
953
|
+
__decorateClass([
|
|
954
|
+
property7({ type: String })
|
|
955
|
+
], RelCardMedia.prototype, "subtitle", 2);
|
|
956
|
+
RelCardMedia = __decorateClass([
|
|
957
|
+
customElement8("rel-card-media")
|
|
958
|
+
], RelCardMedia);
|
|
959
|
+
|
|
960
|
+
// src/components/rel-checkbox/rel-checkbox.ts
|
|
961
|
+
import { LitElement as LitElement9, html as html9, css as css9 } from "lit";
|
|
962
|
+
import { customElement as customElement9, property as property8 } from "lit/decorators.js";
|
|
963
|
+
var RelCheckbox = class extends LitElement9 {
|
|
964
|
+
constructor() {
|
|
965
|
+
super(...arguments);
|
|
966
|
+
this.label = "Label";
|
|
967
|
+
this.supportingtext = "";
|
|
968
|
+
this.state = "default";
|
|
969
|
+
this.status = "unchecked";
|
|
970
|
+
}
|
|
971
|
+
toggle() {
|
|
972
|
+
if (this.state === "disabled") return;
|
|
973
|
+
if (this.status === "unchecked") this.status = "checked";
|
|
974
|
+
else if (this.status === "checked") this.status = "indeterminate";
|
|
975
|
+
else this.status = "unchecked";
|
|
976
|
+
this.dispatchEvent(new CustomEvent("changed", { detail: this.status }));
|
|
977
|
+
}
|
|
978
|
+
render() {
|
|
979
|
+
const className = `
|
|
980
|
+
wrapper
|
|
981
|
+
${this.state}
|
|
982
|
+
${this.status}
|
|
983
|
+
`;
|
|
984
|
+
return html9`
|
|
985
|
+
<div class="${className}">
|
|
986
|
+
<label class="row">
|
|
987
|
+
<input
|
|
988
|
+
type="checkbox"
|
|
989
|
+
@change=${this.toggle}
|
|
990
|
+
?disabled=${this.state === "disabled"}
|
|
991
|
+
/>
|
|
992
|
+
|
|
993
|
+
<span class="box">
|
|
994
|
+
<!-- CHECK ICON -->
|
|
995
|
+
<svg class="check-icon" viewBox="0 0 18 14" fill="white">
|
|
996
|
+
<path
|
|
997
|
+
d="M6.44479 14L0.5 7.36383L1.9862 5.70478L6.44479 10.6819L16.0138 0L17.5 1.65904L6.44479 14Z"
|
|
998
|
+
/>
|
|
999
|
+
</svg>
|
|
1000
|
+
|
|
1001
|
+
<!-- INDETERMINATE ICON -->
|
|
1002
|
+
<svg class="indeterminate-icon" viewBox="0 0 16 2" fill="white">
|
|
1003
|
+
<rect width="16" height="2" />
|
|
1004
|
+
</svg>
|
|
1005
|
+
</span>
|
|
1006
|
+
|
|
1007
|
+
<span class="label">${this.label}</span>
|
|
1008
|
+
</label>
|
|
1009
|
+
|
|
1010
|
+
${this.supportingtext ? html9`<span class="text">${this.supportingtext}</span>` : null}
|
|
1011
|
+
</div>
|
|
1012
|
+
`;
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
RelCheckbox.styles = css9`
|
|
1016
|
+
:host {
|
|
1017
|
+
display: block;
|
|
1018
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.wrapper {
|
|
1022
|
+
display: flex;
|
|
1023
|
+
flex-direction: column;
|
|
1024
|
+
gap: 4px;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
.row {
|
|
1028
|
+
display: flex;
|
|
1029
|
+
align-items: center;
|
|
1030
|
+
gap: 10px;
|
|
1031
|
+
cursor: pointer;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
input {
|
|
1035
|
+
position: absolute;
|
|
1036
|
+
opacity: 0;
|
|
1037
|
+
pointer-events: none;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.box {
|
|
1041
|
+
width: 18px;
|
|
1042
|
+
height: 18px;
|
|
1043
|
+
border-radius: 4px;
|
|
1044
|
+
border: 2px solid var(--rel-colors-gray-heading);
|
|
1045
|
+
background: var(--rel-colors-white);
|
|
1046
|
+
display: flex;
|
|
1047
|
+
align-items: center;
|
|
1048
|
+
justify-content: center;
|
|
1049
|
+
transition: all 0.2s;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/* ICONS FIXED SIZE */
|
|
1053
|
+
svg {
|
|
1054
|
+
width: 12px;
|
|
1055
|
+
height: 12px;
|
|
1056
|
+
display: none;
|
|
1057
|
+
pointer-events: none;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/* CHECKED */
|
|
1061
|
+
.checked .box {
|
|
1062
|
+
background: var(--rel-colors-gray-heading);
|
|
1063
|
+
border-color: var(--rel-colors-gray-heading);
|
|
1064
|
+
}
|
|
1065
|
+
.checked .check-icon {
|
|
1066
|
+
display: block;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/* INDETERMINATE */
|
|
1070
|
+
.indeterminate .box {
|
|
1071
|
+
background: var(--rel-colors-gray-heading);
|
|
1072
|
+
border-color: var(--rel-colors-gray-heading);
|
|
1073
|
+
}
|
|
1074
|
+
.indeterminate .indeterminate-icon {
|
|
1075
|
+
display: block;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/* ERROR */
|
|
1079
|
+
.error .box {
|
|
1080
|
+
border-color: var(--rel-colors-red-primary);
|
|
1081
|
+
}
|
|
1082
|
+
.error.checked .box,
|
|
1083
|
+
.error.indeterminate .box {
|
|
1084
|
+
background: var(--rel-colors-red-primary);
|
|
1085
|
+
border-color: var(--rel-colors-red-primary);
|
|
1086
|
+
}
|
|
1087
|
+
.error .label,
|
|
1088
|
+
.error .text {
|
|
1089
|
+
color: var(--rel-colors-red-primary);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
/* DISABLED */
|
|
1093
|
+
.disabled {
|
|
1094
|
+
opacity: 0.55;
|
|
1095
|
+
cursor: not-allowed !important;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.label {
|
|
1099
|
+
font-size: var(--rel-fontSizes-md);
|
|
1100
|
+
color: var(--rel-colors-gray-heading);
|
|
1101
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
.text {
|
|
1105
|
+
font-size: var(--rel-fontSizes-sm);
|
|
1106
|
+
color: var(--rel-colors-gray-text);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
/* Focus ring */
|
|
1110
|
+
input:focus-visible + .box {
|
|
1111
|
+
outline: 2px solid var(--rel-colors-blue-primary);
|
|
1112
|
+
outline-offset: 2px;
|
|
1113
|
+
}
|
|
1114
|
+
`;
|
|
1115
|
+
__decorateClass([
|
|
1116
|
+
property8({ type: String })
|
|
1117
|
+
], RelCheckbox.prototype, "label", 2);
|
|
1118
|
+
__decorateClass([
|
|
1119
|
+
property8({ type: String })
|
|
1120
|
+
], RelCheckbox.prototype, "supportingtext", 2);
|
|
1121
|
+
__decorateClass([
|
|
1122
|
+
property8({ type: String })
|
|
1123
|
+
], RelCheckbox.prototype, "state", 2);
|
|
1124
|
+
__decorateClass([
|
|
1125
|
+
property8({ type: String })
|
|
1126
|
+
], RelCheckbox.prototype, "status", 2);
|
|
1127
|
+
RelCheckbox = __decorateClass([
|
|
1128
|
+
customElement9("rel-checkbox")
|
|
1129
|
+
], RelCheckbox);
|
|
1130
|
+
|
|
1131
|
+
// src/components/rel-chip/rel-chip.ts
|
|
1132
|
+
import { LitElement as LitElement10, html as html10, css as css10 } from "lit";
|
|
1133
|
+
import { customElement as customElement10, property as property9, state as state2 } from "lit/decorators.js";
|
|
1134
|
+
var RelChip = class extends LitElement10 {
|
|
1135
|
+
constructor() {
|
|
1136
|
+
super(...arguments);
|
|
1137
|
+
this.label = "Label";
|
|
1138
|
+
this.tone = "default";
|
|
1139
|
+
this.removable = false;
|
|
1140
|
+
this.outline = false;
|
|
1141
|
+
this.removed = false;
|
|
1142
|
+
}
|
|
1143
|
+
get classes() {
|
|
1144
|
+
return [
|
|
1145
|
+
"chip",
|
|
1146
|
+
`chip-${this.tone}`,
|
|
1147
|
+
this.outline ? "chip-outline" : ""
|
|
1148
|
+
].join(" ");
|
|
1149
|
+
}
|
|
1150
|
+
handleRemove(event) {
|
|
1151
|
+
event.stopPropagation();
|
|
1152
|
+
this.removed = true;
|
|
1153
|
+
this.dispatchEvent(
|
|
1154
|
+
new CustomEvent("removed", {
|
|
1155
|
+
bubbles: true,
|
|
1156
|
+
composed: true
|
|
1157
|
+
})
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
handleKeyDown(event) {
|
|
1161
|
+
if (!this.removable) return;
|
|
1162
|
+
if (event.key === "Backspace" || event.key === "Delete") {
|
|
1163
|
+
event.preventDefault();
|
|
1164
|
+
this.handleRemove(event);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
render() {
|
|
1168
|
+
if (this.removed) {
|
|
1169
|
+
return null;
|
|
1170
|
+
}
|
|
1171
|
+
return html10`
|
|
1172
|
+
<button
|
|
1173
|
+
class="${this.classes}"
|
|
1174
|
+
type="button"
|
|
1175
|
+
role="button"
|
|
1176
|
+
aria-label="${this.label}"
|
|
1177
|
+
@keydown=${this.handleKeyDown}
|
|
1178
|
+
tabindex="0"
|
|
1179
|
+
>
|
|
1180
|
+
${this.avatar ? html10`<img src="${this.avatar}" alt="avatar" class="chip-avatar" />` : ""}
|
|
1181
|
+
${this.leadingIcon ? html10`<span class="chip-icon leading">
|
|
1182
|
+
<slot name="leading-icon">${this.renderIcon(this.leadingIcon)}</slot>
|
|
1183
|
+
</span>` : ""}
|
|
1184
|
+
<span class="chip-label">${this.label}</span>
|
|
1185
|
+
${this.trailingIcon ? html10`<span class="chip-icon trailing">
|
|
1186
|
+
<slot name="trailing-icon">${this.renderIcon(this.trailingIcon)}</slot>
|
|
1187
|
+
</span>` : ""}
|
|
1188
|
+
${this.removable ? html10`<button
|
|
1189
|
+
type="button"
|
|
1190
|
+
class="chip-remove"
|
|
1191
|
+
@click=${this.handleRemove}
|
|
1192
|
+
aria-label="Remove chip"
|
|
1193
|
+
>
|
|
1194
|
+
|
|
1195
|
+
</button>` : ""}
|
|
1196
|
+
</button>
|
|
1197
|
+
`;
|
|
1198
|
+
}
|
|
1199
|
+
renderIcon(iconString) {
|
|
1200
|
+
const template = document.createElement("template");
|
|
1201
|
+
template.innerHTML = iconString.trim();
|
|
1202
|
+
return html10`${template.content.cloneNode(true)}`;
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
RelChip.styles = css10`
|
|
1206
|
+
:host {
|
|
1207
|
+
display: inline-block;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
:host([removed]) {
|
|
1211
|
+
display: none;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.chip {
|
|
1215
|
+
display: inline-flex;
|
|
1216
|
+
align-items: center;
|
|
1217
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
1218
|
+
font-size: var(--rel-fontSizes-md);
|
|
1219
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
1220
|
+
border-radius: var(--rel-borders-radius-border-radius-500);
|
|
1221
|
+
padding: var(--rel-spacing-space-2xs) var(--rel-spacing-space-sm);
|
|
1222
|
+
gap: var(--rel-spacing-space-2xs);
|
|
1223
|
+
cursor: pointer;
|
|
1224
|
+
transition: all 0.2s ease-in-out;
|
|
1225
|
+
border: var(--rel-borders-width-stroke-100) solid transparent;
|
|
1226
|
+
user-select: none;
|
|
1227
|
+
white-space: nowrap;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.chip:hover {
|
|
1231
|
+
filter: brightness(0.92);
|
|
1232
|
+
transform: translateY(-1px);
|
|
1233
|
+
box-shadow: var(--rel-shadows-shadow-100);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
.chip:focus:not(:focus-visible) {
|
|
1237
|
+
outline: none;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
.chip:active {
|
|
1241
|
+
transform: scale(0.97) translateY(0);
|
|
1242
|
+
box-shadow: none;
|
|
1243
|
+
filter: brightness(0.88);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/* Tone Variants - Filled */
|
|
1247
|
+
.chip-default {
|
|
1248
|
+
background: var(--rel-colors-gray-border);
|
|
1249
|
+
color: var(--rel-colors-black);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
.chip-default:focus {
|
|
1253
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-gray-primary);
|
|
1254
|
+
outline-offset: var(--rel-spacing-space-3xs);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
.chip-blue {
|
|
1258
|
+
background: var(--rel-colors-blue-tertiary);
|
|
1259
|
+
color: var(--rel-colors-white);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.chip-blue:focus {
|
|
1263
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-blue-tertiary);
|
|
1264
|
+
outline-offset: var(--rel-spacing-space-3xs);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
.chip-yellow {
|
|
1268
|
+
background: var(--rel-colors-yellow-pending);
|
|
1269
|
+
color: var(--rel-colors-black);
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
.chip-yellow:focus {
|
|
1273
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-yellow-pending);
|
|
1274
|
+
outline-offset: var(--rel-spacing-space-3xs);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
.chip-red {
|
|
1278
|
+
background: var(--rel-colors-red-secondary);
|
|
1279
|
+
color: var(--rel-colors-white);
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.chip-red:focus {
|
|
1283
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-red-secondary);
|
|
1284
|
+
outline-offset: var(--rel-spacing-space-3xs);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.chip-green {
|
|
1288
|
+
background: var(--rel-colors-green-success);
|
|
1289
|
+
color: var(--rel-colors-white);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
.chip-green:focus {
|
|
1293
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-green-success);
|
|
1294
|
+
outline-offset: var(--rel-spacing-space-3xs);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/* Outline Variants */
|
|
1298
|
+
.chip-outline.chip-default {
|
|
1299
|
+
background: transparent;
|
|
1300
|
+
border-color: var(--rel-colors-gray-border);
|
|
1301
|
+
color: var(--rel-colors-black);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
.chip-outline.chip-blue {
|
|
1305
|
+
background: transparent;
|
|
1306
|
+
border-color: var(--rel-colors-blue-tertiary);
|
|
1307
|
+
color: var(--rel-colors-blue-tertiary);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
.chip-outline.chip-yellow {
|
|
1311
|
+
background: transparent;
|
|
1312
|
+
border-color: var(--rel-colors-yellow-pending);
|
|
1313
|
+
color: var(--rel-colors-yellow-pending);
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
.chip-outline.chip-red {
|
|
1317
|
+
background: transparent;
|
|
1318
|
+
border-color: var(--rel-colors-red-secondary);
|
|
1319
|
+
color: var(--rel-colors-red-secondary);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
.chip-outline.chip-green {
|
|
1323
|
+
background: transparent;
|
|
1324
|
+
border-color: var(--rel-colors-green-success);
|
|
1325
|
+
color: var(--rel-colors-green-success);
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
.chip-avatar {
|
|
1329
|
+
width: 20px;
|
|
1330
|
+
height: 20px;
|
|
1331
|
+
border-radius: var(--rel-borders-radius-border-radius-500);
|
|
1332
|
+
object-fit: cover;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
.chip-icon {
|
|
1336
|
+
display: flex;
|
|
1337
|
+
align-items: center;
|
|
1338
|
+
line-height: 0;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
.chip-icon ::slotted(svg),
|
|
1342
|
+
.chip-icon svg {
|
|
1343
|
+
width: 16px;
|
|
1344
|
+
height: 16px;
|
|
1345
|
+
fill: currentColor;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
.chip-label {
|
|
1349
|
+
line-height: var(--rel-lineHeights-md);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
.chip-remove {
|
|
1353
|
+
background: transparent;
|
|
1354
|
+
border: none;
|
|
1355
|
+
color: inherit;
|
|
1356
|
+
font-size: var(--rel-fontSizes-md);
|
|
1357
|
+
cursor: pointer;
|
|
1358
|
+
display: flex;
|
|
1359
|
+
align-items: center;
|
|
1360
|
+
padding: 0;
|
|
1361
|
+
margin-left: var(--rel-spacing-space-3xs);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
.chip-remove:hover {
|
|
1365
|
+
opacity: 0.6;
|
|
1366
|
+
}
|
|
1367
|
+
`;
|
|
1368
|
+
__decorateClass([
|
|
1369
|
+
property9({ type: String })
|
|
1370
|
+
], RelChip.prototype, "label", 2);
|
|
1371
|
+
__decorateClass([
|
|
1372
|
+
property9({ type: String })
|
|
1373
|
+
], RelChip.prototype, "tone", 2);
|
|
1374
|
+
__decorateClass([
|
|
1375
|
+
property9({ type: String })
|
|
1376
|
+
], RelChip.prototype, "leadingIcon", 2);
|
|
1377
|
+
__decorateClass([
|
|
1378
|
+
property9({ type: String })
|
|
1379
|
+
], RelChip.prototype, "trailingIcon", 2);
|
|
1380
|
+
__decorateClass([
|
|
1381
|
+
property9({ type: String })
|
|
1382
|
+
], RelChip.prototype, "avatar", 2);
|
|
1383
|
+
__decorateClass([
|
|
1384
|
+
property9({ type: Boolean })
|
|
1385
|
+
], RelChip.prototype, "removable", 2);
|
|
1386
|
+
__decorateClass([
|
|
1387
|
+
property9({ type: Boolean })
|
|
1388
|
+
], RelChip.prototype, "outline", 2);
|
|
1389
|
+
__decorateClass([
|
|
1390
|
+
state2()
|
|
1391
|
+
], RelChip.prototype, "removed", 2);
|
|
1392
|
+
RelChip = __decorateClass([
|
|
1393
|
+
customElement10("rel-chip")
|
|
1394
|
+
], RelChip);
|
|
1395
|
+
|
|
1396
|
+
// src/components/rel-container/rel-container.ts
|
|
1397
|
+
import { LitElement as LitElement11, html as html11, css as css11 } from "lit";
|
|
1398
|
+
import { customElement as customElement11, property as property10 } from "lit/decorators.js";
|
|
1399
|
+
var RelContainer = class extends LitElement11 {
|
|
1400
|
+
constructor() {
|
|
1401
|
+
super(...arguments);
|
|
1402
|
+
this.padding = "md";
|
|
1403
|
+
this.shadow = false;
|
|
1404
|
+
this.background = "white";
|
|
1405
|
+
}
|
|
1406
|
+
get classes() {
|
|
1407
|
+
return [
|
|
1408
|
+
"reliability-container",
|
|
1409
|
+
`bg-${this.background}`,
|
|
1410
|
+
`padding-${this.padding}`,
|
|
1411
|
+
this.shadow ? "shadow" : ""
|
|
1412
|
+
].join(" ");
|
|
1413
|
+
}
|
|
1414
|
+
render() {
|
|
1415
|
+
return html11`
|
|
1416
|
+
<div class="${this.classes}">
|
|
1417
|
+
<slot></slot>
|
|
1418
|
+
</div>
|
|
1419
|
+
`;
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
RelContainer.styles = css11`
|
|
1423
|
+
:host {
|
|
1424
|
+
display: block;
|
|
1425
|
+
width: 100%;
|
|
1426
|
+
box-sizing: border-box;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
.reliability-container {
|
|
1430
|
+
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
1431
|
+
display: block;
|
|
1432
|
+
width: 100%;
|
|
1433
|
+
box-sizing: border-box;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/* Background Variants */
|
|
1437
|
+
.bg-white {
|
|
1438
|
+
background-color: var(--rel-colors-white);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
.bg-light {
|
|
1442
|
+
background-color: var(--rel-colors-gray-light);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.bg-none {
|
|
1446
|
+
background: transparent;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/* Padding Variants */
|
|
1450
|
+
.padding-sm {
|
|
1451
|
+
padding: var(--rel-spacing-space-xs);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
.padding-md {
|
|
1455
|
+
padding: var(--rel-spacing-space-md);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
.padding-lg {
|
|
1459
|
+
padding: var(--rel-spacing-space-2xl);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
/* Shadow */
|
|
1463
|
+
.shadow {
|
|
1464
|
+
box-shadow: var(--rel-shadows-shadow-300);
|
|
1465
|
+
}
|
|
1466
|
+
`;
|
|
1467
|
+
__decorateClass([
|
|
1468
|
+
property10({ type: String })
|
|
1469
|
+
], RelContainer.prototype, "padding", 2);
|
|
1470
|
+
__decorateClass([
|
|
1471
|
+
property10({ type: Boolean })
|
|
1472
|
+
], RelContainer.prototype, "shadow", 2);
|
|
1473
|
+
__decorateClass([
|
|
1474
|
+
property10({ type: String })
|
|
1475
|
+
], RelContainer.prototype, "background", 2);
|
|
1476
|
+
RelContainer = __decorateClass([
|
|
1477
|
+
customElement11("rel-container")
|
|
1478
|
+
], RelContainer);
|
|
1479
|
+
|
|
1480
|
+
// src/components/rel-divider/rel-divider.ts
|
|
1481
|
+
import { LitElement as LitElement12, html as html12, css as css12 } from "lit";
|
|
1482
|
+
import { customElement as customElement12, property as property11 } from "lit/decorators.js";
|
|
1483
|
+
var RelDivider = class extends LitElement12 {
|
|
1484
|
+
constructor() {
|
|
1485
|
+
super(...arguments);
|
|
1486
|
+
this.orientation = "horizontal";
|
|
1487
|
+
}
|
|
1488
|
+
render() {
|
|
1489
|
+
return html12`
|
|
1490
|
+
<div class="rel-divider ${this.orientation}" role="separator"></div>
|
|
1491
|
+
`;
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
RelDivider.styles = css12`
|
|
1495
|
+
:host {
|
|
1496
|
+
display: block;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
.rel-divider {
|
|
1500
|
+
position: relative;
|
|
1501
|
+
display: flex;
|
|
1502
|
+
background: transparent;
|
|
1503
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
1504
|
+
color: var(--rel-colors-gray-primary);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/* Horizontal */
|
|
1508
|
+
.rel-divider.horizontal {
|
|
1509
|
+
width: 100%;
|
|
1510
|
+
height: var(--rel-borders-width-stroke-100);
|
|
1511
|
+
background-color: var(--rel-colors-gray-border);
|
|
1512
|
+
margin: var(--rel-spacing-space-md) 0;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
/* Vertical */
|
|
1516
|
+
.rel-divider.vertical {
|
|
1517
|
+
width: var(--rel-borders-width-stroke-100);
|
|
1518
|
+
background-color: var(--rel-colors-gray-border);
|
|
1519
|
+
margin: 0 var(--rel-spacing-space-md);
|
|
1520
|
+
align-self: stretch;
|
|
1521
|
+
height: 100%;
|
|
1522
|
+
}
|
|
1523
|
+
`;
|
|
1524
|
+
__decorateClass([
|
|
1525
|
+
property11({ type: String })
|
|
1526
|
+
], RelDivider.prototype, "orientation", 2);
|
|
1527
|
+
RelDivider = __decorateClass([
|
|
1528
|
+
customElement12("rel-divider")
|
|
1529
|
+
], RelDivider);
|
|
1530
|
+
|
|
1531
|
+
// src/components/rel-layout/rel-layout.ts
|
|
1532
|
+
import { LitElement as LitElement13, html as html13, css as css13 } from "lit";
|
|
1533
|
+
import { customElement as customElement13, property as property12 } from "lit/decorators.js";
|
|
1534
|
+
var RelLayout = class extends LitElement13 {
|
|
1535
|
+
constructor() {
|
|
1536
|
+
super(...arguments);
|
|
1537
|
+
this.gap = "1rem";
|
|
1538
|
+
this.columns = 4;
|
|
1539
|
+
this.responsive = true;
|
|
1540
|
+
}
|
|
1541
|
+
render() {
|
|
1542
|
+
const gridStyle = `
|
|
1543
|
+
gap: ${this.gap};
|
|
1544
|
+
grid-template-columns: repeat(${this.columns}, 1fr);
|
|
1545
|
+
`;
|
|
1546
|
+
return html13`
|
|
1547
|
+
<div class="layout-grid" style="${gridStyle}">
|
|
1548
|
+
<slot></slot>
|
|
1549
|
+
</div>
|
|
1550
|
+
`;
|
|
1551
|
+
}
|
|
1552
|
+
};
|
|
1553
|
+
RelLayout.styles = css13`
|
|
1554
|
+
:host {
|
|
1555
|
+
display: block;
|
|
1556
|
+
width: 100%;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
.layout-grid {
|
|
1560
|
+
display: grid;
|
|
1561
|
+
width: 100%;
|
|
1562
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
/* Responsive breakpoints - only applied when responsive is true */
|
|
1566
|
+
:host([responsive]) .layout-grid {
|
|
1567
|
+
/* Default: use columns property */
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
@media (max-width: 1024px) {
|
|
1571
|
+
:host([responsive]) .layout-grid {
|
|
1572
|
+
grid-template-columns: repeat(3, 1fr) !important;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
@media (max-width: 768px) {
|
|
1577
|
+
:host([responsive]) .layout-grid {
|
|
1578
|
+
grid-template-columns: repeat(2, 1fr) !important;
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
@media (max-width: 480px) {
|
|
1583
|
+
:host([responsive]) .layout-grid {
|
|
1584
|
+
grid-template-columns: 1fr !important;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
`;
|
|
1588
|
+
__decorateClass([
|
|
1589
|
+
property12({ type: String })
|
|
1590
|
+
], RelLayout.prototype, "gap", 2);
|
|
1591
|
+
__decorateClass([
|
|
1592
|
+
property12({ type: Number })
|
|
1593
|
+
], RelLayout.prototype, "columns", 2);
|
|
1594
|
+
__decorateClass([
|
|
1595
|
+
property12({ type: Boolean })
|
|
1596
|
+
], RelLayout.prototype, "responsive", 2);
|
|
1597
|
+
RelLayout = __decorateClass([
|
|
1598
|
+
customElement13("rel-layout")
|
|
1599
|
+
], RelLayout);
|
|
1600
|
+
|
|
1601
|
+
// src/components/rel-menu/rel-menu.ts
|
|
1602
|
+
import { LitElement as LitElement14, html as html14, css as css14 } from "lit";
|
|
1603
|
+
import { customElement as customElement14, property as property13, state as state3 } from "lit/decorators.js";
|
|
1604
|
+
var RelMenu = class extends LitElement14 {
|
|
1605
|
+
constructor() {
|
|
1606
|
+
super(...arguments);
|
|
1607
|
+
this.type = "default";
|
|
1608
|
+
this.items = [];
|
|
1609
|
+
this.focusedIndex = 0;
|
|
1610
|
+
this.handleDocumentClick = (e) => {
|
|
1611
|
+
const path = e.composedPath();
|
|
1612
|
+
const hit = path.some((n) => n?.classList?.contains("rel-menu"));
|
|
1613
|
+
if (!hit) {
|
|
1614
|
+
this.items.forEach((i) => i.open = false);
|
|
1615
|
+
this.requestUpdate();
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
connectedCallback() {
|
|
1620
|
+
super.connectedCallback();
|
|
1621
|
+
document.addEventListener("click", this.handleDocumentClick);
|
|
1622
|
+
}
|
|
1623
|
+
disconnectedCallback() {
|
|
1624
|
+
super.disconnectedCallback();
|
|
1625
|
+
document.removeEventListener("click", this.handleDocumentClick);
|
|
1626
|
+
}
|
|
1627
|
+
onItemEnter(item) {
|
|
1628
|
+
if (this.type === "arrow" && item.submenu?.length) {
|
|
1629
|
+
this.items.forEach((i) => {
|
|
1630
|
+
if (i !== item) i.open = false;
|
|
1631
|
+
});
|
|
1632
|
+
item.open = true;
|
|
1633
|
+
this.requestUpdate();
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
onItemLeave(_item) {
|
|
1637
|
+
}
|
|
1638
|
+
onItemClick(item, index, ev) {
|
|
1639
|
+
ev?.stopPropagation();
|
|
1640
|
+
if (item.disabled) return;
|
|
1641
|
+
this.focusedIndex = index;
|
|
1642
|
+
if (this.type === "checkbox") {
|
|
1643
|
+
item.checked = !item.checked;
|
|
1644
|
+
this.dispatchEvent(
|
|
1645
|
+
new CustomEvent("item-checked", {
|
|
1646
|
+
detail: { item, checked: item.checked },
|
|
1647
|
+
bubbles: true,
|
|
1648
|
+
composed: true
|
|
1649
|
+
})
|
|
1650
|
+
);
|
|
1651
|
+
this.requestUpdate();
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
if (this.type === "arrow" && item.submenu?.length) {
|
|
1655
|
+
const next = !item.open;
|
|
1656
|
+
this.items.forEach((i) => i.open = false);
|
|
1657
|
+
item.open = next;
|
|
1658
|
+
this.requestUpdate();
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
this.items.forEach((i) => i.active = false);
|
|
1662
|
+
item.active = true;
|
|
1663
|
+
this.dispatchEvent(
|
|
1664
|
+
new CustomEvent("item-selected", {
|
|
1665
|
+
detail: { item },
|
|
1666
|
+
bubbles: true,
|
|
1667
|
+
composed: true
|
|
1668
|
+
})
|
|
1669
|
+
);
|
|
1670
|
+
this.requestUpdate();
|
|
1671
|
+
}
|
|
1672
|
+
onSubClick(parent, sub, ev) {
|
|
1673
|
+
ev?.stopPropagation();
|
|
1674
|
+
this.items.forEach((i) => {
|
|
1675
|
+
i.active = false;
|
|
1676
|
+
i.submenu?.forEach((s) => s.active = false);
|
|
1677
|
+
});
|
|
1678
|
+
sub.active = true;
|
|
1679
|
+
parent.open = false;
|
|
1680
|
+
this.dispatchEvent(
|
|
1681
|
+
new CustomEvent("submenu-selected", {
|
|
1682
|
+
detail: { parent, sub },
|
|
1683
|
+
bubbles: true,
|
|
1684
|
+
composed: true
|
|
1685
|
+
})
|
|
1686
|
+
);
|
|
1687
|
+
this.requestUpdate();
|
|
1688
|
+
}
|
|
1689
|
+
toggleCheckbox(item, ev) {
|
|
1690
|
+
ev.stopPropagation();
|
|
1691
|
+
if (!item.disabled) {
|
|
1692
|
+
item.checked = !item.checked;
|
|
1693
|
+
this.dispatchEvent(
|
|
1694
|
+
new CustomEvent("item-checked", {
|
|
1695
|
+
detail: { item, checked: item.checked },
|
|
1696
|
+
bubbles: true,
|
|
1697
|
+
composed: true
|
|
1698
|
+
})
|
|
1699
|
+
);
|
|
1700
|
+
this.requestUpdate();
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
onKeydown(ev) {
|
|
1704
|
+
const last = this.items.length - 1;
|
|
1705
|
+
if (ev.key === "ArrowDown") {
|
|
1706
|
+
this.focusedIndex = Math.min(last, this.focusedIndex + 1);
|
|
1707
|
+
ev.preventDefault();
|
|
1708
|
+
} else if (ev.key === "ArrowUp") {
|
|
1709
|
+
this.focusedIndex = Math.max(0, this.focusedIndex - 1);
|
|
1710
|
+
ev.preventDefault();
|
|
1711
|
+
} else if (ev.key === "ArrowRight") {
|
|
1712
|
+
const item = this.items[this.focusedIndex];
|
|
1713
|
+
if (this.type === "arrow" && item?.submenu?.length) {
|
|
1714
|
+
item.open = true;
|
|
1715
|
+
this.requestUpdate();
|
|
1716
|
+
}
|
|
1717
|
+
} else if (ev.key === "ArrowLeft" || ev.key === "Escape") {
|
|
1718
|
+
this.items.forEach((i) => i.open = false);
|
|
1719
|
+
this.requestUpdate();
|
|
1720
|
+
} else if (ev.key === "Enter" || ev.key === " ") {
|
|
1721
|
+
const item = this.items[this.focusedIndex];
|
|
1722
|
+
this.onItemClick(item, this.focusedIndex);
|
|
1723
|
+
ev.preventDefault();
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
renderMenuItem(item, index) {
|
|
1727
|
+
const isFocused = this.focusedIndex === index;
|
|
1728
|
+
return html14`
|
|
1729
|
+
<div
|
|
1730
|
+
class="rel-menu-item ${item.active ? "active" : ""} ${item.disabled ? "disabled" : ""}"
|
|
1731
|
+
role="menuitem"
|
|
1732
|
+
?data-focused="${isFocused}"
|
|
1733
|
+
@mouseenter="${() => this.onItemEnter(item)}"
|
|
1734
|
+
@mouseleave="${() => this.onItemLeave(item)}"
|
|
1735
|
+
@click="${(e) => this.onItemClick(item, index, e)}">
|
|
1736
|
+
${this.type === "checkbox" ? html14`
|
|
1737
|
+
<div class="menu-check-row">
|
|
1738
|
+
<input
|
|
1739
|
+
class="menu-checkbox"
|
|
1740
|
+
type="checkbox"
|
|
1741
|
+
.checked="${item.checked || false}"
|
|
1742
|
+
?disabled="${item.disabled}"
|
|
1743
|
+
@click="${(e) => this.toggleCheckbox(item, e)}" />
|
|
1744
|
+
<span class="menu-label">${item.label}</span>
|
|
1745
|
+
</div>
|
|
1746
|
+
` : html14`
|
|
1747
|
+
<span class="menu-label">${item.label}</span>
|
|
1748
|
+
${this.type === "arrow" && item.submenu?.length ? html14`<span class="chevron">▸</span>` : ""}
|
|
1749
|
+
`}
|
|
1750
|
+
${this.type === "arrow" && item.submenu?.length ? html14`
|
|
1751
|
+
<div
|
|
1752
|
+
class="rel-submenu ${item.open ? "visible" : ""}"
|
|
1753
|
+
@click="${(e) => e.stopPropagation()}">
|
|
1754
|
+
${item.submenu.map(
|
|
1755
|
+
(sub) => html14`
|
|
1756
|
+
<div
|
|
1757
|
+
class="rel-menu-item ${sub.active ? "active" : ""}"
|
|
1758
|
+
role="menuitem"
|
|
1759
|
+
@click="${(e) => this.onSubClick(item, sub, e)}">
|
|
1760
|
+
<span class="menu-label">${sub.label}</span>
|
|
1761
|
+
</div>
|
|
1762
|
+
`
|
|
1763
|
+
)}
|
|
1764
|
+
</div>
|
|
1765
|
+
` : ""}
|
|
1766
|
+
</div>
|
|
1767
|
+
`;
|
|
1768
|
+
}
|
|
1769
|
+
render() {
|
|
1770
|
+
return html14`
|
|
1771
|
+
<div
|
|
1772
|
+
class="rel-menu"
|
|
1773
|
+
role="menu"
|
|
1774
|
+
tabindex="0"
|
|
1775
|
+
@keydown="${this.onKeydown}"
|
|
1776
|
+
@click="${(e) => e.stopPropagation()}">
|
|
1777
|
+
${this.items.map((item, index) => this.renderMenuItem(item, index))}
|
|
1778
|
+
</div>
|
|
1779
|
+
`;
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
RelMenu.styles = css14`
|
|
1783
|
+
:host {
|
|
1784
|
+
display: inline-block;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
.rel-menu {
|
|
1788
|
+
position: relative;
|
|
1789
|
+
display: inline-block;
|
|
1790
|
+
background: var(--rel-colors-white);
|
|
1791
|
+
border-radius: var(--rel-borders-radius-border-radius-300);
|
|
1792
|
+
box-shadow: var(--rel-shadows-shadow-300);
|
|
1793
|
+
min-width: 220px;
|
|
1794
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
1795
|
+
font-size: var(--rel-fontSizes-sm);
|
|
1796
|
+
padding: var(--rel-spacing-space-3xs) 0;
|
|
1797
|
+
outline: none;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
.rel-menu-item {
|
|
1801
|
+
position: relative;
|
|
1802
|
+
display: flex;
|
|
1803
|
+
align-items: center;
|
|
1804
|
+
gap: var(--rel-spacing-space-xs);
|
|
1805
|
+
padding: var(--rel-spacing-space-xs) var(--rel-spacing-space-sm);
|
|
1806
|
+
line-height: var(--rel-lineHeights-sm);
|
|
1807
|
+
cursor: pointer;
|
|
1808
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
1809
|
+
user-select: none;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
.rel-menu-item:hover {
|
|
1813
|
+
background: var(--rel-colors-gray-border);
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
.rel-menu-item:active {
|
|
1817
|
+
background: var(--rel-colors-gray-tertiary);
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
.rel-menu-item.active {
|
|
1821
|
+
background: var(--rel-colors-gray-tertiary);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
.rel-menu-item.disabled {
|
|
1825
|
+
background-color: var(--rel-colors-gray-light);
|
|
1826
|
+
color: var(--rel-colors-gray-placeholder);
|
|
1827
|
+
cursor: not-allowed;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
.rel-menu-item[data-focused="true"] {
|
|
1831
|
+
border-top: var(--rel-borders-width-stroke-200) solid var(--rel-colors-gray-primary);
|
|
1832
|
+
border-bottom: var(--rel-borders-width-stroke-200) solid var(--rel-colors-gray-primary);
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
.menu-check-row {
|
|
1836
|
+
display: inline-flex;
|
|
1837
|
+
align-items: center;
|
|
1838
|
+
gap: var(--rel-spacing-space-2xs);
|
|
1839
|
+
width: 100%;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
.menu-checkbox {
|
|
1843
|
+
width: 16px;
|
|
1844
|
+
height: 16px;
|
|
1845
|
+
cursor: pointer;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
.menu-checkbox:disabled {
|
|
1849
|
+
cursor: not-allowed;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
.menu-label {
|
|
1853
|
+
flex: 1 1 auto;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
.chevron {
|
|
1857
|
+
font-size: var(--rel-fontSizes-lg);
|
|
1858
|
+
opacity: 0.75;
|
|
1859
|
+
transform: translateY(1px);
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
.rel-submenu {
|
|
1863
|
+
position: absolute;
|
|
1864
|
+
top: calc(-1 * var(--rel-spacing-space-3xs));
|
|
1865
|
+
left: calc(100% + var(--rel-spacing-space-2xs));
|
|
1866
|
+
min-width: 200px;
|
|
1867
|
+
background: var(--rel-colors-white);
|
|
1868
|
+
border-radius: var(--rel-borders-radius-border-radius-300);
|
|
1869
|
+
box-shadow: var(--rel-shadows-shadow-300);
|
|
1870
|
+
padding: var(--rel-spacing-space-3xs) 0;
|
|
1871
|
+
display: none;
|
|
1872
|
+
z-index: 20;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
.rel-submenu.visible {
|
|
1876
|
+
display: block;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
.rel-submenu .rel-menu-item {
|
|
1880
|
+
padding: var(--rel-spacing-space-xs) var(--rel-spacing-space-sm);
|
|
1881
|
+
}
|
|
1882
|
+
`;
|
|
1883
|
+
__decorateClass([
|
|
1884
|
+
property13({ type: String })
|
|
1885
|
+
], RelMenu.prototype, "type", 2);
|
|
1886
|
+
__decorateClass([
|
|
1887
|
+
property13({ type: Array })
|
|
1888
|
+
], RelMenu.prototype, "items", 2);
|
|
1889
|
+
__decorateClass([
|
|
1890
|
+
state3()
|
|
1891
|
+
], RelMenu.prototype, "focusedIndex", 2);
|
|
1892
|
+
RelMenu = __decorateClass([
|
|
1893
|
+
customElement14("rel-menu")
|
|
1894
|
+
], RelMenu);
|
|
1895
|
+
|
|
1896
|
+
// src/components/rel-progress/rel-progress.ts
|
|
1897
|
+
import { LitElement as LitElement15, html as html15, css as css15 } from "lit";
|
|
1898
|
+
import { customElement as customElement15, property as property14 } from "lit/decorators.js";
|
|
1899
|
+
var RelProgress = class extends LitElement15 {
|
|
1900
|
+
constructor() {
|
|
1901
|
+
super(...arguments);
|
|
1902
|
+
this.mode = "linear-determinate";
|
|
1903
|
+
this.value = 0;
|
|
1904
|
+
this.radius = 15.9155;
|
|
1905
|
+
this.circumference = 2 * Math.PI * this.radius;
|
|
1906
|
+
}
|
|
1907
|
+
renderLinearDeterminate() {
|
|
1908
|
+
return html15`
|
|
1909
|
+
<div class="linear-track">
|
|
1910
|
+
<div class="linear-bar" style="width: ${this.value}%"></div>
|
|
1911
|
+
</div>
|
|
1912
|
+
`;
|
|
1913
|
+
}
|
|
1914
|
+
renderLinearIndeterminate() {
|
|
1915
|
+
return html15`
|
|
1916
|
+
<div class="linear-track">
|
|
1917
|
+
<div class="linear-bar indeterminate"></div>
|
|
1918
|
+
</div>
|
|
1919
|
+
`;
|
|
1920
|
+
}
|
|
1921
|
+
renderCircularDeterminate() {
|
|
1922
|
+
const offset = this.circumference - this.value / 100 * this.circumference;
|
|
1923
|
+
return html15`
|
|
1924
|
+
<div class="circular">
|
|
1925
|
+
<svg viewBox="0 0 36 36" class="circular-svg">
|
|
1926
|
+
<circle class="circular-bg" cx="18" cy="18" r="15.9155" />
|
|
1927
|
+
<circle
|
|
1928
|
+
class="circular-progress"
|
|
1929
|
+
cx="18"
|
|
1930
|
+
cy="18"
|
|
1931
|
+
r="15.9155"
|
|
1932
|
+
stroke-dasharray="${this.circumference}"
|
|
1933
|
+
stroke-dashoffset="${offset}" />
|
|
1934
|
+
</svg>
|
|
1935
|
+
</div>
|
|
1936
|
+
`;
|
|
1937
|
+
}
|
|
1938
|
+
renderCircularIndeterminate() {
|
|
1939
|
+
return html15`
|
|
1940
|
+
<div class="circular">
|
|
1941
|
+
<svg viewBox="0 0 50 50" class="spinner">
|
|
1942
|
+
<circle class="spinner-path" cx="25" cy="25" r="20" fill="none" stroke-width="4" />
|
|
1943
|
+
</svg>
|
|
1944
|
+
</div>
|
|
1945
|
+
`;
|
|
1946
|
+
}
|
|
1947
|
+
render() {
|
|
1948
|
+
switch (this.mode) {
|
|
1949
|
+
case "linear-determinate":
|
|
1950
|
+
return this.renderLinearDeterminate();
|
|
1951
|
+
case "linear-indeterminate":
|
|
1952
|
+
return this.renderLinearIndeterminate();
|
|
1953
|
+
case "circular-determinate":
|
|
1954
|
+
return this.renderCircularDeterminate();
|
|
1955
|
+
case "circular-indeterminate":
|
|
1956
|
+
return this.renderCircularIndeterminate();
|
|
1957
|
+
default:
|
|
1958
|
+
return this.renderLinearDeterminate();
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1962
|
+
RelProgress.styles = css15`
|
|
1963
|
+
:host {
|
|
1964
|
+
display: block;
|
|
1965
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
:host([mode*="circular"]) {
|
|
1969
|
+
display: inline-block;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/* Linear Progress */
|
|
1973
|
+
.linear-track {
|
|
1974
|
+
background: var(--rel-colors-gray-border);
|
|
1975
|
+
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
1976
|
+
height: 6px;
|
|
1977
|
+
overflow: hidden;
|
|
1978
|
+
width: 100%;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
.linear-bar {
|
|
1982
|
+
background: var(--rel-colors-black);
|
|
1983
|
+
height: 100%;
|
|
1984
|
+
transition: width 0.3s ease;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
.linear-bar.indeterminate {
|
|
1988
|
+
width: 30%;
|
|
1989
|
+
animation: linear-indeterminate 1.5s infinite;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
@keyframes linear-indeterminate {
|
|
1993
|
+
0% {
|
|
1994
|
+
margin-left: -30%;
|
|
1995
|
+
}
|
|
1996
|
+
50% {
|
|
1997
|
+
margin-left: 50%;
|
|
1998
|
+
}
|
|
1999
|
+
100% {
|
|
2000
|
+
margin-left: 100%;
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
/* Circular Progress */
|
|
2005
|
+
.circular {
|
|
2006
|
+
display: inline-block;
|
|
2007
|
+
width: 48px;
|
|
2008
|
+
height: 48px;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
.circular-svg {
|
|
2012
|
+
transform: rotate(-90deg);
|
|
2013
|
+
width: 100%;
|
|
2014
|
+
height: 100%;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
.circular-bg {
|
|
2018
|
+
fill: none;
|
|
2019
|
+
stroke: var(--rel-colors-gray-border);
|
|
2020
|
+
stroke-width: 3;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
.circular-progress {
|
|
2024
|
+
fill: none;
|
|
2025
|
+
stroke: var(--rel-colors-black);
|
|
2026
|
+
stroke-width: 3;
|
|
2027
|
+
stroke-linecap: round;
|
|
2028
|
+
transition: stroke-dashoffset 0.35s;
|
|
2029
|
+
transform: rotate(0deg);
|
|
2030
|
+
transform-origin: center;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
/* Circular Indeterminate Spinner */
|
|
2034
|
+
.spinner {
|
|
2035
|
+
animation: rotate 2s linear infinite;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
.spinner-path {
|
|
2039
|
+
stroke: var(--rel-colors-black);
|
|
2040
|
+
stroke-linecap: round;
|
|
2041
|
+
animation: dash 1.5s ease-in-out infinite;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
@keyframes rotate {
|
|
2045
|
+
100% {
|
|
2046
|
+
transform: rotate(360deg);
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
@keyframes dash {
|
|
2051
|
+
0% {
|
|
2052
|
+
stroke-dasharray: 1, 150;
|
|
2053
|
+
stroke-dashoffset: 0;
|
|
2054
|
+
}
|
|
2055
|
+
50% {
|
|
2056
|
+
stroke-dasharray: 90, 150;
|
|
2057
|
+
stroke-dashoffset: -35;
|
|
2058
|
+
}
|
|
2059
|
+
100% {
|
|
2060
|
+
stroke-dasharray: 90, 150;
|
|
2061
|
+
stroke-dashoffset: -124;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
`;
|
|
2065
|
+
__decorateClass([
|
|
2066
|
+
property14({ type: String })
|
|
2067
|
+
], RelProgress.prototype, "mode", 2);
|
|
2068
|
+
__decorateClass([
|
|
2069
|
+
property14({ type: Number })
|
|
2070
|
+
], RelProgress.prototype, "value", 2);
|
|
2071
|
+
RelProgress = __decorateClass([
|
|
2072
|
+
customElement15("rel-progress")
|
|
2073
|
+
], RelProgress);
|
|
2074
|
+
|
|
2075
|
+
// src/components/rel-radio/rel-radio.ts
|
|
2076
|
+
import { LitElement as LitElement16, html as html16, css as css16 } from "lit";
|
|
2077
|
+
import { customElement as customElement16, property as property15 } from "lit/decorators.js";
|
|
2078
|
+
var RelRadio = class extends LitElement16 {
|
|
2079
|
+
constructor() {
|
|
2080
|
+
super(...arguments);
|
|
2081
|
+
this.options = [];
|
|
2082
|
+
this.name = "radio-group";
|
|
2083
|
+
this.selectedValue = null;
|
|
2084
|
+
}
|
|
2085
|
+
onChange(value) {
|
|
2086
|
+
this.selectedValue = value;
|
|
2087
|
+
this.dispatchEvent(
|
|
2088
|
+
new CustomEvent("changed", {
|
|
2089
|
+
detail: { value },
|
|
2090
|
+
bubbles: true,
|
|
2091
|
+
composed: true
|
|
2092
|
+
})
|
|
2093
|
+
);
|
|
2094
|
+
}
|
|
2095
|
+
isChecked(value) {
|
|
2096
|
+
return this.selectedValue === value;
|
|
2097
|
+
}
|
|
2098
|
+
renderOption(option) {
|
|
2099
|
+
const isChecked = this.isChecked(option.value);
|
|
2100
|
+
const classes = [
|
|
2101
|
+
"rel-radio-option",
|
|
2102
|
+
option.disabled ? "disabled" : "",
|
|
2103
|
+
option.error ? "error" : ""
|
|
2104
|
+
].filter(Boolean).join(" ");
|
|
2105
|
+
return html16`
|
|
2106
|
+
<label class="${classes}">
|
|
2107
|
+
<div class="radio-main">
|
|
2108
|
+
<input
|
|
2109
|
+
type="radio"
|
|
2110
|
+
name="${this.name}"
|
|
2111
|
+
.value="${option.value}"
|
|
2112
|
+
.checked="${isChecked}"
|
|
2113
|
+
?disabled="${option.disabled}"
|
|
2114
|
+
@change="${() => !option.disabled && this.onChange(option.value)}" />
|
|
2115
|
+
<span class="radio-custom"></span>
|
|
2116
|
+
<span class="radio-label">${option.label}</span>
|
|
2117
|
+
</div>
|
|
2118
|
+
|
|
2119
|
+
${option.supportingText ? html16`
|
|
2120
|
+
<div class="radio-supporting ${option.error ? "error-text" : ""}">
|
|
2121
|
+
${option.supportingText}
|
|
2122
|
+
</div>
|
|
2123
|
+
` : ""}
|
|
2124
|
+
</label>
|
|
2125
|
+
`;
|
|
2126
|
+
}
|
|
2127
|
+
render() {
|
|
2128
|
+
return html16`
|
|
2129
|
+
<div class="rel-radio-group">
|
|
2130
|
+
${this.options.map((option) => this.renderOption(option))}
|
|
2131
|
+
</div>
|
|
2132
|
+
`;
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
RelRadio.styles = css16`
|
|
2136
|
+
:host {
|
|
2137
|
+
display: block;
|
|
2138
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
.rel-radio-group {
|
|
2142
|
+
display: flex;
|
|
2143
|
+
flex-direction: column;
|
|
2144
|
+
gap: var(--rel-spacing-space-xs);
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
.rel-radio-option {
|
|
2148
|
+
display: flex;
|
|
2149
|
+
flex-direction: column;
|
|
2150
|
+
align-items: flex-start;
|
|
2151
|
+
gap: var(--rel-spacing-space-3xs);
|
|
2152
|
+
cursor: pointer;
|
|
2153
|
+
position: relative;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
.radio-main {
|
|
2157
|
+
display: flex;
|
|
2158
|
+
align-items: center;
|
|
2159
|
+
gap: var(--rel-spacing-space-2xs);
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
.rel-radio-option input {
|
|
2163
|
+
position: absolute;
|
|
2164
|
+
opacity: 0;
|
|
2165
|
+
pointer-events: none;
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
.radio-custom {
|
|
2169
|
+
width: 20px;
|
|
2170
|
+
height: 20px;
|
|
2171
|
+
border: 2px solid var(--rel-colors-black);
|
|
2172
|
+
border-radius: 50%;
|
|
2173
|
+
display: inline-block;
|
|
2174
|
+
position: relative;
|
|
2175
|
+
flex-shrink: 0;
|
|
2176
|
+
transition: all 0.2s ease-in-out;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
.rel-radio-option input:focus + .radio-custom {
|
|
2180
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-black);
|
|
2181
|
+
outline-offset: var(--rel-spacing-space-3xs);
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
.rel-radio-option input:checked + .radio-custom::after {
|
|
2185
|
+
content: "";
|
|
2186
|
+
position: absolute;
|
|
2187
|
+
top: 50%;
|
|
2188
|
+
left: 50%;
|
|
2189
|
+
width: 10px;
|
|
2190
|
+
height: 10px;
|
|
2191
|
+
background-color: var(--rel-colors-black);
|
|
2192
|
+
border-radius: 50%;
|
|
2193
|
+
transform: translate(-50%, -50%);
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
/* Error state */
|
|
2197
|
+
.rel-radio-option.error .radio-custom {
|
|
2198
|
+
border-color: var(--rel-colors-red-secondary);
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
.rel-radio-option.error input:checked + .radio-custom::after {
|
|
2202
|
+
background-color: var(--rel-colors-red-secondary);
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
.rel-radio-option.error .radio-label,
|
|
2206
|
+
.rel-radio-option.error .radio-supporting {
|
|
2207
|
+
color: var(--rel-colors-red-secondary);
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
.rel-radio-option.error input:focus + .radio-custom {
|
|
2211
|
+
outline: var(--rel-borders-width-stroke-200) solid var(--rel-colors-red-secondary);
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
/* Disabled state */
|
|
2215
|
+
.rel-radio-option.disabled {
|
|
2216
|
+
opacity: 0.6;
|
|
2217
|
+
cursor: not-allowed !important;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
.rel-radio-option.disabled .radio-label,
|
|
2221
|
+
.rel-radio-option.disabled .radio-supporting {
|
|
2222
|
+
cursor: not-allowed !important;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
/* Text styles */
|
|
2226
|
+
.radio-label {
|
|
2227
|
+
font-size: var(--rel-fontSizes-sm);
|
|
2228
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
2229
|
+
color: var(--rel-colors-gray-heading);
|
|
2230
|
+
line-height: var(--rel-lineHeights-sm);
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
.radio-supporting {
|
|
2234
|
+
font-size: var(--rel-fontSizes-xs);
|
|
2235
|
+
color: var(--rel-colors-gray-placeholder);
|
|
2236
|
+
margin-left: 28px;
|
|
2237
|
+
line-height: var(--rel-lineHeights-xs);
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
.radio-supporting.error-text {
|
|
2241
|
+
color: var(--rel-colors-red-secondary);
|
|
2242
|
+
}
|
|
2243
|
+
`;
|
|
2244
|
+
__decorateClass([
|
|
2245
|
+
property15({ type: Array })
|
|
2246
|
+
], RelRadio.prototype, "options", 2);
|
|
2247
|
+
__decorateClass([
|
|
2248
|
+
property15({ type: String })
|
|
2249
|
+
], RelRadio.prototype, "name", 2);
|
|
2250
|
+
__decorateClass([
|
|
2251
|
+
property15({ type: String })
|
|
2252
|
+
], RelRadio.prototype, "selectedValue", 2);
|
|
2253
|
+
RelRadio = __decorateClass([
|
|
2254
|
+
customElement16("rel-radio")
|
|
2255
|
+
], RelRadio);
|
|
2256
|
+
|
|
2257
|
+
// src/components/rel-segmented-button/rel-segmented-button.ts
|
|
2258
|
+
import { LitElement as LitElement17, html as html17, css as css17 } from "lit";
|
|
2259
|
+
import { customElement as customElement17, property as property16 } from "lit/decorators.js";
|
|
2260
|
+
var RelSegmentedButton = class extends LitElement17 {
|
|
2261
|
+
constructor() {
|
|
2262
|
+
super(...arguments);
|
|
2263
|
+
this.options = [];
|
|
2264
|
+
this.active = "";
|
|
2265
|
+
this.size = "medium";
|
|
2266
|
+
this.align = "left";
|
|
2267
|
+
}
|
|
2268
|
+
setActive(option) {
|
|
2269
|
+
if (!option.disabled) {
|
|
2270
|
+
this.active = option.value;
|
|
2271
|
+
this.dispatchEvent(
|
|
2272
|
+
new CustomEvent("changed", {
|
|
2273
|
+
detail: { value: option.value },
|
|
2274
|
+
bubbles: true,
|
|
2275
|
+
composed: true
|
|
2276
|
+
})
|
|
2277
|
+
);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
renderSegment(option) {
|
|
2281
|
+
const isActive = this.active === option.value;
|
|
2282
|
+
const classes = [
|
|
2283
|
+
"segment",
|
|
2284
|
+
isActive ? "active" : "",
|
|
2285
|
+
option.disabled ? "disabled" : ""
|
|
2286
|
+
].filter(Boolean).join(" ");
|
|
2287
|
+
return html17`
|
|
2288
|
+
<button
|
|
2289
|
+
class="${classes}"
|
|
2290
|
+
?disabled="${option.disabled}"
|
|
2291
|
+
@click="${() => this.setActive(option)}">
|
|
2292
|
+
${option.label}
|
|
2293
|
+
</button>
|
|
2294
|
+
`;
|
|
2295
|
+
}
|
|
2296
|
+
render() {
|
|
2297
|
+
const containerClasses = [
|
|
2298
|
+
"segmented-buttons",
|
|
2299
|
+
this.size,
|
|
2300
|
+
`align-${this.align}`
|
|
2301
|
+
].join(" ");
|
|
2302
|
+
return html17`
|
|
2303
|
+
<div class="${containerClasses}">
|
|
2304
|
+
${this.options.map((option) => this.renderSegment(option))}
|
|
2305
|
+
</div>
|
|
2306
|
+
`;
|
|
2307
|
+
}
|
|
2308
|
+
};
|
|
2309
|
+
RelSegmentedButton.styles = css17`
|
|
2310
|
+
:host {
|
|
2311
|
+
display: inline-block;
|
|
2312
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
.segmented-buttons {
|
|
2316
|
+
display: inline-flex;
|
|
2317
|
+
border: 2px solid var(--rel-colors-gray-border);
|
|
2318
|
+
border-radius: var(--rel-borders-radius-border-radius-300);
|
|
2319
|
+
overflow: hidden;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
/* Alignment */
|
|
2323
|
+
.align-left {
|
|
2324
|
+
justify-content: flex-start;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
.align-middle {
|
|
2328
|
+
justify-content: center;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
.align-right {
|
|
2332
|
+
justify-content: flex-end;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
/* Base segment styling */
|
|
2336
|
+
.segment {
|
|
2337
|
+
background: var(--rel-colors-white);
|
|
2338
|
+
border: none;
|
|
2339
|
+
cursor: pointer;
|
|
2340
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
2341
|
+
border-right: 2px solid var(--rel-colors-gray-border);
|
|
2342
|
+
transition: all 0.2s ease-in-out;
|
|
2343
|
+
color: var(--rel-colors-gray-heading);
|
|
2344
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
2345
|
+
outline: none;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
.segment:last-child {
|
|
2349
|
+
border-right: none;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
/* Hover */
|
|
2353
|
+
.segment:hover:not(.disabled):not(.active) {
|
|
2354
|
+
background: var(--rel-colors-gray-bg);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
/* Active */
|
|
2358
|
+
.segment.active {
|
|
2359
|
+
background: var(--rel-colors-black);
|
|
2360
|
+
color: var(--rel-colors-white);
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
.segment.active:hover:not(.disabled) {
|
|
2364
|
+
background: var(--rel-colors-black);
|
|
2365
|
+
color: var(--rel-colors-white);
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
/* Disabled */
|
|
2369
|
+
.segment.disabled,
|
|
2370
|
+
.segment:disabled {
|
|
2371
|
+
cursor: not-allowed;
|
|
2372
|
+
opacity: 0.5;
|
|
2373
|
+
background: var(--rel-colors-gray-bg);
|
|
2374
|
+
color: var(--rel-colors-gray-placeholder);
|
|
2375
|
+
pointer-events: none;
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
/* Sizes */
|
|
2379
|
+
.segmented-buttons.small .segment {
|
|
2380
|
+
padding: var(--rel-spacing-space-3xs) var(--rel-spacing-space-xs);
|
|
2381
|
+
font-size: var(--rel-fontSizes-xs);
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
.segmented-buttons.medium .segment {
|
|
2385
|
+
padding: var(--rel-spacing-space-2xs) var(--rel-spacing-space-sm);
|
|
2386
|
+
font-size: var(--rel-fontSizes-sm);
|
|
2387
|
+
}
|
|
2388
|
+
`;
|
|
2389
|
+
__decorateClass([
|
|
2390
|
+
property16({ type: Array })
|
|
2391
|
+
], RelSegmentedButton.prototype, "options", 2);
|
|
2392
|
+
__decorateClass([
|
|
2393
|
+
property16({ type: String })
|
|
2394
|
+
], RelSegmentedButton.prototype, "active", 2);
|
|
2395
|
+
__decorateClass([
|
|
2396
|
+
property16({ type: String })
|
|
2397
|
+
], RelSegmentedButton.prototype, "size", 2);
|
|
2398
|
+
__decorateClass([
|
|
2399
|
+
property16({ type: String })
|
|
2400
|
+
], RelSegmentedButton.prototype, "align", 2);
|
|
2401
|
+
RelSegmentedButton = __decorateClass([
|
|
2402
|
+
customElement17("rel-segmented-button")
|
|
2403
|
+
], RelSegmentedButton);
|
|
2404
|
+
|
|
2405
|
+
// src/components/rel-select/rel-select.ts
|
|
2406
|
+
import { LitElement as LitElement18, html as html18, css as css18 } from "lit";
|
|
2407
|
+
import { customElement as customElement18, property as property17 } from "lit/decorators.js";
|
|
2408
|
+
var RelSelect = class extends LitElement18 {
|
|
2409
|
+
constructor() {
|
|
2410
|
+
super(...arguments);
|
|
2411
|
+
this.label = "";
|
|
2412
|
+
this.options = [];
|
|
2413
|
+
this.selected = "";
|
|
2414
|
+
this.state = "default";
|
|
2415
|
+
this.supportingText = "";
|
|
2416
|
+
this.size = "medium";
|
|
2417
|
+
this.border = "rounded";
|
|
2418
|
+
this.leftIcon = "";
|
|
2419
|
+
this.rightIcon = "";
|
|
2420
|
+
}
|
|
2421
|
+
onChange(event) {
|
|
2422
|
+
const value = event.target.value;
|
|
2423
|
+
this.selected = value;
|
|
2424
|
+
this.dispatchEvent(
|
|
2425
|
+
new CustomEvent("changed", {
|
|
2426
|
+
detail: { value },
|
|
2427
|
+
bubbles: true,
|
|
2428
|
+
composed: true
|
|
2429
|
+
})
|
|
2430
|
+
);
|
|
2431
|
+
}
|
|
2432
|
+
render() {
|
|
2433
|
+
const containerClasses = [
|
|
2434
|
+
"select-container",
|
|
2435
|
+
this.leftIcon ? "with-left-icon" : "",
|
|
2436
|
+
this.rightIcon ? "with-right-icon" : "",
|
|
2437
|
+
`select-${this.size}`
|
|
2438
|
+
].filter(Boolean).join(" ");
|
|
2439
|
+
const wrapperClasses = [
|
|
2440
|
+
"select-wrapper",
|
|
2441
|
+
`select-${this.state}`,
|
|
2442
|
+
`border-${this.border}`
|
|
2443
|
+
].join(" ");
|
|
2444
|
+
const selectClasses = [this.state === "error" ? "error" : ""].filter(Boolean).join(" ");
|
|
2445
|
+
const isDisabled = this.state === "disabled";
|
|
2446
|
+
return html18`
|
|
2447
|
+
<div class="${wrapperClasses}">
|
|
2448
|
+
${this.label ? html18`<label class="select-label">${this.label}</label>` : ""}
|
|
2449
|
+
|
|
2450
|
+
<div class="${containerClasses}">
|
|
2451
|
+
${this.leftIcon ? html18`<span class="icon left">${this.leftIcon}</span>` : ""}
|
|
2452
|
+
|
|
2453
|
+
<select
|
|
2454
|
+
class="${selectClasses}"
|
|
2455
|
+
?disabled="${isDisabled}"
|
|
2456
|
+
@change="${this.onChange}"
|
|
2457
|
+
.value="${this.selected}">
|
|
2458
|
+
<option value="" disabled ?selected="${!this.selected}" hidden>
|
|
2459
|
+
Select Option
|
|
2460
|
+
</option>
|
|
2461
|
+
${this.options.map(
|
|
2462
|
+
(option) => html18`
|
|
2463
|
+
<option value="${option}" ?selected="${option === this.selected}">
|
|
2464
|
+
${option}
|
|
2465
|
+
</option>
|
|
2466
|
+
`
|
|
2467
|
+
)}
|
|
2468
|
+
</select>
|
|
2469
|
+
|
|
2470
|
+
${this.rightIcon ? html18`<span class="icon right">${this.rightIcon}</span>` : ""}
|
|
2471
|
+
</div>
|
|
2472
|
+
|
|
2473
|
+
${this.supportingText ? html18`
|
|
2474
|
+
<span
|
|
2475
|
+
class="supporting-text ${this.state === "error" ? "error-text" : ""}">
|
|
2476
|
+
${this.supportingText}
|
|
2477
|
+
</span>
|
|
2478
|
+
` : ""}
|
|
2479
|
+
</div>
|
|
2480
|
+
`;
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
RelSelect.styles = css18`
|
|
2484
|
+
:host {
|
|
2485
|
+
display: block;
|
|
2486
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
2487
|
+
width: 100%;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
.select-wrapper {
|
|
2491
|
+
display: flex;
|
|
2492
|
+
flex-direction: column;
|
|
2493
|
+
width: 100%;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
.select-label {
|
|
2497
|
+
font-size: var(--rel-fontSizes-sm);
|
|
2498
|
+
margin-bottom: var(--rel-spacing-space-3xs);
|
|
2499
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
2500
|
+
color: var(--rel-colors-gray-heading);
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
.select-container {
|
|
2504
|
+
position: relative;
|
|
2505
|
+
display: flex;
|
|
2506
|
+
align-items: center;
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
.icon {
|
|
2510
|
+
position: absolute;
|
|
2511
|
+
display: flex;
|
|
2512
|
+
align-items: center;
|
|
2513
|
+
justify-content: center;
|
|
2514
|
+
pointer-events: none;
|
|
2515
|
+
top: 50%;
|
|
2516
|
+
transform: translateY(-50%);
|
|
2517
|
+
font-size: 16px;
|
|
2518
|
+
color: var(--rel-colors-gray-primary);
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
.icon.left {
|
|
2522
|
+
left: 12px;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
.icon.right {
|
|
2526
|
+
right: 36px;
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
select {
|
|
2530
|
+
flex: 1;
|
|
2531
|
+
appearance: none;
|
|
2532
|
+
border: 1px solid var(--rel-colors-gray-border);
|
|
2533
|
+
background-color: var(--rel-colors-white);
|
|
2534
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
|
|
2535
|
+
background-repeat: no-repeat;
|
|
2536
|
+
background-position: right 12px center;
|
|
2537
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
2538
|
+
cursor: pointer;
|
|
2539
|
+
transition: all 0.2s ease-in-out;
|
|
2540
|
+
color: var(--rel-colors-gray-heading);
|
|
2541
|
+
width: 100%;
|
|
2542
|
+
outline: none;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
select:hover:not(:disabled) {
|
|
2546
|
+
border-color: var(--rel-colors-gray-primary);
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
select:focus:not(:disabled) {
|
|
2550
|
+
border-color: var(--rel-colors-black);
|
|
2551
|
+
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
/* States */
|
|
2555
|
+
select.error {
|
|
2556
|
+
border-color: var(--rel-colors-red-secondary);
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
select.error:focus {
|
|
2560
|
+
box-shadow: 0 0 0 3px rgba(213, 0, 0, 0.1);
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
select:disabled {
|
|
2564
|
+
background-color: var(--rel-colors-gray-bg);
|
|
2565
|
+
border-color: var(--rel-colors-gray-border);
|
|
2566
|
+
color: var(--rel-colors-gray-placeholder);
|
|
2567
|
+
cursor: not-allowed;
|
|
2568
|
+
opacity: 0.6;
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
/* Sizes */
|
|
2572
|
+
.select-small select {
|
|
2573
|
+
font-size: var(--rel-fontSizes-xs);
|
|
2574
|
+
padding: var(--rel-spacing-space-3xs) var(--rel-spacing-space-lg)
|
|
2575
|
+
var(--rel-spacing-space-3xs) var(--rel-spacing-space-2xs);
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
.select-medium select {
|
|
2579
|
+
font-size: var(--rel-fontSizes-sm);
|
|
2580
|
+
padding: var(--rel-spacing-space-2xs) var(--rel-spacing-space-xl)
|
|
2581
|
+
var(--rel-spacing-space-2xs) var(--rel-spacing-space-xs);
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
.select-large select {
|
|
2585
|
+
font-size: var(--rel-fontSizes-md);
|
|
2586
|
+
padding: var(--rel-spacing-space-xs) var(--rel-spacing-space-2xl)
|
|
2587
|
+
var(--rel-spacing-space-xs) var(--rel-spacing-space-sm);
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
/* With icons */
|
|
2591
|
+
.with-left-icon.select-small select {
|
|
2592
|
+
padding-left: var(--rel-spacing-space-xl);
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
.with-left-icon.select-medium select {
|
|
2596
|
+
padding-left: var(--rel-spacing-space-2xl);
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
.with-left-icon.select-large select {
|
|
2600
|
+
padding-left: var(--rel-spacing-space-3xl);
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
.with-right-icon.select-small select {
|
|
2604
|
+
padding-right: var(--rel-spacing-space-2xl);
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
.with-right-icon.select-medium select {
|
|
2608
|
+
padding-right: var(--rel-spacing-space-3xl);
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
.with-right-icon.select-large select {
|
|
2612
|
+
padding-right: 4rem;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
/* Border */
|
|
2616
|
+
.border-rounded select {
|
|
2617
|
+
border-radius: var(--rel-borders-radius-border-radius-300);
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
.border-sharp select {
|
|
2621
|
+
border-radius: 0;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
/* Supporting text */
|
|
2625
|
+
.supporting-text {
|
|
2626
|
+
font-size: var(--rel-fontSizes-xs);
|
|
2627
|
+
margin-top: var(--rel-spacing-space-3xs);
|
|
2628
|
+
color: var(--rel-colors-gray-placeholder);
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
.error-text {
|
|
2632
|
+
color: var(--rel-colors-red-secondary);
|
|
2633
|
+
}
|
|
2634
|
+
`;
|
|
2635
|
+
__decorateClass([
|
|
2636
|
+
property17({ type: String })
|
|
2637
|
+
], RelSelect.prototype, "label", 2);
|
|
2638
|
+
__decorateClass([
|
|
2639
|
+
property17({ type: Array })
|
|
2640
|
+
], RelSelect.prototype, "options", 2);
|
|
2641
|
+
__decorateClass([
|
|
2642
|
+
property17({ type: String })
|
|
2643
|
+
], RelSelect.prototype, "selected", 2);
|
|
2644
|
+
__decorateClass([
|
|
2645
|
+
property17({ type: String })
|
|
2646
|
+
], RelSelect.prototype, "state", 2);
|
|
2647
|
+
__decorateClass([
|
|
2648
|
+
property17({ type: String })
|
|
2649
|
+
], RelSelect.prototype, "supportingText", 2);
|
|
2650
|
+
__decorateClass([
|
|
2651
|
+
property17({ type: String })
|
|
2652
|
+
], RelSelect.prototype, "size", 2);
|
|
2653
|
+
__decorateClass([
|
|
2654
|
+
property17({ type: String })
|
|
2655
|
+
], RelSelect.prototype, "border", 2);
|
|
2656
|
+
__decorateClass([
|
|
2657
|
+
property17({ type: String })
|
|
2658
|
+
], RelSelect.prototype, "leftIcon", 2);
|
|
2659
|
+
__decorateClass([
|
|
2660
|
+
property17({ type: String })
|
|
2661
|
+
], RelSelect.prototype, "rightIcon", 2);
|
|
2662
|
+
RelSelect = __decorateClass([
|
|
2663
|
+
customElement18("rel-select")
|
|
2664
|
+
], RelSelect);
|
|
2665
|
+
|
|
2666
|
+
// src/components/rel-slider/rel-slider.ts
|
|
2667
|
+
import { LitElement as LitElement19, html as html19, css as css19 } from "lit";
|
|
2668
|
+
import { customElement as customElement19, property as property18, state as state4 } from "lit/decorators.js";
|
|
2669
|
+
var RelSlider = class extends LitElement19 {
|
|
2670
|
+
constructor() {
|
|
2671
|
+
super(...arguments);
|
|
2672
|
+
this.type = "continuous";
|
|
2673
|
+
this.min = 0;
|
|
2674
|
+
this.max = 100;
|
|
2675
|
+
this.step = 1;
|
|
2676
|
+
this.disabled = false;
|
|
2677
|
+
this.track = "solid";
|
|
2678
|
+
this.showTickLabels = false;
|
|
2679
|
+
this.showBubble = true;
|
|
2680
|
+
this.value = 0;
|
|
2681
|
+
this.ticks = [];
|
|
2682
|
+
}
|
|
2683
|
+
connectedCallback() {
|
|
2684
|
+
super.connectedCallback();
|
|
2685
|
+
this.setupTicks();
|
|
2686
|
+
}
|
|
2687
|
+
updated(changedProperties) {
|
|
2688
|
+
if (changedProperties.has("type") || changedProperties.has("min") || changedProperties.has("max") || changedProperties.has("step")) {
|
|
2689
|
+
this.setupTicks();
|
|
2690
|
+
}
|
|
2691
|
+
if (changedProperties.has("value")) {
|
|
2692
|
+
this.updateActiveWidth();
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
get percentage() {
|
|
2696
|
+
if (this.max === this.min) return 0;
|
|
2697
|
+
return (this.value - this.min) / (this.max - this.min) * 100;
|
|
2698
|
+
}
|
|
2699
|
+
setupTicks() {
|
|
2700
|
+
if (this.type !== "discrete") {
|
|
2701
|
+
this.ticks = [];
|
|
2702
|
+
return;
|
|
2703
|
+
}
|
|
2704
|
+
const step = Math.max(1, this.step);
|
|
2705
|
+
const ticks = [];
|
|
2706
|
+
for (let v = this.min; v <= this.max; v += step) {
|
|
2707
|
+
ticks.push(v);
|
|
2708
|
+
}
|
|
2709
|
+
if (ticks[ticks.length - 1] !== this.max) {
|
|
2710
|
+
ticks.push(this.max);
|
|
2711
|
+
}
|
|
2712
|
+
this.ticks = ticks;
|
|
2713
|
+
}
|
|
2714
|
+
getTickLeftPct(tick) {
|
|
2715
|
+
const pct = (tick - this.min) / (this.max - this.min) * 100;
|
|
2716
|
+
return Math.round(pct * 1e3) / 1e3;
|
|
2717
|
+
}
|
|
2718
|
+
isTickActive(tick) {
|
|
2719
|
+
return tick <= this.value;
|
|
2720
|
+
}
|
|
2721
|
+
onInput(ev) {
|
|
2722
|
+
const el = ev.target;
|
|
2723
|
+
let next = Number(el.value);
|
|
2724
|
+
if (this.type === "discrete") {
|
|
2725
|
+
const snapped = Math.round((next - this.min) / this.step) * this.step + this.min;
|
|
2726
|
+
next = Math.min(this.max, Math.max(this.min, snapped));
|
|
2727
|
+
el.value = String(next);
|
|
2728
|
+
}
|
|
2729
|
+
this.value = next;
|
|
2730
|
+
this.updateActiveWidth();
|
|
2731
|
+
this.dispatchEvent(
|
|
2732
|
+
new CustomEvent("valueChange", {
|
|
2733
|
+
detail: { value: this.value },
|
|
2734
|
+
bubbles: true,
|
|
2735
|
+
composed: true
|
|
2736
|
+
})
|
|
2737
|
+
);
|
|
2738
|
+
}
|
|
2739
|
+
updateActiveWidth() {
|
|
2740
|
+
const activeEl = this.shadowRoot?.querySelector(".track-active");
|
|
2741
|
+
if (activeEl) {
|
|
2742
|
+
if (this.type === "discrete") {
|
|
2743
|
+
const stepPercent = this.step / (this.max - this.min) * 100;
|
|
2744
|
+
const snappedPct = Math.round(this.percentage / stepPercent) * stepPercent;
|
|
2745
|
+
activeEl.style.width = `${snappedPct}%`;
|
|
2746
|
+
} else {
|
|
2747
|
+
activeEl.style.width = `${this.percentage}%`;
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
renderThumbContainer() {
|
|
2752
|
+
return html19`
|
|
2753
|
+
<div class="thumb-container" style="left: ${this.percentage}%">
|
|
2754
|
+
${this.showBubble ? html19`
|
|
2755
|
+
<div class="value-marker">
|
|
2756
|
+
<svg viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg">
|
|
2757
|
+
<path
|
|
2758
|
+
d="M12 0C18.6274 0 24 5.37258 24 12C24 21 12 32 12 32C12 32 0 21 0 12C0 5.37258 5.37258 0 12 0Z"
|
|
2759
|
+
fill="black" />
|
|
2760
|
+
<text
|
|
2761
|
+
x="12"
|
|
2762
|
+
y="16"
|
|
2763
|
+
text-anchor="middle"
|
|
2764
|
+
fill="white"
|
|
2765
|
+
font-size="12"
|
|
2766
|
+
font-family="Poppins"
|
|
2767
|
+
font-weight="600">
|
|
2768
|
+
${this.value}
|
|
2769
|
+
</text>
|
|
2770
|
+
</svg>
|
|
2771
|
+
</div>
|
|
2772
|
+
` : ""}
|
|
2773
|
+
<div class="custom-thumb"></div>
|
|
2774
|
+
</div>
|
|
2775
|
+
`;
|
|
2776
|
+
}
|
|
2777
|
+
renderTicks() {
|
|
2778
|
+
if (this.type !== "discrete") return "";
|
|
2779
|
+
return html19`
|
|
2780
|
+
<div class="ticks">
|
|
2781
|
+
${this.ticks.map(
|
|
2782
|
+
(tick) => html19`
|
|
2783
|
+
<div
|
|
2784
|
+
class="tick ${this.isTickActive(tick) ? "active" : ""}"
|
|
2785
|
+
style="left: ${this.getTickLeftPct(tick)}%"></div>
|
|
2786
|
+
`
|
|
2787
|
+
)}
|
|
2788
|
+
</div>
|
|
2789
|
+
`;
|
|
2790
|
+
}
|
|
2791
|
+
renderTickLabels() {
|
|
2792
|
+
if (this.type !== "discrete" || !this.showTickLabels) return "";
|
|
2793
|
+
return html19`
|
|
2794
|
+
<div class="tick-labels">
|
|
2795
|
+
${this.ticks.map(
|
|
2796
|
+
(tick) => html19`
|
|
2797
|
+
<div
|
|
2798
|
+
class="tick-label"
|
|
2799
|
+
style="left: ${this.getTickLeftPct(tick)}%">
|
|
2800
|
+
${tick}
|
|
2801
|
+
</div>
|
|
2802
|
+
`
|
|
2803
|
+
)}
|
|
2804
|
+
</div>
|
|
2805
|
+
`;
|
|
2806
|
+
}
|
|
2807
|
+
render() {
|
|
2808
|
+
const sliderClasses = [
|
|
2809
|
+
"rel-slider",
|
|
2810
|
+
this.disabled ? "disabled" : "",
|
|
2811
|
+
this.type === "discrete" ? "has-ticks" : ""
|
|
2812
|
+
].filter(Boolean).join(" ");
|
|
2813
|
+
const trackActiveClasses = [
|
|
2814
|
+
"track-active",
|
|
2815
|
+
this.track === "dotted" ? "dotted" : ""
|
|
2816
|
+
].filter(Boolean).join(" ");
|
|
2817
|
+
return html19`
|
|
2818
|
+
<div class="${sliderClasses}">
|
|
2819
|
+
<div class="track"></div>
|
|
2820
|
+
<div class="${trackActiveClasses}"></div>
|
|
2821
|
+
|
|
2822
|
+
<input
|
|
2823
|
+
class="slider-input"
|
|
2824
|
+
type="range"
|
|
2825
|
+
.min="${String(this.min)}"
|
|
2826
|
+
.max="${String(this.max)}"
|
|
2827
|
+
.step="${this.type === "discrete" ? String(this.step) : "1"}"
|
|
2828
|
+
.value="${String(this.value)}"
|
|
2829
|
+
?disabled="${this.disabled}"
|
|
2830
|
+
@input="${this.onInput}" />
|
|
2831
|
+
|
|
2832
|
+
${this.renderThumbContainer()}
|
|
2833
|
+
${this.renderTicks()}
|
|
2834
|
+
${this.renderTickLabels()}
|
|
2835
|
+
</div>
|
|
2836
|
+
`;
|
|
2837
|
+
}
|
|
2838
|
+
};
|
|
2839
|
+
RelSlider.styles = css19`
|
|
2840
|
+
:host {
|
|
2841
|
+
--track-height: 5px;
|
|
2842
|
+
--thumb-size: 10px;
|
|
2843
|
+
--thumb-stroke: 7px;
|
|
2844
|
+
--thumb-halo-color: rgba(224, 222, 222, 0.8);
|
|
2845
|
+
--tick-size: 4px;
|
|
2846
|
+
--shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
|
|
2847
|
+
--halo: 0 2px 0 #e9e9e9, 0 6px 10px rgba(0, 0, 0, 0.07);
|
|
2848
|
+
--marker-width: 24px;
|
|
2849
|
+
--marker-height: 28px;
|
|
2850
|
+
|
|
2851
|
+
display: block;
|
|
2852
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
.rel-slider {
|
|
2856
|
+
position: relative;
|
|
2857
|
+
width: 100%;
|
|
2858
|
+
height: 60px;
|
|
2859
|
+
user-select: none;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
/* Track */
|
|
2863
|
+
.track {
|
|
2864
|
+
position: absolute;
|
|
2865
|
+
top: 50%;
|
|
2866
|
+
left: 0;
|
|
2867
|
+
width: 100%;
|
|
2868
|
+
height: var(--track-height);
|
|
2869
|
+
background: var(--rel-colors-gray-border);
|
|
2870
|
+
border-radius: 2px;
|
|
2871
|
+
transform: translateY(-50%);
|
|
2872
|
+
pointer-events: none;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
.track-active {
|
|
2876
|
+
position: absolute;
|
|
2877
|
+
top: 50%;
|
|
2878
|
+
left: 0;
|
|
2879
|
+
height: var(--track-height);
|
|
2880
|
+
background: var(--rel-colors-black);
|
|
2881
|
+
border-radius: 2px;
|
|
2882
|
+
transform: translateY(-50%);
|
|
2883
|
+
pointer-events: none;
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
.track-active.dotted {
|
|
2887
|
+
background: radial-gradient(
|
|
2888
|
+
circle,
|
|
2889
|
+
var(--rel-colors-white) 0 1px,
|
|
2890
|
+
transparent 1px
|
|
2891
|
+
)
|
|
2892
|
+
center/12px 4px repeat-x,
|
|
2893
|
+
var(--rel-colors-black);
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
/* Input */
|
|
2897
|
+
.slider-input {
|
|
2898
|
+
-webkit-appearance: none;
|
|
2899
|
+
appearance: none;
|
|
2900
|
+
position: absolute;
|
|
2901
|
+
top: 0;
|
|
2902
|
+
width: 100%;
|
|
2903
|
+
left: 0;
|
|
2904
|
+
height: 100%;
|
|
2905
|
+
background: transparent;
|
|
2906
|
+
outline: none;
|
|
2907
|
+
cursor: pointer;
|
|
2908
|
+
z-index: 2;
|
|
2909
|
+
margin: 0;
|
|
2910
|
+
padding: 0;
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
.slider-input::-webkit-slider-runnable-track {
|
|
2914
|
+
background: transparent;
|
|
2915
|
+
height: 100%;
|
|
2916
|
+
border: none;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
.slider-input::-moz-range-track {
|
|
2920
|
+
background: transparent;
|
|
2921
|
+
height: 100%;
|
|
2922
|
+
border: none;
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
/* Hide native thumb */
|
|
2926
|
+
.slider-input::-webkit-slider-thumb {
|
|
2927
|
+
-webkit-appearance: none;
|
|
2928
|
+
appearance: none;
|
|
2929
|
+
width: 1px;
|
|
2930
|
+
height: 1px;
|
|
2931
|
+
background: transparent;
|
|
2932
|
+
border: none;
|
|
2933
|
+
cursor: pointer;
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
.slider-input::-moz-range-thumb {
|
|
2937
|
+
width: 1px;
|
|
2938
|
+
height: 1px;
|
|
2939
|
+
background: transparent;
|
|
2940
|
+
border: none;
|
|
2941
|
+
cursor: pointer;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
/* Custom Thumb Container */
|
|
2945
|
+
.thumb-container {
|
|
2946
|
+
position: absolute;
|
|
2947
|
+
left: 0;
|
|
2948
|
+
top: 23.5%;
|
|
2949
|
+
transform: translate(-50%, -50%);
|
|
2950
|
+
pointer-events: none;
|
|
2951
|
+
z-index: 5;
|
|
2952
|
+
display: flex;
|
|
2953
|
+
flex-direction: column;
|
|
2954
|
+
align-items: center;
|
|
2955
|
+
gap: 0;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
/* Value Marker */
|
|
2959
|
+
.value-marker {
|
|
2960
|
+
width: var(--marker-width);
|
|
2961
|
+
height: var(--marker-height);
|
|
2962
|
+
margin-bottom: 4px;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
.value-marker svg {
|
|
2966
|
+
width: 100%;
|
|
2967
|
+
height: 100%;
|
|
2968
|
+
display: block;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
/* Custom Thumb */
|
|
2972
|
+
.custom-thumb {
|
|
2973
|
+
width: var(--thumb-size);
|
|
2974
|
+
height: var(--thumb-size);
|
|
2975
|
+
background: var(--rel-colors-black);
|
|
2976
|
+
border-radius: 50%;
|
|
2977
|
+
transition: box-shadow 0.15s ease;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
.slider-input:active ~ .thumb-container .custom-thumb {
|
|
2981
|
+
box-shadow: 0 0 0 var(--thumb-stroke) var(--thumb-halo-color),
|
|
2982
|
+
var(--shadow), var(--halo);
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
/* Ticks */
|
|
2986
|
+
.ticks {
|
|
2987
|
+
position: absolute;
|
|
2988
|
+
top: 50%;
|
|
2989
|
+
left: 0;
|
|
2990
|
+
width: 100%;
|
|
2991
|
+
transform: translateY(-50%);
|
|
2992
|
+
pointer-events: none;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
.tick {
|
|
2996
|
+
position: absolute;
|
|
2997
|
+
width: var(--tick-size);
|
|
2998
|
+
height: var(--tick-size);
|
|
2999
|
+
background: var(--rel-colors-gray-primary);
|
|
3000
|
+
border-radius: 50%;
|
|
3001
|
+
transform: translate(-50%, -50%);
|
|
3002
|
+
transition: background 0.2s;
|
|
3003
|
+
z-index: 3;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
.tick.active {
|
|
3007
|
+
background: var(--rel-colors-white);
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
/* Tick labels */
|
|
3011
|
+
.tick-labels {
|
|
3012
|
+
position: absolute;
|
|
3013
|
+
top: calc(50% + var(--tick-size) + 6px);
|
|
3014
|
+
left: 0;
|
|
3015
|
+
width: 100%;
|
|
3016
|
+
font-size: var(--rel-fontSizes-xs);
|
|
3017
|
+
color: var(--rel-colors-gray-heading);
|
|
3018
|
+
pointer-events: none;
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3021
|
+
.tick-label {
|
|
3022
|
+
position: absolute;
|
|
3023
|
+
transform: translateX(-50%);
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
/* Disabled State */
|
|
3027
|
+
.rel-slider.disabled .track {
|
|
3028
|
+
background: var(--rel-colors-gray-primary);
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
.rel-slider.disabled .track-active {
|
|
3032
|
+
background: var(--rel-colors-gray-placeholder);
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
.rel-slider.disabled .track-active.dotted {
|
|
3036
|
+
background: radial-gradient(
|
|
3037
|
+
circle,
|
|
3038
|
+
#eaeaea 0 1px,
|
|
3039
|
+
transparent 1px
|
|
3040
|
+
)
|
|
3041
|
+
center/12px 4px repeat-x,
|
|
3042
|
+
var(--rel-colors-gray-placeholder);
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
.rel-slider.disabled .tick {
|
|
3046
|
+
background: var(--rel-colors-gray-placeholder);
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
.rel-slider.disabled .tick-label {
|
|
3050
|
+
color: var(--rel-colors-gray-placeholder);
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
.rel-slider.disabled .slider-input {
|
|
3054
|
+
cursor: not-allowed;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
.rel-slider.disabled .custom-thumb {
|
|
3058
|
+
background: var(--rel-colors-gray-placeholder);
|
|
3059
|
+
box-shadow: 0 0 0 var(--thumb-stroke) #f5f5f5;
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
.rel-slider.disabled .value-marker svg path {
|
|
3063
|
+
fill: var(--rel-colors-gray-placeholder);
|
|
3064
|
+
}
|
|
3065
|
+
`;
|
|
3066
|
+
__decorateClass([
|
|
3067
|
+
property18({ type: String })
|
|
3068
|
+
], RelSlider.prototype, "type", 2);
|
|
3069
|
+
__decorateClass([
|
|
3070
|
+
property18({ type: Number })
|
|
3071
|
+
], RelSlider.prototype, "min", 2);
|
|
3072
|
+
__decorateClass([
|
|
3073
|
+
property18({ type: Number })
|
|
3074
|
+
], RelSlider.prototype, "max", 2);
|
|
3075
|
+
__decorateClass([
|
|
3076
|
+
property18({ type: Number })
|
|
3077
|
+
], RelSlider.prototype, "step", 2);
|
|
3078
|
+
__decorateClass([
|
|
3079
|
+
property18({ type: Boolean })
|
|
3080
|
+
], RelSlider.prototype, "disabled", 2);
|
|
3081
|
+
__decorateClass([
|
|
3082
|
+
property18({ type: String })
|
|
3083
|
+
], RelSlider.prototype, "track", 2);
|
|
3084
|
+
__decorateClass([
|
|
3085
|
+
property18({ type: Boolean })
|
|
3086
|
+
], RelSlider.prototype, "showTickLabels", 2);
|
|
3087
|
+
__decorateClass([
|
|
3088
|
+
property18({ type: Boolean })
|
|
3089
|
+
], RelSlider.prototype, "showBubble", 2);
|
|
3090
|
+
__decorateClass([
|
|
3091
|
+
property18({ type: Number })
|
|
3092
|
+
], RelSlider.prototype, "value", 2);
|
|
3093
|
+
__decorateClass([
|
|
3094
|
+
state4()
|
|
3095
|
+
], RelSlider.prototype, "ticks", 2);
|
|
3096
|
+
RelSlider = __decorateClass([
|
|
3097
|
+
customElement19("rel-slider")
|
|
3098
|
+
], RelSlider);
|
|
3099
|
+
|
|
3100
|
+
// src/components/rel-snackbar/rel-snackbar.ts
|
|
3101
|
+
import { LitElement as LitElement20, html as html20, css as css20 } from "lit";
|
|
3102
|
+
import { customElement as customElement20, property as property19, state as state5 } from "lit/decorators.js";
|
|
3103
|
+
var RelSnackbar = class extends LitElement20 {
|
|
3104
|
+
constructor() {
|
|
3105
|
+
super(...arguments);
|
|
3106
|
+
this.message = "This is a snackbar message";
|
|
3107
|
+
this.longerAction = false;
|
|
3108
|
+
this.iconClose = true;
|
|
3109
|
+
this.lines = "single";
|
|
3110
|
+
this.duration = 4e3;
|
|
3111
|
+
this.visible = true;
|
|
3112
|
+
this.timeout = null;
|
|
3113
|
+
}
|
|
3114
|
+
connectedCallback() {
|
|
3115
|
+
super.connectedCallback();
|
|
3116
|
+
this.setAutoDismiss();
|
|
3117
|
+
}
|
|
3118
|
+
disconnectedCallback() {
|
|
3119
|
+
super.disconnectedCallback();
|
|
3120
|
+
this.clearTimeout();
|
|
3121
|
+
}
|
|
3122
|
+
setAutoDismiss() {
|
|
3123
|
+
if (this.duration > 0) {
|
|
3124
|
+
this.clearTimeout();
|
|
3125
|
+
const delay = this.longerAction ? this.duration * 2 : this.duration;
|
|
3126
|
+
this.timeout = window.setTimeout(() => this.dismiss(), delay);
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
clearTimeout() {
|
|
3130
|
+
if (this.timeout !== null) {
|
|
3131
|
+
window.clearTimeout(this.timeout);
|
|
3132
|
+
this.timeout = null;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
onActionClick() {
|
|
3136
|
+
this.dispatchEvent(
|
|
3137
|
+
new CustomEvent("actionClick", {
|
|
3138
|
+
bubbles: true,
|
|
3139
|
+
composed: true
|
|
3140
|
+
})
|
|
3141
|
+
);
|
|
3142
|
+
this.dismiss();
|
|
3143
|
+
}
|
|
3144
|
+
dismiss() {
|
|
3145
|
+
this.visible = false;
|
|
3146
|
+
this.dispatchEvent(
|
|
3147
|
+
new CustomEvent("close", {
|
|
3148
|
+
bubbles: true,
|
|
3149
|
+
composed: true
|
|
3150
|
+
})
|
|
3151
|
+
);
|
|
3152
|
+
}
|
|
3153
|
+
render() {
|
|
3154
|
+
const snackbarClasses = [
|
|
3155
|
+
"snackbar",
|
|
3156
|
+
this.lines === "double" ? "two-line" : "",
|
|
3157
|
+
!this.visible ? "hidden" : ""
|
|
3158
|
+
].filter(Boolean).join(" ");
|
|
3159
|
+
return html20`
|
|
3160
|
+
<div class="${snackbarClasses}">
|
|
3161
|
+
<div class="snackbar-message">${this.message}</div>
|
|
3162
|
+
|
|
3163
|
+
<div class="snackbar-actions">
|
|
3164
|
+
${this.action ? html20`
|
|
3165
|
+
<button class="snackbar-action" @click="${this.onActionClick}">
|
|
3166
|
+
${this.action}
|
|
3167
|
+
</button>
|
|
3168
|
+
` : ""}
|
|
3169
|
+
${this.iconClose ? html20`
|
|
3170
|
+
<button class="snackbar-close" @click="${this.dismiss}">
|
|
3171
|
+
✖
|
|
3172
|
+
</button>
|
|
3173
|
+
` : ""}
|
|
3174
|
+
</div>
|
|
3175
|
+
</div>
|
|
3176
|
+
`;
|
|
3177
|
+
}
|
|
3178
|
+
};
|
|
3179
|
+
RelSnackbar.styles = css20`
|
|
3180
|
+
:host {
|
|
3181
|
+
display: block;
|
|
3182
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
.snackbar {
|
|
3186
|
+
display: flex;
|
|
3187
|
+
justify-content: space-between;
|
|
3188
|
+
align-items: center;
|
|
3189
|
+
min-width: 280px;
|
|
3190
|
+
max-width: 500px;
|
|
3191
|
+
margin: 0;
|
|
3192
|
+
padding: 12px 16px;
|
|
3193
|
+
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
3194
|
+
background-color: var(--rel-colors-black);
|
|
3195
|
+
color: var(--rel-colors-white);
|
|
3196
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3197
|
+
box-shadow: var(--rel-shadows-shadow-300);
|
|
3198
|
+
animation: slide-up 0.3s ease-out;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
.snackbar.two-line {
|
|
3202
|
+
flex-direction: column;
|
|
3203
|
+
align-items: stretch;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
.snackbar.hidden {
|
|
3207
|
+
display: none;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
.snackbar-message {
|
|
3211
|
+
font-size: var(--rel-fontSizes-sm);
|
|
3212
|
+
line-height: var(--rel-lineHeights-lineheight-200);
|
|
3213
|
+
margin-right: 12px;
|
|
3214
|
+
flex: 1;
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
.snackbar.two-line .snackbar-message {
|
|
3218
|
+
margin-right: 0;
|
|
3219
|
+
margin-bottom: 8px;
|
|
3220
|
+
flex: none;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
.snackbar-actions {
|
|
3224
|
+
display: flex;
|
|
3225
|
+
align-items: center;
|
|
3226
|
+
gap: var(--rel-spacing-space-2xs);
|
|
3227
|
+
flex-shrink: 0;
|
|
3228
|
+
align-self: center;
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
.snackbar.two-line .snackbar-actions {
|
|
3232
|
+
align-self: flex-end;
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
.snackbar-action {
|
|
3236
|
+
background: none;
|
|
3237
|
+
border: none;
|
|
3238
|
+
color: var(--rel-colors-green-secondary);
|
|
3239
|
+
font-weight: var(--rel-fontWeights-semibold);
|
|
3240
|
+
font-size: var(--rel-fontSizes-sm);
|
|
3241
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3242
|
+
cursor: pointer;
|
|
3243
|
+
padding: 0;
|
|
3244
|
+
transition: opacity 0.2s ease;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
.snackbar-action:hover {
|
|
3248
|
+
opacity: 0.8;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
.snackbar-action:active {
|
|
3252
|
+
opacity: 0.6;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
.snackbar-close {
|
|
3256
|
+
background: none;
|
|
3257
|
+
border: none;
|
|
3258
|
+
color: var(--rel-colors-white);
|
|
3259
|
+
cursor: pointer;
|
|
3260
|
+
font-size: 16px;
|
|
3261
|
+
padding: 0;
|
|
3262
|
+
width: 20px;
|
|
3263
|
+
height: 20px;
|
|
3264
|
+
display: flex;
|
|
3265
|
+
align-items: center;
|
|
3266
|
+
justify-content: center;
|
|
3267
|
+
transition: opacity 0.2s ease;
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
.snackbar-close:hover {
|
|
3271
|
+
opacity: 0.8;
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
.snackbar-close:active {
|
|
3275
|
+
opacity: 0.6;
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
@keyframes slide-up {
|
|
3279
|
+
from {
|
|
3280
|
+
transform: translateY(50px);
|
|
3281
|
+
opacity: 0;
|
|
3282
|
+
}
|
|
3283
|
+
to {
|
|
3284
|
+
transform: translateY(0);
|
|
3285
|
+
opacity: 1;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
`;
|
|
3289
|
+
__decorateClass([
|
|
3290
|
+
property19({ type: String })
|
|
3291
|
+
], RelSnackbar.prototype, "message", 2);
|
|
3292
|
+
__decorateClass([
|
|
3293
|
+
property19({ type: String })
|
|
3294
|
+
], RelSnackbar.prototype, "action", 2);
|
|
3295
|
+
__decorateClass([
|
|
3296
|
+
property19({ type: Boolean })
|
|
3297
|
+
], RelSnackbar.prototype, "longerAction", 2);
|
|
3298
|
+
__decorateClass([
|
|
3299
|
+
property19({ type: Boolean })
|
|
3300
|
+
], RelSnackbar.prototype, "iconClose", 2);
|
|
3301
|
+
__decorateClass([
|
|
3302
|
+
property19({ type: String })
|
|
3303
|
+
], RelSnackbar.prototype, "lines", 2);
|
|
3304
|
+
__decorateClass([
|
|
3305
|
+
property19({ type: Number })
|
|
3306
|
+
], RelSnackbar.prototype, "duration", 2);
|
|
3307
|
+
__decorateClass([
|
|
3308
|
+
state5()
|
|
3309
|
+
], RelSnackbar.prototype, "visible", 2);
|
|
3310
|
+
RelSnackbar = __decorateClass([
|
|
3311
|
+
customElement20("rel-snackbar")
|
|
3312
|
+
], RelSnackbar);
|
|
3313
|
+
|
|
3314
|
+
// src/components/rel-stepper/rel-stepper.ts
|
|
3315
|
+
import { LitElement as LitElement21, html as html21, css as css21 } from "lit";
|
|
3316
|
+
import { customElement as customElement21, property as property20 } from "lit/decorators.js";
|
|
3317
|
+
var RelStepper = class extends LitElement21 {
|
|
3318
|
+
constructor() {
|
|
3319
|
+
super(...arguments);
|
|
3320
|
+
this.steps = [];
|
|
3321
|
+
this.textAlign = "below";
|
|
3322
|
+
this.orientation = "horizontal";
|
|
3323
|
+
this.size = "large";
|
|
3324
|
+
}
|
|
3325
|
+
isDone(step) {
|
|
3326
|
+
return step.status === "done";
|
|
3327
|
+
}
|
|
3328
|
+
isProgress(step) {
|
|
3329
|
+
return step.status === "progress";
|
|
3330
|
+
}
|
|
3331
|
+
isDisabled(step) {
|
|
3332
|
+
return step.status === "disabled";
|
|
3333
|
+
}
|
|
3334
|
+
getStepClasses(step) {
|
|
3335
|
+
const classes = ["rel-step"];
|
|
3336
|
+
if (this.isDone(step)) classes.push("done");
|
|
3337
|
+
if (this.isProgress(step)) classes.push("progress");
|
|
3338
|
+
if (this.isDisabled(step)) classes.push("disabled");
|
|
3339
|
+
return classes.join(" ");
|
|
3340
|
+
}
|
|
3341
|
+
renderIndicator(step, index) {
|
|
3342
|
+
if (step.status === "done") {
|
|
3343
|
+
return html21`
|
|
3344
|
+
<svg
|
|
3345
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3346
|
+
width="14"
|
|
3347
|
+
height="10"
|
|
3348
|
+
viewBox="0 0 18 14"
|
|
3349
|
+
fill="none"
|
|
3350
|
+
class="check-icon"
|
|
3351
|
+
>
|
|
3352
|
+
<path
|
|
3353
|
+
d="M6.44479 14L0.5 7.36383L1.9862 5.70478L6.44479 10.6819L16.0138 0L17.5 1.65904L6.44479 14Z"
|
|
3354
|
+
fill="white"
|
|
3355
|
+
/>
|
|
3356
|
+
</svg>
|
|
3357
|
+
`;
|
|
3358
|
+
}
|
|
3359
|
+
return html21`<span>${index + 1}</span>`;
|
|
3360
|
+
}
|
|
3361
|
+
render() {
|
|
3362
|
+
const stepperClasses = [
|
|
3363
|
+
"rel-stepper",
|
|
3364
|
+
this.orientation === "vertical" ? "vertical" : "horizontal",
|
|
3365
|
+
this.textAlign === "below" ? "text-below" : "text-right",
|
|
3366
|
+
this.size === "small" ? "small" : "large"
|
|
3367
|
+
].filter(Boolean).join(" ");
|
|
3368
|
+
const isVertical = this.orientation === "vertical";
|
|
3369
|
+
const isTextRight = this.textAlign === "right";
|
|
3370
|
+
return html21`
|
|
3371
|
+
<div class="${stepperClasses}">
|
|
3372
|
+
${this.steps.map(
|
|
3373
|
+
(step, idx) => html21`
|
|
3374
|
+
<div class="${this.getStepClasses(step)}">
|
|
3375
|
+
${isVertical && isTextRight ? html21`
|
|
3376
|
+
<!-- Indicator with connector below -->
|
|
3377
|
+
<div class="indicator-wrapper">
|
|
3378
|
+
<div class="indicator">
|
|
3379
|
+
${this.renderIndicator(step, idx)}
|
|
3380
|
+
</div>
|
|
3381
|
+
${idx < this.steps.length - 1 ? html21`<div class="connector"></div>` : ""}
|
|
3382
|
+
</div>
|
|
3383
|
+
|
|
3384
|
+
<!-- Step Label to the right -->
|
|
3385
|
+
<div class="step-label">${step.title}</div>
|
|
3386
|
+
` : isVertical ? html21`
|
|
3387
|
+
<div class="step-content text-below-content">
|
|
3388
|
+
<!-- Step Indicator -->
|
|
3389
|
+
<div class="indicator">
|
|
3390
|
+
${this.renderIndicator(step, idx)}
|
|
3391
|
+
</div>
|
|
3392
|
+
|
|
3393
|
+
<!-- Step Label -->
|
|
3394
|
+
<div class="step-label">${step.title}</div>
|
|
3395
|
+
</div>
|
|
3396
|
+
|
|
3397
|
+
<!-- Connector -->
|
|
3398
|
+
${idx < this.steps.length - 1 ? html21`<div class="connector"></div>` : ""}
|
|
3399
|
+
` : html21`
|
|
3400
|
+
<!-- Step Indicator -->
|
|
3401
|
+
<div class="indicator">
|
|
3402
|
+
${this.renderIndicator(step, idx)}
|
|
3403
|
+
</div>
|
|
3404
|
+
|
|
3405
|
+
<!-- Step Label -->
|
|
3406
|
+
<div class="step-label">${step.title}</div>
|
|
3407
|
+
|
|
3408
|
+
<!-- Connector (for horizontal only) -->
|
|
3409
|
+
${!isVertical && idx < this.steps.length - 1 ? html21`<div class="connector"></div>` : ""}
|
|
3410
|
+
`}
|
|
3411
|
+
</div>
|
|
3412
|
+
`
|
|
3413
|
+
)}
|
|
3414
|
+
</div>
|
|
3415
|
+
`;
|
|
3416
|
+
}
|
|
3417
|
+
};
|
|
3418
|
+
RelStepper.styles = css21`
|
|
3419
|
+
:host {
|
|
3420
|
+
display: block;
|
|
3421
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
/********************************************
|
|
3425
|
+
* Base Stepper Styles
|
|
3426
|
+
********************************************/
|
|
3427
|
+
.rel-stepper {
|
|
3428
|
+
display: flex;
|
|
3429
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3430
|
+
width: 100%;
|
|
3431
|
+
position: relative;
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
/* Orientation */
|
|
3435
|
+
.rel-stepper.horizontal {
|
|
3436
|
+
flex-direction: row;
|
|
3437
|
+
align-items: flex-start;
|
|
3438
|
+
justify-content: center;
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3441
|
+
.rel-stepper.vertical.text-below {
|
|
3442
|
+
flex-direction: column;
|
|
3443
|
+
align-items: center;
|
|
3444
|
+
justify-content: start;
|
|
3445
|
+
}
|
|
3446
|
+
|
|
3447
|
+
.rel-stepper.vertical.text-right {
|
|
3448
|
+
flex-direction: column;
|
|
3449
|
+
align-items: flex-start;
|
|
3450
|
+
justify-content: start;
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
/********************************************
|
|
3454
|
+
* Step Container
|
|
3455
|
+
********************************************/
|
|
3456
|
+
.rel-step {
|
|
3457
|
+
display: flex;
|
|
3458
|
+
position: relative;
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
.rel-stepper.horizontal.text-below .rel-step {
|
|
3462
|
+
flex-direction: column;
|
|
3463
|
+
align-items: center;
|
|
3464
|
+
text-align: center;
|
|
3465
|
+
position: relative;
|
|
3466
|
+
flex: 0;
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
.rel-stepper.horizontal.text-right .rel-step {
|
|
3470
|
+
flex-direction: row;
|
|
3471
|
+
align-items: center;
|
|
3472
|
+
position: relative;
|
|
3473
|
+
flex: 0;
|
|
3474
|
+
gap: var(--rel-spacing-space-2xs);
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
/* Vertical layout variants */
|
|
3478
|
+
.rel-stepper.vertical.text-below .rel-step {
|
|
3479
|
+
flex-direction: column;
|
|
3480
|
+
align-items: center;
|
|
3481
|
+
justify-content: start;
|
|
3482
|
+
position: relative;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
.rel-stepper.vertical.text-right .rel-step {
|
|
3486
|
+
flex-direction: row;
|
|
3487
|
+
align-items: flex-start;
|
|
3488
|
+
justify-content: center;
|
|
3489
|
+
position: relative;
|
|
3490
|
+
gap: var(--rel-spacing-space-2xs);
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
/* Wrapper for indicator and connector */
|
|
3494
|
+
.indicator-wrapper {
|
|
3495
|
+
display: flex;
|
|
3496
|
+
flex-direction: column;
|
|
3497
|
+
align-items: center;
|
|
3498
|
+
position: relative;
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
/* Wrapper for indicator and label (text-below only) */
|
|
3502
|
+
.step-content {
|
|
3503
|
+
display: flex;
|
|
3504
|
+
align-items: center;
|
|
3505
|
+
gap: var(--rel-spacing-space-2xs);
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
.text-below-content {
|
|
3509
|
+
flex-direction: column;
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
.text-right-content {
|
|
3513
|
+
flex-direction: row;
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
/********************************************
|
|
3517
|
+
* Indicator
|
|
3518
|
+
********************************************/
|
|
3519
|
+
.indicator {
|
|
3520
|
+
display: flex;
|
|
3521
|
+
align-items: center;
|
|
3522
|
+
justify-content: center;
|
|
3523
|
+
width: 22px;
|
|
3524
|
+
height: 22px;
|
|
3525
|
+
border: 2px solid var(--rel-colors-gray-border);
|
|
3526
|
+
background: var(--rel-colors-white);
|
|
3527
|
+
border-radius: 50%;
|
|
3528
|
+
font-size: var(--rel-fontSizes-sm);
|
|
3529
|
+
font-weight: var(--rel-fontWeights-medium);
|
|
3530
|
+
position: relative;
|
|
3531
|
+
z-index: 2;
|
|
3532
|
+
transition: all 0.2s ease;
|
|
3533
|
+
flex-shrink: 0;
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
.indicator svg {
|
|
3537
|
+
width: 12px;
|
|
3538
|
+
height: auto;
|
|
3539
|
+
display: block;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
/********************************************
|
|
3543
|
+
* Labels
|
|
3544
|
+
********************************************/
|
|
3545
|
+
.step-label {
|
|
3546
|
+
white-space: nowrap;
|
|
3547
|
+
font-size: var(--rel-fontSizes-sm);
|
|
3548
|
+
color: var(--rel-colors-gray-paragraph);
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
/* Horizontal text-below specific */
|
|
3552
|
+
.rel-stepper.horizontal.text-below .step-label {
|
|
3553
|
+
margin-top: var(--rel-spacing-space-2xs);
|
|
3554
|
+
text-align: center;
|
|
3555
|
+
}
|
|
3556
|
+
|
|
3557
|
+
/* Horizontal text-right specific */
|
|
3558
|
+
.rel-stepper.horizontal.text-right .step-label {
|
|
3559
|
+
margin-top: 0;
|
|
3560
|
+
margin-left: 0;
|
|
3561
|
+
margin-right: var(--rel-spacing-space-xs);
|
|
3562
|
+
text-align: left;
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3565
|
+
/* Vertical text-right specific */
|
|
3566
|
+
.rel-stepper.vertical.text-right .step-label {
|
|
3567
|
+
margin-top: 0;
|
|
3568
|
+
margin-left: 0;
|
|
3569
|
+
text-align: left;
|
|
3570
|
+
}
|
|
3571
|
+
|
|
3572
|
+
/* Vertical text-below specific */
|
|
3573
|
+
.rel-stepper.vertical.text-below .step-label {
|
|
3574
|
+
margin-top: 0;
|
|
3575
|
+
margin-left: 0;
|
|
3576
|
+
text-align: center;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
/********************************************
|
|
3580
|
+
* Connector Lines
|
|
3581
|
+
********************************************/
|
|
3582
|
+
.connector {
|
|
3583
|
+
position: absolute;
|
|
3584
|
+
background: var(--rel-colors-gray-border);
|
|
3585
|
+
z-index: 1;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
/* Horizontal connector */
|
|
3589
|
+
.rel-stepper.horizontal .connector {
|
|
3590
|
+
top: 50%;
|
|
3591
|
+
left: 100%;
|
|
3592
|
+
transform: translateY(-50%);
|
|
3593
|
+
height: 2px;
|
|
3594
|
+
position: absolute;
|
|
3595
|
+
background: var(--rel-colors-gray-border);
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
.rel-stepper.horizontal .rel-step:last-child .connector {
|
|
3599
|
+
display: none;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
/* Vertical connectors */
|
|
3603
|
+
.rel-stepper.vertical.text-below .connector {
|
|
3604
|
+
top: 100%;
|
|
3605
|
+
left: 50%;
|
|
3606
|
+
transform: translateX(-50%);
|
|
3607
|
+
width: 2px;
|
|
3608
|
+
position: absolute;
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
.rel-stepper.vertical.text-right .connector {
|
|
3612
|
+
top: 100%;
|
|
3613
|
+
left: 50%;
|
|
3614
|
+
transform: translateX(-50%);
|
|
3615
|
+
width: 2px;
|
|
3616
|
+
position: absolute;
|
|
3617
|
+
}
|
|
3618
|
+
|
|
3619
|
+
.rel-stepper.vertical .rel-step:last-child .connector {
|
|
3620
|
+
display: none;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
.rel-stepper.vertical.text-right .rel-step:last-child .indicator-wrapper .connector {
|
|
3624
|
+
display: none;
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
/********************************************
|
|
3628
|
+
* Step States
|
|
3629
|
+
********************************************/
|
|
3630
|
+
.rel-step.done .indicator {
|
|
3631
|
+
background: var(--rel-colors-black);
|
|
3632
|
+
border-color: var(--rel-colors-black);
|
|
3633
|
+
color: var(--rel-colors-white);
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
.rel-step.progress .indicator {
|
|
3637
|
+
border-color: var(--rel-colors-black);
|
|
3638
|
+
color: var(--rel-colors-black);
|
|
3639
|
+
background: var(--rel-colors-white);
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3642
|
+
.rel-step.disabled .indicator {
|
|
3643
|
+
background: var(--rel-colors-gray-bg-subtle);
|
|
3644
|
+
border-color: var(--rel-colors-gray-border);
|
|
3645
|
+
color: var(--rel-colors-gray-disabled);
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3648
|
+
.rel-step.done .connector {
|
|
3649
|
+
background: var(--rel-colors-black);
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
.rel-step.progress .connector {
|
|
3653
|
+
background: var(--rel-colors-black);
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3656
|
+
.rel-step.done .step-label {
|
|
3657
|
+
color: var(--rel-colors-black);
|
|
3658
|
+
font-weight: var(--rel-fontWeights-semibold);
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
.rel-step.progress .step-label {
|
|
3662
|
+
color: var(--rel-colors-black);
|
|
3663
|
+
font-weight: var(--rel-fontWeights-semibold);
|
|
3664
|
+
}
|
|
3665
|
+
|
|
3666
|
+
.rel-step.disabled .step-label {
|
|
3667
|
+
color: var(--rel-colors-gray-disabled);
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
/********************************************
|
|
3671
|
+
* Size Property — controls connector length
|
|
3672
|
+
********************************************/
|
|
3673
|
+
/* Horizontal */
|
|
3674
|
+
.rel-stepper.large.horizontal {
|
|
3675
|
+
gap: 86px;
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
.rel-stepper.small.horizontal {
|
|
3679
|
+
gap: 60px;
|
|
3680
|
+
}
|
|
3681
|
+
|
|
3682
|
+
.rel-stepper.large.horizontal .connector {
|
|
3683
|
+
width: 86px;
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
.rel-stepper.small.horizontal .connector {
|
|
3687
|
+
width: 60px;
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
/* Vertical */
|
|
3691
|
+
.rel-stepper.large.vertical .connector {
|
|
3692
|
+
height: 86px;
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
.rel-stepper.large.vertical {
|
|
3696
|
+
gap: 86px;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
.rel-stepper.small.vertical .connector {
|
|
3700
|
+
height: 42px;
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
.rel-stepper.small.vertical {
|
|
3704
|
+
gap: 42px;
|
|
3705
|
+
}
|
|
3706
|
+
`;
|
|
3707
|
+
__decorateClass([
|
|
3708
|
+
property20({ type: Array })
|
|
3709
|
+
], RelStepper.prototype, "steps", 2);
|
|
3710
|
+
__decorateClass([
|
|
3711
|
+
property20({ type: String })
|
|
3712
|
+
], RelStepper.prototype, "textAlign", 2);
|
|
3713
|
+
__decorateClass([
|
|
3714
|
+
property20({ type: String })
|
|
3715
|
+
], RelStepper.prototype, "orientation", 2);
|
|
3716
|
+
__decorateClass([
|
|
3717
|
+
property20({ type: String })
|
|
3718
|
+
], RelStepper.prototype, "size", 2);
|
|
3719
|
+
RelStepper = __decorateClass([
|
|
3720
|
+
customElement21("rel-stepper")
|
|
3721
|
+
], RelStepper);
|
|
3722
|
+
|
|
3723
|
+
// src/components/rel-switch/rel-switch.ts
|
|
3724
|
+
import { LitElement as LitElement22, html as html22, css as css22 } from "lit";
|
|
3725
|
+
import { customElement as customElement22, property as property21, state as state6 } from "lit/decorators.js";
|
|
3726
|
+
var RelSwitch = class extends LitElement22 {
|
|
3727
|
+
constructor() {
|
|
3728
|
+
super(...arguments);
|
|
3729
|
+
this.checked = false;
|
|
3730
|
+
this.disabled = false;
|
|
3731
|
+
this.isFocused = false;
|
|
3732
|
+
this.isPressed = false;
|
|
3733
|
+
}
|
|
3734
|
+
toggle() {
|
|
3735
|
+
if (this.disabled) return;
|
|
3736
|
+
this.checked = !this.checked;
|
|
3737
|
+
this.requestUpdate();
|
|
3738
|
+
this.dispatchEvent(
|
|
3739
|
+
new CustomEvent("changed", {
|
|
3740
|
+
detail: this.checked,
|
|
3741
|
+
bubbles: true,
|
|
3742
|
+
composed: true
|
|
3743
|
+
})
|
|
3744
|
+
);
|
|
3745
|
+
}
|
|
3746
|
+
handleFocus() {
|
|
3747
|
+
this.isFocused = true;
|
|
3748
|
+
}
|
|
3749
|
+
handleBlur() {
|
|
3750
|
+
this.isFocused = false;
|
|
3751
|
+
this.isPressed = false;
|
|
3752
|
+
}
|
|
3753
|
+
handleMouseDown() {
|
|
3754
|
+
if (!this.disabled) this.isPressed = true;
|
|
3755
|
+
}
|
|
3756
|
+
handleMouseUp() {
|
|
3757
|
+
if (!this.disabled) this.isPressed = false;
|
|
3758
|
+
}
|
|
3759
|
+
render() {
|
|
3760
|
+
const wrapperClasses = [
|
|
3761
|
+
"switch-wrapper",
|
|
3762
|
+
this.disabled && "switch-disabled",
|
|
3763
|
+
this.isFocused && "switch-focused",
|
|
3764
|
+
this.isPressed && "switch-pressed"
|
|
3765
|
+
].filter(Boolean).join(" ");
|
|
3766
|
+
return html22`
|
|
3767
|
+
<label class="${wrapperClasses}">
|
|
3768
|
+
<input
|
|
3769
|
+
type="checkbox"
|
|
3770
|
+
?disabled=${this.disabled}
|
|
3771
|
+
.checked=${this.checked}
|
|
3772
|
+
@change=${this.toggle}
|
|
3773
|
+
@focus=${this.handleFocus}
|
|
3774
|
+
@blur=${this.handleBlur}
|
|
3775
|
+
@mousedown=${this.handleMouseDown}
|
|
3776
|
+
@mouseup=${this.handleMouseUp}
|
|
3777
|
+
/>
|
|
3778
|
+
<span class="switch-slider"></span>
|
|
3779
|
+
</label>
|
|
3780
|
+
`;
|
|
3781
|
+
}
|
|
3782
|
+
};
|
|
3783
|
+
RelSwitch.styles = css22`
|
|
3784
|
+
:host {
|
|
3785
|
+
--switch-track: #7e8186;
|
|
3786
|
+
--switch-knob-on: #000000;
|
|
3787
|
+
--switch-knob-off: #ffffff;
|
|
3788
|
+
--switch-halo: rgba(224, 224, 224, 0.8);
|
|
3789
|
+
--switch-disabled: #d1d5db;
|
|
3790
|
+
display: inline-block;
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
/* Wrapper */
|
|
3794
|
+
.switch-wrapper {
|
|
3795
|
+
position: relative;
|
|
3796
|
+
display: inline-block;
|
|
3797
|
+
width: 42px;
|
|
3798
|
+
height: 22px;
|
|
3799
|
+
cursor: pointer;
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
.switch-wrapper.switch-disabled {
|
|
3803
|
+
cursor: not-allowed;
|
|
3804
|
+
opacity: 0.5;
|
|
3805
|
+
}
|
|
3806
|
+
|
|
3807
|
+
/* Hide native checkbox */
|
|
3808
|
+
.switch-wrapper input {
|
|
3809
|
+
opacity: 0;
|
|
3810
|
+
width: 0;
|
|
3811
|
+
height: 0;
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
/* Track */
|
|
3815
|
+
.switch-slider {
|
|
3816
|
+
position: absolute;
|
|
3817
|
+
top: 50%;
|
|
3818
|
+
left: 4px;
|
|
3819
|
+
right: 4px;
|
|
3820
|
+
height: 12px;
|
|
3821
|
+
background-color: var(--switch-track);
|
|
3822
|
+
border-radius: 999px;
|
|
3823
|
+
transform: translateY(-50%);
|
|
3824
|
+
transition: background-color 0.25s ease;
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
/* Knob */
|
|
3828
|
+
.switch-slider::before {
|
|
3829
|
+
content: "";
|
|
3830
|
+
position: absolute;
|
|
3831
|
+
top: 50%;
|
|
3832
|
+
left: -2px;
|
|
3833
|
+
transform: translateY(-50%);
|
|
3834
|
+
height: 18px;
|
|
3835
|
+
width: 18px;
|
|
3836
|
+
background-color: var(--switch-knob-off);
|
|
3837
|
+
border-radius: 50%;
|
|
3838
|
+
transition: transform 0.25s ease, background-color 0.25s ease,
|
|
3839
|
+
box-shadow 0.2s ease;
|
|
3840
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
/* ON state */
|
|
3844
|
+
input:checked + .switch-slider::before {
|
|
3845
|
+
background-color: var(--switch-knob-on);
|
|
3846
|
+
transform: translateY(-50%) translateX(22px);
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
/* Hover */
|
|
3850
|
+
.switch-wrapper:hover:not(.switch-disabled) .switch-slider {
|
|
3851
|
+
background-color: #666;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
/* Focus halo */
|
|
3855
|
+
.switch-focused .switch-slider::before {
|
|
3856
|
+
box-shadow: 0 0 0 6px var(--switch-halo);
|
|
3857
|
+
}
|
|
3858
|
+
|
|
3859
|
+
/* Pressed */
|
|
3860
|
+
.switch-pressed .switch-slider::before {
|
|
3861
|
+
transform: scale(0.9) translateY(-50%);
|
|
3862
|
+
}
|
|
3863
|
+
.switch-pressed input:checked + .switch-slider::before {
|
|
3864
|
+
transform: scale(0.9) translateY(-50%) translateX(22px);
|
|
3865
|
+
}
|
|
3866
|
+
|
|
3867
|
+
/* Disabled */
|
|
3868
|
+
.switch-disabled .switch-slider {
|
|
3869
|
+
background-color: var(--switch-disabled);
|
|
3870
|
+
}
|
|
3871
|
+
.switch-disabled .switch-slider::before {
|
|
3872
|
+
background-color: var(--switch-disabled);
|
|
3873
|
+
}
|
|
3874
|
+
`;
|
|
3875
|
+
__decorateClass([
|
|
3876
|
+
property21({ type: Boolean })
|
|
3877
|
+
], RelSwitch.prototype, "checked", 2);
|
|
3878
|
+
__decorateClass([
|
|
3879
|
+
property21({ type: Boolean })
|
|
3880
|
+
], RelSwitch.prototype, "disabled", 2);
|
|
3881
|
+
__decorateClass([
|
|
3882
|
+
state6()
|
|
3883
|
+
], RelSwitch.prototype, "isFocused", 2);
|
|
3884
|
+
__decorateClass([
|
|
3885
|
+
state6()
|
|
3886
|
+
], RelSwitch.prototype, "isPressed", 2);
|
|
3887
|
+
RelSwitch = __decorateClass([
|
|
3888
|
+
customElement22("rel-switch")
|
|
3889
|
+
], RelSwitch);
|
|
3890
|
+
|
|
3891
|
+
// src/components/rel-tab/rel-tab.ts
|
|
3892
|
+
import { LitElement as LitElement23, html as html23, css as css23 } from "lit";
|
|
3893
|
+
import { customElement as customElement23, property as property22 } from "lit/decorators.js";
|
|
3894
|
+
var RelTab = class extends LitElement23 {
|
|
3895
|
+
constructor() {
|
|
3896
|
+
super(...arguments);
|
|
3897
|
+
this.tabs = [];
|
|
3898
|
+
this.activeIndex = 0;
|
|
3899
|
+
}
|
|
3900
|
+
selectTab(index) {
|
|
3901
|
+
if (this.tabs[index]?.disabled) return;
|
|
3902
|
+
this.activeIndex = index;
|
|
3903
|
+
this.dispatchEvent(
|
|
3904
|
+
new CustomEvent("tab-change", {
|
|
3905
|
+
detail: { index },
|
|
3906
|
+
bubbles: true,
|
|
3907
|
+
composed: true
|
|
3908
|
+
})
|
|
3909
|
+
);
|
|
3910
|
+
}
|
|
3911
|
+
onKeyDown(event, index) {
|
|
3912
|
+
if (this.tabs[index]?.disabled) return;
|
|
3913
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
3914
|
+
event.preventDefault();
|
|
3915
|
+
this.selectTab(index);
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
render() {
|
|
3919
|
+
return html23`
|
|
3920
|
+
<div class="tabs-wrapper">
|
|
3921
|
+
${this.tabs.map(
|
|
3922
|
+
(tab, i) => html23`
|
|
3923
|
+
<div
|
|
3924
|
+
class="tab ${i === this.activeIndex ? "active" : ""} ${tab.disabled ? "disabled" : ""}"
|
|
3925
|
+
role="tab"
|
|
3926
|
+
tabindex="${tab.disabled ? -1 : 0}"
|
|
3927
|
+
@click="${() => this.selectTab(i)}"
|
|
3928
|
+
@keydown="${(e) => this.onKeyDown(e, i)}"
|
|
3929
|
+
>
|
|
3930
|
+
<span class="tab-label">${tab.label}</span>
|
|
3931
|
+
${tab.badge ? html23`<span class="tab-badge">${tab.badge}</span>` : ""}
|
|
3932
|
+
<span class="tab-underline"></span>
|
|
3933
|
+
</div>
|
|
3934
|
+
`
|
|
3935
|
+
)}
|
|
3936
|
+
</div>
|
|
3937
|
+
<div class="tab-content">
|
|
3938
|
+
<slot></slot>
|
|
3939
|
+
</div>
|
|
3940
|
+
`;
|
|
3941
|
+
}
|
|
3942
|
+
};
|
|
3943
|
+
RelTab.styles = css23`
|
|
3944
|
+
:host {
|
|
3945
|
+
--tab-active-color: #00f49c;
|
|
3946
|
+
--tab-text-default: #111;
|
|
3947
|
+
--tab-text-disabled: #a5a7aa;
|
|
3948
|
+
--tab-text-hover: #000;
|
|
3949
|
+
--tab-underline-height: 3px;
|
|
3950
|
+
--tab-hover-color: #f3f3f3;
|
|
3951
|
+
display: block;
|
|
3952
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
.tabs-wrapper {
|
|
3956
|
+
display: flex;
|
|
3957
|
+
border-bottom: 1px solid #e5e5e5;
|
|
3958
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
3959
|
+
user-select: none;
|
|
3960
|
+
}
|
|
3961
|
+
|
|
3962
|
+
.tab {
|
|
3963
|
+
position: relative;
|
|
3964
|
+
padding: 0.75rem 1rem;
|
|
3965
|
+
cursor: pointer;
|
|
3966
|
+
color: var(--tab-text-default);
|
|
3967
|
+
font-size: 0.9rem;
|
|
3968
|
+
font-weight: 500;
|
|
3969
|
+
transition: color 0.2s ease;
|
|
3970
|
+
display: flex;
|
|
3971
|
+
align-items: center;
|
|
3972
|
+
gap: 6px;
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
.tab:hover:not(.disabled) .tab-label {
|
|
3976
|
+
color: var(--tab-text-hover);
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
.tab.disabled {
|
|
3980
|
+
color: var(--tab-text-disabled);
|
|
3981
|
+
cursor: not-allowed;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
/* Underline */
|
|
3985
|
+
.tab-underline {
|
|
3986
|
+
position: absolute;
|
|
3987
|
+
left: 0;
|
|
3988
|
+
bottom: 0;
|
|
3989
|
+
height: var(--tab-underline-height);
|
|
3990
|
+
width: 100%;
|
|
3991
|
+
background-color: transparent;
|
|
3992
|
+
transition: background-color 0.2s ease, transform 0.2s ease;
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3995
|
+
.tab.active .tab-underline {
|
|
3996
|
+
background-color: var(--tab-active-color);
|
|
3997
|
+
}
|
|
3998
|
+
|
|
3999
|
+
.tab:hover:not(.disabled):not(.active) {
|
|
4000
|
+
background-color: var(--tab-hover-color);
|
|
4001
|
+
}
|
|
4002
|
+
|
|
4003
|
+
/* Badge */
|
|
4004
|
+
.tab-badge {
|
|
4005
|
+
display: inline-flex;
|
|
4006
|
+
justify-content: center;
|
|
4007
|
+
align-items: center;
|
|
4008
|
+
background: #ff0400;
|
|
4009
|
+
color: #fff;
|
|
4010
|
+
border-radius: 50%;
|
|
4011
|
+
font-size: 11px;
|
|
4012
|
+
font-weight: 600;
|
|
4013
|
+
min-width: 16px;
|
|
4014
|
+
text-align: center;
|
|
4015
|
+
height: 16px;
|
|
4016
|
+
padding: 2px;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
/* Tab content */
|
|
4020
|
+
.tab-content {
|
|
4021
|
+
padding: 1rem 0;
|
|
4022
|
+
}
|
|
4023
|
+
`;
|
|
4024
|
+
__decorateClass([
|
|
4025
|
+
property22({ type: Array })
|
|
4026
|
+
], RelTab.prototype, "tabs", 2);
|
|
4027
|
+
__decorateClass([
|
|
4028
|
+
property22({ type: Number })
|
|
4029
|
+
], RelTab.prototype, "activeIndex", 2);
|
|
4030
|
+
RelTab = __decorateClass([
|
|
4031
|
+
customElement23("rel-tab")
|
|
4032
|
+
], RelTab);
|
|
4033
|
+
|
|
4034
|
+
// src/components/rel-textfield/rel-textfield.ts
|
|
4035
|
+
import { LitElement as LitElement24, html as html24, css as css24 } from "lit";
|
|
4036
|
+
import { customElement as customElement24, property as property23, state as state7 } from "lit/decorators.js";
|
|
4037
|
+
var RelTextfield = class extends LitElement24 {
|
|
4038
|
+
constructor() {
|
|
4039
|
+
super(...arguments);
|
|
4040
|
+
this.placeholder = "";
|
|
4041
|
+
this.type = "text";
|
|
4042
|
+
this.value = "";
|
|
4043
|
+
this.state = "default";
|
|
4044
|
+
this.size = "medium";
|
|
4045
|
+
this.internalState = "default";
|
|
4046
|
+
}
|
|
4047
|
+
get currentState() {
|
|
4048
|
+
return this.state !== "default" ? this.state : this.internalState;
|
|
4049
|
+
}
|
|
4050
|
+
handleFocus() {
|
|
4051
|
+
if (this.state !== "disabled" && this.state !== "error") {
|
|
4052
|
+
this.internalState = "focused";
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
handleBlur() {
|
|
4056
|
+
if (this.internalState === "focused") {
|
|
4057
|
+
this.internalState = "default";
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
handleInput(e) {
|
|
4061
|
+
const input = e.target;
|
|
4062
|
+
this.value = input.value;
|
|
4063
|
+
this.dispatchEvent(
|
|
4064
|
+
new CustomEvent("input-change", {
|
|
4065
|
+
detail: { value: this.value },
|
|
4066
|
+
bubbles: true,
|
|
4067
|
+
composed: true
|
|
4068
|
+
})
|
|
4069
|
+
);
|
|
4070
|
+
}
|
|
4071
|
+
render() {
|
|
4072
|
+
const wrapperClasses = [
|
|
4073
|
+
"textfield-wrapper",
|
|
4074
|
+
this.size,
|
|
4075
|
+
this.currentState
|
|
4076
|
+
].join(" ");
|
|
4077
|
+
const inputClasses = [
|
|
4078
|
+
"textfield-input",
|
|
4079
|
+
this.leftIcon ? "has-left-icon" : "",
|
|
4080
|
+
this.rightIcon ? "has-right-icon" : ""
|
|
4081
|
+
].filter(Boolean).join(" ");
|
|
4082
|
+
return html24`
|
|
4083
|
+
<div class="${wrapperClasses}">
|
|
4084
|
+
${this.label ? html24`<label class="textfield-label">${this.label}</label>` : ""}
|
|
4085
|
+
|
|
4086
|
+
<div
|
|
4087
|
+
class="textfield-container ${this.state === "disabled" ? "disabled" : ""}"
|
|
4088
|
+
>
|
|
4089
|
+
${this.leftIcon ? html24`<span class="icon left">${this.leftIcon}</span>` : ""}
|
|
4090
|
+
|
|
4091
|
+
<input
|
|
4092
|
+
type="${this.type}"
|
|
4093
|
+
class="${inputClasses}"
|
|
4094
|
+
placeholder="${this.placeholder}"
|
|
4095
|
+
.value="${this.value}"
|
|
4096
|
+
?disabled="${this.state === "disabled"}"
|
|
4097
|
+
aria-invalid="${this.state === "error"}"
|
|
4098
|
+
@focus="${this.handleFocus}"
|
|
4099
|
+
@blur="${this.handleBlur}"
|
|
4100
|
+
@input="${this.handleInput}"
|
|
4101
|
+
/>
|
|
4102
|
+
|
|
4103
|
+
${this.rightIcon ? html24`<span class="icon right">${this.rightIcon}</span>` : ""}
|
|
4104
|
+
</div>
|
|
4105
|
+
|
|
4106
|
+
${this.supportingText ? html24`<div
|
|
4107
|
+
class="textfield-support ${this.state === "error" ? "error" : ""}"
|
|
4108
|
+
>
|
|
4109
|
+
${this.supportingText}
|
|
4110
|
+
</div>` : ""}
|
|
4111
|
+
</div>
|
|
4112
|
+
`;
|
|
4113
|
+
}
|
|
4114
|
+
};
|
|
4115
|
+
RelTextfield.styles = css24`
|
|
4116
|
+
:host {
|
|
4117
|
+
display: block;
|
|
4118
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
/* Wrapper */
|
|
4122
|
+
.textfield-wrapper {
|
|
4123
|
+
display: flex;
|
|
4124
|
+
flex-direction: column;
|
|
4125
|
+
gap: 4px;
|
|
4126
|
+
width: 100%;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
/* Label */
|
|
4130
|
+
.textfield-label {
|
|
4131
|
+
font-size: 0.85rem;
|
|
4132
|
+
font-weight: 500;
|
|
4133
|
+
color: #111;
|
|
4134
|
+
}
|
|
4135
|
+
|
|
4136
|
+
/* Container */
|
|
4137
|
+
.textfield-container {
|
|
4138
|
+
display: flex;
|
|
4139
|
+
align-items: center;
|
|
4140
|
+
position: relative;
|
|
4141
|
+
border: 1px solid #ccc;
|
|
4142
|
+
border-radius: 6px;
|
|
4143
|
+
background: white;
|
|
4144
|
+
transition: border 0.2s;
|
|
4145
|
+
}
|
|
4146
|
+
|
|
4147
|
+
.textfield-container.disabled {
|
|
4148
|
+
background: #f5f5f5;
|
|
4149
|
+
cursor: not-allowed;
|
|
4150
|
+
}
|
|
4151
|
+
|
|
4152
|
+
/* Input */
|
|
4153
|
+
.textfield-input {
|
|
4154
|
+
flex: 1;
|
|
4155
|
+
border: none;
|
|
4156
|
+
outline: none;
|
|
4157
|
+
font-size: 0.9rem;
|
|
4158
|
+
padding: 0.5rem 0.75rem;
|
|
4159
|
+
background: transparent;
|
|
4160
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4163
|
+
.textfield-input:disabled {
|
|
4164
|
+
cursor: not-allowed;
|
|
4165
|
+
color: #999;
|
|
4166
|
+
}
|
|
4167
|
+
|
|
4168
|
+
.icon {
|
|
4169
|
+
position: absolute;
|
|
4170
|
+
display: flex;
|
|
4171
|
+
pointer-events: none;
|
|
4172
|
+
color: #7e8186;
|
|
4173
|
+
}
|
|
4174
|
+
|
|
4175
|
+
.icon.left {
|
|
4176
|
+
left: 8px;
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
.icon.right {
|
|
4180
|
+
right: 8px;
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
.textfield-wrapper.small .textfield-input {
|
|
4184
|
+
padding: 0.5rem 1rem;
|
|
4185
|
+
font-size: 0.9rem;
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
.textfield-wrapper.medium .textfield-input {
|
|
4189
|
+
padding: 0.688rem 1rem;
|
|
4190
|
+
font-size: 1rem;
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
.textfield-wrapper.large .textfield-input {
|
|
4194
|
+
padding: 0.875rem 1rem;
|
|
4195
|
+
font-size: 1.1rem;
|
|
4196
|
+
}
|
|
4197
|
+
|
|
4198
|
+
/* Adjust padding when icons are present */
|
|
4199
|
+
.textfield-wrapper .textfield-input.has-left-icon {
|
|
4200
|
+
padding-left: 2.5rem;
|
|
4201
|
+
}
|
|
4202
|
+
|
|
4203
|
+
.textfield-wrapper .textfield-input.has-right-icon {
|
|
4204
|
+
padding-right: 2.5rem;
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4207
|
+
/* States */
|
|
4208
|
+
.textfield-wrapper.focused .textfield-container {
|
|
4209
|
+
border-color: #111;
|
|
4210
|
+
}
|
|
4211
|
+
|
|
4212
|
+
.textfield-wrapper.error .textfield-container {
|
|
4213
|
+
border-color: #d50000;
|
|
4214
|
+
}
|
|
4215
|
+
|
|
4216
|
+
.textfield-wrapper.disabled .textfield-container {
|
|
4217
|
+
border-color: #d7d9db;
|
|
4218
|
+
}
|
|
4219
|
+
|
|
4220
|
+
/* Supporting text */
|
|
4221
|
+
.textfield-support {
|
|
4222
|
+
font-size: 0.75rem;
|
|
4223
|
+
color: #666;
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
.textfield-support.error {
|
|
4227
|
+
color: #d50000;
|
|
4228
|
+
}
|
|
4229
|
+
`;
|
|
4230
|
+
__decorateClass([
|
|
4231
|
+
property23({ type: String })
|
|
4232
|
+
], RelTextfield.prototype, "label", 2);
|
|
4233
|
+
__decorateClass([
|
|
4234
|
+
property23({ type: String })
|
|
4235
|
+
], RelTextfield.prototype, "placeholder", 2);
|
|
4236
|
+
__decorateClass([
|
|
4237
|
+
property23({ type: String })
|
|
4238
|
+
], RelTextfield.prototype, "type", 2);
|
|
4239
|
+
__decorateClass([
|
|
4240
|
+
property23({ type: String })
|
|
4241
|
+
], RelTextfield.prototype, "value", 2);
|
|
4242
|
+
__decorateClass([
|
|
4243
|
+
property23({ type: String })
|
|
4244
|
+
], RelTextfield.prototype, "leftIcon", 2);
|
|
4245
|
+
__decorateClass([
|
|
4246
|
+
property23({ type: String })
|
|
4247
|
+
], RelTextfield.prototype, "rightIcon", 2);
|
|
4248
|
+
__decorateClass([
|
|
4249
|
+
property23({ type: String })
|
|
4250
|
+
], RelTextfield.prototype, "supportingText", 2);
|
|
4251
|
+
__decorateClass([
|
|
4252
|
+
property23({ type: String })
|
|
4253
|
+
], RelTextfield.prototype, "state", 2);
|
|
4254
|
+
__decorateClass([
|
|
4255
|
+
property23({ type: String })
|
|
4256
|
+
], RelTextfield.prototype, "size", 2);
|
|
4257
|
+
__decorateClass([
|
|
4258
|
+
state7()
|
|
4259
|
+
], RelTextfield.prototype, "internalState", 2);
|
|
4260
|
+
RelTextfield = __decorateClass([
|
|
4261
|
+
customElement24("rel-textfield")
|
|
4262
|
+
], RelTextfield);
|
|
4263
|
+
|
|
4264
|
+
// src/components/rel-toast/rel-toast.ts
|
|
4265
|
+
import { LitElement as LitElement25, html as html25, css as css25 } from "lit";
|
|
4266
|
+
import { customElement as customElement25, property as property24, state as state8 } from "lit/decorators.js";
|
|
4267
|
+
var RelToast = class extends LitElement25 {
|
|
4268
|
+
constructor() {
|
|
4269
|
+
super(...arguments);
|
|
4270
|
+
this.message = "";
|
|
4271
|
+
this.type = "default";
|
|
4272
|
+
this.duration = 4e3;
|
|
4273
|
+
this.visible = false;
|
|
4274
|
+
}
|
|
4275
|
+
show() {
|
|
4276
|
+
this.visible = true;
|
|
4277
|
+
if (this.duration > 0) {
|
|
4278
|
+
this.timeoutId = window.setTimeout(() => this.close(), this.duration);
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
close() {
|
|
4282
|
+
this.visible = false;
|
|
4283
|
+
this.dispatchEvent(
|
|
4284
|
+
new CustomEvent("dismissed", {
|
|
4285
|
+
bubbles: true,
|
|
4286
|
+
composed: true
|
|
4287
|
+
})
|
|
4288
|
+
);
|
|
4289
|
+
if (this.timeoutId) {
|
|
4290
|
+
clearTimeout(this.timeoutId);
|
|
4291
|
+
}
|
|
4292
|
+
}
|
|
4293
|
+
handleActionClick(event) {
|
|
4294
|
+
event.stopPropagation();
|
|
4295
|
+
this.dispatchEvent(
|
|
4296
|
+
new CustomEvent("action", {
|
|
4297
|
+
bubbles: true,
|
|
4298
|
+
composed: true
|
|
4299
|
+
})
|
|
4300
|
+
);
|
|
4301
|
+
this.close();
|
|
4302
|
+
}
|
|
4303
|
+
render() {
|
|
4304
|
+
return html25`
|
|
4305
|
+
<div class="toast ${this.type} ${this.visible ? "" : "hidden"}">
|
|
4306
|
+
<span class="toast-message">${this.message}</span>
|
|
4307
|
+
|
|
4308
|
+
${this.actionLabel ? html25`<button
|
|
4309
|
+
class="toast-action"
|
|
4310
|
+
@click="${this.handleActionClick}"
|
|
4311
|
+
>
|
|
4312
|
+
${this.actionLabel}
|
|
4313
|
+
</button>` : ""}
|
|
4314
|
+
|
|
4315
|
+
<button class="toast-close" @click="${this.close}">✕</button>
|
|
4316
|
+
</div>
|
|
4317
|
+
`;
|
|
4318
|
+
}
|
|
4319
|
+
};
|
|
4320
|
+
RelToast.styles = css25`
|
|
4321
|
+
:host {
|
|
4322
|
+
position: fixed;
|
|
4323
|
+
bottom: 24px;
|
|
4324
|
+
left: 50%;
|
|
4325
|
+
transform: translateX(-50%);
|
|
4326
|
+
display: flex;
|
|
4327
|
+
justify-content: center;
|
|
4328
|
+
width: 100%;
|
|
4329
|
+
pointer-events: none;
|
|
4330
|
+
z-index: 1000;
|
|
4331
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
4332
|
+
}
|
|
4333
|
+
|
|
4334
|
+
/* Toast container */
|
|
4335
|
+
.toast {
|
|
4336
|
+
display: inline-flex;
|
|
4337
|
+
align-items: center;
|
|
4338
|
+
gap: 12px;
|
|
4339
|
+
background-color: #111;
|
|
4340
|
+
color: #fff;
|
|
4341
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
4342
|
+
font-size: 0.9rem;
|
|
4343
|
+
border-radius: 8px;
|
|
4344
|
+
padding: 1rem 1rem;
|
|
4345
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
4346
|
+
pointer-events: all;
|
|
4347
|
+
animation: fadeInUp 0.25s ease;
|
|
4348
|
+
}
|
|
4349
|
+
|
|
4350
|
+
.toast.error {
|
|
4351
|
+
background-color: #d50000;
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
.toast.hidden {
|
|
4355
|
+
display: none;
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4358
|
+
/* Message */
|
|
4359
|
+
.toast-message {
|
|
4360
|
+
flex: 1;
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4363
|
+
/* Action button */
|
|
4364
|
+
.toast-action {
|
|
4365
|
+
background: transparent;
|
|
4366
|
+
border: none;
|
|
4367
|
+
color: #0edb90;
|
|
4368
|
+
font-weight: 600;
|
|
4369
|
+
font-size: 0.85rem;
|
|
4370
|
+
cursor: pointer;
|
|
4371
|
+
transition: opacity 0.2s;
|
|
4372
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
4373
|
+
}
|
|
4374
|
+
|
|
4375
|
+
.toast-action:hover {
|
|
4376
|
+
opacity: 0.75;
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4379
|
+
/* Close button */
|
|
4380
|
+
.toast-close {
|
|
4381
|
+
background: transparent;
|
|
4382
|
+
border: none;
|
|
4383
|
+
color: inherit;
|
|
4384
|
+
font-size: 1rem;
|
|
4385
|
+
cursor: pointer;
|
|
4386
|
+
line-height: 1;
|
|
4387
|
+
padding: 0;
|
|
4388
|
+
margin-left: 4px;
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
.toast-close:hover {
|
|
4392
|
+
opacity: 0.75;
|
|
4393
|
+
}
|
|
4394
|
+
|
|
4395
|
+
/* Animations */
|
|
4396
|
+
@keyframes fadeInUp {
|
|
4397
|
+
from {
|
|
4398
|
+
opacity: 0;
|
|
4399
|
+
transform: translateY(20px);
|
|
4400
|
+
}
|
|
4401
|
+
to {
|
|
4402
|
+
opacity: 1;
|
|
4403
|
+
transform: translateY(0);
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4406
|
+
`;
|
|
4407
|
+
__decorateClass([
|
|
4408
|
+
property24({ type: String })
|
|
4409
|
+
], RelToast.prototype, "message", 2);
|
|
4410
|
+
__decorateClass([
|
|
4411
|
+
property24({ type: String })
|
|
4412
|
+
], RelToast.prototype, "type", 2);
|
|
4413
|
+
__decorateClass([
|
|
4414
|
+
property24({ type: String })
|
|
4415
|
+
], RelToast.prototype, "actionLabel", 2);
|
|
4416
|
+
__decorateClass([
|
|
4417
|
+
property24({ type: Number })
|
|
4418
|
+
], RelToast.prototype, "duration", 2);
|
|
4419
|
+
__decorateClass([
|
|
4420
|
+
state8()
|
|
4421
|
+
], RelToast.prototype, "visible", 2);
|
|
4422
|
+
RelToast = __decorateClass([
|
|
4423
|
+
customElement25("rel-toast")
|
|
4424
|
+
], RelToast);
|
|
4425
|
+
|
|
4426
|
+
// src/components/rel-tooltip/rel-tooltip.ts
|
|
4427
|
+
import { LitElement as LitElement26, html as html26, css as css26 } from "lit";
|
|
4428
|
+
import { customElement as customElement26, property as property25 } from "lit/decorators.js";
|
|
4429
|
+
var RelTooltip = class extends LitElement26 {
|
|
4430
|
+
constructor() {
|
|
4431
|
+
super(...arguments);
|
|
4432
|
+
this.text = "";
|
|
4433
|
+
this.position = "above";
|
|
4434
|
+
this.showTail = false;
|
|
4435
|
+
}
|
|
4436
|
+
render() {
|
|
4437
|
+
return html26`
|
|
4438
|
+
<slot></slot>
|
|
4439
|
+
<div class="tooltip-bubble ${this.position}">
|
|
4440
|
+
${this.text}
|
|
4441
|
+
${this.showTail ? html26`<span class="tooltip-tail"></span>` : ""}
|
|
4442
|
+
</div>
|
|
4443
|
+
`;
|
|
4444
|
+
}
|
|
4445
|
+
};
|
|
4446
|
+
RelTooltip.styles = css26`
|
|
4447
|
+
:host {
|
|
4448
|
+
display: inline-block;
|
|
4449
|
+
position: relative;
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
/* Tooltip container */
|
|
4453
|
+
.tooltip-bubble {
|
|
4454
|
+
position: absolute;
|
|
4455
|
+
left: 50%;
|
|
4456
|
+
transform: translateX(-50%);
|
|
4457
|
+
background-color: #111;
|
|
4458
|
+
color: #fff;
|
|
4459
|
+
padding: 0.5rem 0.75rem;
|
|
4460
|
+
border-radius: 6px;
|
|
4461
|
+
font-size: 0.875rem;
|
|
4462
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
4463
|
+
white-space: nowrap;
|
|
4464
|
+
z-index: 1000;
|
|
4465
|
+
opacity: 0;
|
|
4466
|
+
pointer-events: none;
|
|
4467
|
+
transition: opacity 0.2s ease;
|
|
4468
|
+
}
|
|
4469
|
+
|
|
4470
|
+
:host(:hover) .tooltip-bubble {
|
|
4471
|
+
opacity: 1;
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
/* Positioning */
|
|
4475
|
+
.tooltip-bubble.above {
|
|
4476
|
+
bottom: calc(100% + 8px);
|
|
4477
|
+
}
|
|
4478
|
+
|
|
4479
|
+
.tooltip-bubble.below {
|
|
4480
|
+
top: calc(100% + 8px);
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4483
|
+
/* Tail/Arrow */
|
|
4484
|
+
.tooltip-tail {
|
|
4485
|
+
position: absolute;
|
|
4486
|
+
left: 50%;
|
|
4487
|
+
transform: translateX(-50%);
|
|
4488
|
+
width: 0;
|
|
4489
|
+
height: 0;
|
|
4490
|
+
border-left: 6px solid transparent;
|
|
4491
|
+
border-right: 6px solid transparent;
|
|
4492
|
+
}
|
|
4493
|
+
|
|
4494
|
+
.tooltip-bubble.above .tooltip-tail {
|
|
4495
|
+
bottom: -6px;
|
|
4496
|
+
border-top: 6px solid #111;
|
|
4497
|
+
}
|
|
4498
|
+
|
|
4499
|
+
.tooltip-bubble.below .tooltip-tail {
|
|
4500
|
+
top: -6px;
|
|
4501
|
+
border-bottom: 6px solid #111;
|
|
4502
|
+
}
|
|
4503
|
+
`;
|
|
4504
|
+
__decorateClass([
|
|
4505
|
+
property25({ type: String })
|
|
4506
|
+
], RelTooltip.prototype, "text", 2);
|
|
4507
|
+
__decorateClass([
|
|
4508
|
+
property25({ type: String })
|
|
4509
|
+
], RelTooltip.prototype, "position", 2);
|
|
4510
|
+
__decorateClass([
|
|
4511
|
+
property25({ type: Boolean })
|
|
4512
|
+
], RelTooltip.prototype, "showTail", 2);
|
|
4513
|
+
RelTooltip = __decorateClass([
|
|
4514
|
+
customElement26("rel-tooltip")
|
|
4515
|
+
], RelTooltip);
|
|
4516
|
+
export {
|
|
4517
|
+
RelAccordion,
|
|
4518
|
+
RelAlert,
|
|
4519
|
+
RelAvatar,
|
|
4520
|
+
RelBadge,
|
|
4521
|
+
RelBreadcrumbs,
|
|
4522
|
+
RelButton,
|
|
4523
|
+
RelCard,
|
|
4524
|
+
RelCardMedia,
|
|
4525
|
+
RelCheckbox,
|
|
4526
|
+
RelChip,
|
|
4527
|
+
RelContainer,
|
|
4528
|
+
RelDivider,
|
|
4529
|
+
RelLayout,
|
|
4530
|
+
RelMenu,
|
|
4531
|
+
RelProgress,
|
|
4532
|
+
RelRadio,
|
|
4533
|
+
RelSegmentedButton,
|
|
4534
|
+
RelSelect,
|
|
4535
|
+
RelSlider,
|
|
4536
|
+
RelSnackbar,
|
|
4537
|
+
RelStepper,
|
|
4538
|
+
RelSwitch,
|
|
4539
|
+
RelTab,
|
|
4540
|
+
RelTextfield,
|
|
4541
|
+
RelToast,
|
|
4542
|
+
RelTooltip
|
|
4543
|
+
};
|
|
4544
|
+
//# sourceMappingURL=index.mjs.map
|