@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.
@@ -1,46 +1,11 @@
1
- var C = Object.defineProperty;
2
- var _ = (i, t, e) => t in i ? C(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var r = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { r as c, i as a, c as n, f as s, d as l, o as h, x as o, a as q, b as B } from "../assets/Counter.es.js";
1
+ import { r as s, i as r, c as o, f as i, d as a, o as c, x as e, a as p, b as h } from "../assets/Counter.es.js";
5
2
  import "../fonts/index.es.js";
6
- c();
7
- class b extends a {
8
- firstUpdated() {
9
- const t = document.getElementById(this.form);
10
- this.shadowRoot.querySelector("button").addEventListener("click", () => {
11
- t instanceof HTMLFormElement && (console.log("Form found, submitting..."), t.requestSubmit());
12
- });
13
- }
14
- constructor() {
15
- super(), this.link = void 0, this.target = void 0, this.disabled = !1, this.size = "md", this.expand = "", this._variant = "primary", this.name = void 0, this.button = "button", this.form = void 0, this.square = "";
16
- }
17
- render() {
18
- return o`
19
- <a href='${h(this.link)}' target="${h(this.target)}" tabindex="-1" class="${this.expand}">
20
- <button form="${this.form}" type="${this.button}" class="button ${this.square} ${this.variant} ${this.size} ${this.expand} ${this.disabled ? "disabled" : ""}" .name="${this.name}" tabindex="${this.disabled ? "-1" : 0}" @click='${this.handleClick}'>
21
- <slot name='start'></slot> <slot></slot> <slot name='end'></slot>
22
- </button>
23
- </a> `;
24
- }
25
- handleClick(t) {
26
- if (this.disabled) {
27
- t.preventDefault(), t.stopPropagation();
28
- return;
29
- }
30
- this.dispatchEvent(new CustomEvent("button-click", {
31
- detail: {
32
- value: this.value,
33
- name: this.name
34
- },
35
- bubbles: !0,
36
- composed: !0
37
- }));
38
- }
39
- }
40
- r(b, "styles", l`
3
+ s();
4
+ class v extends r {
5
+ static styles = a`
41
6
  @font-face {
42
7
  font-family: 'Geist';
43
- src: url(${n(s)}) format('woff');
8
+ src: url(${o(i)}) format('woff');
44
9
  font-weight: 100 900;
45
10
  font-style: normal;
46
11
  }
@@ -153,90 +118,106 @@ r(b, "styles", l`
153
118
  outline: none;
154
119
  }
155
120
 
156
- `), r(b, "properties", {
157
- variant: {
158
- type: String,
159
- reflect: !0,
160
- converter: (t) => ["classic", "secondary", "primary"].includes(t) ? t : "classic"
161
- },
162
- size: {
163
- type: String,
164
- reflect: !0,
165
- attribute: "size",
166
- converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
167
- },
168
- disabled: {
169
- type: Boolean,
170
- reflect: !0,
171
- attribute: "disabled"
172
- },
173
- link: {
174
- type: String,
175
- reflect: !0,
176
- attribute: "link"
177
- },
178
- target: {
179
- type: String,
180
- reflect: !0,
181
- attribute: "target",
182
- converter: (t) => ["_blank", "_self", "_parent", "_top"].includes(t) ? t : "_self"
183
- },
184
- expand: {
185
- type: Boolean,
186
- reflect: !0,
187
- attribute: "full-width",
188
- converter: (t) => t == "" ? "expand" : ""
189
- },
190
- value: {
191
- type: String,
192
- reflect: !0,
193
- attribute: "value",
194
- defaultValue: ""
195
- },
196
- type: {
197
- type: String,
198
- reflect: !0,
199
- attribute: "type",
200
- converter: (t) => ["button", "submit", "reset"].includes(t) ? t : "button"
201
- },
202
- square: {
203
- type: Boolean,
204
- reflect: !0,
205
- attribute: "square",
206
- converter: (t) => t === "" ? "square" : ""
207
- },
208
- form: {
209
- type: String,
210
- reflect: !0,
211
- attribute: "form"
121
+ `;
122
+ static properties = {
123
+ variant: {
124
+ type: String,
125
+ reflect: !0,
126
+ converter: (t) => ["classic", "secondary", "primary"].includes(t) ? t : "classic"
127
+ },
128
+ size: {
129
+ type: String,
130
+ reflect: !0,
131
+ attribute: "size",
132
+ converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
133
+ },
134
+ disabled: {
135
+ type: Boolean,
136
+ reflect: !0,
137
+ attribute: "disabled"
138
+ },
139
+ link: {
140
+ type: String,
141
+ reflect: !0,
142
+ attribute: "link"
143
+ },
144
+ target: {
145
+ type: String,
146
+ reflect: !0,
147
+ attribute: "target",
148
+ converter: (t) => ["_blank", "_self", "_parent", "_top"].includes(t) ? t : "_self"
149
+ },
150
+ expand: {
151
+ type: Boolean,
152
+ reflect: !0,
153
+ attribute: "full-width",
154
+ converter: (t) => t == "" ? "expand" : ""
155
+ },
156
+ value: {
157
+ type: String,
158
+ reflect: !0,
159
+ attribute: "value",
160
+ defaultValue: ""
161
+ },
162
+ type: {
163
+ type: String,
164
+ reflect: !0,
165
+ attribute: "type",
166
+ converter: (t) => ["button", "submit", "reset"].includes(t) ? t : "button"
167
+ },
168
+ square: {
169
+ type: Boolean,
170
+ reflect: !0,
171
+ attribute: "square",
172
+ converter: (t) => t === "" ? "square" : ""
173
+ },
174
+ form: {
175
+ type: String,
176
+ reflect: !0,
177
+ attribute: "form"
178
+ }
179
+ };
180
+ firstUpdated() {
181
+ const t = document.getElementById(this.form);
182
+ this.shadowRoot.querySelector("button").addEventListener("click", () => {
183
+ t instanceof HTMLFormElement && (console.log("Form found, submitting..."), t.requestSubmit());
184
+ });
212
185
  }
213
- });
214
- function A() {
215
- typeof window < "u" && !customElements.get("cd-button") && customElements.define("cd-button", b);
216
- }
217
- c();
218
- class f extends a {
219
186
  constructor() {
220
- super(), this.icon = "", this.title = "";
187
+ super(), this.link = void 0, this.target = void 0, this.disabled = !1, this.size = "md", this.expand = "", this._variant = "primary", this.name = void 0, this.button = "button", this.form = void 0, this.square = "";
221
188
  }
222
189
  render() {
223
- return o`
224
- <header class="header">
225
- <div class='left'>
226
- <cd-icon name="${this.icon}" size="md"></cd-icon>
227
- <span class="title">${this.title}</span>
228
- </div>
229
- <div class='right'>
230
- <slot></slot>
231
- </div>
232
- </header>
233
- `;
190
+ return e`
191
+ <a href='${c(this.link)}' target="${c(this.target)}" tabindex="-1" class="${this.expand}">
192
+ <button form="${this.form}" type="${this.button}" class="button ${this.square} ${this.variant} ${this.size} ${this.expand} ${this.disabled ? "disabled" : ""}" .name="${this.name}" tabindex="${this.disabled ? "-1" : 0}" @click='${this.handleClick}'>
193
+ <slot name='start'></slot> <slot></slot> <slot name='end'></slot>
194
+ </button>
195
+ </a> `;
196
+ }
197
+ handleClick(t) {
198
+ if (this.disabled) {
199
+ t.preventDefault(), t.stopPropagation();
200
+ return;
201
+ }
202
+ this.dispatchEvent(new CustomEvent("button-click", {
203
+ detail: {
204
+ value: this.value,
205
+ name: this.name
206
+ },
207
+ bubbles: !0,
208
+ composed: !0
209
+ }));
234
210
  }
235
211
  }
236
- r(f, "styles", l`
212
+ function d() {
213
+ typeof window < "u" && !customElements.get("cd-button") && customElements.define("cd-button", v);
214
+ }
215
+ s();
216
+ class b extends r {
217
+ static styles = a`
237
218
  @font-face {
238
219
  font-family: 'Geist';
239
- src: url(${n(s)}) format('woff');
220
+ src: url(${o(i)}) format('woff');
240
221
  font-weight: 100 900;
241
222
  font-style: normal;
242
223
  }
@@ -273,87 +254,46 @@ r(f, "styles", l`
273
254
  padding: 0 16px;
274
255
 
275
256
  }
276
- `), r(f, "properties", {
277
- icon: {
278
- type: String,
279
- reflect: !0,
280
- attribute: "icon"
281
- },
282
- title: {
283
- type: String,
284
- reflect: !0,
285
- attribute: "title"
286
- }
287
- });
288
- function D() {
289
- !customElements.get("cd-header") && typeof window < "u" && customElements.define("cd-header", f);
290
- }
291
- c();
292
- class v extends a {
293
- handleKeyPress(t) {
294
- return this.dispatchEvent(new CustomEvent("keypress", {
295
- detail: {
296
- value: t.target.value,
297
- key: t.keyCode
298
- }
299
- })), t.key === "Enter" && this.dispatchEvent(new CustomEvent("onenter", {
300
- detail: {
301
- value: t.target.value
302
- }
303
- })), this.dispatchEvent(new CustomEvent("onkeyup", {
304
- detail: {
305
- value: t.target.value,
306
- key: t.keyCode
307
- }
308
- })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
309
- }
310
- handleInput(t) {
311
- return this.dispatchEvent(new CustomEvent("input", {
312
- detail: {
313
- value: t.target.value
314
- }
315
- })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
316
- }
317
- handleChange(t) {
318
- return this.dispatchEvent(new CustomEvent("onchange", {
319
- detail: {
320
- value: t.target.value
321
- }
322
- })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
323
- }
324
- handleFocus(t) {
325
- return this.dispatchEvent(new CustomEvent("onblur", {
326
- detail: {
327
- value: t.target.value
328
- }
329
- })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target;
330
- }
257
+ `;
258
+ static properties = {
259
+ icon: {
260
+ type: String,
261
+ reflect: !0,
262
+ attribute: "icon"
263
+ },
264
+ title: {
265
+ type: String,
266
+ reflect: !0,
267
+ attribute: "title"
268
+ }
269
+ };
331
270
  constructor() {
332
- super(), this.value = "", this.placeholder = "", this.pattern = "", this.variant = "solid", this.size = "md", this._internals = this.attachInternals();
271
+ super(), this.icon = "", this.title = "";
333
272
  }
334
273
  render() {
335
- return o`
336
- ${this.iconLeft ? o`<span class="icon-left-container"><cd-icon name="${this.iconLeft}" size="sm" class="icon-left"></cd-icon></span>` : ""}
337
- <input id='${this.name}' class="${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? " icon-spacing-right" : ""} ${this.disabled ? " disabled" : ""} ${this.error ? " input-error" : ""} ${this.fullWidth ? " full-width" : ""} ${this.variant === "dashed" ? " dashed" : this.variant == "dotted" ? " dotted" : ""} ${this.size}" type="${this.type}" placeholder="${this.placeholder}" ?required=${this.required} .value="${this.value}" ?readonly=${this.readOnly} ?disabled=${this.disabled} .pattern="${this.pattern}" @input="${this.handleInput}" @change="${this.handleChange}" @blur="${this.handleFocus}" @keypress=${this.handleKeyPress}/>
338
- ${this.iconRight ? o`<span class="icon-right-container"><cd-icon name="${this.iconRight}" size="sm" class="icon-right"></cd-icon></span>` : ""}
339
- `;
340
- }
341
- focus() {
342
- if (!this.shadowRoot) {
343
- console.warn("Input element is not yet connected to the DOM.");
344
- return;
345
- }
346
- if (!this.shadowRoot.querySelector("input")) {
347
- console.warn("Input element is not found in the shadow DOM.");
348
- return;
349
- }
350
- this.shadowRoot.querySelector("input").focus();
274
+ return e`
275
+ <header class="header">
276
+ <div class='left'>
277
+ <cd-icon name="${this.icon}" size="md"></cd-icon>
278
+ <span class="title">${this.title}</span>
279
+ </div>
280
+ <div class='right'>
281
+ <slot></slot>
282
+ </div>
283
+ </header>
284
+ `;
351
285
  }
352
286
  }
353
- r(v, "formAssociated", !0), r(v, "styles", l`
287
+ function T() {
288
+ !customElements.get("cd-header") && typeof window < "u" && customElements.define("cd-header", b);
289
+ }
290
+ s();
291
+ class f extends r {
292
+ static formAssociated = !0;
293
+ static styles = a`
354
294
  @font-face {
355
295
  font-family: 'Geist';
356
- src: url(${n(s)}) format('woff');
296
+ src: url(${o(i)}) format('woff');
357
297
  font-weight: 100 900;
358
298
  font-style: normal;
359
299
  }
@@ -472,97 +412,139 @@ r(v, "formAssociated", !0), r(v, "styles", l`
472
412
 
473
413
 
474
414
 
475
- `), r(v, "properties", {
476
- name: {
477
- type: String,
478
- reflect: !0
479
- },
480
- type: {
481
- type: String,
482
- reflect: !0,
483
- converter: (t) => ["text", "date", "time", "number", "tel", "url", "phone", "email", "password"].includes(t) ? t : "text"
484
- },
485
- disabled: {
486
- type: Boolean,
487
- reflect: !0
488
- },
489
- placeholder: {
490
- type: String,
491
- reflect: !0
492
- },
493
- readOnly: {
494
- type: Boolean,
495
- reflect: !0,
496
- attribute: "read-only"
497
- },
498
- required: {
499
- type: Boolean,
500
- reflect: !0
501
- },
502
- pattern: {
503
- type: String
504
- },
505
- error: {
506
- type: Boolean,
507
- reflect: !0
508
- },
509
- value: {
510
- type: String,
511
- reflect: !0
512
- },
513
- fullWidth: {
514
- type: Boolean,
515
- reflect: !0,
516
- attribute: "full-width"
517
- },
518
- variant: {
519
- type: String,
520
- reflect: !0
521
- },
522
- size: {
523
- type: String,
524
- reflect: !0,
525
- converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
526
- },
527
- iconLeft: {
528
- type: String,
529
- reflect: !0,
530
- attribute: "icon-left"
531
- },
532
- iconRight: {
533
- type: String,
534
- reflect: !0,
535
- attribute: "icon-right"
415
+ `;
416
+ static properties = {
417
+ name: {
418
+ type: String,
419
+ reflect: !0
420
+ },
421
+ type: {
422
+ type: String,
423
+ reflect: !0,
424
+ converter: (t) => ["text", "date", "time", "number", "tel", "url", "phone", "email", "password"].includes(t) ? t : "text"
425
+ },
426
+ disabled: {
427
+ type: Boolean,
428
+ reflect: !0
429
+ },
430
+ placeholder: {
431
+ type: String,
432
+ reflect: !0
433
+ },
434
+ readOnly: {
435
+ type: Boolean,
436
+ reflect: !0,
437
+ attribute: "read-only"
438
+ },
439
+ required: {
440
+ type: Boolean,
441
+ reflect: !0
442
+ },
443
+ pattern: {
444
+ type: String
445
+ },
446
+ error: {
447
+ type: Boolean,
448
+ reflect: !0
449
+ },
450
+ value: {
451
+ type: String,
452
+ reflect: !0
453
+ },
454
+ fullWidth: {
455
+ type: Boolean,
456
+ reflect: !0,
457
+ attribute: "full-width"
458
+ },
459
+ variant: {
460
+ type: String,
461
+ reflect: !0
462
+ },
463
+ size: {
464
+ type: String,
465
+ reflect: !0,
466
+ converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
467
+ },
468
+ iconLeft: {
469
+ type: String,
470
+ reflect: !0,
471
+ attribute: "icon-left"
472
+ },
473
+ iconRight: {
474
+ type: String,
475
+ reflect: !0,
476
+ attribute: "icon-right"
477
+ }
478
+ };
479
+ handleKeyPress(t) {
480
+ return this.dispatchEvent(new CustomEvent("keypress", {
481
+ detail: {
482
+ value: t.target.value,
483
+ key: t.keyCode
484
+ }
485
+ })), t.key === "Enter" && this.dispatchEvent(new CustomEvent("onenter", {
486
+ detail: {
487
+ value: t.target.value
488
+ }
489
+ })), this.dispatchEvent(new CustomEvent("onkeyup", {
490
+ detail: {
491
+ value: t.target.value,
492
+ key: t.keyCode
493
+ }
494
+ })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
495
+ }
496
+ handleInput(t) {
497
+ return this.dispatchEvent(new CustomEvent("input", {
498
+ detail: {
499
+ value: t.target.value
500
+ }
501
+ })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
502
+ }
503
+ handleChange(t) {
504
+ return this.dispatchEvent(new CustomEvent("onchange", {
505
+ detail: {
506
+ value: t.target.value
507
+ }
508
+ })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
509
+ }
510
+ handleFocus(t) {
511
+ return this.dispatchEvent(new CustomEvent("onblur", {
512
+ detail: {
513
+ value: t.target.value
514
+ }
515
+ })), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target;
536
516
  }
537
- });
538
- function T() {
539
- typeof window < "u" && !customElements.get("cd-input") && customElements.define("cd-input", v);
540
- }
541
- q();
542
- class g extends a {
543
517
  constructor() {
544
- super(), this.image = "", this.name = "";
518
+ super(), this.value = "", this.placeholder = "", this.pattern = "", this.variant = "solid", this.size = "md", this._internals = this.attachInternals();
545
519
  }
546
520
  render() {
547
- return o`
548
- <nav class="navbar ${this.small ? "small" : ""}">
549
- ${this.image != "" && this.name != "" ? o` <div class="image">
550
- <cd-nav-image src="${this.image}" alt="Logo" name="${this.name}"></cd-nav-image>
551
- </div>` : ""}
552
-
553
- <div class="items">
554
- <slot name="start"></slot>
555
- <slot></slot>
556
- <slot name="end"></slot>
557
- </div>
558
- </nav>
559
- `;
521
+ return e`
522
+ ${this.iconLeft ? e`<span class="icon-left-container"><cd-icon name="${this.iconLeft}" size="sm" class="icon-left"></cd-icon></span>` : ""}
523
+ <input id='${this.name}' class="${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? " icon-spacing-right" : ""} ${this.disabled ? " disabled" : ""} ${this.error ? " input-error" : ""} ${this.fullWidth ? " full-width" : ""} ${this.variant === "dashed" ? " dashed" : this.variant == "dotted" ? " dotted" : ""} ${this.size}" type="${this.type}" placeholder="${this.placeholder}" ?required=${this.required} .value="${this.value}" ?readonly=${this.readOnly} ?disabled=${this.disabled} .pattern="${this.pattern}" @input="${this.handleInput}" @change="${this.handleChange}" @blur="${this.handleFocus}" @keypress=${this.handleKeyPress}/>
524
+ ${this.iconRight ? e`<span class="icon-right-container"><cd-icon name="${this.iconRight}" size="sm" class="icon-right"></cd-icon></span>` : ""}
525
+ `;
560
526
  }
527
+ focus() {
528
+ if (!this.shadowRoot) {
529
+ console.warn("Input element is not yet connected to the DOM.");
530
+ return;
531
+ }
532
+ if (!this.shadowRoot.querySelector("input")) {
533
+ console.warn("Input element is not found in the shadow DOM.");
534
+ return;
535
+ }
536
+ this.shadowRoot.querySelector("input").focus();
537
+ }
538
+ }
539
+ function q() {
540
+ typeof window < "u" && !customElements.get("cd-input") && customElements.define("cd-input", f);
561
541
  }
562
- r(g, "styles", l`
542
+ p();
543
+ class g extends r {
544
+ static styles = a`
563
545
  @font-face {
564
546
  font-family: 'Geist';
565
- src: url(${n(s)}) format('woff');
547
+ src: url(${o(i)}) format('woff');
566
548
  font-weight: 100 900;
567
549
  font-style: normal;
568
550
  }
@@ -616,70 +598,56 @@ r(g, "styles", l`
616
598
  flex-direction: column;
617
599
  gap: 8px;
618
600
  }
619
- `), r(g, "properties", {
620
- image: {
621
- type: String,
622
- reflect: !0,
623
- attribute: "image",
624
- defaultValue: ""
625
- },
626
- name: {
627
- type: String,
628
- reflect: !0,
629
- attribute: "name",
630
- defaultValue: ""
631
- },
632
- small: {
633
- type: Boolean,
634
- reflect: !0,
635
- attribute: "sidebar",
636
- defaultValue: !1
637
- }
638
- });
639
- function P() {
640
- typeof window < "u" && !customElements.get("cd-nav-bar") && customElements.define("cd-nav-bar", g);
641
- }
642
- B();
643
- c();
644
- class m extends a {
601
+ `;
602
+ static properties = {
603
+ image: {
604
+ type: String,
605
+ reflect: !0,
606
+ attribute: "image",
607
+ defaultValue: ""
608
+ },
609
+ name: {
610
+ type: String,
611
+ reflect: !0,
612
+ attribute: "name",
613
+ defaultValue: ""
614
+ },
615
+ small: {
616
+ type: Boolean,
617
+ reflect: !0,
618
+ attribute: "sidebar",
619
+ defaultValue: !1
620
+ }
621
+ };
645
622
  constructor() {
646
- super(), this.icon = "", this.name = "", this.variant = "none", this.amount = 0, this.maxCount = 99, this.important = !1, this.dropdown = !1, this.active = !1, this.selected = !1, this.link = void 0;
623
+ super(), this.image = "", this.name = "";
647
624
  }
648
625
  render() {
649
- return o`
650
- <a href="${h(this.link)}" class="nav-item ${this.active ? "active" : ""} ${this.select ? "selected" : ""}" tabindex="0">
651
- <slot name="before" class="${this.amount > 0 && !this.select ? "standout" : ""} ${this.select ? "selected" : ""}"></slot>
652
- <p>${this.name}</p>
653
- ${this.variant == "dropdown" ? o`<cd-icon class='caret' name='caret-down' size='sm'></cd-icon>` : ""}
654
- ${this.variant == "link" ? o`<cd-icon name='external' size='sm'></cd-icon>` : ""}
655
- ${this.variant == "number" ? o`<cd-counter count='${this.amount}' max-count='${this.maxCount}' important='${this.important}'></cd-notification-counter>` : ""}
656
- </a>
657
- <div class="children ${this.active ? "children-active" : ""}">
658
- <slot></slot>
659
- </div>
626
+ return e`
627
+ <nav class="navbar ${this.small ? "small" : ""}">
628
+ ${this.image != "" && this.name != "" ? e` <div class="image">
629
+ <cd-nav-image src="${this.image}" alt="Logo" name="${this.name}"></cd-nav-image>
630
+ </div>` : ""}
631
+
632
+ <div class="items">
633
+ <slot name="start"></slot>
634
+ <slot></slot>
635
+ <slot name="end"></slot>
636
+ </div>
637
+ </nav>
660
638
  `;
661
639
  }
662
- setSelectState(t) {
663
- if (typeof t != "boolean")
664
- throw new Error("Select must be a boolean value");
665
- this.select !== t && (this.select = t, this.requestUpdate());
666
- }
667
- setActiveState(t) {
668
- if (typeof t != "boolean")
669
- throw new Error("Active must be a boolean value");
670
- this.active !== t && (this.active = t, this.requestUpdate());
671
- }
672
- toggleSelect() {
673
- this.select = !this.select, this.requestUpdate();
674
- }
675
- toggleActive() {
676
- this.active = !this.active, this.requestUpdate();
677
- }
678
640
  }
679
- r(m, "styles", l`
641
+ function V() {
642
+ typeof window < "u" && !customElements.get("cd-nav-bar") && customElements.define("cd-nav-bar", g);
643
+ }
644
+ h();
645
+ s();
646
+ class m extends r {
647
+ static styles = a`
680
648
  @font-face {
681
649
  font-family: 'Geist';
682
- src: url('${n(s)}') format('woff');
650
+ src: url('${o(i)}') format('woff');
683
651
  font-weight: 100 900;
684
652
  font-style: normal;
685
653
  }
@@ -770,73 +738,99 @@ r(m, "styles", l`
770
738
  --icon-stroke: var(--base-color-teal-900);
771
739
  --icon-background-primary: var(--base-color-teal-300);
772
740
  }
773
- `), r(m, "properties", {
774
- name: {
775
- type: String,
776
- reflect: !0,
777
- attribute: "name"
778
- },
779
- variant: {
780
- type: String,
781
- reflect: !0,
782
- attribute: "variant",
783
- converter: (t) => ["dropdown", "link", "number"].includes(t) ? t : "none"
784
- },
785
- amount: {
786
- type: Number,
787
- reflect: !0,
788
- attribute: "amount",
789
- converter: (t) => isNaN(t) ? 0 : t
790
- },
791
- maxCount: {
792
- type: Number,
793
- reflect: !0,
794
- attribute: "max-count",
795
- converter: (t) => isNaN(t) ? 99 : t
796
- },
797
- important: {
798
- type: Boolean,
799
- reflect: !0,
800
- attribute: "important"
801
- },
802
- link: {
803
- type: String,
804
- reflect: !0,
805
- attribute: "link"
806
- },
807
- icon: {
808
- type: String,
809
- reflect: !0,
810
- attribute: "icon"
811
- },
812
- active: {
813
- type: Boolean,
814
- reflect: !0,
815
- attribute: "active"
816
- },
817
- select: {
818
- type: Boolean,
819
- reflect: !0,
820
- attribute: "selected"
821
- }
822
- });
823
- function G() {
824
- typeof window < "u" && !customElements.get("cd-nav-item") && customElements.define("cd-nav-item", m);
825
- }
826
- class y extends a {
741
+ `;
742
+ static properties = {
743
+ name: {
744
+ type: String,
745
+ reflect: !0,
746
+ attribute: "name"
747
+ },
748
+ variant: {
749
+ type: String,
750
+ reflect: !0,
751
+ attribute: "variant",
752
+ converter: (t) => ["dropdown", "link", "number"].includes(t) ? t : "none"
753
+ },
754
+ amount: {
755
+ type: Number,
756
+ reflect: !0,
757
+ attribute: "amount",
758
+ converter: (t) => isNaN(t) ? 0 : t
759
+ },
760
+ maxCount: {
761
+ type: Number,
762
+ reflect: !0,
763
+ attribute: "max-count",
764
+ converter: (t) => isNaN(t) ? 99 : t
765
+ },
766
+ important: {
767
+ type: Boolean,
768
+ reflect: !0,
769
+ attribute: "important"
770
+ },
771
+ link: {
772
+ type: String,
773
+ reflect: !0,
774
+ attribute: "link"
775
+ },
776
+ icon: {
777
+ type: String,
778
+ reflect: !0,
779
+ attribute: "icon"
780
+ },
781
+ active: {
782
+ type: Boolean,
783
+ reflect: !0,
784
+ attribute: "active"
785
+ },
786
+ select: {
787
+ type: Boolean,
788
+ reflect: !0,
789
+ attribute: "selected"
790
+ }
791
+ };
827
792
  constructor() {
828
- super();
793
+ super(), this.icon = "", this.name = "", this.variant = "none", this.amount = 0, this.maxCount = 99, this.important = !1, this.dropdown = !1, this.active = !1, this.selected = !1, this.link = void 0;
829
794
  }
830
795
  render() {
831
- return o`
796
+ return e`
797
+ <a href="${c(this.link)}" class="nav-item ${this.active ? "active" : ""} ${this.select ? "selected" : ""}" tabindex="0">
798
+ <slot name="before" class="${this.amount > 0 && !this.select ? "standout" : ""} ${this.select ? "selected" : ""}"></slot>
799
+ <p>${this.name}</p>
800
+ ${this.variant == "dropdown" ? e`<cd-icon class='caret' name='caret-down' size='sm'></cd-icon>` : ""}
801
+ ${this.variant == "link" ? e`<cd-icon name='external' size='sm'></cd-icon>` : ""}
802
+ ${this.variant == "number" ? e`<cd-counter count='${this.amount}' max-count='${this.maxCount}' important='${this.important}'></cd-notification-counter>` : ""}
803
+ </a>
804
+ <div class="children ${this.active ? "children-active" : ""}">
832
805
  <slot></slot>
806
+ </div>
833
807
  `;
834
808
  }
809
+ setSelectState(t) {
810
+ if (typeof t != "boolean")
811
+ throw new Error("Select must be a boolean value");
812
+ this.select !== t && (this.select = t, this.requestUpdate());
813
+ }
814
+ setActiveState(t) {
815
+ if (typeof t != "boolean")
816
+ throw new Error("Active must be a boolean value");
817
+ this.active !== t && (this.active = t, this.requestUpdate());
818
+ }
819
+ toggleSelect() {
820
+ this.select = !this.select, this.requestUpdate();
821
+ }
822
+ toggleActive() {
823
+ this.active = !this.active, this.requestUpdate();
824
+ }
825
+ }
826
+ function I() {
827
+ typeof window < "u" && !customElements.get("cd-nav-item") && customElements.define("cd-nav-item", m);
835
828
  }
836
- r(y, "styles", l`
829
+ class y extends r {
830
+ static styles = a`
837
831
  @font-face {
838
832
  font-family: 'Geist';
839
- src: url(${n(s)}) format('woff');
833
+ src: url(${o(i)}) format('woff');
840
834
  font-weight: 100 900;
841
835
  font-style: normal;
842
836
  }
@@ -845,33 +839,25 @@ r(y, "styles", l`
845
839
  width: 100%;
846
840
  }
847
841
 
848
- `), r(y, "properties", {});
849
- function F() {
850
- typeof window < "u" && !customElements.get("cd-table") && customElements.define("cd-table", y);
851
- }
852
- class x extends a {
842
+ `;
843
+ static properties = {};
853
844
  constructor() {
854
- super(), this.text = "", this.content = !1, this.position = "top";
845
+ super();
855
846
  }
856
847
  render() {
857
- return o`
858
- <div class="tooltip-container">
859
- <div class="tooltip ${this.position}">
860
- <div class="${this.content ? "tooltip-content" : "none"} ${this.text ? "" : "no-border"}">
861
- <slot></slot>
862
- </div>
863
- <div class="${this.text ? "tooltip-text" : "none"}">
864
- ${this.text}
865
- </div>
866
- </div>
867
- </div>
848
+ return e`
849
+ <slot></slot>
868
850
  `;
869
851
  }
870
852
  }
871
- r(x, "styles", l`
853
+ function D() {
854
+ typeof window < "u" && !customElements.get("cd-table") && customElements.define("cd-table", y);
855
+ }
856
+ class x extends r {
857
+ static styles = a`
872
858
  @font-face {
873
859
  font-family: 'Geist';
874
- src: url(${n(s)}) format('woff');
860
+ src: url(${o(i)}) format('woff');
875
861
  font-weight: 100 900;
876
862
  font-style: normal;
877
863
  }
@@ -933,47 +919,50 @@ r(x, "styles", l`
933
919
  .no-border {
934
920
  border-bottom: none;
935
921
  }
936
- `), r(x, "properties", {
937
- text: {
938
- type: String,
939
- reflect: !0
940
- },
941
- position: {
942
- type: String,
943
- reflect: !0,
944
- attribute: "position",
945
- converter: (t) => ["top", "right", "bottom", "left"].includes(t) ? t : "top"
946
- },
947
- content: {
948
- type: Boolean,
949
- reflect: !0
950
- }
951
- });
952
- function N() {
953
- typeof window < "u" && !customElements.get("cd-tool-tip") && customElements.define("cd-tool-tip", x);
954
- }
955
- c();
956
- class w extends a {
922
+ `;
923
+ static properties = {
924
+ text: {
925
+ type: String,
926
+ reflect: !0
927
+ },
928
+ position: {
929
+ type: String,
930
+ reflect: !0,
931
+ attribute: "position",
932
+ converter: (t) => ["top", "right", "bottom", "left"].includes(t) ? t : "top"
933
+ },
934
+ content: {
935
+ type: Boolean,
936
+ reflect: !0
937
+ }
938
+ };
957
939
  constructor() {
958
- super(), this.primaryText = "", this.secondaryText = "", this.icon = "hart";
940
+ super(), this.text = "", this.content = !1, this.position = "top";
959
941
  }
960
942
  render() {
961
- return o`
962
- <div class="profile-stack">
963
- <div class="text-stack">
964
- <span class="name">${this.primaryText}</span>
965
- ${this.secondaryText != "" ? o`<span class="org"><cd-icon name="${this.icon}" size="sm"></cd-icon>${this.secondaryText}</span>` : ""}
943
+ return e`
944
+ <div class="tooltip-container">
945
+ <div class="tooltip ${this.position}">
946
+ <div class="${this.content ? "tooltip-content" : "none"} ${this.text ? "" : "no-border"}">
947
+ <slot></slot>
948
+ </div>
949
+ <div class="${this.text ? "tooltip-text" : "none"}">
950
+ ${this.text}
951
+ </div>
966
952
  </div>
967
- <cd-icon name="caret-down" size="sm"></cd-icon>
968
953
  </div>
969
-
970
954
  `;
971
955
  }
972
956
  }
973
- r(w, "styles", l`
957
+ function R() {
958
+ typeof window < "u" && !customElements.get("cd-tool-tip") && customElements.define("cd-tool-tip", x);
959
+ }
960
+ s();
961
+ class w extends r {
962
+ static styles = a`
974
963
  @font-face {
975
964
  font-family: 'Geist';
976
- src: url(${n(s)}) format('woff');
965
+ src: url(${o(i)}) format('woff');
977
966
  font-weight: 100 900;
978
967
  font-style: normal;
979
968
  }
@@ -1012,46 +1001,52 @@ r(w, "styles", l`
1012
1001
  gap: 6px;
1013
1002
  align-items: center;
1014
1003
  }
1015
- `), r(w, "properties", {
1016
- primaryText: {
1017
- type: String,
1018
- reflect: !0,
1019
- attribute: "name",
1020
- defaultValue: ""
1021
- },
1022
- secondaryText: {
1023
- type: String,
1024
- reflect: !0,
1025
- attribute: "org",
1026
- defaultValue: ""
1027
- },
1028
- icon: {
1029
- type: String,
1030
- reflect: !0,
1031
- attribute: "icon",
1032
- defaultValue: ""
1033
- }
1034
- });
1035
- function U() {
1036
- typeof window < "u" && !customElements.get("cd-nav-profile") && customElements.define("cd-nav-profile", w);
1037
- }
1038
- c();
1039
- class k extends a {
1004
+ `;
1005
+ static properties = {
1006
+ primaryText: {
1007
+ type: String,
1008
+ reflect: !0,
1009
+ attribute: "name",
1010
+ defaultValue: ""
1011
+ },
1012
+ secondaryText: {
1013
+ type: String,
1014
+ reflect: !0,
1015
+ attribute: "org",
1016
+ defaultValue: ""
1017
+ },
1018
+ icon: {
1019
+ type: String,
1020
+ reflect: !0,
1021
+ attribute: "icon",
1022
+ defaultValue: ""
1023
+ }
1024
+ };
1040
1025
  constructor() {
1041
- super(), this.variant = "default", this.link = void 0;
1026
+ super(), this.primaryText = "", this.secondaryText = "", this.icon = "hart";
1042
1027
  }
1043
1028
  render() {
1044
- return o`
1045
- ${this.variant === "default" ? o`<a href="${h(this.link)}" class="value"><slot></slot></a>` : ""}
1046
- ${this.variant === "dropdown" ? o`<span class="dropdown-value"><slot></slot></span>` : ""}
1047
- ${this.variant === "arrow" ? o`<a href="${h(this.link)}" class="arrow-value"><slot></slot><cd-icon name="arrow" size="sm"></cd-icon></a>` : ""}
1029
+ return e`
1030
+ <div class="profile-stack">
1031
+ <div class="text-stack">
1032
+ <span class="name">${this.primaryText}</span>
1033
+ ${this.secondaryText != "" ? e`<span class="org"><cd-icon name="${this.icon}" size="sm"></cd-icon>${this.secondaryText}</span>` : ""}
1034
+ </div>
1035
+ <cd-icon name="caret-down" size="sm"></cd-icon>
1036
+ </div>
1037
+
1048
1038
  `;
1049
1039
  }
1050
1040
  }
1051
- r(k, "styles", l`
1041
+ function L() {
1042
+ typeof window < "u" && !customElements.get("cd-nav-profile") && customElements.define("cd-nav-profile", w);
1043
+ }
1044
+ s();
1045
+ class k extends r {
1046
+ static styles = a`
1052
1047
  @font-face {
1053
1048
  font-family: 'Geist';
1054
- src: url(${n(s)}) format('woff');
1049
+ src: url(${o(i)}) format('woff');
1055
1050
  font-weight: 100 900;
1056
1051
  font-style: normal;
1057
1052
  }
@@ -1125,128 +1120,40 @@ r(k, "styles", l`
1125
1120
  outline: 2px solid var(--input-border-color-focus);
1126
1121
  border-radius: 4px;
1127
1122
  }
1128
- `), r(k, "properties", {
1129
- variant: {
1130
- type: String,
1131
- reflect: !0,
1132
- attribute: "variant",
1133
- converter: (t) => ["default", "dropdown", "arrow"].includes(t) ? t : "default"
1134
- },
1135
- link: {
1136
- type: String,
1137
- reflect: !0,
1138
- attribute: "link"
1139
- }
1140
- });
1141
- function K() {
1142
- typeof window < "u" && !customElements.get("cd-value") && customElements.define("cd-value", k);
1143
- }
1144
- c();
1145
- class $ extends a {
1146
- handleBlur(t) {
1147
- return this.dispatchEvent(new CustomEvent("blur", {
1148
- detail: {
1149
- value: t.target.value
1150
- },
1151
- bubbles: !0,
1152
- composed: !0
1153
- })), this.value = t.target.value, t.target.value;
1154
- }
1155
- handleFocus(t) {
1156
- return this.expandInput(), this.dispatchEvent(new CustomEvent("focus", {
1157
- detail: {
1158
- value: t.target.value
1159
- },
1160
- bubbles: !0,
1161
- composed: !0
1162
- })), this.value = t.target.value, t.target.value;
1163
- }
1164
- handleKeyPress(t) {
1165
- return this.dispatchEvent(new CustomEvent("keypress", {
1166
- detail: {
1167
- value: t.target.value,
1168
- key: t.target.keyCode
1169
- },
1170
- bubbles: !0,
1171
- composed: !0
1172
- })), this.value = t.target.value, t.target.value;
1173
- }
1174
- handleInput(t) {
1175
- return this.dispatchEvent(new CustomEvent("input", {
1176
- detail: {
1177
- value: t.target.value
1178
- },
1179
- bubbles: !0,
1180
- composed: !0
1181
- })), this.value = t.target.value, t.target.value;
1182
- }
1123
+ `;
1124
+ static properties = {
1125
+ variant: {
1126
+ type: String,
1127
+ reflect: !0,
1128
+ attribute: "variant",
1129
+ converter: (t) => ["default", "dropdown", "arrow"].includes(t) ? t : "default"
1130
+ },
1131
+ link: {
1132
+ type: String,
1133
+ reflect: !0,
1134
+ attribute: "link"
1135
+ }
1136
+ };
1183
1137
  constructor() {
1184
- super(), this.placeholder = "Search", this.value = "", this.disabled = !1, this.collapsed = !1, this.iconLeft = !1, this.iconRight = !1, this.size = "md", this.closeIcon = !1, this.label = "", this.labelPosition = "left", this.name = "", this.fullWidth = !1, this._internals = this.attachInternals();
1138
+ super(), this.variant = "default", this.link = void 0;
1185
1139
  }
1186
1140
  render() {
1187
- return o`
1188
- <div class="search-container ${this.labelPosition}">
1189
- ${this.label ? o`<label for="search-input">${this.label}</label>` : ""}
1190
- ${this.iconLeft && !this.collapsed ? o`<span class="icon-left-container"><cd-icon name="search" class="icon-left" variant="light-slate"></cd-icon></span>` : ""}
1191
-
1192
- <input
1193
- id="search-input"
1194
- type="text"
1195
- class="search-input ${this.collapsed ? "collapsed" : "expanded"} ${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? "icon-spacing-right" : ""} ${this.size} ${this.fullWidth && !this.collapsed ? "full-width" : ""}"
1196
- placeholder="${this.placeholder}"
1197
- .value="${this.value}"
1198
- ?disabled="${this.disabled}"
1199
- @input="${this.handleInput}"
1200
- @focus="${this.handleFocus}"
1201
- @blur="${this.handleBlur}"
1202
- @keypress="${this.handleKeyPress}"
1203
- @click="${this.expandInput}"
1204
- name="${this.name}"
1205
- >
1206
- ${this.iconRight || this.collapsed ? o`<span @click="${this.expandInput}" class="${this.collapsed ? "icon-collapsed-container" : "icon-right-container"}"><cd-icon name="search" class="${this.collapsed ? "icon-collapsed " + this.size : "icon-right"}" variant="light-slate"></cd-icon></span>` : ""}
1207
- ${this.closeIcon ? o`<span class="${this.collapsed ? "hidden" : "active"}" id='closeIcon' tabindex='0'><cd-icon name="exit" id="close-icon" class="icon close ${this.collapsed ? "hidden-icon" : "active-icon"}" @click="${this.collapseInput}"></cd-icon></span>` : ""}
1208
- </div>
1141
+ return e`
1142
+ ${this.variant === "default" ? e`<a href="${c(this.link)}" class="value"><slot></slot></a>` : ""}
1143
+ ${this.variant === "dropdown" ? e`<span class="dropdown-value"><slot></slot></span>` : ""}
1144
+ ${this.variant === "arrow" ? e`<a href="${c(this.link)}" class="arrow-value"><slot></slot><cd-icon name="arrow" size="sm"></cd-icon></a>` : ""}
1209
1145
  `;
1210
1146
  }
1211
- firstUpdated() {
1212
- if (!this.shadowRoot) {
1213
- console.warn("Shadow DOM is not available.");
1214
- return;
1215
- }
1216
- this.shadowRoot.querySelector(".active") && (console.log("Adding event listener to active element"), this.shadowRoot.querySelector(".active").addEventListener("keydown", (t) => {
1217
- console.log("test"), t.keyCode === 13 && this.collapseInput();
1218
- }));
1219
- }
1220
- focus() {
1221
- if (!this.shadowRoot) {
1222
- console.warn("Input element is not yet connected to the DOM.");
1223
- return;
1224
- }
1225
- if (!this.shadowRoot.querySelector("input")) {
1226
- console.warn("Input element is not found in the shadow DOM.");
1227
- return;
1228
- }
1229
- this.shadowRoot.querySelector("#search-input").focus();
1230
- }
1231
- expandInput() {
1232
- this.collapsed && (this.collapsed = !1, this.shadowRoot.querySelector("#search-input").focus(), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden"), this.shadowRoot.querySelector("#close-icon").classList.add("active-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("active"), this.requestUpdate(), this.shadowRoot.querySelector("#closeIcon").addEventListener("keydown", (t) => {
1233
- t.key === "Enter" && this.collapseInput();
1234
- }));
1235
- }
1236
- collapseInput() {
1237
- this.collapsed || (this.collapsed = !0, this.value = "", this.shadowRoot.querySelector("#close-icon").classList.add("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("hidden"), this.shadowRoot.querySelector("#close-icon").classList.remove("active"), this.shadowRoot.querySelector("#close-icon").classList.remove("active-icon"), this.dispatchEvent(new CustomEvent("collapsed", {
1238
- detail: {
1239
- closed: !0
1240
- },
1241
- bubbles: !0,
1242
- composed: !0
1243
- })), this.requestUpdate());
1244
- }
1245
1147
  }
1246
- r($, "styles", l`
1148
+ function P() {
1149
+ typeof window < "u" && !customElements.get("cd-value") && customElements.define("cd-value", k);
1150
+ }
1151
+ s();
1152
+ class $ extends r {
1153
+ static styles = a`
1247
1154
  @font-face {
1248
1155
  font-family: 'Geist';
1249
- src: url(${n(s)}) format('woff');
1156
+ src: url(${o(i)}) format('woff');
1250
1157
  font-weight: 100 900;
1251
1158
  font-style: normal;
1252
1159
  }
@@ -1427,102 +1334,171 @@ r($, "styles", l`
1427
1334
  opacity: 0;
1428
1335
  transition: opacity 0.5s ease-in-out;
1429
1336
  }
1430
- `), r($, "properties", {
1431
- placeholder: {
1432
- type: String,
1433
- reflect: !0
1434
- },
1435
- value: {
1436
- type: String,
1437
- reflect: !0
1438
- },
1439
- disabled: {
1440
- type: Boolean,
1441
- reflect: !0
1442
- },
1443
- collapsed: {
1444
- type: Boolean,
1445
- reflect: !0
1446
- },
1447
- iconLeft: {
1448
- type: Boolean,
1449
- reflect: !0,
1450
- attribute: "icon-left"
1451
- },
1452
- iconRight: {
1453
- type: Boolean,
1454
- reflect: !0,
1455
- attribute: "icon-right"
1456
- },
1457
- size: {
1458
- type: String,
1459
- reflect: !0
1460
- },
1461
- closeIcon: {
1462
- type: Boolean,
1463
- reflect: !0,
1464
- attribute: "close-icon"
1465
- },
1466
- label: {
1467
- type: String,
1468
- reflect: !0
1469
- },
1470
- labelPosition: {
1471
- type: String,
1472
- reflect: !0,
1473
- attribute: "label-position"
1474
- },
1475
- name: {
1476
- type: String,
1477
- reflect: !0
1478
- },
1479
- fullWidth: {
1480
- type: Boolean,
1481
- reflect: !0,
1482
- attribute: "full-width"
1337
+ `;
1338
+ static properties = {
1339
+ placeholder: {
1340
+ type: String,
1341
+ reflect: !0
1342
+ },
1343
+ value: {
1344
+ type: String,
1345
+ reflect: !0
1346
+ },
1347
+ disabled: {
1348
+ type: Boolean,
1349
+ reflect: !0
1350
+ },
1351
+ collapsed: {
1352
+ type: Boolean,
1353
+ reflect: !0
1354
+ },
1355
+ iconLeft: {
1356
+ type: Boolean,
1357
+ reflect: !0,
1358
+ attribute: "icon-left"
1359
+ },
1360
+ iconRight: {
1361
+ type: Boolean,
1362
+ reflect: !0,
1363
+ attribute: "icon-right"
1364
+ },
1365
+ size: {
1366
+ type: String,
1367
+ reflect: !0
1368
+ },
1369
+ closeIcon: {
1370
+ type: Boolean,
1371
+ reflect: !0,
1372
+ attribute: "close-icon"
1373
+ },
1374
+ label: {
1375
+ type: String,
1376
+ reflect: !0
1377
+ },
1378
+ labelPosition: {
1379
+ type: String,
1380
+ reflect: !0,
1381
+ attribute: "label-position"
1382
+ },
1383
+ name: {
1384
+ type: String,
1385
+ reflect: !0
1386
+ },
1387
+ fullWidth: {
1388
+ type: Boolean,
1389
+ reflect: !0,
1390
+ attribute: "full-width"
1391
+ }
1392
+ };
1393
+ handleBlur(t) {
1394
+ return this.dispatchEvent(new CustomEvent("blur", {
1395
+ detail: {
1396
+ value: t.target.value
1397
+ },
1398
+ bubbles: !0,
1399
+ composed: !0
1400
+ })), this.value = t.target.value, t.target.value;
1401
+ }
1402
+ handleFocus(t) {
1403
+ return this.expandInput(), this.dispatchEvent(new CustomEvent("focus", {
1404
+ detail: {
1405
+ value: t.target.value
1406
+ },
1407
+ bubbles: !0,
1408
+ composed: !0
1409
+ })), this.value = t.target.value, t.target.value;
1410
+ }
1411
+ handleKeyPress(t) {
1412
+ return this.dispatchEvent(new CustomEvent("keypress", {
1413
+ detail: {
1414
+ value: t.target.value,
1415
+ key: t.target.keyCode
1416
+ },
1417
+ bubbles: !0,
1418
+ composed: !0
1419
+ })), this.value = t.target.value, t.target.value;
1420
+ }
1421
+ handleInput(t) {
1422
+ return this.dispatchEvent(new CustomEvent("input", {
1423
+ detail: {
1424
+ value: t.target.value
1425
+ },
1426
+ bubbles: !0,
1427
+ composed: !0
1428
+ })), this.value = t.target.value, t.target.value;
1483
1429
  }
1484
- });
1485
- function M() {
1486
- typeof window < "u" && !customElements.get("cd-search") && customElements.define("cd-search", $);
1487
- }
1488
- c();
1489
- class E extends a {
1490
1430
  constructor() {
1491
- super(), this.label = "", this.active = !1, this.disabled = !1, this.variant = "default", this.size = "md";
1431
+ super(), this.placeholder = "Search", this.value = "", this.disabled = !1, this.collapsed = !1, this.iconLeft = !1, this.iconRight = !1, this.size = "md", this.closeIcon = !1, this.label = "", this.labelPosition = "left", this.name = "", this.fullWidth = !1, this._internals = this.attachInternals();
1492
1432
  }
1493
1433
  render() {
1494
- return o`
1495
- <div class="tab-outer ${this.variant} ${this.active ? "active" : ""}" >
1496
- <div class='tab ${this.variant} ${this.size} ${this.disabled ? "disabled" : ""} ${this.active ? "active" : ""}' tabindex="${this.disabled ? -1 : 0}">
1497
- <slot name="start"></slot>
1498
- <span class="label">${this.label}</span>
1499
- <slot name="end"></slot>
1434
+ return e`
1435
+ <div class="search-container ${this.labelPosition}">
1436
+ ${this.label ? e`<label for="search-input">${this.label}</label>` : ""}
1437
+ ${this.iconLeft && !this.collapsed ? e`<span class="icon-left-container"><cd-icon name="search" class="icon-left" variant="light-slate"></cd-icon></span>` : ""}
1438
+
1439
+ <input
1440
+ id="search-input"
1441
+ type="text"
1442
+ class="search-input ${this.collapsed ? "collapsed" : "expanded"} ${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? "icon-spacing-right" : ""} ${this.size} ${this.fullWidth && !this.collapsed ? "full-width" : ""}"
1443
+ placeholder="${this.placeholder}"
1444
+ .value="${this.value}"
1445
+ ?disabled="${this.disabled}"
1446
+ @input="${this.handleInput}"
1447
+ @focus="${this.handleFocus}"
1448
+ @blur="${this.handleBlur}"
1449
+ @keypress="${this.handleKeyPress}"
1450
+ @click="${this.expandInput}"
1451
+ name="${this.name}"
1452
+ >
1453
+ ${this.iconRight || this.collapsed ? e`<span @click="${this.expandInput}" class="${this.collapsed ? "icon-collapsed-container" : "icon-right-container"}"><cd-icon name="search" class="${this.collapsed ? "icon-collapsed " + this.size : "icon-right"}" variant="light-slate"></cd-icon></span>` : ""}
1454
+ ${this.closeIcon ? e`<span class="${this.collapsed ? "hidden" : "active"}" id='closeIcon' tabindex='0'><cd-icon name="exit" id="close-icon" class="icon close ${this.collapsed ? "hidden-icon" : "active-icon"}" @click="${this.collapseInput}"></cd-icon></span>` : ""}
1500
1455
  </div>
1501
- </div>
1502
1456
  `;
1503
1457
  }
1504
- toggleActive() {
1505
- this.active = !this.active;
1458
+ firstUpdated() {
1459
+ if (!this.shadowRoot) {
1460
+ console.warn("Shadow DOM is not available.");
1461
+ return;
1462
+ }
1463
+ this.shadowRoot.querySelector(".active") && (console.log("Adding event listener to active element"), this.shadowRoot.querySelector(".active").addEventListener("keydown", (t) => {
1464
+ console.log("test"), t.keyCode === 13 && this.collapseInput();
1465
+ }));
1506
1466
  }
1507
- setActive(t) {
1508
- if (typeof t != "boolean")
1509
- throw new TypeError("Active must be a boolean");
1510
- if (this.disabled)
1511
- throw new Error("Cannot set active state when the tab is disabled");
1512
- this.active = t;
1467
+ focus() {
1468
+ if (!this.shadowRoot) {
1469
+ console.warn("Input element is not yet connected to the DOM.");
1470
+ return;
1471
+ }
1472
+ if (!this.shadowRoot.querySelector("input")) {
1473
+ console.warn("Input element is not found in the shadow DOM.");
1474
+ return;
1475
+ }
1476
+ this.shadowRoot.querySelector("#search-input").focus();
1513
1477
  }
1514
- setDisabled(t) {
1515
- if (typeof t != "boolean")
1516
- throw new TypeError("Disabled must be a boolean");
1517
- if (this.active && t)
1518
- throw new Error("Cannot disable an active tab");
1519
- this.disabled = t;
1478
+ expandInput() {
1479
+ this.collapsed && (this.collapsed = !1, this.shadowRoot.querySelector("#search-input").focus(), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden"), this.shadowRoot.querySelector("#close-icon").classList.add("active-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("active"), this.requestUpdate(), this.shadowRoot.querySelector("#closeIcon").addEventListener("keydown", (t) => {
1480
+ t.key === "Enter" && this.collapseInput();
1481
+ }));
1482
+ }
1483
+ collapseInput() {
1484
+ this.collapsed || (this.collapsed = !0, this.value = "", this.shadowRoot.querySelector("#close-icon").classList.add("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("hidden"), this.shadowRoot.querySelector("#close-icon").classList.remove("active"), this.shadowRoot.querySelector("#close-icon").classList.remove("active-icon"), this.dispatchEvent(new CustomEvent("collapsed", {
1485
+ detail: {
1486
+ closed: !0
1487
+ },
1488
+ bubbles: !0,
1489
+ composed: !0
1490
+ })), this.requestUpdate());
1520
1491
  }
1521
1492
  }
1522
- r(E, "styles", l`
1493
+ function N() {
1494
+ typeof window < "u" && !customElements.get("cd-search") && customElements.define("cd-search", $);
1495
+ }
1496
+ s();
1497
+ class E extends r {
1498
+ static styles = a`
1523
1499
  @font-face {
1524
1500
  font-family: 'Geist';
1525
- src: url(${n(s)}) format('woff');
1501
+ src: url(${o(i)}) format('woff');
1526
1502
  font-weight: 100 900;
1527
1503
  font-style: normal;
1528
1504
  }
@@ -1624,46 +1600,71 @@ r(E, "styles", l`
1624
1600
  .tab:focus {
1625
1601
  outline: 2px solid var(--input-border-color-focus);
1626
1602
  }
1627
- `), r(E, "properties", {
1628
- label: {
1629
- type: String,
1630
- reflect: !0
1631
- },
1632
- active: {
1633
- type: Boolean,
1634
- reflect: !0
1635
- },
1636
- disabled: {
1637
- type: Boolean,
1638
- reflect: !0
1639
- },
1640
- variant: {
1641
- type: String,
1642
- reflect: !0,
1643
- attribute: "variant",
1644
- converter: (t) => ["default", "pill", "outline"].includes(t) ? t : "default"
1645
- },
1646
- size: {
1647
- type: String,
1648
- reflect: !0
1603
+ `;
1604
+ static properties = {
1605
+ label: {
1606
+ type: String,
1607
+ reflect: !0
1608
+ },
1609
+ active: {
1610
+ type: Boolean,
1611
+ reflect: !0
1612
+ },
1613
+ disabled: {
1614
+ type: Boolean,
1615
+ reflect: !0
1616
+ },
1617
+ variant: {
1618
+ type: String,
1619
+ reflect: !0,
1620
+ attribute: "variant",
1621
+ converter: (t) => ["default", "pill", "outline"].includes(t) ? t : "default"
1622
+ },
1623
+ size: {
1624
+ type: String,
1625
+ reflect: !0
1626
+ }
1627
+ };
1628
+ constructor() {
1629
+ super(), this.label = "", this.active = !1, this.disabled = !1, this.variant = "default", this.size = "md";
1649
1630
  }
1650
- });
1651
- function W() {
1652
- typeof window < "u" && !customElements.get("cd-tab") && customElements.define("cd-tab", E);
1653
- }
1654
- class z extends a {
1655
1631
  render() {
1656
- return o`
1657
- <div class='container ${this.variant}'>
1658
- <slot></slot>
1632
+ return e`
1633
+ <div class="tab-outer ${this.variant} ${this.active ? "active" : ""}" >
1634
+ <div class='tab ${this.variant} ${this.size} ${this.disabled ? "disabled" : ""} ${this.active ? "active" : ""}' tabindex="${this.disabled ? -1 : 0}">
1635
+ <slot name="start"></slot>
1636
+ <span class="label">${this.label}</span>
1637
+ <slot name="end"></slot>
1638
+ </div>
1659
1639
  </div>
1660
1640
  `;
1661
1641
  }
1642
+ toggleActive() {
1643
+ this.active = !this.active;
1644
+ }
1645
+ setActive(t) {
1646
+ if (typeof t != "boolean")
1647
+ throw new TypeError("Active must be a boolean");
1648
+ if (this.disabled)
1649
+ throw new Error("Cannot set active state when the tab is disabled");
1650
+ this.active = t;
1651
+ }
1652
+ setDisabled(t) {
1653
+ if (typeof t != "boolean")
1654
+ throw new TypeError("Disabled must be a boolean");
1655
+ if (this.active && t)
1656
+ throw new Error("Cannot disable an active tab");
1657
+ this.disabled = t;
1658
+ }
1659
+ }
1660
+ function G() {
1661
+ typeof window < "u" && !customElements.get("cd-tab") && customElements.define("cd-tab", E);
1662
1662
  }
1663
- r(z, "styles", l`
1663
+ class z extends r {
1664
+ static styles = a`
1664
1665
  @font-face {
1665
1666
  font-family: 'Geist';
1666
- src: url(${n(s)}) format('woff');
1667
+ src: url(${o(i)}) format('woff');
1667
1668
  font-weight: normal;
1668
1669
  font-style: normal;
1669
1670
  }
@@ -1683,143 +1684,72 @@ r(z, "styles", l`
1683
1684
 
1684
1685
 
1685
1686
 
1686
- `), r(z, "properties", {
1687
- variant: {
1688
- type: String,
1689
- reflect: !0,
1690
- attribute: "variant",
1691
- converter: (t) => ["default", "pill", "outline"].includes(t) ? t : "default",
1692
- defaultValue: "default"
1693
- }
1694
- });
1695
- function Y() {
1696
- typeof window < "u" && !customElements.get("cd-tab-container") && customElements.define("cd-tab-container", z);
1697
- }
1698
- A();
1699
- class u extends a {
1700
- constructor() {
1701
- super();
1702
- r(this, "handleChange", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
1703
- detail: {
1704
- value: this.value
1705
- },
1706
- bubbles: !0,
1707
- composed: !0
1708
- })), this.value));
1709
- r(this, "handleInput", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
1710
- detail: {
1711
- value: this.value
1712
- },
1713
- bubbles: !0,
1714
- composed: !0
1715
- })), this.value));
1716
- r(this, "handleFocus", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
1717
- detail: {
1718
- value: this.value
1719
- },
1720
- bubbles: !0,
1721
- composed: !0
1722
- })), this.value));
1723
- r(this, "handleBlur", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
1724
- detail: {
1725
- value: this.value
1726
- },
1727
- bubbles: !0,
1728
- composed: !0
1729
- })), this.value));
1730
- this.value = "", this.shortcut = void 0, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
1731
- customError: this.errorText && this.errorText.length > 0 || !1
1732
- });
1733
- }
1687
+ `;
1688
+ static properties = {
1689
+ variant: {
1690
+ type: String,
1691
+ reflect: !0,
1692
+ attribute: "variant",
1693
+ converter: (t) => ["default", "pill", "outline"].includes(t) ? t : "default",
1694
+ defaultValue: "default"
1695
+ }
1696
+ };
1734
1697
  render() {
1735
- return o`
1736
- <div class='container'>
1737
- <input class='${this.error ? "input-error" : ""} ${this.disabled ? "disabled" : ""} ${this.fullWidth ? "full-width" : ""} ${this.variant} ${this.size}' type='date' id='${this.name | "date"}' name='${this.name | "date"}' .value='${this.value}' @change='${this.handleChange}' @focus='${this.handleFocus}' @blur='${this.handleBlur}' @input='${this.handleInput}' ?disabled='${this.disabled}' />
1738
- ${this.shortcut ? o`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
1698
+ return e`
1699
+ <div class='container ${this.variant}'>
1700
+ <slot></slot>
1739
1701
  </div>
1740
-
1741
1702
  `;
1742
1703
  }
1743
- firstUpdated() {
1744
- if (!this.shadowRoot) {
1745
- console.warn("Shadow DOM not available, DateComponent may not render correctly.");
1746
- return;
1747
- }
1748
- this.shadowRoot.querySelector("cd-button") && this.shadowRoot.querySelector("cd-button").addEventListener("button-click", () => {
1749
- this.setValue(this.dateNow()), this.dispatchEvent(new CustomEvent("change", {
1750
- detail: {
1751
- value: this.value
1752
- },
1753
- bubbles: !0,
1754
- composed: !0
1755
- }));
1756
- });
1757
- }
1758
- dateNow() {
1759
- let e = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
1760
- timeZone: this.timezone
1761
- });
1762
- return new Date(e).toISOString().slice(0, 10);
1763
- }
1764
- setValue(e) {
1765
- this.value = e, this._internals.setFormValue(e), this.requestUpdate();
1766
- }
1767
- setError(e) {
1768
- if (typeof e != "error") {
1769
- console.warn("Error text must be a string");
1770
- return;
1771
- }
1772
- this.error = e, this._internals.setValidity({
1773
- customError: e
1774
- }), this.requestUpdate();
1775
- }
1776
- setDisabled(e) {
1777
- this.disabled = e, this._internals.setValidity({
1778
- customError: e
1779
- }), this.requestUpdate();
1780
- }
1781
1704
  }
1782
- r(u, "formAssociated", !0), r(u, "distinctTimezones", [
1783
- "Etc/GMT+12",
1784
- "Pacific/Pago_Pago",
1785
- "Pacific/Honolulu",
1786
- "America/Anchorage",
1787
- "America/Los_Angeles",
1788
- "America/Denver",
1789
- "America/Chicago",
1790
- "America/New_York",
1791
- "America/Halifax",
1792
- "America/Argentina/Buenos_Aires",
1793
- "America/Noronha",
1794
- "Atlantic/Azores",
1795
- "Europe/London",
1796
- "Europe/Paris",
1797
- "Europe/Bucharest",
1798
- "Europe/Moscow",
1799
- "Asia/Tehran",
1800
- "Asia/Dubai",
1801
- "Asia/Kabul",
1802
- "Asia/Karachi",
1803
- "Asia/Kolkata",
1804
- "Asia/Kathmandu",
1805
- "Asia/Dhaka",
1806
- "Asia/Yangon",
1807
- "Asia/Bangkok",
1808
- "Asia/Shanghai",
1809
- "Australia/Eucla",
1810
- "Asia/Tokyo",
1811
- "Australia/Darwin",
1812
- "Australia/Sydney",
1813
- "Australia/Lord_Howe",
1814
- "Pacific/Noumea",
1815
- "Pacific/Auckland",
1816
- "Pacific/Chatham",
1817
- "Pacific/Tongatapu",
1818
- "Pacific/Kiritimati"
1819
- ]), r(u, "styles", l`
1705
+ function F() {
1706
+ typeof window < "u" && !customElements.get("cd-tab-container") && customElements.define("cd-tab-container", z);
1707
+ }
1708
+ d();
1709
+ class S extends r {
1710
+ static formAssociated = !0;
1711
+ static distinctTimezones = [
1712
+ "Etc/GMT+12",
1713
+ "Pacific/Pago_Pago",
1714
+ "Pacific/Honolulu",
1715
+ "America/Anchorage",
1716
+ "America/Los_Angeles",
1717
+ "America/Denver",
1718
+ "America/Chicago",
1719
+ "America/New_York",
1720
+ "America/Halifax",
1721
+ "America/Argentina/Buenos_Aires",
1722
+ "America/Noronha",
1723
+ "Atlantic/Azores",
1724
+ "Europe/London",
1725
+ "Europe/Paris",
1726
+ "Europe/Bucharest",
1727
+ "Europe/Moscow",
1728
+ "Asia/Tehran",
1729
+ "Asia/Dubai",
1730
+ "Asia/Kabul",
1731
+ "Asia/Karachi",
1732
+ "Asia/Kolkata",
1733
+ "Asia/Kathmandu",
1734
+ "Asia/Dhaka",
1735
+ "Asia/Yangon",
1736
+ "Asia/Bangkok",
1737
+ "Asia/Shanghai",
1738
+ "Australia/Eucla",
1739
+ "Asia/Tokyo",
1740
+ "Australia/Darwin",
1741
+ "Australia/Sydney",
1742
+ "Australia/Lord_Howe",
1743
+ "Pacific/Noumea",
1744
+ "Pacific/Auckland",
1745
+ "Pacific/Chatham",
1746
+ "Pacific/Tongatapu",
1747
+ "Pacific/Kiritimati"
1748
+ ];
1749
+ static styles = a`
1820
1750
  @font-face {
1821
1751
  font-family: 'Geist';
1822
- src: url(${n(s)}) format('woff');
1752
+ src: url(${o(i)}) format('woff');
1823
1753
  font-weight: 100 900;
1824
1754
  font-style: normal;
1825
1755
  }
@@ -1908,105 +1838,103 @@ r(u, "formAssociated", !0), r(u, "distinctTimezones", [
1908
1838
  flex-direction: row;
1909
1839
  align-items: center;
1910
1840
  }
1911
- `), r(u, "properties", {
1912
- value: {
1913
- type: String,
1914
- reflect: !0
1915
- },
1916
- shortcut: {
1917
- type: String,
1918
- reflect: !0
1919
- },
1920
- error: {
1921
- type: Boolean,
1922
- reflect: !0,
1923
- attribute: "error"
1924
- },
1925
- disabled: {
1926
- type: Boolean,
1927
- reflect: !0
1928
- },
1929
- form: {
1930
- type: String,
1931
- reflect: !0,
1932
- attribute: "form"
1933
- },
1934
- size: {
1935
- type: String,
1936
- reflect: !0,
1937
- attribute: "size",
1938
- converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md"
1939
- },
1940
- fullWidth: {
1941
- type: Boolean,
1942
- reflect: !0,
1943
- attribute: "full-width"
1944
- },
1945
- variant: {
1946
- type: String,
1947
- reflect: !0,
1948
- attribute: "variant",
1949
- converter: (e) => ["dashed", "dotted"].includes(e) ? e : "default"
1950
- },
1951
- timezone: {
1952
- type: String,
1953
- reflect: !0,
1954
- attribute: "timezone",
1955
- converter: (e) => distinctTimezones.includes(e) ? e : "America/New_York"
1956
- }
1957
- });
1958
- function O() {
1959
- typeof window < "u" && !customElements.get("cd-date") && customElements.define("cd-date", u);
1960
- }
1961
- A();
1962
- class p extends a {
1841
+ `;
1842
+ static properties = {
1843
+ value: {
1844
+ type: String,
1845
+ reflect: !0
1846
+ },
1847
+ shortcut: {
1848
+ type: String,
1849
+ reflect: !0
1850
+ },
1851
+ error: {
1852
+ type: Boolean,
1853
+ reflect: !0,
1854
+ attribute: "error"
1855
+ },
1856
+ disabled: {
1857
+ type: Boolean,
1858
+ reflect: !0
1859
+ },
1860
+ form: {
1861
+ type: String,
1862
+ reflect: !0,
1863
+ attribute: "form"
1864
+ },
1865
+ size: {
1866
+ type: String,
1867
+ reflect: !0,
1868
+ attribute: "size",
1869
+ converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
1870
+ },
1871
+ fullWidth: {
1872
+ type: Boolean,
1873
+ reflect: !0,
1874
+ attribute: "full-width"
1875
+ },
1876
+ variant: {
1877
+ type: String,
1878
+ reflect: !0,
1879
+ attribute: "variant",
1880
+ converter: (t) => ["dashed", "dotted"].includes(t) ? t : "default"
1881
+ },
1882
+ timezone: {
1883
+ type: String,
1884
+ reflect: !0,
1885
+ attribute: "timezone",
1886
+ converter: (t) => distinctTimezones.includes(t) ? t : "America/New_York"
1887
+ }
1888
+ };
1963
1889
  constructor() {
1964
- super();
1965
- r(this, "handleChange", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
1966
- detail: {
1967
- value: this.value
1968
- },
1969
- bubbles: !0,
1970
- composed: !0
1971
- })), this.value));
1972
- r(this, "handleInput", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
1973
- detail: {
1974
- value: this.value
1975
- },
1976
- bubbles: !0,
1977
- composed: !0
1978
- })), this.value));
1979
- r(this, "handleFocus", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
1980
- detail: {
1981
- value: this.value
1982
- },
1983
- bubbles: !0,
1984
- composed: !0
1985
- })), this.value));
1986
- r(this, "handleBlur", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
1987
- detail: {
1988
- value: this.value
1989
- },
1990
- bubbles: !0,
1991
- composed: !0
1992
- })), this.value));
1993
- this.value = "", this.shortcut = void 0, this.error = !1, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
1890
+ super(), this.value = "", this.shortcut = void 0, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
1994
1891
  customError: this.errorText && this.errorText.length > 0 || !1
1995
1892
  });
