@voidable/ui 0.3.0 → 0.5.0

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +467 -0
  2. package/dist/ui.js +2033 -245
  3. package/package.json +1 -1
package/dist/ui.js CHANGED
@@ -243,7 +243,7 @@ s([r({
243
243
  })], f.prototype, "size", void 0), customElements.get("void-avatar") || customElements.define("void-avatar", f);
244
244
  //#endregion
245
245
  //#region src/components/alert.ts
246
- var p = class extends o {
246
+ var re = class extends o {
247
247
  constructor(...e) {
248
248
  super(...e), this.color = "default", this.dismissible = !1, this.variant = "subtle", this._userContent = [], this._didSetup = !1;
249
249
  }
@@ -269,16 +269,16 @@ var p = class extends o {
269
269
  s([r({
270
270
  type: String,
271
271
  reflect: !0
272
- })], p.prototype, "color", void 0), s([r({
272
+ })], re.prototype, "color", void 0), s([r({
273
273
  type: Boolean,
274
274
  reflect: !0
275
- })], p.prototype, "dismissible", void 0), s([r({
275
+ })], re.prototype, "dismissible", void 0), s([r({
276
276
  type: String,
277
277
  reflect: !0
278
- })], p.prototype, "variant", void 0), customElements.get("void-alert") || customElements.define("void-alert", p);
278
+ })], re.prototype, "variant", void 0), customElements.get("void-alert") || customElements.define("void-alert", re);
279
279
  //#endregion
280
280
  //#region src/components/tag.ts
281
- var m = class extends o {
281
+ var ie = class extends o {
282
282
  constructor(...e) {
283
283
  super(...e), this.color = "default", this.removable = !1, this.size = "md", this._userContent = [], this._didSetup = !1;
284
284
  }
@@ -305,16 +305,16 @@ var m = class extends o {
305
305
  s([r({
306
306
  type: String,
307
307
  reflect: !0
308
- })], m.prototype, "color", void 0), s([r({
308
+ })], ie.prototype, "color", void 0), s([r({
309
309
  type: Boolean,
310
310
  reflect: !0
311
- })], m.prototype, "removable", void 0), s([r({
311
+ })], ie.prototype, "removable", void 0), s([r({
312
312
  type: String,
313
313
  reflect: !0
314
- })], m.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", m);
314
+ })], ie.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", ie);
315
315
  //#endregion
316
316
  //#region src/components/progress.ts
317
- var h = class extends o {
317
+ var p = class extends o {
318
318
  constructor(...e) {
319
319
  super(...e), this.value = 0, this.max = 100, this.color = "default", this.size = "md", this.indeterminate = !1;
320
320
  }
@@ -332,22 +332,22 @@ var h = class extends o {
332
332
  s([r({
333
333
  type: Number,
334
334
  reflect: !0
335
- })], h.prototype, "value", void 0), s([r({
335
+ })], p.prototype, "value", void 0), s([r({
336
336
  type: Number,
337
337
  reflect: !0
338
- })], h.prototype, "max", void 0), s([r({
338
+ })], p.prototype, "max", void 0), s([r({
339
339
  type: String,
340
340
  reflect: !0
341
- })], h.prototype, "color", void 0), s([r({
341
+ })], p.prototype, "color", void 0), s([r({
342
342
  type: String,
343
343
  reflect: !0
344
- })], h.prototype, "size", void 0), s([r({
344
+ })], p.prototype, "size", void 0), s([r({
345
345
  type: Boolean,
346
346
  reflect: !0
347
- })], h.prototype, "indeterminate", void 0), customElements.get("void-progress") || customElements.define("void-progress", h);
347
+ })], p.prototype, "indeterminate", void 0), customElements.get("void-progress") || customElements.define("void-progress", p);
348
348
  //#endregion
349
349
  //#region src/components/panel.ts
350
- var g = class extends o {
350
+ var ae = class extends o {
351
351
  constructor(...e) {
352
352
  super(...e), this.label = "", this.variant = "default", this._userContent = [], this._didSetup = !1;
353
353
  }
@@ -367,13 +367,13 @@ var g = class extends o {
367
367
  s([r({
368
368
  type: String,
369
369
  reflect: !0
370
- })], g.prototype, "label", void 0), s([r({
370
+ })], ae.prototype, "label", void 0), s([r({
371
371
  type: String,
372
372
  reflect: !0
373
- })], g.prototype, "variant", void 0), customElements.get("void-panel") || customElements.define("void-panel", g);
373
+ })], ae.prototype, "variant", void 0), customElements.get("void-panel") || customElements.define("void-panel", ae);
374
374
  //#endregion
375
375
  //#region src/components/input.ts
376
- var _ = class extends o {
376
+ var m = class extends o {
377
377
  constructor(...e) {
378
378
  super(...e), this.type = "text", this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.size = "md", this.error = "";
379
379
  }
@@ -417,31 +417,31 @@ var _ = class extends o {
417
417
  s([r({
418
418
  type: String,
419
419
  reflect: !0
420
- })], _.prototype, "type", void 0), s([r({ type: String })], _.prototype, "value", void 0), s([r({
420
+ })], m.prototype, "type", void 0), s([r({ type: String })], m.prototype, "value", void 0), s([r({
421
421
  type: String,
422
422
  reflect: !0
423
- })], _.prototype, "placeholder", void 0), s([r({
423
+ })], m.prototype, "placeholder", void 0), s([r({
424
424
  type: Boolean,
425
425
  reflect: !0
426
- })], _.prototype, "disabled", void 0), s([r({
426
+ })], m.prototype, "disabled", void 0), s([r({
427
427
  type: Boolean,
428
428
  reflect: !0
429
- })], _.prototype, "readonly", void 0), s([r({
429
+ })], m.prototype, "readonly", void 0), s([r({
430
430
  type: Boolean,
431
431
  reflect: !0
432
- })], _.prototype, "required", void 0), s([r({
432
+ })], m.prototype, "required", void 0), s([r({
433
433
  type: String,
434
434
  reflect: !0
435
- })], _.prototype, "name", void 0), s([r({
435
+ })], m.prototype, "name", void 0), s([r({
436
436
  type: String,
437
437
  reflect: !0
438
- })], _.prototype, "size", void 0), s([r({
438
+ })], m.prototype, "size", void 0), s([r({
439
439
  type: String,
440
440
  reflect: !0
441
- })], _.prototype, "error", void 0), customElements.get("void-input") || customElements.define("void-input", _);
441
+ })], m.prototype, "error", void 0), customElements.get("void-input") || customElements.define("void-input", m);
442
442
  //#endregion
443
443
  //#region src/components/textarea.ts
444
- var v = class extends o {
444
+ var h = class extends o {
445
445
  constructor(...e) {
446
446
  super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.rows = 3, this.resize = "vertical", this.size = "md", this.error = "";
447
447
  }
@@ -483,37 +483,37 @@ var v = class extends o {
483
483
  }));
484
484
  }
485
485
  };
486
- s([r({ type: String })], v.prototype, "value", void 0), s([r({
486
+ s([r({ type: String })], h.prototype, "value", void 0), s([r({
487
487
  type: String,
488
488
  reflect: !0
489
- })], v.prototype, "placeholder", void 0), s([r({
489
+ })], h.prototype, "placeholder", void 0), s([r({
490
490
  type: Boolean,
491
491
  reflect: !0
492
- })], v.prototype, "disabled", void 0), s([r({
492
+ })], h.prototype, "disabled", void 0), s([r({
493
493
  type: Boolean,
494
494
  reflect: !0
495
- })], v.prototype, "readonly", void 0), s([r({
495
+ })], h.prototype, "readonly", void 0), s([r({
496
496
  type: Boolean,
497
497
  reflect: !0
498
- })], v.prototype, "required", void 0), s([r({
498
+ })], h.prototype, "required", void 0), s([r({
499
499
  type: String,
500
500
  reflect: !0
501
- })], v.prototype, "name", void 0), s([r({
501
+ })], h.prototype, "name", void 0), s([r({
502
502
  type: Number,
503
503
  reflect: !0
504
- })], v.prototype, "rows", void 0), s([r({
504
+ })], h.prototype, "rows", void 0), s([r({
505
505
  type: String,
506
506
  reflect: !0
507
- })], v.prototype, "resize", void 0), s([r({
507
+ })], h.prototype, "resize", void 0), s([r({
508
508
  type: String,
509
509
  reflect: !0
510
- })], v.prototype, "size", void 0), s([r({
510
+ })], h.prototype, "size", void 0), s([r({
511
511
  type: String,
512
512
  reflect: !0
513
- })], v.prototype, "error", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", v);
513
+ })], h.prototype, "error", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", h);
514
514
  //#endregion
515
515
  //#region src/components/select.ts
516
- var y = class extends o {
516
+ var g = class extends o {
517
517
  constructor(...e) {
518
518
  super(...e), this.value = "", this.disabled = !1, this.required = !1, this.name = "", this.size = "md", this.error = "", this.placeholder = "", this._options = [], this._didSetup = !1;
519
519
  }
@@ -551,28 +551,28 @@ var y = class extends o {
551
551
  }));
552
552
  }
553
553
  };
554
- s([r({ type: String })], y.prototype, "value", void 0), s([r({
554
+ s([r({ type: String })], g.prototype, "value", void 0), s([r({
555
555
  type: Boolean,
556
556
  reflect: !0
557
- })], y.prototype, "disabled", void 0), s([r({
557
+ })], g.prototype, "disabled", void 0), s([r({
558
558
  type: Boolean,
559
559
  reflect: !0
560
- })], y.prototype, "required", void 0), s([r({
560
+ })], g.prototype, "required", void 0), s([r({
561
561
  type: String,
562
562
  reflect: !0
563
- })], y.prototype, "name", void 0), s([r({
563
+ })], g.prototype, "name", void 0), s([r({
564
564
  type: String,
565
565
  reflect: !0
566
- })], y.prototype, "size", void 0), s([r({
566
+ })], g.prototype, "size", void 0), s([r({
567
567
  type: String,
568
568
  reflect: !0
569
- })], y.prototype, "error", void 0), s([r({
569
+ })], g.prototype, "error", void 0), s([r({
570
570
  type: String,
571
571
  reflect: !0
572
- })], y.prototype, "placeholder", void 0), customElements.get("void-select") || customElements.define("void-select", y);
572
+ })], g.prototype, "placeholder", void 0), customElements.get("void-select") || customElements.define("void-select", g);
573
573
  //#endregion
574
574
  //#region src/components/checkbox.ts
