@revealui/auth 0.0.1-pre.0 → 0.2.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.
Files changed (475) hide show
  1. package/LICENSE +22 -202
  2. package/README.md +77 -0
  3. package/dist/index.d.ts +10 -1
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +10 -4
  6. package/dist/react/index.d.ts +15 -0
  7. package/dist/react/index.d.ts.map +1 -0
  8. package/dist/react/index.js +10 -0
  9. package/dist/react/useSession.d.ts +32 -0
  10. package/dist/react/useSession.d.ts.map +1 -0
  11. package/dist/react/useSession.js +98 -0
  12. package/dist/react/useSignIn.d.ts +41 -0
  13. package/dist/react/useSignIn.d.ts.map +1 -0
  14. package/dist/react/useSignIn.js +99 -0
  15. package/dist/react/useSignOut.d.ts +30 -0
  16. package/dist/react/useSignOut.d.ts.map +1 -0
  17. package/dist/react/useSignOut.js +57 -0
  18. package/dist/react/useSignUp.d.ts +42 -0
  19. package/dist/react/useSignUp.d.ts.map +1 -0
  20. package/dist/react/useSignUp.js +90 -0
  21. package/dist/server/auth.d.ts +44 -0
  22. package/dist/server/auth.d.ts.map +1 -0
  23. package/dist/server/auth.js +297 -0
  24. package/dist/server/brute-force.d.ts +44 -0
  25. package/dist/server/brute-force.d.ts.map +1 -0
  26. package/dist/server/brute-force.js +140 -0
  27. package/dist/server/errors.d.ts +24 -0
  28. package/dist/server/errors.d.ts.map +1 -0
  29. package/dist/server/errors.js +43 -0
  30. package/dist/server/index.d.ts +16 -0
  31. package/dist/server/index.d.ts.map +1 -0
  32. package/dist/server/index.js +13 -0
  33. package/dist/server/password-reset.d.ts +44 -0
  34. package/dist/server/password-reset.d.ts.map +1 -0
  35. package/dist/server/password-reset.js +206 -0
  36. package/dist/server/password-validation.d.ts +25 -0
  37. package/dist/server/password-validation.d.ts.map +1 -0
  38. package/dist/server/password-validation.js +47 -0
  39. package/dist/server/rate-limit.d.ts +45 -0
  40. package/dist/server/rate-limit.d.ts.map +1 -0
  41. package/dist/server/rate-limit.js +130 -0
  42. package/dist/server/session.d.ts +47 -0
  43. package/dist/server/session.d.ts.map +1 -0
  44. package/dist/server/session.js +248 -0
  45. package/dist/server/storage/database.d.ts +17 -0
  46. package/dist/server/storage/database.d.ts.map +1 -0
  47. package/dist/server/storage/database.js +72 -0
  48. package/dist/server/storage/in-memory.d.ts +24 -0
  49. package/dist/server/storage/in-memory.d.ts.map +1 -0
  50. package/dist/server/storage/in-memory.js +70 -0
  51. package/dist/server/storage/index.d.ts +26 -0
  52. package/dist/server/storage/index.d.ts.map +1 -0
  53. package/dist/server/storage/index.js +80 -0
  54. package/dist/server/storage/interface.d.ts +36 -0
  55. package/dist/server/storage/interface.d.ts.map +1 -0
  56. package/dist/server/storage/interface.js +6 -0
  57. package/dist/types.d.ts +63 -0
  58. package/dist/types.d.ts.map +1 -0
  59. package/dist/types.js +8 -0
  60. package/dist/utils/database.d.ts +53 -0
  61. package/dist/utils/database.d.ts.map +1 -0
  62. package/dist/utils/database.js +141 -0
  63. package/dist/utils/token.d.ts +22 -0
  64. package/dist/utils/token.d.ts.map +1 -0
  65. package/dist/utils/token.js +31 -0
  66. package/package.json +50 -106
  67. package/dist/better-auth/adapter/__tests__/transform.test.js +0 -213
  68. package/dist/better-auth/adapter/__tests__/transform.test.js.map +0 -1
  69. package/dist/better-auth/adapter/generate-schema/biome.d.js +0 -2
  70. package/dist/better-auth/adapter/generate-schema/biome.d.js.map +0 -1
  71. package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +0 -5
  72. package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +0 -482
  73. package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js.map +0 -1
  74. package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts +0 -1
  75. package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +0 -42
  76. package/dist/better-auth/adapter/generate-schema/get-payload-schema.js.map +0 -1
  77. package/dist/better-auth/adapter/generate-schema/index.d.ts +0 -4
  78. package/dist/better-auth/adapter/generate-schema/index.js +0 -19
  79. package/dist/better-auth/adapter/generate-schema/index.js.map +0 -1
  80. package/dist/better-auth/adapter/generate-schema/utils.d.ts +0 -2
  81. package/dist/better-auth/adapter/generate-schema/utils.js +0 -20
  82. package/dist/better-auth/adapter/generate-schema/utils.js.map +0 -1
  83. package/dist/better-auth/adapter/index.d.ts +0 -15
  84. package/dist/better-auth/adapter/index.js +0 -731
  85. package/dist/better-auth/adapter/index.js.map +0 -1
  86. package/dist/better-auth/adapter/tests/adapter.test.js +0 -174
  87. package/dist/better-auth/adapter/tests/adapter.test.js.map +0 -1
  88. package/dist/better-auth/adapter/tests/base-collections-tests.js +0 -575
  89. package/dist/better-auth/adapter/tests/base-collections-tests.js.map +0 -1
  90. package/dist/better-auth/adapter/tests/dev/index.js +0 -117
  91. package/dist/better-auth/adapter/tests/dev/index.js.map +0 -1
  92. package/dist/better-auth/adapter/tests/dev/migrate.js +0 -26
  93. package/dist/better-auth/adapter/tests/dev/migrate.js.map +0 -1
  94. package/dist/better-auth/adapter/tests/dev/migrations/20250423_232936_init.js +0 -218
  95. package/dist/better-auth/adapter/tests/dev/migrations/20250423_232936_init.js.map +0 -1
  96. package/dist/better-auth/adapter/tests/dev/schema.js +0 -160
  97. package/dist/better-auth/adapter/tests/dev/schema.js.map +0 -1
  98. package/dist/better-auth/adapter/tests/plugins-tests.js +0 -2
  99. package/dist/better-auth/adapter/tests/plugins-tests.js.map +0 -1
  100. package/dist/better-auth/adapter/transform/index.d.ts +0 -27
  101. package/dist/better-auth/adapter/transform/index.js +0 -664
  102. package/dist/better-auth/adapter/transform/index.js.map +0 -1
  103. package/dist/better-auth/adapter/types.d.ts +0 -10
  104. package/dist/better-auth/adapter/types.js +0 -3
  105. package/dist/better-auth/adapter/types.js.map +0 -1
  106. package/dist/better-auth/generated-types.d.ts +0 -285
  107. package/dist/better-auth/index.d.ts +0 -3
  108. package/dist/better-auth/index.js +0 -5
  109. package/dist/better-auth/index.js.map +0 -1
  110. package/dist/better-auth/plugin/__tests__/plugin.test.js +0 -162
  111. package/dist/better-auth/plugin/__tests__/plugin.test.js.map +0 -1
  112. package/dist/better-auth/plugin/constants.d.ts +0 -220
  113. package/dist/better-auth/plugin/constants.js +0 -249
  114. package/dist/better-auth/plugin/constants.js.map +0 -1
  115. package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts +0 -12
  116. package/dist/better-auth/plugin/helpers/check-plugin-exists.js +0 -14
  117. package/dist/better-auth/plugin/helpers/check-plugin-exists.js.map +0 -1
  118. package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +0 -29
  119. package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +0 -46
  120. package/dist/better-auth/plugin/helpers/generate-verify-email-url.js.map +0 -1
  121. package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +0 -7
  122. package/dist/better-auth/plugin/helpers/get-admin-access.js +0 -22
  123. package/dist/better-auth/plugin/helpers/get-admin-access.js.map +0 -1
  124. package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +0 -5
  125. package/dist/better-auth/plugin/helpers/get-all-roles.js +0 -20
  126. package/dist/better-auth/plugin/helpers/get-all-roles.js.map +0 -1
  127. package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts +0 -18
  128. package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +0 -70
  129. package/dist/better-auth/plugin/helpers/get-better-auth-schema.js.map +0 -1
  130. package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts +0 -5
  131. package/dist/better-auth/plugin/helpers/get-collection-slug.js +0 -20
  132. package/dist/better-auth/plugin/helpers/get-collection-slug.js.map +0 -1
  133. package/dist/better-auth/plugin/helpers/get-collection.d.ts +0 -15
  134. package/dist/better-auth/plugin/helpers/get-collection.js +0 -29
  135. package/dist/better-auth/plugin/helpers/get-collection.js.map +0 -1
  136. package/dist/better-auth/plugin/helpers/get-ip.d.ts +0 -2
  137. package/dist/better-auth/plugin/helpers/get-ip.js +0 -31
  138. package/dist/better-auth/plugin/helpers/get-ip.js.map +0 -1
  139. package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts +0 -2
  140. package/dist/better-auth/plugin/helpers/get-signed-cookie.js +0 -65
  141. package/dist/better-auth/plugin/helpers/get-signed-cookie.js.map +0 -1
  142. package/dist/better-auth/plugin/helpers/index.d.ts +0 -1
  143. package/dist/better-auth/plugin/helpers/index.js +0 -3
  144. package/dist/better-auth/plugin/helpers/index.js.map +0 -1
  145. package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +0 -59
  146. package/dist/better-auth/plugin/helpers/prepare-session-data.js +0 -49
  147. package/dist/better-auth/plugin/helpers/prepare-session-data.js.map +0 -1
  148. package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts +0 -20
  149. package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js +0 -67
  150. package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js.map +0 -1
  151. package/dist/better-auth/plugin/index.d.ts +0 -11
  152. package/dist/better-auth/plugin/index.js +0 -125
  153. package/dist/better-auth/plugin/index.js.map +0 -1
  154. package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts +0 -12
  155. package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js +0 -87
  156. package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js.map +0 -1
  157. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +0 -3
  158. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +0 -60
  159. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js.map +0 -1
  160. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +0 -3
  161. package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +0 -154
  162. package/dist/better-auth/plugin/lib/build-collections/accounts/index.js.map +0 -1
  163. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +0 -5
  164. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +0 -11
  165. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js.map +0 -1
  166. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +0 -2
  167. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js +0 -8
  168. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js.map +0 -1
  169. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +0 -6
  170. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +0 -119
  171. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js.map +0 -1
  172. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +0 -3
  173. package/dist/better-auth/plugin/lib/build-collections/api-keys.js +0 -177
  174. package/dist/better-auth/plugin/lib/build-collections/api-keys.js.map +0 -1
  175. package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts +0 -3
  176. package/dist/better-auth/plugin/lib/build-collections/device-code.js +0 -50
  177. package/dist/better-auth/plugin/lib/build-collections/device-code.js.map +0 -1
  178. package/dist/better-auth/plugin/lib/build-collections/index.d.ts +0 -10
  179. package/dist/better-auth/plugin/lib/build-collections/index.js +0 -73
  180. package/dist/better-auth/plugin/lib/build-collections/index.js.map +0 -1
  181. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +0 -3
  182. package/dist/better-auth/plugin/lib/build-collections/invitations.js +0 -94
  183. package/dist/better-auth/plugin/lib/build-collections/invitations.js.map +0 -1
  184. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +0 -3
  185. package/dist/better-auth/plugin/lib/build-collections/jwks.js +0 -59
  186. package/dist/better-auth/plugin/lib/build-collections/jwks.js.map +0 -1
  187. package/dist/better-auth/plugin/lib/build-collections/members.d.ts +0 -3
  188. package/dist/better-auth/plugin/lib/build-collections/members.js +0 -73
  189. package/dist/better-auth/plugin/lib/build-collections/members.js.map +0 -1
  190. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +0 -3
  191. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +0 -107
  192. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js.map +0 -1
  193. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +0 -3
  194. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +0 -118
  195. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js.map +0 -1
  196. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +0 -3
  197. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +0 -89
  198. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js.map +0 -1
  199. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +0 -3
  200. package/dist/better-auth/plugin/lib/build-collections/organizations.js +0 -70
  201. package/dist/better-auth/plugin/lib/build-collections/organizations.js.map +0 -1
  202. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +0 -3
  203. package/dist/better-auth/plugin/lib/build-collections/passkeys.js +0 -115
  204. package/dist/better-auth/plugin/lib/build-collections/passkeys.js.map +0 -1
  205. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +0 -3
  206. package/dist/better-auth/plugin/lib/build-collections/sessions.js +0 -170
  207. package/dist/better-auth/plugin/lib/build-collections/sessions.js.map +0 -1
  208. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +0 -3
  209. package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +0 -81
  210. package/dist/better-auth/plugin/lib/build-collections/sso-providers.js.map +0 -1
  211. package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts +0 -3
  212. package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +0 -111
  213. package/dist/better-auth/plugin/lib/build-collections/subscriptions.js.map +0 -1
  214. package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts +0 -3
  215. package/dist/better-auth/plugin/lib/build-collections/team-members.js +0 -57
  216. package/dist/better-auth/plugin/lib/build-collections/team-members.js.map +0 -1
  217. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +0 -3
  218. package/dist/better-auth/plugin/lib/build-collections/teams.js +0 -76
  219. package/dist/better-auth/plugin/lib/build-collections/teams.js.map +0 -1
  220. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +0 -3
  221. package/dist/better-auth/plugin/lib/build-collections/two-factors.js +0 -67
  222. package/dist/better-auth/plugin/lib/build-collections/two-factors.js.map +0 -1
  223. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +0 -7
  224. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +0 -53
  225. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js.map +0 -1
  226. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +0 -11
  227. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +0 -75
  228. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js.map +0 -1
  229. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts +0 -4
  230. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js +0 -6
  231. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js.map +0 -1
  232. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +0 -2
  233. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +0 -115
  234. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js.map +0 -1
  235. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +0 -3
  236. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +0 -64
  237. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js.map +0 -1
  238. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +0 -3
  239. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +0 -80
  240. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js.map +0 -1
  241. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +0 -6
  242. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +0 -79
  243. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js.map +0 -1
  244. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +0 -2
  245. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +0 -82
  246. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js.map +0 -1
  247. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +0 -2
  248. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +0 -54
  249. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js.map +0 -1
  250. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +0 -6
  251. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +0 -15
  252. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js.map +0 -1
  253. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts +0 -6
  254. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.js +0 -8
  255. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.js.map +0 -1
  256. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +0 -2
  257. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +0 -17
  258. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js.map +0 -1
  259. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +0 -2
  260. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +0 -91
  261. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js.map +0 -1
  262. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +0 -3
  263. package/dist/better-auth/plugin/lib/build-collections/users/index.js +0 -341
  264. package/dist/better-auth/plugin/lib/build-collections/users/index.js.map +0 -1
  265. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts +0 -15
  266. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js +0 -24
  267. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js.map +0 -1
  268. package/dist/better-auth/plugin/lib/build-collections/utils/filter-duplicate-fields.d.ts +0 -10
  269. package/dist/better-auth/plugin/lib/build-collections/utils/filter-duplicate-fields.js +0 -67
  270. package/dist/better-auth/plugin/lib/build-collections/utils/filter-duplicate-fields.js.map +0 -1
  271. package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts +0 -9
  272. package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js +0 -94
  273. package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js.map +0 -1
  274. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +0 -7
  275. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +0 -35
  276. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js.map +0 -1
  277. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts +0 -12
  278. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js +0 -25
  279. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js.map +0 -1
  280. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts +0 -14
  281. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +0 -67
  282. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js.map +0 -1
  283. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +0 -20
  284. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +0 -98
  285. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js.map +0 -1
  286. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +0 -3
  287. package/dist/better-auth/plugin/lib/build-collections/verifications.js +0 -87
  288. package/dist/better-auth/plugin/lib/build-collections/verifications.js.map +0 -1
  289. package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +0 -5
  290. package/dist/better-auth/plugin/lib/get-payload-auth.js +0 -9
  291. package/dist/better-auth/plugin/lib/get-payload-auth.js.map +0 -1
  292. package/dist/better-auth/plugin/lib/init-better-auth.d.ts +0 -7
  293. package/dist/better-auth/plugin/lib/init-better-auth.js +0 -46
  294. package/dist/better-auth/plugin/lib/init-better-auth.js.map +0 -1
  295. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +0 -2
  296. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +0 -9
  297. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js.map +0 -1
  298. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +0 -2
  299. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +0 -10
  300. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js.map +0 -1
  301. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts +0 -2
  302. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.js +0 -8
  303. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.js.map +0 -1
  304. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +0 -10
  305. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +0 -156
  306. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js.map +0 -1
  307. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +0 -2
  308. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +0 -18
  309. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js.map +0 -1
  310. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +0 -2
  311. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +0 -34
  312. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js.map +0 -1
  313. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +0 -2
  314. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +0 -11
  315. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js.map +0 -1
  316. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +0 -2
  317. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +0 -10
  318. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js.map +0 -1
  319. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts +0 -2
  320. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.js +0 -11
  321. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.js.map +0 -1
  322. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts +0 -7
  323. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js +0 -23
  324. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js.map +0 -1
  325. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts +0 -25
  326. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js +0 -62
  327. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js.map +0 -1
  328. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +0 -9
  329. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +0 -47
  330. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js.map +0 -1
  331. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts +0 -15
  332. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +0 -42
  333. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js.map +0 -1
  334. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts +0 -9
  335. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js +0 -63
  336. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js.map +0 -1
  337. package/dist/better-auth/plugin/lib/set-login-methods.d.ts +0 -4
  338. package/dist/better-auth/plugin/lib/set-login-methods.js +0 -14
  339. package/dist/better-auth/plugin/lib/set-login-methods.js.map +0 -1
  340. package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +0 -9
  341. package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +0 -143
  342. package/dist/better-auth/plugin/payload/components/admin-buttons/index.js.map +0 -1
  343. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +0 -10
  344. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +0 -219
  345. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js.map +0 -1
  346. package/dist/better-auth/plugin/payload/components/logout-button.d.ts +0 -4
  347. package/dist/better-auth/plugin/payload/components/logout-button.js +0 -24
  348. package/dist/better-auth/plugin/payload/components/logout-button.js.map +0 -1
  349. package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts +0 -8
  350. package/dist/better-auth/plugin/payload/components/passkeys/add-button.js +0 -117
  351. package/dist/better-auth/plugin/payload/components/passkeys/add-button.js.map +0 -1
  352. package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts +0 -3
  353. package/dist/better-auth/plugin/payload/components/passkeys/client.js +0 -66
  354. package/dist/better-auth/plugin/payload/components/passkeys/client.js.map +0 -1
  355. package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts +0 -4
  356. package/dist/better-auth/plugin/payload/components/passkeys/index.js +0 -52
  357. package/dist/better-auth/plugin/payload/components/passkeys/index.js.map +0 -1
  358. package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts +0 -8
  359. package/dist/better-auth/plugin/payload/components/passkeys/list.js +0 -57
  360. package/dist/better-auth/plugin/payload/components/passkeys/list.js.map +0 -1
  361. package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts +0 -22
  362. package/dist/better-auth/plugin/payload/components/passkeys/types.js +0 -3
  363. package/dist/better-auth/plugin/payload/components/passkeys/types.js.map +0 -1
  364. package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +0 -6
  365. package/dist/better-auth/plugin/payload/components/rsc-redirect.js +0 -7
  366. package/dist/better-auth/plugin/payload/components/rsc-redirect.js.map +0 -1
  367. package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.d.ts +0 -15
  368. package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.js +0 -157
  369. package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.js.map +0 -1
  370. package/dist/better-auth/plugin/payload/components/token-field.d.ts +0 -4
  371. package/dist/better-auth/plugin/payload/components/token-field.js +0 -31
  372. package/dist/better-auth/plugin/payload/components/token-field.js.map +0 -1
  373. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts +0 -8
  374. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js +0 -300
  375. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js.map +0 -1
  376. package/dist/better-auth/plugin/payload/exports/client.d.ts +0 -6
  377. package/dist/better-auth/plugin/payload/exports/client.js +0 -8
  378. package/dist/better-auth/plugin/payload/exports/client.js.map +0 -1
  379. package/dist/better-auth/plugin/payload/exports/rsc.d.ts +0 -8
  380. package/dist/better-auth/plugin/payload/exports/rsc.js +0 -10
  381. package/dist/better-auth/plugin/payload/exports/rsc.js.map +0 -1
  382. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +0 -2
  383. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +0 -9
  384. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js.map +0 -1
  385. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts +0 -1
  386. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +0 -22
  387. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js.map +0 -1
  388. package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts +0 -19
  389. package/dist/better-auth/plugin/payload/views/admin-login/client.js +0 -226
  390. package/dist/better-auth/plugin/payload/views/admin-login/client.js.map +0 -1
  391. package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +0 -10
  392. package/dist/better-auth/plugin/payload/views/admin-login/index.js +0 -150
  393. package/dist/better-auth/plugin/payload/views/admin-login/index.js.map +0 -1
  394. package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +0 -16
  395. package/dist/better-auth/plugin/payload/views/admin-signup/client.js +0 -299
  396. package/dist/better-auth/plugin/payload/views/admin-signup/client.js.map +0 -1
  397. package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +0 -9
  398. package/dist/better-auth/plugin/payload/views/admin-signup/index.js +0 -104
  399. package/dist/better-auth/plugin/payload/views/admin-signup/index.js.map +0 -1
  400. package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +0 -7
  401. package/dist/better-auth/plugin/payload/views/forgot-password/client.js +0 -119
  402. package/dist/better-auth/plugin/payload/views/forgot-password/client.js.map +0 -1
  403. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +0 -8
  404. package/dist/better-auth/plugin/payload/views/forgot-password/index.js +0 -78
  405. package/dist/better-auth/plugin/payload/views/forgot-password/index.js.map +0 -1
  406. package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +0 -10
  407. package/dist/better-auth/plugin/payload/views/reset-password/client.js +0 -144
  408. package/dist/better-auth/plugin/payload/views/reset-password/client.js.map +0 -1
  409. package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +0 -8
  410. package/dist/better-auth/plugin/payload/views/reset-password/index.js +0 -96
  411. package/dist/better-auth/plugin/payload/views/reset-password/index.js.map +0 -1
  412. package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts +0 -6
  413. package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js +0 -96
  414. package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js.map +0 -1
  415. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts +0 -9
  416. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +0 -56
  417. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js.map +0 -1
  418. package/dist/better-auth/plugin/types.d.ts +0 -429
  419. package/dist/better-auth/plugin/types.js +0 -3
  420. package/dist/better-auth/plugin/types.js.map +0 -1
  421. package/dist/better-auth/plugin/utils/set.d.ts +0 -39
  422. package/dist/better-auth/plugin/utils/set.js +0 -103
  423. package/dist/better-auth/plugin/utils/set.js.map +0 -1
  424. package/dist/better-auth/scripts/generate-types.d.ts +0 -1
  425. package/dist/better-auth/scripts/generate-types.js +0 -234
  426. package/dist/better-auth/scripts/generate-types.js.map +0 -1
  427. package/dist/better-auth/types.d.ts +0 -2
  428. package/dist/better-auth/types.js +0 -4
  429. package/dist/better-auth/types.js.map +0 -1
  430. package/dist/index.js.map +0 -1
  431. package/dist/shared/components/icons.d.ts +0 -7
  432. package/dist/shared/components/icons.js +0 -442
  433. package/dist/shared/components/icons.js.map +0 -1
  434. package/dist/shared/components/logo.d.ts +0 -3
  435. package/dist/shared/components/logo.js +0 -24
  436. package/dist/shared/components/logo.js.map +0 -1
  437. package/dist/shared/form/components/submit.d.ts +0 -7
  438. package/dist/shared/form/components/submit.js +0 -16
  439. package/dist/shared/form/components/submit.js.map +0 -1
  440. package/dist/shared/form/fields/text-field.d.ts +0 -8
  441. package/dist/shared/form/fields/text-field.js +0 -37
  442. package/dist/shared/form/fields/text-field.js.map +0 -1
  443. package/dist/shared/form/index.d.ts +0 -4
  444. package/dist/shared/form/index.js +0 -8
  445. package/dist/shared/form/index.js.map +0 -1
  446. package/dist/shared/form/ui/header/index.d.ts +0 -8
  447. package/dist/shared/form/ui/header/index.js +0 -24
  448. package/dist/shared/form/ui/header/index.js.map +0 -1
  449. package/dist/shared/form/ui/index.d.ts +0 -31
  450. package/dist/shared/form/ui/index.js +0 -57
  451. package/dist/shared/form/ui/index.js.map +0 -1
  452. package/dist/shared/form/validation.d.ts +0 -51
  453. package/dist/shared/form/validation.js +0 -127
  454. package/dist/shared/form/validation.js.map +0 -1
  455. package/dist/shared/index.d.ts +0 -2
  456. package/dist/shared/index.js +0 -4
  457. package/dist/shared/index.js.map +0 -1
  458. package/dist/shared/payload/fields/field-copy-button/index.d.ts +0 -3
  459. package/dist/shared/payload/fields/field-copy-button/index.js +0 -38
  460. package/dist/shared/payload/fields/field-copy-button/index.js.map +0 -1
  461. package/dist/shared/payload/fields/generate-uuid-button/index.d.ts +0 -3
  462. package/dist/shared/payload/fields/generate-uuid-button/index.js +0 -26
  463. package/dist/shared/payload/fields/generate-uuid-button/index.js.map +0 -1
  464. package/dist/shared/payload/fields/index.d.ts +0 -2
  465. package/dist/shared/payload/fields/index.js +0 -4
  466. package/dist/shared/payload/fields/index.js.map +0 -1
  467. package/dist/shared/utils/regex.d.ts +0 -2
  468. package/dist/shared/utils/regex.js +0 -4
  469. package/dist/shared/utils/regex.js.map +0 -1
  470. package/dist/shared/utils/try-catch.d.ts +0 -11
  471. package/dist/shared/utils/try-catch.js +0 -17
  472. package/dist/shared/utils/try-catch.js.map +0 -1
  473. package/dist/shared/utils/value-or-default.d.ts +0 -9
  474. package/dist/shared/utils/value-or-default.js +0 -12
  475. package/dist/shared/utils/value-or-default.js.map +0 -1
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useFormContext } from "react-hook-form";
3
- import { FieldErrors, FieldInputWrap, FormField, FormLabel } from "../ui";
4
- export function TextField({ name, className, label, required = false, type = 'text', autoComplete = 'off' }) {
5
- const { register, formState: { errors } } = useFormContext();
6
- const fieldError = errors[name];
7
- const hasError = !!fieldError;
8
- return /*#__PURE__*/ _jsxs(FormField, {
9
- id: name,
10
- className: className,
11
- hasError: hasError,
12
- children: [
13
- /*#__PURE__*/ _jsx(FormLabel, {
14
- label: label,
15
- htmlFor: name,
16
- required: required
17
- }),
18
- /*#__PURE__*/ _jsxs(FieldInputWrap, {
19
- children: [
20
- /*#__PURE__*/ _jsx("input", {
21
- ...register(name),
22
- autoComplete: autoComplete,
23
- type: type,
24
- id: name,
25
- required: required,
26
- className: "text-field"
27
- }),
28
- fieldError && /*#__PURE__*/ _jsx(FieldErrors, {
29
- error: fieldError
30
- })
31
- ]
32
- })
33
- ]
34
- });
35
- }
36
-
37
- //# sourceMappingURL=text-field.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/form/fields/text-field.tsx"],"sourcesContent":["import { type FieldError, useFormContext } from 'react-hook-form';\nimport { FieldErrors, FieldInputWrap, FormField, FormLabel } from '../ui';\n\nexport function TextField({\n name,\n className,\n label,\n required = false,\n type = 'text',\n autoComplete = 'off',\n}: {\n name: string;\n className: string;\n label: string;\n required?: boolean;\n type?: string;\n autoComplete?: string;\n}) {\n const {\n register,\n formState: { errors },\n } = useFormContext();\n\n const fieldError = errors[name] as FieldError | undefined;\n const hasError = !!fieldError;\n\n return (\n <FormField id={name} className={className} hasError={hasError}>\n <FormLabel label={label} htmlFor={name} required={required} />\n <FieldInputWrap>\n <input\n {...register(name)}\n autoComplete={autoComplete}\n type={type}\n id={name}\n required={required}\n className='text-field'\n />\n {fieldError && <FieldErrors error={fieldError} />}\n </FieldInputWrap>\n </FormField>\n );\n}\n"],"names":["useFormContext","FieldErrors","FieldInputWrap","FormField","FormLabel","TextField","name","className","label","required","type","autoComplete","register","formState","errors","fieldError","hasError","id","htmlFor","input","error"],"mappings":";AAAA,SAA0BA,cAAc,QAAQ,kBAAkB;AAClE,SAASC,WAAW,EAAEC,cAAc,EAAEC,SAAS,EAAEC,SAAS,QAAQ,QAAQ;AAE1E,OAAO,SAASC,UAAU,EACxBC,IAAI,EACJC,SAAS,EACTC,KAAK,EACLC,WAAW,KAAK,EAChBC,OAAO,MAAM,EACbC,eAAe,KAAK,EAQrB;IACC,MAAM,EACJC,QAAQ,EACRC,WAAW,EAAEC,MAAM,EAAE,EACtB,GAAGd;IAEJ,MAAMe,aAAaD,MAAM,CAACR,KAAK;IAC/B,MAAMU,WAAW,CAAC,CAACD;IAEnB,qBACE,MAACZ;QAAUc,IAAIX;QAAMC,WAAWA;QAAWS,UAAUA;;0BACnD,KAACZ;gBAAUI,OAAOA;gBAAOU,SAASZ;gBAAMG,UAAUA;;0BAClD,MAACP;;kCACC,KAACiB;wBACE,GAAGP,SAASN,KAAK;wBAClBK,cAAcA;wBACdD,MAAMA;wBACNO,IAAIX;wBACJG,UAAUA;wBACVF,WAAU;;oBAEXQ,4BAAc,KAACd;wBAAYmB,OAAOL;;;;;;AAI3C"}
@@ -1,4 +0,0 @@
1
- export { zodResolver } from '@hookform/resolvers/zod';
2
- export { FormProvider, useForm, useFormContext } from 'react-hook-form';
3
- export { Submit } from './components/submit';
4
- export { TextField } from './fields/text-field';
@@ -1,8 +0,0 @@
1
- // Re-export react-hook-form utilities for use in forms
2
- export { zodResolver } from "@hookform/resolvers/zod";
3
- export { FormProvider, useForm, useFormContext } from "react-hook-form";
4
- // Re-export form components
5
- export { Submit } from "./components/submit";
6
- export { TextField } from "./fields/text-field";
7
-
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/shared/form/index.ts"],"sourcesContent":["// Re-export react-hook-form utilities for use in forms\nexport { zodResolver } from '@hookform/resolvers/zod';\nexport { FormProvider, useForm, useFormContext } from 'react-hook-form';\n\n// Re-export form components\nexport { Submit } from './components/submit';\nexport { TextField } from './fields/text-field';\n"],"names":["zodResolver","FormProvider","useForm","useFormContext","Submit","TextField"],"mappings":"AAAA,uDAAuD;AACvD,SAASA,WAAW,QAAQ,0BAA0B;AACtD,SAASC,YAAY,EAAEC,OAAO,EAAEC,cAAc,QAAQ,kBAAkB;AAExE,4BAA4B;AAC5B,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,SAAS,QAAQ,sBAAsB"}
@@ -1,8 +0,0 @@
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 };
@@ -1,24 +0,0 @@
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=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/shared/form/ui/header/index.tsx"],"sourcesContent":["import React, { type ComponentPropsWithoutRef } from 'react';\n\nimport './index.scss';\n\nconst baseClass = 'form-header';\n\ntype Props = ComponentPropsWithoutRef<'div'> & {\n description?: React.ReactNode | string;\n heading: string;\n};\n\nconst FormHeader: React.FC<Props> = ({ description, heading, ...props }) => {\n if (!heading) {\n return null;\n }\n\n return (\n <div className={baseClass} {...props}>\n <h1>{heading}</h1>\n {Boolean(description) && <p>{description}</p>}\n </div>\n );\n};\n\nexport { FormHeader };\n"],"names":["React","baseClass","FormHeader","description","heading","props","div","className","h1","Boolean","p"],"mappings":";AAAA,OAAOA,WAA8C,QAAQ;AAE7D,OAAO,eAAe;AAEtB,MAAMC,YAAY;AAOlB,MAAMC,aAA8B,CAAC,EAAEC,WAAW,EAAEC,OAAO,EAAE,GAAGC,OAAO;IACrE,IAAI,CAACD,SAAS;QACZ,OAAO;IACT;IAEA,qBACE,MAACE;QAAIC,WAAWN;QAAY,GAAGI,KAAK;;0BAClC,KAACG;0BAAIJ;;YACJK,QAAQN,8BAAgB,KAACO;0BAAGP;;;;AAGnC;AAEA,SAASD,UAAU,GAAG"}
@@ -1,31 +0,0 @@
1
- import React, { type ComponentPropsWithoutRef, type ReactNode } from 'react';
2
- import type { FieldError } from 'react-hook-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
- htmlFor?: string;
12
- };
13
- declare const FormLabel: React.FC<FormLabelProps>;
14
- type FieldErrorsProps = {
15
- error?: FieldError;
16
- className?: string;
17
- };
18
- export declare const FieldErrors: ({ error, className }: FieldErrorsProps) => any;
19
- type FormErrorProps = {
20
- errors?: string[];
21
- className?: string;
22
- };
23
- declare const FormError: React.FC<FormErrorProps>;
24
- type FormProps = ComponentPropsWithoutRef<'form'>;
25
- declare const Form: React.FC<FormProps>;
26
- type FormInputWrapProps = ComponentPropsWithoutRef<'div'>;
27
- declare const FormInputWrap: React.FC<FormInputWrapProps>;
28
- type FieldInputWrapProps = ComponentPropsWithoutRef<'div'>;
29
- declare const FieldInputWrap: React.FC<FieldInputWrapProps>;
30
- export { FieldInputWrap, Form, FormError, FormField, FormInputWrap, FormLabel };
31
- export type { FormErrorProps, FormFieldProps, FormInputWrapProps, FormLabelProps, FormProps };
@@ -1,57 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Tooltip } from "@payloadcms/ui/elements/Tooltip";
3
- import clsx from "clsx";
4
- import React from "react";
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, htmlFor, ...rest })=>/*#__PURE__*/ _jsxs("label", {
14
- className: clsx('field-label', className),
15
- htmlFor: htmlFor,
16
- ...rest,
17
- children: [
18
- label,
19
- required && /*#__PURE__*/ _jsx("span", {
20
- className: "required",
21
- children: "*"
22
- })
23
- ]
24
- });
25
- export const FieldErrors = ({ error, className })=>{
26
- const errorMessage = error?.message ?? null;
27
- return /*#__PURE__*/ _jsx(Tooltip, {
28
- alignCaret: "right",
29
- className: clsx('field-error', className),
30
- show: !!errorMessage,
31
- delay: 0,
32
- staticPositioning: true,
33
- children: errorMessage
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 { FieldInputWrap, Form, FormError, FormField, FormInputWrap, FormLabel };
56
-
57
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/form/ui/index.tsx"],"sourcesContent":["import { Tooltip } from '@payloadcms/ui/elements/Tooltip';\nimport clsx from 'clsx';\nimport React, { type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport type { FieldError } from 'react-hook-form';\n\nimport './index.scss';\n\ntype FormFieldProps = ComponentPropsWithoutRef<'div'> & {\n hasError?: boolean;\n};\n\nconst FormField: React.FC<FormFieldProps> = ({ children, hasError, className, ...rest }) => (\n <div className={clsx('field-type', className, { error: hasError })} {...rest}>\n {children}\n </div>\n);\n\ntype FormLabelProps = ComponentPropsWithoutRef<'label'> & {\n label: ReactNode;\n required?: boolean;\n htmlFor?: string;\n};\n\nconst FormLabel: React.FC<FormLabelProps> = ({ label, required = false, className, htmlFor, ...rest }) => (\n <label className={clsx('field-label', className)} htmlFor={htmlFor} {...rest}>\n {label}\n {required && <span className='required'>*</span>}\n </label>\n);\n\ntype FieldErrorsProps = {\n error?: FieldError;\n className?: string;\n};\n\nexport const FieldErrors = ({ error, className }: FieldErrorsProps) => {\n const errorMessage = error?.message ?? null;\n\n return (\n <Tooltip\n alignCaret='right'\n className={clsx('field-error', className)}\n show={!!errorMessage}\n delay={0}\n staticPositioning\n >\n {errorMessage}\n </Tooltip>\n );\n};\n\ntype FormErrorProps = {\n errors?: string[];\n className?: string;\n};\n\nconst FormError: React.FC<FormErrorProps> = ({ errors, className }) =>\n errors ? <div className={clsx('form-error', className)}>{errors.join(', ')}</div> : null;\n\ntype FormProps = ComponentPropsWithoutRef<'form'>;\n\nconst Form: React.FC<FormProps> = ({ children, className, ...rest }) => (\n <form className={clsx('form', className)} {...rest}>\n {children}\n </form>\n);\n\ntype FormInputWrapProps = ComponentPropsWithoutRef<'div'>;\n\nconst FormInputWrap: React.FC<FormInputWrapProps> = ({ children, className, ...rest }) => (\n <div className={`${className}__inputWrap`} {...rest}>\n {children}\n </div>\n);\n\ntype FieldInputWrapProps = ComponentPropsWithoutRef<'div'>;\n\nconst FieldInputWrap: React.FC<FieldInputWrapProps> = ({ children, className, ...rest }) => (\n <div className={clsx('field-type__wrap', className)} {...rest}>\n {children}\n </div>\n);\n\nexport { FieldInputWrap, Form, FormError, FormField, FormInputWrap, FormLabel };\nexport type { FormErrorProps, FormFieldProps, FormInputWrapProps, FormLabelProps, FormProps };\n"],"names":["Tooltip","clsx","React","FormField","children","hasError","className","rest","div","error","FormLabel","label","required","htmlFor","span","FieldErrors","errorMessage","message","alignCaret","show","delay","staticPositioning","FormError","errors","join","Form","form","FormInputWrap","FieldInputWrap"],"mappings":";AAAA,SAASA,OAAO,QAAQ,kCAAkC;AAC1D,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAA8D,QAAQ;AAG7E,OAAO,eAAe;AAMtB,MAAMC,YAAsC,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,MAAM,iBACrF,KAACC;QAAIF,WAAWL,KAAK,cAAcK,WAAW;YAAEG,OAAOJ;QAAS;QAAK,GAAGE,IAAI;kBACzEH;;AAUL,MAAMM,YAAsC,CAAC,EAAEC,KAAK,EAAEC,WAAW,KAAK,EAAEN,SAAS,EAAEO,OAAO,EAAE,GAAGN,MAAM,iBACnG,MAACI;QAAML,WAAWL,KAAK,eAAeK;QAAYO,SAASA;QAAU,GAAGN,IAAI;;YACzEI;YACAC,0BAAY,KAACE;gBAAKR,WAAU;0BAAW;;;;AAS5C,OAAO,MAAMS,cAAc,CAAC,EAAEN,KAAK,EAAEH,SAAS,EAAoB;IAChE,MAAMU,eAAeP,OAAOQ,WAAW;IAEvC,qBACE,KAACjB;QACCkB,YAAW;QACXZ,WAAWL,KAAK,eAAeK;QAC/Ba,MAAM,CAAC,CAACH;QACRI,OAAO;QACPC,iBAAiB;kBAEhBL;;AAGP,EAAE;AAOF,MAAMM,YAAsC,CAAC,EAAEC,MAAM,EAAEjB,SAAS,EAAE,GAChEiB,uBAAS,KAACf;QAAIF,WAAWL,KAAK,cAAcK;kBAAaiB,OAAOC,IAAI,CAAC;SAAe;AAItF,MAAMC,OAA4B,CAAC,EAAErB,QAAQ,EAAEE,SAAS,EAAE,GAAGC,MAAM,iBACjE,KAACmB;QAAKpB,WAAWL,KAAK,QAAQK;QAAa,GAAGC,IAAI;kBAC/CH;;AAML,MAAMuB,gBAA8C,CAAC,EAAEvB,QAAQ,EAAEE,SAAS,EAAE,GAAGC,MAAM,iBACnF,KAACC;QAAIF,WAAW,GAAGA,UAAU,WAAW,CAAC;QAAG,GAAGC,IAAI;kBAChDH;;AAML,MAAMwB,iBAAgD,CAAC,EAAExB,QAAQ,EAAEE,SAAS,EAAE,GAAGC,MAAM,iBACrF,KAACC;QAAIF,WAAWL,KAAK,oBAAoBK;QAAa,GAAGC,IAAI;kBAC1DH;;AAIL,SAASwB,cAAc,EAAEH,IAAI,EAAEH,SAAS,EAAEnB,SAAS,EAAEwB,aAAa,EAAEjB,SAAS,GAAG"}
@@ -1,51 +0,0 @@
1
- /**
2
- * Minimal translation function type extracted from `i18next`.
3
- * Accepts a key and returns the translated string.
4
- */
5
- export type Translate = (...args: any[]) => string;
6
- export declare const emailField: ({ t, required }: {
7
- t: Translate;
8
- required?: boolean;
9
- }) => any;
10
- export declare const usernameField: ({ t, required }: {
11
- t: Translate;
12
- required?: boolean;
13
- }) => any;
14
- export declare const passwordField: ({ t, required, minLength, }: {
15
- t: Translate;
16
- required?: boolean;
17
- minLength?: number;
18
- }) => any;
19
- export declare const confirmPasswordField: ({ t, required, }: {
20
- t: Translate;
21
- required?: boolean;
22
- }) => any;
23
- /**
24
- * Returns a Zod object schema with `password` and `confirmPassword` fields
25
- * and a refinement that ensures they match.
26
- */
27
- export declare const passwordWithConfirmation: ({ t, minLength, }: {
28
- t: Translate;
29
- minLength?: number;
30
- }) => any;
31
- export declare const isValidEmail: (val: string) => boolean;
32
- export declare const isValidUsername: (val: string, { minLength, maxLength }?: {
33
- minLength?: number;
34
- maxLength?: number;
35
- }) => boolean;
36
- type UsernameSettings = {
37
- minLength: number;
38
- maxLength: number;
39
- };
40
- export declare const createLoginSchema: ({ t, loginType, canLoginWithUsername, usernameSettings, }: {
41
- t: Translate;
42
- loginType: "email" | "username" | "emailOrUsername";
43
- canLoginWithUsername?: boolean;
44
- usernameSettings?: UsernameSettings;
45
- }) => any;
46
- export declare const createSignupSchema: ({ t, requireUsername, requireConfirmPassword, }: {
47
- t: Translate;
48
- requireUsername?: boolean;
49
- requireConfirmPassword?: boolean;
50
- }) => any;
51
- export {};
@@ -1,127 +0,0 @@
1
- import { z } from "zod";
2
- // Email regex pattern
3
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
4
- // Username regex pattern: alphanumeric, underscore, hyphen, 3-20 characters
5
- const usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/;
6
- // ---------------------------------------------------------------------------
7
- // Field builders
8
- // ---------------------------------------------------------------------------
9
- export const emailField = ({ t, required = true })=>{
10
- let schema = z.string();
11
- if (required) schema = schema.min(1, t('validation:required'));
12
- return schema.refine((val)=>emailRegex.test(val), {
13
- message: t('authentication:emailNotValid') ?? 'Email is not valid'
14
- });
15
- };
16
- export const usernameField = ({ t, required = true })=>{
17
- let schema = z.string();
18
- if (required) schema = schema.min(1, t('validation:required'));
19
- return schema.refine((val)=>usernameRegex.test(val), {
20
- message: t('authentication:usernameNotValid') ?? 'Username is not valid'
21
- });
22
- };
23
- export const passwordField = ({ t, required = true, minLength = 1 })=>{
24
- let schema = z.string();
25
- if (required) schema = schema.min(minLength, t('validation:required') ?? 'Password is required');
26
- return schema;
27
- };
28
- export const confirmPasswordField = ({ t, required = true })=>{
29
- let schema = z.string();
30
- if (required) schema = schema.min(1, t('validation:required') ?? 'Confirm password is required');
31
- return schema;
32
- };
33
- // ---------------------------------------------------------------------------
34
- // Composables
35
- // ---------------------------------------------------------------------------
36
- /**
37
- * Returns a Zod object schema with `password` and `confirmPassword` fields
38
- * and a refinement that ensures they match.
39
- */ export const passwordWithConfirmation = ({ t, minLength = 1 })=>z.object({
40
- password: passwordField({
41
- t,
42
- minLength
43
- }),
44
- confirmPassword: confirmPasswordField({
45
- t
46
- })
47
- }).refine((data)=>data.password === data.confirmPassword, {
48
- path: [
49
- 'confirmPassword'
50
- ],
51
- message: t('fields:passwordsDoNotMatch') ?? 'Passwords do not match'
52
- });
53
- // ---------------------------------------------------------------------------
54
- // Utility validators (non‑Zod) — handy for dynamic login field checks
55
- // ---------------------------------------------------------------------------
56
- export const isValidEmail = (val)=>emailRegex.test(val);
57
- export const isValidUsername = (val, { minLength = 5, maxLength = 128 } = {})=>usernameRegex.test(val) && val.length >= minLength && val.length <= maxLength;
58
- export const createLoginSchema = ({ t, loginType, canLoginWithUsername = false, usernameSettings = {
59
- minLength: 5,
60
- maxLength: 128
61
- } })=>z.object({
62
- login: z.string().superRefine((val, ctx)=>{
63
- if (!val) {
64
- ctx.addIssue({
65
- code: z.ZodIssueCode.custom,
66
- message: t('validation:required')
67
- });
68
- return;
69
- }
70
- const isProbablyEmail = val.includes('@') || !canLoginWithUsername;
71
- if (loginType === 'email') {
72
- if (!isValidEmail(val)) {
73
- ctx.addIssue({
74
- code: z.ZodIssueCode.custom,
75
- message: t('authentication:emailNotValid') || 'Email is not valid'
76
- });
77
- }
78
- } else if (loginType === 'username') {
79
- if (!isValidUsername(val, usernameSettings)) {
80
- ctx.addIssue({
81
- code: z.ZodIssueCode.custom,
82
- message: t('authentication:usernameNotValid') || 'Username is not valid'
83
- });
84
- }
85
- } else {
86
- if (!isValidEmail(val) && !isValidUsername(val, usernameSettings)) {
87
- ctx.addIssue({
88
- code: z.ZodIssueCode.custom,
89
- message: isProbablyEmail ? t('authentication:emailNotValid') || 'Email is not valid' : t('authentication:usernameNotValid') || 'Username is not valid'
90
- });
91
- }
92
- }
93
- }),
94
- password: passwordField({
95
- t
96
- })
97
- });
98
- export const createSignupSchema = ({ t, requireUsername = false, requireConfirmPassword = false })=>{
99
- const schema = z.object({
100
- name: z.string({
101
- message: 'Name is required'
102
- }).min(1),
103
- email: emailField({
104
- t
105
- }),
106
- username: usernameField({
107
- t,
108
- required: requireUsername
109
- }).optional(),
110
- password: passwordField({
111
- t
112
- }),
113
- confirmPassword: confirmPasswordField({
114
- t,
115
- required: requireConfirmPassword
116
- }).optional()
117
- });
118
- if (!requireConfirmPassword) return schema;
119
- return schema.refine((data)=>data.password === data.confirmPassword, {
120
- path: [
121
- 'confirmPassword'
122
- ],
123
- message: t('fields:passwordsDoNotMatch') || 'Passwords do not match'
124
- });
125
- };
126
-
127
- //# sourceMappingURL=validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/shared/form/validation.ts"],"sourcesContent":["import { z } from 'zod';\n\n// Email regex pattern\nconst emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n// Username regex pattern: alphanumeric, underscore, hyphen, 3-20 characters\nconst usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal translation function type extracted from `i18next`.\n * Accepts a key and returns the translated string.\n */\nexport type Translate = (...args: any[]) => string;\n\n// ---------------------------------------------------------------------------\n// Field builders\n// ---------------------------------------------------------------------------\n\nexport const emailField = ({ t, required = true }: { t: Translate; required?: boolean }) => {\n let schema = z.string();\n if (required) schema = schema.min(1, t('validation:required'));\n return schema.refine(val => emailRegex.test(val), {\n message: t('authentication:emailNotValid') ?? 'Email is not valid',\n });\n};\n\nexport const usernameField = ({ t, required = true }: { t: Translate; required?: boolean }) => {\n let schema = z.string();\n if (required) schema = schema.min(1, t('validation:required'));\n return schema.refine(val => usernameRegex.test(val), {\n message: t('authentication:usernameNotValid') ?? 'Username is not valid',\n });\n};\n\nexport const passwordField = ({\n t,\n required = true,\n minLength = 1,\n}: {\n t: Translate;\n required?: boolean;\n minLength?: number;\n}) => {\n let schema = z.string();\n if (required) schema = schema.min(minLength, t('validation:required') ?? 'Password is required');\n return schema;\n};\n\nexport const confirmPasswordField = ({\n t,\n required = true,\n}: {\n t: Translate;\n required?: boolean;\n}) => {\n let schema = z.string();\n if (required) schema = schema.min(1, t('validation:required') ?? 'Confirm password is required');\n return schema;\n};\n\n// ---------------------------------------------------------------------------\n// Composables\n// ---------------------------------------------------------------------------\n\n/**\n * Returns a Zod object schema with `password` and `confirmPassword` fields\n * and a refinement that ensures they match.\n */\nexport const passwordWithConfirmation = ({\n t,\n minLength = 1,\n}: {\n t: Translate;\n minLength?: number;\n}) =>\n z\n .object({\n password: passwordField({ t, minLength }),\n confirmPassword: confirmPasswordField({ t }),\n })\n .refine(data => data.password === data.confirmPassword, {\n path: ['confirmPassword'],\n message: t('fields:passwordsDoNotMatch') ?? 'Passwords do not match',\n });\n\n// ---------------------------------------------------------------------------\n// Utility validators (non‑Zod) — handy for dynamic login field checks\n// ---------------------------------------------------------------------------\n\nexport const isValidEmail = (val: string) => emailRegex.test(val);\nexport const isValidUsername = (\n val: string,\n { minLength = 5, maxLength = 128 }: { minLength?: number; maxLength?: number } = {}\n) => usernameRegex.test(val) && val.length >= minLength && val.length <= maxLength;\n\n// ---------------------------------------------------------------------------\n// Schema builders\n// ---------------------------------------------------------------------------\n\ntype UsernameSettings = { minLength: number; maxLength: number };\n\nexport const createLoginSchema = ({\n t,\n loginType,\n canLoginWithUsername = false,\n usernameSettings = { minLength: 5, maxLength: 128 },\n}: {\n t: Translate;\n loginType: 'email' | 'username' | 'emailOrUsername';\n canLoginWithUsername?: boolean;\n usernameSettings?: UsernameSettings;\n}) =>\n z.object({\n login: z.string().superRefine((val, ctx) => {\n if (!val) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: t('validation:required'),\n });\n return;\n }\n\n const isProbablyEmail = val.includes('@') || !canLoginWithUsername;\n\n if (loginType === 'email') {\n if (!isValidEmail(val)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: t('authentication:emailNotValid') || 'Email is not valid',\n });\n }\n } else if (loginType === 'username') {\n if (!isValidUsername(val, usernameSettings)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: t('authentication:usernameNotValid') || 'Username is not valid',\n });\n }\n } else {\n if (!isValidEmail(val) && !isValidUsername(val, usernameSettings)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: isProbablyEmail\n ? t('authentication:emailNotValid') || 'Email is not valid'\n : t('authentication:usernameNotValid') || 'Username is not valid',\n });\n }\n }\n }),\n password: passwordField({ t }),\n });\n\nexport const createSignupSchema = ({\n t,\n requireUsername = false,\n requireConfirmPassword = false,\n}: {\n t: Translate;\n requireUsername?: boolean;\n requireConfirmPassword?: boolean;\n}) => {\n const schema = z.object({\n name: z.string({ message: 'Name is required' }).min(1),\n email: emailField({ t }),\n username: usernameField({ t, required: requireUsername }).optional(),\n password: passwordField({ t }),\n confirmPassword: confirmPasswordField({ t, required: requireConfirmPassword }).optional(),\n });\n\n if (!requireConfirmPassword) return schema;\n\n return schema.refine(data => data.password === data.confirmPassword, {\n path: ['confirmPassword'],\n message: t('fields:passwordsDoNotMatch') || 'Passwords do not match',\n });\n};\n"],"names":["z","emailRegex","usernameRegex","emailField","t","required","schema","string","min","refine","val","test","message","usernameField","passwordField","minLength","confirmPasswordField","passwordWithConfirmation","object","password","confirmPassword","data","path","isValidEmail","isValidUsername","maxLength","length","createLoginSchema","loginType","canLoginWithUsername","usernameSettings","login","superRefine","ctx","addIssue","code","ZodIssueCode","custom","isProbablyEmail","includes","createSignupSchema","requireUsername","requireConfirmPassword","name","email","username","optional"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,sBAAsB;AACtB,MAAMC,aAAa;AACnB,4EAA4E;AAC5E,MAAMC,gBAAgB;AAYtB,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,OAAO,MAAMC,aAAa,CAAC,EAAEC,CAAC,EAAEC,WAAW,IAAI,EAAwC;IACrF,IAAIC,SAASN,EAAEO,MAAM;IACrB,IAAIF,UAAUC,SAASA,OAAOE,GAAG,CAAC,GAAGJ,EAAE;IACvC,OAAOE,OAAOG,MAAM,CAACC,CAAAA,MAAOT,WAAWU,IAAI,CAACD,MAAM;QAChDE,SAASR,EAAE,mCAAmC;IAChD;AACF,EAAE;AAEF,OAAO,MAAMS,gBAAgB,CAAC,EAAET,CAAC,EAAEC,WAAW,IAAI,EAAwC;IACxF,IAAIC,SAASN,EAAEO,MAAM;IACrB,IAAIF,UAAUC,SAASA,OAAOE,GAAG,CAAC,GAAGJ,EAAE;IACvC,OAAOE,OAAOG,MAAM,CAACC,CAAAA,MAAOR,cAAcS,IAAI,CAACD,MAAM;QACnDE,SAASR,EAAE,sCAAsC;IACnD;AACF,EAAE;AAEF,OAAO,MAAMU,gBAAgB,CAAC,EAC5BV,CAAC,EACDC,WAAW,IAAI,EACfU,YAAY,CAAC,EAKd;IACC,IAAIT,SAASN,EAAEO,MAAM;IACrB,IAAIF,UAAUC,SAASA,OAAOE,GAAG,CAACO,WAAWX,EAAE,0BAA0B;IACzE,OAAOE;AACT,EAAE;AAEF,OAAO,MAAMU,uBAAuB,CAAC,EACnCZ,CAAC,EACDC,WAAW,IAAI,EAIhB;IACC,IAAIC,SAASN,EAAEO,MAAM;IACrB,IAAIF,UAAUC,SAASA,OAAOE,GAAG,CAAC,GAAGJ,EAAE,0BAA0B;IACjE,OAAOE;AACT,EAAE;AAEF,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E;;;CAGC,GACD,OAAO,MAAMW,2BAA2B,CAAC,EACvCb,CAAC,EACDW,YAAY,CAAC,EAId,GACCf,EACGkB,MAAM,CAAC;QACNC,UAAUL,cAAc;YAAEV;YAAGW;QAAU;QACvCK,iBAAiBJ,qBAAqB;YAAEZ;QAAE;IAC5C,GACCK,MAAM,CAACY,CAAAA,OAAQA,KAAKF,QAAQ,KAAKE,KAAKD,eAAe,EAAE;QACtDE,MAAM;YAAC;SAAkB;QACzBV,SAASR,EAAE,iCAAiC;IAC9C,GAAG;AAEP,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAE9E,OAAO,MAAMmB,eAAe,CAACb,MAAgBT,WAAWU,IAAI,CAACD,KAAK;AAClE,OAAO,MAAMc,kBAAkB,CAC7Bd,KACA,EAAEK,YAAY,CAAC,EAAEU,YAAY,GAAG,EAA8C,GAAG,CAAC,CAAC,GAChFvB,cAAcS,IAAI,CAACD,QAAQA,IAAIgB,MAAM,IAAIX,aAAaL,IAAIgB,MAAM,IAAID,UAAU;AAQnF,OAAO,MAAME,oBAAoB,CAAC,EAChCvB,CAAC,EACDwB,SAAS,EACTC,uBAAuB,KAAK,EAC5BC,mBAAmB;IAAEf,WAAW;IAAGU,WAAW;AAAI,CAAC,EAMpD,GACCzB,EAAEkB,MAAM,CAAC;QACPa,OAAO/B,EAAEO,MAAM,GAAGyB,WAAW,CAAC,CAACtB,KAAKuB;YAClC,IAAI,CAACvB,KAAK;gBACRuB,IAAIC,QAAQ,CAAC;oBACXC,MAAMnC,EAAEoC,YAAY,CAACC,MAAM;oBAC3BzB,SAASR,EAAE;gBACb;gBACA;YACF;YAEA,MAAMkC,kBAAkB5B,IAAI6B,QAAQ,CAAC,QAAQ,CAACV;YAE9C,IAAID,cAAc,SAAS;gBACzB,IAAI,CAACL,aAAab,MAAM;oBACtBuB,IAAIC,QAAQ,CAAC;wBACXC,MAAMnC,EAAEoC,YAAY,CAACC,MAAM;wBAC3BzB,SAASR,EAAE,mCAAmC;oBAChD;gBACF;YACF,OAAO,IAAIwB,cAAc,YAAY;gBACnC,IAAI,CAACJ,gBAAgBd,KAAKoB,mBAAmB;oBAC3CG,IAAIC,QAAQ,CAAC;wBACXC,MAAMnC,EAAEoC,YAAY,CAACC,MAAM;wBAC3BzB,SAASR,EAAE,sCAAsC;oBACnD;gBACF;YACF,OAAO;gBACL,IAAI,CAACmB,aAAab,QAAQ,CAACc,gBAAgBd,KAAKoB,mBAAmB;oBACjEG,IAAIC,QAAQ,CAAC;wBACXC,MAAMnC,EAAEoC,YAAY,CAACC,MAAM;wBAC3BzB,SAAS0B,kBACLlC,EAAE,mCAAmC,uBACrCA,EAAE,sCAAsC;oBAC9C;gBACF;YACF;QACF;QACAe,UAAUL,cAAc;YAAEV;QAAE;IAC9B,GAAG;AAEL,OAAO,MAAMoC,qBAAqB,CAAC,EACjCpC,CAAC,EACDqC,kBAAkB,KAAK,EACvBC,yBAAyB,KAAK,EAK/B;IACC,MAAMpC,SAASN,EAAEkB,MAAM,CAAC;QACtByB,MAAM3C,EAAEO,MAAM,CAAC;YAAEK,SAAS;QAAmB,GAAGJ,GAAG,CAAC;QACpDoC,OAAOzC,WAAW;YAAEC;QAAE;QACtByC,UAAUhC,cAAc;YAAET;YAAGC,UAAUoC;QAAgB,GAAGK,QAAQ;QAClE3B,UAAUL,cAAc;YAAEV;QAAE;QAC5BgB,iBAAiBJ,qBAAqB;YAAEZ;YAAGC,UAAUqC;QAAuB,GAAGI,QAAQ;IACzF;IAEA,IAAI,CAACJ,wBAAwB,OAAOpC;IAEpC,OAAOA,OAAOG,MAAM,CAACY,CAAAA,OAAQA,KAAKF,QAAQ,KAAKE,KAAKD,eAAe,EAAE;QACnEE,MAAM;YAAC;SAAkB;QACzBV,SAASR,EAAE,iCAAiC;IAC9C;AACF,EAAE"}
@@ -1,2 +0,0 @@
1
- export * from './payload/fields/field-copy-button';
2
- export * from './payload/fields/generate-uuid-button';
@@ -1,4 +0,0 @@
1
- export * from "./payload/fields/field-copy-button";
2
- export * from "./payload/fields/generate-uuid-button";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/shared/index.ts"],"sourcesContent":["export * from './payload/fields/field-copy-button';\nexport * from './payload/fields/generate-uuid-button';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC;AACnD,cAAc,wCAAwC"}
@@ -1,3 +0,0 @@
1
- import './index.css';
2
- import { TextField } from '@payloadcms/ui';
3
- export declare const FieldCopyButton: typeof TextField;
@@ -1,38 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import "./index.css";
4
- import { Button, CopyIcon, useField } from "@payloadcms/ui";
5
- import { useRef, useState } from "react";
6
- export const FieldCopyButton = ({ path })=>{
7
- const { value } = useField({
8
- path
9
- });
10
- const [copied, setCopied] = useState(false);
11
- const buttonRef = useRef(null);
12
- const handleCopy = ()=>{
13
- navigator.clipboard.writeText(value);
14
- setCopied(true);
15
- setTimeout(()=>{
16
- setCopied(false);
17
- }, 2000);
18
- };
19
- return /*#__PURE__*/ _jsxs("div", {
20
- className: "field-copy-text__button-wrapper",
21
- children: [
22
- /*#__PURE__*/ _jsx("div", {
23
- className: "field-copy-text__tooltip",
24
- "data-visible": copied,
25
- children: "Copied"
26
- }),
27
- /*#__PURE__*/ _jsx(Button, {
28
- ref: buttonRef,
29
- icon: /*#__PURE__*/ _jsx(CopyIcon, {}),
30
- buttonStyle: "transparent",
31
- onClick: handleCopy,
32
- className: "field-copy-text__button"
33
- })
34
- ]
35
- });
36
- };
37
-
38
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/shared/payload/fields/field-copy-button/index.tsx"],"sourcesContent":["'use client';\nimport './index.css';\nimport { Button, CopyIcon, TextField, useField } from '@payloadcms/ui';\nimport { useRef, useState } from 'react';\n\nexport const FieldCopyButton: typeof TextField = ({ path }) => {\n const { value } = useField({ path });\n const [copied, setCopied] = useState(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const handleCopy = () => {\n navigator.clipboard.writeText(value as string);\n setCopied(true);\n setTimeout(() => {\n setCopied(false);\n }, 2000);\n };\n return (\n <div className='field-copy-text__button-wrapper'>\n <div className='field-copy-text__tooltip' data-visible={copied}>\n Copied\n </div>\n <Button\n ref={buttonRef}\n icon={<CopyIcon />}\n buttonStyle='transparent'\n onClick={handleCopy}\n className='field-copy-text__button'\n />\n </div>\n );\n};\n"],"names":["Button","CopyIcon","useField","useRef","useState","FieldCopyButton","path","value","copied","setCopied","buttonRef","handleCopy","navigator","clipboard","writeText","setTimeout","div","className","data-visible","ref","icon","buttonStyle","onClick"],"mappings":"AAAA;;AACA,OAAO,cAAc;AACrB,SAASA,MAAM,EAAEC,QAAQ,EAAaC,QAAQ,QAAQ,iBAAiB;AACvE,SAASC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAEzC,OAAO,MAAMC,kBAAoC,CAAC,EAAEC,IAAI,EAAE;IACxD,MAAM,EAAEC,KAAK,EAAE,GAAGL,SAAS;QAAEI;IAAK;IAClC,MAAM,CAACE,QAAQC,UAAU,GAAGL,SAAS;IACrC,MAAMM,YAAYP,OAA0B;IAE5C,MAAMQ,aAAa;QACjBC,UAAUC,SAAS,CAACC,SAAS,CAACP;QAC9BE,UAAU;QACVM,WAAW;YACTN,UAAU;QACZ,GAAG;IACL;IACA,qBACE,MAACO;QAAIC,WAAU;;0BACb,KAACD;gBAAIC,WAAU;gBAA2BC,gBAAcV;0BAAQ;;0BAGhE,KAACR;gBACCmB,KAAKT;gBACLU,oBAAM,KAACnB;gBACPoB,aAAY;gBACZC,SAASX;gBACTM,WAAU;;;;AAIlB,EAAE"}
@@ -1,3 +0,0 @@
1
- import './index.css';
2
- import { TextField } from '@payloadcms/ui';
3
- export declare const GenerateUuidButton: typeof TextField;
@@ -1,26 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import "./index.css";
4
- import { Button, useField } from "@payloadcms/ui";
5
- import { useRef } from "react";
6
- export const GenerateUuidButton = ({ path })=>{
7
- const { setValue } = useField({
8
- path
9
- });
10
- const buttonRef = useRef(null);
11
- const handleGenerate = ()=>{
12
- setValue(crypto.randomUUID());
13
- };
14
- return /*#__PURE__*/ _jsx("div", {
15
- className: "generate-uuid-button-wrapper",
16
- children: /*#__PURE__*/ _jsx(Button, {
17
- ref: buttonRef,
18
- buttonStyle: "primary",
19
- onClick: handleGenerate,
20
- className: "generate-uuid-button",
21
- children: "Generate UUID"
22
- })
23
- });
24
- };
25
-
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/shared/payload/fields/generate-uuid-button/index.tsx"],"sourcesContent":["'use client';\n\nimport './index.css';\nimport { Button, TextField, useField } from '@payloadcms/ui';\nimport { useRef } from 'react';\n\nexport const GenerateUuidButton: typeof TextField = ({ path }) => {\n const { setValue } = useField({ path });\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const handleGenerate = () => {\n setValue(crypto.randomUUID());\n };\n\n return (\n <div className='generate-uuid-button-wrapper'>\n <Button\n ref={buttonRef}\n buttonStyle='primary'\n onClick={handleGenerate}\n className='generate-uuid-button'\n >\n Generate UUID\n </Button>\n </div>\n );\n};\n"],"names":["Button","useField","useRef","GenerateUuidButton","path","setValue","buttonRef","handleGenerate","crypto","randomUUID","div","className","ref","buttonStyle","onClick"],"mappings":"AAAA;;AAEA,OAAO,cAAc;AACrB,SAASA,MAAM,EAAaC,QAAQ,QAAQ,iBAAiB;AAC7D,SAASC,MAAM,QAAQ,QAAQ;AAE/B,OAAO,MAAMC,qBAAuC,CAAC,EAAEC,IAAI,EAAE;IAC3D,MAAM,EAAEC,QAAQ,EAAE,GAAGJ,SAAS;QAAEG;IAAK;IACrC,MAAME,YAAYJ,OAA0B;IAE5C,MAAMK,iBAAiB;QACrBF,SAASG,OAAOC,UAAU;IAC5B;IAEA,qBACE,KAACC;QAAIC,WAAU;kBACb,cAAA,KAACX;YACCY,KAAKN;YACLO,aAAY;YACZC,SAASP;YACTI,WAAU;sBACX;;;AAKP,EAAE"}
@@ -1,2 +0,0 @@
1
- export * from './field-copy-button';
2
- export * from './generate-uuid-button';
@@ -1,4 +0,0 @@
1
- export * from "./field-copy-button";
2
- export * from "./generate-uuid-button";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/payload/fields/index.ts"],"sourcesContent":["export * from './field-copy-button';\nexport * from './generate-uuid-button';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,yBAAyB"}
@@ -1,2 +0,0 @@
1
- export declare const emailRegex: RegExp;
2
- export declare const usernameRegex: RegExp;
@@ -1,4 +0,0 @@
1
- export const emailRegex = /^(?!\.)(?!.*\.\.)([a-z0-9_'+\-\.]*)[a-z0-9_'+\-]@([a-z0-9][a-z0-9\-]*\.)+[a-z]{2,}$/i;
2
- export const usernameRegex = /^[a-zA-Z0-9._-]+$/;
3
-
4
- //# sourceMappingURL=regex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/shared/utils/regex.ts"],"sourcesContent":["export const emailRegex =\n /^(?!\\.)(?!.*\\.\\.)([a-z0-9_'+\\-\\.]*)[a-z0-9_'+\\-]@([a-z0-9][a-z0-9\\-]*\\.)+[a-z]{2,}$/i;\nexport const usernameRegex = /^[a-zA-Z0-9._-]+$/;\n"],"names":["emailRegex","usernameRegex"],"mappings":"AAAA,OAAO,MAAMA,aACX,uFAAuF;AACzF,OAAO,MAAMC,gBAAgB,oBAAoB"}
@@ -1,11 +0,0 @@
1
- type Success<T> = {
2
- data: T;
3
- error: null;
4
- };
5
- type Failure<E> = {
6
- data: null;
7
- error: E;
8
- };
9
- type Result<T, E = Error> = Success<T> | Failure<E>;
10
- export declare function tryCatch<T, E = Error>(promise: Promise<T>): Promise<Result<T, E>>;
11
- export {};
@@ -1,17 +0,0 @@
1
- // Main wrapper function
2
- export async function tryCatch(promise) {
3
- try {
4
- const data = await promise;
5
- return {
6
- data,
7
- error: null
8
- };
9
- } catch (error) {
10
- return {
11
- data: null,
12
- error: error
13
- };
14
- }
15
- }
16
-
17
- //# sourceMappingURL=try-catch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/shared/utils/try-catch.ts"],"sourcesContent":["type Success<T> = {\n data: T;\n error: null;\n};\n\ntype Failure<E> = {\n data: null;\n error: E;\n};\n\ntype Result<T, E = Error> = Success<T> | Failure<E>;\n\n// Main wrapper function\nexport async function tryCatch<T, E = Error>(promise: Promise<T>): Promise<Result<T, E>> {\n try {\n const data = await promise;\n return { data, error: null };\n } catch (error) {\n return { data: null, error: error as E };\n }\n}\n"],"names":["tryCatch","promise","data","error"],"mappings":"AAYA,wBAAwB;AACxB,OAAO,eAAeA,SAAuBC,OAAmB;IAC9D,IAAI;QACF,MAAMC,OAAO,MAAMD;QACnB,OAAO;YAAEC;YAAMC,OAAO;QAAK;IAC7B,EAAE,OAAOA,OAAO;QACd,OAAO;YAAED,MAAM;YAAMC,OAAOA;QAAW;IACzC;AACF"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Returns the provided value if it's defined (not undefined), otherwise returns the default value.
3
- * Unlike null checks, this allows empty strings to pass through.
4
- *
5
- * @param value - The value to check
6
- * @param defaultValue - The default value to return if the provided value is undefined
7
- * @returns The provided value if defined, otherwise the default value
8
- */
9
- export declare function valueOrDefaultString<T extends string>(value: T | undefined, defaultValue: T): T;
@@ -1,12 +0,0 @@
1
- /**
2
- * Returns the provided value if it's defined (not undefined), otherwise returns the default value.
3
- * Unlike null checks, this allows empty strings to pass through.
4
- *
5
- * @param value - The value to check
6
- * @param defaultValue - The default value to return if the provided value is undefined
7
- * @returns The provided value if defined, otherwise the default value
8
- */ export function valueOrDefaultString(value, defaultValue) {
9
- return value !== undefined ? value : defaultValue;
10
- }
11
-
12
- //# sourceMappingURL=value-or-default.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/shared/utils/value-or-default.ts"],"sourcesContent":["/**\n * Returns the provided value if it's defined (not undefined), otherwise returns the default value.\n * Unlike null checks, this allows empty strings to pass through.\n *\n * @param value - The value to check\n * @param defaultValue - The default value to return if the provided value is undefined\n * @returns The provided value if defined, otherwise the default value\n */\nexport function valueOrDefaultString<T extends string>(value: T | undefined, defaultValue: T): T {\n return value !== undefined ? value : defaultValue;\n}\n"],"names":["valueOrDefaultString","value","defaultValue","undefined"],"mappings":"AAAA;;;;;;;CAOC,GACD,OAAO,SAASA,qBAAuCC,KAAoB,EAAEC,YAAe;IAC1F,OAAOD,UAAUE,YAAYF,QAAQC;AACvC"}