@rovula/ui 0.0.5 → 0.0.7
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/dist/cjs/bundle.css +272 -2
- package/dist/cjs/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +1 -1
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +19 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +338 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +26 -0
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/components/TextInput/TextInput.js +61 -0
- package/dist/components/TextInput/TextInput.stories.js +39 -0
- package/dist/components/TextInput/TextInput.styles.js +155 -0
- package/dist/esm/bundle.css +272 -2
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +1 -1
- package/dist/esm/types/components/TextInput/TextInput.d.ts +19 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +338 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +26 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.js +1 -1
- package/dist/src/theme/global.css +341 -1
- package/dist/theme/global.css +15 -2
- package/dist/theme/presets/colors.js +26 -0
- package/package.json +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +44 -0
- package/src/components/TextInput/TextInput.styles.ts +177 -0
- package/src/components/TextInput/TextInput.tsx +119 -0
- package/src/index.ts +1 -1
- package/src/theme/global.css +15 -2
- package/src/theme/presets/colors.js +26 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
export var inputVariant = cva([
|
|
3
|
+
"border-0 outline-none",
|
|
4
|
+
"p-1 flex",
|
|
5
|
+
"peer text-black placeholder:text-transparent",
|
|
6
|
+
], {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "p-2 px-3 typography-small1",
|
|
10
|
+
md: "py-2 px-3 typography-subtitile4",
|
|
11
|
+
lg: "p-4 typography-subtitile1",
|
|
12
|
+
},
|
|
13
|
+
rounded: {
|
|
14
|
+
none: "rounded-none",
|
|
15
|
+
normal: "rounded-xl",
|
|
16
|
+
full: "rounded-full",
|
|
17
|
+
},
|
|
18
|
+
variant: {
|
|
19
|
+
flat: "",
|
|
20
|
+
outline: "ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-2 focus:ring-inset focus:ring-input-active",
|
|
21
|
+
underline: "border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke",
|
|
22
|
+
},
|
|
23
|
+
fullwidth: {
|
|
24
|
+
true: "w-full",
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
|
|
28
|
+
},
|
|
29
|
+
error: {
|
|
30
|
+
true: "ring-error",
|
|
31
|
+
},
|
|
32
|
+
hasClearIcon: {
|
|
33
|
+
true: "",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
compoundVariants: [
|
|
37
|
+
{
|
|
38
|
+
variant: "underline",
|
|
39
|
+
className: "rounded-none",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
hasClearIcon: true,
|
|
43
|
+
size: "sm",
|
|
44
|
+
class: "focus:pe-6",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
hasClearIcon: true,
|
|
48
|
+
size: "md",
|
|
49
|
+
class: "focus:pe-8",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
hasClearIcon: true,
|
|
53
|
+
size: "lg",
|
|
54
|
+
class: "focus:pe-10",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
size: "md",
|
|
59
|
+
variant: "outline",
|
|
60
|
+
rounded: "normal",
|
|
61
|
+
fullwidth: false,
|
|
62
|
+
disabled: false,
|
|
63
|
+
error: false,
|
|
64
|
+
hasClearIcon: false,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
export var labelVariant = cva([
|
|
68
|
+
"absolute block transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background",
|
|
69
|
+
], {
|
|
70
|
+
variants: {
|
|
71
|
+
size: {
|
|
72
|
+
sm: [
|
|
73
|
+
"left-3 top-2 typography-small1 peer-focus:-top-1.5 peer-focus:typography-label2",
|
|
74
|
+
"bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label2",
|
|
75
|
+
],
|
|
76
|
+
md: [
|
|
77
|
+
"left-3 top-2 typography-subtitile4 peer-focus:-top-1.5 peer-focus:typography-label1",
|
|
78
|
+
"bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
|
|
79
|
+
],
|
|
80
|
+
lg: [
|
|
81
|
+
"left-4 top-4 typography-subtitile1 peer-focus:-top-1.5 peer-focus:typography-label1",
|
|
82
|
+
"bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
disabled: {
|
|
86
|
+
true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
|
|
87
|
+
},
|
|
88
|
+
error: {
|
|
89
|
+
true: "ring-error",
|
|
90
|
+
},
|
|
91
|
+
isFloating: {
|
|
92
|
+
true: "-top-1.5 typography-label1 bg-input-label-background",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
compoundVariants: [
|
|
96
|
+
{
|
|
97
|
+
size: "sm",
|
|
98
|
+
isFloating: true,
|
|
99
|
+
class: "-top-1.5 typography-label2 bg-input-label-background",
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
defaultVariants: {
|
|
103
|
+
size: "md",
|
|
104
|
+
disabled: false,
|
|
105
|
+
error: false,
|
|
106
|
+
isFloating: false,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
export var helperTextVariant = cva(["text-small1 flex flex-row items-center gap-1"], {
|
|
110
|
+
variants: {
|
|
111
|
+
size: {
|
|
112
|
+
sm: "mt-1",
|
|
113
|
+
md: "mt-[6px]",
|
|
114
|
+
lg: "mt-[6px]",
|
|
115
|
+
},
|
|
116
|
+
disabled: {
|
|
117
|
+
true: "text-input-text-disabled",
|
|
118
|
+
},
|
|
119
|
+
error: {
|
|
120
|
+
true: "text-error",
|
|
121
|
+
false: "text-input-text",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
defaultVariants: {
|
|
125
|
+
size: "md",
|
|
126
|
+
disabled: false,
|
|
127
|
+
error: false,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
export var iconWrapperVariant = cva([
|
|
131
|
+
"absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex",
|
|
132
|
+
], {
|
|
133
|
+
variants: {
|
|
134
|
+
size: {
|
|
135
|
+
sm: "mr-2",
|
|
136
|
+
md: "mr-3",
|
|
137
|
+
lg: "mr-4",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
defaultVariants: {
|
|
141
|
+
size: "md",
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
export var iconVariant = cva(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"], {
|
|
145
|
+
variants: {
|
|
146
|
+
size: {
|
|
147
|
+
sm: "size-3",
|
|
148
|
+
md: "size-4",
|
|
149
|
+
lg: "size-5",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
defaultVariants: {
|
|
153
|
+
size: "md",
|
|
154
|
+
},
|
|
155
|
+
});
|
package/dist/esm/bundle.css
CHANGED
|
@@ -517,10 +517,23 @@ video {
|
|
|
517
517
|
--error-default: var(--error-100);
|
|
518
518
|
--error-foreground: var(--white);
|
|
519
519
|
|
|
520
|
-
|
|
520
|
+
/* Button */
|
|
521
521
|
--btn-rounded-sm: 10px;
|
|
522
522
|
--btn-rounded-md: 12px;
|
|
523
523
|
--btn-rounded-lg: 16px;
|
|
524
|
+
|
|
525
|
+
/* Input */
|
|
526
|
+
--input-default-text-color: 164 169 178;
|
|
527
|
+
--input-default-stroke-color: 231 231 231;
|
|
528
|
+
|
|
529
|
+
--input-active-text-color: 29 30 39;
|
|
530
|
+
--input-active-stroke-color: 208 208 208;
|
|
531
|
+
|
|
532
|
+
--input-disabled-text-color: 196 199 205;
|
|
533
|
+
--input-disabled-stroke-color: 239 239 239;
|
|
534
|
+
--input-disabled-background-color: 247 247 247;
|
|
535
|
+
|
|
536
|
+
--input-label-background-color: 249 251 255;
|
|
524
537
|
}
|
|
525
538
|
|
|
526
539
|
*, ::before, ::after {
|
|
@@ -633,6 +646,40 @@ video {
|
|
|
633
646
|
.pointer-events-none {
|
|
634
647
|
pointer-events: none;
|
|
635
648
|
}
|
|
649
|
+
.absolute {
|
|
650
|
+
position: absolute;
|
|
651
|
+
}
|
|
652
|
+
.relative {
|
|
653
|
+
position: relative;
|
|
654
|
+
}
|
|
655
|
+
.inset-y-0 {
|
|
656
|
+
top: 0px;
|
|
657
|
+
bottom: 0px;
|
|
658
|
+
}
|
|
659
|
+
.-top-1 {
|
|
660
|
+
top: -0.25rem;
|
|
661
|
+
}
|
|
662
|
+
.-top-1\.5 {
|
|
663
|
+
top: -0.375rem;
|
|
664
|
+
}
|
|
665
|
+
.left-3 {
|
|
666
|
+
left: 0.75rem;
|
|
667
|
+
}
|
|
668
|
+
.left-4 {
|
|
669
|
+
left: 1rem;
|
|
670
|
+
}
|
|
671
|
+
.right-0 {
|
|
672
|
+
right: 0px;
|
|
673
|
+
}
|
|
674
|
+
.top-2 {
|
|
675
|
+
top: 0.5rem;
|
|
676
|
+
}
|
|
677
|
+
.top-4 {
|
|
678
|
+
top: 1rem;
|
|
679
|
+
}
|
|
680
|
+
.z-50 {
|
|
681
|
+
z-index: 50;
|
|
682
|
+
}
|
|
636
683
|
.mx-auto {
|
|
637
684
|
margin-left: auto;
|
|
638
685
|
margin-right: auto;
|
|
@@ -641,6 +688,24 @@ video {
|
|
|
641
688
|
margin-top: auto;
|
|
642
689
|
margin-bottom: auto;
|
|
643
690
|
}
|
|
691
|
+
.mr-2 {
|
|
692
|
+
margin-right: 0.5rem;
|
|
693
|
+
}
|
|
694
|
+
.mr-3 {
|
|
695
|
+
margin-right: 0.75rem;
|
|
696
|
+
}
|
|
697
|
+
.mr-4 {
|
|
698
|
+
margin-right: 1rem;
|
|
699
|
+
}
|
|
700
|
+
.mt-1 {
|
|
701
|
+
margin-top: 0.25rem;
|
|
702
|
+
}
|
|
703
|
+
.mt-\[6px\] {
|
|
704
|
+
margin-top: 6px;
|
|
705
|
+
}
|
|
706
|
+
.block {
|
|
707
|
+
display: block;
|
|
708
|
+
}
|
|
644
709
|
.flex {
|
|
645
710
|
display: flex;
|
|
646
711
|
}
|
|
@@ -653,6 +718,21 @@ video {
|
|
|
653
718
|
.grid {
|
|
654
719
|
display: grid;
|
|
655
720
|
}
|
|
721
|
+
.hidden {
|
|
722
|
+
display: none;
|
|
723
|
+
}
|
|
724
|
+
.size-3 {
|
|
725
|
+
width: 0.75rem;
|
|
726
|
+
height: 0.75rem;
|
|
727
|
+
}
|
|
728
|
+
.size-4 {
|
|
729
|
+
width: 1rem;
|
|
730
|
+
height: 1rem;
|
|
731
|
+
}
|
|
732
|
+
.size-5 {
|
|
733
|
+
width: 1.25rem;
|
|
734
|
+
height: 1.25rem;
|
|
735
|
+
}
|
|
656
736
|
.w-\[200px\] {
|
|
657
737
|
width: 200px;
|
|
658
738
|
}
|
|
@@ -665,6 +745,9 @@ video {
|
|
|
665
745
|
.max-w-3xl {
|
|
666
746
|
max-width: 48rem;
|
|
667
747
|
}
|
|
748
|
+
.cursor-pointer {
|
|
749
|
+
cursor: pointer;
|
|
750
|
+
}
|
|
668
751
|
.select-none {
|
|
669
752
|
-webkit-user-select: none;
|
|
670
753
|
-moz-user-select: none;
|
|
@@ -690,9 +773,15 @@ video {
|
|
|
690
773
|
.justify-center {
|
|
691
774
|
justify-content: center;
|
|
692
775
|
}
|
|
776
|
+
.gap-1 {
|
|
777
|
+
gap: 0.25rem;
|
|
778
|
+
}
|
|
693
779
|
.gap-2 {
|
|
694
780
|
gap: 0.5rem;
|
|
695
781
|
}
|
|
782
|
+
.gap-4 {
|
|
783
|
+
gap: 1rem;
|
|
784
|
+
}
|
|
696
785
|
.gap-x-8 {
|
|
697
786
|
-moz-column-gap: 2rem;
|
|
698
787
|
column-gap: 2rem;
|
|
@@ -709,6 +798,9 @@ video {
|
|
|
709
798
|
.whitespace-nowrap {
|
|
710
799
|
white-space: nowrap;
|
|
711
800
|
}
|
|
801
|
+
.rounded {
|
|
802
|
+
border-radius: 0.25rem;
|
|
803
|
+
}
|
|
712
804
|
.rounded-\[--btn-rounded-lg\] {
|
|
713
805
|
border-radius: var(--btn-rounded-lg);
|
|
714
806
|
}
|
|
@@ -718,15 +810,30 @@ video {
|
|
|
718
810
|
.rounded-\[--btn-rounded-sm\] {
|
|
719
811
|
border-radius: var(--btn-rounded-sm);
|
|
720
812
|
}
|
|
813
|
+
.rounded-full {
|
|
814
|
+
border-radius: 9999px;
|
|
815
|
+
}
|
|
721
816
|
.rounded-lg {
|
|
722
817
|
border-radius: 0.5rem;
|
|
723
818
|
}
|
|
819
|
+
.rounded-none {
|
|
820
|
+
border-radius: 0px;
|
|
821
|
+
}
|
|
724
822
|
.rounded-sm {
|
|
725
823
|
border-radius: 0.125rem;
|
|
726
824
|
}
|
|
825
|
+
.rounded-xl {
|
|
826
|
+
border-radius: 0.75rem;
|
|
827
|
+
}
|
|
727
828
|
.border {
|
|
728
829
|
border-width: 1px;
|
|
729
830
|
}
|
|
831
|
+
.border-0 {
|
|
832
|
+
border-width: 0px;
|
|
833
|
+
}
|
|
834
|
+
.border-b-2 {
|
|
835
|
+
border-bottom-width: 2px;
|
|
836
|
+
}
|
|
730
837
|
.border-error {
|
|
731
838
|
--tw-border-opacity: 1;
|
|
732
839
|
border-color: rgb(var(--error-100) / var(--tw-border-opacity));
|
|
@@ -735,6 +842,10 @@ video {
|
|
|
735
842
|
--tw-border-opacity: 1;
|
|
736
843
|
border-color: rgb(var(--info-default) / var(--tw-border-opacity));
|
|
737
844
|
}
|
|
845
|
+
.border-input-stroke {
|
|
846
|
+
--tw-border-opacity: 1;
|
|
847
|
+
border-color: rgb(var(--input-default-stroke-color) / var(--tw-border-opacity));
|
|
848
|
+
}
|
|
738
849
|
.border-primary {
|
|
739
850
|
--tw-border-opacity: 1;
|
|
740
851
|
border-color: rgb(var(--primary-default) / var(--tw-border-opacity));
|
|
@@ -766,6 +877,10 @@ video {
|
|
|
766
877
|
--tw-bg-opacity: 1;
|
|
767
878
|
background-color: rgb(var(--info-default) / var(--tw-bg-opacity));
|
|
768
879
|
}
|
|
880
|
+
.bg-input-label-background {
|
|
881
|
+
--tw-bg-opacity: 1;
|
|
882
|
+
background-color: rgb(var(--input-label-background-color) / var(--tw-bg-opacity));
|
|
883
|
+
}
|
|
769
884
|
.bg-primary {
|
|
770
885
|
--tw-bg-opacity: 1;
|
|
771
886
|
background-color: rgb(var(--primary-default) / var(--tw-bg-opacity));
|
|
@@ -793,6 +908,21 @@ video {
|
|
|
793
908
|
--tw-bg-opacity: 1;
|
|
794
909
|
background-color: rgb(var(--warning-default) / var(--tw-bg-opacity));
|
|
795
910
|
}
|
|
911
|
+
.fill-error {
|
|
912
|
+
fill: rgb(var(--error-100) / 1);
|
|
913
|
+
}
|
|
914
|
+
.fill-input-stroke-active {
|
|
915
|
+
fill: rgb(var(--input-active-stroke-color) / 1);
|
|
916
|
+
}
|
|
917
|
+
.p-1 {
|
|
918
|
+
padding: 0.25rem;
|
|
919
|
+
}
|
|
920
|
+
.p-2 {
|
|
921
|
+
padding: 0.5rem;
|
|
922
|
+
}
|
|
923
|
+
.p-4 {
|
|
924
|
+
padding: 1rem;
|
|
925
|
+
}
|
|
796
926
|
.p-5 {
|
|
797
927
|
padding: 1.25rem;
|
|
798
928
|
}
|
|
@@ -808,6 +938,10 @@ video {
|
|
|
808
938
|
padding-left: 1.5rem;
|
|
809
939
|
padding-right: 1.5rem;
|
|
810
940
|
}
|
|
941
|
+
.px-\[2px\] {
|
|
942
|
+
padding-left: 2px;
|
|
943
|
+
padding-right: 2px;
|
|
944
|
+
}
|
|
811
945
|
.py-1 {
|
|
812
946
|
padding-top: 0.25rem;
|
|
813
947
|
padding-bottom: 0.25rem;
|
|
@@ -951,6 +1085,10 @@ video {
|
|
|
951
1085
|
.tracking-\[\.02857em\] {
|
|
952
1086
|
letter-spacing: .02857em;
|
|
953
1087
|
}
|
|
1088
|
+
.text-black {
|
|
1089
|
+
--tw-text-opacity: 1;
|
|
1090
|
+
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
1091
|
+
}
|
|
954
1092
|
.text-error {
|
|
955
1093
|
--tw-text-opacity: 1;
|
|
956
1094
|
color: rgb(var(--error-100) / var(--tw-text-opacity));
|
|
@@ -971,6 +1109,14 @@ video {
|
|
|
971
1109
|
--tw-text-opacity: 1;
|
|
972
1110
|
color: rgb(var(--info-foreground) / var(--tw-text-opacity));
|
|
973
1111
|
}
|
|
1112
|
+
.text-input-text {
|
|
1113
|
+
--tw-text-opacity: 1;
|
|
1114
|
+
color: rgb(var(--input-default-text-color) / var(--tw-text-opacity));
|
|
1115
|
+
}
|
|
1116
|
+
.text-input-text-disabled {
|
|
1117
|
+
--tw-text-opacity: 1;
|
|
1118
|
+
color: rgb(var(--input-disabled-text-color) / var(--tw-text-opacity));
|
|
1119
|
+
}
|
|
974
1120
|
.text-primary {
|
|
975
1121
|
--tw-text-opacity: 1;
|
|
976
1122
|
color: rgb(var(--primary-default) / var(--tw-text-opacity));
|
|
@@ -1024,9 +1170,38 @@ video {
|
|
|
1024
1170
|
.underline-offset-4 {
|
|
1025
1171
|
text-underline-offset: 4px;
|
|
1026
1172
|
}
|
|
1173
|
+
.outline-none {
|
|
1174
|
+
outline: 2px solid transparent;
|
|
1175
|
+
outline-offset: 2px;
|
|
1176
|
+
}
|
|
1027
1177
|
.outline {
|
|
1028
1178
|
outline-style: solid;
|
|
1029
1179
|
}
|
|
1180
|
+
.ring-1 {
|
|
1181
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1182
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1183
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1184
|
+
}
|
|
1185
|
+
.ring-inset {
|
|
1186
|
+
--tw-ring-inset: inset;
|
|
1187
|
+
}
|
|
1188
|
+
.ring-error {
|
|
1189
|
+
--tw-ring-opacity: 1;
|
|
1190
|
+
--tw-ring-color: rgb(var(--error-100) / var(--tw-ring-opacity));
|
|
1191
|
+
}
|
|
1192
|
+
.ring-input-stroke {
|
|
1193
|
+
--tw-ring-opacity: 1;
|
|
1194
|
+
--tw-ring-color: rgb(var(--input-default-stroke-color) / var(--tw-ring-opacity));
|
|
1195
|
+
}
|
|
1196
|
+
.ring-input-stroke-disabled {
|
|
1197
|
+
--tw-ring-opacity: 1;
|
|
1198
|
+
--tw-ring-color: rgb(var(--input-disabled-stroke-color) / var(--tw-ring-opacity));
|
|
1199
|
+
}
|
|
1200
|
+
.transition-all {
|
|
1201
|
+
transition-property: all;
|
|
1202
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1203
|
+
transition-duration: 150ms;
|
|
1204
|
+
}
|
|
1030
1205
|
.transition-colors {
|
|
1031
1206
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
1032
1207
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -1143,10 +1318,28 @@ video {
|
|
|
1143
1318
|
line-height: 10px;
|
|
1144
1319
|
font-weight: 400;
|
|
1145
1320
|
}
|
|
1321
|
+
.placeholder\:text-input-text-disabled::-moz-placeholder {
|
|
1322
|
+
--tw-text-opacity: 1;
|
|
1323
|
+
color: rgb(var(--input-disabled-text-color) / var(--tw-text-opacity));
|
|
1324
|
+
}
|
|
1325
|
+
.placeholder\:text-input-text-disabled::placeholder {
|
|
1326
|
+
--tw-text-opacity: 1;
|
|
1327
|
+
color: rgb(var(--input-disabled-text-color) / var(--tw-text-opacity));
|
|
1328
|
+
}
|
|
1329
|
+
.placeholder\:text-transparent::-moz-placeholder {
|
|
1330
|
+
color: transparent;
|
|
1331
|
+
}
|
|
1332
|
+
.placeholder\:text-transparent::placeholder {
|
|
1333
|
+
color: transparent;
|
|
1334
|
+
}
|
|
1146
1335
|
.hover\:border-error-120:hover {
|
|
1147
1336
|
--tw-border-opacity: 1;
|
|
1148
1337
|
border-color: rgb(var(--error-120) / var(--tw-border-opacity));
|
|
1149
1338
|
}
|
|
1339
|
+
.hover\:border-input-stroke-active:hover {
|
|
1340
|
+
--tw-border-opacity: 1;
|
|
1341
|
+
border-color: rgb(var(--input-active-stroke-color) / var(--tw-border-opacity));
|
|
1342
|
+
}
|
|
1150
1343
|
.hover\:border-warning-100:hover {
|
|
1151
1344
|
--tw-border-opacity: 1;
|
|
1152
1345
|
border-color: rgb(var(--warning-100) / var(--tw-border-opacity));
|
|
@@ -1188,14 +1381,91 @@ video {
|
|
|
1188
1381
|
.hover\:bg-opacity-90:hover {
|
|
1189
1382
|
--tw-bg-opacity: 0.9;
|
|
1190
1383
|
}
|
|
1384
|
+
.hover\:fill-input-text:hover {
|
|
1385
|
+
fill: rgb(var(--input-default-text-color) / 1);
|
|
1386
|
+
}
|
|
1191
1387
|
.hover\:text-opacity-80:hover {
|
|
1192
1388
|
--tw-text-opacity: 0.8;
|
|
1193
1389
|
}
|
|
1390
|
+
.focus\:border-input-stroke:focus {
|
|
1391
|
+
--tw-border-opacity: 1;
|
|
1392
|
+
border-color: rgb(var(--input-default-stroke-color) / var(--tw-border-opacity));
|
|
1393
|
+
}
|
|
1394
|
+
.focus\:pe-10:focus {
|
|
1395
|
+
padding-inline-end: 2.5rem;
|
|
1396
|
+
}
|
|
1397
|
+
.focus\:pe-6:focus {
|
|
1398
|
+
padding-inline-end: 1.5rem;
|
|
1399
|
+
}
|
|
1400
|
+
.focus\:pe-8:focus {
|
|
1401
|
+
padding-inline-end: 2rem;
|
|
1402
|
+
}
|
|
1403
|
+
.focus\:ring-2:focus {
|
|
1404
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1405
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1406
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1407
|
+
}
|
|
1408
|
+
.focus\:ring-inset:focus {
|
|
1409
|
+
--tw-ring-inset: inset;
|
|
1410
|
+
}
|
|
1194
1411
|
.active\:scale-\[98\%\]:active {
|
|
1195
1412
|
--tw-scale-x: 98%;
|
|
1196
1413
|
--tw-scale-y: 98%;
|
|
1197
1414
|
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));
|
|
1198
1415
|
}
|
|
1416
|
+
.peer:focus ~ .peer-focus\:-top-1 {
|
|
1417
|
+
top: -0.25rem;
|
|
1418
|
+
}
|
|
1419
|
+
.peer:focus ~ .peer-focus\:-top-1\.5 {
|
|
1420
|
+
top: -0.375rem;
|
|
1421
|
+
}
|
|
1422
|
+
.peer:focus ~ .peer-focus\:flex {
|
|
1423
|
+
display: flex;
|
|
1424
|
+
}
|
|
1425
|
+
.peer:focus ~ .peer-focus\:bg-input-label-background {
|
|
1426
|
+
--tw-bg-opacity: 1;
|
|
1427
|
+
background-color: rgb(var(--input-label-background-color) / var(--tw-bg-opacity));
|
|
1428
|
+
}
|
|
1429
|
+
.peer:focus ~ .peer-focus\:text-input-text-active {
|
|
1430
|
+
--tw-text-opacity: 1;
|
|
1431
|
+
color: rgb(var(--input-active-text-color) / var(--tw-text-opacity));
|
|
1432
|
+
}
|
|
1433
|
+
.peer:focus ~ .peer-focus\:typography-label1 {
|
|
1434
|
+
font-size: 12px;
|
|
1435
|
+
line-height: 12px;
|
|
1436
|
+
font-weight: 400;
|
|
1437
|
+
}
|
|
1438
|
+
.peer:focus ~ .peer-focus\:typography-label2 {
|
|
1439
|
+
font-size: 10px;
|
|
1440
|
+
line-height: 10px;
|
|
1441
|
+
font-weight: 400;
|
|
1442
|
+
}
|
|
1443
|
+
.peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:-top-1\.5 {
|
|
1444
|
+
top: -0.375rem;
|
|
1445
|
+
}
|
|
1446
|
+
.peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:-top-1\.5 {
|
|
1447
|
+
top: -0.375rem;
|
|
1448
|
+
}
|
|
1449
|
+
.peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:typography-label1 {
|
|
1450
|
+
font-size: 12px;
|
|
1451
|
+
line-height: 12px;
|
|
1452
|
+
font-weight: 400;
|
|
1453
|
+
}
|
|
1454
|
+
.peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:typography-label1 {
|
|
1455
|
+
font-size: 12px;
|
|
1456
|
+
line-height: 12px;
|
|
1457
|
+
font-weight: 400;
|
|
1458
|
+
}
|
|
1459
|
+
.peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:typography-label2 {
|
|
1460
|
+
font-size: 10px;
|
|
1461
|
+
line-height: 10px;
|
|
1462
|
+
font-weight: 400;
|
|
1463
|
+
}
|
|
1464
|
+
.peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:typography-label2 {
|
|
1465
|
+
font-size: 10px;
|
|
1466
|
+
line-height: 10px;
|
|
1467
|
+
font-weight: 400;
|
|
1468
|
+
}
|
|
1199
1469
|
.aria-disabled\:pointer-events-none[aria-disabled="true"] {
|
|
1200
1470
|
pointer-events: none;
|
|
1201
1471
|
}
|
|
@@ -1204,4 +1474,4 @@ video {
|
|
|
1204
1474
|
}
|
|
1205
1475
|
.aria-disabled\:opacity-50[aria-disabled="true"] {
|
|
1206
1476
|
opacity: 0.5;
|
|
1207
|
-
}
|
|
1477
|
+
}
|
package/dist/esm/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{twMerge as a}from"tailwind-merge";import{cva as o}from"class-variance-authority";import*as n from"react";import{forwardRef as i,useRef as l,useImperativeHandle as s,useState as d}from"react";var c=function(){return c=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},c.apply(this,arguments)};function u(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)r.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var p=o(["gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]"],{variants:{color:{primary:"bg-primary border-primary text-primary hover:bg-primary-80",secondary:"border-secondary bg-secondary-100 text-secondary-foreground hover:bg-secondary-120",tertiary:"border-tertiary-120 bg-tertiary-120 text-tertiary-120 hover:bg-tertiary-100",success:"border-success bg-success text-success hover:bg-success-120",info:"border-info bg-info text-info hover:bg-info-100",warning:"border-warning bg-warning text-warning hover:bg-warning-100 hover:border-warning-100",error:"border-error bg-error text-error hover:bg-error-120 hover:border-error-120"},size:{sm:"px-3 py-1 text-sm rounded-[--btn-rounded-sm]",md:"px-4 py-2 text-sm rounded-[--btn-rounded-md]",lg:"px-6 py-4 text-base rounded-[--btn-rounded-lg]"},variant:{solid:"border",outline:"border bg-transparent hover:bg-opacity-20",flat:"bg-transparent hover:bg-opacity-20",link:"bg-transparent underline underline-offset-4 hover:bg-transparent hover:text-opacity-80"},disabled:{true:"pointer-events-none border-transparent bg-secondary-110 text-secondary-130"},fullwidth:{true:"w-full"}},compoundVariants:[{variant:["flat","link"],disabled:!0,class:"border-transparent bg-transparent"},{variant:"solid",color:"primary",class:"text-primary-foreground"},{variant:"solid",color:"secondary",class:"text-secondary-foreground"},{variant:"solid",disabled:!0,color:"secondary",class:"text-white"},{variant:"solid",color:"tertiary",class:"text-tertiary-foreground"},{variant:"solid",color:"success",class:"text-success-foreground"},{variant:"solid",color:"info",class:"text-info-foreground"},{variant:"solid",color:"warning",class:"text-warning-foreground"},{variant:"solid",color:"error",class:"text-error-foreground"}],defaultVariants:{size:"md",color:"primary",variant:"solid",fullwidth:!0}}),b=function(o){var n=o.size,i=void 0===n?"md":n,l=o.color,s=void 0===l?"primary":l,d=o.variant,b=void 0===d?"solid":d,f=o.title,g=o.children,h=o.startIcon,v=o.endIcon,m=o.disabled,y=void 0!==m&&m,x=o.fullwidth,w=void 0!==x&&x,z=o.isLoading,N=void 0!==z&&z,k=o.className,I=u(o,["size","color","variant","title","children","startIcon","endIcon","disabled","fullwidth","isLoading","className"]),O=y||N;return e("button",c({type:"button"},I,{"aria-disabled":O||void 0,tabIndex:O?-1:0,className:a(p({size:i,color:s,variant:b,disabled:y,fullwidth:w}),k),disabled:O,children:r(t,{children:[h,g||f,v]})}))},f=function(t){var a=t.columns,o=t.data;return r("table",{className:"table",children:[e("thead",{children:e("tr",{children:a.map((function(r,t){return e("th",{children:r.header},t)}))})}),e("tbody",{children:o.map((function(r,t){return e("tr",{children:a.map((function(t,a){return e("td",{children:r[t.accessor]},a)}))},t)}))})]})},g=o(["border-0 outline-none","p-1 flex","peer text-black placeholder:text-transparent"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitile4",lg:"p-4 typography-subtitile1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:"ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-2 focus:ring-inset focus:ring-input-active",underline:"border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"},hasClearIcon:{true:""}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",class:"focus:pe-6"},{hasClearIcon:!0,size:"md",class:"focus:pe-8"},{hasClearIcon:!0,size:"lg",class:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1}}),h=o(["absolute block transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background"],{variants:{size:{sm:["left-3 top-2 typography-small1 peer-focus:-top-1.5 peer-focus:typography-label2","bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label2"],md:["left-3 top-2 typography-subtitile4 peer-focus:-top-1.5 peer-focus:typography-label1","bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1"],lg:["left-4 top-4 typography-subtitile1 peer-focus:-top-1.5 peer-focus:typography-label1","bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1"]},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"},isFloating:{true:"-top-1.5 typography-label1 bg-input-label-background"}},compoundVariants:[{size:"sm",isFloating:!0,class:"-top-1.5 typography-label2 bg-input-label-background"}],defaultVariants:{size:"md",disabled:!1,error:!1,isFloating:!1}}),v=o(["text-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-text-disabled"},error:{true:"text-error",false:"text-input-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),m=o(["absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),y=o(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}});const x=n.forwardRef((function({title:e,titleId:r,...t},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?n.createElement("title",{id:r},e):null,n.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}));const w=n.forwardRef((function({title:e,titleId:r,...t},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?n.createElement("title",{id:r},e):null,n.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z",clipRule:"evenodd"}))}));var z=i((function(t,o){var n,i=t.id,d=t.label,p=t.size,b=void 0===p?"md":p,f=t.rounded,z=void 0===f?"normal":f,N=t.variant,k=void 0===N?"outline":N,I=t.type,O=void 0===I?"text":I,C=t.helperText,j=t.errorMessage,E=t.fullwidth,V=void 0!==E&&E,M=t.disabled,D=void 0!==M&&M,F=t.error,L=void 0!==F&&F,R=t.required,S=void 0===R||R,T=t.hasClearIcon,Z=void 0===T||T,P=u(t,["id","label","size","rounded","variant","type","helperText","errorMessage","fullwidth","disabled","error","required","hasClearIcon"]),A=l(null),H=i||"".concat(O,"-").concat(d,"-input"),q=g({size:b,rounded:z,variant:k,fullwidth:V,disabled:D,error:L,hasClearIcon:Z}),B=h({size:b,disabled:D,error:L,isFloating:null!==(n=!!P.value)&&void 0!==n&&n}),U=v({size:b,error:L,disabled:D}),Y=m({size:b}),G=y({size:b});s(o,(function(){return{clearInput:J}}));var J=function(){A.current&&(A.current.value="")};return r("div",{className:"flex flex-col ".concat(V?"w-full":""),children:[r("div",{className:"relative",children:[e("input",c({},P,{ref:A,type:O,id:H,disabled:D,className:a(q,P.className)})),Z&&e("div",{className:Y,children:e(w,{type:"button",className:G,onMouseDown:J})}),r("label",{htmlFor:H,className:B,children:[d," ",S&&e("span",{className:"text-error",children:"*"})]})]}),(j||C)&&r("span",{className:U,children:[e(x,{width:16,height:16,className:L?"fill-error":""})," ",j||C]})]})})),N=function(r){var t=r.variant,a=void 0===t?"body1":t,o=r.tag,n=void 0===o?"p":o,i=r.children,l=r.className,s=r.color,d=r.style;return e(n,{className:"typography-".concat(a," text-").concat(s," ").concat(l),style:d,children:i})},k=function(t){var a=t.tabs,o=t.initialTab,n=d(void 0===o?0:o),i=n[0],l=n[1];return r("div",{className:"tabs",children:[e("div",{className:"tab-buttons",children:a.map((function(r,t){return e("button",{className:t===i?"active":"",onClick:function(){return l(t)},children:r.label},t)}))}),e("div",{className:"tab-content",children:a[i].content})]})},I=function(e){return String(e).length>10?e/1e3:e},O=function(e){var r=new Date(e);return r.setHours(0,0,0,0),r},C=function(e){var r=new Date(e);return r.setHours(23,59,59,999),r},j=function(){var e=O(new Date);return{startTime:e,endTime:C(e)}},E=function(e){var r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());return I(r)};export{b as Button,f as Table,k as Tabs,N as Text,z as TextInput,C as getEndDateOfDay,O as getStartDateOfDay,j as getStartEndTimestampOfDay,E as getTimestampUTC,I as resloveTimestamp};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|