@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.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +53 -0
- package/dist/features/accordion/accordionItemMeta.d.ts.map +1 -0
- package/dist/features/accordion/accordionItemMeta.js +45 -0
- package/dist/features/accordion/accordionItemMeta.js.map +1 -0
- package/dist/features/accordion/accordionMeta.d.ts +36 -0
- package/dist/features/accordion/accordionMeta.d.ts.map +1 -0
- package/dist/features/accordion/accordionMeta.js +33 -0
- package/dist/features/accordion/accordionMeta.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js +41 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js +52 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -0
- package/dist/features/accordion/composition/AccordionPresentationContext.d.ts +4 -0
- package/dist/features/accordion/composition/AccordionPresentationContext.d.ts.map +1 -0
- package/dist/features/accordion/composition/AccordionPresentationContext.js +3 -0
- package/dist/features/accordion/composition/AccordionPresentationContext.js.map +1 -0
- package/dist/features/accordion/public.d.ts +4 -0
- package/dist/features/accordion/public.d.ts.map +1 -0
- package/dist/features/accordion/public.js +3 -0
- package/dist/features/accordion/public.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthForm.d.ts +3 -3
- package/dist/features/auth/adapters/inbound/AuthForm.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthForm.js +2 -2
- package/dist/features/auth/adapters/inbound/AuthForm.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.d.ts +2 -2
- package/dist/features/auth/adapters/inbound/AuthFormField.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.js +2 -2
- package/dist/features/auth/adapters/inbound/AuthFormField.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.d.ts +1 -1
- package/dist/features/auth/adapters/inbound/ForgotPasswordForm.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.js +5 -5
- package/dist/features/auth/adapters/inbound/ForgotPasswordForm.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.d.ts +1 -1
- package/dist/features/auth/adapters/inbound/OAuthProviderButton.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.js +3 -3
- package/dist/features/auth/adapters/inbound/OAuthProviderButton.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.d.ts +1 -1
- package/dist/features/auth/adapters/inbound/OAuthProviderList.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.js +2 -2
- package/dist/features/auth/adapters/inbound/OAuthProviderList.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/OtpForm.d.ts +1 -1
- package/dist/features/auth/adapters/inbound/OtpForm.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/OtpForm.js +4 -4
- package/dist/features/auth/adapters/inbound/OtpForm.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/SignInForm.d.ts +1 -1
- package/dist/features/auth/adapters/inbound/SignInForm.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/SignInForm.js +5 -5
- package/dist/features/auth/adapters/inbound/SignInForm.js.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.d.ts +1 -1
- package/dist/features/auth/adapters/inbound/SignUpForm.d.ts.map +1 -0
- package/dist/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.js +3 -3
- package/dist/features/auth/adapters/inbound/SignUpForm.js.map +1 -0
- package/dist/features/auth/forgotPasswordFormMeta.d.ts +79 -0
- package/dist/features/auth/forgotPasswordFormMeta.d.ts.map +1 -0
- package/dist/features/auth/forgotPasswordFormMeta.js +48 -0
- package/dist/features/auth/forgotPasswordFormMeta.js.map +1 -0
- package/dist/features/auth/oauthProviderButtonMeta.d.ts +83 -0
- package/dist/features/auth/oauthProviderButtonMeta.d.ts.map +1 -0
- package/dist/features/auth/oauthProviderButtonMeta.js +61 -0
- package/dist/features/auth/oauthProviderButtonMeta.js.map +1 -0
- package/dist/features/auth/oauthProviderListMeta.d.ts +109 -0
- package/dist/features/auth/oauthProviderListMeta.d.ts.map +1 -0
- package/dist/features/auth/oauthProviderListMeta.js +66 -0
- package/dist/features/auth/oauthProviderListMeta.js.map +1 -0
- package/dist/features/auth/otpFormMeta.d.ts +89 -0
- package/dist/features/auth/otpFormMeta.d.ts.map +1 -0
- package/dist/features/auth/otpFormMeta.js +54 -0
- package/dist/features/auth/otpFormMeta.js.map +1 -0
- package/dist/features/auth/public.d.ts +9 -0
- package/dist/features/auth/public.d.ts.map +1 -0
- package/dist/features/auth/public.js +8 -0
- package/dist/features/auth/public.js.map +1 -0
- package/dist/features/auth/signInFormMeta.d.ts +100 -0
- package/dist/features/auth/signInFormMeta.d.ts.map +1 -0
- package/dist/features/auth/signInFormMeta.js +62 -0
- package/dist/features/auth/signInFormMeta.js.map +1 -0
- package/dist/features/auth/signUpFormMeta.d.ts +111 -0
- package/dist/features/auth/signUpFormMeta.d.ts.map +1 -0
- package/dist/features/auth/signUpFormMeta.js +66 -0
- package/dist/features/auth/signUpFormMeta.js.map +1 -0
- package/dist/{patterns/auth/utils.d.ts → features/auth/utils/authForm.d.ts} +3 -3
- package/dist/features/auth/utils/authForm.d.ts.map +1 -0
- package/dist/{patterns/auth/utils.js → features/auth/utils/authForm.js} +1 -1
- package/dist/features/auth/utils/authForm.js.map +1 -0
- package/dist/{patterns/auth → features/auth/utils}/oauthProviders.d.ts +1 -1
- package/dist/features/auth/utils/oauthProviders.d.ts.map +1 -0
- package/dist/features/auth/utils/oauthProviders.js.map +1 -0
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/{components/gradient → features/gradient/adapters/inbound}/Gradient.d.ts +1 -1
- package/dist/features/gradient/adapters/inbound/Gradient.d.ts.map +1 -0
- package/dist/{components/gradient → features/gradient/adapters/inbound}/Gradient.js +2 -2
- package/dist/features/gradient/adapters/inbound/Gradient.js.map +1 -0
- package/dist/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.d.ts +3 -2
- package/dist/features/gradient/adapters/inbound/GradientRendererContext.d.ts.map +1 -0
- package/dist/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.js +2 -1
- package/dist/features/gradient/adapters/inbound/GradientRendererContext.js.map +1 -0
- package/dist/features/gradient/gradientMeta.d.ts +48 -0
- package/dist/features/gradient/gradientMeta.d.ts.map +1 -0
- package/dist/features/gradient/gradientMeta.js +25 -0
- package/dist/features/gradient/gradientMeta.js.map +1 -0
- package/dist/features/gradient/public.d.ts +4 -0
- package/dist/features/gradient/public.d.ts.map +1 -0
- package/dist/features/gradient/public.js +3 -0
- package/dist/features/gradient/public.js.map +1 -0
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/boxMeta.d.ts +1 -1
- package/dist/features/layout/containerMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/stackMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/layout/screen/meta.d.ts +1 -1
- package/dist/layout/screen-section/meta.d.ts +1 -1
- package/dist/metadata/allowedChildren.d.ts +3 -3
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +8 -0
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +2 -2
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +11 -4
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/message-bubble/meta.d.ts +1 -1
- package/dist/patterns/notice/meta.d.ts +1 -1
- package/dist/patterns/panel/meta.d.ts +1 -1
- package/dist/patterns/reader/meta.d.ts +2 -2
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -4
- package/dist/registry.js.map +1 -1
- package/dist/types/accordion.d.ts +23 -0
- package/dist/types/accordion.d.ts.map +1 -0
- package/dist/types/accordion.js +2 -0
- package/dist/types/accordion.js.map +1 -0
- package/dist/{patterns/auth/types.d.ts → types/auth.d.ts} +8 -8
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +2 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/{components/gradient/types.d.ts → types/gradient.d.ts} +3 -3
- package/dist/types/gradient.d.ts.map +1 -0
- package/dist/types/gradient.js +2 -0
- package/dist/types/gradient.js.map +1 -0
- package/package.json +2 -2
- package/src/constants.ts +9 -0
- package/src/expo57Migration.test.ts +1 -1
- package/src/featureManifest.test.ts +2 -0
- package/src/features/accordion/accordionItemMeta.ts +46 -0
- package/src/features/accordion/accordionMeta.ts +34 -0
- package/src/features/accordion/adapters/inbound/Accordion.tsx +94 -0
- package/src/features/accordion/adapters/inbound/AccordionItem.tsx +86 -0
- package/src/features/accordion/composition/AccordionPresentationContext.ts +6 -0
- package/src/features/accordion/public.ts +9 -0
- package/src/{patterns/auth → features/auth/adapters/inbound}/AuthForm.tsx +5 -5
- package/src/{patterns/auth → features/auth/adapters/inbound}/AuthFormField.tsx +4 -4
- package/src/{patterns/auth → features/auth/adapters/inbound}/ForgotPasswordForm.tsx +8 -8
- package/src/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderButton.tsx +4 -4
- package/src/{patterns/auth → features/auth/adapters/inbound}/OAuthProviderList.tsx +3 -3
- package/src/{patterns/auth → features/auth/adapters/inbound}/OtpForm.tsx +6 -6
- package/src/{patterns/auth → features/auth/adapters/inbound}/SignInForm.tsx +8 -8
- package/src/{patterns/auth → features/auth/adapters/inbound}/SignUpForm.tsx +5 -5
- package/src/features/auth/forgotPasswordFormMeta.ts +49 -0
- package/src/features/auth/oauthProviderButtonMeta.ts +62 -0
- package/src/features/auth/oauthProviderListMeta.ts +67 -0
- package/src/features/auth/otpFormMeta.ts +55 -0
- package/src/features/auth/public.test.ts +34 -0
- package/src/{patterns/auth/index.ts → features/auth/public.ts} +12 -12
- package/src/features/auth/signInFormMeta.ts +63 -0
- package/src/features/auth/signUpFormMeta.ts +67 -0
- package/src/{patterns/auth/utils.ts → features/auth/utils/authForm.ts} +2 -2
- package/src/{patterns/auth → features/auth/utils}/oauthProviders.test.ts +1 -1
- package/src/{patterns/auth → features/auth/utils}/oauthProviders.ts +1 -1
- package/src/{components/gradient → features/gradient/adapters/inbound}/Gradient.tsx +3 -3
- package/src/{components/gradient → features/gradient/adapters/inbound}/GradientRendererContext.tsx +3 -2
- package/src/features/gradient/gradientMeta.ts +26 -0
- package/src/features/gradient/public.test.ts +15 -0
- package/src/{components/gradient/index.ts → features/gradient/public.ts} +3 -3
- package/src/index.ts +49 -42
- package/src/metadata/allowedChildren.ts +8 -0
- package/src/metadata/componentMeta.test.ts +16 -0
- package/src/metadata/componentMeta.ts +11 -11
- package/src/registry.ts +12 -11
- package/src/showcaseCoverage.test.ts +2 -1
- package/src/theme/themeScopeStructure.test.ts +10 -7
- package/src/types/accordion.ts +38 -0
- package/src/{patterns/auth/types.ts → types/auth.ts} +7 -7
- package/src/{components/gradient/types.ts → types/gradient.ts} +2 -2
- package/dist/components/gradient/Gradient.d.ts.map +0 -1
- package/dist/components/gradient/Gradient.js.map +0 -1
- package/dist/components/gradient/GradientRendererContext.d.ts.map +0 -1
- package/dist/components/gradient/GradientRendererContext.js.map +0 -1
- package/dist/components/gradient/index.d.ts +0 -4
- package/dist/components/gradient/index.d.ts.map +0 -1
- package/dist/components/gradient/index.js +0 -3
- package/dist/components/gradient/index.js.map +0 -1
- package/dist/components/gradient/meta.d.ts +0 -9
- package/dist/components/gradient/meta.d.ts.map +0 -1
- package/dist/components/gradient/meta.js +0 -9
- package/dist/components/gradient/meta.js.map +0 -1
- package/dist/components/gradient/types.d.ts.map +0 -1
- package/dist/components/gradient/types.js +0 -2
- package/dist/components/gradient/types.js.map +0 -1
- package/dist/patterns/auth/AuthForm.d.ts.map +0 -1
- package/dist/patterns/auth/AuthForm.js.map +0 -1
- package/dist/patterns/auth/AuthFormField.d.ts.map +0 -1
- package/dist/patterns/auth/AuthFormField.js.map +0 -1
- package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +0 -1
- package/dist/patterns/auth/ForgotPasswordForm.js.map +0 -1
- package/dist/patterns/auth/OAuthProviderButton.d.ts.map +0 -1
- package/dist/patterns/auth/OAuthProviderButton.js.map +0 -1
- package/dist/patterns/auth/OAuthProviderList.d.ts.map +0 -1
- package/dist/patterns/auth/OAuthProviderList.js.map +0 -1
- package/dist/patterns/auth/OtpForm.d.ts.map +0 -1
- package/dist/patterns/auth/OtpForm.js.map +0 -1
- package/dist/patterns/auth/SignInForm.d.ts.map +0 -1
- package/dist/patterns/auth/SignInForm.js.map +0 -1
- package/dist/patterns/auth/SignUpForm.d.ts.map +0 -1
- package/dist/patterns/auth/SignUpForm.js.map +0 -1
- package/dist/patterns/auth/index.d.ts +0 -9
- package/dist/patterns/auth/index.d.ts.map +0 -1
- package/dist/patterns/auth/index.js +0 -8
- package/dist/patterns/auth/index.js.map +0 -1
- package/dist/patterns/auth/meta.d.ts +0 -49
- package/dist/patterns/auth/meta.d.ts.map +0 -1
- package/dist/patterns/auth/meta.js +0 -50
- package/dist/patterns/auth/meta.js.map +0 -1
- package/dist/patterns/auth/oauthProviders.d.ts.map +0 -1
- package/dist/patterns/auth/oauthProviders.js.map +0 -1
- package/dist/patterns/auth/types.d.ts.map +0 -1
- package/dist/patterns/auth/types.js +0 -2
- package/dist/patterns/auth/types.js.map +0 -1
- package/dist/patterns/auth/utils.d.ts.map +0 -1
- package/dist/patterns/auth/utils.js.map +0 -1
- package/dist/patterns/disclosure-section/DisclosureSection.d.ts +0 -9
- package/dist/patterns/disclosure-section/DisclosureSection.d.ts.map +0 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js +0 -86
- package/dist/patterns/disclosure-section/DisclosureSection.js.map +0 -1
- package/dist/patterns/disclosure-section/index.d.ts +0 -3
- package/dist/patterns/disclosure-section/index.d.ts.map +0 -1
- package/dist/patterns/disclosure-section/index.js +0 -3
- package/dist/patterns/disclosure-section/index.js.map +0 -1
- package/dist/patterns/disclosure-section/meta.d.ts +0 -9
- package/dist/patterns/disclosure-section/meta.d.ts.map +0 -1
- package/dist/patterns/disclosure-section/meta.js +0 -9
- package/dist/patterns/disclosure-section/meta.js.map +0 -1
- package/dist/patterns/disclosure-section/types.d.ts +0 -15
- package/dist/patterns/disclosure-section/types.d.ts.map +0 -1
- package/dist/patterns/disclosure-section/types.js +0 -2
- package/dist/patterns/disclosure-section/types.js.map +0 -1
- package/src/components/gradient/meta.ts +0 -10
- package/src/patterns/auth/meta.ts +0 -57
- package/src/patterns/disclosure-section/DisclosureSection.tsx +0 -130
- package/src/patterns/disclosure-section/index.ts +0 -2
- package/src/patterns/disclosure-section/meta.ts +0 -10
- package/src/patterns/disclosure-section/types.ts +0 -16
- /package/dist/{patterns/auth → features/auth/utils}/oauthProviders.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 13.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- c2e5080: Replace the legacy `DisclosureSection` pattern with feature-owned `Accordion` and `AccordionItem` manifest components backed by the published Surface accordion foundation.
|
|
8
|
+
|
|
9
|
+
BREAKING CHANGE: `DisclosureSection` and `DisclosureSectionProps` are no longer exported. Use `Accordion` with one or more `AccordionItem` children instead.
|
|
10
|
+
|
|
11
|
+
## 12.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- ca23e34: Move the complete Auth solution and Gradient to canonical feature ownership.
|
|
16
|
+
|
|
17
|
+
ForgotPasswordForm, OtpForm, SignInForm, SignUpForm, OAuthProviderButton, OAuthProviderList, and Gradient are now direct manifest nodes with serializable authoring metadata. Gradient remains renderer-agnostic through GradientRendererProvider.
|
|
18
|
+
|
|
3
19
|
## 12.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/zora
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
|
|
9
9
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const COMPONENT_THEME_AUTHORING: {
|
|
|
4
4
|
readonly allowInstanceOverride: true;
|
|
5
5
|
};
|
|
6
6
|
export declare const FEATURE_MANIFEST_ELEMENTS: {
|
|
7
|
+
readonly auth: readonly ["ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm"];
|
|
7
8
|
readonly surface: readonly ["Surface"];
|
|
8
9
|
readonly avatar: readonly ["Avatar", "AvatarGroup"];
|
|
9
10
|
readonly badge: readonly ["Badge"];
|
|
@@ -12,6 +13,7 @@ export declare const FEATURE_MANIFEST_ELEMENTS: {
|
|
|
12
13
|
readonly 'data-table': readonly ["DataTable"];
|
|
13
14
|
readonly 'date-picker': readonly ["DatePicker"];
|
|
14
15
|
readonly form: readonly ["Form", "FormError", "FormField"];
|
|
16
|
+
readonly gradient: readonly ["Gradient"];
|
|
15
17
|
readonly button: readonly ["Button", "IconButton", "ButtonGroup"];
|
|
16
18
|
readonly icon: readonly ["Icon"];
|
|
17
19
|
readonly image: readonly ["Image"];
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;CA6B5B,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -4,6 +4,14 @@ export const COMPONENT_THEME_AUTHORING = {
|
|
|
4
4
|
allowInstanceOverride: true,
|
|
5
5
|
};
|
|
6
6
|
export const FEATURE_MANIFEST_ELEMENTS = {
|
|
7
|
+
auth: [
|
|
8
|
+
'ForgotPasswordForm',
|
|
9
|
+
'OAuthProviderButton',
|
|
10
|
+
'OAuthProviderList',
|
|
11
|
+
'OtpForm',
|
|
12
|
+
'SignInForm',
|
|
13
|
+
'SignUpForm',
|
|
14
|
+
],
|
|
7
15
|
surface: ['Surface'],
|
|
8
16
|
avatar: ['Avatar', 'AvatarGroup'],
|
|
9
17
|
badge: ['Badge'],
|
|
@@ -12,6 +20,7 @@ export const FEATURE_MANIFEST_ELEMENTS = {
|
|
|
12
20
|
'data-table': ['DataTable'],
|
|
13
21
|
'date-picker': ['DatePicker'],
|
|
14
22
|
form: ['Form', 'FormError', 'FormField'],
|
|
23
|
+
gradient: ['Gradient'],
|
|
15
24
|
button: ['Button', 'IconButton', 'ButtonGroup'],
|
|
16
25
|
icon: ['Icon'],
|
|
17
26
|
image: ['Image'],
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,WAAW;IAClB,qBAAqB,EAAE,IAAI;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC;IACpE,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;IAC3B,YAAY,EAAE,CAAC,WAAW,CAAC;IAC3B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC;IACxC,MAAM,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC;IAC/C,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,wBAAwB,EAAE,CAAC,sBAAsB,CAAC;IAClD,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;IACvE,IAAI,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IACjC,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAC;IACtE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,cAAc,EAAE,CAAC,aAAa,CAAC;CACvB,CAAC","sourcesContent":["export const COMPONENT_THEME_AUTHORING = {\n authority: 'theme',\n scope: 'component',\n allowInstanceOverride: true,\n} as const;\n\nexport const FEATURE_MANIFEST_ELEMENTS = {\n surface: ['Surface'],\n avatar: ['Avatar', 'AvatarGroup'],\n badge: ['Badge'],\n card: ['Card', 'MediaCard', 'MetricCard', 'PostCard', 'ProductCard'],\n chip: ['Chip', 'ChipGroup'],\n 'data-table': ['DataTable'],\n 'date-picker': ['DatePicker'],\n form: ['Form', 'FormError', 'FormField'],\n button: ['Button', 'IconButton', 'ButtonGroup'],\n icon: ['Icon'],\n image: ['Image'],\n 'keyboard-avoiding-view': ['KeyboardAvoidingView'],\n layout: ['Box', 'Container', 'ContentRail', 'Divider', 'Grid', 'Stack'],\n list: ['FlatList', 'SectionList'],\n skeleton: ['Skeleton', 'SkeletonCard', 'SkeletonList', 'SkeletonText'],\n typography: ['Heading', 'Text'],\n 'time-picker': ['TimePicker'],\n uploader: ['Uploader'],\n 'bottom-sheet': ['BottomSheet'],\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,WAAW;IAClB,qBAAqB,EAAE,IAAI;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE;QACJ,oBAAoB;QACpB,qBAAqB;QACrB,mBAAmB;QACnB,SAAS;QACT,YAAY;QACZ,YAAY;KACb;IACD,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC;IACpE,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;IAC3B,YAAY,EAAE,CAAC,WAAW,CAAC;IAC3B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC;IACxC,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,MAAM,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC;IAC/C,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,wBAAwB,EAAE,CAAC,sBAAsB,CAAC;IAClD,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;IACvE,IAAI,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IACjC,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAC;IACtE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,cAAc,EAAE,CAAC,aAAa,CAAC;CACvB,CAAC","sourcesContent":["export const COMPONENT_THEME_AUTHORING = {\n authority: 'theme',\n scope: 'component',\n allowInstanceOverride: true,\n} as const;\n\nexport const FEATURE_MANIFEST_ELEMENTS = {\n auth: [\n 'ForgotPasswordForm',\n 'OAuthProviderButton',\n 'OAuthProviderList',\n 'OtpForm',\n 'SignInForm',\n 'SignUpForm',\n ],\n surface: ['Surface'],\n avatar: ['Avatar', 'AvatarGroup'],\n badge: ['Badge'],\n card: ['Card', 'MediaCard', 'MetricCard', 'PostCard', 'ProductCard'],\n chip: ['Chip', 'ChipGroup'],\n 'data-table': ['DataTable'],\n 'date-picker': ['DatePicker'],\n form: ['Form', 'FormError', 'FormField'],\n gradient: ['Gradient'],\n button: ['Button', 'IconButton', 'ButtonGroup'],\n icon: ['Icon'],\n image: ['Image'],\n 'keyboard-avoiding-view': ['KeyboardAvoidingView'],\n layout: ['Box', 'Container', 'ContentRail', 'Divider', 'Grid', 'Stack'],\n list: ['FlatList', 'SectionList'],\n skeleton: ['Skeleton', 'SkeletonCard', 'SkeletonList', 'SkeletonText'],\n typography: ['Heading', 'Text'],\n 'time-picker': ['TimePicker'],\n uploader: ['Uploader'],\n 'bottom-sheet': ['BottomSheet'],\n} as const;\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const accordionItemMeta: {
|
|
2
|
+
readonly name: "AccordionItem";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly description: "One expandable accordion item with authored content and optional actions.";
|
|
5
|
+
readonly directManifestNode: true;
|
|
6
|
+
readonly allowedChildren: readonly ["ActivityIndicator", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Gradient", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "TimePicker", "Form", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
7
|
+
readonly blueprint: {
|
|
8
|
+
readonly label: "Accordion item";
|
|
9
|
+
readonly defaultProps: {
|
|
10
|
+
readonly value: "item";
|
|
11
|
+
readonly title: "Accordion item";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly slots: {
|
|
15
|
+
readonly actions: {
|
|
16
|
+
readonly label: "Actions";
|
|
17
|
+
readonly allowedChildren: readonly ["Button", "ButtonGroup", "IconButton"];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly props: {
|
|
21
|
+
readonly value: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly category: "Behavior";
|
|
24
|
+
readonly label: "Value";
|
|
25
|
+
readonly authoring: {
|
|
26
|
+
readonly authority: "instance";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly title: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly category: "Content";
|
|
32
|
+
readonly label: "Title";
|
|
33
|
+
readonly authoring: {
|
|
34
|
+
readonly authority: "instance";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly description: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly category: "Content";
|
|
40
|
+
readonly label: "Description";
|
|
41
|
+
readonly authoring: {
|
|
42
|
+
readonly authority: "instance";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
readonly disabled: {
|
|
46
|
+
readonly type: "boolean";
|
|
47
|
+
readonly category: "State";
|
|
48
|
+
readonly label: "Disabled";
|
|
49
|
+
readonly default: false;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=accordionItemMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordionItemMeta.d.ts","sourceRoot":"","sources":["../../../src/features/accordion/accordionItemMeta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CQ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
|
|
2
|
+
export const accordionItemMeta = {
|
|
3
|
+
name: 'AccordionItem',
|
|
4
|
+
category: 'component',
|
|
5
|
+
description: 'One expandable accordion item with authored content and optional actions.',
|
|
6
|
+
directManifestNode: true,
|
|
7
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
8
|
+
blueprint: {
|
|
9
|
+
label: 'Accordion item',
|
|
10
|
+
defaultProps: { value: 'item', title: 'Accordion item' },
|
|
11
|
+
},
|
|
12
|
+
slots: {
|
|
13
|
+
actions: {
|
|
14
|
+
label: 'Actions',
|
|
15
|
+
allowedChildren: ['Button', 'ButtonGroup', 'IconButton'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
value: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
category: 'Behavior',
|
|
22
|
+
label: 'Value',
|
|
23
|
+
authoring: { authority: 'instance' },
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
category: 'Content',
|
|
28
|
+
label: 'Title',
|
|
29
|
+
authoring: { authority: 'instance' },
|
|
30
|
+
},
|
|
31
|
+
description: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
category: 'Content',
|
|
34
|
+
label: 'Description',
|
|
35
|
+
authoring: { authority: 'instance' },
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
category: 'State',
|
|
40
|
+
label: 'Disabled',
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=accordionItemMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordionItemMeta.js","sourceRoot":"","sources":["../../../src/features/accordion/accordionItemMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,2EAA2E;IACxF,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,GAAG,0BAA0B,CAAC;IAChD,SAAS,EAAE;QACT,KAAK,EAAE,gBAAgB;QACvB,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE;KACzD;IACD,KAAK,EAAE;QACL,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC;SACzD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,OAAO;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,OAAO;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;SACf;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nimport { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';\n\nexport const accordionItemMeta = {\n name: 'AccordionItem',\n category: 'component',\n description: 'One expandable accordion item with authored content and optional actions.',\n directManifestNode: true,\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n blueprint: {\n label: 'Accordion item',\n defaultProps: { value: 'item', title: 'Accordion item' },\n },\n slots: {\n actions: {\n label: 'Actions',\n allowedChildren: ['Button', 'ButtonGroup', 'IconButton'],\n },\n },\n props: {\n value: {\n type: 'string',\n category: 'Behavior',\n label: 'Value',\n authoring: { authority: 'instance' },\n },\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n authoring: { authority: 'instance' },\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n authoring: { authority: 'instance' },\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const accordionMeta: {
|
|
2
|
+
readonly name: "Accordion";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly description: "Groups expandable content items with single or multiple expansion behavior.";
|
|
5
|
+
readonly directManifestNode: true;
|
|
6
|
+
readonly allowedChildren: readonly ["AccordionItem"];
|
|
7
|
+
readonly blueprint: {
|
|
8
|
+
readonly label: "Accordion";
|
|
9
|
+
readonly defaultProps: {
|
|
10
|
+
readonly type: "single";
|
|
11
|
+
readonly collapsible: true;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly props: {
|
|
15
|
+
readonly type: {
|
|
16
|
+
readonly type: "enum";
|
|
17
|
+
readonly category: "Behavior";
|
|
18
|
+
readonly label: "Expansion mode";
|
|
19
|
+
readonly enum: readonly ["single", "multiple"];
|
|
20
|
+
readonly default: "single";
|
|
21
|
+
};
|
|
22
|
+
readonly collapsible: {
|
|
23
|
+
readonly type: "boolean";
|
|
24
|
+
readonly category: "Behavior";
|
|
25
|
+
readonly label: "Collapsible";
|
|
26
|
+
readonly default: true;
|
|
27
|
+
};
|
|
28
|
+
readonly disabled: {
|
|
29
|
+
readonly type: "boolean";
|
|
30
|
+
readonly category: "State";
|
|
31
|
+
readonly label: "Disabled";
|
|
32
|
+
readonly default: false;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=accordionMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordionMeta.d.ts","sourceRoot":"","sources":["../../../src/features/accordion/accordionMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const accordionMeta = {
|
|
2
|
+
name: 'Accordion',
|
|
3
|
+
category: 'component',
|
|
4
|
+
description: 'Groups expandable content items with single or multiple expansion behavior.',
|
|
5
|
+
directManifestNode: true,
|
|
6
|
+
allowedChildren: ['AccordionItem'],
|
|
7
|
+
blueprint: {
|
|
8
|
+
label: 'Accordion',
|
|
9
|
+
defaultProps: { type: 'single', collapsible: true },
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
type: {
|
|
13
|
+
type: 'enum',
|
|
14
|
+
category: 'Behavior',
|
|
15
|
+
label: 'Expansion mode',
|
|
16
|
+
enum: ['single', 'multiple'],
|
|
17
|
+
default: 'single',
|
|
18
|
+
},
|
|
19
|
+
collapsible: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
category: 'Behavior',
|
|
22
|
+
label: 'Collapsible',
|
|
23
|
+
default: true,
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
category: 'State',
|
|
28
|
+
label: 'Disabled',
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=accordionMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordionMeta.js","sourceRoot":"","sources":["../../../src/features/accordion/accordionMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,6EAA6E;IAC1F,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,eAAe,CAAC;IAClC,SAAS,EAAE;QACT,KAAK,EAAE,WAAW;QAClB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE;KACpD;IACD,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;YAC5B,OAAO,EAAE,QAAQ;SAClB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,IAAI;SACd;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;SACf;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const accordionMeta = {\n name: 'Accordion',\n category: 'component',\n description: 'Groups expandable content items with single or multiple expansion behavior.',\n directManifestNode: true,\n allowedChildren: ['AccordionItem'],\n blueprint: {\n label: 'Accordion',\n defaultProps: { type: 'single', collapsible: true },\n },\n props: {\n type: {\n type: 'enum',\n category: 'Behavior',\n label: 'Expansion mode',\n enum: ['single', 'multiple'],\n default: 'single',\n },\n collapsible: {\n type: 'boolean',\n category: 'Behavior',\n label: 'Collapsible',\n default: true,\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionProps } from '../../../../types/accordion';
|
|
3
|
+
/*** Renders a ZORA accordion backed by Surface expansion and accessibility mechanics. */
|
|
4
|
+
export declare const Accordion: (props: AccordionProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/Accordion.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAEV,cAAc,EAEf,MAAM,6BAA6B,CAAC;AAGrC,yFAAyF;AACzF,eAAO,MAAM,SAAS,sDAAqC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Accordion as SurfaceAccordion } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';
|
|
5
|
+
/*** Renders a ZORA accordion backed by Surface expansion and accessibility mechanics. */
|
|
6
|
+
export const Accordion = withZoraThemeScope(AccordionInner);
|
|
7
|
+
/*** Routes the public accordion union to its single or multiple Surface contract. */
|
|
8
|
+
function AccordionInner(props) {
|
|
9
|
+
if (props.type === 'multiple') {
|
|
10
|
+
return <MultipleAccordion {...props}/>;
|
|
11
|
+
}
|
|
12
|
+
return <SingleAccordion {...props}/>;
|
|
13
|
+
}
|
|
14
|
+
/*** Mirrors Surface multiple-value state for ZORA presentation only. */
|
|
15
|
+
function MultipleAccordion({ themeId: _themeId, mode: _mode, children, defaultValue, interactionPolicy, onValueChange, value, ...surfaceProps }) {
|
|
16
|
+
const [presentationValues, setPresentationValues] = React.useState(() => value ?? defaultValue ?? []);
|
|
17
|
+
const openValues = value ?? presentationValues;
|
|
18
|
+
return (<AccordionPresentationContext.Provider value={{ mode: 'multiple', openValues }}>
|
|
19
|
+
<SurfaceAccordion {...surfaceProps} defaultValue={defaultValue} interactionPolicy={interactionPolicy} onValueChange={(nextValues) => {
|
|
20
|
+
setPresentationValues(nextValues);
|
|
21
|
+
onValueChange?.(nextValues);
|
|
22
|
+
}} type="multiple" value={value}>
|
|
23
|
+
{children}
|
|
24
|
+
</SurfaceAccordion>
|
|
25
|
+
</AccordionPresentationContext.Provider>);
|
|
26
|
+
}
|
|
27
|
+
/*** Mirrors Surface single-value state for ZORA presentation only. */
|
|
28
|
+
function SingleAccordion({ themeId: _themeId, mode: _mode, children, defaultValue, interactionPolicy, onValueChange, type: _type, value, ...surfaceProps }) {
|
|
29
|
+
const [presentationValue, setPresentationValue] = React.useState(() => value ?? defaultValue);
|
|
30
|
+
const openValue = value ?? presentationValue;
|
|
31
|
+
const openValues = openValue === undefined ? [] : [openValue];
|
|
32
|
+
return (<AccordionPresentationContext.Provider value={{ mode: 'single', openValues }}>
|
|
33
|
+
<SurfaceAccordion {...surfaceProps} defaultValue={defaultValue} interactionPolicy={interactionPolicy} onValueChange={(nextValue) => {
|
|
34
|
+
setPresentationValue(nextValue);
|
|
35
|
+
onValueChange?.(nextValue);
|
|
36
|
+
}} type="single" value={value}>
|
|
37
|
+
{children}
|
|
38
|
+
</SurfaceAccordion>
|
|
39
|
+
</AccordionPresentationContext.Provider>);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM1E,OAAO,EAAE,4BAA4B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IAAA,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,IAAI,EAAE,KAAK,EACX,KAAK,EACL,GAAG,YAAY,EACM;IACrB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAC9D,GAAG,EAAE,CAAC,KAAK,IAAI,YAAY,CAC5B,CAAC;IACF,MAAM,SAAS,GAAG,KAAK,IAAI,iBAAiB,CAAC;IAC7C,MAAM,UAAU,GAAG,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE9D,OAAO,CACL,CAAC,4BAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAC3E;MAAA,CAAC,gBAAgB,CACf,IAAI,YAAY,CAAC,CACjB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE;YAC3B,oBAAoB,CAAC,SAAS,CAAC,CAAC;YAChC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC,CAAC,CACF,IAAI,CAAC,QAAQ,CACb,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,gBAAgB,CACpB;IAAA,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CACzC,CAAC;AACJ,CAAC","sourcesContent":["import { Accordion as SurfaceAccordion } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n} from '../../../../types/accordion';\nimport { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';\n\n/*** Renders a ZORA accordion backed by Surface expansion and accessibility mechanics. */\nexport const Accordion = withZoraThemeScope(AccordionInner);\n\n/*** Routes the public accordion union to its single or multiple Surface contract. */\nfunction AccordionInner(props: AccordionProps) {\n if (props.type === 'multiple') {\n return <MultipleAccordion {...props} />;\n }\n\n return <SingleAccordion {...props} />;\n}\n\n/*** Mirrors Surface multiple-value state for ZORA presentation only. */\nfunction MultipleAccordion({\n themeId: _themeId,\n mode: _mode,\n children,\n defaultValue,\n interactionPolicy,\n onValueChange,\n value,\n ...surfaceProps\n}: AccordionMultipleProps) {\n const [presentationValues, setPresentationValues] = React.useState<readonly string[]>(\n () => value ?? defaultValue ?? [],\n );\n const openValues = value ?? presentationValues;\n\n return (\n <AccordionPresentationContext.Provider value={{ mode: 'multiple', openValues }}>\n <SurfaceAccordion\n {...surfaceProps}\n defaultValue={defaultValue}\n interactionPolicy={interactionPolicy}\n onValueChange={(nextValues) => {\n setPresentationValues(nextValues);\n onValueChange?.(nextValues);\n }}\n type=\"multiple\"\n value={value}\n >\n {children}\n </SurfaceAccordion>\n </AccordionPresentationContext.Provider>\n );\n}\n\n/*** Mirrors Surface single-value state for ZORA presentation only. */\nfunction SingleAccordion({\n themeId: _themeId,\n mode: _mode,\n children,\n defaultValue,\n interactionPolicy,\n onValueChange,\n type: _type,\n value,\n ...surfaceProps\n}: AccordionSingleProps) {\n const [presentationValue, setPresentationValue] = React.useState<string | undefined>(\n () => value ?? defaultValue,\n );\n const openValue = value ?? presentationValue;\n const openValues = openValue === undefined ? [] : [openValue];\n\n return (\n <AccordionPresentationContext.Provider value={{ mode: 'single', openValues }}>\n <SurfaceAccordion\n {...surfaceProps}\n defaultValue={defaultValue}\n interactionPolicy={interactionPolicy}\n onValueChange={(nextValue) => {\n setPresentationValue(nextValue);\n onValueChange?.(nextValue);\n }}\n type=\"single\"\n value={value}\n >\n {children}\n </SurfaceAccordion>\n </AccordionPresentationContext.Provider>\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionItemProps } from '../../../../types/accordion';
|
|
3
|
+
/*** Renders one opinionated ZORA accordion item over Surface trigger/content primitives. */
|
|
4
|
+
export declare const AccordionItem: (props: AccordionItemProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAMtE,4FAA4F;AAC5F,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AccordionContent as SurfaceAccordionContent, AccordionItem as SurfaceAccordionItem, AccordionTrigger as SurfaceAccordionTrigger, } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { Icon } from '../../../icon/public';
|
|
5
|
+
import { Box, Divider, Stack } from '../../../layout/public';
|
|
6
|
+
import { Heading, Text } from '../../../typography/public';
|
|
7
|
+
import { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';
|
|
8
|
+
/*** Renders one opinionated ZORA accordion item over Surface trigger/content primitives. */
|
|
9
|
+
export const AccordionItem = withZoraThemeScope(AccordionItemInner);
|
|
10
|
+
const triggerStyle = { flex: 1 };
|
|
11
|
+
/*** Composes the item header, optional actions, expanded content, and separator. */
|
|
12
|
+
function AccordionItemInner({ themeId: _themeId, mode: _mode, actions, children, description, disabled, icon, interactionPolicy, testID, title, value, ...surfaceItemProps }) {
|
|
13
|
+
const presentation = React.useContext(AccordionPresentationContext);
|
|
14
|
+
if (!presentation) {
|
|
15
|
+
throw new Error('AccordionItem must be rendered inside Accordion.');
|
|
16
|
+
}
|
|
17
|
+
const open = presentation.openValues.includes(value);
|
|
18
|
+
return (<SurfaceAccordionItem {...surfaceItemProps} disabled={disabled} interactionPolicy={interactionPolicy} testID={testID} value={value}>
|
|
19
|
+
<Stack gap="none">
|
|
20
|
+
<Stack align="center" direction="row" gap="s">
|
|
21
|
+
<Box flex={1}>
|
|
22
|
+
<SurfaceAccordionTrigger interactionPolicy={interactionPolicy} style={triggerStyle}>
|
|
23
|
+
<Box px="m" py="m">
|
|
24
|
+
<Stack align="center" direction="row" gap="m">
|
|
25
|
+
{icon ? <Icon {...icon}/> : null}
|
|
26
|
+
<Box flex={1}>
|
|
27
|
+
<Stack gap="xs">
|
|
28
|
+
<Heading level={4}>{title}</Heading>
|
|
29
|
+
{description ? (<Text emphasis="muted" variant="bodySmall">
|
|
30
|
+
{description}
|
|
31
|
+
</Text>) : null}
|
|
32
|
+
</Stack>
|
|
33
|
+
</Box>
|
|
34
|
+
<Icon name={open ? 'chevron-up-outline' : 'chevron-down-outline'} size="m"/>
|
|
35
|
+
</Stack>
|
|
36
|
+
</Box>
|
|
37
|
+
</SurfaceAccordionTrigger>
|
|
38
|
+
</Box>
|
|
39
|
+
{actions ? <Box pr="m">{actions}</Box> : null}
|
|
40
|
+
</Stack>
|
|
41
|
+
|
|
42
|
+
<SurfaceAccordionContent>
|
|
43
|
+
<Box px="m" pb="m">
|
|
44
|
+
<Stack gap="m">{children}</Stack>
|
|
45
|
+
</Box>
|
|
46
|
+
</SurfaceAccordionContent>
|
|
47
|
+
|
|
48
|
+
<Divider />
|
|
49
|
+
</Stack>
|
|
50
|
+
</SurfaceAccordionItem>);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionIt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AC,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,GAAG,EAC5E;gBAAA,EAAE,KAAK,CACT;cAAA,EAAE,GAAG,CACP;YAAA,EAAE,uBAAuB,CAC3B;UAAA,EAAE,GAAG,CACL;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC/C;QAAA,EAAE,KAAK,CAEP;;QAAA,CAAC,uBAAuB,CACtB;UAAA,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAChB;YAAA,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAClC;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,uBAAuB,CAEzB;;QAAA,CAAC,OAAO,CAAC,AAAD,EACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n AccordionContent as SurfaceAccordionContent,\n AccordionItem as SurfaceAccordionItem,\n AccordionTrigger as SurfaceAccordionTrigger,\n} from '@ankhorage/surface';\nimport React from 'react';\nimport type { ViewStyle } from 'react-native';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { AccordionItemProps } from '../../../../types/accordion';\nimport { Icon } from '../../../icon/public';\nimport { Box, Divider, Stack } from '../../../layout/public';\nimport { Heading, Text } from '../../../typography/public';\nimport { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';\n\n/*** Renders one opinionated ZORA accordion item over Surface trigger/content primitives. */\nexport const AccordionItem = withZoraThemeScope(AccordionItemInner);\n\nconst triggerStyle: ViewStyle = { flex: 1 };\n\n/*** Composes the item header, optional actions, expanded content, and separator. */\nfunction AccordionItemInner({\n themeId: _themeId,\n mode: _mode,\n actions,\n children,\n description,\n disabled,\n icon,\n interactionPolicy,\n testID,\n title,\n value,\n ...surfaceItemProps\n}: AccordionItemProps) {\n const presentation = React.useContext(AccordionPresentationContext);\n if (!presentation) {\n throw new Error('AccordionItem must be rendered inside Accordion.');\n }\n\n const open = presentation.openValues.includes(value);\n\n return (\n <SurfaceAccordionItem\n {...surfaceItemProps}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n testID={testID}\n value={value}\n >\n <Stack gap=\"none\">\n <Stack align=\"center\" direction=\"row\" gap=\"s\">\n <Box flex={1}>\n <SurfaceAccordionTrigger interactionPolicy={interactionPolicy} style={triggerStyle}>\n <Box px=\"m\" py=\"m\">\n <Stack align=\"center\" direction=\"row\" gap=\"m\">\n {icon ? <Icon {...icon} /> : null}\n <Box flex={1}>\n <Stack gap=\"xs\">\n <Heading level={4}>{title}</Heading>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n <Icon name={open ? 'chevron-up-outline' : 'chevron-down-outline'} size=\"m\" />\n </Stack>\n </Box>\n </SurfaceAccordionTrigger>\n </Box>\n {actions ? <Box pr=\"m\">{actions}</Box> : null}\n </Stack>\n\n <SurfaceAccordionContent>\n <Box px=\"m\" pb=\"m\">\n <Stack gap=\"m\">{children}</Stack>\n </Box>\n </SurfaceAccordionContent>\n\n <Divider />\n </Stack>\n </SurfaceAccordionItem>\n );\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionPresentationContextValue } from '../../../types/accordion';
|
|
3
|
+
export declare const AccordionPresentationContext: React.Context<AccordionPresentationContextValue | null>;
|
|
4
|
+
//# sourceMappingURL=AccordionPresentationContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionPresentationContext.d.ts","sourceRoot":"","sources":["../../../../src/features/accordion/composition/AccordionPresentationContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAElF,eAAO,MAAM,4BAA4B,yDAC4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionPresentationContext.js","sourceRoot":"","sources":["../../../../src/features/accordion/composition/AccordionPresentationContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,MAAM,4BAA4B,GACvC,KAAK,CAAC,aAAa,CAA2C,IAAI,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { AccordionPresentationContextValue } from '../../../types/accordion';\n\nexport const AccordionPresentationContext =\n React.createContext<AccordionPresentationContextValue | null>(null);\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AccordionItemProps, AccordionMode, AccordionMultipleProps, AccordionProps, AccordionSingleProps, } from '../../types/accordion';
|
|
2
|
+
export { Accordion } from './adapters/inbound/Accordion';
|
|
3
|
+
export { AccordionItem } from './adapters/inbound/AccordionItem';
|
|
4
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/accordion/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/accordion/public.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC","sourcesContent":["export type {\n AccordionItemProps,\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n} from '../../types/accordion';\nexport { Accordion } from './adapters/inbound/Accordion';\nexport { AccordionItem } from './adapters/inbound/AccordionItem';\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '
|
|
3
|
-
import type { FormErrors, FormFieldConfig, FormValues } from '
|
|
2
|
+
import type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';
|
|
3
|
+
import type { FormErrors, FormFieldConfig, FormValues } from '../../../../types/form';
|
|
4
4
|
interface AuthFormProps<TName extends string> {
|
|
5
5
|
fields: readonly FormFieldConfig<TName>[];
|
|
6
6
|
values: FormValues<TName>;
|
|
7
7
|
onChange: (values: FormValues<TName>) => void;
|
|
8
|
-
onSubmit
|
|
8
|
+
onSubmit?: (values: FormValues<TName>) => void | Promise<void>;
|
|
9
9
|
errors?: FormErrors<TName>;
|
|
10
10
|
error?: React.ReactNode;
|
|
11
11
|
loading?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthForm.d.ts","sourceRoot":"","sources":["../../../../../src/features/auth/adapters/inbound/AuthForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKtF,UAAU,aAAa,CAAC,KAAK,SAAS,MAAM;IAC1C,MAAM,EAAE,SAAS,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;IAC1C,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;CACxD;AAED,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,KAAK,SAAS,MAAM,EAAE,EAC7C,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAe,EACf,QAAgB,EAChB,WAAsB,EACtB,OAAO,EACP,MAAM,EACN,iBAAiB,GAClB,EAAE,aAAa,CAAC,KAAK,CAAC,qBA8BtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormActions, FormError, useFormController } from '
|
|
3
|
-
import { Stack } from '
|
|
2
|
+
import { FormActions, FormError, useFormController } from '../../../form/public';
|
|
3
|
+
import { Stack } from '../../../layout/public';
|
|
4
4
|
import { AuthFormField } from './AuthFormField';
|
|
5
5
|
/*** Keeps config-driven field orchestration private to the auth patterns that own it. */
|
|
6
6
|
export function AuthForm({ fields, values, onChange, onSubmit, errors, error, loading = false, disabled = false, submitLabel = 'Submit', actions, testID, interactionPolicy, }) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthForm.js","sourceRoot":"","sources":["../../../../../src/features/auth/adapters/inbound/AuthForm.tsx"],"names":[],"mappings":"AAAA,OAAO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ACV,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,GAAG,EAAE;YACb,IAAI,iBAAiB,KAAK,SAAS;gBAAE,KAAK,UAAU,CAAC,YAAY,EAAE,CAAC;QACtE,CAAC,CAAC,CACF,WAAW,CAAC,CAAC,WAAW,CAAC,CAEzB;QAAA,CAAC,OAAO,CACV;MAAA,EAAE,WAAW,CACf;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';\nimport type { FormErrors, FormFieldConfig, FormValues } from '../../../../types/form';\nimport { FormActions, FormError, useFormController } from '../../../form/public';\nimport { Stack } from '../../../layout/public';\nimport { AuthFormField } from './AuthFormField';\n\ninterface AuthFormProps<TName extends string> {\n fields: readonly FormFieldConfig<TName>[];\n values: FormValues<TName>;\n onChange: (values: FormValues<TName>) => void;\n onSubmit?: (values: FormValues<TName>) => void | Promise<void>;\n errors?: FormErrors<TName>;\n error?: React.ReactNode;\n loading?: boolean;\n disabled?: boolean;\n submitLabel?: React.ReactNode;\n actions?: React.ReactNode;\n testID?: string;\n interactionPolicy?: ZoraBaseProps['interactionPolicy'];\n}\n\n/*** Keeps config-driven field orchestration private to the auth patterns that own it. */\nexport function AuthForm<TName extends string>({\n fields,\n values,\n onChange,\n onSubmit,\n errors,\n error,\n loading = false,\n disabled = false,\n submitLabel = 'Submit',\n actions,\n testID,\n interactionPolicy,\n}: AuthFormProps<TName>) {\n const controller = useFormController({ fields, values, errors, onChange, onSubmit });\n return (\n <Stack gap=\"m\" testID={testID}>\n <FormError error={error} />\n {fields.map((field) => (\n <AuthFormField\n key={field.name}\n disabled={disabled}\n error={controller.errors[field.name]}\n field={field}\n interactionPolicy={interactionPolicy}\n loading={loading}\n onChange={controller.setFieldValue}\n value={values[field.name]}\n />\n ))}\n <FormActions\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n loading={loading}\n onSubmit={() => {\n if (interactionPolicy !== 'passive') void controller.handleSubmit();\n }}\n submitLabel={submitLabel}\n >\n {actions}\n </FormActions>\n </Stack>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '
|
|
3
|
-
import type { FormFieldConfig, FormFieldValue } from '
|
|
2
|
+
import type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';
|
|
3
|
+
import type { FormFieldConfig, FormFieldValue } from '../../../../types/form';
|
|
4
4
|
interface AuthFormFieldProps<TName extends string> {
|
|
5
5
|
field: FormFieldConfig<TName>;
|
|
6
6
|
value: FormFieldValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthFormField.d.ts","sourceRoot":"","sources":["../../../../../src/features/auth/adapters/inbound/AuthFormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI9E,UAAU,kBAAkB,CAAC,KAAK,SAAS,MAAM;IAC/C,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACvD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;CACxD;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,KAAK,SAAS,MAAM,EAAE,EAClD,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAgB,EAChB,OAAe,EACf,iBAAiB,GAClB,EAAE,kBAAkB,CAAC,KAAK,CAAC,qBAmC3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormField, hasRequiredRule } from '
|
|
3
|
-
import { TextInput } from '
|
|
2
|
+
import { FormField, hasRequiredRule } from '../../../form/public';
|
|
3
|
+
import { TextInput } from '../../../form/text-input/public';
|
|
4
4
|
/*** Adapts an auth field configuration to the public compositional form primitives. */
|
|
5
5
|
export function AuthFormField({ field, value, onChange, error, disabled = false, loading = false, interactionPolicy, }) {
|
|
6
6
|
const fieldDisabled = disabled || loading || field.disabled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthFormField.js","sourceRoot":"","sources":["../../../../../src/features/auth/adapters/inbound/AuthFormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAY5D,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAAuB,EAClD,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,iBAAiB,GACS;IAC1B,MAAM,aAAa,GAAG,QAAQ,IAAI,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC;IAC5D,OAAO,CACL,CAAC,SAAS,CACR,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,QAAQ,CAAC,CAAC,aAAa,CAAC,CACxB,SAAS,CAAC,CAAC,KAAK,CAAC,CACjB,UAAU,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAC7B,OAAO,CAAC,CAAC,OAAO,CAAC,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B,CAAC,KAAK,CAAC,CAAC,CAC/C,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,SAAS,mBAAmB,CAAC,KAAsB;IACjD,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC,YAAY,CAAC;IAClD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,eAAe,CAAC;IACnD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,YAAY,CAAC;IACzE,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,WAAW,CAAC;IAC7C,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,6EAA6E;AAC7E,SAAS,sBAAsB,CAAC,KAAsB;IACpD,IAAI,KAAK,CAAC,eAAe;QAAE,OAAO,KAAK,CAAC,eAAe,CAAC;IACxD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,cAAc,CAAC;IAClD,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IACjD,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,aAAa,CAAC;IAC/C,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';\nimport type { FormFieldConfig, FormFieldValue } from '../../../../types/form';\nimport { FormField, hasRequiredRule } from '../../../form/public';\nimport { TextInput } from '../../../form/text-input/public';\n\ninterface AuthFormFieldProps<TName extends string> {\n field: FormFieldConfig<TName>;\n value: FormFieldValue;\n onChange: (name: TName, value: FormFieldValue) => void;\n error?: React.ReactNode;\n disabled?: boolean;\n loading?: boolean;\n interactionPolicy?: ZoraBaseProps['interactionPolicy'];\n}\n\n/*** Adapts an auth field configuration to the public compositional form primitives. */\nexport function AuthFormField<TName extends string>({\n field,\n value,\n onChange,\n error,\n disabled = false,\n loading = false,\n interactionPolicy,\n}: AuthFormFieldProps<TName>) {\n const fieldDisabled = disabled || loading || field.disabled;\n return (\n <FormField\n description={field.description}\n disabled={fieldDisabled}\n errorText={error}\n helperText={field.helperText}\n invalid={Boolean(error)}\n label={field.label}\n readOnly={field.readOnly}\n required={field.required ?? hasRequiredRule(field.rules)}\n testID={field.testID}\n >\n <TextInput\n accessibilityLabel={typeof field.label === 'string' ? field.label : undefined}\n autoCapitalize={\n field.autoCapitalize ??\n (['email', 'password', 'url'].includes(field.type ?? 'text') ? 'none' : undefined)\n }\n autoComplete={field.autoComplete}\n disabled={fieldDisabled}\n interactionPolicy={interactionPolicy}\n invalid={Boolean(error)}\n keyboardType={resolveKeyboardType(field)}\n maxLength={field.maxLength}\n onChangeText={(nextValue) => onChange(field.name, nextValue)}\n placeholder={field.placeholder}\n readOnly={field.readOnly}\n secureTextEntry={field.secureTextEntry ?? field.type === 'password'}\n textContentType={resolveTextContentType(field)}\n value={value}\n />\n </FormField>\n );\n}\n\n/*** Resolves the native keyboard for an auth field configuration. */\nfunction resolveKeyboardType(field: FormFieldConfig) {\n if (field.keyboardType) return field.keyboardType;\n if (field.type === 'email') return 'email-address';\n if (field.type === 'number' || field.type === 'otp') return 'number-pad';\n if (field.type === 'tel') return 'phone-pad';\n if (field.type === 'url') return 'url';\n return undefined;\n}\n\n/*** Resolves platform text-content hints for an auth field configuration. */\nfunction resolveTextContentType(field: FormFieldConfig) {\n if (field.textContentType) return field.textContentType;\n if (field.type === 'email') return 'emailAddress';\n if (field.type === 'password') return 'password';\n if (field.type === 'otp') return 'oneTimeCode';\n return undefined;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForgotPasswordForm.d.ts","sourceRoot":"","sources":["../../../../../src/features/auth/adapters/inbound/ForgotPasswordForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAyFtE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,+DAA8C,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
3
|
+
import { Button } from '../../../button/public';
|
|
4
|
+
import { Stack } from '../../../layout/public';
|
|
5
|
+
import { defaultIdentifiers, normalizeIdentifierKind, resolveIdentifierLabel, resolveIdentifierRules, resolveIdentifierType, } from '../../utils/authForm';
|
|
5
6
|
import { AuthForm } from './AuthForm';
|
|
6
|
-
import { defaultIdentifiers, normalizeIdentifierKind, resolveIdentifierLabel, resolveIdentifierRules, resolveIdentifierType, } from './utils';
|
|
7
7
|
function ForgotPasswordFormInner({ themeId: _themeId, mode: _mode, interactionPolicy, identifiers = defaultIdentifiers, identifierLabel, signInLabel = 'Sign in', loading = false, disabled = false, error, submitLabel = 'Send code', onSubmit, onSignIn, testID, }) {
|
|
8
8
|
const [values, setValues] = React.useState({
|
|
9
9
|
identifier: '',
|
|
@@ -17,7 +17,7 @@ function ForgotPasswordFormInner({ themeId: _themeId, mode: _mode, interactionPo
|
|
|
17
17
|
rules: resolveIdentifierRules(identifiers),
|
|
18
18
|
},
|
|
19
19
|
], [identifierLabel, identifiers]);
|
|
20
|
-
const handleSubmit = React.useCallback((formValues) => onSubmit({
|
|
20
|
+
const handleSubmit = React.useCallback((formValues) => onSubmit?.({
|
|
21
21
|
identifier: formValues.identifier.trim(),
|
|
22
22
|
identifierKind: normalizeIdentifierKind(formValues.identifier, identifiers),
|
|
23
23
|
}), [identifiers, onSubmit]);
|