@ankhorage/zora 12.0.0 → 13.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 (272) hide show
  1. package/CHANGELOG.md +16 -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/features/accordion/accordionItemMeta.d.ts +53 -0
  8. package/dist/features/accordion/accordionItemMeta.d.ts.map +1 -0
  9. package/dist/features/accordion/accordionItemMeta.js +45 -0
  10. package/dist/features/accordion/accordionItemMeta.js.map +1 -0
  11. package/dist/features/accordion/accordionMeta.d.ts +36 -0
  12. package/dist/features/accordion/accordionMeta.d.ts.map +1 -0
  13. package/dist/features/accordion/accordionMeta.js +33 -0
  14. package/dist/features/accordion/accordionMeta.js.map +1 -0
  15. package/dist/features/accordion/adapters/inbound/Accordion.d.ts +5 -0
  16. package/dist/features/accordion/adapters/inbound/Accordion.d.ts.map +1 -0
  17. package/dist/features/accordion/adapters/inbound/Accordion.js +41 -0
  18. package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -0
  19. package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts +5 -0
  20. package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts.map +1 -0
  21. package/dist/features/accordion/adapters/inbound/AccordionItem.js +52 -0
  22. package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -0
  23. package/dist/features/accordion/composition/AccordionPresentationContext.d.ts +4 -0
  24. package/dist/features/accordion/composition/AccordionPresentationContext.d.ts.map +1 -0
  25. package/dist/features/accordion/composition/AccordionPresentationContext.js +3 -0
  26. package/dist/features/accordion/composition/AccordionPresentationContext.js.map +1 -0
  27. package/dist/features/accordion/public.d.ts +4 -0
  28. package/dist/features/accordion/public.d.ts.map +1 -0
  29. package/dist/features/accordion/public.js +3 -0
  30. package/dist/features/accordion/public.js.map +1 -0
  31. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthForm.d.ts +3 -3
  32. package/dist/features/auth/adapters/inbound/AuthForm.d.ts.map +1 -0
  33. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthForm.js +2 -2
  34. package/dist/features/auth/adapters/inbound/AuthForm.js.map +1 -0
  35. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.d.ts +2 -2
  36. package/dist/features/auth/adapters/inbound/AuthFormField.d.ts.map +1 -0
  37. package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.js +2 -2
  38. package/dist/features/auth/adapters/inbound/AuthFormField.js.map +1 -0
  39. package/dist/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.d.ts +1 -1
  40. package/dist/features/auth/adapters/inbound/ForgotPasswordForm.d.ts.map +1 -0
  41. package/dist/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.js +5 -5
  42. package/dist/features/auth/adapters/inbound/ForgotPasswordForm.js.map +1 -0
  43. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.d.ts +1 -1
  44. package/dist/features/auth/adapters/inbound/OAuthProviderButton.d.ts.map +1 -0
  45. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.js +3 -3
  46. package/dist/features/auth/adapters/inbound/OAuthProviderButton.js.map +1 -0
  47. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.d.ts +1 -1
  48. package/dist/features/auth/adapters/inbound/OAuthProviderList.d.ts.map +1 -0
  49. package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.js +2 -2
  50. package/dist/features/auth/adapters/inbound/OAuthProviderList.js.map +1 -0
  51. package/dist/{patterns/auth → features/auth/adapters/inbound}/OtpForm.d.ts +1 -1
  52. package/dist/features/auth/adapters/inbound/OtpForm.d.ts.map +1 -0
  53. package/dist/{patterns/auth → features/auth/adapters/inbound}/OtpForm.js +4 -4
  54. package/dist/features/auth/adapters/inbound/OtpForm.js.map +1 -0
  55. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignInForm.d.ts +1 -1
  56. package/dist/features/auth/adapters/inbound/SignInForm.d.ts.map +1 -0
  57. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignInForm.js +5 -5
  58. package/dist/features/auth/adapters/inbound/SignInForm.js.map +1 -0
  59. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.d.ts +1 -1
  60. package/dist/features/auth/adapters/inbound/SignUpForm.d.ts.map +1 -0
  61. package/dist/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.js +3 -3
  62. package/dist/features/auth/adapters/inbound/SignUpForm.js.map +1 -0
  63. package/dist/features/auth/forgotPasswordFormMeta.d.ts +79 -0
  64. package/dist/features/auth/forgotPasswordFormMeta.d.ts.map +1 -0
  65. package/dist/features/auth/forgotPasswordFormMeta.js +48 -0
  66. package/dist/features/auth/forgotPasswordFormMeta.js.map +1 -0
  67. package/dist/features/auth/oauthProviderButtonMeta.d.ts +83 -0
  68. package/dist/features/auth/oauthProviderButtonMeta.d.ts.map +1 -0
  69. package/dist/features/auth/oauthProviderButtonMeta.js +61 -0
  70. package/dist/features/auth/oauthProviderButtonMeta.js.map +1 -0
  71. package/dist/features/auth/oauthProviderListMeta.d.ts +109 -0
  72. package/dist/features/auth/oauthProviderListMeta.d.ts.map +1 -0
  73. package/dist/features/auth/oauthProviderListMeta.js +66 -0
  74. package/dist/features/auth/oauthProviderListMeta.js.map +1 -0
  75. package/dist/features/auth/otpFormMeta.d.ts +89 -0
  76. package/dist/features/auth/otpFormMeta.d.ts.map +1 -0
  77. package/dist/features/auth/otpFormMeta.js +54 -0
  78. package/dist/features/auth/otpFormMeta.js.map +1 -0
  79. package/dist/features/auth/public.d.ts +9 -0
  80. package/dist/features/auth/public.d.ts.map +1 -0
  81. package/dist/features/auth/public.js +8 -0
  82. package/dist/features/auth/public.js.map +1 -0
  83. package/dist/features/auth/signInFormMeta.d.ts +100 -0
  84. package/dist/features/auth/signInFormMeta.d.ts.map +1 -0
  85. package/dist/features/auth/signInFormMeta.js +62 -0
  86. package/dist/features/auth/signInFormMeta.js.map +1 -0
  87. package/dist/features/auth/signUpFormMeta.d.ts +111 -0
  88. package/dist/features/auth/signUpFormMeta.d.ts.map +1 -0
  89. package/dist/features/auth/signUpFormMeta.js +66 -0
  90. package/dist/features/auth/signUpFormMeta.js.map +1 -0
  91. package/dist/{patterns/auth/utils.d.ts → features/auth/utils/authForm.d.ts} +3 -3
  92. package/dist/features/auth/utils/authForm.d.ts.map +1 -0
  93. package/dist/{patterns/auth/utils.js → features/auth/utils/authForm.js} +1 -1
  94. package/dist/features/auth/utils/authForm.js.map +1 -0
  95. package/dist/{patterns/auth → features/auth/utils}/oauthProviders.d.ts +1 -1
  96. package/dist/features/auth/utils/oauthProviders.d.ts.map +1 -0
  97. package/dist/features/auth/utils/oauthProviders.js.map +1 -0
  98. package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
  99. package/dist/features/card/cardMeta.d.ts +1 -1
  100. package/dist/features/card/mediaCardMeta.d.ts +1 -1
  101. package/dist/features/card/postCardMeta.d.ts +1 -1
  102. package/dist/{components/gradient → features/gradient/adapters/inbound}/Gradient.d.ts +1 -1
  103. package/dist/features/gradient/adapters/inbound/Gradient.d.ts.map +1 -0
  104. package/dist/{components/gradient → features/gradient/adapters/inbound}/Gradient.js +2 -2
  105. package/dist/features/gradient/adapters/inbound/Gradient.js.map +1 -0
  106. package/dist/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.d.ts +3 -2
  107. package/dist/features/gradient/adapters/inbound/GradientRendererContext.d.ts.map +1 -0
  108. package/dist/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.js +2 -1
  109. package/dist/features/gradient/adapters/inbound/GradientRendererContext.js.map +1 -0
  110. package/dist/features/gradient/gradientMeta.d.ts +48 -0
  111. package/dist/features/gradient/gradientMeta.d.ts.map +1 -0
  112. package/dist/features/gradient/gradientMeta.js +25 -0
  113. package/dist/features/gradient/gradientMeta.js.map +1 -0
  114. package/dist/features/gradient/public.d.ts +4 -0
  115. package/dist/features/gradient/public.d.ts.map +1 -0
  116. package/dist/features/gradient/public.js +3 -0
  117. package/dist/features/gradient/public.js.map +1 -0
  118. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
  119. package/dist/features/layout/boxMeta.d.ts +1 -1
  120. package/dist/features/layout/containerMeta.d.ts +1 -1
  121. package/dist/features/layout/gridMeta.d.ts +1 -1
  122. package/dist/features/layout/stackMeta.d.ts +1 -1
  123. package/dist/features/list/flatListMeta.d.ts +1 -1
  124. package/dist/features/list/sectionListMeta.d.ts +1 -1
  125. package/dist/features/surface/surfaceMeta.d.ts +1 -1
  126. package/dist/index.d.ts +5 -6
  127. package/dist/index.d.ts.map +1 -1
  128. package/dist/index.js +3 -3
  129. package/dist/index.js.map +1 -1
  130. package/dist/layout/screen/meta.d.ts +1 -1
  131. package/dist/layout/screen-section/meta.d.ts +1 -1
  132. package/dist/metadata/allowedChildren.d.ts +3 -3
  133. package/dist/metadata/allowedChildren.d.ts.map +1 -1
  134. package/dist/metadata/allowedChildren.js +8 -0
  135. package/dist/metadata/allowedChildren.js.map +1 -1
  136. package/dist/metadata/bindableComponentMeta.d.ts +2 -2
  137. package/dist/metadata/componentMeta.d.ts.map +1 -1
  138. package/dist/metadata/componentMeta.js +11 -4
  139. package/dist/metadata/componentMeta.js.map +1 -1
  140. package/dist/patterns/message-bubble/meta.d.ts +1 -1
  141. package/dist/patterns/notice/meta.d.ts +1 -1
  142. package/dist/patterns/panel/meta.d.ts +1 -1
  143. package/dist/patterns/reader/meta.d.ts +2 -2
  144. package/dist/patterns/scanner/meta.d.ts +2 -2
  145. package/dist/registry.d.ts.map +1 -1
  146. package/dist/registry.js +5 -4
  147. package/dist/registry.js.map +1 -1
  148. package/dist/types/accordion.d.ts +23 -0
  149. package/dist/types/accordion.d.ts.map +1 -0
  150. package/dist/types/accordion.js +2 -0
  151. package/dist/types/accordion.js.map +1 -0
  152. package/dist/{patterns/auth/types.d.ts → types/auth.d.ts} +8 -8
  153. package/dist/types/auth.d.ts.map +1 -0
  154. package/dist/types/auth.js +2 -0
  155. package/dist/types/auth.js.map +1 -0
  156. package/dist/{components/gradient/types.d.ts → types/gradient.d.ts} +3 -3
  157. package/dist/types/gradient.d.ts.map +1 -0
  158. package/dist/types/gradient.js +2 -0
  159. package/dist/types/gradient.js.map +1 -0
  160. package/package.json +2 -2
  161. package/src/constants.ts +9 -0
  162. package/src/expo57Migration.test.ts +1 -1
  163. package/src/featureManifest.test.ts +2 -0
  164. package/src/features/accordion/accordionItemMeta.ts +46 -0
  165. package/src/features/accordion/accordionMeta.ts +34 -0
  166. package/src/features/accordion/adapters/inbound/Accordion.tsx +94 -0
  167. package/src/features/accordion/adapters/inbound/AccordionItem.tsx +86 -0
  168. package/src/features/accordion/composition/AccordionPresentationContext.ts +6 -0
  169. package/src/features/accordion/public.ts +9 -0
  170. package/src/{patterns/auth → features/auth/adapters/inbound}/AuthForm.tsx +5 -5
  171. package/src/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.tsx +4 -4
  172. package/src/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.tsx +8 -8
  173. package/src/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.tsx +4 -4
  174. package/src/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.tsx +3 -3
  175. package/src/{patterns/auth → features/auth/adapters/inbound}/OtpForm.tsx +6 -6
  176. package/src/{patterns/auth → features/auth/adapters/inbound}/SignInForm.tsx +8 -8
  177. package/src/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.tsx +5 -5
  178. package/src/features/auth/forgotPasswordFormMeta.ts +49 -0
  179. package/src/features/auth/oauthProviderButtonMeta.ts +62 -0
  180. package/src/features/auth/oauthProviderListMeta.ts +67 -0
  181. package/src/features/auth/otpFormMeta.ts +55 -0
  182. package/src/features/auth/public.test.ts +34 -0
  183. package/src/{patterns/auth/index.ts → features/auth/public.ts} +12 -12
  184. package/src/features/auth/signInFormMeta.ts +63 -0
  185. package/src/features/auth/signUpFormMeta.ts +67 -0
  186. package/src/{patterns/auth/utils.ts → features/auth/utils/authForm.ts} +2 -2
  187. package/src/{patterns/auth → features/auth/utils}/oauthProviders.test.ts +1 -1
  188. package/src/{patterns/auth → features/auth/utils}/oauthProviders.ts +1 -1
  189. package/src/{components/gradient → features/gradient/adapters/inbound}/Gradient.tsx +3 -3
  190. package/src/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.tsx +3 -2
  191. package/src/features/gradient/gradientMeta.ts +26 -0
  192. package/src/features/gradient/public.test.ts +15 -0
  193. package/src/{components/gradient/index.ts → features/gradient/public.ts} +3 -3
  194. package/src/index.ts +49 -42
  195. package/src/metadata/allowedChildren.ts +8 -0
  196. package/src/metadata/componentMeta.test.ts +16 -0
  197. package/src/metadata/componentMeta.ts +11 -11
  198. package/src/registry.ts +12 -11
  199. package/src/showcaseCoverage.test.ts +2 -1
  200. package/src/theme/themeScopeStructure.test.ts +10 -7
  201. package/src/types/accordion.ts +38 -0
  202. package/src/{patterns/auth/types.ts → types/auth.ts} +7 -7
  203. package/src/{components/gradient/types.ts → types/gradient.ts} +2 -2
  204. package/dist/components/gradient/Gradient.d.ts.map +0 -1
  205. package/dist/components/gradient/Gradient.js.map +0 -1
  206. package/dist/components/gradient/GradientRendererContext.d.ts.map +0 -1
  207. package/dist/components/gradient/GradientRendererContext.js.map +0 -1
  208. package/dist/components/gradient/index.d.ts +0 -4
  209. package/dist/components/gradient/index.d.ts.map +0 -1
  210. package/dist/components/gradient/index.js +0 -3
  211. package/dist/components/gradient/index.js.map +0 -1
  212. package/dist/components/gradient/meta.d.ts +0 -9
  213. package/dist/components/gradient/meta.d.ts.map +0 -1
  214. package/dist/components/gradient/meta.js +0 -9
  215. package/dist/components/gradient/meta.js.map +0 -1
  216. package/dist/components/gradient/types.d.ts.map +0 -1
  217. package/dist/components/gradient/types.js +0 -2
  218. package/dist/components/gradient/types.js.map +0 -1
  219. package/dist/patterns/auth/AuthForm.d.ts.map +0 -1
  220. package/dist/patterns/auth/AuthForm.js.map +0 -1
  221. package/dist/patterns/auth/AuthFormField.d.ts.map +0 -1
  222. package/dist/patterns/auth/AuthFormField.js.map +0 -1
  223. package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +0 -1
  224. package/dist/patterns/auth/ForgotPasswordForm.js.map +0 -1
  225. package/dist/patterns/auth/OAuthProviderButton.d.ts.map +0 -1
  226. package/dist/patterns/auth/OAuthProviderButton.js.map +0 -1
  227. package/dist/patterns/auth/OAuthProviderList.d.ts.map +0 -1
  228. package/dist/patterns/auth/OAuthProviderList.js.map +0 -1
  229. package/dist/patterns/auth/OtpForm.d.ts.map +0 -1
  230. package/dist/patterns/auth/OtpForm.js.map +0 -1
  231. package/dist/patterns/auth/SignInForm.d.ts.map +0 -1
  232. package/dist/patterns/auth/SignInForm.js.map +0 -1
  233. package/dist/patterns/auth/SignUpForm.d.ts.map +0 -1
  234. package/dist/patterns/auth/SignUpForm.js.map +0 -1
  235. package/dist/patterns/auth/index.d.ts +0 -9
  236. package/dist/patterns/auth/index.d.ts.map +0 -1
  237. package/dist/patterns/auth/index.js +0 -8
  238. package/dist/patterns/auth/index.js.map +0 -1
  239. package/dist/patterns/auth/meta.d.ts +0 -49
  240. package/dist/patterns/auth/meta.d.ts.map +0 -1
  241. package/dist/patterns/auth/meta.js +0 -50
  242. package/dist/patterns/auth/meta.js.map +0 -1
  243. package/dist/patterns/auth/oauthProviders.d.ts.map +0 -1
  244. package/dist/patterns/auth/oauthProviders.js.map +0 -1
  245. package/dist/patterns/auth/types.d.ts.map +0 -1
  246. package/dist/patterns/auth/types.js +0 -2
  247. package/dist/patterns/auth/types.js.map +0 -1
  248. package/dist/patterns/auth/utils.d.ts.map +0 -1
  249. package/dist/patterns/auth/utils.js.map +0 -1
  250. package/dist/patterns/disclosure-section/DisclosureSection.d.ts +0 -9
  251. package/dist/patterns/disclosure-section/DisclosureSection.d.ts.map +0 -1
  252. package/dist/patterns/disclosure-section/DisclosureSection.js +0 -86
  253. package/dist/patterns/disclosure-section/DisclosureSection.js.map +0 -1
  254. package/dist/patterns/disclosure-section/index.d.ts +0 -3
  255. package/dist/patterns/disclosure-section/index.d.ts.map +0 -1
  256. package/dist/patterns/disclosure-section/index.js +0 -3
  257. package/dist/patterns/disclosure-section/index.js.map +0 -1
  258. package/dist/patterns/disclosure-section/meta.d.ts +0 -9
  259. package/dist/patterns/disclosure-section/meta.d.ts.map +0 -1
  260. package/dist/patterns/disclosure-section/meta.js +0 -9
  261. package/dist/patterns/disclosure-section/meta.js.map +0 -1
  262. package/dist/patterns/disclosure-section/types.d.ts +0 -15
  263. package/dist/patterns/disclosure-section/types.d.ts.map +0 -1
  264. package/dist/patterns/disclosure-section/types.js +0 -2
  265. package/dist/patterns/disclosure-section/types.js.map +0 -1
  266. package/src/components/gradient/meta.ts +0 -10
  267. package/src/patterns/auth/meta.ts +0 -57
  268. package/src/patterns/disclosure-section/DisclosureSection.tsx +0 -130
  269. package/src/patterns/disclosure-section/index.ts +0 -2
  270. package/src/patterns/disclosure-section/meta.ts +0 -10
  271. package/src/patterns/disclosure-section/types.ts +0 -16
  272. /package/dist/{patterns/auth → features/auth/utils}/oauthProviders.js +0 -0
