@multiplatform.one/components 7.66.0 → 7.68.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/dist/cjs/Alert/index.cjs +5 -0
- package/dist/cjs/Alert/index.native.js +5 -0
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.cjs +6 -34
- package/dist/cjs/Avatar/getInitials.native.js +8 -34
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.cjs +28 -23
- package/dist/cjs/Avatar/index.native.js +30 -25
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Card.cjs +67 -11
- package/dist/cjs/Card.native.js +71 -11
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/Chip/index.cjs +54 -8
- package/dist/cjs/Chip/index.native.js +57 -10
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.cjs +5 -2
- package/dist/cjs/DropdownMenu/index.native.js +5 -2
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.cjs +3 -1
- package/dist/cjs/OverflowRow/index.native.js +3 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +4 -6
- package/dist/cjs/Pagination.native.js +4 -6
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.cjs +5 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js +5 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.cjs +104 -0
- package/dist/cjs/SheetModal/SheetNavigation.native.js +132 -0
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/cjs/SheetModal/index.cjs +30 -17
- package/dist/cjs/SheetModal/index.native.js +86 -58
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/ThemePlayground/index.cjs +1 -2
- package/dist/cjs/actions/StandardAction.cjs +131 -0
- package/dist/cjs/actions/StandardAction.native.js +136 -0
- package/dist/cjs/actions/StandardAction.native.js.map +1 -0
- package/dist/cjs/actions/index.cjs +9 -2
- package/dist/cjs/actions/index.native.js +8 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.cjs +51 -0
- package/dist/cjs/appShell/TabHost.native.js +151 -0
- package/dist/cjs/appShell/TabHost.native.js.map +1 -0
- package/dist/cjs/appShell/index.cjs +2 -0
- package/dist/cjs/appShell/index.native.js +2 -0
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +8 -20
- package/dist/cjs/charts/ChartDataView.native.js +10 -20
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +87 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js +91 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.cjs +0 -1
- package/dist/cjs/layouts/EmptyState.native.js +0 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.cjs +1 -0
- package/dist/cjs/layouts/PageTemplates.native.js +2 -0
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +22 -12
- package/dist/cjs/layouts/page.native.js +27 -16
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.cjs +51 -21
- package/dist/cjs/layouts/sidebar.native.js +53 -23
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.cjs +9 -6
- package/dist/cjs/layouts/toolbar.native.js +9 -6
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.cjs +55 -14
- package/dist/cjs/views/ImageGrid.native.js +58 -15
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +19 -25
- package/dist/cjs/views/ListGroup.native.js +19 -25
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.cjs +3 -6
- package/dist/cjs/views/ReportBuilder.native.js +3 -6
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +2 -0
- package/dist/cjs/views/index.native.js +2 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/esm/Alert/index.mjs +5 -0
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/Alert/index.native.js +5 -0
- package/dist/esm/Alert/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.mjs +7 -32
- package/dist/esm/Avatar/getInitials.mjs.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js +9 -32
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.mjs +30 -24
- package/dist/esm/Avatar/index.mjs.map +1 -1
- package/dist/esm/Avatar/index.native.js +32 -26
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Card.mjs +69 -13
- package/dist/esm/Card.mjs.map +1 -1
- package/dist/esm/Card.native.js +73 -13
- package/dist/esm/Card.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +54 -9
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +57 -11
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +5 -2
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +5 -2
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.mjs +4 -2
- package/dist/esm/OverflowRow/index.mjs.map +1 -1
- package/dist/esm/OverflowRow/index.native.js +4 -2
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.mjs +4 -6
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +4 -6
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.mjs +5 -1
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +5 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.mjs +79 -0
- package/dist/esm/SheetModal/SheetNavigation.mjs.map +1 -0
- package/dist/esm/SheetModal/SheetNavigation.native.js +104 -0
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/esm/SheetModal/index.mjs +32 -19
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +88 -60
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/ThemePlayground/index.mjs +1 -2
- package/dist/esm/ThemePlayground/index.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.mjs +104 -0
- package/dist/esm/actions/StandardAction.mjs.map +1 -0
- package/dist/esm/actions/StandardAction.native.js +106 -0
- package/dist/esm/actions/StandardAction.native.js.map +1 -0
- package/dist/esm/actions/index.mjs +3 -1
- package/dist/esm/actions/index.mjs.map +1 -1
- package/dist/esm/actions/index.native.js +3 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.mjs.map +1 -1
- package/dist/esm/appShell/TabHost.mjs +25 -0
- package/dist/esm/appShell/TabHost.mjs.map +1 -0
- package/dist/esm/appShell/TabHost.native.js +118 -0
- package/dist/esm/appShell/TabHost.native.js.map +1 -0
- package/dist/esm/appShell/index.mjs +2 -1
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +2 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +8 -20
- package/dist/esm/charts/ChartDataView.mjs.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js +10 -20
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +87 -0
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +91 -0
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.mjs +0 -1
- package/dist/esm/layouts/EmptyState.mjs.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js +0 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.mjs +2 -1
- package/dist/esm/layouts/PageTemplates.mjs.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js +3 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +22 -12
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +27 -16
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.mjs +51 -21
- package/dist/esm/layouts/sidebar.mjs.map +1 -1
- package/dist/esm/layouts/sidebar.native.js +53 -23
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.mjs +9 -6
- package/dist/esm/layouts/toolbar.mjs.map +1 -1
- package/dist/esm/layouts/toolbar.native.js +9 -6
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.mjs +53 -14
- package/dist/esm/views/ImageGrid.mjs.map +1 -1
- package/dist/esm/views/ImageGrid.native.js +56 -15
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +20 -26
- package/dist/esm/views/ListGroup.mjs.map +1 -1
- package/dist/esm/views/ListGroup.native.js +20 -26
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.mjs +4 -7
- package/dist/esm/views/ReportBuilder.mjs.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js +4 -7
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -2
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -2
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/jsx/Accordion/index.native.js +1 -1
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/Alert/index.mjs +5 -0
- package/dist/jsx/Alert/index.mjs.map +1 -1
- package/dist/jsx/Alert/index.native.js +5 -0
- package/dist/jsx/Alert/index.native.js.map +1 -1
- package/dist/jsx/AnimateHeight/index.native.js.map +1 -1
- package/dist/jsx/Avatar/getInitials.mjs +7 -32
- package/dist/jsx/Avatar/getInitials.mjs.map +1 -1
- package/dist/jsx/Avatar/getInitials.native.js +8 -34
- package/dist/jsx/Avatar/getInitials.native.js.map +1 -1
- package/dist/jsx/Avatar/index.mjs +30 -24
- package/dist/jsx/Avatar/index.mjs.map +1 -1
- package/dist/jsx/Avatar/index.native.js +30 -25
- package/dist/jsx/Avatar/index.native.js.map +1 -1
- package/dist/jsx/Badge/index.native.js.map +1 -1
- package/dist/jsx/Button.native.js.map +1 -1
- package/dist/jsx/Card.mjs +69 -13
- package/dist/jsx/Card.mjs.map +1 -1
- package/dist/jsx/Card.native.js +71 -11
- package/dist/jsx/Card.native.js.map +1 -1
- package/dist/jsx/CardFooter.native.js.map +1 -1
- package/dist/jsx/CardHeader.native.js.map +1 -1
- package/dist/jsx/Carousel/index.native.js +3 -3
- package/dist/jsx/Carousel/index.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +54 -9
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +57 -10
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/Collapsible.native.js.map +1 -1
- package/dist/jsx/ContextMenu/index.native.js.map +1 -1
- package/dist/jsx/CopyField/index.native.js.map +1 -1
- package/dist/jsx/Dialog.native.js.map +1 -1
- package/dist/jsx/DotIndicator/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +5 -2
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +5 -2
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/jsx/ErrorBoundary/index.native.js.map +1 -1
- package/dist/jsx/Heading.native.js.map +1 -1
- package/dist/jsx/Kbd/index.native.js.map +1 -1
- package/dist/jsx/Kbd/keys.native.js.map +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.native.js +1 -1
- package/dist/jsx/Lightbox/shared.native.js.map +1 -1
- package/dist/jsx/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/jsx/Material/index.native.js.map +1 -1
- package/dist/jsx/Meter/index.native.js +1 -1
- package/dist/jsx/Meter/index.native.js.map +1 -1
- package/dist/jsx/Meter/meter.native.js.map +1 -1
- package/dist/jsx/OverflowRow/index.mjs +4 -2
- package/dist/jsx/OverflowRow/index.mjs.map +1 -1
- package/dist/jsx/OverflowRow/index.native.js +4 -2
- package/dist/jsx/OverflowRow/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +4 -6
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +5 -7
- package/dist/jsx/Pagination.native.js.map +1 -1
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/ProgressSteps/index.native.js.map +1 -1
- package/dist/jsx/Quote/index.native.js.map +1 -1
- package/dist/jsx/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/jsx/Separator/index.native.js.map +1 -1
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs +5 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +5 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetNavigation.mjs +79 -0
- package/dist/jsx/SheetModal/SheetNavigation.mjs.map +1 -0
- package/dist/jsx/SheetModal/SheetNavigation.native.js +132 -0
- package/dist/jsx/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/jsx/SheetModal/detents.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +32 -19
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +86 -58
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/jsx/Skeleton/index.native.js.map +1 -1
- package/dist/jsx/SkipLink/index.native.js.map +1 -1
- package/dist/jsx/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/jsx/SortableList/index.native.js.map +1 -1
- package/dist/jsx/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/jsx/Tabs/index.native.js +1 -1
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Text.native.js.map +1 -1
- package/dist/jsx/ThemePlayground/index.mjs +1 -2
- package/dist/jsx/ThemePlayground/index.mjs.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.native.js +2 -2
- package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/jsx/Toast/index.native.js.map +1 -1
- package/dist/jsx/Toast/store.native.js.map +1 -1
- package/dist/jsx/Tooltip/nativePress.native.js.map +1 -1
- package/dist/jsx/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/jsx/TreeSelect/index.native.js +1 -1
- package/dist/jsx/TreeSelect/index.native.js.map +1 -1
- package/dist/jsx/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/jsx/Video/PlayerChrome.native.js.map +1 -1
- package/dist/jsx/Video/VideoFrame.native.js.map +1 -1
- package/dist/jsx/Video/types.native.js.map +1 -1
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/Wizard/index.native.js +2 -2
- package/dist/jsx/Wizard/index.native.js.map +1 -1
- package/dist/jsx/actions/ActionBar.native.js.map +1 -1
- package/dist/jsx/actions/DangerSection.native.js.map +1 -1
- package/dist/jsx/actions/DestructiveAction.native.js.map +1 -1
- package/dist/jsx/actions/HeaderActions.native.js +2 -2
- package/dist/jsx/actions/HeaderActions.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.mjs +104 -0
- package/dist/jsx/actions/StandardAction.mjs.map +1 -0
- package/dist/jsx/actions/StandardAction.native.js +136 -0
- package/dist/jsx/actions/StandardAction.native.js.map +1 -0
- package/dist/jsx/actions/devWarn.native.js.map +1 -1
- package/dist/jsx/actions/index.mjs +3 -1
- package/dist/jsx/actions/index.mjs.map +1 -1
- package/dist/jsx/actions/index.native.js +8 -1
- package/dist/jsx/actions/index.native.js.map +1 -1
- package/dist/jsx/actions/severity.native.js.map +1 -1
- package/dist/jsx/appShell/BottomAccessory.native.js.map +1 -1
- package/dist/jsx/appShell/Dock.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js +1 -1
- package/dist/jsx/appShell/Springboard.native.js.map +1 -1
- package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabBar.mjs.map +1 -1
- package/dist/jsx/appShell/TabBar.native.js +1 -1
- package/dist/jsx/appShell/TabBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.mjs +25 -0
- package/dist/jsx/appShell/TabHost.mjs.map +1 -0
- package/dist/jsx/appShell/TabHost.native.js +151 -0
- package/dist/jsx/appShell/TabHost.native.js.map +1 -0
- package/dist/jsx/appShell/appTile.native.js +1 -1
- package/dist/jsx/appShell/appTile.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +2 -1
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +2 -0
- package/dist/jsx/appShell/index.native.js.map +1 -1
- package/dist/jsx/charts/Axis.native.js.map +1 -1
- package/dist/jsx/charts/BarChart.native.js.map +1 -1
- package/dist/jsx/charts/ChartDataView.mjs +8 -20
- package/dist/jsx/charts/ChartDataView.mjs.map +1 -1
- package/dist/jsx/charts/ChartDataView.native.js +11 -21
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
- package/dist/jsx/charts/ChartSurface.native.js.map +1 -1
- package/dist/jsx/charts/LineChart.native.js.map +1 -1
- package/dist/jsx/charts/PieChart.native.js.map +1 -1
- package/dist/jsx/charts/Sparkline.native.js.map +1 -1
- package/dist/jsx/charts/accessibility.native.js.map +1 -1
- package/dist/jsx/charts/chartHeight.native.js.map +1 -1
- package/dist/jsx/charts/composeChart.native.js.map +1 -1
- package/dist/jsx/charts/index.native.js.map +1 -1
- package/dist/jsx/charts/math.native.js.map +1 -1
- package/dist/jsx/charts/series.native.js.map +1 -1
- package/dist/jsx/charts/svg.native.js.map +1 -1
- package/dist/jsx/charts/types.native.js.map +1 -1
- package/dist/jsx/charts/useChartTheme.native.js.map +1 -1
- package/dist/jsx/code/Code/index.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +7 -7
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/jsx/code/Pre/index.native.js.map +1 -1
- package/dist/jsx/code/index.native.js +5 -5
- package/dist/jsx/code/index.native.js.map +1 -1
- package/dist/jsx/componentColors.native.js.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +2 -2
- package/dist/jsx/feedback/NotifyHost.native.js.map +1 -1
- package/dist/jsx/feedback/copy.native.js.map +1 -1
- package/dist/jsx/feedback/index.native.js.map +1 -1
- package/dist/jsx/feedback/notify.native.js.map +1 -1
- package/dist/jsx/feedback/route.native.js.map +1 -1
- package/dist/jsx/feedback/store.native.js.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/jsx/formLayouts/index.native.js.map +1 -1
- package/dist/jsx/hooks/index.native.js +1 -1
- package/dist/jsx/hooks/index.native.js.map +1 -1
- package/dist/jsx/hooks/useClipboard.native.js.map +1 -1
- package/dist/jsx/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/jsx/hooks/useHoldCue.native.js.map +1 -1
- package/dist/jsx/icons/CheckRegular.native.js.map +1 -1
- package/dist/jsx/icons/MinusRegular.native.js.map +1 -1
- package/dist/jsx/icons/index.native.js.map +1 -1
- package/dist/jsx/icons/lucide.native.js.map +1 -1
- package/dist/jsx/icons/themed.native.js.map +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/jsx/images/Image/framing.native.js.map +1 -1
- package/dist/jsx/images/Image/index.native.js +1 -1
- package/dist/jsx/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/jsx/images/Image/shared.native.js +1 -1
- package/dist/jsx/images/Image/shared.native.js.map +1 -1
- package/dist/jsx/images/Image/types.native.js.map +1 -1
- package/dist/jsx/images/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +37 -35
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +87 -0
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +93 -2
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/Debug/index.native.js.map +1 -1
- package/dist/jsx/layouts/EmptyState.mjs +0 -1
- package/dist/jsx/layouts/EmptyState.mjs.map +1 -1
- package/dist/jsx/layouts/EmptyState.native.js +0 -1
- package/dist/jsx/layouts/EmptyState.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/jsx/layouts/PageTemplates.mjs +2 -1
- package/dist/jsx/layouts/PageTemplates.mjs.map +1 -1
- package/dist/jsx/layouts/PageTemplates.native.js +2 -0
- package/dist/jsx/layouts/PageTemplates.native.js.map +1 -1
- package/dist/jsx/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/jsx/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/jsx/layouts/StatusDot.native.js.map +1 -1
- package/dist/jsx/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +1 -1
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/layouts/index.native.js +3 -3
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +22 -12
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +29 -18
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/jsx/layouts/sidebar.mjs +51 -21
- package/dist/jsx/layouts/sidebar.mjs.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js +54 -24
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/layouts/tags.native.js +2 -2
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.native.js +2 -2
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/layouts/toolbar.mjs +9 -6
- package/dist/jsx/layouts/toolbar.mjs.map +1 -1
- package/dist/jsx/layouts/toolbar.native.js +10 -7
- package/dist/jsx/layouts/toolbar.native.js.map +1 -1
- package/dist/jsx/shared/actionScan.native.js.map +1 -1
- package/dist/jsx/shared/i18n.native.js.map +1 -1
- package/dist/jsx/shared/restoreRetries.native.js.map +1 -1
- package/dist/jsx/shared/t.native.js.map +1 -1
- package/dist/jsx/shared/textRidesText.native.js.map +1 -1
- package/dist/jsx/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/jsx/surfaces.native.js +1 -1
- package/dist/jsx/surfaces.native.js.map +1 -1
- package/dist/jsx/tamagui.native.js +1 -1
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/dist/jsx/testSetup.native.js.map +1 -1
- package/dist/jsx/utils/setTinted.native.js.map +1 -1
- package/dist/jsx/utils/unwrapText.native.js.map +1 -1
- package/dist/jsx/views/Calendar.native.js +1 -1
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +2 -2
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/Gantt.native.js +2 -2
- package/dist/jsx/views/Gantt.native.js.map +1 -1
- package/dist/jsx/views/GanttDateGrip.native.js.map +1 -1
- package/dist/jsx/views/ImageGrid.mjs +53 -14
- package/dist/jsx/views/ImageGrid.mjs.map +1 -1
- package/dist/jsx/views/ImageGrid.native.js +60 -17
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/Kanban.native.js +1 -1
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.mjs +20 -26
- package/dist/jsx/views/ListGroup.mjs.map +1 -1
- package/dist/jsx/views/ListGroup.native.js +19 -25
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/ListRow.native.js.map +1 -1
- package/dist/jsx/views/Matrix.native.js +2 -2
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.mjs +4 -7
- package/dist/jsx/views/ReportBuilder.mjs.map +1 -1
- package/dist/jsx/views/ReportBuilder.native.js +5 -8
- package/dist/jsx/views/ReportBuilder.native.js.map +1 -1
- package/dist/jsx/views/ShortcutCard.native.js.map +1 -1
- package/dist/jsx/views/TreeView.native.js.map +1 -1
- package/dist/jsx/views/calendarMath.native.js.map +1 -1
- package/dist/jsx/views/ganttIntervals.native.js.map +1 -1
- package/dist/jsx/views/ganttMath.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -2
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +3 -1
- package/dist/jsx/views/index.native.js.map +1 -1
- package/dist/jsx/views/kanbanDnd.native.js.map +1 -1
- package/dist/jsx/views/matrixMath.native.js.map +1 -1
- package/dist/jsx/views/treeViewDnd.native.js.map +1 -1
- package/dist/jsx/views/treeViewLayout.native.js.map +1 -1
- package/dist/jsx/views/treeViewMotion.native.js.map +1 -1
- package/dist/jsx/views/treeViewReveal.native.js.map +1 -1
- package/dist/jsx/views/widgetChrome.native.js.map +1 -1
- package/package.json +13 -9
- package/src/Alert/Alert.spec.tsx +22 -0
- package/src/Alert/index.tsx +5 -0
- package/src/AlertDialogContent.stories.tsx +4 -3
- package/src/Avatar/Avatar.ink.spec.tsx +74 -0
- package/src/Avatar/Avatar.spec.tsx +35 -8
- package/src/Avatar/getInitials.ts +12 -30
- package/src/Avatar/index.tsx +37 -22
- package/src/Button.stories.tsx +1 -1
- package/src/Card.spec.tsx +45 -0
- package/src/Card.stories.tsx +7 -6
- package/src/Card.tsx +57 -18
- package/src/CardFooter.stories.tsx +3 -2
- package/src/CardHeader.stories.tsx +2 -1
- package/src/Chip/Chip.spec.tsx +72 -1
- package/src/Chip/index.tsx +86 -7
- package/src/DialogContent.stories.tsx +9 -11
- package/src/DropdownMenu/DropdownMenu.avatarTrigger.spec.tsx +62 -0
- package/src/DropdownMenu/DropdownMenu.stories.tsx +47 -1
- package/src/DropdownMenu/index.tsx +7 -3
- package/src/OverflowRow/OverflowRow.native.spec.tsx +17 -2
- package/src/OverflowRow/index.tsx +6 -2
- package/src/Pagination.spec.tsx +43 -15
- package/src/Pagination.tsx +11 -9
- package/src/Panel.stories.tsx +5 -6
- package/src/SheetModal/SheetHeader.tsx +3 -2
- package/src/SheetModal/SheetModal.fill.spec.tsx +1 -1
- package/src/SheetModal/SheetModal.menus.spec.tsx +125 -26
- package/src/SheetModal/SheetModal.native.spec.tsx +35 -0
- package/src/SheetModal/SheetModal.regularWidth.native.spec.tsx +117 -0
- package/src/SheetModal/SheetModal.stories.spec.tsx +7 -3
- package/src/SheetModal/SheetModal.stories.tsx +30 -20
- package/src/SheetModal/SheetNavigation.tsx +93 -0
- package/src/SheetModal/index.native.tsx +108 -69
- package/src/SheetModal/index.tsx +39 -22
- package/src/SkipLink/SkipLink.stories.tsx +2 -2
- package/src/Tabs/Tabs.stories.tsx +2 -2
- package/src/ThemePlayground/index.tsx +1 -2
- package/src/Tooltip/Tooltip.spec.tsx +2 -2
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/actions/ActionBar.stories.spec.tsx +5 -5
- package/src/actions/ActionBar.stories.tsx +8 -25
- package/src/actions/ActionButton.spec.tsx +125 -0
- package/src/actions/ActionButton.stories.tsx +113 -0
- package/src/actions/DestructiveAction.stories.tsx +4 -3
- package/src/actions/StandardAction.tsx +185 -0
- package/src/actions/index.ts +14 -0
- package/src/appShell/TabBar.tsx +5 -0
- package/src/appShell/TabHost.native.spec.tsx +188 -0
- package/src/appShell/TabHost.native.tsx +154 -0
- package/src/appShell/TabHost.tsx +36 -0
- package/src/appShell/index.ts +1 -0
- package/src/charts/ChartDataView.tsx +9 -14
- package/src/icons/nativeIconInk.dark.spec.tsx +159 -0
- package/src/index.ts +2 -0
- package/src/layouts/AsyncBoundary.spec.tsx +24 -1
- package/src/layouts/AsyncBoundary.stories.tsx +8 -1
- package/src/layouts/AsyncBoundary.tsx +71 -2
- package/src/layouts/AsyncSkeleton.stories.tsx +9 -1
- package/src/layouts/EmptyState.stories.tsx +3 -2
- package/src/layouts/EmptyState.tsx +0 -1
- package/src/layouts/PageHeader.stories.tsx +88 -4
- package/src/layouts/PageTemplates.spec.tsx +28 -1
- package/src/layouts/PageTemplates.stories.tsx +6 -7
- package/src/layouts/PageTemplates.tsx +8 -1
- package/src/layouts/ScreenToolbar.stories.tsx +3 -2
- package/src/layouts/Sidebar.spec.tsx +48 -0
- package/src/layouts/layouts.spec.tsx +33 -0
- package/src/layouts/navBar.spec.tsx +22 -0
- package/src/layouts/page.tsx +31 -13
- package/src/layouts/pageChrome.phone.spec.tsx +11 -5
- package/src/layouts/sidebar.tsx +84 -31
- package/src/layouts/toolbar.tsx +16 -2
- package/src/overlayElevation.spec.tsx +3 -4
- package/src/surfaces.spec.tsx +60 -0
- package/src/views/ImageGrid.photos.spec.tsx +46 -0
- package/src/views/ImageGrid.tsx +52 -27
- package/src/views/ListGroup.native-press.spec.tsx +66 -0
- package/src/views/ListGroup.spec.tsx +25 -6
- package/src/views/ListGroup.tsx +20 -30
- package/src/views/ReportBuilder.tsx +2 -10
- package/src/views/index.ts +8 -1
- package/types/Alert/index.d.ts.map +1 -1
- package/types/Avatar/getInitials.d.ts +3 -27
- package/types/Avatar/getInitials.d.ts.map +1 -1
- package/types/Avatar/index.d.ts +15 -2
- package/types/Avatar/index.d.ts.map +1 -1
- package/types/Card.d.ts +15 -1
- package/types/Card.d.ts.map +1 -1
- package/types/Chip/index.d.ts +38 -3
- package/types/Chip/index.d.ts.map +1 -1
- package/types/DropdownMenu/index.d.ts +2 -1
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/OverflowRow/index.d.ts.map +1 -1
- package/types/Pagination.d.ts +4 -1
- package/types/Pagination.d.ts.map +1 -1
- package/types/SheetModal/SheetHeader.d.ts +1 -1
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/SheetModal/SheetNavigation.d.ts +14 -0
- package/types/SheetModal/SheetNavigation.d.ts.map +1 -0
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +6 -0
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/ThemePlayground/index.d.ts.map +1 -1
- package/types/actions/StandardAction.d.ts +64 -0
- package/types/actions/StandardAction.d.ts.map +1 -0
- package/types/actions/index.d.ts +2 -0
- package/types/actions/index.d.ts.map +1 -1
- package/types/appShell/TabBar.d.ts +8 -0
- package/types/appShell/TabBar.d.ts.map +1 -1
- package/types/appShell/TabHost.d.ts +23 -0
- package/types/appShell/TabHost.d.ts.map +1 -0
- package/types/appShell/TabHost.native.d.ts +56 -0
- package/types/appShell/TabHost.native.d.ts.map +1 -0
- package/types/appShell/index.d.ts +1 -0
- package/types/appShell/index.d.ts.map +1 -1
- package/types/charts/ChartDataView.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts +13 -2
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/layouts/EmptyState.d.ts.map +1 -1
- package/types/layouts/PageTemplates.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/sidebar.d.ts +25 -3
- package/types/layouts/sidebar.d.ts.map +1 -1
- package/types/layouts/toolbar.d.ts +9 -0
- package/types/layouts/toolbar.d.ts.map +1 -1
- package/types/views/ImageGrid.d.ts +19 -1
- package/types/views/ImageGrid.d.ts.map +1 -1
- package/types/views/ListGroup.d.ts +4 -1
- package/types/views/ListGroup.d.ts.map +1 -1
- package/types/views/ReportBuilder.d.ts.map +1 -1
- package/types/views/index.d.ts +1 -1
- package/types/views/index.d.ts.map +1 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabHost (FZ-8105): one tab config, the system tab bar where the binary has
|
|
3
|
+
* react-native-screens' Tabs, the MPO TabBar everywhere else.
|
|
4
|
+
*/
|
|
5
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
6
|
+
import { cleanup, fireEvent, screen } from "@testing-library/react";
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
9
|
+
import { useBottomChromeInset } from "./bottomChrome";
|
|
10
|
+
import type { TabBarItem } from "./TabBar";
|
|
11
|
+
import {
|
|
12
|
+
type NativeTabs,
|
|
13
|
+
type NativeTabsSources,
|
|
14
|
+
NativeTabHost,
|
|
15
|
+
TabHost,
|
|
16
|
+
itemsHaveNativeIcons,
|
|
17
|
+
nativeTabBarHeight,
|
|
18
|
+
resolveNativeTabs,
|
|
19
|
+
} from "./TabHost.native";
|
|
20
|
+
|
|
21
|
+
afterEach(cleanup);
|
|
22
|
+
|
|
23
|
+
const Glyph = () => null;
|
|
24
|
+
|
|
25
|
+
const items: TabBarItem[] = [
|
|
26
|
+
{
|
|
27
|
+
key: "/",
|
|
28
|
+
label: "Home",
|
|
29
|
+
icon: Glyph,
|
|
30
|
+
nativeIcon: { sfSymbol: "house", sfSymbolSelected: "house.fill" },
|
|
31
|
+
},
|
|
32
|
+
{ key: "/pokemon", label: "Pokemon", icon: Glyph, nativeIcon: { sfSymbol: "sparkles" } },
|
|
33
|
+
{ key: "/moves", label: "Moves", icon: Glyph, nativeIcon: { sfSymbol: "bolt" } },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const fakeTabs: NativeTabs = {
|
|
37
|
+
Host: ({ children, onNativeFocusChange, tabBarHidden }) => (
|
|
38
|
+
<div data-testid="native-host" data-hidden={String(Boolean(tabBarHidden))}>
|
|
39
|
+
{children}
|
|
40
|
+
<button
|
|
41
|
+
type="button"
|
|
42
|
+
data-testid="native-press-moves"
|
|
43
|
+
onClick={() => onNativeFocusChange?.({ nativeEvent: { tabKey: "/moves" } })}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
Screen: ({ children, tabKey, isFocused, icon, title }) => (
|
|
48
|
+
<section
|
|
49
|
+
data-testid={`native-screen-${tabKey}`}
|
|
50
|
+
data-focused={String(Boolean(isFocused))}
|
|
51
|
+
data-symbol={icon?.ios.name}
|
|
52
|
+
aria-label={title}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</section>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function sources(registered: string[], tabs: () => { Tabs?: NativeTabs }): NativeTabsSources {
|
|
60
|
+
return { hasComponent: (name) => registered.includes(name), screens: tabs };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function Inset() {
|
|
64
|
+
return <span data-testid="inset">{useBottomChromeInset()}</span>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function renderNative(
|
|
68
|
+
activeKey: string | undefined,
|
|
69
|
+
onTabPress = vi.fn(),
|
|
70
|
+
page: ReactNode = "page",
|
|
71
|
+
) {
|
|
72
|
+
return renderWithProviders(
|
|
73
|
+
<NativeTabHost tabs={fakeTabs} items={items} activeKey={activeKey} onTabPress={onTabPress}>
|
|
74
|
+
<div data-testid="page">{page}</div>
|
|
75
|
+
<Inset />
|
|
76
|
+
</NativeTabHost>,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
describe("native tabs detection", () => {
|
|
81
|
+
it("uses react-native-screens' Tabs on iOS when the binary registers RNSTabsHost", () => {
|
|
82
|
+
expect(
|
|
83
|
+
resolveNativeTabs(
|
|
84
|
+
sources(["RNSTabsHost", "RNSTabsScreen"], () => ({ Tabs: fakeTabs })),
|
|
85
|
+
"ios",
|
|
86
|
+
),
|
|
87
|
+
).toBe(fakeTabs);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("never requires react-native-screens' Tabs on a binary without the native view", () => {
|
|
91
|
+
const screens = vi.fn(() => ({ Tabs: fakeTabs }));
|
|
92
|
+
expect(resolveNativeTabs(sources(["RNSTabsScreen"], screens), "ios")).toBeNull();
|
|
93
|
+
expect(screens).not.toHaveBeenCalled();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("falls back when the probe or the require throws", () => {
|
|
97
|
+
const throws = () => {
|
|
98
|
+
throw new Error("unavailable");
|
|
99
|
+
};
|
|
100
|
+
expect(
|
|
101
|
+
resolveNativeTabs({ hasComponent: throws, screens: () => ({ Tabs: fakeTabs }) }, "ios"),
|
|
102
|
+
).toBeNull();
|
|
103
|
+
expect(resolveNativeTabs(sources(["RNSTabsHost", "RNSTabsScreen"], throws), "ios")).toBeNull();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("keeps the MPO TabBar on Android and the web", () => {
|
|
107
|
+
const screens = vi.fn(() => ({ Tabs: fakeTabs }));
|
|
108
|
+
const all = sources(["RNSTabsHost", "RNSTabsScreen"], screens);
|
|
109
|
+
expect(resolveNativeTabs(all, "android")).toBeNull();
|
|
110
|
+
expect(resolveNativeTabs(all, "web")).toBeNull();
|
|
111
|
+
expect(screens).not.toHaveBeenCalled();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("needs an SF Symbol on every item", () => {
|
|
115
|
+
expect(itemsHaveNativeIcons(items)).toBe(true);
|
|
116
|
+
expect(itemsHaveNativeIcons([...items, { key: "/x", label: "X", icon: Glyph }])).toBe(false);
|
|
117
|
+
expect(itemsHaveNativeIcons([])).toBe(false);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe("NativeTabHost", () => {
|
|
122
|
+
it("frames the routed screen in the active tab, with the item's SF Symbol", () => {
|
|
123
|
+
renderNative("/pokemon");
|
|
124
|
+
const pokemon = screen.getByTestId("native-screen-/pokemon");
|
|
125
|
+
expect(pokemon.getAttribute("data-focused")).toBe("true");
|
|
126
|
+
expect(pokemon.contains(screen.getByTestId("page"))).toBe(true);
|
|
127
|
+
expect(screen.getByTestId("native-screen-/").getAttribute("data-focused")).toBe("false");
|
|
128
|
+
expect(screen.getByTestId("native-screen-/").getAttribute("data-symbol")).toBe("house");
|
|
129
|
+
expect(screen.getByTestId("native-host").getAttribute("data-hidden")).toBe("false");
|
|
130
|
+
expect(screen.queryByTestId("tab-bar")).toBeNull();
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("asks the app to navigate on a tab press instead of switching itself", () => {
|
|
134
|
+
const onTabPress = vi.fn();
|
|
135
|
+
renderNative("/pokemon", onTabPress);
|
|
136
|
+
fireEvent.click(screen.getByTestId("native-press-moves"));
|
|
137
|
+
expect(onTabPress).toHaveBeenCalledWith("/moves");
|
|
138
|
+
expect(screen.getByTestId("native-screen-/pokemon").getAttribute("data-focused")).toBe("true");
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("hides the bar on a pushed screen and keeps it in the last tab", () => {
|
|
142
|
+
const { rerender } = renderNative("/pokemon");
|
|
143
|
+
rerender(
|
|
144
|
+
<NativeTabHost tabs={fakeTabs} items={items} activeKey={undefined} onTabPress={vi.fn()}>
|
|
145
|
+
<div data-testid="page">detail</div>
|
|
146
|
+
<Inset />
|
|
147
|
+
</NativeTabHost>,
|
|
148
|
+
);
|
|
149
|
+
expect(screen.getByTestId("native-host").getAttribute("data-hidden")).toBe("true");
|
|
150
|
+
expect(screen.getByTestId("native-screen-/pokemon").textContent).toContain("detail");
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("pads screens by the system bar it covers, and nothing once hidden", () => {
|
|
154
|
+
const { rerender } = renderNative("/");
|
|
155
|
+
expect(Number(screen.getByTestId("inset").textContent)).toBeGreaterThanOrEqual(
|
|
156
|
+
nativeTabBarHeight,
|
|
157
|
+
);
|
|
158
|
+
rerender(
|
|
159
|
+
<NativeTabHost tabs={fakeTabs} items={items} activeKey={undefined} onTabPress={vi.fn()}>
|
|
160
|
+
<Inset />
|
|
161
|
+
</NativeTabHost>,
|
|
162
|
+
);
|
|
163
|
+
expect(screen.getByTestId("inset").textContent).toBe("0");
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
describe("TabHost fallback", () => {
|
|
168
|
+
it("renders the MPO TabBar from the same config where native tabs are unavailable", () => {
|
|
169
|
+
renderWithProviders(
|
|
170
|
+
<TabHost items={items} activeKey="/moves" onTabPress={vi.fn()}>
|
|
171
|
+
<div data-testid="page">page</div>
|
|
172
|
+
</TabHost>,
|
|
173
|
+
);
|
|
174
|
+
expect(screen.queryByTestId("native-host")).toBeNull();
|
|
175
|
+
expect(screen.getByTestId("tab-bar")).toBeTruthy();
|
|
176
|
+
expect(screen.getByTestId("tab-bar-item-moves")).toBeTruthy();
|
|
177
|
+
expect(screen.getByTestId("page")).toBeTruthy();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("shows no bar on a pushed screen", () => {
|
|
181
|
+
renderWithProviders(
|
|
182
|
+
<TabHost items={items} onTabPress={vi.fn()}>
|
|
183
|
+
<div data-testid="page">page</div>
|
|
184
|
+
</TabHost>,
|
|
185
|
+
);
|
|
186
|
+
expect(screen.queryByTestId("tab-bar")).toBeNull();
|
|
187
|
+
});
|
|
188
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabHost, native arm (FZ-8105): the system tab bar (UITabBarController on
|
|
3
|
+
* iOS, so iOS 26 Liquid Glass) through react-native-screens' Tabs.
|
|
4
|
+
*
|
|
5
|
+
* The routed screen stays the app's own: the host only frames it. It sits
|
|
6
|
+
* in the focused tab's screen, and a tab press asks the app to navigate
|
|
7
|
+
* (controlled tabs), so routing never moves into a tab navigator and web,
|
|
8
|
+
* SSR and GNOME keep the same routes. A pushed screen keeps the last tab
|
|
9
|
+
* focused with the bar hidden, so pushing does not remount the screen.
|
|
10
|
+
*
|
|
11
|
+
* The native view ships in react-native-screens' binary half, so it is
|
|
12
|
+
* feature-detected before react-native-screens' Tabs is required: a binary
|
|
13
|
+
* without RNSTabsHost, a platform other than iOS, or an item without an SF
|
|
14
|
+
* Symbol keeps the MPO TabBar. Android stays on the MPO TabBar until the
|
|
15
|
+
* items carry image icons the Material bar can draw.
|
|
16
|
+
*/
|
|
17
|
+
import { useGlyphColor, useIdentityInkOnSurface } from "@multiplatform.one/theme";
|
|
18
|
+
import { type ComponentType, type ReactNode, useEffect, useRef, useState } from "react";
|
|
19
|
+
import { Platform, UIManager } from "react-native";
|
|
20
|
+
import { setBottomChromeInset } from "./bottomChrome";
|
|
21
|
+
import { useBottomInset } from "./bottomInset";
|
|
22
|
+
import { type TabBarItem, tabBarInactiveInk } from "./TabBar";
|
|
23
|
+
import { MpoTabHost, type TabHostProps } from "./TabHost";
|
|
24
|
+
|
|
25
|
+
export type { TabHostProps } from "./TabHost";
|
|
26
|
+
|
|
27
|
+
/** The Fabric components react-native-screens registers for its tabs. */
|
|
28
|
+
export const nativeTabsComponents = ["RNSTabsHost", "RNSTabsScreen"] as const;
|
|
29
|
+
|
|
30
|
+
/** Points the system tab bar covers above the home-indicator band. */
|
|
31
|
+
export const nativeTabBarHeight = 49;
|
|
32
|
+
|
|
33
|
+
type IconProp = { ios: { type: "sfSymbol"; name: string } };
|
|
34
|
+
|
|
35
|
+
export interface NativeTabs {
|
|
36
|
+
Host: ComponentType<{
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
tabBarHidden?: boolean;
|
|
39
|
+
tabBarTintColor?: string;
|
|
40
|
+
tabBarItemIconColor?: string;
|
|
41
|
+
tabBarItemIconColorActive?: string;
|
|
42
|
+
tabBarItemTitleFontColor?: string;
|
|
43
|
+
tabBarItemTitleFontColorActive?: string;
|
|
44
|
+
experimentalControlNavigationStateInJS?: boolean;
|
|
45
|
+
onNativeFocusChange?: (event: { nativeEvent: { tabKey: string } }) => void;
|
|
46
|
+
}>;
|
|
47
|
+
Screen: ComponentType<{
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
tabKey: string;
|
|
50
|
+
title?: string;
|
|
51
|
+
isFocused?: boolean;
|
|
52
|
+
icon?: IconProp;
|
|
53
|
+
selectedIcon?: IconProp["ios"];
|
|
54
|
+
tabBarItemAccessibilityLabel?: string;
|
|
55
|
+
tabBarItemTestID?: string;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface NativeTabsSources {
|
|
60
|
+
hasComponent: (name: string) => boolean;
|
|
61
|
+
screens: () => { Tabs?: NativeTabs };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const appSources: NativeTabsSources = {
|
|
65
|
+
hasComponent: (name) => UIManager.hasViewManagerConfig(name),
|
|
66
|
+
screens: () => require("react-native-screens"),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** react-native-screens' Tabs, or null when this platform or binary cannot draw them. */
|
|
70
|
+
export function resolveNativeTabs(sources: NativeTabsSources, os: string): NativeTabs | null {
|
|
71
|
+
if (os !== "ios") return null;
|
|
72
|
+
try {
|
|
73
|
+
if (!nativeTabsComponents.every((name) => sources.hasComponent(name))) return null;
|
|
74
|
+
const tabs = sources.screens().Tabs;
|
|
75
|
+
return tabs?.Host && tabs.Screen ? tabs : null;
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let cached: NativeTabs | null | undefined;
|
|
82
|
+
|
|
83
|
+
function loadNativeTabs(): NativeTabs | null {
|
|
84
|
+
if (cached === undefined) cached = resolveNativeTabs(appSources, Platform.OS);
|
|
85
|
+
return cached;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** True when every item names the SF Symbol the system bar draws. */
|
|
89
|
+
export function itemsHaveNativeIcons(items: readonly TabBarItem[]): boolean {
|
|
90
|
+
return items.length > 0 && items.every((item) => Boolean(item.nativeIcon?.sfSymbol));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function NativeTabHost({
|
|
94
|
+
tabs,
|
|
95
|
+
items,
|
|
96
|
+
activeKey,
|
|
97
|
+
onTabPress,
|
|
98
|
+
children,
|
|
99
|
+
}: TabHostProps & { tabs: NativeTabs }) {
|
|
100
|
+
const { Host, Screen } = tabs;
|
|
101
|
+
const accent = useIdentityInkOnSurface();
|
|
102
|
+
const ink = useGlyphColor(tabBarInactiveInk);
|
|
103
|
+
const deviceInset = useBottomInset();
|
|
104
|
+
const [id] = useState(() => Symbol("native-tab-host"));
|
|
105
|
+
const lastKey = useRef(activeKey ?? items[0]?.key);
|
|
106
|
+
if (activeKey) lastKey.current = activeKey;
|
|
107
|
+
const focusedKey = lastKey.current;
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
setBottomChromeInset(id, activeKey ? nativeTabBarHeight + deviceInset : null);
|
|
111
|
+
}, [activeKey, deviceInset, id]);
|
|
112
|
+
useEffect(() => () => setBottomChromeInset(id, null), [id]);
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Host
|
|
116
|
+
tabBarHidden={!activeKey}
|
|
117
|
+
tabBarTintColor={accent}
|
|
118
|
+
tabBarItemIconColor={ink}
|
|
119
|
+
tabBarItemIconColorActive={accent}
|
|
120
|
+
tabBarItemTitleFontColor={ink}
|
|
121
|
+
tabBarItemTitleFontColorActive={accent}
|
|
122
|
+
experimentalControlNavigationStateInJS
|
|
123
|
+
onNativeFocusChange={(event) => {
|
|
124
|
+
const key = event.nativeEvent.tabKey;
|
|
125
|
+
if (key !== activeKey) onTabPress(key);
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
{items.map((item) => (
|
|
129
|
+
<Screen
|
|
130
|
+
key={item.key}
|
|
131
|
+
tabKey={item.key}
|
|
132
|
+
title={item.label}
|
|
133
|
+
isFocused={item.key === focusedKey}
|
|
134
|
+
icon={{ ios: { type: "sfSymbol", name: item.nativeIcon!.sfSymbol } }}
|
|
135
|
+
selectedIcon={
|
|
136
|
+
item.nativeIcon?.sfSymbolSelected
|
|
137
|
+
? { type: "sfSymbol", name: item.nativeIcon.sfSymbolSelected }
|
|
138
|
+
: undefined
|
|
139
|
+
}
|
|
140
|
+
tabBarItemAccessibilityLabel={item.label}
|
|
141
|
+
tabBarItemTestID={`tab-bar-item-${item.key.replace(/^\/+/, "") || "root"}`}
|
|
142
|
+
>
|
|
143
|
+
{item.key === focusedKey ? children : null}
|
|
144
|
+
</Screen>
|
|
145
|
+
))}
|
|
146
|
+
</Host>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function TabHost(props: TabHostProps) {
|
|
151
|
+
const tabs = loadNativeTabs();
|
|
152
|
+
if (!tabs || !itemsHaveNativeIcons(props.items)) return <MpoTabHost {...props} />;
|
|
153
|
+
return <NativeTabHost tabs={tabs} {...props} />;
|
|
154
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabHost — an app's top-level sections, declared once (FZ-8105). The host
|
|
3
|
+
* wraps the routed screen and picks the tab bar for the platform: the
|
|
4
|
+
* phone's own tab bar where the binary has it (`TabHost.native.tsx`), the
|
|
5
|
+
* MPO floating TabBar everywhere else (web, GNOME, a binary without native
|
|
6
|
+
* tabs). An app hands over the same items on every platform and never
|
|
7
|
+
* branches on one.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import { TabBar, type TabBarItem } from "./TabBar";
|
|
11
|
+
|
|
12
|
+
export interface TabHostProps {
|
|
13
|
+
items: readonly TabBarItem[];
|
|
14
|
+
/** The section the current route is the root of. Unset hides the bar (a pushed screen). */
|
|
15
|
+
activeKey?: string;
|
|
16
|
+
onTabPress: (key: string) => void;
|
|
17
|
+
/** Accessible name of the tab list. Default "Tabs". */
|
|
18
|
+
label?: string;
|
|
19
|
+
/** The routed screen. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function MpoTabHost({ items, activeKey, onTabPress, label, children }: TabHostProps) {
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
{children}
|
|
27
|
+
{activeKey ? (
|
|
28
|
+
<TabBar items={items} activeKey={activeKey} onTabPress={onTabPress} label={label} />
|
|
29
|
+
) : null}
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function TabHost(props: TabHostProps) {
|
|
35
|
+
return <MpoTabHost {...props} />;
|
|
36
|
+
}
|
package/src/appShell/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./SystemBar";
|
|
|
2
2
|
export * from "./ScopeMenu";
|
|
3
3
|
export * from "./Dock";
|
|
4
4
|
export * from "./TabBar";
|
|
5
|
+
export { TabHost, type TabHostProps } from "./TabHost";
|
|
5
6
|
export * from "./Springboard";
|
|
6
7
|
export type { AppEntry } from "./appTile";
|
|
7
8
|
export * from "./SettingsSplit";
|
|
@@ -3,6 +3,7 @@ import { isWeb } from "@multiplatform.one/platform";
|
|
|
3
3
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
4
|
import { createContext, useContext, useId, useState, type ReactNode } from "react";
|
|
5
5
|
import { Paragraph, XStack, YStack } from "tamagui";
|
|
6
|
+
import { OverlayHeader } from "../actions/StandardAction";
|
|
6
7
|
import { Dialog } from "../Dialog";
|
|
7
8
|
import { ScrollView } from "../ScrollView";
|
|
8
9
|
import { sectionHeading } from "../componentColors";
|
|
@@ -65,9 +66,14 @@ export function ChartDataView({ data, title, valueFormatter, children }: ChartDa
|
|
|
65
66
|
maxHeight="80%"
|
|
66
67
|
{...chartWebProps({ "data-mpo-chart-data-panel": id })}
|
|
67
68
|
>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
<OverlayHeader
|
|
70
|
+
title={
|
|
71
|
+
<Dialog.Title {...sectionHeading} {...knobProps.heading}>
|
|
72
|
+
{title ? `${title}: ${t("data")}` : t("Chart data")}
|
|
73
|
+
</Dialog.Title>
|
|
74
|
+
}
|
|
75
|
+
onClose={() => setOpen(false)}
|
|
76
|
+
/>
|
|
71
77
|
<Dialog.Description
|
|
72
78
|
{...knobProps.body}
|
|
73
79
|
>{`${normalized.length} ${t("data points")}`}</Dialog.Description>
|
|
@@ -109,17 +115,6 @@ export function ChartDataView({ data, title, valueFormatter, children }: ChartDa
|
|
|
109
115
|
))}
|
|
110
116
|
</YStack>
|
|
111
117
|
</ScrollView>
|
|
112
|
-
<XStack justifyContent="flex-end">
|
|
113
|
-
<Dialog.Close asChild aria-label={t("Close")}>
|
|
114
|
-
<Button
|
|
115
|
-
aria-label={t("Close")}
|
|
116
|
-
{...(!isWeb ? { accessibilityLabel: t("Close") } : {})}
|
|
117
|
-
{...chartWebProps({ "data-mpo-chart-data-close": id })}
|
|
118
|
-
>
|
|
119
|
-
{t("Close")}
|
|
120
|
-
</Button>
|
|
121
|
-
</Dialog.Close>
|
|
122
|
-
</XStack>
|
|
123
118
|
</DialogContent>
|
|
124
119
|
</Dialog.Portal>
|
|
125
120
|
</Dialog>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-7680. On native a phosphor glyph has no CSS colour to inherit: given no
|
|
3
|
+
* colour, a token or `currentColor`, phosphor-react-native draws it black, and
|
|
4
|
+
* on the dark scheme that is a glyph nobody can see (the command palette's
|
|
5
|
+
* recents clocks on Clay's iPhone). The native bundle swaps phosphor's
|
|
6
|
+
* IconBase for MPO's theme-ink one; this renders the icon-bearing component
|
|
7
|
+
* stories through that same IconBase, on the dark theme, and fails on any
|
|
8
|
+
* glyph that would paint black.
|
|
9
|
+
*/
|
|
10
|
+
import { createDefaultThemeConfig } from "@multiplatform.one/theme";
|
|
11
|
+
import { isBlackPaint } from "@multiplatform.one/config/phosphor-native-probe";
|
|
12
|
+
import { ClockIcon } from "@phosphor-icons/react";
|
|
13
|
+
import { cleanup, render } from "@testing-library/react";
|
|
14
|
+
import type { ReactNode } from "react";
|
|
15
|
+
import { TamaguiProvider, useTheme } from "tamagui";
|
|
16
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
17
|
+
import * as BadgeStories from "../Badge/Badge.stories";
|
|
18
|
+
import * as ChipStories from "../Chip/Chip.stories";
|
|
19
|
+
import * as DropdownMenuStories from "../DropdownMenu/DropdownMenu.stories";
|
|
20
|
+
import * as TabsStories from "../Tabs/Tabs.stories";
|
|
21
|
+
import * as TabBarStories from "../appShell/TabBar.stories";
|
|
22
|
+
import * as EmptyStateStories from "../layouts/EmptyState.stories";
|
|
23
|
+
import * as SidebarStories from "../layouts/Sidebar.stories";
|
|
24
|
+
import * as DashboardStories from "../views/Dashboard.stories";
|
|
25
|
+
import * as ListStories from "../views/List.stories";
|
|
26
|
+
import * as ShortcutCardStories from "../views/ShortcutCard.stories";
|
|
27
|
+
|
|
28
|
+
vi.mock("@phosphor-icons/react", async (importOriginal) => {
|
|
29
|
+
const [{ nativePhosphorModule }, { useTheme: useScopeTheme }] = await Promise.all([
|
|
30
|
+
import("@multiplatform.one/config/phosphor-native-probe"),
|
|
31
|
+
import("tamagui"),
|
|
32
|
+
]);
|
|
33
|
+
return nativePhosphorModule(await importOriginal<Record<string, unknown>>(), useScopeTheme);
|
|
34
|
+
});
|
|
35
|
+
vi.mock("@multiplatform.one/storybook", () => ({ action: () => () => undefined }));
|
|
36
|
+
vi.mock("tamagui", async (original) => ({
|
|
37
|
+
...(await original<typeof import("tamagui")>()),
|
|
38
|
+
isWeb: false,
|
|
39
|
+
}));
|
|
40
|
+
vi.mock("@multiplatform.one/forms", async (original) => ({
|
|
41
|
+
...(await original<typeof import("@multiplatform.one/forms")>()),
|
|
42
|
+
FloatingPanel: ({ children }: { children: ReactNode }) => <>{children}</>,
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
const config = createDefaultThemeConfig();
|
|
46
|
+
afterEach(cleanup);
|
|
47
|
+
|
|
48
|
+
type StoryModule = Record<string, unknown> & {
|
|
49
|
+
default?: { component?: unknown; args?: Record<string, unknown> };
|
|
50
|
+
};
|
|
51
|
+
type Story = {
|
|
52
|
+
args?: Record<string, unknown>;
|
|
53
|
+
render?: (args: Record<string, unknown>, context: unknown) => ReactNode;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function Dark({ children }: { children: ReactNode }) {
|
|
57
|
+
return (
|
|
58
|
+
<TamaguiProvider config={config.tamagui} defaultTheme="dark" disableInjectCSS>
|
|
59
|
+
{children}
|
|
60
|
+
</TamaguiProvider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ThemeInk({ name }: { name: string }) {
|
|
65
|
+
const theme = useTheme() as unknown as Record<string, { val?: unknown } | undefined>;
|
|
66
|
+
return <span data-theme-ink={name} data-val={String(theme[name]?.val ?? "")} />;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function storyElement(module: StoryModule, story: Story): ReactNode {
|
|
70
|
+
const args = { ...module.default?.args, ...story.args };
|
|
71
|
+
if (story.render) return story.render(args, { args, argTypes: {}, globals: {}, parameters: {} });
|
|
72
|
+
const Component = module.default?.component as ((props: object) => ReactNode) | undefined;
|
|
73
|
+
return Component ? <Component {...args} /> : null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Storybook mounts render() as a component, so a story's own hooks run inside one.
|
|
77
|
+
function StoryHost({ module, story }: { module: StoryModule; story: Story }) {
|
|
78
|
+
return <>{storyElement(module, story)}</>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function glyphPaints(container: HTMLElement) {
|
|
82
|
+
return [...container.querySelectorAll<HTMLElement>("[data-native-icon]")].map((glyph) => ({
|
|
83
|
+
icon: glyph.dataset.nativeIcon,
|
|
84
|
+
paint: glyph.dataset.paint,
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const storyFiles: Record<string, StoryModule> = {
|
|
89
|
+
Badge: BadgeStories,
|
|
90
|
+
Chip: ChipStories,
|
|
91
|
+
DropdownMenu: DropdownMenuStories,
|
|
92
|
+
Tabs: TabsStories,
|
|
93
|
+
TabBar: TabBarStories,
|
|
94
|
+
EmptyState: EmptyStateStories,
|
|
95
|
+
Sidebar: SidebarStories,
|
|
96
|
+
Dashboard: DashboardStories,
|
|
97
|
+
List: ListStories,
|
|
98
|
+
ShortcutCard: ShortcutCardStories,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const stories = Object.entries(storyFiles).flatMap(([file, module]) =>
|
|
102
|
+
Object.entries(module)
|
|
103
|
+
.filter(([name, story]) => name !== "default" && story && typeof story === "object")
|
|
104
|
+
.map(([name, story]) => [`${file}/${name}`, module, story as Story] as const),
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
describe("no phosphor glyph paints black on native in dark mode (FZ-7680)", () => {
|
|
108
|
+
it("a glyph with no colour, a token or currentColor paints the theme's ink", () => {
|
|
109
|
+
const { container } = render(
|
|
110
|
+
<Dark>
|
|
111
|
+
<ClockIcon size={16} />
|
|
112
|
+
<ClockIcon size={16} color={undefined} />
|
|
113
|
+
<ClockIcon size={16} color="currentColor" />
|
|
114
|
+
<ClockIcon size={16} color="$color12" />
|
|
115
|
+
<ClockIcon size={16} color="$textMuted" />
|
|
116
|
+
<ClockIcon size={16} color="$notAThemeKey" />
|
|
117
|
+
<ThemeInk name="color" />
|
|
118
|
+
<ThemeInk name="color12" />
|
|
119
|
+
<ThemeInk name="textMuted" />
|
|
120
|
+
</Dark>,
|
|
121
|
+
);
|
|
122
|
+
const ink = (name: string) =>
|
|
123
|
+
container.querySelector(`[data-theme-ink="${name}"]`)?.getAttribute("data-val");
|
|
124
|
+
const paints = glyphPaints(container).map((glyph) => glyph.paint);
|
|
125
|
+
expect(paints).toEqual([
|
|
126
|
+
ink("color"),
|
|
127
|
+
ink("color"),
|
|
128
|
+
ink("color"),
|
|
129
|
+
ink("color12"),
|
|
130
|
+
ink("textMuted"),
|
|
131
|
+
ink("color"),
|
|
132
|
+
]);
|
|
133
|
+
for (const paint of paints) expect(isBlackPaint(paint), paint).toBe(false);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("the icon-bearing stories render glyphs at all", () => {
|
|
137
|
+
let total = 0;
|
|
138
|
+
for (const [, module, story] of stories) {
|
|
139
|
+
const { container, unmount } = render(
|
|
140
|
+
<Dark>
|
|
141
|
+
<StoryHost module={module} story={story} />
|
|
142
|
+
</Dark>,
|
|
143
|
+
);
|
|
144
|
+
total += glyphPaints(container).length;
|
|
145
|
+
unmount();
|
|
146
|
+
}
|
|
147
|
+
expect(total).toBeGreaterThan(stories.length);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it.each(stories)("%s paints no glyph black", (_name, module, story) => {
|
|
151
|
+
const { container } = render(
|
|
152
|
+
<Dark>
|
|
153
|
+
<StoryHost module={module} story={story} />
|
|
154
|
+
</Dark>,
|
|
155
|
+
);
|
|
156
|
+
const black = glyphPaints(container).filter((glyph) => isBlackPaint(glyph.paint));
|
|
157
|
+
expect(black).toEqual([]);
|
|
158
|
+
});
|
|
159
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -151,6 +151,8 @@ export type { SpinnerProps } from "@multiplatform.one/forms";
|
|
|
151
151
|
// longer exports the bare name; raw stays reachable as TamaguiButton.
|
|
152
152
|
export { Button } from "./Button";
|
|
153
153
|
export type { ButtonProps } from "./Button";
|
|
154
|
+
export { IconButton } from "@multiplatform.one/forms";
|
|
155
|
+
export type { IconButtonProps } from "@multiplatform.one/forms";
|
|
154
156
|
|
|
155
157
|
// Shadow tamagui Text and Heading with the house versions. ./tamagui.ts says
|
|
156
158
|
// so in its own words -- "Bare Text/SizableText/Paragraph/Anchor are the house
|
|
@@ -12,6 +12,7 @@ import { Badge } from "../Badge";
|
|
|
12
12
|
import { Text as HouseText } from "../Text";
|
|
13
13
|
import {
|
|
14
14
|
AsyncBoundary,
|
|
15
|
+
AsyncSkeleton,
|
|
15
16
|
resolveAsyncStatus,
|
|
16
17
|
useAsyncCount,
|
|
17
18
|
__resetAsyncDevWarnSeen,
|
|
@@ -287,7 +288,7 @@ describe("AsyncBoundary Retry label weight (MPO-48 / R7)", () => {
|
|
|
287
288
|
});
|
|
288
289
|
|
|
289
290
|
describe("AsyncBoundary layout skeletons", () => {
|
|
290
|
-
it.each(["list", "table", "kanban", "dashboard", "generic"] as const)(
|
|
291
|
+
it.each(["list", "table", "kanban", "dashboard", "detail", "generic"] as const)(
|
|
291
292
|
"renders %s skeleton",
|
|
292
293
|
(layout) => {
|
|
293
294
|
renderWithProviders(<AsyncBoundary loading layout={layout} />);
|
|
@@ -295,3 +296,25 @@ describe("AsyncBoundary layout skeletons", () => {
|
|
|
295
296
|
},
|
|
296
297
|
);
|
|
297
298
|
});
|
|
299
|
+
|
|
300
|
+
describe("AsyncSkeleton detail layout (FZ-8000)", () => {
|
|
301
|
+
afterEach(cleanup);
|
|
302
|
+
|
|
303
|
+
it("stands in for a record page: hero band, identity, tabs and body", () => {
|
|
304
|
+
renderWithProviders(<AsyncSkeleton layout="detail" hero={{ height: 250, art: 220 }} />);
|
|
305
|
+
const root = document.querySelector('[data-async-skeleton="detail"]') as HTMLElement;
|
|
306
|
+
expect(root.getAttribute("aria-busy")).toBe("true");
|
|
307
|
+
const parts = [...root.querySelectorAll("[data-skeleton-part]")].map((node) =>
|
|
308
|
+
node.getAttribute("data-skeleton-part"),
|
|
309
|
+
);
|
|
310
|
+
expect(parts).toEqual(["hero", "identity", "tabs"]);
|
|
311
|
+
const band = root.querySelector('[data-skeleton-part="hero"]') as HTMLElement;
|
|
312
|
+
expect(getComputedStyle(band).minHeight).toBe("250px");
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it("drops the hero band when the page draws none", () => {
|
|
316
|
+
renderWithProviders(<AsyncSkeleton layout="detail" hero={false} />);
|
|
317
|
+
expect(document.querySelector('[data-skeleton-part="hero"]')).toBeNull();
|
|
318
|
+
expect(document.querySelector('[data-skeleton-part="identity"]')).not.toBeNull();
|
|
319
|
+
});
|
|
320
|
+
});
|
|
@@ -22,7 +22,14 @@ const meta: Meta<typeof AsyncBoundary> = {
|
|
|
22
22
|
argTypes: {
|
|
23
23
|
layout: {
|
|
24
24
|
control: "select",
|
|
25
|
-
options: [
|
|
25
|
+
options: [
|
|
26
|
+
"list",
|
|
27
|
+
"table",
|
|
28
|
+
"kanban",
|
|
29
|
+
"dashboard",
|
|
30
|
+
"detail",
|
|
31
|
+
"generic",
|
|
32
|
+
] satisfies AsyncBoundaryLayout[],
|
|
26
33
|
},
|
|
27
34
|
keepPrevious: { control: "boolean" },
|
|
28
35
|
},
|