@worldcoin/idkit 0.0.1

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.
Files changed (34) hide show
  1. package/README.md +35 -0
  2. package/build/components/Button.d.ts +3 -0
  3. package/build/components/CountryCodeSelect.d.ts +6 -0
  4. package/build/components/Frame.d.ts +4 -0
  5. package/build/components/IDKitWidget/BaseWidget.d.ts +9 -0
  6. package/build/components/IDKitWidget/States/AboutState.d.ts +2 -0
  7. package/build/components/IDKitWidget/States/EnterPhoneState.d.ts +2 -0
  8. package/build/components/IDKitWidget/States/ErrorState.d.ts +2 -0
  9. package/build/components/IDKitWidget/States/SuccessState.d.ts +2 -0
  10. package/build/components/IDKitWidget/States/VerifyCodeState.d.ts +2 -0
  11. package/build/components/IDKitWidget/States/WorldIDState.d.ts +2 -0
  12. package/build/components/IDKitWidget/index.d.ts +7 -0
  13. package/build/components/Icons/LoadingIcon.d.ts +4 -0
  14. package/build/components/Icons/QuestionMarkIcon.d.ts +4 -0
  15. package/build/components/Icons/WorldIDQR.d.ts +4 -0
  16. package/build/components/Icons/WorldIDWordmark.d.ts +4 -0
  17. package/build/components/PhoneInput.d.ts +6 -0
  18. package/build/components/ResendButton.d.ts +3 -0
  19. package/build/components/SMSCodeInput.d.ts +6 -0
  20. package/build/components/WorldIDIcon.d.ts +6 -0
  21. package/build/hooks/useIDKit.d.ts +6 -0
  22. package/build/idkit-js.js +113 -0
  23. package/build/index.css +2 -0
  24. package/build/index.d.ts +6 -0
  25. package/build/index.js +3 -0
  26. package/build/index.js.map +7 -0
  27. package/build/lib/utils.d.ts +1 -0
  28. package/build/services/phone.d.ts +18 -0
  29. package/build/store/idkit.d.ts +29 -0
  30. package/build/tsconfig.tsbuildinfo +1 -0
  31. package/build/types/config.d.ts +19 -0
  32. package/build/types/index.d.ts +30 -0
  33. package/build/vanilla.d.ts +12 -0
  34. package/package.json +102 -0
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # IDKit JS Widget
2
+
3
+ This folder (`/idkit`) contains the main code for the widget. For instructions on **how to use the widget**, please refer to the repository's main [README](/README.md).
4
+
5
+ ## ℹ️ About the codebase
6
+
7
+ - The widget is made to work mainly with vanilla JS code (no framework required). The starting point can be found in `src/vanilla.tsx`.
8
+ - The React wrapper is found on `src/components/IDKitWidget/index.ts`.
9
+
10
+ ## 🧑‍💻 Development & testing
11
+
12
+ To develop locally and contribute to this package, you can simply follow these instructions after cloning the repo.
13
+
14
+ - Install dependencies
15
+ ```bash
16
+ # be sure to run this in the root folder of the repo
17
+ yarn install
18
+ ```
19
+ - Run tests
20
+ ```bash
21
+ # runs in the /idkit folder
22
+ cd idkit/
23
+ yarn test
24
+ ```
25
+ - Run local test project
26
+ ```bash
27
+ # runs in the /idkit folder
28
+ yarn dev
29
+ ```
30
+ - Open browser at `http://localhost:3000`
31
+ - To build the production bundle you can simply run.
32
+ ```bash
33
+ # runs in the /idkit folder
34
+ yarn build
35
+ ```
@@ -0,0 +1,3 @@
1
+ import type { ButtonHTMLAttributes } from 'react';
2
+ declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
3
+ export default Button;
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ };
5
+ declare const CountryCodeSelect: ({ value, onChange }: Props) => JSX.Element;
6
+ export default CountryCodeSelect;
@@ -0,0 +1,4 @@
1
+ import type { FC, HTMLAttributes, PropsWithChildren } from 'react';
2
+ type Props = PropsWithChildren<HTMLAttributes<HTMLIFrameElement>>;
3
+ declare const Frame: FC<Props>;
4
+ export default Frame;
@@ -0,0 +1,9 @@
1
+ import type { FC } from 'react';
2
+ import { Config } from '../../types/config';
3
+ type Props = Config & {
4
+ children?: ({ open }: {
5
+ open: () => void;
6
+ }) => JSX.Element;
7
+ };
8
+ declare const IDKitWidget: FC<Props>;
9
+ export default IDKitWidget;
@@ -0,0 +1,2 @@
1
+ declare const AboutState: () => JSX.Element;
2
+ export default AboutState;
@@ -0,0 +1,2 @@
1
+ declare const EnterPhoneState: () => JSX.Element;
2
+ export default EnterPhoneState;
@@ -0,0 +1,2 @@
1
+ declare const ErrorState: () => JSX.Element;
2
+ export default ErrorState;
@@ -0,0 +1,2 @@
1
+ declare const SuccessState: () => JSX.Element;
2
+ export default SuccessState;
@@ -0,0 +1,2 @@
1
+ declare const VerifyCodeState: () => JSX.Element;
2
+ export default VerifyCodeState;
@@ -0,0 +1,2 @@
1
+ declare const WorldIDState: () => JSX.Element;
2
+ export default WorldIDState;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").NamedExoticComponent<import("../..").Config & {
3
+ children?: (({ open }: {
4
+ open: () => void;
5
+ }) => JSX.Element) | undefined;
6
+ }>;
7
+ export default _default;
@@ -0,0 +1,4 @@
1
+ declare const LoadingIcon: ({ className }: {
2
+ className?: string | undefined;
3
+ }) => JSX.Element;
4
+ export default LoadingIcon;
@@ -0,0 +1,4 @@
1
+ declare const QuestionMarkIcon: ({ className }: {
2
+ className?: string | undefined;
3
+ }) => JSX.Element;
4
+ export default QuestionMarkIcon;
@@ -0,0 +1,4 @@
1
+ declare const WorldIDQR: ({ className }: {
2
+ className?: string | undefined;
3
+ }) => JSX.Element;
4
+ export default WorldIDQR;
@@ -0,0 +1,4 @@
1
+ declare const WorldIDWordmark: ({ className }: {
2
+ className?: string | undefined;
3
+ }) => JSX.Element;
4
+ export default WorldIDWordmark;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").MemoExoticComponent<({ disabled, onSubmit }: {
3
+ disabled?: boolean | undefined;
4
+ onSubmit?: (() => void | Promise<void>) | undefined;
5
+ }) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").MemoExoticComponent<() => JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import type { RefObject } from 'react';
2
+ declare const _default: import("react").MemoExoticComponent<({ submitRef, disabled }: {
3
+ submitRef: RefObject<HTMLButtonElement>;
4
+ disabled?: boolean | undefined;
5
+ }) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import type { DetailedHTMLProps, ImgHTMLAttributes } from 'react';
2
+ type Props = DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & {
3
+ border?: string;
4
+ };
5
+ declare const WorldIDIcon: ({ border, ...props }: Props) => JSX.Element;
6
+ export default WorldIDIcon;
@@ -0,0 +1,6 @@
1
+ import type { Config } from '../types/config';
2
+ declare const useIDKit: (options: Config) => {
3
+ open: boolean;
4
+ setOpen: (open: boolean) => void;
5
+ };
6
+ export default useIDKit;