@rovula/ui 0.0.17 → 0.0.18
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 +152 -0
- package/dist/cjs/bundle.js +3 -3
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/AlertDialog/Alert.stories.d.ts +1 -1
- package/dist/cjs/types/components/Calendar/Calendar.d.ts +8 -0
- package/dist/cjs/types/components/Calendar/Calendar.stories.d.ts +272 -0
- package/dist/cjs/types/components/Calendar/index.d.ts +1 -0
- package/dist/cjs/types/components/DatePicker/DatePicker.d.ts +8 -0
- package/dist/cjs/types/components/DatePicker/DatePicker.stories.d.ts +21 -0
- package/dist/cjs/types/components/Popover/Popover.d.ts +6 -0
- package/dist/cjs/types/components/Popover/Popover.stories.d.ts +21 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +7 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +5 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/components/Calendar/Calendar.js +43 -0
- package/dist/components/Calendar/Calendar.stories.js +36 -0
- package/dist/components/Calendar/index.js +1 -0
- package/dist/components/DatePicker/DatePicker.js +22 -0
- package/dist/components/DatePicker/DatePicker.stories.js +36 -0
- package/dist/components/Popover/Popover.js +35 -0
- package/dist/components/Popover/Popover.stories.js +33 -0
- package/dist/components/TextInput/TextInput.js +9 -3
- package/dist/components/TextInput/TextInput.stories.js +12 -0
- package/dist/components/TextInput/TextInput.styles.js +41 -0
- package/dist/esm/bundle.css +152 -0
- package/dist/esm/bundle.js +3 -3
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/AlertDialog/Alert.stories.d.ts +1 -1
- package/dist/esm/types/components/Calendar/Calendar.d.ts +8 -0
- package/dist/esm/types/components/Calendar/Calendar.stories.d.ts +272 -0
- package/dist/esm/types/components/Calendar/index.d.ts +1 -0
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +8 -0
- package/dist/esm/types/components/DatePicker/DatePicker.stories.d.ts +21 -0
- package/dist/esm/types/components/Popover/Popover.d.ts +6 -0
- package/dist/esm/types/components/Popover/Popover.stories.d.ts +21 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +7 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +5 -0
- package/dist/esm/types/index.d.ts +3 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.js +3 -0
- package/dist/src/theme/global.css +192 -0
- package/package.json +5 -2
- package/src/components/Calendar/Calendar.stories.tsx +45 -0
- package/src/components/Calendar/Calendar.tsx +66 -0
- package/src/components/Calendar/index.ts +1 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +40 -0
- package/src/components/DatePicker/DatePicker.tsx +57 -0
- package/src/components/Popover/Popover.stories.tsx +40 -0
- package/src/components/Popover/Popover.tsx +31 -0
- package/src/components/TextInput/TextInput.stories.tsx +36 -0
- package/src/components/TextInput/TextInput.styles.ts +45 -0
- package/src/components/TextInput/TextInput.tsx +13 -3
- package/src/index.ts +7 -0
|
@@ -873,6 +873,10 @@ body {
|
|
|
873
873
|
pointer-events: none;
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
+
.invisible {
|
|
877
|
+
visibility: hidden;
|
|
878
|
+
}
|
|
879
|
+
|
|
876
880
|
.static {
|
|
877
881
|
position: static;
|
|
878
882
|
}
|
|
@@ -910,6 +914,10 @@ body {
|
|
|
910
914
|
top: -0.375rem;
|
|
911
915
|
}
|
|
912
916
|
|
|
917
|
+
.left-1 {
|
|
918
|
+
left: 0.25rem;
|
|
919
|
+
}
|
|
920
|
+
|
|
913
921
|
.left-3 {
|
|
914
922
|
left: 0.75rem;
|
|
915
923
|
}
|
|
@@ -926,6 +934,10 @@ body {
|
|
|
926
934
|
right: 0px;
|
|
927
935
|
}
|
|
928
936
|
|
|
937
|
+
.right-1 {
|
|
938
|
+
right: 0.25rem;
|
|
939
|
+
}
|
|
940
|
+
|
|
929
941
|
.right-4 {
|
|
930
942
|
right: 1rem;
|
|
931
943
|
}
|
|
@@ -1032,6 +1044,11 @@ body {
|
|
|
1032
1044
|
aspect-ratio: 1 / 1;
|
|
1033
1045
|
}
|
|
1034
1046
|
|
|
1047
|
+
.size-14 {
|
|
1048
|
+
width: 3.5rem;
|
|
1049
|
+
height: 3.5rem;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1035
1052
|
.size-2 {
|
|
1036
1053
|
width: 0.5rem;
|
|
1037
1054
|
height: 0.5rem;
|
|
@@ -1072,6 +1089,16 @@ body {
|
|
|
1072
1089
|
height: 14px;
|
|
1073
1090
|
}
|
|
1074
1091
|
|
|
1092
|
+
.size-\[30px\] {
|
|
1093
|
+
width: 30px;
|
|
1094
|
+
height: 30px;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
.size-\[38px\] {
|
|
1098
|
+
width: 38px;
|
|
1099
|
+
height: 38px;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1075
1102
|
.size-full {
|
|
1076
1103
|
width: 100%;
|
|
1077
1104
|
height: 100%;
|
|
@@ -1089,6 +1116,10 @@ body {
|
|
|
1089
1116
|
height: 1rem;
|
|
1090
1117
|
}
|
|
1091
1118
|
|
|
1119
|
+
.h-9 {
|
|
1120
|
+
height: 2.25rem;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1092
1123
|
.h-\[18px\] {
|
|
1093
1124
|
height: 18px;
|
|
1094
1125
|
}
|
|
@@ -1162,10 +1193,18 @@ body {
|
|
|
1162
1193
|
width: 1rem;
|
|
1163
1194
|
}
|
|
1164
1195
|
|
|
1196
|
+
.w-72 {
|
|
1197
|
+
width: 18rem;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1165
1200
|
.w-8 {
|
|
1166
1201
|
width: 2rem;
|
|
1167
1202
|
}
|
|
1168
1203
|
|
|
1204
|
+
.w-9 {
|
|
1205
|
+
width: 2.25rem;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1169
1208
|
.w-\[100px\] {
|
|
1170
1209
|
width: 100px;
|
|
1171
1210
|
}
|
|
@@ -1381,12 +1420,24 @@ body {
|
|
|
1381
1420
|
margin-left: calc(-0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
1382
1421
|
}
|
|
1383
1422
|
|
|
1423
|
+
.space-x-1 > :not([hidden]) ~ :not([hidden]) {
|
|
1424
|
+
--tw-space-x-reverse: 0;
|
|
1425
|
+
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
|
|
1426
|
+
margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse)));
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1384
1429
|
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
|
|
1385
1430
|
--tw-space-x-reverse: 0;
|
|
1386
1431
|
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
1387
1432
|
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
1388
1433
|
}
|
|
1389
1434
|
|
|
1435
|
+
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
|
|
1436
|
+
--tw-space-y-reverse: 0;
|
|
1437
|
+
margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
|
|
1438
|
+
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1390
1441
|
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
|
|
1391
1442
|
--tw-space-y-reverse: 0;
|
|
1392
1443
|
margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -1473,6 +1524,21 @@ body {
|
|
|
1473
1524
|
border-radius: 0.75rem;
|
|
1474
1525
|
}
|
|
1475
1526
|
|
|
1527
|
+
.rounded-r-full {
|
|
1528
|
+
border-top-right-radius: 9999px;
|
|
1529
|
+
border-bottom-right-radius: 9999px;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.rounded-r-none {
|
|
1533
|
+
border-top-right-radius: 0px;
|
|
1534
|
+
border-bottom-right-radius: 0px;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.rounded-r-xl {
|
|
1538
|
+
border-top-right-radius: 0.75rem;
|
|
1539
|
+
border-bottom-right-radius: 0.75rem;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1476
1542
|
.border {
|
|
1477
1543
|
border-width: 1px;
|
|
1478
1544
|
}
|
|
@@ -1493,6 +1559,10 @@ body {
|
|
|
1493
1559
|
border-bottom-width: 3px;
|
|
1494
1560
|
}
|
|
1495
1561
|
|
|
1562
|
+
.border-l {
|
|
1563
|
+
border-left-width: 1px;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1496
1566
|
.border-t {
|
|
1497
1567
|
border-top-width: 1px;
|
|
1498
1568
|
}
|
|
@@ -1586,6 +1656,11 @@ body {
|
|
|
1586
1656
|
border-bottom-color: rgb(var(--navbar-border-color));
|
|
1587
1657
|
}
|
|
1588
1658
|
|
|
1659
|
+
.border-l-input-stroke {
|
|
1660
|
+
--tw-border-opacity: 1;
|
|
1661
|
+
border-left-color: rgb(var(--input-default-stroke-color) / var(--tw-border-opacity));
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1589
1664
|
.bg-\[rgb\(var\(--navbar-bg-color\)\)\] {
|
|
1590
1665
|
background-color: rgb(var(--navbar-bg-color));
|
|
1591
1666
|
}
|
|
@@ -1746,6 +1821,10 @@ body {
|
|
|
1746
1821
|
fill: rgb(var(--text-default-medium) / 1);
|
|
1747
1822
|
}
|
|
1748
1823
|
|
|
1824
|
+
.p-0 {
|
|
1825
|
+
padding: 0px;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1749
1828
|
.p-1 {
|
|
1750
1829
|
padding: 0.25rem;
|
|
1751
1830
|
}
|
|
@@ -1758,6 +1837,10 @@ body {
|
|
|
1758
1837
|
padding: 5rem;
|
|
1759
1838
|
}
|
|
1760
1839
|
|
|
1840
|
+
.p-3 {
|
|
1841
|
+
padding: 0.75rem;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1761
1844
|
.p-4 {
|
|
1762
1845
|
padding: 1rem;
|
|
1763
1846
|
}
|
|
@@ -1852,14 +1935,30 @@ body {
|
|
|
1852
1935
|
padding-inline-end: 30px;
|
|
1853
1936
|
}
|
|
1854
1937
|
|
|
1938
|
+
.pe-\[38px\] {
|
|
1939
|
+
padding-inline-end: 38px;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1855
1942
|
.pe-\[40px\] {
|
|
1856
1943
|
padding-inline-end: 40px;
|
|
1857
1944
|
}
|
|
1858
1945
|
|
|
1946
|
+
.pe-\[46px\] {
|
|
1947
|
+
padding-inline-end: 46px;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1859
1950
|
.pe-\[48px\] {
|
|
1860
1951
|
padding-inline-end: 48px;
|
|
1861
1952
|
}
|
|
1862
1953
|
|
|
1954
|
+
.pe-\[72px\] {
|
|
1955
|
+
padding-inline-end: 72px;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.pt-1 {
|
|
1959
|
+
padding-top: 0.25rem;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1863
1962
|
.text-left {
|
|
1864
1963
|
text-align: left;
|
|
1865
1964
|
}
|
|
@@ -1880,6 +1979,10 @@ body {
|
|
|
1880
1979
|
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
1881
1980
|
}
|
|
1882
1981
|
|
|
1982
|
+
.text-\[0\.8rem\] {
|
|
1983
|
+
font-size: 0.8rem;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1883
1986
|
.text-base {
|
|
1884
1987
|
font-size: 1rem;
|
|
1885
1988
|
line-height: 1.5rem;
|
|
@@ -2029,6 +2132,10 @@ body {
|
|
|
2029
2132
|
font-weight: 500;
|
|
2030
2133
|
}
|
|
2031
2134
|
|
|
2135
|
+
.font-normal {
|
|
2136
|
+
font-weight: 400;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2032
2139
|
.capitalize {
|
|
2033
2140
|
text-transform: capitalize;
|
|
2034
2141
|
}
|
|
@@ -2204,6 +2311,10 @@ body {
|
|
|
2204
2311
|
text-underline-offset: 4px;
|
|
2205
2312
|
}
|
|
2206
2313
|
|
|
2314
|
+
.opacity-50 {
|
|
2315
|
+
opacity: 0.5;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2207
2318
|
.opacity-70 {
|
|
2208
2319
|
opacity: 0.7;
|
|
2209
2320
|
}
|
|
@@ -2463,6 +2574,14 @@ body {
|
|
|
2463
2574
|
color: transparent;
|
|
2464
2575
|
}
|
|
2465
2576
|
|
|
2577
|
+
.focus-within\:relative:focus-within {
|
|
2578
|
+
position: relative;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
.focus-within\:z-20:focus-within {
|
|
2582
|
+
z-index: 20;
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2466
2585
|
.hover\:border-error-120:hover {
|
|
2467
2586
|
--tw-border-opacity: 1;
|
|
2468
2587
|
border-color: rgb(var(--error-120) / var(--tw-border-opacity));
|
|
@@ -2506,6 +2625,11 @@ body {
|
|
|
2506
2625
|
background-color: rgb(var(--main-transparent-secondary) / 0.8);
|
|
2507
2626
|
}
|
|
2508
2627
|
|
|
2628
|
+
.hover\:bg-primary:hover {
|
|
2629
|
+
--tw-bg-opacity: 1;
|
|
2630
|
+
background-color: rgb(var(--primary-default) / var(--tw-bg-opacity));
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2509
2633
|
.hover\:bg-primary-100:hover {
|
|
2510
2634
|
--tw-bg-opacity: 1;
|
|
2511
2635
|
background-color: rgb(var(--primary-100) / var(--tw-bg-opacity));
|
|
@@ -2566,6 +2690,11 @@ body {
|
|
|
2566
2690
|
color: rgb(var(--primary-default) / var(--tw-text-opacity));
|
|
2567
2691
|
}
|
|
2568
2692
|
|
|
2693
|
+
.hover\:text-primary-foreground:hover {
|
|
2694
|
+
--tw-text-opacity: 1;
|
|
2695
|
+
color: rgb(var(--primary-foreground) / var(--tw-text-opacity));
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2569
2698
|
.hover\:text-secondary-5:hover {
|
|
2570
2699
|
--tw-text-opacity: 1;
|
|
2571
2700
|
color: rgb(var(--secondary-5) / var(--tw-text-opacity));
|
|
@@ -2589,6 +2718,11 @@ body {
|
|
|
2589
2718
|
border-color: rgb(var(--input-default-stroke-color) / var(--tw-border-opacity));
|
|
2590
2719
|
}
|
|
2591
2720
|
|
|
2721
|
+
.focus\:bg-primary:focus {
|
|
2722
|
+
--tw-bg-opacity: 1;
|
|
2723
|
+
background-color: rgb(var(--primary-default) / var(--tw-bg-opacity));
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2592
2726
|
.focus\:pe-10:focus {
|
|
2593
2727
|
padding-inline-end: 2.5rem;
|
|
2594
2728
|
}
|
|
@@ -2601,6 +2735,11 @@ body {
|
|
|
2601
2735
|
padding-inline-end: 2rem;
|
|
2602
2736
|
}
|
|
2603
2737
|
|
|
2738
|
+
.focus\:text-primary-foreground:focus {
|
|
2739
|
+
--tw-text-opacity: 1;
|
|
2740
|
+
color: rgb(var(--primary-foreground) / var(--tw-text-opacity));
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2604
2743
|
.focus\:outline-none:focus {
|
|
2605
2744
|
outline: 2px solid transparent;
|
|
2606
2745
|
outline-offset: 2px;
|
|
@@ -2757,6 +2896,10 @@ body {
|
|
|
2757
2896
|
font-weight: 400;
|
|
2758
2897
|
}
|
|
2759
2898
|
|
|
2899
|
+
.peer:hover ~ .peer-hover\:fill-input-text-active {
|
|
2900
|
+
fill: rgb(var(--input-active-text-color) / 1);
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2760
2903
|
.peer:focus ~ .peer-focus\:-top-1 {
|
|
2761
2904
|
top: -0.25rem;
|
|
2762
2905
|
}
|
|
@@ -2769,6 +2912,11 @@ body {
|
|
|
2769
2912
|
display: flex;
|
|
2770
2913
|
}
|
|
2771
2914
|
|
|
2915
|
+
.peer:focus ~ .peer-focus\:border-l-input-stroke-active {
|
|
2916
|
+
--tw-border-opacity: 1;
|
|
2917
|
+
border-left-color: rgb(var(--input-active-stroke-color) / var(--tw-border-opacity));
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2772
2920
|
.peer:focus ~ .peer-focus\:bg-input-label-background {
|
|
2773
2921
|
--tw-bg-opacity: 1;
|
|
2774
2922
|
background-color: rgb(var(--input-label-background-color) / var(--tw-bg-opacity));
|
|
@@ -2779,6 +2927,10 @@ body {
|
|
|
2779
2927
|
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
|
|
2780
2928
|
}
|
|
2781
2929
|
|
|
2930
|
+
.peer:focus ~ .peer-focus\:fill-input-text-active {
|
|
2931
|
+
fill: rgb(var(--input-active-text-color) / 1);
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2782
2934
|
.peer:focus ~ .peer-focus\:text-input-text-active {
|
|
2783
2935
|
--tw-text-opacity: 1;
|
|
2784
2936
|
color: rgb(var(--input-active-text-color) / var(--tw-text-opacity));
|
|
@@ -2800,6 +2952,11 @@ body {
|
|
|
2800
2952
|
cursor: not-allowed;
|
|
2801
2953
|
}
|
|
2802
2954
|
|
|
2955
|
+
.peer:disabled ~ .peer-disabled\:border-l-input-stroke-disabled {
|
|
2956
|
+
--tw-border-opacity: 1;
|
|
2957
|
+
border-left-color: rgb(var(--input-disabled-stroke-color) / var(--tw-border-opacity));
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2803
2960
|
.peer:disabled ~ .peer-disabled\:opacity-70 {
|
|
2804
2961
|
opacity: 0.7;
|
|
2805
2962
|
}
|
|
@@ -2816,6 +2973,14 @@ body {
|
|
|
2816
2973
|
opacity: 0.5;
|
|
2817
2974
|
}
|
|
2818
2975
|
|
|
2976
|
+
.aria-selected\:opacity-100[aria-selected="true"] {
|
|
2977
|
+
opacity: 1;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
.aria-selected\:opacity-30[aria-selected="true"] {
|
|
2981
|
+
opacity: 0.3;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2819
2984
|
.data-\[state\=checked\]\:border-primary[data-state=checked] {
|
|
2820
2985
|
--tw-border-opacity: 1;
|
|
2821
2986
|
border-color: rgb(var(--primary-default) / var(--tw-border-opacity));
|
|
@@ -2859,6 +3024,18 @@ body {
|
|
|
2859
3024
|
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
2860
3025
|
}
|
|
2861
3026
|
|
|
3027
|
+
.sm\:space-x-4 > :not([hidden]) ~ :not([hidden]) {
|
|
3028
|
+
--tw-space-x-reverse: 0;
|
|
3029
|
+
margin-right: calc(1rem * var(--tw-space-x-reverse));
|
|
3030
|
+
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3033
|
+
.sm\:space-y-0 > :not([hidden]) ~ :not([hidden]) {
|
|
3034
|
+
--tw-space-y-reverse: 0;
|
|
3035
|
+
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
|
|
3036
|
+
margin-bottom: calc(0px * var(--tw-space-y-reverse));
|
|
3037
|
+
}
|
|
3038
|
+
|
|
2862
3039
|
.sm\:rounded-\[var\(--popup-rounded\)\] {
|
|
2863
3040
|
border-radius: var(--popup-rounded);
|
|
2864
3041
|
}
|
|
@@ -2868,6 +3045,21 @@ body {
|
|
|
2868
3045
|
}
|
|
2869
3046
|
}
|
|
2870
3047
|
|
|
3048
|
+
.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child {
|
|
3049
|
+
border-top-left-radius: calc(var(--radius) - 2px);
|
|
3050
|
+
border-bottom-left-radius: calc(var(--radius) - 2px);
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child {
|
|
3054
|
+
border-top-right-radius: calc(var(--radius) - 2px);
|
|
3055
|
+
border-bottom-right-radius: calc(var(--radius) - 2px);
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end) {
|
|
3059
|
+
border-top-right-radius: calc(var(--radius) - 2px);
|
|
3060
|
+
border-bottom-right-radius: calc(var(--radius) - 2px);
|
|
3061
|
+
}
|
|
3062
|
+
|
|
2871
3063
|
.\[\&\:has\(\[role\=checkbox\]\)\]\:w-4:has([role=checkbox]) {
|
|
2872
3064
|
width: 1rem;
|
|
2873
3065
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rovula/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"main": "dist/cjs/bundle.js",
|
|
5
5
|
"module": "dist/esm/bundle.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -73,15 +73,18 @@
|
|
|
73
73
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
74
74
|
"@radix-ui/react-dialog": "^1.0.5",
|
|
75
75
|
"@radix-ui/react-label": "^2.0.2",
|
|
76
|
+
"@radix-ui/react-popover": "^1.1.1",
|
|
76
77
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
77
|
-
"@radix-ui/react-slot": "^1.0
|
|
78
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
78
79
|
"@tanstack/react-table": "^8.17.3",
|
|
79
80
|
"@tanstack/react-virtual": "^3.5.0",
|
|
80
81
|
"@types/react": "^18.3.2",
|
|
81
82
|
"axios": "^1.6.4",
|
|
82
83
|
"class-variance-authority": "^0.7.0",
|
|
83
84
|
"clsx": "^2.1.1",
|
|
85
|
+
"date-fns": "^3.6.0",
|
|
84
86
|
"react": "^17.0.0 || ^18.0.0",
|
|
87
|
+
"react-day-picker": "^8.10.1",
|
|
85
88
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
86
89
|
"tailwind-merge": "^2.3.0",
|
|
87
90
|
"tailwindcss-animate": "^1.0.7",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import Calendar from "./Calendar";
|
|
4
|
+
|
|
5
|
+
// import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Components/Calendar",
|
|
9
|
+
component: Calendar,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
parameters: {
|
|
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 Calendar>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {},
|
|
27
|
+
render: (args) => {
|
|
28
|
+
console.log("args ", args);
|
|
29
|
+
const props: typeof args = {
|
|
30
|
+
...args,
|
|
31
|
+
};
|
|
32
|
+
const [date, setDate] = React.useState<Date | undefined>(new Date());
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="flex flex-row gap-4 w-full">
|
|
36
|
+
<Calendar
|
|
37
|
+
mode="single"
|
|
38
|
+
selected={date}
|
|
39
|
+
onSelect={setDate}
|
|
40
|
+
className="rounded-md border"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
} satisfies StoryObj;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/16/solid";
|
|
5
|
+
import { DayPicker } from "react-day-picker";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/utils/cn";
|
|
8
|
+
import { buttonVariants } from "../Button/Button.styles";
|
|
9
|
+
|
|
10
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
11
|
+
|
|
12
|
+
function Calendar({
|
|
13
|
+
className,
|
|
14
|
+
classNames,
|
|
15
|
+
showOutsideDays = true,
|
|
16
|
+
...props
|
|
17
|
+
}: CalendarProps) {
|
|
18
|
+
return (
|
|
19
|
+
<DayPicker
|
|
20
|
+
showOutsideDays={showOutsideDays}
|
|
21
|
+
className={cn("p-3", className)}
|
|
22
|
+
classNames={{
|
|
23
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
24
|
+
month: "space-y-4",
|
|
25
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
26
|
+
caption_label: "text-sm font-medium",
|
|
27
|
+
nav: "space-x-1 flex items-center",
|
|
28
|
+
nav_button: cn(
|
|
29
|
+
buttonVariants({ variant: "outline" }),
|
|
30
|
+
"flex items-center justify-center size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
31
|
+
),
|
|
32
|
+
nav_button_previous: "absolute left-1",
|
|
33
|
+
nav_button_next: "absolute right-1",
|
|
34
|
+
table: "w-full border-collapse space-y-1",
|
|
35
|
+
head_row: "flex",
|
|
36
|
+
head_cell:
|
|
37
|
+
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
38
|
+
row: "flex w-full mt-2",
|
|
39
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
40
|
+
day: cn(
|
|
41
|
+
buttonVariants({ variant: "flat" }),
|
|
42
|
+
"size-7 p-0 font-normal aria-selected:opacity-100"
|
|
43
|
+
),
|
|
44
|
+
day_range_end: "day-range-end",
|
|
45
|
+
day_selected:
|
|
46
|
+
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
47
|
+
day_today: "bg-accent text-accent-foreground",
|
|
48
|
+
day_outside:
|
|
49
|
+
"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
50
|
+
day_disabled: "text-muted-foreground opacity-50",
|
|
51
|
+
day_range_middle:
|
|
52
|
+
"aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
53
|
+
day_hidden: "invisible",
|
|
54
|
+
...classNames,
|
|
55
|
+
}}
|
|
56
|
+
components={{
|
|
57
|
+
IconLeft: ({ ...props }) => <ChevronLeftIcon className="h-4 w-4" />,
|
|
58
|
+
IconRight: ({ ...props }) => <ChevronRightIcon className="h-4 w-4" />,
|
|
59
|
+
}}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
Calendar.displayName = "Calendar";
|
|
65
|
+
|
|
66
|
+
export default Calendar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Calendar } from "./Calendar";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import DatePicker from "./DatePicker";
|
|
4
|
+
|
|
5
|
+
// import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Components/DatePicker",
|
|
9
|
+
component: DatePicker,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
parameters: {
|
|
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 DatePicker>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {},
|
|
27
|
+
render: (args) => {
|
|
28
|
+
console.log("args ", args);
|
|
29
|
+
const props: typeof args = {
|
|
30
|
+
...args,
|
|
31
|
+
};
|
|
32
|
+
const [date, setDate] = React.useState<Date | undefined>(undefined);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="flex flex-row gap-4 w-full">
|
|
36
|
+
<DatePicker date={date} onSelect={setDate} />
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
} satisfies StoryObj;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { FC, useState } from "react";
|
|
4
|
+
import { CalendarIcon } from "@heroicons/react/16/solid";
|
|
5
|
+
|
|
6
|
+
import { Calendar } from "../Calendar";
|
|
7
|
+
import Button from "../Button/Button";
|
|
8
|
+
import { cn } from "@/utils/cn";
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../Popover/Popover";
|
|
10
|
+
import { SelectSingleEventHandler } from "react-day-picker";
|
|
11
|
+
import { TextInput } from "../TextInput/TextInput";
|
|
12
|
+
import { format } from "date-fns/format";
|
|
13
|
+
|
|
14
|
+
type DatePickerProps = {
|
|
15
|
+
date: Date | undefined;
|
|
16
|
+
onSelect: SelectSingleEventHandler;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
CalendarIcon;
|
|
20
|
+
|
|
21
|
+
const DatePicker: FC<DatePickerProps> = ({ date, onSelect }) => {
|
|
22
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div>
|
|
26
|
+
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
|
27
|
+
<PopoverTrigger asChild>
|
|
28
|
+
<div className="flex">
|
|
29
|
+
<TextInput
|
|
30
|
+
fullwidth
|
|
31
|
+
id="2"
|
|
32
|
+
readOnly
|
|
33
|
+
label="Date"
|
|
34
|
+
size="md"
|
|
35
|
+
value={date ? format(date, "dd MMM yyyy") : isOpen ? " " : ""}
|
|
36
|
+
hasClearIcon={false}
|
|
37
|
+
endIcon={<CalendarIcon fill="inherit" />}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</PopoverTrigger>
|
|
41
|
+
<PopoverContent className="w-auto p-0">
|
|
42
|
+
<Calendar
|
|
43
|
+
mode="single"
|
|
44
|
+
selected={date}
|
|
45
|
+
onSelect={(...value) => {
|
|
46
|
+
onSelect?.(...value);
|
|
47
|
+
setIsOpen(false);
|
|
48
|
+
}}
|
|
49
|
+
initialFocus
|
|
50
|
+
/>
|
|
51
|
+
</PopoverContent>
|
|
52
|
+
</Popover>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default DatePicker;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Popver",
|
|
8
|
+
component: Popover,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "fullscreen",
|
|
12
|
+
},
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<div className="p-5 flex w-full">
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
} satisfies Meta<typeof Popover>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {},
|
|
26
|
+
render: (args) => {
|
|
27
|
+
console.log("args ", args);
|
|
28
|
+
const props: typeof args = {
|
|
29
|
+
...args,
|
|
30
|
+
};
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex flex-row gap-4 w-full">
|
|
33
|
+
<Popover>
|
|
34
|
+
<PopoverTrigger>Open</PopoverTrigger>
|
|
35
|
+
<PopoverContent>Place content for the popover here.</PopoverContent>
|
|
36
|
+
</Popover>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
} satisfies StoryObj;
|