payload-auth 1.1.2 → 1.3.0
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/authjs/index.d.ts.map +1 -1
- package/dist/authjs/index.js +2 -2
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +1 -1
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts.map +1 -1
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +3 -3
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts.map +1 -1
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +4 -4
- package/dist/better-auth/adapter/generate-schema/index.js +5 -5
- package/dist/better-auth/adapter/generate-schema/utils.js +1 -1
- package/dist/better-auth/adapter/index.d.ts +2 -2
- package/dist/better-auth/adapter/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/index.js +53 -53
- package/dist/better-auth/adapter/transform/index.d.ts +5 -5
- package/dist/better-auth/adapter/transform/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/transform/index.js +69 -69
- package/dist/better-auth/adapter/types.d.ts +3 -3
- package/dist/better-auth/adapter/types.d.ts.map +1 -1
- package/dist/better-auth/adapter/types.js +1 -1
- package/dist/better-auth/index.js +4 -4
- package/dist/better-auth/plugin/{lib/constants.d.ts → constants.d.ts} +14 -6
- package/dist/better-auth/plugin/constants.d.ts.map +1 -0
- package/dist/better-auth/plugin/constants.js +91 -0
- package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/check-passkey-plugin.js +2 -2
- package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/check-username-plugin.js +2 -2
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +7 -7
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-admin-access.js +2 -2
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-all-roles.js +4 -4
- package/dist/better-auth/plugin/helpers/get-ip.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-ip.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-ip.js +14 -14
- package/dist/better-auth/plugin/helpers/get-requst-collection.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-requst-collection.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-requst-collection.js +2 -2
- package/dist/better-auth/plugin/helpers/index.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/index.js +1 -1
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +3 -3
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/prepare-session-data.js +1 -1
- package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/serialize-cookie.js +33 -33
- package/dist/better-auth/plugin/index.d.ts +6 -6
- package/dist/better-auth/plugin/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/index.js +27 -57
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +6 -6
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +47 -47
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +33 -24
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/api-keys.js +77 -80
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/index.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/invitations.js +30 -30
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/jwks.js +13 -13
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/members.js +22 -22
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +33 -33
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +40 -40
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +20 -20
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/organizations.js +21 -21
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/passkeys.js +37 -37
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/sessions.js +33 -33
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +29 -29
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/teams.js +13 -13
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/two-factors.js +17 -17
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +8 -8
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +3 -4
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +12 -11
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +19 -18
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +3 -2
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +28 -6
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +9 -8
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.js +34 -30
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +7 -6
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +11 -11
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +3 -3
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/index.js +84 -94
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +7 -7
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/verifications.js +17 -17
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +2 -2
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/get-payload-auth.js +1 -1
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts +2 -2
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.js +7 -7
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +4 -4
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/init-better-auth.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +4 -4
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +28 -12
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +10 -11
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +15 -16
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js +7 -6
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js +7 -6
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +43 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts +4 -4
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +9 -4
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts +5 -0
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/set-login-methods.js +16 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +4 -4
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +19 -20
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +4 -4
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +59 -42
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.scss +7 -6
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts +2 -3
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/logout-button.js +8 -11
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +1 -1
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/rsc-redirect.js +1 -1
- package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.d.ts +14 -0
- package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.js +142 -0
- package/dist/better-auth/plugin/payload/components/{admin-social-provider-buttons → social-provider-buttons}/index.scss +4 -1
- package/dist/better-auth/plugin/payload/components/token-field.d.ts +2 -2
- package/dist/better-auth/plugin/payload/components/token-field.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/token-field.js +3 -3
- package/dist/better-auth/plugin/payload/exports/client.d.ts +5 -6
- package/dist/better-auth/plugin/payload/exports/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/exports/client.js +6 -7
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts +6 -9
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/exports/rsc.js +5 -8
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +1 -1
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +6 -5
- package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts +3 -3
- package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/utils/generate-metadata.js +18 -18
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +1 -1
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts +17 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.js +175 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +11 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.js +125 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +15 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.js +156 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +11 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.js +71 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +4 -7
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/forgot-password/client.js +70 -100
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +6 -6
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/forgot-password/index.js +23 -34
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +4 -2
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/client.js +88 -53
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +2 -2
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/index.js +51 -56
- package/dist/better-auth/plugin/types.d.ts +58 -31
- package/dist/better-auth/plugin/types.d.ts.map +1 -1
- package/dist/better-auth/plugin/types.js +1 -1
- package/dist/better-auth/types.js +2 -2
- package/dist/clerk/admin-ui.js +4 -4
- package/dist/clerk/index.js +5 -5
- package/dist/clerk/plugin/auth-strategy.js +4 -4
- package/dist/clerk/plugin/collections/users/access.js +1 -1
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.d.ts +2 -2
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.d.ts.map +1 -1
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.js +9 -9
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.js +4 -4
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.d.ts.map +1 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.js +2 -2
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.d.ts.map +1 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.js +2 -2
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.d.ts.map +1 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.js +2 -2
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.d.ts.map +1 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.js +5 -4
- package/dist/clerk/plugin/collections/users/fields.js +1 -1
- package/dist/clerk/plugin/collections/users/index.d.ts +1 -1
- package/dist/clerk/plugin/collections/users/index.d.ts.map +1 -1
- package/dist/clerk/plugin/collections/users/index.js +7 -7
- package/dist/clerk/plugin/components/after-login-form.js +4 -4
- package/dist/clerk/plugin/components/logout-button.d.ts.map +1 -1
- package/dist/clerk/plugin/components/logout-button.js +17 -17
- package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts +1 -1
- package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts.map +1 -1
- package/dist/clerk/plugin/components/sync-clerk-users-button.js +8 -8
- package/dist/clerk/plugin.d.ts +4 -4
- package/dist/clerk/plugin.d.ts.map +1 -1
- package/dist/clerk/plugin.js +4 -4
- package/dist/clerk/types.js +1 -1
- package/dist/clerk/utils/clerk-user.d.ts.map +1 -1
- package/dist/clerk/utils/clerk-user.js +1 -1
- package/dist/clerk/utils/index.js +4 -4
- package/dist/clerk/utils/load-clerk-instance.d.ts.map +1 -1
- package/dist/clerk/utils/load-clerk-instance.js +2 -2
- package/dist/clerk/utils/svix.d.ts +1 -1
- package/dist/clerk/utils/svix.d.ts.map +1 -1
- package/dist/clerk/utils/svix.js +2 -2
- package/dist/clerk/utils/user.d.ts.map +1 -1
- package/dist/clerk/utils/user.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/kinde/index.d.ts.map +1 -1
- package/dist/kinde/index.js +2 -2
- package/dist/{better-auth/plugin/payload → shared}/components/icons.d.ts +3 -3
- package/dist/shared/components/icons.d.ts.map +1 -0
- package/dist/shared/components/icons.js +437 -0
- package/dist/shared/components/logo.d.ts +4 -0
- package/dist/shared/components/logo.d.ts.map +1 -0
- package/dist/shared/components/logo.js +24 -0
- package/dist/shared/form/components/submit.d.ts +8 -0
- package/dist/shared/form/components/submit.d.ts.map +1 -0
- package/dist/shared/form/components/submit.js +21 -0
- package/dist/shared/form/fields/text-field.d.ts +8 -0
- package/dist/shared/form/fields/text-field.d.ts.map +1 -0
- package/dist/shared/form/fields/text-field.js +41 -0
- package/dist/shared/form/index.d.ts +34 -0
- package/dist/shared/form/index.d.ts.map +1 -0
- package/dist/shared/form/index.js +17 -0
- package/dist/shared/form/ui/header/index.d.ts +9 -0
- package/dist/shared/form/ui/header/index.d.ts.map +1 -0
- package/dist/shared/form/ui/header/index.js +24 -0
- package/dist/shared/form/ui/index.d.ts +31 -0
- package/dist/shared/form/ui/index.d.ts.map +1 -0
- package/dist/shared/form/ui/index.js +57 -0
- package/dist/shared/form/ui/index.scss +27 -0
- package/dist/shared/form/validation.d.ts +103 -0
- package/dist/shared/form/validation.d.ts.map +1 -0
- package/dist/shared/form/validation.js +108 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/payload/fields/field-copy-button/index.css +47 -0
- package/dist/shared/payload/fields/field-copy-button/index.d.ts +4 -0
- package/dist/shared/payload/fields/field-copy-button/index.d.ts.map +1 -0
- package/dist/shared/payload/fields/field-copy-button/index.js +38 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.css +14 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts +4 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts.map +1 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.js +26 -0
- package/dist/shared/payload/fields/index.d.ts +3 -0
- package/dist/shared/payload/fields/index.d.ts.map +1 -0
- package/dist/shared/payload/fields/index.js +4 -0
- package/dist/shared/utils/regex.d.ts +3 -0
- package/dist/shared/utils/regex.d.ts.map +1 -0
- package/dist/shared/utils/regex.js +4 -0
- package/dist/shared/utils/try-catch.d.ts +12 -0
- package/dist/shared/utils/try-catch.d.ts.map +1 -0
- package/dist/shared/utils/try-catch.js +17 -0
- package/package.json +7 -5
- package/dist/better-auth/plugin/helpers/get-admin-routes.d.ts +0 -14
- package/dist/better-auth/plugin/helpers/get-admin-routes.d.ts.map +0 -1
- package/dist/better-auth/plugin/helpers/get-admin-routes.js +0 -6
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.d.ts +0 -3
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.d.ts.map +0 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.js +0 -96
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.d.ts +0 -4
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.d.ts.map +0 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.js +0 -115
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.d.ts +0 -3
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.d.ts.map +0 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.js +0 -62
- package/dist/better-auth/plugin/lib/constants.d.ts.map +0 -1
- package/dist/better-auth/plugin/lib/constants.js +0 -56
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.d.ts +0 -14
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.js +0 -111
- package/dist/better-auth/plugin/payload/components/form-header/index.d.ts +0 -9
- package/dist/better-auth/plugin/payload/components/form-header/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/components/form-header/index.js +0 -23
- package/dist/better-auth/plugin/payload/components/icons.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/components/icons.js +0 -437
- package/dist/better-auth/plugin/payload/components/logo.d.ts +0 -4
- package/dist/better-auth/plugin/payload/components/logo.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/components/logo.js +0 -24
- package/dist/better-auth/plugin/payload/components/styles.css +0 -73
- package/dist/better-auth/plugin/payload/views/admin-invite/client.d.ts +0 -12
- package/dist/better-auth/plugin/payload/views/admin-invite/client.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/admin-invite/client.js +0 -92
- package/dist/better-auth/plugin/payload/views/admin-invite/index.d.ts +0 -11
- package/dist/better-auth/plugin/payload/views/admin-invite/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/admin-invite/index.js +0 -84
- package/dist/better-auth/plugin/payload/views/admin-invite/index.scss +0 -25
- package/dist/better-auth/plugin/payload/views/create-first-admin/client.d.ts +0 -14
- package/dist/better-auth/plugin/payload/views/create-first-admin/client.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/create-first-admin/client.js +0 -95
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts +0 -12
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.js +0 -144
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.scss +0 -29
- package/dist/better-auth/plugin/payload/views/forgot-password/index.scss +0 -0
- package/dist/better-auth/plugin/payload/views/inactivity/index.d.ts +0 -5
- package/dist/better-auth/plugin/payload/views/inactivity/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/inactivity/index.js +0 -12
- package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.d.ts +0 -9
- package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.js +0 -54
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.d.ts +0 -1
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.js +0 -121
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.scss +0 -31
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.d.ts +0 -56
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.js +0 -3
- package/dist/better-auth/plugin/payload/views/login/form/index.d.ts +0 -17
- package/dist/better-auth/plugin/payload/views/login/form/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/login/form/index.js +0 -137
- package/dist/better-auth/plugin/payload/views/login/form/index.scss +0 -23
- package/dist/better-auth/plugin/payload/views/login/index.d.ts +0 -11
- package/dist/better-auth/plugin/payload/views/login/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/login/index.js +0 -98
- package/dist/better-auth/plugin/payload/views/login/index.scss +0 -10
- package/dist/better-auth/plugin/payload/views/logout/client.d.ts +0 -8
- package/dist/better-auth/plugin/payload/views/logout/client.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/logout/client.js +0 -76
- package/dist/better-auth/plugin/payload/views/logout/index.d.ts +0 -8
- package/dist/better-auth/plugin/payload/views/logout/index.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/logout/index.js +0 -14
- package/dist/better-auth/plugin/payload/views/logout/index.scss +0 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.scss +0 -9
- package/dist/better-auth/plugin/payload/views/reset-password/metadata.d.ts +0 -3
- package/dist/better-auth/plugin/payload/views/reset-password/metadata.d.ts.map +0 -1
- package/dist/better-auth/plugin/payload/views/reset-password/metadata.js +0 -11
- /package/dist/{better-auth/plugin/payload/components/form-header → shared/form/ui/header}/index.scss +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useStore } from "@tanstack/react-form";
|
|
3
|
+
import { useFieldContext } from "../index";
|
|
4
|
+
import { FieldErrors, FieldInputWrap, FormField, FormLabel } from "../ui";
|
|
5
|
+
export function TextField({ className, label, required = false, type = 'text', autoComplete = 'off' }) {
|
|
6
|
+
const field = useFieldContext();
|
|
7
|
+
const meta = useStore(field.store, (state)=>state.meta);
|
|
8
|
+
const hasError = meta.isTouched && meta.errors.length > 0;
|
|
9
|
+
return /*#__PURE__*/ _jsxs(FormField, {
|
|
10
|
+
id: field.name,
|
|
11
|
+
className: className,
|
|
12
|
+
hasError: hasError,
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
15
|
+
label: label,
|
|
16
|
+
htmlFor: field.name,
|
|
17
|
+
required: required
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ _jsxs(FieldInputWrap, {
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx("input", {
|
|
22
|
+
autoComplete: autoComplete,
|
|
23
|
+
type: type,
|
|
24
|
+
id: field.name,
|
|
25
|
+
name: field.name,
|
|
26
|
+
value: field.state.value,
|
|
27
|
+
onChange: (e)=>field.handleChange(e.target.value),
|
|
28
|
+
onBlur: field.handleBlur,
|
|
29
|
+
required: required,
|
|
30
|
+
className: "text-field"
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ _jsx(FieldErrors, {
|
|
33
|
+
meta: meta
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
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NKLEtBQUs7d0JBQ2xESyxRQUFRakIsTUFBTWtCLFVBQVU7d0JBQ3hCckIsVUFBVUE7d0JBQ1ZGLFdBQVU7O2tDQUVaLEtBQUNMO3dCQUFZVyxNQUFNQTs7Ozs7O0FBSTNCIn0=
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextField } from './fields/text-field';
|
|
2
|
+
declare const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any>;
|
|
3
|
+
declare const useAppForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import("@tanstack/react-form").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta> & import("@tanstack/react-form").ReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta> & NoInfer<{
|
|
4
|
+
readonly Submit: import("react").FC<{
|
|
5
|
+
label: string;
|
|
6
|
+
loadingLabel: string;
|
|
7
|
+
}>;
|
|
8
|
+
}> & {
|
|
9
|
+
AppField: import("@tanstack/react-form").FieldComponent<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, NoInfer<{
|
|
10
|
+
readonly TextField: typeof TextField;
|
|
11
|
+
}>>;
|
|
12
|
+
AppForm: import("react").ComponentType<import("react").PropsWithChildren>;
|
|
13
|
+
}, withForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends Record<string, unknown> = {}>({ render, props, }: import("@tanstack/react-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, {
|
|
14
|
+
readonly TextField: typeof TextField;
|
|
15
|
+
}, {
|
|
16
|
+
readonly Submit: import("react").FC<{
|
|
17
|
+
label: string;
|
|
18
|
+
loadingLabel: string;
|
|
19
|
+
}>;
|
|
20
|
+
}, TRenderProps>) => (props: import("react").PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
21
|
+
form: import("@tanstack/react-form").FormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta> & import("@tanstack/react-form").ReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta> & NoInfer<{
|
|
22
|
+
readonly Submit: import("react").FC<{
|
|
23
|
+
label: string;
|
|
24
|
+
loadingLabel: string;
|
|
25
|
+
}>;
|
|
26
|
+
}> & {
|
|
27
|
+
AppField: import("@tanstack/react-form").FieldComponent<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, NoInfer<{
|
|
28
|
+
readonly TextField: typeof TextField;
|
|
29
|
+
}>>;
|
|
30
|
+
AppForm: import("react").ComponentType<import("react").PropsWithChildren>;
|
|
31
|
+
};
|
|
32
|
+
}>) => import("react").JSX.Element;
|
|
33
|
+
export { useAppForm, withForm, fieldContext, formContext, useFieldContext, useFormContext };
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/form/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAG/C,QAAA,MAAQ,YAAY,uEAAE,WAAW,sEAAE,eAAe,4JAAE,cAAc,+HAA6B,CAAA;AAE/F,QAAA,MAAQ,UAAU;;;;;;;;;;GAAE,QAAQ;;;;;;;;;;;;;;;;;;;kCAS1B,CAAA;AAEF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFormHookContexts, createFormHook } from "@tanstack/react-form";
|
|
2
|
+
import { TextField } from "./fields/text-field";
|
|
3
|
+
import { Submit } from "./components/submit";
|
|
4
|
+
const { fieldContext, formContext, useFieldContext, useFormContext } = createFormHookContexts();
|
|
5
|
+
const { useAppForm, withForm } = createFormHook({
|
|
6
|
+
fieldContext,
|
|
7
|
+
formContext,
|
|
8
|
+
fieldComponents: {
|
|
9
|
+
TextField
|
|
10
|
+
},
|
|
11
|
+
formComponents: {
|
|
12
|
+
Submit
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { useAppForm, withForm, fieldContext, formContext, useFieldContext, useFormContext };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zaGFyZWQvZm9ybS9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjcmVhdGVGb3JtSG9va0NvbnRleHRzLCBjcmVhdGVGb3JtSG9vayB9IGZyb20gJ0B0YW5zdGFjay9yZWFjdC1mb3JtJ1xuaW1wb3J0IHsgVGV4dEZpZWxkIH0gZnJvbSAnLi9maWVsZHMvdGV4dC1maWVsZCdcbmltcG9ydCB7IFN1Ym1pdCB9IGZyb20gJy4vY29tcG9uZW50cy9zdWJtaXQnXG5cbmNvbnN0IHsgZmllbGRDb250ZXh0LCBmb3JtQ29udGV4dCwgdXNlRmllbGRDb250ZXh0LCB1c2VGb3JtQ29udGV4dCB9ID0gY3JlYXRlRm9ybUhvb2tDb250ZXh0cygpXG5cbmNvbnN0IHsgdXNlQXBwRm9ybSwgd2l0aEZvcm0gfSA9IGNyZWF0ZUZvcm1Ib29rKHtcbiAgZmllbGRDb250ZXh0LFxuICBmb3JtQ29udGV4dCxcbiAgZmllbGRDb21wb25lbnRzOiB7XG4gICAgVGV4dEZpZWxkXG4gIH0sXG4gIGZvcm1Db21wb25lbnRzOiB7XG4gICAgU3VibWl0XG4gIH1cbn0pXG5cbmV4cG9ydCB7IHVzZUFwcEZvcm0sIHdpdGhGb3JtLCBmaWVsZENvbnRleHQsIGZvcm1Db250ZXh0LCB1c2VGaWVsZENvbnRleHQsIHVzZUZvcm1Db250ZXh0IH1cbiJdLCJuYW1lcyI6WyJjcmVhdGVGb3JtSG9va0NvbnRleHRzIiwiY3JlYXRlRm9ybUhvb2siLCJUZXh0RmllbGQiLCJTdWJtaXQiLCJmaWVsZENvbnRleHQiLCJmb3JtQ29udGV4dCIsInVzZUZpZWxkQ29udGV4dCIsInVzZUZvcm1Db250ZXh0IiwidXNlQXBwRm9ybSIsIndpdGhGb3JtIiwiZmllbGRDb21wb25lbnRzIiwiZm9ybUNvbXBvbmVudHMiXSwibWFwcGluZ3MiOiJBQUFBLFNBQVNBLHNCQUFzQixFQUFFQyxjQUFjLFFBQVEsdUJBQXNCO0FBQzdFLFNBQVNDLFNBQVMsUUFBUSxzQkFBcUI7QUFDL0MsU0FBU0MsTUFBTSxRQUFRLHNCQUFxQjtBQUU1QyxNQUFNLEVBQUVDLFlBQVksRUFBRUMsV0FBVyxFQUFFQyxlQUFlLEVBQUVDLGNBQWMsRUFBRSxHQUFHUDtBQUV2RSxNQUFNLEVBQUVRLFVBQVUsRUFBRUMsUUFBUSxFQUFFLEdBQUdSLGVBQWU7SUFDOUNHO0lBQ0FDO0lBQ0FLLGlCQUFpQjtRQUNmUjtJQUNGO0lBQ0FTLGdCQUFnQjtRQUNkUjtJQUNGO0FBQ0Y7QUFFQSxTQUFTSyxVQUFVLEVBQUVDLFFBQVEsRUFBRUwsWUFBWSxFQUFFQyxXQUFXLEVBQUVDLGVBQWUsRUFBRUMsY0FBYyxHQUFFIn0=
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
type Props = ComponentPropsWithoutRef<'div'> & {
|
|
4
|
+
description?: React.ReactNode | string;
|
|
5
|
+
heading: string;
|
|
6
|
+
};
|
|
7
|
+
declare const FormHeader: React.FC<Props>;
|
|
8
|
+
export { FormHeader };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/form/ui/header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,cAAc,CAAA;AAIrB,KAAK,KAAK,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC7C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAA;IACtC,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAW/B,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./index.scss";
|
|
4
|
+
const baseClass = 'form-header';
|
|
5
|
+
const FormHeader = ({ description, heading, ...props })=>{
|
|
6
|
+
if (!heading) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
10
|
+
className: baseClass,
|
|
11
|
+
...props,
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
14
|
+
children: heading
|
|
15
|
+
}),
|
|
16
|
+
Boolean(description) && /*#__PURE__*/ _jsx("p", {
|
|
17
|
+
children: description
|
|
18
|
+
})
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export { FormHeader };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9zaGFyZWQvZm9ybS91aS9oZWFkZXIvaW5kZXgudHN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyB0eXBlIENvbXBvbmVudFByb3BzV2l0aG91dFJlZiB9IGZyb20gJ3JlYWN0J1xuXG5pbXBvcnQgJy4vaW5kZXguc2NzcydcblxuY29uc3QgYmFzZUNsYXNzID0gJ2Zvcm0taGVhZGVyJ1xuXG50eXBlIFByb3BzID0gQ29tcG9uZW50UHJv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BQUUifQ==
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import type { AnyFieldMeta } from '@tanstack/react-form';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
5
|
+
hasError?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const FormField: React.FC<FormFieldProps>;
|
|
8
|
+
type FormLabelProps = ComponentPropsWithoutRef<'label'> & {
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const FormLabel: React.FC<FormLabelProps>;
|
|
13
|
+
type FieldErrorsProps = {
|
|
14
|
+
meta: AnyFieldMeta;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const FieldErrors: ({ meta, className }: FieldErrorsProps) => React.JSX.Element | null;
|
|
18
|
+
type FormErrorProps = {
|
|
19
|
+
errors?: string[];
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
declare const FormError: React.FC<FormErrorProps>;
|
|
23
|
+
type FormProps = ComponentPropsWithoutRef<'form'>;
|
|
24
|
+
declare const Form: React.FC<FormProps>;
|
|
25
|
+
type FormInputWrapProps = ComponentPropsWithoutRef<'div'>;
|
|
26
|
+
declare const FormInputWrap: React.FC<FormInputWrapProps>;
|
|
27
|
+
type FieldInputWrapProps = ComponentPropsWithoutRef<'div'>;
|
|
28
|
+
declare const FieldInputWrap: React.FC<FieldInputWrapProps>;
|
|
29
|
+
export type { FormFieldProps, FormLabelProps, FormErrorProps, FormProps, FormInputWrapProps };
|
|
30
|
+
export { FormField, FormLabel, FormError, Form, FormInputWrap, FieldInputWrap };
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/form/ui/index.tsx"],"names":[],"m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AE1D,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAIjD,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAA;AAC7F,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { Tooltip } from "@payloadcms/ui/elements/Tooltip";
|
|
5
|
+
import "./index.scss";
|
|
6
|
+
const FormField = ({ children, hasError, className, ...rest })=>/*#__PURE__*/ _jsx("div", {
|
|
7
|
+
className: clsx('field-type', className, {
|
|
8
|
+
error: hasError
|
|
9
|
+
}),
|
|
10
|
+
...rest,
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
const FormLabel = ({ label, required = false, className, ...rest })=>/*#__PURE__*/ _jsxs("label", {
|
|
14
|
+
className: clsx('field-label', className),
|
|
15
|
+
...rest,
|
|
16
|
+
children: [
|
|
17
|
+
label,
|
|
18
|
+
required && /*#__PURE__*/ _jsx("span", {
|
|
19
|
+
className: "required",
|
|
20
|
+
children: "*"
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
export const FieldErrors = ({ meta, className })=>{
|
|
25
|
+
if (!meta.isTouched) return null;
|
|
26
|
+
const error = meta.errors.at(0)?.message || null;
|
|
27
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
28
|
+
alignCaret: "right",
|
|
29
|
+
className: clsx('field-error', className),
|
|
30
|
+
show: !!error,
|
|
31
|
+
delay: 0,
|
|
32
|
+
staticPositioning: true,
|
|
33
|
+
children: error
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const FormError = ({ errors, className })=>errors ? /*#__PURE__*/ _jsx("div", {
|
|
37
|
+
className: clsx('form-error', className),
|
|
38
|
+
children: errors.join(', ')
|
|
39
|
+
}) : null;
|
|
40
|
+
const Form = ({ children, className, ...rest })=>/*#__PURE__*/ _jsx("form", {
|
|
41
|
+
className: clsx('form', className),
|
|
42
|
+
...rest,
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
const FormInputWrap = ({ children, className, ...rest })=>/*#__PURE__*/ _jsx("div", {
|
|
46
|
+
className: `${className}__inputWrap`,
|
|
47
|
+
...rest,
|
|
48
|
+
children: children
|
|
49
|
+
});
|
|
50
|
+
const FieldInputWrap = ({ children, className, ...rest })=>/*#__PURE__*/ _jsx("div", {
|
|
51
|
+
className: clsx('field-type__wrap', className),
|
|
52
|
+
...rest,
|
|
53
|
+
children: children
|
|
54
|
+
});
|
|
55
|
+
export { FormField, FormLabel, FormError, Form, FormInputWrap, FieldInputWrap };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9zaGFyZWQvZm9ybS91aS9pbmRleC50c3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IHR5cGUgQ29tcG9uZW50UHJvcHNXaXRob3V0UmVmLCB0eXBlIFJlYWN0Tm9kZSB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IGNsc3ggZnJvbSAnY2xzeCdcbmltcG9ydCB0eXBlIHsgQW55RmllbGRNZXRhIH0gZnJvbSAnQHRhbnN0YWNrL3JlYWN0LWZvcm0nXG5pbXBvcnQgeyBUb29sdGlwIH0gZnJvbSAnQHBheWxvYWRjbXMvdWkvZWxlbWVudHMvVG9vbHRpcCdcblxuaW1wb3J0ICcuL2luZGV4LnNjc3MnXG5cbnR5cGUgRm9ybUZpZWxkUHJvcHMgPSBDb21wb25lbnRQcm9wc1dpdGhvdXRSZWY8J2Rp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QztBQU9ELE1BQU1lLFlBQXNDLENBQUMsRUFBRVAsTUFBTSxFQUFFWCxTQUFTLEVBQUUsR0FDaEVXLHVCQUNFLEtBQUNUO1FBQUlGLFdBQVdMLEtBQUssY0FBY0s7a0JBQ2hDVyxPQUFPUSxJQUFJLENBQUM7U0FFYjtBQUlOLE1BQU1DLE9BQTRCLENBQUMsRUFBRXRCLFFBQVEsRUFBRUUsU0FBUyxFQUFFLEdBQUdDLE1BQU0saUJBQ2pFLEtBQUNvQjtRQUFLckIsV0FBV0wsS0FBSyxRQUFRSztRQUFhLEdBQUdDLElBQUk7a0JBQy9DSDs7QUFNTCxNQUFNd0IsZ0JBQThDLENBQUMsRUFBRXhCLFFBQVEsRUFBRUUsU0FBUyxFQUFFLEdBQUdDLE1BQU0saUJBQ25GLEtBQUNDO1FBQUlGLFdBQVcsR0FBR0EsVUFBVSxXQUFXLENBQUM7UUFBRyxHQUFHQyxJQUFJO2tCQUNoREg7O0FBTUwsTUFBTXlCLGlCQUFnRCxDQUFDLEVBQUV6QixRQUFRLEVBQUVFLFNBQVMsRUFBRSxHQUFHQyxNQUFNLGlCQUNyRixLQUFDQztRQUFJRixXQUFXTCxLQUFLLG9CQUFvQks7UUFBYSxHQUFHQyxJQUFJO2tCQUMxREg7O0FBS0wsU0FBU0QsU0FBUyxFQUFFTyxTQUFTLEVBQUVjLFNBQVMsRUFBRUUsSUFBSSxFQUFFRSxhQUFhLEVBQUVDLGNBQWMsR0FBRSJ9
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.field-error {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.field-error-message {
|
|
6
|
+
margin-top: 6px;
|
|
7
|
+
color: var(--theme-error-950);
|
|
8
|
+
background-color: var(--theme-error-300);
|
|
9
|
+
border-radius: 2px;
|
|
10
|
+
padding: 4px 8px;
|
|
11
|
+
line-height: 15px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
html[data-theme="light"] .form-error {
|
|
15
|
+
background-color: var(--theme-error-200);
|
|
16
|
+
color: black;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.form-error {
|
|
20
|
+
display: block;
|
|
21
|
+
color: var(--theme-error-950);
|
|
22
|
+
background-color: var(--theme-error-300);
|
|
23
|
+
color: white;
|
|
24
|
+
border-radius: var(--style-radius-s);
|
|
25
|
+
padding: 10px 15px;
|
|
26
|
+
margin-bottom: 1.2rem;
|
|
27
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal translation function type extracted from `i18next`.
|
|
4
|
+
* Accepts a key and returns the translated string.
|
|
5
|
+
*/
|
|
6
|
+
export type Translate = (...args: any[]) => string;
|
|
7
|
+
export declare const emailField: ({ t, required }: {
|
|
8
|
+
t: Translate;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}) => z.ZodEffects<z.ZodString, string, string>;
|
|
11
|
+
export declare const usernameField: ({ t, required, minLength, maxLength }: {
|
|
12
|
+
t: Translate;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
minLength?: number;
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
}) => z.ZodEffects<z.ZodString, string, string>;
|
|
17
|
+
export declare const passwordField: ({ t, required, minLength }: {
|
|
18
|
+
t: Translate;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
minLength?: number;
|
|
21
|
+
}) => z.ZodString;
|
|
22
|
+
export declare const confirmPasswordField: ({ t, required }: {
|
|
23
|
+
t: Translate;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
}) => z.ZodString;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a Zod object schema with `password` and `confirmPassword` fields
|
|
28
|
+
* and a refinement that ensures they match.
|
|
29
|
+
*/
|
|
30
|
+
export declare const passwordWithConfirmation: ({ t, minLength }: {
|
|
31
|
+
t: Translate;
|
|
32
|
+
minLength?: number;
|
|
33
|
+
}) => z.ZodEffects<z.ZodObject<{
|
|
34
|
+
password: z.ZodString;
|
|
35
|
+
confirmPassword: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
password: string;
|
|
38
|
+
confirmPassword: string;
|
|
39
|
+
}, {
|
|
40
|
+
password: string;
|
|
41
|
+
confirmPassword: string;
|
|
42
|
+
}>, {
|
|
43
|
+
password: string;
|
|
44
|
+
confirmPassword: string;
|
|
45
|
+
}, {
|
|
46
|
+
password: string;
|
|
47
|
+
confirmPassword: string;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const isValidEmail: (val: string) => boolean;
|
|
50
|
+
export declare const isValidUsername: (val: string, { minLength, maxLength }?: {
|
|
51
|
+
minLength?: number;
|
|
52
|
+
maxLength?: number;
|
|
53
|
+
}) => boolean;
|
|
54
|
+
type UsernameSettings = {
|
|
55
|
+
minLength: number;
|
|
56
|
+
maxLength: number;
|
|
57
|
+
};
|
|
58
|
+
export declare const createLoginSchema: ({ t, loginType, canLoginWithUsername, usernameSettings }: {
|
|
59
|
+
t: Translate;
|
|
60
|
+
loginType: "email" | "username" | "emailOrUsername";
|
|
61
|
+
canLoginWithUsername?: boolean;
|
|
62
|
+
usernameSettings?: UsernameSettings;
|
|
63
|
+
}) => z.ZodObject<{
|
|
64
|
+
login: z.ZodEffects<z.ZodString, string, string>;
|
|
65
|
+
password: z.ZodString;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
password: string;
|
|
68
|
+
login: string;
|
|
69
|
+
}, {
|
|
70
|
+
password: string;
|
|
71
|
+
login: string;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const createSignupSchema: ({ t, requireUsername }: {
|
|
74
|
+
t: Translate;
|
|
75
|
+
requireUsername?: boolean;
|
|
76
|
+
}) => z.ZodEffects<z.ZodObject<{
|
|
77
|
+
email: z.ZodEffects<z.ZodString, string, string>;
|
|
78
|
+
username: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
79
|
+
password: z.ZodString;
|
|
80
|
+
confirmPassword: z.ZodString;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
email: string;
|
|
83
|
+
password: string;
|
|
84
|
+
confirmPassword: string;
|
|
85
|
+
username?: string | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
email: string;
|
|
88
|
+
password: string;
|
|
89
|
+
confirmPassword: string;
|
|
90
|
+
username?: string | undefined;
|
|
91
|
+
}>, {
|
|
92
|
+
email: string;
|
|
93
|
+
password: string;
|
|
94
|
+
confirmPassword: string;
|
|
95
|
+
username?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
email: string;
|
|
98
|
+
password: string;
|
|
99
|
+
confirmPassword: string;
|
|
100
|
+
username?: string | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/shared/form/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAA;AAMlD,eAAO,MAAM,UAAU,GAAI,iBAAwB;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,8CAMtF,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,uCAK3B;IACD,CAAC,EAAE,SAAS,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,8CAMA,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,4BAAuC;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,gBAI5H,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,iBAAwB;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,gBAIhG,CAAA;AAMD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,kBAAsB;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;EAS7F,CAAA;AAMN,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,YAAyB,CAAA;AACjE,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,EAAE,2BAAoC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,YACjD,CAAA;AAM/E,KAAK,gBAAgB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhE,eAAO,MAAM,iBAAiB,GAAI,0DAK/B;IACD,CAAC,EAAE,SAAS,CAAA;IACZ,SAAS,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,CAAA;IACnD,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC;;;;;;;;;EA8BG,CAAA;AAEJ,eAAO,MAAM,kBAAkB,GAAI,wBAAgC;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;EAWxG,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { emailRegex, usernameRegex } from "../utils/regex";
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Field builders
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
export const emailField = ({ t, required = true })=>{
|
|
7
|
+
let schema = z.string();
|
|
8
|
+
if (required) schema = schema.min(1, t('validation:required'));
|
|
9
|
+
return schema.refine((val)=>emailRegex.test(val), {
|
|
10
|
+
message: t('authentication:emailNotValid') || 'Email is not valid'
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export const usernameField = ({ t, required = true, minLength = 5, maxLength = 128 })=>{
|
|
14
|
+
let schema = z.string();
|
|
15
|
+
if (required) schema = schema.min(1, t('validation:required'));
|
|
16
|
+
return schema.refine((val)=>usernameRegex.test(val) && val.length >= minLength && val.length <= maxLength, {
|
|
17
|
+
message: t('authentication:usernameNotValid') || 'Username is not valid'
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export const passwordField = ({ t, required = true, minLength = 1 })=>{
|
|
21
|
+
let schema = z.string();
|
|
22
|
+
if (required) schema = schema.min(minLength, t('validation:required') || 'Password is required');
|
|
23
|
+
return schema;
|
|
24
|
+
};
|
|
25
|
+
export const confirmPasswordField = ({ t, required = true })=>{
|
|
26
|
+
let schema = z.string();
|
|
27
|
+
if (required) schema = schema.min(1, t('validation:required') || 'Confirm password is required');
|
|
28
|
+
return schema;
|
|
29
|
+
};
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Composables
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
/**
|
|
34
|
+
* Returns a Zod object schema with `password` and `confirmPassword` fields
|
|
35
|
+
* and a refinement that ensures they match.
|
|
36
|
+
*/ export const passwordWithConfirmation = ({ t, minLength = 1 })=>z.object({
|
|
37
|
+
password: passwordField({
|
|
38
|
+
t,
|
|
39
|
+
minLength
|
|
40
|
+
}),
|
|
41
|
+
confirmPassword: confirmPasswordField({
|
|
42
|
+
t
|
|
43
|
+
})
|
|
44
|
+
}).refine((data)=>data.password === data.confirmPassword, {
|
|
45
|
+
path: [
|
|
46
|
+
'confirmPassword'
|
|
47
|
+
],
|
|
48
|
+
message: t('fields:passwordsDoNotMatch') || 'Passwords do not match'
|
|
49
|
+
});
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Utility validators (non‑Zod) — handy for dynamic login field checks
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
export const isValidEmail = (val)=>emailRegex.test(val);
|
|
54
|
+
export const isValidUsername = (val, { minLength = 5, maxLength = 128 } = {})=>usernameRegex.test(val) && val.length >= minLength && val.length <= maxLength;
|
|
55
|
+
export const createLoginSchema = ({ t, loginType, canLoginWithUsername = false, usernameSettings = {
|
|
56
|
+
minLength: 5,
|
|
57
|
+
maxLength: 128
|
|
58
|
+
} })=>z.object({
|
|
59
|
+
login: z.string().refine((val)=>{
|
|
60
|
+
if (!val) return false;
|
|
61
|
+
if (loginType === 'email') return isValidEmail(val);
|
|
62
|
+
if (loginType === 'username') return isValidUsername(val, usernameSettings);
|
|
63
|
+
return isValidEmail(val) || isValidUsername(val, usernameSettings);
|
|
64
|
+
}, (val)=>{
|
|
65
|
+
if (!val) return {
|
|
66
|
+
message: t('validation:required')
|
|
67
|
+
};
|
|
68
|
+
const isProbablyEmail = val.includes('@') || !canLoginWithUsername;
|
|
69
|
+
if (loginType === 'email') {
|
|
70
|
+
return {
|
|
71
|
+
message: t('authentication:emailNotValid') || 'Email is not valid'
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (loginType === 'username') {
|
|
75
|
+
return {
|
|
76
|
+
message: t('authentication:usernameNotValid') || 'Username is not valid'
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
message: isProbablyEmail ? t('authentication:emailNotValid') || 'Email is not valid' : t('authentication:usernameNotValid') || 'Username is not valid'
|
|
81
|
+
};
|
|
82
|
+
}),
|
|
83
|
+
password: passwordField({
|
|
84
|
+
t
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
export const createSignupSchema = ({ t, requireUsername = false })=>z.object({
|
|
88
|
+
email: emailField({
|
|
89
|
+
t
|
|
90
|
+
}),
|
|
91
|
+
username: usernameField({
|
|
92
|
+
t,
|
|
93
|
+
required: requireUsername
|
|
94
|
+
}).optional(),
|
|
95
|
+
password: passwordField({
|
|
96
|
+
t
|
|
97
|
+
}),
|
|
98
|
+
confirmPassword: confirmPasswordField({
|
|
99
|
+
t
|
|
100
|
+
})
|
|
101
|
+
}).refine((data)=>data.password === data.confirmPassword, {
|
|
102
|
+
path: [
|
|
103
|
+
'confirmPassword'
|
|
104
|
+
],
|
|
105
|
+
message: t('fields:passwordsDoNotMatch') || 'Passwords do not match'
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zaGFyZWQvZm9ybS92YWxpZGF0aW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHogfSBmcm9tICd6b2QnXG5cbmltcG9ydCB7IGVtYWlsUmVnZXgsIHVzZXJuYW1lUmVnZXggfSBmcm9tICdAL3NoYXJlZC91dGlscy9yZWdleCdcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG4vLyBUeXBlc1xuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbi8qKlxuICogTWluaW1hbCB0cmFuc2xhdGlvbiBmdW5jdGlvbiB0eXBlIGV4dHJhY3RlZCBmcm9tIGBpMThuZXh0YC5cbiAqIEFjY2VwdHMgYSBrZXkgYW5kIHJldHVybnMgdGhlIHRyYW5zbGF0ZWQgc3RyaW5nLlxuICovXG5leHBvcnQgdHlwZSBUcmFuc2xhdGUgPSAoLi4uYXJnczogYW55W10pID0+IHN0cmluZ1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tL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FxQjtZQUFFZDtRQUFFO0lBQzVDLEdBQ0NLLE1BQU0sQ0FBQyxDQUFDYyxPQUFTQSxLQUFLRixRQUFRLEtBQUtFLEtBQUtELGVBQWUsRUFBRTtRQUN4REUsTUFBTTtZQUFDO1NBQWtCO1FBQ3pCWixTQUFTUixFQUFFLGlDQUFpQztJQUM5QyxHQUFFIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from "./payload/fields/field-copy-button";
|
|
2
|
+
export * from "./payload/fields/generate-uuid-button";
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaGFyZWQvaW5kZXgudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9wYXlsb2FkL2ZpZWxkcy9maWVsZC1jb3B5LWJ1dHRvbidcbmV4cG9ydCAqIGZyb20gJy4vcGF5bG9hZC9maWVsZHMvZ2VuZXJhdGUtdXVpZC1idXR0b24nXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxxQ0FBb0M7QUFDbEQsY0FBYyx3Q0FBdUMifQ==
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.field-copy-text__button-wrapper {
|
|
2
|
+
position: absolute;
|
|
3
|
+
right: 0;
|
|
4
|
+
top: 0;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.field-copy-text__button {
|
|
9
|
+
margin-block: 0;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.field-copy-text__button:focus {
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.field-copy-text__tooltip {
|
|
18
|
+
position: absolute;
|
|
19
|
+
bottom: 100%;
|
|
20
|
+
right: 50%;
|
|
21
|
+
transform: translateX(50%) translateY(5px);
|
|
22
|
+
background-color: var(--theme-elevation-800);
|
|
23
|
+
color: var(--theme-elevation-0);
|
|
24
|
+
padding: 2px 8px;
|
|
25
|
+
border-radius: var(--style-radius-m);
|
|
26
|
+
font-size: 13px;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
transition: all 0.2s ease;
|
|
30
|
+
z-index: 3;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.field-copy-text__tooltip[data-visible='true'] {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
transform: translateX(50%) translateY(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.field-copy-text__tooltip::after {
|
|
39
|
+
content: '';
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 100%;
|
|
42
|
+
left: 50%;
|
|
43
|
+
transform: translateX(-50%);
|
|
44
|
+
border-left: 6px solid transparent;
|
|
45
|
+
border-right: 6px solid transparent;
|
|
46
|
+
border-top: 6px solid var(--theme-elevation-800);
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/payload/fields/field-copy-button/index.tsx"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAA;AACpB,OAAO,EAAoB,SAAS,EAAY,MAAM,gBAAgB,CAAA;AAGtE,eAAO,MAAM,eAAe,EAAE,OAAO,SAoBpC,CAAA"}
|