@multiplatform.one/components 8.3.0 → 8.4.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/README.md +18 -3
- package/dist/cjs/Chip/index.cjs +1 -1
- package/dist/cjs/Chip/index.native.js +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/Material/blur.native.js +5 -1
- package/dist/cjs/Material/blur.native.js.map +1 -1
- package/dist/cjs/ScrollView/useRevealFocusedField.native.js +3 -2
- package/dist/cjs/ScrollView/useRevealFocusedField.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +10 -1
- package/dist/cjs/SheetModal/index.native.js +14 -5
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +16 -39
- package/dist/cjs/Tabs/index.native.js +17 -40
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Tooltip/index.native.js +9 -1
- package/dist/cjs/Tooltip/index.native.js.map +1 -1
- package/dist/cjs/appShell/AppShell.cjs +91 -107
- package/dist/cjs/appShell/AppShell.native.js +100 -114
- package/dist/cjs/appShell/AppShell.native.js.map +1 -1
- package/dist/cjs/appShell/Springboard.cjs +2 -2
- package/dist/cjs/appShell/Springboard.native.js +2 -2
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.cjs +147 -55
- package/dist/cjs/appShell/SystemBar.native.js +152 -59
- package/dist/cjs/appShell/SystemBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.native.js +5 -2
- package/dist/cjs/appShell/TabHost.native.js.map +1 -1
- package/dist/cjs/appShell/stackBack.cjs +49 -0
- package/dist/cjs/appShell/stackBack.native.js +55 -0
- package/dist/cjs/appShell/stackBack.native.js.map +1 -0
- package/dist/cjs/appShell/systemBarFit.cjs +12 -2
- package/dist/cjs/appShell/systemBarFit.native.js +16 -2
- package/dist/cjs/appShell/systemBarFit.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.cjs +21 -12
- package/dist/cjs/code/CodeBlock/index.native.js +21 -12
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HoldSelect/index.cjs +69 -0
- package/dist/cjs/code/HoldSelect/index.native.js +132 -0
- package/dist/cjs/code/HoldSelect/index.native.js.map +1 -0
- package/dist/cjs/code/HoldSelect/tapGate.cjs +88 -0
- package/dist/cjs/code/HoldSelect/tapGate.native.js +95 -0
- package/dist/cjs/code/HoldSelect/tapGate.native.js.map +1 -0
- package/dist/cjs/code/LogView.cjs +14 -3
- package/dist/cjs/code/LogView.native.js +15 -3
- package/dist/cjs/code/LogView.native.js.map +1 -1
- package/dist/cjs/code/index.cjs +1 -0
- package/dist/cjs/code/index.native.js +1 -0
- package/dist/cjs/code/index.native.js.map +1 -1
- package/dist/cjs/componentColors.cjs +5 -4
- package/dist/cjs/componentColors.native.js +5 -4
- package/dist/cjs/componentColors.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +21 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +21 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/asyncFailure.cjs +15 -15
- package/dist/cjs/layouts/asyncFailure.native.js +15 -15
- package/dist/cjs/layouts/asyncFailure.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.cjs +45 -6
- package/dist/cjs/layouts/attachments.native.js +47 -6
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +89 -13
- package/dist/cjs/layouts/page.native.js +93 -14
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.cjs +8 -4
- package/dist/cjs/layouts/screenScroll.native.js +12 -4
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/cjs/layouts/tags.cjs +2 -1
- package/dist/cjs/layouts/tags.native.js +2 -1
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +18 -5
- package/dist/cjs/views/Dashboard.native.js +18 -5
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/FilePreview.cjs +624 -0
- package/dist/cjs/views/FilePreview.native.js +675 -0
- package/dist/cjs/views/FilePreview.native.js.map +1 -0
- package/dist/cjs/views/ListGroup.cjs +2 -2
- package/dist/cjs/views/ListGroup.native.js +2 -2
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +13 -0
- package/dist/cjs/views/index.native.js +13 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Carousel/geometry.native.js.map +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/ChatTurn/index.native.js.map +1 -1
- package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/esm/CheckGlyph/index.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +3 -3
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +3 -3
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ChoiceChips/index.native.js.map +1 -1
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/Diff/diff.native.js.map +1 -1
- package/dist/esm/Diff/index.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DrillStack/DrillBar.native.js.map +1 -1
- package/dist/esm/DrillStack/context.native.js.map +1 -1
- package/dist/esm/DrillStack/drillMotion.native.js.map +1 -1
- package/dist/esm/DropDownPanel/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Kbd/index.native.js.map +1 -1
- package/dist/esm/Kbd/keys.native.js.map +1 -1
- package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/esm/Lightbox/shared.native.js.map +1 -1
- package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/esm/MachineLiteral/index.native.js.map +1 -1
- package/dist/esm/Material/blur.native.js +5 -1
- package/dist/esm/Material/blur.native.js.map +1 -1
- package/dist/esm/Material/index.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/MiddleEllipsisText/middleSplit.native.js.map +1 -1
- package/dist/esm/MiddleEllipsisText/types.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/Quote/index.native.js.map +1 -1
- package/dist/esm/SchemeToggle/index.native.js.map +1 -1
- package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/esm/ScrollView/useRevealFocusedField.native.js +3 -2
- package/dist/esm/ScrollView/useRevealFocusedField.native.js.map +1 -1
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +10 -1
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +14 -5
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/SheetScrollView/index.native.js.map +1 -1
- package/dist/esm/SheetScrollView/sheetHandoff.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/esm/SwipeDismissRow/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +16 -40
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +17 -41
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/index.native.js +10 -2
- package/dist/esm/Tooltip/index.native.js.map +1 -1
- package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
- package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
- package/dist/esm/Video/VideoFrame.native.js.map +1 -1
- package/dist/esm/Video/types.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wizard/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/actions/DangerSection.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/actions/HeaderActions.native.js.map +1 -1
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/actions/devWarn.native.js.map +1 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/actions/severity.native.js.map +1 -1
- package/dist/esm/appShell/AppShell.mjs +91 -107
- package/dist/esm/appShell/AppShell.mjs.map +1 -1
- package/dist/esm/appShell/AppShell.native.js +100 -114
- package/dist/esm/appShell/AppShell.native.js.map +1 -1
- package/dist/esm/appShell/BottomChromeClearance.native.js.map +1 -1
- package/dist/esm/appShell/Dock.native.js.map +1 -1
- package/dist/esm/appShell/MpoTabHost.mjs.map +1 -1
- package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.mjs +1 -1
- package/dist/esm/appShell/Springboard.mjs.map +1 -1
- package/dist/esm/appShell/Springboard.native.js +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.mjs +147 -58
- package/dist/esm/appShell/SystemBar.mjs.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js +152 -62
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.native.js.map +1 -1
- package/dist/esm/appShell/TabHost.native.js +5 -2
- package/dist/esm/appShell/TabHost.native.js.map +1 -1
- package/dist/esm/appShell/appTile.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/appShell/stackBack.mjs +23 -0
- package/dist/esm/appShell/stackBack.mjs.map +1 -0
- package/dist/esm/appShell/stackBack.native.js +26 -0
- package/dist/esm/appShell/stackBack.native.js.map +1 -0
- package/dist/esm/appShell/systemBarFit.mjs +12 -2
- package/dist/esm/appShell/systemBarFit.mjs.map +1 -1
- package/dist/esm/appShell/systemBarFit.native.js +16 -2
- package/dist/esm/appShell/systemBarFit.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.mjs +21 -12
- package/dist/esm/code/CodeBlock/index.mjs.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js +21 -12
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/esm/code/Highlighter/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/esm/code/HoldSelect/index.mjs +42 -0
- package/dist/esm/code/HoldSelect/index.mjs.map +1 -0
- package/dist/esm/code/HoldSelect/index.native.js +102 -0
- package/dist/esm/code/HoldSelect/index.native.js.map +1 -0
- package/dist/esm/code/HoldSelect/tapGate.mjs +61 -0
- package/dist/esm/code/HoldSelect/tapGate.mjs.map +1 -0
- package/dist/esm/code/HoldSelect/tapGate.native.js +65 -0
- package/dist/esm/code/HoldSelect/tapGate.native.js.map +1 -0
- package/dist/esm/code/LogView.mjs +13 -3
- package/dist/esm/code/LogView.mjs.map +1 -1
- package/dist/esm/code/LogView.native.js +14 -3
- package/dist/esm/code/LogView.native.js.map +1 -1
- package/dist/esm/code/PayloadView/index.native.js.map +1 -1
- package/dist/esm/code/PayloadView/payloadModel.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.mjs +1 -0
- package/dist/esm/code/index.mjs.map +1 -1
- package/dist/esm/code/index.native.js +1 -0
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.mjs +5 -4
- package/dist/esm/componentColors.mjs.map +1 -1
- package/dist/esm/componentColors.native.js +5 -4
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/esm/formLayouts/index.native.js.map +1 -1
- package/dist/esm/hooks/index.native.js.map +1 -1
- package/dist/esm/hooks/useClipboard.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/framing.native.js.map +1 -1
- package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/remoteArtCache.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/svgMarkup.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/types.native.js.map +1 -1
- package/dist/esm/images/index.native.js.map +1 -1
- package/dist/esm/index.gnome.native.js.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +22 -2
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +22 -2
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/Debug/index.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/asyncFailure.mjs +15 -15
- package/dist/esm/layouts/asyncFailure.mjs.map +1 -1
- package/dist/esm/layouts/asyncFailure.native.js +15 -15
- package/dist/esm/layouts/asyncFailure.native.js.map +1 -1
- package/dist/esm/layouts/attachments.mjs +45 -6
- package/dist/esm/layouts/attachments.mjs.map +1 -1
- package/dist/esm/layouts/attachments.native.js +47 -6
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/barTitleSpan.native.js.map +1 -1
- package/dist/esm/layouts/bottomAccessory.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +94 -18
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +96 -17
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.mjs +8 -4
- package/dist/esm/layouts/screenScroll.mjs.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js +12 -4
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.mjs +2 -1
- package/dist/esm/layouts/tags.mjs.map +1 -1
- package/dist/esm/layouts/tags.native.js +2 -1
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/shared/actionScan.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/restoreRetries.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/textRidesText.native.js.map +1 -1
- package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/CardGrid.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +19 -6
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +19 -6
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/FilePreview.mjs +588 -0
- package/dist/esm/views/FilePreview.mjs.map +1 -0
- package/dist/esm/views/FilePreview.native.js +636 -0
- package/dist/esm/views/FilePreview.native.js.map +1 -0
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +1 -1
- package/dist/esm/views/ListGroup.native.js +1 -1
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ListRow.native.js.map +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/ShortcutCard.native.js.map +1 -1
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/esm/views/ganttIntervals.native.js.map +1 -1
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -1
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/kanbanDnd.native.js.map +1 -1
- package/dist/esm/views/matrixMath.native.js.map +1 -1
- package/dist/esm/views/sameNameScope.native.js.map +1 -1
- package/dist/esm/views/treeViewDnd.native.js.map +1 -1
- package/dist/esm/views/treeViewLayout.native.js.map +1 -1
- package/dist/esm/views/treeViewMotion.native.js.map +1 -1
- package/dist/esm/views/treeViewReveal.native.js.map +1 -1
- package/dist/esm/views/usePageFlowLoadMore.native.js.map +1 -1
- package/dist/esm/views/widgetChrome.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +3 -3
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +1 -1
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/Material/blur.native.js +5 -1
- package/dist/jsx/Material/blur.native.js.map +1 -1
- package/dist/jsx/ScrollView/useRevealFocusedField.native.js +3 -2
- package/dist/jsx/ScrollView/useRevealFocusedField.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +10 -1
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +14 -5
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +16 -40
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +17 -40
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Tooltip/index.native.js +9 -1
- package/dist/jsx/Tooltip/index.native.js.map +1 -1
- package/dist/jsx/appShell/AppShell.mjs +91 -107
- package/dist/jsx/appShell/AppShell.mjs.map +1 -1
- package/dist/jsx/appShell/AppShell.native.js +100 -114
- package/dist/jsx/appShell/AppShell.native.js.map +1 -1
- package/dist/jsx/appShell/MpoTabHost.mjs.map +1 -1
- package/dist/jsx/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.mjs +1 -1
- package/dist/jsx/appShell/Springboard.mjs.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js +2 -2
- package/dist/jsx/appShell/Springboard.native.js.map +1 -1
- package/dist/jsx/appShell/SystemBar.mjs +147 -58
- package/dist/jsx/appShell/SystemBar.mjs.map +1 -1
- package/dist/jsx/appShell/SystemBar.native.js +152 -59
- package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.native.js +5 -2
- package/dist/jsx/appShell/TabHost.native.js.map +1 -1
- package/dist/jsx/appShell/stackBack.mjs +23 -0
- package/dist/jsx/appShell/stackBack.mjs.map +1 -0
- package/dist/jsx/appShell/stackBack.native.js +55 -0
- package/dist/jsx/appShell/stackBack.native.js.map +1 -0
- package/dist/jsx/appShell/systemBarFit.mjs +12 -2
- package/dist/jsx/appShell/systemBarFit.mjs.map +1 -1
- package/dist/jsx/appShell/systemBarFit.native.js +16 -2
- package/dist/jsx/appShell/systemBarFit.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.mjs +21 -12
- package/dist/jsx/code/CodeBlock/index.mjs.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +21 -12
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/code/HoldSelect/index.mjs +42 -0
- package/dist/jsx/code/HoldSelect/index.mjs.map +1 -0
- package/dist/jsx/code/HoldSelect/index.native.js +132 -0
- package/dist/jsx/code/HoldSelect/index.native.js.map +1 -0
- package/dist/jsx/code/HoldSelect/tapGate.mjs +61 -0
- package/dist/jsx/code/HoldSelect/tapGate.mjs.map +1 -0
- package/dist/jsx/code/HoldSelect/tapGate.native.js +95 -0
- package/dist/jsx/code/HoldSelect/tapGate.native.js.map +1 -0
- package/dist/jsx/code/LogView.mjs +13 -3
- package/dist/jsx/code/LogView.mjs.map +1 -1
- package/dist/jsx/code/LogView.native.js +15 -3
- package/dist/jsx/code/LogView.native.js.map +1 -1
- package/dist/jsx/code/index.mjs +1 -0
- package/dist/jsx/code/index.mjs.map +1 -1
- package/dist/jsx/code/index.native.js +1 -0
- package/dist/jsx/code/index.native.js.map +1 -1
- package/dist/jsx/componentColors.mjs +5 -4
- package/dist/jsx/componentColors.mjs.map +1 -1
- package/dist/jsx/componentColors.native.js +5 -4
- package/dist/jsx/componentColors.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +22 -2
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +21 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/asyncFailure.mjs +15 -15
- package/dist/jsx/layouts/asyncFailure.mjs.map +1 -1
- package/dist/jsx/layouts/asyncFailure.native.js +15 -15
- package/dist/jsx/layouts/asyncFailure.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.mjs +45 -6
- package/dist/jsx/layouts/attachments.mjs.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +47 -6
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +94 -18
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +93 -14
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.mjs +8 -4
- package/dist/jsx/layouts/screenScroll.mjs.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js +12 -4
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/tags.mjs +2 -1
- package/dist/jsx/layouts/tags.mjs.map +1 -1
- package/dist/jsx/layouts/tags.native.js +2 -1
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +19 -6
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +18 -5
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/FilePreview.mjs +588 -0
- package/dist/jsx/views/FilePreview.mjs.map +1 -0
- package/dist/jsx/views/FilePreview.native.js +675 -0
- package/dist/jsx/views/FilePreview.native.js.map +1 -0
- package/dist/jsx/views/ListGroup.mjs +1 -1
- package/dist/jsx/views/ListGroup.native.js +2 -2
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -1
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +13 -0
- package/dist/jsx/views/index.native.js.map +1 -1
- package/package.json +8 -11
- package/src/Chip/index.tsx +4 -3
- package/src/Material/blur.native.tsx +7 -1
- package/src/OverflowRow/OverflowRow.native.spec.tsx +10 -0
- package/src/OverflowRow/OverflowRow.stories.tsx +46 -17
- package/src/ScrollView/useRevealFocusedField.native.ts +2 -2
- package/src/SheetModal/SheetModal.elevation.spec.tsx +4 -4
- package/src/SheetModal/SheetModal.fill.spec.tsx +47 -0
- package/src/SheetModal/index.native.tsx +11 -3
- package/src/SheetModal/index.tsx +8 -0
- package/src/Tabs/Tabs.edgeFades.spec.tsx +77 -0
- package/src/Tabs/Tabs.fades.native.spec.tsx +23 -21
- package/src/Tabs/Tabs.measurement.spec.tsx +3 -3
- package/src/Tabs/Tabs.native.spec.tsx +1 -1
- package/src/Tabs/index.tsx +29 -50
- package/src/Tooltip/Tooltip.holdCue.native.spec.tsx +71 -0
- package/src/Tooltip/Tooltip.spec.tsx +1 -1
- package/src/Tooltip/index.native.tsx +6 -1
- package/src/appShell/AppShell.native.spec.tsx +104 -0
- package/src/appShell/AppShell.spec.tsx +49 -0
- package/src/appShell/AppShell.stackBack.native-press.spec.tsx +61 -0
- package/src/appShell/AppShell.stackBack.spec.tsx +112 -0
- package/src/appShell/AppShell.stories.tsx +51 -1
- package/src/appShell/AppShell.tsx +66 -80
- package/src/appShell/MpoTabHost.tsx +6 -0
- package/src/appShell/Springboard.spec.tsx +1 -1
- package/src/appShell/Springboard.tsx +1 -1
- package/src/appShell/SystemBar.phoneWidth.spec.tsx +17 -0
- package/src/appShell/SystemBar.spec.tsx +155 -3
- package/src/appShell/SystemBar.stories.tsx +48 -3
- package/src/appShell/SystemBar.tsx +172 -48
- package/src/appShell/TabHost.native.tsx +4 -2
- package/src/appShell/stackBack.ts +31 -0
- package/src/appShell/systemBarFit.ts +10 -7
- package/src/checkedRow.native-press.spec.tsx +4 -4
- package/src/checkedRow.spec.tsx +2 -2
- package/src/code/CodeBlock/codeBlock.stories.ts +21 -0
- package/src/code/CodeBlock/index.tsx +24 -17
- package/src/code/HoldSelect/holdSelect.spec.tsx +128 -0
- package/src/code/HoldSelect/index.native.tsx +86 -0
- package/src/code/HoldSelect/index.tsx +53 -0
- package/src/code/HoldSelect/tapGate.ts +87 -0
- package/src/code/LogView.follow.spec.tsx +104 -0
- package/src/code/LogView.tsx +29 -4
- package/src/code/index.ts +1 -0
- package/src/componentColors.spec.ts +3 -3
- package/src/componentColors.ts +5 -4
- package/src/elevatedGround.spec.tsx +7 -7
- package/src/layouts/AsyncBoundary.reason.spec.tsx +64 -23
- package/src/layouts/AsyncBoundary.stories.tsx +1 -0
- package/src/layouts/AsyncBoundary.tsx +21 -2
- package/src/layouts/Attachments.stories.tsx +31 -1
- package/src/layouts/ScreenToolbar.stories.tsx +54 -1
- package/src/layouts/Sidebar.spec.tsx +6 -1
- package/src/layouts/asyncFailure.spec.ts +28 -13
- package/src/layouts/asyncFailure.ts +17 -19
- package/src/layouts/attachments.tsx +60 -8
- package/src/layouts/heroBarTitle.native-press.spec.tsx +132 -0
- package/src/layouts/page.tsx +136 -16
- package/src/layouts/screenScroll.tsx +21 -14
- package/src/layouts/tags.tsx +2 -1
- package/src/layouts/toolbarLeadingClip.spec.tsx +120 -0
- package/src/overlayElevation.spec.tsx +1 -1
- package/src/overlayGround.spec.tsx +77 -0
- package/src/views/Dashboard.stories.tsx +21 -0
- package/src/views/Dashboard.tsx +34 -7
- package/src/views/FilePreview.tsx +640 -0
- package/src/views/Kanban.spec.tsx +6 -1
- package/src/views/List.selection.spec.tsx +42 -0
- package/src/views/List.spec.tsx +1 -26
- package/src/views/ListGroup.states.spec.tsx +1 -1
- package/src/views/ListGroup.stories.tsx +119 -2
- package/src/views/ListGroup.tsx +1 -1
- package/src/views/ReportBuilder.spec.tsx +9 -4
- package/src/views/TreeView.spec.tsx +6 -1
- package/src/views/dataIdentity.spec.tsx +5 -0
- package/src/views/filePreview.spec.tsx +282 -0
- package/src/views/index.ts +17 -0
- package/src/views/kpiNotMeasured.spec.tsx +56 -0
- package/types/Chip/index.d.ts.map +1 -1
- package/types/Material/blur.native.d.ts.map +1 -1
- package/types/SheetModal/index.d.ts +6 -1
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +2 -1
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/Tooltip/index.native.d.ts.map +1 -1
- package/types/appShell/AppShell.d.ts +5 -1
- package/types/appShell/AppShell.d.ts.map +1 -1
- package/types/appShell/MpoTabHost.d.ts +6 -0
- package/types/appShell/MpoTabHost.d.ts.map +1 -1
- package/types/appShell/Springboard.d.ts.map +1 -1
- package/types/appShell/SystemBar.d.ts +39 -2
- package/types/appShell/SystemBar.d.ts.map +1 -1
- package/types/appShell/TabHost.native.d.ts +1 -1
- package/types/appShell/TabHost.native.d.ts.map +1 -1
- package/types/appShell/stackBack.d.ts +3 -0
- package/types/appShell/stackBack.d.ts.map +1 -0
- package/types/appShell/systemBarFit.d.ts +1 -0
- package/types/appShell/systemBarFit.d.ts.map +1 -1
- package/types/code/CodeBlock/index.d.ts +3 -1
- package/types/code/CodeBlock/index.d.ts.map +1 -1
- package/types/code/HoldSelect/index.d.ts +16 -0
- package/types/code/HoldSelect/index.d.ts.map +1 -0
- package/types/code/HoldSelect/index.native.d.ts +17 -0
- package/types/code/HoldSelect/index.native.d.ts.map +1 -0
- package/types/code/HoldSelect/tapGate.d.ts +41 -0
- package/types/code/HoldSelect/tapGate.d.ts.map +1 -0
- package/types/code/LogView.d.ts +3 -1
- package/types/code/LogView.d.ts.map +1 -1
- package/types/code/index.d.ts +1 -0
- package/types/code/index.d.ts.map +1 -1
- package/types/componentColors.d.ts +4 -4
- package/types/componentColors.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts +3 -1
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/layouts/asyncFailure.d.ts +4 -1
- package/types/layouts/asyncFailure.d.ts.map +1 -1
- package/types/layouts/attachments.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/screenScroll.d.ts +4 -2
- package/types/layouts/screenScroll.d.ts.map +1 -1
- package/types/layouts/tags.d.ts.map +1 -1
- package/types/views/Dashboard.d.ts +7 -1
- package/types/views/Dashboard.d.ts.map +1 -1
- package/types/views/FilePreview.d.ts +62 -0
- package/types/views/FilePreview.d.ts.map +1 -0
- package/types/views/index.d.ts +1 -0
- package/types/views/index.d.ts.map +1 -1
- package/dist/cjs/hooks/useHoldCue.cjs +0 -52
- package/dist/cjs/hooks/useHoldCue.native.js +0 -60
- package/dist/cjs/hooks/useHoldCue.native.js.map +0 -1
- package/dist/esm/hooks/useHoldCue.mjs +0 -26
- package/dist/esm/hooks/useHoldCue.mjs.map +0 -1
- package/dist/esm/hooks/useHoldCue.native.js +0 -31
- package/dist/esm/hooks/useHoldCue.native.js.map +0 -1
- package/dist/jsx/hooks/useHoldCue.mjs +0 -26
- package/dist/jsx/hooks/useHoldCue.mjs.map +0 -1
- package/dist/jsx/hooks/useHoldCue.native.js +0 -60
- package/dist/jsx/hooks/useHoldCue.native.js.map +0 -1
- package/src/hooks/useHoldCue.ts +0 -23
- package/types/hooks/useHoldCue.d.ts +0 -8
- package/types/hooks/useHoldCue.d.ts.map +0 -1
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MIN_PRESS_TARGET,
|
|
3
|
+
sizeRecipeForToken,
|
|
4
|
+
useBarSurface,
|
|
5
|
+
useResolvedKnobs,
|
|
6
|
+
} from "@multiplatform.one/theme";
|
|
1
7
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
-
import { BatteryHighIcon, WifiHighIcon } from "@phosphor-icons/react";
|
|
8
|
+
import { BatteryHighIcon, HandPalmIcon, WifiHighIcon } from "@phosphor-icons/react";
|
|
3
9
|
import { cleanup, renderHook, screen } from "@testing-library/react";
|
|
4
10
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
import {
|
|
11
|
+
import { SizableText } from "../Text";
|
|
12
|
+
import { SystemBar, SystemBarAction, SystemBarCaption } from "./SystemBar";
|
|
6
13
|
import { useTopInsetStyle } from "./topInset";
|
|
7
14
|
|
|
8
15
|
afterEach(cleanup);
|
|
@@ -27,7 +34,8 @@ describe("SystemBar", () => {
|
|
|
27
34
|
const [start, centre, end] = Array.from(row.children);
|
|
28
35
|
expect(start.textContent).toBe("Acme");
|
|
29
36
|
expect(centre.textContent).toBe("9:41 AM");
|
|
30
|
-
expect(end.getAttribute("data-testid")).toBe("system-bar-
|
|
37
|
+
expect(end.getAttribute("data-testid")).toBe("system-bar-end");
|
|
38
|
+
expect(end.contains(screen.getByTestId("system-bar-status"))).toBe(true);
|
|
31
39
|
});
|
|
32
40
|
|
|
33
41
|
it("paints its own background a step off the page with a hairline bottom rule", () => {
|
|
@@ -56,6 +64,150 @@ describe("SystemBar", () => {
|
|
|
56
64
|
expect(screen.getByTestId("system-bar").hasAttribute("data-safe-area")).toBe(false);
|
|
57
65
|
});
|
|
58
66
|
|
|
67
|
+
it("draws trailing actions after the status glyphs, as given, outside any theme or live region (FZ-8913)", () => {
|
|
68
|
+
renderWithProviders(
|
|
69
|
+
<SystemBar
|
|
70
|
+
status={status}
|
|
71
|
+
actions={<button data-testid="stop">Stop</button>}
|
|
72
|
+
now={new Date(2026, 9, 23, 9, 41)}
|
|
73
|
+
/>,
|
|
74
|
+
);
|
|
75
|
+
const bar = screen.getByTestId("system-bar");
|
|
76
|
+
const end = screen.getByTestId("system-bar-end");
|
|
77
|
+
const stop = screen.getByTestId("stop");
|
|
78
|
+
expect(end.contains(screen.getByTestId("system-bar-status"))).toBe(true);
|
|
79
|
+
expect(end.lastElementChild?.contains(stop)).toBe(true);
|
|
80
|
+
expect(
|
|
81
|
+
screen.getByTestId("system-bar-status").compareDocumentPosition(stop) &
|
|
82
|
+
Node.DOCUMENT_POSITION_FOLLOWING,
|
|
83
|
+
).toBeTruthy();
|
|
84
|
+
for (let el = stop.parentElement; el && el !== bar; el = el.parentElement) {
|
|
85
|
+
expect(el.className).not.toMatch(/(^|\s)t_/);
|
|
86
|
+
expect(el.getAttribute("aria-live")).toBeNull();
|
|
87
|
+
}
|
|
88
|
+
expect(bar.getAttribute("aria-live")).toBeNull();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("drops the centre zone for clock={null}: the start zone takes the free width and the end zone hugs (FZ-8913)", () => {
|
|
92
|
+
renderWithProviders(
|
|
93
|
+
<SystemBar menus={<span>Practice mode</span>} clock={null} actions={<button>Stop</button>} />,
|
|
94
|
+
);
|
|
95
|
+
const row = screen.getByTestId("system-bar").firstElementChild as HTMLElement;
|
|
96
|
+
expect(screen.queryByTestId("system-bar-clock")).toBeNull();
|
|
97
|
+
expect(row.children).toHaveLength(2);
|
|
98
|
+
const [start, end] = Array.from(row.children) as HTMLElement[];
|
|
99
|
+
expect(start.textContent).toBe("Practice mode");
|
|
100
|
+
expect(end.getAttribute("data-testid")).toBe("system-bar-end");
|
|
101
|
+
expect(start.className).toMatch(/(^|\s)_fg-1(\s|$)/);
|
|
102
|
+
expect(end.className).not.toMatch(/(^|\s)_fg-1(\s|$)/);
|
|
103
|
+
expect(end.className).toMatch(/(^|\s)_fs-0(\s|$)/);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("keeps the end zone on the first row's line box when the start zone wraps at 390 (FZ-8913)", () => {
|
|
107
|
+
const line = sizeRecipeForToken("$3", { family: "control" }).height;
|
|
108
|
+
renderWithProviders(
|
|
109
|
+
<SystemBar
|
|
110
|
+
menus={
|
|
111
|
+
<>
|
|
112
|
+
<span>Practice mode</span>
|
|
113
|
+
<span>Updated 4s ago</span>
|
|
114
|
+
<span>Updates delayed</span>
|
|
115
|
+
</>
|
|
116
|
+
}
|
|
117
|
+
clock={null}
|
|
118
|
+
actions={<button>Stop</button>}
|
|
119
|
+
/>,
|
|
120
|
+
);
|
|
121
|
+
const row = screen.getByTestId("system-bar").firstElementChild as HTMLElement;
|
|
122
|
+
const [start, end] = Array.from(row.children) as HTMLElement[];
|
|
123
|
+
expect(row.className).toMatch(/(^|\s)_ai-flex-start(\s|$)/);
|
|
124
|
+
expect(row.className).toMatch(/(^|\s)_pt-[a-z]-space-2(\s|$)/);
|
|
125
|
+
expect(row.className).toMatch(/(^|\s)_pb-[a-z]-space-2(\s|$)/);
|
|
126
|
+
expect(start.className).toMatch(/(^|\s)_fwr-wrap(\s|$)/);
|
|
127
|
+
const strut = start.firstElementChild as HTMLElement;
|
|
128
|
+
expect(strut.getAttribute("data-testid")).toBe("system-bar-line");
|
|
129
|
+
expect(strut.className).toMatch(new RegExp(`(^|\\s)_h-${line}px(\\s|$)`));
|
|
130
|
+
expect(strut.className).toMatch(/(^|\s)_w-0px(\s|$)/);
|
|
131
|
+
for (const zone of [start, end]) {
|
|
132
|
+
expect(zone.className).toMatch(new RegExp(`(^|\\s)_mih-${line}px(\\s|$)`));
|
|
133
|
+
expect(zone.className).toMatch(/(^|\s)_ai-center(\s|$)/);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("draws a trailing action as a round glyph on the bar line, named but never worded (FZ-8913)", () => {
|
|
138
|
+
const line = sizeRecipeForToken("$3", { family: "control" }).height;
|
|
139
|
+
renderWithProviders(
|
|
140
|
+
<SystemBar
|
|
141
|
+
menus={<span>Practice</span>}
|
|
142
|
+
clock={null}
|
|
143
|
+
actions={<SystemBarAction error icon={HandPalmIcon} label="Stop" />}
|
|
144
|
+
/>,
|
|
145
|
+
);
|
|
146
|
+
const stop = screen.getByRole("button", { name: "Stop" });
|
|
147
|
+
expect(stop.textContent).toBe("");
|
|
148
|
+
expect(stop.className).toMatch(new RegExp(`(^|\\s)_h-${line}px(\\s|$)`));
|
|
149
|
+
expect(stop.className).toMatch(new RegExp(`(^|\\s)_w-${line}px(\\s|$)`));
|
|
150
|
+
expect(screen.queryByText("Stop")).toBeNull();
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("restores the 44pt press target with hit slop, since the plate draws at the bar line (FZ-8913)", () => {
|
|
154
|
+
const line = sizeRecipeForToken("$3", { family: "control" }).height;
|
|
155
|
+
const { container } = renderWithProviders(
|
|
156
|
+
<SystemBar
|
|
157
|
+
menus={<span>Practice</span>}
|
|
158
|
+
clock={null}
|
|
159
|
+
actions={<SystemBarAction error icon={HandPalmIcon} label="Stop" />}
|
|
160
|
+
/>,
|
|
161
|
+
);
|
|
162
|
+
const slop = container.querySelector("[data-system-bar-hitslop]");
|
|
163
|
+
expect(slop?.getAttribute("data-system-bar-hitslop")).toBe(
|
|
164
|
+
String(Math.ceil((MIN_PRESS_TARGET - line) / 2)),
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("paints a caption in the LC-152 caption role, never the body ink (FZ-8913)", () => {
|
|
169
|
+
function RoleProbe() {
|
|
170
|
+
const { knobProps } = useResolvedKnobs();
|
|
171
|
+
return (
|
|
172
|
+
<SizableText data-testid="role" {...knobProps.textRole.caption}>
|
|
173
|
+
13s ago
|
|
174
|
+
</SizableText>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
renderWithProviders(
|
|
178
|
+
<SystemBar
|
|
179
|
+
menus={
|
|
180
|
+
<>
|
|
181
|
+
<SystemBarCaption data-testid="caption">13s ago</SystemBarCaption>
|
|
182
|
+
<RoleProbe />
|
|
183
|
+
</>
|
|
184
|
+
}
|
|
185
|
+
clock={null}
|
|
186
|
+
/>,
|
|
187
|
+
);
|
|
188
|
+
const roleClasses = (id: string) =>
|
|
189
|
+
screen.getByTestId(id).className.match(/(^|\s)_(col|fos|fow|lh)-\S+/g);
|
|
190
|
+
expect(roleClasses("caption")).toEqual(roleClasses("role"));
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it("is a bar surface, so an icon-only action there is the bar's tinted glyph (LC-176, FZ-8913)", () => {
|
|
194
|
+
function BarProbe() {
|
|
195
|
+
return <span data-testid="bar-probe" data-bar={String(useBarSurface())} />;
|
|
196
|
+
}
|
|
197
|
+
renderWithProviders(<SystemBar menus={<BarProbe />} clock={null} />);
|
|
198
|
+
expect(screen.getByTestId("bar-probe").getAttribute("data-bar")).toBe("true");
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it("announces nothing when free text in a zone changes (FZ-8913)", () => {
|
|
202
|
+
const { rerender } = renderWithProviders(
|
|
203
|
+
<SystemBar menus={<span>Updated 3s ago</span>} clock={null} />,
|
|
204
|
+
);
|
|
205
|
+
rerender(<SystemBar menus={<span>Updated 4s ago</span>} clock={null} />);
|
|
206
|
+
const bar = screen.getByTestId("system-bar");
|
|
207
|
+
expect(bar.querySelector("[aria-live],[role=status],[role=alert],[role=log]")).toBeNull();
|
|
208
|
+
expect(bar.textContent).toBe("Updated 4s ago");
|
|
209
|
+
});
|
|
210
|
+
|
|
59
211
|
it("shows status as glyphs named for assistive tech, with no narrated status text (LC-104)", () => {
|
|
60
212
|
renderWithProviders(<SystemBar status={status} now={new Date(2026, 9, 23, 9, 41)} />);
|
|
61
213
|
const zone = screen.getByTestId("system-bar-status");
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
-
import { BatteryHighIcon, BellIcon, WifiHighIcon } from "@phosphor-icons/react";
|
|
3
|
-
import { useState } from "react";
|
|
2
|
+
import { BatteryHighIcon, BellIcon, HandPalmIcon, WifiHighIcon } from "@phosphor-icons/react";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
4
|
import { YStack } from "tamagui";
|
|
5
|
+
import { Chip } from "../Chip";
|
|
5
6
|
import { ScopeMenu } from "./ScopeMenu";
|
|
6
|
-
import { SystemBar } from "./SystemBar";
|
|
7
|
+
import { SystemBar, SystemBarAction, SystemBarCaption } from "./SystemBar";
|
|
7
8
|
|
|
8
9
|
const meta: Meta<typeof SystemBar> = {
|
|
9
10
|
title: "Components/SystemBar",
|
|
@@ -77,3 +78,47 @@ export const ClockOnly: Story = {
|
|
|
77
78
|
</YStack>
|
|
78
79
|
),
|
|
79
80
|
};
|
|
81
|
+
|
|
82
|
+
function useSecondsAgo(start: number) {
|
|
83
|
+
const [seconds, setSeconds] = useState(start);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const timer = setInterval(() => setSeconds((value) => value + 1), 1000);
|
|
86
|
+
return () => clearInterval(timer);
|
|
87
|
+
}, []);
|
|
88
|
+
return seconds;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* An app's persistent mode strip on the bar (FZ-8913, LC-286), Pelt's mode
|
|
93
|
+
* banner: the mode is the one chip, each secondary state is its own caption,
|
|
94
|
+
* and Stop is the hand glyph on the round destructive plate, named "Stop" for
|
|
95
|
+
* assistive tech and the tooltip. One row at 390; the ticking age is not a
|
|
96
|
+
* live region.
|
|
97
|
+
*/
|
|
98
|
+
export const ModeStrip: Story = {
|
|
99
|
+
render: function ModeStripStory() {
|
|
100
|
+
const seconds = useSecondsAgo(8);
|
|
101
|
+
return (
|
|
102
|
+
<YStack flex={1} backgroundColor="$background" minHeight="$20">
|
|
103
|
+
<SystemBar
|
|
104
|
+
clock={null}
|
|
105
|
+
menus={
|
|
106
|
+
<>
|
|
107
|
+
<Chip
|
|
108
|
+
size="$3"
|
|
109
|
+
color="green"
|
|
110
|
+
onPress={() => undefined}
|
|
111
|
+
aria-label="Practice. Status details"
|
|
112
|
+
>
|
|
113
|
+
Practice
|
|
114
|
+
</Chip>
|
|
115
|
+
<SystemBarCaption>Delayed</SystemBarCaption>
|
|
116
|
+
<SystemBarCaption>{`${seconds}s ago`}</SystemBarCaption>
|
|
117
|
+
</>
|
|
118
|
+
}
|
|
119
|
+
actions={<SystemBarAction error icon={HandPalmIcon} label="Stop" />}
|
|
120
|
+
/>
|
|
121
|
+
</YStack>
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
};
|
|
@@ -13,17 +13,35 @@ import { IconSlot } from "@multiplatform.one/theme";
|
|
|
13
13
|
* (`flex={1}` with a zero basis), so the clock sits on the true centre
|
|
14
14
|
* without a spread justification (LC-102 HUG-CONTENT). When the menus do
|
|
15
15
|
* not fit beside a centred clock (a phone), the clock gives way and the
|
|
16
|
-
* menus take the width (FZ-9003); on a phone the system shows the time
|
|
16
|
+
* menus take the width (FZ-9003); on a phone the system shows the time.
|
|
17
|
+
* With `clock={null}` there is no centre: the start zone takes the free
|
|
18
|
+
* width and the end zone hugs its glyphs and actions (LC-286). Each zone is at least one
|
|
19
|
+
* control line tall and centres its content on it, and the zones sit at
|
|
20
|
+
* the top of the row, so a start zone that wraps grows downward while the
|
|
21
|
+
* end zone stays on the first row's line box. The start zone wraps its own
|
|
22
|
+
* items and a zero-width strut holds its first line one control line tall (LC-286);
|
|
23
|
+
* - the end zone ends with the app's trailing actions, drawn as given, so
|
|
24
|
+
* a Stop button keeps its own intent; the bar is a bar surface (LC-153),
|
|
25
|
+
* so an icon-only action is its tinted bar glyph (LC-176); nothing in the bar is a live
|
|
26
|
+
* region, so free text that ticks announces nothing (LC-286);
|
|
17
27
|
* - status is SHOWN, never narrated (LC-104): each glyph carries its words
|
|
18
28
|
* as its accessible name and no status sentence is drawn beside it.
|
|
19
29
|
*/
|
|
20
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
Surface,
|
|
32
|
+
hairline,
|
|
33
|
+
pressTargetHitSlop,
|
|
34
|
+
sizeRecipeForToken,
|
|
35
|
+
useResolvedKnobs,
|
|
36
|
+
} from "@multiplatform.one/theme";
|
|
21
37
|
import type { ComponentType, ReactNode } from "react";
|
|
22
|
-
import { useEffect, useState } from "react";
|
|
23
|
-
import { XStack, YStack } from "tamagui";
|
|
38
|
+
import { createElement, useEffect, useState } from "react";
|
|
39
|
+
import { XStack, YStack, getTokenValue, styled } from "tamagui";
|
|
24
40
|
import { useSystemBarFit } from "./systemBarFit";
|
|
25
41
|
import { useTopInsetStyle } from "./topInset";
|
|
26
|
-
import {
|
|
42
|
+
import { Button, type ButtonProps } from "../Button";
|
|
43
|
+
import { SizableText, type SizableTextProps } from "../Text";
|
|
44
|
+
import { Tooltip } from "../Tooltip";
|
|
27
45
|
|
|
28
46
|
export interface SystemBarStatus {
|
|
29
47
|
key: string;
|
|
@@ -38,10 +56,19 @@ export interface SystemBarStatus {
|
|
|
38
56
|
export interface SystemBarProps {
|
|
39
57
|
/** Start zone: bar menus (e.g. ScopeMenus for tenant and environment). */
|
|
40
58
|
menus?: ReactNode;
|
|
41
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Centre zone. Defaults to a live clock (hours and minutes); `null` drops
|
|
61
|
+
* the centre, and the start zone takes the free width.
|
|
62
|
+
*/
|
|
42
63
|
clock?: ReactNode;
|
|
43
64
|
/** End zone: status glyphs, start to end. */
|
|
44
65
|
status?: readonly SystemBarStatus[];
|
|
66
|
+
/**
|
|
67
|
+
* End zone, after the status glyphs: the app's trailing actions (LC-286),
|
|
68
|
+
* drawn as given. An icon-only action is a bare tinted glyph (LC-176); a
|
|
69
|
+
* labelled one such as Stop keeps its own intent.
|
|
70
|
+
*/
|
|
71
|
+
actions?: ReactNode;
|
|
45
72
|
/** Fixed time for the default clock (stories, tests). */
|
|
46
73
|
now?: Date;
|
|
47
74
|
/** Clock locale (default: the runtime's). */
|
|
@@ -79,10 +106,72 @@ export function SystemBarClock({ now, locale }: { now?: Date; locale?: string })
|
|
|
79
106
|
);
|
|
80
107
|
}
|
|
81
108
|
|
|
109
|
+
/**
|
|
110
|
+
* The bar's one control line: the `$3` control height on every surface. A
|
|
111
|
+
* touch surface keeps the visual height and restores the 44pt press target
|
|
112
|
+
* with hit slop, the way UINavigationBar items do (LC-286).
|
|
113
|
+
*/
|
|
114
|
+
export function systemBarLine(): number {
|
|
115
|
+
return sizeRecipeForToken("$3", { family: "control" }).height;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const SystemBarLineStrut = styled(YStack, {
|
|
119
|
+
name: "SystemBarLineStrut",
|
|
120
|
+
width: 0,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* A trailing action on the bar line (LC-286): the glyph alone on a round
|
|
125
|
+
* filled plate at the line height, in the action's own intent (Stop's hand on
|
|
126
|
+
* the destructive plate). `label` names it for assistive tech and the web
|
|
127
|
+
* tooltip; no word is drawn (LC-176, LC-260).
|
|
128
|
+
*/
|
|
129
|
+
export function SystemBarAction({
|
|
130
|
+
label,
|
|
131
|
+
icon,
|
|
132
|
+
...props
|
|
133
|
+
}: Omit<ButtonProps, "size" | "children" | "circular" | "icon"> & {
|
|
134
|
+
label: string;
|
|
135
|
+
icon: ComponentType<{ size?: number; color?: string; weight?: "bold" }>;
|
|
136
|
+
}) {
|
|
137
|
+
const line = systemBarLine();
|
|
138
|
+
const glyph = createElement(icon, { size: Math.round(line * 0.58), weight: "bold" });
|
|
139
|
+
const slop = pressTargetHitSlop(line);
|
|
140
|
+
return (
|
|
141
|
+
<Tooltip content={label}>
|
|
142
|
+
<YStack>
|
|
143
|
+
<Button
|
|
144
|
+
{...props}
|
|
145
|
+
chromeless={false}
|
|
146
|
+
icon={glyph}
|
|
147
|
+
aria-label={label}
|
|
148
|
+
size={line}
|
|
149
|
+
width={line}
|
|
150
|
+
paddingHorizontal={0}
|
|
151
|
+
borderRadius={line / 2}
|
|
152
|
+
hitSlop={slop}
|
|
153
|
+
data-system-bar-hitslop={String(slop.top)}
|
|
154
|
+
/>
|
|
155
|
+
</YStack>
|
|
156
|
+
</Tooltip>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* A secondary state in the bar (delayed, last updated): the LC-152 caption
|
|
162
|
+
* role, so the mode and the action stay the strip's only strong elements.
|
|
163
|
+
* One value per caption; never joined with a middot (LC-261).
|
|
164
|
+
*/
|
|
165
|
+
export function SystemBarCaption(props: SizableTextProps) {
|
|
166
|
+
const { knobProps } = useResolvedKnobs();
|
|
167
|
+
return <SizableText numberOfLines={1} {...knobProps.textRole.caption} {...props} />;
|
|
168
|
+
}
|
|
169
|
+
|
|
82
170
|
export function SystemBar({
|
|
83
171
|
menus,
|
|
84
172
|
clock,
|
|
85
173
|
status = [],
|
|
174
|
+
actions,
|
|
86
175
|
now,
|
|
87
176
|
locale,
|
|
88
177
|
extendIntoSafeArea = true,
|
|
@@ -91,7 +180,10 @@ export function SystemBar({
|
|
|
91
180
|
const { knobProps } = useResolvedKnobs();
|
|
92
181
|
const insetStyle = useTopInsetStyle();
|
|
93
182
|
const iconSize = Number(knobProps.controlIcon?.width) || undefined;
|
|
94
|
-
const
|
|
183
|
+
const hasCentre = clock !== null;
|
|
184
|
+
const { showClock, onRowLayout, onZoneLayout, onMenusLayout, onEndLayout } = useSystemBarFit();
|
|
185
|
+
const centred = hasCentre && showClock;
|
|
186
|
+
const line = systemBarLine();
|
|
95
187
|
return (
|
|
96
188
|
<YStack
|
|
97
189
|
role="banner"
|
|
@@ -104,52 +196,84 @@ export function SystemBar({
|
|
|
104
196
|
data-safe-area={extendIntoSafeArea ? "top" : undefined}
|
|
105
197
|
data-testid={testID}
|
|
106
198
|
>
|
|
107
|
-
<
|
|
108
|
-
minHeight="$3"
|
|
109
|
-
alignItems="center"
|
|
110
|
-
paddingHorizontal="$3"
|
|
111
|
-
gap="$3"
|
|
112
|
-
onLayout={onRowLayout}
|
|
113
|
-
>
|
|
199
|
+
<Surface bar>
|
|
114
200
|
<XStack
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
201
|
+
minHeight="$3"
|
|
202
|
+
alignItems="flex-start"
|
|
203
|
+
paddingHorizontal="$3"
|
|
204
|
+
paddingVertical="$2"
|
|
205
|
+
gap="$3"
|
|
206
|
+
onLayout={hasCentre ? onRowLayout : undefined}
|
|
121
207
|
>
|
|
122
|
-
<XStack
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
208
|
+
<XStack
|
|
209
|
+
flex={1}
|
|
210
|
+
flexBasis={0}
|
|
211
|
+
minWidth={0}
|
|
212
|
+
minHeight={line}
|
|
213
|
+
alignItems="center"
|
|
214
|
+
flexWrap="wrap"
|
|
215
|
+
gap="$2"
|
|
216
|
+
onLayout={centred ? onZoneLayout : undefined}
|
|
217
|
+
data-testid="system-bar-start"
|
|
218
|
+
>
|
|
219
|
+
<SystemBarLineStrut
|
|
220
|
+
height={line}
|
|
221
|
+
marginRight={
|
|
222
|
+
-(Number(getTokenValue("$2" as Parameters<typeof getTokenValue>[0], "space")) || 0)
|
|
223
|
+
}
|
|
224
|
+
aria-hidden
|
|
225
|
+
data-testid="system-bar-line"
|
|
226
|
+
/>
|
|
227
|
+
<XStack
|
|
228
|
+
{...(centred ? { flexShrink: 0 } : { flexShrink: 1, minWidth: 0, flexWrap: "wrap" })}
|
|
229
|
+
alignItems="center"
|
|
230
|
+
gap="$2"
|
|
231
|
+
onLayout={hasCentre ? onMenusLayout : undefined}
|
|
232
|
+
>
|
|
233
|
+
{menus}
|
|
234
|
+
</XStack>
|
|
129
235
|
</XStack>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
236
|
+
{centred ? (
|
|
237
|
+
<XStack
|
|
238
|
+
flexShrink={0}
|
|
239
|
+
minHeight={line}
|
|
240
|
+
alignItems="center"
|
|
241
|
+
data-testid="system-bar-centre"
|
|
242
|
+
>
|
|
243
|
+
{clock === undefined ? <SystemBarClock now={now} locale={locale} /> : clock}
|
|
244
|
+
</XStack>
|
|
245
|
+
) : null}
|
|
246
|
+
<XStack
|
|
247
|
+
{...(centred ? { flex: 1, flexBasis: 0, minWidth: 0 } : { flexShrink: 0 })}
|
|
248
|
+
minHeight={line}
|
|
249
|
+
alignItems="center"
|
|
250
|
+
justifyContent="flex-end"
|
|
251
|
+
data-testid="system-bar-end"
|
|
252
|
+
>
|
|
253
|
+
<XStack
|
|
254
|
+
flexShrink={0}
|
|
255
|
+
alignItems="center"
|
|
256
|
+
gap="$2"
|
|
257
|
+
onLayout={hasCentre ? onEndLayout : undefined}
|
|
147
258
|
>
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
259
|
+
<XStack alignItems="center" gap="$2" data-testid="system-bar-status">
|
|
260
|
+
{status.map(({ key, icon: Icon, label, onPress }) => (
|
|
261
|
+
<YStack
|
|
262
|
+
key={key}
|
|
263
|
+
role={onPress ? "button" : "img"}
|
|
264
|
+
aria-label={label}
|
|
265
|
+
{...(onPress ? { onPress, cursor: "pointer", tabIndex: 0 } : {})}
|
|
266
|
+
data-testid={`system-bar-status-${key}`}
|
|
267
|
+
>
|
|
268
|
+
<IconSlot icon={Icon} size={iconSize} />
|
|
269
|
+
</YStack>
|
|
270
|
+
))}
|
|
271
|
+
</XStack>
|
|
272
|
+
{actions}
|
|
273
|
+
</XStack>
|
|
274
|
+
</XStack>
|
|
151
275
|
</XStack>
|
|
152
|
-
</
|
|
276
|
+
</Surface>
|
|
153
277
|
</YStack>
|
|
154
278
|
);
|
|
155
279
|
}
|
|
@@ -199,6 +199,7 @@ export function NativeTabHost({
|
|
|
199
199
|
tabs,
|
|
200
200
|
items,
|
|
201
201
|
activeKey,
|
|
202
|
+
hostKey,
|
|
202
203
|
onTabPress,
|
|
203
204
|
children,
|
|
204
205
|
hostsAccessory = false,
|
|
@@ -210,8 +211,9 @@ export function NativeTabHost({
|
|
|
210
211
|
const indicator = useAccentTintedSurface();
|
|
211
212
|
const deviceInset = useBottomInset();
|
|
212
213
|
const [id] = useState(() => Symbol("native-tab-host"));
|
|
213
|
-
const lastKey = useRef(activeKey ?? items[0]?.key);
|
|
214
|
-
|
|
214
|
+
const lastKey = useRef(activeKey ?? hostKey ?? items[0]?.key);
|
|
215
|
+
const holdingKey = activeKey ?? hostKey;
|
|
216
|
+
if (holdingKey) lastKey.current = holdingKey;
|
|
215
217
|
const focusedKey = lastKey.current;
|
|
216
218
|
const hosting = hostsAccessory && Boolean(activeKey);
|
|
217
219
|
const pageAccessory = useBottomAccessory();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export function nextShellStack(
|
|
4
|
+
stack: readonly string[],
|
|
5
|
+
path: string,
|
|
6
|
+
atRoot: boolean,
|
|
7
|
+
): readonly string[] {
|
|
8
|
+
if (atRoot) return [path];
|
|
9
|
+
const index = stack.indexOf(path);
|
|
10
|
+
if (index !== -1) return stack.slice(0, index + 1);
|
|
11
|
+
return [...stack, path];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function useShellStackBack(
|
|
15
|
+
path: string,
|
|
16
|
+
atRoot: boolean,
|
|
17
|
+
title: string | null,
|
|
18
|
+
): string | null {
|
|
19
|
+
const [stack, setStack] = useState<readonly string[]>(() => [path]);
|
|
20
|
+
const titles = useRef(new Map<string, string>());
|
|
21
|
+
let current = stack;
|
|
22
|
+
if (stack[stack.length - 1] !== path) {
|
|
23
|
+
current = nextShellStack(stack, path, atRoot);
|
|
24
|
+
setStack(current);
|
|
25
|
+
}
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (title) titles.current.set(path, title);
|
|
28
|
+
}, [path, title]);
|
|
29
|
+
const previous = current[current.length - 2];
|
|
30
|
+
return previous === undefined ? null : (titles.current.get(previous) ?? null);
|
|
31
|
+
}
|
|
@@ -6,6 +6,7 @@ interface Widths {
|
|
|
6
6
|
row?: number;
|
|
7
7
|
zone?: number;
|
|
8
8
|
menus?: number;
|
|
9
|
+
end?: number;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -20,18 +21,16 @@ interface Widths {
|
|
|
20
21
|
*/
|
|
21
22
|
export function useSystemBarFit() {
|
|
22
23
|
const [widths, setWidths] = useState<Widths>({});
|
|
23
|
-
const
|
|
24
|
-
widths.zone !== undefined &&
|
|
25
|
-
|
|
26
|
-
widths.menus > widths.zone + 0.5
|
|
27
|
-
);
|
|
24
|
+
const outruns = (width?: number) =>
|
|
25
|
+
widths.zone !== undefined && width !== undefined && width > widths.zone + 0.5;
|
|
26
|
+
const showClock = !(outruns(widths.menus) || outruns(widths.end));
|
|
28
27
|
const onRowLayout = useCallback(
|
|
29
28
|
(event: LayoutEvent) => {
|
|
30
29
|
const row = event.nativeEvent.layout.width;
|
|
31
30
|
setWidths((prev) => {
|
|
32
31
|
if (prev.row === row) return prev;
|
|
33
32
|
if (showClock || prev.row === undefined) return { ...prev, row };
|
|
34
|
-
return { menus: prev.menus, row };
|
|
33
|
+
return { menus: prev.menus, end: prev.end, row };
|
|
35
34
|
});
|
|
36
35
|
},
|
|
37
36
|
[showClock],
|
|
@@ -48,5 +47,9 @@ export function useSystemBarFit() {
|
|
|
48
47
|
const menus = event.nativeEvent.layout.width;
|
|
49
48
|
setWidths((prev) => (prev.menus === menus ? prev : { ...prev, menus }));
|
|
50
49
|
}, []);
|
|
51
|
-
|
|
50
|
+
const onEndLayout = useCallback((event: LayoutEvent) => {
|
|
51
|
+
const end = event.nativeEvent.layout.width;
|
|
52
|
+
setWidths((prev) => (prev.end === end ? prev : { ...prev, end }));
|
|
53
|
+
}, []);
|
|
54
|
+
return { showClock, onRowLayout, onZoneLayout, onMenusLayout, onEndLayout };
|
|
52
55
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* React Native animation driver every MPO app runs on a phone.
|
|
4
4
|
*
|
|
5
5
|
* A checked menu row paints the theme's selection tint on native (LC-262):
|
|
6
|
-
* `$
|
|
6
|
+
* `$color6` over the dark `$color5` overlay, `$color3` over the light panel.
|
|
7
7
|
* On iOS the appearance menu's checked "Dark" row painted the page colour, a
|
|
8
8
|
* hole through the panel that hid its rounded bottom (FZ-8550 KS sim, main
|
|
9
9
|
* before this lane, when dark rested on `$color2`).
|
|
@@ -24,7 +24,7 @@ vi.mock("@multiplatform.one/theme", async (original) => ({
|
|
|
24
24
|
|
|
25
25
|
// The harness resolves forms web-first, and the web panel portals out of the
|
|
26
26
|
// menu's context under tamagui's native build. The phone's panel is a Modal
|
|
27
|
-
// over the `$
|
|
27
|
+
// over the `$color5` overlay surface; this stands in for it inline.
|
|
28
28
|
vi.mock("@multiplatform.one/forms", async (original) => ({
|
|
29
29
|
...(await original<typeof import("@multiplatform.one/forms")>()),
|
|
30
30
|
FloatingPanel: ({
|
|
@@ -38,7 +38,7 @@ vi.mock("@multiplatform.one/forms", async (original) => ({
|
|
|
38
38
|
}) => (
|
|
39
39
|
<>
|
|
40
40
|
{trigger}
|
|
41
|
-
{open ? <YStack backgroundColor="$
|
|
41
|
+
{open ? <YStack backgroundColor="$color5">{children}</YStack> : null}
|
|
42
42
|
</>
|
|
43
43
|
),
|
|
44
44
|
}));
|
|
@@ -99,7 +99,7 @@ function fillUnder(label: string): string {
|
|
|
99
99
|
throw new Error(`nothing painted under ${label}`);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
const tint = { light: "color3", dark: "
|
|
102
|
+
const tint = { light: "color3", dark: "color6" } as const;
|
|
103
103
|
|
|
104
104
|
describe("a checked menu row paints the selection tint on native (LC-262, FZ-8557)", () => {
|
|
105
105
|
it("runs on tamagui's native build", () => {
|
package/src/checkedRow.spec.tsx
CHANGED
|
@@ -22,8 +22,8 @@ function restFills(el: Element) {
|
|
|
22
22
|
.filter((c) => /^_bg-(?!0)/.test(c));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/** A tint one step off the panel: light $color3 on white, dark $
|
|
26
|
-
const checkedFill = { light: "color3", dark: "
|
|
25
|
+
/** A tint one step off the panel: light $color3 on white, dark $color6 over the $color5 overlay (FZ-8557, FZ-8400). */
|
|
26
|
+
const checkedFill = { light: "color3", dark: "color6" } as const;
|
|
27
27
|
|
|
28
28
|
/** A checked row rests on its scheme's checked fill, and only on it. */
|
|
29
29
|
function expectTint(el: Element | null | undefined, scheme: (typeof schemes)[number]) {
|