@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.
@@ -1,862 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../assets/Counter.cjs.js");require("../fonts/index.cjs.js");class a extends e.i{static styles=e.i$1`
2
- @font-face {
3
- font-family: 'Geist';
4
- src: url(${e.r(e.fontURL)}) format('woff');
5
- font-weight: 100 900;
6
- font-style: normal;
7
- }
8
-
9
- .badge {
10
- background-color: var(--badge-background-color);
11
- color: var(--badge-text-color);
12
- font-size: var(--badge-text-size, 14px);
13
- font-weight: var(--badge-text-weight, 500);
14
- border-radius: var(--badge-border-radius, 16px);
15
- padding: var(--badge-padding, 1px 8px);
16
- display: inline-flex;
17
- align-items: center;
18
- text-align: center;
19
- border: 1px solid var(--badge-border-color, #D6D7D9);
20
- }
21
-
22
-
23
-
24
- .badge::before {
25
- content: '';
26
- display: inline-block;
27
- width: 8px;
28
- height: 8px;
29
- margin-right: 4px;
30
- border-radius: 50%;
31
- background-color: var(--badge-dot-color, #1C1C1C);
32
- }
33
- .done {
34
- --badge-dot-color: #1C1C1C;
35
- }
36
-
37
- .error {
38
- --badge-dot-color: #E53E3E;
39
- }
40
-
41
- .warning {
42
- --badge-dot-color: #D97E28;
43
- }
44
-
45
- .pending {
46
- --badge-dot-color: #43B620;
47
- }
48
-
49
- .none::before {
50
- content: none;
51
- }
52
- `;static properties={status:{type:String,reflect:!0,attribute:"status",defaultValue:"none"}};constructor(){super(),this.status="none"}render(){return e.x`
53
- <span class="badge ${this.status}">
54
- <slot></slot>
55
- </span>
56
- `}}function x(){typeof window<"u"&&!customElements.get("cd-badge")&&customElements.define("cd-badge",a)}class n extends e.i{static styles=e.i$1`
57
- @font-face {
58
- font-family: 'Geist';
59
- src: url(${e.r(e.fontURL)}) format('woff');
60
- font-weight: 100 900;
61
- font-style: normal;
62
- }
63
-
64
- :host {
65
- flex-grow: 1;
66
- }
67
-
68
- .body {
69
- font-family: 'Geist', sans-serif;
70
- display:flex;
71
- height: 100%;
72
- width: 100%;
73
-
74
- background-color: var(--body-background-color, var(--base-color-slate-50));
75
- }
76
-
77
- .content {
78
- margin: var(--body-content-margin, 28px);
79
- display: flex;
80
- flex-grow: 1;
81
- flex-direction: row;
82
- background-color: var(--body-content-background-color, var(--base-color-white));
83
- border-radius: 8px;
84
- border: 1px solid var(--body-content-border-color, var(--base-color-slate-200));
85
- }
86
-
87
- .fit-content {
88
- align-items: center;
89
- justify-content: center;
90
- }
91
-
92
- .fit-content .content {
93
- width: fit-content;
94
- height: fit-content;
95
- flex-grow: 0;
96
- max-width: 100%;
97
- max-height: 100%;
98
- }
99
- `;static properties={fitContent:{type:Boolean,reflect:!0,attribute:"fit-content"}};constructor(){super(),this.fitContent=!1}render(){return e.x`
100
- <div class="body${this.fitContent?" fit-content":""}">
101
- <div class="content">
102
- <slot><slot>
103
- </div>
104
- </div>
105
- `}}function k(){typeof window<"u"&&!customElements.get("cd-body")&&customElements.define("cd-body",n)}class s extends e.i{static styles=e.i$1`
106
- @font-face {
107
- font-family: 'Geist';
108
- src: url(${e.r(e.fontURL)}) format('woff');
109
- font-weight: 100 900;
110
- font-style: normal;
111
- }
112
-
113
- .default {
114
- font-family: 'Geist';
115
- display: inline-flex;
116
- flex-direction: row;
117
- align-items: center;
118
- padding: var(--data-object-vertical-padding) var(--data-object-horizontal-padding);
119
- background-color: var(--data-object-background-color);
120
- color: var(--data-object-text-color);
121
- border-radius: var(--data-object-border-radius);
122
- gap: var(--data-object-gap);
123
- font-size: var(--data-object-size);
124
- font-weight: var(--data-object-font-weight, 400);
125
- --icon-stroke: var(--data-object-icon-color, var(--text-primary-color));
126
- cursor: pointer;
127
- }
128
-
129
- .default:hover {
130
- background-color: var(--data-object-hover-background-color, var(--base-color-teal-100));
131
- transition: background 0.3s ease-in-out;
132
- }
133
-
134
- .default:focus {
135
- outline: 2px solid var(--input-border-color-focus);
136
- border: none;
137
- outline-offset: 0;
138
- }
139
-
140
- a {
141
- text-decoration: none;
142
- color: inherit;
143
- }
144
- `;static properties={link:{type:String,reflect:!0}};constructor(){super(),this.variant="",this.link=void 0}render(){return e.x`
145
- <a href="${e.o(this.link)}" class="default ${this.variant}" tabindex="0">
146
- <slot name="start"></slot>
147
- <slot></slot>
148
- <slot name="end"></slot>
149
- </a>
150
- `}}function w(){typeof window<"u"&&!customElements.get("cd-data-object")&&customElements.define("cd-data-object",s)}class l extends e.i{static styles=e.i$1`
151
- @font-face {
152
- font-family: 'Geist';
153
- src: url(${e.r(e.fontURL)}) format('woff');
154
- font-weight: 100 900;
155
- font-style: normal;
156
- }
157
-
158
- .key-value {
159
- font-family: 'Geist', sans-serif;
160
- display: flex;
161
- flex-direction: row;
162
- align-items: center;
163
- font-size: var(--key-value-font-size, 14px);
164
- gap: var(--key-value-gap, 10px);
165
- }
166
-
167
- .key {
168
- flex-grow: 1;
169
- color: var(--key-value-label-color, var(--text-secondary-color));
170
- font-weight: var(--key-value-label-font-weight);
171
- }
172
-
173
- .value {
174
- color: var(--key-value-value-color, var(--text-primary-color));
175
- font-weight: var(--key-value-value-font-weight);
176
- }
177
-
178
- `;static properties={key:{type:String,reflect:!0},value:{type:String,reflect:!0}};constructor(){super(),this.key="",this.value=""}render(){return e.x`
179
- <div class="key-value">
180
- <span class="key">${this.key}</span>
181
- ${this.value===""?e.x`<slot class="value"></slot>`:e.x`<span class="value">${this.value}</span>`}
182
- </div>
183
- `}}function $(){typeof window<"u"&&!customElements.get("cd-key-value")&&customElements.define("cd-key-value",l)}class c extends e.i{static styles=e.i$1`
184
- @font-face {
185
- font-family: 'Geist';
186
- src: url(${e.r(e.fontURL)}) format('woff');
187
- font-weight: 100 900;
188
- font-style: normal;
189
- }
190
-
191
- .key {
192
- color: var(--key-value-label-color, var(--text-secondary-color));
193
- font-weight: var(--key-value-label-font-weight);
194
- font-size: var(--key-value-font-size, 14px);
195
- }
196
- `;static properties={key:{type:String,reflect:!0}};constructor(){super(),this.key=""}render(){return e.x`
197
- <span class="key"><slot></slot></span>
198
- `}}function E(){typeof window<"u"&&!customElements.get("cd-key")&&customElements.define("cd-key",c)}class d extends e.i{static styles=e.i$1`
199
- @font-face {
200
- font-family: 'Geist';
201
- src: url(${e.r("fonts/Geist-Regular.woff")}) format('woff');
202
- font-weight: 100 900;
203
- font-style: normal;
204
- }
205
-
206
- .sm svg {
207
- width: 20px;
208
- height: 20px;
209
- }
210
-
211
- .md svg {
212
- width: 40px;
213
- height: 40px;
214
- }
215
-
216
- .lg svg{
217
- width: 60px;
218
- height: 60px;
219
- }
220
-
221
- .spinner {
222
- animation: spin 1s linear infinite;
223
- }
224
-
225
- .default {
226
- --spinner-stroke: var(--base-color-slate-900);
227
- }
228
-
229
- .classic {
230
- --spinner-stroke: var(--base-color-teal-600);
231
- }
232
-
233
- .secondary {
234
- --spinner-stroke: var(--base-color-slate-50);
235
- }
236
-
237
- .path {
238
- stroke-dasharray: 90, 150;
239
- stroke-dashoffset: 0;
240
- transform-origin: center;
241
- }
242
-
243
- @keyframes spin {
244
- 100% {
245
- transform: rotate(360deg);
246
- }
247
- }
248
- `;static properties={size:{type:String,reflect:!0,attribute:"size",converter:t=>["sm","md","lg"].includes(t)?t:"md",defaultValue:"md"},color:{type:String,reflect:!0,attribute:"color",converter:t=>["default","classic","secondary"].includes(t)?t:"default",defaultValue:"default"},ariaLabel:{type:String,reflect:!0,attribute:"aria-label",defaultValue:"Loading"}};constructor(){super(),this.size="md",this.color="default"}render(){return e.x`
249
- <div class="${this.size} ${this.color}" aria-label=${this.ariaLabel}>
250
- <svg class="spinner" viewBox="0 0 50 50" width="40" height="40">
251
- <circle
252
- class="path"
253
- cx="25"
254
- cy="25"
255
- r="20"
256
- fill="none"
257
- stroke="var(--spinner-stroke)"
258
- stroke-width="4"
259
- stroke-linecap="round"
260
- />
261
- </svg>
262
- </div>
263
- `}}function C(){typeof window<"u"&&!customElements.get("cd-spinner")&&customElements.define("cd-spinner",d)}class u extends e.i{static styles=e.i$1`
264
- @font-face {
265
- font-family: 'Geist';
266
- src: url(${e.r(e.fontURL)}) format('woff');
267
- font-weight: 100 900;
268
- font-style: normal;
269
- }
270
-
271
- .container {
272
- display: flex;
273
- flex-direction: column;
274
- width: 100%;
275
- height: 100%;
276
- }
277
- `;static properties={direction:{type:String,reflect:!0,attribute:"direction",converter:{fromAttribute(t){return t||"column"},toAttribute(t){return t}}},align:{type:String,reflect:!0,attribute:"align",converter:{fromAttribute(t){return t||"stretch"},toAttribute(t){return t}}},gap:{type:String,reflect:!0,attribute:"gap",converter:{fromAttribute(t){return t||"0px"},toAttribute(t){return t}}},justify:{type:String,reflect:!0,attribute:"justify",converter:{fromAttribute(t){return t||"flex-start"},toAttribute(t){return t}}}};constructor(){super()}render(){return e.x`
278
- <div class="container" style="flex-direction: ${this.direction}; align-items: ${this.align}; gap: ${this.gap}; justify-content: ${this.justify};">
279
- <slot></slot>
280
- </div>
281
- `}}function z(){typeof window<"u"&&!customElements.get("cd-flex-container")&&customElements.define("cd-flex-container",u)}class p extends e.i{static formAssociated=!0;static styles=e.i$1`
282
- @font-face {
283
- font-family: 'Geist';
284
- src: url(${e.r(e.fontURL)}) format('woff');
285
- font-weight: 100 900;
286
- font-style: normal;
287
- }
288
-
289
- .container {
290
- display: flex;
291
- align-items: center;
292
- flex-direction: row-reverse;
293
- position: relative;
294
- min-height: var(--input-checkbox-size-md, 20px);
295
- gap: var(--input-checkbox-gap, 10px);
296
- width: fit-content;
297
- }
298
-
299
- label {
300
- font-family: var(--font-family, 'Geist');
301
- font-weight: var(--font-weight, 400);
302
- font-size: var(--font-size, 14px);
303
- color: var(--text-primary-color);
304
- cursor: pointer;
305
- user-select: none;
306
- }
307
-
308
- .container input {
309
- position: absolute;
310
- opacity: 0;
311
- cursor: pointer;
312
- height: 0;
313
- width: 0;
314
- }
315
-
316
- .checkmark {
317
- height: var(--input-checkbox-size-md, 20px);
318
- width: var(--input-checkbox-size-md, 20px);
319
- border-radius: var(--input-checkbox-border-radius-md, 4px);
320
- background-color: var(--input-background-color);
321
- border: 1px solid var(--input-border-color, #8E98A4);
322
-
323
-
324
- display: flex;
325
- align-items: center;
326
- justify-content: center;
327
- box-sizing: border-box;
328
- }
329
-
330
- .checkmark cd-icon {
331
- display: none;
332
- }
333
-
334
- .container:hover .active.checkmark {
335
-
336
- background-color: var(--ui-interactive-primary-background-hover, #0F665F);
337
- border: 1px solid var(--ui-interactive-primary-border-hover, #013333);
338
- }
339
-
340
- .container:hover .checkmark {
341
- background-color: var(--input-background-color, #F1F4F6);
342
- border: 1px solid var(--input-border-color, #8E98A4);
343
- transition: background-color 0.2s ease, border-color 0.2s ease;
344
- }
345
-
346
- .active.checkmark {
347
- background-color: var(--ui-interactive-primary-background, #1B1F23);
348
- border: 1px solid var(--ui-interactive-primary-border, #0C0E0F);
349
- }
350
- .active.checkmark cd-icon {
351
- display: block;
352
- }
353
-
354
- .container input[type="checkbox"]:disabled ~ .checkmark {
355
- background-color: var(--input-background-color-disabled, #E1E5EA);
356
- border: 1px solid var(--input-border-color-disabled, #C5CCD3);
357
- }
358
-
359
- .container:hover input[type="checkbox"]:disabled ~ .checkmark {
360
- background-color: var(--input-background-color-disabled, #E1E5EA) !important;
361
- border: 1px solid var(--input-border-color-disabled, #C5CCD3) !important;
362
-
363
- }
364
-
365
- .disabled .label-text {
366
- color: var(--ui-disabled-color, #A9B2BC);
367
- cursor: not-allowed;
368
- }
369
-
370
- .checkmark:focus {
371
- outline: 2px solid var(--ui-focus-color, #0F665F);
372
- border-width: 0;
373
- }
374
-
375
- .disabled .checkmark:focus {
376
- outline: none;
377
- border-width: 0;
378
- }
379
-
380
- .container input[type="checkbox"] ~ .error {
381
- border-color: var(--input-error-border-color);
382
- color: var(--input-error-border-color);
383
- }
384
-
385
- .container .active.error {
386
- background-color: var(--input-error-border-color);
387
- border-color: var(--input-error-border-color);
388
-
389
- }
390
- .container:hover input[type="checkbox"] ~ .error {
391
- border-color: var(--input-error-border-hover-color);
392
- }
393
-
394
- .container:hover .active.error {
395
- border-color: var(--input-error-border-hover-color);
396
- background-color: var(--input-error-border-hover-color);
397
- }
398
-
399
- .container input[type="checkbox"] ~ .error:focus {
400
- border-color: var(--input-error-border-color);
401
- outline: 2px solid var(--input-error-border-color);
402
- }
403
-
404
- .container.error {
405
- color: var(--input-error-border-color);
406
-
407
- }
408
-
409
- .label-text {
410
- display: flex;
411
- align-items: flex-start;
412
- flex-direction: column;
413
- gap: 2px;
414
- font-size: var(--input-label-font-size, 14px);
415
- color: var(--text-primary-color);
416
- }
417
-
418
- .description {
419
- color: var(--text-secondary-color);
420
- margin-top: 2px;
421
- font-size: var(--input-description-font-size, 13px);
422
- }
423
-
424
- .disabled .description {
425
- color: var(--ui-disabled-color, #A9B2BC);
426
- }
427
-
428
- .container:focus {
429
- outline: 2px solid var(--ui-focus-color, #0F665F);
430
- outline-offset: 2px;
431
- border-radius: var(--input-checkbox-border-radius-md, 4px);
432
- }
433
- `;static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},description:{type:String,reflect:!0},name:{type:String,reflect:!0},required:{type:Boolean,reflect:!0},value:{type:String,reflect:!0},error:{type:Boolean,reflect:!0}};constructor(){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()}render(){return e.x`
434
- <label ?disabled="${this.disabled}" for='${this.name|"checkbox"}' class='container ${this.disabled?"disabled":""} ${this.error?"error":""}' >
435
-
436
- <div class='label-text'>
437
- <slot></slot>
438
- ${this.description?e.x`<span class='description'>${this.description}</span>`:""}
439
- </div>
440
-
441
-
442
- <input type="checkbox" id='${this.name|"checkbox"}' name='${this.name|"checkbox"}' aria-describedby='${this.description|this.name|"checkbox"}' value='${e.o(this.value)}' ?checked="${this.checked}" ?disabled="${this.disabled}" @change="${this._onChange}" tabindex="-1">
443
-
444
- <div class='checkmark ${this.checked?"active":""} ${this.error?"error":""}' id='check' aria-describedby='${this.description|this.name|"checkbox"}' tabindex="${this.disabled?"-1":"0"}">
445
- <cd-icon name='check' size='xs' color='white'></cd-icon>
446
- </div>
447
- </label>
448
-
449
-
450
- `}_onChange(t){if(!this.disabled)return this.checked=t.target.checked,this._internals.setValidity({valid:!0}),this._internals.setFormValue(this.checked),this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0})),this.checked}setChecked(t){if(typeof t!="boolean")throw new TypeError("The checked parameter must be a boolean");this.checked=t,this._internals.setValidity({valid:t}),this._internals.setFormValue(t),this.dispatchEvent(new CustomEvent("change",{detail:{checked:t,value:this.value},bubbles:!0,composed:!0}))}firstUpdated(){this.disabled?this.shadowRoot.querySelector("cd-icon").color="#A9B2BC":this.shadowRoot.querySelector("#check").addEventListener("keydown",t=>{console.log("keydown event",t),(t.key==="Enter"||t.key===" ")&&(this.checked=!this.checked,this._internals.setValidity({valid:!this.checked}),this._internals.setFormValue(!this.checked),this.dispatchEvent(new CustomEvent("change",{detail:{checked:!this.checked,value:this.value},bubbles:!0,composed:!0})),this.requestUpdate())})}}function F(){typeof window<"u"&&!customElements.get("cd-checkbox")&&customElements.define("cd-checkbox",p)}class f extends e.i{static styles=e.i$1`
451
- @font-face {
452
- font-family: 'Geist';
453
- src: url(${e.r(e.fontURL)}) format('woff');
454
- font-weight: 100 900;
455
- font-style: normal;
456
- }
457
-
458
- .informational {
459
- font-size: var(--input-hint-font-size, 14px);
460
- color: var(input-hint-color, var(--text-secondary-color));
461
- display:block;
462
-
463
- }
464
- `;static properties={text:{type:String,reflect:!0},type:{type:String,reflect:!0}};constructor(){super(),this.text="",this.type="info"}render(){return e.x`
465
- <div class="informational ${this.type}">
466
- ${this.text}
467
- <slot></slot>
468
- </div>
469
- `}}function h(){typeof window<"u"&&!customElements.get("cd-information")&&customElements.define("cd-information",f)}class b extends e.i{static styles=e.i$1`
470
- @font-face {
471
- font-family: 'Geist';
472
- src: url(${e.r(e.fontURL)}) format('woff');
473
- font-weight: 100 900;
474
- font-style: normal;
475
- }
476
-
477
- label {
478
- font-family: 'Geist';
479
- font-size: var(--label-font-size, 14px);
480
- color: var(--text-primary-color);
481
- display: block;
482
- }
483
- .disabled slot {
484
- color: var(--ui-disabled-color, #A9B2BC);
485
- cursor: not-allowed;
486
- }
487
-
488
- .required {
489
- color: var(--input-required-color, #FF5630);
490
- }
491
- `;static properties={text:{type:String,reflect:!0},for:{type:String,reflect:!0,attribute:"for"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}};constructor(){super(),this.text=void 0,this.for=void 0,this.required=!1,this.disabled=!1}render(){return e.x`
492
- <label
493
- class="${this.disabled?"disabled":""}"
494
- for="${e.o(this.for)}"
495
- >
496
- ${this.text}
497
- <slot></slot>
498
- ${this.required?e.x`<span class="required">*</span>`:""}
499
- </label>
500
- `}}function S(){typeof window<"u"&&!customElements.get("cd-label")&&customElements.define("cd-label",b)}class g extends e.i{static styles=e.i$1`
501
- @font-face {
502
- font-family: 'Geist';
503
- src: url(${e.r(e.fontURL)}) format('woff');
504
- font-weight: 100 900;
505
- font-style: normal;
506
- }
507
-
508
- .error-message {
509
- font-family: 'Geist';
510
- display:flex;
511
- align-items: center;
512
- font-size: var(--input-error-font-size);
513
- gap: var(--error-message-gap, 8px);
514
- }
515
-
516
-
517
- .error {
518
- color: var(--input-error-color);
519
- }
520
-
521
- .warning {
522
- color: var(--input-warning-color, orange);
523
- }
524
-
525
- .normal {
526
- color: var(--text-primary-color);
527
- }
528
-
529
- .success {
530
- color: var(--input-success-color, green);
531
- }
532
-
533
- `;static properties={text:{type:String,reflect:!0},type:{type:String,reflect:!0}};constructor(){super(),this.text=void 0,this.type="error"}render(){return e.x`
534
- <div class="error-message ${this.type}">
535
- <slot name='icon'></slot>
536
- ${this.text?e.x`<span class="error-text">${this.text}</span>`:e.x`<slot></slot>`}
537
- </div>
538
- `}}function B(){typeof window<"u"&&!customElements.get("cd-error")&&customElements.define("cd-error",g)}class v extends e.i{static styles=e.i$1`
539
- @font-face {
540
- font-family: 'Geist';
541
- src: url(${e.r(e.fontURL)}) format('woff');
542
- font-weight: 100 900;
543
- font-style: normal;
544
- }
545
-
546
- .tag {
547
- font-family: 'Geist';
548
- display: inline-flex;
549
- align-items: center;
550
- border-radius: var(--tag-border-radius, 4px);
551
- padding: var(--tag-padding, 0 8px);
552
- min-height: var(--tag-medium, 27px);
553
- font-size: var(--tag-font-size, 14px);
554
- color: var(--tag-color, #fff);
555
- background-color: var(--tag-default-background-color, var(--base-color-slate-900));
556
- --icon-stroke: var(--tag-color, #000);
557
- cursor: pointer;
558
- user-select: none;
559
- gap: var(--tag-gap, 6px);
560
- }
561
-
562
- .tag.primary {
563
- background-color: var(--tag-primary-color, var(--base-color-teal-600));
564
- --icon-stroke: var(--tag-color, #000);
565
- }
566
-
567
- .tag.secondary {
568
- background-color: var(--tag-secondary-color, var(--base-color-slate-50));
569
- --icon-stroke: var(--tag-color, #000);
570
- color: var(--text-primary-color, #000);
571
- }
572
-
573
- .tag.link {
574
- background-color: var(--tag-link-color, var(--event-air-background));
575
- color: var(--tag-link-text-color, white);
576
- }
577
-
578
- .tag.info {
579
- background-color: var(--tag-secondary-color, var(--base-color-slate-200));
580
- --icon-stroke: var(--tag-color, #000);
581
- color: var(--text-primary-color, #000);
582
- }
583
-
584
- .tag.success {
585
- background-color: var(--tag-success-color, green);
586
- --icon-stroke: var(--tag-color, #000);
587
- }
588
-
589
- .tag.warning {
590
- background-color: var(--tag-warning-color, orange);
591
- --icon-stroke: var(--tag-color, #000);
592
- }
593
-
594
- .tag.danger {
595
- background-color: var(--tag-danger-color, red);
596
- --icon-stroke: var(--tag-color, #000);
597
- }
598
-
599
- .tag.disabled {
600
- background-color: var(--tag-disabled-background-color, var(--base-color-slate-400));
601
- color: var(--tag-disabled-color, var(--base-color-slate-200));
602
- cursor: not-allowed;
603
- pointer-events: none;
604
- }
605
-
606
- .sm {
607
- min-height: var(--tag-small, 24px);
608
- gap: var(--tag-gap-sm, 4px);
609
- }
610
-
611
- .lg {
612
- min-height: var(--tag-large, 32px);
613
- gap: var(--tag-gap-lg, 8px);
614
- }
615
- `;static properties={label:{type:String,reflect:!0},variant:{type:String,reflect:!0,converter:t=>["primary","secondary","default","link","info","success","warning","danger"].includes(t)?t:"default"},removable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},size:{type:String,reflect:!0,converter:t=>["sm","md","lg"].includes(t)?t:"md"}};constructor(){super(),this.label="",this.variant="primary",this.removable=!1,this.disabled=!1,this.size="md"}render(){return e.x`
616
- <span class="tag ${this.variant} ${this.size} ${this.disabled?"disabled":""}" @click='${this._handleClick}'>
617
- <slot name="icon">
618
- </slot>
619
- <span class="label">${this.label} <slot></slot></span>
620
- ${this.removable?e.x`<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>`:""}
621
- </span>
622
- `}_handleRemove(){this.disabled||(this.dispatchEvent(new CustomEvent("remove",{detail:{label:this.label},bubbles:!0,composed:!0})),this.remove())}setRemovable(t){this.removable=t}setDisabled(t){this.disabled=t}removeTag(){this.dispatchEvent(new CustomEvent("remove",{detail:{label:this.label},bubbles:!0,composed:!0})),this.remove()}_handleClick(){this.disabled||this.dispatchEvent(new CustomEvent("click",{detail:{label:this.label},bubbles:!0,composed:!0}))}}function q(){typeof window<"u"&&!customElements.get("cd-tag")&&customElements.define("cd-tag",v)}h();class m extends e.i{static formAssociated=!0;static styles=e.i$1`
623
- @font-face {
624
- font-family: 'Geist';
625
- src: url(${e.r(e.fontURL)}) format('woff');
626
- font-weight: 100 900;
627
- font-style: normal;
628
- }
629
- :host {
630
- display: inline-block;
631
- font-family: 'Geist', sans-serif;
632
- }
633
-
634
- .container {
635
- display: flex;
636
- align-items: center;
637
- flex-direction: row;
638
- gap: var(--input-radio-gap, 8px);
639
- font-size: var(--input-font-size, 14px);
640
- font-weight: var(--input-font-weight, 400);
641
- color: var(--input-text-color, #1B1F23);
642
- }
643
-
644
- input[type="radio"] {
645
- appearance: none;
646
- -webkit-appearance: none;
647
- width: var(--input-radio-size, 20px);
648
- height: var(--input-radio-size, 20px);
649
- border-radius: var(--input-radio-border-radius, 50%);
650
- margin: 0;
651
- padding: 0;
652
- border: 1px solid var(--input-border-color, #8E98A4);
653
- background-color: var(--input-background-color, #F1F4F6);
654
- cursor: pointer;
655
- }
656
-
657
- input[type="radio"]:hover {
658
- border-color: var(--input-border-color-hover, #5C6B7A);
659
- transition: border-color 0.2s ease-in-out;
660
- }
661
-
662
- input[type="radio"]:focus {
663
- border-color: var(--input-border-color-focus, #1B1F23);
664
- outline: 1px solid var(--input-border-color-focus, #1B1F23);
665
- outline-offset: 0;
666
- }
667
-
668
- input[type="radio"]:checked:focus {
669
- outline: 2px solid var(--input-border-color-focus, #1B1F23);
670
- outline-offset: 0;
671
- }
672
-
673
-
674
- input[type="radio"]:checked {
675
- background-color: var(--input-checked-background-color, #fff);
676
- border-width: 5px;
677
- border-color: var(--ui-interactive-primary-background, #1B1F23);
678
- outline: 1px solid var(--ui-interactive-primary-background, #1B1F23);
679
- box-sizing: border-box;
680
- }
681
-
682
- input[type="radio"]:checked:hover {
683
- border-color: var(--ui-interactive-primary-background-hover, #0F665F);
684
- transition: border-color 0.2s ease-in-out;
685
- }
686
-
687
- input[type="radio"]:disabled {
688
- background-color: var(--input-background-color-disabled, #E1E5EA);
689
- border-color: var(--input-border-color-disabled, #C5CCD3);
690
- cursor: not-allowed;
691
- }
692
-
693
- input[type="radio"]:checked:disabled {
694
- background-color: var(--base-color-white);
695
- border-color: var(--input-background-color-disabled, #E1E5EA);
696
- outline: var(--input-border-color-disabled, #C5CCD3);
697
- cursor: not-allowed;
698
- }
699
-
700
- input[type="radio"].input-error {
701
- border-color: var(--input-error-border-color, #FF4D4F);
702
- outline: 1px solid var(--input-error-border-color, #FF4D4F);
703
- }
704
-
705
- input[type="radio"].input-error:hover {
706
- border-color: var(--input-error-border-hover-color, #FF7875);
707
- outline: 1px solid var(--input-error-border-hover-color, #FF7875);
708
- }
709
- input[type="radio"].input-error:focus {
710
- border-color: var(--input-error-border-color, #FF4D4F);
711
- outline: 2px solid var(--input-error-border-color, #FF4D4F);
712
- }
713
-
714
- .input-error .radio-text {
715
- color: var(--input-error-border-color, #FF4D4F);
716
- }
717
-
718
-
719
-
720
- .disabled {
721
- color: var(--ui-disabled-color, #A9B2BC);
722
- cursor: not-allowed;
723
- }
724
-
725
-
726
- .radio-text {
727
- display: flex;
728
- flex-direction: column;
729
- cursor: pointer;
730
-
731
- }
732
- `;static properties={name:{type:String},value:{type:String},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},description:{type:String},error:{type:Boolean,reflect:!0},size:{type:String,reflect:!0},required:{type:Boolean,reflect:!0}};constructor(){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()}render(){return e.x`
733
- <label class="container ${this.size} ${this.disabled?"disabled":""} ${this.error?"input-error":""}" for="${this.name}">
734
- <input
735
- type="radio"
736
- class="${this.error?"input-error":""}"
737
- name=${this.name}
738
- .value="${this.value}"
739
- .checked="${this.checked}"
740
- ?disabled="${this.disabled}"
741
- @change="${this._handleChange}"
742
- @click="${this._select}"
743
- required="${this.required}"
744
- tabindex="0"
745
- >
746
- <div class='radio-text' @click="${this._handleLabelClick}">
747
-
748
- <slot></slot>
749
- <cd-information>${this.description}</cd-information>
750
- </div>
751
- </label>
752
-
753
- `}deselectAll(){document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach(o=>{o.checked=!1,o.dispatchEvent(new CustomEvent("change",{detail:{checked:!1},bubbles:!0,composed:!0}))})}_select(){document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach(o=>{o!==this&&(o.checked=!1)}),this.checked=!0,this.dispatchEvent(new CustomEvent("change",{detail:{checked:!0},bubbles:!0,composed:!0}))}_handleLabelClick(){this.disabled||this._select()}_handleChange(t){this.checked=t.target.checked,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent("change",{detail:{name:this.name,value:this.value,checked:this.checked},bubbles:!0,composed:!0}))}}const A=()=>{customElements.get("cd-radio")||customElements.define("cd-radio",m)};class y extends e.i{static formAssociated=!0;static styles=e.i$1`
754
- @font-face {
755
- font-family: 'Geist';
756
- src: url(${e.r(e.fontURL)}) format('woff');
757
- font-weight: 100 900;
758
- font-style: normal;
759
- }
760
-
761
- :host {
762
- display: block;
763
- }
764
-
765
- select {
766
- display:flex;
767
- appearance: none;
768
- box-sizing: border-box;
769
- padding: 0 var(--input-horizontal-inline-padding);
770
- height: 40px;
771
- border-width: var(--input-border-width);
772
- border-style: var(--input-border-style);
773
- border-color: var(--input-border-color);
774
- border-radius: var(--input-border-radius);
775
- background-color: var(--input-background-color);
776
- color: var(--input-text-color);
777
- width: var(--input-width);
778
- font-size: var(--input-font-size);
779
- }
780
-
781
- select:disabled {
782
- background-color: var(--input-background-color-disabled);
783
- color: var(--input-text-color-disabled);
784
- border-color: var(--input-border-color-disabled);
785
- cursor: not-allowed;
786
- }
787
-
788
- select:disabled:hover {
789
- outline: none;
790
- border-color: var(--input-border-color-disabled);
791
- }
792
-
793
- select:hover {
794
- border-color: var(--input-border-color-hover);
795
- }
796
-
797
- select:focus {
798
- background-color: var(--input-background-color-focus);
799
- color: var(--input-text-color-focus);
800
- outline: 2px solid var(--input-border-color-focus);
801
- border: 1px solid var(--input-border-color-focus);
802
- }
803
-
804
- select.input-error {
805
- border-color: var(--input-error-border-color);
806
- color: var(--input-error-border-color);
807
- }
808
-
809
- select.input-error:hover {
810
- border-color: var(--input-error-border-hover-color);
811
- }
812
-
813
- select.input-error:focus {
814
- border-color: var(--input-error-border-color);
815
- outline: 2px solid var(--input-error-border-color);
816
- }
817
-
818
- .full-width {
819
- min-width: 100%;
820
- }
821
-
822
- .select-icon {
823
- position: absolute;
824
- right: 10px;
825
- top: 50%;
826
- transform: translateY(-50%);
827
- pointer-events: none;
828
- }
829
-
830
- .container {
831
- position: relative;
832
- display: flex;
833
- align-items: center;
834
- gap: var(--input-select-gap, 8px);
835
- width: fit-content;
836
- }
837
-
838
- .lg {
839
- height: 50px;
840
- padding: 0 var(--input-horizontal-inline-padding-lg, 24px);
841
- }
842
-
843
- .sm {
844
- height: 36px;
845
- padding: 0 var(--input-horizontal-inline-padding-sm, 12px);
846
- }
847
- `;static properties={name:{type:String},value:{type:String},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},error:{type:Boolean,reflect:!0},placeholder:{type:String},fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},size:{type:String,reflect:!0,attribute:"size",converter:t=>["sm","md","lg"].includes(t)?t:"md"},_internals:{type:Object,attribute:!1}};constructor(){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()}render(){return e.x`
848
- <div class='container ${this.fullWidth?"full-width":""}'>
849
- <select
850
- name="${e.o(this.name)}"
851
- ?disabled="${this.disabled}"
852
- ?required="${this.required}"
853
- class="${this.error?"input-error":""} ${this.size} ${this.fullWidth?"full-width":""}"
854
- @change="${this.handleChange}"
855
- >
856
- ${this.placeholder?e.x`<option value="" disabled selected>${this.placeholder}</option>`:""}
857
- <slot></slot>
858
- </select>
859
- <cd-icon name="caret-down" class="select-icon" size='xxs'></cd-icon>
860
- </div>
861
- `}firstUpdated(){const t=this.querySelectorAll("option"),o=this.shadowRoot.querySelector("select");t.forEach(i=>o.appendChild(i.cloneNode(!0))),t.forEach(i=>i.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)")}selectOption(t){const o=this.shadowRoot.querySelector("select");o.value=t,this.value=t,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))}reset(){const t=this.shadowRoot.querySelector("select");t.value="",this.value="",this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))}handleChange(t){this.value=t.target.value,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))}}function R(){typeof window<"u"&&!customElements.get("cd-select")&&customElements.define("cd-select",y)}exports.Counter=e.Counter;exports.Icon=e.Icon;exports.NavImage=e.NavImage;exports.registerCounter=e.registerCounter;exports.registerIcon=e.registerIcon;exports.registerNavImage=e.registerNavImage;exports.Badge=a;exports.Body=n;exports.Checkbox=p;exports.DataObject=s;exports.ErrorMessage=g;exports.FlexContainer=u;exports.Informational=f;exports.Key=c;exports.KeyValue=l;exports.Label=b;exports.Radio=m;exports.Select=y;exports.Spinner=d;exports.Tag=v;exports.registerBadge=x;exports.registerBody=k;exports.registerCheckbox=F;exports.registerDataObject=w;exports.registerErrorMessage=B;exports.registerFlexContainer=z;exports.registerInformational=h;exports.registerKey=E;exports.registerKeyValue=$;exports.registerLabel=S;exports.registerRadio=A;exports.registerSelect=R;exports.registerSpinner=C;exports.registerTag=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../assets/index.cjs.js");require("../fonts/index.cjs.js");exports.Badge=e.Badge;exports.Body=e.Body;exports.Checkbox=e.Checkbox;exports.Counter=e.Counter;exports.DataObject=e.DataObject;exports.ErrorMessage=e.ErrorMessage;exports.FlexContainer=e.FlexContainer;exports.Icon=e.Icon;exports.Informational=e.Informational;exports.Key=e.Key;exports.KeyValue=e.KeyValue;exports.Label=e.Label;exports.NavImage=e.NavImage;exports.Radio=e.Radio;exports.Select=e.Select;exports.Spinner=e.Spinner;exports.Tag=e.Tag;exports.registerBadge=e.registerBadge;exports.registerBody=e.registerBody;exports.registerCheckbox=e.registerCheckbox;exports.registerCounter=e.registerCounter;exports.registerDataObject=e.registerDataObject;exports.registerErrorMessage=e.registerErrorMessage;exports.registerFlexContainer=e.registerFlexContainer;exports.registerIcon=e.registerIcon;exports.registerInformational=e.registerInformational;exports.registerKey=e.registerKey;exports.registerKeyValue=e.registerKeyValue;exports.registerLabel=e.registerLabel;exports.registerNavImage=e.registerNavImage;exports.registerRadio=e.registerRadio;exports.registerSelect=e.registerSelect;exports.registerSpinner=e.registerSpinner;exports.registerTag=e.registerTag;
862
2
  //# sourceMappingURL=index.cjs.js.map