@hotelinking/ui 1.2.5 → 1.6.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.
- package/README.md +7 -5
- package/dist/index.css +381 -2
- package/dist/ui.cjs.js +4 -1
- package/dist/ui.es.js +1162 -5
- package/package.json +27 -4
- package/dist/ui.cjs2.js +0 -1
- package/dist/ui.cjs3.js +0 -1
- package/dist/ui.cjs4.js +0 -1
- package/dist/ui.es2.js +0 -9
- package/dist/ui.es3.js +0 -41
- package/dist/ui.es4.js +0 -20
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
cambios:
|
|
2
|
+
- los iconos ahora aceptan directamente el icono, no un texto del icono
|
|
3
|
+
- Afecta a:
|
|
4
|
+
Botones
|
|
5
|
+
Iconos
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
- Dropdown ahora tiene un label en vez de un slot
|
|
8
|
+
- Input el evento ha cambiado a camelCase, los iconos se tienen que importar como componentes
|
|
4
9
|
|
|
5
|
-
## Recommended IDE Setup
|
|
6
|
-
|
|
7
|
-
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
package/dist/index.css
CHANGED
|
@@ -648,6 +648,75 @@ select{
|
|
|
648
648
|
--tw-backdrop-saturate: ;
|
|
649
649
|
--tw-backdrop-sepia: ;
|
|
650
650
|
}
|
|
651
|
+
.sr-only{
|
|
652
|
+
position: absolute;
|
|
653
|
+
width: 1px;
|
|
654
|
+
height: 1px;
|
|
655
|
+
padding: 0;
|
|
656
|
+
margin: -1px;
|
|
657
|
+
overflow: hidden;
|
|
658
|
+
clip: rect(0, 0, 0, 0);
|
|
659
|
+
white-space: nowrap;
|
|
660
|
+
border-width: 0;
|
|
661
|
+
}
|
|
662
|
+
.pointer-events-none{
|
|
663
|
+
pointer-events: none;
|
|
664
|
+
}
|
|
665
|
+
.absolute{
|
|
666
|
+
position: absolute;
|
|
667
|
+
}
|
|
668
|
+
.relative{
|
|
669
|
+
position: relative;
|
|
670
|
+
}
|
|
671
|
+
.inset-y-0{
|
|
672
|
+
top: 0px;
|
|
673
|
+
bottom: 0px;
|
|
674
|
+
}
|
|
675
|
+
.left-0{
|
|
676
|
+
left: 0px;
|
|
677
|
+
}
|
|
678
|
+
.right-0{
|
|
679
|
+
right: 0px;
|
|
680
|
+
}
|
|
681
|
+
.z-10{
|
|
682
|
+
z-index: 10;
|
|
683
|
+
}
|
|
684
|
+
.-ml-0{
|
|
685
|
+
margin-left: -0px;
|
|
686
|
+
}
|
|
687
|
+
.-ml-0\.5{
|
|
688
|
+
margin-left: -0.125rem;
|
|
689
|
+
}
|
|
690
|
+
.-mr-1{
|
|
691
|
+
margin-right: -0.25rem;
|
|
692
|
+
}
|
|
693
|
+
.mb-4{
|
|
694
|
+
margin-bottom: 1rem;
|
|
695
|
+
}
|
|
696
|
+
.ml-2{
|
|
697
|
+
margin-left: 0.5rem;
|
|
698
|
+
}
|
|
699
|
+
.ml-3{
|
|
700
|
+
margin-left: 0.75rem;
|
|
701
|
+
}
|
|
702
|
+
.mr-2{
|
|
703
|
+
margin-right: 0.5rem;
|
|
704
|
+
}
|
|
705
|
+
.mt-1{
|
|
706
|
+
margin-top: 0.25rem;
|
|
707
|
+
}
|
|
708
|
+
.mt-2{
|
|
709
|
+
margin-top: 0.5rem;
|
|
710
|
+
}
|
|
711
|
+
.block{
|
|
712
|
+
display: block;
|
|
713
|
+
}
|
|
714
|
+
.inline-block{
|
|
715
|
+
display: inline-block;
|
|
716
|
+
}
|
|
717
|
+
.flex{
|
|
718
|
+
display: flex;
|
|
719
|
+
}
|
|
651
720
|
.inline-flex{
|
|
652
721
|
display: inline-flex;
|
|
653
722
|
}
|
|
@@ -660,6 +729,9 @@ select{
|
|
|
660
729
|
.h-4{
|
|
661
730
|
height: 1rem;
|
|
662
731
|
}
|
|
732
|
+
.h-5{
|
|
733
|
+
height: 1.25rem;
|
|
734
|
+
}
|
|
663
735
|
.h-6{
|
|
664
736
|
height: 1.5rem;
|
|
665
737
|
}
|
|
@@ -672,28 +744,136 @@ select{
|
|
|
672
744
|
.w-4{
|
|
673
745
|
width: 1rem;
|
|
674
746
|
}
|
|
747
|
+
.w-5{
|
|
748
|
+
width: 1.25rem;
|
|
749
|
+
}
|
|
750
|
+
.w-56{
|
|
751
|
+
width: 14rem;
|
|
752
|
+
}
|
|
675
753
|
.w-6{
|
|
676
754
|
width: 1.5rem;
|
|
677
755
|
}
|
|
756
|
+
.w-full{
|
|
757
|
+
width: 100%;
|
|
758
|
+
}
|
|
759
|
+
.origin-top-right{
|
|
760
|
+
transform-origin: top right;
|
|
761
|
+
}
|
|
762
|
+
.scale-100{
|
|
763
|
+
--tw-scale-x: 1;
|
|
764
|
+
--tw-scale-y: 1;
|
|
765
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
766
|
+
}
|
|
767
|
+
.scale-95{
|
|
768
|
+
--tw-scale-x: .95;
|
|
769
|
+
--tw-scale-y: .95;
|
|
770
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
771
|
+
}
|
|
772
|
+
.transform{
|
|
773
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
774
|
+
}
|
|
775
|
+
.cursor-pointer{
|
|
776
|
+
cursor: pointer;
|
|
777
|
+
}
|
|
778
|
+
.flex-row{
|
|
779
|
+
flex-direction: row;
|
|
780
|
+
}
|
|
781
|
+
.flex-col{
|
|
782
|
+
flex-direction: column;
|
|
783
|
+
}
|
|
784
|
+
.items-start{
|
|
785
|
+
align-items: flex-start;
|
|
786
|
+
}
|
|
678
787
|
.items-center{
|
|
679
788
|
align-items: center;
|
|
680
789
|
}
|
|
790
|
+
.justify-center{
|
|
791
|
+
justify-content: center;
|
|
792
|
+
}
|
|
793
|
+
.justify-between{
|
|
794
|
+
justify-content: space-between;
|
|
795
|
+
}
|
|
796
|
+
.space-y-1 > :not([hidden]) ~ :not([hidden]){
|
|
797
|
+
--tw-space-y-reverse: 0;
|
|
798
|
+
margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
|
|
799
|
+
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
800
|
+
}
|
|
801
|
+
.justify-self-end{
|
|
802
|
+
justify-self: end;
|
|
803
|
+
}
|
|
681
804
|
.rounded{
|
|
682
805
|
border-radius: 0.25rem;
|
|
683
806
|
}
|
|
684
807
|
.rounded-md{
|
|
685
808
|
border-radius: 0.375rem;
|
|
686
809
|
}
|
|
810
|
+
.rounded-l-md{
|
|
811
|
+
border-top-left-radius: 0.375rem;
|
|
812
|
+
border-bottom-left-radius: 0.375rem;
|
|
813
|
+
}
|
|
814
|
+
.rounded-r-md{
|
|
815
|
+
border-top-right-radius: 0.375rem;
|
|
816
|
+
border-bottom-right-radius: 0.375rem;
|
|
817
|
+
}
|
|
687
818
|
.border{
|
|
688
819
|
border-width: 1px;
|
|
689
820
|
}
|
|
821
|
+
.border-2{
|
|
822
|
+
border-width: 2px;
|
|
823
|
+
}
|
|
824
|
+
.border-r-0{
|
|
825
|
+
border-right-width: 0px;
|
|
826
|
+
}
|
|
827
|
+
.border-dashed{
|
|
828
|
+
border-style: dashed;
|
|
829
|
+
}
|
|
830
|
+
.border-gray-300{
|
|
831
|
+
--tw-border-opacity: 1;
|
|
832
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
|
833
|
+
}
|
|
834
|
+
.border-gray-400{
|
|
835
|
+
--tw-border-opacity: 1;
|
|
836
|
+
border-color: rgb(156 163 175 / var(--tw-border-opacity));
|
|
837
|
+
}
|
|
838
|
+
.border-green-400{
|
|
839
|
+
--tw-border-opacity: 1;
|
|
840
|
+
border-color: rgb(74 222 128 / var(--tw-border-opacity));
|
|
841
|
+
}
|
|
842
|
+
.border-red-300{
|
|
843
|
+
--tw-border-opacity: 1;
|
|
844
|
+
border-color: rgb(252 165 165 / var(--tw-border-opacity));
|
|
845
|
+
}
|
|
846
|
+
.border-red-400{
|
|
847
|
+
--tw-border-opacity: 1;
|
|
848
|
+
border-color: rgb(248 113 113 / var(--tw-border-opacity));
|
|
849
|
+
}
|
|
690
850
|
.border-transparent{
|
|
691
851
|
border-color: transparent;
|
|
692
852
|
}
|
|
853
|
+
.border-yellow-400{
|
|
854
|
+
--tw-border-opacity: 1;
|
|
855
|
+
border-color: rgb(250 204 21 / var(--tw-border-opacity));
|
|
856
|
+
}
|
|
693
857
|
.bg-cyan-300{
|
|
694
858
|
--tw-bg-opacity: 1;
|
|
695
859
|
background-color: rgb(103 232 249 / var(--tw-bg-opacity));
|
|
696
860
|
}
|
|
861
|
+
.bg-cyan-500{
|
|
862
|
+
--tw-bg-opacity: 1;
|
|
863
|
+
background-color: rgb(6 182 212 / var(--tw-bg-opacity));
|
|
864
|
+
}
|
|
865
|
+
.bg-gray-100{
|
|
866
|
+
--tw-bg-opacity: 1;
|
|
867
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
|
868
|
+
}
|
|
869
|
+
.bg-gray-200{
|
|
870
|
+
--tw-bg-opacity: 1;
|
|
871
|
+
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
|
872
|
+
}
|
|
873
|
+
.bg-gray-50{
|
|
874
|
+
--tw-bg-opacity: 1;
|
|
875
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
|
876
|
+
}
|
|
697
877
|
.bg-green-400{
|
|
698
878
|
--tw-bg-opacity: 1;
|
|
699
879
|
background-color: rgb(74 222 128 / var(--tw-bg-opacity));
|
|
@@ -718,6 +898,10 @@ select{
|
|
|
718
898
|
--tw-bg-opacity: 1;
|
|
719
899
|
background-color: rgb(220 38 38 / var(--tw-bg-opacity));
|
|
720
900
|
}
|
|
901
|
+
.bg-white{
|
|
902
|
+
--tw-bg-opacity: 1;
|
|
903
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
904
|
+
}
|
|
721
905
|
.bg-yellow-400{
|
|
722
906
|
--tw-bg-opacity: 1;
|
|
723
907
|
background-color: rgb(250 204 21 / var(--tw-bg-opacity));
|
|
@@ -726,6 +910,9 @@ select{
|
|
|
726
910
|
--tw-bg-opacity: 1;
|
|
727
911
|
background-color: rgb(202 138 4 / var(--tw-bg-opacity));
|
|
728
912
|
}
|
|
913
|
+
.p-2{
|
|
914
|
+
padding: 0.5rem;
|
|
915
|
+
}
|
|
729
916
|
.px-2{
|
|
730
917
|
padding-left: 0.5rem;
|
|
731
918
|
padding-right: 0.5rem;
|
|
@@ -734,6 +921,10 @@ select{
|
|
|
734
921
|
padding-left: 0.625rem;
|
|
735
922
|
padding-right: 0.625rem;
|
|
736
923
|
}
|
|
924
|
+
.px-3{
|
|
925
|
+
padding-left: 0.75rem;
|
|
926
|
+
padding-right: 0.75rem;
|
|
927
|
+
}
|
|
737
928
|
.px-4{
|
|
738
929
|
padding-left: 1rem;
|
|
739
930
|
padding-right: 1rem;
|
|
@@ -758,6 +949,33 @@ select{
|
|
|
758
949
|
padding-top: 0.75rem;
|
|
759
950
|
padding-bottom: 0.75rem;
|
|
760
951
|
}
|
|
952
|
+
.pb-4{
|
|
953
|
+
padding-bottom: 1rem;
|
|
954
|
+
}
|
|
955
|
+
.pb-40{
|
|
956
|
+
padding-bottom: 10rem;
|
|
957
|
+
}
|
|
958
|
+
.pb-6{
|
|
959
|
+
padding-bottom: 1.5rem;
|
|
960
|
+
}
|
|
961
|
+
.pl-1{
|
|
962
|
+
padding-left: 0.25rem;
|
|
963
|
+
}
|
|
964
|
+
.pr-3{
|
|
965
|
+
padding-right: 0.75rem;
|
|
966
|
+
}
|
|
967
|
+
.pt-5{
|
|
968
|
+
padding-top: 1.25rem;
|
|
969
|
+
}
|
|
970
|
+
.text-left{
|
|
971
|
+
text-align: left;
|
|
972
|
+
}
|
|
973
|
+
.text-center{
|
|
974
|
+
text-align: center;
|
|
975
|
+
}
|
|
976
|
+
.text-\[10px\]{
|
|
977
|
+
font-size: 10px;
|
|
978
|
+
}
|
|
761
979
|
.text-base{
|
|
762
980
|
font-size: 1rem;
|
|
763
981
|
line-height: 1.5rem;
|
|
@@ -770,24 +988,159 @@ select{
|
|
|
770
988
|
font-size: 0.75rem;
|
|
771
989
|
line-height: 1rem;
|
|
772
990
|
}
|
|
991
|
+
.font-bold{
|
|
992
|
+
font-weight: 700;
|
|
993
|
+
}
|
|
773
994
|
.font-medium{
|
|
774
995
|
font-weight: 500;
|
|
775
996
|
}
|
|
997
|
+
.uppercase{
|
|
998
|
+
text-transform: uppercase;
|
|
999
|
+
}
|
|
776
1000
|
.leading-none{
|
|
777
1001
|
line-height: 1;
|
|
778
1002
|
}
|
|
1003
|
+
.text-black{
|
|
1004
|
+
--tw-text-opacity: 1;
|
|
1005
|
+
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
1006
|
+
}
|
|
1007
|
+
.text-cyan-300{
|
|
1008
|
+
--tw-text-opacity: 1;
|
|
1009
|
+
color: rgb(103 232 249 / var(--tw-text-opacity));
|
|
1010
|
+
}
|
|
1011
|
+
.text-gray-300{
|
|
1012
|
+
--tw-text-opacity: 1;
|
|
1013
|
+
color: rgb(209 213 219 / var(--tw-text-opacity));
|
|
1014
|
+
}
|
|
1015
|
+
.text-gray-500{
|
|
1016
|
+
--tw-text-opacity: 1;
|
|
1017
|
+
color: rgb(107 114 128 / var(--tw-text-opacity));
|
|
1018
|
+
}
|
|
1019
|
+
.text-gray-600{
|
|
1020
|
+
--tw-text-opacity: 1;
|
|
1021
|
+
color: rgb(75 85 99 / var(--tw-text-opacity));
|
|
1022
|
+
}
|
|
1023
|
+
.text-gray-700{
|
|
1024
|
+
--tw-text-opacity: 1;
|
|
1025
|
+
color: rgb(55 65 81 / var(--tw-text-opacity));
|
|
1026
|
+
}
|
|
1027
|
+
.text-gray-900{
|
|
1028
|
+
--tw-text-opacity: 1;
|
|
1029
|
+
color: rgb(17 24 39 / var(--tw-text-opacity));
|
|
1030
|
+
}
|
|
1031
|
+
.text-green-400{
|
|
1032
|
+
--tw-text-opacity: 1;
|
|
1033
|
+
color: rgb(74 222 128 / var(--tw-text-opacity));
|
|
1034
|
+
}
|
|
1035
|
+
.text-indigo-600{
|
|
1036
|
+
--tw-text-opacity: 1;
|
|
1037
|
+
color: rgb(79 70 229 / var(--tw-text-opacity));
|
|
1038
|
+
}
|
|
1039
|
+
.text-red-300{
|
|
1040
|
+
--tw-text-opacity: 1;
|
|
1041
|
+
color: rgb(252 165 165 / var(--tw-text-opacity));
|
|
1042
|
+
}
|
|
1043
|
+
.text-red-400{
|
|
1044
|
+
--tw-text-opacity: 1;
|
|
1045
|
+
color: rgb(248 113 113 / var(--tw-text-opacity));
|
|
1046
|
+
}
|
|
779
1047
|
.text-white{
|
|
780
1048
|
--tw-text-opacity: 1;
|
|
781
1049
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
782
1050
|
}
|
|
1051
|
+
.text-yellow-400{
|
|
1052
|
+
--tw-text-opacity: 1;
|
|
1053
|
+
color: rgb(250 204 21 / var(--tw-text-opacity));
|
|
1054
|
+
}
|
|
1055
|
+
.placeholder-gray-300::-moz-placeholder{
|
|
1056
|
+
--tw-placeholder-opacity: 1;
|
|
1057
|
+
color: rgb(209 213 219 / var(--tw-placeholder-opacity));
|
|
1058
|
+
}
|
|
1059
|
+
.placeholder-gray-300::placeholder{
|
|
1060
|
+
--tw-placeholder-opacity: 1;
|
|
1061
|
+
color: rgb(209 213 219 / var(--tw-placeholder-opacity));
|
|
1062
|
+
}
|
|
1063
|
+
.opacity-0{
|
|
1064
|
+
opacity: 0;
|
|
1065
|
+
}
|
|
1066
|
+
.opacity-100{
|
|
1067
|
+
opacity: 1;
|
|
1068
|
+
}
|
|
1069
|
+
.opacity-25{
|
|
1070
|
+
opacity: 0.25;
|
|
1071
|
+
}
|
|
1072
|
+
.shadow-lg{
|
|
1073
|
+
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
1074
|
+
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
|
|
1075
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1076
|
+
}
|
|
783
1077
|
.shadow-sm{
|
|
784
1078
|
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
785
1079
|
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
|
786
1080
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
787
1081
|
}
|
|
788
|
-
.
|
|
1082
|
+
.ring-1{
|
|
1083
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1084
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1085
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1086
|
+
}
|
|
1087
|
+
.ring-black{
|
|
1088
|
+
--tw-ring-opacity: 1;
|
|
1089
|
+
--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity));
|
|
1090
|
+
}
|
|
1091
|
+
.ring-opacity-5{
|
|
1092
|
+
--tw-ring-opacity: 0.05;
|
|
1093
|
+
}
|
|
1094
|
+
.transition{
|
|
1095
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
|
1096
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
|
1097
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
|
1098
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1099
|
+
transition-duration: 150ms;
|
|
1100
|
+
}
|
|
1101
|
+
.duration-100{
|
|
1102
|
+
transition-duration: 100ms;
|
|
1103
|
+
}
|
|
1104
|
+
.duration-75{
|
|
1105
|
+
transition-duration: 75ms;
|
|
1106
|
+
}
|
|
1107
|
+
.ease-in{
|
|
1108
|
+
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
1109
|
+
}
|
|
1110
|
+
.ease-out{
|
|
1111
|
+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
1112
|
+
}
|
|
1113
|
+
.focus-within\:outline-none:focus-within{
|
|
1114
|
+
outline: 2px solid transparent;
|
|
1115
|
+
outline-offset: 2px;
|
|
1116
|
+
}
|
|
1117
|
+
.focus-within\:ring-2:focus-within{
|
|
1118
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1119
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1120
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1121
|
+
}
|
|
1122
|
+
.focus-within\:ring-indigo-500:focus-within{
|
|
1123
|
+
--tw-ring-opacity: 1;
|
|
1124
|
+
--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity));
|
|
1125
|
+
}
|
|
1126
|
+
.focus-within\:ring-offset-2:focus-within{
|
|
1127
|
+
--tw-ring-offset-width: 2px;
|
|
1128
|
+
}
|
|
1129
|
+
.hover\:border-gray-400:hover{
|
|
1130
|
+
--tw-border-opacity: 1;
|
|
1131
|
+
border-color: rgb(156 163 175 / var(--tw-border-opacity));
|
|
1132
|
+
}
|
|
1133
|
+
.hover\:border-red-400:hover{
|
|
1134
|
+
--tw-border-opacity: 1;
|
|
1135
|
+
border-color: rgb(248 113 113 / var(--tw-border-opacity));
|
|
1136
|
+
}
|
|
1137
|
+
.hover\:bg-cyan-500:hover{
|
|
789
1138
|
--tw-bg-opacity: 1;
|
|
790
|
-
background-color: rgb(
|
|
1139
|
+
background-color: rgb(6 182 212 / var(--tw-bg-opacity));
|
|
1140
|
+
}
|
|
1141
|
+
.hover\:bg-gray-50:hover{
|
|
1142
|
+
--tw-bg-opacity: 1;
|
|
1143
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
|
791
1144
|
}
|
|
792
1145
|
.hover\:bg-green-600:hover{
|
|
793
1146
|
--tw-bg-opacity: 1;
|
|
@@ -805,6 +1158,14 @@ select{
|
|
|
805
1158
|
--tw-bg-opacity: 1;
|
|
806
1159
|
background-color: rgb(202 138 4 / var(--tw-bg-opacity));
|
|
807
1160
|
}
|
|
1161
|
+
.hover\:text-indigo-500:hover{
|
|
1162
|
+
--tw-text-opacity: 1;
|
|
1163
|
+
color: rgb(99 102 241 / var(--tw-text-opacity));
|
|
1164
|
+
}
|
|
1165
|
+
.focus\:border-indigo-500:focus{
|
|
1166
|
+
--tw-border-opacity: 1;
|
|
1167
|
+
border-color: rgb(99 102 241 / var(--tw-border-opacity));
|
|
1168
|
+
}
|
|
808
1169
|
.focus\:outline-none:focus{
|
|
809
1170
|
outline: 2px solid transparent;
|
|
810
1171
|
outline-offset: 2px;
|
|
@@ -814,9 +1175,27 @@ select{
|
|
|
814
1175
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
815
1176
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
816
1177
|
}
|
|
1178
|
+
.focus\:ring-indigo-500:focus{
|
|
1179
|
+
--tw-ring-opacity: 1;
|
|
1180
|
+
--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity));
|
|
1181
|
+
}
|
|
817
1182
|
.focus\:ring-offset-2:focus{
|
|
818
1183
|
--tw-ring-offset-width: 2px;
|
|
819
1184
|
}
|
|
1185
|
+
.focus\:ring-offset-gray-100:focus{
|
|
1186
|
+
--tw-ring-offset-color: #f3f4f6;
|
|
1187
|
+
}
|
|
820
1188
|
.disabled\:opacity-25:disabled{
|
|
821
1189
|
opacity: 0.25;
|
|
1190
|
+
}
|
|
1191
|
+
@media (min-width: 640px){
|
|
1192
|
+
|
|
1193
|
+
.sm\:flex-row{
|
|
1194
|
+
flex-direction: row;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.sm\:text-sm{
|
|
1198
|
+
font-size: 0.875rem;
|
|
1199
|
+
line-height: 1.25rem;
|
|
1200
|
+
}
|
|
822
1201
|
}
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),Z={name:"uiIcon"},w=Object.assign(Z,{props:{icon:{type:Function,required:!0},size:{type:String,default:"normal"},color:{type:String,default:"primary"}},setup(e){return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.icon),{class:t.normalizeClass({"h-4 w-4":e.size==="normal","h-6 w-6":e.size==="big","h-12 w-12":e.size==="huge","h-20 w-20":e.size==="massive","text-indigo-600":e.color==="primary","text-cyan-300":e.color==="secondary","text-red-400":e.color==="red","text-yellow-400":e.color==="yellow","text-green-400":e.color==="green","text-white":e.color==="white","text-gray-300":e.color==="gray","text-black":e.color==="black"})},null,8,["class"]))}}),_=["disabled"],ee={name:"uiButton"},te=Object.assign(ee,{props:{color:{type:String,default:"primary"},size:{type:String,default:"normal"},icon:{type:Function,default:()=>{}},disabled:{type:Boolean,default:!1}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("button",{disabled:e.disabled,class:t.normalizeClass([{"bg-indigo-600 hover:bg-indigo-800":e.color==="primary","bg-cyan-300 hover:bg-cyan-500":e.color==="secondary","bg-red-400 hover:bg-red-600":e.color==="red","bg-yellow-400 hover:bg-yellow-600":e.color==="yellow","bg-green-400 hover:bg-green-600":e.color==="green","px-4 py-2 text-sm rounded-md":e.size==="normal","px-2.5 py-1.5 text-xs rounded leading-none":e.size==="small","px-6 py-3 text-base rounded-md":e.size==="large"},"inline-flex items-center border border-transparent font-medium shadow-sm text-white focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-25"]),type:"button"},[t.createVNode(w,{icon:e.icon,color:"white",class:"-ml-0.5 mr-2"},null,8,["icon"]),t.renderSlot(n.$slots,"default")],10,_))}}),ne={class:"relative flex items-start"},re={class:"flex items-center h-5"},oe=["checked","value","disabled"],le={class:"ml-3 text-sm"},ae={class:"text-gray-500"},ie={name:"uiCheckbox"},ue=Object.assign(ie,{props:{disabled:{type:Boolean,default:!1},value:{type:String},check:{type:Boolean,default:!1}},emits:["checkboxChanged"],setup(e,{emit:n}){const o=e,l=t.ref(o.check),r=()=>{o.disabled||(l.value=!l.value,n("checkboxChanged",{checked:l.value,value:o.value}))};return(i,a)=>(t.openBlock(),t.createElementBlock("div",ne,[t.createElementVNode("div",re,[t.createElementVNode("input",{checked:e.check,value:e.value,disabled:e.disabled,class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded disabled:opacity-25",type:"checkbox",onChange:a[0]||(a[0]=c=>r())},null,40,oe)]),t.createElementVNode("div",le,[t.createElementVNode("span",ae,[t.renderSlot(i.$slots,"default")])])]))}});function S(e,n,...o){if(e in n){let r=n[e];return typeof r=="function"?r(...o):r}let l=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,S),l}var $=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))($||{}),ce=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ce||{});function N({visible:e=!0,features:n=0,ourProps:o,theirProps:l,...r}){var i;let a=K(l,o),c=Object.assign(r,{props:a});if(e||n&2&&a.static)return D(c);if(n&1){let f=(i=a.unmount)==null||i?0:1;return S(f,{[0](){return null},[1](){return D({...r,props:{...a,hidden:!0,style:{display:"none"}}})}})}return D(c)}function D({props:e,attrs:n,slots:o,slot:l,name:r}){var i,a;let{as:c,...f}=se(e,["unmount","static"]),d=(i=o.default)==null?void 0:i.call(o,l),u={};if(l){let g=!1,v=[];for(let[p,m]of Object.entries(l))typeof m=="boolean"&&(g=!0),m===!0&&v.push(p);g&&(u["data-headlessui-state"]=v.join(" "))}if(c==="template"){if(d=H(d??[]),Object.keys(f).length>0||Object.keys(n).length>0){let[g,...v]=d??[];if(!de(g)||v.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${r} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(f).concat(Object.keys(n)).map(s=>s.trim()).filter((s,b,k)=>k.indexOf(s)===b).sort((s,b)=>s.localeCompare(b)).map(s=>` - ${s}`).join(`
|
|
2
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(s=>` - ${s}`).join(`
|
|
3
|
+
`)].join(`
|
|
4
|
+
`));let p=K((a=g.props)!=null?a:{},f),m=t.cloneVNode(g,p);for(let s in p)s.startsWith("on")&&(m.props||(m.props={}),m.props[s]=p[s]);return m}return Array.isArray(d)&&d.length===1?d[0]:d}return t.h(c,Object.assign({},f,u),{default:()=>d})}function H(e){return e.flatMap(n=>n.type===t.Fragment?H(n.children):[n])}function K(...e){if(e.length===0)return{};if(e.length===1)return e[0];let n={},o={};for(let l of e)for(let r in l)r.startsWith("on")&&typeof l[r]=="function"?(o[r]!=null||(o[r]=[]),o[r].push(l[r])):n[r]=l[r];if(n.disabled||n["aria-disabled"])return Object.assign(n,Object.fromEntries(Object.keys(o).map(l=>[l,void 0])));for(let l in o)Object.assign(n,{[l](r,...i){let a=o[l];for(let c of a){if(r instanceof Event&&r.defaultPrevented)return;c(r,...i)}}});return n}function se(e,n=[]){let o=Object.assign({},e);for(let l of n)l in o&&delete o[l];return o}function de(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}let fe=0;function me(){return++fe}function M(){return me()}var y=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(y||{});function ve(e){throw new Error("Unexpected object: "+e)}var x=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(x||{});function pe(e,n){let o=n.resolveItems();if(o.length<=0)return null;let l=n.resolveActiveIndex(),r=l??-1,i=(()=>{switch(e.focus){case 0:return o.findIndex(a=>!n.resolveDisabled(a));case 1:{let a=o.slice().reverse().findIndex((c,f,d)=>r!==-1&&d.length-f-1>=r?!1:!n.resolveDisabled(c));return a===-1?a:o.length-1-a}case 2:return o.findIndex((a,c)=>c<=r?!1:!n.resolveDisabled(a));case 3:{let a=o.slice().reverse().findIndex(c=>!n.resolveDisabled(c));return a===-1?a:o.length-1-a}case 4:return o.findIndex(a=>n.resolveId(a)===e.id);case 5:return null;default:ve(e)}})();return i===-1?l:i}function h(e){var n;return e==null||e.value==null?null:(n=e.value.$el)!=null?n:e.value}let q=Symbol("Context");var E=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(E||{});function ge(){return t.inject(q,null)}function he(e){t.provide(q,e)}function P(e,n){if(e)return e;let o=n??"button";if(typeof o=="string"&&o.toLowerCase()==="button")return"button"}function be(e,n){let o=t.ref(P(e.value.type,e.value.as));return t.onMounted(()=>{o.value=P(e.value.type,e.value.as)}),t.watchEffect(()=>{var l;o.value||h(n)&&h(n)instanceof HTMLButtonElement&&!((l=h(n))!=null&&l.hasAttribute("type"))&&(o.value="button")}),o}var ye=Object.defineProperty,xe=(e,n,o)=>n in e?ye(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,j=(e,n,o)=>(xe(e,typeof n!="symbol"?n+"":n,o),o);class we{constructor(){j(this,"current",this.detect()),j(this,"currentId",0)}set(n){this.current!==n&&(this.currentId=0,this.current=n)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}}let O=new we;function T(e){if(O.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let n=h(e);if(n)return n.ownerDocument}return document}function ke({container:e,accept:n,walk:o,enabled:l}){t.watchEffect(()=>{let r=e.value;if(!r||l!==void 0&&!l.value)return;let i=T(e);if(!i)return;let a=Object.assign(f=>n(f),{acceptNode:n}),c=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,a,!1);for(;c.nextNode();)o(c.currentNode)})}let B=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var C=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(C||{}),Ee=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ee||{}),Se=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Se||{});function W(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(B)).sort((n,o)=>Math.sign((n.tabIndex||Number.MAX_SAFE_INTEGER)-(o.tabIndex||Number.MAX_SAFE_INTEGER)))}var V=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(V||{});function F(e,n=0){var o;return e===((o=T(e))==null?void 0:o.body)?!1:S(n,{[0](){return e.matches(B)},[1](){let l=e;for(;l!==null;){if(l.matches(B))return!0;l=l.parentElement}return!1}})}function G(e){let n=T(e);t.nextTick(()=>{n&&!F(n.activeElement,0)&&Ie(e)})}var Ne=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ne||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Ie(e){e==null||e.focus({preventScroll:!0})}let De=["textarea","input"].join(",");function $e(e){var n,o;return(o=(n=e==null?void 0:e.matches)==null?void 0:n.call(e,De))!=null?o:!1}function X(e,n=o=>o){return e.slice().sort((o,l)=>{let r=n(o),i=n(l);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Be(e,n){return Ce(W(),n,{relativeTo:e})}function Ce(e,n,{sorted:o=!0,relativeTo:l=null,skipElements:r=[]}={}){var i;let a=(i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e==null?void 0:e.ownerDocument)!=null?i:document,c=Array.isArray(e)?o?X(e):e:W(e);r.length>0&&c.length>1&&(c=c.filter(m=>!r.includes(m))),l=l??a.activeElement;let f=(()=>{if(n&5)return 1;if(n&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(n&1)return 0;if(n&2)return Math.max(0,c.indexOf(l))-1;if(n&4)return Math.max(0,c.indexOf(l))+1;if(n&8)return c.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=n&32?{preventScroll:!0}:{},g=0,v=c.length,p;do{if(g>=v||g+v<=0)return 0;let m=d+g;if(n&16)m=(m+v)%v;else{if(m<0)return 3;if(m>=v)return 1}p=c[m],p==null||p.focus(u),g+=f}while(p!==a.activeElement);return n&6&&$e(p)&&p.select(),2}function A(e,n,o){O.isServer||t.watchEffect(l=>{document.addEventListener(e,n,o),l(()=>document.removeEventListener(e,n,o))})}function Me(e,n,o){O.isServer||t.watchEffect(l=>{window.addEventListener(e,n,o),l(()=>window.removeEventListener(e,n,o))})}function Oe(e,n,o=t.computed(()=>!0)){function l(i,a){if(!o.value||i.defaultPrevented)return;let c=a(i);if(c===null||!c.getRootNode().contains(c))return;let f=function d(u){return typeof u=="function"?d(u()):Array.isArray(u)||u instanceof Set?u:[u]}(e);for(let d of f){if(d===null)continue;let u=d instanceof HTMLElement?d:h(d);if(u!=null&&u.contains(c)||i.composed&&i.composedPath().includes(u))return}return!F(c,V.Loose)&&c.tabIndex!==-1&&i.preventDefault(),n(i,c)}let r=t.ref(null);A("mousedown",i=>{var a,c;o.value&&(r.value=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target)},!0),A("click",i=>{r.value&&(l(i,()=>r.value),r.value=null)},!0),Me("blur",i=>l(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function R(e){return[e.screenX,e.screenY]}function Te(){let e=t.ref([-1,-1]);return{wasMoved(n){let o=R(n);return e.value[0]===o[0]&&e.value[1]===o[1]?!1:(e.value=o,!0)},update(n){e.value=R(n)}}}let L=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function z(e){var n,o;let l=(n=e.innerText)!=null?n:"",r=e.cloneNode(!0);if(!(r instanceof HTMLElement))return l;let i=!1;for(let c of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))c.remove(),i=!0;let a=i?(o=r.innerText)!=null?o:"":l;return L.test(a)&&(a=a.replace(L,"")),a}function Ve(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let o=e.getAttribute("aria-labelledby");if(o){let l=o.split(" ").map(r=>{let i=document.getElementById(r);if(i){let a=i.getAttribute("aria-label");return typeof a=="string"?a.trim():z(i).trim()}return null}).filter(Boolean);if(l.length>0)return l.join(", ")}return z(e).trim()}function Fe(e){let n=t.ref(""),o=t.ref("");return()=>{let l=h(e);if(!l)return"";let r=l.innerText;if(n.value===r)return o.value;let i=Ve(l).trim().toLowerCase();return n.value=r,o.value=i,i}}var Pe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Pe||{}),je=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(je||{});function Ae(e){requestAnimationFrame(()=>requestAnimationFrame(e))}let Y=Symbol("MenuContext");function I(e){let n=t.inject(Y,null);if(n===null){let o=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,I),o}return n}let Re=t.defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup(e,{slots:n,attrs:o}){let l=t.ref(1),r=t.ref(null),i=t.ref(null),a=t.ref([]),c=t.ref(""),f=t.ref(null),d=t.ref(1);function u(v=p=>p){let p=f.value!==null?a.value[f.value]:null,m=X(v(a.value.slice()),b=>h(b.dataRef.domRef)),s=p?m.indexOf(p):null;return s===-1&&(s=null),{items:m,activeItemIndex:s}}let g={menuState:l,buttonRef:r,itemsRef:i,items:a,searchQuery:c,activeItemIndex:f,activationTrigger:d,closeMenu:()=>{l.value=1,f.value=null},openMenu:()=>l.value=0,goToItem(v,p,m){let s=u(),b=pe(v===x.Specific?{focus:x.Specific,id:p}:{focus:v},{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:k=>k.id,resolveDisabled:k=>k.dataRef.disabled});c.value="",f.value=b,d.value=m??1,a.value=s.items},search(v){let p=c.value!==""?0:1;c.value+=v.toLowerCase();let m=(f.value!==null?a.value.slice(f.value+p).concat(a.value.slice(0,f.value+p)):a.value).find(b=>b.dataRef.textValue.startsWith(c.value)&&!b.dataRef.disabled),s=m?a.value.indexOf(m):-1;s===-1||s===f.value||(f.value=s,d.value=1)},clearSearch(){c.value=""},registerItem(v,p){let m=u(s=>[...s,{id:v,dataRef:p}]);a.value=m.items,f.value=m.activeItemIndex,d.value=1},unregisterItem(v){let p=u(m=>{let s=m.findIndex(b=>b.id===v);return s!==-1&&m.splice(s,1),m});a.value=p.items,f.value=p.activeItemIndex,d.value=1}};return Oe([r,i],(v,p)=>{var m;g.closeMenu(),F(p,V.Loose)||(v.preventDefault(),(m=h(r))==null||m.focus())},t.computed(()=>l.value===0)),t.provide(Y,g),he(t.computed(()=>S(l.value,{[0]:E.Open,[1]:E.Closed}))),()=>{let v={open:l.value===0,close:g.closeMenu};return N({ourProps:{},theirProps:e,slot:v,slots:n,attrs:o,name:"Menu"})}}}),Le=t.defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"},id:{type:String,default:()=>`headlessui-menu-button-${M()}`}},setup(e,{attrs:n,slots:o,expose:l}){let r=I("MenuButton");l({el:r.buttonRef,$el:r.buttonRef});function i(d){switch(d.key){case y.Space:case y.Enter:case y.ArrowDown:d.preventDefault(),d.stopPropagation(),r.openMenu(),t.nextTick(()=>{var u;(u=h(r.itemsRef))==null||u.focus({preventScroll:!0}),r.goToItem(x.First)});break;case y.ArrowUp:d.preventDefault(),d.stopPropagation(),r.openMenu(),t.nextTick(()=>{var u;(u=h(r.itemsRef))==null||u.focus({preventScroll:!0}),r.goToItem(x.Last)});break}}function a(d){switch(d.key){case y.Space:d.preventDefault();break}}function c(d){e.disabled||(r.menuState.value===0?(r.closeMenu(),t.nextTick(()=>{var u;return(u=h(r.buttonRef))==null?void 0:u.focus({preventScroll:!0})})):(d.preventDefault(),r.openMenu(),Ae(()=>{var u;return(u=h(r.itemsRef))==null?void 0:u.focus({preventScroll:!0})})))}let f=be(t.computed(()=>({as:e.as,type:n.type})),r.buttonRef);return()=>{var d;let u={open:r.menuState.value===0},{id:g,...v}=e,p={ref:r.buttonRef,id:g,type:f.value,"aria-haspopup":"menu","aria-controls":(d=h(r.itemsRef))==null?void 0:d.id,"aria-expanded":e.disabled?void 0:r.menuState.value===0,onKeydown:i,onKeyup:a,onClick:c};return N({ourProps:p,theirProps:v,slot:u,attrs:n,slots:o,name:"MenuButton"})}}}),ze=t.defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:()=>`headlessui-menu-items-${M()}`}},setup(e,{attrs:n,slots:o,expose:l}){let r=I("MenuItems"),i=t.ref(null);l({el:r.itemsRef,$el:r.itemsRef}),ke({container:t.computed(()=>h(r.itemsRef)),enabled:t.computed(()=>r.menuState.value===0),accept(u){return u.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:u.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(u){u.setAttribute("role","none")}});function a(u){var g;switch(i.value&&clearTimeout(i.value),u.key){case y.Space:if(r.searchQuery.value!=="")return u.preventDefault(),u.stopPropagation(),r.search(u.key);case y.Enter:if(u.preventDefault(),u.stopPropagation(),r.activeItemIndex.value!==null){let v=r.items.value[r.activeItemIndex.value];(g=h(v.dataRef.domRef))==null||g.click()}r.closeMenu(),G(h(r.buttonRef));break;case y.ArrowDown:return u.preventDefault(),u.stopPropagation(),r.goToItem(x.Next);case y.ArrowUp:return u.preventDefault(),u.stopPropagation(),r.goToItem(x.Previous);case y.Home:case y.PageUp:return u.preventDefault(),u.stopPropagation(),r.goToItem(x.First);case y.End:case y.PageDown:return u.preventDefault(),u.stopPropagation(),r.goToItem(x.Last);case y.Escape:u.preventDefault(),u.stopPropagation(),r.closeMenu(),t.nextTick(()=>{var v;return(v=h(r.buttonRef))==null?void 0:v.focus({preventScroll:!0})});break;case y.Tab:u.preventDefault(),u.stopPropagation(),r.closeMenu(),t.nextTick(()=>Be(h(r.buttonRef),u.shiftKey?C.Previous:C.Next));break;default:u.key.length===1&&(r.search(u.key),i.value=setTimeout(()=>r.clearSearch(),350));break}}function c(u){switch(u.key){case y.Space:u.preventDefault();break}}let f=ge(),d=t.computed(()=>f!==null?(f.value&E.Open)===E.Open:r.menuState.value===0);return()=>{var u,g;let v={open:r.menuState.value===0},{id:p,...m}=e,s={"aria-activedescendant":r.activeItemIndex.value===null||(u=r.items.value[r.activeItemIndex.value])==null?void 0:u.id,"aria-labelledby":(g=h(r.buttonRef))==null?void 0:g.id,id:p,onKeydown:a,onKeyup:c,role:"menu",tabIndex:0,ref:r.itemsRef};return N({ourProps:s,theirProps:m,slot:v,attrs:n,slots:o,features:$.RenderStrategy|$.Static,visible:d.value,name:"MenuItems"})}}}),Ue=t.defineComponent({name:"MenuItem",inheritAttrs:!1,props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`headlessui-menu-item-${M()}`}},setup(e,{slots:n,attrs:o,expose:l}){let r=I("MenuItem"),i=t.ref(null);l({el:i,$el:i});let a=t.computed(()=>r.activeItemIndex.value!==null?r.items.value[r.activeItemIndex.value].id===e.id:!1),c=Fe(i),f=t.computed(()=>({disabled:e.disabled,get textValue(){return c()},domRef:i}));t.onMounted(()=>r.registerItem(e.id,f)),t.onUnmounted(()=>r.unregisterItem(e.id)),t.watchEffect(()=>{r.menuState.value===0&&a.value&&r.activationTrigger.value!==0&&t.nextTick(()=>{var s,b;return(b=(s=h(i))==null?void 0:s.scrollIntoView)==null?void 0:b.call(s,{block:"nearest"})})});function d(s){if(e.disabled)return s.preventDefault();r.closeMenu(),G(h(r.buttonRef))}function u(){if(e.disabled)return r.goToItem(x.Nothing);r.goToItem(x.Specific,e.id)}let g=Te();function v(s){g.update(s)}function p(s){g.wasMoved(s)&&(e.disabled||a.value||r.goToItem(x.Specific,e.id,0))}function m(s){g.wasMoved(s)&&(e.disabled||a.value&&r.goToItem(x.Nothing))}return()=>{let{disabled:s}=e,b={active:a.value,disabled:s,close:r.closeMenu},{id:k,...J}=e;return N({ourProps:{id:k,ref:i,role:"menuitem",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,disabled:void 0,onClick:d,onFocus:u,onPointerenter:v,onMouseenter:v,onPointermove:p,onMousemove:p,onPointerleave:m,onMouseleave:m},theirProps:{...o,...J},slot:b,attrs:o,slots:n,name:"MenuItem"})}}});function He(e,n){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 7.5h-.75A2.25 2.25 0 004.5 9.75v7.5a2.25 2.25 0 002.25 2.25h7.5a2.25 2.25 0 002.25-2.25v-7.5a2.25 2.25 0 00-2.25-2.25h-.75m0-3l-3-3m0 0l-3 3m3-3v11.25m6-2.25h.75a2.25 2.25 0 012.25 2.25v7.5a2.25 2.25 0 01-2.25 2.25h-7.5a2.25 2.25 0 01-2.25-2.25v-.75"})])}function Ke(e,n){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"})])}function qe(e,n){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function We(e,n){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})])}function Ge(e,n){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})])}function Q(e,n){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])}const Xe={class:"py-1"},Ye=["onClick"],Qe={name:"uiDropdown"},Je=Object.assign(Qe,{props:{items:{type:Array,required:!0},position:{type:String,default:"left"},disabled:Boolean,label:{type:String,required:!0}},emits:["optionSelected"],setup(e,{emit:n}){const o=e,l=t.computed(()=>{let i=o.items.find(a=>a.active===!0);return i?i.name:o.label}),r=i=>{o.disabled||n("optionSelected",i.value)};return(i,a)=>(t.openBlock(),t.createBlock(t.unref(Re),{as:"div",class:t.normalizeClass(["relative inline-block text-left",{"opacity-25":e.disabled}])},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(Le),{class:"inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.value)+" ",1),t.createVNode(t.unref(qe),{"aria-hidden":"true",class:"-mr-1 ml-2 h-5 w-5"})]),_:1})]),t.createVNode(t.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:t.withCtx(()=>[e.disabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(ze),{key:0,class:t.normalizeClass([{"right-0":e.position==="right","left-0":e.position==="left"},"origin-top-right absolute mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none z-10"])},{default:t.withCtx(()=>[t.createElementVNode("div",Xe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(c,f)=>(t.openBlock(),t.createBlock(t.unref(Ue),{key:f},{default:t.withCtx(()=>[t.createElementVNode("a",{onClick:d=>r(c),class:t.normalizeClass([c.active?"bg-gray-100 text-gray-900":"text-gray-700","block px-4 py-2 text-sm cursor-pointer"])},t.toDisplayString(c.name),11,Ye)]),_:2},1024))),128))])]),_:1},8,["class"]))]),_:1})]),_:1},8,["class"]))}}),Ze={class:"flex justify-between"},_e={key:0,class:"block text-sm font-medium text-gray-700"},et={key:1,class:"text-[10px] text-gray-500 uppercase justify-self-end"},tt={key:0,class:"inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm"},nt=["disabled","name","placeholder","type"],rt={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},ot={name:"uiInput"},lt=Object.assign(ot,{props:{label:String,type:{type:String,default:"text"},name:String,placeholder:{type:String,default:"..."},icon:{type:Function,default:()=>{}},disabled:Boolean,color:{type:String,default:"gray"},value:{type:String,default:""},error:String,optional:String,addOn:String},emits:["inputChanged"],setup(e,{emit:n}){const o=e,l=i=>{n("inputChanged",{value:i.target.value,name:i.target.name})},r=t.ref(o.value);return(i,a)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",Ze,[e.label?(t.openBlock(),t.createElementBlock("label",_e,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),e.optional?(t.openBlock(),t.createElementBlock("span",et,t.toDisplayString(e.optional),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass([{"mt-1":e.label},"relative flex"])},[e.addOn?(t.openBlock(),t.createElementBlock("span",tt,t.toDisplayString(e.addOn),1)):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=c=>r.value=c),class:t.normalizeClass([{"border-gray-300":e.color!=="danger"||e.color!=="warning"||e.color!=="success","border-red-300":e.color==="danger","border-yellow-400":e.color==="warning","border-green-400":e.color==="success","bg-gray-100":e.disabled,"text-black":e.color!=="danger"||e.color!=="warning"||e.color!=="success","text-red-300":e.color==="danger","text-yellow-400":e.color==="warning","text-green-400":e.color==="success","rounded-md":!e.addOn,"rounded-r-md":e.addOn},"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 placeholder-gray-300"]),disabled:e.disabled,name:e.name,placeholder:e.placeholder,type:e.type,onInput:l},null,42,nt),[[t.vModelDynamic,r.value]]),e.icon?(t.openBlock(),t.createElementBlock("div",rt,[t.createVNode(w,{icon:e.icon,color:e.color},null,8,["icon","color"]),t.withDirectives(t.createVNode(w,{icon:t.unref(Ke),color:"green"},null,8,["icon"]),[[t.vShow,e.color==="success"]]),t.withDirectives(t.createVNode(w,{icon:t.unref(Ge),color:"yellow"},null,8,["icon"]),[[t.vShow,e.color==="warning"]]),t.withDirectives(t.createVNode(w,{icon:t.unref(We),color:"red"},null,8,["icon"]),[[t.vShow,e.color==="danger"]])])):t.createCommentVNode("",!0)],2),t.withDirectives(t.createElementVNode("p",{class:t.normalizeClass([{"text-gray-300":e.color!=="danger"||e.color!=="warning"||e.color!=="success","text-red-300":e.color==="danger","text-yellow-400":e.color==="warning","text-green-400":e.color==="success"},"mt-2 text-xs flex flex-row items-center"])},[t.createVNode(w,{icon:t.unref(Q),color:"red",class:"mr-2"},null,8,["icon"]),t.createTextVNode(t.toDisplayString(e.error),1)],2),[[t.vShow,e.error]])]))}}),at={class:"flex justify-between"},it={key:0,class:"block text-sm font-medium text-gray-700"},ut={key:1,class:"text-[10px] text-gray-500 uppercase"},ct=["onDrop"],st={class:"space-y-1 flex flex-col items-center justify-center"},dt={class:"flex text-sm text-gray-600 flex flex-col sm:flex-row text-center"},ft={for:"file-upload",class:"relative cursor-pointer rounded-md font-medium text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2 hover:text-indigo-500"},mt=["accept"],vt={class:"pl-1"},pt={class:"text-xs text-gray-500 pb-4"},gt={class:"mt-2 text-xs flex flex-row items-center text-red-300"},ht={name:"uiInputFile"},bt=Object.assign(ht,{props:{name:String,label:String,optional:String,placeholder:String,dragAndDrop:String,fileTypesAndSizes:String,error:String,accept:String,icon:{type:Function,default:He}},emits:["filesUploaded"],setup(e,{emit:n}){const o=e,l=t.ref(""),r=a=>{let f=a.dataTransfer.files;n("filesUploaded",f),o.filename=f[0].name},i=a=>{n("filesUploaded",a.target.files),o.filename=a.target.files[0].name};return(a,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",at,[e.label?(t.openBlock(),t.createElementBlock("label",it,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),e.optional?(t.openBlock(),t.createElementBlock("span",ut,t.toDisplayString(e.optional),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass([[{"mt-1":e.label},{"border-gray-300 hover:border-gray-400":!e.error},{"border-red-300 hover:border-red-400":e.error}],"dropArea flex justify-center rounded-md border-2 border-dashed px-6 pt-5 pb-6"]),onDragover:c[0]||(c[0]=t.withModifiers(()=>{},["prevent"])),onDrop:t.withModifiers(r,["prevent"])},[t.createElementVNode("div",st,[t.createVNode(w,{icon:e.icon,size:"massive",color:"gray","aria-hidden":"true",class:"mb-4"},null,8,["icon"]),t.createElementVNode("div",dt,[t.createElementVNode("label",ft,[t.createElementVNode("span",null,t.toDisplayString(e.placeholder),1),t.createElementVNode("input",{id:"file-upload",name:"file-upload",type:"file",class:"sr-only",accept:e.accept,onChange:i},null,40,mt)]),t.createElementVNode("p",vt,t.toDisplayString(e.dragAndDrop),1)]),t.createElementVNode("p",pt,t.toDisplayString(e.fileTypesAndSizes),1),t.withDirectives(t.createElementVNode("p",{class:"font-bold text-xs uppercase block p-2 bg-gray-200 rounded"},t.toDisplayString(l.value),513),[[t.vShow,l.value!==""]])])],42,ct),t.withDirectives(t.createElementVNode("p",gt,[t.createVNode(w,{icon:t.unref(Q),color:"red",class:"mr-2"},null,8,["icon"]),t.createTextVNode(t.toDisplayString(e.error),1)],512),[[t.vShow,e.error]])]))}}),yt={uiButton:te,uiIcon:w,uiCheckbox:ue,uiDropdown:Je,uiInput:lt,uiInputFile:bt},U=yt,xt={install(e){Object.keys(U).forEach(n=>{e.component(n,U[n])})}};exports.default=xt;
|