@solid2-aria/sonner 0.0.1 → 0.1.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.
@@ -405,6 +405,14 @@ var _tmpl$ = [
405
405
  "</button>"
406
406
  ];
407
407
  var _tmpl$2 = [
408
+ "<div",
409
+ " data-content",
410
+ "><div data-title",
411
+ ">",
412
+ "</div><!--$-->",
413
+ "<!--/--></div>"
414
+ ];
415
+ var _tmpl$3 = [
408
416
  "<button",
409
417
  "",
410
418
  "",
@@ -412,27 +420,19 @@ var _tmpl$2 = [
412
420
  ">",
413
421
  "</button>"
414
422
  ];
415
- var _tmpl$3 = [
423
+ var _tmpl$4 = [
416
424
  "<div",
417
425
  " data-icon",
418
426
  "><!--$-->",
419
427
  "<!--/--><!--$-->",
420
428
  "<!--/--></div>"
421
429
  ];
422
- var _tmpl$4 = [
430
+ var _tmpl$5 = [
423
431
  "<div",
424
432
  " data-description",
425
433
  ">",
426
434
  "</div>"
427
435
  ];
428
- var _tmpl$5 = [
429
- "<div",
430
- " data-content",
431
- "><div data-title",
432
- ">",
433
- "</div><!--$-->",
434
- "<!--/--></div>"
435
- ];
436
436
  var _tmpl$6 = [
437
437
  "<div",
438
438
  "",
@@ -533,120 +533,6 @@ function _P$(_p, _p2) {
533
533
  }
534
534
  _P$.prototype = Object.prototype;
535
535
  var _d$3 = {
536
- get() {
537
- const props = this[_m$];
538
- const hasCustomContent = this[_m$2];
539
- const toastType = this[_m$3];
540
- return memo(() => {
541
- return !!(props.closeButton && !hasCustomContent());
542
- })() ? toastType() !== "loading" : props.closeButton && !hasCustomContent();
543
- },
544
- enumerable: true,
545
- configurable: true
546
- };
547
- var _d$4 = {
548
- get() {
549
- const props = this[_m$];
550
- const classNames = this[_m$4];
551
- const toastClassNames = this[_m$5];
552
- var _v$9 = ssrHydrationKey(), _g$2 = ssrGroup(() => {
553
- return [
554
- ssrAttribute("aria-label", escape(props.closeButtonAriaLabel ?? "Close toast", true)),
555
- ssrAttribute("data-disabled", escape(String(props.disabled), true)),
556
- ((_v$12) => _v$12 == null ? "" : ssrAttribute("class", ssrClassName(_v$12)))(cn(classNames()?.closeButton, toastClassNames()?.closeButton))
557
- ];
558
- }, 3), _v$14 = scope(() => {
559
- return escape(props.icons?.close ?? CloseIcon({}));
560
- });
561
- return ssr(_tmpl$2, _v$9, _g$2, _g$2, _g$2, _v$14);
562
- },
563
- enumerable: true,
564
- configurable: true
565
- };
566
- function _P$2(_p3, _p4, _p5, _p6, _p7) {
567
- this[_m$] = _p3;
568
- this[_m$2] = _p4;
569
- this[_m$3] = _p5;
570
- this[_m$4] = _p6;
571
- this[_m$5] = _p7;
572
- Object.defineProperty(this, "when", _d$3);
573
- Object.defineProperty(this, "children", _d$4);
574
- }
575
- _P$2.prototype = Object.prototype;
576
- var _d$5 = {
577
- get() {
578
- const hasIcon = this[_m$];
579
- return hasIcon();
580
- },
581
- enumerable: true,
582
- configurable: true
583
- };
584
- var _d$6 = {
585
- get() {
586
- const classNames = this[_m$2];
587
- const toastClassNames = this[_m$3];
588
- const loadingIconContent = this[_m$4];
589
- const toastType = this[_m$5];
590
- const props = this[_m$6];
591
- var _v$15 = ssrHydrationKey(), _v$17 = () => {
592
- return ((_v$16) => _v$16 == null ? "" : ssrAttribute("class", ssrClassName(_v$16)))(cn(classNames()?.icon, toastClassNames()?.icon));
593
- }, _v$18 = scope(() => {
594
- return escape(loadingIconContent());
595
- }), _v$19 = scope((() => {
596
- var _c$ = memo(() => {
597
- return toastType() === "loading";
598
- });
599
- return () => {
600
- return _c$() ? escape(null) : escape(props.getIcon());
601
- };
602
- })());
603
- return ssr(_tmpl$3, _v$15, _v$17, _v$18, _v$19);
604
- },
605
- enumerable: true,
606
- configurable: true
607
- };
608
- function _P$3(_p8, _p9, _p0, _p1, _p10, _p11) {
609
- this[_m$] = _p8;
610
- this[_m$2] = _p9;
611
- this[_m$3] = _p0;
612
- this[_m$4] = _p1;
613
- this[_m$5] = _p10;
614
- this[_m$6] = _p11;
615
- Object.defineProperty(this, "when", _d$5);
616
- Object.defineProperty(this, "children", _d$6);
617
- }
618
- _P$3.prototype = Object.prototype;
619
- var _d$7 = {
620
- get() {
621
- return this[_m$].toast.description;
622
- },
623
- enumerable: true,
624
- configurable: true
625
- };
626
- var _d$8 = {
627
- get() {
628
- const props = this[_m$];
629
- const classNames = this[_m$2];
630
- const toastClassNames = this[_m$3];
631
- var _v$26 = ssrHydrationKey(), _v$28 = () => {
632
- return ((_v$27) => _v$27 == null ? "" : ssrAttribute("class", ssrClassName(_v$27)))(cn(props.descriptionClassName, props.toastDescriptionClassName, classNames()?.description, toastClassNames()?.description));
633
- }, _v$29 = scope(() => {
634
- return escape(resolveContent(props.toast.description));
635
- });
636
- return ssr(_tmpl$4, _v$26, _v$28, _v$29);
637
- },
638
- enumerable: true,
639
- configurable: true
640
- };
641
- function _P$4(_p12, _p13, _p14) {
642
- this[_m$] = _p12;
643
- this[_m$2] = _p13;
644
- this[_m$3] = _p14;
645
- Object.defineProperty(this, "when", _d$7);
646
- Object.defineProperty(this, "children", _d$8);
647
- }
648
- _P$4.prototype = Object.prototype;
649
- var _d$9 = {
650
536
  get() {
651
537
  const cancel = this[_m$];
652
538
  return cancel();
@@ -654,7 +540,7 @@ var _d$9 = {
654
540
  enumerable: true,
655
541
  configurable: true
656
542
  };
657
- var _d$10 = {
543
+ var _d$4 = {
658
544
  get() {
659
545
  const props = this[_m$2];
660
546
  return props.toast.cancelButtonStyle ?? props.cancelButtonStyle;
@@ -662,7 +548,7 @@ var _d$10 = {
662
548
  enumerable: true,
663
549
  configurable: true
664
550
  };
665
- var _d$11 = {
551
+ var _d$5 = {
666
552
  get() {
667
553
  const classNames = this[_m$3];
668
554
  const toastClassNames = this[_m$4];
@@ -671,19 +557,19 @@ var _d$11 = {
671
557
  enumerable: true,
672
558
  configurable: true
673
559
  };
674
- function _P$5(_p15, _p16, _p17, _p18, _p19, _p20) {
675
- this[_m$] = _p15;
676
- this[_m$2] = _p16;
677
- this[_m$3] = _p17;
678
- this[_m$4] = _p18;
679
- Object.defineProperty(this, "content", _d$9);
680
- this.kind = _p19;
681
- Object.defineProperty(this, "style", _d$10);
682
- Object.defineProperty(this, "class", _d$11);
683
- this.onClick = _p20;
560
+ function _P$2(_p3, _p4, _p5, _p6, _p7, _p8) {
561
+ this[_m$] = _p3;
562
+ this[_m$2] = _p4;
563
+ this[_m$3] = _p5;
564
+ this[_m$4] = _p6;
565
+ Object.defineProperty(this, "content", _d$3);
566
+ this.kind = _p7;
567
+ Object.defineProperty(this, "style", _d$4);
568
+ Object.defineProperty(this, "class", _d$5);
569
+ this.onClick = _p8;
684
570
  }
685
- _P$5.prototype = Object.prototype;
686
- var _d$12 = {
571
+ _P$2.prototype = Object.prototype;
572
+ var _d$6 = {
687
573
  get() {
688
574
  const cancel = this[_m$];
689
575
  return !isAction(cancel());
@@ -691,13 +577,13 @@ var _d$12 = {
691
577
  enumerable: true,
692
578
  configurable: true
693
579
  };
694
- var _d$13 = {
580
+ var _d$7 = {
695
581
  get() {
696
582
  const cancel = this[_m$];
697
583
  const props = this[_m$2];
698
584
  const classNames = this[_m$3];
699
585
  const toastClassNames = this[_m$4];
700
- return ToastActionButton(new _P$5(cancel, props, classNames, toastClassNames, "cancel", (event) => {
586
+ return ToastActionButton(new _P$2(cancel, props, classNames, toastClassNames, "cancel", (event) => {
701
587
  if (!props.dismissible) return;
702
588
  const currentCancel = cancel();
703
589
  if (!isAction(currentCancel)) return;
@@ -708,7 +594,7 @@ var _d$13 = {
708
594
  enumerable: true,
709
595
  configurable: true
710
596
  };
711
- var _d$14 = {
597
+ var _d$8 = {
712
598
  get() {
713
599
  const cancel = this[_m$];
714
600
  return getNonActionContent(cancel());
@@ -716,30 +602,30 @@ var _d$14 = {
716
602
  enumerable: true,
717
603
  configurable: true
718
604
  };
719
- function _P$6(_p21, _p22, _p23, _p24) {
720
- this[_m$] = _p21;
721
- this[_m$2] = _p22;
722
- this[_m$3] = _p23;
723
- this[_m$4] = _p24;
724
- Object.defineProperty(this, "when", _d$12);
725
- Object.defineProperty(this, "fallback", _d$13);
726
- Object.defineProperty(this, "children", _d$14);
605
+ function _P$3(_p9, _p0, _p1, _p10) {
606
+ this[_m$] = _p9;
607
+ this[_m$2] = _p0;
608
+ this[_m$3] = _p1;
609
+ this[_m$4] = _p10;
610
+ Object.defineProperty(this, "when", _d$6);
611
+ Object.defineProperty(this, "fallback", _d$7);
612
+ Object.defineProperty(this, "children", _d$8);
727
613
  }
728
- _P$6.prototype = Object.prototype;
729
- var _d$15 = {
614
+ _P$3.prototype = Object.prototype;
615
+ var _d$9 = {
730
616
  get() {
731
617
  return this[_m$].toast.cancel;
732
618
  },
733
619
  enumerable: true,
734
620
  configurable: true
735
621
  };
736
- function _P$7(_p25, _p26) {
737
- this[_m$] = _p25;
738
- Object.defineProperty(this, "when", _d$15);
739
- this.children = _p26;
622
+ function _P$4(_p11, _p12) {
623
+ this[_m$] = _p11;
624
+ Object.defineProperty(this, "when", _d$9);
625
+ this.children = _p12;
740
626
  }
741
- _P$7.prototype = Object.prototype;
742
- var _d$16 = {
627
+ _P$4.prototype = Object.prototype;
628
+ var _d$10 = {
743
629
  get() {
744
630
  const action = this[_m$];
745
631
  return action();
@@ -747,7 +633,7 @@ var _d$16 = {
747
633
  enumerable: true,
748
634
  configurable: true
749
635
  };
750
- var _d$17 = {
636
+ var _d$11 = {
751
637
  get() {
752
638
  const props = this[_m$2];
753
639
  return props.toast.actionButtonStyle ?? props.actionButtonStyle;
@@ -755,7 +641,7 @@ var _d$17 = {
755
641
  enumerable: true,
756
642
  configurable: true
757
643
  };
758
- var _d$18 = {
644
+ var _d$12 = {
759
645
  get() {
760
646
  const classNames = this[_m$3];
761
647
  const toastClassNames = this[_m$4];
@@ -764,19 +650,19 @@ var _d$18 = {
764
650
  enumerable: true,
765
651
  configurable: true
766
652
  };
767
- function _P$8(_p27, _p28, _p29, _p30, _p31, _p32) {
768
- this[_m$] = _p27;
769
- this[_m$2] = _p28;
770
- this[_m$3] = _p29;
771
- this[_m$4] = _p30;
772
- Object.defineProperty(this, "content", _d$16);
773
- this.kind = _p31;
774
- Object.defineProperty(this, "style", _d$17);
775
- Object.defineProperty(this, "class", _d$18);
776
- this.onClick = _p32;
653
+ function _P$5(_p13, _p14, _p15, _p16, _p17, _p18) {
654
+ this[_m$] = _p13;
655
+ this[_m$2] = _p14;
656
+ this[_m$3] = _p15;
657
+ this[_m$4] = _p16;
658
+ Object.defineProperty(this, "content", _d$10);
659
+ this.kind = _p17;
660
+ Object.defineProperty(this, "style", _d$11);
661
+ Object.defineProperty(this, "class", _d$12);
662
+ this.onClick = _p18;
777
663
  }
778
- _P$8.prototype = Object.prototype;
779
- var _d$19 = {
664
+ _P$5.prototype = Object.prototype;
665
+ var _d$13 = {
780
666
  get() {
781
667
  const action = this[_m$];
782
668
  return !isAction(action());
@@ -784,13 +670,13 @@ var _d$19 = {
784
670
  enumerable: true,
785
671
  configurable: true
786
672
  };
787
- var _d$20 = {
673
+ var _d$14 = {
788
674
  get() {
789
675
  const action = this[_m$];
790
676
  const props = this[_m$2];
791
677
  const classNames = this[_m$3];
792
678
  const toastClassNames = this[_m$4];
793
- return ToastActionButton(new _P$8(action, props, classNames, toastClassNames, "action", (event) => {
679
+ return ToastActionButton(new _P$5(action, props, classNames, toastClassNames, "action", (event) => {
794
680
  const currentAction = action();
795
681
  if (!isAction(currentAction)) return;
796
682
  currentAction.onClick?.(event);
@@ -801,7 +687,7 @@ var _d$20 = {
801
687
  enumerable: true,
802
688
  configurable: true
803
689
  };
804
- var _d$21 = {
690
+ var _d$15 = {
805
691
  get() {
806
692
  const action = this[_m$];
807
693
  return getNonActionContent(action());
@@ -809,30 +695,30 @@ var _d$21 = {
809
695
  enumerable: true,
810
696
  configurable: true
811
697
  };
812
- function _P$9(_p33, _p34, _p35, _p36) {
813
- this[_m$] = _p33;
814
- this[_m$2] = _p34;
815
- this[_m$3] = _p35;
816
- this[_m$4] = _p36;
817
- Object.defineProperty(this, "when", _d$19);
818
- Object.defineProperty(this, "fallback", _d$20);
819
- Object.defineProperty(this, "children", _d$21);
698
+ function _P$6(_p19, _p20, _p21, _p22) {
699
+ this[_m$] = _p19;
700
+ this[_m$2] = _p20;
701
+ this[_m$3] = _p21;
702
+ this[_m$4] = _p22;
703
+ Object.defineProperty(this, "when", _d$13);
704
+ Object.defineProperty(this, "fallback", _d$14);
705
+ Object.defineProperty(this, "children", _d$15);
820
706
  }
821
- _P$9.prototype = Object.prototype;
822
- var _d$22 = {
707
+ _P$6.prototype = Object.prototype;
708
+ var _d$16 = {
823
709
  get() {
824
710
  return this[_m$].toast.action;
825
711
  },
826
712
  enumerable: true,
827
713
  configurable: true
828
714
  };
829
- function _P$10(_p37, _p38) {
830
- this[_m$] = _p37;
831
- Object.defineProperty(this, "when", _d$22);
832
- this.children = _p38;
715
+ function _P$7(_p23, _p24) {
716
+ this[_m$] = _p23;
717
+ Object.defineProperty(this, "when", _d$16);
718
+ this.children = _p24;
833
719
  }
834
- _P$10.prototype = Object.prototype;
835
- var _d$23 = {
720
+ _P$7.prototype = Object.prototype;
721
+ var _d$17 = {
836
722
  get() {
837
723
  const classNames = this[_m$];
838
724
  const toastClassNames = this[_m$2];
@@ -841,7 +727,7 @@ var _d$23 = {
841
727
  enumerable: true,
842
728
  configurable: true
843
729
  };
844
- var _d$24 = {
730
+ var _d$18 = {
845
731
  get() {
846
732
  const toastType = this[_m$3];
847
733
  return toastType() === "loading";
@@ -849,29 +735,29 @@ var _d$24 = {
849
735
  enumerable: true,
850
736
  configurable: true
851
737
  };
852
- function _P$11(_p39, _p40, _p41) {
853
- this[_m$] = _p39;
854
- this[_m$2] = _p40;
855
- this[_m$3] = _p41;
856
- Object.defineProperty(this, "class", _d$23);
857
- Object.defineProperty(this, "visible", _d$24);
738
+ function _P$8(_p25, _p26, _p27) {
739
+ this[_m$] = _p25;
740
+ this[_m$2] = _p26;
741
+ this[_m$3] = _p27;
742
+ Object.defineProperty(this, "class", _d$17);
743
+ Object.defineProperty(this, "visible", _d$18);
858
744
  }
859
- _P$11.prototype = Object.prototype;
860
- var _d$25 = {
745
+ _P$8.prototype = Object.prototype;
746
+ var _d$19 = {
861
747
  get() {
862
748
  return this[_m$].actionButtonStyle;
863
749
  },
864
750
  enumerable: true,
865
751
  configurable: true
866
752
  };
867
- var _d$26 = {
753
+ var _d$20 = {
868
754
  get() {
869
755
  return this[_m$].cancelButtonStyle;
870
756
  },
871
757
  enumerable: true,
872
758
  configurable: true
873
759
  };
874
- var _d$27 = {
760
+ var _d$21 = {
875
761
  get() {
876
762
  const classNames = this[_m$2];
877
763
  return classNames();
@@ -879,7 +765,7 @@ var _d$27 = {
879
765
  enumerable: true,
880
766
  configurable: true
881
767
  };
882
- var _d$28 = {
768
+ var _d$22 = {
883
769
  get() {
884
770
  const closeButton = this[_m$3];
885
771
  return closeButton();
@@ -887,14 +773,14 @@ var _d$28 = {
887
773
  enumerable: true,
888
774
  configurable: true
889
775
  };
890
- var _d$29 = {
776
+ var _d$23 = {
891
777
  get() {
892
778
  return this[_m$].closeButtonAriaLabel;
893
779
  },
894
780
  enumerable: true,
895
781
  configurable: true
896
782
  };
897
- var _d$30 = {
783
+ var _d$24 = {
898
784
  get() {
899
785
  const descriptionClassName = this[_m$4];
900
786
  return descriptionClassName();
@@ -902,7 +788,7 @@ var _d$30 = {
902
788
  enumerable: true,
903
789
  configurable: true
904
790
  };
905
- var _d$31 = {
791
+ var _d$25 = {
906
792
  get() {
907
793
  const disabled = this[_m$5];
908
794
  return disabled();
@@ -910,7 +796,7 @@ var _d$31 = {
910
796
  enumerable: true,
911
797
  configurable: true
912
798
  };
913
- var _d$32 = {
799
+ var _d$26 = {
914
800
  get() {
915
801
  const dismissible = this[_m$6];
916
802
  return dismissible();
@@ -918,21 +804,21 @@ var _d$32 = {
918
804
  enumerable: true,
919
805
  configurable: true
920
806
  };
921
- var _d$33 = {
807
+ var _d$27 = {
922
808
  get() {
923
809
  return this[_m$].icons;
924
810
  },
925
811
  enumerable: true,
926
812
  configurable: true
927
813
  };
928
- var _d$34 = {
814
+ var _d$28 = {
929
815
  get() {
930
816
  return this[_m$].toast;
931
817
  },
932
818
  enumerable: true,
933
819
  configurable: true
934
820
  };
935
- var _d$35 = {
821
+ var _d$29 = {
936
822
  get() {
937
823
  const toastClassNames = this[_m$7];
938
824
  return toastClassNames();
@@ -940,7 +826,7 @@ var _d$35 = {
940
826
  enumerable: true,
941
827
  configurable: true
942
828
  };
943
- var _d$36 = {
829
+ var _d$30 = {
944
830
  get() {
945
831
  const toastDescriptionClassName = this[_m$8];
946
832
  return toastDescriptionClassName();
@@ -948,41 +834,41 @@ var _d$36 = {
948
834
  enumerable: true,
949
835
  configurable: true
950
836
  };
951
- function _P$12(_p42, _p43, _p44, _p45, _p46, _p47, _p48, _p49, _p50, _p51, _p52, _p53) {
952
- this[_m$] = _p42;
953
- this[_m$2] = _p43;
954
- this[_m$3] = _p44;
955
- this[_m$4] = _p45;
956
- this[_m$5] = _p46;
957
- this[_m$6] = _p47;
958
- this[_m$7] = _p48;
959
- this[_m$8] = _p49;
960
- Object.defineProperty(this, "actionButtonStyle", _d$25);
961
- Object.defineProperty(this, "cancelButtonStyle", _d$26);
962
- Object.defineProperty(this, "classNames", _d$27);
963
- Object.defineProperty(this, "closeButton", _d$28);
964
- Object.defineProperty(this, "closeButtonAriaLabel", _d$29);
965
- Object.defineProperty(this, "descriptionClassName", _d$30);
966
- Object.defineProperty(this, "disabled", _d$31);
967
- Object.defineProperty(this, "dismissible", _d$32);
968
- this.getIcon = _p50;
969
- this.getLoadingIcon = _p51;
970
- Object.defineProperty(this, "icons", _d$33);
971
- this.onDelete = _p52;
972
- this.onDismiss = _p53;
973
- Object.defineProperty(this, "toast", _d$34);
974
- Object.defineProperty(this, "toastClassNames", _d$35);
975
- Object.defineProperty(this, "toastDescriptionClassName", _d$36);
837
+ function _P$9(_p28, _p29, _p30, _p31, _p32, _p33, _p34, _p35, _p36, _p37, _p38, _p39) {
838
+ this[_m$] = _p28;
839
+ this[_m$2] = _p29;
840
+ this[_m$3] = _p30;
841
+ this[_m$4] = _p31;
842
+ this[_m$5] = _p32;
843
+ this[_m$6] = _p33;
844
+ this[_m$7] = _p34;
845
+ this[_m$8] = _p35;
846
+ Object.defineProperty(this, "actionButtonStyle", _d$19);
847
+ Object.defineProperty(this, "cancelButtonStyle", _d$20);
848
+ Object.defineProperty(this, "classNames", _d$21);
849
+ Object.defineProperty(this, "closeButton", _d$22);
850
+ Object.defineProperty(this, "closeButtonAriaLabel", _d$23);
851
+ Object.defineProperty(this, "descriptionClassName", _d$24);
852
+ Object.defineProperty(this, "disabled", _d$25);
853
+ Object.defineProperty(this, "dismissible", _d$26);
854
+ this.getIcon = _p36;
855
+ this.getLoadingIcon = _p37;
856
+ Object.defineProperty(this, "icons", _d$27);
857
+ this.onDelete = _p38;
858
+ this.onDismiss = _p39;
859
+ Object.defineProperty(this, "toast", _d$28);
860
+ Object.defineProperty(this, "toastClassNames", _d$29);
861
+ Object.defineProperty(this, "toastDescriptionClassName", _d$30);
976
862
  }
977
- _P$12.prototype = Object.prototype;
978
- var _d$37 = {
863
+ _P$9.prototype = Object.prototype;
864
+ var _d$31 = {
979
865
  get() {
980
866
  return this[_m$].icons;
981
867
  },
982
868
  enumerable: true,
983
869
  configurable: true
984
870
  };
985
- var _d$38 = {
871
+ var _d$32 = {
986
872
  get() {
987
873
  const toastIndex = this[_m$2];
988
874
  return toastIndex();
@@ -990,14 +876,14 @@ var _d$38 = {
990
876
  enumerable: true,
991
877
  configurable: true
992
878
  };
993
- var _d$39 = {
879
+ var _d$33 = {
994
880
  get() {
995
881
  return this[_m$].richColors;
996
882
  },
997
883
  enumerable: true,
998
884
  configurable: true
999
885
  };
1000
- var _d$40 = {
886
+ var _d$34 = {
1001
887
  get() {
1002
888
  const toastOptions = this[_m$3];
1003
889
  const propsWithDefaults = this[_m$];
@@ -1006,7 +892,7 @@ var _d$40 = {
1006
892
  enumerable: true,
1007
893
  configurable: true
1008
894
  };
1009
- var _d$41 = {
895
+ var _d$35 = {
1010
896
  get() {
1011
897
  const toastClassName = this[_m$4];
1012
898
  return toastClassName();
@@ -1014,7 +900,7 @@ var _d$41 = {
1014
900
  enumerable: true,
1015
901
  configurable: true
1016
902
  };
1017
- var _d$42 = {
903
+ var _d$36 = {
1018
904
  get() {
1019
905
  const toastDescriptionClassName = this[_m$5];
1020
906
  return toastDescriptionClassName();
@@ -1022,7 +908,7 @@ var _d$42 = {
1022
908
  enumerable: true,
1023
909
  configurable: true
1024
910
  };
1025
- var _d$43 = {
911
+ var _d$37 = {
1026
912
  get() {
1027
913
  const propsWithDefaults = this[_m$];
1028
914
  return Boolean(propsWithDefaults.invert);
@@ -1030,14 +916,14 @@ var _d$43 = {
1030
916
  enumerable: true,
1031
917
  configurable: true
1032
918
  };
1033
- var _d$44 = {
919
+ var _d$38 = {
1034
920
  get() {
1035
921
  return this[_m$].visibleToasts;
1036
922
  },
1037
923
  enumerable: true,
1038
924
  configurable: true
1039
925
  };
1040
- var _d$45 = {
926
+ var _d$39 = {
1041
927
  get() {
1042
928
  const toastOptions = this[_m$3];
1043
929
  const propsWithDefaults = this[_m$];
@@ -1046,7 +932,7 @@ var _d$45 = {
1046
932
  enumerable: true,
1047
933
  configurable: true
1048
934
  };
1049
- var _d$46 = {
935
+ var _d$40 = {
1050
936
  get() {
1051
937
  const interacting = this[_m$6];
1052
938
  return interacting();
@@ -1054,7 +940,7 @@ var _d$46 = {
1054
940
  enumerable: true,
1055
941
  configurable: true
1056
942
  };
1057
- var _d$47 = {
943
+ var _d$41 = {
1058
944
  get() {
1059
945
  const toastOptions = this[_m$3];
1060
946
  return toastOptions()?.style;
@@ -1062,7 +948,7 @@ var _d$47 = {
1062
948
  enumerable: true,
1063
949
  configurable: true
1064
950
  };
1065
- var _d$48 = {
951
+ var _d$42 = {
1066
952
  get() {
1067
953
  const toastOptions = this[_m$3];
1068
954
  return toastOptions()?.unstyled;
@@ -1070,7 +956,7 @@ var _d$48 = {
1070
956
  enumerable: true,
1071
957
  configurable: true
1072
958
  };
1073
- var _d$49 = {
959
+ var _d$43 = {
1074
960
  get() {
1075
961
  const toastClassNames = this[_m$7];
1076
962
  return toastClassNames();
@@ -1078,7 +964,7 @@ var _d$49 = {
1078
964
  enumerable: true,
1079
965
  configurable: true
1080
966
  };
1081
- var _d$50 = {
967
+ var _d$44 = {
1082
968
  get() {
1083
969
  const toastOptions = this[_m$3];
1084
970
  return toastOptions()?.cancelButtonStyle;
@@ -1086,7 +972,7 @@ var _d$50 = {
1086
972
  enumerable: true,
1087
973
  configurable: true
1088
974
  };
1089
- var _d$51 = {
975
+ var _d$45 = {
1090
976
  get() {
1091
977
  const toastOptions = this[_m$3];
1092
978
  return toastOptions()?.actionButtonStyle;
@@ -1094,7 +980,7 @@ var _d$51 = {
1094
980
  enumerable: true,
1095
981
  configurable: true
1096
982
  };
1097
- var _d$52 = {
983
+ var _d$46 = {
1098
984
  get() {
1099
985
  const toastOptions = this[_m$3];
1100
986
  return toastOptions()?.closeButtonAriaLabel;
@@ -1102,7 +988,7 @@ var _d$52 = {
1102
988
  enumerable: true,
1103
989
  configurable: true
1104
990
  };
1105
- var _d$53 = {
991
+ var _d$47 = {
1106
992
  get() {
1107
993
  const toastsByPosition = this[_m$8];
1108
994
  return toastsByPosition();
@@ -1110,7 +996,7 @@ var _d$53 = {
1110
996
  enumerable: true,
1111
997
  configurable: true
1112
998
  };
1113
- var _d$54 = {
999
+ var _d$48 = {
1114
1000
  get() {
1115
1001
  const heightsByPosition = this[_m$9];
1116
1002
  return heightsByPosition();
@@ -1118,7 +1004,7 @@ var _d$54 = {
1118
1004
  enumerable: true,
1119
1005
  configurable: true
1120
1006
  };
1121
- var _d$55 = {
1007
+ var _d$49 = {
1122
1008
  get() {
1123
1009
  const propsWithDefaults = this[_m$];
1124
1010
  return Boolean(propsWithDefaults.expand);
@@ -1126,14 +1012,14 @@ var _d$55 = {
1126
1012
  enumerable: true,
1127
1013
  configurable: true
1128
1014
  };
1129
- var _d$56 = {
1015
+ var _d$50 = {
1130
1016
  get() {
1131
1017
  return this[_m$].gap;
1132
1018
  },
1133
1019
  enumerable: true,
1134
1020
  configurable: true
1135
1021
  };
1136
- var _d$57 = {
1022
+ var _d$51 = {
1137
1023
  get() {
1138
1024
  const expanded = this[_m$10];
1139
1025
  return expanded();
@@ -1141,61 +1027,61 @@ var _d$57 = {
1141
1027
  enumerable: true,
1142
1028
  configurable: true
1143
1029
  };
1144
- var _d$58 = {
1030
+ var _d$52 = {
1145
1031
  get() {
1146
1032
  return this[_m$].swipeDirections;
1147
1033
  },
1148
1034
  enumerable: true,
1149
1035
  configurable: true
1150
1036
  };
1151
- var _d$59 = {
1037
+ var _d$53 = {
1152
1038
  get() {
1153
1039
  return this[_m$].pauseWhenPageIsHidden;
1154
1040
  },
1155
1041
  enumerable: true,
1156
1042
  configurable: true
1157
1043
  };
1158
- function _P$13(_p54, _p55, _p56, _p57, _p58, _p59, _p60, _p61, _p62, _p63, _p64, _p65, _p66, _p67) {
1159
- this[_m$] = _p54;
1160
- this[_m$2] = _p55;
1161
- this[_m$3] = _p56;
1162
- this[_m$4] = _p57;
1163
- this[_m$5] = _p58;
1164
- this[_m$6] = _p59;
1165
- this[_m$7] = _p60;
1166
- this[_m$8] = _p61;
1167
- this[_m$9] = _p62;
1168
- this[_m$10] = _p63;
1169
- Object.defineProperty(this, "icons", _d$37);
1170
- Object.defineProperty(this, "index", _d$38);
1171
- this.toast = _p64;
1172
- Object.defineProperty(this, "defaultRichColors", _d$39);
1173
- Object.defineProperty(this, "duration", _d$40);
1174
- Object.defineProperty(this, "class", _d$41);
1175
- Object.defineProperty(this, "descriptionClassName", _d$42);
1176
- Object.defineProperty(this, "invert", _d$43);
1177
- Object.defineProperty(this, "visibleToasts", _d$44);
1178
- Object.defineProperty(this, "closeButton", _d$45);
1179
- Object.defineProperty(this, "interacting", _d$46);
1180
- this.position = _p65;
1181
- Object.defineProperty(this, "style", _d$47);
1182
- Object.defineProperty(this, "unstyled", _d$48);
1183
- Object.defineProperty(this, "classNames", _d$49);
1184
- Object.defineProperty(this, "cancelButtonStyle", _d$50);
1185
- Object.defineProperty(this, "actionButtonStyle", _d$51);
1186
- Object.defineProperty(this, "closeButtonAriaLabel", _d$52);
1187
- this.removeToast = _p66;
1188
- Object.defineProperty(this, "toasts", _d$53);
1189
- Object.defineProperty(this, "heights", _d$54);
1190
- this.setHeights = _p67;
1191
- Object.defineProperty(this, "expandByDefault", _d$55);
1192
- Object.defineProperty(this, "gap", _d$56);
1193
- Object.defineProperty(this, "expanded", _d$57);
1194
- Object.defineProperty(this, "swipeDirections", _d$58);
1195
- Object.defineProperty(this, "pauseWhenPageIsHidden", _d$59);
1044
+ function _P$10(_p40, _p41, _p42, _p43, _p44, _p45, _p46, _p47, _p48, _p49, _p50, _p51, _p52, _p53) {
1045
+ this[_m$] = _p40;
1046
+ this[_m$2] = _p41;
1047
+ this[_m$3] = _p42;
1048
+ this[_m$4] = _p43;
1049
+ this[_m$5] = _p44;
1050
+ this[_m$6] = _p45;
1051
+ this[_m$7] = _p46;
1052
+ this[_m$8] = _p47;
1053
+ this[_m$9] = _p48;
1054
+ this[_m$10] = _p49;
1055
+ Object.defineProperty(this, "icons", _d$31);
1056
+ Object.defineProperty(this, "index", _d$32);
1057
+ this.toast = _p50;
1058
+ Object.defineProperty(this, "defaultRichColors", _d$33);
1059
+ Object.defineProperty(this, "duration", _d$34);
1060
+ Object.defineProperty(this, "class", _d$35);
1061
+ Object.defineProperty(this, "descriptionClassName", _d$36);
1062
+ Object.defineProperty(this, "invert", _d$37);
1063
+ Object.defineProperty(this, "visibleToasts", _d$38);
1064
+ Object.defineProperty(this, "closeButton", _d$39);
1065
+ Object.defineProperty(this, "interacting", _d$40);
1066
+ this.position = _p51;
1067
+ Object.defineProperty(this, "style", _d$41);
1068
+ Object.defineProperty(this, "unstyled", _d$42);
1069
+ Object.defineProperty(this, "classNames", _d$43);
1070
+ Object.defineProperty(this, "cancelButtonStyle", _d$44);
1071
+ Object.defineProperty(this, "actionButtonStyle", _d$45);
1072
+ Object.defineProperty(this, "closeButtonAriaLabel", _d$46);
1073
+ this.removeToast = _p52;
1074
+ Object.defineProperty(this, "toasts", _d$47);
1075
+ Object.defineProperty(this, "heights", _d$48);
1076
+ this.setHeights = _p53;
1077
+ Object.defineProperty(this, "expandByDefault", _d$49);
1078
+ Object.defineProperty(this, "gap", _d$50);
1079
+ Object.defineProperty(this, "expanded", _d$51);
1080
+ Object.defineProperty(this, "swipeDirections", _d$52);
1081
+ Object.defineProperty(this, "pauseWhenPageIsHidden", _d$53);
1196
1082
  }
1197
- _P$13.prototype = Object.prototype;
1198
- var _d$60 = {
1083
+ _P$10.prototype = Object.prototype;
1084
+ var _d$54 = {
1199
1085
  get() {
1200
1086
  const toastsByPosition = this[_m$];
1201
1087
  return toastsByPosition();
@@ -1203,13 +1089,13 @@ var _d$60 = {
1203
1089
  enumerable: true,
1204
1090
  configurable: true
1205
1091
  };
1206
- function _P$14(_p68, _p69) {
1207
- this[_m$] = _p68;
1208
- Object.defineProperty(this, "each", _d$60);
1209
- this.children = _p69;
1092
+ function _P$11(_p54, _p55) {
1093
+ this[_m$] = _p54;
1094
+ Object.defineProperty(this, "each", _d$54);
1095
+ this.children = _p55;
1210
1096
  }
1211
- _P$14.prototype = Object.prototype;
1212
- var _d$61 = {
1097
+ _P$11.prototype = Object.prototype;
1098
+ var _d$55 = {
1213
1099
  get() {
1214
1100
  const possiblePositions = this[_m$];
1215
1101
  return possiblePositions();
@@ -1217,12 +1103,12 @@ var _d$61 = {
1217
1103
  enumerable: true,
1218
1104
  configurable: true
1219
1105
  };
1220
- function _P$15(_p70, _p71) {
1221
- this[_m$] = _p70;
1222
- Object.defineProperty(this, "each", _d$61);
1223
- this.children = _p71;
1106
+ function _P$12(_p56, _p57) {
1107
+ this[_m$] = _p56;
1108
+ Object.defineProperty(this, "each", _d$55);
1109
+ this.children = _p57;
1224
1110
  }
1225
- _P$15.prototype = Object.prototype;
1111
+ _P$12.prototype = Object.prototype;
1226
1112
  const VISIBLE_TOASTS_AMOUNT = 3;
1227
1113
  const VIEWPORT_OFFSET = "24px";
1228
1114
  const MOBILE_VIEWPORT_OFFSET = "16px";
@@ -1345,7 +1231,7 @@ function createToastTheme(theme) {
1345
1231
  return typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1346
1232
  }
1347
1233
  function ToastBody(props) {
1348
- var _v$20, _g$3, _v$25, _v$30;
1234
+ var _v$9, _g$2, _v$14, _v$15;
1349
1235
  const classNames = () => props.classNames;
1350
1236
  const toastClassNames = () => props.toastClassNames;
1351
1237
  const toastType = () => props.toast.type;
@@ -1361,15 +1247,56 @@ function ToastBody(props) {
1361
1247
  return null;
1362
1248
  };
1363
1249
  return [
1364
- Show(new _P$2(props, hasCustomContent, toastType, classNames, toastClassNames)),
1365
- Show(new _P$3(hasIcon, classNames, toastClassNames, loadingIconContent, toastType, props)),
1366
- (_v$20 = ssrHydrationKey(), _g$3 = ssrGroup(() => {
1367
- return [((_v$21) => _v$21 == null ? "" : ssrAttribute("class", ssrClassName(_v$21)))(cn(classNames()?.content, toastClassNames()?.content)), ((_v$23) => _v$23 == null ? "" : ssrAttribute("class", ssrClassName(_v$23)))(cn(classNames()?.title, toastClassNames()?.title))];
1368
- }, 2), _v$25 = scope(() => {
1250
+ memo(() => {
1251
+ var _v$16, _g$3, _v$21;
1252
+ return memo(() => {
1253
+ return !!(props.closeButton && !hasCustomContent() && toastType() !== "loading");
1254
+ })() ? (_v$16 = ssrHydrationKey(), _g$3 = ssrGroup(() => {
1255
+ return [
1256
+ ssrAttribute("aria-label", escape(props.closeButtonAriaLabel ?? "Close toast", true)),
1257
+ ssrAttribute("data-disabled", escape(String(props.disabled), true)),
1258
+ ((_v$19) => _v$19 == null ? "" : ssrAttribute("class", ssrClassName(_v$19)))(cn(classNames()?.closeButton, toastClassNames()?.closeButton))
1259
+ ];
1260
+ }, 3), _v$21 = scope(() => {
1261
+ return escape(props.icons?.close ?? CloseIcon({}));
1262
+ }), ssr(_tmpl$3, _v$16, _g$3, _g$3, _g$3, _v$21)) : void 0;
1263
+ }),
1264
+ memo(() => {
1265
+ var _v$22, _v$24, _v$25, _v$26;
1266
+ return memo(() => {
1267
+ return !!hasIcon();
1268
+ })() ? (_v$22 = ssrHydrationKey(), _v$24 = () => {
1269
+ return ((_v$23) => _v$23 == null ? "" : ssrAttribute("class", ssrClassName(_v$23)))(cn(classNames()?.icon, toastClassNames()?.icon));
1270
+ }, _v$25 = scope(() => {
1271
+ return escape(loadingIconContent());
1272
+ }), _v$26 = scope((() => {
1273
+ var _c$2 = memo(() => {
1274
+ return toastType() === "loading";
1275
+ });
1276
+ return () => {
1277
+ return _c$2() ? escape(null) : escape(props.getIcon());
1278
+ };
1279
+ })()), ssr(_tmpl$4, _v$22, _v$24, _v$25, _v$26)) : void 0;
1280
+ }),
1281
+ (_v$9 = ssrHydrationKey(), _g$2 = ssrGroup(() => {
1282
+ return [((_v$10) => _v$10 == null ? "" : ssrAttribute("class", ssrClassName(_v$10)))(cn(classNames()?.content, toastClassNames()?.content)), ((_v$12) => _v$12 == null ? "" : ssrAttribute("class", ssrClassName(_v$12)))(cn(classNames()?.title, toastClassNames()?.title))];
1283
+ }, 2), _v$14 = scope(() => {
1369
1284
  return escape(props.toast.jsx ?? resolveContent(props.toast.title));
1370
- }), _v$30 = escape(Show(new _P$4(props, classNames, toastClassNames))), ssr(_tmpl$5, _v$20, _g$3, _g$3, _v$25, _v$30)),
1371
- Show(new _P$7(props, (cancel) => Show(new _P$6(cancel, props, classNames, toastClassNames)))),
1372
- Show(new _P$10(props, (action) => Show(new _P$9(action, props, classNames, toastClassNames))))
1285
+ }), _v$15 = scope((() => {
1286
+ var _c$ = memo(() => {
1287
+ return !!props.toast.description;
1288
+ });
1289
+ return () => {
1290
+ var _v$27, _v$29, _v$30;
1291
+ return _c$() ? (_v$27 = ssrHydrationKey(), _v$29 = () => {
1292
+ return ((_v$28) => _v$28 == null ? "" : ssrAttribute("class", ssrClassName(_v$28)))(cn(props.descriptionClassName, props.toastDescriptionClassName, classNames()?.description, toastClassNames()?.description));
1293
+ }, _v$30 = scope(() => {
1294
+ return escape(resolveContent(props.toast.description));
1295
+ }), ssr(_tmpl$5, _v$27, _v$29, _v$30)) : void 0;
1296
+ };
1297
+ })()), ssr(_tmpl$2, _v$9, _g$2, _g$2, _v$14, _v$15)),
1298
+ Show(new _P$4(props, (cancel) => Show(new _P$3(cancel, props, classNames, toastClassNames)))),
1299
+ Show(new _P$7(props, (action) => Show(new _P$6(action, props, classNames, toastClassNames))))
1373
1300
  ];
1374
1301
  }
1375
1302
  function setupToastEffects({ props, mounted, getToastElement, isRemoving, isDocumentHidden, duration, removed, deleteToast, setInitialHeight }) {
@@ -1501,7 +1428,7 @@ function Toast(props) {
1501
1428
  });
1502
1429
  return ssr(_tmpl$6, _v$31, _g$4, _g$4, _v$35);
1503
1430
  }
1504
- return Loader(new _P$11(classNames, toastClassNames, toastType));
1431
+ return Loader(new _P$8(classNames, toastClassNames, toastType));
1505
1432
  }
1506
1433
  const icon = () => {
1507
1434
  const type = toastType();
@@ -1553,7 +1480,7 @@ function Toast(props) {
1553
1480
  ...props.toast.style
1554
1481
  })
1555
1482
  ];
1556
- }, 21), _v$59 = escape(ToastBody(new _P$12(props, classNames, closeButton, descriptionClassName, disabled, dismissible, toastClassNames, toastDescriptionClassName, icon, getLoadingIcon, deleteToast, () => props.toast.onDismiss?.(props.toast))));
1483
+ }, 21), _v$59 = escape(ToastBody(new _P$9(props, classNames, closeButton, descriptionClassName, disabled, dismissible, toastClassNames, toastDescriptionClassName, icon, getLoadingIcon, deleteToast, () => props.toast.onDismiss?.(props.toast))));
1557
1484
  return ssr(_tmpl$7, _v$36, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _g$5, _v$59);
1558
1485
  }
1559
1486
  function Toaster(props) {
@@ -1647,32 +1574,29 @@ function Toaster(props) {
1647
1574
  });
1648
1575
  var _v$60 = ssrHydrationKey(), _v$61 = () => {
1649
1576
  return ssrAttribute("aria-label", escape(propsWithDefaults.customAriaLabel ?? `${propsWithDefaults.containerAriaLabel} ${hotkeyLabel()}`, true));
1650
- }, _v$62 = escape(For(new _P$15(possiblePositions, (position, index) => {
1651
- var _v$63, _g$6, _v$68, _v$69;
1577
+ }, _v$62 = escape(For(new _P$12(possiblePositions, (position, index) => {
1652
1578
  const [y, x] = position.split("-");
1653
1579
  const toastsByPosition = createMemo(() => filteredToasts().filter((toast) => !toast.position && index() === 0 || toast.position === position));
1654
1580
  const heightsByPosition = createMemo(() => heights().filter((height) => index() === 0 && !height.position || height.position === position));
1655
- return Show({
1656
- get when() {
1581
+ return memo(() => {
1582
+ var _v$63, _g$6, _v$68, _v$69;
1583
+ return memo(() => {
1657
1584
  return filteredToasts().length > 0;
1658
- },
1659
- get children() {
1660
- return _v$63 = ssrHydrationKey(), _g$6 = ssrGroup(() => {
1661
- return [
1662
- ssrAttribute("dir", propsWithDefaults.dir === "auto" ? escape(getDocumentDirection(), true) : escape(propsWithDefaults.dir, true)),
1663
- ((_v$65) => _v$65 == null ? "" : ssrAttribute("class", ssrClassName(_v$65)))(className()),
1664
- ssrAttribute("data-sonner-theme", escape(actualTheme(), true))
1665
- ];
1666
- }, 3), _v$68 = () => {
1667
- return ssrStyle({
1668
- "--front-toast-height": `${heightsByPosition()[0]?.height ?? 0}px`,
1669
- "--gap": `${propsWithDefaults.gap}px`,
1670
- "--width": "356px",
1671
- ...propsWithDefaults.style,
1672
- ...assignOffset(propsWithDefaults.offset, propsWithDefaults.mobileOffset)
1673
- });
1674
- }, _v$69 = escape(For(new _P$14(toastsByPosition, (toastItem, toastIndex) => Toast(new _P$13(propsWithDefaults, toastIndex, toastOptions, toastClassName, toastDescriptionClassName, interacting, toastClassNames, toastsByPosition, heightsByPosition, expanded, toastItem, position, removeToast, setHeights))))), ssr(_tmpl$9, _v$63, _g$6, _g$6, _g$6, ssrAttribute("data-y-position", escape(y, true)), ssrAttribute("data-x-position", escape(x, true)), _v$68, _v$69);
1675
- }
1585
+ })() ? (_v$63 = ssrHydrationKey(), _g$6 = ssrGroup(() => {
1586
+ return [
1587
+ ssrAttribute("dir", propsWithDefaults.dir === "auto" ? escape(getDocumentDirection(), true) : escape(propsWithDefaults.dir, true)),
1588
+ ((_v$65) => _v$65 == null ? "" : ssrAttribute("class", ssrClassName(_v$65)))(className()),
1589
+ ssrAttribute("data-sonner-theme", escape(actualTheme(), true))
1590
+ ];
1591
+ }, 3), _v$68 = () => {
1592
+ return ssrStyle({
1593
+ "--front-toast-height": `${heightsByPosition()[0]?.height ?? 0}px`,
1594
+ "--gap": `${propsWithDefaults.gap}px`,
1595
+ "--width": "356px",
1596
+ ...propsWithDefaults.style,
1597
+ ...assignOffset(propsWithDefaults.offset, propsWithDefaults.mobileOffset)
1598
+ });
1599
+ }, _v$69 = escape(For(new _P$11(toastsByPosition, (toastItem, toastIndex) => Toast(new _P$10(propsWithDefaults, toastIndex, toastOptions, toastClassName, toastDescriptionClassName, interacting, toastClassNames, toastsByPosition, heightsByPosition, expanded, toastItem, position, removeToast, setHeights))))), ssr(_tmpl$9, _v$63, _g$6, _g$6, _g$6, ssrAttribute("data-y-position", escape(y, true)), ssrAttribute("data-x-position", escape(x, true)), _v$68, _v$69)) : void 0;
1676
1600
  });
1677
1601
  })));
1678
1602
  return ssr(_tmpl$8, _v$60, _v$61, _v$62);