1996
1893
  }
1894
+ handleChange = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
1895
+ detail: {
1896
+ value: this.value
1897
+ },
1898
+ bubbles: !0,
1899
+ composed: !0
1900
+ })), this.value);
1901
+ handleInput = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
1902
+ detail: {
1903
+ value: this.value
1904
+ },
1905
+ bubbles: !0,
1906
+ composed: !0
1907
+ })), this.value);
1908
+ handleFocus = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
1909
+ detail: {
1910
+ value: this.value
1911
+ },
1912
+ bubbles: !0,
1913
+ composed: !0
1914
+ })), this.value);
1915
+ handleBlur = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
1916
+ detail: {
1917
+ value: this.value
1918
+ },
1919
+ bubbles: !0,
1920
+ composed: !0
1921
+ })), this.value);
1997
1922
  render() {
1998
- return o`
1999
- <input class='${this.error ? "input-error" : ""} ${this.disabled ? "disabled" : ""} ${this.fullWidth ? "full-width" : ""} ${this.variant} ${this.size}' type='time' id='${this.name | "time"}' name='${this.name | "time"}' .value='${this.value}' @change='${this.handleChange}' @focus='${this.handleFocus}' @blur='${this.handleBlur}' @input='${this.handleInput}' ?disabled='${this.disabled}' />
2000
- ${this.shortcut ? o`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
1923
+ return e`
1924
+ <div class='container'>
1925
+ <input class='${this.error ? "input-error" : ""} ${this.disabled ? "disabled" : ""} ${this.fullWidth ? "full-width" : ""} ${this.variant} ${this.size}' type='date' id='${this.name | "date"}' name='${this.name | "date"}' .value='${this.value}' @change='${this.handleChange}' @focus='${this.handleFocus}' @blur='${this.handleBlur}' @input='${this.handleInput}' ?disabled='${this.disabled}' />
1926
+ ${this.shortcut ? e`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
1927
+ </div>
1928
+
2001
1929
  `;
2002
1930
  }
2003
1931
  firstUpdated() {
2004
1932
  if (!this.shadowRoot) {
2005
- console.warn("Shadow DOM not available, TimeComponent may not render correctly.");
1933
+ console.warn("Shadow DOM not available, DateComponent may not render correctly.");
2006
1934
  return;
2007
1935
  }
2008
1936
  this.shadowRoot.querySelector("cd-button") && this.shadowRoot.querySelector("cd-button").addEventListener("button-click", () => {
2009
- this.setValue(this.timeNow()), this.dispatchEvent(new CustomEvent("change", {
1937
+ this.setValue(this.dateNow()), this.dispatchEvent(new CustomEvent("change", {
2010
1938
  detail: {
2011
1939
  value: this.value
2012
1940
  },
@@ -2015,77 +1943,78 @@ class p extends a {
2015
1943
  }));
2016
1944
  });
2017
1945
  }
2018
- timeNow() {
2019
- console.log(this.timezone);
2020
- let e = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
2021
- timeZone: this.timezone || "America/New_York"
1946
+ dateNow() {
1947
+ let t = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
1948
+ timeZone: this.timezone
2022
1949
  });
2023
- if (console.log(e), console.log(e.split(" ")[2]), e.split(" ")[2] === "PM") {
2024
- let d = e.split(" ");
2025
- console.log(d), e = Number(d[1].split(":")[0]) + 12 + ":" + d[1].split(":")[1] + ":" + d[1].split(":")[2];
2026
- } else
2027
- e = e.split(" ")[1];
2028
- return e;
1950
+ return new Date(t).toISOString().slice(0, 10);
2029
1951
  }
2030
- setValue(e) {
2031
- this.value = e, this._internals.setFormValue(e), this.requestUpdate();
1952
+ setValue(t) {
1953
+ this.value = t, this._internals.setFormValue(t), this.requestUpdate();
2032
1954
  }
2033
- setError(e) {
2034
- if (typeof e != "error") {
1955
+ setError(t) {
1956
+ if (typeof t != "error") {
2035
1957
  console.warn("Error text must be a string");
2036
1958
  return;
2037
1959
  }
2038
- this.error = e, this._internals.setValidity({
2039
- customError: e
1960
+ this.error = t, this._internals.setValidity({
1961
+ customError: t
2040
1962
  }), this.requestUpdate();
2041
1963
  }
2042
- setDisabled(e) {
2043
- this.disabled = e, this._internals.setValidity({
2044
- customError: e
1964
+ setDisabled(t) {
1965
+ this.disabled = t, this._internals.setValidity({
1966
+ customError: t
2045
1967
  }), this.requestUpdate();
2046
1968
  }
2047
1969
  }
2048
- r(p, "formAssociated", !0), r(p, "distinctTimezones", [
2049
- "Etc/GMT+12",
2050
- "Pacific/Pago_Pago",
2051
- "Pacific/Honolulu",
2052
- "America/Anchorage",
2053
- "America/Los_Angeles",
2054
- "America/Denver",
2055
- "America/Chicago",
2056
- "America/New_York",
2057
- "America/Halifax",
2058
- "America/Argentina/Buenos_Aires",
2059
- "America/Noronha",
2060
- "Atlantic/Azores",
2061
- "Europe/London",
2062
- "Europe/Paris",
2063
- "Europe/Bucharest",
2064
- "Europe/Moscow",
2065
- "Asia/Tehran",
2066
- "Asia/Dubai",
2067
- "Asia/Kabul",
2068
- "Asia/Karachi",
2069
- "Asia/Kolkata",
2070
- "Asia/Kathmandu",
2071
- "Asia/Dhaka",
2072
- "Asia/Yangon",
2073
- "Asia/Bangkok",
2074
- "Asia/Shanghai",
2075
- "Australia/Eucla",
2076
- "Asia/Tokyo",
2077
- "Australia/Darwin",
2078
- "Australia/Sydney",
2079
- "Australia/Lord_Howe",
2080
- "Pacific/Noumea",
2081
- "Pacific/Auckland",
2082
- "Pacific/Chatham",
2083
- "Pacific/Tongatapu",
2084
- "Pacific/Kiritimati"
2085
- ]), r(p, "styles", l`
1970
+ function U() {
1971
+ typeof window < "u" && !customElements.get("cd-date") && customElements.define("cd-date", S);
1972
+ }
1973
+ d();
1974
+ class A extends r {
1975
+ static formAssociated = !0;
1976
+ static distinctTimezones = [
1977
+ "Etc/GMT+12",
1978
+ "Pacific/Pago_Pago",
1979
+ "Pacific/Honolulu",
1980
+ "America/Anchorage",
1981
+ "America/Los_Angeles",
1982
+ "America/Denver",
1983
+ "America/Chicago",
1984
+ "America/New_York",
1985
+ "America/Halifax",
1986
+ "America/Argentina/Buenos_Aires",
1987
+ "America/Noronha",
1988
+ "Atlantic/Azores",
1989
+ "Europe/London",
1990
+ "Europe/Paris",
1991
+ "Europe/Bucharest",
1992
+ "Europe/Moscow",
1993
+ "Asia/Tehran",
1994
+ "Asia/Dubai",
1995
+ "Asia/Kabul",
1996
+ "Asia/Karachi",
1997
+ "Asia/Kolkata",
1998
+ "Asia/Kathmandu",
1999
+ "Asia/Dhaka",
2000
+ "Asia/Yangon",
2001
+ "Asia/Bangkok",
2002
+ "Asia/Shanghai",
2003
+ "Australia/Eucla",
2004
+ "Asia/Tokyo",
2005
+ "Australia/Darwin",
2006
+ "Australia/Sydney",
2007
+ "Australia/Lord_Howe",
2008
+ "Pacific/Noumea",
2009
+ "Pacific/Auckland",
2010
+ "Pacific/Chatham",
2011
+ "Pacific/Tongatapu",
2012
+ "Pacific/Kiritimati"
2013
+ ];
2014
+ static styles = a`
2086
2015
  @font-face {
2087
2016
  font-family: 'Geist';
2088
- src: url(${n(s)}) format('woff');
2017
+ src: url(${o(i)}) format('woff');
2089
2018
  font-weight: 100 900;
2090
2019
  font-style: normal;
2091
2020
  }
@@ -2167,61 +2096,146 @@ r(p, "formAssociated", !0), r(p, "distinctTimezones", [
2167
2096
  height: 36px;
2168
2097
  padding: 0 var(--input-horizontal-inline-padding-sm, 12px);
2169
2098
  }
2170
- `), r(p, "properties", {
2171
- value: {
2172
- type: String,
2173
- reflect: !0
2174
- },
2175
- shortcut: {
2176
- type: String,
2177
- reflect: !0
2178
- },
2179
- error: {
2180
- type: Boolean,
2181
- reflect: !0,
2182
- attribute: "error"
2183
- },
2184
- disabled: {
2185
- type: Boolean,
2186
- reflect: !0
2187
- },
2188
- form: {
2189
- type: String,
2190
- reflect: !0,
2191
- attribute: "form"
2192
- },
2193
- size: {
2194
- type: String,
2195
- reflect: !0,
2196
- attribute: "size",
2197
- converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md"
2198
- },
2199
- fullWidth: {
2200
- type: Boolean,
2201
- reflect: !0,
2202
- attribute: "full-width"
2203
- },
2204
- variant: {
2205
- type: String,
2206
- reflect: !0,
2207
- attribute: "variant",
2208
- converter: (e) => ["dashed", "dotted"].includes(e) ? e : "default"
2209
- },
2210
- timezone: {
2211
- type: String,
2212
- reflect: !0,
2213
- attribute: "timezone",
2214
- converter: (e) => distinctTimezones.includes(e) ? e : "America/New_York"
2099
+ `;
2100
+ static properties = {
2101
+ value: {
2102
+ type: String,
2103
+ reflect: !0
2104
+ },
2105
+ shortcut: {
2106
+ type: String,
2107
+ reflect: !0
2108
+ },
2109
+ error: {
2110
+ type: Boolean,
2111
+ reflect: !0,
2112
+ attribute: "error"
2113
+ },
2114
+ disabled: {
2115
+ type: Boolean,
2116
+ reflect: !0
2117
+ },
2118
+ form: {
2119
+ type: String,
2120
+ reflect: !0,
2121
+ attribute: "form"
2122
+ },
2123
+ size: {
2124
+ type: String,
2125
+ reflect: !0,
2126
+ attribute: "size",
2127
+ converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
2128
+ },
2129
+ fullWidth: {
2130
+ type: Boolean,
2131
+ reflect: !0,
2132
+ attribute: "full-width"
2133
+ },
2134
+ variant: {
2135
+ type: String,
2136
+ reflect: !0,
2137
+ attribute: "variant",
2138
+ converter: (t) => ["dashed", "dotted"].includes(t) ? t : "default"
2139
+ },
2140
+ timezone: {
2141
+ type: String,
2142
+ reflect: !0,
2143
+ attribute: "timezone",
2144
+ converter: (t) => distinctTimezones.includes(t) ? t : "America/New_York"
2145
+ }
2146
+ };
2147
+ constructor() {
2148
+ super(), this.value = "", this.shortcut = void 0, this.error = !1, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
2149
+ customError: this.errorText && this.errorText.length > 0 || !1
2150
+ });
2151
+ }
2152
+ handleChange = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
2153
+ detail: {
2154
+ value: this.value
2155
+ },
2156
+ bubbles: !0,
2157
+ composed: !0
2158
+ })), this.value);
2159
+ handleInput = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
2160
+ detail: {
2161
+ value: this.value
2162
+ },
2163
+ bubbles: !0,
2164
+ composed: !0
2165
+ })), this.value);
2166
+ handleFocus = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
2167
+ detail: {
2168
+ value: this.value
2169
+ },
2170
+ bubbles: !0,
2171
+ composed: !0
2172
+ })), this.value);
2173
+ handleBlur = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
2174
+ detail: {
2175
+ value: this.value
2176
+ },
2177
+ bubbles: !0,
2178
+ composed: !0
2179
+ })), this.value);
2180
+ render() {
2181
+ return e`
2182
+ <input class='${this.error ? "input-error" : ""} ${this.disabled ? "disabled" : ""} ${this.fullWidth ? "full-width" : ""} ${this.variant} ${this.size}' type='time' id='${this.name | "time"}' name='${this.name | "time"}' .value='${this.value}' @change='${this.handleChange}' @focus='${this.handleFocus}' @blur='${this.handleBlur}' @input='${this.handleInput}' ?disabled='${this.disabled}' />
2183
+ ${this.shortcut ? e`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
2184
+ `;
2185
+ }
2186
+ firstUpdated() {
2187
+ if (!this.shadowRoot) {
2188
+ console.warn("Shadow DOM not available, TimeComponent may not render correctly.");
2189
+ return;
2190
+ }
2191
+ this.shadowRoot.querySelector("cd-button") && this.shadowRoot.querySelector("cd-button").addEventListener("button-click", () => {
2192
+ this.setValue(this.timeNow()), this.dispatchEvent(new CustomEvent("change", {
2193
+ detail: {
2194
+ value: this.value
2195
+ },
2196
+ bubbles: !0,
2197
+ composed: !0
2198
+ }));
2199
+ });
2200
+ }
2201
+ timeNow() {
2202
+ console.log(this.timezone);
2203
+ let t = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
2204
+ timeZone: this.timezone || "America/New_York"
2205
+ });
2206
+ if (console.log(t), console.log(t.split(" ")[2]), t.split(" ")[2] === "PM") {
2207
+ let l = t.split(" ");
2208
+ console.log(l), t = Number(l[1].split(":")[0]) + 12 + ":" + l[1].split(":")[1] + ":" + l[1].split(":")[2];
2209
+ } else
2210
+ t = t.split(" ")[1];
2211
+ return t;
2212
+ }
2213
+ setValue(t) {
2214
+ this.value = t, this._internals.setFormValue(t), this.requestUpdate();
2215
+ }
2216
+ setError(t) {
2217
+ if (typeof t != "error") {
2218
+ console.warn("Error text must be a string");
2219
+ return;
2220
+ }
2221
+ this.error = t, this._internals.setValidity({
2222
+ customError: t
2223
+ }), this.requestUpdate();
2215
2224
  }
2216
- });
2217
- function H() {
2218
- typeof window < "u" && !customElements.get("cd-time") && customElements.define("cd-time", p);
2225
+ setDisabled(t) {
2226
+ this.disabled = t, this._internals.setValidity({
2227
+ customError: t
2228
+ }), this.requestUpdate();
2229
+ }
2230
+ }
2231
+ function K() {
2232
+ typeof window < "u" && !customElements.get("cd-time") && customElements.define("cd-time", A);
2219
2233
  }
