@cargosense/cargo-design-system 1.0.4 → 1.0.7
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/assets/{Counter.cjs.js → index.cjs.js} +883 -17
- package/dist/assets/index.cjs.js.map +1 -0
- package/dist/assets/{Counter.es.js → index.es.js} +1639 -159
- package/dist/assets/index.es.js.map +1 -0
- package/dist/atoms/index.cjs.js +1 -861
- package/dist/atoms/index.cjs.js.map +1 -1
- package/dist/atoms/index.es.js +34 -1479
- package/dist/atoms/index.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +48 -47
- package/dist/index.es.js.map +1 -1
- package/dist/molecules/index.cjs.js +80 -13
- package/dist/molecules/index.cjs.js.map +1 -1
- package/dist/molecules/index.es.js +200 -89
- package/dist/molecules/index.es.js.map +1 -1
- package/dist/register/index.cjs.js +1 -1
- package/dist/register/index.cjs.js.map +1 -1
- package/dist/register/index.es.js +8 -7
- package/dist/register/index.es.js.map +1 -1
- package/package.json +3 -2
- package/dist/assets/Counter.cjs.js.map +0 -1
- package/dist/assets/Counter.es.js.map +0 -1
package/dist/atoms/index.es.js
CHANGED
|
@@ -1,1484 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as K, I as N, N as U, b as W, r as M, a as Y } from "../assets/Counter.es.js";
|
|
1
|
+
import { B as r, h as t, s as g, C as i, D as o, E as n, F as l, I as c, u as d, m, K as y, L as C, N as I, R as b, G as p, S as u, T as x, g as B, j as K, t as S, d as f, k as h, y as j, q as k, r as v, v as D, n as E, l as F, w as L, c as N, A as R, H as T, p as M, z as O } from "../assets/index.es.js";
|
|
3
2
|
import "../fonts/index.es.js";
|
|
4
|
-
class d extends r {
|
|
5
|
-
static styles = i`
|
|
6
|
-
@font-face {
|
|
7
|
-
font-family: 'Geist';
|
|
8
|
-
src: url(${o(n)}) format('woff');
|
|
9
|
-
font-weight: 100 900;
|
|
10
|
-
font-style: normal;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.badge {
|
|
14
|
-
background-color: var(--badge-background-color);
|
|
15
|
-
color: var(--badge-text-color);
|
|
16
|
-
font-size: var(--badge-text-size, 14px);
|
|
17
|
-
font-weight: var(--badge-text-weight, 500);
|
|
18
|
-
border-radius: var(--badge-border-radius, 16px);
|
|
19
|
-
padding: var(--badge-padding, 1px 8px);
|
|
20
|
-
display: inline-flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
text-align: center;
|
|
23
|
-
border: 1px solid var(--badge-border-color, #D6D7D9);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.badge::before {
|
|
29
|
-
content: '';
|
|
30
|
-
display: inline-block;
|
|
31
|
-
width: 8px;
|
|
32
|
-
height: 8px;
|
|
33
|
-
margin-right: 4px;
|
|
34
|
-
border-radius: 50%;
|
|
35
|
-
background-color: var(--badge-dot-color, #1C1C1C);
|
|
36
|
-
}
|
|
37
|
-
.done {
|
|
38
|
-
--badge-dot-color: #1C1C1C;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.error {
|
|
42
|
-
--badge-dot-color: #E53E3E;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.warning {
|
|
46
|
-
--badge-dot-color: #D97E28;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.pending {
|
|
50
|
-
--badge-dot-color: #43B620;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.none::before {
|
|
54
|
-
content: none;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
static properties = {
|
|
58
|
-
status: {
|
|
59
|
-
type: String,
|
|
60
|
-
reflect: !0,
|
|
61
|
-
attribute: "status",
|
|
62
|
-
defaultValue: "none"
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
constructor() {
|
|
66
|
-
super(), this.status = "none";
|
|
67
|
-
}
|
|
68
|
-
render() {
|
|
69
|
-
return t`
|
|
70
|
-
<span class="badge ${this.status}">
|
|
71
|
-
<slot></slot>
|
|
72
|
-
</span>
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function F() {
|
|
77
|
-
typeof window < "u" && !customElements.get("cd-badge") && customElements.define("cd-badge", d);
|
|
78
|
-
}
|
|
79
|
-
class u extends r {
|
|
80
|
-
static styles = i`
|
|
81
|
-
@font-face {
|
|
82
|
-
font-family: 'Geist';
|
|
83
|
-
src: url(${o(n)}) format('woff');
|
|
84
|
-
font-weight: 100 900;
|
|
85
|
-
font-style: normal;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
:host {
|
|
89
|
-
flex-grow: 1;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.body {
|
|
93
|
-
font-family: 'Geist', sans-serif;
|
|
94
|
-
display:flex;
|
|
95
|
-
height: 100%;
|
|
96
|
-
width: 100%;
|
|
97
|
-
|
|
98
|
-
background-color: var(--body-background-color, var(--base-color-slate-50));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.content {
|
|
102
|
-
margin: var(--body-content-margin, 28px);
|
|
103
|
-
display: flex;
|
|
104
|
-
flex-grow: 1;
|
|
105
|
-
flex-direction: row;
|
|
106
|
-
background-color: var(--body-content-background-color, var(--base-color-white));
|
|
107
|
-
border-radius: 8px;
|
|
108
|
-
border: 1px solid var(--body-content-border-color, var(--base-color-slate-200));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.fit-content {
|
|
112
|
-
align-items: center;
|
|
113
|
-
justify-content: center;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.fit-content .content {
|
|
117
|
-
width: fit-content;
|
|
118
|
-
height: fit-content;
|
|
119
|
-
flex-grow: 0;
|
|
120
|
-
max-width: 100%;
|
|
121
|
-
max-height: 100%;
|
|
122
|
-
}
|
|
123
|
-
`;
|
|
124
|
-
static properties = {
|
|
125
|
-
fitContent: {
|
|
126
|
-
type: Boolean,
|
|
127
|
-
reflect: !0,
|
|
128
|
-
attribute: "fit-content"
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
constructor() {
|
|
132
|
-
super(), this.fitContent = !1;
|
|
133
|
-
}
|
|
134
|
-
render() {
|
|
135
|
-
return t`
|
|
136
|
-
<div class="body${this.fitContent ? " fit-content" : ""}">
|
|
137
|
-
<div class="content">
|
|
138
|
-
<slot><slot>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
`;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function S() {
|
|
145
|
-
typeof window < "u" && !customElements.get("cd-body") && customElements.define("cd-body", u);
|
|
146
|
-
}
|
|
147
|
-
class p extends r {
|
|
148
|
-
static styles = i`
|
|
149
|
-
@font-face {
|
|
150
|
-
font-family: 'Geist';
|
|
151
|
-
src: url(${o(n)}) format('woff');
|
|
152
|
-
font-weight: 100 900;
|
|
153
|
-
font-style: normal;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.default {
|
|
157
|
-
font-family: 'Geist';
|
|
158
|
-
display: inline-flex;
|
|
159
|
-
flex-direction: row;
|
|
160
|
-
align-items: center;
|
|
161
|
-
padding: var(--data-object-vertical-padding) var(--data-object-horizontal-padding);
|
|
162
|
-
background-color: var(--data-object-background-color);
|
|
163
|
-
color: var(--data-object-text-color);
|
|
164
|
-
border-radius: var(--data-object-border-radius);
|
|
165
|
-
gap: var(--data-object-gap);
|
|
166
|
-
font-size: var(--data-object-size);
|
|
167
|
-
font-weight: var(--data-object-font-weight, 400);
|
|
168
|
-
--icon-stroke: var(--data-object-icon-color, var(--text-primary-color));
|
|
169
|
-
cursor: pointer;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.default:hover {
|
|
173
|
-
background-color: var(--data-object-hover-background-color, var(--base-color-teal-100));
|
|
174
|
-
transition: background 0.3s ease-in-out;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.default:focus {
|
|
178
|
-
outline: 2px solid var(--input-border-color-focus);
|
|
179
|
-
border: none;
|
|
180
|
-
outline-offset: 0;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
a {
|
|
184
|
-
text-decoration: none;
|
|
185
|
-
color: inherit;
|
|
186
|
-
}
|
|
187
|
-
`;
|
|
188
|
-
static properties = {
|
|
189
|
-
link: {
|
|
190
|
-
type: String,
|
|
191
|
-
reflect: !0
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
constructor() {
|
|
195
|
-
super(), this.variant = "", this.link = void 0;
|
|
196
|
-
}
|
|
197
|
-
render() {
|
|
198
|
-
return t`
|
|
199
|
-
<a href="${l(this.link)}" class="default ${this.variant}" tabindex="0">
|
|
200
|
-
<slot name="start"></slot>
|
|
201
|
-
<slot></slot>
|
|
202
|
-
<slot name="end"></slot>
|
|
203
|
-
</a>
|
|
204
|
-
`;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function B() {
|
|
208
|
-
typeof window < "u" && !customElements.get("cd-data-object") && customElements.define("cd-data-object", p);
|
|
209
|
-
}
|
|
210
|
-
class f extends r {
|
|
211
|
-
static styles = i`
|
|
212
|
-
@font-face {
|
|
213
|
-
font-family: 'Geist';
|
|
214
|
-
src: url(${o(n)}) format('woff');
|
|
215
|
-
font-weight: 100 900;
|
|
216
|
-
font-style: normal;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.key-value {
|
|
220
|
-
font-family: 'Geist', sans-serif;
|
|
221
|
-
display: flex;
|
|
222
|
-
flex-direction: row;
|
|
223
|
-
align-items: center;
|
|
224
|
-
font-size: var(--key-value-font-size, 14px);
|
|
225
|
-
gap: var(--key-value-gap, 10px);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.key {
|
|
229
|
-
flex-grow: 1;
|
|
230
|
-
color: var(--key-value-label-color, var(--text-secondary-color));
|
|
231
|
-
font-weight: var(--key-value-label-font-weight);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.value {
|
|
235
|
-
color: var(--key-value-value-color, var(--text-primary-color));
|
|
236
|
-
font-weight: var(--key-value-value-font-weight);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
`;
|
|
240
|
-
static properties = {
|
|
241
|
-
key: {
|
|
242
|
-
type: String,
|
|
243
|
-
reflect: !0
|
|
244
|
-
},
|
|
245
|
-
value: {
|
|
246
|
-
type: String,
|
|
247
|
-
reflect: !0
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
constructor() {
|
|
251
|
-
super(), this.key = "", this.value = "";
|
|
252
|
-
}
|
|
253
|
-
render() {
|
|
254
|
-
return t`
|
|
255
|
-
<div class="key-value">
|
|
256
|
-
<span class="key">${this.key}</span>
|
|
257
|
-
${this.value === "" ? t`<slot class="value"></slot>` : t`<span class="value">${this.value}</span>`}
|
|
258
|
-
</div>
|
|
259
|
-
`;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
function A() {
|
|
263
|
-
typeof window < "u" && !customElements.get("cd-key-value") && customElements.define("cd-key-value", f);
|
|
264
|
-
}
|
|
265
|
-
class h extends r {
|
|
266
|
-
static styles = i`
|
|
267
|
-
@font-face {
|
|
268
|
-
font-family: 'Geist';
|
|
269
|
-
src: url(${o(n)}) format('woff');
|
|
270
|
-
font-weight: 100 900;
|
|
271
|
-
font-style: normal;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.key {
|
|
275
|
-
color: var(--key-value-label-color, var(--text-secondary-color));
|
|
276
|
-
font-weight: var(--key-value-label-font-weight);
|
|
277
|
-
font-size: var(--key-value-font-size, 14px);
|
|
278
|
-
}
|
|
279
|
-
`;
|
|
280
|
-
static properties = {
|
|
281
|
-
key: {
|
|
282
|
-
type: String,
|
|
283
|
-
reflect: !0
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
constructor() {
|
|
287
|
-
super(), this.key = "";
|
|
288
|
-
}
|
|
289
|
-
render() {
|
|
290
|
-
return t`
|
|
291
|
-
<span class="key"><slot></slot></span>
|
|
292
|
-
`;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function q() {
|
|
296
|
-
typeof window < "u" && !customElements.get("cd-key") && customElements.define("cd-key", h);
|
|
297
|
-
}
|
|
298
|
-
class b extends r {
|
|
299
|
-
static styles = i`
|
|
300
|
-
@font-face {
|
|
301
|
-
font-family: 'Geist';
|
|
302
|
-
src: url(${o("fonts/Geist-Regular.woff")}) format('woff');
|
|
303
|
-
font-weight: 100 900;
|
|
304
|
-
font-style: normal;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.sm svg {
|
|
308
|
-
width: 20px;
|
|
309
|
-
height: 20px;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.md svg {
|
|
313
|
-
width: 40px;
|
|
314
|
-
height: 40px;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.lg svg{
|
|
318
|
-
width: 60px;
|
|
319
|
-
height: 60px;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.spinner {
|
|
323
|
-
animation: spin 1s linear infinite;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.default {
|
|
327
|
-
--spinner-stroke: var(--base-color-slate-900);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.classic {
|
|
331
|
-
--spinner-stroke: var(--base-color-teal-600);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.secondary {
|
|
335
|
-
--spinner-stroke: var(--base-color-slate-50);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.path {
|
|
339
|
-
stroke-dasharray: 90, 150;
|
|
340
|
-
stroke-dashoffset: 0;
|
|
341
|
-
transform-origin: center;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
@keyframes spin {
|
|
345
|
-
100% {
|
|
346
|
-
transform: rotate(360deg);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
`;
|
|
350
|
-
static properties = {
|
|
351
|
-
size: {
|
|
352
|
-
type: String,
|
|
353
|
-
reflect: !0,
|
|
354
|
-
attribute: "size",
|
|
355
|
-
converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md",
|
|
356
|
-
defaultValue: "md"
|
|
357
|
-
},
|
|
358
|
-
color: {
|
|
359
|
-
type: String,
|
|
360
|
-
reflect: !0,
|
|
361
|
-
attribute: "color",
|
|
362
|
-
converter: (e) => ["default", "classic", "secondary"].includes(e) ? e : "default",
|
|
363
|
-
defaultValue: "default"
|
|
364
|
-
},
|
|
365
|
-
ariaLabel: {
|
|
366
|
-
type: String,
|
|
367
|
-
reflect: !0,
|
|
368
|
-
attribute: "aria-label",
|
|
369
|
-
defaultValue: "Loading"
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
constructor() {
|
|
373
|
-
super(), this.size = "md", this.color = "default";
|
|
374
|
-
}
|
|
375
|
-
render() {
|
|
376
|
-
return t`
|
|
377
|
-
<div class="${this.size} ${this.color}" aria-label=${this.ariaLabel}>
|
|
378
|
-
<svg class="spinner" viewBox="0 0 50 50" width="40" height="40">
|
|
379
|
-
<circle
|
|
380
|
-
class="path"
|
|
381
|
-
cx="25"
|
|
382
|
-
cy="25"
|
|
383
|
-
r="20"
|
|
384
|
-
fill="none"
|
|
385
|
-
stroke="var(--spinner-stroke)"
|
|
386
|
-
stroke-width="4"
|
|
387
|
-
stroke-linecap="round"
|
|
388
|
-
/>
|
|
389
|
-
</svg>
|
|
390
|
-
</div>
|
|
391
|
-
`;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
function _() {
|
|
395
|
-
typeof window < "u" && !customElements.get("cd-spinner") && customElements.define("cd-spinner", b);
|
|
396
|
-
}
|
|
397
|
-
class v extends r {
|
|
398
|
-
static styles = i`
|
|
399
|
-
@font-face {
|
|
400
|
-
font-family: 'Geist';
|
|
401
|
-
src: url(${o(n)}) format('woff');
|
|
402
|
-
font-weight: 100 900;
|
|
403
|
-
font-style: normal;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.container {
|
|
407
|
-
display: flex;
|
|
408
|
-
flex-direction: column;
|
|
409
|
-
width: 100%;
|
|
410
|
-
height: 100%;
|
|
411
|
-
}
|
|
412
|
-
`;
|
|
413
|
-
static properties = {
|
|
414
|
-
direction: {
|
|
415
|
-
type: String,
|
|
416
|
-
reflect: !0,
|
|
417
|
-
attribute: "direction",
|
|
418
|
-
converter: {
|
|
419
|
-
fromAttribute(e) {
|
|
420
|
-
return e || "column";
|
|
421
|
-
},
|
|
422
|
-
toAttribute(e) {
|
|
423
|
-
return e;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
|
-
align: {
|
|
428
|
-
type: String,
|
|
429
|
-
reflect: !0,
|
|
430
|
-
attribute: "align",
|
|
431
|
-
converter: {
|
|
432
|
-
fromAttribute(e) {
|
|
433
|
-
return e || "stretch";
|
|
434
|
-
},
|
|
435
|
-
toAttribute(e) {
|
|
436
|
-
return e;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
},
|
|
440
|
-
gap: {
|
|
441
|
-
type: String,
|
|
442
|
-
reflect: !0,
|
|
443
|
-
attribute: "gap",
|
|
444
|
-
converter: {
|
|
445
|
-
fromAttribute(e) {
|
|
446
|
-
return e || "0px";
|
|
447
|
-
},
|
|
448
|
-
toAttribute(e) {
|
|
449
|
-
return e;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
justify: {
|
|
454
|
-
type: String,
|
|
455
|
-
reflect: !0,
|
|
456
|
-
attribute: "justify",
|
|
457
|
-
converter: {
|
|
458
|
-
fromAttribute(e) {
|
|
459
|
-
return e || "flex-start";
|
|
460
|
-
},
|
|
461
|
-
toAttribute(e) {
|
|
462
|
-
return e;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
constructor() {
|
|
468
|
-
super();
|
|
469
|
-
}
|
|
470
|
-
render() {
|
|
471
|
-
return t`
|
|
472
|
-
<div class="container" style="flex-direction: ${this.direction}; align-items: ${this.align}; gap: ${this.gap}; justify-content: ${this.justify};">
|
|
473
|
-
<slot></slot>
|
|
474
|
-
</div>
|
|
475
|
-
`;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
function G() {
|
|
479
|
-
typeof window < "u" && !customElements.get("cd-flex-container") && customElements.define("cd-flex-container", v);
|
|
480
|
-
}
|
|
481
|
-
class g extends r {
|
|
482
|
-
static formAssociated = !0;
|
|
483
|
-
static styles = i`
|
|
484
|
-
@font-face {
|
|
485
|
-
font-family: 'Geist';
|
|
486
|
-
src: url(${o(n)}) format('woff');
|
|
487
|
-
font-weight: 100 900;
|
|
488
|
-
font-style: normal;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
.container {
|
|
492
|
-
display: flex;
|
|
493
|
-
align-items: center;
|
|
494
|
-
flex-direction: row-reverse;
|
|
495
|
-
position: relative;
|
|
496
|
-
min-height: var(--input-checkbox-size-md, 20px);
|
|
497
|
-
gap: var(--input-checkbox-gap, 10px);
|
|
498
|
-
width: fit-content;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
label {
|
|
502
|
-
font-family: var(--font-family, 'Geist');
|
|
503
|
-
font-weight: var(--font-weight, 400);
|
|
504
|
-
font-size: var(--font-size, 14px);
|
|
505
|
-
color: var(--text-primary-color);
|
|
506
|
-
cursor: pointer;
|
|
507
|
-
user-select: none;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.container input {
|
|
511
|
-
position: absolute;
|
|
512
|
-
opacity: 0;
|
|
513
|
-
cursor: pointer;
|
|
514
|
-
height: 0;
|
|
515
|
-
width: 0;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
.checkmark {
|
|
519
|
-
height: var(--input-checkbox-size-md, 20px);
|
|
520
|
-
width: var(--input-checkbox-size-md, 20px);
|
|
521
|
-
border-radius: var(--input-checkbox-border-radius-md, 4px);
|
|
522
|
-
background-color: var(--input-background-color);
|
|
523
|
-
border: 1px solid var(--input-border-color, #8E98A4);
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
display: flex;
|
|
527
|
-
align-items: center;
|
|
528
|
-
justify-content: center;
|
|
529
|
-
box-sizing: border-box;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
.checkmark cd-icon {
|
|
533
|
-
display: none;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
.container:hover .active.checkmark {
|
|
537
|
-
|
|
538
|
-
background-color: var(--ui-interactive-primary-background-hover, #0F665F);
|
|
539
|
-
border: 1px solid var(--ui-interactive-primary-border-hover, #013333);
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.container:hover .checkmark {
|
|
543
|
-
background-color: var(--input-background-color, #F1F4F6);
|
|
544
|
-
border: 1px solid var(--input-border-color, #8E98A4);
|
|
545
|
-
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.active.checkmark {
|
|
549
|
-
background-color: var(--ui-interactive-primary-background, #1B1F23);
|
|
550
|
-
border: 1px solid var(--ui-interactive-primary-border, #0C0E0F);
|
|
551
|
-
}
|
|
552
|
-
.active.checkmark cd-icon {
|
|
553
|
-
display: block;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
.container input[type="checkbox"]:disabled ~ .checkmark {
|
|
557
|
-
background-color: var(--input-background-color-disabled, #E1E5EA);
|
|
558
|
-
border: 1px solid var(--input-border-color-disabled, #C5CCD3);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
.container:hover input[type="checkbox"]:disabled ~ .checkmark {
|
|
562
|
-
background-color: var(--input-background-color-disabled, #E1E5EA) !important;
|
|
563
|
-
border: 1px solid var(--input-border-color-disabled, #C5CCD3) !important;
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
.disabled .label-text {
|
|
568
|
-
color: var(--ui-disabled-color, #A9B2BC);
|
|
569
|
-
cursor: not-allowed;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
.checkmark:focus {
|
|
573
|
-
outline: 2px solid var(--ui-focus-color, #0F665F);
|
|
574
|
-
border-width: 0;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
.disabled .checkmark:focus {
|
|
578
|
-
outline: none;
|
|
579
|
-
border-width: 0;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
.container input[type="checkbox"] ~ .error {
|
|
583
|
-
border-color: var(--input-error-border-color);
|
|
584
|
-
color: var(--input-error-border-color);
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
.container .active.error {
|
|
588
|
-
background-color: var(--input-error-border-color);
|
|
589
|
-
border-color: var(--input-error-border-color);
|
|
590
|
-
|
|
591
|
-
}
|
|
592
|
-
.container:hover input[type="checkbox"] ~ .error {
|
|
593
|
-
border-color: var(--input-error-border-hover-color);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
.container:hover .active.error {
|
|
597
|
-
border-color: var(--input-error-border-hover-color);
|
|
598
|
-
background-color: var(--input-error-border-hover-color);
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.container input[type="checkbox"] ~ .error:focus {
|
|
602
|
-
border-color: var(--input-error-border-color);
|
|
603
|
-
outline: 2px solid var(--input-error-border-color);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
.container.error {
|
|
607
|
-
color: var(--input-error-border-color);
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
.label-text {
|
|
612
|
-
display: flex;
|
|
613
|
-
align-items: flex-start;
|
|
614
|
-
flex-direction: column;
|
|
615
|
-
gap: 2px;
|
|
616
|
-
font-size: var(--input-label-font-size, 14px);
|
|
617
|
-
color: var(--text-primary-color);
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
.description {
|
|
621
|
-
color: var(--text-secondary-color);
|
|
622
|
-
margin-top: 2px;
|
|
623
|
-
font-size: var(--input-description-font-size, 13px);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
.disabled .description {
|
|
627
|
-
color: var(--ui-disabled-color, #A9B2BC);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
.container:focus {
|
|
631
|
-
outline: 2px solid var(--ui-focus-color, #0F665F);
|
|
632
|
-
outline-offset: 2px;
|
|
633
|
-
border-radius: var(--input-checkbox-border-radius-md, 4px);
|
|
634
|
-
}
|
|
635
|
-
`;
|
|
636
|
-
static properties = {
|
|
637
|
-
checked: {
|
|
638
|
-
type: Boolean,
|
|
639
|
-
reflect: !0
|
|
640
|
-
},
|
|
641
|
-
disabled: {
|
|
642
|
-
type: Boolean,
|
|
643
|
-
reflect: !0
|
|
644
|
-
},
|
|
645
|
-
description: {
|
|
646
|
-
type: String,
|
|
647
|
-
reflect: !0
|
|
648
|
-
},
|
|
649
|
-
name: {
|
|
650
|
-
type: String,
|
|
651
|
-
reflect: !0
|
|
652
|
-
},
|
|
653
|
-
required: {
|
|
654
|
-
type: Boolean,
|
|
655
|
-
reflect: !0
|
|
656
|
-
},
|
|
657
|
-
value: {
|
|
658
|
-
type: String,
|
|
659
|
-
reflect: !0
|
|
660
|
-
},
|
|
661
|
-
error: {
|
|
662
|
-
type: Boolean,
|
|
663
|
-
reflect: !0
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
constructor() {
|
|
667
|
-
super(), this.checked = !1, this.disabled = !1, this.description = void 0, this.name = void 0, this.required = !1, this.value = void 0, this._internals = this.attachInternals();
|
|
668
|
-
}
|
|
669
|
-
render() {
|
|
670
|
-
return t`
|
|
671
|
-
<label ?disabled="${this.disabled}" for='${this.name | "checkbox"}' class='container ${this.disabled ? "disabled" : ""} ${this.error ? "error" : ""}' >
|
|
672
|
-
|
|
673
|
-
<div class='label-text'>
|
|
674
|
-
<slot></slot>
|
|
675
|
-
${this.description ? t`<span class='description'>${this.description}</span>` : ""}
|
|
676
|
-
</div>
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
<input type="checkbox" id='${this.name | "checkbox"}' name='${this.name | "checkbox"}' aria-describedby='${this.description | this.name | "checkbox"}' value='${l(this.value)}' ?checked="${this.checked}" ?disabled="${this.disabled}" @change="${this._onChange}" tabindex="-1">
|
|
680
|
-
|
|
681
|
-
<div class='checkmark ${this.checked ? "active" : ""} ${this.error ? "error" : ""}' id='check' aria-describedby='${this.description | this.name | "checkbox"}' tabindex="${this.disabled ? "-1" : "0"}">
|
|
682
|
-
<cd-icon name='check' size='xs' color='white'></cd-icon>
|
|
683
|
-
</div>
|
|
684
|
-
</label>
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
`;
|
|
688
|
-
}
|
|
689
|
-
_onChange(e) {
|
|
690
|
-
if (!this.disabled)
|
|
691
|
-
return this.checked = e.target.checked, this._internals.setValidity({
|
|
692
|
-
valid: !0
|
|
693
|
-
}), this._internals.setFormValue(this.checked), this.dispatchEvent(new CustomEvent("change", {
|
|
694
|
-
detail: {
|
|
695
|
-
checked: this.checked,
|
|
696
|
-
value: this.value
|
|
697
|
-
},
|
|
698
|
-
bubbles: !0,
|
|
699
|
-
composed: !0
|
|
700
|
-
})), this.checked;
|
|
701
|
-
}
|
|
702
|
-
setChecked(e) {
|
|
703
|
-
if (typeof e != "boolean")
|
|
704
|
-
throw new TypeError("The checked parameter must be a boolean");
|
|
705
|
-
this.checked = e, this._internals.setValidity({
|
|
706
|
-
valid: e
|
|
707
|
-
}), this._internals.setFormValue(e), this.dispatchEvent(new CustomEvent("change", {
|
|
708
|
-
detail: {
|
|
709
|
-
checked: e,
|
|
710
|
-
value: this.value
|
|
711
|
-
},
|
|
712
|
-
bubbles: !0,
|
|
713
|
-
composed: !0
|
|
714
|
-
}));
|
|
715
|
-
}
|
|
716
|
-
firstUpdated() {
|
|
717
|
-
this.disabled ? this.shadowRoot.querySelector("cd-icon").color = "#A9B2BC" : this.shadowRoot.querySelector("#check").addEventListener("keydown", (e) => {
|
|
718
|
-
console.log("keydown event", e), (e.key === "Enter" || e.key === " ") && (this.checked = !this.checked, this._internals.setValidity({
|
|
719
|
-
valid: !this.checked
|
|
720
|
-
}), this._internals.setFormValue(!this.checked), this.dispatchEvent(new CustomEvent("change", {
|
|
721
|
-
detail: {
|
|
722
|
-
checked: !this.checked,
|
|
723
|
-
value: this.value
|
|
724
|
-
},
|
|
725
|
-
bubbles: !0,
|
|
726
|
-
composed: !0
|
|
727
|
-
})), this.requestUpdate());
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
function j() {
|
|
732
|
-
typeof window < "u" && !customElements.get("cd-checkbox") && customElements.define("cd-checkbox", g);
|
|
733
|
-
}
|
|
734
|
-
class m extends r {
|
|
735
|
-
static styles = i`
|
|
736
|
-
@font-face {
|
|
737
|
-
font-family: 'Geist';
|
|
738
|
-
src: url(${o(n)}) format('woff');
|
|
739
|
-
font-weight: 100 900;
|
|
740
|
-
font-style: normal;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
.informational {
|
|
744
|
-
font-size: var(--input-hint-font-size, 14px);
|
|
745
|
-
color: var(input-hint-color, var(--text-secondary-color));
|
|
746
|
-
display:block;
|
|
747
|
-
|
|
748
|
-
}
|
|
749
|
-
`;
|
|
750
|
-
static properties = {
|
|
751
|
-
text: {
|
|
752
|
-
type: String,
|
|
753
|
-
reflect: !0
|
|
754
|
-
},
|
|
755
|
-
type: {
|
|
756
|
-
type: String,
|
|
757
|
-
reflect: !0
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
constructor() {
|
|
761
|
-
super(), this.text = "", this.type = "info";
|
|
762
|
-
}
|
|
763
|
-
render() {
|
|
764
|
-
return t`
|
|
765
|
-
<div class="informational ${this.type}">
|
|
766
|
-
${this.text}
|
|
767
|
-
<slot></slot>
|
|
768
|
-
</div>
|
|
769
|
-
`;
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
function y() {
|
|
773
|
-
typeof window < "u" && !customElements.get("cd-information") && customElements.define("cd-information", m);
|
|
774
|
-
}
|
|
775
|
-
class x extends r {
|
|
776
|
-
static styles = i`
|
|
777
|
-
@font-face {
|
|
778
|
-
font-family: 'Geist';
|
|
779
|
-
src: url(${o(n)}) format('woff');
|
|
780
|
-
font-weight: 100 900;
|
|
781
|
-
font-style: normal;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
label {
|
|
785
|
-
font-family: 'Geist';
|
|
786
|
-
font-size: var(--label-font-size, 14px);
|
|
787
|
-
color: var(--text-primary-color);
|
|
788
|
-
display: block;
|
|
789
|
-
}
|
|
790
|
-
.disabled slot {
|
|
791
|
-
color: var(--ui-disabled-color, #A9B2BC);
|
|
792
|
-
cursor: not-allowed;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
.required {
|
|
796
|
-
color: var(--input-required-color, #FF5630);
|
|
797
|
-
}
|
|
798
|
-
`;
|
|
799
|
-
static properties = {
|
|
800
|
-
text: {
|
|
801
|
-
type: String,
|
|
802
|
-
reflect: !0
|
|
803
|
-
},
|
|
804
|
-
for: {
|
|
805
|
-
type: String,
|
|
806
|
-
reflect: !0,
|
|
807
|
-
attribute: "for"
|
|
808
|
-
},
|
|
809
|
-
required: {
|
|
810
|
-
type: Boolean,
|
|
811
|
-
reflect: !0
|
|
812
|
-
},
|
|
813
|
-
disabled: {
|
|
814
|
-
type: Boolean,
|
|
815
|
-
reflect: !0
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
constructor() {
|
|
819
|
-
super(), this.text = void 0, this.for = void 0, this.required = !1, this.disabled = !1;
|
|
820
|
-
}
|
|
821
|
-
render() {
|
|
822
|
-
return t`
|
|
823
|
-
<label
|
|
824
|
-
class="${this.disabled ? "disabled" : ""}"
|
|
825
|
-
for="${l(this.for)}"
|
|
826
|
-
>
|
|
827
|
-
${this.text}
|
|
828
|
-
<slot></slot>
|
|
829
|
-
${this.required ? t`<span class="required">*</span>` : ""}
|
|
830
|
-
</label>
|
|
831
|
-
`;
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
function D() {
|
|
835
|
-
typeof window < "u" && !customElements.get("cd-label") && customElements.define("cd-label", x);
|
|
836
|
-
}
|
|
837
|
-
class k extends r {
|
|
838
|
-
static styles = i`
|
|
839
|
-
@font-face {
|
|
840
|
-
font-family: 'Geist';
|
|
841
|
-
src: url(${o(n)}) format('woff');
|
|
842
|
-
font-weight: 100 900;
|
|
843
|
-
font-style: normal;
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
.error-message {
|
|
847
|
-
font-family: 'Geist';
|
|
848
|
-
display:flex;
|
|
849
|
-
align-items: center;
|
|
850
|
-
font-size: var(--input-error-font-size);
|
|
851
|
-
gap: var(--error-message-gap, 8px);
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
.error {
|
|
856
|
-
color: var(--input-error-color);
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
.warning {
|
|
860
|
-
color: var(--input-warning-color, orange);
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
.normal {
|
|
864
|
-
color: var(--text-primary-color);
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
.success {
|
|
868
|
-
color: var(--input-success-color, green);
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
`;
|
|
872
|
-
static properties = {
|
|
873
|
-
text: {
|
|
874
|
-
type: String,
|
|
875
|
-
reflect: !0
|
|
876
|
-
},
|
|
877
|
-
type: {
|
|
878
|
-
type: String,
|
|
879
|
-
reflect: !0
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
constructor() {
|
|
883
|
-
super(), this.text = void 0, this.type = "error";
|
|
884
|
-
}
|
|
885
|
-
render() {
|
|
886
|
-
return t`
|
|
887
|
-
<div class="error-message ${this.type}">
|
|
888
|
-
<slot name='icon'></slot>
|
|
889
|
-
${this.text ? t`<span class="error-text">${this.text}</span>` : t`<slot></slot>`}
|
|
890
|
-
</div>
|
|
891
|
-
`;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
function V() {
|
|
895
|
-
typeof window < "u" && !customElements.get("cd-error") && customElements.define("cd-error", k);
|
|
896
|
-
}
|
|
897
|
-
class w extends r {
|
|
898
|
-
static styles = i`
|
|
899
|
-
@font-face {
|
|
900
|
-
font-family: 'Geist';
|
|
901
|
-
src: url(${o(n)}) format('woff');
|
|
902
|
-
font-weight: 100 900;
|
|
903
|
-
font-style: normal;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
.tag {
|
|
907
|
-
font-family: 'Geist';
|
|
908
|
-
display: inline-flex;
|
|
909
|
-
align-items: center;
|
|
910
|
-
border-radius: var(--tag-border-radius, 4px);
|
|
911
|
-
padding: var(--tag-padding, 0 8px);
|
|
912
|
-
min-height: var(--tag-medium, 27px);
|
|
913
|
-
font-size: var(--tag-font-size, 14px);
|
|
914
|
-
color: var(--tag-color, #fff);
|
|
915
|
-
background-color: var(--tag-default-background-color, var(--base-color-slate-900));
|
|
916
|
-
--icon-stroke: var(--tag-color, #000);
|
|
917
|
-
cursor: pointer;
|
|
918
|
-
user-select: none;
|
|
919
|
-
gap: var(--tag-gap, 6px);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
.tag.primary {
|
|
923
|
-
background-color: var(--tag-primary-color, var(--base-color-teal-600));
|
|
924
|
-
--icon-stroke: var(--tag-color, #000);
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
.tag.secondary {
|
|
928
|
-
background-color: var(--tag-secondary-color, var(--base-color-slate-50));
|
|
929
|
-
--icon-stroke: var(--tag-color, #000);
|
|
930
|
-
color: var(--text-primary-color, #000);
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
.tag.link {
|
|
934
|
-
background-color: var(--tag-link-color, var(--event-air-background));
|
|
935
|
-
color: var(--tag-link-text-color, white);
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
.tag.info {
|
|
939
|
-
background-color: var(--tag-secondary-color, var(--base-color-slate-200));
|
|
940
|
-
--icon-stroke: var(--tag-color, #000);
|
|
941
|
-
color: var(--text-primary-color, #000);
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
.tag.success {
|
|
945
|
-
background-color: var(--tag-success-color, green);
|
|
946
|
-
--icon-stroke: var(--tag-color, #000);
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
.tag.warning {
|
|
950
|
-
background-color: var(--tag-warning-color, orange);
|
|
951
|
-
--icon-stroke: var(--tag-color, #000);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
.tag.danger {
|
|
955
|
-
background-color: var(--tag-danger-color, red);
|
|
956
|
-
--icon-stroke: var(--tag-color, #000);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
.tag.disabled {
|
|
960
|
-
background-color: var(--tag-disabled-background-color, var(--base-color-slate-400));
|
|
961
|
-
color: var(--tag-disabled-color, var(--base-color-slate-200));
|
|
962
|
-
cursor: not-allowed;
|
|
963
|
-
pointer-events: none;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
.sm {
|
|
967
|
-
min-height: var(--tag-small, 24px);
|
|
968
|
-
gap: var(--tag-gap-sm, 4px);
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
.lg {
|
|
972
|
-
min-height: var(--tag-large, 32px);
|
|
973
|
-
gap: var(--tag-gap-lg, 8px);
|
|
974
|
-
}
|
|
975
|
-
`;
|
|
976
|
-
static properties = {
|
|
977
|
-
label: {
|
|
978
|
-
type: String,
|
|
979
|
-
reflect: !0
|
|
980
|
-
},
|
|
981
|
-
variant: {
|
|
982
|
-
type: String,
|
|
983
|
-
reflect: !0,
|
|
984
|
-
converter: (e) => ["primary", "secondary", "default", "link", "info", "success", "warning", "danger"].includes(e) ? e : "default"
|
|
985
|
-
},
|
|
986
|
-
removable: {
|
|
987
|
-
type: Boolean,
|
|
988
|
-
reflect: !0
|
|
989
|
-
},
|
|
990
|
-
disabled: {
|
|
991
|
-
type: Boolean,
|
|
992
|
-
reflect: !0
|
|
993
|
-
},
|
|
994
|
-
size: {
|
|
995
|
-
type: String,
|
|
996
|
-
reflect: !0,
|
|
997
|
-
converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md"
|
|
998
|
-
}
|
|
999
|
-
};
|
|
1000
|
-
constructor() {
|
|
1001
|
-
super(), this.label = "", this.variant = "primary", this.removable = !1, this.disabled = !1, this.size = "md";
|
|
1002
|
-
}
|
|
1003
|
-
render() {
|
|
1004
|
-
return t`
|
|
1005
|
-
<span class="tag ${this.variant} ${this.size} ${this.disabled ? "disabled" : ""}" @click='${this._handleClick}'>
|
|
1006
|
-
<slot name="icon">
|
|
1007
|
-
</slot>
|
|
1008
|
-
<span class="label">${this.label} <slot></slot></span>
|
|
1009
|
-
${this.removable ? t`<span class="remove-icon" @click="${this._handleRemove}"><cd-icon name='exit' size='xs' color='${this.variant === "secondary" || this.variant === "info" ? "black" : "white"}'></cd-icon></span>` : ""}
|
|
1010
|
-
</span>
|
|
1011
|
-
`;
|
|
1012
|
-
}
|
|
1013
|
-
_handleRemove() {
|
|
1014
|
-
this.disabled || (this.dispatchEvent(new CustomEvent("remove", {
|
|
1015
|
-
detail: {
|
|
1016
|
-
label: this.label
|
|
1017
|
-
},
|
|
1018
|
-
bubbles: !0,
|
|
1019
|
-
composed: !0
|
|
1020
|
-
})), this.remove());
|
|
1021
|
-
}
|
|
1022
|
-
setRemovable(e) {
|
|
1023
|
-
this.removable = e;
|
|
1024
|
-
}
|
|
1025
|
-
setDisabled(e) {
|
|
1026
|
-
this.disabled = e;
|
|
1027
|
-
}
|
|
1028
|
-
removeTag() {
|
|
1029
|
-
this.dispatchEvent(new CustomEvent("remove", {
|
|
1030
|
-
detail: {
|
|
1031
|
-
label: this.label
|
|
1032
|
-
},
|
|
1033
|
-
bubbles: !0,
|
|
1034
|
-
composed: !0
|
|
1035
|
-
})), this.remove();
|
|
1036
|
-
}
|
|
1037
|
-
_handleClick() {
|
|
1038
|
-
this.disabled || this.dispatchEvent(new CustomEvent("click", {
|
|
1039
|
-
detail: {
|
|
1040
|
-
label: this.label
|
|
1041
|
-
},
|
|
1042
|
-
bubbles: !0,
|
|
1043
|
-
composed: !0
|
|
1044
|
-
}));
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
function R() {
|
|
1048
|
-
typeof window < "u" && !customElements.get("cd-tag") && customElements.define("cd-tag", w);
|
|
1049
|
-
}
|
|
1050
|
-
y();
|
|
1051
|
-
class $ extends r {
|
|
1052
|
-
static formAssociated = !0;
|
|
1053
|
-
static styles = i`
|
|
1054
|
-
@font-face {
|
|
1055
|
-
font-family: 'Geist';
|
|
1056
|
-
src: url(${o(n)}) format('woff');
|
|
1057
|
-
font-weight: 100 900;
|
|
1058
|
-
font-style: normal;
|
|
1059
|
-
}
|
|
1060
|
-
:host {
|
|
1061
|
-
display: inline-block;
|
|
1062
|
-
font-family: 'Geist', sans-serif;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
.container {
|
|
1066
|
-
display: flex;
|
|
1067
|
-
align-items: center;
|
|
1068
|
-
flex-direction: row;
|
|
1069
|
-
gap: var(--input-radio-gap, 8px);
|
|
1070
|
-
font-size: var(--input-font-size, 14px);
|
|
1071
|
-
font-weight: var(--input-font-weight, 400);
|
|
1072
|
-
color: var(--input-text-color, #1B1F23);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
input[type="radio"] {
|
|
1076
|
-
appearance: none;
|
|
1077
|
-
-webkit-appearance: none;
|
|
1078
|
-
width: var(--input-radio-size, 20px);
|
|
1079
|
-
height: var(--input-radio-size, 20px);
|
|
1080
|
-
border-radius: var(--input-radio-border-radius, 50%);
|
|
1081
|
-
margin: 0;
|
|
1082
|
-
padding: 0;
|
|
1083
|
-
border: 1px solid var(--input-border-color, #8E98A4);
|
|
1084
|
-
background-color: var(--input-background-color, #F1F4F6);
|
|
1085
|
-
cursor: pointer;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
input[type="radio"]:hover {
|
|
1089
|
-
border-color: var(--input-border-color-hover, #5C6B7A);
|
|
1090
|
-
transition: border-color 0.2s ease-in-out;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
input[type="radio"]:focus {
|
|
1094
|
-
border-color: var(--input-border-color-focus, #1B1F23);
|
|
1095
|
-
outline: 1px solid var(--input-border-color-focus, #1B1F23);
|
|
1096
|
-
outline-offset: 0;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
input[type="radio"]:checked:focus {
|
|
1100
|
-
outline: 2px solid var(--input-border-color-focus, #1B1F23);
|
|
1101
|
-
outline-offset: 0;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
input[type="radio"]:checked {
|
|
1106
|
-
background-color: var(--input-checked-background-color, #fff);
|
|
1107
|
-
border-width: 5px;
|
|
1108
|
-
border-color: var(--ui-interactive-primary-background, #1B1F23);
|
|
1109
|
-
outline: 1px solid var(--ui-interactive-primary-background, #1B1F23);
|
|
1110
|
-
box-sizing: border-box;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
input[type="radio"]:checked:hover {
|
|
1114
|
-
border-color: var(--ui-interactive-primary-background-hover, #0F665F);
|
|
1115
|
-
transition: border-color 0.2s ease-in-out;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
input[type="radio"]:disabled {
|
|
1119
|
-
background-color: var(--input-background-color-disabled, #E1E5EA);
|
|
1120
|
-
border-color: var(--input-border-color-disabled, #C5CCD3);
|
|
1121
|
-
cursor: not-allowed;
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
input[type="radio"]:checked:disabled {
|
|
1125
|
-
background-color: var(--base-color-white);
|
|
1126
|
-
border-color: var(--input-background-color-disabled, #E1E5EA);
|
|
1127
|
-
outline: var(--input-border-color-disabled, #C5CCD3);
|
|
1128
|
-
cursor: not-allowed;
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
input[type="radio"].input-error {
|
|
1132
|
-
border-color: var(--input-error-border-color, #FF4D4F);
|
|
1133
|
-
outline: 1px solid var(--input-error-border-color, #FF4D4F);
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
input[type="radio"].input-error:hover {
|
|
1137
|
-
border-color: var(--input-error-border-hover-color, #FF7875);
|
|
1138
|
-
outline: 1px solid var(--input-error-border-hover-color, #FF7875);
|
|
1139
|
-
}
|
|
1140
|
-
input[type="radio"].input-error:focus {
|
|
1141
|
-
border-color: var(--input-error-border-color, #FF4D4F);
|
|
1142
|
-
outline: 2px solid var(--input-error-border-color, #FF4D4F);
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
.input-error .radio-text {
|
|
1146
|
-
color: var(--input-error-border-color, #FF4D4F);
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
.disabled {
|
|
1152
|
-
color: var(--ui-disabled-color, #A9B2BC);
|
|
1153
|
-
cursor: not-allowed;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
.radio-text {
|
|
1158
|
-
display: flex;
|
|
1159
|
-
flex-direction: column;
|
|
1160
|
-
cursor: pointer;
|
|
1161
|
-
|
|
1162
|
-
}
|
|
1163
|
-
`;
|
|
1164
|
-
static properties = {
|
|
1165
|
-
name: {
|
|
1166
|
-
type: String
|
|
1167
|
-
},
|
|
1168
|
-
value: {
|
|
1169
|
-
type: String
|
|
1170
|
-
},
|
|
1171
|
-
checked: {
|
|
1172
|
-
type: Boolean,
|
|
1173
|
-
reflect: !0
|
|
1174
|
-
},
|
|
1175
|
-
disabled: {
|
|
1176
|
-
type: Boolean,
|
|
1177
|
-
reflect: !0
|
|
1178
|
-
},
|
|
1179
|
-
description: {
|
|
1180
|
-
type: String
|
|
1181
|
-
},
|
|
1182
|
-
error: {
|
|
1183
|
-
type: Boolean,
|
|
1184
|
-
reflect: !0
|
|
1185
|
-
},
|
|
1186
|
-
size: {
|
|
1187
|
-
type: String,
|
|
1188
|
-
reflect: !0
|
|
1189
|
-
},
|
|
1190
|
-
required: {
|
|
1191
|
-
type: Boolean,
|
|
1192
|
-
reflect: !0
|
|
1193
|
-
}
|
|
1194
|
-
};
|
|
1195
|
-
constructor() {
|
|
1196
|
-
super(), this.name = void 0, this.value = void 0, this.checked = !1, this.disabled = !1, this.description = void 0, this.error = !1, this.size = "md", this.required = !1, this._internals = this.attachInternals();
|
|
1197
|
-
}
|
|
1198
|
-
render() {
|
|
1199
|
-
return t`
|
|
1200
|
-
<label class="container ${this.size} ${this.disabled ? "disabled" : ""} ${this.error ? "input-error" : ""}" for="${this.name}">
|
|
1201
|
-
<input
|
|
1202
|
-
type="radio"
|
|
1203
|
-
class="${this.error ? "input-error" : ""}"
|
|
1204
|
-
name=${this.name}
|
|
1205
|
-
.value="${this.value}"
|
|
1206
|
-
.checked="${this.checked}"
|
|
1207
|
-
?disabled="${this.disabled}"
|
|
1208
|
-
@change="${this._handleChange}"
|
|
1209
|
-
@click="${this._select}"
|
|
1210
|
-
required="${this.required}"
|
|
1211
|
-
tabindex="0"
|
|
1212
|
-
>
|
|
1213
|
-
<div class='radio-text' @click="${this._handleLabelClick}">
|
|
1214
|
-
|
|
1215
|
-
<slot></slot>
|
|
1216
|
-
<cd-information>${this.description}</cd-information>
|
|
1217
|
-
</div>
|
|
1218
|
-
</label>
|
|
1219
|
-
|
|
1220
|
-
`;
|
|
1221
|
-
}
|
|
1222
|
-
deselectAll() {
|
|
1223
|
-
document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach((s) => {
|
|
1224
|
-
s.checked = !1, s.dispatchEvent(new CustomEvent("change", {
|
|
1225
|
-
detail: {
|
|
1226
|
-
checked: !1
|
|
1227
|
-
},
|
|
1228
|
-
bubbles: !0,
|
|
1229
|
-
composed: !0
|
|
1230
|
-
}));
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
_select() {
|
|
1234
|
-
document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach((s) => {
|
|
1235
|
-
s !== this && (s.checked = !1);
|
|
1236
|
-
}), this.checked = !0, this.dispatchEvent(new CustomEvent("change", {
|
|
1237
|
-
detail: {
|
|
1238
|
-
checked: !0
|
|
1239
|
-
},
|
|
1240
|
-
bubbles: !0,
|
|
1241
|
-
composed: !0
|
|
1242
|
-
}));
|
|
1243
|
-
}
|
|
1244
|
-
_handleLabelClick() {
|
|
1245
|
-
this.disabled || this._select();
|
|
1246
|
-
}
|
|
1247
|
-
_handleChange(e) {
|
|
1248
|
-
this.checked = e.target.checked, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1249
|
-
detail: {
|
|
1250
|
-
name: this.name,
|
|
1251
|
-
value: this.value,
|
|
1252
|
-
checked: this.checked
|
|
1253
|
-
},
|
|
1254
|
-
bubbles: !0,
|
|
1255
|
-
composed: !0
|
|
1256
|
-
}));
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
const I = () => {
|
|
1260
|
-
customElements.get("cd-radio") || customElements.define("cd-radio", $);
|
|
1261
|
-
};
|
|
1262
|
-
class E extends r {
|
|
1263
|
-
static formAssociated = !0;
|
|
1264
|
-
static styles = i`
|
|
1265
|
-
@font-face {
|
|
1266
|
-
font-family: 'Geist';
|
|
1267
|
-
src: url(${o(n)}) format('woff');
|
|
1268
|
-
font-weight: 100 900;
|
|
1269
|
-
font-style: normal;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
:host {
|
|
1273
|
-
display: block;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
select {
|
|
1277
|
-
display:flex;
|
|
1278
|
-
appearance: none;
|
|
1279
|
-
box-sizing: border-box;
|
|
1280
|
-
padding: 0 var(--input-horizontal-inline-padding);
|
|
1281
|
-
height: 40px;
|
|
1282
|
-
border-width: var(--input-border-width);
|
|
1283
|
-
border-style: var(--input-border-style);
|
|
1284
|
-
border-color: var(--input-border-color);
|
|
1285
|
-
border-radius: var(--input-border-radius);
|
|
1286
|
-
background-color: var(--input-background-color);
|
|
1287
|
-
color: var(--input-text-color);
|
|
1288
|
-
width: var(--input-width);
|
|
1289
|
-
font-size: var(--input-font-size);
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
select:disabled {
|
|
1293
|
-
background-color: var(--input-background-color-disabled);
|
|
1294
|
-
color: var(--input-text-color-disabled);
|
|
1295
|
-
border-color: var(--input-border-color-disabled);
|
|
1296
|
-
cursor: not-allowed;
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
select:disabled:hover {
|
|
1300
|
-
outline: none;
|
|
1301
|
-
border-color: var(--input-border-color-disabled);
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
select:hover {
|
|
1305
|
-
border-color: var(--input-border-color-hover);
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
select:focus {
|
|
1309
|
-
background-color: var(--input-background-color-focus);
|
|
1310
|
-
color: var(--input-text-color-focus);
|
|
1311
|
-
outline: 2px solid var(--input-border-color-focus);
|
|
1312
|
-
border: 1px solid var(--input-border-color-focus);
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
select.input-error {
|
|
1316
|
-
border-color: var(--input-error-border-color);
|
|
1317
|
-
color: var(--input-error-border-color);
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
select.input-error:hover {
|
|
1321
|
-
border-color: var(--input-error-border-hover-color);
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
select.input-error:focus {
|
|
1325
|
-
border-color: var(--input-error-border-color);
|
|
1326
|
-
outline: 2px solid var(--input-error-border-color);
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
.full-width {
|
|
1330
|
-
min-width: 100%;
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
.select-icon {
|
|
1334
|
-
position: absolute;
|
|
1335
|
-
right: 10px;
|
|
1336
|
-
top: 50%;
|
|
1337
|
-
transform: translateY(-50%);
|
|
1338
|
-
pointer-events: none;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
.container {
|
|
1342
|
-
position: relative;
|
|
1343
|
-
display: flex;
|
|
1344
|
-
align-items: center;
|
|
1345
|
-
gap: var(--input-select-gap, 8px);
|
|
1346
|
-
width: fit-content;
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
.lg {
|
|
1350
|
-
height: 50px;
|
|
1351
|
-
padding: 0 var(--input-horizontal-inline-padding-lg, 24px);
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
.sm {
|
|
1355
|
-
height: 36px;
|
|
1356
|
-
padding: 0 var(--input-horizontal-inline-padding-sm, 12px);
|
|
1357
|
-
}
|
|
1358
|
-
`;
|
|
1359
|
-
static properties = {
|
|
1360
|
-
name: {
|
|
1361
|
-
type: String
|
|
1362
|
-
},
|
|
1363
|
-
value: {
|
|
1364
|
-
type: String
|
|
1365
|
-
},
|
|
1366
|
-
disabled: {
|
|
1367
|
-
type: Boolean,
|
|
1368
|
-
reflect: !0
|
|
1369
|
-
},
|
|
1370
|
-
required: {
|
|
1371
|
-
type: Boolean,
|
|
1372
|
-
reflect: !0
|
|
1373
|
-
},
|
|
1374
|
-
error: {
|
|
1375
|
-
type: Boolean,
|
|
1376
|
-
reflect: !0
|
|
1377
|
-
},
|
|
1378
|
-
placeholder: {
|
|
1379
|
-
type: String
|
|
1380
|
-
},
|
|
1381
|
-
fullWidth: {
|
|
1382
|
-
type: Boolean,
|
|
1383
|
-
attribute: "full-width",
|
|
1384
|
-
reflect: !0
|
|
1385
|
-
},
|
|
1386
|
-
size: {
|
|
1387
|
-
type: String,
|
|
1388
|
-
reflect: !0,
|
|
1389
|
-
attribute: "size",
|
|
1390
|
-
converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md"
|
|
1391
|
-
},
|
|
1392
|
-
_internals: {
|
|
1393
|
-
type: Object,
|
|
1394
|
-
attribute: !1
|
|
1395
|
-
}
|
|
1396
|
-
};
|
|
1397
|
-
constructor() {
|
|
1398
|
-
super(), this.name = void 0, this.value = void 0, this.disabled = !1, this.required = !1, this.error = !1, this.placeholder = void 0, this.fullWidth = !1, this._internals = this.attachInternals();
|
|
1399
|
-
}
|
|
1400
|
-
render() {
|
|
1401
|
-
return t`
|
|
1402
|
-
<div class='container ${this.fullWidth ? "full-width" : ""}'>
|
|
1403
|
-
<select
|
|
1404
|
-
name="${l(this.name)}"
|
|
1405
|
-
?disabled="${this.disabled}"
|
|
1406
|
-
?required="${this.required}"
|
|
1407
|
-
class="${this.error ? "input-error" : ""} ${this.size} ${this.fullWidth ? "full-width" : ""}"
|
|
1408
|
-
@change="${this.handleChange}"
|
|
1409
|
-
>
|
|
1410
|
-
${this.placeholder ? t`<option value="" disabled selected>${this.placeholder}</option>` : ""}
|
|
1411
|
-
<slot></slot>
|
|
1412
|
-
</select>
|
|
1413
|
-
<cd-icon name="caret-down" class="select-icon" size='xxs'></cd-icon>
|
|
1414
|
-
</div>
|
|
1415
|
-
`;
|
|
1416
|
-
}
|
|
1417
|
-
firstUpdated() {
|
|
1418
|
-
const e = this.querySelectorAll("option"), s = this.shadowRoot.querySelector("select");
|
|
1419
|
-
e.forEach((c) => s.appendChild(c.cloneNode(!0))), e.forEach((c) => c.remove()), this.disabled && (this.shadowRoot.querySelector("cd-icon").color = "var(--input-text-color-disabled)"), this.error && (this.shadowRoot.querySelector("cd-icon").color = "var(--input-error-border-color)");
|
|
1420
|
-
}
|
|
1421
|
-
selectOption(e) {
|
|
1422
|
-
const s = this.shadowRoot.querySelector("select");
|
|
1423
|
-
s.value = e, this.value = e, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1424
|
-
detail: {
|
|
1425
|
-
value: this.value
|
|
1426
|
-
}
|
|
1427
|
-
}));
|
|
1428
|
-
}
|
|
1429
|
-
reset() {
|
|
1430
|
-
const e = this.shadowRoot.querySelector("select");
|
|
1431
|
-
e.value = "", this.value = "", this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1432
|
-
detail: {
|
|
1433
|
-
value: this.value
|
|
1434
|
-
}
|
|
1435
|
-
}));
|
|
1436
|
-
}
|
|
1437
|
-
handleChange(e) {
|
|
1438
|
-
this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1439
|
-
detail: {
|
|
1440
|
-
value: this.value
|
|
1441
|
-
}
|
|
1442
|
-
}));
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
function L() {
|
|
1446
|
-
typeof window < "u" && !customElements.get("cd-select") && customElements.define("cd-select", E);
|
|
1447
|
-
}
|
|
1448
3
|
export {
|
|
1449
|
-
|
|
1450
|
-
|
|
4
|
+
r as Badge,
|
|
5
|
+
t as Body,
|
|
1451
6
|
g as Checkbox,
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
7
|
+
i as Counter,
|
|
8
|
+
o as DataObject,
|
|
9
|
+
n as ErrorMessage,
|
|
10
|
+
l as FlexContainer,
|
|
11
|
+
c as Icon,
|
|
12
|
+
d as Informational,
|
|
13
|
+
m as Key,
|
|
14
|
+
y as KeyValue,
|
|
15
|
+
C as Label,
|
|
16
|
+
I as NavImage,
|
|
17
|
+
b as Radio,
|
|
18
|
+
p as Select,
|
|
19
|
+
u as Spinner,
|
|
20
|
+
x as Tag,
|
|
21
|
+
B as registerBadge,
|
|
22
|
+
K as registerBody,
|
|
23
|
+
S as registerCheckbox,
|
|
24
|
+
f as registerCounter,
|
|
25
|
+
h as registerDataObject,
|
|
26
|
+
j as registerErrorMessage,
|
|
27
|
+
k as registerFlexContainer,
|
|
28
|
+
v as registerIcon,
|
|
29
|
+
D as registerInformational,
|
|
30
|
+
E as registerKey,
|
|
31
|
+
F as registerKeyValue,
|
|
32
|
+
L as registerLabel,
|
|
33
|
+
N as registerNavImage,
|
|
34
|
+
R as registerRadio,
|
|
35
|
+
T as registerSelect,
|
|
36
|
+
M as registerSpinner,
|
|
37
|
+
O as registerTag
|
|
1483
38
|
};
|
|
1484
39
|
//# sourceMappingURL=index.es.js.map
|