@ankhorage/zora 16.0.0 → 17.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 +10 -0
- package/README.md +15 -15
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/accordion/adapters/inbound/AccordionItem.js +19 -19
- package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.js +6 -7
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -1
- package/dist/features/auth/adapters/inbound/AuthForm.js +3 -3
- package/dist/features/auth/adapters/inbound/AuthForm.js.map +1 -1
- package/dist/features/auth/adapters/inbound/ForgotPasswordForm.js +3 -3
- package/dist/features/auth/adapters/inbound/ForgotPasswordForm.js.map +1 -1
- package/dist/features/auth/adapters/inbound/OAuthProviderList.js +3 -3
- package/dist/features/auth/adapters/inbound/OAuthProviderList.js.map +1 -1
- package/dist/features/auth/adapters/inbound/OtpForm.js +3 -3
- package/dist/features/auth/adapters/inbound/OtpForm.js.map +1 -1
- package/dist/features/auth/adapters/inbound/SignInForm.js +3 -3
- package/dist/features/auth/adapters/inbound/SignInForm.js.map +1 -1
- package/dist/features/auth/adapters/inbound/SignUpForm.js +3 -3
- package/dist/features/auth/adapters/inbound/SignUpForm.js.map +1 -1
- package/dist/features/avatar/adapters/inbound/Avatar.js +3 -3
- package/dist/features/avatar/adapters/inbound/Avatar.js.map +1 -1
- package/dist/features/avatar/adapters/inbound/AvatarGroup.js +7 -7
- package/dist/features/avatar/adapters/inbound/AvatarGroup.js.map +1 -1
- package/dist/features/bottom-sheet/adapters/inbound/BottomSheet.js +3 -3
- package/dist/features/bottom-sheet/adapters/inbound/BottomSheet.js.map +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts.map +1 -1
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js +5 -5
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js.map +1 -1
- package/dist/features/button/adapters/inbound/ButtonGroup.js +3 -3
- package/dist/features/button/adapters/inbound/ButtonGroup.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +12 -12
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/card/adapters/inbound/MediaCard.js +21 -21
- package/dist/features/card/adapters/inbound/MediaCard.js.map +1 -1
- package/dist/features/card/adapters/inbound/MetricCard.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/MetricCard.js +10 -11
- package/dist/features/card/adapters/inbound/MetricCard.js.map +1 -1
- package/dist/features/card/adapters/inbound/PostCard.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/PostCard.js +37 -38
- package/dist/features/card/adapters/inbound/PostCard.js.map +1 -1
- package/dist/features/card/adapters/inbound/ProductCard.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/ProductCard.js +17 -18
- package/dist/features/card/adapters/inbound/ProductCard.js.map +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chip/adapters/inbound/Chip.d.ts.map +1 -1
- package/dist/features/chip/adapters/inbound/Chip.js +5 -6
- package/dist/features/chip/adapters/inbound/Chip.js.map +1 -1
- package/dist/features/chip/adapters/inbound/ChipGroup.d.ts.map +1 -1
- package/dist/features/chip/adapters/inbound/ChipGroup.js +3 -3
- package/dist/features/chip/adapters/inbound/ChipGroup.js.map +1 -1
- package/dist/features/content-rail/adapters/inbound/ContentRail.d.ts.map +1 -0
- package/dist/features/{layout → content-rail}/adapters/inbound/ContentRail.js +9 -10
- package/dist/features/content-rail/adapters/inbound/ContentRail.js.map +1 -0
- package/dist/features/content-rail/adapters/inbound/ContentRailFlow.d.ts.map +1 -0
- package/dist/features/content-rail/adapters/inbound/ContentRailFlow.js.map +1 -0
- package/dist/features/content-rail/constants.d.ts +2 -0
- package/dist/features/content-rail/constants.d.ts.map +1 -0
- package/dist/features/content-rail/constants.js +2 -0
- package/dist/features/content-rail/constants.js.map +1 -0
- package/dist/features/{layout → content-rail}/contentRailMeta.d.ts +2 -2
- package/dist/features/content-rail/contentRailMeta.d.ts.map +1 -0
- package/dist/features/content-rail/contentRailMeta.js.map +1 -0
- package/dist/features/content-rail/public.d.ts +3 -0
- package/dist/features/content-rail/public.d.ts.map +1 -0
- package/dist/features/content-rail/public.js +2 -0
- package/dist/features/content-rail/public.js.map +1 -0
- package/dist/features/content-rail/utils/resolveContentRailItemWidth.d.ts.map +1 -0
- package/dist/features/content-rail/utils/resolveContentRailItemWidth.js.map +1 -0
- package/dist/features/content-rail/utils/resolveContentRailPhysicalOffset.d.ts.map +1 -0
- package/dist/features/content-rail/utils/resolveContentRailPhysicalOffset.js.map +1 -0
- package/dist/features/content-rail/utils/resolveContentRailState.d.ts.map +1 -0
- package/dist/features/content-rail/utils/resolveContentRailState.js.map +1 -0
- package/dist/features/content-rail/utils/useContentRailReducedMotion.d.ts.map +1 -0
- package/dist/features/content-rail/utils/useContentRailReducedMotion.js.map +1 -0
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +32 -32
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.js +16 -16
- package/dist/features/date-picker/composition/DatePickerContent.js.map +1 -1
- package/dist/features/date-picker/composition/DatePickerField.js +3 -3
- package/dist/features/date-picker/composition/DatePickerField.js.map +1 -1
- package/dist/features/dialog/adapters/inbound/Dialog.js +9 -9
- package/dist/features/dialog/adapters/inbound/Dialog.js.map +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/empty-state/adapters/inbound/EmptyState.js +5 -5
- package/dist/features/empty-state/adapters/inbound/EmptyState.js.map +1 -1
- package/dist/features/form/adapters/inbound/Form.js +3 -3
- package/dist/features/form/adapters/inbound/Form.js.map +1 -1
- package/dist/features/form/adapters/inbound/FormActions.js +4 -4
- package/dist/features/form/adapters/inbound/FormActions.js.map +1 -1
- package/dist/features/form/adapters/inbound/FormError.js +3 -3
- package/dist/features/form/adapters/inbound/FormError.js.map +1 -1
- package/dist/features/form/adapters/inbound/FormField.js +3 -3
- package/dist/features/form/adapters/inbound/FormField.js.map +1 -1
- package/dist/features/form/checkbox/adapters/inbound/CheckboxGroup.d.ts.map +1 -1
- package/dist/features/form/checkbox/adapters/inbound/CheckboxGroup.js +5 -6
- package/dist/features/form/checkbox/adapters/inbound/CheckboxGroup.js.map +1 -1
- package/dist/features/form/radio/adapters/inbound/RadioGroup.js +10 -10
- package/dist/features/form/radio/adapters/inbound/RadioGroup.js.map +1 -1
- package/dist/features/form/select/adapters/inbound/Select.web.js +3 -3
- package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -1
- package/dist/features/gradient/adapters/inbound/Gradient.js +5 -5
- package/dist/features/gradient/adapters/inbound/Gradient.js.map +1 -1
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/hero/adapters/inbound/Hero.js +12 -12
- package/dist/features/hero/adapters/inbound/Hero.js.map +1 -1
- package/dist/features/image/adapters/inbound/Image.js +3 -3
- package/dist/features/image/adapters/inbound/Image.js.map +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/adapters/inbound/AppShell.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/AppShell.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/AppShell.js +20 -0
- package/dist/features/layout/adapters/inbound/AppShell.js.map +1 -0
- package/dist/features/layout/adapters/inbound/Screen.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/Screen.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/Screen.js +22 -0
- package/dist/features/layout/adapters/inbound/Screen.js.map +1 -0
- package/dist/features/layout/adapters/inbound/ScreenSection.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/ScreenSection.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/ScreenSection.js +13 -0
- package/dist/features/layout/adapters/inbound/ScreenSection.js.map +1 -0
- package/dist/features/layout/adapters/inbound/ScrollView.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/ScrollView.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/ScrollView.js +10 -0
- package/dist/features/layout/adapters/inbound/ScrollView.js.map +1 -0
- package/dist/features/layout/adapters/inbound/View.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/View.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/View.js +10 -0
- package/dist/features/layout/adapters/inbound/View.js.map +1 -0
- package/dist/{layout/app-shell/meta.d.ts → features/layout/appShellMeta.d.ts} +1 -1
- package/dist/features/layout/appShellMeta.d.ts.map +1 -0
- package/dist/{layout/app-shell/meta.js → features/layout/appShellMeta.js} +1 -1
- package/dist/features/layout/appShellMeta.js.map +1 -0
- package/dist/features/layout/constants.d.ts +0 -1
- package/dist/features/layout/constants.d.ts.map +1 -1
- package/dist/features/layout/constants.js +0 -1
- package/dist/features/layout/constants.js.map +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/public.d.ts +6 -6
- package/dist/features/layout/public.d.ts.map +1 -1
- package/dist/features/layout/public.js +5 -4
- package/dist/features/layout/public.js.map +1 -1
- package/dist/{layout/screen/meta.d.ts → features/layout/screenMeta.d.ts} +2 -2
- package/dist/features/layout/screenMeta.d.ts.map +1 -0
- package/dist/{layout/screen/meta.js → features/layout/screenMeta.js} +1 -1
- package/dist/features/layout/screenMeta.js.map +1 -0
- package/dist/{layout/screen-section/meta.d.ts → features/layout/screenSectionMeta.d.ts} +2 -2
- package/dist/features/layout/screenSectionMeta.d.ts.map +1 -0
- package/dist/{layout/screen-section/meta.js → features/layout/screenSectionMeta.js} +1 -1
- package/dist/features/layout/screenSectionMeta.js.map +1 -0
- package/dist/features/layout/{boxMeta.d.ts → scrollViewMeta.d.ts} +8 -15
- package/dist/features/layout/scrollViewMeta.d.ts.map +1 -0
- package/dist/features/layout/{boxMeta.js → scrollViewMeta.js} +4 -6
- package/dist/features/layout/scrollViewMeta.js.map +1 -0
- package/dist/features/layout/{stackMeta.d.ts → viewMeta.d.ts} +24 -4
- package/dist/features/layout/viewMeta.d.ts.map +1 -0
- package/dist/features/layout/{stackMeta.js → viewMeta.js} +8 -3
- package/dist/features/layout/viewMeta.js.map +1 -0
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/missing-element/adapters/inbound/MissingElement.js +5 -5
- package/dist/features/missing-element/adapters/inbound/MissingElement.js.map +1 -1
- package/dist/features/pagination/adapters/inbound/Pagination.js +3 -3
- package/dist/features/pagination/adapters/inbound/Pagination.js.map +1 -1
- package/dist/{patterns/tile-grid → features/palette-item/adapters/inbound}/PaletteItem.d.ts +1 -1
- package/dist/features/palette-item/adapters/inbound/PaletteItem.d.ts.map +1 -0
- package/dist/{patterns/tile-grid → features/palette-item/adapters/inbound}/PaletteItem.js +10 -10
- package/dist/features/palette-item/adapters/inbound/PaletteItem.js.map +1 -0
- package/dist/features/palette-item/paletteItemMeta.d.ts +9 -0
- package/dist/features/palette-item/paletteItemMeta.d.ts.map +1 -0
- package/dist/features/palette-item/paletteItemMeta.js +9 -0
- package/dist/features/palette-item/paletteItemMeta.js.map +1 -0
- package/dist/features/palette-item/public.d.ts +3 -0
- package/dist/features/palette-item/public.d.ts.map +1 -0
- package/dist/features/palette-item/public.js +2 -0
- package/dist/features/palette-item/public.js.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +2 -2
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -1
- package/dist/features/progress/adapters/inbound/Progress.js +4 -4
- package/dist/features/progress/adapters/inbound/Progress.js.map +1 -1
- package/dist/features/progress/adapters/inbound/ProgressRing.js +10 -10
- package/dist/features/progress/adapters/inbound/ProgressRing.js.map +1 -1
- package/dist/features/rating/adapters/inbound/Rating.d.ts.map +1 -1
- package/dist/features/rating/adapters/inbound/Rating.js +3 -3
- package/dist/features/rating/adapters/inbound/Rating.js.map +1 -1
- package/dist/features/skeleton/adapters/inbound/Skeleton.js +2 -2
- package/dist/features/skeleton/adapters/inbound/Skeleton.js.map +1 -1
- package/dist/features/skeleton/adapters/inbound/SkeletonCard.js +5 -5
- package/dist/features/skeleton/adapters/inbound/SkeletonCard.js.map +1 -1
- package/dist/features/skeleton/adapters/inbound/SkeletonText.js +3 -3
- package/dist/features/skeleton/adapters/inbound/SkeletonText.js.map +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/features/time-picker/composition/TimePickerContent.js +7 -7
- package/dist/features/time-picker/composition/TimePickerContent.js.map +1 -1
- package/dist/features/time-picker/composition/TimePickerField.js +3 -3
- package/dist/features/time-picker/composition/TimePickerField.js.map +1 -1
- package/dist/features/toolbar/adapters/inbound/Toolbar.js +3 -3
- package/dist/features/toolbar/adapters/inbound/Toolbar.js.map +1 -1
- package/dist/features/uploader/adapters/inbound/Uploader.js +19 -19
- package/dist/features/uploader/adapters/inbound/Uploader.js.map +1 -1
- package/dist/index.d.ts +6 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -11
- package/dist/index.js.map +1 -1
- package/dist/metadata/allowedChildren.d.ts +4 -4
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +4 -6
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +2 -2
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +9 -22
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/chat-list-item/ChatListItem.d.ts.map +1 -1
- package/dist/patterns/chat-list-item/ChatListItem.js +22 -23
- package/dist/patterns/chat-list-item/ChatListItem.js.map +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.js +12 -12
- package/dist/patterns/collection-editor/CollectionEditor.js.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js +3 -3
- package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
- package/dist/patterns/filter-bar/FilterBar.d.ts.map +1 -1
- package/dist/patterns/filter-bar/FilterBar.js +6 -7
- package/dist/patterns/filter-bar/FilterBar.js.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.js +5 -5
- package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
- package/dist/patterns/list/List.d.ts.map +1 -1
- package/dist/patterns/list/List.js +6 -7
- package/dist/patterns/list/List.js.map +1 -1
- package/dist/patterns/list/ListRow.d.ts.map +1 -1
- package/dist/patterns/list/ListRow.js +16 -17
- package/dist/patterns/list/ListRow.js.map +1 -1
- package/dist/patterns/list/ListSection.js +3 -3
- package/dist/patterns/list/ListSection.js.map +1 -1
- package/dist/patterns/message-bubble/MessageBubble.d.ts.map +1 -1
- package/dist/patterns/message-bubble/MessageBubble.js +21 -20
- package/dist/patterns/message-bubble/MessageBubble.js.map +1 -1
- package/dist/patterns/message-bubble/meta.d.ts +1 -1
- package/dist/patterns/notice/Notice.js +5 -5
- package/dist/patterns/notice/Notice.js.map +1 -1
- package/dist/patterns/notice/meta.d.ts +1 -1
- package/dist/patterns/panel/meta.d.ts +1 -1
- package/dist/patterns/reader/ReaderSurface.d.ts.map +1 -1
- package/dist/patterns/reader/ReaderSurface.js +18 -19
- package/dist/patterns/reader/ReaderSurface.js.map +1 -1
- package/dist/patterns/reader/meta.d.ts +2 -2
- package/dist/patterns/scanner/BarcodeScannerView.js +7 -7
- package/dist/patterns/scanner/BarcodeScannerView.js.map +1 -1
- package/dist/patterns/scanner/CameraPermissionView.js +5 -5
- package/dist/patterns/scanner/CameraPermissionView.js.map +1 -1
- package/dist/patterns/scanner/ScanOverlay.js +8 -8
- package/dist/patterns/scanner/ScanOverlay.js.map +1 -1
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/patterns/section-header/SectionHeader.js +8 -8
- package/dist/patterns/section-header/SectionHeader.js.map +1 -1
- package/dist/patterns/switch-field/SwitchField.d.ts +1 -1
- package/dist/patterns/switch-field/SwitchField.js +3 -3
- package/dist/patterns/switch-field/SwitchField.js.map +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js +30 -30
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/patterns/timeline/Timeline.d.ts.map +1 -1
- package/dist/patterns/timeline/Timeline.js +14 -15
- package/dist/patterns/timeline/Timeline.js.map +1 -1
- package/dist/patterns/tree-view/TreeItem.d.ts.map +1 -1
- package/dist/patterns/tree-view/TreeItem.js +9 -9
- package/dist/patterns/tree-view/TreeItem.js.map +1 -1
- package/dist/patterns/tree-view/TreeView.js +3 -3
- package/dist/patterns/tree-view/TreeView.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -23
- package/dist/registry.js.map +1 -1
- package/dist/types/button-group.d.ts +2 -2
- package/dist/types/button-group.d.ts.map +1 -1
- package/dist/types/button-group.js.map +1 -1
- package/dist/types/gradient.d.ts +6 -6
- package/dist/types/gradient.d.ts.map +1 -1
- package/dist/types/gradient.js.map +1 -1
- package/dist/types/layout.d.ts +22 -4
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/dist/types/palette-item.d.ts +13 -0
- package/dist/types/palette-item.d.ts.map +1 -0
- package/dist/types/palette-item.js +2 -0
- package/dist/types/palette-item.js.map +1 -0
- package/dist/types/skeleton.d.ts +5 -5
- package/dist/types/skeleton.d.ts.map +1 -1
- package/dist/types/skeleton.js.map +1 -1
- package/package.json +2 -2
- package/src/audit.test.ts +7 -11
- package/src/constants.ts +2 -1
- package/src/expo57Migration.test.ts +4 -3
- package/src/features/accordion/adapters/inbound/AccordionItem.tsx +19 -19
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +6 -7
- package/src/features/auth/adapters/inbound/AuthForm.tsx +3 -3
- package/src/features/auth/adapters/inbound/ForgotPasswordForm.tsx +3 -3
- package/src/features/auth/adapters/inbound/OAuthProviderList.tsx +3 -3
- package/src/features/auth/adapters/inbound/OtpForm.tsx +3 -3
- package/src/features/auth/adapters/inbound/SignInForm.tsx +3 -3
- package/src/features/auth/adapters/inbound/SignUpForm.tsx +3 -3
- package/src/features/avatar/adapters/inbound/Avatar.tsx +3 -3
- package/src/features/avatar/adapters/inbound/AvatarGroup.tsx +7 -7
- package/src/features/bottom-sheet/adapters/inbound/BottomSheet.tsx +3 -3
- package/src/features/bottom-sheet/public.test.ts +1 -1
- package/src/features/breadcrumbs/adapters/inbound/Breadcrumbs.tsx +5 -5
- package/src/features/button/adapters/inbound/ButtonGroup.tsx +3 -3
- package/src/features/card/adapters/inbound/Card.tsx +12 -12
- package/src/features/card/adapters/inbound/MediaCard.tsx +21 -21
- package/src/features/card/adapters/inbound/MetricCard.tsx +10 -11
- package/src/features/card/adapters/inbound/PostCard.tsx +37 -38
- package/src/features/card/adapters/inbound/ProductCard.tsx +17 -18
- package/src/features/chip/adapters/inbound/Chip.tsx +5 -6
- package/src/features/chip/adapters/inbound/ChipGroup.tsx +3 -3
- package/src/features/{layout → content-rail}/adapters/inbound/ContentRail.test.ts +3 -1
- package/src/features/{layout → content-rail}/adapters/inbound/ContentRail.tsx +9 -10
- package/src/features/content-rail/constants.ts +1 -0
- package/src/features/content-rail/public.ts +10 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +32 -32
- package/src/features/date-picker/composition/DatePickerContent.tsx +16 -16
- package/src/features/date-picker/composition/DatePickerField.tsx +3 -3
- package/src/features/dialog/adapters/inbound/Dialog.tsx +9 -9
- package/src/features/empty-state/adapters/inbound/EmptyState.tsx +5 -5
- package/src/features/form/adapters/inbound/Form.tsx +3 -3
- package/src/features/form/adapters/inbound/FormActions.tsx +4 -4
- package/src/features/form/adapters/inbound/FormError.tsx +3 -3
- package/src/features/form/adapters/inbound/FormField.tsx +3 -3
- package/src/features/form/checkbox/adapters/inbound/CheckboxGroup.tsx +5 -6
- package/src/features/form/radio/adapters/inbound/RadioGroup.tsx +10 -10
- package/src/features/form/select/adapters/inbound/Select.web.tsx +3 -3
- package/src/features/gradient/adapters/inbound/Gradient.tsx +5 -5
- package/src/features/hero/adapters/inbound/Hero.tsx +12 -12
- package/src/features/icon/utils/meta.test.ts +2 -3
- package/src/features/image/adapters/inbound/Image.tsx +3 -3
- package/src/features/layout/adapters/inbound/AppShell.test.ts +24 -0
- package/src/features/layout/adapters/inbound/AppShell.tsx +44 -0
- package/src/features/layout/adapters/inbound/Screen.tsx +50 -0
- package/src/{layout/screen-section → features/layout/adapters/inbound}/ScreenSection.tsx +7 -11
- package/src/features/layout/adapters/inbound/ScrollView.tsx +18 -0
- package/src/features/layout/adapters/inbound/View.tsx +18 -0
- package/src/features/layout/constants.ts +0 -2
- package/src/features/layout/public.test.ts +55 -0
- package/src/features/layout/public.ts +10 -16
- package/src/features/layout/{containerMeta.ts → scrollViewMeta.ts} +6 -3
- package/src/features/layout/{stackMeta.ts → viewMeta.ts} +7 -2
- package/src/features/missing-element/adapters/inbound/MissingElement.tsx +5 -5
- package/src/features/pagination/adapters/inbound/Pagination.tsx +3 -3
- package/src/{patterns/tile-grid → features/palette-item/adapters/inbound}/PaletteItem.tsx +11 -11
- package/src/{layout/sidebar-layout/meta.ts → features/palette-item/paletteItemMeta.ts} +4 -4
- package/src/features/palette-item/public.ts +2 -0
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +2 -2
- package/src/features/progress/adapters/inbound/Progress.tsx +4 -4
- package/src/features/progress/adapters/inbound/ProgressRing.tsx +10 -10
- package/src/features/rating/adapters/inbound/Rating.tsx +3 -3
- package/src/features/skeleton/adapters/inbound/Skeleton.tsx +2 -2
- package/src/features/skeleton/adapters/inbound/SkeletonCard.tsx +5 -5
- package/src/features/skeleton/adapters/inbound/SkeletonText.tsx +3 -3
- package/src/features/time-picker/composition/TimePickerContent.tsx +7 -7
- package/src/features/time-picker/composition/TimePickerField.tsx +3 -3
- package/src/features/toolbar/adapters/inbound/Toolbar.tsx +3 -3
- package/src/features/uploader/adapters/inbound/Uploader.tsx +19 -19
- package/src/index.ts +25 -31
- package/src/interactionPolicy.test.ts +1 -1
- package/src/metadata/allowedChildren.ts +4 -6
- package/src/metadata/componentMeta.test.ts +4 -6
- package/src/metadata/componentMeta.ts +9 -22
- package/src/metadata/radioGroupReachability.test.ts +2 -2
- package/src/patterns/chat-list-item/ChatListItem.tsx +22 -23
- package/src/patterns/collection-editor/CollectionEditor.tsx +13 -13
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +3 -3
- package/src/patterns/filter-bar/FilterBar.tsx +6 -7
- package/src/patterns/inspector-field/InspectorField.tsx +5 -5
- package/src/patterns/list/List.tsx +6 -7
- package/src/patterns/list/ListRow.tsx +16 -17
- package/src/patterns/list/ListSection.tsx +3 -3
- package/src/patterns/message-bubble/MessageBubble.tsx +23 -20
- package/src/patterns/notice/Notice.tsx +5 -5
- package/src/patterns/reader/ReaderSurface.tsx +18 -19
- package/src/patterns/scanner/BarcodeScannerView.tsx +7 -7
- package/src/patterns/scanner/CameraPermissionView.tsx +5 -5
- package/src/patterns/scanner/ScanOverlay.tsx +8 -8
- package/src/patterns/section-header/SectionHeader.tsx +8 -8
- package/src/patterns/switch-field/SwitchField.tsx +4 -4
- package/src/patterns/theme-composer/ThemeComposer.tsx +30 -30
- package/src/patterns/timeline/Timeline.tsx +21 -15
- package/src/patterns/tree-view/TreeItem.tsx +12 -11
- package/src/patterns/tree-view/TreeView.tsx +3 -3
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.test.ts +1 -1
- package/src/registry.ts +13 -23
- package/src/showcaseCoverage.test.ts +2 -22
- package/src/theme/themeScopeStructure.test.ts +10 -31
- package/src/types/button-group.ts +2 -2
- package/src/types/gradient.ts +6 -6
- package/src/types/layout.ts +28 -7
- package/src/types/palette-item.ts +14 -0
- package/src/types/skeleton.ts +5 -5
- package/dist/features/layout/adapters/inbound/Box.d.ts +0 -5
- package/dist/features/layout/adapters/inbound/Box.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/Box.js +0 -10
- package/dist/features/layout/adapters/inbound/Box.js.map +0 -1
- package/dist/features/layout/adapters/inbound/Container.d.ts +0 -5
- package/dist/features/layout/adapters/inbound/Container.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/Container.js +0 -10
- package/dist/features/layout/adapters/inbound/Container.js.map +0 -1
- package/dist/features/layout/adapters/inbound/ContentRail.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/ContentRail.js.map +0 -1
- package/dist/features/layout/adapters/inbound/ContentRailFlow.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/ContentRailFlow.js.map +0 -1
- package/dist/features/layout/adapters/inbound/Stack.d.ts +0 -5
- package/dist/features/layout/adapters/inbound/Stack.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/Stack.js +0 -10
- package/dist/features/layout/adapters/inbound/Stack.js.map +0 -1
- package/dist/features/layout/boxMeta.d.ts.map +0 -1
- package/dist/features/layout/boxMeta.js.map +0 -1
- package/dist/features/layout/containerMeta.d.ts +0 -55
- package/dist/features/layout/containerMeta.d.ts.map +0 -1
- package/dist/features/layout/containerMeta.js +0 -10
- package/dist/features/layout/containerMeta.js.map +0 -1
- package/dist/features/layout/contentRailMeta.d.ts.map +0 -1
- package/dist/features/layout/contentRailMeta.js.map +0 -1
- package/dist/features/layout/stackMeta.d.ts.map +0 -1
- package/dist/features/layout/stackMeta.js.map +0 -1
- package/dist/features/layout/utils/resolveContentRailItemWidth.d.ts.map +0 -1
- package/dist/features/layout/utils/resolveContentRailItemWidth.js.map +0 -1
- package/dist/features/layout/utils/resolveContentRailPhysicalOffset.d.ts.map +0 -1
- package/dist/features/layout/utils/resolveContentRailPhysicalOffset.js.map +0 -1
- package/dist/features/layout/utils/resolveContentRailState.d.ts.map +0 -1
- package/dist/features/layout/utils/resolveContentRailState.js.map +0 -1
- package/dist/features/layout/utils/useContentRailReducedMotion.d.ts.map +0 -1
- package/dist/features/layout/utils/useContentRailReducedMotion.js.map +0 -1
- package/dist/foundation/Center.d.ts +0 -12
- package/dist/foundation/Center.d.ts.map +0 -1
- package/dist/foundation/Center.js +0 -13
- package/dist/foundation/Center.js.map +0 -1
- package/dist/foundation/Inline.d.ts +0 -12
- package/dist/foundation/Inline.d.ts.map +0 -1
- package/dist/foundation/Inline.js +0 -13
- package/dist/foundation/Inline.js.map +0 -1
- package/dist/foundation/Show.d.ts +0 -12
- package/dist/foundation/Show.d.ts.map +0 -1
- package/dist/foundation/Show.js +0 -13
- package/dist/foundation/Show.js.map +0 -1
- package/dist/foundation/Spacer.d.ts +0 -12
- package/dist/foundation/Spacer.d.ts.map +0 -1
- package/dist/foundation/Spacer.js +0 -13
- package/dist/foundation/Spacer.js.map +0 -1
- package/dist/foundation/index.d.ts +0 -9
- package/dist/foundation/index.d.ts.map +0 -1
- package/dist/foundation/index.js +0 -5
- package/dist/foundation/index.js.map +0 -1
- package/dist/foundation/meta.d.ts +0 -35
- package/dist/foundation/meta.d.ts.map +0 -1
- package/dist/foundation/meta.js +0 -35
- package/dist/foundation/meta.js.map +0 -1
- package/dist/layout/app-shell/AppShell.d.ts +0 -16
- package/dist/layout/app-shell/AppShell.d.ts.map +0 -1
- package/dist/layout/app-shell/AppShell.js +0 -50
- package/dist/layout/app-shell/AppShell.js.map +0 -1
- package/dist/layout/app-shell/index.d.ts +0 -3
- package/dist/layout/app-shell/index.d.ts.map +0 -1
- package/dist/layout/app-shell/index.js +0 -2
- package/dist/layout/app-shell/index.js.map +0 -1
- package/dist/layout/app-shell/meta.d.ts.map +0 -1
- package/dist/layout/app-shell/meta.js.map +0 -1
- package/dist/layout/app-shell/types.d.ts +0 -9
- package/dist/layout/app-shell/types.d.ts.map +0 -1
- package/dist/layout/app-shell/types.js +0 -2
- package/dist/layout/app-shell/types.js.map +0 -1
- package/dist/layout/screen/Screen.d.ts +0 -11
- package/dist/layout/screen/Screen.d.ts.map +0 -1
- package/dist/layout/screen/Screen.js +0 -30
- package/dist/layout/screen/Screen.js.map +0 -1
- package/dist/layout/screen/index.d.ts +0 -3
- package/dist/layout/screen/index.d.ts.map +0 -1
- package/dist/layout/screen/index.js +0 -2
- package/dist/layout/screen/index.js.map +0 -1
- package/dist/layout/screen/meta.d.ts.map +0 -1
- package/dist/layout/screen/meta.js.map +0 -1
- package/dist/layout/screen/types.d.ts +0 -10
- package/dist/layout/screen/types.d.ts.map +0 -1
- package/dist/layout/screen/types.js +0 -2
- package/dist/layout/screen/types.js.map +0 -1
- package/dist/layout/screen-section/ScreenSection.d.ts +0 -9
- package/dist/layout/screen-section/ScreenSection.d.ts.map +0 -1
- package/dist/layout/screen-section/ScreenSection.js +0 -17
- package/dist/layout/screen-section/ScreenSection.js.map +0 -1
- package/dist/layout/screen-section/index.d.ts +0 -3
- package/dist/layout/screen-section/index.d.ts.map +0 -1
- package/dist/layout/screen-section/index.js +0 -2
- package/dist/layout/screen-section/index.js.map +0 -1
- package/dist/layout/screen-section/meta.d.ts.map +0 -1
- package/dist/layout/screen-section/meta.js.map +0 -1
- package/dist/layout/screen-section/types.d.ts +0 -9
- package/dist/layout/screen-section/types.d.ts.map +0 -1
- package/dist/layout/screen-section/types.js +0 -2
- package/dist/layout/screen-section/types.js.map +0 -1
- package/dist/layout/settings-layout/SettingsLayout.d.ts +0 -7
- package/dist/layout/settings-layout/SettingsLayout.d.ts.map +0 -1
- package/dist/layout/settings-layout/SettingsLayout.js +0 -18
- package/dist/layout/settings-layout/SettingsLayout.js.map +0 -1
- package/dist/layout/settings-layout/index.d.ts +0 -3
- package/dist/layout/settings-layout/index.d.ts.map +0 -1
- package/dist/layout/settings-layout/index.js +0 -2
- package/dist/layout/settings-layout/index.js.map +0 -1
- package/dist/layout/settings-layout/meta.d.ts +0 -9
- package/dist/layout/settings-layout/meta.d.ts.map +0 -1
- package/dist/layout/settings-layout/meta.js +0 -9
- package/dist/layout/settings-layout/meta.js.map +0 -1
- package/dist/layout/settings-layout/types.d.ts +0 -10
- package/dist/layout/settings-layout/types.d.ts.map +0 -1
- package/dist/layout/settings-layout/types.js +0 -2
- package/dist/layout/settings-layout/types.js.map +0 -1
- package/dist/layout/sidebar-layout/SidebarLayout.d.ts +0 -11
- package/dist/layout/sidebar-layout/SidebarLayout.d.ts.map +0 -1
- package/dist/layout/sidebar-layout/SidebarLayout.js +0 -27
- package/dist/layout/sidebar-layout/SidebarLayout.js.map +0 -1
- package/dist/layout/sidebar-layout/index.d.ts +0 -3
- package/dist/layout/sidebar-layout/index.d.ts.map +0 -1
- package/dist/layout/sidebar-layout/index.js +0 -2
- package/dist/layout/sidebar-layout/index.js.map +0 -1
- package/dist/layout/sidebar-layout/meta.d.ts +0 -9
- package/dist/layout/sidebar-layout/meta.d.ts.map +0 -1
- package/dist/layout/sidebar-layout/meta.js +0 -9
- package/dist/layout/sidebar-layout/meta.js.map +0 -1
- package/dist/layout/sidebar-layout/resolveSidebarLayoutSizing.d.ts +0 -14
- package/dist/layout/sidebar-layout/resolveSidebarLayoutSizing.d.ts.map +0 -1
- package/dist/layout/sidebar-layout/resolveSidebarLayoutSizing.js +0 -16
- package/dist/layout/sidebar-layout/resolveSidebarLayoutSizing.js.map +0 -1
- package/dist/layout/sidebar-layout/types.d.ts +0 -12
- package/dist/layout/sidebar-layout/types.d.ts.map +0 -1
- package/dist/layout/sidebar-layout/types.js +0 -2
- package/dist/layout/sidebar-layout/types.js.map +0 -1
- package/dist/layout/topbar-layout/TopbarLayout.d.ts +0 -9
- package/dist/layout/topbar-layout/TopbarLayout.d.ts.map +0 -1
- package/dist/layout/topbar-layout/TopbarLayout.js +0 -17
- package/dist/layout/topbar-layout/TopbarLayout.js.map +0 -1
- package/dist/layout/topbar-layout/index.d.ts +0 -3
- package/dist/layout/topbar-layout/index.d.ts.map +0 -1
- package/dist/layout/topbar-layout/index.js +0 -2
- package/dist/layout/topbar-layout/index.js.map +0 -1
- package/dist/layout/topbar-layout/meta.d.ts +0 -9
- package/dist/layout/topbar-layout/meta.d.ts.map +0 -1
- package/dist/layout/topbar-layout/meta.js +0 -9
- package/dist/layout/topbar-layout/meta.js.map +0 -1
- package/dist/layout/topbar-layout/types.d.ts +0 -8
- package/dist/layout/topbar-layout/types.d.ts.map +0 -1
- package/dist/layout/topbar-layout/types.js +0 -2
- package/dist/layout/topbar-layout/types.js.map +0 -1
- package/dist/patterns/settings-row/SettingsRow.d.ts +0 -9
- package/dist/patterns/settings-row/SettingsRow.d.ts.map +0 -1
- package/dist/patterns/settings-row/SettingsRow.js +0 -24
- package/dist/patterns/settings-row/SettingsRow.js.map +0 -1
- package/dist/patterns/settings-row/index.d.ts +0 -3
- package/dist/patterns/settings-row/index.d.ts.map +0 -1
- package/dist/patterns/settings-row/index.js +0 -2
- package/dist/patterns/settings-row/index.js.map +0 -1
- package/dist/patterns/settings-row/meta.d.ts +0 -39
- package/dist/patterns/settings-row/meta.d.ts.map +0 -1
- package/dist/patterns/settings-row/meta.js +0 -39
- package/dist/patterns/settings-row/meta.js.map +0 -1
- package/dist/patterns/settings-row/types.d.ts +0 -23
- package/dist/patterns/settings-row/types.d.ts.map +0 -1
- package/dist/patterns/settings-row/types.js +0 -2
- package/dist/patterns/settings-row/types.js.map +0 -1
- package/dist/patterns/tile-grid/PaletteItem.d.ts.map +0 -1
- package/dist/patterns/tile-grid/PaletteItem.js.map +0 -1
- package/dist/patterns/tile-grid/TileGrid.d.ts +0 -9
- package/dist/patterns/tile-grid/TileGrid.d.ts.map +0 -1
- package/dist/patterns/tile-grid/TileGrid.js +0 -33
- package/dist/patterns/tile-grid/TileGrid.js.map +0 -1
- package/dist/patterns/tile-grid/index.d.ts +0 -4
- package/dist/patterns/tile-grid/index.d.ts.map +0 -1
- package/dist/patterns/tile-grid/index.js +0 -4
- package/dist/patterns/tile-grid/index.js.map +0 -1
- package/dist/patterns/tile-grid/meta.d.ts +0 -17
- package/dist/patterns/tile-grid/meta.d.ts.map +0 -1
- package/dist/patterns/tile-grid/meta.js +0 -18
- package/dist/patterns/tile-grid/meta.js.map +0 -1
- package/dist/patterns/tile-grid/types.d.ts +0 -18
- package/dist/patterns/tile-grid/types.d.ts.map +0 -1
- package/dist/patterns/tile-grid/types.js +0 -2
- package/dist/patterns/tile-grid/types.js.map +0 -1
- package/src/features/layout/adapters/inbound/Box.tsx +0 -18
- package/src/features/layout/adapters/inbound/Container.tsx +0 -18
- package/src/features/layout/adapters/inbound/Stack.tsx +0 -18
- package/src/features/layout/boxMeta.ts +0 -16
- package/src/foundation/Center.tsx +0 -26
- package/src/foundation/Inline.tsx +0 -26
- package/src/foundation/Show.tsx +0 -23
- package/src/foundation/Spacer.tsx +0 -26
- package/src/foundation/index.test.ts +0 -30
- package/src/foundation/index.ts +0 -8
- package/src/foundation/meta.ts +0 -36
- package/src/layout/app-shell/AppShell.test.ts +0 -24
- package/src/layout/app-shell/AppShell.tsx +0 -65
- package/src/layout/app-shell/index.ts +0 -2
- package/src/layout/app-shell/types.ts +0 -10
- package/src/layout/screen/Screen.test.ts +0 -22
- package/src/layout/screen/Screen.tsx +0 -47
- package/src/layout/screen/index.ts +0 -2
- package/src/layout/screen/types.ts +0 -11
- package/src/layout/screen-section/index.ts +0 -2
- package/src/layout/screen-section/types.ts +0 -10
- package/src/layout/settings-layout/SettingsLayout.tsx +0 -33
- package/src/layout/settings-layout/index.ts +0 -2
- package/src/layout/settings-layout/meta.ts +0 -10
- package/src/layout/settings-layout/types.ts +0 -11
- package/src/layout/sidebar-layout/SidebarLayout.test.ts +0 -35
- package/src/layout/sidebar-layout/SidebarLayout.tsx +0 -46
- package/src/layout/sidebar-layout/index.ts +0 -2
- package/src/layout/sidebar-layout/resolveSidebarLayoutSizing.ts +0 -18
- package/src/layout/sidebar-layout/types.ts +0 -14
- package/src/layout/topbar-layout/TopbarLayout.tsx +0 -30
- package/src/layout/topbar-layout/index.ts +0 -2
- package/src/layout/topbar-layout/meta.ts +0 -10
- package/src/layout/topbar-layout/types.ts +0 -9
- package/src/patterns/settings-row/SettingsRow.tsx +0 -53
- package/src/patterns/settings-row/index.ts +0 -2
- package/src/patterns/settings-row/meta.ts +0 -40
- package/src/patterns/settings-row/types.ts +0 -28
- package/src/patterns/tile-grid/TileGrid.tsx +0 -55
- package/src/patterns/tile-grid/index.ts +0 -3
- package/src/patterns/tile-grid/meta.ts +0 -21
- package/src/patterns/tile-grid/types.ts +0 -20
- /package/dist/features/{layout → content-rail}/adapters/inbound/ContentRail.d.ts +0 -0
- /package/dist/features/{layout → content-rail}/adapters/inbound/ContentRailFlow.d.ts +0 -0
- /package/dist/features/{layout → content-rail}/adapters/inbound/ContentRailFlow.js +0 -0
- /package/dist/features/{layout → content-rail}/contentRailMeta.js +0 -0
- /package/dist/features/{layout → content-rail}/utils/resolveContentRailItemWidth.d.ts +0 -0
- /package/dist/features/{layout → content-rail}/utils/resolveContentRailItemWidth.js +0 -0
- /package/dist/features/{layout → content-rail}/utils/resolveContentRailPhysicalOffset.d.ts +0 -0
- /package/dist/features/{layout → content-rail}/utils/resolveContentRailPhysicalOffset.js +0 -0
- /package/dist/features/{layout → content-rail}/utils/resolveContentRailState.d.ts +0 -0
- /package/dist/features/{layout → content-rail}/utils/resolveContentRailState.js +0 -0
- /package/dist/features/{layout → content-rail}/utils/useContentRailReducedMotion.d.ts +0 -0
- /package/dist/features/{layout → content-rail}/utils/useContentRailReducedMotion.js +0 -0
- /package/src/features/{layout → content-rail}/adapters/inbound/ContentRailFlow.tsx +0 -0
- /package/src/features/{layout → content-rail}/contentRailMeta.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/resolveContentRailItemWidth.test.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/resolveContentRailItemWidth.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/resolveContentRailPhysicalOffset.test.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/resolveContentRailPhysicalOffset.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/resolveContentRailState.test.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/resolveContentRailState.ts +0 -0
- /package/src/features/{layout → content-rail}/utils/useContentRailReducedMotion.ts +0 -0
- /package/src/{layout/app-shell/meta.ts → features/layout/appShellMeta.ts} +0 -0
- /package/src/{layout/screen/meta.ts → features/layout/screenMeta.ts} +0 -0
- /package/src/{layout/screen-section/meta.ts → features/layout/screenSectionMeta.ts} +0 -0
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Image } from 'react-native';
|
|
3
3
|
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
4
4
|
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
5
|
-
import {
|
|
5
|
+
import { View } from '../../../layout/public';
|
|
6
6
|
import { Heading } from '../../../typography/public';
|
|
7
7
|
import { Text } from '../../../typography/public';
|
|
8
8
|
import { Card } from '../../public';
|
|
@@ -23,45 +23,45 @@ function MediaCardInner({ themeId: _themeId, mode: _mode, interactionPolicy, tes
|
|
|
23
23
|
const resolvedAspectRatio = resolveImageAspectRatio(imageAspectRatio);
|
|
24
24
|
const renderImage = () => {
|
|
25
25
|
if (image) {
|
|
26
|
-
return (<
|
|
26
|
+
return (<View radius="m" style={{ overflow: 'hidden' }}>
|
|
27
27
|
{image}
|
|
28
|
-
</
|
|
28
|
+
</View>);
|
|
29
29
|
}
|
|
30
30
|
if (!imageSource) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
|
-
return (<
|
|
34
|
-
<
|
|
33
|
+
return (<View bg={theme.semantics.neutral.surface} radius="m" style={{ overflow: 'hidden' }}>
|
|
34
|
+
<View style={{ aspectRatio: resolvedAspectRatio, width: '100%' }}>
|
|
35
35
|
<Image accessibilityLabel={imageLabel} source={imageSource} style={{ height: '100%', width: '100%' }}/>
|
|
36
|
-
</
|
|
37
|
-
</
|
|
36
|
+
</View>
|
|
37
|
+
</View>);
|
|
38
38
|
};
|
|
39
39
|
const hasHeader = [eyebrow, title, description, badges, actions].some((item) => item != null);
|
|
40
40
|
return (<Card compact={compact} interactionPolicy={interactionPolicy} onPress={isInteractive ? onPress : undefined} testID={testID} tone={tone}>
|
|
41
|
-
<
|
|
41
|
+
<View gap={gap}>
|
|
42
42
|
{renderImage()}
|
|
43
43
|
|
|
44
|
-
{hasHeader ? (<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
44
|
+
{hasHeader ? (<View align={{ base: 'flex-start', md: 'center' }} direction={{ base: 'column', md: 'row' }} gap="m" justify="space-between">
|
|
45
|
+
<View flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>
|
|
46
|
+
<View gap="xs">
|
|
47
47
|
{eyebrow ? (<Text emphasis="muted" variant="caption" weight="semiBold">
|
|
48
48
|
{eyebrow}
|
|
49
49
|
</Text>) : null}
|
|
50
|
-
<
|
|
50
|
+
<View gap="xs">
|
|
51
51
|
<Heading level={compact ? 4 : 3}>{title}</Heading>
|
|
52
|
-
{badges ? <
|
|
53
|
-
</
|
|
52
|
+
{badges ? <View>{badges}</View> : null}
|
|
53
|
+
</View>
|
|
54
54
|
{description ? (<Text emphasis="muted" variant="bodySmall">
|
|
55
55
|
{description}
|
|
56
56
|
</Text>) : null}
|
|
57
|
-
</
|
|
58
|
-
</
|
|
59
|
-
{actions ? <
|
|
60
|
-
</
|
|
57
|
+
</View>
|
|
58
|
+
</View>
|
|
59
|
+
{actions ? <View>{actions}</View> : null}
|
|
60
|
+
</View>) : null}
|
|
61
61
|
|
|
62
|
-
{children ? <
|
|
63
|
-
{footer ? <
|
|
64
|
-
</
|
|
62
|
+
{children ? <View>{children}</View> : null}
|
|
63
|
+
{footer ? <View pt="xs">{footer}</View> : null}
|
|
64
|
+
</View>
|
|
65
65
|
</Card>);
|
|
66
66
|
}
|
|
67
67
|
//# sourceMappingURL=MediaCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/MediaCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MediaCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/MediaCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,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,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAE5D,SAAS,uBAAuB,CAC9B,gBAAiE;IAEjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,IAAI,CAAC,EAAE,CAAC;QAChE,OAAO,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC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AC,CAAC,IAAI,CAChD;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\n\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { MediaCardProps } from '../../../../types/media-card';\nimport { View } from '../../../layout/public';\nimport { Heading } from '../../../typography/public';\nimport { Text } from '../../../typography/public';\nimport { Card } from '../../public';\n/***\n * Card layout with an optional media/header region and structured content slots.\n */\nexport const MediaCard = withZoraThemeScope(MediaCardInner);\n\nfunction resolveImageAspectRatio(\n imageAspectRatio: NonNullable<MediaCardProps['imageAspectRatio']>,\n) {\n if (!Number.isFinite(imageAspectRatio) || imageAspectRatio <= 0) {\n return 16 / 9;\n }\n\n return imageAspectRatio;\n}\n\nfunction MediaCardInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n testID,\n imageSource,\n imageLabel,\n image,\n imageAspectRatio = 16 / 9,\n title,\n description,\n eyebrow,\n badges,\n actions,\n footer,\n children,\n tone = 'default',\n compact = false,\n onPress,\n}: MediaCardProps) {\n const { theme } = useZoraTheme();\n const gap = compact ? 's' : 'm';\n const isInteractive = Boolean(onPress) && !actions;\n const resolvedAspectRatio = resolveImageAspectRatio(imageAspectRatio);\n\n const renderImage = () => {\n if (image) {\n return (\n <View radius=\"m\" style={{ overflow: 'hidden' }}>\n {image}\n </View>\n );\n }\n\n if (!imageSource) {\n return null;\n }\n\n return (\n <View bg={theme.semantics.neutral.surface} radius=\"m\" style={{ overflow: 'hidden' }}>\n <View style={{ aspectRatio: resolvedAspectRatio, width: '100%' }}>\n <Image\n accessibilityLabel={imageLabel}\n source={imageSource}\n style={{ height: '100%', width: '100%' }}\n />\n </View>\n </View>\n );\n };\n\n const hasHeader = [eyebrow, title, description, badges, actions].some((item) => item != null);\n\n return (\n <Card\n compact={compact}\n interactionPolicy={interactionPolicy}\n onPress={isInteractive ? onPress : undefined}\n testID={testID}\n tone={tone}\n >\n <View gap={gap}>\n {renderImage()}\n\n {hasHeader ? (\n <View\n align={{ base: 'flex-start', md: 'center' }}\n direction={{ base: 'column', md: 'row' }}\n gap=\"m\"\n justify=\"space-between\"\n >\n <View flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>\n <View gap=\"xs\">\n {eyebrow ? (\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {eyebrow}\n </Text>\n ) : null}\n <View gap=\"xs\">\n <Heading level={compact ? 4 : 3}>{title}</Heading>\n {badges ? <View>{badges}</View> : null}\n </View>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n </View>\n {actions ? <View>{actions}</View> : null}\n </View>\n ) : null}\n\n {children ? <View>{children}</View> : null}\n {footer ? <View pt=\"xs\">{footer}</View> : null}\n </View>\n </Card>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/MetricCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MetricCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/MetricCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOrE;;GAEG;AACH,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Inline } from '../../../../foundation';
|
|
3
2
|
import { resolveBadgeRecipe, resolveIconSize } from '../../../../internal/recipes';
|
|
4
3
|
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
5
4
|
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
6
5
|
import { Badge } from '../../../badge/public';
|
|
7
6
|
import { Icon } from '../../../icon/public';
|
|
8
|
-
import {
|
|
7
|
+
import { View } from '../../../layout/public';
|
|
9
8
|
import { Heading } from '../../../typography/public';
|
|
10
9
|
import { Text } from '../../../typography/public';
|
|
11
10
|
import { Card } from '../../public';
|
|
@@ -19,10 +18,10 @@ function MetricCardInner({ themeId: _themeId, mode: _mode, interactionPolicy, te
|
|
|
19
18
|
const badgeRecipe = resolveBadgeRecipe({ color: deltaColor, variant: 'soft', size: 's' });
|
|
20
19
|
const iconColor = theme.semantics.content.muted;
|
|
21
20
|
return (<Card compact={compact} interactionPolicy={interactionPolicy} onPress={isInteractive ? onPress : undefined} testID={testID} tone={tone}>
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
21
|
+
<View gap={compact ? 's' : 'm'}>
|
|
22
|
+
<View direction="row" align="flex-start" gap="m" justify="space-between">
|
|
23
|
+
<View flex={1} gap="xs">
|
|
24
|
+
<View direction="row" align="center" gap="xs" wrap="wrap">
|
|
26
25
|
{icon ? <Icon {...icon} color={iconColor} size={resolveIconSize('s')}/> : null}
|
|
27
26
|
<Text emphasis="muted" variant="caption" weight="semiBold">
|
|
28
27
|
{label}
|
|
@@ -30,18 +29,18 @@ function MetricCardInner({ themeId: _themeId, mode: _mode, interactionPolicy, te
|
|
|
30
29
|
{delta != null ? (<Badge variant={badgeRecipe.variant} size={badgeRecipe.size} color={badgeRecipe.color}>
|
|
31
30
|
{delta}
|
|
32
31
|
</Badge>) : null}
|
|
33
|
-
</
|
|
32
|
+
</View>
|
|
34
33
|
|
|
35
34
|
<Heading level={compact ? 3 : 2}>{value}</Heading>
|
|
36
35
|
|
|
37
36
|
{description ? (<Text emphasis="muted" variant="bodySmall">
|
|
38
37
|
{description}
|
|
39
38
|
</Text>) : null}
|
|
40
|
-
</
|
|
39
|
+
</View>
|
|
41
40
|
|
|
42
|
-
{actions ? <
|
|
43
|
-
</
|
|
44
|
-
</
|
|
41
|
+
{actions ? <View>{actions}</View> : null}
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
45
44
|
</Card>);
|
|
46
45
|
}
|
|
47
46
|
//# sourceMappingURL=MetricCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/MetricCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MetricCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/MetricCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE9D,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,UAAU,GAAG,SAAS,EACtB,OAAO,EACP,IAAI,GA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,CAAC,CAAC,EAAG,CAAC,CAAC,CAAC,IAAI,CAC/E;cAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CACxD;gBAAA,CAAC,KAAK,CACR;cAAA,EAAE,IAAI,CACN;cAAA,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CACf,CAAC,KAAK,CACJ,OAAO,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAC7B,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CACvB,KAAK,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAEzB;kBAAA,CAAC,KAAK,CACR;gBAAA,EAAE,KAAK,CAAC,CACT,CAAC,CAAC,CAAC,IAAI,CACV;YAAA,EAAE,IAAI,CAEN;;YAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,CAEjD;;YAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACxC;gBAAA,CAAC,WAAW,CACd;cAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,IAAI,CAEN;;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1C;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { resolveBadgeRecipe, resolveIconSize } from '../../../../internal/recipes';\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { MetricCardProps } from '../../../../types/metric-card';\nimport { Badge } from '../../../badge/public';\nimport { Icon } from '../../../icon/public';\nimport { View } from '../../../layout/public';\nimport { Heading } from '../../../typography/public';\nimport { Text } from '../../../typography/public';\nimport { Card } from '../../public';\n/***\n * Highlights a key metric with label, value, and optional trend/actions.\n */\nexport const MetricCard = withZoraThemeScope(MetricCardInner);\n\nfunction MetricCardInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n testID,\n label,\n value,\n description,\n icon,\n delta,\n deltaColor = 'neutral',\n actions,\n tone = 'default',\n compact = false,\n onPress,\n}: MetricCardProps) {\n const { theme } = useZoraTheme();\n const isInteractive = Boolean(onPress) && !actions;\n\n const badgeRecipe = resolveBadgeRecipe({ color: deltaColor, variant: 'soft', size: 's' });\n const iconColor = theme.semantics.content.muted;\n\n return (\n <Card\n compact={compact}\n interactionPolicy={interactionPolicy}\n onPress={isInteractive ? onPress : undefined}\n testID={testID}\n tone={tone}\n >\n <View gap={compact ? 's' : 'm'}>\n <View direction=\"row\" align=\"flex-start\" gap=\"m\" justify=\"space-between\">\n <View flex={1} gap=\"xs\">\n <View direction=\"row\" align=\"center\" gap=\"xs\" wrap=\"wrap\">\n {icon ? <Icon {...icon} color={iconColor} size={resolveIconSize('s')} /> : null}\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {label}\n </Text>\n {delta != null ? (\n <Badge\n variant={badgeRecipe.variant}\n size={badgeRecipe.size}\n color={badgeRecipe.color}\n >\n {delta}\n </Badge>\n ) : null}\n </View>\n\n <Heading level={compact ? 3 : 2}>{value}</Heading>\n\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n\n {actions ? <View>{actions}</View> : null}\n </View>\n </View>\n </Card>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/PostCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PostCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/PostCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,6BAA6B,CAAC;AAMrC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Image as ReactNativeImage } from 'react-native';
|
|
3
|
-
import { Inline } from '../../../../foundation';
|
|
4
3
|
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
5
4
|
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
6
5
|
import { Avatar } from '../../../avatar/public';
|
|
7
6
|
import { Button } from '../../../button/public';
|
|
8
|
-
import {
|
|
7
|
+
import { Divider, View } from '../../../layout/public';
|
|
9
8
|
import { Text } from '../../../typography/public';
|
|
10
9
|
import { Card } from '../../public';
|
|
11
10
|
/***
|
|
@@ -38,33 +37,33 @@ function normalizeMedia(media) {
|
|
|
38
37
|
function PostCardAuthor({ author, compact = false }) {
|
|
39
38
|
const avatarName = resolveAuthorName(author);
|
|
40
39
|
const { avatar } = author;
|
|
41
|
-
return (<
|
|
40
|
+
return (<View direction="row" align="center" gap="s" wrap="nowrap">
|
|
42
41
|
<Avatar initials={avatar?.initials} label={avatar?.label ?? avatarName} name={avatarName} shape={avatar?.shape} size={avatar?.size ?? (compact ? 's' : 'm')} source={avatar?.source} color={avatar?.color}/>
|
|
43
|
-
<
|
|
44
|
-
<
|
|
42
|
+
<View flex={1}>
|
|
43
|
+
<View gap="xxs">
|
|
45
44
|
<Text variant="bodySmall" weight="semiBold">
|
|
46
45
|
{author.name}
|
|
47
46
|
</Text>
|
|
48
47
|
{author.subtitle ? (<Text emphasis="muted" variant="caption">
|
|
49
48
|
{author.subtitle}
|
|
50
49
|
</Text>) : null}
|
|
51
|
-
</
|
|
52
|
-
</
|
|
53
|
-
</
|
|
50
|
+
</View>
|
|
51
|
+
</View>
|
|
52
|
+
</View>);
|
|
54
53
|
}
|
|
55
54
|
function PostCardMediaItem({ media }) {
|
|
56
55
|
const { theme } = useZoraTheme();
|
|
57
56
|
const aspectRatio = resolveMediaAspectRatio(media.aspectRatio);
|
|
58
57
|
if (!('source' in media)) {
|
|
59
|
-
return (<
|
|
58
|
+
return (<View radius="m" style={{ overflow: 'hidden' }}>
|
|
60
59
|
{media.children}
|
|
61
|
-
</
|
|
60
|
+
</View>);
|
|
62
61
|
}
|
|
63
|
-
return (<
|
|
64
|
-
<
|
|
62
|
+
return (<View bg={theme.semantics.neutral.surface} radius="m" style={{ overflow: 'hidden' }}>
|
|
63
|
+
<View style={{ aspectRatio, width: '100%' }}>
|
|
65
64
|
<ReactNativeImage accessibilityLabel={media.label} source={media.source} style={{ height: '100%', width: '100%' }}/>
|
|
66
|
-
</
|
|
67
|
-
</
|
|
65
|
+
</View>
|
|
66
|
+
</View>);
|
|
68
67
|
}
|
|
69
68
|
function PostActionLabel({ action }) {
|
|
70
69
|
if (!action.count) {
|
|
@@ -78,33 +77,33 @@ function PostCardActions({ actions }) {
|
|
|
78
77
|
if (actions.length === 0) {
|
|
79
78
|
return null;
|
|
80
79
|
}
|
|
81
|
-
return (<
|
|
80
|
+
return (<View direction="row" align="center" gap="s" wrap="wrap">
|
|
82
81
|
{actions.map((action) => (<Button key={action.id} disabled={action.disabled} variant={action.selected ? 'soft' : 'ghost'} leadingIcon={action.icon} onPress={action.onPress} size="s" color={action.selected ? 'primary' : 'neutral'}>
|
|
83
82
|
<PostActionLabel action={action}/>
|
|
84
83
|
</Button>))}
|
|
85
|
-
</
|
|
84
|
+
</View>);
|
|
86
85
|
}
|
|
87
86
|
function PostCommentPreviewItem({ comment }) {
|
|
88
|
-
return (<
|
|
87
|
+
return (<View direction="row" align="flex-start" gap="s" wrap="nowrap">
|
|
89
88
|
{comment.author ? <PostCardAuthor author={comment.author} compact/> : null}
|
|
90
|
-
<
|
|
91
|
-
<
|
|
89
|
+
<View flex={1}>
|
|
90
|
+
<View gap="xxs">
|
|
92
91
|
<Text variant="bodySmall">{comment.text}</Text>
|
|
93
92
|
{comment.meta ? (<Text emphasis="subtle" variant="caption">
|
|
94
93
|
{comment.meta}
|
|
95
94
|
</Text>) : null}
|
|
96
|
-
{comment.action ? <
|
|
97
|
-
</
|
|
98
|
-
</
|
|
99
|
-
</
|
|
95
|
+
{comment.action ? <View>{comment.action}</View> : null}
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
98
|
+
</View>);
|
|
100
99
|
}
|
|
101
100
|
function PostCardComments({ comments }) {
|
|
102
101
|
if (comments.length === 0) {
|
|
103
102
|
return null;
|
|
104
103
|
}
|
|
105
|
-
return (<
|
|
104
|
+
return (<View gap="s">
|
|
106
105
|
{comments.map((comment) => (<PostCommentPreviewItem key={comment.id} comment={comment}/>))}
|
|
107
|
-
</
|
|
106
|
+
</View>);
|
|
108
107
|
}
|
|
109
108
|
function PostCardInner({ themeId: _themeId, mode: _mode, interactionPolicy, testID, author, text, children, media, actions = [], comments = [], headerAction, footer, tone = 'default', compact = false, onPress, }) {
|
|
110
109
|
const mediaItems = normalizeMedia(media);
|
|
@@ -113,27 +112,27 @@ function PostCardInner({ themeId: _themeId, mode: _mode, interactionPolicy, test
|
|
|
113
112
|
const hasBody = text != null || children != null || mediaItems.length > 0;
|
|
114
113
|
const hasEngagement = actions.length > 0 || comments.length > 0;
|
|
115
114
|
return (<Card compact={compact} interactionPolicy={interactionPolicy} onPress={isInteractive ? onPress : undefined} testID={testID} tone={tone}>
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<
|
|
115
|
+
<View gap={gap}>
|
|
116
|
+
<View direction="row" align="center" gap="m" justify="space-between" wrap="nowrap">
|
|
117
|
+
<View flex={1}>
|
|
119
118
|
<PostCardAuthor author={author} compact={compact}/>
|
|
120
|
-
</
|
|
121
|
-
{headerAction ? <
|
|
122
|
-
</
|
|
119
|
+
</View>
|
|
120
|
+
{headerAction ? <View>{headerAction}</View> : null}
|
|
121
|
+
</View>
|
|
123
122
|
|
|
124
|
-
{hasBody ? (<
|
|
123
|
+
{hasBody ? (<View gap={gap}>
|
|
125
124
|
{text ? <Text variant="body">{text}</Text> : null}
|
|
126
|
-
{children ? <
|
|
127
|
-
{mediaItems.length > 0 ? (<
|
|
125
|
+
{children ? <View>{children}</View> : null}
|
|
126
|
+
{mediaItems.length > 0 ? (<View gap="s">
|
|
128
127
|
{mediaItems.map((item, index) => (<PostCardMediaItem key={`${index}`} media={item}/>))}
|
|
129
|
-
</
|
|
130
|
-
</
|
|
128
|
+
</View>) : null}
|
|
129
|
+
</View>) : null}
|
|
131
130
|
|
|
132
131
|
{hasEngagement ? <Divider /> : null}
|
|
133
132
|
<PostCardActions actions={actions}/>
|
|
134
133
|
<PostCardComments comments={comments}/>
|
|
135
|
-
{footer ? <
|
|
136
|
-
</
|
|
134
|
+
{footer ? <View pt="xs">{footer}</View> : null}
|
|
135
|
+
</View>
|
|
137
136
|
</Card>);
|
|
138
137
|
}
|
|
139
138
|
//# sourceMappingURL=PostCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/PostCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAQ1E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAA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esContent":["import React from 'react';\nimport { Image as ReactNativeImage } from 'react-native';\n\nimport { Inline } from '../../../../foundation';\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n PostAction,\n PostAuthor,\n PostCardMedia,\n PostCardProps,\n PostCommentPreview,\n} from '../../../../types/post-card';\nimport { Avatar } from '../../../avatar/public';\nimport { Button } from '../../../button/public';\nimport { Box, Divider, Stack } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\nimport { Card } from '../../public';\n/***\n * Social-style post card pattern with author, content, media, and actions.\n *\n\n */\nexport const PostCard = withZoraThemeScope(PostCardInner);\n\nfunction resolveAuthorName(author: PostAuthor): string | undefined {\n return typeof author.name === 'string' ? author.name : author.avatar?.name;\n}\n\nfunction resolveMediaAspectRatio(aspectRatio: number | undefined): number {\n if (aspectRatio === undefined || !Number.isFinite(aspectRatio) || aspectRatio <= 0) {\n return 16 / 9;\n }\n\n return aspectRatio;\n}\n\nfunction isPostCardMediaList(\n media: NonNullable<PostCardProps['media']>,\n): media is readonly PostCardMedia[] {\n return Array.isArray(media);\n}\n\nfunction normalizeMedia(media: PostCardProps['media']): readonly PostCardMedia[] {\n if (!media) {\n return [];\n }\n\n if (isPostCardMediaList(media)) {\n return media;\n }\n\n return [media];\n}\n\nfunction PostCardAuthor({ author, compact = false }: { author: PostAuthor; compact?: boolean }) {\n const avatarName = resolveAuthorName(author);\n const { avatar } = author;\n\n return (\n <Inline align=\"center\" gap=\"s\" wrap=\"nowrap\">\n <Avatar\n initials={avatar?.initials}\n label={avatar?.label ?? avatarName}\n name={avatarName}\n shape={avatar?.shape}\n size={avatar?.size ?? (compact ? 's' : 'm')}\n source={avatar?.source}\n color={avatar?.color}\n />\n <Box flex={1}>\n <Stack gap=\"xxs\">\n <Text variant=\"bodySmall\" weight=\"semiBold\">\n {author.name}\n </Text>\n {author.subtitle ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {author.subtitle}\n </Text>\n ) : null}\n </Stack>\n </Box>\n </Inline>\n );\n}\n\nfunction PostCardMediaItem({ media }: { media: PostCardMedia }) {\n const { theme } = useZoraTheme();\n const aspectRatio = resolveMediaAspectRatio(media.aspectRatio);\n\n if (!('source' in media)) {\n return (\n <Box radius=\"m\" style={{ overflow: 'hidden' }}>\n {media.children}\n </Box>\n );\n }\n\n return (\n <Box bg={theme.semantics.neutral.surface} radius=\"m\" style={{ overflow: 'hidden' }}>\n <Box style={{ aspectRatio, width: '100%' }}>\n <ReactNativeImage\n accessibilityLabel={media.label}\n source={media.source}\n style={{ height: '100%', width: '100%' }}\n />\n </Box>\n </Box>\n );\n}\n\nfunction PostActionLabel({ action }: { action: PostAction }) {\n if (!action.count) {\n return <>{action.label}</>;\n }\n\n return (\n <>\n {action.label} {action.count}\n </>\n );\n}\n\nfunction PostCardActions({ actions }: { actions: readonly PostAction[] }) {\n if (actions.length === 0) {\n return null;\n }\n\n return (\n <Inline align=\"center\" gap=\"s\" wrap=\"wrap\">\n {actions.map((action) => (\n <Button\n key={action.id}\n disabled={action.disabled}\n variant={action.selected ? 'soft' : 'ghost'}\n leadingIcon={action.icon}\n onPress={action.onPress}\n size=\"s\"\n color={action.selected ? 'primary' : 'neutral'}\n >\n <PostActionLabel action={action} />\n </Button>\n ))}\n </Inline>\n );\n}\n\nfunction PostCommentPreviewItem({ comment }: { comment: PostCommentPreview }) {\n return (\n <Inline align=\"flex-start\" gap=\"s\" wrap=\"nowrap\">\n {comment.author ? <PostCardAuthor author={comment.author} compact /> : null}\n <Box flex={1}>\n <Stack gap=\"xxs\">\n <Text variant=\"bodySmall\">{comment.text}</Text>\n {comment.meta ? (\n <Text emphasis=\"subtle\" variant=\"caption\">\n {comment.meta}\n </Text>\n ) : null}\n {comment.action ? <Box>{comment.action}</Box> : null}\n </Stack>\n </Box>\n </Inline>\n );\n}\n\nfunction PostCardComments({ comments }: { comments: readonly PostCommentPreview[] }) {\n if (comments.length === 0) {\n return null;\n }\n\n return (\n <Stack gap=\"s\">\n {comments.map((comment) => (\n <PostCommentPreviewItem key={comment.id} comment={comment} />\n ))}\n </Stack>\n );\n}\n\nfunction PostCardInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n testID,\n author,\n text,\n children,\n media,\n actions = [],\n comments = [],\n headerAction,\n footer,\n tone = 'default',\n compact = false,\n onPress,\n}: PostCardProps) {\n const mediaItems = normalizeMedia(media);\n const gap = compact ? 's' : 'm';\n const isInteractive = Boolean(onPress) && !headerAction;\n const hasBody = text != null || children != null || mediaItems.length > 0;\n const hasEngagement = actions.length > 0 || comments.length > 0;\n\n return (\n <Card\n compact={compact}\n interactionPolicy={interactionPolicy}\n onPress={isInteractive ? onPress : undefined}\n testID={testID}\n tone={tone}\n >\n <Stack gap={gap}>\n <Inline align=\"center\" gap=\"m\" justify=\"space-between\" wrap=\"nowrap\">\n <Box flex={1}>\n <PostCardAuthor author={author} compact={compact} />\n </Box>\n {headerAction ? <Box>{headerAction}</Box> : null}\n </Inline>\n\n {hasBody ? (\n <Stack gap={gap}>\n {text ? <Text variant=\"body\">{text}</Text> : null}\n {children ? <Box>{children}</Box> : null}\n {mediaItems.length > 0 ? (\n <Stack gap=\"s\">\n {mediaItems.map((item, index) => (\n <PostCardMediaItem key={`${index}`} media={item} />\n ))}\n </Stack>\n ) : null}\n </Stack>\n ) : null}\n\n {hasEngagement ? <Divider /> : null}\n <PostCardActions actions={actions} />\n <PostCardComments comments={comments} />\n {footer ? <Box pt=\"xs\">{footer}</Box> : null}\n </Stack>\n </Card>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PostCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/PostCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,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,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAChD;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Image as ReactNativeImage } from 'react-native';\n\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n PostAction,\n PostAuthor,\n PostCardMedia,\n PostCardProps,\n PostCommentPreview,\n} from '../../../../types/post-card';\nimport { Avatar } from '../../../avatar/public';\nimport { Button } from '../../../button/public';\nimport { Divider, View } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\nimport { Card } from '../../public';\n/***\n * Social-style post card pattern with author, content, media, and actions.\n *\n\n */\nexport const PostCard = withZoraThemeScope(PostCardInner);\n\nfunction resolveAuthorName(author: PostAuthor): string | undefined {\n return typeof author.name === 'string' ? author.name : author.avatar?.name;\n}\n\nfunction resolveMediaAspectRatio(aspectRatio: number | undefined): number {\n if (aspectRatio === undefined || !Number.isFinite(aspectRatio) || aspectRatio <= 0) {\n return 16 / 9;\n }\n\n return aspectRatio;\n}\n\nfunction isPostCardMediaList(\n media: NonNullable<PostCardProps['media']>,\n): media is readonly PostCardMedia[] {\n return Array.isArray(media);\n}\n\nfunction normalizeMedia(media: PostCardProps['media']): readonly PostCardMedia[] {\n if (!media) {\n return [];\n }\n\n if (isPostCardMediaList(media)) {\n return media;\n }\n\n return [media];\n}\n\nfunction PostCardAuthor({ author, compact = false }: { author: PostAuthor; compact?: boolean }) {\n const avatarName = resolveAuthorName(author);\n const { avatar } = author;\n\n return (\n <View direction=\"row\" align=\"center\" gap=\"s\" wrap=\"nowrap\">\n <Avatar\n initials={avatar?.initials}\n label={avatar?.label ?? avatarName}\n name={avatarName}\n shape={avatar?.shape}\n size={avatar?.size ?? (compact ? 's' : 'm')}\n source={avatar?.source}\n color={avatar?.color}\n />\n <View flex={1}>\n <View gap=\"xxs\">\n <Text variant=\"bodySmall\" weight=\"semiBold\">\n {author.name}\n </Text>\n {author.subtitle ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {author.subtitle}\n </Text>\n ) : null}\n </View>\n </View>\n </View>\n );\n}\n\nfunction PostCardMediaItem({ media }: { media: PostCardMedia }) {\n const { theme } = useZoraTheme();\n const aspectRatio = resolveMediaAspectRatio(media.aspectRatio);\n\n if (!('source' in media)) {\n return (\n <View radius=\"m\" style={{ overflow: 'hidden' }}>\n {media.children}\n </View>\n );\n }\n\n return (\n <View bg={theme.semantics.neutral.surface} radius=\"m\" style={{ overflow: 'hidden' }}>\n <View style={{ aspectRatio, width: '100%' }}>\n <ReactNativeImage\n accessibilityLabel={media.label}\n source={media.source}\n style={{ height: '100%', width: '100%' }}\n />\n </View>\n </View>\n );\n}\n\nfunction PostActionLabel({ action }: { action: PostAction }) {\n if (!action.count) {\n return <>{action.label}</>;\n }\n\n return (\n <>\n {action.label} {action.count}\n </>\n );\n}\n\nfunction PostCardActions({ actions }: { actions: readonly PostAction[] }) {\n if (actions.length === 0) {\n return null;\n }\n\n return (\n <View direction=\"row\" align=\"center\" gap=\"s\" wrap=\"wrap\">\n {actions.map((action) => (\n <Button\n key={action.id}\n disabled={action.disabled}\n variant={action.selected ? 'soft' : 'ghost'}\n leadingIcon={action.icon}\n onPress={action.onPress}\n size=\"s\"\n color={action.selected ? 'primary' : 'neutral'}\n >\n <PostActionLabel action={action} />\n </Button>\n ))}\n </View>\n );\n}\n\nfunction PostCommentPreviewItem({ comment }: { comment: PostCommentPreview }) {\n return (\n <View direction=\"row\" align=\"flex-start\" gap=\"s\" wrap=\"nowrap\">\n {comment.author ? <PostCardAuthor author={comment.author} compact /> : null}\n <View flex={1}>\n <View gap=\"xxs\">\n <Text variant=\"bodySmall\">{comment.text}</Text>\n {comment.meta ? (\n <Text emphasis=\"subtle\" variant=\"caption\">\n {comment.meta}\n </Text>\n ) : null}\n {comment.action ? <View>{comment.action}</View> : null}\n </View>\n </View>\n </View>\n );\n}\n\nfunction PostCardComments({ comments }: { comments: readonly PostCommentPreview[] }) {\n if (comments.length === 0) {\n return null;\n }\n\n return (\n <View gap=\"s\">\n {comments.map((comment) => (\n <PostCommentPreviewItem key={comment.id} comment={comment} />\n ))}\n </View>\n );\n}\n\nfunction PostCardInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n testID,\n author,\n text,\n children,\n media,\n actions = [],\n comments = [],\n headerAction,\n footer,\n tone = 'default',\n compact = false,\n onPress,\n}: PostCardProps) {\n const mediaItems = normalizeMedia(media);\n const gap = compact ? 's' : 'm';\n const isInteractive = Boolean(onPress) && !headerAction;\n const hasBody = text != null || children != null || mediaItems.length > 0;\n const hasEngagement = actions.length > 0 || comments.length > 0;\n\n return (\n <Card\n compact={compact}\n interactionPolicy={interactionPolicy}\n onPress={isInteractive ? onPress : undefined}\n testID={testID}\n tone={tone}\n >\n <View gap={gap}>\n <View direction=\"row\" align=\"center\" gap=\"m\" justify=\"space-between\" wrap=\"nowrap\">\n <View flex={1}>\n <PostCardAuthor author={author} compact={compact} />\n </View>\n {headerAction ? <View>{headerAction}</View> : null}\n </View>\n\n {hasBody ? (\n <View gap={gap}>\n {text ? <Text variant=\"body\">{text}</Text> : null}\n {children ? <View>{children}</View> : null}\n {mediaItems.length > 0 ? (\n <View gap=\"s\">\n {mediaItems.map((item, index) => (\n <PostCardMediaItem key={`${index}`} media={item} />\n ))}\n </View>\n ) : null}\n </View>\n ) : null}\n\n {hasEngagement ? <Divider /> : null}\n <PostCardActions actions={actions} />\n <PostCardComments comments={comments} />\n {footer ? <View pt=\"xs\">{footer}</View> : null}\n </View>\n </Card>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/ProductCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/ProductCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAQvE,eAAO,MAAM,WAAW,wEAAuC,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Inline } from '../../../../foundation';
|
|
3
2
|
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
3
|
import { Badge } from '../../../badge/public';
|
|
5
4
|
import { Button } from '../../../button/public';
|
|
6
5
|
import { Image } from '../../../image/public';
|
|
7
|
-
import { Divider,
|
|
6
|
+
import { Divider, View } from '../../../layout/public';
|
|
8
7
|
import { Heading } from '../../../typography/public';
|
|
9
8
|
import { Text } from '../../../typography/public';
|
|
10
9
|
import { Card } from '../../public';
|
|
@@ -16,11 +15,11 @@ function ProductCardInner({ title, subtitle, description, brand, vendor: _vendor
|
|
|
16
15
|
const isInteractive = Boolean(onPress);
|
|
17
16
|
const eyebrow = brand ?? _vendor;
|
|
18
17
|
return (<Card onPress={isInteractive ? onPress : undefined} interactionPolicy={interactionPolicy} {...rest}>
|
|
19
|
-
<
|
|
18
|
+
<View gap="m">
|
|
20
19
|
{imageUrl ? (<Image accessibilityLabel={imageAlt ?? title} source={{ uri: imageUrl }} aspectRatio={1} radius="m"/>) : null}
|
|
21
20
|
|
|
22
|
-
<
|
|
23
|
-
{hasHeaderInfo ? (<
|
|
21
|
+
<View gap="s">
|
|
22
|
+
{hasHeaderInfo ? (<View gap="xxs">
|
|
24
23
|
{eyebrow ? (<Text variant="caption" weight="semiBold" emphasis="muted">
|
|
25
24
|
{eyebrow}
|
|
26
25
|
</Text>) : null}
|
|
@@ -28,44 +27,44 @@ function ProductCardInner({ title, subtitle, description, brand, vendor: _vendor
|
|
|
28
27
|
{subtitle ? (<Text variant="bodySmall" emphasis="muted">
|
|
29
28
|
{subtitle}
|
|
30
29
|
</Text>) : null}
|
|
31
|
-
</
|
|
30
|
+
</View>) : null}
|
|
32
31
|
|
|
33
32
|
{description ? <Text variant="bodySmall">{description}</Text> : null}
|
|
34
33
|
|
|
35
|
-
{badges && badges.length > 0 ? (<
|
|
34
|
+
{badges && badges.length > 0 ? (<View direction="row" gap="xs" wrap="wrap">
|
|
36
35
|
{badges.map((badge, index) => (<Badge key={`${badge}-${index}`}>{badge}</Badge>))}
|
|
37
|
-
</
|
|
38
|
-
</
|
|
36
|
+
</View>) : null}
|
|
37
|
+
</View>
|
|
39
38
|
|
|
40
39
|
{price ? (<Text variant="bodySmall" weight="bold">
|
|
41
40
|
{currency ? `${currency} ` : ''}
|
|
42
41
|
{price}
|
|
43
42
|
</Text>) : null}
|
|
44
43
|
|
|
45
|
-
{hasMeta ? (<
|
|
44
|
+
{hasMeta ? (<View gap="xs">
|
|
46
45
|
<Divider />
|
|
47
|
-
{meta.map((item, index) => (<
|
|
46
|
+
{meta.map((item, index) => (<View direction="row" key={`${item.label}-${index}`} justify="space-between">
|
|
48
47
|
<Text variant="bodySmall" emphasis="muted">
|
|
49
48
|
{item.label}
|
|
50
49
|
</Text>
|
|
51
50
|
<Text variant="bodySmall" weight="semiBold">
|
|
52
51
|
{item.value}
|
|
53
52
|
</Text>
|
|
54
|
-
</
|
|
55
|
-
</
|
|
53
|
+
</View>))}
|
|
54
|
+
</View>) : null}
|
|
56
55
|
|
|
57
|
-
{hasActions ? (<
|
|
56
|
+
{hasActions ? (<View gap="s">
|
|
58
57
|
<Divider />
|
|
59
|
-
<
|
|
58
|
+
<View direction="row" gap="s">
|
|
60
59
|
{secondaryActionLabel ? (<Button interactionPolicy={interactionPolicy} variant="ghost" onPress={onSecondaryAction} size="s">
|
|
61
60
|
{secondaryActionLabel}
|
|
62
61
|
</Button>) : null}
|
|
63
62
|
{primaryActionLabel ? (<Button interactionPolicy={interactionPolicy} variant="solid" onPress={onPrimaryAction} size="s" flex={1}>
|
|
64
63
|
{primaryActionLabel}
|
|
65
64
|
</Button>) : null}
|
|
66
|
-
</
|
|
67
|
-
</
|
|
68
|
-
</
|
|
65
|
+
</View>
|
|
66
|
+
</View>) : null}
|
|
67
|
+
</View>
|
|
69
68
|
</Card>);
|
|
70
69
|
}
|
|
71
70
|
//# sourceMappingURL=ProductCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/ProductCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ProductCard.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/ProductCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;AAEhE,SAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,KAAK,EACL,MAAM,EAAE,O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I,CAAC,GAAG,CAER;kBAAA,CAAC,oBAAoB,CACvB;gBAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACR;cAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACpB,CAAC,MAAM,CACL,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,OAAO,CACf,OAAO,CAAC,CAAC,eAAe,CAAC,CACzB,IAAI,CAAC,GAAG,CACR,IAAI,CAAC,CAAC,CAAC,CAAC,CAER;kBAAA,CAAC,kBAAkB,CACrB;gBAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { ZoraBaseProps } from '../../../../theme/ZoraBaseProps';\nimport type { ProductCardProps } from '../../../../types/product-card';\nimport { Badge } from '../../../badge/public';\nimport { Button } from '../../../button/public';\nimport { Image } from '../../../image/public';\nimport { Divider, View } from '../../../layout/public';\nimport { Heading } from '../../../typography/public';\nimport { Text } from '../../../typography/public';\nimport { Card } from '../../public';\nexport const ProductCard = withZoraThemeScope(ProductCardInner);\n\nfunction ProductCardInner({\n title,\n subtitle,\n description,\n brand,\n vendor: _vendor,\n imageUrl,\n imageAlt,\n price,\n currency,\n badges,\n meta,\n primaryActionLabel,\n secondaryActionLabel,\n onPress,\n onPrimaryAction,\n onSecondaryAction,\n interactionPolicy,\n ...rest\n}: ProductCardProps & ZoraBaseProps) {\n const hasHeaderInfo = !!title || !!brand || !!subtitle;\n const hasMeta = !!meta && meta.length > 0;\n const hasActions = !!primaryActionLabel || !!secondaryActionLabel;\n const isInteractive = Boolean(onPress);\n\n const eyebrow = brand ?? _vendor;\n\n return (\n <Card\n onPress={isInteractive ? onPress : undefined}\n interactionPolicy={interactionPolicy}\n {...rest}\n >\n <View gap=\"m\">\n {imageUrl ? (\n <Image\n accessibilityLabel={imageAlt ?? title}\n source={{ uri: imageUrl }}\n aspectRatio={1}\n radius=\"m\"\n />\n ) : null}\n\n <View gap=\"s\">\n {hasHeaderInfo ? (\n <View gap=\"xxs\">\n {eyebrow ? (\n <Text variant=\"caption\" weight=\"semiBold\" emphasis=\"muted\">\n {eyebrow}\n </Text>\n ) : null}\n <Heading level={4}>{title}</Heading>\n {subtitle ? (\n <Text variant=\"bodySmall\" emphasis=\"muted\">\n {subtitle}\n </Text>\n ) : null}\n </View>\n ) : null}\n\n {description ? <Text variant=\"bodySmall\">{description}</Text> : null}\n\n {badges && badges.length > 0 ? (\n <View direction=\"row\" gap=\"xs\" wrap=\"wrap\">\n {badges.map((badge, index) => (\n <Badge key={`${badge}-${index}`}>{badge}</Badge>\n ))}\n </View>\n ) : null}\n </View>\n\n {price ? (\n <Text variant=\"bodySmall\" weight=\"bold\">\n {currency ? `${currency} ` : ''}\n {price}\n </Text>\n ) : null}\n\n {hasMeta ? (\n <View gap=\"xs\">\n <Divider />\n {meta.map((item, index) => (\n <View direction=\"row\" key={`${item.label}-${index}`} justify=\"space-between\">\n <Text variant=\"bodySmall\" emphasis=\"muted\">\n {item.label}\n </Text>\n <Text variant=\"bodySmall\" weight=\"semiBold\">\n {item.value}\n </Text>\n </View>\n ))}\n </View>\n ) : null}\n\n {hasActions ? (\n <View gap=\"s\">\n <Divider />\n <View direction=\"row\" gap=\"s\">\n {secondaryActionLabel ? (\n <Button\n interactionPolicy={interactionPolicy}\n variant=\"ghost\"\n onPress={onSecondaryAction}\n size=\"s\"\n >\n {secondaryActionLabel}\n </Button>\n ) : null}\n {primaryActionLabel ? (\n <Button\n interactionPolicy={interactionPolicy}\n variant=\"solid\"\n onPress={onPrimaryAction}\n size=\"s\"\n flex={1}\n >\n {primaryActionLabel}\n </Button>\n ) : null}\n </View>\n </View>\n ) : null}\n </View>\n </Card>\n );\n}\n"]}
|
|
@@ -2,7 +2,7 @@ export declare const cardMeta: {
|
|
|
2
2
|
readonly name: "Card";
|
|
3
3
|
readonly category: "component";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["ActivityIndicator", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "
|
|
5
|
+
readonly allowedChildren: readonly ["ActivityIndicator", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "TimePicker", "Form", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Card";
|
|
8
8
|
readonly defaultProps: {
|