diff --git a/.vscode/settings.json b/.vscode/settings.json index 954000cb..db64ead1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "[typescriptreact]": { diff --git a/cspell.json b/cspell.json index e1d3c0f1..5ea81418 100644 --- a/cspell.json +++ b/cspell.json @@ -3,10 +3,23 @@ "enabled": true, "language": "en-US", "allowCompoundWords": true, - "dictionaries": ["typescript", "node", "npm", "html"], - "enabledLanguageIds": ["typescript", "typescriptreact", "javascript", "markdown", "yaml", "json"], + "dictionaries": [ + "typescript", + "node", + "npm", + "html" + ], + "enabledLanguageIds": [ + "typescript", + "typescriptreact", + "javascript", + "markdown", + "yaml", + "json" + ], "words": [ "arrayify", + "consts", "dfea", "eafc", "esbuild", @@ -18,11 +31,11 @@ "merkle", "NextJS", "QRCode", + "tsup", "TTFB", "viem", "webp", - "zustand", "worldid", - "consts" + "zustand" ] } diff --git a/packages/react/package.json b/packages/react/package.json index 6e970a8a..5cbec4a6 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -60,15 +60,12 @@ "react-dom": ">18.0.0" }, "dependencies": { - "@fontsource/rubik": "^4.5.11", - "@headlessui/react": "^1.7.4", "@radix-ui/react-dialog": "^1.0.3", "@radix-ui/react-toast": "^1.1.3", "@tailwindcss/forms": "^0.5.3", "@worldcoin/idkit-core": "workspace:*", "copy-to-clipboard": "^3.3.3", "framer-motion": "^7.6.7", - "posthog-js-lite": "2.4.0", "qrcode": "^1.5.1", "react-shadow": "^19.1.0", "zustand": "^4.5" diff --git a/packages/react/public/images/verified.webp b/packages/react/public/images/verified.webp deleted file mode 100644 index ce95ee9e..00000000 Binary files a/packages/react/public/images/verified.webp and /dev/null differ diff --git a/packages/react/src/components/AboutWorldID.tsx b/packages/react/src/components/AboutWorldID.tsx deleted file mode 100644 index c563a861..00000000 --- a/packages/react/src/components/AboutWorldID.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { __ } from '@/lang' -import LockIcon from './Icons/LockIcon' -import { classNames } from '@/lib/utils' -import HumanIcon from './Icons/HumanIcon' -import type { FC, HTMLAttributes, PropsWithChildren } from 'react' - -type Props = { - className?: string -} - -const AboutWorldID: FC = ({ className }) => { - return ( -
-

{__('What is World ID?')}

-
- -

{__('With Worldcoin and World ID sign in seamlessly and prove you are a unique human.')}

-
- -

{__('Maximum privacy. Prevents cross-tracking and can be used fully anonymously.')}

-
-
-
- ) -} - -type FeatureHighlightProps = PropsWithChildren<{ - title: string - icon: FC> -}> - -const FeatureHighlight: FC = ({ icon: Icon, title, children }) => ( -
-
- -
-
-

{title}

-
{children}
-
-
-) - -export default AboutWorldID diff --git a/packages/react/src/components/Button.tsx b/packages/react/src/components/Button.tsx deleted file mode 100644 index 435d224c..00000000 --- a/packages/react/src/components/Button.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { forwardRef } from 'react' -import { classNames } from '@/lib/utils' -import type { ButtonHTMLAttributes, ForwardedRef } from 'react' - -const Button = forwardRef(function Button( - { className, ...props }: ButtonHTMLAttributes, - ref: ForwardedRef -) { - return ( - - diff --git a/packages/react/src/components/IDKitWidget/States/ErrorState.tsx b/packages/react/src/components/IDKitWidget/States/ErrorState.tsx index 5f547cf0..e7ee10b4 100644 --- a/packages/react/src/components/IDKitWidget/States/ErrorState.tsx +++ b/packages/react/src/components/IDKitWidget/States/ErrorState.tsx @@ -50,11 +50,10 @@ const ErrorState = () => {

- {(errorState?.code && ERROR_TITLES[errorState.code]) || ERROR_TITLES[AppErrorCodes.GenericError]} + {(errorState?.code && ERROR_TITLES[errorState.code]) ?? ERROR_TITLES[AppErrorCodes.GenericError]}

- {/* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing */} - {errorState?.message || ERROR_MESSAGES[errorState?.code ?? AppErrorCodes.GenericError]} + {errorState?.message ?? ERROR_MESSAGES[errorState?.code ?? AppErrorCodes.GenericError]}

diff --git a/packages/react/src/components/IDKitWidget/States/HostAppVerificationState.tsx b/packages/react/src/components/IDKitWidget/States/HostAppVerificationState.tsx index b1868373..e2aaa977 100644 --- a/packages/react/src/components/IDKitWidget/States/HostAppVerificationState.tsx +++ b/packages/react/src/components/IDKitWidget/States/HostAppVerificationState.tsx @@ -13,7 +13,7 @@ const HostAppVerificationState = () => {
-
{__('Transmitting verification to host app. Please wait...')}
+
{__('Transmitting verification to host app. Please wait...')}
) } diff --git a/packages/react/src/components/IDKitWidget/States/PrivacyState.tsx b/packages/react/src/components/IDKitWidget/States/PrivacyState.tsx deleted file mode 100644 index 1b3a5381..00000000 --- a/packages/react/src/components/IDKitWidget/States/PrivacyState.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { __ } from '@/lang' -import WorldIDIcon from '@/components/WorldIDIcon' -import InfoIcon from '@/components/Icons/InfoIcon' - -const PrivacyState = () => { - return ( -
- -

- {__('Privacy preserving to the core.')} -

-
    -
  • - {__( - 'World ID uses Zero-Knowledge Proofs to make it cryptographically impossible to track persons across applications.' - )} -
  • -
  • {__('Orb biometrics analyzed by the Orb are not stored.')}
  • -
  • - {__('Code and hardware are open source or source available on')}{' '} - - GitHub - - . -
  • -
-
- -

{__('Biometrics are never shared.')}

-
-
- ) -} - -export default PrivacyState diff --git a/packages/react/src/components/Icons/ChevronDownIcon.tsx b/packages/react/src/components/Icons/ChevronDownIcon.tsx deleted file mode 100644 index 9c4614df..00000000 --- a/packages/react/src/components/Icons/ChevronDownIcon.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import type { FC, HTMLAttributes } from 'react' - -const ChevronDownIcon: FC> = props => ( - - - -) - -export default ChevronDownIcon diff --git a/packages/react/src/components/Icons/InfoIcon.tsx b/packages/react/src/components/Icons/InfoIcon.tsx deleted file mode 100644 index 6f50d0be..00000000 --- a/packages/react/src/components/Icons/InfoIcon.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import type { FC, HTMLAttributes } from 'react' - -const InfoIcon: FC> = props => ( - - - -) - -export default InfoIcon diff --git a/packages/react/src/components/Icons/QuestionMarkIcon.tsx b/packages/react/src/components/Icons/QuestionMarkIcon.tsx deleted file mode 100644 index b44a5328..00000000 --- a/packages/react/src/components/Icons/QuestionMarkIcon.tsx +++ /dev/null @@ -1,7 +0,0 @@ -const QuestionMarkIcon = ({ className = '' }: { className?: string }) => ( - - - -) - -export default QuestionMarkIcon diff --git a/packages/react/src/components/Icons/WorldIDWordmark.tsx b/packages/react/src/components/Icons/WorldIDWordmark.tsx deleted file mode 100644 index 70015681..00000000 --- a/packages/react/src/components/Icons/WorldIDWordmark.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import type { HTMLAttributes, FC } from 'react' - -const WorldIDWordmark: FC> = props => ( - - - - - - - - - - - - - - - - - - - -) - -export default WorldIDWordmark diff --git a/packages/react/src/components/WorldIDIcon.tsx b/packages/react/src/components/WorldIDIcon.tsx deleted file mode 100644 index c79113b2..00000000 --- a/packages/react/src/components/WorldIDIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { classNames } from '@/lib/utils' -import verifiedIcon from '@images/verified.webp' -import type { DetailedHTMLProps, ImgHTMLAttributes } from 'react' - -type Props = Omit< - DetailedHTMLProps, HTMLImageElement> & { border?: string; size?: 'md' | 'sm' }, - 'height' | 'src' | 'width' -> - -const WorldIDIcon = ({ border, size = 'sm', ...props }: Props) => { - const heightWidth = size === 'md' ? 36 : 24 // NOTE: we enforce sizes because something larger than 48px will not render well (image's native resolution is 96px) - return ( - <> - {border && ( - - - - )} - Verified - - ) -} - -export default WorldIDIcon diff --git a/packages/react/src/store/idkit.ts b/packages/react/src/store/idkit.ts index f348d2d9..d6f4d509 100644 --- a/packages/react/src/store/idkit.ts +++ b/packages/react/src/store/idkit.ts @@ -32,10 +32,6 @@ export type IDKitStore = { verifyCallbacks: Record | undefined> | Record successCallbacks: Record | undefined> | Record - computed: { - canGoBack: (stage: IDKITStage) => boolean - } - retryFlow: () => void setStage: (stage: IDKITStage) => void onOpenChange: (open: boolean) => void @@ -69,12 +65,6 @@ const useIDKitStore = createWithEqualityFn()( successCallbacks: {}, stage: IDKITStage.WORLD_ID, - computed: { - canGoBack: (stage: IDKITStage) => { - return stage == IDKITStage.PRIVACY - }, - }, - setStage: stage => set({ stage }), setErrorState: errorState => set({ errorState }), setProcessing: (processing: boolean) => set({ processing }), diff --git a/packages/react/src/types/index.ts b/packages/react/src/types/index.ts index 6685b313..e073332d 100644 --- a/packages/react/src/types/index.ts +++ b/packages/react/src/types/index.ts @@ -1,6 +1,5 @@ export enum IDKITStage { WORLD_ID = 'WORLD_ID', - PRIVACY = 'PRIVACY', SUCCESS = 'SUCCESS', ERROR = 'ERROR', HOST_APP_VERIFICATION = 'HOST_APP_VERIFICATION', diff --git a/packages/standalone/src/index.tsx b/packages/standalone/src/index.tsx index 7b6dafbe..bd1d7ad9 100644 --- a/packages/standalone/src/index.tsx +++ b/packages/standalone/src/index.tsx @@ -11,7 +11,6 @@ let isInitialized = false */ const init = (config: Config): void => { if (isInitialized) throw new Error(__('IDKit is already initialized')) - if (!config.app_id) throw new Error(__('You must provide your App ID & Action')) const startApp = () => { try { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64c246f7..b1e9fae2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,12 +89,6 @@ importers: packages/react: dependencies: - '@fontsource/rubik': - specifier: ^4.5.11 - version: 4.5.14 - '@headlessui/react': - specifier: ^1.7.4 - version: 1.7.17(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-dialog': specifier: ^1.0.3 version: 1.0.5(@types/react-dom@18.0.9)(@types/react@18.0.25)(react-dom@18.2.0)(react@18.2.0) @@ -113,9 +107,6 @@ importers: framer-motion: specifier: ^7.6.7 version: 7.10.3(react-dom@18.2.0)(react@18.2.0) - posthog-js-lite: - specifier: 2.4.0 - version: 2.4.0 qrcode: specifier: ^1.5.1 version: 1.5.3 @@ -567,22 +558,6 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@fontsource/rubik@4.5.14: - resolution: {integrity: sha512-EvMK3kkeAgKkk8qAeT4PjpyAYyu72pIlJm+SXJ5vR/xhCX2yj2xoq3+YS38rPmPcCAnrAVONoQ3ezLxVm6jhBA==} - dev: false - - /@headlessui/react@1.7.17(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-4am+tzvkqDSSgiwrsEpGWqgGo9dz8qU5M3znCkC4PgkpY4HcCZzEDEvozltGGGHIKl9jbXbZPSH5TWn4sWJdow==} - engines: {node: '>=10'} - peerDependencies: - react: ^16 || ^17 || ^18 - react-dom: ^16 || ^17 || ^18 - dependencies: - client-only: 0.0.1 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@humanwhocodes/config-array@0.11.11: resolution: {integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==} engines: {node: '>=10.10.0'} @@ -4262,10 +4237,6 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /posthog-js-lite@2.4.0: - resolution: {integrity: sha512-BslsygPtDEeFIIRgW9za0mzTtZGv5iy5HrmpRd5KIUPtd3J24mItFMhf8cU9GguqS+oq/Dugt2K2ijpC8mSlzQ==} - dev: false - /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'}