@incodetech/web 2.0.0-alpha.2 → 2.0.0-alpha.4
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/{styles/core.css → base.css} +53 -57
- package/dist/email/email.es.js +1 -1
- package/dist/email/styles.css +11 -11
- package/dist/flow/styles.css +688 -1
- package/dist/{incodeModule-BF5MX9GT.js → incodeModule-Ct9jp5k6.js} +22 -19
- package/dist/index.es.js +18 -18
- package/dist/phone/phone.es.js +1 -1
- package/dist/phone/styles.css +31 -31
- package/dist/selfie/selfie.es.js +16 -16
- package/dist/selfie/styles.css +0 -51
- package/dist/themes/dark.css +652 -0
- package/dist/types/dark.d.ts +1 -0
- package/dist/types/light.d.ts +1 -0
- package/dist/types/themes/light.d.ts +1 -0
- package/package.json +12 -6
- package/.turbo/turbo-build.log +0 -58
- package/.turbo/turbo-coverage.log +0 -23
- package/.turbo/turbo-format.log +0 -6
- package/.turbo/turbo-lint$colon$fix.log +0 -6
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +0 -1033
- package/.turbo/turbo-typecheck.log +0 -5
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/email/email.tsx.html +0 -850
- package/coverage/email/emailInput.tsx.html +0 -340
- package/coverage/email/index.html +0 -131
- package/coverage/favicon.png +0 -0
- package/coverage/flow/flow.tsx.html +0 -961
- package/coverage/flow/flowCompleted.tsx.html +0 -448
- package/coverage/flow/flowInit.ts.html +0 -367
- package/coverage/flow/flowStart.tsx.html +0 -208
- package/coverage/flow/index.html +0 -221
- package/coverage/flow/preloadFlow.ts.html +0 -598
- package/coverage/flow/unsupportedModule.tsx.html +0 -202
- package/coverage/flow/useFlowInitialization.ts.html +0 -469
- package/coverage/flow/useModuleLoader.ts.html +0 -361
- package/coverage/hooks/index.html +0 -116
- package/coverage/hooks/useManager.ts.html +0 -205
- package/coverage/index.html +0 -401
- package/coverage/permissions/boldWithArrow.tsx.html +0 -208
- package/coverage/permissions/denied.tsx.html +0 -172
- package/coverage/permissions/deniedAndroid.tsx.html +0 -253
- package/coverage/permissions/deniedDesktop.tsx.html +0 -277
- package/coverage/permissions/deniedIOS.tsx.html +0 -304
- package/coverage/permissions/deniedInstructions.tsx.html +0 -142
- package/coverage/permissions/iconWrapper.tsx.html +0 -130
- package/coverage/permissions/index.html +0 -251
- package/coverage/permissions/learnMore.tsx.html +0 -340
- package/coverage/permissions/numberedStep.tsx.html +0 -127
- package/coverage/permissions/permissions.tsx.html +0 -289
- package/coverage/phone/index.html +0 -116
- package/coverage/phone/phoneInput.tsx.html +0 -832
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/selfie/index.html +0 -131
- package/coverage/selfie/selfie.tsx.html +0 -334
- package/coverage/selfie/tutorial.tsx.html +0 -214
- package/coverage/shared/baseTutorial/baseTutorial.tsx.html +0 -250
- package/coverage/shared/baseTutorial/index.html +0 -131
- package/coverage/shared/baseTutorial/replaceBaseTutorial.ts.html +0 -289
- package/coverage/shared/button/button.tsx.html +0 -226
- package/coverage/shared/button/index.html +0 -116
- package/coverage/shared/componentRoot/incodeComponent.tsx.html +0 -121
- package/coverage/shared/componentRoot/index.html +0 -116
- package/coverage/shared/countries/countries.ts.html +0 -502
- package/coverage/shared/countries/index.html +0 -116
- package/coverage/shared/icons/chevronDown.tsx.html +0 -151
- package/coverage/shared/icons/index.html +0 -131
- package/coverage/shared/icons/successIcon.tsx.html +0 -163
- package/coverage/shared/loader/index.html +0 -116
- package/coverage/shared/loader/loadingIcon.tsx.html +0 -286
- package/coverage/shared/otpInput/index.html +0 -116
- package/coverage/shared/otpInput/otpInput.tsx.html +0 -808
- package/coverage/shared/page/index.html +0 -146
- package/coverage/shared/page/page.tsx.html +0 -358
- package/coverage/shared/page/pageUiConfig.ts.html +0 -277
- package/coverage/shared/page/verifiedByIncode.tsx.html +0 -310
- package/coverage/shared/spacer/index.html +0 -116
- package/coverage/shared/spacer/spacer.tsx.html +0 -349
- package/coverage/shared/spinner/index.html +0 -116
- package/coverage/shared/spinner/spinner.tsx.html +0 -280
- package/coverage/shared/title/index.html +0 -116
- package/coverage/shared/title/title.tsx.html +0 -121
- package/coverage/shared/uiConfig/index.html +0 -116
- package/coverage/shared/uiConfig/uiConfig.ts.html +0 -193
- package/coverage/shared/webComponent/incodeModule.ts.html +0 -172
- package/coverage/shared/webComponent/index.html +0 -131
- package/coverage/shared/webComponent/registerIncodeElement.ts.html +0 -130
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/coverage/styles/cn.tsx.html +0 -148
- package/coverage/styles/fetchTheme.ts.html +0 -349
- package/coverage/styles/index.html +0 -131
- package/dev/README.md +0 -163
- package/dev/getToken.ts +0 -36
- package/dev/headless.html +0 -875
- package/dev/index.html +0 -366
- package/dev/main-headless.tsx +0 -1332
- package/dev/main-orchestrated-flow.tsx +0 -1158
- package/dev/main-preact.tsx +0 -323
- package/dev/main-simplified.tsx +0 -123
- package/dev/main-web-component.tsx +0 -256
- package/dev/main.tsx +0 -332
- package/dev/manual.html +0 -27
- package/dev/orchestrated-flow.html +0 -64
- package/dev/simplified.html +0 -64
- package/dev/tiktok-logo.svg +0 -7
- package/dist/asset-manifest.json +0 -18
- package/src/defineCustomElement.tsx +0 -30
- package/src/email/email.test.tsx +0 -368
- package/src/email/email.tsx +0 -255
- package/src/email/emailInput.test.tsx +0 -264
- package/src/email/emailInput.tsx +0 -85
- package/src/email/styles.css +0 -59
- package/src/flow/flow.test.tsx +0 -796
- package/src/flow/flow.tsx +0 -292
- package/src/flow/flowCompleted.css +0 -30
- package/src/flow/flowCompleted.test.tsx +0 -331
- package/src/flow/flowCompleted.tsx +0 -121
- package/src/flow/flowInit.test.ts +0 -264
- package/src/flow/flowInit.ts +0 -94
- package/src/flow/flowStart.css +0 -58
- package/src/flow/flowStart.test.tsx +0 -49
- package/src/flow/flowStart.tsx +0 -41
- package/src/flow/incode-logo.svg +0 -8
- package/src/flow/index.ts +0 -7
- package/src/flow/preloadFlow.test.ts +0 -421
- package/src/flow/preloadFlow.ts +0 -171
- package/src/flow/styles.css +0 -9
- package/src/flow/unsupportedModule.css +0 -21
- package/src/flow/unsupportedModule.tsx +0 -39
- package/src/flow/useFlowInitialization.test.tsx +0 -292
- package/src/flow/useFlowInitialization.ts +0 -128
- package/src/flow/useModuleLoader.test.tsx +0 -212
- package/src/flow/useModuleLoader.ts +0 -92
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useManager.test.ts +0 -91
- package/src/hooks/useManager.ts +0 -40
- package/src/i18n/index.ts +0 -3
- package/src/i18n/instance.ts +0 -16
- package/src/i18n/setup.ts +0 -184
- package/src/i18n/useTranslation.ts +0 -42
- package/src/index.ts +0 -27
- package/src/permissions/assets/android-dots-icon.svg +0 -7
- package/src/permissions/assets/android-settings-icon.svg +0 -16
- package/src/permissions/assets/android-toggle-icon.svg +0 -20
- package/src/permissions/assets/bank-card-icon.svg +0 -14
- package/src/permissions/assets/camera-icon.svg +0 -12
- package/src/permissions/assets/camera-ios.svg +0 -53
- package/src/permissions/assets/check-icon.svg +0 -8
- package/src/permissions/assets/chrome-icon.svg +0 -43
- package/src/permissions/assets/password-icon.svg +0 -11
- package/src/permissions/assets/permissions-img.svg +0 -51
- package/src/permissions/assets/safari-icon.svg +0 -37
- package/src/permissions/assets/settings-icon.svg +0 -33
- package/src/permissions/assets/toggle-icon.svg +0 -19
- package/src/permissions/assets/warning-icon.svg +0 -6
- package/src/permissions/boldWithArrow.css +0 -9
- package/src/permissions/boldWithArrow.tsx +0 -41
- package/src/permissions/denied.css +0 -37
- package/src/permissions/denied.tsx +0 -29
- package/src/permissions/deniedAndroid.tsx +0 -56
- package/src/permissions/deniedDesktop.css +0 -9
- package/src/permissions/deniedDesktop.tsx +0 -64
- package/src/permissions/deniedIOS.tsx +0 -73
- package/src/permissions/deniedInstructions.tsx +0 -19
- package/src/permissions/iconWrapper.css +0 -9
- package/src/permissions/iconWrapper.tsx +0 -15
- package/src/permissions/learnMore.css +0 -37
- package/src/permissions/learnMore.tsx +0 -85
- package/src/permissions/numberedStep.css +0 -13
- package/src/permissions/numberedStep.tsx +0 -14
- package/src/permissions/permissions.css +0 -13
- package/src/permissions/permissions.tsx +0 -68
- package/src/phone/phone.tsx +0 -246
- package/src/phone/phoneInput.test.tsx +0 -275
- package/src/phone/phoneInput.tsx +0 -249
- package/src/phone/styles.css +0 -158
- package/src/selfie/cameraButton.css +0 -13
- package/src/selfie/cameraButton.tsx +0 -35
- package/src/selfie/capture.css +0 -57
- package/src/selfie/capture.tsx +0 -232
- package/src/selfie/errorModal.tsx +0 -218
- package/src/selfie/errorModalContent.css +0 -33
- package/src/selfie/errorModalContent.tsx +0 -44
- package/src/selfie/faceOutline.css +0 -5
- package/src/selfie/faceOutline.tsx +0 -22
- package/src/selfie/loadingBorder.css +0 -12
- package/src/selfie/loadingBorder.tsx +0 -77
- package/src/selfie/manualCaptureButton.css +0 -13
- package/src/selfie/manualCaptureButton.tsx +0 -35
- package/src/selfie/noMoreAttemptsModal.tsx +0 -44
- package/src/selfie/notification.css +0 -9
- package/src/selfie/notification.tsx +0 -36
- package/src/selfie/retryErrorModal.tsx +0 -56
- package/src/selfie/selfie.test.tsx +0 -458
- package/src/selfie/selfie.tsx +0 -83
- package/src/selfie/selfieTutorial.json +0 -2626
- package/src/selfie/styles.css +0 -1
- package/src/selfie/tutorial.test.tsx +0 -200
- package/src/selfie/tutorial.tsx +0 -43
- package/src/setup.ts +0 -33
- package/src/shared/baseTutorial/baseTutorial.css +0 -21
- package/src/shared/baseTutorial/baseTutorial.test.tsx +0 -184
- package/src/shared/baseTutorial/baseTutorial.tsx +0 -55
- package/src/shared/baseTutorial/replaceBaseTutorial.test.ts +0 -267
- package/src/shared/baseTutorial/replaceBaseTutorial.ts +0 -68
- package/src/shared/button/button.css +0 -55
- package/src/shared/button/button.test.tsx +0 -101
- package/src/shared/button/button.tsx +0 -47
- package/src/shared/componentRoot/incodeComponent.tsx +0 -12
- package/src/shared/countries/countries.test.ts +0 -75
- package/src/shared/countries/countries.ts +0 -139
- package/src/shared/countries/index.ts +0 -6
- package/src/shared/icons/chevronDown.tsx +0 -22
- package/src/shared/icons/index.ts +0 -2
- package/src/shared/icons/successIcon.css +0 -5
- package/src/shared/icons/successIcon.test.tsx +0 -40
- package/src/shared/icons/successIcon.tsx +0 -26
- package/src/shared/loader/loadingIcon.css +0 -28
- package/src/shared/loader/loadingIcon.tsx +0 -67
- package/src/shared/lottie/lottie.tsx +0 -108
- package/src/shared/otpInput/otpInput.css +0 -85
- package/src/shared/otpInput/otpInput.test.tsx +0 -356
- package/src/shared/otpInput/otpInput.tsx +0 -241
- package/src/shared/page/incode-logo.svg +0 -3
- package/src/shared/page/page.css +0 -47
- package/src/shared/page/page.test.tsx +0 -97
- package/src/shared/page/page.tsx +0 -91
- package/src/shared/page/pageUiConfig.test.ts +0 -112
- package/src/shared/page/pageUiConfig.ts +0 -64
- package/src/shared/page/verifiedByIncode.css +0 -5
- package/src/shared/page/verifiedByIncode.tsx +0 -75
- package/src/shared/spacer/spacer.css +0 -149
- package/src/shared/spacer/spacer.test.tsx +0 -143
- package/src/shared/spacer/spacer.tsx +0 -88
- package/src/shared/spinner/index.ts +0 -2
- package/src/shared/spinner/spinner.css +0 -28
- package/src/shared/spinner/spinner.test.tsx +0 -82
- package/src/shared/spinner/spinner.tsx +0 -65
- package/src/shared/title/title.css +0 -7
- package/src/shared/title/title.tsx +0 -12
- package/src/shared/uiConfig/uiConfig.ts +0 -36
- package/src/shared/webComponent/incodeModule.ts +0 -29
- package/src/shared/webComponent/registerIncodeElement.ts +0 -15
- package/src/styles/__mocks__/fetchTheme.ts +0 -19
- package/src/styles/applyTheme.ts +0 -37
- package/src/styles/cn.test.tsx +0 -57
- package/src/styles/cn.tsx +0 -21
- package/src/styles/core.css +0 -12
- package/src/styles/fetchTheme.test.ts +0 -390
- package/src/styles/fetchTheme.ts +0 -88
- package/src/styles/generatePalette.ts +0 -111
- package/src/styles/reset.css +0 -65
- package/src/styles/resolveCssVariableToHex.ts +0 -28
- package/src/styles/tailwind.css +0 -291
- package/src/styles/themeTypes.ts +0 -18
- package/src/styles/tokens/colors.css +0 -190
- package/src/styles/tokens/components.css +0 -174
- package/src/styles/tokens/index.css +0 -4
- package/src/styles/tokens/primitives.css +0 -129
- package/src/styles/tokens/semantic.css +0 -51
- package/src/svg.d.ts +0 -4
- package/src/types/assets.d.ts +0 -1
- package/src/types/custom-elements.d.ts +0 -104
- package/tsconfig.json +0 -22
- package/vite.config.ts +0 -260
- package/vitest.config.ts +0 -40
- package/vitest.setup.ts +0 -16
- /package/dist/{styles/tokens.css → themes/light.css} +0 -0
- /package/dist/types/{core.d.ts → base.d.ts} +0 -0
- /package/dist/types/{styles/core.d.ts → themes/dark.d.ts} +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { getDeviceClass } from '@incodetech/core';
|
|
2
|
-
import type { FC } from 'preact/compat';
|
|
3
|
-
import { DeniedAndroid } from './deniedAndroid';
|
|
4
|
-
import { DeniedDesktop } from './deniedDesktop';
|
|
5
|
-
import { DeniedIOS } from './deniedIOS';
|
|
6
|
-
|
|
7
|
-
export const DeniedInstructions: FC = () => {
|
|
8
|
-
const deviceClass = getDeviceClass();
|
|
9
|
-
|
|
10
|
-
if (deviceClass === 'ios') {
|
|
11
|
-
return <DeniedIOS />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (deviceClass === 'android') {
|
|
15
|
-
return <DeniedAndroid />;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return <DeniedDesktop />;
|
|
19
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'preact/compat';
|
|
2
|
-
import './iconWrapper.css';
|
|
3
|
-
|
|
4
|
-
type IconWrapperProps = {
|
|
5
|
-
icon: string;
|
|
6
|
-
title: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const IconWrapper: FC<IconWrapperProps> = ({ icon, title }) => {
|
|
10
|
-
return (
|
|
11
|
-
<div class="IncodeIconWrapper">
|
|
12
|
-
<img src={icon} alt={title} class="IncodeIconWrapperImage" />
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
@reference "../styles/tailwind.css";
|
|
2
|
-
|
|
3
|
-
.IncodeLearnMoreContainer {
|
|
4
|
-
@apply flex flex-col items-center justify-center;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.IncodeLearnMoreImage {
|
|
8
|
-
@apply w-32 h-32 aspect-square;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.IncodeLearnMoreTitle {
|
|
12
|
-
@apply text-20 text-center font-bold leading-[114%] tracking-[-1px] text-text-body-primary;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.IncodeLearnMoreInstructions {
|
|
16
|
-
@apply flex flex-col items-center gap-24;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.IncodeLearnMoreInstruction {
|
|
20
|
-
@apply flex items-center gap-12 w-full;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.IncodeLearnMoreInstructionIcon {
|
|
24
|
-
@apply flex w-32 h-32 aspect-square shrink-0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.IncodeLearnMoreInstructionIconImage {
|
|
28
|
-
@apply w-full h-full;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.IncodeLearnMoreInstructionText {
|
|
32
|
-
@apply text-18 font-medium leading-[114%] tracking-[-0.5px] text-text-body-primary;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.IncodeLearnMoreActions {
|
|
36
|
-
@apply flex flex-col items-center w-full mt-auto py-16;
|
|
37
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'preact/compat';
|
|
2
|
-
import { useTranslation } from '@/i18n/useTranslation';
|
|
3
|
-
import { Button } from '@/shared/button/button';
|
|
4
|
-
import { Page } from '@/shared/page/page';
|
|
5
|
-
import { Spacer } from '@/shared/spacer/spacer';
|
|
6
|
-
import './learnMore.css';
|
|
7
|
-
import bankCardIcon from './assets/bank-card-icon.svg';
|
|
8
|
-
import cameraIcon from './assets/camera-icon.svg';
|
|
9
|
-
import checkIcon from './assets/check-icon.svg';
|
|
10
|
-
import passwordIcon from './assets/password-icon.svg';
|
|
11
|
-
import warningIcon from './assets/warning-icon.svg';
|
|
12
|
-
|
|
13
|
-
type LearnMoreProps = {
|
|
14
|
-
onAllowPermissions: () => void;
|
|
15
|
-
onQuitProcess: () => void;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const learnMoreInstructions = [
|
|
19
|
-
{
|
|
20
|
-
icon: cameraIcon,
|
|
21
|
-
textKey: 'idv2.permissions.learnMorePage.instructions.1',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
icon: bankCardIcon,
|
|
25
|
-
textKey: 'idv2.permissions.learnMorePage.instructions.2',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
icon: passwordIcon,
|
|
29
|
-
textKey: 'idv2.permissions.learnMorePage.instructions.3',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
icon: checkIcon,
|
|
33
|
-
textKey: 'idv2.permissions.learnMorePage.instructions.4',
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
export const LearnMore: FC<LearnMoreProps> = ({
|
|
38
|
-
onAllowPermissions,
|
|
39
|
-
onQuitProcess,
|
|
40
|
-
}) => {
|
|
41
|
-
const { t } = useTranslation();
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Page className="IncodeLearnMorePage" hideHeader>
|
|
45
|
-
<Spacer size={40} />
|
|
46
|
-
<div class="IncodeLearnMoreContainer">
|
|
47
|
-
<img
|
|
48
|
-
src={warningIcon}
|
|
49
|
-
alt={t('idv2.permissions.learnMorePage.warning')}
|
|
50
|
-
class="IncodeLearnMoreImage"
|
|
51
|
-
/>
|
|
52
|
-
<Spacer size={12} />
|
|
53
|
-
<p class="IncodeLearnMoreTitle">
|
|
54
|
-
{t('idv2.permissions.learnMorePage.title')}
|
|
55
|
-
</p>
|
|
56
|
-
<Spacer size={32} />
|
|
57
|
-
<div class="IncodeLearnMoreInstructions">
|
|
58
|
-
{learnMoreInstructions.map((instruction) => (
|
|
59
|
-
<div key={instruction.textKey} class="IncodeLearnMoreInstruction">
|
|
60
|
-
<div class="IncodeLearnMoreInstructionIcon">
|
|
61
|
-
<img
|
|
62
|
-
src={instruction.icon}
|
|
63
|
-
alt=""
|
|
64
|
-
class="IncodeLearnMoreInstructionIconImage"
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
<span class="IncodeLearnMoreInstructionText">
|
|
68
|
-
{t(instruction.textKey)}
|
|
69
|
-
</span>
|
|
70
|
-
</div>
|
|
71
|
-
))}
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
<div class="IncodeLearnMoreActions">
|
|
75
|
-
<Button onClick={onAllowPermissions}>
|
|
76
|
-
{t('idv2.permissions.learnMorePage.allowPermissions')}
|
|
77
|
-
</Button>
|
|
78
|
-
<Spacer size={12} />
|
|
79
|
-
<Button variant="link" onClick={onQuitProcess}>
|
|
80
|
-
{t('idv2.permissions.learnMorePage.quitProcess')}
|
|
81
|
-
</Button>
|
|
82
|
-
</div>
|
|
83
|
-
</Page>
|
|
84
|
-
);
|
|
85
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@reference "../styles/tailwind.css";
|
|
2
|
-
|
|
3
|
-
.IncodeNumberedStep {
|
|
4
|
-
@apply flex items-center justify-center w-[46px] h-[46px] min-w-[46px] min-h-[46px] rounded-lg border-2 border-solid border-border-neutral-100;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.IncodeNumberedStepText {
|
|
8
|
-
@apply text-18 font-semibold text-text-body-primary;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.IncodeNumberedStepConnector {
|
|
12
|
-
@apply h-12 w-2 bg-border-neutral-100 ml-24;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'preact/compat';
|
|
2
|
-
import './numberedStep.css';
|
|
3
|
-
|
|
4
|
-
type NumberedStepProps = {
|
|
5
|
-
number: number;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const NumberedStep: FC<NumberedStepProps> = ({ number }) => {
|
|
9
|
-
return (
|
|
10
|
-
<div class="IncodeNumberedStep">
|
|
11
|
-
<span class="IncodeNumberedStepText">{number}</span>
|
|
12
|
-
</div>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@reference "../styles/tailwind.css";
|
|
2
|
-
|
|
3
|
-
.IncodePermissionsImageContainer {
|
|
4
|
-
@apply flex relative flex-col items-center;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.IncodePermissionsActions {
|
|
8
|
-
@apply flex flex-col items-center w-full mt-auto;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.IncodePermissionsActionsGap {
|
|
12
|
-
@apply flex flex-col items-center w-full mt-auto gap-12;
|
|
13
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { PermissionStatus, SelfieManager } from '@incodetech/core/selfie';
|
|
2
|
-
import type { FC } from 'preact/compat';
|
|
3
|
-
import { useTranslation } from '@/i18n/useTranslation';
|
|
4
|
-
import { Button } from '@/shared/button/button';
|
|
5
|
-
import { Page } from '@/shared/page/page';
|
|
6
|
-
import { Spacer } from '@/shared/spacer/spacer';
|
|
7
|
-
import permissionsImg from './assets/permissions-img.svg';
|
|
8
|
-
import { Denied } from './denied';
|
|
9
|
-
import { LearnMore } from './learnMore';
|
|
10
|
-
import './permissions.css';
|
|
11
|
-
|
|
12
|
-
type PermissionsProps = {
|
|
13
|
-
manager: SelfieManager;
|
|
14
|
-
permissionStatus: PermissionStatus;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Permissions: FC<PermissionsProps> = ({
|
|
18
|
-
manager,
|
|
19
|
-
permissionStatus,
|
|
20
|
-
}) => {
|
|
21
|
-
const { t } = useTranslation();
|
|
22
|
-
|
|
23
|
-
if (permissionStatus === 'requesting') {
|
|
24
|
-
return <Page className="IncodePermissionsRequestingPage" hideHeader />;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (permissionStatus === 'learnMore') {
|
|
28
|
-
return (
|
|
29
|
-
<LearnMore
|
|
30
|
-
onAllowPermissions={() => manager.requestPermission()}
|
|
31
|
-
onQuitProcess={() => manager.close()}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (permissionStatus === 'denied') {
|
|
37
|
-
return <Denied onRefresh={() => window.location.reload()} />;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Page
|
|
42
|
-
className="IncodePermissionsPage"
|
|
43
|
-
title={t('idv2.permissions.allowPermissionsV2')}
|
|
44
|
-
subtitle={t('idv2.permissions.inOrderToCompleteTheProcess')}
|
|
45
|
-
hideHeader
|
|
46
|
-
>
|
|
47
|
-
<Spacer size={40} />
|
|
48
|
-
<div class="IncodePermissionsImageContainer">
|
|
49
|
-
<img
|
|
50
|
-
src={permissionsImg}
|
|
51
|
-
alt={t('idv2.permissions.alertAlt')}
|
|
52
|
-
class="IncodePermissionsImage"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
<Spacer size={24} />
|
|
56
|
-
<div class="IncodePermissionsActions">
|
|
57
|
-
<Button onClick={() => manager.requestPermission()}>
|
|
58
|
-
{t('idv2.permissions.allowPermissions')}
|
|
59
|
-
</Button>
|
|
60
|
-
<Spacer size={12} />
|
|
61
|
-
<Button variant="link" onClick={() => manager.goToLearnMore()}>
|
|
62
|
-
{t('idv2.permissions.learnMore')}
|
|
63
|
-
</Button>
|
|
64
|
-
<Spacer size={16} />
|
|
65
|
-
</div>
|
|
66
|
-
</Page>
|
|
67
|
-
);
|
|
68
|
-
};
|
package/src/phone/phone.tsx
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @incodetech/ui/phone
|
|
3
|
-
*
|
|
4
|
-
* Phone verification UI component for the Incode Web SDK.
|
|
5
|
-
* Provides a complete, ready-to-use phone verification experience
|
|
6
|
-
* with country code selection and OTP input.
|
|
7
|
-
*
|
|
8
|
-
* ## UI Usage
|
|
9
|
-
*
|
|
10
|
-
* The Phone component can be used as a React/Preact component or as a
|
|
11
|
-
* Web Component (`<incode-phone>`).
|
|
12
|
-
*
|
|
13
|
-
* @example React/Preact component usage
|
|
14
|
-
* ```tsx
|
|
15
|
-
* import { Phone } from '@incodetech/ui/phone';
|
|
16
|
-
* import { setup } from '@incodetech/core';
|
|
17
|
-
*
|
|
18
|
-
* // Configure the SDK first
|
|
19
|
-
* setup({ apiURL: 'https://api.example.com', token: 'your-token' });
|
|
20
|
-
*
|
|
21
|
-
* function App() {
|
|
22
|
-
* const config = {
|
|
23
|
-
* otpVerification: true,
|
|
24
|
-
* otpExpirationInMinutes: 5,
|
|
25
|
-
* prefill: false,
|
|
26
|
-
* };
|
|
27
|
-
*
|
|
28
|
-
* return (
|
|
29
|
-
* <Phone
|
|
30
|
-
* config={config}
|
|
31
|
-
* onFinish={() => console.log('Phone verified!')}
|
|
32
|
-
* onError={(error) => console.error('Error:', error)}
|
|
33
|
-
* />
|
|
34
|
-
* );
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @example Web Component usage
|
|
39
|
-
* ```html
|
|
40
|
-
* <!-- Include the script -->
|
|
41
|
-
* <script type="module">
|
|
42
|
-
* import '@incodetech/ui/phone';
|
|
43
|
-
* import { setup } from '@incodetech/core';
|
|
44
|
-
*
|
|
45
|
-
* setup({ apiURL: 'https://api.example.com', token: 'your-token' });
|
|
46
|
-
*
|
|
47
|
-
* const phone = document.querySelector('incode-phone');
|
|
48
|
-
* phone.config = {
|
|
49
|
-
* otpVerification: true,
|
|
50
|
-
* otpExpirationInMinutes: 5,
|
|
51
|
-
* prefill: false,
|
|
52
|
-
* };
|
|
53
|
-
* phone.onFinish = () => console.log('Phone verified!');
|
|
54
|
-
* phone.onError = (error) => console.error('Error:', error);
|
|
55
|
-
* </script>
|
|
56
|
-
*
|
|
57
|
-
* <incode-phone></incode-phone>
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* ## Styling
|
|
61
|
-
*
|
|
62
|
-
* The component uses CSS custom properties (variables) for theming.
|
|
63
|
-
* Override these variables to customize the appearance:
|
|
64
|
-
*
|
|
65
|
-
* ```css
|
|
66
|
-
* :root {
|
|
67
|
-
* --button-primary-surface-default: #0066cc;
|
|
68
|
-
* --input-border-default: #cccccc;
|
|
69
|
-
* --text-title: #333333;
|
|
70
|
-
* }
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* ## Headless Alternative
|
|
74
|
-
*
|
|
75
|
-
* For complete control over the UI, use the headless `createPhoneManager`
|
|
76
|
-
* from `@incodetech/core/phone` instead. See the core module documentation.
|
|
77
|
-
*/
|
|
78
|
-
import './styles.css';
|
|
79
|
-
import { createPhoneManager, type PhoneConfig } from '@incodetech/core/phone';
|
|
80
|
-
import type { FC } from 'preact/compat';
|
|
81
|
-
import { useState } from 'preact/hooks';
|
|
82
|
-
import { useManager } from '@/hooks';
|
|
83
|
-
import { Button } from '../shared/button/button';
|
|
84
|
-
import { IncodeComponent } from '../shared/componentRoot/incodeComponent';
|
|
85
|
-
import { OtpInput } from '../shared/otpInput/otpInput';
|
|
86
|
-
import { Page } from '../shared/page/page';
|
|
87
|
-
import { Spacer } from '../shared/spacer/spacer';
|
|
88
|
-
import {
|
|
89
|
-
type IncodeModuleProps,
|
|
90
|
-
registerIncodeModuleElement,
|
|
91
|
-
} from '../shared/webComponent/incodeModule';
|
|
92
|
-
import { PhoneInput } from './phoneInput';
|
|
93
|
-
|
|
94
|
-
/** @internal */
|
|
95
|
-
type PhoneContentProps = {
|
|
96
|
-
config: PhoneConfig;
|
|
97
|
-
onFinish?: () => void;
|
|
98
|
-
onError?: (error: string | undefined) => void;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const PhoneContent: FC<PhoneContentProps> = ({ config, onFinish, onError }) => {
|
|
102
|
-
const [state, manager] = useManager(() => {
|
|
103
|
-
if (!config) {
|
|
104
|
-
throw new Error('Phone config is required');
|
|
105
|
-
}
|
|
106
|
-
return createPhoneManager({ config });
|
|
107
|
-
});
|
|
108
|
-
const [isPhoneValid, setIsPhoneValid] = useState(false);
|
|
109
|
-
|
|
110
|
-
// Handle input states: idle, loadingPrefill, inputting, submitting, sendingOtp
|
|
111
|
-
const isInputState =
|
|
112
|
-
state.status === 'idle' ||
|
|
113
|
-
state.status === 'loadingPrefill' ||
|
|
114
|
-
state.status === 'inputting' ||
|
|
115
|
-
state.status === 'submitting' ||
|
|
116
|
-
state.status === 'sendingOtp';
|
|
117
|
-
|
|
118
|
-
if (isInputState) {
|
|
119
|
-
const isLoading =
|
|
120
|
-
state.status === 'idle' ||
|
|
121
|
-
state.status === 'loadingPrefill' ||
|
|
122
|
-
state.status === 'submitting' ||
|
|
123
|
-
state.status === 'sendingOtp';
|
|
124
|
-
|
|
125
|
-
const countryCode = state.status === 'inputting' ? state.countryCode : 'US';
|
|
126
|
-
const phonePrefix = state.status === 'inputting' ? state.phonePrefix : '+1';
|
|
127
|
-
const prefilledPhone =
|
|
128
|
-
state.status === 'inputting' ? state.prefilledPhone : undefined;
|
|
129
|
-
const phoneError =
|
|
130
|
-
state.status === 'inputting' ? state.phoneError : undefined;
|
|
131
|
-
|
|
132
|
-
return (
|
|
133
|
-
<Page
|
|
134
|
-
className="IncodePhonePage"
|
|
135
|
-
title="Verify Phone"
|
|
136
|
-
subtitle={
|
|
137
|
-
config.otpVerification
|
|
138
|
-
? 'We will send you a verification code'
|
|
139
|
-
: undefined
|
|
140
|
-
}
|
|
141
|
-
>
|
|
142
|
-
<PhoneInput
|
|
143
|
-
countryCode={countryCode}
|
|
144
|
-
phonePrefix={phonePrefix}
|
|
145
|
-
prefilledPhone={prefilledPhone}
|
|
146
|
-
phoneError={phoneError}
|
|
147
|
-
optinEnabled={config.optinEnabled}
|
|
148
|
-
disabled={isLoading}
|
|
149
|
-
onPhoneChange={(phone, isValid) => {
|
|
150
|
-
manager.setPhoneNumber(phone, isValid);
|
|
151
|
-
setIsPhoneValid(isValid);
|
|
152
|
-
}}
|
|
153
|
-
onOptInChange={(granted) => manager.setOptInGranted(granted)}
|
|
154
|
-
/>
|
|
155
|
-
<Spacer />
|
|
156
|
-
<Button
|
|
157
|
-
onClick={() => manager.submit()}
|
|
158
|
-
disabled={!isPhoneValid}
|
|
159
|
-
isLoading={isLoading}
|
|
160
|
-
data-testid="phone-submit"
|
|
161
|
-
>
|
|
162
|
-
Continue
|
|
163
|
-
</Button>
|
|
164
|
-
</Page>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (
|
|
169
|
-
state.status === 'awaitingOtp' ||
|
|
170
|
-
state.status === 'verifyingOtp' ||
|
|
171
|
-
state.status === 'otpError'
|
|
172
|
-
) {
|
|
173
|
-
const isVerifying = state.status === 'verifyingOtp';
|
|
174
|
-
|
|
175
|
-
return (
|
|
176
|
-
<Page
|
|
177
|
-
className="IncodePhonePage IncodePhoneOtpPage"
|
|
178
|
-
title="Enter Verification Code"
|
|
179
|
-
>
|
|
180
|
-
<OtpInput
|
|
181
|
-
resendTimer={state.status === 'awaitingOtp' ? state.resendTimer : 0}
|
|
182
|
-
canResend={state.status === 'awaitingOtp' ? state.canResend : false}
|
|
183
|
-
error={state.status === 'otpError' ? state.error : undefined}
|
|
184
|
-
onSubmit={(code) => manager.submitOtp(code)}
|
|
185
|
-
onResend={() => manager.resendOtp()}
|
|
186
|
-
onBack={() => manager.back()}
|
|
187
|
-
isLoading={isVerifying}
|
|
188
|
-
/>
|
|
189
|
-
</Page>
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (state.status === 'success') {
|
|
194
|
-
onFinish?.();
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if (state.status === 'error') {
|
|
199
|
-
onError?.(state.error);
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return null;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Props for the Phone component
|
|
208
|
-
*/
|
|
209
|
-
type PhoneProps = IncodeModuleProps<PhoneConfig>;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Phone verification UI component.
|
|
213
|
-
*
|
|
214
|
-
* Provides a complete phone verification experience including:
|
|
215
|
-
* - Country code selector with flag emojis
|
|
216
|
-
* - Phone number input with validation
|
|
217
|
-
* - OTP code entry with resend functionality
|
|
218
|
-
* - Loading states and error handling
|
|
219
|
-
*
|
|
220
|
-
* @example Basic usage
|
|
221
|
-
* ```tsx
|
|
222
|
-
* <Phone
|
|
223
|
-
* config={{
|
|
224
|
-
* otpVerification: true,
|
|
225
|
-
* otpExpirationInMinutes: 5,
|
|
226
|
-
* prefill: false,
|
|
227
|
-
* }}
|
|
228
|
-
* onFinish={() => router.push('/next-step')}
|
|
229
|
-
* onError={(err) => toast.error(err)}
|
|
230
|
-
* />
|
|
231
|
-
* ```
|
|
232
|
-
*
|
|
233
|
-
* @see {@link createPhoneManager} for headless usage
|
|
234
|
-
*/
|
|
235
|
-
export const Phone: FC<PhoneProps> = ({ config, onFinish, onError }) => {
|
|
236
|
-
return (
|
|
237
|
-
<IncodeComponent>
|
|
238
|
-
{config ? (
|
|
239
|
-
<PhoneContent config={config} onFinish={onFinish} onError={onError} />
|
|
240
|
-
) : null}
|
|
241
|
-
</IncodeComponent>
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
// Register as a Web Component
|
|
246
|
-
registerIncodeModuleElement(Phone, 'incode-phone');
|