@@ -0,0 +1,86 @@
1
+ import {
2
+ AccordionContent as SurfaceAccordionContent,
3
+ AccordionItem as SurfaceAccordionItem,
4
+ AccordionTrigger as SurfaceAccordionTrigger,
5
+ } from '@ankhorage/surface';
6
+ import React from 'react';
7
+ import type { ViewStyle } from 'react-native';
8
+
9
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
10
+ import type { AccordionItemProps } from '../../../../types/accordion';
11
+ import { Icon } from '../../../icon/public';
12
+ import { Box, Divider, Stack } from '../../../layout/public';
13
+ import { Heading, Text } from '../../../typography/public';
14
+ import { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';
15
+
16
+ /*** Renders one opinionated ZORA accordion item over Surface trigger/content primitives. */
17
+ export const AccordionItem = withZoraThemeScope(AccordionItemInner);
18
+
19
+ const triggerStyle: ViewStyle = { flex: 1 };
20
+
21
+ /*** Composes the item header, optional actions, expanded content, and separator. */
22
+ function AccordionItemInner({
23
+ themeId: _themeId,
24
+ mode: _mode,
25
+ actions,
26
+ children,
27
+ description,
28
+ disabled,
29
+ icon,
30
+ interactionPolicy,
31
+ testID,
32
+ title,
33
+ value,
34
+ ...surfaceItemProps
35
+ }: AccordionItemProps) {
36
+ const presentation = React.useContext(AccordionPresentationContext);
37
+ if (!presentation) {
38
+ throw new Error('AccordionItem must be rendered inside Accordion.');
39
+ }
40
+
41
+ const open = presentation.openValues.includes(value);
42
+
43
+ return (
44
+ <SurfaceAccordionItem
45
+ {...surfaceItemProps}
46
+ disabled={disabled}
47
+ interactionPolicy={interactionPolicy}
48
+ testID={testID}
49
+ value={value}
50
+ >
51
+ <Stack gap="none">
52
+ <Stack align="center" direction="row" gap="s">
53
+ <Box flex={1}>
54
+ <SurfaceAccordionTrigger interactionPolicy={interactionPolicy} style={triggerStyle}>
55
+ <Box px="m" py="m">
56
+ <Stack align="center" direction="row" gap="m">
57
+ {icon ? <Icon {...icon} /> : null}
58
+ <Box flex={1}>
59
+ <Stack gap="xs">
60
+ <Heading level={4}>{title}</Heading>
61
+ {description ? (
62
+ <Text emphasis="muted" variant="bodySmall">
63
+ {description}
64
+ </Text>
65
+ ) : null}
66
+ </Stack>
67
+ </Box>
68
+ <Icon name={open ? 'chevron-up-outline' : 'chevron-down-outline'} size="m" />
69
+ </Stack>
70
+ </Box>
71
+ </SurfaceAccordionTrigger>
72
+ </Box>
73
+ {actions ? <Box pr="m">{actions}</Box> : null}
74
+ </Stack>
75
+
76
+ <SurfaceAccordionContent>
77
+ <Box px="m" pb="m">
78
+ <Stack gap="m">{children}</Stack>
79
+ </Box>
80
+ </SurfaceAccordionContent>
81
+
82
+ <Divider />
83
+ </Stack>
84
+ </SurfaceAccordionItem>
85
+ );
86
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+
3
+ import type { AccordionPresentationContextValue } from '../../../types/accordion';
4
+
5
+ export const AccordionPresentationContext =
6
+ React.createContext<AccordionPresentationContextValue | null>(null);
@@ -0,0 +1,9 @@
1
+ export type {
2
+ AccordionItemProps,
3
+ AccordionMode,
4
+ AccordionMultipleProps,
5
+ AccordionProps,
6
+ AccordionSingleProps,
7
+ } from '../../types/accordion';
8
+ export { Accordion } from './adapters/inbound/Accordion';
9
+ export { AccordionItem } from './adapters/inbound/AccordionItem';
@@ -1,16 +1,16 @@
1
1
  import React from 'react';
2
2
 
3
- import { FormActions, FormError, useFormController } from '../../features/form/public';
4
- import { Stack } from '../../features/layout/public';
5
- import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
6
- import type { FormErrors, FormFieldConfig, FormValues } from '../../types/form';
3
+ import type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';
4
+ import type { FormErrors, FormFieldConfig, FormValues } from '../../../../types/form';
5
+ import { FormActions, FormError, useFormController } from '../../../form/public';
6
+ import { Stack } from '../../../layout/public';
7
7
  import { AuthFormField } from './AuthFormField';
8
8
 
9
9
  interface AuthFormProps<TName extends string> {
10
10
  fields: readonly FormFieldConfig<TName>[];
11
11
  values: FormValues<TName>;
12
12
  onChange: (values: FormValues<TName>) => void;
13
- onSubmit: (values: FormValues<TName>) => void | Promise<void>;
13
+ onSubmit?: (values: FormValues<TName>) => void | Promise<void>;
14
14
  errors?: FormErrors<TName>;
15
15
  error?: React.ReactNode;
16
16
  loading?: boolean;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
- import { FormField, hasRequiredRule } from '../../features/form/public';
4
- import { TextInput } from '../../features/form/text-input/public';
5
- import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
6
- import type { FormFieldConfig, FormFieldValue } from '../../types/form';
3
+ import type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';
4
+ import type { FormFieldConfig, FormFieldValue } from '../../../../types/form';
5
+ import { FormField, hasRequiredRule } from '../../../form/public';
6
+ import { TextInput } from '../../../form/text-input/public';
7
7
 
8
8
  interface AuthFormFieldProps<TName extends string> {
9
9
  field: FormFieldConfig<TName>;
@@ -1,18 +1,18 @@
1
1
  import React from 'react';
2
2
 
3
- import { Button } from '../../features/button/public';
4
- import { Stack } from '../../features/layout/public';
5
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
- import type { FormFieldConfig, FormValues } from '../../types/form';
7
- import { AuthForm } from './AuthForm';
8
- import type { ForgotPasswordFormProps } from './types';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import type { ForgotPasswordFormProps } from '../../../../types/auth';
5
+ import type { FormFieldConfig, FormValues } from '../../../../types/form';
6
+ import { Button } from '../../../button/public';
7
+ import { Stack } from '../../../layout/public';
9
8
  import {
10
9
  defaultIdentifiers,
11
10
  normalizeIdentifierKind,
12
11
  resolveIdentifierLabel,
13
12
  resolveIdentifierRules,
14
13
  resolveIdentifierType,
15
- } from './utils';
14
+ } from '../../utils/authForm';
15
+ import { AuthForm } from './AuthForm';
16
16
 
17
17
  type ForgotPasswordFieldName = 'identifier';
18
18
 
@@ -49,7 +49,7 @@ function ForgotPasswordFormInner({
49
49
 
50
50
  const handleSubmit = React.useCallback(
51
51
  (formValues: FormValues<ForgotPasswordFieldName>) =>
52
- onSubmit({
52
+ onSubmit?.({
53
53
  identifier: formValues.identifier.trim(),
54
54
  identifierKind: normalizeIdentifierKind(formValues.identifier, identifiers),
55
55
  }),
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
- import { Button } from '../../features/button/public';
4
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
- import { resolveOAuthProviderIcon, resolveOAuthProviderLabel } from './oauthProviders';
6
- import type { OAuthProviderButtonProps } from './types';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import type { OAuthProviderButtonProps } from '../../../../types/auth';
5
+ import { Button } from '../../../button/public';
6
+ import { resolveOAuthProviderIcon, resolveOAuthProviderLabel } from '../../utils/oauthProviders';
7
7
 
8
8
  function OAuthProviderButtonInner({
9
9
  themeId: _themeId,
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
- import { Stack } from '../../features/layout/public';
4
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import type { OAuthProviderListProps } from '../../../../types/auth';
5
+ import { Stack } from '../../../layout/public';
5
6
  import { OAuthProviderButton } from './OAuthProviderButton';
6
- import type { OAuthProviderListProps } from './types';
7
7
 
8
8
  function OAuthProviderListInner({
9
9
  themeId: _themeId,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
 
3
- import { Button } from '../../features/button/public';
4
- import { Stack } from '../../features/layout/public';
5
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
- import type { FormFieldConfig, FormValues } from '../../types/form';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import type { OtpFormProps } from '../../../../types/auth';
5
+ import type { FormFieldConfig, FormValues } from '../../../../types/form';
6
+ import { Button } from '../../../button/public';
7
+ import { Stack } from '../../../layout/public';
7
8
  import { AuthForm } from './AuthForm';
8
- import type { OtpFormProps } from './types';
9
9
 
10
10
  type OtpFieldName = 'otp';
11
11
 
@@ -45,7 +45,7 @@ function OtpFormInner({
45
45
 
46
46
  const handleSubmit = React.useCallback(
47
47
  (formValues: FormValues<OtpFieldName>) =>
48
- onSubmit({
48
+ onSubmit?.({
49
49
  otp: formValues.otp.trim(),
50
50
  }),
51
51
  [onSubmit],
@@ -1,18 +1,18 @@
1
1
  import React from 'react';
2
2
 
3
- import { Button } from '../../features/button/public';
4
- import { Stack } from '../../features/layout/public';
5
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
- import type { FormFieldConfig, FormValues } from '../../types/form';
7
- import { AuthForm } from './AuthForm';
8
- import type { SignInFormProps } from './types';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import type { SignInFormProps } from '../../../../types/auth';
5
+ import type { FormFieldConfig, FormValues } from '../../../../types/form';
6
+ import { Button } from '../../../button/public';
7
+ import { Stack } from '../../../layout/public';
9
8
  import {
10
9
  defaultIdentifiers,
11
10
  normalizeIdentifierKind,
12
11
  resolveIdentifierLabel,
13
12
  resolveIdentifierRules,
14
13
  resolveIdentifierType,
15
- } from './utils';
14
+ } from '../../utils/authForm';
15
+ import { AuthForm } from './AuthForm';
16
16
 
17
17
  type SignInFieldName = 'identifier' | 'secret';
18
18
 
@@ -60,7 +60,7 @@ function SignInFormInner({
60
60
 
61
61
  const handleSubmit = React.useCallback(
62
62
  (formValues: FormValues<SignInFieldName>) =>
63
- onSubmit({
63
+ onSubmit?.({
64
64
  identifier: formValues.identifier.trim(),
65
65
  identifierKind: normalizeIdentifierKind(formValues.identifier, identifiers),
66
66
  secret: formValues.secret,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
 
3
- import { Button } from '../../features/button/public';
4
- import { Stack } from '../../features/layout/public';
5
- import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
- import type { FormFieldConfig, FormValues } from '../../types/form';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import type { SignUpFormProps } from '../../../../types/auth';
5
+ import type { FormFieldConfig, FormValues } from '../../../../types/form';
6
+ import { Button } from '../../../button/public';
7
+ import { Stack } from '../../../layout/public';
7
8
  import { AuthForm } from './AuthForm';
8
- import type { SignUpFormProps } from './types';
9
9
 
10
10
  const defaultSignUpFields = [
11
11
  {
@@ -0,0 +1,49 @@
1
+ import type { ZoraComponentMeta } from '../../metadata';
2
+
3
+ export const forgotPasswordFormMeta = {
4
+ name: 'ForgotPasswordForm',
5
+ category: 'pattern',
6
+ description: 'Collects an account identifier to start password recovery.',
7
+ directManifestNode: true,
8
+ allowedChildren: [],
9
+ blueprint: {
10
+ label: 'Forgot password form',
11
+ defaultProps: {
12
+ identifiers: ['email'],
13
+ identifierLabel: 'Email',
14
+ signInLabel: 'Sign in',
15
+ submitLabel: 'Send code',
16
+ loading: false,
17
+ disabled: false,
18
+ },
19
+ },
20
+ events: {
21
+ submit: {
22
+ label: 'Submit',
23
+ eventType: 'forgotPasswordForm.submit',
24
+ payloadFields: [
25
+ { path: 'identifier', type: 'string', label: 'Identifier' },
26
+ { path: 'identifierKind', type: 'string', label: 'Identifier kind' },
27
+ ],
28
+ },
29
+ signIn: {
30
+ label: 'Sign in',
31
+ eventType: 'forgotPasswordForm.signIn',
32
+ payloadFields: [],
33
+ },
34
+ },
35
+ props: {
36
+ identifiers: {
37
+ type: 'array',
38
+ category: 'Authentication',
39
+ label: 'Identifiers',
40
+ default: ['email'],
41
+ },
42
+ identifierLabel: { type: 'string', category: 'Content', label: 'Identifier label' },
43
+ signInLabel: { type: 'string', category: 'Content', label: 'Sign-in label' },
44
+ submitLabel: { type: 'string', category: 'Content', label: 'Submit label' },
45
+ error: { type: 'string', category: 'State', label: 'Error' },
46
+ loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },
47
+ disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
48
+ },
49
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,62 @@
1
+ import { ZORA_COLORS } from '../../internal/colorModel';
2
+ import type { ZoraComponentMeta } from '../../metadata';
3
+
4
+ export const oauthProviderButtonMeta = {
5
+ name: 'OAuthProviderButton',
6
+ category: 'pattern',
7
+ description: 'Renders a provider-branded OAuth action button.',
8
+ directManifestNode: true,
9
+ allowedChildren: [],
10
+ blueprint: {
11
+ label: 'OAuth provider button',
12
+ defaultProps: {
13
+ providerId: 'google',
14
+ fullWidth: true,
15
+ size: 'l',
16
+ variant: 'outline',
17
+ color: 'neutral',
18
+ loading: false,
19
+ disabled: false,
20
+ },
21
+ },
22
+ events: {
23
+ press: {
24
+ label: 'Press',
25
+ eventType: 'oauthProviderButton.press',
26
+ payloadFields: [{ path: 'providerId', type: 'string', label: 'Provider ID' }],
27
+ },
28
+ },
29
+ props: {
30
+ providerId: {
31
+ type: 'string',
32
+ category: 'Authentication',
33
+ label: 'Provider ID',
34
+ default: 'google',
35
+ },
36
+ label: { type: 'string', category: 'Content', label: 'Label' },
37
+ disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
38
+ loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },
39
+ fullWidth: { type: 'boolean', category: 'Layout', label: 'Full width', default: true },
40
+ size: {
41
+ type: 'enum',
42
+ category: 'Style',
43
+ label: 'Size',
44
+ enum: ['s', 'm', 'l'],
45
+ default: 'l',
46
+ },
47
+ variant: {
48
+ type: 'enum',
49
+ category: 'Style',
50
+ label: 'Variant',
51
+ enum: ['solid', 'outline', 'ghost', 'soft'],
52
+ default: 'outline',
53
+ },
54
+ color: {
55
+ type: 'enum',
56
+ category: 'Style',
57
+ label: 'Color',
58
+ enum: [...ZORA_COLORS],
59
+ default: 'neutral',
60
+ },
61
+ },
62
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,67 @@
1
+ import { ZORA_COLORS } from '../../internal/colorModel';
2
+ import type { ZoraComponentMeta } from '../../metadata';
3
+
4
+ export const oauthProviderListMeta = {
5
+ name: 'OAuthProviderList',
6
+ category: 'pattern',
7
+ description: 'Renders a configurable group of OAuth provider actions.',
8
+ directManifestNode: true,
9
+ allowedChildren: [],
10
+ blueprint: {
11
+ label: 'OAuth provider list',
12
+ defaultProps: {
13
+ providers: [{ id: 'google', label: 'Continue with Google' }],
14
+ layout: 'stack',
15
+ loading: false,
16
+ disabled: false,
17
+ },
18
+ },
19
+ events: {
20
+ providerPress: {
21
+ label: 'Provider press',
22
+ eventType: 'oauthProviderList.providerPress',
23
+ payloadFields: [{ path: 'providerId', type: 'string', label: 'Provider ID' }],
24
+ },
25
+ },
26
+ props: {
27
+ providers: {
28
+ type: 'array',
29
+ category: 'Authentication',
30
+ label: 'Providers',
31
+ itemSchema: [
32
+ { key: 'id', schema: { type: 'string', category: 'Identity', label: 'Provider ID' } },
33
+ { key: 'label', schema: { type: 'string', category: 'Content', label: 'Label' } },
34
+ { key: 'disabled', schema: { type: 'boolean', category: 'State', label: 'Disabled' } },
35
+ { key: 'loading', schema: { type: 'boolean', category: 'State', label: 'Loading' } },
36
+ ],
37
+ },
38
+ disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
39
+ loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },
40
+ fullWidth: { type: 'boolean', category: 'Layout', label: 'Full width' },
41
+ layout: {
42
+ type: 'enum',
43
+ category: 'Layout',
44
+ label: 'Layout',
45
+ enum: ['stack', 'inline'],
46
+ default: 'stack',
47
+ },
48
+ size: {
49
+ type: 'enum',
50
+ category: 'Style',
51
+ label: 'Size',
52
+ enum: ['s', 'm', 'l'],
53
+ },
54
+ variant: {
55
+ type: 'enum',
56
+ category: 'Style',
57
+ label: 'Variant',
58
+ enum: ['solid', 'outline', 'ghost', 'soft'],
59
+ },
60
+ color: {
61
+ type: 'enum',
62
+ category: 'Style',
63
+ label: 'Color',
64
+ enum: [...ZORA_COLORS],
65
+ },
66
+ },
67
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,55 @@
1
+ import type { ZoraComponentMeta } from '../../metadata';
2
+
3
+ export const otpFormMeta = {
4
+ name: 'OtpForm',
5
+ category: 'pattern',
6
+ description: 'Collects and verifies a one-time passcode with an optional resend action.',
7
+ directManifestNode: true,
8
+ allowedChildren: [],
9
+ blueprint: {
10
+ label: 'OTP form',
11
+ defaultProps: {
12
+ length: 6,
13
+ otpLabel: 'Code',
14
+ resendLabel: 'Resend code',
15
+ submitLabel: 'Verify code',
16
+ resendDisabled: false,
17
+ resendLoading: false,
18
+ loading: false,
19
+ disabled: false,
20
+ },
21
+ },
22
+ events: {
23
+ submit: {
24
+ label: 'Submit',
25
+ eventType: 'otpForm.submit',
26
+ payloadFields: [{ path: 'otp', type: 'string', label: 'One-time passcode' }],
27
+ },
28
+ resend: {
29
+ label: 'Resend',
30
+ eventType: 'otpForm.resend',
31
+ payloadFields: [],
32
+ },
33
+ },
34
+ props: {
35
+ length: { type: 'number', category: 'Validation', label: 'Code length', default: 6 },
36
+ otpLabel: { type: 'string', category: 'Content', label: 'Code label' },
37
+ resendLabel: { type: 'string', category: 'Content', label: 'Resend label' },
38
+ submitLabel: { type: 'string', category: 'Content', label: 'Submit label' },
39
+ error: { type: 'string', category: 'State', label: 'Error' },
40
+ resendDisabled: {
41
+ type: 'boolean',
42
+ category: 'State',
43
+ label: 'Resend disabled',
44
+ default: false,
45
+ },
46
+ resendLoading: {
47
+ type: 'boolean',
48
+ category: 'State',
49
+ label: 'Resend loading',
50
+ default: false,
51
+ },
52
+ loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },
53
+ disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
54
+ },
55
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,34 @@
1
+ import { expect, test } from 'bun:test';
2
+
3
+ import { ZORA_COMPONENT_META } from '../../metadata/componentMeta';
4
+
5
+ const AUTH_MANIFEST_ELEMENTS = [
6
+ 'ForgotPasswordForm',
7
+ 'OAuthProviderButton',
8
+ 'OAuthProviderList',
9
+ 'OtpForm',
10
+ 'SignInForm',
11
+ 'SignUpForm',
12
+ ] as const;
13
+ const authMetaByName = new Map(Object.entries(ZORA_COMPONENT_META));
14
+
15
+ test('auth solutions are direct manifest leaf nodes with authoring schemas', () => {
16
+ for (const name of AUTH_MANIFEST_ELEMENTS) {
17
+ const meta = authMetaByName.get(name);
18
+ expect(meta?.directManifestNode, name).toBe(true);
19
+ expect(meta?.allowedChildren, name).toEqual([]);
20
+ expect(Object.keys(meta?.props ?? {}).length, name).toBeGreaterThan(0);
21
+ }
22
+ });
23
+
24
+ test('auth solution events expose their actionable boundaries', () => {
25
+ expect(ZORA_COMPONENT_META.SignInForm?.events?.submit?.payloadFields).toContainEqual({
26
+ path: 'secret',
27
+ type: 'string',
28
+ label: 'Secret',
29
+ });
30
+ expect(ZORA_COMPONENT_META.OtpForm?.events?.resend?.eventType).toBe('otpForm.resend');
31
+ expect(ZORA_COMPONENT_META.OAuthProviderList?.events?.providerPress?.payloadFields).toEqual([
32
+ { path: 'providerId', type: 'string', label: 'Provider ID' },
33
+ ]);
34
+ });
@@ -1,14 +1,3 @@
1
- export { ForgotPasswordForm } from './ForgotPasswordForm';
2
- export { OAuthProviderButton } from './OAuthProviderButton';
3
- export { OAuthProviderList } from './OAuthProviderList';
4
- export {
5
- DEFAULT_OAUTH_PROVIDER_ICONS,
6
- resolveOAuthProviderIcon,
7
- resolveOAuthProviderLabel,
8
- } from './oauthProviders';
9
- export { OtpForm } from './OtpForm';
10
- export { SignInForm } from './SignInForm';
11
- export { SignUpForm } from './SignUpForm';
12
1
  export type {
13
2
  AuthFormBaseProps,
14
3
  AuthIdentifierKind,
@@ -26,4 +15,15 @@ export type {
26
15
  SignUpFormField,
27
16
  SignUpFormProps,
28
17
  SignUpFormValues,
29
- } from './types';
18
+ } from '../../types/auth';
19
+ export { ForgotPasswordForm } from './adapters/inbound/ForgotPasswordForm';
20
+ export { OAuthProviderButton } from './adapters/inbound/OAuthProviderButton';
21
+ export { OAuthProviderList } from './adapters/inbound/OAuthProviderList';
22
+ export { OtpForm } from './adapters/inbound/OtpForm';
23
+ export { SignInForm } from './adapters/inbound/SignInForm';
24
+ export { SignUpForm } from './adapters/inbound/SignUpForm';
25
+ export {
26
+ DEFAULT_OAUTH_PROVIDER_ICONS,
27
+ resolveOAuthProviderIcon,
28
+ resolveOAuthProviderLabel,
29
+ } from './utils/oauthProviders';
@@ -0,0 +1,63 @@
1
+ import type { ZoraComponentMeta } from '../../metadata';
2
+
3
+ export const signInFormMeta = {
4
+ name: 'SignInForm',
5
+ category: 'pattern',
6
+ description: 'Collects an account identifier and secret for sign-in.',
7
+ directManifestNode: true,
8
+ allowedChildren: [],
9
+ blueprint: {
10
+ label: 'Sign-in form',
11
+ defaultProps: {
12
+ identifiers: ['email'],
13
+ identifierLabel: 'Email',
14
+ secretLabel: 'Password',
15
+ forgotPasswordLabel: 'Forgot password',
16
+ signUpLabel: 'Sign up',
17
+ submitLabel: 'Sign in',
18
+ loading: false,
19
+ disabled: false,
20
+ },
21
+ },
22
+ events: {
23
+ submit: {
24
+ label: 'Submit',
25
+ eventType: 'signInForm.submit',
26
+ payloadFields: [
27
+ { path: 'identifier', type: 'string', label: 'Identifier' },
28
+ { path: 'identifierKind', type: 'string', label: 'Identifier kind' },
29
+ { path: 'secret', type: 'string', label: 'Secret' },
30
+ ],
31
+ },
32
+ forgotPassword: {
33
+ label: 'Forgot password',
34
+ eventType: 'signInForm.forgotPassword',
35
+ payloadFields: [],
36
+ },
37
+ signUp: {
38
+ label: 'Sign up',
39
+ eventType: 'signInForm.signUp',
40
+ payloadFields: [],
41
+ },
42
+ },
43
+ props: {
44
+ identifiers: {
45
+ type: 'array',
46
+ category: 'Authentication',
47
+ label: 'Identifiers',
48
+ default: ['email'],
49
+ },
50
+ identifierLabel: { type: 'string', category: 'Content', label: 'Identifier label' },
51
+ secretLabel: { type: 'string', category: 'Content', label: 'Secret label' },
52
+ forgotPasswordLabel: {
53
+ type: 'string',
54
+ category: 'Content',
55
+ label: 'Forgot-password label',
56
+ },
57
+ signUpLabel: { type: 'string', category: 'Content', label: 'Sign-up label' },
58
+ submitLabel: { type: 'string', category: 'Content', label: 'Submit label' },
59
+ error: { type: 'string', category: 'State', label: 'Error' },
60
+ loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },
61
+ disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
62
+ },
63
+ } as const satisfies ZoraComponentMeta;