@opexa/portal-components 0.0.644 → 0.0.647
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/client/hooks/useAccountQuery.js +0 -33
- package/dist/client/hooks/useSignInMutation.js +4 -0
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +0 -2
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
- package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
- package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
- package/dist/components/Disclaimer/TermsOfUse.js +13 -0
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +1 -0
- package/dist/components/FeatureFlag/FeatureFlag.js +29 -0
- package/dist/components/FeatureFlag/index.d.ts +1 -0
- package/dist/components/FeatureFlag/index.js +1 -0
- package/dist/components/GameLaunch/GameLaunchTrigger.js +71 -2
- package/dist/components/Jackpots/Jackpots.module.css +184 -184
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/AutoOpen.d.ts +1 -0
- package/dist/components/KYC/AutoOpen.js +40 -0
- package/dist/components/KYC/BasicInformation.js +1 -1
- package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/KYC/CaptureIdDocument.js +219 -0
- package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/KYC/CaptureSelfie.js +285 -0
- package/dist/components/KYC/DisplayImage.d.ts +5 -0
- package/dist/components/KYC/DisplayImage.js +8 -0
- package/dist/components/KYC/FileUpload.d.ts +10 -0
- package/dist/components/KYC/FileUpload.js +72 -0
- package/dist/components/KYC/IdentityVerification.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +1 -1
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +2 -2
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +8 -5
- package/dist/components/KYC/NoCameraError.d.ts +7 -0
- package/dist/components/KYC/NoCameraError.js +6 -0
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/KYC/PersonalInformation.js +1 -1
- package/dist/components/KYC/backup/Header.d.ts +1 -0
- package/dist/components/KYC/backup/Header.js +8 -0
- package/dist/components/KYC/backup/Indicator.d.ts +1 -0
- package/dist/components/KYC/backup/Indicator.js +9 -0
- package/dist/components/KYC/backup/KYC.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.js +14 -0
- package/dist/components/KYC/backup/KYC.lazy.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.lazy.js +26 -0
- package/dist/components/KYC/backup/KYCContext.d.ts +6 -0
- package/dist/components/KYC/backup/KYCContext.js +2 -0
- package/dist/components/KYC/backup/Step1.d.ts +1 -0
- package/dist/components/KYC/backup/Step1.js +13 -0
- package/dist/components/KYC/backup/Step2.d.ts +1 -0
- package/dist/components/KYC/backup/Step2.js +13 -0
- package/dist/components/KYC/backup/Step3.d.ts +1 -0
- package/dist/components/KYC/backup/Step3.js +13 -0
- package/dist/components/KYC/backup/Step4.d.ts +1 -0
- package/dist/components/KYC/backup/Step4.js +7 -0
- package/dist/components/KYC/backup/useKYC.d.ts +10 -0
- package/dist/components/KYC/backup/useKYC.js +8 -0
- package/dist/components/KYC/loadModels.d.ts +1 -0
- package/dist/components/KYC/loadModels.js +9 -0
- package/dist/components/KYC/utils.d.ts +9 -0
- package/dist/components/KYC/utils.js +79 -0
- package/dist/components/Messages/Message.d.ts +1 -0
- package/dist/components/Messages/Message.js +35 -0
- package/dist/components/Messages/MessageContext.d.ts +6 -0
- package/dist/components/Messages/MessageContext.js +2 -0
- package/dist/components/Messages/MessagePopup.d.ts +1 -0
- package/dist/components/Messages/MessagePopup.js +20 -0
- package/dist/components/Messages/MessageTrigger.d.ts +8 -0
- package/dist/components/Messages/MessageTrigger.js +19 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/PortalProvider/PushNotifications.js +1 -1
- package/dist/components/Quests/CountdownTimer.d.ts +15 -0
- package/dist/components/Quests/CountdownTimer.js +33 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +78 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.js +20 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
- package/dist/components/RegisterBiometrics/RegisterBiometrics.js +3 -2
- package/dist/components/SignIn/SignInTrigger.js +5 -4
- package/dist/components/SignUp/SignUp.lazy.d.ts +12 -0
- package/dist/components/SignUp/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +2 -2
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
- package/dist/components/SignUp/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpForm.js +284 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +2 -2
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
- package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
- package/dist/components/SignUp/SignUpNameAndPassword/SignUpNameAndPasswordForm.js +2 -2
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +41 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +429 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +13 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +26 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +7 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +2 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +20 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/TransactionRecords/DepositRecordsTable.js +21 -3
- package/dist/components/shared/IdDocumentField.client.d.ts +25 -0
- package/dist/components/shared/IdDocumentField.client.js +204 -0
- package/dist/components/shared/IdDocumentField.d.ts +2 -0
- package/dist/components/shared/IdDocumentField.js +11 -0
- package/dist/components/shared/SelfieField.client.d.ts +20 -0
- package/dist/components/shared/SelfieField.client.js +327 -0
- package/dist/components/shared/SelfieField.d.ts +2 -0
- package/dist/components/shared/SelfieField.js +11 -0
- package/dist/constants/BranchCode.d.ts +4 -0
- package/dist/constants/BranchCode.js +42 -0
- package/dist/handlers/deleteAccessTokenSession.d.ts +2 -2
- package/dist/handlers/deleteAccessTokenSession.js +2 -2
- package/dist/handlers/getSession.js +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/postToken.d.ts +6 -6
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +67 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +71 -0
- package/dist/handlers.d.ts +43 -0
- package/dist/handlers.js +297 -0
- package/dist/icons/BellRingIcon.d.ts +2 -0
- package/dist/icons/BellRingIcon.js +4 -0
- package/dist/services/httpRequest.js +0 -1
- package/dist/services/queries.js +2758 -2758
- package/dist/styles/theme.css +773 -773
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +252 -252
- package/dist/ui/Menu/menu.recipe.d.ts +14 -14
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PinInput/PinInput.d.ts +12 -12
- package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/utils/dataUrlToBlob.d.ts +1 -0
- package/dist/utils/dataUrlToBlob.js +11 -0
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
- package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
- package/dist/utils/getGameName.d.ts +1 -0
- package/dist/utils/getGameName.js +6 -0
- package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
- package/dist/utils/isBetween3amAnd3pm.js +5 -0
- package/dist/utils/resizeImageSize.d.ts +2 -0
- package/dist/utils/resizeImageSize.js +11 -0
- package/package.json +171 -171
- package/dist/components/Banner/Banner.client.d.ts +0 -12
- package/dist/components/Banner/Banner.client.js +0 -49
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
@keyframes arrow-green-flash {
|
|
2
|
-
0% {
|
|
3
|
-
color: #abefc6;
|
|
4
|
-
}
|
|
5
|
-
100% {
|
|
6
|
-
color: #079455;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.animate-arrow-green-flash-1 {
|
|
11
|
-
animation: arrow-green-flash 0.4s infinite;
|
|
12
|
-
animation-delay: -0.2s;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.animate-arrow-green-flash-2 {
|
|
16
|
-
animation: arrow-green-flash 0.4s infinite;
|
|
17
|
-
animation-delay: -0.1s;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.animate-arrow-green-flash-3 {
|
|
21
|
-
animation: arrow-green-flash 0.4s infinite;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@keyframes arrow-red-flash {
|
|
25
|
-
0%,
|
|
26
|
-
100% {
|
|
27
|
-
color: #f97066;
|
|
28
|
-
}
|
|
29
|
-
50% {
|
|
30
|
-
color: #fecdca;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.animate-arrow-red-flash-1 {
|
|
35
|
-
animation: arrow-red-flash 0.4s infinite;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.animate-arrow-red-flash-2 {
|
|
39
|
-
animation: arrow-red-flash 0.4s infinite;
|
|
40
|
-
animation-delay: -0.1s;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.animate-arrow-red-flash-3 {
|
|
44
|
-
animation: arrow-red-flash 0.4s infinite;
|
|
45
|
-
animation-delay: -0.2s;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Animated BG */
|
|
49
|
-
@keyframes rotate {
|
|
50
|
-
to {
|
|
51
|
-
transform: rotate(1turn);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.light-rays {
|
|
56
|
-
position: absolute;
|
|
57
|
-
top: 0;
|
|
58
|
-
left: 0;
|
|
59
|
-
right: 0;
|
|
60
|
-
bottom: 0;
|
|
61
|
-
overflow: hidden;
|
|
62
|
-
|
|
63
|
-
--first: var(--color-bg-tertiary);
|
|
64
|
-
--second: var(--color-bg-quaternary);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.light-rays::before,
|
|
68
|
-
.light-rays::after {
|
|
69
|
-
content: '';
|
|
70
|
-
position: absolute;
|
|
71
|
-
top: var(--light-rays-top, 150px);
|
|
72
|
-
left: calc(50% - 90px);
|
|
73
|
-
margin: -100vmax;
|
|
74
|
-
width: 200vmax;
|
|
75
|
-
height: 200vmax;
|
|
76
|
-
opacity: 0.6;
|
|
77
|
-
transform-origin: center;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.light-rays::before {
|
|
81
|
-
background: conic-gradient(
|
|
82
|
-
var(--first) 0deg 7.2deg,
|
|
83
|
-
var(--second) 7.2deg 14.4deg,
|
|
84
|
-
var(--first) 14.4deg 21.6deg,
|
|
85
|
-
var(--second) 21.6deg 28.8deg,
|
|
86
|
-
var(--first) 28.8deg 36deg,
|
|
87
|
-
var(--second) 36deg 43.2deg,
|
|
88
|
-
var(--first) 43.2deg 50.4deg,
|
|
89
|
-
var(--second) 50.4deg 57.6deg,
|
|
90
|
-
var(--first) 57.6deg 64.8deg,
|
|
91
|
-
var(--second) 64.8deg 72deg,
|
|
92
|
-
var(--first) 72deg 79.2deg,
|
|
93
|
-
var(--second) 79.2deg 86.4deg,
|
|
94
|
-
var(--first) 86.4deg 93.6deg,
|
|
95
|
-
var(--second) 93.6deg 100.8deg,
|
|
96
|
-
var(--first) 100.8deg 108deg,
|
|
97
|
-
var(--second) 108deg 115.2deg,
|
|
98
|
-
var(--first) 115.2deg 122.4deg,
|
|
99
|
-
var(--second) 122.4deg 129.6deg,
|
|
100
|
-
var(--first) 129.6deg 136.8deg,
|
|
101
|
-
var(--second) 136.8deg 144deg,
|
|
102
|
-
var(--first) 144deg 151.2deg,
|
|
103
|
-
var(--second) 151.2deg 158.4deg,
|
|
104
|
-
var(--first) 158.4deg 165.6deg,
|
|
105
|
-
var(--second) 165.6deg 172.8deg,
|
|
106
|
-
var(--first) 172.8deg 180deg,
|
|
107
|
-
var(--second) 180deg 187.2deg,
|
|
108
|
-
var(--first) 187.2deg 194.4deg,
|
|
109
|
-
var(--second) 194.4deg 201.6deg,
|
|
110
|
-
var(--first) 201.6deg 208.8deg,
|
|
111
|
-
var(--second) 208.8deg 216deg,
|
|
112
|
-
var(--first) 216deg 223.2deg,
|
|
113
|
-
var(--second) 223.2deg 230.4deg,
|
|
114
|
-
var(--first) 230.4deg 237.6deg,
|
|
115
|
-
var(--second) 237.6deg 244.8deg,
|
|
116
|
-
var(--first) 244.8deg 252deg,
|
|
117
|
-
var(--second) 252deg 259.2deg,
|
|
118
|
-
var(--first) 259.2deg 266.4deg,
|
|
119
|
-
var(--second) 266.4deg 273.6deg,
|
|
120
|
-
var(--first) 273.6deg 280.8deg,
|
|
121
|
-
var(--second) 280.8deg 288deg,
|
|
122
|
-
var(--first) 288deg 295.2deg,
|
|
123
|
-
var(--second) 295.2deg 302.4deg,
|
|
124
|
-
var(--first) 302.4deg 309.6deg,
|
|
125
|
-
var(--second) 309.6deg 316.8deg,
|
|
126
|
-
var(--first) 316.8deg 324deg,
|
|
127
|
-
var(--second) 324deg 331.2deg,
|
|
128
|
-
var(--first) 331.2deg 338.4deg,
|
|
129
|
-
var(--second) 338.4deg 345.6deg,
|
|
130
|
-
var(--first) 345.6deg 352.8deg,
|
|
131
|
-
var(--second) 352.8deg 360deg
|
|
132
|
-
);
|
|
133
|
-
animation: rotate 20s linear infinite;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@media (max-width: 1024px) {
|
|
137
|
-
.light-rays::before,
|
|
138
|
-
.light-rays::after {
|
|
139
|
-
left: auto;
|
|
140
|
-
right: 11%;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* ScrollArea.module.css */
|
|
145
|
-
.scrollArea {
|
|
146
|
-
overflow-y: scroll;
|
|
147
|
-
padding-right: 4px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/* WebKit-based browsers */
|
|
151
|
-
.scrollArea::-webkit-scrollbar {
|
|
152
|
-
width: 8px;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.scrollArea::-webkit-scrollbar-track {
|
|
156
|
-
background: var(--color-bg-primary-alt);
|
|
157
|
-
border-radius: 9999px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.scrollArea::-webkit-scrollbar-thumb {
|
|
161
|
-
background-color: var(--color-bg-quaternary);
|
|
162
|
-
border-radius: 9999px;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@keyframes waveColor {
|
|
166
|
-
0%,
|
|
167
|
-
2.5% {
|
|
168
|
-
color: var(--wave-highlight-color);
|
|
169
|
-
}
|
|
170
|
-
2.51%,
|
|
171
|
-
100% {
|
|
172
|
-
color: var(--color-brand-300);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.animate-wave-color-success {
|
|
177
|
-
--wave-highlight-color: var(--color-success-800);
|
|
178
|
-
animation: waveColor 4s ease-in-out infinite;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.animate-wave-color-error {
|
|
182
|
-
--wave-highlight-color: var(--color-error-600);
|
|
183
|
-
animation: waveColor 4s ease-in-out infinite;
|
|
184
|
-
}
|
|
1
|
+
@keyframes arrow-green-flash {
|
|
2
|
+
0% {
|
|
3
|
+
color: #abefc6;
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
color: #079455;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.animate-arrow-green-flash-1 {
|
|
11
|
+
animation: arrow-green-flash 0.4s infinite;
|
|
12
|
+
animation-delay: -0.2s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.animate-arrow-green-flash-2 {
|
|
16
|
+
animation: arrow-green-flash 0.4s infinite;
|
|
17
|
+
animation-delay: -0.1s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.animate-arrow-green-flash-3 {
|
|
21
|
+
animation: arrow-green-flash 0.4s infinite;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes arrow-red-flash {
|
|
25
|
+
0%,
|
|
26
|
+
100% {
|
|
27
|
+
color: #f97066;
|
|
28
|
+
}
|
|
29
|
+
50% {
|
|
30
|
+
color: #fecdca;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.animate-arrow-red-flash-1 {
|
|
35
|
+
animation: arrow-red-flash 0.4s infinite;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.animate-arrow-red-flash-2 {
|
|
39
|
+
animation: arrow-red-flash 0.4s infinite;
|
|
40
|
+
animation-delay: -0.1s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.animate-arrow-red-flash-3 {
|
|
44
|
+
animation: arrow-red-flash 0.4s infinite;
|
|
45
|
+
animation-delay: -0.2s;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Animated BG */
|
|
49
|
+
@keyframes rotate {
|
|
50
|
+
to {
|
|
51
|
+
transform: rotate(1turn);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.light-rays {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
|
|
63
|
+
--first: var(--color-bg-tertiary);
|
|
64
|
+
--second: var(--color-bg-quaternary);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.light-rays::before,
|
|
68
|
+
.light-rays::after {
|
|
69
|
+
content: '';
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: var(--light-rays-top, 150px);
|
|
72
|
+
left: calc(50% - 90px);
|
|
73
|
+
margin: -100vmax;
|
|
74
|
+
width: 200vmax;
|
|
75
|
+
height: 200vmax;
|
|
76
|
+
opacity: 0.6;
|
|
77
|
+
transform-origin: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.light-rays::before {
|
|
81
|
+
background: conic-gradient(
|
|
82
|
+
var(--first) 0deg 7.2deg,
|
|
83
|
+
var(--second) 7.2deg 14.4deg,
|
|
84
|
+
var(--first) 14.4deg 21.6deg,
|
|
85
|
+
var(--second) 21.6deg 28.8deg,
|
|
86
|
+
var(--first) 28.8deg 36deg,
|
|
87
|
+
var(--second) 36deg 43.2deg,
|
|
88
|
+
var(--first) 43.2deg 50.4deg,
|
|
89
|
+
var(--second) 50.4deg 57.6deg,
|
|
90
|
+
var(--first) 57.6deg 64.8deg,
|
|
91
|
+
var(--second) 64.8deg 72deg,
|
|
92
|
+
var(--first) 72deg 79.2deg,
|
|
93
|
+
var(--second) 79.2deg 86.4deg,
|
|
94
|
+
var(--first) 86.4deg 93.6deg,
|
|
95
|
+
var(--second) 93.6deg 100.8deg,
|
|
96
|
+
var(--first) 100.8deg 108deg,
|
|
97
|
+
var(--second) 108deg 115.2deg,
|
|
98
|
+
var(--first) 115.2deg 122.4deg,
|
|
99
|
+
var(--second) 122.4deg 129.6deg,
|
|
100
|
+
var(--first) 129.6deg 136.8deg,
|
|
101
|
+
var(--second) 136.8deg 144deg,
|
|
102
|
+
var(--first) 144deg 151.2deg,
|
|
103
|
+
var(--second) 151.2deg 158.4deg,
|
|
104
|
+
var(--first) 158.4deg 165.6deg,
|
|
105
|
+
var(--second) 165.6deg 172.8deg,
|
|
106
|
+
var(--first) 172.8deg 180deg,
|
|
107
|
+
var(--second) 180deg 187.2deg,
|
|
108
|
+
var(--first) 187.2deg 194.4deg,
|
|
109
|
+
var(--second) 194.4deg 201.6deg,
|
|
110
|
+
var(--first) 201.6deg 208.8deg,
|
|
111
|
+
var(--second) 208.8deg 216deg,
|
|
112
|
+
var(--first) 216deg 223.2deg,
|
|
113
|
+
var(--second) 223.2deg 230.4deg,
|
|
114
|
+
var(--first) 230.4deg 237.6deg,
|
|
115
|
+
var(--second) 237.6deg 244.8deg,
|
|
116
|
+
var(--first) 244.8deg 252deg,
|
|
117
|
+
var(--second) 252deg 259.2deg,
|
|
118
|
+
var(--first) 259.2deg 266.4deg,
|
|
119
|
+
var(--second) 266.4deg 273.6deg,
|
|
120
|
+
var(--first) 273.6deg 280.8deg,
|
|
121
|
+
var(--second) 280.8deg 288deg,
|
|
122
|
+
var(--first) 288deg 295.2deg,
|
|
123
|
+
var(--second) 295.2deg 302.4deg,
|
|
124
|
+
var(--first) 302.4deg 309.6deg,
|
|
125
|
+
var(--second) 309.6deg 316.8deg,
|
|
126
|
+
var(--first) 316.8deg 324deg,
|
|
127
|
+
var(--second) 324deg 331.2deg,
|
|
128
|
+
var(--first) 331.2deg 338.4deg,
|
|
129
|
+
var(--second) 338.4deg 345.6deg,
|
|
130
|
+
var(--first) 345.6deg 352.8deg,
|
|
131
|
+
var(--second) 352.8deg 360deg
|
|
132
|
+
);
|
|
133
|
+
animation: rotate 20s linear infinite;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media (max-width: 1024px) {
|
|
137
|
+
.light-rays::before,
|
|
138
|
+
.light-rays::after {
|
|
139
|
+
left: auto;
|
|
140
|
+
right: 11%;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ScrollArea.module.css */
|
|
145
|
+
.scrollArea {
|
|
146
|
+
overflow-y: scroll;
|
|
147
|
+
padding-right: 4px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* WebKit-based browsers */
|
|
151
|
+
.scrollArea::-webkit-scrollbar {
|
|
152
|
+
width: 8px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.scrollArea::-webkit-scrollbar-track {
|
|
156
|
+
background: var(--color-bg-primary-alt);
|
|
157
|
+
border-radius: 9999px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.scrollArea::-webkit-scrollbar-thumb {
|
|
161
|
+
background-color: var(--color-bg-quaternary);
|
|
162
|
+
border-radius: 9999px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@keyframes waveColor {
|
|
166
|
+
0%,
|
|
167
|
+
2.5% {
|
|
168
|
+
color: var(--wave-highlight-color);
|
|
169
|
+
}
|
|
170
|
+
2.51%,
|
|
171
|
+
100% {
|
|
172
|
+
color: var(--color-brand-300);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.animate-wave-color-success {
|
|
177
|
+
--wave-highlight-color: var(--color-success-800);
|
|
178
|
+
animation: waveColor 4s ease-in-out infinite;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.animate-wave-color-error {
|
|
182
|
+
--wave-highlight-color: var(--color-error-600);
|
|
183
|
+
animation: waveColor 4s ease-in-out infinite;
|
|
184
|
+
}
|
|
@@ -21,6 +21,26 @@ import { formatNumber } from '../../utils/formatNumber.js';
|
|
|
21
21
|
import { Empty } from '../shared/Empty.js';
|
|
22
22
|
import { TableFilters } from './TableFilters.js';
|
|
23
23
|
import { useTransactionPropsContext } from './TransactionContext.js';
|
|
24
|
+
/**
|
|
25
|
+
* Maps deposit type strings to required/preferred display names.
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* - Add new mappings to the typeMapping object below
|
|
29
|
+
* - All mapped values will be capitalized using the capitalize function
|
|
30
|
+
* - Unmapped types will fall back to capitalized underscore-delimited format
|
|
31
|
+
*
|
|
32
|
+
* Examples:
|
|
33
|
+
* - 'PISOPAY_CHECKOUT' → 'Pisopay'
|
|
34
|
+
* - 'GCASH_DIRECT' → 'Gcash' (if added to mapping)
|
|
35
|
+
* - 'UNMAPPED_TYPE' → 'Unmapped Type' (fallback)
|
|
36
|
+
*/
|
|
37
|
+
const getDepositTypeDisplayName = (type) => {
|
|
38
|
+
const typeMapping = {
|
|
39
|
+
'PISOPAY_CHECKOUT': 'PISOPAY',
|
|
40
|
+
};
|
|
41
|
+
const displayValue = typeMapping[type] || type;
|
|
42
|
+
return capitalize(displayValue, { delimiter: capitalize.delimiters.UNDERSCORE });
|
|
43
|
+
};
|
|
24
44
|
export function DepositRecordsTable(props) {
|
|
25
45
|
const router = useRouter();
|
|
26
46
|
const pathname = usePathname();
|
|
@@ -93,9 +113,7 @@ export function DepositRecordsTable(props) {
|
|
|
93
113
|
depositStatus: true,
|
|
94
114
|
} }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
95
115
|
? 'Fetching latest deposit records...'
|
|
96
|
-
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: twMerge('scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-track:bg-transparent lg:rounded-t-xl', classNames.scrollbarThumb || 'scrollbar-thumb:bg-bg-quaternary'), children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Deposit No." }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Deposit Method" }), _jsx(Table.Heading, { children: "Applied Amount" }), _jsx(Table.Heading, { children: "Received Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Deposit Time" }), _jsx(Table.Heading, { children: "Received Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.depositNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children:
|
|
97
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
98
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.amount, {
|
|
116
|
+
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: twMerge('scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-track:bg-transparent lg:rounded-t-xl', classNames.scrollbarThumb || 'scrollbar-thumb:bg-bg-quaternary'), children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Deposit No." }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Deposit Method" }), _jsx(Table.Heading, { children: "Applied Amount" }), _jsx(Table.Heading, { children: "Received Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Deposit Time" }), _jsx(Table.Heading, { children: "Received Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.depositNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: getDepositTypeDisplayName(data.type) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.amount, {
|
|
99
117
|
currency: localeInfo.currency.code,
|
|
100
118
|
minDecimalPlaces: 2,
|
|
101
119
|
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.netAmount, {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CSSProperties, type RefObject } from 'react';
|
|
2
|
+
import { type ValidateFileError } from '../../utils/validateFile';
|
|
3
|
+
export interface IdDocumentFieldProps extends UseIdDocumentFieldProps {
|
|
4
|
+
ref?: RefObject<HTMLDivElement | null>;
|
|
5
|
+
id?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
className?: string;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
onError?: (error: ValidateFileError) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function IdDocumentField__client(props: IdDocumentFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* -------------------------------------
|
|
17
|
+
* Context
|
|
18
|
+
* -------------------------------------
|
|
19
|
+
*/
|
|
20
|
+
interface UseIdDocumentFieldProps {
|
|
21
|
+
value?: string;
|
|
22
|
+
onChange?: (value: string) => void;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext } from '@ark-ui/react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { useEffect, useId, useRef, useState, } from 'react';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { useMediaQuery } from 'usehooks-ts';
|
|
7
|
+
import { useCamera } from '../../client/hooks/useCamera.js';
|
|
8
|
+
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
9
|
+
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
10
|
+
import { useFileQuery } from '../../client/hooks/useFileQuery.js';
|
|
11
|
+
import { useUploadImageFileMutation } from '../../client/hooks/useUploadImageFileMutation.js';
|
|
12
|
+
import { createContext } from '../../client/utils/createContext.js';
|
|
13
|
+
import { toaster } from '../../client/utils/toaster.js';
|
|
14
|
+
import { Camera01Icon } from '../../icons/Camera01Icon.js';
|
|
15
|
+
import { CameraOffIcon } from '../../icons/CameraOffIcon.js';
|
|
16
|
+
import { CheckCircleIcon } from '../../icons/CheckCircleIcon.js';
|
|
17
|
+
import { RefreshCcw01Icon } from '../../icons/RefreshCcw01Icon.js';
|
|
18
|
+
import { Spinner02Icon } from '../../icons/Spinner02Icon.js';
|
|
19
|
+
import { UploadCloud02Icon } from '../../icons/UploadCloud02Icon.js';
|
|
20
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
21
|
+
import { Button } from '../../ui/Button/index.js';
|
|
22
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
23
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
24
|
+
import { validateFile } from '../../utils/validateFile.js';
|
|
25
|
+
export function IdDocumentField__client(props) {
|
|
26
|
+
const context = useIdDocumentField(props);
|
|
27
|
+
return (_jsxs(IdDocumentFieldProvider, { value: context, children: [_jsxs("div", { ref: props.ref, id: props.id, style: props.style, className: twMerge('border-border-primary bg-bg-primary group relative aspect-[352/180] w-full shrink-0 rounded-xl border p-xl', props.className), onDragOver: (e) => e.preventDefault(), onDragEnter: (e) => e.preventDefault(), onDragLeave: (e) => e.preventDefault(), onDrop: (e) => {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
const file = e.dataTransfer.files?.[0];
|
|
30
|
+
if (!file)
|
|
31
|
+
return;
|
|
32
|
+
const error = validateFile(file);
|
|
33
|
+
if (error)
|
|
34
|
+
return props.onError?.(error);
|
|
35
|
+
context.mutation.mutate({ file });
|
|
36
|
+
}, "aria-describedby": context.field?.ariaDescribedby, children: [_jsx("input", { id: context.field?.ids?.control, ref: context.inputRef, type: "file", accept: "image/png, image/jpeg", onChange: (e) => {
|
|
37
|
+
const file = e.target.files?.[0];
|
|
38
|
+
if (!file)
|
|
39
|
+
return;
|
|
40
|
+
const error = validateFile(file);
|
|
41
|
+
if (error)
|
|
42
|
+
return props.onError?.(error);
|
|
43
|
+
context.mutation.mutate({ file });
|
|
44
|
+
}, disabled: context.field?.disabled ||
|
|
45
|
+
context.query.isLoading ||
|
|
46
|
+
context.mutation.isPending ||
|
|
47
|
+
props.disabled, readOnly: context.field?.readOnly || props.readOnly, required: context.field?.required || props.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: _jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" }) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
|
|
48
|
+
context.inputRef.current?.click();
|
|
49
|
+
}, disabled: context.field?.disabled ||
|
|
50
|
+
context.field?.readOnly ||
|
|
51
|
+
context.query.isLoading ||
|
|
52
|
+
context.mutation.isPending ||
|
|
53
|
+
props.disabled ||
|
|
54
|
+
props.readOnly, className: "text-button-secondary-fg font-semibold disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
|
|
55
|
+
context.disclosure.setOpen(true);
|
|
56
|
+
}, disabled: context.field?.disabled ||
|
|
57
|
+
context.field?.readOnly ||
|
|
58
|
+
context.query.isLoading ||
|
|
59
|
+
context.mutation.isPending ||
|
|
60
|
+
props.disabled ||
|
|
61
|
+
props.readOnly, children: "Take a photo" })] })), context.query.data?.url && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.query.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "backdrop-blur-xs absolute right-2 top-2 rounded-full bg-white/10 p-1", onClick: () => {
|
|
62
|
+
context.setValue('');
|
|
63
|
+
}, children: _jsx(XIcon, { className: "size-5" }) })] }))] }), _jsx(Camera, {})] }));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* -------------------------------------
|
|
67
|
+
* Camera
|
|
68
|
+
* -------------------------------------
|
|
69
|
+
*/
|
|
70
|
+
function Camera() {
|
|
71
|
+
const context = useIdDocumentFieldContext();
|
|
72
|
+
return (_jsx(Dialog.Root, { open: context.disclosure.open, onOpenChange: (details) => {
|
|
73
|
+
context.disclosure.setOpen(details.open);
|
|
74
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Picture of Your Front ID" }), _jsxs(Dialog.Description, { className: "text-text-tertiary-600 mt-md text-center text-xs lg:text-base", children: ["Make sure your ID is clearly visible, well-lit, and not blurry.", ' ', _jsx("br", { className: "hidden lg:block" }), "Avoid glare or reflections, and ensure all corners are within\u00A0the\u00A0frame."] }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "text-text-placeholder-subtle size-10 text-center lg:size-12" }), _jsx("h2", { className: "mt-3 text-sm font-semibold lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "text-text-tertiary-600 mt-0.5 text-center text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
|
|
75
|
+
context.camera.reopen();
|
|
76
|
+
}, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "text-text-placeholder size-8" }) })), context.camera.data && (_jsx("div", { className: "border-border-disabled aspect-[4/3] w-full overflow-hidden rounded-md border bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "disabled:bg-bg-disabled disabled:text-text-disabled mx-auto w-full px-xl py-lg lg:w-[10rem]", onClick: () => {
|
|
77
|
+
context.camera.snap({
|
|
78
|
+
crop: context.guideRef.current?.getBoundingClientRect(),
|
|
79
|
+
});
|
|
80
|
+
}, disabled: context.camera.snapping ||
|
|
81
|
+
context.camera.loading ||
|
|
82
|
+
!!context.camera.error, children: [context.camera.snapping ? (_jsx(Spinner02Icon, { className: "size-5" })) : (_jsx(Camera01Icon, { className: "size-5" })), "Capture"] }) })), context.camera.data && (_jsxs("div", { className: "mt-5 flex gap-3 lg:mt-10 lg:justify-center", children: [_jsxs(Button, { onClick: () => {
|
|
83
|
+
const file = context.camera.data?.file;
|
|
84
|
+
if (!file)
|
|
85
|
+
return;
|
|
86
|
+
context.mutation.mutate({ file });
|
|
87
|
+
context.disclosure.setOpen(false);
|
|
88
|
+
}, className: "w-full lg:w-[10rem]", children: [_jsx(CheckCircleIcon, { className: "size-5" }), "Use Photo"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
89
|
+
context.camera.reset();
|
|
90
|
+
}, className: "w-full lg:w-[10rem]", children: [_jsx(RefreshCcw01Icon, { className: "size-5" }), " Retake"] })] }))] }) })] }) }));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* -------------------------------------
|
|
94
|
+
* Video
|
|
95
|
+
* -------------------------------------
|
|
96
|
+
*/
|
|
97
|
+
function Video() {
|
|
98
|
+
const id = useId();
|
|
99
|
+
const context = useIdDocumentFieldContext();
|
|
100
|
+
const [maskBox, setMaskBox] = useState({
|
|
101
|
+
x: 0,
|
|
102
|
+
y: 0,
|
|
103
|
+
width: 0,
|
|
104
|
+
height: 0,
|
|
105
|
+
});
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const update = () => {
|
|
108
|
+
const guide = context.guideRef.current;
|
|
109
|
+
const mask = context.maskRef.current;
|
|
110
|
+
if (!guide || !mask)
|
|
111
|
+
return;
|
|
112
|
+
const guideRect = guide.getBoundingClientRect();
|
|
113
|
+
const maskRect = mask.getBoundingClientRect();
|
|
114
|
+
const x = guideRect.left - maskRect.left;
|
|
115
|
+
const y = guideRect.top - maskRect.top;
|
|
116
|
+
const width = guideRect.width;
|
|
117
|
+
const height = guideRect.height;
|
|
118
|
+
if (width && height) {
|
|
119
|
+
setMaskBox({
|
|
120
|
+
x,
|
|
121
|
+
y,
|
|
122
|
+
width,
|
|
123
|
+
height,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const observer = new ResizeObserver(update);
|
|
128
|
+
if (context.guideRef.current)
|
|
129
|
+
observer.observe(context.guideRef.current);
|
|
130
|
+
if (context.maskRef.current)
|
|
131
|
+
observer.observe(context.maskRef.current);
|
|
132
|
+
requestAnimationFrame(update);
|
|
133
|
+
return () => observer.disconnect();
|
|
134
|
+
}, [context.guideRef, context.maskRef]);
|
|
135
|
+
return (_jsxs("div", { className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
|
|
136
|
+
? 'block'
|
|
137
|
+
: 'hidden'), children: [_jsx("video", { ...context.camera.videoProps }), _jsx("svg", { className: "pointer-events-none absolute -inset-4 size-[200%]", children: _jsx("defs", { children: _jsxs("mask", { id: id, maskUnits: "userSpaceOnUse", children: [_jsx("rect", { x: "0", y: "0", width: "200%", height: "200%", fill: "white" }), _jsx("rect", { x: maskBox.x, y: maskBox.y, width: maskBox.width, height: maskBox.height, fill: "black", rx: "8", ry: "8" })] }) }) }), _jsx("div", { ref: context.maskRef, className: "absolute -inset-4 size-[200%] bg-black/60 backdrop-blur-sm", style: {
|
|
138
|
+
mask: `url(#${id})`,
|
|
139
|
+
WebkitMask: `url(#${id})`,
|
|
140
|
+
maskRepeat: 'no-repeat',
|
|
141
|
+
WebkitMaskRepeat: 'no-repeat',
|
|
142
|
+
} }), _jsx("div", { ref: context.guideRef, className: "border-utility-warning-700 pointer-events-none absolute left-1/2 top-1/2 z-10 aspect-[85.6/53.98] w-[calc(100%-1rem)] max-w-[24.688rem] -translate-x-1/2 -translate-y-1/2 rounded-md border-2 border-dashed transition-all duration-200" })] }));
|
|
143
|
+
}
|
|
144
|
+
function useIdDocumentField(props) {
|
|
145
|
+
const field = useFieldContext();
|
|
146
|
+
const [value, setValue] = useControllableState({
|
|
147
|
+
value: props.value,
|
|
148
|
+
defaultValue: props.defaultValue ?? '',
|
|
149
|
+
onChange: props.onChange,
|
|
150
|
+
});
|
|
151
|
+
const query = useFileQuery(value, {
|
|
152
|
+
refetchInterval({ state }) {
|
|
153
|
+
return !state.data || state.data.status === 'UPLOADING' ? 1000 : false;
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
const mutation = useUploadImageFileMutation({
|
|
157
|
+
onSuccess(id) {
|
|
158
|
+
setValue(id);
|
|
159
|
+
},
|
|
160
|
+
onMutate() {
|
|
161
|
+
setValue('');
|
|
162
|
+
},
|
|
163
|
+
onError(error) {
|
|
164
|
+
toaster.error({
|
|
165
|
+
title: 'Upload Failed',
|
|
166
|
+
description: error.message,
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
onSettled() {
|
|
170
|
+
if (inputRef.current) {
|
|
171
|
+
inputRef.current.value = '';
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
const inputRef = useRef(null);
|
|
176
|
+
const maskRef = useRef(null);
|
|
177
|
+
const guideRef = useRef(null);
|
|
178
|
+
const desktop = useMediaQuery('(min-width: 1024px)');
|
|
179
|
+
const camera = useCamera({
|
|
180
|
+
video: {
|
|
181
|
+
facingMode: desktop ? 'user' : 'environment',
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
const disclosure = useDisclosure({
|
|
185
|
+
onOpenChange(open) {
|
|
186
|
+
if (open) {
|
|
187
|
+
camera.open();
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
return {
|
|
192
|
+
field,
|
|
193
|
+
value,
|
|
194
|
+
setValue,
|
|
195
|
+
query,
|
|
196
|
+
mutation,
|
|
197
|
+
camera,
|
|
198
|
+
disclosure,
|
|
199
|
+
inputRef,
|
|
200
|
+
guideRef,
|
|
201
|
+
maskRef,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const [IdDocumentFieldProvider, useIdDocumentFieldContext] = createContext();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
import { Spinner02Icon } from '../../icons/Spinner02Icon.js';
|
|
5
|
+
const Component = dynamic(() => import('./IdDocumentField.client.js').then((mod) => mod.IdDocumentField__client), {
|
|
6
|
+
ssr: false,
|
|
7
|
+
loading: () => (_jsx("div", { className: "border-border-primary bg-bg-primary flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border", children: _jsx(Spinner02Icon, { className: "text-text-quinary size-8" }) })),
|
|
8
|
+
});
|
|
9
|
+
export function IdDocumentField(props) {
|
|
10
|
+
return _jsx(Component, { ...props });
|
|
11
|
+
}
|