@ankhorage/zora 9.0.1 → 11.0.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 (237) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -2
  3. package/dist/constants.d.ts +2 -1
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/constants.js +2 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
  8. package/dist/features/card/cardMeta.d.ts +1 -1
  9. package/dist/features/card/mediaCardMeta.d.ts +1 -1
  10. package/dist/features/card/postCardMeta.d.ts +1 -1
  11. package/dist/features/form/adapters/inbound/Form.d.ts +5 -0
  12. package/dist/features/form/adapters/inbound/Form.d.ts.map +1 -0
  13. package/dist/features/form/adapters/inbound/Form.js +18 -0
  14. package/dist/features/form/adapters/inbound/Form.js.map +1 -0
  15. package/dist/{components/form → features/form/adapters/inbound}/FormActions.d.ts +1 -1
  16. package/dist/features/form/adapters/inbound/FormActions.d.ts.map +1 -0
  17. package/dist/{components/form → features/form/adapters/inbound}/FormActions.js +3 -3
  18. package/dist/features/form/adapters/inbound/FormActions.js.map +1 -0
  19. package/dist/features/form/adapters/inbound/FormError.d.ts +5 -0
  20. package/dist/features/form/adapters/inbound/FormError.d.ts.map +1 -0
  21. package/dist/features/form/adapters/inbound/FormError.js +18 -0
  22. package/dist/features/form/adapters/inbound/FormError.js.map +1 -0
  23. package/dist/features/form/adapters/inbound/FormField.d.ts +5 -0
  24. package/dist/features/form/adapters/inbound/FormField.d.ts.map +1 -0
  25. package/dist/{patterns/form-field → features/form/adapters/inbound}/FormField.js +5 -4
  26. package/dist/features/form/adapters/inbound/FormField.js.map +1 -0
  27. package/dist/features/form/formActionsMeta.d.ts +9 -0
  28. package/dist/features/form/formActionsMeta.d.ts.map +1 -0
  29. package/dist/features/form/formActionsMeta.js +9 -0
  30. package/dist/features/form/formActionsMeta.js.map +1 -0
  31. package/dist/features/form/formErrorMeta.d.ts +32 -0
  32. package/dist/features/form/formErrorMeta.d.ts.map +1 -0
  33. package/dist/features/form/formErrorMeta.js +19 -0
  34. package/dist/features/form/formErrorMeta.js.map +1 -0
  35. package/dist/{components/form/meta.d.ts → features/form/formFieldMeta.d.ts} +28 -39
  36. package/dist/features/form/formFieldMeta.d.ts.map +1 -0
  37. package/dist/features/form/formFieldMeta.js +35 -0
  38. package/dist/features/form/formFieldMeta.js.map +1 -0
  39. package/dist/features/form/formMeta.d.ts +61 -0
  40. package/dist/features/form/formMeta.d.ts.map +1 -0
  41. package/dist/features/form/formMeta.js +34 -0
  42. package/dist/features/form/formMeta.js.map +1 -0
  43. package/dist/features/form/public.d.ts +8 -0
  44. package/dist/features/form/public.d.ts.map +1 -0
  45. package/dist/features/form/public.js +7 -0
  46. package/dist/features/form/public.js.map +1 -0
  47. package/dist/{components → features}/form/useFormController.d.ts +1 -1
  48. package/dist/features/form/useFormController.d.ts.map +1 -0
  49. package/dist/{components → features}/form/useFormController.js +1 -1
  50. package/dist/features/form/useFormController.js.map +1 -0
  51. package/dist/{components/form → features/form/utils}/validation.d.ts +1 -1
  52. package/dist/features/form/utils/validation.d.ts.map +1 -0
  53. package/dist/{components/form → features/form/utils}/validation.js +2 -4
  54. package/dist/features/form/utils/validation.js.map +1 -0
  55. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.d.ts +5 -0
  56. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.d.ts.map +1 -0
  57. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.js +10 -0
  58. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.js.map +1 -0
  59. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +36 -0
  60. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts.map +1 -0
  61. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.js +37 -0
  62. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.js.map +1 -0
  63. package/dist/features/keyboard-avoiding-view/public.d.ts +3 -0
  64. package/dist/features/keyboard-avoiding-view/public.d.ts.map +1 -0
  65. package/dist/features/keyboard-avoiding-view/public.js +3 -0
  66. package/dist/features/keyboard-avoiding-view/public.js.map +1 -0
  67. package/dist/features/layout/boxMeta.d.ts +1 -1
  68. package/dist/features/layout/containerMeta.d.ts +1 -1
  69. package/dist/features/layout/gridMeta.d.ts +1 -1
  70. package/dist/features/layout/stackMeta.d.ts +1 -1
  71. package/dist/features/list/flatListMeta.d.ts +1 -1
  72. package/dist/features/list/sectionListMeta.d.ts +1 -1
  73. package/dist/features/surface/surfaceMeta.d.ts +1 -1
  74. package/dist/features/uploader/adapters/inbound/Uploader.d.ts.map +1 -1
  75. package/dist/features/uploader/adapters/inbound/Uploader.js +1 -1
  76. package/dist/features/uploader/adapters/inbound/Uploader.js.map +1 -1
  77. package/dist/index.d.ts +3 -4
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +2 -2
  80. package/dist/index.js.map +1 -1
  81. package/dist/layout/screen/meta.d.ts +1 -1
  82. package/dist/layout/screen-section/meta.d.ts +1 -1
  83. package/dist/metadata/allowedChildren.d.ts +3 -3
  84. package/dist/metadata/allowedChildren.d.ts.map +1 -1
  85. package/dist/metadata/allowedChildren.js +2 -2
  86. package/dist/metadata/allowedChildren.js.map +1 -1
  87. package/dist/metadata/bindableComponentMeta.d.ts +2 -2
  88. package/dist/metadata/componentMeta.d.ts.map +1 -1
  89. package/dist/metadata/componentMeta.js +6 -3
  90. package/dist/metadata/componentMeta.js.map +1 -1
  91. package/dist/patterns/auth/AuthForm.d.ts +21 -0
  92. package/dist/patterns/auth/AuthForm.d.ts.map +1 -0
  93. package/dist/patterns/auth/AuthForm.js +19 -0
  94. package/dist/patterns/auth/AuthForm.js.map +1 -0
  95. package/dist/patterns/auth/AuthFormField.d.ts +16 -0
  96. package/dist/patterns/auth/AuthFormField.d.ts.map +1 -0
  97. package/dist/patterns/auth/AuthFormField.js +38 -0
  98. package/dist/patterns/auth/AuthFormField.js.map +1 -0
  99. package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +1 -1
  100. package/dist/patterns/auth/ForgotPasswordForm.js +2 -2
  101. package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
  102. package/dist/patterns/auth/OtpForm.d.ts.map +1 -1
  103. package/dist/patterns/auth/OtpForm.js +2 -2
  104. package/dist/patterns/auth/OtpForm.js.map +1 -1
  105. package/dist/patterns/auth/SignInForm.d.ts.map +1 -1
  106. package/dist/patterns/auth/SignInForm.js +2 -2
  107. package/dist/patterns/auth/SignInForm.js.map +1 -1
  108. package/dist/patterns/auth/SignUpForm.d.ts.map +1 -1
  109. package/dist/patterns/auth/SignUpForm.js +2 -2
  110. package/dist/patterns/auth/SignUpForm.js.map +1 -1
  111. package/dist/patterns/auth/types.d.ts +1 -1
  112. package/dist/patterns/auth/types.d.ts.map +1 -1
  113. package/dist/patterns/auth/types.js.map +1 -1
  114. package/dist/patterns/auth/utils.d.ts +1 -1
  115. package/dist/patterns/auth/utils.d.ts.map +1 -1
  116. package/dist/patterns/auth/utils.js.map +1 -1
  117. package/dist/patterns/inspector-field/InspectorField.js +1 -1
  118. package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
  119. package/dist/patterns/message-bubble/meta.d.ts +1 -1
  120. package/dist/patterns/notice/meta.d.ts +1 -1
  121. package/dist/patterns/panel/meta.d.ts +1 -1
  122. package/dist/patterns/reader/meta.d.ts +2 -2
  123. package/dist/patterns/scanner/meta.d.ts +2 -2
  124. package/dist/registry.js +3 -3
  125. package/dist/registry.js.map +1 -1
  126. package/dist/{components/form/types.d.ts → types/form.d.ts} +12 -28
  127. package/dist/types/form.d.ts.map +1 -0
  128. package/dist/types/form.js +2 -0
  129. package/dist/types/form.js.map +1 -0
  130. package/dist/types/keyboard-avoiding-view.d.ts +6 -0
  131. package/dist/types/keyboard-avoiding-view.d.ts.map +1 -0
  132. package/dist/types/keyboard-avoiding-view.js +2 -0
  133. package/dist/types/keyboard-avoiding-view.js.map +1 -0
  134. package/package.json +3 -2
  135. package/src/audit.test.ts +2 -4
  136. package/src/constants.ts +2 -1
  137. package/src/featureManifest.test.ts +7 -0
  138. package/src/features/form/adapters/inbound/Form.tsx +39 -0
  139. package/src/{components/form → features/form/adapters/inbound}/FormActions.tsx +4 -4
  140. package/src/features/form/adapters/inbound/FormError.tsx +22 -0
  141. package/src/{patterns/form-field → features/form/adapters/inbound}/FormField.tsx +6 -4
  142. package/src/features/form/formActionsMeta.ts +9 -0
  143. package/src/features/form/formErrorMeta.ts +19 -0
  144. package/src/features/form/formFieldMeta.ts +35 -0
  145. package/src/features/form/formMeta.ts +34 -0
  146. package/src/{components/form/index.ts → features/form/public.ts} +6 -7
  147. package/src/{components → features}/form/useFormController.ts +2 -2
  148. package/src/{components/form → features/form/utils}/validation.test.ts +4 -1
  149. package/src/{components/form → features/form/utils}/validation.ts +4 -8
  150. package/src/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.tsx +18 -0
  151. package/src/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.ts +38 -0
  152. package/src/features/keyboard-avoiding-view/public.ts +5 -0
  153. package/src/features/uploader/adapters/inbound/Uploader.tsx +1 -1
  154. package/src/index.ts +31 -29
  155. package/src/metadata/allowedChildren.ts +2 -2
  156. package/src/metadata/componentMeta.test.ts +32 -2
  157. package/src/metadata/componentMeta.ts +6 -3
  158. package/src/patterns/auth/AuthForm.tsx +68 -0
  159. package/src/patterns/auth/AuthFormField.tsx +81 -0
  160. package/src/patterns/auth/ForgotPasswordForm.tsx +3 -2
  161. package/src/patterns/auth/OtpForm.tsx +3 -2
  162. package/src/patterns/auth/SignInForm.tsx +3 -2
  163. package/src/patterns/auth/SignUpForm.tsx +3 -2
  164. package/src/patterns/auth/types.ts +1 -1
  165. package/src/patterns/auth/utils.ts +1 -1
  166. package/src/patterns/inspector-field/InspectorField.tsx +1 -1
  167. package/src/platformAcceptance.test.ts +1 -1
  168. package/src/registry.ts +3 -3
  169. package/src/showcaseCoverage.test.ts +1 -0
  170. package/src/theme/themeScopeStructure.test.ts +5 -7
  171. package/src/{components/form/types.ts → types/form.ts} +12 -36
  172. package/src/types/keyboard-avoiding-view.ts +10 -0
  173. package/dist/components/form/Form.d.ts +0 -7
  174. package/dist/components/form/Form.d.ts.map +0 -1
  175. package/dist/components/form/Form.js +0 -34
  176. package/dist/components/form/Form.js.map +0 -1
  177. package/dist/components/form/FormActions.d.ts.map +0 -1
  178. package/dist/components/form/FormActions.js.map +0 -1
  179. package/dist/components/form/FormError.d.ts +0 -7
  180. package/dist/components/form/FormError.d.ts.map +0 -1
  181. package/dist/components/form/FormError.js +0 -21
  182. package/dist/components/form/FormError.js.map +0 -1
  183. package/dist/components/form/FormField.d.ts +0 -7
  184. package/dist/components/form/FormField.d.ts.map +0 -1
  185. package/dist/components/form/FormField.js +0 -81
  186. package/dist/components/form/FormField.js.map +0 -1
  187. package/dist/components/form/index.d.ts +0 -8
  188. package/dist/components/form/index.d.ts.map +0 -1
  189. package/dist/components/form/index.js +0 -7
  190. package/dist/components/form/index.js.map +0 -1
  191. package/dist/components/form/meta.d.ts.map +0 -1
  192. package/dist/components/form/meta.js +0 -94
  193. package/dist/components/form/meta.js.map +0 -1
  194. package/dist/components/form/types.d.ts.map +0 -1
  195. package/dist/components/form/types.js +0 -2
  196. package/dist/components/form/types.js.map +0 -1
  197. package/dist/components/form/useFormController.d.ts.map +0 -1
  198. package/dist/components/form/useFormController.js.map +0 -1
  199. package/dist/components/form/validation.d.ts.map +0 -1
  200. package/dist/components/form/validation.js.map +0 -1
  201. package/dist/features/splash-screen/adapters/inbound/SplashScreen.d.ts +0 -11
  202. package/dist/features/splash-screen/adapters/inbound/SplashScreen.d.ts.map +0 -1
  203. package/dist/features/splash-screen/adapters/inbound/SplashScreen.js +0 -55
  204. package/dist/features/splash-screen/adapters/inbound/SplashScreen.js.map +0 -1
  205. package/dist/features/splash-screen/public.d.ts +0 -3
  206. package/dist/features/splash-screen/public.d.ts.map +0 -1
  207. package/dist/features/splash-screen/public.js +0 -2
  208. package/dist/features/splash-screen/public.js.map +0 -1
  209. package/dist/features/splash-screen/splashScreenMeta.d.ts +0 -39
  210. package/dist/features/splash-screen/splashScreenMeta.d.ts.map +0 -1
  211. package/dist/features/splash-screen/splashScreenMeta.js +0 -40
  212. package/dist/features/splash-screen/splashScreenMeta.js.map +0 -1
  213. package/dist/patterns/form-field/FormField.d.ts +0 -4
  214. package/dist/patterns/form-field/FormField.d.ts.map +0 -1
  215. package/dist/patterns/form-field/FormField.js.map +0 -1
  216. package/dist/patterns/form-field/index.d.ts +0 -2
  217. package/dist/patterns/form-field/index.d.ts.map +0 -1
  218. package/dist/patterns/form-field/index.js +0 -2
  219. package/dist/patterns/form-field/index.js.map +0 -1
  220. package/dist/patterns/form-field/types.d.ts +0 -9
  221. package/dist/patterns/form-field/types.d.ts.map +0 -1
  222. package/dist/patterns/form-field/types.js +0 -2
  223. package/dist/patterns/form-field/types.js.map +0 -1
  224. package/dist/types/splash-screen.d.ts +0 -16
  225. package/dist/types/splash-screen.d.ts.map +0 -1
  226. package/dist/types/splash-screen.js +0 -2
  227. package/dist/types/splash-screen.js.map +0 -1
  228. package/src/components/form/Form.tsx +0 -74
  229. package/src/components/form/FormError.tsx +0 -34
  230. package/src/components/form/FormField.tsx +0 -157
  231. package/src/components/form/meta.ts +0 -98
  232. package/src/features/splash-screen/adapters/inbound/SplashScreen.tsx +0 -98
  233. package/src/features/splash-screen/public.ts +0 -2
  234. package/src/features/splash-screen/splashScreenMeta.ts +0 -41
  235. package/src/patterns/form-field/index.ts +0 -1
  236. package/src/patterns/form-field/types.ts +0 -16
  237. package/src/types/splash-screen.ts +0 -18
