@cargosense/cargo-design-system 1.0.1 → 1.0.4
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/README.md +18 -0
- package/dist/assets/Counter.cjs.js +24 -24
- package/dist/assets/Counter.cjs.js.map +1 -1
- package/dist/assets/Counter.es.js +297 -337
- package/dist/assets/Counter.es.js.map +1 -1
- package/dist/atoms/index.cjs.js +131 -131
- package/dist/atoms/index.cjs.js.map +1 -1
- package/dist/atoms/index.es.js +659 -645
- package/dist/atoms/index.es.js.map +1 -1
- package/dist/molecules/index.cjs.js +120 -120
- package/dist/molecules/index.cjs.js.map +1 -1
- package/dist/molecules/index.es.js +1054 -1040
- package/dist/molecules/index.es.js.map +1 -1
- package/package.json +4 -3
- package/src/components/index.js +0 -7
package/dist/atoms/index.cjs.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
<span class="badge ${this.status}">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</span>
|
|
5
|
-
`}}r(l,"styles",e.i$1`
|
|
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`
|
|
6
2
|
@font-face {
|
|
7
3
|
font-family: 'Geist';
|
|
8
4
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -53,13 +49,11 @@
|
|
|
53
49
|
.none::before {
|
|
54
50
|
content: none;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</div>
|
|
62
|
-
`}}r(c,"styles",e.i$1`
|
|
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`
|
|
63
57
|
@font-face {
|
|
64
58
|
font-family: 'Geist';
|
|
65
59
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -102,13 +96,13 @@
|
|
|
102
96
|
max-width: 100%;
|
|
103
97
|
max-height: 100%;
|
|
104
98
|
}
|
|
105
|
-
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</
|
|
111
|
-
`}}
|
|
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`
|
|
112
106
|
@font-face {
|
|
113
107
|
font-family: 'Geist';
|
|
114
108
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -147,12 +141,13 @@
|
|
|
147
141
|
text-decoration: none;
|
|
148
142
|
color: inherit;
|
|
149
143
|
}
|
|
150
|
-
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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`
|
|
156
151
|
@font-face {
|
|
157
152
|
font-family: 'Geist';
|
|
158
153
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -180,9 +175,12 @@
|
|
|
180
175
|
font-weight: var(--key-value-value-font-weight);
|
|
181
176
|
}
|
|
182
177
|
|
|
183
|
-
|
|
184
|
-
<
|
|
185
|
-
|
|
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`
|
|
186
184
|
@font-face {
|
|
187
185
|
font-family: 'Geist';
|
|
188
186
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -195,22 +193,9 @@
|
|
|
195
193
|
font-weight: var(--key-value-label-font-weight);
|
|
196
194
|
font-size: var(--key-value-font-size, 14px);
|
|
197
195
|
}
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
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`
|
|
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`
|
|
214
199
|
@font-face {
|
|
215
200
|
font-family: 'Geist';
|
|
216
201
|
src: url(${e.r("fonts/Geist-Regular.woff")}) format('woff');
|
|
@@ -260,11 +245,22 @@
|
|
|
260
245
|
transform: rotate(360deg);
|
|
261
246
|
}
|
|
262
247
|
}
|
|
263
|
-
|
|
264
|
-
<div class="
|
|
265
|
-
<
|
|
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>
|
|
266
262
|
</div>
|
|
267
|
-
`}}
|
|
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`
|
|
268
264
|
@font-face {
|
|
269
265
|
font-family: 'Geist';
|
|
270
266
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -278,24 +274,11 @@
|
|
|
278
274
|
width: 100%;
|
|
279
275
|
height: 100%;
|
|
280
276
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
<div class='label-text'>
|
|
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};">
|
|
285
279
|
<slot></slot>
|
|
286
|
-
${this.description?e.x`<span class='description'>${this.description}</span>`:""}
|
|
287
280
|
</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`
|
|
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`
|
|
299
282
|
@font-face {
|
|
300
283
|
font-family: 'Geist';
|
|
301
284
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -447,12 +430,24 @@
|
|
|
447
430
|
outline-offset: 2px;
|
|
448
431
|
border-radius: var(--input-checkbox-border-radius-md, 4px);
|
|
449
432
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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'>
|
|
453
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>
|
|
454
446
|
</div>
|
|
455
|
-
|
|
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`
|
|
456
451
|
@font-face {
|
|
457
452
|
font-family: 'Geist';
|
|
458
453
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -466,16 +461,12 @@
|
|
|
466
461
|
display:block;
|
|
467
462
|
|
|
468
463
|
}
|
|
469
|
-
|
|
470
|
-
<
|
|
471
|
-
class="${this.disabled?"disabled":""}"
|
|
472
|
-
for="${e.o(this.for)}"
|
|
473
|
-
>
|
|
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}">
|
|
474
466
|
${this.text}
|
|
475
467
|
<slot></slot>
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
`}}r(g,"styles",e.i$1`
|
|
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`
|
|
479
470
|
@font-face {
|
|
480
471
|
font-family: 'Geist';
|
|
481
472
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -497,12 +488,16 @@
|
|
|
497
488
|
.required {
|
|
498
489
|
color: var(--input-required-color, #FF5630);
|
|
499
490
|
}
|
|
500
|
-
|
|
501
|
-
<
|
|
502
|
-
|
|
503
|
-
${
|
|
504
|
-
|
|
505
|
-
|
|
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`
|
|
506
501
|
@font-face {
|
|
507
502
|
font-family: 'Geist';
|
|
508
503
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -535,14 +530,12 @@
|
|
|
535
530
|
color: var(--input-success-color, green);
|
|
536
531
|
}
|
|
537
532
|
|
|
538
|
-
|
|
539
|
-
<
|
|
540
|
-
<slot name=
|
|
541
|
-
</slot
|
|
542
|
-
|
|
543
|
-
|
|
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`
|
|
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`
|
|
546
539
|
@font-face {
|
|
547
540
|
font-family: 'Geist';
|
|
548
541
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -619,28 +612,14 @@
|
|
|
619
612
|
min-height: var(--tag-large, 32px);
|
|
620
613
|
gap: var(--tag-gap-lg, 8px);
|
|
621
614
|
}
|
|
622
|
-
|
|
623
|
-
<
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
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`
|
|
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`
|
|
644
623
|
@font-face {
|
|
645
624
|
font-family: 'Geist';
|
|
646
625
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -665,9 +644,9 @@
|
|
|
665
644
|
input[type="radio"] {
|
|
666
645
|
appearance: none;
|
|
667
646
|
-webkit-appearance: none;
|
|
668
|
-
width: var(--input-
|
|
669
|
-
height: var(--input-
|
|
670
|
-
border-radius: var(--input-border-radius, 50%);
|
|
647
|
+
width: var(--input-radio-size, 20px);
|
|
648
|
+
height: var(--input-radio-size, 20px);
|
|
649
|
+
border-radius: var(--input-radio-border-radius, 50%);
|
|
671
650
|
margin: 0;
|
|
672
651
|
padding: 0;
|
|
673
652
|
border: 1px solid var(--input-border-color, #8E98A4);
|
|
@@ -750,21 +729,28 @@
|
|
|
750
729
|
cursor: pointer;
|
|
751
730
|
|
|
752
731
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
<
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
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`
|
|
768
754
|
@font-face {
|
|
769
755
|
font-family: 'Geist';
|
|
770
756
|
src: url(${e.r(e.fontURL)}) format('woff');
|
|
@@ -858,5 +844,19 @@
|
|
|
858
844
|
height: 36px;
|
|
859
845
|
padding: 0 var(--input-horizontal-inline-padding-sm, 12px);
|
|
860
846
|
}
|
|
861
|
-
|
|
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;
|
|
862
862
|
//# sourceMappingURL=index.cjs.js.map
|