@tapcart/mobile-components 0.6.1 → 0.6.3
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/components/hooks/use-click-outside.d.ts +8 -0
- package/dist/components/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/components/hooks/use-click-outside.js +46 -0
- package/dist/components/hooks/use-collection.d.ts +25 -0
- package/dist/components/hooks/use-collection.d.ts.map +1 -0
- package/dist/components/hooks/use-collection.js +74 -0
- package/dist/components/hooks/use-products.d.ts +3 -2
- package/dist/components/hooks/use-products.d.ts.map +1 -1
- package/dist/components/hooks/use-products.js +12 -3
- package/dist/components/hooks/use-pull-to-refresh.d.ts +9 -0
- package/dist/components/hooks/use-pull-to-refresh.d.ts.map +1 -0
- package/dist/components/hooks/use-pull-to-refresh.js +88 -0
- package/dist/components/ui/accordion.d.ts +3 -1
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +7 -2
- package/dist/components/ui/chip.d.ts +2 -2
- package/dist/components/ui/chip.js +1 -1
- package/dist/components/ui/favorite/favorite.d.ts +16 -0
- package/dist/components/ui/favorite/favorite.d.ts.map +1 -0
- package/dist/components/ui/favorite/favorite.js +156 -0
- package/dist/components/ui/favorite/favorite.spec.d.ts +2 -0
- package/dist/components/ui/favorite/favorite.spec.d.ts.map +1 -0
- package/dist/components/ui/favorite/favorite.spec.js +6 -0
- package/dist/components/ui/favorite/index.d.ts +2 -0
- package/dist/components/ui/favorite/index.d.ts.map +1 -0
- package/dist/components/ui/favorite/index.js +1 -0
- package/dist/components/ui/favorite.d.ts +1 -1
- package/dist/components/ui/favorite.d.ts.map +1 -1
- package/dist/components/ui/favorite.js +4 -4
- package/dist/components/ui/grid.d.ts +1 -1
- package/dist/components/ui/icon.d.ts.map +1 -1
- package/dist/components/ui/icon.js +9 -54
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +13 -17
- package/dist/components/ui/quantity-picker.js +2 -2
- package/dist/components/ui/select.d.ts +39 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +87 -0
- package/dist/components/ui/selectors.d.ts.map +1 -1
- package/dist/components/ui/selectors.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/text.d.ts.map +1 -1
- package/dist/components/ui/text.js +3 -3
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +5 -1
- package/dist/components/ui/wishlist-select.d.ts +43 -0
- package/dist/components/ui/wishlist-select.d.ts.map +1 -0
- package/dist/components/ui/wishlist-select.js +88 -0
- package/dist/components/ui/wishlist.d.ts +15 -4
- package/dist/components/ui/wishlist.d.ts.map +1 -1
- package/dist/components/ui/wishlist.js +12 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/utils.d.ts +91 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +76 -1
- package/dist/styles.css +103 -10
- package/package.json +3 -2
- package/dist/components/ThemeProvider.d.ts +0 -3
- package/dist/components/ThemeProvider.d.ts.map +0 -1
- package/dist/components/ThemeProvider.js +0 -18
- package/dist/components/ThemeToggle.d.ts +0 -2
- package/dist/components/ThemeToggle.d.ts.map +0 -1
- package/dist/components/ThemeToggle.js +0 -8
- package/dist/components/ui/input.d.ts +0 -17
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -35
- package/dist/components/ui/product-grid.d.ts +0 -15
- package/dist/components/ui/product-grid.d.ts.map +0 -1
- package/dist/components/ui/product-grid.js +0 -22
package/dist/styles.css
CHANGED
|
@@ -673,6 +673,9 @@ video {
|
|
|
673
673
|
.relative {
|
|
674
674
|
position: relative;
|
|
675
675
|
}
|
|
676
|
+
.sticky {
|
|
677
|
+
position: sticky;
|
|
678
|
+
}
|
|
676
679
|
.inset-0 {
|
|
677
680
|
inset: 0px;
|
|
678
681
|
}
|
|
@@ -707,9 +710,15 @@ video {
|
|
|
707
710
|
.bottom-\[18px\] {
|
|
708
711
|
bottom: 18px;
|
|
709
712
|
}
|
|
713
|
+
.bottom-\[30px\] {
|
|
714
|
+
bottom: 30px;
|
|
715
|
+
}
|
|
710
716
|
.bottom-\[58px\] {
|
|
711
717
|
bottom: 58px;
|
|
712
718
|
}
|
|
719
|
+
.bottom-\[70px\] {
|
|
720
|
+
bottom: 70px;
|
|
721
|
+
}
|
|
713
722
|
.end-4 {
|
|
714
723
|
inset-inline-end: 1rem;
|
|
715
724
|
}
|
|
@@ -722,6 +731,9 @@ video {
|
|
|
722
731
|
.left-2 {
|
|
723
732
|
left: 0.5rem;
|
|
724
733
|
}
|
|
734
|
+
.left-4 {
|
|
735
|
+
left: 1rem;
|
|
736
|
+
}
|
|
725
737
|
.left-6 {
|
|
726
738
|
left: 1.5rem;
|
|
727
739
|
}
|
|
@@ -734,6 +746,9 @@ video {
|
|
|
734
746
|
.right-2 {
|
|
735
747
|
right: 0.5rem;
|
|
736
748
|
}
|
|
749
|
+
.right-4 {
|
|
750
|
+
right: 1rem;
|
|
751
|
+
}
|
|
737
752
|
.start-10 {
|
|
738
753
|
inset-inline-start: 2.5rem;
|
|
739
754
|
}
|
|
@@ -752,6 +767,12 @@ video {
|
|
|
752
767
|
.top-2 {
|
|
753
768
|
top: 0.5rem;
|
|
754
769
|
}
|
|
770
|
+
.top-4 {
|
|
771
|
+
top: 1rem;
|
|
772
|
+
}
|
|
773
|
+
.top-\[16px\] {
|
|
774
|
+
top: 16px;
|
|
775
|
+
}
|
|
755
776
|
.top-\[18px\] {
|
|
756
777
|
top: 18px;
|
|
757
778
|
}
|
|
@@ -779,6 +800,9 @@ video {
|
|
|
779
800
|
.m-2 {
|
|
780
801
|
margin: 0.5rem;
|
|
781
802
|
}
|
|
803
|
+
.m-auto {
|
|
804
|
+
margin: auto;
|
|
805
|
+
}
|
|
782
806
|
.mx-1 {
|
|
783
807
|
margin-left: 0.25rem;
|
|
784
808
|
margin-right: 0.25rem;
|
|
@@ -820,12 +844,21 @@ video {
|
|
|
820
844
|
.mb-6 {
|
|
821
845
|
margin-bottom: 1.5rem;
|
|
822
846
|
}
|
|
847
|
+
.ml-1 {
|
|
848
|
+
margin-left: 0.25rem;
|
|
849
|
+
}
|
|
823
850
|
.ml-2 {
|
|
824
851
|
margin-left: 0.5rem;
|
|
825
852
|
}
|
|
826
853
|
.ml-4 {
|
|
827
854
|
margin-left: 1rem;
|
|
828
855
|
}
|
|
856
|
+
.mr-0 {
|
|
857
|
+
margin-right: 0px;
|
|
858
|
+
}
|
|
859
|
+
.mr-0\.5 {
|
|
860
|
+
margin-right: 0.125rem;
|
|
861
|
+
}
|
|
829
862
|
.mr-2 {
|
|
830
863
|
margin-right: 0.5rem;
|
|
831
864
|
}
|
|
@@ -952,6 +985,9 @@ video {
|
|
|
952
985
|
.h-full {
|
|
953
986
|
height: 100%;
|
|
954
987
|
}
|
|
988
|
+
.max-h-\[200px\] {
|
|
989
|
+
max-height: 200px;
|
|
990
|
+
}
|
|
955
991
|
.max-h-\[240px\] {
|
|
956
992
|
max-height: 240px;
|
|
957
993
|
}
|
|
@@ -973,9 +1009,6 @@ video {
|
|
|
973
1009
|
.w-10 {
|
|
974
1010
|
width: 2.5rem;
|
|
975
1011
|
}
|
|
976
|
-
.w-12 {
|
|
977
|
-
width: 3rem;
|
|
978
|
-
}
|
|
979
1012
|
.w-14 {
|
|
980
1013
|
width: 3.5rem;
|
|
981
1014
|
}
|
|
@@ -1089,10 +1122,22 @@ video {
|
|
|
1089
1122
|
--tw-translate-x: -50%;
|
|
1090
1123
|
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));
|
|
1091
1124
|
}
|
|
1125
|
+
.translate-y-0 {
|
|
1126
|
+
--tw-translate-y: 0px;
|
|
1127
|
+
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));
|
|
1128
|
+
}
|
|
1129
|
+
.translate-y-\[-10px\] {
|
|
1130
|
+
--tw-translate-y: -10px;
|
|
1131
|
+
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));
|
|
1132
|
+
}
|
|
1092
1133
|
.translate-y-\[-50\%\] {
|
|
1093
1134
|
--tw-translate-y: -50%;
|
|
1094
1135
|
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));
|
|
1095
1136
|
}
|
|
1137
|
+
.rotate-180 {
|
|
1138
|
+
--tw-rotate: 180deg;
|
|
1139
|
+
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));
|
|
1140
|
+
}
|
|
1096
1141
|
.rotate-45 {
|
|
1097
1142
|
--tw-rotate: 45deg;
|
|
1098
1143
|
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));
|
|
@@ -1374,6 +1419,9 @@ video {
|
|
|
1374
1419
|
.border-t {
|
|
1375
1420
|
border-top-width: 1px;
|
|
1376
1421
|
}
|
|
1422
|
+
.border-t-\[0px\] {
|
|
1423
|
+
border-top-width: 0px;
|
|
1424
|
+
}
|
|
1377
1425
|
.border-t-\[1px\] {
|
|
1378
1426
|
border-top-width: 1px;
|
|
1379
1427
|
}
|
|
@@ -1426,6 +1474,9 @@ video {
|
|
|
1426
1474
|
--tw-bg-opacity: 1;
|
|
1427
1475
|
background-color: rgb(97 46 255 / var(--tw-bg-opacity));
|
|
1428
1476
|
}
|
|
1477
|
+
.bg-\[rgba\(255\2c 255\2c 255\2c 0\.5\)\] {
|
|
1478
|
+
background-color: rgba(255,255,255,0.5);
|
|
1479
|
+
}
|
|
1429
1480
|
.bg-background {
|
|
1430
1481
|
background-color: hsl(var(--background));
|
|
1431
1482
|
}
|
|
@@ -1511,6 +1562,10 @@ video {
|
|
|
1511
1562
|
.fill-current {
|
|
1512
1563
|
fill: currentColor;
|
|
1513
1564
|
}
|
|
1565
|
+
.object-contain {
|
|
1566
|
+
-o-object-fit: contain;
|
|
1567
|
+
object-fit: contain;
|
|
1568
|
+
}
|
|
1514
1569
|
.object-cover {
|
|
1515
1570
|
-o-object-fit: cover;
|
|
1516
1571
|
object-fit: cover;
|
|
@@ -1521,6 +1576,9 @@ video {
|
|
|
1521
1576
|
.p-1 {
|
|
1522
1577
|
padding: 0.25rem;
|
|
1523
1578
|
}
|
|
1579
|
+
.p-1\.5 {
|
|
1580
|
+
padding: 0.375rem;
|
|
1581
|
+
}
|
|
1524
1582
|
.p-2 {
|
|
1525
1583
|
padding: 0.5rem;
|
|
1526
1584
|
}
|
|
@@ -1637,6 +1695,9 @@ video {
|
|
|
1637
1695
|
.pt-12 {
|
|
1638
1696
|
padding-top: 3rem;
|
|
1639
1697
|
}
|
|
1698
|
+
.pt-2 {
|
|
1699
|
+
padding-top: 0.5rem;
|
|
1700
|
+
}
|
|
1640
1701
|
.pt-4 {
|
|
1641
1702
|
padding-top: 1rem;
|
|
1642
1703
|
}
|
|
@@ -1661,9 +1722,6 @@ video {
|
|
|
1661
1722
|
.align-top {
|
|
1662
1723
|
vertical-align: top;
|
|
1663
1724
|
}
|
|
1664
|
-
.font-fontMedium {
|
|
1665
|
-
font-family: var(--fontMedium);
|
|
1666
|
-
}
|
|
1667
1725
|
.font-fontRegular {
|
|
1668
1726
|
font-family: var(--fontRegular);
|
|
1669
1727
|
}
|
|
@@ -1681,6 +1739,9 @@ video {
|
|
|
1681
1739
|
.text-\[12px\] {
|
|
1682
1740
|
font-size: 12px;
|
|
1683
1741
|
}
|
|
1742
|
+
.text-\[14px\] {
|
|
1743
|
+
font-size: 14px;
|
|
1744
|
+
}
|
|
1684
1745
|
.text-\[15px\] {
|
|
1685
1746
|
font-size: 15px;
|
|
1686
1747
|
}
|
|
@@ -1718,6 +1779,9 @@ video {
|
|
|
1718
1779
|
.uppercase {
|
|
1719
1780
|
text-transform: uppercase;
|
|
1720
1781
|
}
|
|
1782
|
+
.lowercase {
|
|
1783
|
+
text-transform: lowercase;
|
|
1784
|
+
}
|
|
1721
1785
|
.capitalize {
|
|
1722
1786
|
text-transform: capitalize;
|
|
1723
1787
|
}
|
|
@@ -2017,6 +2081,9 @@ video {
|
|
|
2017
2081
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2018
2082
|
transition-duration: 150ms;
|
|
2019
2083
|
}
|
|
2084
|
+
.duration-150 {
|
|
2085
|
+
transition-duration: 150ms;
|
|
2086
|
+
}
|
|
2020
2087
|
.duration-200 {
|
|
2021
2088
|
transition-duration: 200ms;
|
|
2022
2089
|
}
|
|
@@ -2043,6 +2110,9 @@ video {
|
|
|
2043
2110
|
transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));
|
|
2044
2111
|
}
|
|
2045
2112
|
}
|
|
2113
|
+
.duration-150 {
|
|
2114
|
+
animation-duration: 150ms;
|
|
2115
|
+
}
|
|
2046
2116
|
.duration-200 {
|
|
2047
2117
|
animation-duration: 200ms;
|
|
2048
2118
|
}
|
|
@@ -2092,6 +2162,14 @@ body::-webkit-scrollbar {
|
|
|
2092
2162
|
font-weight: 500;
|
|
2093
2163
|
}
|
|
2094
2164
|
|
|
2165
|
+
.placeholder\:text-coreColors-brandColorPrimary::-moz-placeholder {
|
|
2166
|
+
color: var(--coreColors-brandColorPrimary);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
.placeholder\:text-coreColors-brandColorPrimary::placeholder {
|
|
2170
|
+
color: var(--coreColors-brandColorPrimary);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2095
2173
|
.placeholder\:text-stateColors-error::-moz-placeholder {
|
|
2096
2174
|
color: var(--stateColors-error);
|
|
2097
2175
|
}
|
|
@@ -2108,6 +2186,10 @@ body::-webkit-scrollbar {
|
|
|
2108
2186
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
2109
2187
|
}
|
|
2110
2188
|
|
|
2189
|
+
.last\:border-b-0:last-child {
|
|
2190
|
+
border-bottom-width: 0px;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2111
2193
|
.placeholder-shown\:\!truncate:-moz-placeholder-shown {
|
|
2112
2194
|
overflow: hidden !important;
|
|
2113
2195
|
text-overflow: ellipsis !important;
|
|
@@ -2189,6 +2271,10 @@ body::-webkit-scrollbar {
|
|
|
2189
2271
|
text-decoration-line: line-through !important;
|
|
2190
2272
|
}
|
|
2191
2273
|
|
|
2274
|
+
.hover\:line-through:hover {
|
|
2275
|
+
text-decoration-line: line-through;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2192
2278
|
.focus\:border-coreColors-brandColorPrimary:focus {
|
|
2193
2279
|
border-color: var(--coreColors-brandColorPrimary);
|
|
2194
2280
|
}
|
|
@@ -2253,6 +2339,10 @@ body::-webkit-scrollbar {
|
|
|
2253
2339
|
--tw-ring-offset-color: hsl(var(--background));
|
|
2254
2340
|
}
|
|
2255
2341
|
|
|
2342
|
+
.active\:bg-black\/10:active {
|
|
2343
|
+
background-color: rgb(0 0 0 / 0.1);
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2256
2346
|
.active\:text-coreColors-brandColorPrimary:active {
|
|
2257
2347
|
color: var(--coreColors-brandColorPrimary);
|
|
2258
2348
|
}
|
|
@@ -2614,6 +2704,13 @@ body::-webkit-scrollbar {
|
|
|
2614
2704
|
text-decoration-line: line-through !important;
|
|
2615
2705
|
}
|
|
2616
2706
|
|
|
2707
|
+
.\[\&\>span\]\:line-clamp-1>span {
|
|
2708
|
+
overflow: hidden;
|
|
2709
|
+
display: -webkit-box;
|
|
2710
|
+
-webkit-box-orient: vertical;
|
|
2711
|
+
-webkit-line-clamp: 1;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2617
2714
|
.\[\&\[data-state\=open\]\]\:outline-coreColors-brandColorPrimary[data-state=open] {
|
|
2618
2715
|
outline-color: var(--coreColors-brandColorPrimary);
|
|
2619
2716
|
}
|
|
@@ -2667,7 +2764,3 @@ body::-webkit-scrollbar {
|
|
|
2667
2764
|
.\[\&_p\]\:text-stateColors-disabled p {
|
|
2668
2765
|
color: var(--stateColors-disabled);
|
|
2669
2766
|
}
|
|
2670
|
-
|
|
2671
|
-
.active\:\[\&_svg\]\:text-stateColors-favorites svg:active {
|
|
2672
|
-
color: var(--stateColors-favorites);
|
|
2673
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@radix-ui/react-label": "^2.0.2",
|
|
52
52
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
53
53
|
"@radix-ui/react-scroll-area": "^1.0.5",
|
|
54
|
+
"@radix-ui/react-select": "^2.1.1",
|
|
54
55
|
"@radix-ui/react-separator": "^1.0.3",
|
|
55
56
|
"@radix-ui/react-slider": "^1.1.2",
|
|
56
57
|
"@radix-ui/react-slot": "^1.0.2",
|
|
@@ -73,4 +74,4 @@
|
|
|
73
74
|
"tailwindcss-animate": "^1.0.6",
|
|
74
75
|
"vaul": "^0.9.1"
|
|
75
76
|
}
|
|
76
|
-
}
|
|
77
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../components/ThemeProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAEvE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
15
|
-
export function ThemeProvider(_a) {
|
|
16
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
17
|
-
return _jsx(NextThemesProvider, Object.assign({}, props, { children: children }));
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../components/ThemeToggle.tsx"],"names":[],"mappings":"AAOA,wBAAgB,WAAW,4CAc1B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useTheme } from "next-themes";
|
|
4
|
-
import { Button } from "../components/ui/button";
|
|
5
|
-
export function ThemeToggle() {
|
|
6
|
-
const { setTheme, theme } = useTheme();
|
|
7
|
-
return (_jsxs(Button, Object.assign({ variant: "ghost", size: "sm", onClick: () => setTheme(theme === "light" ? "dark" : "light") }, { children: [_jsx("div", { className: "rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }), _jsx("div", { className: "absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" }), _jsx("span", Object.assign({ className: "sr-only" }, { children: "Toggle theme" }))] })));
|
|
8
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
declare const inputVariants: (props?: ({
|
|
4
|
-
error?: boolean | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
-
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">, VariantProps<typeof inputVariants> {
|
|
7
|
-
id: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
icon?: string;
|
|
10
|
-
asChild?: boolean;
|
|
11
|
-
value: string;
|
|
12
|
-
placeholder: string;
|
|
13
|
-
onChange: (_: string) => void;
|
|
14
|
-
}
|
|
15
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
16
|
-
export { Input };
|
|
17
|
-
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../components/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa;;mFAalB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,EACnE,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,QAAA,MAAM,KAAK,qFAkDV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
15
|
-
import { cva } from "class-variance-authority";
|
|
16
|
-
import { cn } from "../../lib/utils";
|
|
17
|
-
import { Icon } from "./icon";
|
|
18
|
-
const inputVariants = cva("flex h-14 w-full rounded border border-coreColors-dividingLines bg-coreColors-inputBackground px-4 pt-5 pb-2 placeholder-shown:p-4 text-textColors-primaryColor text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer data-[icon=true]:pr-10", {
|
|
19
|
-
variants: {
|
|
20
|
-
error: {
|
|
21
|
-
true: "border-stateColors-error text-stateColors-error placeholder:text-stateColors-error focus:border-stateColors-error [&+label]:text-stateColors-error",
|
|
22
|
-
false: "",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
error: false,
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
const Input = React.forwardRef((_a, ref) => {
|
|
30
|
-
var { className, error = false, id, type, label, icon, asChild, value, placeholder, onChange } = _a, props = __rest(_a, ["className", "error", "id", "type", "label", "icon", "asChild", "value", "placeholder", "onChange"]);
|
|
31
|
-
const Comp = asChild ? Slot : "div";
|
|
32
|
-
return (_jsxs(Comp, Object.assign({ className: "relative group" }, { children: [_jsx("input", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), id: id, type: type, className: cn(inputVariants({ error }), className), "data-icon": !!icon, ref: ref }, props)), label ? (_jsx("label", Object.assign({ htmlFor: id, className: "absolute text-[10px] text-textColors-secondaryColor group-active:text-coreColors-brandColorPrimary top-2 z-10 h-4 origin-[0] start-4 opacity-100 peer-placeholder-shown:opacity-0" }, { children: label }))) : null, icon ? (_jsx(Icon, { name: icon, "data-error": error, size: "sm", className: "absolute w-5 aspect-square fill-current text-textColors-secondaryColor top-[18px] z-10 origin-[0] end-4 peer-pr-8 icon data-[error=true]:text-stateColors-error" })) : null] })));
|
|
33
|
-
});
|
|
34
|
-
Input.displayName = "Input";
|
|
35
|
-
export { Input };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type Product = any;
|
|
2
|
-
interface PageData {
|
|
3
|
-
products: Product[];
|
|
4
|
-
cursorBlob?: string;
|
|
5
|
-
filtersData: any;
|
|
6
|
-
}
|
|
7
|
-
interface ProductGridItemsProps {
|
|
8
|
-
initialData: PageData;
|
|
9
|
-
loadMoreProducts: (params: any) => Promise<PageData>;
|
|
10
|
-
queryVariables: Record<string, any>;
|
|
11
|
-
config: Record<string, any>;
|
|
12
|
-
}
|
|
13
|
-
declare function ProductGrid({ loadMoreProducts, initialData, queryVariables, config, }: ProductGridItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export { ProductGrid };
|
|
15
|
-
//# sourceMappingURL=product-grid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/product-grid.tsx"],"names":[],"mappings":"AAkBA,KAAK,OAAO,GAAG,GAAG,CAAA;AAClB,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;CACjB;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,QAAQ,CAAA;IACrB,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5B;AAED,iBAAS,WAAW,CAAC,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,MAAM,GACP,EAAE,qBAAqB,2CAmCvB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useInfiniteScroll } from "../hooks/use-infinite-scroll";
|
|
4
|
-
import { ProductCard } from "./product-card";
|
|
5
|
-
const Loader = () => (_jsx("div", Object.assign({ className: "grid-cols-2 lg:grid-cols-3" }, { children: Array(4)
|
|
6
|
-
.fill(0)
|
|
7
|
-
.map((_, index) => (_jsx("div", { className: "aspect-[2/3] animate-pulse bg-neutral-100 dark:bg-neutral-900" }, index))) })));
|
|
8
|
-
function ProductGrid({ loadMoreProducts, initialData, queryVariables, config, }) {
|
|
9
|
-
const { data, error, isLoadingInitialData, isLoadingMore, isEmpty, isReachingEnd, ref, products, } = useInfiniteScroll({
|
|
10
|
-
initialData,
|
|
11
|
-
loadMoreProducts,
|
|
12
|
-
queryVariables,
|
|
13
|
-
});
|
|
14
|
-
if (error)
|
|
15
|
-
return _jsx("div", { children: "Failed to load data" });
|
|
16
|
-
if (isLoadingInitialData)
|
|
17
|
-
return _jsx(Loader, {});
|
|
18
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "grid-cols-2 lg:grid-cols-3" }, { children: products.map((product, i) => (_jsx(ProductCard, {
|
|
19
|
-
// @ts-expect-error
|
|
20
|
-
product: product, config: config, isLoading: false }, product.handle))) })), isLoadingMore ? _jsx(Loader, {}) : _jsx("div", { ref: ref })] }));
|
|
21
|
-
}
|
|
22
|
-
export { ProductGrid };
|