@ankhorage/zora 12.0.0 → 12.1.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 (215) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/dist/constants.d.ts +2 -0
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/constants.js +9 -0
  6. package/dist/constants.js.map +1 -1
  7. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthForm.d.ts +3 -3
  8. package/dist/features/auth/adapters/inbound/AuthForm.d.ts.map +1 -0
  9. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthForm.js +2 -2
  10. package/dist/features/auth/adapters/inbound/AuthForm.js.map +1 -0
  11. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.d.ts +2 -2
  12. package/dist/features/auth/adapters/inbound/AuthFormField.d.ts.map +1 -0
  13. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.js +2 -2
  14. package/dist/features/auth/adapters/inbound/AuthFormField.js.map +1 -0
  15. package/dist/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.d.ts +1 -1
  16. package/dist/features/auth/adapters/inbound/ForgotPasswordForm.d.ts.map +1 -0
  17. package/dist/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.js +5 -5
  18. package/dist/features/auth/adapters/inbound/ForgotPasswordForm.js.map +1 -0
  19. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.d.ts +1 -1
  20. package/dist/features/auth/adapters/inbound/OAuthProviderButton.d.ts.map +1 -0
  21. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.js +3 -3
  22. package/dist/features/auth/adapters/inbound/OAuthProviderButton.js.map +1 -0
  23. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.d.ts +1 -1
  24. package/dist/features/auth/adapters/inbound/OAuthProviderList.d.ts.map +1 -0
  25. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.js +2 -2
  26. package/dist/features/auth/adapters/inbound/OAuthProviderList.js.map +1 -0
  27. package/dist/{patterns/auth → features/auth/adapters/inbound}/OtpForm.d.ts +1 -1
  28. package/dist/features/auth/adapters/inbound/OtpForm.d.ts.map +1 -0
  29. package/dist/{patterns/auth → features/auth/adapters/inbound}/OtpForm.js +4 -4
  30. package/dist/features/auth/adapters/inbound/OtpForm.js.map +1 -0
  31. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignInForm.d.ts +1 -1
  32. package/dist/features/auth/adapters/inbound/SignInForm.d.ts.map +1 -0
  33. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignInForm.js +5 -5
  34. package/dist/features/auth/adapters/inbound/SignInForm.js.map +1 -0
  35. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.d.ts +1 -1
  36. package/dist/features/auth/adapters/inbound/SignUpForm.d.ts.map +1 -0
  37. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.js +3 -3
  38. package/dist/features/auth/adapters/inbound/SignUpForm.js.map +1 -0
  39. package/dist/features/auth/forgotPasswordFormMeta.d.ts +79 -0
  40. package/dist/features/auth/forgotPasswordFormMeta.d.ts.map +1 -0
  41. package/dist/features/auth/forgotPasswordFormMeta.js +48 -0
  42. package/dist/features/auth/forgotPasswordFormMeta.js.map +1 -0
  43. package/dist/features/auth/oauthProviderButtonMeta.d.ts +83 -0
  44. package/dist/features/auth/oauthProviderButtonMeta.d.ts.map +1 -0
  45. package/dist/features/auth/oauthProviderButtonMeta.js +61 -0
  46. package/dist/features/auth/oauthProviderButtonMeta.js.map +1 -0
  47. package/dist/features/auth/oauthProviderListMeta.d.ts +109 -0
  48. package/dist/features/auth/oauthProviderListMeta.d.ts.map +1 -0
  49. package/dist/features/auth/oauthProviderListMeta.js +66 -0
  50. package/dist/features/auth/oauthProviderListMeta.js.map +1 -0
  51. package/dist/features/auth/otpFormMeta.d.ts +89 -0
  52. package/dist/features/auth/otpFormMeta.d.ts.map +1 -0
  53. package/dist/features/auth/otpFormMeta.js +54 -0
  54. package/dist/features/auth/otpFormMeta.js.map +1 -0
  55. package/dist/features/auth/public.d.ts +9 -0
  56. package/dist/features/auth/public.d.ts.map +1 -0
  57. package/dist/features/auth/public.js +8 -0
  58. package/dist/features/auth/public.js.map +1 -0
  59. package/dist/features/auth/signInFormMeta.d.ts +100 -0
  60. package/dist/features/auth/signInFormMeta.d.ts.map +1 -0
  61. package/dist/features/auth/signInFormMeta.js +62 -0
  62. package/dist/features/auth/signInFormMeta.js.map +1 -0
  63. package/dist/features/auth/signUpFormMeta.d.ts +111 -0
  64. package/dist/features/auth/signUpFormMeta.d.ts.map +1 -0
  65. package/dist/features/auth/signUpFormMeta.js +66 -0
  66. package/dist/features/auth/signUpFormMeta.js.map +1 -0
  67. package/dist/{patterns/auth/utils.d.ts → features/auth/utils/authForm.d.ts} +3 -3
  68. package/dist/features/auth/utils/authForm.d.ts.map +1 -0
  69. package/dist/{patterns/auth/utils.js → features/auth/utils/authForm.js} +1 -1
  70. package/dist/features/auth/utils/authForm.js.map +1 -0
  71. package/dist/{patterns/auth → features/auth/utils}/oauthProviders.d.ts +1 -1
  72. package/dist/features/auth/utils/oauthProviders.d.ts.map +1 -0
  73. package/dist/features/auth/utils/oauthProviders.js.map +1 -0
  74. package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
  75. package/dist/features/card/cardMeta.d.ts +1 -1
  76. package/dist/features/card/mediaCardMeta.d.ts +1 -1
  77. package/dist/features/card/postCardMeta.d.ts +1 -1
  78. package/dist/{components/gradient → features/gradient/adapters/inbound}/Gradient.d.ts +1 -1
  79. package/dist/features/gradient/adapters/inbound/Gradient.d.ts.map +1 -0
  80. package/dist/{components/gradient → features/gradient/adapters/inbound}/Gradient.js +2 -2
  81. package/dist/features/gradient/adapters/inbound/Gradient.js.map +1 -0
  82. package/dist/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.d.ts +3 -2
  83. package/dist/features/gradient/adapters/inbound/GradientRendererContext.d.ts.map +1 -0
  84. package/dist/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.js +2 -1
  85. package/dist/features/gradient/adapters/inbound/GradientRendererContext.js.map +1 -0
  86. package/dist/features/gradient/gradientMeta.d.ts +48 -0
  87. package/dist/features/gradient/gradientMeta.d.ts.map +1 -0
  88. package/dist/features/gradient/gradientMeta.js +25 -0
  89. package/dist/features/gradient/gradientMeta.js.map +1 -0
  90. package/dist/features/gradient/public.d.ts +4 -0
  91. package/dist/features/gradient/public.d.ts.map +1 -0
  92. package/dist/features/gradient/public.js +3 -0
  93. package/dist/features/gradient/public.js.map +1 -0
  94. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
  95. package/dist/features/layout/boxMeta.d.ts +1 -1
  96. package/dist/features/layout/containerMeta.d.ts +1 -1
  97. package/dist/features/layout/gridMeta.d.ts +1 -1
  98. package/dist/features/layout/stackMeta.d.ts +1 -1
  99. package/dist/features/list/flatListMeta.d.ts +1 -1
  100. package/dist/features/list/sectionListMeta.d.ts +1 -1
  101. package/dist/features/surface/surfaceMeta.d.ts +1 -1
  102. package/dist/index.d.ts +4 -4
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +2 -2
  105. package/dist/index.js.map +1 -1
  106. package/dist/layout/screen/meta.d.ts +1 -1
  107. package/dist/layout/screen-section/meta.d.ts +1 -1
  108. package/dist/metadata/allowedChildren.d.ts +3 -3
  109. package/dist/metadata/allowedChildren.d.ts.map +1 -1
  110. package/dist/metadata/allowedChildren.js +7 -0
  111. package/dist/metadata/allowedChildren.js.map +1 -1
  112. package/dist/metadata/bindableComponentMeta.d.ts +2 -2
  113. package/dist/metadata/componentMeta.d.ts.map +1 -1
  114. package/dist/metadata/componentMeta.js +7 -2
  115. package/dist/metadata/componentMeta.js.map +1 -1
  116. package/dist/patterns/message-bubble/meta.d.ts +1 -1
  117. package/dist/patterns/notice/meta.d.ts +1 -1
  118. package/dist/patterns/panel/meta.d.ts +1 -1
  119. package/dist/patterns/reader/meta.d.ts +2 -2
  120. package/dist/patterns/scanner/meta.d.ts +2 -2
  121. package/dist/registry.js +2 -2
  122. package/dist/registry.js.map +1 -1
  123. package/dist/{patterns/auth/types.d.ts → types/auth.d.ts} +8 -8
  124. package/dist/types/auth.d.ts.map +1 -0
  125. package/dist/types/auth.js +2 -0
  126. package/dist/types/auth.js.map +1 -0
  127. package/dist/{components/gradient/types.d.ts → types/gradient.d.ts} +3 -3
  128. package/dist/types/gradient.d.ts.map +1 -0
  129. package/dist/types/gradient.js +2 -0
  130. package/dist/types/gradient.js.map +1 -0
  131. package/package.json +1 -1
  132. package/src/constants.ts +9 -0
  133. package/src/expo57Migration.test.ts +1 -1
  134. package/src/featureManifest.test.ts +2 -0
  135. package/src/{patterns/auth → features/auth/adapters/inbound}/AuthForm.tsx +5 -5
  136. package/src/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.tsx +4 -4
  137. package/src/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.tsx +8 -8
  138. package/src/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.tsx +4 -4
  139. package/src/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.tsx +3 -3
  140. package/src/{patterns/auth → features/auth/adapters/inbound}/OtpForm.tsx +6 -6
  141. package/src/{patterns/auth → features/auth/adapters/inbound}/SignInForm.tsx +8 -8
  142. package/src/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.tsx +5 -5
  143. package/src/features/auth/forgotPasswordFormMeta.ts +49 -0
  144. package/src/features/auth/oauthProviderButtonMeta.ts +62 -0
  145. package/src/features/auth/oauthProviderListMeta.ts +67 -0
  146. package/src/features/auth/otpFormMeta.ts +55 -0
  147. package/src/features/auth/public.test.ts +34 -0
  148. package/src/{patterns/auth/index.ts → features/auth/public.ts} +12 -12
  149. package/src/features/auth/signInFormMeta.ts +63 -0
  150. package/src/features/auth/signUpFormMeta.ts +67 -0
  151. package/src/{patterns/auth/utils.ts → features/auth/utils/authForm.ts} +2 -2
  152. package/src/{patterns/auth → features/auth/utils}/oauthProviders.test.ts +1 -1
  153. package/src/{patterns/auth → features/auth/utils}/oauthProviders.ts +1 -1
  154. package/src/{components/gradient → features/gradient/adapters/inbound}/Gradient.tsx +3 -3
  155. package/src/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.tsx +3 -2
  156. package/src/features/gradient/gradientMeta.ts +26 -0
  157. package/src/features/gradient/public.test.ts +15 -0
  158. package/src/{components/gradient/index.ts → features/gradient/public.ts} +3 -3
  159. package/src/index.ts +40 -40
  160. package/src/metadata/allowedChildren.ts +7 -0
  161. package/src/metadata/componentMeta.test.ts +7 -0
  162. package/src/metadata/componentMeta.ts +7 -9
  163. package/src/registry.ts +9 -9
  164. package/src/theme/themeScopeStructure.test.ts +7 -5
  165. package/src/{patterns/auth/types.ts → types/auth.ts} +7 -7
  166. package/src/{components/gradient/types.ts → types/gradient.ts} +2 -2
  167. package/dist/components/gradient/Gradient.d.ts.map +0 -1
  168. package/dist/components/gradient/Gradient.js.map +0 -1
  169. package/dist/components/gradient/GradientRendererContext.d.ts.map +0 -1
  170. package/dist/components/gradient/GradientRendererContext.js.map +0 -1
  171. package/dist/components/gradient/index.d.ts +0 -4
  172. package/dist/components/gradient/index.d.ts.map +0 -1
  173. package/dist/components/gradient/index.js +0 -3
  174. package/dist/components/gradient/index.js.map +0 -1
  175. package/dist/components/gradient/meta.d.ts +0 -9
  176. package/dist/components/gradient/meta.d.ts.map +0 -1
  177. package/dist/components/gradient/meta.js +0 -9
  178. package/dist/components/gradient/meta.js.map +0 -1
  179. package/dist/components/gradient/types.d.ts.map +0 -1
  180. package/dist/components/gradient/types.js +0 -2
  181. package/dist/components/gradient/types.js.map +0 -1
  182. package/dist/patterns/auth/AuthForm.d.ts.map +0 -1
  183. package/dist/patterns/auth/AuthForm.js.map +0 -1
  184. package/dist/patterns/auth/AuthFormField.d.ts.map +0 -1
  185. package/dist/patterns/auth/AuthFormField.js.map +0 -1
  186. package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +0 -1
  187. package/dist/patterns/auth/ForgotPasswordForm.js.map +0 -1
  188. package/dist/patterns/auth/OAuthProviderButton.d.ts.map +0 -1
  189. package/dist/patterns/auth/OAuthProviderButton.js.map +0 -1
  190. package/dist/patterns/auth/OAuthProviderList.d.ts.map +0 -1
  191. package/dist/patterns/auth/OAuthProviderList.js.map +0 -1
  192. package/dist/patterns/auth/OtpForm.d.ts.map +0 -1
  193. package/dist/patterns/auth/OtpForm.js.map +0 -1
  194. package/dist/patterns/auth/SignInForm.d.ts.map +0 -1
  195. package/dist/patterns/auth/SignInForm.js.map +0 -1
  196. package/dist/patterns/auth/SignUpForm.d.ts.map +0 -1
  197. package/dist/patterns/auth/SignUpForm.js.map +0 -1
  198. package/dist/patterns/auth/index.d.ts +0 -9
  199. package/dist/patterns/auth/index.d.ts.map +0 -1
  200. package/dist/patterns/auth/index.js +0 -8
  201. package/dist/patterns/auth/index.js.map +0 -1
  202. package/dist/patterns/auth/meta.d.ts +0 -49
  203. package/dist/patterns/auth/meta.d.ts.map +0 -1
  204. package/dist/patterns/auth/meta.js +0 -50
  205. package/dist/patterns/auth/meta.js.map +0 -1
  206. package/dist/patterns/auth/oauthProviders.d.ts.map +0 -1
  207. package/dist/patterns/auth/oauthProviders.js.map +0 -1
  208. package/dist/patterns/auth/types.d.ts.map +0 -1
  209. package/dist/patterns/auth/types.js +0 -2
  210. package/dist/patterns/auth/types.js.map +0 -1
  211. package/dist/patterns/auth/utils.d.ts.map +0 -1
  212. package/dist/patterns/auth/utils.js.map +0 -1
  213. package/src/components/gradient/meta.ts +0 -10
  214. package/src/patterns/auth/meta.ts +0 -57
  215. /package/dist/{patterns/auth → features/auth/utils}/oauthProviders.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/auth/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ButtonProps } from '../../features/button/public';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport type { FormFieldConfig, FormValues } from '../../types/form';\n\nexport type AuthIdentifierKind = 'email' | 'phone' | 'username';\n\nexport interface AuthFormBaseProps extends ZoraBaseProps {\n loading?: boolean;\n disabled?: boolean;\n error?: React.ReactNode;\n submitLabel?: React.ReactNode;\n}\n\nexport interface SignInFormValues {\n identifier: string;\n identifierKind: AuthIdentifierKind;\n secret: string;\n}\n\nexport interface SignInFormProps extends AuthFormBaseProps {\n identifiers?: readonly AuthIdentifierKind[];\n identifierLabel?: React.ReactNode;\n secretLabel?: React.ReactNode;\n forgotPasswordLabel?: React.ReactNode;\n signUpLabel?: React.ReactNode;\n onSubmit: (values: SignInFormValues) => void | Promise<void>;\n onForgotPassword?: () => void | Promise<void>;\n onSignUp?: () => void | Promise<void>;\n}\n\nexport type SignUpFormValues = FormValues;\nexport type SignUpFormField = FormFieldConfig;\n\nexport interface SignUpFormProps extends AuthFormBaseProps {\n fields?: readonly SignUpFormField[];\n signInLabel?: React.ReactNode;\n onSubmit: (values: SignUpFormValues) => void | Promise<void>;\n onSignIn?: () => void | Promise<void>;\n}\n\nexport interface ForgotPasswordFormValues {\n identifier: string;\n identifierKind: AuthIdentifierKind;\n}\n\nexport interface ForgotPasswordFormProps extends AuthFormBaseProps {\n identifiers?: readonly AuthIdentifierKind[];\n identifierLabel?: React.ReactNode;\n signInLabel?: React.ReactNode;\n onSubmit: (values: ForgotPasswordFormValues) => void | Promise<void>;\n onSignIn?: () => void | Promise<void>;\n}\n\nexport interface OtpFormValues {\n otp: string;\n}\n\nexport interface OtpFormProps extends AuthFormBaseProps {\n length?: number;\n otpLabel?: React.ReactNode;\n resendLabel?: React.ReactNode;\n resendDisabled?: boolean;\n resendLoading?: boolean;\n onSubmit: (values: OtpFormValues) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n}\n\nexport type OAuthProviderIconSpec = ButtonIconSpec;\n\nexport interface OAuthProviderItem {\n id: string;\n label?: React.ReactNode;\n icon?: OAuthProviderIconSpec;\n disabled?: boolean;\n loading?: boolean;\n}\n\nexport interface OAuthProviderButtonProps extends ZoraBaseProps {\n providerId: string;\n label?: React.ReactNode;\n icon?: OAuthProviderIconSpec;\n disabled?: boolean;\n loading?: boolean;\n fullWidth?: boolean;\n size?: ButtonProps['size'];\n variant?: ButtonProps['variant'];\n color?: ButtonProps['color'];\n onPress?: (providerId: string) => void | Promise<void>;\n}\n\nexport type OAuthProviderListLayout = 'stack' | 'inline';\n\nexport interface OAuthProviderListProps extends ZoraBaseProps {\n providers: readonly OAuthProviderItem[];\n disabled?: boolean;\n loading?: boolean;\n fullWidth?: boolean;\n layout?: OAuthProviderListLayout;\n size?: ButtonProps['size'];\n variant?: ButtonProps['variant'];\n color?: ButtonProps['color'];\n onProviderPress?: (providerId: string) => void | Promise<void>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/patterns/auth/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,kBAAkB,oBAA6D,CAAC;AAqB7F,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAMzF;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,SAAS,kBAAkB,EAAE,GACzC,eAAe,CAAC,MAAM,CAAC,CAgBzB;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,kBAAkB,EAAE,GACzC,SAAS,cAAc,EAAE,CAM3B;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,SAAS,kBAAkB,EAAE,GACzC,kBAAkB,CAoBpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/patterns/auth/utils.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,CAAkD,CAAC;AAE7F,SAAS,0BAA0B,CAAC,UAA8B;IAChE,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO,CAAC;QACb;YACE,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CACzB,WAA0C,EAC1C,UAA8B;IAE9B,OAAO,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,WAA0C;IAC/E,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,0BAA0B,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,WAA0C;IAE1C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC;IAEjC,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,WAA0C;IAE1C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC3D,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,UAAkB,EAClB,WAA0C;IAE1C,MAAM,oBAAoB,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAE/C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;IACnC,CAAC;IAED,IAAI,kBAAkB,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAI,kBAAkB,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC5F,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAI,kBAAkB,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,CAAC;QAChD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AACnC,CAAC","sourcesContent":["import type { FormFieldConfig, ValidationRule } from '../../types/form';\nimport type { AuthIdentifierKind } from './types';\n\nexport const defaultIdentifiers = ['email'] as const satisfies readonly AuthIdentifierKind[];\n\nfunction resolveIdentifierKindLabel(identifier: AuthIdentifierKind): string {\n switch (identifier) {\n case 'phone':\n return 'Phone';\n case 'username':\n return 'Username';\n case 'email':\n default:\n return 'Email';\n }\n}\n\nfunction includesIdentifier(\n identifiers: readonly AuthIdentifierKind[],\n identifier: AuthIdentifierKind,\n): boolean {\n return identifiers.includes(identifier);\n}\n\nexport function resolveIdentifierLabel(identifiers: readonly AuthIdentifierKind[]): string {\n if (identifiers.length === 1) {\n return resolveIdentifierKindLabel(identifiers[0] ?? 'email');\n }\n\n return identifiers.map(resolveIdentifierKindLabel).join(', or ');\n}\n\nexport function resolveIdentifierType(\n identifiers: readonly AuthIdentifierKind[],\n): FormFieldConfig['type'] {\n if (identifiers.length !== 1) {\n return 'text';\n }\n\n const [identifier] = identifiers;\n\n if (identifier === 'email') {\n return 'email';\n }\n\n if (identifier === 'phone') {\n return 'tel';\n }\n\n return 'text';\n}\n\nexport function resolveIdentifierRules(\n identifiers: readonly AuthIdentifierKind[],\n): readonly ValidationRule[] {\n if (identifiers.length === 1 && identifiers[0] === 'email') {\n return [{ kind: 'required' }, { kind: 'email' }];\n }\n\n return [{ kind: 'required' }];\n}\n\nexport function normalizeIdentifierKind(\n identifier: string,\n identifiers: readonly AuthIdentifierKind[],\n): AuthIdentifierKind {\n const normalizedIdentifier = identifier.trim();\n\n if (identifiers.length === 1) {\n return identifiers[0] ?? 'email';\n }\n\n if (includesIdentifier(identifiers, 'email') && normalizedIdentifier.includes('@')) {\n return 'email';\n }\n\n if (includesIdentifier(identifiers, 'phone') && /^[+()\\d\\s.-]+$/.test(normalizedIdentifier)) {\n return 'phone';\n }\n\n if (includesIdentifier(identifiers, 'username')) {\n return 'username';\n }\n\n return identifiers[0] ?? 'email';\n}\n"]}
@@ -1,10 +0,0 @@
1
- import type { ZoraComponentMeta } from '../../metadata';
2
-
3
- export const gradientMeta = {
4
- name: 'Gradient',
5
- category: 'component',
6
- directManifestNode: false,
7
- allowedChildren: [],
8
- note: 'Gradient background container; not represented as a manifest node in v1.',
9
- props: {},
10
- } as const satisfies ZoraComponentMeta;
@@ -1,57 +0,0 @@
1
- import type { ZoraComponentMeta } from '../../metadata';
2
-
3
- const AUTH_NOTE = 'Auth pattern component; not represented as a manifest node in v1.';
4
-
5
- export const forgotPasswordFormMeta = {
6
- name: 'ForgotPasswordForm',
7
- category: 'pattern',
8
- directManifestNode: false,
9
- allowedChildren: [],
10
- note: AUTH_NOTE,
11
- props: {},
12
- } as const satisfies ZoraComponentMeta;
13
-
14
- export const oauthProviderButtonMeta = {
15
- name: 'OAuthProviderButton',
16
- category: 'pattern',
17
- directManifestNode: false,
18
- allowedChildren: [],
19
- note: AUTH_NOTE,
20
- props: {},
21
- } as const satisfies ZoraComponentMeta;
22
-
23
- export const oauthProviderListMeta = {
24
- name: 'OAuthProviderList',
25
- category: 'pattern',
26
- directManifestNode: false,
27
- allowedChildren: [],
28
- note: AUTH_NOTE,
29
- props: {},
30
- } as const satisfies ZoraComponentMeta;
31
-
32
- export const otpFormMeta = {
33
- name: 'OtpForm',
34
- category: 'pattern',
35
- directManifestNode: false,
36
- allowedChildren: [],
37
- note: AUTH_NOTE,
38
- props: {},
39
- } as const satisfies ZoraComponentMeta;
40
-
41
- export const signInFormMeta = {
42
- name: 'SignInForm',
43
- category: 'pattern',
44
- directManifestNode: false,
45
- allowedChildren: [],
46
- note: AUTH_NOTE,
47
- props: {},
48
- } as const satisfies ZoraComponentMeta;
49
-
50
- export const signUpFormMeta = {
51
- name: 'SignUpForm',
52
- category: 'pattern',
53
- directManifestNode: false,
54
- allowedChildren: [],
55
- note: AUTH_NOTE,
56
- props: {},
57
- } as const satisfies ZoraComponentMeta;