@cargosense/cargo-design-system 1.0.1 → 1.0.5

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