@ankhorage/zora 17.0.0 → 18.0.1
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 +12 -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/chip/adapters/inbound/Chip.js +3 -3
- package/dist/features/chip/adapters/inbound/Chip.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/chat-list-item/ChatListItem.js +3 -3
- package/dist/patterns/chat-list-item/ChatListItem.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/message-bubble/MessageBubble.js +3 -3
- package/dist/patterns/message-bubble/MessageBubble.js.map +1 -1
- package/dist/patterns/selection/SelectableItem.js +4 -4
- package/dist/patterns/selection/SelectableItem.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/chip/adapters/inbound/Chip.tsx +3 -3
- 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/chat-list-item/ChatListItem.tsx +3 -3
- package/src/patterns/inspector-field/InspectorField.tsx +3 -3
- package/src/patterns/message-bubble/MessageBubble.tsx +3 -3
- package/src/patterns/selection/SelectableItem.tsx +4 -4
- package/src/patterns/switch-field/SwitchField.tsx +8 -8
- package/src/patterns/tree-view/TreeItem.tsx +2 -2
- package/src/platformAcceptance.test.ts +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,MAAM,EACN,iBAAiB,GACA;IACjB,OAAO,CACL,CAAC,QAAQ,CACP,MAAM,CAAC,CACL,CAAC,MAAM,CACL,OAAO,CAAC,CAAC,KAAK,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,eAAe,CAAC,CAAC,aAAa,CAAC,EAEnC,CAAC,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,MAAM,EACd,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { Switch } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { ListItem } from '../../features/list/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SwitchFieldProps } from './types';\n\nfunction SwitchFieldInner({\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n value,\n onValueChange,\n disabled,\n testID,\n interactionPolicy,\n}: SwitchFieldProps) {\n return (\n <ListItem\n action={\n <Switch\n checked={value}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n onCheckedChange={onValueChange}\n />\n }\n description={description}\n disabled={disabled}\n testID={testID}\n title={label}\n variant=\"card\"\n />\n );\n}\n\n/***\n * Labeled switch field pattern built on the card-style `ListItem` presentation.\n *\n */\nexport const SwitchField = withZoraThemeScope(SwitchFieldInner);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,UAAU,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IACxE,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,SAAS,GAAG,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACnE;AA+ED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAlFE,GAAG,SAAS,MAAM,kEAkFgB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconButton } from '../../features/button/public';
|
|
3
3
|
import { View } from '../../features/layout/public';
|
|
4
|
+
import { ListItem } from '../../features/list/public';
|
|
4
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
-
import { ListRow } from '../list';
|
|
6
6
|
function TreeItemInner({ themeId: _themeId, mode: _mode, node, depth, selectedId, expandedIds, onSelect, onToggleExpand, renderItem, testID, interactionPolicy, }) {
|
|
7
7
|
const hasChildren = node.children !== undefined && node.children.length > 0;
|
|
8
8
|
const isExpanded = expandedIds.includes(node.id);
|
|
@@ -17,7 +17,7 @@ function TreeItemInner({ themeId: _themeId, mode: _mode, node, depth, selectedId
|
|
|
17
17
|
hasChildren,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
return (<
|
|
20
|
+
return (<ListItem title={node.label} action={<View direction="row" gap="xs" align="center">
|
|
21
21
|
{node.actions}
|
|
22
22
|
{hasChildren ? (<IconButton icon={{ name: isExpanded ? 'chevron-down-outline' : 'chevron-forward-outline' }} interactionPolicy={interactionPolicy} label={isExpanded ? 'Collapse' : 'Expand'} onPress={() => onToggleExpand(node.id)} size="s" variant="ghost"/>) : null}
|
|
23
23
|
</View>} meta={node.meta} disabled={node.disabled} selected={isSelected}/>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItem.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TreeItem.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAcpE,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,EACJ,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,UAAU,EACV,MAAM,EACN,iBAAiB,GACE;IACnB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC;gBAChB,IAAI;gB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AAC,CAAC,CAAC,CAC3B,CAAC,IAAI,CACH;UAAA,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7B,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CACd,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,IAAI,CAAC,CAAC,KAAK,CAAC,CACZ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { IconButton } from '../../features/button/public';\nimport { View } from '../../features/layout/public';\nimport { ListItem } from '../../features/list/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport type { TreeItemNode, TreeItemRenderProps } from './types';\n\ninterface TreeItemProps<TId extends string = string> extends ZoraBaseProps {\n node: TreeItemNode<TId>;\n depth: number;\n selectedId?: TId;\n expandedIds: readonly TId[];\n onSelect?: (id: TId) => void;\n onToggleExpand: (id: TId) => void;\n renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;\n}\n\nfunction TreeItemInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n node,\n depth,\n selectedId,\n expandedIds,\n onSelect,\n onToggleExpand,\n renderItem,\n testID,\n interactionPolicy,\n}: TreeItemProps<TId>) {\n const hasChildren = node.children !== undefined && node.children.length > 0;\n const isExpanded = expandedIds.includes(node.id);\n const isSelected = selectedId === node.id;\n\n const renderContent = () => {\n if (renderItem) {\n return renderItem({\n node,\n depth,\n selected: isSelected,\n expanded: isExpanded,\n hasChildren,\n });\n }\n\n return (\n <ListItem\n title={node.label}\n action={\n <View direction=\"row\" gap=\"xs\" align=\"center\">\n {node.actions}\n {hasChildren ? (\n <IconButton\n icon={{ name: isExpanded ? 'chevron-down-outline' : 'chevron-forward-outline' }}\n interactionPolicy={interactionPolicy}\n label={isExpanded ? 'Collapse' : 'Expand'}\n onPress={() => onToggleExpand(node.id)}\n size=\"s\"\n variant=\"ghost\"\n />\n ) : null}\n </View>\n }\n meta={node.meta}\n disabled={node.disabled}\n selected={isSelected}\n />\n );\n };\n\n return (\n <View testID={testID}>\n <View style={{ paddingLeft: depth * 16 }}>{renderContent()}</View>\n {hasChildren && isExpanded ? (\n <View>\n {node.children?.map((child) => (\n <TreeItem\n key={child.id}\n depth={depth + 1}\n expandedIds={expandedIds}\n interactionPolicy={interactionPolicy}\n node={child}\n onSelect={onSelect}\n onToggleExpand={onToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </View>\n ) : null}\n </View>\n );\n}\n\n/***\n * Single tree node row used within `TreeView`.\n *\n \n */\nexport const TreeItem = withZoraThemeScope(TreeItemInner);\n"]}
|
package/dist/registry.js
CHANGED
|
@@ -23,7 +23,7 @@ import { DatePicker } from './features/date-picker/public';
|
|
|
23
23
|
import { Dialog } from './features/dialog/public';
|
|
24
24
|
import { EmptyState } from './features/empty-state/public';
|
|
25
25
|
import { Checkbox, CheckboxGroup } from './features/form/checkbox/public';
|
|
26
|
-
import { Form, FormActions, FormError
|
|
26
|
+
import { Field, Form, FormActions, FormError } from './features/form/public';
|
|
27
27
|
import { Radio, RadioGroup } from './features/form/radio/public';
|
|
28
28
|
import { SearchInput } from './features/form/search-input/public';
|
|
29
29
|
import { Select } from './features/form/select/public';
|
|
@@ -35,6 +35,7 @@ import { Image } from './features/image/public';
|
|
|
35
35
|
import { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
36
36
|
import { AppShell, Divider, Grid, Screen, ScreenSection, ScrollView, View, } from './features/layout/public';
|
|
37
37
|
import { FlatList, SectionList } from './features/list/public';
|
|
38
|
+
import { List, ListItem, ListSection } from './features/list/public';
|
|
38
39
|
import { MissingElement } from './features/missing-element/public';
|
|
39
40
|
import { Pagination } from './features/pagination/public';
|
|
40
41
|
import { PaletteItem } from './features/palette-item/public';
|
|
@@ -55,7 +56,6 @@ import { CollectionEditor } from './patterns/collection-editor';
|
|
|
55
56
|
import { ConfirmDialog } from './patterns/confirm-dialog';
|
|
56
57
|
import { FilterBar } from './patterns/filter-bar';
|
|
57
58
|
import { InspectorField } from './patterns/inspector-field';
|
|
58
|
-
import { List, ListRow, ListSection } from './patterns/list';
|
|
59
59
|
import { MessageBubble } from './patterns/message-bubble';
|
|
60
60
|
import { Notice } from './patterns/notice';
|
|
61
61
|
import { Panel } from './patterns/panel';
|
|
@@ -90,7 +90,7 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
90
90
|
Form,
|
|
91
91
|
FormActions,
|
|
92
92
|
FormError,
|
|
93
|
-
|
|
93
|
+
Field,
|
|
94
94
|
Gradient,
|
|
95
95
|
Heading,
|
|
96
96
|
Icon,
|
|
@@ -149,7 +149,7 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
149
149
|
Hero,
|
|
150
150
|
InspectorField,
|
|
151
151
|
List,
|
|
152
|
-
|
|
152
|
+
ListItem,
|
|
153
153
|
ListSection,
|
|
154
154
|
MessageBubble,
|
|
155
155
|
MissingElement,
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA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AW;IACX,aAAa;IACb,kBAAkB;IAClB,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,cAAc;IACd,WAAW;IACX,aAAa;IACb,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;CACgC,CAAC;AAE3C,MAAM,CAAC,MAAM,uBAAuB,GAA0B,wBAAwB,CAAC","sourcesContent":["import type { InteractionPolicyProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport { Accordion, AccordionItem } from './features/accordion/public';\nimport { ActivityIndicator } from './features/activity-indicator/public';\nimport { AppBar } from './features/app-bar/public';\nimport {\n ForgotPasswordForm,\n OAuthProviderButton,\n OAuthProviderList,\n OtpForm,\n SignInForm,\n SignUpForm,\n} from './features/auth/public';\nimport { Avatar } from './features/avatar/public';\nimport { AvatarGroup } from './features/avatar/public';\nimport { Badge } from './features/badge/public';\nimport { BottomSheet } from './features/bottom-sheet/public';\nimport { Breadcrumbs } from './features/breadcrumbs/public';\nimport { Button } from './features/button/public';\nimport { ButtonGroup } from './features/button/public';\nimport { IconButton } from './features/button/public';\nimport { Card } from './features/card/public';\nimport { MediaCard } from './features/card/public';\nimport { MetricCard } from './features/card/public';\nimport { PostCard } from './features/card/public';\nimport { ProductCard } from './features/card/public';\nimport { Chip } from './features/chip/public';\nimport { ChipGroup } from './features/chip/public';\nimport { ContentRail } from './features/content-rail/public';\nimport { DataTable } from './features/data-table/public';\nimport { DatePicker } from './features/date-picker/public';\nimport { Dialog } from './features/dialog/public';\nimport { EmptyState } from './features/empty-state/public';\nimport { Checkbox, CheckboxGroup } from './features/form/checkbox/public';\nimport { Form, FormActions, FormError, FormField } from './features/form/public';\nimport { Radio, RadioGroup } from './features/form/radio/public';\nimport { SearchInput } from './features/form/search-input/public';\nimport { Select } from './features/form/select/public';\nimport { TextInput } from './features/form/text-input/public';\nimport { Gradient } from './features/gradient/public';\nimport { Hero } from './features/hero/public';\nimport { Icon } from './features/icon/public';\nimport { Image } from './features/image/public';\nimport { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';\nimport {\n AppShell,\n Divider,\n Grid,\n Screen,\n ScreenSection,\n ScrollView,\n View,\n} from './features/layout/public';\nimport { FlatList, SectionList } from './features/list/public';\nimport { MissingElement } from './features/missing-element/public';\nimport { Pagination } from './features/pagination/public';\nimport { PaletteItem } from './features/palette-item/public';\nimport { PopoverMenu } from './features/popover-menu/public';\nimport { Progress, ProgressRing } from './features/progress/public';\nimport { Rating } from './features/rating/public';\nimport { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from './features/skeleton/public';\nimport { Surface } from './features/surface/public';\nimport { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';\nimport { TimePicker } from './features/time-picker/public';\nimport { Toast } from './features/toast/public';\nimport { Toolbar } from './features/toolbar/public';\nimport { Heading } from './features/typography/public';\nimport { Text } from './features/typography/public';\nimport { Uploader } from './features/uploader/public';\nimport { ChatListItem } from './patterns/chat-list-item';\nimport { CollectionEditor } from './patterns/collection-editor';\nimport { ConfirmDialog } from './patterns/confirm-dialog';\nimport { FilterBar } from './patterns/filter-bar';\nimport { InspectorField } from './patterns/inspector-field';\nimport { List, ListRow, ListSection } from './patterns/list';\nimport { MessageBubble } from './patterns/message-bubble';\nimport { Notice } from './patterns/notice';\nimport { Panel } from './patterns/panel';\nimport { ReaderSurface } from './patterns/reader';\nimport { BarcodeScannerView, CameraPermissionView, ScanOverlay } from './patterns/scanner';\nimport { SectionHeader } from './patterns/section-header';\nimport { SelectableItem } from './patterns/selection';\nimport { SwitchField } from './patterns/switch-field';\nimport { ThemeComposer } from './patterns/theme-composer';\nimport { Timeline } from './patterns/timeline';\nimport { TreeItem, TreeView } from './patterns/tree-view';\nimport { ThemeModeToggle } from './theme/ThemeModeToggle';\n\nexport type ZoraComponentRegistry = Readonly<Record<string, React.ElementType>>;\n\ntype ComponentPropsFor<K extends keyof typeof _ZORA_COMPONENT_REGISTRY> = React.ComponentProps<\n (typeof _ZORA_COMPONENT_REGISTRY)[K]\n>;\n\ntype AcceptsSurfaceInteractionPolicyProps<P> = 'interactionPolicy' extends keyof P\n ? InteractionPolicyProps extends Pick<P, 'interactionPolicy'>\n ? Pick<P, 'interactionPolicy'> extends InteractionPolicyProps\n ? true\n : false\n : false\n : false;\n\ntype RegistryInteractionPolicyContract = {\n [K in keyof typeof _ZORA_COMPONENT_REGISTRY]: AcceptsSurfaceInteractionPolicyProps<\n ComponentPropsFor<K>\n >;\n};\n\ntype _AssertTrue<T extends true> = T;\ntype _RegistryInteractionPolicyCheck = _AssertTrue<\n RegistryInteractionPolicyContract[keyof typeof _ZORA_COMPONENT_REGISTRY]\n>;\n\nconst _ZORA_COMPONENT_REGISTRY = {\n Accordion,\n AccordionItem,\n ActivityIndicator,\n AppBar,\n Avatar,\n AvatarGroup,\n Badge,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n Checkbox,\n CheckboxGroup,\n Chip,\n ChipGroup,\n DataTable,\n DatePicker,\n Dialog,\n Form,\n FormActions,\n FormError,\n FormField,\n Gradient,\n Heading,\n Icon,\n IconButton,\n Image,\n KeyboardAvoidingView,\n TextInput,\n MediaCard,\n MetricCard,\n Pagination,\n PopoverMenu,\n Progress,\n ProgressRing,\n Radio,\n RadioGroup,\n Rating,\n SearchInput,\n Select,\n Skeleton,\n SkeletonCard,\n SkeletonList,\n SkeletonText,\n Tab,\n TabList,\n TabPanel,\n Tabs,\n Text,\n TimePicker,\n Toast,\n Toolbar,\n Uploader,\n BottomSheet,\n FlatList,\n SectionList,\n ScrollView,\n View,\n ThemeModeToggle,\n Divider,\n Grid,\n Surface,\n AppShell,\n Screen,\n ScreenSection,\n ForgotPasswordForm,\n OAuthProviderButton,\n OAuthProviderList,\n OtpForm,\n SignInForm,\n SignUpForm,\n ChatListItem,\n CollectionEditor,\n ConfirmDialog,\n ContentRail,\n EmptyState,\n FilterBar,\n Hero,\n InspectorField,\n List,\n ListRow,\n ListSection,\n MessageBubble,\n MissingElement,\n Notice,\n Panel,\n PostCard,\n ProductCard,\n ReaderSurface,\n BarcodeScannerView,\n CameraPermissionView,\n ScanOverlay,\n SectionHeader,\n SelectableItem,\n SwitchField,\n ThemeComposer,\n PaletteItem,\n Timeline,\n TreeItem,\n TreeView,\n} as const satisfies ZoraComponentRegistry;\n\nexport const ZORA_COMPONENT_REGISTRY: ZoraComponentRegistry = _ZORA_COMPONENT_REGISTRY;\n"]}
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAw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ACV,IAAI;IACJ,eAAe;IACf,OAAO;IACP,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,MAAM;IACN,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,OAAO;IACP,UAAU;IACV,UAAU;IACV,YAAY;IACZ,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,UAAU;IACV,SAAS;IACT,IAAI;IACJ,cAAc;IACd,IAAI;IACJ,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,MAAM;IACN,KAAK;IACL,QAAQ;IACR,WAAW;IACX,aAAa;IACb,kBAAkB;IAClB,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,cAAc;IACd,WAAW;IACX,aAAa;IACb,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;CACgC,CAAC;AAE3C,MAAM,CAAC,MAAM,uBAAuB,GAA0B,wBAAwB,CAAC","sourcesContent":["import type { InteractionPolicyProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport { Accordion, AccordionItem } from './features/accordion/public';\nimport { ActivityIndicator } from './features/activity-indicator/public';\nimport { AppBar } from './features/app-bar/public';\nimport {\n ForgotPasswordForm,\n OAuthProviderButton,\n OAuthProviderList,\n OtpForm,\n SignInForm,\n SignUpForm,\n} from './features/auth/public';\nimport { Avatar } from './features/avatar/public';\nimport { AvatarGroup } from './features/avatar/public';\nimport { Badge } from './features/badge/public';\nimport { BottomSheet } from './features/bottom-sheet/public';\nimport { Breadcrumbs } from './features/breadcrumbs/public';\nimport { Button } from './features/button/public';\nimport { ButtonGroup } from './features/button/public';\nimport { IconButton } from './features/button/public';\nimport { Card } from './features/card/public';\nimport { MediaCard } from './features/card/public';\nimport { MetricCard } from './features/card/public';\nimport { PostCard } from './features/card/public';\nimport { ProductCard } from './features/card/public';\nimport { Chip } from './features/chip/public';\nimport { ChipGroup } from './features/chip/public';\nimport { ContentRail } from './features/content-rail/public';\nimport { DataTable } from './features/data-table/public';\nimport { DatePicker } from './features/date-picker/public';\nimport { Dialog } from './features/dialog/public';\nimport { EmptyState } from './features/empty-state/public';\nimport { Checkbox, CheckboxGroup } from './features/form/checkbox/public';\nimport { Field, Form, FormActions, FormError } from './features/form/public';\nimport { Radio, RadioGroup } from './features/form/radio/public';\nimport { SearchInput } from './features/form/search-input/public';\nimport { Select } from './features/form/select/public';\nimport { TextInput } from './features/form/text-input/public';\nimport { Gradient } from './features/gradient/public';\nimport { Hero } from './features/hero/public';\nimport { Icon } from './features/icon/public';\nimport { Image } from './features/image/public';\nimport { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';\nimport {\n AppShell,\n Divider,\n Grid,\n Screen,\n ScreenSection,\n ScrollView,\n View,\n} from './features/layout/public';\nimport { FlatList, SectionList } from './features/list/public';\nimport { List, ListItem, ListSection } from './features/list/public';\nimport { MissingElement } from './features/missing-element/public';\nimport { Pagination } from './features/pagination/public';\nimport { PaletteItem } from './features/palette-item/public';\nimport { PopoverMenu } from './features/popover-menu/public';\nimport { Progress, ProgressRing } from './features/progress/public';\nimport { Rating } from './features/rating/public';\nimport { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from './features/skeleton/public';\nimport { Surface } from './features/surface/public';\nimport { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';\nimport { TimePicker } from './features/time-picker/public';\nimport { Toast } from './features/toast/public';\nimport { Toolbar } from './features/toolbar/public';\nimport { Heading } from './features/typography/public';\nimport { Text } from './features/typography/public';\nimport { Uploader } from './features/uploader/public';\nimport { ChatListItem } from './patterns/chat-list-item';\nimport { CollectionEditor } from './patterns/collection-editor';\nimport { ConfirmDialog } from './patterns/confirm-dialog';\nimport { FilterBar } from './patterns/filter-bar';\nimport { InspectorField } from './patterns/inspector-field';\nimport { MessageBubble } from './patterns/message-bubble';\nimport { Notice } from './patterns/notice';\nimport { Panel } from './patterns/panel';\nimport { ReaderSurface } from './patterns/reader';\nimport { BarcodeScannerView, CameraPermissionView, ScanOverlay } from './patterns/scanner';\nimport { SectionHeader } from './patterns/section-header';\nimport { SelectableItem } from './patterns/selection';\nimport { SwitchField } from './patterns/switch-field';\nimport { ThemeComposer } from './patterns/theme-composer';\nimport { Timeline } from './patterns/timeline';\nimport { TreeItem, TreeView } from './patterns/tree-view';\nimport { ThemeModeToggle } from './theme/ThemeModeToggle';\n\nexport type ZoraComponentRegistry = Readonly<Record<string, React.ElementType>>;\n\ntype ComponentPropsFor<K extends keyof typeof _ZORA_COMPONENT_REGISTRY> = React.ComponentProps<\n (typeof _ZORA_COMPONENT_REGISTRY)[K]\n>;\n\ntype AcceptsSurfaceInteractionPolicyProps<P> = 'interactionPolicy' extends keyof P\n ? InteractionPolicyProps extends Pick<P, 'interactionPolicy'>\n ? Pick<P, 'interactionPolicy'> extends InteractionPolicyProps\n ? true\n : false\n : false\n : false;\n\ntype RegistryInteractionPolicyContract = {\n [K in keyof typeof _ZORA_COMPONENT_REGISTRY]: AcceptsSurfaceInteractionPolicyProps<\n ComponentPropsFor<K>\n >;\n};\n\ntype _AssertTrue<T extends true> = T;\ntype _RegistryInteractionPolicyCheck = _AssertTrue<\n RegistryInteractionPolicyContract[keyof typeof _ZORA_COMPONENT_REGISTRY]\n>;\n\nconst _ZORA_COMPONENT_REGISTRY = {\n Accordion,\n AccordionItem,\n ActivityIndicator,\n AppBar,\n Avatar,\n AvatarGroup,\n Badge,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n Checkbox,\n CheckboxGroup,\n Chip,\n ChipGroup,\n DataTable,\n DatePicker,\n Dialog,\n Form,\n FormActions,\n FormError,\n Field,\n Gradient,\n Heading,\n Icon,\n IconButton,\n Image,\n KeyboardAvoidingView,\n TextInput,\n MediaCard,\n MetricCard,\n Pagination,\n PopoverMenu,\n Progress,\n ProgressRing,\n Radio,\n RadioGroup,\n Rating,\n SearchInput,\n Select,\n Skeleton,\n SkeletonCard,\n SkeletonList,\n SkeletonText,\n Tab,\n TabList,\n TabPanel,\n Tabs,\n Text,\n TimePicker,\n Toast,\n Toolbar,\n Uploader,\n BottomSheet,\n FlatList,\n SectionList,\n ScrollView,\n View,\n ThemeModeToggle,\n Divider,\n Grid,\n Surface,\n AppShell,\n Screen,\n ScreenSection,\n ForgotPasswordForm,\n OAuthProviderButton,\n OAuthProviderList,\n OtpForm,\n SignInForm,\n SignUpForm,\n ChatListItem,\n CollectionEditor,\n ConfirmDialog,\n ContentRail,\n EmptyState,\n FilterBar,\n Hero,\n InspectorField,\n List,\n ListItem,\n ListSection,\n MessageBubble,\n MissingElement,\n Notice,\n Panel,\n PostCard,\n ProductCard,\n ReaderSurface,\n BarcodeScannerView,\n CameraPermissionView,\n ScanOverlay,\n SectionHeader,\n SelectableItem,\n SwitchField,\n ThemeComposer,\n PaletteItem,\n Timeline,\n TreeItem,\n TreeView,\n} as const satisfies ZoraComponentRegistry;\n\nexport const ZORA_COMPONENT_REGISTRY: ZoraComponentRegistry = _ZORA_COMPONENT_REGISTRY;\n"]}
|
package/dist/types/form.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface FormProps extends ZoraBaseProps {
|
|
|
49
49
|
submitLabel?: React.ReactNode;
|
|
50
50
|
actions?: React.ReactNode;
|
|
51
51
|
}
|
|
52
|
-
export interface
|
|
52
|
+
export interface FieldProps extends ZoraBaseProps, Pick<Omit<SurfaceFieldProps, 'mode' | 'themeId'>, 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'> {
|
|
53
53
|
label: React.ReactNode;
|
|
54
54
|
description?: React.ReactNode;
|
|
55
55
|
helperText?: React.ReactNode;
|
package/dist/types/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/types/form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM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AAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5D,QAAQ,EAAE,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5C,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
|
package/dist/types/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/types/form.ts"],"names":[],"mappings":"","sourcesContent":["import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../theme/ZoraBaseProps';\nimport type { TextInputProps } from './text-input';\n\nexport type ValidationRule =\n | { kind: 'required'; message?: string }\n | { kind: 'email'; message?: string }\n | { kind: 'minLength'; value: number; message?: string }\n | { kind: 'pattern'; value: string; message?: string };\nexport type FormFieldValue = string;\nexport type FormValues<TName extends string = string> = Record<TName, FormFieldValue>;\nexport type FormErrors<TName extends string = string> = Partial<Record<TName, React.ReactNode>>;\nexport type FormValidationErrors<TName extends string = string> = Partial<Record<TName, string>>;\nexport type FormFieldInputType = 'email' | 'number' | 'otp' | 'password' | 'tel' | 'text' | 'url';\n\nexport interface FormFieldConfig<TName extends string = string> {\n name: TName;\n label: React.ReactNode;\n description?: React.ReactNode;\n helperText?: React.ReactNode;\n type?: FormFieldInputType;\n placeholder?: string;\n rules?: readonly ValidationRule[];\n autoCapitalize?: TextInputProps['autoCapitalize'];\n autoComplete?: TextInputProps['autoComplete'];\n keyboardType?: TextInputProps['keyboardType'];\n maxLength?: TextInputProps['maxLength'];\n readOnly?: boolean;\n required?: boolean;\n secureTextEntry?: boolean;\n textContentType?: TextInputProps['textContentType'];\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface FormProps extends ZoraBaseProps {\n children?: React.ReactNode;\n onSubmit?: () => void | Promise<void>;\n loading?: boolean;\n disabled?: boolean;\n submitLabel?: React.ReactNode;\n actions?: React.ReactNode;\n}\n\nexport interface
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/types/form.ts"],"names":[],"mappings":"","sourcesContent":["import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../theme/ZoraBaseProps';\nimport type { TextInputProps } from './text-input';\n\nexport type ValidationRule =\n | { kind: 'required'; message?: string }\n | { kind: 'email'; message?: string }\n | { kind: 'minLength'; value: number; message?: string }\n | { kind: 'pattern'; value: string; message?: string };\nexport type FormFieldValue = string;\nexport type FormValues<TName extends string = string> = Record<TName, FormFieldValue>;\nexport type FormErrors<TName extends string = string> = Partial<Record<TName, React.ReactNode>>;\nexport type FormValidationErrors<TName extends string = string> = Partial<Record<TName, string>>;\nexport type FormFieldInputType = 'email' | 'number' | 'otp' | 'password' | 'tel' | 'text' | 'url';\n\nexport interface FormFieldConfig<TName extends string = string> {\n name: TName;\n label: React.ReactNode;\n description?: React.ReactNode;\n helperText?: React.ReactNode;\n type?: FormFieldInputType;\n placeholder?: string;\n rules?: readonly ValidationRule[];\n autoCapitalize?: TextInputProps['autoCapitalize'];\n autoComplete?: TextInputProps['autoComplete'];\n keyboardType?: TextInputProps['keyboardType'];\n maxLength?: TextInputProps['maxLength'];\n readOnly?: boolean;\n required?: boolean;\n secureTextEntry?: boolean;\n textContentType?: TextInputProps['textContentType'];\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface FormProps extends ZoraBaseProps {\n children?: React.ReactNode;\n onSubmit?: () => void | Promise<void>;\n loading?: boolean;\n disabled?: boolean;\n submitLabel?: React.ReactNode;\n actions?: React.ReactNode;\n}\n\nexport interface FieldProps\n extends\n ZoraBaseProps,\n Pick<\n Omit<SurfaceFieldProps, 'mode' | 'themeId'>,\n 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'\n > {\n label: React.ReactNode;\n description?: React.ReactNode;\n helperText?: React.ReactNode;\n}\n\nexport interface FormActionsProps extends ZoraBaseProps {\n submitLabel?: React.ReactNode;\n loading?: boolean;\n disabled?: boolean;\n onSubmit?: () => void;\n children?: React.ReactNode;\n}\nexport interface FormErrorProps extends ZoraBaseProps {\n error?: React.ReactNode;\n}\nexport interface FormValidationResult<TName extends string = string> {\n errors: FormValidationErrors<TName>;\n valid: boolean;\n}\nexport interface UseFormControllerOptions<TName extends string = string> {\n fields: readonly FormFieldConfig<TName>[];\n initialValues?: Partial<FormValues<TName>>;\n values?: FormValues<TName>;\n errors?: FormErrors<TName>;\n onChange?: (values: FormValues<TName>) => void;\n onSubmit?: (values: FormValues<TName>) => void | Promise<void>;\n validateOnChange?: boolean;\n}\nexport interface UseFormControllerResult<TName extends string = string> {\n values: FormValues<TName>;\n errors: FormErrors<TName>;\n setValues: (values: FormValues<TName>) => void;\n setFieldValue: (name: TName, value: FormFieldValue) => void;\n validate: () => FormValidationResult<TName>;\n handleSubmit: () => Promise<void>;\n reset: () => void;\n}\n"]}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
+
import type { ListItemProps as SurfaceListItemProps } from '@ankhorage/surface';
|
|
1
2
|
import type React from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '
|
|
3
|
-
export type
|
|
4
|
-
interface
|
|
3
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
4
|
+
export type ListItemVariant = 'divider' | 'card';
|
|
5
|
+
interface ListItemBaseProps extends ZoraBaseProps, Pick<SurfaceListItemProps, 'compact' | 'disabled' | 'leading' | 'selected' | 'trailing'> {
|
|
5
6
|
title: React.ReactNode;
|
|
6
7
|
description?: React.ReactNode;
|
|
7
8
|
meta?: React.ReactNode;
|
|
8
|
-
|
|
9
|
-
trailing?: React.ReactNode;
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
compact?: boolean;
|
|
13
|
-
variant?: ListRowVariant;
|
|
9
|
+
variant?: ListItemVariant;
|
|
14
10
|
}
|
|
15
|
-
interface
|
|
11
|
+
interface ListItemPressableProps {
|
|
16
12
|
onPress: () => void;
|
|
17
13
|
action?: never;
|
|
18
14
|
}
|
|
19
|
-
interface
|
|
15
|
+
interface ListItemActionProps {
|
|
20
16
|
action: React.ReactNode;
|
|
21
17
|
onPress?: never;
|
|
22
18
|
}
|
|
23
|
-
interface
|
|
19
|
+
interface ListItemStaticProps {
|
|
24
20
|
action?: never;
|
|
25
21
|
onPress?: never;
|
|
26
22
|
}
|
|
27
|
-
export type
|
|
23
|
+
export type ListItemProps = ListItemBaseProps & (ListItemPressableProps | ListItemActionProps | ListItemStaticProps);
|
|
28
24
|
export interface ListItemsProps extends ZoraBaseProps {
|
|
29
|
-
items: readonly
|
|
30
|
-
|
|
25
|
+
items: readonly ListItemProps[];
|
|
26
|
+
itemVariant?: ListItemVariant;
|
|
31
27
|
compact?: boolean;
|
|
32
28
|
}
|
|
33
29
|
export interface ListChildrenProps extends ZoraBaseProps {
|
|
@@ -39,8 +35,8 @@ interface ListSectionItemsProps extends ZoraBaseProps {
|
|
|
39
35
|
description?: React.ReactNode;
|
|
40
36
|
eyebrow?: React.ReactNode;
|
|
41
37
|
actions?: React.ReactNode;
|
|
42
|
-
items: readonly
|
|
43
|
-
|
|
38
|
+
items: readonly ListItemProps[];
|
|
39
|
+
itemVariant?: ListItemVariant;
|
|
44
40
|
compact?: boolean;
|
|
45
41
|
}
|
|
46
42
|
interface ListSectionChildrenProps extends ZoraBaseProps {
|
|
@@ -52,4 +48,4 @@ interface ListSectionChildrenProps extends ZoraBaseProps {
|
|
|
52
48
|
}
|
|
53
49
|
export type ListSectionProps = ListSectionItemsProps | ListSectionChildrenProps;
|
|
54
50
|
export {};
|
|
55
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AS,CAAC;CAC3B;AAED,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAE3D,UAAU,qBAAsB,SAAQ,aAAa;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,wBAAyB,SAAQ,aAAa;IACtD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/types/list.ts"],"names":[],"mappings":"","sourcesContent":["import type { ListItemProps as SurfaceListItemProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../theme/ZoraBaseProps';\n\nexport type ListItemVariant = 'divider' | 'card';\n\ninterface ListItemBaseProps\n extends\n ZoraBaseProps,\n Pick<SurfaceListItemProps, 'compact' | 'disabled' | 'leading' | 'selected' | 'trailing'> {\n title: React.ReactNode;\n description?: React.ReactNode;\n meta?: React.ReactNode;\n variant?: ListItemVariant;\n}\n\ninterface ListItemPressableProps {\n onPress: () => void;\n action?: never;\n}\n\ninterface ListItemActionProps {\n action: React.ReactNode;\n onPress?: never;\n}\n\ninterface ListItemStaticProps {\n action?: never;\n onPress?: never;\n}\n\nexport type ListItemProps = ListItemBaseProps &\n (ListItemPressableProps | ListItemActionProps | ListItemStaticProps);\n\nexport interface ListItemsProps extends ZoraBaseProps {\n items: readonly ListItemProps[];\n itemVariant?: ListItemVariant;\n compact?: boolean;\n}\n\nexport interface ListChildrenProps extends ZoraBaseProps {\n children: React.ReactNode;\n}\n\nexport type ListProps = ListItemsProps | ListChildrenProps;\n\ninterface ListSectionItemsProps extends ZoraBaseProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n items: readonly ListItemProps[];\n itemVariant?: ListItemVariant;\n compact?: boolean;\n}\n\ninterface ListSectionChildrenProps extends ZoraBaseProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport type ListSectionProps = ListSectionItemsProps | ListSectionChildrenProps;\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "18.0.1",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@ankhorage/color-theory": "^0.3.0",
|
|
43
43
|
"@ankhorage/contracts": "^12.0.1",
|
|
44
|
-
"@ankhorage/surface": "^
|
|
44
|
+
"@ankhorage/surface": "^8.0.0",
|
|
45
45
|
"@ankhorage/utility": "^0.8.0",
|
|
46
46
|
"expo-document-picker": "~57.0.1",
|
|
47
47
|
"expo-image-picker": "~57.0.16"
|
package/src/constants.ts
CHANGED
|
@@ -21,7 +21,7 @@ export const FEATURE_MANIFEST_ELEMENTS = {
|
|
|
21
21
|
'data-table': ['DataTable'],
|
|
22
22
|
'date-picker': ['DatePicker'],
|
|
23
23
|
dialog: ['Dialog'],
|
|
24
|
-
form: ['Form', 'FormError', '
|
|
24
|
+
form: ['Form', 'FormError', 'Field'],
|
|
25
25
|
gradient: ['Gradient'],
|
|
26
26
|
button: ['Button', 'IconButton', 'ButtonGroup'],
|
|
27
27
|
icon: ['Icon'],
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';
|
|
4
4
|
import type { FormFieldConfig, FormFieldValue } from '../../../../types/form';
|
|
5
|
-
import {
|
|
5
|
+
import { Field, hasRequiredRule } from '../../../form/public';
|
|
6
6
|
import { TextInput } from '../../../form/text-input/public';
|
|
7
7
|
|
|
8
8
|
interface AuthFormFieldProps<TName extends string> {
|
|
@@ -27,7 +27,7 @@ export function AuthFormField<TName extends string>({
|
|
|
27
27
|
}: AuthFormFieldProps<TName>) {
|
|
28
28
|
const fieldDisabled = disabled || loading || field.disabled;
|
|
29
29
|
return (
|
|
30
|
-
<
|
|
30
|
+
<Field
|
|
31
31
|
description={field.description}
|
|
32
32
|
disabled={fieldDisabled}
|
|
33
33
|
errorText={error}
|
|
@@ -57,7 +57,7 @@ export function AuthFormField<TName extends string>({
|
|
|
57
57
|
textContentType={resolveTextContentType(field)}
|
|
58
58
|
value={value}
|
|
59
59
|
/>
|
|
60
|
-
</
|
|
60
|
+
</Field>
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -10,7 +10,7 @@ describe('ZORA BottomSheet public contract', () => {
|
|
|
10
10
|
const source = await Bun.file('src/features/bottom-sheet/public.ts').text();
|
|
11
11
|
|
|
12
12
|
expect(packageJson.exports['./bottom-sheet']).toBeDefined();
|
|
13
|
-
expect(packageJson.dependencies['@ankhorage/surface']).toMatch(
|
|
13
|
+
expect(packageJson.dependencies['@ankhorage/surface']).toMatch(/^\^\d+\.\d+\.\d+$/u);
|
|
14
14
|
expect(source).toContain("from '@ankhorage/surface/bottom-sheet'");
|
|
15
15
|
for (const name of [
|
|
16
16
|
'BottomSheetFlatList',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pressable } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveIconSize } from '../../../../internal/recipes';
|
|
@@ -83,7 +83,7 @@ function ChipInner({
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<
|
|
86
|
+
<Pressable
|
|
87
87
|
disabled={disabled}
|
|
88
88
|
interactionPolicy={interactionPolicy}
|
|
89
89
|
onPress={onPress}
|
|
@@ -91,6 +91,6 @@ function ChipInner({
|
|
|
91
91
|
testID={testID}
|
|
92
92
|
>
|
|
93
93
|
{(state) => renderContent(state)}
|
|
94
|
-
</
|
|
94
|
+
</Pressable>
|
|
95
95
|
);
|
|
96
96
|
}
|
package/src/features/form/{adapters/inbound/FormField.tsx → field/adapters/inbound/Field.tsx}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Field } from '@ankhorage/surface';
|
|
1
|
+
import { Field as SurfaceField } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { withZoraThemeScope } from '
|
|
5
|
-
import type {
|
|
6
|
-
import { View } from '
|
|
7
|
-
import { Text } from '
|
|
4
|
+
import { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';
|
|
5
|
+
import type { FieldProps } from '../../../../../types/form';
|
|
6
|
+
import { View } from '../../../../layout/public';
|
|
7
|
+
import { Text } from '../../../../typography/public';
|
|
8
8
|
|
|
9
|
-
function
|
|
9
|
+
function FieldInner({
|
|
10
10
|
themeId: _themeId,
|
|
11
11
|
mode: _mode,
|
|
12
12
|
label,
|
|
@@ -15,9 +15,9 @@ function FormFieldInner({
|
|
|
15
15
|
children,
|
|
16
16
|
interactionPolicy: _interactionPolicy,
|
|
17
17
|
...props
|
|
18
|
-
}:
|
|
18
|
+
}: FieldProps) {
|
|
19
19
|
return (
|
|
20
|
-
<
|
|
20
|
+
<SurfaceField
|
|
21
21
|
{...props}
|
|
22
22
|
helperText={helperText}
|
|
23
23
|
label={
|
|
@@ -34,9 +34,9 @@ function FormFieldInner({
|
|
|
34
34
|
}
|
|
35
35
|
>
|
|
36
36
|
{children}
|
|
37
|
-
</
|
|
37
|
+
</SurfaceField>
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/*** Groups one form control with its label, description, helper text, and field error. */
|
|
42
|
-
export const
|
|
42
|
+
export const Field = withZoraThemeScope(FieldInner);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ZoraComponentMeta } from '../../../metadata';
|
|
2
|
+
|
|
3
|
+
export const fieldMeta = {
|
|
4
|
+
name: 'Field',
|
|
4
5
|
category: 'component',
|
|
5
6
|
directManifestNode: true,
|
|
6
7
|
allowedChildren: [
|
|
@@ -11,7 +12,7 @@ export const formFieldMeta = {
|
|
|
11
12
|
'Select',
|
|
12
13
|
'TextInput',
|
|
13
14
|
],
|
|
14
|
-
blueprint: { label: '
|
|
15
|
+
blueprint: { label: 'Field', defaultProps: { label: 'Label' } },
|
|
15
16
|
bindings: {
|
|
16
17
|
props: {
|
|
17
18
|
errorText: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Field } from './adapters/inbound/Field';
|
|
@@ -3,7 +3,7 @@ export const formMeta = {
|
|
|
3
3
|
name: 'Form',
|
|
4
4
|
category: 'component',
|
|
5
5
|
directManifestNode: true,
|
|
6
|
-
allowedChildren: ['FormError', '
|
|
6
|
+
allowedChildren: ['FormError', 'Field'],
|
|
7
7
|
blueprint: {
|
|
8
8
|
label: 'Form',
|
|
9
9
|
defaultProps: { submitLabel: 'Submit', loading: false, disabled: false },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type {
|
|
2
|
+
FieldProps,
|
|
2
3
|
FormActionsProps,
|
|
3
4
|
FormErrorProps,
|
|
4
5
|
FormErrors,
|
|
5
6
|
FormFieldConfig,
|
|
6
7
|
FormFieldInputType,
|
|
7
|
-
FormFieldProps,
|
|
8
8
|
FormProps,
|
|
9
9
|
FormValidationErrors,
|
|
10
10
|
FormValidationResult,
|
|
@@ -16,6 +16,6 @@ export type {
|
|
|
16
16
|
export { Form } from './adapters/inbound/Form';
|
|
17
17
|
export { FormActions } from './adapters/inbound/FormActions';
|
|
18
18
|
export { FormError } from './adapters/inbound/FormError';
|
|
19
|
-
export {
|
|
19
|
+
export { Field } from './field/public';
|
|
20
20
|
export { useFormController } from './useFormController';
|
|
21
21
|
export { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { List as SurfaceList } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
5
|
+
import type {
|
|
6
|
+
ListItemProps,
|
|
7
|
+
ListItemsProps,
|
|
8
|
+
ListItemVariant,
|
|
9
|
+
ListProps,
|
|
10
|
+
} from '../../../../types/list';
|
|
11
|
+
import { Divider, View } from '../../../layout/public';
|
|
12
|
+
import { resolveListSeparator } from '../../utils/resolveListSeparator';
|
|
13
|
+
import { ListItem } from './ListItem';
|
|
14
|
+
|
|
15
|
+
function resolveItemVariant({
|
|
16
|
+
item,
|
|
17
|
+
defaultVariant,
|
|
18
|
+
}: {
|
|
19
|
+
item: ListItemProps;
|
|
20
|
+
defaultVariant: ListItemVariant;
|
|
21
|
+
}): ListItemVariant {
|
|
22
|
+
return item.variant ?? defaultVariant;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function resolveItemCompact({
|
|
26
|
+
item,
|
|
27
|
+
compact,
|
|
28
|
+
}: {
|
|
29
|
+
item: ListItemProps;
|
|
30
|
+
compact: boolean | undefined;
|
|
31
|
+
}): boolean {
|
|
32
|
+
return item.compact ?? compact ?? false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function ListItemsInner({
|
|
36
|
+
themeId: _themeId,
|
|
37
|
+
mode: _mode,
|
|
38
|
+
testID,
|
|
39
|
+
items,
|
|
40
|
+
itemVariant = 'divider',
|
|
41
|
+
compact,
|
|
42
|
+
}: ListItemsProps) {
|
|
43
|
+
return (
|
|
44
|
+
<SurfaceList testID={testID}>
|
|
45
|
+
{items.map((item, index) => {
|
|
46
|
+
const effectiveVariant = resolveItemVariant({ item, defaultVariant: itemVariant });
|
|
47
|
+
const separator = resolveListSeparator(effectiveVariant, index);
|
|
48
|
+
return (
|
|
49
|
+
<React.Fragment key={String(index)}>
|
|
50
|
+
{separator === 'divider' ? <Divider /> : null}
|
|
51
|
+
{separator === 'spacer' ? <View height="s" /> : null}
|
|
52
|
+
<ListItem
|
|
53
|
+
{...item}
|
|
54
|
+
compact={resolveItemCompact({ item, compact })}
|
|
55
|
+
variant={effectiveVariant}
|
|
56
|
+
/>
|
|
57
|
+
</React.Fragment>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</SurfaceList>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ListInner(props: ListProps) {
|
|
65
|
+
if ('items' in props) return <ListItemsInner {...props} />;
|
|
66
|
+
const {
|
|
67
|
+
themeId: _themeId,
|
|
68
|
+
mode: _mode,
|
|
69
|
+
interactionPolicy: _interactionPolicy,
|
|
70
|
+
children,
|
|
71
|
+
testID,
|
|
72
|
+
} = props;
|
|
73
|
+
return <SurfaceList testID={testID}>{children}</SurfaceList>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/*** List composition built on the Surface list boundary with ZORA item/separator policy. */
|
|
77
|
+
export const List = withZoraThemeScope(ListInner);
|