@sikka/hawa 0.1.86 → 0.1.88
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/index.d.mts +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +404 -309
- package/dist/index.mjs +317 -242
- package/dist/styles.css +16 -66
- package/package.json +1 -1
- package/src/blocks/AuthForms/AppLanding.tsx +17 -7
- package/src/blocks/AuthForms/CheckEmail.tsx +54 -0
- package/src/blocks/AuthForms/SignInForm.tsx +1 -1
- package/src/blocks/AuthForms/SignUpForm.tsx +1 -1
- package/src/blocks/AuthForms/index.ts +1 -0
- package/src/blocks/Misc/NoPermission.tsx +1 -5
- package/src/blocks/Payment/CreditCardForm.tsx +20 -19
- package/src/elements/Carousel.tsx +5 -155
- package/src/elements/DropdownMenu.tsx +5 -0
- package/src/elements/HawaAdCard.tsx +61 -23
- package/src/layout/Footer.tsx +50 -13
- package/src/styles.css +16 -66
- package/src/translations/ar.json +4 -1
- package/src/translations/en.json +4 -1
package/dist/styles.css
CHANGED
|
@@ -1078,9 +1078,6 @@ video {
|
|
|
1078
1078
|
.hidden {
|
|
1079
1079
|
display: none;
|
|
1080
1080
|
}
|
|
1081
|
-
.aspect-\[2\/3\] {
|
|
1082
|
-
aspect-ratio: 2/3;
|
|
1083
|
-
}
|
|
1084
1081
|
.aspect-square {
|
|
1085
1082
|
aspect-ratio: 1 / 1;
|
|
1086
1083
|
}
|
|
@@ -1099,12 +1096,12 @@ video {
|
|
|
1099
1096
|
.h-11 {
|
|
1100
1097
|
height: 2.75rem;
|
|
1101
1098
|
}
|
|
1102
|
-
.h-12 {
|
|
1103
|
-
height: 3rem;
|
|
1104
|
-
}
|
|
1105
1099
|
.h-14 {
|
|
1106
1100
|
height: 3.5rem;
|
|
1107
1101
|
}
|
|
1102
|
+
.h-16 {
|
|
1103
|
+
height: 4rem;
|
|
1104
|
+
}
|
|
1108
1105
|
.h-2 {
|
|
1109
1106
|
height: 0.5rem;
|
|
1110
1107
|
}
|
|
@@ -1234,6 +1231,9 @@ video {
|
|
|
1234
1231
|
.min-h-\[80px\] {
|
|
1235
1232
|
min-height: 80px;
|
|
1236
1233
|
}
|
|
1234
|
+
.min-h-screen {
|
|
1235
|
+
min-height: 100vh;
|
|
1236
|
+
}
|
|
1237
1237
|
.w-0 {
|
|
1238
1238
|
width: 0px;
|
|
1239
1239
|
}
|
|
@@ -1258,6 +1258,9 @@ video {
|
|
|
1258
1258
|
.w-14 {
|
|
1259
1259
|
width: 3.5rem;
|
|
1260
1260
|
}
|
|
1261
|
+
.w-16 {
|
|
1262
|
+
width: 4rem;
|
|
1263
|
+
}
|
|
1261
1264
|
.w-2 {
|
|
1262
1265
|
width: 0.5rem;
|
|
1263
1266
|
}
|
|
@@ -1315,6 +1318,9 @@ video {
|
|
|
1315
1318
|
.w-\[1\.2rem\] {
|
|
1316
1319
|
width: 1.2rem;
|
|
1317
1320
|
}
|
|
1321
|
+
.w-\[1000px\] {
|
|
1322
|
+
width: 1000px;
|
|
1323
|
+
}
|
|
1318
1324
|
.w-\[12px\] {
|
|
1319
1325
|
width: 12px;
|
|
1320
1326
|
}
|
|
@@ -1351,15 +1357,9 @@ video {
|
|
|
1351
1357
|
.w-\[42px\] {
|
|
1352
1358
|
width: 42px;
|
|
1353
1359
|
}
|
|
1354
|
-
.w-\[500px\] {
|
|
1355
|
-
width: 500px;
|
|
1356
|
-
}
|
|
1357
1360
|
.w-\[64px\] {
|
|
1358
1361
|
width: 64px;
|
|
1359
1362
|
}
|
|
1360
|
-
.w-\[90\%\] {
|
|
1361
|
-
width: 90%;
|
|
1362
|
-
}
|
|
1363
1363
|
.w-\[calc\(1\%\)\] {
|
|
1364
1364
|
width: calc(1%);
|
|
1365
1365
|
}
|
|
@@ -1582,19 +1582,6 @@ video {
|
|
|
1582
1582
|
.snap-x {
|
|
1583
1583
|
scroll-snap-type: x var(--tw-scroll-snap-strictness);
|
|
1584
1584
|
}
|
|
1585
|
-
.snap-mandatory {
|
|
1586
|
-
--tw-scroll-snap-strictness: mandatory;
|
|
1587
|
-
}
|
|
1588
|
-
.snap-start {
|
|
1589
|
-
scroll-snap-align: start;
|
|
1590
|
-
}
|
|
1591
|
-
.snap-always {
|
|
1592
|
-
scroll-snap-stop: always;
|
|
1593
|
-
}
|
|
1594
|
-
.scroll-px-10 {
|
|
1595
|
-
scroll-padding-left: 2.5rem;
|
|
1596
|
-
scroll-padding-right: 2.5rem;
|
|
1597
|
-
}
|
|
1598
1585
|
.appearance-none {
|
|
1599
1586
|
-webkit-appearance: none;
|
|
1600
1587
|
-moz-appearance: none;
|
|
@@ -1775,15 +1762,9 @@ video {
|
|
|
1775
1762
|
.overflow-y-clip {
|
|
1776
1763
|
overflow-y: clip;
|
|
1777
1764
|
}
|
|
1778
|
-
.overflow-x-scroll {
|
|
1779
|
-
overflow-x: scroll;
|
|
1780
|
-
}
|
|
1781
1765
|
.overflow-y-scroll {
|
|
1782
1766
|
overflow-y: scroll;
|
|
1783
1767
|
}
|
|
1784
|
-
.scroll-smooth {
|
|
1785
|
-
scroll-behavior: smooth;
|
|
1786
|
-
}
|
|
1787
1768
|
.truncate {
|
|
1788
1769
|
overflow: hidden;
|
|
1789
1770
|
text-overflow: ellipsis;
|
|
@@ -2033,10 +2014,6 @@ video {
|
|
|
2033
2014
|
--tw-bg-opacity: 1;
|
|
2034
2015
|
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
|
|
2035
2016
|
}
|
|
2036
|
-
.bg-blue-200 {
|
|
2037
|
-
--tw-bg-opacity: 1;
|
|
2038
|
-
background-color: rgb(191 219 254 / var(--tw-bg-opacity));
|
|
2039
|
-
}
|
|
2040
2017
|
.bg-blue-300 {
|
|
2041
2018
|
--tw-bg-opacity: 1;
|
|
2042
2019
|
background-color: rgb(147 197 253 / var(--tw-bg-opacity));
|
|
@@ -2123,10 +2100,6 @@ video {
|
|
|
2123
2100
|
--tw-bg-opacity: 1;
|
|
2124
2101
|
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
|
|
2125
2102
|
}
|
|
2126
|
-
.bg-green-300 {
|
|
2127
|
-
--tw-bg-opacity: 1;
|
|
2128
|
-
background-color: rgb(134 239 172 / var(--tw-bg-opacity));
|
|
2129
|
-
}
|
|
2130
2103
|
.bg-green-500 {
|
|
2131
2104
|
--tw-bg-opacity: 1;
|
|
2132
2105
|
background-color: rgb(34 197 94 / var(--tw-bg-opacity));
|
|
@@ -2144,10 +2117,6 @@ video {
|
|
|
2144
2117
|
.bg-muted {
|
|
2145
2118
|
background-color: hsl(var(--muted));
|
|
2146
2119
|
}
|
|
2147
|
-
.bg-orange-100 {
|
|
2148
|
-
--tw-bg-opacity: 1;
|
|
2149
|
-
background-color: rgb(255 237 213 / var(--tw-bg-opacity));
|
|
2150
|
-
}
|
|
2151
2120
|
.bg-orange-400 {
|
|
2152
2121
|
--tw-bg-opacity: 1;
|
|
2153
2122
|
background-color: rgb(251 146 60 / var(--tw-bg-opacity));
|
|
@@ -2194,10 +2163,6 @@ video {
|
|
|
2194
2163
|
--tw-bg-opacity: 1;
|
|
2195
2164
|
background-color: rgb(127 29 29 / var(--tw-bg-opacity));
|
|
2196
2165
|
}
|
|
2197
|
-
.bg-rose-100 {
|
|
2198
|
-
--tw-bg-opacity: 1;
|
|
2199
|
-
background-color: rgb(255 228 230 / var(--tw-bg-opacity));
|
|
2200
|
-
}
|
|
2201
2166
|
.bg-secondary {
|
|
2202
2167
|
background-color: hsl(var(--secondary));
|
|
2203
2168
|
}
|
|
@@ -2242,17 +2207,9 @@ video {
|
|
|
2242
2207
|
.bg-opacity-80 {
|
|
2243
2208
|
--tw-bg-opacity: 0.8;
|
|
2244
2209
|
}
|
|
2245
|
-
.bg-gradient-to-t {
|
|
2246
|
-
background-image: linear-gradient(to top, var(--tw-gradient-stops));
|
|
2247
|
-
}
|
|
2248
2210
|
.bg-none {
|
|
2249
2211
|
background-image: none;
|
|
2250
2212
|
}
|
|
2251
|
-
.from-black {
|
|
2252
|
-
--tw-gradient-from: #000 var(--tw-gradient-from-position);
|
|
2253
|
-
--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);
|
|
2254
|
-
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
|
|
2255
|
-
}
|
|
2256
2213
|
.bg-cover {
|
|
2257
2214
|
background-size: cover;
|
|
2258
2215
|
}
|
|
@@ -2728,9 +2685,6 @@ video {
|
|
|
2728
2685
|
--tw-text-opacity: 1;
|
|
2729
2686
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
2730
2687
|
}
|
|
2731
|
-
.text-white\/50 {
|
|
2732
|
-
color: rgb(255 255 255 / 0.5);
|
|
2733
|
-
}
|
|
2734
2688
|
.text-yellow-700 {
|
|
2735
2689
|
--tw-text-opacity: 1;
|
|
2736
2690
|
color: rgb(161 98 7 / var(--tw-text-opacity));
|
|
@@ -4071,10 +4025,6 @@ body {
|
|
|
4071
4025
|
display: flex;
|
|
4072
4026
|
}
|
|
4073
4027
|
|
|
4074
|
-
.sm\:w-\[44\%\] {
|
|
4075
|
-
width: 44%;
|
|
4076
|
-
}
|
|
4077
|
-
|
|
4078
4028
|
.sm\:columns-2 {
|
|
4079
4029
|
-moz-columns: 2;
|
|
4080
4030
|
columns: 2;
|
|
@@ -4186,10 +4136,6 @@ body {
|
|
|
4186
4136
|
width: 12rem;
|
|
4187
4137
|
}
|
|
4188
4138
|
|
|
4189
|
-
.md\:w-\[30\%\] {
|
|
4190
|
-
width: 30%;
|
|
4191
|
-
}
|
|
4192
|
-
|
|
4193
4139
|
.md\:w-full {
|
|
4194
4140
|
width: 100%;
|
|
4195
4141
|
}
|
|
@@ -4219,6 +4165,10 @@ body {
|
|
|
4219
4165
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
4220
4166
|
}
|
|
4221
4167
|
|
|
4168
|
+
.md\:grid-cols-3 {
|
|
4169
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4222
4172
|
.md\:flex-row {
|
|
4223
4173
|
flex-direction: row;
|
|
4224
4174
|
}
|
package/package.json
CHANGED
|
@@ -9,11 +9,15 @@ type AppLandingTypes = {
|
|
|
9
9
|
handleSignUp: () => void
|
|
10
10
|
handleLanguage: () => void
|
|
11
11
|
handleColorMode: () => void
|
|
12
|
-
texts
|
|
12
|
+
texts?: {
|
|
13
13
|
signIn: string
|
|
14
14
|
signUp: string
|
|
15
15
|
lang: string
|
|
16
|
+
newUserText?: string
|
|
17
|
+
createAccount?: string
|
|
16
18
|
}
|
|
19
|
+
withoutSignUp?: boolean
|
|
20
|
+
handleRouteToSignUp?: () => void
|
|
17
21
|
size: "small" | "normal" | "full"
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -67,12 +71,18 @@ export const AppLanding: FC<AppLandingTypes> = (props) => {
|
|
|
67
71
|
{props.handleSignUp && (
|
|
68
72
|
<Button onClick={props.handleSignUp}>{props.texts.signUp}</Button>
|
|
69
73
|
)} */}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
{!props.withoutSignUp && (
|
|
75
|
+
<div className="p-3 text-center text-sm font-normal dark:text-gray-300">
|
|
76
|
+
{props.texts.newUserText}{" "}
|
|
77
|
+
<span
|
|
78
|
+
onClick={props.handleRouteToSignUp}
|
|
79
|
+
className="clickable-link"
|
|
80
|
+
>
|
|
81
|
+
{props.texts.createAccount}
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
|
|
76
86
|
</CardContent>
|
|
77
87
|
</Card>
|
|
78
88
|
<div className="mt-6 flex flex-row justify-between">
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useState, FC } from "react"
|
|
2
|
+
import { HawaAlert, HawaPinInput } from "../../elements"
|
|
3
|
+
import { Card, CardContent, CardFooter } from "../../elements/Card"
|
|
4
|
+
import { Button } from "../../elements/Button"
|
|
5
|
+
|
|
6
|
+
type CheckEmailBlocks = {
|
|
7
|
+
texts?: {
|
|
8
|
+
checkEmail: string
|
|
9
|
+
resendEmail: string
|
|
10
|
+
pleaseVerify: string
|
|
11
|
+
}
|
|
12
|
+
handleResend?: () => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CheckEmail: FC<CheckEmailBlocks> = ({ texts, handleResend }) => {
|
|
16
|
+
return (
|
|
17
|
+
<Card>
|
|
18
|
+
<CardContent headless>
|
|
19
|
+
<div className="flex flex-col items-center justify-center text-center">
|
|
20
|
+
<div className="flex h-16 w-16 flex-col items-center justify-center rounded-3xl bg-primary text-6xl font-bold text-primary-foreground">
|
|
21
|
+
<svg
|
|
22
|
+
stroke="currentColor"
|
|
23
|
+
fill="none"
|
|
24
|
+
stroke-width="2"
|
|
25
|
+
viewBox="0 0 24 24"
|
|
26
|
+
stroke-linecap="round"
|
|
27
|
+
stroke-linejoin="round"
|
|
28
|
+
height="0.5em"
|
|
29
|
+
width="0.5em"
|
|
30
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
+
// {...props}
|
|
32
|
+
>
|
|
33
|
+
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
|
|
34
|
+
<polyline points="22,6 12,13 2,6"></polyline>
|
|
35
|
+
</svg>
|
|
36
|
+
</div>
|
|
37
|
+
<div className="m-2 text-xl font-bold">
|
|
38
|
+
{texts?.checkEmail ?? "Check you email"}
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div className="text-sm">
|
|
42
|
+
{texts?.pleaseVerify ??
|
|
43
|
+
"Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</CardContent>
|
|
47
|
+
<CardFooter className="flex flex-col justify-center ">
|
|
48
|
+
<span className="clickable-link text-sm" onClick={handleResend}>
|
|
49
|
+
{texts?.resendEmail ?? "Resend Email"}
|
|
50
|
+
</span>
|
|
51
|
+
</CardFooter>
|
|
52
|
+
</Card>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -135,7 +135,7 @@ export const SignInForm: FC<SignInFormTypes> = (props) => {
|
|
|
135
135
|
{props.texts.signInText}
|
|
136
136
|
</Button>
|
|
137
137
|
{!props.withoutSignUp && (
|
|
138
|
-
<div className="p-3 text-center text-sm font-
|
|
138
|
+
<div className="p-3 text-center text-sm font-normal dark:text-gray-300">
|
|
139
139
|
{props.texts.newUserText}{" "}
|
|
140
140
|
<span
|
|
141
141
|
onClick={props.handleRouteToSignUp}
|
|
@@ -295,7 +295,7 @@ export const SignUpForm: FC<SignUpFormTypes> = (props) => {
|
|
|
295
295
|
</Button>
|
|
296
296
|
</form>
|
|
297
297
|
</FormProvider>
|
|
298
|
-
<div className="flex flex-row items-center justify-center gap-1 p-3 text-center text-sm font-
|
|
298
|
+
<div className="flex flex-row items-center justify-center gap-1 p-3 text-center text-sm font-normal dark:text-white">
|
|
299
299
|
<span>{props.texts.existingUserText}</span>
|
|
300
300
|
<span
|
|
301
301
|
onClick={props.handleRouteToSignIn}
|
|
@@ -2,17 +2,13 @@ import React, { FC } from "react"
|
|
|
2
2
|
import { Card, CardContent } from "../../elements/Card"
|
|
3
3
|
|
|
4
4
|
type TNoPermission = {
|
|
5
|
-
variant?: "outlined" | "contained" | "neobrutalism"
|
|
6
5
|
texts?: {
|
|
7
6
|
title: string
|
|
8
7
|
subtitle: string
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
export const NoPermission: FC<TNoPermission> = ({
|
|
13
|
-
variant = "contained",
|
|
14
|
-
texts,
|
|
15
|
-
}) => {
|
|
11
|
+
export const NoPermission: FC<TNoPermission> = ({ texts }) => {
|
|
16
12
|
return (
|
|
17
13
|
<Card>
|
|
18
14
|
<CardContent headless>
|
|
@@ -28,30 +28,30 @@ export const CreditCardForm: FC<CreditCardFormTypes> = (props) => {
|
|
|
28
28
|
render={({ field }) => (
|
|
29
29
|
<HawaTextField
|
|
30
30
|
width="full"
|
|
31
|
-
name="
|
|
32
|
-
placeholder="
|
|
33
|
-
type="
|
|
31
|
+
name="cardNumber"
|
|
32
|
+
placeholder="1234 1234 1234 1234"
|
|
33
|
+
type="number"
|
|
34
34
|
label="Card Number"
|
|
35
35
|
helpertext={errors.password?.message}
|
|
36
36
|
/>
|
|
37
37
|
)}
|
|
38
38
|
rules={{
|
|
39
|
-
required: "
|
|
39
|
+
required: "Card Number is rquired",
|
|
40
40
|
}}
|
|
41
41
|
/>
|
|
42
42
|
<div className="w-1/4">
|
|
43
43
|
<Controller
|
|
44
44
|
control={control}
|
|
45
|
-
name="
|
|
45
|
+
name="cardCVC"
|
|
46
46
|
render={({ field }) => (
|
|
47
47
|
<HawaTextField
|
|
48
48
|
width="full"
|
|
49
|
-
name="
|
|
49
|
+
name="cardCVC"
|
|
50
50
|
maxLength="3"
|
|
51
51
|
autoComplete="cc-number"
|
|
52
|
-
placeholder=""
|
|
53
|
-
type="
|
|
54
|
-
label="
|
|
52
|
+
placeholder="CVC"
|
|
53
|
+
type="number"
|
|
54
|
+
label="CVC"
|
|
55
55
|
helpertext={errors.password?.message}
|
|
56
56
|
/>
|
|
57
57
|
)}
|
|
@@ -61,16 +61,17 @@ export const CreditCardForm: FC<CreditCardFormTypes> = (props) => {
|
|
|
61
61
|
/>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
|
+
|
|
64
65
|
<Controller
|
|
65
66
|
control={control}
|
|
66
|
-
name="
|
|
67
|
+
name="cardExpiry"
|
|
67
68
|
render={({ field }) => (
|
|
68
69
|
<HawaTextField
|
|
69
70
|
width="full"
|
|
70
|
-
name="
|
|
71
|
-
placeholder="
|
|
72
|
-
type="
|
|
73
|
-
label="
|
|
71
|
+
name="cardExpiry"
|
|
72
|
+
placeholder="MM / YY"
|
|
73
|
+
type="password"
|
|
74
|
+
label="Expiry Date"
|
|
74
75
|
helpertext={errors.password?.message}
|
|
75
76
|
/>
|
|
76
77
|
)}
|
|
@@ -84,15 +85,15 @@ export const CreditCardForm: FC<CreditCardFormTypes> = (props) => {
|
|
|
84
85
|
render={({ field }) => (
|
|
85
86
|
<HawaTextField
|
|
86
87
|
width="full"
|
|
87
|
-
name="
|
|
88
|
-
placeholder="Enter password"
|
|
89
|
-
type="
|
|
90
|
-
label="
|
|
88
|
+
name="cardName"
|
|
89
|
+
// placeholder="Enter password"
|
|
90
|
+
type="text"
|
|
91
|
+
label="Name on card"
|
|
91
92
|
helpertext={errors.password?.message}
|
|
92
93
|
/>
|
|
93
94
|
)}
|
|
94
95
|
rules={{
|
|
95
|
-
required: "
|
|
96
|
+
required: "Card holder name is rquired",
|
|
96
97
|
}}
|
|
97
98
|
/>
|
|
98
99
|
</CardContent>
|
|
@@ -6,7 +6,7 @@ interface CarouselProps {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const Carousel: React.FC<CarouselProps> = ({ images }) => {
|
|
9
|
-
const imageWidth =
|
|
9
|
+
const imageWidth = 1000 + 16 // Adjust according to your image width
|
|
10
10
|
const {
|
|
11
11
|
containerRef,
|
|
12
12
|
handleMouseDown,
|
|
@@ -17,7 +17,7 @@ export const Carousel: React.FC<CarouselProps> = ({ images }) => {
|
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<div
|
|
20
|
-
className="flex cursor-pointer snap-x gap-4 overflow-x-
|
|
20
|
+
className="flex cursor-pointer snap-x gap-4 overflow-x-hidden justify-center items-center"
|
|
21
21
|
onMouseDown={handleMouseDown}
|
|
22
22
|
onMouseLeave={handleMouseLeave}
|
|
23
23
|
onMouseUp={handleMouseUp}
|
|
@@ -25,10 +25,12 @@ export const Carousel: React.FC<CarouselProps> = ({ images }) => {
|
|
|
25
25
|
ref={containerRef}
|
|
26
26
|
>
|
|
27
27
|
{images.map((image, index) => (
|
|
28
|
-
<div key={index} className="
|
|
28
|
+
<div key={index} className="w-[1000px] h-96 flex-shrink-0">
|
|
29
|
+
{/* <div key={index} className="h-40 w-60 flex-shrink-0"> */}
|
|
29
30
|
<img
|
|
30
31
|
src={image}
|
|
31
32
|
alt={`Carousel Image ${index}`}
|
|
33
|
+
width={imageWidth}
|
|
32
34
|
className="h-full w-full rounded-lg object-cover"
|
|
33
35
|
/>
|
|
34
36
|
</div>
|
|
@@ -37,155 +39,3 @@ export const Carousel: React.FC<CarouselProps> = ({ images }) => {
|
|
|
37
39
|
)
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
// import React, { FC, useEffect, useRef } from "react"
|
|
41
|
-
// import clsx from "clsx"
|
|
42
|
-
|
|
43
|
-
// type CarouselTypes = {
|
|
44
|
-
// /** The text inside the chip */
|
|
45
|
-
// label: string
|
|
46
|
-
// /** The small icon before the chip label */
|
|
47
|
-
// icon?: JSX.Element
|
|
48
|
-
// /** The color of the chip, must be a tailwind color */
|
|
49
|
-
// color?: string
|
|
50
|
-
// /** The size of the chip */
|
|
51
|
-
// size?: "small" | "normal" | "large"
|
|
52
|
-
// /** Enable/Disable the dot before the label of the chip */
|
|
53
|
-
// dot?: boolean
|
|
54
|
-
// /** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
|
55
|
-
// dotType?: "available" | "unavailable"
|
|
56
|
-
// }
|
|
57
|
-
|
|
58
|
-
// export const Carousel: FC<CarouselTypes> = (props) => {
|
|
59
|
-
// const scrollContainer = useRef(null)
|
|
60
|
-
|
|
61
|
-
// useEffect(() => {
|
|
62
|
-
// let isDown = false
|
|
63
|
-
// let startX
|
|
64
|
-
// let scrollLeft
|
|
65
|
-
|
|
66
|
-
// const onMouseDown = (e) => {
|
|
67
|
-
// isDown = true
|
|
68
|
-
// startX = e.pageX
|
|
69
|
-
// scrollLeft = scrollContainer.current.scrollLeft
|
|
70
|
-
// }
|
|
71
|
-
|
|
72
|
-
// const onMouseLeave = () => {
|
|
73
|
-
// isDown = false
|
|
74
|
-
// }
|
|
75
|
-
|
|
76
|
-
// const onMouseUp = () => {
|
|
77
|
-
// isDown = false
|
|
78
|
-
// }
|
|
79
|
-
|
|
80
|
-
// const onMouseMove = (e) => {
|
|
81
|
-
// if (!isDown) return
|
|
82
|
-
// e.preventDefault()
|
|
83
|
-
// const x = e.pageX
|
|
84
|
-
// const walk = x - startX
|
|
85
|
-
// scrollContainer.current.scrollLeft = scrollLeft - walk
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
// const container = scrollContainer.current
|
|
89
|
-
// container.addEventListener("mousedown", onMouseDown)
|
|
90
|
-
// container.addEventListener("mouseleave", onMouseLeave)
|
|
91
|
-
// container.addEventListener("mouseup", onMouseUp)
|
|
92
|
-
// container.addEventListener("mousemove", onMouseMove)
|
|
93
|
-
|
|
94
|
-
// return () => {
|
|
95
|
-
// container.removeEventListener("mousedown", onMouseDown)
|
|
96
|
-
// container.removeEventListener("mouseleave", onMouseLeave)
|
|
97
|
-
// container.removeEventListener("mouseup", onMouseUp)
|
|
98
|
-
// container.removeEventListener("mousemove", onMouseMove)
|
|
99
|
-
// }
|
|
100
|
-
// }, [])
|
|
101
|
-
// return (
|
|
102
|
-
// <div className="relative flex flex-col items-center justify-center overflow-hidden bg-gray-50">
|
|
103
|
-
// <div className="w-[500px]">
|
|
104
|
-
// <div
|
|
105
|
-
// ref={scrollContainer}
|
|
106
|
-
// className="scrollbar-hide mt-14 flex w-full snap-x snap-mandatory scroll-px-10 gap-10 overflow-x-scroll scroll-smooth px-10"
|
|
107
|
-
// >
|
|
108
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-orange-100 sm:w-[44%] md:w-[30%]">
|
|
109
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
110
|
-
// <h2 className="mt-4 text-xl font-bold text-white">Cangu</h2>
|
|
111
|
-
// <p className="text-sm text-white/50">Indonesia</p>
|
|
112
|
-
// </div>
|
|
113
|
-
// <img
|
|
114
|
-
// src="https://source.unsplash.com/9bp48ITvd00"
|
|
115
|
-
// alt="image"
|
|
116
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
117
|
-
// />
|
|
118
|
-
// </div>
|
|
119
|
-
|
|
120
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-orange-100 sm:w-[44%] md:w-[30%]">
|
|
121
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
122
|
-
// <h2 className="mt-4 text-xl font-bold text-white">New York</h2>
|
|
123
|
-
// <p className="text-sm text-white/50">United States</p>
|
|
124
|
-
// </div>
|
|
125
|
-
// <img
|
|
126
|
-
// src="https://source.unsplash.com/4HG5hlhmZg8"
|
|
127
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
128
|
-
// />
|
|
129
|
-
// </div>
|
|
130
|
-
|
|
131
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-blue-100 sm:w-[44%] md:w-[30%]">
|
|
132
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
133
|
-
// <h2 className="mt-4 text-xl font-bold text-white">London</h2>
|
|
134
|
-
// <p className="text-sm text-white/50">United Kingdom</p>
|
|
135
|
-
// </div>
|
|
136
|
-
// <img
|
|
137
|
-
// src="https://source.unsplash.com/oBmlsTW2pHY"
|
|
138
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
139
|
-
// />
|
|
140
|
-
// </div>
|
|
141
|
-
|
|
142
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-green-100 sm:w-[44%] md:w-[30%]">
|
|
143
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
144
|
-
// <h2 className="mt-4 text-xl font-bold text-white">Bali</h2>
|
|
145
|
-
// <p className="text-sm text-white/50">Indonesia</p>
|
|
146
|
-
// </div>
|
|
147
|
-
// <img
|
|
148
|
-
// src="https://source.unsplash.com/1kdIG_258bU"
|
|
149
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
150
|
-
// />
|
|
151
|
-
// </div>
|
|
152
|
-
|
|
153
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-rose-100 sm:w-[44%] md:w-[30%]">
|
|
154
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
155
|
-
// <h2 className="mt-4 text-xl font-bold text-white">
|
|
156
|
-
// Times Square
|
|
157
|
-
// </h2>
|
|
158
|
-
// <p className="text-sm text-white/50">Singapore</p>
|
|
159
|
-
// </div>
|
|
160
|
-
// <img
|
|
161
|
-
// src="https://source.unsplash.com/l8vKWxhVuts"
|
|
162
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
163
|
-
// />
|
|
164
|
-
// </div>
|
|
165
|
-
|
|
166
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-yellow-100 sm:w-[44%] md:w-[30%]">
|
|
167
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
168
|
-
// <h2 className="mt-4 text-xl font-bold text-white">Bangkok</h2>
|
|
169
|
-
// <p className="text-sm text-white/50">Thailand</p>
|
|
170
|
-
// </div>
|
|
171
|
-
// <img
|
|
172
|
-
// src="https://source.unsplash.com/0LGDmbnk0-U"
|
|
173
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
174
|
-
// />
|
|
175
|
-
// </div>
|
|
176
|
-
|
|
177
|
-
// <div className="md:2/3 relative aspect-[2/3] w-[90%] shrink-0 snap-start snap-always rounded-xl bg-red-100 sm:w-[44%] md:w-[30%]">
|
|
178
|
-
// <div className="absolute bottom-0 z-10 w-full rounded-xl bg-gradient-to-t from-black px-5 py-3">
|
|
179
|
-
// <h2 className="mt-4 text-xl font-bold text-white">Latina</h2>
|
|
180
|
-
// <p className="text-sm text-white/50">South America</p>
|
|
181
|
-
// </div>
|
|
182
|
-
// <img
|
|
183
|
-
// src="https://source.unsplash.com/tVqQSfXQ_SI"
|
|
184
|
-
// className="h-full w-full rounded-xl object-cover"
|
|
185
|
-
// />
|
|
186
|
-
// </div>
|
|
187
|
-
// </div>
|
|
188
|
-
// </div>
|
|
189
|
-
// </div>
|
|
190
|
-
// )
|
|
191
|
-
// }
|
|
@@ -89,6 +89,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
89
89
|
}
|
|
90
90
|
>(({ className, inset, ...props }, ref) => (
|
|
91
91
|
<DropdownMenuPrimitive.Item
|
|
92
|
+
disabled={props.disabled}
|
|
92
93
|
ref={ref}
|
|
93
94
|
className={cn(
|
|
94
95
|
"relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -238,6 +239,7 @@ export type SubItem = {
|
|
|
238
239
|
icon?: any
|
|
239
240
|
action?: () => void
|
|
240
241
|
highlighted?: boolean
|
|
242
|
+
disabled?: boolean
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
export type MenuItemType = {
|
|
@@ -249,6 +251,7 @@ export type MenuItemType = {
|
|
|
249
251
|
action?: () => void
|
|
250
252
|
highlighted?: boolean
|
|
251
253
|
subitems?: SubItem[] // Note the use of the optional modifier
|
|
254
|
+
disabled?: boolean
|
|
252
255
|
}
|
|
253
256
|
interface DropdownMenuProps {
|
|
254
257
|
trigger?: any
|
|
@@ -306,6 +309,7 @@ export const DropdownMenu: React.FC<DropdownMenuProps> = ({
|
|
|
306
309
|
<DropdownMenuSubContent>
|
|
307
310
|
{item.subitems.map((subitem, subIndex) => (
|
|
308
311
|
<DropdownMenuItem
|
|
312
|
+
disabled={subitem.disabled}
|
|
309
313
|
className="flex flex-row gap-2"
|
|
310
314
|
onSelect={() => subitem.action()}
|
|
311
315
|
key={subIndex}
|
|
@@ -319,6 +323,7 @@ export const DropdownMenu: React.FC<DropdownMenuProps> = ({
|
|
|
319
323
|
</DropdownMenuSub>
|
|
320
324
|
) : (
|
|
321
325
|
<DropdownMenuItem
|
|
326
|
+
disabled={item.disabled}
|
|
322
327
|
className="flex flex-row gap-2"
|
|
323
328
|
key={index}
|
|
324
329
|
onSelect={(e) => {
|