@ankhorage/zora 17.0.0 → 18.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 +6 -0
- package/README.md +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/features/auth/adapters/inbound/AuthFormField.js +3 -3
- package/dist/features/auth/adapters/inbound/AuthFormField.js.map +1 -1
- package/dist/features/form/field/adapters/inbound/Field.d.ts +5 -0
- package/dist/features/form/field/adapters/inbound/Field.d.ts.map +1 -0
- package/dist/features/form/field/adapters/inbound/Field.js +20 -0
- package/dist/features/form/field/adapters/inbound/Field.js.map +1 -0
- package/dist/features/form/{formFieldMeta.d.ts → field/meta.d.ts} +4 -4
- package/dist/features/form/field/meta.d.ts.map +1 -0
- package/dist/features/form/{formFieldMeta.js → field/meta.js} +4 -4
- package/dist/features/form/field/meta.js.map +1 -0
- package/dist/features/form/field/public.d.ts +2 -0
- package/dist/features/form/field/public.d.ts.map +1 -0
- package/dist/features/form/field/public.js +2 -0
- package/dist/features/form/field/public.js.map +1 -0
- package/dist/features/form/formMeta.d.ts +1 -1
- package/dist/features/form/formMeta.js +1 -1
- package/dist/features/form/formMeta.js.map +1 -1
- package/dist/features/form/public.d.ts +2 -2
- package/dist/features/form/public.d.ts.map +1 -1
- package/dist/features/form/public.js +1 -1
- package/dist/features/form/public.js.map +1 -1
- package/dist/features/list/adapters/inbound/List.d.ts +5 -0
- package/dist/features/list/adapters/inbound/List.d.ts.map +1 -0
- package/dist/features/list/adapters/inbound/List.js +34 -0
- package/dist/features/list/adapters/inbound/List.js.map +1 -0
- package/dist/features/list/adapters/inbound/ListItem.d.ts +5 -0
- package/dist/features/list/adapters/inbound/ListItem.d.ts.map +1 -0
- package/dist/features/list/adapters/inbound/ListItem.js +43 -0
- package/dist/features/list/adapters/inbound/ListItem.js.map +1 -0
- package/dist/features/list/adapters/inbound/ListSection.d.ts +5 -0
- package/dist/features/list/adapters/inbound/ListSection.d.ts.map +1 -0
- package/dist/{patterns/list → features/list/adapters/inbound}/ListSection.js +4 -8
- package/dist/features/list/adapters/inbound/ListSection.js.map +1 -0
- package/dist/{patterns → features}/list/meta.d.ts +6 -6
- package/dist/features/list/meta.d.ts.map +1 -0
- package/dist/{patterns → features}/list/meta.js +6 -14
- package/dist/features/list/meta.js.map +1 -0
- package/dist/features/list/public.d.ts +4 -0
- package/dist/features/list/public.d.ts.map +1 -1
- package/dist/features/list/public.js +3 -0
- package/dist/features/list/public.js.map +1 -1
- package/dist/features/list/utils/resolveListSeparator.d.ts +5 -0
- package/dist/features/list/utils/resolveListSeparator.d.ts.map +1 -0
- package/dist/{patterns/list → features/list/utils}/resolveListSeparator.js +1 -0
- package/dist/features/list/utils/resolveListSeparator.js.map +1 -0
- package/dist/features/skeleton/adapters/inbound/SkeletonList.d.ts.map +1 -1
- package/dist/features/skeleton/adapters/inbound/SkeletonList.js +2 -2
- package/dist/features/skeleton/adapters/inbound/SkeletonList.js.map +1 -1
- package/dist/features/uploader/adapters/inbound/Uploader.js +3 -3
- package/dist/features/uploader/adapters/inbound/Uploader.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +1 -1
- package/dist/metadata/bindableComponentMeta.js +1 -1
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.js +4 -4
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.js +3 -3
- package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
- package/dist/patterns/switch-field/SwitchField.d.ts +1 -2
- package/dist/patterns/switch-field/SwitchField.d.ts.map +1 -1
- package/dist/patterns/switch-field/SwitchField.js +3 -4
- package/dist/patterns/switch-field/SwitchField.js.map +1 -1
- package/dist/patterns/tree-view/TreeItem.d.ts.map +1 -1
- package/dist/patterns/tree-view/TreeItem.js +2 -2
- package/dist/patterns/tree-view/TreeItem.js.map +1 -1
- package/dist/registry.js +4 -4
- package/dist/registry.js.map +1 -1
- package/dist/types/form.d.ts +1 -1
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/form.js.map +1 -1
- package/dist/{patterns/list/types.d.ts → types/list.d.ts} +14 -18
- package/dist/types/list.d.ts.map +1 -0
- package/dist/types/list.js +2 -0
- package/dist/types/list.js.map +1 -0
- package/package.json +2 -2
- package/src/constants.ts +1 -1
- package/src/features/auth/adapters/inbound/AuthFormField.tsx +3 -3
- package/src/features/bottom-sheet/public.test.ts +1 -1
- package/src/features/form/{adapters/inbound/FormField.tsx → field/adapters/inbound/Field.tsx} +10 -10
- package/src/features/form/{formFieldMeta.ts → field/meta.ts} +5 -4
- package/src/features/form/field/public.ts +1 -0
- package/src/features/form/formMeta.ts +1 -1
- package/src/features/form/public.ts +2 -2
- package/src/features/list/adapters/inbound/List.tsx +77 -0
- package/src/features/list/adapters/inbound/ListItem.tsx +89 -0
- package/src/{patterns/list → features/list/adapters/inbound}/ListSection.tsx +5 -10
- package/src/{patterns → features}/list/meta.ts +7 -14
- package/src/features/list/public.ts +11 -0
- package/src/features/list/utils/resolveListSeparator.ts +9 -0
- package/src/features/skeleton/adapters/inbound/SkeletonList.tsx +3 -3
- package/src/features/uploader/adapters/inbound/Uploader.tsx +3 -3
- package/src/index.ts +11 -10
- package/src/metadata/bindableComponentMeta.ts +1 -1
- package/src/metadata/componentMeta.test.ts +5 -5
- package/src/metadata/componentMeta.ts +4 -4
- package/src/patterns/inspector-field/InspectorField.tsx +3 -3
- package/src/patterns/switch-field/SwitchField.tsx +8 -8
- package/src/patterns/tree-view/TreeItem.tsx +2 -2
- package/src/registry.ts +4 -4
- package/src/showcaseCoverage.test.ts +2 -2
- package/src/theme/themeScopeStructure.test.ts +5 -5
- package/src/types/form.ts +1 -1
- package/src/{patterns/list/types.ts → types/list.ts} +17 -18
- package/dist/features/form/adapters/inbound/FormField.d.ts +0 -5
- package/dist/features/form/adapters/inbound/FormField.d.ts.map +0 -1
- package/dist/features/form/adapters/inbound/FormField.js +0 -20
- package/dist/features/form/adapters/inbound/FormField.js.map +0 -1
- package/dist/features/form/formFieldMeta.d.ts.map +0 -1
- package/dist/features/form/formFieldMeta.js.map +0 -1
- package/dist/patterns/list/List.d.ts +0 -9
- package/dist/patterns/list/List.d.ts.map +0 -1
- package/dist/patterns/list/List.js +0 -40
- package/dist/patterns/list/List.js.map +0 -1
- package/dist/patterns/list/ListRow.d.ts +0 -9
- package/dist/patterns/list/ListRow.d.ts.map +0 -1
- package/dist/patterns/list/ListRow.js +0 -113
- package/dist/patterns/list/ListRow.js.map +0 -1
- package/dist/patterns/list/ListSection.d.ts +0 -9
- package/dist/patterns/list/ListSection.d.ts.map +0 -1
- package/dist/patterns/list/ListSection.js.map +0 -1
- package/dist/patterns/list/index.d.ts +0 -5
- package/dist/patterns/list/index.d.ts.map +0 -1
- package/dist/patterns/list/index.js +0 -4
- package/dist/patterns/list/index.js.map +0 -1
- package/dist/patterns/list/meta.d.ts.map +0 -1
- package/dist/patterns/list/meta.js.map +0 -1
- package/dist/patterns/list/resolveListSeparator.d.ts +0 -5
- package/dist/patterns/list/resolveListSeparator.d.ts.map +0 -1
- package/dist/patterns/list/resolveListSeparator.js.map +0 -1
- package/dist/patterns/list/types.d.ts.map +0 -1
- package/dist/patterns/list/types.js +0 -2
- package/dist/patterns/list/types.js.map +0 -1
- package/src/patterns/list/List.tsx +0 -77
- package/src/patterns/list/ListRow.tsx +0 -198
- package/src/patterns/list/index.ts +0 -10
- package/src/patterns/list/resolveListSeparator.test.ts +0 -18
- package/src/patterns/list/resolveListSeparator.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 18.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 57e6020: Align form and list capabilities with Surface 7. Rename FormField to Field and ListRow to ListItem, move list ownership into src/features/list, and compose Surface Field, List, and ListItem directly without compatibility aliases.
|
|
8
|
+
|
|
3
9
|
## 17.0.0
|
|
4
10
|
|
|
5
11
|
### 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
|
@@ -13,7 +13,7 @@ export declare const FEATURE_MANIFEST_ELEMENTS: {
|
|
|
13
13
|
readonly 'data-table': readonly ["DataTable"];
|
|
14
14
|
readonly 'date-picker': readonly ["DatePicker"];
|
|
15
15
|
readonly dialog: readonly ["Dialog"];
|
|
16
|
-
readonly form: readonly ["Form", "FormError", "
|
|
16
|
+
readonly form: readonly ["Form", "FormError", "Field"];
|
|
17
17
|
readonly gradient: readonly ["Gradient"];
|
|
18
18
|
readonly button: readonly ["Button", "IconButton", "ButtonGroup"];
|
|
19
19
|
readonly icon: readonly ["Icon"];
|
package/dist/constants.js
CHANGED
|
@@ -20,7 +20,7 @@ export const FEATURE_MANIFEST_ELEMENTS = {
|
|
|
20
20
|
'data-table': ['DataTable'],
|
|
21
21
|
'date-picker': ['DatePicker'],
|
|
22
22
|
dialog: ['Dialog'],
|
|
23
|
-
form: ['Form', 'FormError', '
|
|
23
|
+
form: ['Form', 'FormError', 'Field'],
|
|
24
24
|
gradient: ['Gradient'],
|
|
25
25
|
button: ['Button', 'IconButton', 'ButtonGroup'],
|
|
26
26
|
icon: ['Icon'],
|
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,OA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C,WAAW,CAAC;IAC3B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;IACpC,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,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/B,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,CAAC;IAC5E,IAAI,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IACjC,UAAU,EAAE,CAAC,YAAY,CAAC;IAC1B,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAC;IACtE,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC;IAC5C,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,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 dialog: ['Dialog'],\n form: ['Form', 'FormError', 'Field'],\n gradient: ['Gradient'],\n button: ['Button', 'IconButton', 'ButtonGroup'],\n icon: ['Icon'],\n image: ['Image'],\n 'keyboard-avoiding-view': ['KeyboardAvoidingView'],\n 'content-rail': ['ContentRail'],\n layout: ['Divider', 'Grid', 'Screen', 'ScreenSection', 'ScrollView', 'View'],\n list: ['FlatList', 'SectionList'],\n pagination: ['Pagination'],\n rating: ['Rating'],\n skeleton: ['Skeleton', 'SkeletonCard', 'SkeletonList', 'SkeletonText'],\n tabs: ['Tabs', 'TabList', 'Tab', 'TabPanel'],\n toolbar: ['Toolbar'],\n typography: ['Heading', 'Text'],\n 'time-picker': ['TimePicker'],\n uploader: ['Uploader'],\n 'bottom-sheet': ['BottomSheet'],\n} as const;\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Field, hasRequiredRule } from '../../../form/public';
|
|
3
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;
|
|
7
|
-
return (<
|
|
7
|
+
return (<Field description={field.description} disabled={fieldDisabled} errorText={error} helperText={field.helperText} invalid={Boolean(error)} label={field.label} readOnly={field.readOnly} required={field.required ?? hasRequiredRule(field.rules)} testID={field.testID}>
|
|
8
8
|
<TextInput accessibilityLabel={typeof field.label === 'string' ? field.label : undefined} autoCapitalize={field.autoCapitalize ??
|
|
9
9
|
(['email', 'password', 'url'].includes(field.type ?? 'text') ? 'none' : undefined)} autoComplete={field.autoComplete} disabled={fieldDisabled} interactionPolicy={interactionPolicy} invalid={Boolean(error)} keyboardType={resolveKeyboardType(field)} maxLength={field.maxLength} onChangeText={(nextValue) => onChange(field.name, nextValue)} placeholder={field.placeholder} readOnly={field.readOnly} secureTextEntry={field.secureTextEntry ?? field.type === 'password'} textContentType={resolveTextContentType(field)} value={value}/>
|
|
10
|
-
</
|
|
10
|
+
</Field>);
|
|
11
11
|
}
|
|
12
12
|
/*** Resolves the native keyboard for an auth field configuration. */
|
|
13
13
|
function resolveKeyboardType(field) {
|
|
@@ -1 +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,
|
|
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,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC9D,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,KAAK,CACJ,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,K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,CAAC,KAAK,CAAC,CAAC,CAC/C,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,KAAK,CAAC,CACT,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 { Field, 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 <Field\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 </Field>\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,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FieldProps } from '../../../../../types/form';
|
|
3
|
+
/*** Groups one form control with its label, description, helper text, and field error. */
|
|
4
|
+
export declare const Field: (props: FieldProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/field/adapters/inbound/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAoC5D,0FAA0F;AAC1F,eAAO,MAAM,KAAK,kDAAiC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Field as SurfaceField } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { View } from '../../../../layout/public';
|
|
5
|
+
import { Text } from '../../../../typography/public';
|
|
6
|
+
function FieldInner({ themeId: _themeId, mode: _mode, label, description, helperText, children, interactionPolicy: _interactionPolicy, ...props }) {
|
|
7
|
+
return (<SurfaceField {...props} helperText={helperText} label={<View gap="xs">
|
|
8
|
+
<Text variant="label" weight="semiBold">
|
|
9
|
+
{label}
|
|
10
|
+
</Text>
|
|
11
|
+
{description ? (<Text emphasis="muted" variant="bodySmall">
|
|
12
|
+
{description}
|
|
13
|
+
</Text>) : null}
|
|
14
|
+
</View>}>
|
|
15
|
+
{children}
|
|
16
|
+
</SurfaceField>);
|
|
17
|
+
}
|
|
18
|
+
/*** Groups one form control with its label, description, helper text, and field error. */
|
|
19
|
+
export const Field = withZoraThemeScope(FieldInner);
|
|
20
|
+
//# sourceMappingURL=Field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../../../src/features/form/field/adapters/inbound/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,SAAS,UAAU,CAAC,EAClB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,KAAK,EACG;IACX,OAAO,CACL,CAAC,YAAY,CACX,IAAI,KAAK,CAAC,CACV,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CACZ;UAAA,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CACrC;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACxC;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,IAAI,CACR,CAAC,CAED;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,YAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { Field as SurfaceField } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';\nimport type { FieldProps } from '../../../../../types/form';\nimport { View } from '../../../../layout/public';\nimport { Text } from '../../../../typography/public';\n\nfunction FieldInner({\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n helperText,\n children,\n interactionPolicy: _interactionPolicy,\n ...props\n}: FieldProps) {\n return (\n <SurfaceField\n {...props}\n helperText={helperText}\n label={\n <View gap=\"xs\">\n <Text variant=\"label\" weight=\"semiBold\">\n {label}\n </Text>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n }\n >\n {children}\n </SurfaceField>\n );\n}\n\n/*** Groups one form control with its label, description, helper text, and field error. */\nexport const Field = withZoraThemeScope(FieldInner);\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
readonly name: "
|
|
1
|
+
export declare const fieldMeta: {
|
|
2
|
+
readonly name: "Field";
|
|
3
3
|
readonly category: "component";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
5
|
readonly allowedChildren: readonly ["Checkbox", "CheckboxGroup", "RadioGroup", "SearchInput", "Select", "TextInput"];
|
|
6
6
|
readonly blueprint: {
|
|
7
|
-
readonly label: "
|
|
7
|
+
readonly label: "Field";
|
|
8
8
|
readonly defaultProps: {
|
|
9
9
|
readonly label: "Label";
|
|
10
10
|
};
|
|
@@ -78,4 +78,4 @@ export declare const formFieldMeta: {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=
|
|
81
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/features/form/field/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const
|
|
2
|
-
name: '
|
|
1
|
+
export const fieldMeta = {
|
|
2
|
+
name: 'Field',
|
|
3
3
|
category: 'component',
|
|
4
4
|
directManifestNode: true,
|
|
5
5
|
allowedChildren: [
|
|
@@ -10,7 +10,7 @@ export const formFieldMeta = {
|
|
|
10
10
|
'Select',
|
|
11
11
|
'TextInput',
|
|
12
12
|
],
|
|
13
|
-
blueprint: { label: '
|
|
13
|
+
blueprint: { label: 'Field', defaultProps: { label: 'Label' } },
|
|
14
14
|
bindings: {
|
|
15
15
|
props: {
|
|
16
16
|
errorText: {
|
|
@@ -39,4 +39,4 @@ export const formFieldMeta = {
|
|
|
39
39
|
readOnly: { type: 'boolean', category: 'State', label: 'Read-only', default: false },
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../../src/features/form/field/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE;QACf,UAAU;QACV,eAAe;QACf,YAAY;QACZ,aAAa;QACb,QAAQ;QACR,WAAW;KACZ;IACD,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAC/D,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,+BAA+B;gBAC5C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,eAAe,EAAE,IAAI;aACtB;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,gCAAgC;gBAC7C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,eAAe,EAAE,IAAI;gBACrB,iBAAiB,EAAE,IAAI;aACxB;SACF;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;QAChF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE;QAC1E,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE;QACzE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;QAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;QACxF,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;QACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;QACnF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE;KACrF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../../metadata';\n\nexport const fieldMeta = {\n name: 'Field',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [\n 'Checkbox',\n 'CheckboxGroup',\n 'RadioGroup',\n 'SearchInput',\n 'Select',\n 'TextInput',\n ],\n blueprint: { label: 'Field', defaultProps: { label: 'Label' } },\n bindings: {\n props: {\n errorText: {\n label: 'Error text',\n description: 'Field-level validation error.',\n value: { type: 'unknown' },\n acceptsFallback: true,\n },\n disabled: {\n label: 'Disabled',\n description: 'Whether the field is disabled.',\n value: { type: 'boolean' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n },\n props: {\n label: { type: 'string', category: 'Content', label: 'Label', default: 'Label' },\n description: { type: 'string', category: 'Content', label: 'Description' },\n helperText: { type: 'string', category: 'Content', label: 'Helper text' },\n errorText: { type: 'string', category: 'Validation', label: 'Error text' },\n required: { type: 'boolean', category: 'Validation', label: 'Required', default: false },\n invalid: { type: 'boolean', category: 'Validation', label: 'Invalid', default: false },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n readOnly: { type: 'boolean', category: 'State', label: 'Read-only', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/features/form/field/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/features/form/field/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { Field } from './adapters/inbound/Field';\n"]}
|
|
@@ -2,7 +2,7 @@ export declare const formMeta: {
|
|
|
2
2
|
readonly name: "Form";
|
|
3
3
|
readonly category: "component";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["FormError", "
|
|
5
|
+
readonly allowedChildren: readonly ["FormError", "Field"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Form";
|
|
8
8
|
readonly defaultProps: {
|
|
@@ -2,7 +2,7 @@ export const formMeta = {
|
|
|
2
2
|
name: 'Form',
|
|
3
3
|
category: 'component',
|
|
4
4
|
directManifestNode: true,
|
|
5
|
-
allowedChildren: ['FormError', '
|
|
5
|
+
allowedChildren: ['FormError', 'Field'],
|
|
6
6
|
blueprint: {
|
|
7
7
|
label: 'Form',
|
|
8
8
|
defaultProps: { submitLabel: 'Submit', loading: false, disabled: false },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formMeta.js","sourceRoot":"","sources":["../../../src/features/form/formMeta.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"formMeta.js","sourceRoot":"","sources":["../../../src/features/form/formMeta.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;IACvC,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;KACzE;IACD,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,kCAAkC;gBAC/C,OAAO,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE;aAClD;SACF;KACF;IACD,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,qCAAqC;YAClD,aAAa,EAAE,EAAE;SAClB;KACF;IACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE;IACpF,KAAK,EAAE;QACL,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9F,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;QACjF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;KACpF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nexport const formMeta = {\n name: 'Form',\n category: 'component',\n directManifestNode: true,\n allowedChildren: ['FormError', 'Field'],\n blueprint: {\n label: 'Form',\n defaultProps: { submitLabel: 'Submit', loading: false, disabled: false },\n },\n bindings: {\n events: {\n submit: {\n label: 'Submit',\n description: 'Runs when the form is submitted.',\n payload: { eventType: 'form.submit', fields: [] },\n },\n },\n },\n events: {\n submit: {\n label: 'Submit',\n eventType: 'form.submit',\n description: 'Emitted when the form is submitted.',\n payloadFields: [],\n },\n },\n slots: { actions: { label: 'Actions', allowedChildren: ['Button', 'ButtonGroup'] } },\n props: {\n submitLabel: { type: 'string', category: 'Content', label: 'Submit label', default: 'Submit' },\n loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type { FormActionsProps, FormErrorProps, FormErrors, FormFieldConfig, FormFieldInputType,
|
|
1
|
+
export type { FieldProps, FormActionsProps, FormErrorProps, FormErrors, FormFieldConfig, FormFieldInputType, FormProps, FormValidationErrors, FormValidationResult, FormValues, UseFormControllerOptions, UseFormControllerResult, ValidationRule, } from '../../types/form';
|
|
2
2
|
export { Form } from './adapters/inbound/Form';
|
|
3
3
|
export { FormActions } from './adapters/inbound/FormActions';
|
|
4
4
|
export { FormError } from './adapters/inbound/FormError';
|
|
5
|
-
export {
|
|
5
|
+
export { Field } from './field/public';
|
|
6
6
|
export { useFormController } from './useFormController';
|
|
7
7
|
export { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';
|
|
8
8
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/form/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/form/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,wBAAwB,EACxB,uBAAuB,EACvB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Form } from './adapters/inbound/Form';
|
|
2
2
|
export { FormActions } from './adapters/inbound/FormActions';
|
|
3
3
|
export { FormError } from './adapters/inbound/FormError';
|
|
4
|
-
export {
|
|
4
|
+
export { Field } from './field/public';
|
|
5
5
|
export { useFormController } from './useFormController';
|
|
6
6
|
export { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';
|
|
7
7
|
//# sourceMappingURL=public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/form/public.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/form/public.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export type {\n FieldProps,\n FormActionsProps,\n FormErrorProps,\n FormErrors,\n FormFieldConfig,\n FormFieldInputType,\n FormProps,\n FormValidationErrors,\n FormValidationResult,\n FormValues,\n UseFormControllerOptions,\n UseFormControllerResult,\n ValidationRule,\n} from '../../types/form';\nexport { Form } from './adapters/inbound/Form';\nexport { FormActions } from './adapters/inbound/FormActions';\nexport { FormError } from './adapters/inbound/FormError';\nexport { Field } from './field/public';\nexport { useFormController } from './useFormController';\nexport { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ListProps } from '../../../../types/list';
|
|
3
|
+
/*** List composition built on the Surface list boundary with ZORA item/separator policy. */
|
|
4
|
+
export declare const List: (props: ListProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/List.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAIV,SAAS,EACV,MAAM,wBAAwB,CAAC;AAkEhC,4FAA4F;AAC5F,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { List as SurfaceList } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { Divider, View } from '../../../layout/public';
|
|
5
|
+
import { resolveListSeparator } from '../../utils/resolveListSeparator';
|
|
6
|
+
import { ListItem } from './ListItem';
|
|
7
|
+
function resolveItemVariant({ item, defaultVariant, }) {
|
|
8
|
+
return item.variant ?? defaultVariant;
|
|
9
|
+
}
|
|
10
|
+
function resolveItemCompact({ item, compact, }) {
|
|
11
|
+
return item.compact ?? compact ?? false;
|
|
12
|
+
}
|
|
13
|
+
function ListItemsInner({ themeId: _themeId, mode: _mode, testID, items, itemVariant = 'divider', compact, }) {
|
|
14
|
+
return (<SurfaceList testID={testID}>
|
|
15
|
+
{items.map((item, index) => {
|
|
16
|
+
const effectiveVariant = resolveItemVariant({ item, defaultVariant: itemVariant });
|
|
17
|
+
const separator = resolveListSeparator(effectiveVariant, index);
|
|
18
|
+
return (<React.Fragment key={String(index)}>
|
|
19
|
+
{separator === 'divider' ? <Divider /> : null}
|
|
20
|
+
{separator === 'spacer' ? <View height="s"/> : null}
|
|
21
|
+
<ListItem {...item} compact={resolveItemCompact({ item, compact })} variant={effectiveVariant}/>
|
|
22
|
+
</React.Fragment>);
|
|
23
|
+
})}
|
|
24
|
+
</SurfaceList>);
|
|
25
|
+
}
|
|
26
|
+
function ListInner(props) {
|
|
27
|
+
if ('items' in props)
|
|
28
|
+
return <ListItemsInner {...props}/>;
|
|
29
|
+
const { themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy, children, testID, } = props;
|
|
30
|
+
return <SurfaceList testID={testID}>{children}</SurfaceList>;
|
|
31
|
+
}
|
|
32
|
+
/*** List composition built on the Surface list boundary with ZORA item/separator policy. */
|
|
33
|
+
export const List = withZoraThemeScope(ListInner);
|
|
34
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/List.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO1E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,SAAS,kBAAkB,CAAC,EAC1B,IAAI,EACJ,cAAc,GAIf;IACC,OAAO,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC;AACxC,CAAC;AAED,SAAS,kBAAkB,CAAC,EAC1B,IAAI,EACJ,OAAO,GAIR;IACC,OAAO,IAAI,CAAC,OAAO,IAAI,OAAO,IAAI,KAAK,CAAC;AAC1C,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,MAAM,EACN,KAAK,EACL,WAAW,GAAG,SAAS,EACvB,OAAO,GACQ;IACf,OAAO,CACL,CAAC,WAAW,CAAC,MAAM,CAAC,CAA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AW,CAAC,CAAC;AAC/D,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { List as SurfaceList } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n ListItemProps,\n ListItemsProps,\n ListItemVariant,\n ListProps,\n} from '../../../../types/list';\nimport { Divider, View } from '../../../layout/public';\nimport { resolveListSeparator } from '../../utils/resolveListSeparator';\nimport { ListItem } from './ListItem';\n\nfunction resolveItemVariant({\n item,\n defaultVariant,\n}: {\n item: ListItemProps;\n defaultVariant: ListItemVariant;\n}): ListItemVariant {\n return item.variant ?? defaultVariant;\n}\n\nfunction resolveItemCompact({\n item,\n compact,\n}: {\n item: ListItemProps;\n compact: boolean | undefined;\n}): boolean {\n return item.compact ?? compact ?? false;\n}\n\nfunction ListItemsInner({\n themeId: _themeId,\n mode: _mode,\n testID,\n items,\n itemVariant = 'divider',\n compact,\n}: ListItemsProps) {\n return (\n <SurfaceList testID={testID}>\n {items.map((item, index) => {\n const effectiveVariant = resolveItemVariant({ item, defaultVariant: itemVariant });\n const separator = resolveListSeparator(effectiveVariant, index);\n return (\n <React.Fragment key={String(index)}>\n {separator === 'divider' ? <Divider /> : null}\n {separator === 'spacer' ? <View height=\"s\" /> : null}\n <ListItem\n {...item}\n compact={resolveItemCompact({ item, compact })}\n variant={effectiveVariant}\n />\n </React.Fragment>\n );\n })}\n </SurfaceList>\n );\n}\n\nfunction ListInner(props: ListProps) {\n if ('items' in props) return <ListItemsInner {...props} />;\n const {\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n children,\n testID,\n } = props;\n return <SurfaceList testID={testID}>{children}</SurfaceList>;\n}\n\n/*** List composition built on the Surface list boundary with ZORA item/separator policy. */\nexport const List = withZoraThemeScope(ListInner);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ListItemProps } from '../../../../types/list';
|
|
3
|
+
/*** Opinionated list item built on the Surface list-item interaction and geometry boundary. */
|
|
4
|
+
export declare const ListItem: (props: ListItemProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,wBAAwB,CAAC;AAkF7E,+FAA+F;AAC/F,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ListItem as SurfaceListItem } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
4
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
5
|
+
import { View } from '../../../layout/public';
|
|
6
|
+
import { Text } from '../../../typography/public';
|
|
7
|
+
function ListItemInner({ themeId: _themeId, mode: _mode, testID, interactionPolicy, title, description, meta, leading, trailing, action, onPress, selected = false, disabled = false, compact = false, variant = 'divider', }) {
|
|
8
|
+
const { theme } = useZoraTheme();
|
|
9
|
+
const trailingContent = renderTrailing(trailing, action);
|
|
10
|
+
return (<View bg={variant === 'card' ? theme.semantics.surface.raised : 'transparent'} borderColor={selected
|
|
11
|
+
? theme.semantics.border.focus
|
|
12
|
+
: variant === 'card'
|
|
13
|
+
? theme.semantics.border.default
|
|
14
|
+
: 'transparent'} borderWidth={variant === 'card' || selected ? 1 : 0} overflow="hidden" radius={resolveRadius(variant)}>
|
|
15
|
+
<SurfaceListItem compact={compact} disabled={disabled} interactionPolicy={interactionPolicy} leading={leading} onPress={action ? undefined : onPress} selected={selected} testID={testID} trailing={trailingContent}>
|
|
16
|
+
<View gap="xxs">
|
|
17
|
+
<Text variant="body" weight={selected ? 'semiBold' : 'medium'}>
|
|
18
|
+
{title}
|
|
19
|
+
</Text>
|
|
20
|
+
{description ? (<Text emphasis="muted" variant="bodySmall">
|
|
21
|
+
{description}
|
|
22
|
+
</Text>) : null}
|
|
23
|
+
{meta ? (<Text emphasis="subtle" variant="caption">
|
|
24
|
+
{meta}
|
|
25
|
+
</Text>) : null}
|
|
26
|
+
</View>
|
|
27
|
+
</SurfaceListItem>
|
|
28
|
+
</View>);
|
|
29
|
+
}
|
|
30
|
+
function resolveRadius(variant) {
|
|
31
|
+
return variant === 'card' ? 'l' : 'm';
|
|
32
|
+
}
|
|
33
|
+
function renderTrailing(trailing, action) {
|
|
34
|
+
if (!trailing && !action)
|
|
35
|
+
return undefined;
|
|
36
|
+
return (<View align="center" direction="row" gap="s" wrap="nowrap">
|
|
37
|
+
{trailing}
|
|
38
|
+
{action}
|
|
39
|
+
</View>);
|
|
40
|
+
}
|
|
41
|
+
/*** Opinionated list item built on the Surface list-item interaction and geometry boundary. */
|
|
42
|
+
export const ListItem = withZoraThemeScope(ListItemInner);
|
|
43
|
+
//# sourceMappingURL=ListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,SAAS,aAAa,CAAC,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI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F;AAC/F,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { ListItem as SurfaceListItem } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { ListItemProps, ListItemVariant } from '../../../../types/list';\nimport { View } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\n\nfunction ListItemInner({\n themeId: _themeId,\n mode: _mode,\n testID,\n interactionPolicy,\n title,\n description,\n meta,\n leading,\n trailing,\n action,\n onPress,\n selected = false,\n disabled = false,\n compact = false,\n variant = 'divider',\n}: ListItemProps) {\n const { theme } = useZoraTheme();\n const trailingContent = renderTrailing(trailing, action);\n\n return (\n <View\n bg={variant === 'card' ? theme.semantics.surface.raised : 'transparent'}\n borderColor={\n selected\n ? theme.semantics.border.focus\n : variant === 'card'\n ? theme.semantics.border.default\n : 'transparent'\n }\n borderWidth={variant === 'card' || selected ? 1 : 0}\n overflow=\"hidden\"\n radius={resolveRadius(variant)}\n >\n <SurfaceListItem\n compact={compact}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n leading={leading}\n onPress={action ? undefined : onPress}\n selected={selected}\n testID={testID}\n trailing={trailingContent}\n >\n <View gap=\"xxs\">\n <Text variant=\"body\" weight={selected ? 'semiBold' : 'medium'}>\n {title}\n </Text>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n {meta ? (\n <Text emphasis=\"subtle\" variant=\"caption\">\n {meta}\n </Text>\n ) : null}\n </View>\n </SurfaceListItem>\n </View>\n );\n}\n\nfunction resolveRadius(variant: ListItemVariant) {\n return variant === 'card' ? ('l' as const) : ('m' as const);\n}\n\nfunction renderTrailing(trailing: React.ReactNode, action: React.ReactNode) {\n if (!trailing && !action) return undefined;\n return (\n <View align=\"center\" direction=\"row\" gap=\"s\" wrap=\"nowrap\">\n {trailing}\n {action}\n </View>\n );\n}\n\n/*** Opinionated list item built on the Surface list-item interaction and geometry boundary. */\nexport const ListItem = withZoraThemeScope(ListItemInner);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ListSectionProps } from '../../../../types/list';
|
|
3
|
+
/*** Section wrapper for lists with optional ZORA section-heading semantics. */
|
|
4
|
+
export declare const ListSection: (props: ListSectionProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=ListSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListSection.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA8B/D,+EAA+E;AAC/E,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { withZoraThemeScope } from '
|
|
4
|
-
import {
|
|
2
|
+
import { SectionHeader } from '../../../../patterns/section-header';
|
|
3
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { View } from '../../../layout/public';
|
|
5
5
|
import { List } from './List';
|
|
6
6
|
function ListSectionInner({ themeId: _themeId, mode: _mode, testID, title, description, eyebrow, actions, ...props }) {
|
|
7
7
|
const hasHeader = title !== undefined;
|
|
@@ -10,10 +10,6 @@ function ListSectionInner({ themeId: _themeId, mode: _mode, testID, title, descr
|
|
|
10
10
|
<List {...props}/>
|
|
11
11
|
</View>);
|
|
12
12
|
}
|
|
13
|
-
/***
|
|
14
|
-
* Section wrapper for lists with optional title and description.
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
*/
|
|
13
|
+
/*** Section wrapper for lists with optional ZORA section-heading semantics. */
|
|
18
14
|
export const ListSection = withZoraThemeScope(ListSectionInner);
|
|
19
15
|
//# sourceMappingURL=ListSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListSection.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,MAAM,EACN,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACS;IACjB,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,CAAC;IACtC,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC3B;MAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CACX,CAAC,aAAa,CACZ,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,EAClB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { SectionHeader } from '../../../../patterns/section-header';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { ListSectionProps } from '../../../../types/list';\nimport { View } from '../../../layout/public';\nimport { List } from './List';\n\nfunction ListSectionInner({\n themeId: _themeId,\n mode: _mode,\n testID,\n title,\n description,\n eyebrow,\n actions,\n ...props\n}: ListSectionProps) {\n const hasHeader = title !== undefined;\n return (\n <View gap=\"s\" testID={testID}>\n {hasHeader ? (\n <SectionHeader\n actions={actions}\n description={description}\n eyebrow={eyebrow}\n title={title}\n />\n ) : null}\n <List {...props} />\n </View>\n );\n}\n\n/*** Section wrapper for lists with optional ZORA section-heading semantics. */\nexport const ListSection = withZoraThemeScope(ListSectionInner);\n"]}
|
|
@@ -3,20 +3,20 @@ export declare const listMeta: {
|
|
|
3
3
|
readonly category: "pattern";
|
|
4
4
|
readonly directManifestNode: false;
|
|
5
5
|
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "List
|
|
6
|
+
readonly note: "List feature component; collection authoring is represented through List metadata.";
|
|
7
7
|
readonly props: {};
|
|
8
8
|
};
|
|
9
|
-
export declare const
|
|
10
|
-
readonly name: "
|
|
9
|
+
export declare const listItemMeta: {
|
|
10
|
+
readonly name: "ListItem";
|
|
11
11
|
readonly category: "pattern";
|
|
12
12
|
readonly directManifestNode: false;
|
|
13
13
|
readonly allowedChildren: readonly [];
|
|
14
|
-
readonly note: "List
|
|
14
|
+
readonly note: "List feature component; collection authoring is represented through List metadata.";
|
|
15
15
|
readonly events: {
|
|
16
16
|
readonly itemPress: {
|
|
17
17
|
readonly label: "Item press";
|
|
18
18
|
readonly eventType: "collection.itemPress";
|
|
19
|
-
readonly description: "Emitted when a collection item
|
|
19
|
+
readonly description: "Emitted when a collection item is selected.";
|
|
20
20
|
readonly payloadFields: readonly [{
|
|
21
21
|
readonly path: "payload.itemId";
|
|
22
22
|
readonly type: "string";
|
|
@@ -35,7 +35,7 @@ export declare const listSectionMeta: {
|
|
|
35
35
|
readonly category: "pattern";
|
|
36
36
|
readonly directManifestNode: false;
|
|
37
37
|
readonly allowedChildren: readonly [];
|
|
38
|
-
readonly note: "List
|
|
38
|
+
readonly note: "List feature component; collection authoring is represented through List metadata.";
|
|
39
39
|
readonly props: {};
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/features/list/meta.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;;;;;CAOiB,CAAC;AAEvC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;CAkBa,CAAC;AAEvC,eAAO,MAAM,eAAe;;;;;;;CAOU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const LIST_NOTE = 'List
|
|
1
|
+
const LIST_NOTE = 'List feature component; collection authoring is represented through List metadata.';
|
|
2
2
|
export const listMeta = {
|
|
3
3
|
name: 'List',
|
|
4
4
|
category: 'pattern',
|
|
@@ -7,8 +7,8 @@ export const listMeta = {
|
|
|
7
7
|
note: LIST_NOTE,
|
|
8
8
|
props: {},
|
|
9
9
|
};
|
|
10
|
-
export const
|
|
11
|
-
name: '
|
|
10
|
+
export const listItemMeta = {
|
|
11
|
+
name: 'ListItem',
|
|
12
12
|
category: 'pattern',
|
|
13
13
|
directManifestNode: false,
|
|
14
14
|
allowedChildren: [],
|
|
@@ -17,18 +17,10 @@ export const listRowMeta = {
|
|
|
17
17
|
itemPress: {
|
|
18
18
|
label: 'Item press',
|
|
19
19
|
eventType: 'collection.itemPress',
|
|
20
|
-
description: 'Emitted when a collection item
|
|
20
|
+
description: 'Emitted when a collection item is selected.',
|
|
21
21
|
payloadFields: [
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
type: 'string',
|
|
25
|
-
label: 'Item ID',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
path: 'payload.item',
|
|
29
|
-
type: 'record',
|
|
30
|
-
label: 'Item',
|
|
31
|
-
},
|
|
22
|
+
{ path: 'payload.itemId', type: 'string', label: 'Item ID' },
|
|
23
|
+
{ path: 'payload.item', type: 'record', label: 'Item' },
|
|
32
24
|
],
|
|
33
25
|
},
|
|
34
26
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/features/list/meta.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GACb,oFAAoF,CAAC;AAEvF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,SAAS;IACnB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,EAAE;CAC2B,CAAC;AAEvC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,SAAS;IACnB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,SAAS,EAAE,sBAAsB;YACjC,WAAW,EAAE,6CAA6C;YAC1D,aAAa,EAAE;gBACb,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;gBAC5D,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;aACxD;SACF;KACF;IACD,KAAK,EAAE,EAAE;CAC2B,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,SAAS;IACnB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nconst LIST_NOTE =\n 'List feature component; collection authoring is represented through List metadata.';\n\nexport const listMeta = {\n name: 'List',\n category: 'pattern',\n directManifestNode: false,\n allowedChildren: [],\n note: LIST_NOTE,\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const listItemMeta = {\n name: 'ListItem',\n category: 'pattern',\n directManifestNode: false,\n allowedChildren: [],\n note: LIST_NOTE,\n events: {\n itemPress: {\n label: 'Item press',\n eventType: 'collection.itemPress',\n description: 'Emitted when a collection item is selected.',\n payloadFields: [\n { path: 'payload.itemId', type: 'string', label: 'Item ID' },\n { path: 'payload.item', type: 'record', label: 'Item' },\n ],\n },\n },\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const listSectionMeta = {\n name: 'ListSection',\n category: 'pattern',\n directManifestNode: false,\n allowedChildren: [],\n note: LIST_NOTE,\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export type { ListChildrenProps, ListItemProps, ListItemsProps, ListItemVariant, ListProps, ListSectionProps, } from '../../types/list';
|
|
1
2
|
export type { ManifestListProps, ManifestListSection, ManifestSectionListProps, } from '../../types/manifest-list';
|
|
2
3
|
export { FlatList } from './adapters/inbound/FlatList';
|
|
4
|
+
export { List } from './adapters/inbound/List';
|
|
5
|
+
export { ListItem } from './adapters/inbound/ListItem';
|
|
6
|
+
export { ListSection } from './adapters/inbound/ListSection';
|
|
3
7
|
export { SectionList } from './adapters/inbound/SectionList';
|
|
4
8
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,eAAe,EACf,SAAS,EACT,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { FlatList } from './adapters/inbound/FlatList';
|
|
2
|
+
export { List } from './adapters/inbound/List';
|
|
3
|
+
export { ListItem } from './adapters/inbound/ListItem';
|
|
4
|
+
export { ListSection } from './adapters/inbound/ListSection';
|
|
2
5
|
export { SectionList } from './adapters/inbound/SectionList';
|
|
3
6
|
//# sourceMappingURL=public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["export type {\n ListChildrenProps,\n ListItemProps,\n ListItemsProps,\n ListItemVariant,\n ListProps,\n ListSectionProps,\n} from '../../types/list';\nexport type {\n ManifestListProps,\n ManifestListSection,\n ManifestSectionListProps,\n} from '../../types/manifest-list';\nexport { FlatList } from './adapters/inbound/FlatList';\nexport { List } from './adapters/inbound/List';\nexport { ListItem } from './adapters/inbound/ListItem';\nexport { ListSection } from './adapters/inbound/ListSection';\nexport { SectionList } from './adapters/inbound/SectionList';\n"]}
|