@@ -1 +0,0 @@
1
- {"version":3,"file":"splashScreenMeta.js","sourceRoot":"","sources":["../../../src/features/splash-screen/splashScreenMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAG5E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,GAAG,0BAA0B,CAAC;IAChD,WAAW,EAAE,6EAA6E;IAC1F,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;SACpB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;SACpB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;SACnB;QACD,eAAe,EAAE;YACf,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,OAAO;SAClB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;SACnB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,eAAe;SAC1B;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;SACtC;KACF;CACmC,CAAC","sourcesContent":["import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';\nimport type { ZoraComponentMeta } from '../../metadata/types';\n\nexport const splashScreenMeta = {\n name: 'SplashScreen',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n description: 'App content splash presentation; does not control the native launch screen.',\n props: {\n title: {\n type: 'string',\n category: 'Content',\n },\n subtitle: {\n type: 'string',\n category: 'Content',\n },\n minHeight: {\n type: 'number',\n category: 'Layout',\n },\n backgroundColor: {\n type: 'color',\n category: 'Style',\n },\n logoSize: {\n type: 'number',\n category: 'Layout',\n },\n logoLabel: {\n type: 'string',\n category: 'Accessibility',\n },\n logoShape: {\n type: 'enum',\n category: 'Style',\n enum: ['circle', 'square', 'rounded'],\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { FormFieldProps } from './types';
3
- export declare const FormField: (props: FormFieldProps) => React.ReactElement | null;
4
- //# sourceMappingURL=FormField.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../src/patterns/form-field/FormField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAiC9C,eAAO,MAAM,SAAS,sDAAqC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/patterns/form-field/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,cAAc,CAAC,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACO;IACf,OAAO,CACL,CAAC,KAAK,CACJ,IAAI,KAAK,CAAC,CACV,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CACb;UAAA,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CACrC;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACxC;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,KAAK,CACT,CAAC,CAED;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Field } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Stack } from '../../features/layout/public';\nimport { Text } from '../../features/typography/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { FormFieldProps } from './types';\n\nfunction FormFieldInner({\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n helperText,\n children,\n ...props\n}: FormFieldProps) {\n return (\n <Field\n {...props}\n helperText={helperText}\n label={\n <Stack gap=\"xs\">\n <Text variant=\"label\" weight=\"semiBold\">\n {label}\n </Text>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n }\n >\n {children}\n </Field>\n );\n}\n\nexport const FormField = withZoraThemeScope(FormFieldInner);\n"]}
@@ -1,2 +0,0 @@
1
- export { FormField } from './FormField';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/form-field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- export { FormField } from './FormField';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/form-field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { FormField } from './FormField';\n"]}
@@ -1,9 +0,0 @@
1
- import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';
2
- import type React from 'react';
3
- import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
4
- export interface FormFieldProps extends ZoraBaseProps, Pick<Omit<SurfaceFieldProps, 'mode' | 'themeId'>, 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'> {
5
- label: React.ReactNode;
6
- description?: React.ReactNode;
7
- helperText?: React.ReactNode;
8
- }
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/form-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,cACf,SACE,aAAa,EACb,IAAI,CACF,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,EAC3C,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAC5E;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/form-field/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface FormFieldProps\n extends\n ZoraBaseProps,\n Pick<\n Omit<SurfaceFieldProps, 'mode' | 'themeId'>,\n 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'\n > {\n label: React.ReactNode;\n description?: React.ReactNode;\n helperText?: React.ReactNode;\n}\n"]}
@@ -1,16 +0,0 @@
1
- import type React from 'react';
2
- import type { BoxProps } from '../features/layout/public';
3
- import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
4
- export type SplashScreenLogoShape = 'circle' | 'square' | 'rounded';
5
- export interface SplashScreenProps extends ZoraBaseProps {
6
- logo?: React.ReactNode;
7
- title?: React.ReactNode;
8
- subtitle?: React.ReactNode;
9
- children?: React.ReactNode;
10
- minHeight?: BoxProps['minHeight'];
11
- backgroundColor?: BoxProps['bg'];
12
- logoSize?: number;
13
- logoLabel?: string;
14
- logoShape?: SplashScreenLogoShape;
15
- }
16
- //# sourceMappingURL=splash-screen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splash-screen.d.ts","sourceRoot":"","sources":["../../src/types/splash-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAClC,eAAe,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=splash-screen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splash-screen.js","sourceRoot":"","sources":["../../src/types/splash-screen.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { BoxProps } from '../features/layout/public';\nimport type { ZoraBaseProps } from '../theme/ZoraBaseProps';\n\nexport type SplashScreenLogoShape = 'circle' | 'square' | 'rounded';\n\nexport interface SplashScreenProps extends ZoraBaseProps {\n logo?: React.ReactNode;\n title?: React.ReactNode;\n subtitle?: React.ReactNode;\n children?: React.ReactNode;\n minHeight?: BoxProps['minHeight'];\n backgroundColor?: BoxProps['bg'];\n logoSize?: number;\n logoLabel?: string;\n logoShape?: SplashScreenLogoShape;\n}\n"]}
@@ -1,74 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Box, Stack } from '../../features/layout/public';
4
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
- import { FormActions } from './FormActions';
6
- import { FormError } from './FormError';
7
- import { FormField } from './FormField';
8
- import type { FormProps } from './types';
9
- import { useFormController } from './useFormController';
10
-
11
- function FormInner<TName extends string = string>({
12
- themeId: _themeId,
13
- mode: _mode,
14
- fields,
15
- values,
16
- onChange,
17
- onSubmit,
18
- errors,
19
- error,
20
- loading = false,
21
- disabled = false,
22
- submitLabel = 'Submit',
23
- actions,
24
- footer,
25
- validateOnChange = false,
26
- testID,
27
- interactionPolicy,
28
- }: FormProps<TName>) {
29
- const controller = useFormController({
30
- fields,
31
- values,
32
- errors,
33
- onChange,
34
- onSubmit,
35
- validateOnChange,
36
- });
37
-
38
- return (
39
- <Stack gap="m" testID={testID}>
40
- <FormError error={error} />
41
- {fields.map((field) => (
42
- <FormField
43
- key={field.name}
44
- disabled={disabled}
45
- error={controller.errors[field.name]}
46
- field={field}
47
- interactionPolicy={interactionPolicy}
48
- loading={loading}
49
- onChange={controller.setFieldValue}
50
- value={values[field.name]}
51
- />
52
- ))}
53
- <FormActions
54
- disabled={disabled}
55
- interactionPolicy={interactionPolicy}
56
- loading={loading}
57
- onSubmit={() => {
58
- if (interactionPolicy === 'passive') return;
59
-
60
- void controller.handleSubmit();
61
- }}
62
- submitLabel={submitLabel}
63
- >
64
- {actions}
65
- </FormActions>
66
- {footer ? <Box>{footer}</Box> : null}
67
- </Stack>
68
- );
69
- }
70
-
71
- /***
72
- * Composes fields and actions into a validated form layout.
73
- */
74
- export const Form = withZoraThemeScope(FormInner);
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Box } from '../../features/layout/public';
4
- import { Text } from '../../features/typography/public';
5
- import { useZoraTheme } from '../../theme/useZoraTheme';
6
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
7
- import type { FormErrorProps } from './types';
8
-
9
- function FormErrorInner({
10
- themeId: _themeId,
11
- mode: _mode,
12
- error,
13
- testID,
14
- interactionPolicy: _interactionPolicy,
15
- }: FormErrorProps) {
16
- const { theme } = useZoraTheme();
17
-
18
- if (!error) {
19
- return null;
20
- }
21
-
22
- return (
23
- <Box borderColor={theme.colors.error} borderWidth={1} p="s" radius="m" testID={testID}>
24
- <Text color="error" variant="bodySmall">
25
- {error}
26
- </Text>
27
- </Box>
28
- );
29
- }
30
-
31
- /***
32
- * Displays a form-level validation or submission error message.
33
- */
34
- export const FormError = withZoraThemeScope(FormErrorInner);
@@ -1,157 +0,0 @@
1
- import { Field } from '@ankhorage/surface';
2
- import React from 'react';
3
-
4
- import { TextInput } from '../../features/form/text-input/public';
5
- import { Stack } from '../../features/layout/public';
6
- import { Text } from '../../features/typography/public';
7
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
8
- import type { FormFieldConfig, FormFieldControlProps, FormFieldProps } from './types';
9
- import { hasRequiredRule } from './validation';
10
-
11
- function isControlFieldProps<TName extends string>(
12
- props: FormFieldProps<TName>,
13
- ): props is FormFieldControlProps<TName> {
14
- return 'field' in props;
15
- }
16
-
17
- function resolveKeyboardType(field: FormFieldConfig) {
18
- if (field.keyboardType) {
19
- return field.keyboardType;
20
- }
21
-
22
- if (field.type === 'email') {
23
- return 'email-address';
24
- }
25
-
26
- if (field.type === 'number' || field.type === 'otp') {
27
- return 'number-pad';
28
- }
29
-
30
- if (field.type === 'tel') {
31
- return 'phone-pad';
32
- }
33
-
34
- if (field.type === 'url') {
35
- return 'url';
36
- }
37
-
38
- return undefined;
39
- }
40
-
41
- function resolveAutoCapitalize(field: FormFieldConfig) {
42
- if (field.autoCapitalize) {
43
- return field.autoCapitalize;
44
- }
45
-
46
- if (['email', 'password', 'url'].includes(field.type ?? 'text')) {
47
- return 'none';
48
- }
49
-
50
- return undefined;
51
- }
52
-
53
- function resolveTextContentType(field: FormFieldConfig) {
54
- if (field.textContentType) {
55
- return field.textContentType;
56
- }
57
-
58
- if (field.type === 'email') {
59
- return 'emailAddress';
60
- }
61
-
62
- if (field.type === 'password') {
63
- return 'password';
64
- }
65
-
66
- if (field.type === 'otp') {
67
- return 'oneTimeCode';
68
- }
69
-
70
- return undefined;
71
- }
72
-
73
- function renderLabel(label: React.ReactNode, description: React.ReactNode | undefined) {
74
- return (
75
- <Stack gap="xs">
76
- <Text variant="label" weight="semiBold">
77
- {label}
78
- </Text>
79
- {description ? (
80
- <Text emphasis="muted" variant="bodySmall">
81
- {description}
82
- </Text>
83
- ) : null}
84
- </Stack>
85
- );
86
- }
87
-
88
- function FormFieldInner<TName extends string = string>(props: FormFieldProps<TName>) {
89
- if (!isControlFieldProps(props)) {
90
- const {
91
- themeId: _themeId,
92
- mode: _mode,
93
- label,
94
- description,
95
- helperText,
96
- children,
97
- interactionPolicy: _interactionPolicy,
98
- ...fieldProps
99
- } = props;
100
-
101
- return (
102
- <Field {...fieldProps} helperText={helperText} label={renderLabel(label, description)}>
103
- {children}
104
- </Field>
105
- );
106
- }
107
-
108
- const {
109
- themeId: _themeId,
110
- mode: _mode,
111
- field,
112
- value,
113
- error,
114
- disabled = false,
115
- loading = false,
116
- onChange,
117
- testID,
118
- interactionPolicy,
119
- } = props;
120
- const fieldDisabled = disabled || loading || field.disabled;
121
- const required = field.required ?? hasRequiredRule(field.rules);
122
-
123
- return (
124
- <Field
125
- disabled={fieldDisabled}
126
- errorText={error}
127
- helperText={field.helperText}
128
- invalid={Boolean(error)}
129
- label={renderLabel(field.label, field.description)}
130
- readOnly={field.readOnly}
131
- required={required}
132
- testID={testID ?? field.testID}
133
- >
134
- <TextInput
135
- accessibilityLabel={typeof field.label === 'string' ? field.label : undefined}
136
- autoCapitalize={resolveAutoCapitalize(field)}
137
- autoComplete={field.autoComplete}
138
- disabled={fieldDisabled}
139
- interactionPolicy={interactionPolicy}
140
- invalid={Boolean(error)}
141
- keyboardType={resolveKeyboardType(field)}
142
- maxLength={field.maxLength}
143
- onChangeText={(nextValue) => onChange(field.name, nextValue)}
144
- placeholder={field.placeholder}
145
- readOnly={field.readOnly}
146
- secureTextEntry={field.secureTextEntry ?? field.type === 'password'}
147
- textContentType={resolveTextContentType(field)}
148
- value={value}
149
- />
150
- </Field>
151
- );
152
- }
153
-
154
- /***
155
- * Connects a controlled form value to a labeled input field with error handling.
156
- */
157
- export const FormField = withZoraThemeScope(FormFieldInner);
@@ -1,98 +0,0 @@
1
- import type { ZoraComponentMeta } from '../../metadata';
2
-
3
- export const formMeta = {
4
- name: 'Form',
5
- category: 'component',
6
- directManifestNode: false,
7
- allowedChildren: [],
8
- note: 'Form orchestration component; not represented as a manifest node in v1.',
9
- events: {
10
- submit: {
11
- label: 'Submit',
12
- eventType: 'form.submit',
13
- description: 'Emitted when the form submits its current values.',
14
- payloadFields: [
15
- {
16
- path: 'payload.values',
17
- type: 'record',
18
- label: 'Values',
19
- description: 'Submitted form values keyed by field name.',
20
- },
21
- ],
22
- },
23
- },
24
- props: {},
25
- } as const satisfies ZoraComponentMeta;
26
-
27
- export const formActionsMeta = {
28
- name: 'FormActions',
29
- category: 'component',
30
- directManifestNode: false,
31
- allowedChildren: [],
32
- note: 'Form helper component; not represented as a manifest node in v1.',
33
- props: {},
34
- } as const satisfies ZoraComponentMeta;
35
-
36
- export const formErrorMeta = {
37
- name: 'FormError',
38
- category: 'component',
39
- directManifestNode: false,
40
- allowedChildren: [],
41
- note: 'Form helper component; not represented as a manifest node in v1.',
42
- props: {},
43
- } as const satisfies ZoraComponentMeta;
44
-
45
- export const formFieldMeta = {
46
- name: 'FormField',
47
- category: 'component',
48
- directManifestNode: true,
49
- allowedChildren: ['TextInput'],
50
- blueprint: {
51
- label: 'Form field',
52
- defaultProps: {
53
- label: 'Label',
54
- },
55
- },
56
- props: {
57
- label: {
58
- type: 'string',
59
- category: 'Content',
60
- label: 'Label',
61
- default: 'Label',
62
- },
63
- description: {
64
- type: 'string',
65
- category: 'Content',
66
- label: 'Description',
67
- },
68
- helperText: {
69
- type: 'string',
70
- category: 'Content',
71
- label: 'Helper text',
72
- },
73
- required: {
74
- type: 'boolean',
75
- category: 'Validation',
76
- label: 'Required',
77
- default: false,
78
- },
79
- invalid: {
80
- type: 'boolean',
81
- category: 'Validation',
82
- label: 'Invalid',
83
- default: false,
84
- },
85
- disabled: {
86
- type: 'boolean',
87
- category: 'State',
88
- label: 'Disabled',
89
- default: false,
90
- },
91
- readOnly: {
92
- type: 'boolean',
93
- category: 'State',
94
- label: 'Read-only',
95
- default: false,
96
- },
97
- },
98
- } as const satisfies ZoraComponentMeta;
@@ -1,98 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Center } from '../../../../foundation';
4
- import { useZoraTheme } from '../../../../theme/useZoraTheme';
5
- import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
6
- import type { SplashScreenLogoShape, SplashScreenProps } from '../../../../types/splash-screen';
7
- import { Box, Stack } from '../../../layout/public';
8
- import { Heading } from '../../../typography/public';
9
- import { Text } from '../../../typography/public';
10
- /***
11
- * Branded launch/loading surface for previews, web fallbacks, and app bootstrap states.
12
- *
13
- * `SplashScreen` is a React-rendered component. It intentionally does not manage
14
- * Expo's native splash screen lifecycle or replace generated `expo-splash-screen`
15
- * configuration.
16
- */
17
- export const SplashScreen = withZoraThemeScope(SplashScreenInner);
18
-
19
- interface PlaceholderLogoProps {
20
- label: string;
21
- shape: SplashScreenLogoShape;
22
- size: number;
23
- }
24
-
25
- function resolveLogoRadius(shape: SplashScreenLogoShape): number {
26
- switch (shape) {
27
- case 'circle':
28
- return 9999;
29
- case 'square':
30
- return 0;
31
- case 'rounded':
32
- default:
33
- return 28;
34
- }
35
- }
36
-
37
- function PlaceholderLogo({ label, shape, size }: PlaceholderLogoProps) {
38
- const { theme } = useZoraTheme();
39
- const radius = resolveLogoRadius(shape);
40
-
41
- return (
42
- <Center
43
- accessibilityLabel={label}
44
- bg={theme.semantics.action.primary.base}
45
- height={size}
46
- width={size}
47
- style={{ borderRadius: radius }}
48
- >
49
- <Text emphasis="inverse" variant="eyebrow" weight="bold">
50
- {label.slice(0, 2).toUpperCase()}
51
- </Text>
52
- </Center>
53
- );
54
- }
55
-
56
- function SplashScreenInner({
57
- themeId: _themeId,
58
- mode: _mode,
59
- logo,
60
- title,
61
- subtitle,
62
- children,
63
- minHeight = '100%',
64
- backgroundColor,
65
- logoSize = 96,
66
- logoLabel = 'ZORA',
67
- logoShape = 'rounded',
68
- testID,
69
- }: SplashScreenProps) {
70
- const { theme } = useZoraTheme();
71
- const background = backgroundColor ?? theme.semantics.neutral.surface;
72
- const renderedLogo = logo ?? (
73
- <PlaceholderLogo label={logoLabel} shape={logoShape} size={logoSize} />
74
- );
75
-
76
- return (
77
- <Center bg={background} minHeight={minHeight} p="xl" testID={testID} width="100%">
78
- <Stack align="center" gap="l" style={{ maxWidth: 360 }}>
79
- {renderedLogo}
80
- {title || subtitle ? (
81
- <Stack align="center" gap="xs">
82
- {title ? (
83
- <Heading align="center" level={1} size="h1">
84
- {title}
85
- </Heading>
86
- ) : null}
87
- {subtitle ? (
88
- <Text align="center" emphasis="muted" variant="bodySmall">
89
- {subtitle}
90
- </Text>
91
- ) : null}
92
- </Stack>
93
- ) : null}
94
- {children ? <Box width="100%">{children}</Box> : null}
95
- </Stack>
96
- </Center>
97
- );
98
- }
@@ -1,2 +0,0 @@
1
- export type { SplashScreenLogoShape, SplashScreenProps } from '../../types/splash-screen';
2
- export { SplashScreen } from './adapters/inbound/SplashScreen';
@@ -1,41 +0,0 @@
1
- import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
2
- import type { ZoraComponentMeta } from '../../metadata/types';
3
-
4
- export const splashScreenMeta = {
5
- name: 'SplashScreen',
6
- category: 'component',
7
- directManifestNode: true,
8
- allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
9
- description: 'App content splash presentation; does not control the native launch screen.',
10
- props: {
11
- title: {
12
- type: 'string',
13
- category: 'Content',
14
- },
15
- subtitle: {
16
- type: 'string',
17
- category: 'Content',
18
- },
19
- minHeight: {
20
- type: 'number',
21
- category: 'Layout',
22
- },
23
- backgroundColor: {
24
- type: 'color',
25
- category: 'Style',
26
- },
27
- logoSize: {
28
- type: 'number',
29
- category: 'Layout',
30
- },
31
- logoLabel: {
32
- type: 'string',
33
- category: 'Accessibility',
34
- },
35
- logoShape: {
36
- type: 'enum',
37
- category: 'Style',
38
- enum: ['circle', 'square', 'rounded'],
39
- },
40
- },
41
- } as const satisfies ZoraComponentMeta;
@@ -1 +0,0 @@
1
- export { FormField } from './FormField';
@@ -1,16 +0,0 @@
1
- import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';
2
- import type React from 'react';
3
-
4
- import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
5
-
6
- export interface FormFieldProps
7
- extends
8
- ZoraBaseProps,
9
- Pick<
10
- Omit<SurfaceFieldProps, 'mode' | 'themeId'>,
11
- 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'
12
- > {
13
- label: React.ReactNode;
14
- description?: React.ReactNode;
15
- helperText?: React.ReactNode;
16
- }
@@ -1,18 +0,0 @@
1
- import type React from 'react';
2
-
3
- import type { BoxProps } from '../features/layout/public';
4
- import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
5
-
6
- export type SplashScreenLogoShape = 'circle' | 'square' | 'rounded';
7
-
8
- export interface SplashScreenProps extends ZoraBaseProps {
9
- logo?: React.ReactNode;
10
- title?: React.ReactNode;
11
- subtitle?: React.ReactNode;
12
- children?: React.ReactNode;
13
- minHeight?: BoxProps['minHeight'];
14
- backgroundColor?: BoxProps['bg'];
15
- logoSize?: number;
16
- logoLabel?: string;
17
- logoShape?: SplashScreenLogoShape;
18
- }