575
- var b = class extends o {
575
+ var _ = class extends o {
576
576
  constructor(...e) {
577
577
  super(...e), this.checked = !1, this.disabled = !1, this.indeterminate = !1, this.name = "", this.value = "", this.color = "default", this.size = "md", this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
578
578
  if (this.disabled) {
@@ -615,28 +615,28 @@ var b = class extends o {
615
615
  s([r({
616
616
  type: Boolean,
617
617
  reflect: !0
618
- })], b.prototype, "checked", void 0), s([r({
618
+ })], _.prototype, "checked", void 0), s([r({
619
619
  type: Boolean,
620
620
  reflect: !0
621
- })], b.prototype, "disabled", void 0), s([r({
621
+ })], _.prototype, "disabled", void 0), s([r({
622
622
  type: Boolean,
623
623
  reflect: !0
624
- })], b.prototype, "indeterminate", void 0), s([r({
624
+ })], _.prototype, "indeterminate", void 0), s([r({
625
625
  type: String,
626
626
  reflect: !0
627
- })], b.prototype, "name", void 0), s([r({
627
+ })], _.prototype, "name", void 0), s([r({
628
628
  type: String,
629
629
  reflect: !0
630
- })], b.prototype, "value", void 0), s([r({
630
+ })], _.prototype, "value", void 0), s([r({
631
631
  type: String,
632
632
  reflect: !0
633
- })], b.prototype, "color", void 0), s([r({
633
+ })], _.prototype, "color", void 0), s([r({
634
634
  type: String,
635
635
  reflect: !0
636
- })], b.prototype, "size", void 0), customElements.get("void-checkbox") || customElements.define("void-checkbox", b);
636
+ })], _.prototype, "size", void 0), customElements.get("void-checkbox") || customElements.define("void-checkbox", _);
637
637
  //#endregion
638
638
  //#region src/components/radio.ts
639
- var x = class extends o {
639
+ var v = class extends o {
640
640
  constructor(...e) {
641
641
  super(...e), this.checked = !1, this.disabled = !1, this.name = "", this.value = "", this.color = "default", this.size = "md", this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
642
642
  if (this.disabled || this.checked) {
@@ -681,25 +681,25 @@ var x = class extends o {
681
681
  s([r({
682
682
  type: Boolean,
683
683
  reflect: !0
684
- })], x.prototype, "checked", void 0), s([r({
684
+ })], v.prototype, "checked", void 0), s([r({
685
685
  type: Boolean,
686
686
  reflect: !0
687
- })], x.prototype, "disabled", void 0), s([r({
687
+ })], v.prototype, "disabled", void 0), s([r({
688
688
  type: String,
689
689
  reflect: !0
690
- })], x.prototype, "name", void 0), s([r({
690
+ })], v.prototype, "name", void 0), s([r({
691
691
  type: String,
692
692
  reflect: !0
693
- })], x.prototype, "value", void 0), s([r({
693
+ })], v.prototype, "value", void 0), s([r({
694
694
  type: String,
695
695
  reflect: !0
696
- })], x.prototype, "color", void 0), s([r({
696
+ })], v.prototype, "color", void 0), s([r({
697
697
  type: String,
698
698
  reflect: !0
699
- })], x.prototype, "size", void 0), customElements.get("void-radio") || customElements.define("void-radio", x);
699
+ })], v.prototype, "size", void 0), customElements.get("void-radio") || customElements.define("void-radio", v);
700
700
  //#endregion
701
701
  //#region src/components/radio-group.ts
702
- var S = class extends o {
702
+ var y = class extends o {
703
703
  constructor(...e) {
704
704
  super(...e), this.label = "", this.value = "", this.name = "", this.orientation = "vertical", this._userContent = [], this._didSetup = !1, this._handleChildChange = (e) => {
705
705
  let t = e.target;
@@ -744,13 +744,13 @@ var S = class extends o {
744
744
  `;
745
745
  }
746
746
  };
747
- s([r({ type: String })], S.prototype, "label", void 0), s([r({ type: String })], S.prototype, "value", void 0), s([r({ type: String })], S.prototype, "name", void 0), s([r({
747
+ s([r({ type: String })], y.prototype, "label", void 0), s([r({ type: String })], y.prototype, "value", void 0), s([r({ type: String })], y.prototype, "name", void 0), s([r({
748
748
  type: String,
749
749
  reflect: !0
750
- })], S.prototype, "orientation", void 0), customElements.get("void-radio-group") || customElements.define("void-radio-group", S);
750
+ })], y.prototype, "orientation", void 0), customElements.get("void-radio-group") || customElements.define("void-radio-group", y);
751
751
  //#endregion
752
752
  //#region src/components/field.ts
753
- var C = class extends o {
753
+ var b = class extends o {
754
754
  constructor(...e) {
755
755
  super(...e), this.label = "", this.error = "", this.helper = "", this.required = !1, this._userContent = [], this._didSetup = !1;
756
756
  }
@@ -775,19 +775,19 @@ var C = class extends o {
775
775
  s([r({
776
776
  type: String,
777
777
  reflect: !0
778
- })], C.prototype, "label", void 0), s([r({
778
+ })], b.prototype, "label", void 0), s([r({
779
779
  type: String,
780
780
  reflect: !0
781
- })], C.prototype, "error", void 0), s([r({
781
+ })], b.prototype, "error", void 0), s([r({
782
782
  type: String,
783
783
  reflect: !0
784
- })], C.prototype, "helper", void 0), s([r({
784
+ })], b.prototype, "helper", void 0), s([r({
785
785
  type: Boolean,
786
786
  reflect: !0
787
- })], C.prototype, "required", void 0), customElements.get("void-field") || customElements.define("void-field", C);
787
+ })], b.prototype, "required", void 0), customElements.get("void-field") || customElements.define("void-field", b);
788
788
  //#endregion
789
789
  //#region src/components/multiselect.ts
790
- var w = class extends o {
790
+ var oe = class extends o {
791
791
  constructor(...e) {
792
792
  super(...e), this.value = "", this.selected = !1;
793
793
  }
@@ -795,11 +795,11 @@ var w = class extends o {
795
795
  s([r({
796
796
  type: String,
797
797
  reflect: !0
798
- })], w.prototype, "value", void 0), s([r({
798
+ })], oe.prototype, "value", void 0), s([r({
799
799
  type: Boolean,
800
800
  reflect: !0
801
- })], w.prototype, "selected", void 0), customElements.get("void-option") || customElements.define("void-option", w);
802
- var T = class extends o {
801
+ })], oe.prototype, "selected", void 0), customElements.get("void-option") || customElements.define("void-option", oe);
802
+ var x = class extends o {
803
803
  constructor(...e) {
804
804
  super(...e), this.placeholder = "Select...", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this._open = !1, this._options = [], this._didSetup = !1, this._onTriggerClick = (e) => {
805
805
  this.disabled || (e.stopPropagation(), this._open = !this._open, this.requestUpdate());
@@ -884,22 +884,22 @@ var T = class extends o {
884
884
  }));
885
885
  }
886
886
  };
887
- s([r({ type: String })], T.prototype, "placeholder", void 0), s([r({
887
+ s([r({ type: String })], x.prototype, "placeholder", void 0), s([r({
888
888
  type: Boolean,
889
889
  reflect: !0
890
- })], T.prototype, "disabled", void 0), s([r({
890
+ })], x.prototype, "disabled", void 0), s([r({
891
891
  type: String,
892
892
  reflect: !0
893
- })], T.prototype, "size", void 0), s([r({
893
+ })], x.prototype, "size", void 0), s([r({
894
894
  type: String,
895
895
  reflect: !0
896
- })], T.prototype, "error", void 0), s([r({
896
+ })], x.prototype, "error", void 0), s([r({
897
897
  type: String,
898
898
  reflect: !0
899
- })], T.prototype, "name", void 0), customElements.get("void-multiselect") || customElements.define("void-multiselect", T);
899
+ })], x.prototype, "name", void 0), customElements.get("void-multiselect") || customElements.define("void-multiselect", x);
900
900
  //#endregion
901
901
  //#region src/components/dialog.ts
902
- var E = class extends o {
902
+ var S = class extends o {
903
903
  constructor(...e) {
904
904
  super(...e), this.open = !1, this.heading = "", this.size = "md", this.closable = !0, this._userContent = [], this._didSetup = !1, this._handleKeydown = (e) => {
905
905
  e.key === "Escape" && this.closable && this._close();
@@ -914,9 +914,11 @@ var E = class extends o {
914
914
  }
915
915
  updated(e) {
916
916
  if (super.updated(e), e.has("heading") && (this.heading ? this.setAttribute("aria-label", this.heading) : this.removeAttribute("aria-label")), e.has("open") && (this.open ? (document.body.style.overflow = "hidden", document.addEventListener("keydown", this._handleKeydown), this._focusFirst()) : (document.body.style.overflow = "", document.removeEventListener("keydown", this._handleKeydown))), !this._didSetup) {
917
- this._didSetup = !0;
918
917
  let e = this.querySelector(".void-dialog-body");
919
- if (e) for (let t of this._userContent) e.appendChild(t);
918
+ if (e) {
919
+ this._didSetup = !0;
920
+ for (let t of this._userContent) e.appendChild(t);
921
+ }
920
922
  }
921
923
  }
922
924
  disconnectedCallback() {
@@ -950,13 +952,13 @@ var E = class extends o {
950
952
  s([r({
951
953
  type: Boolean,
952
954
  reflect: !0
953
- })], E.prototype, "open", void 0), s([r({ type: String })], E.prototype, "heading", void 0), s([r({
955
+ })], S.prototype, "open", void 0), s([r({ type: String })], S.prototype, "heading", void 0), s([r({
954
956
  type: String,
955
957
  reflect: !0
956
- })], E.prototype, "size", void 0), s([r({ type: Boolean })], E.prototype, "closable", void 0), customElements.get("void-dialog") || customElements.define("void-dialog", E);
958
+ })], S.prototype, "size", void 0), s([r({ type: Boolean })], S.prototype, "closable", void 0), customElements.get("void-dialog") || customElements.define("void-dialog", S);
957
959
  //#endregion
958
960
  //#region src/components/tabs.ts
959
- var D = class extends o {
961
+ var C = class extends o {
960
962
  constructor(...e) {
961
963
  super(...e), this.tab = "", this.label = "", this.active = !1;
962
964
  }
@@ -970,14 +972,14 @@ var D = class extends o {
970
972
  s([r({
971
973
  type: String,
972
974
  reflect: !0
973
- })], D.prototype, "tab", void 0), s([r({
975
+ })], C.prototype, "tab", void 0), s([r({
974
976
  type: String,
975
977
  reflect: !0
976
- })], D.prototype, "label", void 0), s([r({
978
+ })], C.prototype, "label", void 0), s([r({
977
979
  type: Boolean,
978
980
  reflect: !0
979
- })], D.prototype, "active", void 0), customElements.get("void-tab-panel") || customElements.define("void-tab-panel", D);
980
- var O = class extends o {
981
+ })], C.prototype, "active", void 0), customElements.get("void-tab-panel") || customElements.define("void-tab-panel", C);
982
+ var se = class extends o {
981
983
  constructor(...e) {
982
984
  super(...e), this.value = "", this.size = "md", this._panels = [];
983
985
  }
@@ -1020,13 +1022,13 @@ var O = class extends o {
1020
1022
  e.key === "ArrowRight" ? (e.preventDefault(), n[(t + 1) % n.length].focus()) : e.key === "ArrowLeft" && (e.preventDefault(), n[(t - 1 + n.length) % n.length].focus());
1021
1023
  }
1022
1024
  };
1023
- s([r({ type: String })], O.prototype, "value", void 0), s([r({
1025
+ s([r({ type: String })], se.prototype, "value", void 0), s([r({
1024
1026
  type: String,
1025
1027
  reflect: !0
1026
- })], O.prototype, "size", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", O);
1028
+ })], se.prototype, "size", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", se);
1027
1029
  //#endregion
1028
1030
  //#region src/components/accordion.ts
1029
- var k = class extends o {
1031
+ var ce = class extends o {
1030
1032
  constructor(...e) {
1031
1033
  super(...e), this.multiple = !1;
1032
1034
  }
@@ -1034,13 +1036,13 @@ var k = class extends o {
1034
1036
  s([r({
1035
1037
  type: Boolean,
1036
1038
  reflect: !0
1037
- })], k.prototype, "multiple", void 0), customElements.get("void-accordion") || customElements.define("void-accordion", k);
1038
- var A = class extends o {
1039
+ })], ce.prototype, "multiple", void 0), customElements.get("void-accordion") || customElements.define("void-accordion", ce);
1040
+ var le = class extends o {
1039
1041
  constructor(...e) {
1040
1042
  super(...e), this.heading = "", this.open = !1, this._id = Math.random().toString(36).slice(2), this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
1041
1043
  e.preventDefault(), this.open = !this.open;
1042
1044
  let t = this.parentElement;
1043
- if (t instanceof k && !t.multiple) {
1045
+ if (t instanceof ce && !t.multiple) {
1044
1046
  let e = Array.from(t.querySelectorAll("void-accordion-item"));
1045
1047
  for (let t of e) t !== this && (t.open = !1);
1046
1048
  }
@@ -1087,13 +1089,13 @@ var A = class extends o {
1087
1089
  `;
1088
1090
  }
1089
1091
  };
1090
- s([r({ type: String })], A.prototype, "heading", void 0), s([r({
1092
+ s([r({ type: String })], le.prototype, "heading", void 0), s([r({
1091
1093
  type: Boolean,
1092
1094
  reflect: !0
1093
- })], A.prototype, "open", void 0), customElements.get("void-accordion-item") || customElements.define("void-accordion-item", A);
1095
+ })], le.prototype, "open", void 0), customElements.get("void-accordion-item") || customElements.define("void-accordion-item", le);
1094
1096
  //#endregion
1095
1097
  //#region src/components/breadcrumbs.ts
1096
- var re = class extends o {
1098
+ var ue = class extends o {
1097
1099
  constructor(...e) {
1098
1100
  super(...e), this.separator = "/", this._items = [], this._didSetup = !1;
1099
1101
  }
@@ -1118,10 +1120,10 @@ var re = class extends o {
1118
1120
  return t`<ol class="void-breadcrumbs-list"></ol>`;
1119
1121
  }
1120
1122
  };
1121
- s([r({ type: String })], re.prototype, "separator", void 0), customElements.get("void-breadcrumbs") || customElements.define("void-breadcrumbs", re);
1123
+ s([r({ type: String })], ue.prototype, "separator", void 0), customElements.get("void-breadcrumbs") || customElements.define("void-breadcrumbs", ue);
1122
1124
  //#endregion
1123
1125
  //#region src/components/list.ts
1124
- var ie = class extends o {
1126
+ var de = class extends o {
1125
1127
  constructor(...e) {
1126
1128
  super(...e), this.dividers = !1;
1127
1129
  }
@@ -1132,8 +1134,8 @@ var ie = class extends o {
1132
1134
  s([r({
1133
1135
  type: Boolean,
1134
1136
  reflect: !0
1135
- })], ie.prototype, "dividers", void 0), customElements.get("void-list") || customElements.define("void-list", ie);
1136
- var j = class extends o {
1137
+ })], de.prototype, "dividers", void 0), customElements.get("void-list") || customElements.define("void-list", de);
1138
+ var fe = class extends o {
1137
1139
  constructor(...e) {
1138
1140
  super(...e), this.selected = !1, this.disabled = !1, this.interactive = !1, this._handleClick = () => {
1139
1141
  this.disabled || this.dispatchEvent(new CustomEvent("void-click", {
@@ -1153,16 +1155,16 @@ var j = class extends o {
1153
1155
  s([r({
1154
1156
  type: Boolean,
1155
1157
  reflect: !0
1156
- })], j.prototype, "selected", void 0), s([r({
1158
+ })], fe.prototype, "selected", void 0), s([r({
1157
1159
  type: Boolean,
1158
1160
  reflect: !0
1159
- })], j.prototype, "disabled", void 0), s([r({
1161
+ })], fe.prototype, "disabled", void 0), s([r({
1160
1162
  type: Boolean,
1161
1163
  reflect: !0
1162
- })], j.prototype, "interactive", void 0), customElements.get("void-list-item") || customElements.define("void-list-item", j);
1164
+ })], fe.prototype, "interactive", void 0), customElements.get("void-list-item") || customElements.define("void-list-item", fe);
1163
1165
  //#endregion
1164
1166
  //#region src/components/toast.ts
1165
- var M = class extends o {
1167
+ var w = class extends o {
1166
1168
  constructor(...e) {
1167
1169
  super(...e), this.color = "default", this.duration = 5e3, this.dismissable = !0, this.heading = "";
1168
1170
  }
@@ -1188,11 +1190,11 @@ var M = class extends o {
1188
1190
  s([r({
1189
1191
  type: String,
1190
1192
  reflect: !0
1191
- })], M.prototype, "color", void 0), s([r({ type: Number })], M.prototype, "duration", void 0), s([r({
1193
+ })], w.prototype, "color", void 0), s([r({ type: Number })], w.prototype, "duration", void 0), s([r({
1192
1194
  type: Boolean,
1193
1195
  reflect: !0
1194
- })], M.prototype, "dismissable", void 0), s([r({ type: String })], M.prototype, "heading", void 0), customElements.get("void-toast") || customElements.define("void-toast", M);
1195
- var ae = class extends o {
1196
+ })], w.prototype, "dismissable", void 0), s([r({ type: String })], w.prototype, "heading", void 0), customElements.get("void-toast") || customElements.define("void-toast", w);
1197
+ var pe = class extends o {
1196
1198
  constructor(...e) {
1197
1199
  super(...e), this.position = "bottom-right";
1198
1200
  }
@@ -1209,10 +1211,10 @@ var ae = class extends o {
1209
1211
  s([r({
1210
1212
  type: String,
1211
1213
  reflect: !0
1212
- })], ae.prototype, "position", void 0), customElements.get("void-toast-container") || customElements.define("void-toast-container", ae);
1214
+ })], pe.prototype, "position", void 0), customElements.get("void-toast-container") || customElements.define("void-toast-container", pe);
1213
1215
  //#endregion
1214
1216
  //#region src/components/stepper.ts
1215
- var N = class extends o {
1217
+ var me = class extends o {
1216
1218
  constructor(...e) {
1217
1219
  super(...e), this.value = 0, this.steps = "";
1218
1220
  }
@@ -1249,10 +1251,10 @@ var N = class extends o {
1249
1251
  s([r({
1250
1252
  type: Number,
1251
1253
  reflect: !0
1252
- })], N.prototype, "value", void 0), s([r({ reflect: !0 })], N.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", N);
1254
+ })], me.prototype, "value", void 0), s([r({ reflect: !0 })], me.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", me);
1253
1255
  //#endregion
1254
1256
  //#region src/components/drawer.ts
1255
- var P = class extends o {
1257
+ var T = class extends o {
1256
1258
  constructor(...e) {
1257
1259
  super(...e), this.open = !1, this.side = "right", this.size = "md", this.heading = "", this.closable = !0, this._userContent = [], this._didSetup = !1, this._handleKeydown = (e) => {
1258
1260
  e.key === "Escape" && this.open && this.closable && this._close();
@@ -1297,19 +1299,19 @@ var P = class extends o {
1297
1299
  s([r({
1298
1300
  type: Boolean,
1299
1301
  reflect: !0
1300
- })], P.prototype, "open", void 0), s([r({
1302
+ })], T.prototype, "open", void 0), s([r({
1301
1303
  type: String,
1302
1304
  reflect: !0
1303
- })], P.prototype, "side", void 0), s([r({
1305
+ })], T.prototype, "side", void 0), s([r({
1304
1306
  type: String,
1305
1307
  reflect: !0
1306
- })], P.prototype, "size", void 0), s([r({ type: String })], P.prototype, "heading", void 0), s([r({
1308
+ })], T.prototype, "size", void 0), s([r({ type: String })], T.prototype, "heading", void 0), s([r({
1307
1309
  type: Boolean,
1308
1310
  reflect: !0
1309
- })], P.prototype, "closable", void 0), customElements.get("void-drawer") || customElements.define("void-drawer", P);
1311
+ })], T.prototype, "closable", void 0), customElements.get("void-drawer") || customElements.define("void-drawer", T);
1310
1312
  //#endregion
1311
1313
  //#region src/components/card.ts
1312
- var F = class extends o {
1314
+ var he = class extends o {
1313
1315
  constructor(...e) {
1314
1316
  super(...e), this.heading = "", this.variant = "default", this.padding = "md", this._userContent = [], this._didSetup = !1;
1315
1317
  }
@@ -1327,16 +1329,16 @@ var F = class extends o {
1327
1329
  return t`${this.heading ? t`<div class="void-card-header"><span class="void-card-heading">${this.heading}</span></div>` : n}<div class="void-card-body"></div>`;
1328
1330
  }
1329
1331
  };
1330
- s([r({ type: String })], F.prototype, "heading", void 0), s([r({
1332
+ s([r({ type: String })], he.prototype, "heading", void 0), s([r({
1331
1333
  type: String,
1332
1334
  reflect: !0
1333
- })], F.prototype, "variant", void 0), s([r({
1335
+ })], he.prototype, "variant", void 0), s([r({
1334
1336
  type: String,
1335
1337
  reflect: !0
1336
- })], F.prototype, "padding", void 0), customElements.get("void-card") || customElements.define("void-card", F);
1338
+ })], he.prototype, "padding", void 0), customElements.get("void-card") || customElements.define("void-card", he);
1337
1339
  //#endregion
1338
1340
  //#region src/components/popover.ts
1339
- var I = class extends o {
1341
+ var ge = class extends o {
1340
1342
  constructor(...e) {
1341
1343
  super(...e), this.open = !1, this.position = "bottom", this.trigger = "click", this._triggerEl = null, this._contentNodes = [], this._didSetup = !1, this._handleTriggerClick = () => {
1342
1344
  this.open = !this.open, this.open || this._dispatchClose();
@@ -1375,16 +1377,16 @@ var I = class extends o {
1375
1377
  s([r({
1376
1378
  type: Boolean,
1377
1379
  reflect: !0
1378
- })], I.prototype, "open", void 0), s([r({
1380
+ })], ge.prototype, "open", void 0), s([r({
1379
1381
  type: String,
1380
1382
  reflect: !0
1381
- })], I.prototype, "position", void 0), s([r({
1383
+ })], ge.prototype, "position", void 0), s([r({
1382
1384
  type: String,
1383
1385
  reflect: !0
1384
- })], I.prototype, "trigger", void 0), customElements.get("void-popover") || customElements.define("void-popover", I);
1386
+ })], ge.prototype, "trigger", void 0), customElements.get("void-popover") || customElements.define("void-popover", ge);
1385
1387
  //#endregion
1386
1388
  //#region src/components/tooltip.ts
1387
- var L = class extends o {
1389
+ var E = class extends o {
1388
1390
  constructor(...e) {
1389
1391
  super(...e), this.text = "", this.position = "top", this.delay = 200, this._visible = !1, this._tooltipId = "void-tooltip-" + Math.random().toString(36).slice(2), this._userContent = [], this._didSetup = !1, this._onMouseEnter = () => {
1390
1392
  clearTimeout(this._timerId), this._timerId = setTimeout(() => {
@@ -1418,13 +1420,13 @@ var L = class extends o {
1418
1420
  return t`<span id="${this._tooltipId}" class="void-tooltip-bubble" role="tooltip" aria-label=${this.text}>${this.text}</span>`;
1419
1421
  }
1420
1422
  };
1421
- s([r({ type: String })], L.prototype, "text", void 0), s([r({
1423
+ s([r({ type: String })], E.prototype, "text", void 0), s([r({
1422
1424
  type: String,
1423
1425
  reflect: !0
1424
- })], L.prototype, "position", void 0), s([r({ type: Number })], L.prototype, "delay", void 0), s([a()], L.prototype, "_visible", void 0), customElements.get("void-tooltip") || customElements.define("void-tooltip", L);
1426
+ })], E.prototype, "position", void 0), s([r({ type: Number })], E.prototype, "delay", void 0), s([a()], E.prototype, "_visible", void 0), customElements.get("void-tooltip") || customElements.define("void-tooltip", E);
1425
1427
  //#endregion
1426
1428
  //#region src/components/banner.ts
1427
- var R = class extends o {
1429
+ var _e = class extends o {
1428
1430
  constructor(...e) {
1429
1431
  super(...e), this.color = "default", this.dismissable = !1, this.variant = "subtle", this._userContent = [], this._didSetup = !1;
1430
1432
  }
@@ -1450,16 +1452,16 @@ var R = class extends o {
1450
1452
  s([r({
1451
1453
  type: String,
1452
1454
  reflect: !0
1453
- })], R.prototype, "color", void 0), s([r({
1455
+ })], _e.prototype, "color", void 0), s([r({
1454
1456
  type: Boolean,
1455
1457
  reflect: !0
1456
- })], R.prototype, "dismissable", void 0), s([r({
1458
+ })], _e.prototype, "dismissable", void 0), s([r({
1457
1459
  type: String,
1458
1460
  reflect: !0
1459
- })], R.prototype, "variant", void 0), customElements.get("void-banner") || customElements.define("void-banner", R);
1461
+ })], _e.prototype, "variant", void 0), customElements.get("void-banner") || customElements.define("void-banner", _e);
1460
1462
  //#endregion
1461
1463
  //#region src/components/scroll-area.ts
1462
- var z = class extends o {
1464
+ var ve = class extends o {
1463
1465
  constructor(...e) {
1464
1466
  super(...e), this.maxHeight = "", this.direction = "vertical", this._userContent = [], this._didSetup = !1;
1465
1467
  }
@@ -1478,13 +1480,13 @@ var z = class extends o {
1478
1480
  return t`<div class="void-scroll-area-viewport"></div>`;
1479
1481
  }
1480
1482
  };
1481
- s([r({ type: String })], z.prototype, "maxHeight", void 0), s([r({
1483
+ s([r({ type: String })], ve.prototype, "maxHeight", void 0), s([r({
1482
1484
  type: String,
1483
1485
  reflect: !0
1484
- })], z.prototype, "direction", void 0), customElements.get("void-scroll-area") || customElements.define("void-scroll-area", z);
1486
+ })], ve.prototype, "direction", void 0), customElements.get("void-scroll-area") || customElements.define("void-scroll-area", ve);
1485
1487
  //#endregion
1486
1488
  //#region src/components/table.ts
1487
- var B = class extends o {
1489
+ var D = class extends o {
1488
1490
  constructor(...e) {
1489
1491
  super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1;
1490
1492
  }
@@ -1492,19 +1494,19 @@ var B = class extends o {
1492
1494
  s([r({
1493
1495
  type: Boolean,
1494
1496
  reflect: !0
1495
- })], B.prototype, "striped", void 0), s([r({
1497
+ })], D.prototype, "striped", void 0), s([r({
1496
1498
  type: Boolean,
1497
1499
  reflect: !0
1498
- })], B.prototype, "hoverable", void 0), s([r({
1500
+ })], D.prototype, "hoverable", void 0), s([r({
1499
1501
  type: Boolean,
1500
1502
  reflect: !0
1501
- })], B.prototype, "compact", void 0), s([r({
1503
+ })], D.prototype, "compact", void 0), s([r({
1502
1504
  type: Boolean,
1503
1505
  reflect: !0
1504
- })], B.prototype, "bordered", void 0), customElements.get("void-table") || customElements.define("void-table", B);
1506
+ })], D.prototype, "bordered", void 0), customElements.get("void-table") || customElements.define("void-table", D);
1505
1507
  //#endregion
1506
1508
  //#region src/components/pagination.ts
1507
- var V = class extends o {
1509
+ var O = class extends o {
1508
1510
  constructor(...e) {
1509
1511
  super(...e), this.total = 1, this.value = 1, this.siblings = 1, this.size = "md";
1510
1512
  }
@@ -1549,16 +1551,16 @@ var V = class extends o {
1549
1551
  `;
1550
1552
  }
1551
1553
  };
1552
- s([r({ type: Number })], V.prototype, "total", void 0), s([r({
1554
+ s([r({ type: Number })], O.prototype, "total", void 0), s([r({
1553
1555
  type: Number,
1554
1556
  reflect: !0
1555
- })], V.prototype, "value", void 0), s([r({ type: Number })], V.prototype, "siblings", void 0), s([r({
1557
+ })], O.prototype, "value", void 0), s([r({ type: Number })], O.prototype, "siblings", void 0), s([r({
1556
1558
  type: String,
1557
1559
  reflect: !0
1558
- })], V.prototype, "size", void 0), customElements.get("void-pagination") || customElements.define("void-pagination", V);
1560
+ })], O.prototype, "size", void 0), customElements.get("void-pagination") || customElements.define("void-pagination", O);
1559
1561
  //#endregion
1560
1562
  //#region src/components/error-fallback.ts
1561
- var H = class extends o {
1563
+ var k = class extends o {
1562
1564
  constructor(...e) {
1563
1565
  super(...e), this.heading = "Something went wrong", this.message = "", this.retryable = !1, this.retryLabel = "Try again", this.icon = !0;
1564
1566
  }
@@ -1582,13 +1584,13 @@ var H = class extends o {
1582
1584
  `;
1583
1585
  }
1584
1586
  };
1585
- s([r({ type: String })], H.prototype, "heading", void 0), s([r({ type: String })], H.prototype, "message", void 0), s([r({
1587
+ s([r({ type: String })], k.prototype, "heading", void 0), s([r({ type: String })], k.prototype, "message", void 0), s([r({
1586
1588
  type: Boolean,
1587
1589
  reflect: !0
1588
- })], H.prototype, "retryable", void 0), s([r({ type: String })], H.prototype, "retryLabel", void 0), s([r({ type: Boolean })], H.prototype, "icon", void 0), customElements.get("void-error-fallback") || customElements.define("void-error-fallback", H);
1590
+ })], k.prototype, "retryable", void 0), s([r({ type: String })], k.prototype, "retryLabel", void 0), s([r({ type: Boolean })], k.prototype, "icon", void 0), customElements.get("void-error-fallback") || customElements.define("void-error-fallback", k);
1589
1591
  //#endregion
1590
1592
  //#region src/components/checkbox-group.ts
1591
- var U = class extends o {
1593
+ var ye = class extends o {
1592
1594
  constructor(...e) {
1593
1595
  super(...e), this.label = "", this.orientation = "vertical", this._userContent = [], this._didSetup = !1, this._handleChildChange = (e) => {
1594
1596
  let t = e.target;
@@ -1625,13 +1627,13 @@ var U = class extends o {
1625
1627
  s([r({
1626
1628
  type: String,
1627
1629
  reflect: !0
1628
- })], U.prototype, "label", void 0), s([r({
1630
+ })], ye.prototype, "label", void 0), s([r({
1629
1631
  type: String,
1630
1632
  reflect: !0
1631
- })], U.prototype, "orientation", void 0), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", U);
1633
+ })], ye.prototype, "orientation", void 0), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", ye);
1632
1634
  //#endregion
1633
1635
  //#region src/components/combobox.ts
1634
- var W = class extends o {
1636
+ var A = class extends o {
1635
1637
  constructor(...e) {
1636
1638
  super(...e), this.value = "", this.placeholder = "Search...", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this._open = !1, this._query = "", this._options = [], this._onInputFocus = () => {
1637
1639
  this.disabled || (this._open = !0, this._query = "", this.requestUpdate());
@@ -1700,22 +1702,22 @@ var W = class extends o {
1700
1702
  }));
1701
1703
  }
1702
1704
  };
1703
- s([r({ type: String })], W.prototype, "value", void 0), s([r({ type: String })], W.prototype, "placeholder", void 0), s([r({
1705
+ s([r({ type: String })], A.prototype, "value", void 0), s([r({ type: String })], A.prototype, "placeholder", void 0), s([r({
1704
1706
  type: Boolean,
1705
1707
  reflect: !0
1706
- })], W.prototype, "disabled", void 0), s([r({
1708
+ })], A.prototype, "disabled", void 0), s([r({
1707
1709
  type: String,
1708
1710
  reflect: !0
1709
- })], W.prototype, "size", void 0), s([r({
1711
+ })], A.prototype, "size", void 0), s([r({
1710
1712
  type: String,
1711
1713
  reflect: !0
1712
- })], W.prototype, "error", void 0), s([r({
1714
+ })], A.prototype, "error", void 0), s([r({
1713
1715
  type: String,
1714
1716
  reflect: !0
1715
- })], W.prototype, "name", void 0), customElements.get("void-combobox") || customElements.define("void-combobox", W);
1717
+ })], A.prototype, "name", void 0), customElements.get("void-combobox") || customElements.define("void-combobox", A);
1716
1718
  //#endregion
1717
1719
  //#region src/components/slider.ts
1718
- var G = class extends o {
1720
+ var j = class extends o {
1719
1721
  constructor(...e) {
1720
1722
  super(...e), this.value = 50, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.name = "", this.showValue = !1, this.size = "md";
1721
1723
  }
@@ -1755,7 +1757,7 @@ var G = class extends o {
1755
1757
  step=${this.step}
1756
1758
  ?disabled=${this.disabled}
1757
1759
  name=${this.name}
1758
- style="--fill: ${e}%"
1760
+ style="--void-slider-fill: ${e}%"
1759
1761
  @input=${this._onInput}
1760
1762
  @change=${this._onChange}
1761
1763
  />
@@ -1763,22 +1765,22 @@ var G = class extends o {
1763
1765
  `;
1764
1766
  }
1765
1767
  };
1766
- s([r({ type: Number })], G.prototype, "value", void 0), s([r({ type: Number })], G.prototype, "min", void 0), s([r({ type: Number })], G.prototype, "max", void 0), s([r({ type: Number })], G.prototype, "step", void 0), s([r({
1768
+ s([r({ type: Number })], j.prototype, "value", void 0), s([r({ type: Number })], j.prototype, "min", void 0), s([r({ type: Number })], j.prototype, "max", void 0), s([r({ type: Number })], j.prototype, "step", void 0), s([r({
1767
1769
  type: Boolean,
1768
1770
  reflect: !0
1769
- })], G.prototype, "disabled", void 0), s([r({
1771
+ })], j.prototype, "disabled", void 0), s([r({
1770
1772
  type: String,
1771
1773
  reflect: !0
1772
- })], G.prototype, "name", void 0), s([r({
1774
+ })], j.prototype, "name", void 0), s([r({
1773
1775
  type: Boolean,
1774
1776
  reflect: !0
1775
- })], G.prototype, "showValue", void 0), s([r({
1777
+ })], j.prototype, "showValue", void 0), s([r({
1776
1778
  type: String,
1777
1779
  reflect: !0
1778
- })], G.prototype, "size", void 0), customElements.get("void-slider") || customElements.define("void-slider", G);
1780
+ })], j.prototype, "size", void 0), customElements.get("void-slider") || customElements.define("void-slider", j);
1779
1781
  //#endregion
1780
1782
  //#region src/components/file-upload.ts
1781
- var K = class extends o {
1783
+ var M = class extends o {
1782
1784
  constructor(...e) {
1783
1785
  super(...e), this.accept = "", this.multiple = !1, this.disabled = !1, this.maxSize = 0, this.error = "", this._files = [], this._onDropzoneClick = () => {
1784
1786
  this.disabled || this._input?.click();
@@ -1804,7 +1806,7 @@ var K = class extends o {
1804
1806
  return t`
1805
1807
  <input
1806
1808
  type="file"
1807
- style="display:none"
1809
+ class="void-file-upload-input"
1808
1810
  accept=${this.accept || n}
1809
1811
  ?multiple=${this.multiple}
1810
1812
  ?disabled=${this.disabled}
@@ -1859,19 +1861,19 @@ var K = class extends o {
1859
1861
  }));
1860
1862
  }
1861
1863
  };
1862
- s([r({ type: String })], K.prototype, "accept", void 0), s([r({
1864
+ s([r({ type: String })], M.prototype, "accept", void 0), s([r({
1863
1865
  type: Boolean,
1864
1866
  reflect: !0
1865
- })], K.prototype, "multiple", void 0), s([r({
1867
+ })], M.prototype, "multiple", void 0), s([r({
1866
1868
  type: Boolean,
1867
1869
  reflect: !0
1868
- })], K.prototype, "disabled", void 0), s([r({ type: Number })], K.prototype, "maxSize", void 0), s([r({
1870
+ })], M.prototype, "disabled", void 0), s([r({ type: Number })], M.prototype, "maxSize", void 0), s([r({
1869
1871
  type: String,
1870
1872
  reflect: !0
1871
- })], K.prototype, "error", void 0), customElements.get("void-file-upload") || customElements.define("void-file-upload", K);
1873
+ })], M.prototype, "error", void 0), customElements.get("void-file-upload") || customElements.define("void-file-upload", M);
1872
1874
  //#endregion
1873
1875
  //#region src/components/nav-bar.ts
1874
- var q = class extends o {
1876
+ var N = class extends o {
1875
1877
  constructor(...e) {
1876
1878
  super(...e), this.sticky = !1, this.bordered = !0, this.variant = "default", this._userContent = [], this._didSetup = !1;
1877
1879
  }
@@ -1892,16 +1894,16 @@ var q = class extends o {
1892
1894
  s([r({
1893
1895
  type: Boolean,
1894
1896
  reflect: !0
1895
- })], q.prototype, "sticky", void 0), s([r({
1897
+ })], N.prototype, "sticky", void 0), s([r({
1896
1898
  type: Boolean,
1897
1899
  reflect: !0
1898
- })], q.prototype, "bordered", void 0), s([r({
1900
+ })], N.prototype, "bordered", void 0), s([r({
1899
1901
  type: String,
1900
1902
  reflect: !0
1901
- })], q.prototype, "variant", void 0), customElements.get("void-nav-bar") || customElements.define("void-nav-bar", q);
1903
+ })], N.prototype, "variant", void 0), customElements.get("void-nav-bar") || customElements.define("void-nav-bar", N);
1902
1904
  //#endregion
1903
1905
  //#region src/components/hamburger.ts
1904
- var oe = class extends o {
1906
+ var be = class extends o {
1905
1907
  constructor(...e) {
1906
1908
  super(...e), this.active = !1, this.size = "md", this._handleClick = () => {
1907
1909
  this.active = !this.active, this.dispatchEvent(new CustomEvent("void-toggle", {
@@ -1935,13 +1937,13 @@ var oe = class extends o {
1935
1937
  s([r({
1936
1938
  type: Boolean,
1937
1939
  reflect: !0
1938
- })], oe.prototype, "active", void 0), s([r({
1940
+ })], be.prototype, "active", void 0), s([r({
1939
1941
  type: String,
1940
1942
  reflect: !0
1941
- })], oe.prototype, "size", void 0), customElements.get("void-hamburger") || customElements.define("void-hamburger", oe);
1943
+ })], be.prototype, "size", void 0), customElements.get("void-hamburger") || customElements.define("void-hamburger", be);
1942
1944
  //#endregion
1943
1945
  //#region src/components/compose-input.ts
1944
- var J = class extends o {
1946
+ var P = class extends o {
1945
1947
  constructor(...e) {
1946
1948
  super(...e), this.value = "", this.placeholder = "Type a message...", this.disabled = !1, this.maxlength = 0;
1947
1949
  }
@@ -1995,19 +1997,19 @@ var J = class extends o {
1995
1997
  }));
1996
1998
  }
1997
1999
  };
1998
- s([r({ type: String })], J.prototype, "value", void 0), s([r({
2000
+ s([r({ type: String })], P.prototype, "value", void 0), s([r({
1999
2001
  type: String,
2000
2002
  reflect: !0
2001
- })], J.prototype, "placeholder", void 0), s([r({
2003
+ })], P.prototype, "placeholder", void 0), s([r({
2002
2004
  type: Boolean,
2003
2005
  reflect: !0
2004
- })], J.prototype, "disabled", void 0), s([r({
2006
+ })], P.prototype, "disabled", void 0), s([r({
2005
2007
  type: Number,
2006
2008
  reflect: !0
2007
- })], J.prototype, "maxlength", void 0), s([i(".void-compose-input-textarea")], J.prototype, "_textarea", void 0), customElements.get("void-compose-input") || customElements.define("void-compose-input", J);
2009
+ })], P.prototype, "maxlength", void 0), s([i(".void-compose-input-textarea")], P.prototype, "_textarea", void 0), customElements.get("void-compose-input") || customElements.define("void-compose-input", P);
2008
2010
  //#endregion
2009
2011
  //#region src/components/sidebar.ts
2010
- var Y = class extends o {
2012
+ var F = class extends o {
2011
2013
  constructor(...e) {
2012
2014
  super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.position = "left";
2013
2015
  }
@@ -2031,19 +2033,19 @@ var Y = class extends o {
2031
2033
  s([r({
2032
2034
  type: Boolean,
2033
2035
  reflect: !0
2034
- })], Y.prototype, "collapsed", void 0), s([r({
2036
+ })], F.prototype, "collapsed", void 0), s([r({
2035
2037
  type: String,
2036
2038
  reflect: !0
2037
- })], Y.prototype, "width", void 0), s([r({
2039
+ })], F.prototype, "width", void 0), s([r({
2038
2040
  type: String,
2039
2041
  reflect: !0
2040
- })], Y.prototype, "collapsedWidth", void 0), s([r({
2042
+ })], F.prototype, "collapsedWidth", void 0), s([r({
2041
2043
  type: String,
2042
2044
  reflect: !0
2043
- })], Y.prototype, "position", void 0), customElements.get("void-sidebar") || customElements.define("void-sidebar", Y);
2045
+ })], F.prototype, "position", void 0), customElements.get("void-sidebar") || customElements.define("void-sidebar", F);
2044
2046
  //#endregion
2045
2047
  //#region src/components/toggle.ts
2046
- var X = class extends o {
2048
+ var I = class extends o {
2047
2049
  constructor(...e) {
2048
2050
  super(...e), this.pressed = !1, this.disabled = !1, this.color = "default", this.size = "md", this.variant = "outline", this._handleClick = () => {
2049
2051
  this.disabled || (this.pressed = !this.pressed, this.dispatchEvent(new CustomEvent("void-change", {
@@ -2068,22 +2070,98 @@ var X = class extends o {
2068
2070
  s([r({
2069
2071
  type: Boolean,
2070
2072
  reflect: !0
2071
- })], X.prototype, "pressed", void 0), s([r({
2073
+ })], I.prototype, "pressed", void 0), s([r({
2072
2074
  type: Boolean,
2073
2075
  reflect: !0
2074
- })], X.prototype, "disabled", void 0), s([r({
2076
+ })], I.prototype, "disabled", void 0), s([r({
2075
2077
  type: String,
2076
2078
  reflect: !0
2077
- })], X.prototype, "color", void 0), s([r({
2079
+ })], I.prototype, "color", void 0), s([r({
2078
2080
  type: String,
2079
2081
  reflect: !0
2080
- })], X.prototype, "size", void 0), s([r({
2082
+ })], I.prototype, "size", void 0), s([r({
2083
+ type: String,
2084
+ reflect: !0
2085
+ })], I.prototype, "variant", void 0), customElements.get("void-toggle") || customElements.define("void-toggle", I);
2086
+ //#endregion
2087
+ //#region src/components/toggle-group.ts
2088
+ var L = class extends o {
2089
+ constructor(...e) {
2090
+ super(...e), this.value = "", this.multiple = !1, this.disabled = !1, this.size = "md", this.color = "default", this.orientation = "horizontal", this._handleChildChange = (e) => {
2091
+ let t = e.target.closest("void-toggle");
2092
+ if (!t || t.closest("void-toggle-group") !== this) return;
2093
+ e.stopImmediatePropagation();
2094
+ let n = t.getAttribute("value") || "";
2095
+ if (n) if (this.multiple) {
2096
+ let e = this._selectedValues(), t = e.indexOf(n);
2097
+ t >= 0 ? e.splice(t, 1) : e.push(n), this.value = e.join(","), this._syncToggles(), this.dispatchEvent(new CustomEvent("void-change", {
2098
+ bubbles: !0,
2099
+ composed: !0,
2100
+ detail: { value: e }
2101
+ }));
2102
+ } else {
2103
+ let e = this.value === n ? "" : n;
2104
+ this.value = e, this._syncToggles(), this.dispatchEvent(new CustomEvent("void-change", {
2105
+ bubbles: !0,
2106
+ composed: !0,
2107
+ detail: { value: e }
2108
+ }));
2109
+ }
2110
+ }, this._handleKeydown = (e) => {
2111
+ let t = this._toggles().filter((e) => !e.disabled);
2112
+ if (!t.length) return;
2113
+ let n = this.orientation === "horizontal", r = n ? "ArrowRight" : "ArrowDown", i = n ? "ArrowLeft" : "ArrowUp";
2114
+ if (e.key !== r && e.key !== i) return;
2115
+ e.preventDefault();
2116
+ let a = t.indexOf(e.target), o;
2117
+ o = e.key === r ? a < 0 ? 0 : (a + 1) % t.length : a < 0 ? t.length - 1 : (a - 1 + t.length) % t.length, t[o].focus();
2118
+ };
2119
+ }
2120
+ connectedCallback() {
2121
+ super.connectedCallback(), this.setAttribute("role", "group"), this.addEventListener("void-change", this._handleChildChange), this.addEventListener("keydown", this._handleKeydown), this._syncToggles();
2122
+ }
2123
+ disconnectedCallback() {
2124
+ super.disconnectedCallback(), this.removeEventListener("void-change", this._handleChildChange), this.removeEventListener("keydown", this._handleKeydown);
2125
+ }
2126
+ updated(e) {
2127
+ (e.has("value") || e.has("disabled") || e.has("size") || e.has("color")) && this._syncToggles();
2128
+ }
2129
+ _toggles() {
2130
+ return Array.from(this.querySelectorAll("void-toggle"));
2131
+ }
2132
+ _selectedValues() {
2133
+ return this.value ? this.value.split(",").map((e) => e.trim()).filter(Boolean) : [];
2134
+ }
2135
+ _syncToggles() {
2136
+ let e = this._selectedValues();
2137
+ for (let t of this._toggles()) {
2138
+ let n = t.getAttribute("value") || "";
2139
+ t.pressed = e.includes(n), this.disabled && (t.disabled = !0), t.size = this.size, this.color !== "default" && (t.color = this.color);
2140
+ }
2141
+ }
2142
+ };
2143
+ s([r({
2144
+ type: String,
2145
+ reflect: !0
2146
+ })], L.prototype, "value", void 0), s([r({
2147
+ type: Boolean,
2148
+ reflect: !0
2149
+ })], L.prototype, "multiple", void 0), s([r({
2150
+ type: Boolean,
2151
+ reflect: !0
2152
+ })], L.prototype, "disabled", void 0), s([r({
2153
+ type: String,
2154
+ reflect: !0
2155
+ })], L.prototype, "size", void 0), s([r({
2156
+ type: String,
2157
+ reflect: !0
2158
+ })], L.prototype, "color", void 0), s([r({
2081
2159
  type: String,
2082
2160
  reflect: !0
2083
- })], X.prototype, "variant", void 0), customElements.get("void-toggle") || customElements.define("void-toggle", X);
2161
+ })], L.prototype, "orientation", void 0), customElements.get("void-toggle-group") || customElements.define("void-toggle-group", L);
2084
2162
  //#endregion
2085
2163
  //#region src/components/segmented-control.ts
2086
- var se = class extends o {
2164
+ var xe = class extends o {
2087
2165
  constructor(...e) {
2088
2166
  super(...e), this.value = "", this.disabled = !1;
2089
2167
  }
@@ -2097,11 +2175,11 @@ var se = class extends o {
2097
2175
  s([r({
2098
2176
  type: String,
2099
2177
  reflect: !0
2100
- })], se.prototype, "value", void 0), s([r({
2178
+ })], xe.prototype, "value", void 0), s([r({
2101
2179
  type: Boolean,
2102
2180
  reflect: !0
2103
- })], se.prototype, "disabled", void 0), customElements.get("void-segmented-control-item") || customElements.define("void-segmented-control-item", se);
2104
- var Z = class extends o {
2181
+ })], xe.prototype, "disabled", void 0), customElements.get("void-segmented-control-item") || customElements.define("void-segmented-control-item", xe);
2182
+ var Se = class extends o {
2105
2183
  constructor(...e) {
2106
2184
  super(...e), this.value = "", this.size = "md", this.color = "default", this._handleClick = (e) => {
2107
2185
  let t = e.target.closest("void-segmented-control-item");
@@ -2140,16 +2218,16 @@ var Z = class extends o {
2140
2218
  s([r({
2141
2219
  type: String,
2142
2220
  reflect: !0
2143
- })], Z.prototype, "value", void 0), s([r({
2221
+ })], Se.prototype, "value", void 0), s([r({
2144
2222
  type: String,
2145
2223
  reflect: !0
2146
- })], Z.prototype, "size", void 0), s([r({
2224
+ })], Se.prototype, "size", void 0), s([r({
2147
2225
  type: String,
2148
2226
  reflect: !0
2149
- })], Z.prototype, "color", void 0), customElements.get("void-segmented-control") || customElements.define("void-segmented-control", Z);
2227
+ })], Se.prototype, "color", void 0), customElements.get("void-segmented-control") || customElements.define("void-segmented-control", Se);
2150
2228
  //#endregion
2151
2229
  //#region src/components/stat.ts
2152
- var Q = class extends o {
2230
+ var R = class extends o {
2153
2231
  constructor(...e) {
2154
2232
  super(...e), this.label = "", this.value = "", this.delta = "", this.trend = null, this.color = "default", this.size = "md";
2155
2233
  }
@@ -2167,75 +2245,612 @@ var Q = class extends o {
2167
2245
  s([r({
2168
2246
  type: String,
2169
2247
  reflect: !0
2170
- })], Q.prototype, "label", void 0), s([r({
2248
+ })], R.prototype, "label", void 0), s([r({
2171
2249
  type: String,
2172
2250
  reflect: !0
2173
- })], Q.prototype, "value", void 0), s([r({
2251
+ })], R.prototype, "value", void 0), s([r({
2174
2252
  type: String,
2175
2253
  reflect: !0
2176
- })], Q.prototype, "delta", void 0), s([r({
2254
+ })], R.prototype, "delta", void 0), s([r({
2177
2255
  type: String,
2178
2256
  reflect: !0
2179
- })], Q.prototype, "trend", void 0), s([r({
2257
+ })], R.prototype, "trend", void 0), s([r({
2180
2258
  type: String,
2181
2259
  reflect: !0
2182
- })], Q.prototype, "color", void 0), s([r({
2260
+ })], R.prototype, "color", void 0), s([r({
2183
2261
  type: String,
2184
2262
  reflect: !0
2185
- })], Q.prototype, "size", void 0), customElements.get("void-stat") || customElements.define("void-stat", Q);
2263
+ })], R.prototype, "size", void 0), customElements.get("void-stat") || customElements.define("void-stat", R);
2186
2264
  //#endregion
2187
- //#region src/components/dropdown-menu.ts
2188
- var ce = class extends o {
2265
+ //#region src/components/calendar.ts
2266
+ function z(e) {
2267
+ let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
2268
+ return t ? [
2269
+ Number(t[1]),
2270
+ Number(t[2]) - 1,
2271
+ Number(t[3])
2272
+ ] : null;
2273
+ }
2274
+ function Ce(e, t, n) {
2275
+ return `${String(e).padStart(4, "0")}-${String(t + 1).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
2276
+ }
2277
+ function we() {
2278
+ let e = /* @__PURE__ */ new Date();
2279
+ return Ce(e.getFullYear(), e.getMonth(), e.getDate());
2280
+ }
2281
+ function Te(e, t) {
2282
+ return new Date(e, t + 1, 0).getDate();
2283
+ }
2284
+ function Ee(e, t, n) {
2285
+ return t && e < t ? t : n && e > n ? n : e;
2286
+ }
2287
+ function De(e, t) {
2288
+ let n = z(e);
2289
+ if (!n) return e;
2290
+ let [r, i, a] = n;
2291
+ return t.replace("YYYY", String(r).padStart(4, "0")).replace("MM", String(i + 1).padStart(2, "0")).replace("DD", String(a).padStart(2, "0"));
2292
+ }
2293
+ var B = class extends o {
2189
2294
  constructor(...e) {
2190
- super(...e), this.open = !1, this.position = "bottom-start", this._triggerEl = null, this._panel = null, this._handleTriggerClick = () => {
2191
- this.open = !this.open;
2192
- }, this._handleOutsideClick = (e) => {
2193
- this.open && !this.contains(e.target) && (this.open = !1);
2194
- }, this._handleKeydown = (e) => {
2195
- if (e.key === "Escape" && this.open && (this.open = !1, this._triggerEl?.focus()), this.open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
2196
- e.preventDefault();
2197
- let t = Array.from(this.querySelectorAll("void-dropdown-menu-item:not([disabled])"));
2198
- if (!t.length) return;
2199
- let n = t.indexOf(document.activeElement);
2200
- e.key === "ArrowDown" ? (t[n + 1] ?? t[0]).focus() : (t[n - 1] ?? t[t.length - 1]).focus();
2295
+ super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this._viewYear = 0, this._viewMonth = 0, this._view = "days", this._focusDate = "", this._yearsPageStart = 0, this._didInit = !1, this._prevMonth = () => {
2296
+ this._viewMonth === 0 ? (this._viewMonth = 11, this._viewYear--) : this._viewMonth--, this.requestUpdate();
2297
+ }, this._nextMonth = () => {
2298
+ this._viewMonth === 11 ? (this._viewMonth = 0, this._viewYear++) : this._viewMonth++, this.requestUpdate();
2299
+ }, this._prevYear = () => {
2300
+ this._viewYear--, this.requestUpdate();
2301
+ }, this._nextYear = () => {
2302
+ this._viewYear++, this.requestUpdate();
2303
+ }, this._prevYearsPage = () => {
2304
+ this._yearsPageStart -= 12, this.requestUpdate();
2305
+ }, this._nextYearsPage = () => {
2306
+ this._yearsPageStart += 12, this.requestUpdate();
2307
+ }, this._showMonths = () => {
2308
+ this._view = "months", this.requestUpdate();
2309
+ }, this._showYears = () => {
2310
+ this._yearsPageStart = this._viewYear - this._viewYear % 12, this._view = "years", this.requestUpdate();
2311
+ }, this._onDayKeydown = (e) => {
2312
+ if (this.disabled) return;
2313
+ let t = e.target.getAttribute("data-date");
2314
+ if (!t) return;
2315
+ let n = z(t);
2316
+ if (!n) return;
2317
+ let [r, i] = n, a = n[2], o = !0;
2318
+ switch (e.key) {
2319
+ case "ArrowLeft":
2320
+ a--;
2321
+ break;
2322
+ case "ArrowRight":
2323
+ a++;
2324
+ break;
2325
+ case "ArrowUp":
2326
+ a -= 7;
2327
+ break;
2328
+ case "ArrowDown":
2329
+ a += 7;
2330
+ break;
2331
+ case "Enter":
2332
+ case " ":
2333
+ this._selectDate(t), e.preventDefault();
2334
+ return;
2335
+ default: o = !1;
2201
2336
  }
2337
+ if (!o) return;
2338
+ e.preventDefault();
2339
+ let s = new Date(r, i, a), c = Ee(Ce(s.getFullYear(), s.getMonth(), s.getDate()), this.min || void 0, this.max || void 0);
2340
+ this._focusDate = c;
2341
+ let l = z(c);
2342
+ l && (this._viewYear = l[0], this._viewMonth = l[1]), this.requestUpdate(), this.updateComplete.then(() => {
2343
+ this.querySelector(`[data-date="${c}"]`)?.focus();
2344
+ });
2202
2345
  };
2203
2346
  }
2204
2347
  connectedCallback() {
2205
- super.connectedCallback(), this._triggerEl = this.children[0] ?? null, this._panel = document.createElement("div"), this._panel.className = "void-dropdown-menu-panel", this._panel.setAttribute("role", "menu");
2206
- let e = Array.from(this.childNodes);
2207
- for (let t of e) t !== this._triggerEl && this._panel.appendChild(t);
2208
- this.appendChild(this._panel), this._triggerEl?.addEventListener("click", this._handleTriggerClick), document.addEventListener("mousedown", this._handleOutsideClick), document.addEventListener("keydown", this._handleKeydown);
2348
+ super.connectedCallback(), this.setAttribute("role", "group"), this.setAttribute("aria-label", "Calendar"), this._didInit || (this._didInit = !0, this._initView());
2209
2349
  }
2210
- disconnectedCallback() {
2211
- super.disconnectedCallback(), this._triggerEl?.removeEventListener("click", this._handleTriggerClick), document.removeEventListener("mousedown", this._handleOutsideClick), document.removeEventListener("keydown", this._handleKeydown);
2350
+ updated(e) {
2351
+ super.updated(e), e.has("value") && this._syncViewToValue();
2352
+ }
2353
+ _initView() {
2354
+ let e = z(this.value);
2355
+ if (e) this._viewYear = e[0], this._viewMonth = e[1], this._focusDate = this.value;
2356
+ else {
2357
+ let e = /* @__PURE__ */ new Date();
2358
+ this._viewYear = e.getFullYear(), this._viewMonth = e.getMonth(), this._focusDate = we();
2359
+ }
2360
+ this._yearsPageStart = this._viewYear - this._viewYear % 12;
2361
+ }
2362
+ _syncViewToValue() {
2363
+ let e = z(this.value);
2364
+ e && (this._viewYear = e[0], this._viewMonth = e[1], this._focusDate = this.value, this._yearsPageStart = this._viewYear - this._viewYear % 12, this.requestUpdate());
2365
+ }
2366
+ render() {
2367
+ return this._view === "years" ? this._renderYears() : this._view === "months" ? this._renderMonths() : this._renderDays();
2368
+ }
2369
+ _renderDays() {
2370
+ let e = this._getDayNames(), n = this._buildDayCells(), r = this._getMonthName(this._viewMonth);
2371
+ return t`
2372
+ <div class="void-calendar-header">
2373
+ <button
2374
+ class="void-calendar-nav"
2375
+ aria-label="Previous month"
2376
+ ?disabled=${this.disabled}
2377
+ @click=${this._prevMonth}
2378
+ >
2379
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
2380
+ </button>
2381
+ <button
2382
+ class="void-calendar-title"
2383
+ aria-label="Switch to month picker"
2384
+ ?disabled=${this.disabled}
2385
+ @click=${this._showMonths}
2386
+ >${r} ${this._viewYear}</button>
2387
+ <button
2388
+ class="void-calendar-nav"
2389
+ aria-label="Next month"
2390
+ ?disabled=${this.disabled}
2391
+ @click=${this._nextMonth}
2392
+ >
2393
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg>
2394
+ </button>
2395
+ </div>
2396
+ <div class="void-calendar-grid" role="grid" @keydown=${this._onDayKeydown}>
2397
+ <div class="void-calendar-weekdays">
2398
+ ${e.map((e) => t`<div class="void-calendar-weekday">${e}</div>`)}
2399
+ </div>
2400
+ <div class="void-calendar-days">
2401
+ ${n.map((e) => {
2402
+ let n = e.iso === this.value, r = e.iso === we(), i = e.outside, a = this.disabled || e.disabled;
2403
+ return t`
2404
+ <button
2405
+ class="void-calendar-day${n ? " selected" : ""}${r ? " today" : ""}${i ? " outside" : ""}"
2406
+ ?disabled=${a}
2407
+ aria-selected=${n ? "true" : "false"}
2408
+ aria-label=${e.iso}
2409
+ tabindex=${e.iso === this._focusDate ? "0" : "-1"}
2410
+ data-date=${e.iso}
2411
+ @click=${() => this._selectDate(e.iso)}
2412
+ >${e.day}</button>
2413
+ `;
2414
+ })}
2415
+ </div>
2416
+ </div>
2417
+ `;
2418
+ }
2419
+ _getDayNames() {
2420
+ let e = new Intl.DateTimeFormat(this.locale, { weekday: "short" }), t = [];
2421
+ for (let n = 0; n < 7; n++) {
2422
+ let r = new Date(2024, 0, 7 + (this.firstDay + n) % 7);
2423
+ t.push(e.format(r));
2424
+ }
2425
+ return t;
2426
+ }
2427
+ _getMonthName(e) {
2428
+ return new Intl.DateTimeFormat(this.locale, { month: "long" }).format(new Date(2024, e, 1));
2429
+ }
2430
+ _buildDayCells() {
2431
+ let e = this._viewYear, t = this._viewMonth, n = Te(e, t), r = (new Date(e, t, 1).getDay() - this.firstDay + 7) % 7, i = [], a = t === 0 ? 11 : t - 1, o = t === 0 ? e - 1 : e, s = Te(o, a);
2432
+ for (let e = r - 1; e >= 0; e--) {
2433
+ let t = s - e, n = Ce(o, a, t);
2434
+ i.push({
2435
+ day: t,
2436
+ iso: n,
2437
+ outside: !0,
2438
+ disabled: this._isOutOfRange(n)
2439
+ });
2440
+ }
2441
+ for (let r = 1; r <= n; r++) {
2442
+ let n = Ce(e, t, r);
2443
+ i.push({
2444
+ day: r,
2445
+ iso: n,
2446
+ outside: !1,
2447
+ disabled: this._isOutOfRange(n)
2448
+ });
2449
+ }
2450
+ let c = t === 11 ? 0 : t + 1, l = t === 11 ? e + 1 : e, u = 42 - i.length;
2451
+ for (let e = 1; e <= u; e++) {
2452
+ let t = Ce(l, c, e);
2453
+ i.push({
2454
+ day: e,
2455
+ iso: t,
2456
+ outside: !0,
2457
+ disabled: this._isOutOfRange(t)
2458
+ });
2459
+ }
2460
+ return i;
2461
+ }
2462
+ _isOutOfRange(e) {
2463
+ return !!(this.min && e < this.min || this.max && e > this.max);
2464
+ }
2465
+ _renderMonths() {
2466
+ let e = new Intl.DateTimeFormat(this.locale, { month: "short" }), n = Array.from({ length: 12 }, (t, n) => ({
2467
+ index: n,
2468
+ name: e.format(new Date(2024, n, 1))
2469
+ }));
2470
+ return t`
2471
+ <div class="void-calendar-header">
2472
+ <button
2473
+ class="void-calendar-nav"
2474
+ aria-label="Previous year"
2475
+ ?disabled=${this.disabled}
2476
+ @click=${this._prevYear}
2477
+ >
2478
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
2479
+ </button>
2480
+ <button
2481
+ class="void-calendar-title"
2482
+ aria-label="Switch to year picker"
2483
+ ?disabled=${this.disabled}
2484
+ @click=${this._showYears}
2485
+ >${this._viewYear}</button>
2486
+ <button
2487
+ class="void-calendar-nav"
2488
+ aria-label="Next year"
2489
+ ?disabled=${this.disabled}
2490
+ @click=${this._nextYear}
2491
+ >
2492
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg>
2493
+ </button>
2494
+ </div>
2495
+ <div class="void-calendar-months">
2496
+ ${n.map((e) => t`
2497
+ <button
2498
+ class="void-calendar-month${e.index === this._viewMonth && this._viewYear === (/* @__PURE__ */ new Date()).getFullYear() ? " current" : ""}"
2499
+ ?disabled=${this.disabled}
2500
+ @click=${() => this._pickMonth(e.index)}
2501
+ >${e.name}</button>
2502
+ `)}
2503
+ </div>
2504
+ `;
2505
+ }
2506
+ _renderYears() {
2507
+ let e = this._yearsPageStart, n = Array.from({ length: 12 }, (t, n) => e + n), r = (/* @__PURE__ */ new Date()).getFullYear();
2508
+ return t`
2509
+ <div class="void-calendar-header">
2510
+ <button
2511
+ class="void-calendar-nav"
2512
+ aria-label="Previous years"
2513
+ ?disabled=${this.disabled}
2514
+ @click=${this._prevYearsPage}
2515
+ >
2516
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
2517
+ </button>
2518
+ <span class="void-calendar-title void-calendar-title--static">${e} – ${e + 11}</span>
2519
+ <button
2520
+ class="void-calendar-nav"
2521
+ aria-label="Next years"
2522
+ ?disabled=${this.disabled}
2523
+ @click=${this._nextYearsPage}
2524
+ >
2525
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg>
2526
+ </button>
2527
+ </div>
2528
+ <div class="void-calendar-years">
2529
+ ${n.map((e) => t`
2530
+ <button
2531
+ class="void-calendar-year${e === r ? " current" : ""}"
2532
+ ?disabled=${this.disabled}
2533
+ @click=${() => this._pickYear(e)}
2534
+ >${e}</button>
2535
+ `)}
2536
+ </div>
2537
+ `;
2538
+ }
2539
+ _pickMonth(e) {
2540
+ this._viewMonth = e, this._view = "days", this.requestUpdate();
2541
+ }
2542
+ _pickYear(e) {
2543
+ this._viewYear = e, this._yearsPageStart = e - e % 12, this._view = "months", this.requestUpdate();
2544
+ }
2545
+ _selectDate(e) {
2546
+ if (this.disabled || this._isOutOfRange(e)) return;
2547
+ this.value = e, this._focusDate = e;
2548
+ let t = z(e);
2549
+ this._viewYear = t[0], this._viewMonth = t[1], this._view = "days", this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
2550
+ bubbles: !0,
2551
+ composed: !0,
2552
+ detail: {
2553
+ value: e,
2554
+ date: new Date(t[0], t[1], t[2])
2555
+ }
2556
+ }));
2212
2557
  }
2213
2558
  };
2214
2559
  s([r({
2560
+ type: String,
2561
+ reflect: !0
2562
+ })], B.prototype, "value", void 0), s([r({ type: String })], B.prototype, "min", void 0), s([r({ type: String })], B.prototype, "max", void 0), s([r({
2215
2563
  type: Boolean,
2216
2564
  reflect: !0
2217
- })], ce.prototype, "open", void 0), s([r({
2565
+ })], B.prototype, "disabled", void 0), s([r({
2218
2566
  type: String,
2219
2567
  reflect: !0
2220
- })], ce.prototype, "position", void 0), customElements.get("void-dropdown-menu") || customElements.define("void-dropdown-menu", ce);
2221
- var le = class extends o {
2568
+ })], B.prototype, "size", void 0), s([r({ type: String })], B.prototype, "locale", void 0), s([r({
2569
+ attribute: "first-day",
2570
+ type: Number
2571
+ })], B.prototype, "firstDay", void 0), customElements.get("void-calendar") || customElements.define("void-calendar", B);
2572
+ var V = class extends o {
2222
2573
  constructor(...e) {
2223
- super(...e), this.disabled = !1, this.destructive = !1, this._handleClick = (e) => {
2224
- if (this.disabled) {
2225
- e.stopImmediatePropagation();
2226
- return;
2227
- }
2228
- this.dispatchEvent(new CustomEvent("void-select", {
2574
+ super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this.open = !1, this.placeholder = "Select date", this.format = "MM/DD/YYYY", this.color = "default", this._toggle = () => {
2575
+ this.disabled || (this.open = !this.open, this.requestUpdate());
2576
+ }, this._onCalendarChange = (e) => {
2577
+ e.stopPropagation(), this.value = e.detail.value, this.open = !1, this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
2229
2578
  bubbles: !0,
2230
2579
  composed: !0,
2231
- detail: { item: this }
2580
+ detail: e.detail
2232
2581
  }));
2233
- }, this._handleKeydown = (e) => {
2234
- (e.key === "Enter" || e.key === " ") && !this.disabled && (e.preventDefault(), this._handleClick(e));
2582
+ }, this._onDocumentClick = (e) => {
2583
+ this.open && !this.contains(e.target) && (this.open = !1, this.requestUpdate());
2584
+ }, this._onDocumentKeydown = (e) => {
2585
+ e.key === "Escape" && this.open && (this.open = !1, this.requestUpdate());
2586
+ }, this._onInputKeydown = (e) => {
2587
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._toggle()), e.key === "Escape" && this.open && (this.open = !1, this.requestUpdate());
2235
2588
  };
2236
2589
  }
2237
2590
  connectedCallback() {
2238
- super.connectedCallback(), this.setAttribute("role", "menuitem"), this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown);
2591
+ super.connectedCallback(), this.setAttribute("role", "combobox"), this.setAttribute("aria-haspopup", "dialog"), document.addEventListener("mousedown", this._onDocumentClick), document.addEventListener("keydown", this._onDocumentKeydown);
2592
+ }
2593
+ disconnectedCallback() {
2594
+ super.disconnectedCallback(), document.removeEventListener("mousedown", this._onDocumentClick), document.removeEventListener("keydown", this._onDocumentKeydown);
2595
+ }
2596
+ updated(e) {
2597
+ super.updated(e), this.setAttribute("aria-expanded", String(this.open));
2598
+ }
2599
+ render() {
2600
+ return t`
2601
+ <div class="void-date-picker-anchor">
2602
+ <input
2603
+ class="void-date-picker-input"
2604
+ .value=${this.value ? De(this.value, this.format) : ""}
2605
+ placeholder=${this.placeholder}
2606
+ ?disabled=${this.disabled}
2607
+ readonly
2608
+ aria-expanded=${String(this.open)}
2609
+ aria-haspopup="dialog"
2610
+ @click=${this._toggle}
2611
+ @keydown=${this._onInputKeydown}
2612
+ />
2613
+ <button
2614
+ class="void-date-picker-icon"
2615
+ aria-label="Toggle calendar"
2616
+ ?disabled=${this.disabled}
2617
+ tabindex="-1"
2618
+ @click=${this._toggle}
2619
+ >
2620
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
2621
+ <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
2622
+ <line x1="16" y1="2" x2="16" y2="6"></line>
2623
+ <line x1="8" y1="2" x2="8" y2="6"></line>
2624
+ <line x1="3" y1="10" x2="21" y2="10"></line>
2625
+ </svg>
2626
+ </button>
2627
+ </div>
2628
+ ${this.open ? t`
2629
+ <div class="void-date-picker-dropdown" role="dialog" aria-label="Choose date">
2630
+ <void-calendar
2631
+ value=${this.value}
2632
+ min=${this.min}
2633
+ max=${this.max}
2634
+ ?disabled=${this.disabled}
2635
+ size=${this.size}
2636
+ locale=${this.locale}
2637
+ first-day=${this.firstDay}
2638
+ @void-change=${this._onCalendarChange}
2639
+ ></void-calendar>
2640
+ </div>
2641
+ ` : n}
2642
+ `;
2643
+ }
2644
+ };
2645
+ s([r({
2646
+ type: String,
2647
+ reflect: !0
2648
+ })], V.prototype, "value", void 0), s([r({ type: String })], V.prototype, "min", void 0), s([r({ type: String })], V.prototype, "max", void 0), s([r({
2649
+ type: Boolean,
2650
+ reflect: !0
2651
+ })], V.prototype, "disabled", void 0), s([r({
2652
+ type: String,
2653
+ reflect: !0
2654
+ })], V.prototype, "size", void 0), s([r({ type: String })], V.prototype, "locale", void 0), s([r({
2655
+ attribute: "first-day",
2656
+ type: Number
2657
+ })], V.prototype, "firstDay", void 0), s([r({
2658
+ type: Boolean,
2659
+ reflect: !0
2660
+ })], V.prototype, "open", void 0), s([r({ type: String })], V.prototype, "placeholder", void 0), s([r({ type: String })], V.prototype, "format", void 0), s([r({
2661
+ type: String,
2662
+ reflect: !0
2663
+ })], V.prototype, "color", void 0), customElements.get("void-date-picker") || customElements.define("void-date-picker", V);
2664
+ //#endregion
2665
+ //#region src/components/carousel.ts
2666
+ var Oe = class extends o {
2667
+ connectedCallback() {
2668
+ super.connectedCallback(), this.setAttribute("role", "group"), this.setAttribute("aria-roledescription", "slide");
2669
+ }
2670
+ };
2671
+ customElements.get("void-carousel-slide") || customElements.define("void-carousel-slide", Oe);
2672
+ var H = class extends o {
2673
+ constructor(...e) {
2674
+ super(...e), this.active = 0, this.loop = !1, this.autoplay = !1, this.interval = 5e3, this.size = "md", this.controls = !0, this.indicators = !0, this.orientation = "horizontal", this._slides = [], this._autoplayTimer = null, this._userContent = [], this._didSetup = !1, this._prev = () => {
2675
+ this._goTo(this.active - 1);
2676
+ }, this._next = () => {
2677
+ this._goTo(this.active + 1);
2678
+ }, this._onMouseEnter = () => {
2679
+ this.autoplay && this._stopAutoplay();
2680
+ }, this._onMouseLeave = () => {
2681
+ this.autoplay && this._startAutoplay();
2682
+ }, this._onKeydown = (e) => {
2683
+ let t = this.orientation === "horizontal", n = t ? "ArrowLeft" : "ArrowUp", r = t ? "ArrowRight" : "ArrowDown";
2684
+ e.key === n ? (e.preventDefault(), this._prev()) : e.key === r && (e.preventDefault(), this._next());
2685
+ };
2686
+ }
2687
+ connectedCallback() {
2688
+ super.connectedCallback(), this._didSetup || (this._userContent = Array.from(this.childNodes)), this.setAttribute("role", "region"), this.setAttribute("aria-roledescription", "carousel"), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), this.addEventListener("keydown", this._onKeydown);
2689
+ }
2690
+ disconnectedCallback() {
2691
+ super.disconnectedCallback(), this._stopAutoplay(), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("keydown", this._onKeydown);
2692
+ }
2693
+ updated(e) {
2694
+ super.updated(e);
2695
+ let t = !1;
2696
+ if (!this._didSetup) {
2697
+ this._didSetup = !0;
2698
+ let e = this.querySelector(".void-carousel-track");
2699
+ if (e) for (let t of this._userContent) e.appendChild(t);
2700
+ t = !0;
2701
+ }
2702
+ this._slides = Array.from(this.querySelectorAll("void-carousel-slide")), this._syncSlides(), (e.has("autoplay") || e.has("interval")) && (this._stopAutoplay(), this.autoplay && this._startAutoplay()), this.style.setProperty("--void-carousel-offset", String(this.active)), t && this.requestUpdate();
2703
+ }
2704
+ _syncSlides() {
2705
+ for (let e = 0; e < this._slides.length; e++) {
2706
+ let t = this._slides[e];
2707
+ t.setAttribute("aria-label", `Slide ${e + 1} of ${this._slides.length}`), e === this.active ? t.setAttribute("active", "") : t.removeAttribute("active");
2708
+ }
2709
+ }
2710
+ _goTo(e) {
2711
+ let t = this._slides.length;
2712
+ if (t === 0) return;
2713
+ let n = this.active;
2714
+ e = this.loop ? (e % t + t) % t : Math.max(0, Math.min(e, t - 1)), e !== n && (this.active = e, this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
2715
+ bubbles: !0,
2716
+ composed: !0,
2717
+ detail: {
2718
+ index: this.active,
2719
+ previous: n
2720
+ }
2721
+ })));
2722
+ }
2723
+ _goToSlide(e) {
2724
+ this._goTo(e);
2725
+ }
2726
+ _startAutoplay() {
2727
+ this._autoplayTimer ||= setInterval(() => {
2728
+ this._next();
2729
+ }, this.interval);
2730
+ }
2731
+ _stopAutoplay() {
2732
+ this._autoplayTimer &&= (clearInterval(this._autoplayTimer), null);
2733
+ }
2734
+ render() {
2735
+ let e = this._slides.length, n = !this.loop && this.active === 0, r = !this.loop && this.active === e - 1;
2736
+ return t`
2737
+ <div class="void-carousel-viewport">
2738
+ <div class="void-carousel-track" aria-live="polite"></div>
2739
+ </div>
2740
+ ${this.controls ? t`
2741
+ <button
2742
+ class="void-carousel-prev"
2743
+ aria-label="Previous slide"
2744
+ ?disabled=${n}
2745
+ @click=${this._prev}
2746
+ >
2747
+ <svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
2748
+ <path d="M10 4L6 8l4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
2749
+ </svg>
2750
+ </button>
2751
+ <button
2752
+ class="void-carousel-next"
2753
+ aria-label="Next slide"
2754
+ ?disabled=${r}
2755
+ @click=${this._next}
2756
+ >
2757
+ <svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
2758
+ <path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
2759
+ </svg>
2760
+ </button>
2761
+ ` : ""}
2762
+ ${this.indicators ? t`
2763
+ <div class="void-carousel-indicators" role="tablist" aria-label="Slide indicators">
2764
+ ${this._slides.map((e, n) => t`
2765
+ <button
2766
+ class="void-carousel-dot"
2767
+ role="tab"
2768
+ aria-selected=${n === this.active ? "true" : "false"}
2769
+ aria-label="Go to slide ${n + 1}"
2770
+ ?active=${n === this.active}
2771
+ @click=${() => this._goToSlide(n)}
2772
+ ></button>
2773
+ `)}
2774
+ </div>
2775
+ ` : ""}
2776
+ `;
2777
+ }
2778
+ };
2779
+ s([r({
2780
+ type: Number,
2781
+ reflect: !0
2782
+ })], H.prototype, "active", void 0), s([r({
2783
+ type: Boolean,
2784
+ reflect: !0
2785
+ })], H.prototype, "loop", void 0), s([r({
2786
+ type: Boolean,
2787
+ reflect: !0
2788
+ })], H.prototype, "autoplay", void 0), s([r({ type: Number })], H.prototype, "interval", void 0), s([r({
2789
+ type: String,
2790
+ reflect: !0
2791
+ })], H.prototype, "size", void 0), s([r({
2792
+ type: Boolean,
2793
+ reflect: !0
2794
+ })], H.prototype, "controls", void 0), s([r({
2795
+ type: Boolean,
2796
+ reflect: !0
2797
+ })], H.prototype, "indicators", void 0), s([r({
2798
+ type: String,
2799
+ reflect: !0
2800
+ })], H.prototype, "orientation", void 0), customElements.get("void-carousel") || customElements.define("void-carousel", H);
2801
+ //#endregion
2802
+ //#region src/components/dropdown-menu.ts
2803
+ var ke = class extends o {
2804
+ constructor(...e) {
2805
+ super(...e), this.open = !1, this.position = "bottom-start", this._triggerEl = null, this._panel = null, this._handleTriggerClick = () => {
2806
+ this.open = !this.open;
2807
+ }, this._handleOutsideClick = (e) => {
2808
+ this.open && !this.contains(e.target) && (this.open = !1);
2809
+ }, this._handleKeydown = (e) => {
2810
+ if (e.key === "Escape" && this.open && (this.open = !1, this._triggerEl?.focus()), this.open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
2811
+ e.preventDefault();
2812
+ let t = Array.from(this.querySelectorAll("void-dropdown-menu-item:not([disabled])"));
2813
+ if (!t.length) return;
2814
+ let n = t.indexOf(document.activeElement);
2815
+ e.key === "ArrowDown" ? (t[n + 1] ?? t[0]).focus() : (t[n - 1] ?? t[t.length - 1]).focus();
2816
+ }
2817
+ };
2818
+ }
2819
+ connectedCallback() {
2820
+ super.connectedCallback(), this._triggerEl = this.children[0] ?? null, this._panel = document.createElement("div"), this._panel.className = "void-dropdown-menu-panel", this._panel.setAttribute("role", "menu");
2821
+ let e = Array.from(this.childNodes);
2822
+ for (let t of e) t !== this._triggerEl && this._panel.appendChild(t);
2823
+ this.appendChild(this._panel), this._triggerEl?.addEventListener("click", this._handleTriggerClick), document.addEventListener("mousedown", this._handleOutsideClick), document.addEventListener("keydown", this._handleKeydown);
2824
+ }
2825
+ disconnectedCallback() {
2826
+ super.disconnectedCallback(), this._triggerEl?.removeEventListener("click", this._handleTriggerClick), document.removeEventListener("mousedown", this._handleOutsideClick), document.removeEventListener("keydown", this._handleKeydown);
2827
+ }
2828
+ };
2829
+ s([r({
2830
+ type: Boolean,
2831
+ reflect: !0
2832
+ })], ke.prototype, "open", void 0), s([r({
2833
+ type: String,
2834
+ reflect: !0
2835
+ })], ke.prototype, "position", void 0), customElements.get("void-dropdown-menu") || customElements.define("void-dropdown-menu", ke);
2836
+ var Ae = class extends o {
2837
+ constructor(...e) {
2838
+ super(...e), this.disabled = !1, this.destructive = !1, this._handleClick = (e) => {
2839
+ if (this.disabled) {
2840
+ e.stopImmediatePropagation();
2841
+ return;
2842
+ }
2843
+ this.dispatchEvent(new CustomEvent("void-select", {
2844
+ bubbles: !0,
2845
+ composed: !0,
2846
+ detail: { item: this }
2847
+ }));
2848
+ }, this._handleKeydown = (e) => {
2849
+ (e.key === "Enter" || e.key === " ") && !this.disabled && (e.preventDefault(), this._handleClick(e));
2850
+ };
2851
+ }
2852
+ connectedCallback() {
2853
+ super.connectedCallback(), this.setAttribute("role", "menuitem"), this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown);
2239
2854
  }
2240
2855
  disconnectedCallback() {
2241
2856
  super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("keydown", this._handleKeydown);
@@ -2247,13 +2862,13 @@ var le = class extends o {
2247
2862
  s([r({
2248
2863
  type: Boolean,
2249
2864
  reflect: !0
2250
- })], le.prototype, "disabled", void 0), s([r({
2865
+ })], Ae.prototype, "disabled", void 0), s([r({
2251
2866
  type: Boolean,
2252
2867
  reflect: !0
2253
- })], le.prototype, "destructive", void 0), customElements.get("void-dropdown-menu-item") || customElements.define("void-dropdown-menu-item", le);
2868
+ })], Ae.prototype, "destructive", void 0), customElements.get("void-dropdown-menu-item") || customElements.define("void-dropdown-menu-item", Ae);
2254
2869
  //#endregion
2255
2870
  //#region src/components/indicator.ts
2256
- var $ = class extends o {
2871
+ var U = class extends o {
2257
2872
  constructor(...e) {
2258
2873
  super(...e), this.color = "default", this.position = "top-right", this.count = null, this.ping = !1, this.size = "md";
2259
2874
  }
@@ -2273,18 +2888,1191 @@ var $ = class extends o {
2273
2888
  s([r({
2274
2889
  type: String,
2275
2890
  reflect: !0
2276
- })], $.prototype, "color", void 0), s([r({
2891
+ })], U.prototype, "color", void 0), s([r({
2277
2892
  type: String,
2278
2893
  reflect: !0
2279
- })], $.prototype, "position", void 0), s([r({
2894
+ })], U.prototype, "position", void 0), s([r({
2280
2895
  type: Number,
2281
2896
  reflect: !0
2282
- })], $.prototype, "count", void 0), s([r({
2897
+ })], U.prototype, "count", void 0), s([r({
2898
+ type: Boolean,
2899
+ reflect: !0
2900
+ })], U.prototype, "ping", void 0), s([r({
2901
+ type: String,
2902
+ reflect: !0
2903
+ })], U.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", U);
2904
+ //#endregion
2905
+ //#region src/components/menu.ts
2906
+ var W = class extends o {
2907
+ constructor(...e) {
2908
+ super(...e), this.open = !1, this.searchable = !1, this.size = "md", this.placeholder = "Search...", this._query = "", this._userContent = [], this._didSetup = !1, this._handleKeydown = (e) => {
2909
+ if (this.open) {
2910
+ if (e.key === "Escape") {
2911
+ e.preventDefault(), this.open = !1, this._clearSearch();
2912
+ return;
2913
+ }
2914
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
2915
+ e.preventDefault();
2916
+ let t = Array.from(this.querySelectorAll("void-menu-item:not([disabled]):not([hidden])"));
2917
+ if (!t.length) return;
2918
+ let n = t.indexOf(document.activeElement);
2919
+ e.key === "ArrowDown" ? (t[n + 1] ?? t[0]).focus() : (t[n - 1] ?? t[t.length - 1]).focus();
2920
+ }
2921
+ }
2922
+ }, this._onSearchInput = (e) => {
2923
+ this._query = e.target.value, this._filterItems();
2924
+ };
2925
+ }
2926
+ connectedCallback() {
2927
+ super.connectedCallback(), this.setAttribute("role", "menu"), this._didSetup || (this._userContent = Array.from(this.childNodes)), document.addEventListener("keydown", this._handleKeydown);
2928
+ }
2929
+ disconnectedCallback() {
2930
+ super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeydown);
2931
+ }
2932
+ updated(e) {
2933
+ if (super.updated(e), !this._didSetup) {
2934
+ this._didSetup = !0;
2935
+ let e = this.querySelector(".void-menu-list");
2936
+ if (e) for (let t of this._userContent) e.appendChild(t);
2937
+ }
2938
+ e.has("open") && this.open && this.searchable && requestAnimationFrame(() => {
2939
+ this.querySelector(".void-menu-search")?.focus();
2940
+ });
2941
+ }
2942
+ _filterItems() {
2943
+ let e = this._query.toLowerCase();
2944
+ this.querySelectorAll("void-menu-item").forEach((t) => {
2945
+ let n = (t.textContent?.trim() ?? "").toLowerCase(), r = (t.getAttribute("value") ?? "").toLowerCase();
2946
+ !e || n.includes(e) || r.includes(e) ? t.removeAttribute("hidden") : t.setAttribute("hidden", "");
2947
+ }), this.querySelectorAll("void-menu-group").forEach((e) => {
2948
+ e.querySelectorAll("void-menu-item:not([hidden])").length === 0 ? e.setAttribute("hidden", "") : e.removeAttribute("hidden");
2949
+ }), this._updateEmptyState();
2950
+ }
2951
+ _updateEmptyState() {
2952
+ let e = this.querySelector(".void-menu-list");
2953
+ if (!e) return;
2954
+ let t = this.querySelector(".void-menu-empty");
2955
+ this.querySelectorAll("void-menu-item:not([hidden])").length === 0 && this._query ? t || (t = document.createElement("div"), t.className = "void-menu-empty", t.textContent = "No results found", e.appendChild(t)) : t && t.remove();
2956
+ }
2957
+ _clearSearch() {
2958
+ this._query = "";
2959
+ let e = this.querySelector(".void-menu-search");
2960
+ e && (e.value = ""), this.querySelectorAll("void-menu-item[hidden], void-menu-group[hidden]").forEach((e) => {
2961
+ e.removeAttribute("hidden");
2962
+ });
2963
+ let t = this.querySelector(".void-menu-empty");
2964
+ t && t.remove();
2965
+ }
2966
+ render() {
2967
+ return this.open ? t`
2968
+ ${this.searchable ? t`
2969
+ <input
2970
+ class="void-menu-search"
2971
+ type="text"
2972
+ placeholder=${this.placeholder}
2973
+ autocomplete="off"
2974
+ @input=${this._onSearchInput}
2975
+ />
2976
+ ` : n}
2977
+ <div class="void-menu-list" role="listbox" aria-label="Menu options"></div>
2978
+ ` : n;
2979
+ }
2980
+ };
2981
+ s([r({
2982
+ type: Boolean,
2983
+ reflect: !0
2984
+ })], W.prototype, "open", void 0), s([r({
2985
+ type: Boolean,
2986
+ reflect: !0
2987
+ })], W.prototype, "searchable", void 0), s([r({
2988
+ type: String,
2989
+ reflect: !0
2990
+ })], W.prototype, "size", void 0), s([r({ type: String })], W.prototype, "placeholder", void 0), customElements.get("void-menu") || customElements.define("void-menu", W);
2991
+ var G = class extends o {
2992
+ constructor(...e) {
2993
+ super(...e), this.value = "", this.disabled = !1, this.shortcut = "", this.icon = "", this._originalContent = null, this._handleClick = (e) => {
2994
+ if (this.disabled) {
2995
+ e.stopImmediatePropagation();
2996
+ return;
2997
+ }
2998
+ this.dispatchEvent(new CustomEvent("void-select", {
2999
+ bubbles: !0,
3000
+ composed: !0,
3001
+ detail: { value: this.value }
3002
+ }));
3003
+ }, this._handleKeydown = (e) => {
3004
+ (e.key === "Enter" || e.key === " ") && !this.disabled && (e.preventDefault(), this._handleClick(e));
3005
+ };
3006
+ }
3007
+ connectedCallback() {
3008
+ super.connectedCallback(), this.setAttribute("role", "menuitem"), this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown), this._originalContent === null && (this._originalContent = Array.from(this.childNodes).map((e) => e.cloneNode(!0))), this._buildContent();
3009
+ }
3010
+ disconnectedCallback() {
3011
+ super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("keydown", this._handleKeydown);
3012
+ }
3013
+ updated(e) {
3014
+ e.has("disabled") && (this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.setAttribute("aria-disabled", String(this.disabled)));
3015
+ }
3016
+ _buildContent() {
3017
+ if (!this.icon && !this.shortcut) return;
3018
+ let e = document.createDocumentFragment();
3019
+ if (this.icon) {
3020
+ let t = document.createElement("span");
3021
+ t.className = "void-menu-item-icon", t.textContent = this.icon, e.appendChild(t);
3022
+ }
3023
+ let t = document.createElement("span");
3024
+ if (t.className = "void-menu-item-label", this._originalContent) for (let e of this._originalContent) t.appendChild(e.cloneNode(!0));
3025
+ if (e.appendChild(t), this.shortcut) {
3026
+ let t = document.createElement("span");
3027
+ t.className = "void-menu-item-shortcut", t.textContent = this.shortcut, e.appendChild(t);
3028
+ }
3029
+ this.textContent = "", this.appendChild(e);
3030
+ }
3031
+ };
3032
+ s([r({ type: String })], G.prototype, "value", void 0), s([r({
2283
3033
  type: Boolean,
2284
3034
  reflect: !0
2285
- })], $.prototype, "ping", void 0), s([r({
3035
+ })], G.prototype, "disabled", void 0), s([r({ type: String })], G.prototype, "shortcut", void 0), s([r({ type: String })], G.prototype, "icon", void 0), customElements.get("void-menu-item") || customElements.define("void-menu-item", G);
3036
+ var je = class extends o {
3037
+ constructor(...e) {
3038
+ super(...e), this.label = "", this._userContent = [], this._didSetup = !1;
3039
+ }
3040
+ connectedCallback() {
3041
+ super.connectedCallback(), this.setAttribute("role", "group"), this.label && this.setAttribute("aria-label", this.label), this._didSetup || (this._userContent = Array.from(this.childNodes));
3042
+ }
3043
+ updated(e) {
3044
+ if (super.updated(e), e.has("label") && this.label && this.setAttribute("aria-label", this.label), !this._didSetup) {
3045
+ this._didSetup = !0;
3046
+ let e = this.querySelector(".void-menu-group-items");
3047
+ if (e) for (let t of this._userContent) e.appendChild(t);
3048
+ }
3049
+ }
3050
+ render() {
3051
+ return t`
3052
+ ${this.label ? t`<div class="void-menu-group-label">${this.label}</div>` : n}
3053
+ <div class="void-menu-group-items"></div>
3054
+ `;
3055
+ }
3056
+ };
3057
+ s([r({
2286
3058
  type: String,
2287
3059
  reflect: !0
2288
- })], $.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", $);
3060
+ })], je.prototype, "label", void 0), customElements.get("void-menu-group") || customElements.define("void-menu-group", je);
3061
+ //#endregion
3062
+ //#region src/components/number-input.ts
3063
+ var K = class extends o {
3064
+ constructor(...e) {
3065
+ super(...e), this.value = 0, this.min = -Infinity, this.max = Infinity, this.step = 1, this.precision = -1, this.disabled = !1, this.readonly = !1, this.size = "md", this.color = "default", this.placeholder = "", this.controls = "sides", this.label = "", this._pressTimer = null, this._repeatTimer = null, this._repeatInterval = 300, this._repeatCount = 0;
3066
+ }
3067
+ connectedCallback() {
3068
+ super.connectedCallback(), this.setAttribute("role", "spinbutton"), this.label && this.setAttribute("aria-label", this.label), isFinite(this.min) && this.setAttribute("aria-valuemin", String(this.min)), isFinite(this.max) && this.setAttribute("aria-valuemax", String(this.max)), this.setAttribute("aria-valuenow", String(this.value));
3069
+ }
3070
+ updated(e) {
3071
+ e.has("value") && this.setAttribute("aria-valuenow", String(this.value)), e.has("min") && isFinite(this.min) && this.setAttribute("aria-valuemin", String(this.min)), e.has("max") && isFinite(this.max) && this.setAttribute("aria-valuemax", String(this.max)), e.has("label") && this.setAttribute("aria-label", this.label);
3072
+ }
3073
+ disconnectedCallback() {
3074
+ super.disconnectedCallback(), this._stopRepeat();
3075
+ }
3076
+ _clamp(e) {
3077
+ return Math.min(Math.max(e, this.min), this.max);
3078
+ }
3079
+ _format(e) {
3080
+ return this.precision >= 0 ? e.toFixed(this.precision) : String(e);
3081
+ }
3082
+ _commit(e) {
3083
+ let t = this._clamp(e);
3084
+ if (t === this.value) return;
3085
+ let n = this.value;
3086
+ this.value = t, this._input && (this._input.value = this._format(t)), this.dispatchEvent(new CustomEvent("void-change", {
3087
+ bubbles: !0,
3088
+ composed: !0,
3089
+ detail: {
3090
+ value: t,
3091
+ previous: n
3092
+ }
3093
+ }));
3094
+ }
3095
+ _increment() {
3096
+ this.disabled || this.readonly || this._commit(this.value + this.step);
3097
+ }
3098
+ _decrement() {
3099
+ this.disabled || this.readonly || this._commit(this.value - this.step);
3100
+ }
3101
+ _startRepeat(e) {
3102
+ e(), this._pressTimer = setTimeout(() => {
3103
+ this._repeatInterval = 300, this._repeatCount = 0, this._repeatTimer = setInterval(() => {
3104
+ if (e(), this._repeatCount++, this._repeatCount % 5 == 0 && this._repeatInterval > 50) {
3105
+ let t = Math.max(50, Math.floor(this._repeatInterval / 2));
3106
+ t !== this._repeatInterval && (this._repeatInterval = t, clearInterval(this._repeatTimer), this._repeatTimer = setInterval(() => {
3107
+ e(), this._repeatCount++;
3108
+ }, this._repeatInterval));
3109
+ }
3110
+ }, this._repeatInterval);
3111
+ }, 400);
3112
+ }
3113
+ _stopRepeat() {
3114
+ this._pressTimer !== null && (clearTimeout(this._pressTimer), this._pressTimer = null), this._repeatTimer !== null && (clearInterval(this._repeatTimer), this._repeatTimer = null), this._repeatCount = 0;
3115
+ }
3116
+ _onKeydown(e) {
3117
+ this.disabled || this.readonly || (e.key === "ArrowUp" ? (e.preventDefault(), this._increment()) : e.key === "ArrowDown" && (e.preventDefault(), this._decrement()));
3118
+ }
3119
+ _onBlur() {
3120
+ if (!this._input || this.readonly) return;
3121
+ let e = parseFloat(this._input.value);
3122
+ isNaN(e) ? this._input.value = this._format(this.value) : this._commit(e);
3123
+ }
3124
+ _onInputChange() {}
3125
+ render() {
3126
+ let e = t`
3127
+ <button
3128
+ class="void-number-input-btn void-number-input-btn-dec"
3129
+ type="button"
3130
+ ?disabled=${this.disabled || this.readonly || this.value <= this.min}
3131
+ aria-label="Decrement"
3132
+ @pointerdown=${(e) => {
3133
+ e.preventDefault(), this._startRepeat(() => this._decrement());
3134
+ }}
3135
+ @pointerup=${() => this._stopRepeat()}
3136
+ @pointerleave=${() => this._stopRepeat()}
3137
+ >
3138
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em">
3139
+ <line x1="3" y1="8" x2="13" y2="8"/>
3140
+ </svg>
3141
+ </button>
3142
+ `, n = t`
3143
+ <button
3144
+ class="void-number-input-btn void-number-input-btn-inc"
3145
+ type="button"
3146
+ ?disabled=${this.disabled || this.readonly || this.value >= this.max}
3147
+ aria-label="Increment"
3148
+ @pointerdown=${(e) => {
3149
+ e.preventDefault(), this._startRepeat(() => this._increment());
3150
+ }}
3151
+ @pointerup=${() => this._stopRepeat()}
3152
+ @pointerleave=${() => this._stopRepeat()}
3153
+ >
3154
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em">
3155
+ <line x1="8" y1="3" x2="8" y2="13"/>
3156
+ <line x1="3" y1="8" x2="13" y2="8"/>
3157
+ </svg>
3158
+ </button>
3159
+ `;
3160
+ return t`
3161
+ ${this.controls !== "none" && this.controls !== "right" ? e : ""}
3162
+ <input
3163
+ class="void-number-input-field"
3164
+ type="text"
3165
+ inputmode="numeric"
3166
+ .value=${this._format(this.value)}
3167
+ placeholder=${this.placeholder}
3168
+ ?disabled=${this.disabled}
3169
+ ?readonly=${this.readonly}
3170
+ aria-label=${this.label || "Number input"}
3171
+ @keydown=${this._onKeydown}
3172
+ @blur=${this._onBlur}
3173
+ @change=${this._onInputChange}
3174
+ />
3175
+ ${this.controls === "right" ? t`<div class="void-number-input-btn-group">${n}${e}</div>` : ""}
3176
+ ${this.controls === "sides" ? n : ""}
3177
+ `;
3178
+ }
3179
+ };
3180
+ s([r({
3181
+ type: Number,
3182
+ reflect: !0
3183
+ })], K.prototype, "value", void 0), s([r({ type: Number })], K.prototype, "min", void 0), s([r({ type: Number })], K.prototype, "max", void 0), s([r({ type: Number })], K.prototype, "step", void 0), s([r({ type: Number })], K.prototype, "precision", void 0), s([r({
3184
+ type: Boolean,
3185
+ reflect: !0
3186
+ })], K.prototype, "disabled", void 0), s([r({
3187
+ type: Boolean,
3188
+ reflect: !0
3189
+ })], K.prototype, "readonly", void 0), s([r({
3190
+ type: String,
3191
+ reflect: !0
3192
+ })], K.prototype, "size", void 0), s([r({
3193
+ type: String,
3194
+ reflect: !0
3195
+ })], K.prototype, "color", void 0), s([r({ type: String })], K.prototype, "placeholder", void 0), s([r({
3196
+ type: String,
3197
+ reflect: !0
3198
+ })], K.prototype, "controls", void 0), s([r({ type: String })], K.prototype, "label", void 0), s([i(".void-number-input-field")], K.prototype, "_input", void 0), customElements.get("void-number-input") || customElements.define("void-number-input", K);
3199
+ //#endregion
3200
+ //#region src/components/collapsible.ts
3201
+ var Me = class extends o {
3202
+ constructor(...e) {
3203
+ super(...e), this.heading = "", this.open = !1, this.disabled = !1, this._id = Math.random().toString(36).slice(2), this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
3204
+ e.preventDefault(), !this.disabled && (this.open = !this.open, this.dispatchEvent(new CustomEvent("void-toggle", {
3205
+ bubbles: !0,
3206
+ composed: !0,
3207
+ detail: { open: this.open }
3208
+ })));
3209
+ }, this._handleKeydown = (e) => {
3210
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._handleClick(e));
3211
+ };
3212
+ }
3213
+ connectedCallback() {
3214
+ super.connectedCallback(), this._didSetup || (this._userContent = Array.from(this.childNodes));
3215
+ }
3216
+ updated(e) {
3217
+ if (super.updated(e), !this._didSetup) {
3218
+ this._didSetup = !0;
3219
+ let e = this.querySelector(".void-collapsible-inner");
3220
+ if (e) for (let t of this._userContent) e.appendChild(t);
3221
+ }
3222
+ }
3223
+ render() {
3224
+ return t`
3225
+ <button
3226
+ id="trigger-${this._id}"
3227
+ class="void-collapsible-trigger"
3228
+ aria-expanded=${String(this.open)}
3229
+ aria-controls="content-${this._id}"
3230
+ @click=${this._handleClick}
3231
+ @keydown=${this._handleKeydown}
3232
+ >
3233
+ ${this.heading}
3234
+ <svg class="void-collapsible-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true">
3235
+ <path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
3236
+ </svg>
3237
+ </button>
3238
+ <div
3239
+ id="content-${this._id}"
3240
+ class="void-collapsible-content"
3241
+ role="region"
3242
+ aria-labelledby="trigger-${this._id}"
3243
+ ><div class="void-collapsible-inner"></div></div>
3244
+ `;
3245
+ }
3246
+ };
3247
+ s([r({ type: String })], Me.prototype, "heading", void 0), s([r({
3248
+ type: Boolean,
3249
+ reflect: !0
3250
+ })], Me.prototype, "open", void 0), s([r({
3251
+ type: Boolean,
3252
+ reflect: !0
3253
+ })], Me.prototype, "disabled", void 0), customElements.get("void-collapsible") || customElements.define("void-collapsible", Me);
3254
+ //#endregion
3255
+ //#region src/components/editable.ts
3256
+ var q = class extends o {
3257
+ constructor(...e) {
3258
+ super(...e), this.value = "", this.editing = !1, this.disabled = !1, this.placeholder = "Click to edit", this.submitMode = "both", this.size = "md", this._previousValue = "", this._handleClick = () => {
3259
+ this.disabled || this.editing || this._enterEditMode();
3260
+ }, this._handlePreviewKeydown = (e) => {
3261
+ this.disabled || this.editing || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._enterEditMode());
3262
+ }, this._handleInputKeydown = (e) => {
3263
+ if (e.key === "Escape") {
3264
+ e.preventDefault(), this._cancel();
3265
+ return;
3266
+ }
3267
+ e.key === "Enter" && (this.submitMode === "enter" || this.submitMode === "both") && (e.preventDefault(), this._confirm());
3268
+ }, this._handleBlur = () => {
3269
+ this.editing && (this.submitMode === "blur" || this.submitMode === "both" ? this._confirm() : this._cancel());
3270
+ };
3271
+ }
3272
+ connectedCallback() {
3273
+ super.connectedCallback(), this.addEventListener("click", this._handleClick), this.addEventListener("dblclick", this._handleClick);
3274
+ }
3275
+ disconnectedCallback() {
3276
+ super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("dblclick", this._handleClick);
3277
+ }
3278
+ render() {
3279
+ return t`
3280
+ <span
3281
+ class="void-editable-preview"
3282
+ tabindex=${this.disabled ? n : "0"}
3283
+ @keydown=${this._handlePreviewKeydown}
3284
+ >${this.value || t`<span class="void-editable-placeholder">${this.placeholder}</span>`}</span>
3285
+ <input
3286
+ class="void-editable-input"
3287
+ .value=${this.value}
3288
+ @keydown=${this._handleInputKeydown}
3289
+ @blur=${this._handleBlur}
3290
+ />
3291
+ `;
3292
+ }
3293
+ _enterEditMode() {
3294
+ this._previousValue = this.value, this.editing = !0, this.updateComplete.then(() => {
3295
+ let e = this.querySelector(".void-editable-input");
3296
+ e && (e.focus(), e.select());
3297
+ });
3298
+ }
3299
+ _confirm() {
3300
+ let e = this.querySelector(".void-editable-input");
3301
+ e && (this.value = e.value), this.editing = !1, this.dispatchEvent(new CustomEvent("void-change", {
3302
+ bubbles: !0,
3303
+ composed: !0,
3304
+ detail: { value: this.value }
3305
+ }));
3306
+ }
3307
+ _cancel() {
3308
+ this.value = this._previousValue, this.editing = !1, this.dispatchEvent(new CustomEvent("void-cancel", {
3309
+ bubbles: !0,
3310
+ composed: !0
3311
+ }));
3312
+ }
3313
+ };
3314
+ s([r({
3315
+ type: String,
3316
+ reflect: !0
3317
+ })], q.prototype, "value", void 0), s([r({
3318
+ type: Boolean,
3319
+ reflect: !0
3320
+ })], q.prototype, "editing", void 0), s([r({
3321
+ type: Boolean,
3322
+ reflect: !0
3323
+ })], q.prototype, "disabled", void 0), s([r({ type: String })], q.prototype, "placeholder", void 0), s([r({
3324
+ type: String,
3325
+ reflect: !0,
3326
+ attribute: "submit-mode"
3327
+ })], q.prototype, "submitMode", void 0), s([r({
3328
+ type: String,
3329
+ reflect: !0
3330
+ })], q.prototype, "size", void 0), customElements.get("void-editable") || customElements.define("void-editable", q);
3331
+ //#endregion
3332
+ //#region src/components/hover-card.ts
3333
+ var J = class extends o {
3334
+ constructor(...e) {
3335
+ super(...e), this.open = !1, this.position = "bottom", this.openDelay = 300, this.closeDelay = 300, this._triggerEl = null, this._contentNodes = [], this._didSetup = !1, this._onTriggerEnter = () => {
3336
+ clearTimeout(this._closeTimerId), this._openTimerId = setTimeout(() => {
3337
+ this._openCard();
3338
+ }, this.openDelay);
3339
+ }, this._onTriggerLeave = () => {
3340
+ clearTimeout(this._openTimerId), this._closeTimerId = setTimeout(() => {
3341
+ this._closeCard();
3342
+ }, this.closeDelay);
3343
+ }, this._onBodyEnter = () => {
3344
+ clearTimeout(this._closeTimerId);
3345
+ }, this._onBodyLeave = () => {
3346
+ this._closeTimerId = setTimeout(() => {
3347
+ this._closeCard();
3348
+ }, this.closeDelay);
3349
+ }, this._onFocusIn = () => {
3350
+ clearTimeout(this._closeTimerId), this._openCard();
3351
+ }, this._onFocusOut = () => {
3352
+ this._closeTimerId = setTimeout(() => {
3353
+ this._closeCard();
3354
+ }, this.closeDelay);
3355
+ }, this._handleKeydown = (e) => {
3356
+ e.key === "Escape" && this.open && this._closeCard();
3357
+ };
3358
+ }
3359
+ connectedCallback() {
3360
+ super.connectedCallback(), this._didSetup || (this._triggerEl = this.children[0] ?? null, this._contentNodes = Array.from(this.childNodes).filter((e) => e !== this._triggerEl)), document.addEventListener("keydown", this._handleKeydown);
3361
+ }
3362
+ disconnectedCallback() {
3363
+ super.disconnectedCallback(), clearTimeout(this._openTimerId), clearTimeout(this._closeTimerId), document.removeEventListener("keydown", this._handleKeydown);
3364
+ }
3365
+ updated(e) {
3366
+ if (super.updated(e), !this._didSetup) {
3367
+ if (this._didSetup = !0, this._triggerEl) {
3368
+ let e = document.createElement("div");
3369
+ e.className = "void-hover-card-trigger", e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", String(this.open)), e.appendChild(this._triggerEl), e.addEventListener("mouseenter", this._onTriggerEnter), e.addEventListener("mouseleave", this._onTriggerLeave), e.addEventListener("focusin", this._onFocusIn), e.addEventListener("focusout", this._onFocusOut), this.appendChild(e);
3370
+ }
3371
+ let e = document.createElement("div");
3372
+ e.className = "void-hover-card-body", e.setAttribute("role", "dialog"), e.addEventListener("mouseenter", this._onBodyEnter), e.addEventListener("mouseleave", this._onBodyLeave);
3373
+ for (let t of this._contentNodes) e.appendChild(t);
3374
+ this.appendChild(e);
3375
+ }
3376
+ if (e.has("open")) {
3377
+ let e = this.querySelector(".void-hover-card-trigger");
3378
+ e && e.setAttribute("aria-expanded", String(this.open));
3379
+ }
3380
+ }
3381
+ _openCard() {
3382
+ this.open || (this.open = !0, this.dispatchEvent(new CustomEvent("void-open", {
3383
+ bubbles: !0,
3384
+ composed: !0
3385
+ })));
3386
+ }
3387
+ _closeCard() {
3388
+ this.open && (this.open = !1, this.dispatchEvent(new CustomEvent("void-close", {
3389
+ bubbles: !0,
3390
+ composed: !0
3391
+ })));
3392
+ }
3393
+ };
3394
+ s([r({
3395
+ type: Boolean,
3396
+ reflect: !0
3397
+ })], J.prototype, "open", void 0), s([r({
3398
+ type: String,
3399
+ reflect: !0
3400
+ })], J.prototype, "position", void 0), s([r({
3401
+ type: Number,
3402
+ attribute: "open-delay"
3403
+ })], J.prototype, "openDelay", void 0), s([r({
3404
+ type: Number,
3405
+ attribute: "close-delay"
3406
+ })], J.prototype, "closeDelay", void 0), customElements.get("void-hover-card") || customElements.define("void-hover-card", J);
3407
+ //#endregion
3408
+ //#region src/components/pin-input.ts
3409
+ var Y = class extends o {
3410
+ constructor(...e) {
3411
+ super(...e), this.length = 6, this.groups = "", this.value = "", this.disabled = !1, this.mask = !1, this.type = "numeric", this.size = "md", this.color = "default", this.placeholder = "";
3412
+ }
3413
+ get _effectiveLength() {
3414
+ let e = this._parsedGroups;
3415
+ return e.length > 0 ? e.reduce((e, t) => e + t, 0) : this.length;
3416
+ }
3417
+ get _parsedGroups() {
3418
+ return this.groups ? this.groups.split(",").map((e) => parseInt(e.trim(), 10)).filter((e) => e > 0) : [];
3419
+ }
3420
+ _separatorIndices() {
3421
+ let e = this._parsedGroups;
3422
+ if (e.length < 2) return /* @__PURE__ */ new Set();
3423
+ let t = /* @__PURE__ */ new Set(), n = 0;
3424
+ for (let r = 0; r < e.length - 1; r++) n += e[r], t.add(n);
3425
+ return t;
3426
+ }
3427
+ connectedCallback() {
3428
+ super.connectedCallback(), this.setAttribute("role", "group"), this.setAttribute("aria-label", "PIN input");
3429
+ }
3430
+ _getCells() {
3431
+ return Array.from(this.querySelectorAll(".void-pin-cell"));
3432
+ }
3433
+ _focusCell(e) {
3434
+ let t = this._getCells();
3435
+ e >= 0 && e < t.length && (t[e].focus(), t[e].select());
3436
+ }
3437
+ _collectValue() {
3438
+ return this._getCells().map((e) => e.value).join("");
3439
+ }
3440
+ _syncValue() {
3441
+ let e = this.value;
3442
+ this.value = this._collectValue(), this.value !== e && (this.dispatchEvent(new CustomEvent("void-change", {
3443
+ bubbles: !0,
3444
+ composed: !0,
3445
+ detail: { value: this.value }
3446
+ })), this.value.length === this._effectiveLength && this.dispatchEvent(new CustomEvent("void-complete", {
3447
+ bubbles: !0,
3448
+ composed: !0,
3449
+ detail: { value: this.value }
3450
+ })));
3451
+ }
3452
+ _isValidChar(e) {
3453
+ return this.type === "numeric" ? /^[0-9]$/.test(e) : /^[a-zA-Z0-9]$/.test(e);
3454
+ }
3455
+ _onInput(e, t) {
3456
+ let n = e.target, r = n.value;
3457
+ if (r && !this._isValidChar(r)) {
3458
+ n.value = "";
3459
+ return;
3460
+ }
3461
+ this._syncValue(), r && t < this._effectiveLength - 1 && this._focusCell(t + 1);
3462
+ }
3463
+ _onKeydown(e, t) {
3464
+ let n = e.target;
3465
+ if (e.key === "Backspace") {
3466
+ if (n.value) n.value = "", this._syncValue();
3467
+ else if (t > 0) {
3468
+ this._focusCell(t - 1);
3469
+ let e = this._getCells()[t - 1];
3470
+ e.value = "", this._syncValue();
3471
+ }
3472
+ e.preventDefault();
3473
+ } else e.key === "ArrowLeft" ? (e.preventDefault(), this._focusCell(t - 1)) : e.key === "ArrowRight" ? (e.preventDefault(), this._focusCell(t + 1)) : e.key === "Delete" && (n.value = "", this._syncValue(), e.preventDefault());
3474
+ }
3475
+ _onPaste(e) {
3476
+ e.preventDefault();
3477
+ let t = e.clipboardData?.getData("text") ?? "", n = this._getCells(), r = e.target, i = n.indexOf(r), a = 0;
3478
+ for (let e = 0; e < t.length && i + a < n.length; e++) {
3479
+ let r = t[e];
3480
+ this._isValidChar(r) && (n[i + a].value = r, a++);
3481
+ }
3482
+ this._syncValue();
3483
+ let o = Math.min(i + a, this._effectiveLength - 1);
3484
+ this._focusCell(o);
3485
+ }
3486
+ _onFocus(e) {
3487
+ e.target.select();
3488
+ }
3489
+ render() {
3490
+ let e = [], r = this._separatorIndices();
3491
+ for (let i = 0; i < this._effectiveLength; i++) {
3492
+ r.has(i) && e.push(t`<span class="void-pin-separator" aria-hidden="true">–</span>`);
3493
+ let a = this.value[i] ?? "";
3494
+ e.push(t`
3495
+ <input
3496
+ class="void-pin-cell"
3497
+ type=${this.mask ? "password" : "text"}
3498
+ inputmode=${this.type === "numeric" ? "numeric" : "text"}
3499
+ maxlength="1"
3500
+ .value=${a}
3501
+ placeholder=${this.placeholder || n}
3502
+ ?disabled=${this.disabled}
3503
+ autocomplete="one-time-code"
3504
+ aria-label=${`Digit ${i + 1} of ${this._effectiveLength}`}
3505
+ @input=${(e) => this._onInput(e, i)}
3506
+ @keydown=${(e) => this._onKeydown(e, i)}
3507
+ @paste=${this._onPaste}
3508
+ @focus=${this._onFocus}
3509
+ />
3510
+ `);
3511
+ }
3512
+ return t`<div class="void-pin-input">${e}</div>`;
3513
+ }
3514
+ };
3515
+ s([r({ type: Number })], Y.prototype, "length", void 0), s([r({
3516
+ type: String,
3517
+ reflect: !0
3518
+ })], Y.prototype, "groups", void 0), s([r({ type: String })], Y.prototype, "value", void 0), s([r({
3519
+ type: Boolean,
3520
+ reflect: !0
3521
+ })], Y.prototype, "disabled", void 0), s([r({
3522
+ type: Boolean,
3523
+ reflect: !0
3524
+ })], Y.prototype, "mask", void 0), s([r({
3525
+ type: String,
3526
+ reflect: !0
3527
+ })], Y.prototype, "type", void 0), s([r({
3528
+ type: String,
3529
+ reflect: !0
3530
+ })], Y.prototype, "size", void 0), s([r({
3531
+ type: String,
3532
+ reflect: !0
3533
+ })], Y.prototype, "color", void 0), s([r({ type: String })], Y.prototype, "placeholder", void 0), customElements.get("void-pin-input") || customElements.define("void-pin-input", Y);
3534
+ //#endregion
3535
+ //#region src/components/tags-input.ts
3536
+ var X = class extends o {
3537
+ constructor(...e) {
3538
+ super(...e), this.value = [], this.disabled = !1, this.readonly = !1, this.max = Infinity, this.placeholder = "Add tag...", this.size = "md", this.color = "default", this.variant = "outline", this.allowDuplicates = !1;
3539
+ }
3540
+ _tagText(e) {
3541
+ return typeof e == "string" ? e : e.text;
3542
+ }
3543
+ _tagColor(e) {
3544
+ return typeof e == "string" ? void 0 : e.color;
3545
+ }
3546
+ connectedCallback() {
3547
+ super.connectedCallback(), this.setAttribute("role", "listbox");
3548
+ }
3549
+ render() {
3550
+ let e = this.value.length >= this.max;
3551
+ return t`
3552
+ <div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
3553
+ ${this.value.map((e, r) => {
3554
+ let i = this._tagText(e);
3555
+ return t`
3556
+ <span
3557
+ class="void-tags-input-tag"
3558
+ role="option"
3559
+ aria-selected="true"
3560
+ data-color=${this._tagColor(e) || n}
3561
+ >
3562
+ <span class="void-tags-input-tag-text">${i}</span>
3563
+ ${!this.disabled && !this.readonly ? t`<button
3564
+ class="void-tags-input-tag-remove"
3565
+ aria-label="Remove ${i}"
3566
+ @click=${(e) => {
3567
+ e.stopPropagation(), this._removeTag(r);
3568
+ }}
3569
+ >×</button>` : n}
3570
+ </span>
3571
+ `;
3572
+ })}
3573
+ ${!e && !this.readonly ? t`<input
3574
+ class="void-tags-input-field"
3575
+ type="text"
3576
+ placeholder=${this.value.length === 0 ? this.placeholder : ""}
3577
+ ?disabled=${this.disabled}
3578
+ @keydown=${this._onKeydown}
3579
+ @paste=${this._onPaste}
3580
+ />` : n}
3581
+ </div>
3582
+ `;
3583
+ }
3584
+ _focusInput() {
3585
+ this.querySelector(".void-tags-input-field")?.focus();
3586
+ }
3587
+ _onContainerKeydown(e) {
3588
+ e.target === this.querySelector(".void-tags-input") && this._focusInput();
3589
+ }
3590
+ _addTag(e) {
3591
+ let t = e.trim();
3592
+ t && (!this.allowDuplicates && this.value.some((e) => this._tagText(e) === t) || this.value.length >= this.max || (this.value = [...this.value, t], this._dispatchChange()));
3593
+ }
3594
+ _removeTag(e) {
3595
+ this.disabled || this.readonly || (this.value = this.value.filter((t, n) => n !== e), this._dispatchChange());
3596
+ }
3597
+ _onKeydown(e) {
3598
+ let t = e.target;
3599
+ if (e.key === "Enter" || e.key === ",") {
3600
+ e.preventDefault();
3601
+ let n = (e.key, t.value);
3602
+ this._addTag(n), t.value = "";
3603
+ } else e.key === "Backspace" && t.value === "" && this.value.length > 0 && this._removeTag(this.value.length - 1);
3604
+ }
3605
+ _onPaste(e) {
3606
+ let t = e.clipboardData?.getData("text") ?? "";
3607
+ if (t.includes(",")) {
3608
+ e.preventDefault();
3609
+ let n = t.split(",");
3610
+ for (let e of n) this._addTag(e);
3611
+ }
3612
+ }
3613
+ _dispatchChange() {
3614
+ this.dispatchEvent(new CustomEvent("void-change", {
3615
+ bubbles: !0,
3616
+ composed: !0,
3617
+ detail: { value: this.value }
3618
+ }));
3619
+ }
3620
+ };
3621
+ s([r({ type: Array })], X.prototype, "value", void 0), s([r({
3622
+ type: Boolean,
3623
+ reflect: !0
3624
+ })], X.prototype, "disabled", void 0), s([r({
3625
+ type: Boolean,
3626
+ reflect: !0
3627
+ })], X.prototype, "readonly", void 0), s([r({ type: Number })], X.prototype, "max", void 0), s([r({ type: String })], X.prototype, "placeholder", void 0), s([r({
3628
+ type: String,
3629
+ reflect: !0
3630
+ })], X.prototype, "size", void 0), s([r({
3631
+ type: String,
3632
+ reflect: !0
3633
+ })], X.prototype, "color", void 0), s([r({
3634
+ type: String,
3635
+ reflect: !0
3636
+ })], X.prototype, "variant", void 0), s([r({ type: Boolean })], X.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", X);
3637
+ //#endregion
3638
+ //#region src/components/nav-menu.ts
3639
+ var Ne = class extends o {
3640
+ constructor(...e) {
3641
+ super(...e), this.orientation = "horizontal", this.width = "", this._handleItemOpen = (e) => {
3642
+ let t = e.target, n = this._getItems();
3643
+ for (let e of n) e !== t && e.open && (e.open = !1, e.dispatchEvent(new CustomEvent("void-close", {
3644
+ bubbles: !0,
3645
+ composed: !0
3646
+ })));
3647
+ }, this._handleKeydown = (e) => {
3648
+ let t = this._getItems();
3649
+ if (!t.length) return;
3650
+ let n = this.orientation === "horizontal", r = n ? "ArrowRight" : "ArrowDown", i = n ? "ArrowLeft" : "ArrowUp";
3651
+ if (e.key === r || e.key === i) {
3652
+ e.preventDefault();
3653
+ let n = t.map((e) => e.querySelector(".void-nav-menu-trigger")).filter(Boolean), i = n.indexOf(document.activeElement);
3654
+ e.key === r ? (n[i + 1] ?? n[0])?.focus() : (n[i - 1] ?? n[n.length - 1])?.focus();
3655
+ }
3656
+ if (e.key === "Enter" || e.key === " ") {
3657
+ let t = document.activeElement?.closest?.("void-nav-menu-item");
3658
+ t && this.contains(t) && !t.href && (e.preventDefault(), t.open = !t.open, t.open ? t.dispatchEvent(new CustomEvent("void-open", {
3659
+ bubbles: !0,
3660
+ composed: !0
3661
+ })) : t.dispatchEvent(new CustomEvent("void-close", {
3662
+ bubbles: !0,
3663
+ composed: !0
3664
+ })));
3665
+ }
3666
+ if (e.key === "Escape") for (let e of t) e.open && (e.open = !1, e.dispatchEvent(new CustomEvent("void-close", {
3667
+ bubbles: !0,
3668
+ composed: !0
3669
+ })), e.querySelector(".void-nav-menu-trigger")?.focus());
3670
+ };
3671
+ }
3672
+ connectedCallback() {
3673
+ super.connectedCallback(), this.setAttribute("role", "menubar"), this.addEventListener("keydown", this._handleKeydown), this.addEventListener("void-open", this._handleItemOpen);
3674
+ }
3675
+ disconnectedCallback() {
3676
+ super.disconnectedCallback(), this.removeEventListener("keydown", this._handleKeydown), this.removeEventListener("void-open", this._handleItemOpen);
3677
+ }
3678
+ updated(e) {
3679
+ super.updated(e), e.has("width") && (this.width ? this.style.setProperty("--void-nav-menu-width", this.width) : this.style.removeProperty("--void-nav-menu-width"));
3680
+ }
3681
+ _getItems() {
3682
+ return Array.from(this.querySelectorAll(":scope > void-nav-menu-item"));
3683
+ }
3684
+ };
3685
+ s([r({
3686
+ type: String,
3687
+ reflect: !0
3688
+ })], Ne.prototype, "orientation", void 0), s([r({
3689
+ type: String,
3690
+ reflect: !0
3691
+ })], Ne.prototype, "width", void 0), customElements.get("void-nav-menu") || customElements.define("void-nav-menu", Ne);
3692
+ var Z = class extends o {
3693
+ constructor(...e) {
3694
+ super(...e), this.open = !1, this.disabled = !1, this.href = "", this.active = !1, this._triggerEl = null, this._contentEl = null, this._contentNodes = [], this._didSetup = !1, this._onMouseEnter = () => {
3695
+ this.disabled || !this._contentEl || (clearTimeout(this._closeTimerId), this._openTimerId = setTimeout(() => {
3696
+ this._openDropdown();
3697
+ }, 150));
3698
+ }, this._onMouseLeave = () => {
3699
+ this._contentEl && (clearTimeout(this._openTimerId), this._closeTimerId = setTimeout(() => {
3700
+ this._closeDropdown();
3701
+ }, 300));
3702
+ }, this._onContentEnter = () => {
3703
+ clearTimeout(this._closeTimerId);
3704
+ }, this._onContentLeave = () => {
3705
+ this._closeTimerId = setTimeout(() => {
3706
+ this._closeDropdown();
3707
+ }, 300);
3708
+ }, this._onOutsideClick = (e) => {
3709
+ this.open && !this.contains(e.target) && this._closeDropdown();
3710
+ };
3711
+ }
3712
+ connectedCallback() {
3713
+ super.connectedCallback(), this.setAttribute("role", "none"), this._didSetup || (this._contentNodes = Array.from(this.childNodes)), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), document.addEventListener("mousedown", this._onOutsideClick);
3714
+ }
3715
+ disconnectedCallback() {
3716
+ super.disconnectedCallback(), clearTimeout(this._openTimerId), clearTimeout(this._closeTimerId), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), document.removeEventListener("mousedown", this._onOutsideClick);
3717
+ }
3718
+ updated(e) {
3719
+ if (super.updated(e), !this._didSetup) {
3720
+ this._didSetup = !0, this.href ? (this._triggerEl = document.createElement("a"), this._triggerEl.href = this.href) : (this._triggerEl = document.createElement("button"), this._triggerEl.type = "button"), this._triggerEl.className = "void-nav-menu-trigger", this._triggerEl.setAttribute("role", "menuitem"), this._triggerEl.setAttribute("tabindex", this.disabled ? "-1" : "0");
3721
+ let e = [], t = [];
3722
+ for (let n of this._contentNodes) n.nodeType === Node.TEXT_NODE && n.textContent?.trim() ? e.push(n) : n.nodeType === Node.ELEMENT_NODE && t.push(n);
3723
+ for (let t of e) this._triggerEl.appendChild(t);
3724
+ if (this.appendChild(this._triggerEl), t.length > 0) {
3725
+ this._triggerEl.setAttribute("aria-haspopup", "true"), this._triggerEl.setAttribute("aria-expanded", String(this.open)), this._contentEl = document.createElement("div"), this._contentEl.className = "void-nav-menu-content", this._contentEl.setAttribute("role", "menu");
3726
+ for (let e of t) this._contentEl.appendChild(e);
3727
+ this._contentEl.addEventListener("mouseenter", this._onContentEnter), this._contentEl.addEventListener("mouseleave", this._onContentLeave), this.appendChild(this._contentEl);
3728
+ }
3729
+ }
3730
+ e.has("open") && this._triggerEl && this._triggerEl.setAttribute("aria-expanded", String(this.open)), e.has("disabled") && this._triggerEl && (this._triggerEl.setAttribute("tabindex", this.disabled ? "-1" : "0"), this._triggerEl.setAttribute("aria-disabled", String(this.disabled)), this._triggerEl instanceof HTMLButtonElement && (this._triggerEl.disabled = this.disabled)), e.has("href") && this._triggerEl instanceof HTMLAnchorElement && (this._triggerEl.href = this.href);
3731
+ }
3732
+ _openDropdown() {
3733
+ this.open || (this.open = !0, this.dispatchEvent(new CustomEvent("void-open", {
3734
+ bubbles: !0,
3735
+ composed: !0
3736
+ })));
3737
+ }
3738
+ _closeDropdown() {
3739
+ this.open && (this.open = !1, this.dispatchEvent(new CustomEvent("void-close", {
3740
+ bubbles: !0,
3741
+ composed: !0
3742
+ })));
3743
+ }
3744
+ };
3745
+ s([r({
3746
+ type: Boolean,
3747
+ reflect: !0
3748
+ })], Z.prototype, "open", void 0), s([r({
3749
+ type: Boolean,
3750
+ reflect: !0
3751
+ })], Z.prototype, "disabled", void 0), s([r({ type: String })], Z.prototype, "href", void 0), s([r({
3752
+ type: Boolean,
3753
+ reflect: !0
3754
+ })], Z.prototype, "active", void 0), customElements.get("void-nav-menu-item") || customElements.define("void-nav-menu-item", Z);
3755
+ //#endregion
3756
+ //#region src/components/color-picker.ts
3757
+ var Q = class e extends o {
3758
+ constructor(...e) {
3759
+ super(...e), this.value = "#000000", this.disabled = !1, this.size = "md", this.swatches = [], this.showInput = !0, this.variant = "default", this.open = !1, this._hue = 0, this._saturation = 0, this._brightness = 0, this._dragging = null, this._boundPointerMove = null, this._boundPointerUp = null, this._onDocumentClick = (e) => {
3760
+ this.open && (this.contains(e.target) || (this.open = !1));
3761
+ };
3762
+ }
3763
+ connectedCallback() {
3764
+ super.connectedCallback(), this._syncFromHex(this.value), this._boundPointerMove = this._onPointerMove.bind(this), this._boundPointerUp = this._onPointerUp.bind(this);
3765
+ }
3766
+ disconnectedCallback() {
3767
+ super.disconnectedCallback(), document.removeEventListener("pointermove", this._boundPointerMove), document.removeEventListener("pointerup", this._boundPointerUp);
3768
+ }
3769
+ _applyCustomProperties() {
3770
+ let e = this._hsvToHex(this._hue, 100, 100);
3771
+ this.style.setProperty("--void-cp-hue", e), this.style.setProperty("--void-cp-current", this.value), this.style.setProperty("--void-cp-area-x", `${this._saturation}%`), this.style.setProperty("--void-cp-area-y", `${100 - this._brightness}%`), this.style.setProperty("--void-cp-hue-x", `${this._hue / 360 * 100}%`);
3772
+ }
3773
+ _hsvToRgb(e, t, n) {
3774
+ let r = t / 100, i = n / 100, a = i * r, o = a * (1 - Math.abs(e / 60 % 2 - 1)), s = i - a, c = 0, l = 0, u = 0;
3775
+ return e < 60 ? (c = a, l = o, u = 0) : e < 120 ? (c = o, l = a, u = 0) : e < 180 ? (c = 0, l = a, u = o) : e < 240 ? (c = 0, l = o, u = a) : e < 300 ? (c = o, l = 0, u = a) : (c = a, l = 0, u = o), [
3776
+ Math.round((c + s) * 255),
3777
+ Math.round((l + s) * 255),
3778
+ Math.round((u + s) * 255)
3779
+ ];
3780
+ }
3781
+ _hsvToHex(e, t, n) {
3782
+ let [r, i, a] = this._hsvToRgb(e, t, n);
3783
+ return `#${r.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
3784
+ }
3785
+ _hexToRgb(e) {
3786
+ let t = e.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);
3787
+ return t ? [
3788
+ parseInt(t[1], 16),
3789
+ parseInt(t[2], 16),
3790
+ parseInt(t[3], 16)
3791
+ ] : null;
3792
+ }
3793
+ _rgbToHsv(e, t, n) {
3794
+ let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = o - Math.min(r, i, a), c = 0;
3795
+ s !== 0 && (c = o === r ? (i - a) / s % 6 : o === i ? (a - r) / s + 2 : (r - i) / s + 4, c = Math.round(c * 60), c < 0 && (c += 360));
3796
+ let l = o === 0 ? 0 : Math.round(s / o * 100), u = Math.round(o * 100);
3797
+ return [
3798
+ c,
3799
+ l,
3800
+ u
3801
+ ];
3802
+ }
3803
+ _syncFromHex(e) {
3804
+ let t = this._hexToRgb(e);
3805
+ if (!t) return;
3806
+ let [n, r, i] = this._rgbToHsv(...t);
3807
+ this._hue = n, this._saturation = r, this._brightness = i;
3808
+ }
3809
+ static isValidHex(e) {
3810
+ return /^#[a-f\d]{6}$/i.test(e);
3811
+ }
3812
+ _updateValue() {
3813
+ let e = this._hsvToHex(this._hue, this._saturation, this._brightness);
3814
+ this.value = e, this.dispatchEvent(new CustomEvent("void-change", {
3815
+ bubbles: !0,
3816
+ composed: !0,
3817
+ detail: { value: this.value }
3818
+ }));
3819
+ }
3820
+ _onAreaPointerDown(e) {
3821
+ this.disabled || (this._dragging = "area", this._updateAreaFromPointer(e), document.addEventListener("pointermove", this._boundPointerMove), document.addEventListener("pointerup", this._boundPointerUp));
3822
+ }
3823
+ _onHuePointerDown(e) {
3824
+ this.disabled || (this._dragging = "hue", this._updateHueFromPointer(e), document.addEventListener("pointermove", this._boundPointerMove), document.addEventListener("pointerup", this._boundPointerUp));
3825
+ }
3826
+ _onPointerMove(e) {
3827
+ this._dragging === "area" ? this._updateAreaFromPointer(e) : this._dragging === "hue" && this._updateHueFromPointer(e);
3828
+ }
3829
+ _onPointerUp() {
3830
+ this._dragging = null, document.removeEventListener("pointermove", this._boundPointerMove), document.removeEventListener("pointerup", this._boundPointerUp);
3831
+ }
3832
+ _updateAreaFromPointer(e) {
3833
+ let t = this.querySelector(".void-color-picker-area");
3834
+ if (!t) return;
3835
+ let n = t.getBoundingClientRect(), r = Math.max(0, Math.min(1, (e.clientX - n.left) / n.width)), i = Math.max(0, Math.min(1, (e.clientY - n.top) / n.height));
3836
+ this._saturation = Math.round(r * 100), this._brightness = Math.round((1 - i) * 100), this._updateValue();
3837
+ }
3838
+ _updateHueFromPointer(e) {
3839
+ let t = this.querySelector(".void-color-picker-hue");
3840
+ if (!t) return;
3841
+ let n = t.getBoundingClientRect(), r = Math.max(0, Math.min(1, (e.clientX - n.left) / n.width));
3842
+ this._hue = Math.round(r * 360), this._updateValue();
3843
+ }
3844
+ _onHexInput(t) {
3845
+ let n = t.target.value.trim();
3846
+ n.startsWith("#") || (n = "#" + n), e.isValidHex(n) && (this._syncFromHex(n), this.value = n.toLowerCase(), this.dispatchEvent(new CustomEvent("void-change", {
3847
+ bubbles: !0,
3848
+ composed: !0,
3849
+ detail: { value: this.value }
3850
+ })));
3851
+ }
3852
+ _onSwatchClick(e) {
3853
+ this.disabled || (this._syncFromHex(e), this.value = e.toLowerCase(), this.dispatchEvent(new CustomEvent("void-change", {
3854
+ bubbles: !0,
3855
+ composed: !0,
3856
+ detail: { value: this.value }
3857
+ })));
3858
+ }
3859
+ _onCompactTriggerClick() {
3860
+ this.disabled || (this.open = !this.open);
3861
+ }
3862
+ _onCompactHexInput(e) {
3863
+ this._onHexInput(e);
3864
+ }
3865
+ updated(e) {
3866
+ e.has("value") && !this._dragging && this._syncFromHex(this.value), this._applyCustomProperties(), e.has("open") && (this.open ? document.addEventListener("click", this._onDocumentClick, !0) : document.removeEventListener("click", this._onDocumentClick, !0));
3867
+ }
3868
+ _renderPicker() {
3869
+ return t`
3870
+ <div class="void-color-picker">
3871
+ <div
3872
+ class="void-color-picker-area"
3873
+ @pointerdown=${this._onAreaPointerDown}
3874
+ >
3875
+ <div class="void-color-picker-area-thumb"></div>
3876
+ </div>
3877
+ <div
3878
+ class="void-color-picker-hue"
3879
+ @pointerdown=${this._onHuePointerDown}
3880
+ >
3881
+ <div class="void-color-picker-hue-thumb"></div>
3882
+ </div>
3883
+ ${this.showInput ? t`
3884
+ <div class="void-color-picker-field">
3885
+ <span class="void-color-picker-field-swatch"></span>
3886
+ <span class="void-color-picker-field-separator"></span>
3887
+ <input
3888
+ class="void-color-picker-input"
3889
+ type="text"
3890
+ .value=${this.value}
3891
+ ?disabled=${this.disabled}
3892
+ maxlength="7"
3893
+ @change=${this._onHexInput}
3894
+ />
3895
+ </div>
3896
+ ` : t`
3897
+ <div class="void-color-picker-preview"></div>
3898
+ `}
3899
+ ${this.swatches.length > 0 ? t`
3900
+ <div class="void-color-picker-swatches">
3901
+ ${this.swatches.map((e) => t`
3902
+ <button
3903
+ class="void-color-picker-swatch"
3904
+ style="--void-cp-swatch:${e}"
3905
+ aria-label=${e}
3906
+ ?disabled=${this.disabled}
3907
+ @click=${() => this._onSwatchClick(e)}
3908
+ ></button>
3909
+ `)}
3910
+ </div>
3911
+ ` : n}
3912
+ </div>
3913
+ `;
3914
+ }
3915
+ render() {
3916
+ return this.variant === "compact" ? t`
3917
+ <div class="void-color-picker-compact">
3918
+ <button
3919
+ class="void-color-picker-compact-trigger"
3920
+ @click=${this._onCompactTriggerClick}
3921
+ ?disabled=${this.disabled}
3922
+ aria-expanded=${String(this.open)}
3923
+ aria-haspopup="dialog"
3924
+ >
3925
+ <span class="void-color-picker-compact-swatch"></span>
3926
+ <span class="void-color-picker-field-separator"></span>
3927
+ <input
3928
+ class="void-color-picker-compact-input"
3929
+ type="text"
3930
+ .value=${this.value}
3931
+ ?disabled=${this.disabled}
3932
+ maxlength="7"
3933
+ @click=${(e) => e.stopPropagation()}
3934
+ @change=${this._onCompactHexInput}
3935
+ />
3936
+ </button>
3937
+ ${this.open ? t`
3938
+ <div class="void-color-picker-compact-dropdown" role="dialog" aria-label="Color picker">
3939
+ ${this._renderPicker()}
3940
+ </div>
3941
+ ` : n}
3942
+ </div>
3943
+ ` : this._renderPicker();
3944
+ }
3945
+ };
3946
+ s([r({
3947
+ type: String,
3948
+ reflect: !0
3949
+ })], Q.prototype, "value", void 0), s([r({
3950
+ type: Boolean,
3951
+ reflect: !0
3952
+ })], Q.prototype, "disabled", void 0), s([r({
3953
+ type: String,
3954
+ reflect: !0
3955
+ })], Q.prototype, "size", void 0), s([r({ type: Array })], Q.prototype, "swatches", void 0), s([r({
3956
+ type: Boolean,
3957
+ reflect: !0
3958
+ })], Q.prototype, "showInput", void 0), s([r({
3959
+ type: String,
3960
+ reflect: !0
3961
+ })], Q.prototype, "variant", void 0), s([r({
3962
+ type: Boolean,
3963
+ reflect: !0
3964
+ })], Q.prototype, "open", void 0), customElements.get("void-color-picker") || customElements.define("void-color-picker", Q);
3965
+ //#endregion
3966
+ //#region src/components/action-input.ts
3967
+ var $ = class extends o {
3968
+ constructor(...e) {
3969
+ super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.name = "", this.autocomplete = "", this.size = "md", this.color = "default", this.type = "text", this.icon = "search", this.actionLabel = "Action", this.position = "right", this.tooltipPosition = "top";
3970
+ }
3971
+ _renderIcon() {
3972
+ switch (this.icon) {
3973
+ case "copy": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666"/><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"/></svg>`;
3974
+ case "search": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
3975
+ case "send": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 14l11 -11"/><path d="M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5"/></svg>`;
3976
+ case "eye": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>`;
3977
+ case "eye-off": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>`;
3978
+ case "check": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>`;
3979
+ case "x": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12"/><path d="M6 6l12 12"/></svg>`;
3980
+ case "arrow-right": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0"/><path d="M13 18l6 -6"/><path d="M13 6l6 6"/></svg>`;
3981
+ case "clipboard": return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"/><path d="M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2"/></svg>`;
3982
+ default: return t`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
3983
+ }
3984
+ }
3985
+ _onInput(e) {
3986
+ let t = e.target;
3987
+ this.value = t.value, this.dispatchEvent(new CustomEvent("void-input", {
3988
+ bubbles: !0,
3989
+ composed: !0,
3990
+ detail: { value: this.value }
3991
+ }));
3992
+ }
3993
+ _onChange(e) {
3994
+ let t = e.target;
3995
+ this.value = t.value, this.dispatchEvent(new CustomEvent("void-change", {
3996
+ bubbles: !0,
3997
+ composed: !0,
3998
+ detail: { value: this.value }
3999
+ }));
4000
+ }
4001
+ _onAction() {
4002
+ this.disabled || this.dispatchEvent(new CustomEvent("void-action", {
4003
+ bubbles: !0,
4004
+ composed: !0,
4005
+ detail: { value: this.value }
4006
+ }));
4007
+ }
4008
+ render() {
4009
+ let e = t`
4010
+ <void-tooltip text=${this.actionLabel} position=${this.tooltipPosition}>
4011
+ <button
4012
+ class="void-action-input-btn"
4013
+ type="button"
4014
+ ?disabled=${this.disabled}
4015
+ aria-label=${this.actionLabel}
4016
+ @click=${this._onAction}
4017
+ >${this._renderIcon()}</button>
4018
+ </void-tooltip>
4019
+ `;
4020
+ return t`
4021
+ ${this.position === "left" ? e : ""}
4022
+ <input
4023
+ class="void-action-input-field"
4024
+ type=${this.type}
4025
+ .value=${this.value}
4026
+ placeholder=${this.placeholder}
4027
+ ?disabled=${this.disabled}
4028
+ ?readonly=${this.readonly}
4029
+ name=${this.name}
4030
+ autocomplete=${this.autocomplete}
4031
+ aria-label=${this.actionLabel}
4032
+ @input=${this._onInput}
4033
+ @change=${this._onChange}
4034
+ />
4035
+ ${this.position === "right" ? e : ""}
4036
+ `;
4037
+ }
4038
+ };
4039
+ s([r({ type: String })], $.prototype, "value", void 0), s([r({
4040
+ type: String,
4041
+ reflect: !0
4042
+ })], $.prototype, "placeholder", void 0), s([r({
4043
+ type: Boolean,
4044
+ reflect: !0
4045
+ })], $.prototype, "disabled", void 0), s([r({
4046
+ type: Boolean,
4047
+ reflect: !0
4048
+ })], $.prototype, "readonly", void 0), s([r({
4049
+ type: String,
4050
+ reflect: !0
4051
+ })], $.prototype, "name", void 0), s([r({
4052
+ type: String,
4053
+ reflect: !0
4054
+ })], $.prototype, "autocomplete", void 0), s([r({
4055
+ type: String,
4056
+ reflect: !0
4057
+ })], $.prototype, "size", void 0), s([r({
4058
+ type: String,
4059
+ reflect: !0
4060
+ })], $.prototype, "color", void 0), s([r({
4061
+ type: String,
4062
+ reflect: !0
4063
+ })], $.prototype, "type", void 0), s([r({
4064
+ type: String,
4065
+ reflect: !0
4066
+ })], $.prototype, "icon", void 0), s([r({
4067
+ type: String,
4068
+ attribute: "action-label"
4069
+ })], $.prototype, "actionLabel", void 0), s([r({
4070
+ type: String,
4071
+ reflect: !0
4072
+ })], $.prototype, "position", void 0), s([r({
4073
+ type: String,
4074
+ reflect: !0,
4075
+ attribute: "tooltip-position"
4076
+ })], $.prototype, "tooltipPosition", void 0), customElements.get("void-action-input") || customElements.define("void-action-input", $);
2289
4077
  //#endregion
2290
- export { k as VoidAccordion, A as VoidAccordionItem, p as VoidAlert, f as VoidAvatar, c as VoidBadge, R as VoidBanner, re as VoidBreadcrumbs, l as VoidButton, F as VoidCard, b as VoidCheckbox, U as VoidCheckboxGroup, W as VoidCombobox, J as VoidComposeInput, E as VoidDialog, u as VoidDivider, P as VoidDrawer, ce as VoidDropdownMenu, le as VoidDropdownMenuItem, o as VoidElement, H as VoidErrorFallback, C as VoidField, K as VoidFileUpload, oe as VoidHamburger, $ as VoidIndicator, _ as VoidInput, ie as VoidList, j as VoidListItem, T as VoidMultiselect, q as VoidNavBar, w as VoidOption, V as VoidPagination, g as VoidPanel, I as VoidPopover, h as VoidProgress, x as VoidRadio, S as VoidRadioGroup, z as VoidScrollArea, Z as VoidSegmentedControl, se as VoidSegmentedControlItem, y as VoidSelect, Y as VoidSidebar, te as VoidSkeleton, G as VoidSlider, ee as VoidSpinner, Q as VoidStat, ne as VoidStatusDot, N as VoidStepper, d as VoidSwitch, D as VoidTabPanel, B as VoidTable, O as VoidTabs, m as VoidTag, v as VoidTextarea, M as VoidToast, ae as VoidToastContainer, X as VoidToggle, L as VoidTooltip };
4078
+ export { ce as VoidAccordion, le as VoidAccordionItem, $ as VoidActionInput, re as VoidAlert, f as VoidAvatar, c as VoidBadge, _e as VoidBanner, ue as VoidBreadcrumbs, l as VoidButton, B as VoidCalendar, he as VoidCard, H as VoidCarousel, Oe as VoidCarouselSlide, _ as VoidCheckbox, ye as VoidCheckboxGroup, Me as VoidCollapsible, Q as VoidColorPicker, A as VoidCombobox, P as VoidComposeInput, V as VoidDatePicker, S as VoidDialog, u as VoidDivider, T as VoidDrawer, ke as VoidDropdownMenu, Ae as VoidDropdownMenuItem, q as VoidEditable, o as VoidElement, k as VoidErrorFallback, b as VoidField, M as VoidFileUpload, be as VoidHamburger, J as VoidHoverCard, U as VoidIndicator, m as VoidInput, de as VoidList, fe as VoidListItem, W as VoidMenu, je as VoidMenuGroup, G as VoidMenuItem, x as VoidMultiselect, N as VoidNavBar, Ne as VoidNavMenu, Z as VoidNavMenuItem, K as VoidNumberInput, oe as VoidOption, O as VoidPagination, ae as VoidPanel, Y as VoidPinInput, ge as VoidPopover, p as VoidProgress, v as VoidRadio, y as VoidRadioGroup, ve as VoidScrollArea, Se as VoidSegmentedControl, xe as VoidSegmentedControlItem, g as VoidSelect, F as VoidSidebar, te as VoidSkeleton, j as VoidSlider, ee as VoidSpinner, R as VoidStat, ne as VoidStatusDot, me as VoidStepper, d as VoidSwitch, C as VoidTabPanel, D as VoidTable, se as VoidTabs, ie as VoidTag, X as VoidTagsInput, h as VoidTextarea, w as VoidToast, pe as VoidToastContainer, I as VoidToggle, L as VoidToggleGroup, E as VoidTooltip };