@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
package/dist/index.d.ts
CHANGED
|
@@ -24,15 +24,23 @@ interface TableProps {
|
|
|
24
24
|
}
|
|
25
25
|
declare const Table: React.FC<TableProps>;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
type InputProps = {
|
|
28
|
+
id?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
size?: "sm" | "md" | "lg";
|
|
31
|
+
rounded?: "none" | "normal" | "full";
|
|
32
|
+
variant?: "flat" | "outline" | "underline";
|
|
33
|
+
type?: React.HTMLInputTypeAttribute;
|
|
34
|
+
helperText?: string;
|
|
35
|
+
errorMessage?: string;
|
|
36
|
+
fullwidth?: boolean;
|
|
32
37
|
disabled?: boolean;
|
|
38
|
+
error?: boolean;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
hasClearIcon?: boolean;
|
|
33
41
|
className?: string;
|
|
34
|
-
}
|
|
35
|
-
declare const TextInput:
|
|
42
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
|
|
43
|
+
declare const TextInput: FC<InputProps>;
|
|
36
44
|
|
|
37
45
|
type TextProps = {
|
|
38
46
|
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitile1" | "subtitile2" | "subtitile3" | "subtitile4" | "subtitile5" | "subtitile6" | "body1" | "body2" | "body3" | "body4" | "small1" | "small2" | "small3" | "label1" | "label2";
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import "./theme/global.css";
|
|
4
4
|
export { default as Button } from "./components/Button/Button";
|
|
5
5
|
export { default as Table } from "./components/Table/Table";
|
|
6
|
-
export { default as TextInput } from "./components/
|
|
6
|
+
export { default as TextInput } from "./components/TextInput/TextInput";
|
|
7
7
|
export { default as Text } from "./components/Text/Text";
|
|
8
8
|
export { default as Tabs } from "./components/Tabs/Tabs";
|
|
9
9
|
// UTILS
|
|
@@ -652,9 +652,19 @@ video {
|
|
|
652
652
|
/* #CC3E2A */
|
|
653
653
|
--error-default: var(--error-100);
|
|
654
654
|
--error-foreground: var(--white);
|
|
655
|
+
/* Button */
|
|
655
656
|
--btn-rounded-sm: 10px;
|
|
656
657
|
--btn-rounded-md: 12px;
|
|
657
658
|
--btn-rounded-lg: 16px;
|
|
659
|
+
/* Input */
|
|
660
|
+
--input-default-text-color: 164 169 178;
|
|
661
|
+
--input-default-stroke-color: 231 231 231;
|
|
662
|
+
--input-active-text-color: 29 30 39;
|
|
663
|
+
--input-active-stroke-color: 208 208 208;
|
|
664
|
+
--input-disabled-text-color: 196 199 205;
|
|
665
|
+
--input-disabled-stroke-color: 239 239 239;
|
|
666
|
+
--input-disabled-background-color: 247 247 247;
|
|
667
|
+
--input-label-background-color: 249 251 255;
|
|
658
668
|
}
|
|
659
669
|
|
|
660
670
|
*, ::before, ::after {
|
|
@@ -769,6 +779,51 @@ video {
|
|
|
769
779
|
pointer-events: none;
|
|
770
780
|
}
|
|
771
781
|
|
|
782
|
+
.absolute {
|
|
783
|
+
position: absolute;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.relative {
|
|
787
|
+
position: relative;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.inset-y-0 {
|
|
791
|
+
top: 0px;
|
|
792
|
+
bottom: 0px;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.-top-1 {
|
|
796
|
+
top: -0.25rem;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.-top-1\.5 {
|
|
800
|
+
top: -0.375rem;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.left-3 {
|
|
804
|
+
left: 0.75rem;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.left-4 {
|
|
808
|
+
left: 1rem;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.right-0 {
|
|
812
|
+
right: 0px;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.top-2 {
|
|
816
|
+
top: 0.5rem;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
.top-4 {
|
|
820
|
+
top: 1rem;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.z-50 {
|
|
824
|
+
z-index: 50;
|
|
825
|
+
}
|
|
826
|
+
|
|
772
827
|
.mx-auto {
|
|
773
828
|
margin-left: auto;
|
|
774
829
|
margin-right: auto;
|
|
@@ -779,6 +834,30 @@ video {
|
|
|
779
834
|
margin-bottom: auto;
|
|
780
835
|
}
|
|
781
836
|
|
|
837
|
+
.mr-2 {
|
|
838
|
+
margin-right: 0.5rem;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.mr-3 {
|
|
842
|
+
margin-right: 0.75rem;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.mr-4 {
|
|
846
|
+
margin-right: 1rem;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.mt-1 {
|
|
850
|
+
margin-top: 0.25rem;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.mt-\[6px\] {
|
|
854
|
+
margin-top: 6px;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.block {
|
|
858
|
+
display: block;
|
|
859
|
+
}
|
|
860
|
+
|
|
782
861
|
.flex {
|
|
783
862
|
display: flex;
|
|
784
863
|
}
|
|
@@ -795,6 +874,25 @@ video {
|
|
|
795
874
|
display: grid;
|
|
796
875
|
}
|
|
797
876
|
|
|
877
|
+
.hidden {
|
|
878
|
+
display: none;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.size-3 {
|
|
882
|
+
width: 0.75rem;
|
|
883
|
+
height: 0.75rem;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.size-4 {
|
|
887
|
+
width: 1rem;
|
|
888
|
+
height: 1rem;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.size-5 {
|
|
892
|
+
width: 1.25rem;
|
|
893
|
+
height: 1.25rem;
|
|
894
|
+
}
|
|
895
|
+
|
|
798
896
|
.w-\[200px\] {
|
|
799
897
|
width: 200px;
|
|
800
898
|
}
|
|
@@ -811,6 +909,10 @@ video {
|
|
|
811
909
|
max-width: 48rem;
|
|
812
910
|
}
|
|
813
911
|
|
|
912
|
+
.cursor-pointer {
|
|
913
|
+
cursor: pointer;
|
|
914
|
+
}
|
|
915
|
+
|
|
814
916
|
.select-none {
|
|
815
917
|
-webkit-user-select: none;
|
|
816
918
|
-moz-user-select: none;
|
|
@@ -843,10 +945,18 @@ video {
|
|
|
843
945
|
justify-content: center;
|
|
844
946
|
}
|
|
845
947
|
|
|
948
|
+
.gap-1 {
|
|
949
|
+
gap: 0.25rem;
|
|
950
|
+
}
|
|
951
|
+
|
|
846
952
|
.gap-2 {
|
|
847
953
|
gap: 0.5rem;
|
|
848
954
|
}
|
|
849
955
|
|
|
956
|
+
.gap-4 {
|
|
957
|
+
gap: 1rem;
|
|
958
|
+
}
|
|
959
|
+
|
|
850
960
|
.gap-x-8 {
|
|
851
961
|
-moz-column-gap: 2rem;
|
|
852
962
|
column-gap: 2rem;
|
|
@@ -868,6 +978,10 @@ video {
|
|
|
868
978
|
white-space: nowrap;
|
|
869
979
|
}
|
|
870
980
|
|
|
981
|
+
.rounded {
|
|
982
|
+
border-radius: 0.25rem;
|
|
983
|
+
}
|
|
984
|
+
|
|
871
985
|
.rounded-\[--btn-rounded-lg\] {
|
|
872
986
|
border-radius: var(--btn-rounded-lg);
|
|
873
987
|
}
|
|
@@ -880,18 +994,38 @@ video {
|
|
|
880
994
|
border-radius: var(--btn-rounded-sm);
|
|
881
995
|
}
|
|
882
996
|
|
|
997
|
+
.rounded-full {
|
|
998
|
+
border-radius: 9999px;
|
|
999
|
+
}
|
|
1000
|
+
|
|
883
1001
|
.rounded-lg {
|
|
884
1002
|
border-radius: 0.5rem;
|
|
885
1003
|
}
|
|
886
1004
|
|
|
1005
|
+
.rounded-none {
|
|
1006
|
+
border-radius: 0px;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
887
1009
|
.rounded-sm {
|
|
888
1010
|
border-radius: 0.125rem;
|
|
889
1011
|
}
|
|
890
1012
|
|
|
1013
|
+
.rounded-xl {
|
|
1014
|
+
border-radius: 0.75rem;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
891
1017
|
.border {
|
|
892
1018
|
border-width: 1px;
|
|
893
1019
|
}
|
|
894
1020
|
|
|
1021
|
+
.border-0 {
|
|
1022
|
+
border-width: 0px;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.border-b-2 {
|
|
1026
|
+
border-bottom-width: 2px;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
895
1029
|
.border-error {
|
|
896
1030
|
--tw-border-opacity: 1;
|
|
897
1031
|
border-color: rgb(var(--error-100) / var(--tw-border-opacity));
|
|
@@ -902,6 +1036,11 @@ video {
|
|
|
902
1036
|
border-color: rgb(var(--info-default) / var(--tw-border-opacity));
|
|
903
1037
|
}
|
|
904
1038
|
|
|
1039
|
+
.border-input-stroke {
|
|
1040
|
+
--tw-border-opacity: 1;
|
|
1041
|
+
border-color: rgb(var(--input-default-stroke-color) / var(--tw-border-opacity));
|
|
1042
|
+
}
|
|
1043
|
+
|
|
905
1044
|
.border-primary {
|
|
906
1045
|
--tw-border-opacity: 1;
|
|
907
1046
|
border-color: rgb(var(--primary-default) / var(--tw-border-opacity));
|
|
@@ -941,6 +1080,11 @@ video {
|
|
|
941
1080
|
background-color: rgb(var(--info-default) / var(--tw-bg-opacity));
|
|
942
1081
|
}
|
|
943
1082
|
|
|
1083
|
+
.bg-input-label-background {
|
|
1084
|
+
--tw-bg-opacity: 1;
|
|
1085
|
+
background-color: rgb(var(--input-label-background-color) / var(--tw-bg-opacity));
|
|
1086
|
+
}
|
|
1087
|
+
|
|
944
1088
|
.bg-primary {
|
|
945
1089
|
--tw-bg-opacity: 1;
|
|
946
1090
|
background-color: rgb(var(--primary-default) / var(--tw-bg-opacity));
|
|
@@ -975,6 +1119,26 @@ video {
|
|
|
975
1119
|
background-color: rgb(var(--warning-default) / var(--tw-bg-opacity));
|
|
976
1120
|
}
|
|
977
1121
|
|
|
1122
|
+
.fill-error {
|
|
1123
|
+
fill: rgb(var(--error-100) / 1);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
.fill-input-stroke-active {
|
|
1127
|
+
fill: rgb(var(--input-active-stroke-color) / 1);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
.p-1 {
|
|
1131
|
+
padding: 0.25rem;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
.p-2 {
|
|
1135
|
+
padding: 0.5rem;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.p-4 {
|
|
1139
|
+
padding: 1rem;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
978
1142
|
.p-5 {
|
|
979
1143
|
padding: 1.25rem;
|
|
980
1144
|
}
|
|
@@ -994,6 +1158,11 @@ video {
|
|
|
994
1158
|
padding-right: 1.5rem;
|
|
995
1159
|
}
|
|
996
1160
|
|
|
1161
|
+
.px-\[2px\] {
|
|
1162
|
+
padding-left: 2px;
|
|
1163
|
+
padding-right: 2px;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
997
1166
|
.py-1 {
|
|
998
1167
|
padding-top: 0.25rem;
|
|
999
1168
|
padding-bottom: 0.25rem;
|
|
@@ -1169,6 +1338,11 @@ video {
|
|
|
1169
1338
|
letter-spacing: .02857em;
|
|
1170
1339
|
}
|
|
1171
1340
|
|
|
1341
|
+
.text-black {
|
|
1342
|
+
--tw-text-opacity: 1;
|
|
1343
|
+
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1172
1346
|
.text-error {
|
|
1173
1347
|
--tw-text-opacity: 1;
|
|
1174
1348
|
color: rgb(var(--error-100) / var(--tw-text-opacity));
|
|
@@ -1194,6 +1368,16 @@ video {
|
|
|
1194
1368
|
color: rgb(var(--info-foreground) / var(--tw-text-opacity));
|
|
1195
1369
|
}
|
|
1196
1370
|
|
|
1371
|
+
.text-input-text {
|
|
1372
|
+
--tw-text-opacity: 1;
|
|
1373
|
+
color: rgb(var(--input-default-text-color) / var(--tw-text-opacity));
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.text-input-text-disabled {
|
|
1377
|
+
--tw-text-opacity: 1;
|
|
1378
|
+
color: rgb(var(--input-disabled-text-color) / var(--tw-text-opacity));
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1197
1381
|
.text-primary {
|
|
1198
1382
|
--tw-text-opacity: 1;
|
|
1199
1383
|
color: rgb(var(--primary-default) / var(--tw-text-opacity));
|
|
@@ -1261,10 +1445,46 @@ video {
|
|
|
1261
1445
|
text-underline-offset: 4px;
|
|
1262
1446
|
}
|
|
1263
1447
|
|
|
1448
|
+
.outline-none {
|
|
1449
|
+
outline: 2px solid transparent;
|
|
1450
|
+
outline-offset: 2px;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1264
1453
|
.outline {
|
|
1265
1454
|
outline-style: solid;
|
|
1266
1455
|
}
|
|
1267
1456
|
|
|
1457
|
+
.ring-1 {
|
|
1458
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1459
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1460
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
.ring-inset {
|
|
1464
|
+
--tw-ring-inset: inset;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
.ring-error {
|
|
1468
|
+
--tw-ring-opacity: 1;
|
|
1469
|
+
--tw-ring-color: rgb(var(--error-100) / var(--tw-ring-opacity));
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.ring-input-stroke {
|
|
1473
|
+
--tw-ring-opacity: 1;
|
|
1474
|
+
--tw-ring-color: rgb(var(--input-default-stroke-color) / var(--tw-ring-opacity));
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
.ring-input-stroke-disabled {
|
|
1478
|
+
--tw-ring-opacity: 1;
|
|
1479
|
+
--tw-ring-color: rgb(var(--input-disabled-stroke-color) / var(--tw-ring-opacity));
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
.transition-all {
|
|
1483
|
+
transition-property: all;
|
|
1484
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1485
|
+
transition-duration: 150ms;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1268
1488
|
.transition-colors {
|
|
1269
1489
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
1270
1490
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -1405,11 +1625,34 @@ video {
|
|
|
1405
1625
|
font-weight: 400;
|
|
1406
1626
|
}
|
|
1407
1627
|
|
|
1628
|
+
.placeholder\:text-input-text-disabled::-moz-placeholder {
|
|
1629
|
+
--tw-text-opacity: 1;
|
|
1630
|
+
color: rgb(var(--input-disabled-text-color) / var(--tw-text-opacity));
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
.placeholder\:text-input-text-disabled::placeholder {
|
|
1634
|
+
--tw-text-opacity: 1;
|
|
1635
|
+
color: rgb(var(--input-disabled-text-color) / var(--tw-text-opacity));
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
.placeholder\:text-transparent::-moz-placeholder {
|
|
1639
|
+
color: transparent;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.placeholder\:text-transparent::placeholder {
|
|
1643
|
+
color: transparent;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1408
1646
|
.hover\:border-error-120:hover {
|
|
1409
1647
|
--tw-border-opacity: 1;
|
|
1410
1648
|
border-color: rgb(var(--error-120) / var(--tw-border-opacity));
|
|
1411
1649
|
}
|
|
1412
1650
|
|
|
1651
|
+
.hover\:border-input-stroke-active:hover {
|
|
1652
|
+
--tw-border-opacity: 1;
|
|
1653
|
+
border-color: rgb(var(--input-active-stroke-color) / var(--tw-border-opacity));
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1413
1656
|
.hover\:border-warning-100:hover {
|
|
1414
1657
|
--tw-border-opacity: 1;
|
|
1415
1658
|
border-color: rgb(var(--warning-100) / var(--tw-border-opacity));
|
|
@@ -1462,16 +1705,113 @@ video {
|
|
|
1462
1705
|
--tw-bg-opacity: 0.9;
|
|
1463
1706
|
}
|
|
1464
1707
|
|
|
1708
|
+
.hover\:fill-input-text:hover {
|
|
1709
|
+
fill: rgb(var(--input-default-text-color) / 1);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1465
1712
|
.hover\:text-opacity-80:hover {
|
|
1466
1713
|
--tw-text-opacity: 0.8;
|
|
1467
1714
|
}
|
|
1468
1715
|
|
|
1716
|
+
.focus\:border-input-stroke:focus {
|
|
1717
|
+
--tw-border-opacity: 1;
|
|
1718
|
+
border-color: rgb(var(--input-default-stroke-color) / var(--tw-border-opacity));
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
.focus\:pe-10:focus {
|
|
1722
|
+
padding-inline-end: 2.5rem;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
.focus\:pe-6:focus {
|
|
1726
|
+
padding-inline-end: 1.5rem;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
.focus\:pe-8:focus {
|
|
1730
|
+
padding-inline-end: 2rem;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
.focus\:ring-2:focus {
|
|
1734
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1735
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1736
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
.focus\:ring-inset:focus {
|
|
1740
|
+
--tw-ring-inset: inset;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1469
1743
|
.active\:scale-\[98\%\]:active {
|
|
1470
1744
|
--tw-scale-x: 98%;
|
|
1471
1745
|
--tw-scale-y: 98%;
|
|
1472
1746
|
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));
|
|
1473
1747
|
}
|
|
1474
1748
|
|
|
1749
|
+
.peer:focus ~ .peer-focus\:-top-1 {
|
|
1750
|
+
top: -0.25rem;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
.peer:focus ~ .peer-focus\:-top-1\.5 {
|
|
1754
|
+
top: -0.375rem;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.peer:focus ~ .peer-focus\:flex {
|
|
1758
|
+
display: flex;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
.peer:focus ~ .peer-focus\:bg-input-label-background {
|
|
1762
|
+
--tw-bg-opacity: 1;
|
|
1763
|
+
background-color: rgb(var(--input-label-background-color) / var(--tw-bg-opacity));
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.peer:focus ~ .peer-focus\:text-input-text-active {
|
|
1767
|
+
--tw-text-opacity: 1;
|
|
1768
|
+
color: rgb(var(--input-active-text-color) / var(--tw-text-opacity));
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
.peer:focus ~ .peer-focus\:typography-label1 {
|
|
1772
|
+
font-size: 12px;
|
|
1773
|
+
line-height: 12px;
|
|
1774
|
+
font-weight: 400;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
.peer:focus ~ .peer-focus\:typography-label2 {
|
|
1778
|
+
font-size: 10px;
|
|
1779
|
+
line-height: 10px;
|
|
1780
|
+
font-weight: 400;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
.peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:-top-1\.5 {
|
|
1784
|
+
top: -0.375rem;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
.peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:-top-1\.5 {
|
|
1788
|
+
top: -0.375rem;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
.peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:typography-label1 {
|
|
1792
|
+
font-size: 12px;
|
|
1793
|
+
line-height: 12px;
|
|
1794
|
+
font-weight: 400;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:typography-label1 {
|
|
1798
|
+
font-size: 12px;
|
|
1799
|
+
line-height: 12px;
|
|
1800
|
+
font-weight: 400;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
.peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:typography-label2 {
|
|
1804
|
+
font-size: 10px;
|
|
1805
|
+
line-height: 10px;
|
|
1806
|
+
font-weight: 400;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
.peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:typography-label2 {
|
|
1810
|
+
font-size: 10px;
|
|
1811
|
+
line-height: 10px;
|
|
1812
|
+
font-weight: 400;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1475
1815
|
.aria-disabled\:pointer-events-none[aria-disabled="true"] {
|
|
1476
1816
|
pointer-events: none;
|
|
1477
1817
|
}
|
|
@@ -1482,4 +1822,4 @@ video {
|
|
|
1482
1822
|
|
|
1483
1823
|
.aria-disabled\:opacity-50[aria-disabled="true"] {
|
|
1484
1824
|
opacity: 0.5;
|
|
1485
|
-
}
|
|
1825
|
+
}
|
package/dist/theme/global.css
CHANGED
|
@@ -128,9 +128,22 @@
|
|
|
128
128
|
--error-default: var(--error-100);
|
|
129
129
|
--error-foreground: var(--white);
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
/* Button */
|
|
132
132
|
--btn-rounded-sm: 10px;
|
|
133
133
|
--btn-rounded-md: 12px;
|
|
134
134
|
--btn-rounded-lg: 16px;
|
|
135
|
+
|
|
136
|
+
/* Input */
|
|
137
|
+
--input-default-text-color: 164 169 178;
|
|
138
|
+
--input-default-stroke-color: 231 231 231;
|
|
139
|
+
|
|
140
|
+
--input-active-text-color: 29 30 39;
|
|
141
|
+
--input-active-stroke-color: 208 208 208;
|
|
142
|
+
|
|
143
|
+
--input-disabled-text-color: 196 199 205;
|
|
144
|
+
--input-disabled-stroke-color: 239 239 239;
|
|
145
|
+
--input-disabled-background-color: 247 247 247;
|
|
146
|
+
|
|
147
|
+
--input-label-background-color: 249 251 255;
|
|
135
148
|
}
|
|
136
|
-
}
|
|
149
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
const { DEFAULTS } = require("@rollup/plugin-node-resolve");
|
|
2
|
+
|
|
1
3
|
/** @type {import('tailwindcss').Config} */
|
|
2
4
|
module.exports = {
|
|
3
5
|
theme: {
|
|
4
6
|
extend: {
|
|
5
7
|
colors: {
|
|
8
|
+
// Palette colors
|
|
6
9
|
themes: {
|
|
7
10
|
50: "rgb(var(--themes-50) / <alpha-value>)",
|
|
8
11
|
100: "rgb(var(--themes-100) / <alpha-value>)",
|
|
@@ -134,6 +137,29 @@ module.exports = {
|
|
|
134
137
|
DEFAULT: "rgb(var(--error-100) / <alpha-value>)",
|
|
135
138
|
foreground: "rgb(var(--error-foreground) / <alpha-value>)",
|
|
136
139
|
},
|
|
140
|
+
// Component color
|
|
141
|
+
input: {
|
|
142
|
+
text: {
|
|
143
|
+
DEFAULT: "rgb(var(--input-default-text-color) / <alpha-value>)",
|
|
144
|
+
active: "rgb(var(--input-active-text-color) / <alpha-value>)",
|
|
145
|
+
disabled: "rgb(var(--input-disabled-text-color) / <alpha-value>)",
|
|
146
|
+
},
|
|
147
|
+
stroke: {
|
|
148
|
+
DEFAULT: "rgb(var(--input-default-stroke-color) / <alpha-value>)",
|
|
149
|
+
active: "rgb(var(--input-active-stroke-color) / <alpha-value>)",
|
|
150
|
+
disabled: "rgb(var(--input-disabled-stroke-color) / <alpha-value>)",
|
|
151
|
+
},
|
|
152
|
+
background: {
|
|
153
|
+
DEFAULT: "transparent",
|
|
154
|
+
active: "transparent",
|
|
155
|
+
disabled:
|
|
156
|
+
"rgb(var(--input-disabled-background-color) / <alpha-value>)",
|
|
157
|
+
},
|
|
158
|
+
label: {
|
|
159
|
+
background:
|
|
160
|
+
"rgb(var(--input-label-background-color) / <alpha-value>)",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
137
163
|
},
|
|
138
164
|
},
|
|
139
165
|
},
|
package/package.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import TextInput from "./TextInput";
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/TextInput",
|
|
8
|
+
component: TextInput,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
|
|
12
|
+
layout: "fullscreen",
|
|
13
|
+
},
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<div className="p-5 flex w-full">
|
|
17
|
+
<Story />
|
|
18
|
+
</div>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
} satisfies Meta<typeof TextInput>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {
|
|
27
|
+
label: "Lorem Ipsum",
|
|
28
|
+
// value: "Lorem Ipsum",
|
|
29
|
+
fullwidth: true,
|
|
30
|
+
},
|
|
31
|
+
render: (args) => {
|
|
32
|
+
console.log("args ", args);
|
|
33
|
+
const props: typeof args = {
|
|
34
|
+
...args,
|
|
35
|
+
};
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex flex-row gap-4 w-full">
|
|
38
|
+
<TextInput id="1" placeholder="placeholder" size="lg" {...args} />
|
|
39
|
+
<TextInput id="2" placeholder="placeholder" size="md" {...args} />
|
|
40
|
+
<TextInput id="3" placeholder="placeholder" size="sm" {...args} />
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
} satisfies StoryObj;
|