2220
2234
  export {
2221
- b as Button,
2222
- u as DateComponent,
2223
- f as Header,
2224
- v as Input,
2235
+ v as Button,
2236
+ S as DateComponent,
2237
+ b as Header,
2238
+ f as Input,
2225
2239
  g as NavBar,
2226
2240
  m as NavItem,
2227
2241
  w as NavProfile,
@@ -2229,22 +2243,22 @@ export {
2229
2243
  E as Tab,
2230
2244
  z as TabContainer,
2231
2245
  y as Table,
2232
- p as TimeComponent,
2246
+ A as TimeComponent,
2233
2247
  x as ToolTip,
2234
2248
  k as Value,
2235
- A as registerButton,
2236
- O as registerDate,
2237
- D as registerHeader,
2238
- T as registerInput,
2239
- P as registerNavBar,
2240
- G as registerNavItem,
2241
- U as registerNavProfile,
2242
- M as registerSearch,
2243
- W as registerTab,
2244
- Y as registerTabContainer,
2245
- F as registerTable,
2246
- H as registerTime,
2247
- N as registerToolTip,
2248
- K as registerValue
2249
+ d as registerButton,
2250
+ U as registerDate,
2251
+ T as registerHeader,
2252
+ q as registerInput,
2253
+ V as registerNavBar,
2254
+ I as registerNavItem,
2255
+ L as registerNavProfile,
2256
+ N as registerSearch,
2257
+ G as registerTab,
2258
+ F as registerTabContainer,
2259
+ D as registerTable,
2260
+ K as registerTime,
2261
+ R as registerToolTip,
2262
+ P as registerValue
2249
2263
  };
2250
2264
  //# sourceMappingURL=index.es.js.map