@multiplatform.one/components 7.70.0 → 7.72.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/Accordion/index.native.js +1 -1
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/AnimateHeight/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Badge/index.native.js.map +1 -1
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/CardFooter.native.js.map +1 -1
- package/dist/cjs/CardHeader.native.js.map +1 -1
- package/dist/cjs/Carousel/index.native.js +3 -3
- package/dist/cjs/Carousel/index.native.js.map +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/Collapsible.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/DotIndicator/index.cjs +21 -11
- package/dist/cjs/DotIndicator/index.native.js +21 -11
- package/dist/cjs/DotIndicator/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.cjs +4 -1
- package/dist/cjs/DropdownMenu/index.native.js +4 -1
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/cjs/ErrorBoundary/index.native.js.map +1 -1
- package/dist/cjs/Heading.native.js.map +1 -1
- package/dist/cjs/Kbd/index.native.js.map +1 -1
- package/dist/cjs/Kbd/keys.native.js.map +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.native.js +1 -1
- package/dist/cjs/Lightbox/shared.native.js.map +1 -1
- package/dist/cjs/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/cjs/Material/index.native.js.map +1 -1
- package/dist/cjs/Meter/index.native.js +1 -1
- package/dist/cjs/Meter/index.native.js.map +1 -1
- package/dist/cjs/Meter/meter.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.native.js +1 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +11 -4
- package/dist/cjs/Pagination.native.js +12 -5
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Popover.cjs +5 -1
- package/dist/cjs/Popover.native.js +5 -1
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/ProgressSteps/index.native.js.map +1 -1
- package/dist/cjs/Quote/index.native.js.map +1 -1
- package/dist/cjs/SchemeToggle/index.native.js +1 -1
- package/dist/cjs/SchemeToggle/index.native.js.map +1 -1
- package/dist/cjs/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/cjs/Separator/index.native.js.map +1 -1
- package/dist/cjs/Sheet.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/cjs/SheetModal/detents.native.js.map +1 -1
- package/dist/cjs/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/cjs/Skeleton/index.native.js.map +1 -1
- package/dist/cjs/SkipLink/index.native.js.map +1 -1
- package/dist/cjs/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/cjs/SortableList/index.native.js.map +1 -1
- package/dist/cjs/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/cjs/Tabs/index.native.js +1 -1
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.native.js.map +1 -1
- package/dist/cjs/ThemePresetPicker/index.native.js +2 -2
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/Toast/index.native.js.map +1 -1
- package/dist/cjs/Toast/store.native.js.map +1 -1
- package/dist/cjs/Tooltip/nativePress.native.js.map +1 -1
- package/dist/cjs/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/cjs/TreeSelect/index.cjs +1 -0
- package/dist/cjs/TreeSelect/index.native.js +2 -1
- package/dist/cjs/TreeSelect/index.native.js.map +1 -1
- package/dist/cjs/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/cjs/Video/PlayerChrome.native.js.map +1 -1
- package/dist/cjs/Video/VideoFrame.native.js.map +1 -1
- package/dist/cjs/Video/types.native.js.map +1 -1
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/Wizard/index.native.js +2 -2
- package/dist/cjs/Wizard/index.native.js.map +1 -1
- package/dist/cjs/actions/ActionBar.native.js.map +1 -1
- package/dist/cjs/actions/DangerSection.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.native.js.map +1 -1
- package/dist/cjs/actions/HeaderActions.native.js +2 -2
- package/dist/cjs/actions/HeaderActions.native.js.map +1 -1
- package/dist/cjs/actions/StandardAction.native.js +1 -1
- package/dist/cjs/actions/StandardAction.native.js.map +1 -1
- package/dist/cjs/actions/devWarn.native.js.map +1 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/actions/severity.native.js.map +1 -1
- package/dist/cjs/appShell/Dock.native.js.map +1 -1
- package/dist/cjs/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/cjs/appShell/ScopeMenu.cjs +13 -6
- package/dist/cjs/appShell/ScopeMenu.native.js +19 -6
- package/dist/cjs/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/cjs/appShell/Springboard.native.js +1 -1
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabBar.native.js +1 -1
- package/dist/cjs/appShell/TabBar.native.js.map +1 -1
- package/dist/cjs/appShell/appTile.native.js +1 -1
- package/dist/cjs/appShell/appTile.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- package/dist/cjs/appShell/index.cjs +1 -3
- package/dist/cjs/appShell/index.native.js +0 -2
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.native.js +1 -1
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/charts/ChartSurface.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/PieChart.native.js.map +1 -1
- package/dist/cjs/charts/Sparkline.native.js.map +1 -1
- package/dist/cjs/charts/accessibility.native.js.map +1 -1
- package/dist/cjs/charts/chartHeight.native.js.map +1 -1
- package/dist/cjs/charts/composeChart.native.js.map +1 -1
- package/dist/cjs/charts/index.native.js.map +1 -1
- package/dist/cjs/charts/math.native.js.map +1 -1
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/charts/svg.native.js.map +1 -1
- package/dist/cjs/charts/types.native.js.map +1 -1
- package/dist/cjs/charts/useChartTheme.native.js.map +1 -1
- package/dist/cjs/code/Code/index.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.native.js +7 -7
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/cjs/code/Pre/index.native.js.map +1 -1
- package/dist/cjs/code/index.native.js +5 -5
- package/dist/cjs/code/index.native.js.map +1 -1
- package/dist/cjs/componentColors.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/NotifyHost.native.js +2 -2
- package/dist/cjs/feedback/NotifyHost.native.js.map +1 -1
- package/dist/cjs/feedback/copy.native.js.map +1 -1
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/feedback/notify.native.js.map +1 -1
- package/dist/cjs/feedback/route.native.js.map +1 -1
- package/dist/cjs/feedback/store.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/cjs/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/cjs/formLayouts/index.native.js.map +1 -1
- package/dist/cjs/hooks/index.native.js +1 -1
- package/dist/cjs/hooks/index.native.js.map +1 -1
- package/dist/cjs/hooks/useClipboard.native.js.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/cjs/hooks/useHoldCue.native.js.map +1 -1
- package/dist/cjs/icons/CheckRegular.native.js.map +1 -1
- package/dist/cjs/icons/MinusRegular.native.js.map +1 -1
- package/dist/cjs/icons/index.native.js.map +1 -1
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.native.js.map +1 -1
- package/dist/cjs/images/Image/index.native.js +1 -1
- package/dist/cjs/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/cjs/images/Image/shared.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/images/Image/types.native.js.map +1 -1
- package/dist/cjs/images/index.native.js.map +1 -1
- package/dist/cjs/index.native.js +36 -36
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +2 -2
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/Debug/index.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/cjs/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/cjs/layouts/StatusDot.native.js.map +1 -1
- package/dist/cjs/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.native.js +1 -1
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/bottomAccessory.cjs +173 -0
- package/dist/cjs/layouts/bottomAccessory.native.js +225 -0
- package/dist/cjs/layouts/bottomAccessory.native.js.map +1 -0
- package/dist/cjs/{appShell/BottomAccessory.cjs → layouts/bottomSafeArea.cjs} +12 -14
- package/dist/cjs/layouts/bottomSafeArea.native.js +75 -0
- package/dist/cjs/layouts/bottomSafeArea.native.js.map +1 -0
- package/dist/cjs/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/cjs/layouts/index.cjs +2 -0
- package/dist/cjs/layouts/index.native.js +5 -3
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +16 -5
- package/dist/cjs/layouts/page.native.js +18 -7
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.cjs +44 -0
- package/dist/cjs/layouts/screenScroll.native.js +52 -0
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/cjs/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.native.js +1 -1
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.native.js +2 -2
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.native.js +2 -2
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.native.js +1 -1
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/shared/actionScan.native.js.map +1 -1
- package/dist/cjs/shared/i18n.native.js.map +1 -1
- package/dist/cjs/shared/restoreRetries.native.js.map +1 -1
- package/dist/cjs/shared/t.native.js.map +1 -1
- package/dist/cjs/shared/textRidesText.native.js.map +1 -1
- package/dist/cjs/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/tamagui.native.js +1 -1
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/cjs/testSetup.native.js.map +1 -1
- package/dist/cjs/utils/setTinted.native.js.map +1 -1
- package/dist/cjs/utils/unwrapText.native.js.map +1 -1
- package/dist/cjs/views/Calendar.native.js +1 -1
- package/dist/cjs/views/Calendar.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.native.js +2 -2
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/Gantt.native.js +2 -2
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/GanttDateGrip.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.native.js +2 -2
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/Kanban.native.js +1 -1
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ListRow.native.js.map +1 -1
- package/dist/cjs/views/Matrix.native.js +2 -2
- package/dist/cjs/views/Matrix.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +2 -2
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -1
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/calendarMath.native.js.map +1 -1
- package/dist/cjs/views/ganttIntervals.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.native.js +1 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/kanbanDnd.native.js.map +1 -1
- package/dist/cjs/views/matrixMath.native.js.map +1 -1
- package/dist/cjs/views/treeViewDnd.native.js.map +1 -1
- package/dist/cjs/views/treeViewLayout.native.js.map +1 -1
- package/dist/cjs/views/treeViewMotion.native.js.map +1 -1
- package/dist/cjs/views/treeViewReveal.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.mjs +21 -11
- package/dist/esm/DotIndicator/index.mjs.map +1 -1
- package/dist/esm/DotIndicator/index.native.js +21 -11
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +4 -1
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +4 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/Pagination.mjs +11 -4
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +11 -4
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.mjs +5 -1
- package/dist/esm/Popover.mjs.map +1 -1
- package/dist/esm/Popover.native.js +5 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.mjs +1 -0
- package/dist/esm/TreeSelect/index.mjs.map +1 -1
- package/dist/esm/TreeSelect/index.native.js +1 -0
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.mjs +13 -6
- package/dist/esm/appShell/ScopeMenu.mjs.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js +19 -6
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/index.mjs +1 -2
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +1 -2
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/layouts/bottomAccessory.mjs +144 -0
- package/dist/esm/layouts/bottomAccessory.mjs.map +1 -0
- package/dist/esm/layouts/bottomAccessory.native.js +193 -0
- package/dist/esm/layouts/bottomAccessory.native.js.map +1 -0
- package/dist/esm/layouts/bottomSafeArea.mjs +16 -0
- package/dist/esm/layouts/bottomSafeArea.mjs.map +1 -0
- package/dist/esm/layouts/bottomSafeArea.native.js +47 -0
- package/dist/esm/layouts/bottomSafeArea.native.js.map +1 -0
- package/dist/esm/layouts/index.mjs +2 -0
- package/dist/esm/layouts/index.mjs.map +1 -1
- package/dist/esm/layouts/index.native.js +2 -0
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +16 -5
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +16 -5
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.mjs +43 -1
- package/dist/esm/layouts/screenScroll.mjs.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js +51 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/DotIndicator/index.mjs +21 -11
- package/dist/jsx/DotIndicator/index.mjs.map +1 -1
- package/dist/jsx/DotIndicator/index.native.js +21 -11
- package/dist/jsx/DotIndicator/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +4 -1
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +4 -1
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +11 -4
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +11 -4
- package/dist/jsx/Pagination.native.js.map +1 -1
- package/dist/jsx/Popover.mjs +5 -1
- package/dist/jsx/Popover.mjs.map +1 -1
- package/dist/jsx/Popover.native.js +5 -1
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/TreeSelect/index.mjs +1 -0
- package/dist/jsx/TreeSelect/index.mjs.map +1 -1
- package/dist/jsx/TreeSelect/index.native.js +1 -0
- package/dist/jsx/TreeSelect/index.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.mjs +13 -6
- package/dist/jsx/appShell/ScopeMenu.mjs.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js +19 -6
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +1 -2
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +0 -2
- package/dist/jsx/appShell/index.native.js.map +1 -1
- package/dist/jsx/layouts/bottomAccessory.mjs +144 -0
- package/dist/jsx/layouts/bottomAccessory.mjs.map +1 -0
- package/dist/jsx/layouts/bottomAccessory.native.js +225 -0
- package/dist/jsx/layouts/bottomAccessory.native.js.map +1 -0
- package/dist/jsx/layouts/bottomSafeArea.mjs +16 -0
- package/dist/jsx/layouts/bottomSafeArea.mjs.map +1 -0
- package/dist/jsx/layouts/bottomSafeArea.native.js +75 -0
- package/dist/jsx/layouts/bottomSafeArea.native.js.map +1 -0
- package/dist/jsx/layouts/index.mjs +2 -0
- package/dist/jsx/layouts/index.mjs.map +1 -1
- package/dist/jsx/layouts/index.native.js +2 -0
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +16 -5
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +16 -5
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.mjs +43 -1
- package/dist/jsx/layouts/screenScroll.mjs.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js +52 -0
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/package.json +9 -9
- package/src/DotIndicator/index.tsx +52 -12
- package/src/DotIndicator/pageControl.spec.tsx +105 -0
- package/src/DropdownMenu/DropdownMenu.avatarTrigger.spec.tsx +1 -1
- package/src/DropdownMenu/DropdownMenu.stories.tsx +3 -1
- package/src/DropdownMenu/index.tsx +16 -5
- package/src/Pagination.stories.tsx +23 -0
- package/src/Pagination.tsx +16 -4
- package/src/Popover.tsx +23 -3
- package/src/SheetModal/SheetModal.menus.spec.tsx +78 -0
- package/src/TreeSelect/index.tsx +1 -0
- package/src/appShell/ScopeMenu.spec.tsx +7 -0
- package/src/appShell/ScopeMenu.tsx +15 -3
- package/src/appShell/TabBar.spec.tsx +1 -1
- package/src/appShell/index.ts +0 -1
- package/src/layouts/bottomAccessory.spec.tsx +147 -0
- package/src/layouts/bottomAccessory.tsx +206 -0
- package/src/layouts/bottomSafeArea.native.tsx +43 -0
- package/src/layouts/bottomSafeArea.tsx +13 -0
- package/src/layouts/index.tsx +2 -0
- package/src/layouts/page.tsx +31 -12
- package/src/layouts/revealTop.spec.tsx +77 -0
- package/src/layouts/screenScroll.tsx +67 -1
- package/types/DotIndicator/index.d.ts +18 -4
- package/types/DotIndicator/index.d.ts.map +1 -1
- package/types/DropdownMenu/index.d.ts +9 -1
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/Pagination.d.ts +7 -1
- package/types/Pagination.d.ts.map +1 -1
- package/types/Popover.d.ts +11 -0
- package/types/Popover.d.ts.map +1 -1
- package/types/TreeSelect/index.d.ts.map +1 -1
- package/types/appShell/ScopeMenu.d.ts +22 -1
- package/types/appShell/ScopeMenu.d.ts.map +1 -1
- package/types/appShell/index.d.ts +0 -1
- package/types/appShell/index.d.ts.map +1 -1
- package/types/layouts/bottomAccessory.d.ts +54 -0
- package/types/layouts/bottomAccessory.d.ts.map +1 -0
- package/types/layouts/bottomSafeArea.d.ts +6 -0
- package/types/layouts/bottomSafeArea.d.ts.map +1 -0
- package/types/layouts/bottomSafeArea.native.d.ts +15 -0
- package/types/layouts/bottomSafeArea.native.d.ts.map +1 -0
- package/types/layouts/index.d.ts +2 -0
- package/types/layouts/index.d.ts.map +1 -1
- package/types/layouts/page.d.ts +8 -0
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/screenScroll.d.ts +24 -0
- package/types/layouts/screenScroll.d.ts.map +1 -1
- package/dist/cjs/appShell/BottomAccessory.native.js +0 -53
- package/dist/cjs/appShell/BottomAccessory.native.js.map +0 -1
- package/dist/esm/appShell/BottomAccessory.mjs +0 -18
- package/dist/esm/appShell/BottomAccessory.mjs.map +0 -1
- package/dist/esm/appShell/BottomAccessory.native.js +0 -25
- package/dist/esm/appShell/BottomAccessory.native.js.map +0 -1
- package/dist/jsx/appShell/BottomAccessory.mjs +0 -18
- package/dist/jsx/appShell/BottomAccessory.mjs.map +0 -1
- package/dist/jsx/appShell/BottomAccessory.native.js +0 -53
- package/dist/jsx/appShell/BottomAccessory.native.js.map +0 -1
- package/src/appShell/BottomAccessory.tsx +0 -18
- package/types/appShell/BottomAccessory.d.ts +0 -11
- package/types/appShell/BottomAccessory.d.ts.map +0 -1
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Narrow viewports and native get FloatingPanel's sheet (phones take
|
|
17
17
|
* sheets); the first-row contract holds there too.
|
|
18
18
|
*/
|
|
19
|
-
import { FloatingPanel } from "@multiplatform.one/forms";
|
|
19
|
+
import { FloatingPanel, type PanelWidth } from "@multiplatform.one/forms";
|
|
20
20
|
import { useMenuRowCheckInk, menuRowChecked, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
21
21
|
import { CaretDownIcon, CaretUpIcon, CheckIcon } from "@phosphor-icons/react";
|
|
22
22
|
import { useState } from "react";
|
|
@@ -37,6 +37,8 @@ export interface ScopeMenuProps {
|
|
|
37
37
|
/** Controlled open state (optional). */
|
|
38
38
|
open?: boolean;
|
|
39
39
|
onOpenChange?: (open: boolean) => void;
|
|
40
|
+
/** How wide the menu opens (LC-112): default `"content"`, at least the trigger. */
|
|
41
|
+
panelWidth?: PanelWidth;
|
|
40
42
|
testID?: string;
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -73,12 +75,20 @@ function ScopeRow({
|
|
|
73
75
|
paddingHorizontal="$2.5"
|
|
74
76
|
cursor="pointer"
|
|
75
77
|
onPress={onPress}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
// The echo row is the trigger itself, laid on the panel (LC-112): the
|
|
79
|
+
// pointer that opened the menu rests on it, and a wash there split the
|
|
80
|
+
// panel into two tones (FZ-8438 r3).
|
|
81
|
+
{...(chevron === "up"
|
|
82
|
+
? undefined
|
|
83
|
+
: { hoverStyle: { ...control.hoverKnobProps }, pressStyle: { ...control.pressKnobProps } })}
|
|
78
84
|
focusVisibleStyle={{ ...control.focusVisibleKnobProps }}
|
|
79
85
|
{...(checked ? menuRowChecked(knobProps.scheme) : undefined)}
|
|
80
86
|
data-testid={testID}
|
|
81
87
|
data-chevron={chevron}
|
|
88
|
+
// LC-112 seamless cover (FZ-8438): the bar trigger's hover wash has the
|
|
89
|
+
// theme's control arc, so the menu that covers it measures a rounded box
|
|
90
|
+
// instead of a square one. Rows inside the menu stay square.
|
|
91
|
+
{...(chevron === "down" ? { borderRadius: knobProps.borderRadius.borderRadius } : undefined)}
|
|
82
92
|
>
|
|
83
93
|
{role === "menuitemradio" ? (
|
|
84
94
|
<YStack width={iconSize} alignItems="center" aria-hidden>
|
|
@@ -100,6 +110,7 @@ export function ScopeMenu({
|
|
|
100
110
|
onChange,
|
|
101
111
|
open: openProp,
|
|
102
112
|
onOpenChange,
|
|
113
|
+
panelWidth,
|
|
103
114
|
testID = "scope-menu",
|
|
104
115
|
}: ScopeMenuProps) {
|
|
105
116
|
const [openState, setOpenState] = useState(false);
|
|
@@ -117,6 +128,7 @@ export function ScopeMenu({
|
|
|
117
128
|
onOpenChange={setOpen}
|
|
118
129
|
cover
|
|
119
130
|
widthMode="at-least-trigger"
|
|
131
|
+
panelWidth={panelWidth}
|
|
120
132
|
contentPadding="none"
|
|
121
133
|
triggerSizing="content"
|
|
122
134
|
triggerEcho={false}
|
|
@@ -19,7 +19,7 @@ import path from "node:path";
|
|
|
19
19
|
import type { ReactElement } from "react";
|
|
20
20
|
import { Theme } from "tamagui";
|
|
21
21
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
22
|
-
import { BottomAccessory } from "
|
|
22
|
+
import { BottomAccessory } from "../layouts/bottomAccessory";
|
|
23
23
|
import { useBottomChromeInset } from "./bottomChrome";
|
|
24
24
|
import {
|
|
25
25
|
TabBar,
|
package/src/appShell/index.ts
CHANGED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-174 BOTTOM-ACCESSORY. Clay on the phone DataTable pager (FZ-7889 round
|
|
3
|
+
* 4): "Shouldn't the arrows and stuff the navigation thing be at the bottom of
|
|
4
|
+
* the screen". A Screen hosts one bottom-accessory slot; a control handed to
|
|
5
|
+
* `<BottomAccessory>` renders there, outside the page's content column, and
|
|
6
|
+
* without a slot it renders in place.
|
|
7
|
+
*/
|
|
8
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { act, cleanup } from "@testing-library/react";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
12
|
+
import { BottomAccessory, createBottomAccessoryStore } from "./bottomAccessory";
|
|
13
|
+
import { Screen } from "./page";
|
|
14
|
+
|
|
15
|
+
afterEach(cleanup);
|
|
16
|
+
|
|
17
|
+
describe("Screen's bottom-accessory slot (LC-174)", () => {
|
|
18
|
+
it("draws nothing until a control registers", () => {
|
|
19
|
+
const { container } = renderWithProviders(
|
|
20
|
+
<Screen>
|
|
21
|
+
<span>content</span>
|
|
22
|
+
</Screen>,
|
|
23
|
+
);
|
|
24
|
+
expect(container.querySelector("[data-bottom-accessory]")).toBeNull();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("renders a registered control in the slot, outside the content column", () => {
|
|
28
|
+
const { container } = renderWithProviders(
|
|
29
|
+
<Screen>
|
|
30
|
+
<span>content</span>
|
|
31
|
+
<BottomAccessory>
|
|
32
|
+
<button type="button">Next</button>
|
|
33
|
+
</BottomAccessory>
|
|
34
|
+
</Screen>,
|
|
35
|
+
);
|
|
36
|
+
const slot = container.querySelector("[data-bottom-accessory='slot']");
|
|
37
|
+
expect(slot?.querySelector("button")?.textContent).toBe("Next");
|
|
38
|
+
const column = container.querySelector("[data-testid='screen']");
|
|
39
|
+
expect(column?.querySelector("button")).toBeNull();
|
|
40
|
+
expect(column?.contains(slot!)).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("closes the page column after the scroll view, sticky at the bottom (web)", () => {
|
|
44
|
+
const { container } = renderWithProviders(
|
|
45
|
+
<Screen>
|
|
46
|
+
<span>content</span>
|
|
47
|
+
<BottomAccessory>
|
|
48
|
+
<span>pager</span>
|
|
49
|
+
</BottomAccessory>
|
|
50
|
+
</Screen>,
|
|
51
|
+
);
|
|
52
|
+
const slot = container.querySelector<HTMLElement>("[data-bottom-accessory='slot']")!;
|
|
53
|
+
const column = container.querySelector("[data-testid='screen']")!;
|
|
54
|
+
// The scroll view ends above the bar, so the last row stays visible.
|
|
55
|
+
const scroller = slot.previousElementSibling!;
|
|
56
|
+
expect(scroller.contains(column)).toBe(true);
|
|
57
|
+
expect(scroller.contains(slot)).toBe(false);
|
|
58
|
+
expect(slot.parentElement!.lastElementChild).toBe(slot);
|
|
59
|
+
expect(slot.style.position).toBe("sticky");
|
|
60
|
+
expect(slot.style.bottom).toBe("0px");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("leaves the slot when the control unmounts", () => {
|
|
64
|
+
function Toggle() {
|
|
65
|
+
const [on, setOn] = useState(true);
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<button type="button" onClick={() => setOn(false)}>
|
|
69
|
+
hide
|
|
70
|
+
</button>
|
|
71
|
+
{on ? (
|
|
72
|
+
<BottomAccessory>
|
|
73
|
+
<span>pager</span>
|
|
74
|
+
</BottomAccessory>
|
|
75
|
+
) : null}
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const { container, getByText } = renderWithProviders(
|
|
80
|
+
<Screen>
|
|
81
|
+
<Toggle />
|
|
82
|
+
</Screen>,
|
|
83
|
+
);
|
|
84
|
+
expect(container.querySelector("[data-bottom-accessory='slot']")).not.toBeNull();
|
|
85
|
+
act(() => getByText("hide").click());
|
|
86
|
+
expect(container.querySelector("[data-bottom-accessory]")).toBeNull();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("follows the control's re-renders", () => {
|
|
90
|
+
function Counter() {
|
|
91
|
+
const [n, setN] = useState(1);
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<button type="button" onClick={() => setN(n + 1)}>
|
|
95
|
+
more
|
|
96
|
+
</button>
|
|
97
|
+
<BottomAccessory>
|
|
98
|
+
<span data-count="">{n}</span>
|
|
99
|
+
</BottomAccessory>
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
const { container, getByText } = renderWithProviders(
|
|
104
|
+
<Screen>
|
|
105
|
+
<Counter />
|
|
106
|
+
</Screen>,
|
|
107
|
+
);
|
|
108
|
+
act(() => getByText("more").click());
|
|
109
|
+
expect(
|
|
110
|
+
container.querySelector("[data-bottom-accessory='slot'] [data-count]")?.textContent,
|
|
111
|
+
).toBe("2");
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe("BottomAccessory without a slot", () => {
|
|
116
|
+
it("renders in place as a sticky bar on web", () => {
|
|
117
|
+
const { container } = renderWithProviders(
|
|
118
|
+
<div data-host="">
|
|
119
|
+
<BottomAccessory>
|
|
120
|
+
<span>pager</span>
|
|
121
|
+
</BottomAccessory>
|
|
122
|
+
</div>,
|
|
123
|
+
);
|
|
124
|
+
const bar = container.querySelector<HTMLElement>("[data-bottom-accessory='inline']");
|
|
125
|
+
expect(bar?.closest("[data-host]")).not.toBeNull();
|
|
126
|
+
expect(bar?.textContent).toBe("pager");
|
|
127
|
+
expect(bar?.style.position).toBe("sticky");
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
describe("createBottomAccessoryStore", () => {
|
|
132
|
+
it("keeps registration order and skips a no-op set", () => {
|
|
133
|
+
const store = createBottomAccessoryStore();
|
|
134
|
+
let emits = 0;
|
|
135
|
+
store.subscribe(() => emits++);
|
|
136
|
+
const node = <span />;
|
|
137
|
+
store.set(1, node);
|
|
138
|
+
store.set(2, <span />);
|
|
139
|
+
store.set(1, node);
|
|
140
|
+
expect(store.getSnapshot().map((entry) => entry.id)).toEqual([1, 2]);
|
|
141
|
+
expect(emits).toBe(2);
|
|
142
|
+
store.remove(1);
|
|
143
|
+
store.remove(1);
|
|
144
|
+
expect(store.getSnapshot().map((entry) => entry.id)).toEqual([2]);
|
|
145
|
+
expect(emits).toBe(3);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-174 BOTTOM-ACCESSORY: on a phone, paging and navigation controls pin to
|
|
3
|
+
* the bottom edge of the screen above the safe area (UIToolbar, the
|
|
4
|
+
* UIPageControl under a paged list), not inline after the content.
|
|
5
|
+
*
|
|
6
|
+
* Under a floating TabBar the accessory moves into the bar, which floats it
|
|
7
|
+
* as its own capsule above the tab capsule (LC-150). Otherwise a page shell
|
|
8
|
+
* (`Screen`) owns one bottom-accessory slot. Any component
|
|
9
|
+
* hands it a control with `<BottomAccessory>`; the shell draws it in a bar
|
|
10
|
+
* under its scroll view that stays put while the content scrolls, so the
|
|
11
|
+
* scroll view ends above the bar and its last row stays visible. Without a
|
|
12
|
+
* slot the control renders where it is: inline on native, a sticky bar on web
|
|
13
|
+
* (`position: sticky; bottom: 0`, so it still meets the viewport's edge).
|
|
14
|
+
*
|
|
15
|
+
* The accessory is rendered by the slot, outside the registering component's
|
|
16
|
+
* tree: it receives the shell's theme and none of the component's own
|
|
17
|
+
* contexts, so pass it plain elements with their handlers bound.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { Surface, hairline, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
21
|
+
import {
|
|
22
|
+
Fragment,
|
|
23
|
+
createContext,
|
|
24
|
+
useContext,
|
|
25
|
+
useEffect,
|
|
26
|
+
useLayoutEffect,
|
|
27
|
+
useRef,
|
|
28
|
+
useState,
|
|
29
|
+
useSyncExternalStore,
|
|
30
|
+
type ReactNode,
|
|
31
|
+
} from "react";
|
|
32
|
+
import { YStack, isWeb } from "tamagui";
|
|
33
|
+
import { setBottomAccessory, useFloatingBarMounted } from "../appShell/bottomChrome";
|
|
34
|
+
import { componentColors } from "../componentColors";
|
|
35
|
+
import { BottomSafeArea } from "./bottomSafeArea";
|
|
36
|
+
|
|
37
|
+
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
38
|
+
|
|
39
|
+
interface Entry {
|
|
40
|
+
id: number;
|
|
41
|
+
node: ReactNode;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface BottomAccessoryStore {
|
|
45
|
+
set(id: number, node: ReactNode): void;
|
|
46
|
+
remove(id: number): void;
|
|
47
|
+
subscribe(listener: () => void): () => void;
|
|
48
|
+
getSnapshot(): readonly Entry[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const empty: readonly Entry[] = [];
|
|
52
|
+
|
|
53
|
+
// Web only: the sticky edge. The fill is the page's, as on native (LC-206).
|
|
54
|
+
const webSticky = isWeb ? { position: "sticky", bottom: 0 } : undefined;
|
|
55
|
+
|
|
56
|
+
/** The registry a page shell's slot reads. One per shell. */
|
|
57
|
+
export function createBottomAccessoryStore(): BottomAccessoryStore {
|
|
58
|
+
let entries: readonly Entry[] = empty;
|
|
59
|
+
const listeners = new Set<() => void>();
|
|
60
|
+
const emit = () => {
|
|
61
|
+
for (const listener of listeners) listener();
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
set(id, node) {
|
|
65
|
+
const at = entries.findIndex((entry) => entry.id === id);
|
|
66
|
+
if (at >= 0 && entries[at]!.node === node) return;
|
|
67
|
+
entries =
|
|
68
|
+
at < 0
|
|
69
|
+
? [...entries, { id, node }]
|
|
70
|
+
: entries.map((entry) => (entry.id === id ? { id, node } : entry));
|
|
71
|
+
emit();
|
|
72
|
+
},
|
|
73
|
+
remove(id) {
|
|
74
|
+
if (!entries.some((entry) => entry.id === id)) return;
|
|
75
|
+
entries = entries.filter((entry) => entry.id !== id);
|
|
76
|
+
emit();
|
|
77
|
+
},
|
|
78
|
+
subscribe(listener) {
|
|
79
|
+
listeners.add(listener);
|
|
80
|
+
return () => listeners.delete(listener);
|
|
81
|
+
},
|
|
82
|
+
getSnapshot: () => entries,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const BottomAccessoryContext = createContext<BottomAccessoryStore | null>(null);
|
|
87
|
+
|
|
88
|
+
/** Declares a page's bottom-accessory slot to the tree under it. Renders no DOM. */
|
|
89
|
+
export function BottomAccessoryScope({
|
|
90
|
+
store,
|
|
91
|
+
children,
|
|
92
|
+
}: {
|
|
93
|
+
store: BottomAccessoryStore;
|
|
94
|
+
children: ReactNode;
|
|
95
|
+
}) {
|
|
96
|
+
return (
|
|
97
|
+
<BottomAccessoryContext.Provider value={store}>{children}</BottomAccessoryContext.Provider>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** The nearest page's bottom-accessory slot, or null when nothing hosts one. */
|
|
102
|
+
export function useBottomAccessorySlot(): BottomAccessoryStore | null {
|
|
103
|
+
return useContext(BottomAccessoryContext);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let nextId = 0;
|
|
107
|
+
|
|
108
|
+
export interface BottomAccessoryProps {
|
|
109
|
+
children: ReactNode;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Hands `children` to the page's bottom-accessory slot. With no slot it
|
|
114
|
+
* renders them in place: inline on native, a sticky bottom bar on web.
|
|
115
|
+
*/
|
|
116
|
+
export function BottomAccessory({ children }: BottomAccessoryProps) {
|
|
117
|
+
const floating = useFloatingBarMounted();
|
|
118
|
+
const slot = useBottomAccessorySlot();
|
|
119
|
+
const store = floating ? null : slot;
|
|
120
|
+
const id = useRef<number | null>(null);
|
|
121
|
+
if (id.current === null) id.current = ++nextId;
|
|
122
|
+
const [barId] = useState(() => Symbol("bottom-accessory"));
|
|
123
|
+
|
|
124
|
+
useIsomorphicLayoutEffect(() => {
|
|
125
|
+
store?.set(id.current!, children);
|
|
126
|
+
});
|
|
127
|
+
useIsomorphicLayoutEffect(() => {
|
|
128
|
+
if (!store) return;
|
|
129
|
+
const own = id.current!;
|
|
130
|
+
return () => store.remove(own);
|
|
131
|
+
}, [store]);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
setBottomAccessory(barId, floating ? children : null);
|
|
134
|
+
}, [floating, children, barId]);
|
|
135
|
+
useEffect(() => () => setBottomAccessory(barId, null), [barId]);
|
|
136
|
+
|
|
137
|
+
if (floating || store) return null;
|
|
138
|
+
if (!isWeb) return <>{children}</>;
|
|
139
|
+
return <BottomAccessoryBar>{children}</BottomAccessoryBar>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** A page shell's slot: the bar the registered accessories render in. */
|
|
143
|
+
export function BottomAccessoryHost({
|
|
144
|
+
store,
|
|
145
|
+
inset,
|
|
146
|
+
maxWidth,
|
|
147
|
+
}: {
|
|
148
|
+
store: BottomAccessoryStore;
|
|
149
|
+
inset?: string | null;
|
|
150
|
+
maxWidth?: number | null;
|
|
151
|
+
}) {
|
|
152
|
+
const entries = useSyncExternalStore(store.subscribe, store.getSnapshot, () => empty);
|
|
153
|
+
if (entries.length === 0) return null;
|
|
154
|
+
return (
|
|
155
|
+
<BottomAccessoryBar inset={inset} maxWidth={maxWidth} hosted>
|
|
156
|
+
{entries.map((entry) => (
|
|
157
|
+
<Fragment key={entry.id}>{entry.node}</Fragment>
|
|
158
|
+
))}
|
|
159
|
+
</BottomAccessoryBar>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The bar: the page's fill under a top hairline, and the home indicator's
|
|
165
|
+
* inset below the controls.
|
|
166
|
+
*/
|
|
167
|
+
function BottomAccessoryBar({
|
|
168
|
+
children,
|
|
169
|
+
inset,
|
|
170
|
+
maxWidth,
|
|
171
|
+
hosted = false,
|
|
172
|
+
}: {
|
|
173
|
+
children: ReactNode;
|
|
174
|
+
inset?: string | null;
|
|
175
|
+
maxWidth?: number | null;
|
|
176
|
+
hosted?: boolean;
|
|
177
|
+
}) {
|
|
178
|
+
const { knobProps } = useResolvedKnobs({ component: "ScreenToolbar" });
|
|
179
|
+
return (
|
|
180
|
+
<Surface bar>
|
|
181
|
+
<YStack
|
|
182
|
+
data-bottom-accessory={hosted ? "slot" : "inline"}
|
|
183
|
+
width="100%"
|
|
184
|
+
flexShrink={0}
|
|
185
|
+
zIndex={1}
|
|
186
|
+
backgroundColor="$background"
|
|
187
|
+
{...hairline.top}
|
|
188
|
+
borderColor={componentColors.divider as never}
|
|
189
|
+
style={webSticky as never}
|
|
190
|
+
>
|
|
191
|
+
<BottomSafeArea>
|
|
192
|
+
<YStack
|
|
193
|
+
width="100%"
|
|
194
|
+
{...(maxWidth ? { maxWidth, alignSelf: "center" as const } : null)}
|
|
195
|
+
alignItems="center"
|
|
196
|
+
paddingHorizontal={(inset ?? knobProps.panelPadding.padding) as "$4"}
|
|
197
|
+
paddingVertical={knobProps.gap.gap as "$2"}
|
|
198
|
+
{...knobProps.gap}
|
|
199
|
+
>
|
|
200
|
+
{children}
|
|
201
|
+
</YStack>
|
|
202
|
+
</BottomSafeArea>
|
|
203
|
+
</YStack>
|
|
204
|
+
</Surface>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import { Keyboard, type View as NativeView } from "react-native";
|
|
3
|
+
import { useSafeAreaFrame, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
import { YStack } from "tamagui";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Native: the home indicator's inset under the bar, only as much of it as the
|
|
8
|
+
* bar actually overlaps. react-native-safe-area-context's SafeAreaView and
|
|
9
|
+
* hook both report the provider's inset wherever the view sits, so a bar
|
|
10
|
+
* above another bottom bar (a tab bar, an app's own footer) would pad twice.
|
|
11
|
+
* The bar's bottom edge is fixed by the column it closes, so its own padding
|
|
12
|
+
* never moves it and the measurement settles in one pass. The keyboard moves
|
|
13
|
+
* the column without changing the bar's frame, so it re-measures once the
|
|
14
|
+
* keyboard has finished showing or hiding.
|
|
15
|
+
*/
|
|
16
|
+
export function BottomSafeArea({ children }: { children: ReactNode }) {
|
|
17
|
+
const insets = useSafeAreaInsets();
|
|
18
|
+
const frame = useSafeAreaFrame();
|
|
19
|
+
const ref = useRef<NativeView>(null);
|
|
20
|
+
const [overlap, setOverlap] = useState(0);
|
|
21
|
+
const measure = () => {
|
|
22
|
+
ref.current?.measureInWindow((_x, y, _width, height) => {
|
|
23
|
+
const gap = frame.y + frame.height - (y + height);
|
|
24
|
+
const next = Math.min(insets.bottom, Math.max(0, Math.round(insets.bottom - gap)));
|
|
25
|
+
setOverlap((previous) => (previous === next ? previous : next));
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const latest = useRef(measure);
|
|
29
|
+
latest.current = measure;
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const shown = Keyboard.addListener("keyboardDidShow", () => latest.current());
|
|
32
|
+
const hidden = Keyboard.addListener("keyboardDidHide", () => latest.current());
|
|
33
|
+
return () => {
|
|
34
|
+
shown.remove();
|
|
35
|
+
hidden.remove();
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return (
|
|
39
|
+
<YStack ref={ref as never} width="100%" paddingBottom={overlap} onLayout={measure}>
|
|
40
|
+
{children}
|
|
41
|
+
</YStack>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { YStack } from "tamagui";
|
|
3
|
+
|
|
4
|
+
const homeIndicator = { paddingBottom: "env(safe-area-inset-bottom)" };
|
|
5
|
+
|
|
6
|
+
/** Web: the home indicator's inset under the bar (0 outside a notched viewport). */
|
|
7
|
+
export function BottomSafeArea({ children }: { children: ReactNode }) {
|
|
8
|
+
return (
|
|
9
|
+
<YStack width="100%" style={homeIndicator as never}>
|
|
10
|
+
{children}
|
|
11
|
+
</YStack>
|
|
12
|
+
);
|
|
13
|
+
}
|
package/src/layouts/index.tsx
CHANGED
|
@@ -11,6 +11,8 @@ export * from "./timeline";
|
|
|
11
11
|
export * from "./page";
|
|
12
12
|
export * from "./pageHeadingScope";
|
|
13
13
|
export * from "./screenScroll";
|
|
14
|
+
export * from "./bottomAccessory";
|
|
15
|
+
export * from "./bottomSafeArea";
|
|
14
16
|
export * from "./PageTemplates";
|
|
15
17
|
export * from "./shellSidebarSlot";
|
|
16
18
|
export * from "./PaneScaffold";
|
package/src/layouts/page.tsx
CHANGED
|
@@ -54,6 +54,11 @@ import { useDirection } from "../hooks/useDirection";
|
|
|
54
54
|
import { useTranslation } from "../shared/i18n";
|
|
55
55
|
import { ScrollView } from "../ScrollView";
|
|
56
56
|
import { KeyboardAvoidingWrapper } from "./KeyboardAvoidingWrapper";
|
|
57
|
+
import {
|
|
58
|
+
BottomAccessoryHost,
|
|
59
|
+
BottomAccessoryScope,
|
|
60
|
+
createBottomAccessoryStore,
|
|
61
|
+
} from "./bottomAccessory";
|
|
57
62
|
import {
|
|
58
63
|
ScreenScrollScope,
|
|
59
64
|
TopBarSlot,
|
|
@@ -120,6 +125,14 @@ export interface ScreenProps extends YStackProps {
|
|
|
120
125
|
* SF-TRANSPARENT + SP-PAD/SP-GAP: panelPadding and gapLg are spacing roles,
|
|
121
126
|
* so the active preset's token scale restyles them (LC-100).
|
|
122
127
|
*
|
|
128
|
+
* LC-174: the page hosts one bottom-accessory slot, a bar under the scroll
|
|
129
|
+
* view that `<BottomAccessory>` controls (a phone DataTable's pager) render
|
|
130
|
+
* in. It draws nothing until a control registers. The bar closes the page's
|
|
131
|
+
* column below the scroll view, so the scroll view ends above it. On web it
|
|
132
|
+
* is also sticky: when nothing bounds the page's height the scroll view grows
|
|
133
|
+
* with its content and the document scrolls, and the bar still meets the
|
|
134
|
+
* viewport's bottom edge.
|
|
135
|
+
*
|
|
123
136
|
* @example
|
|
124
137
|
* <Screen>
|
|
125
138
|
* <PageHeader title="Pokemon" subtitle="A list of pokemon" />
|
|
@@ -139,6 +152,7 @@ export function Screen({
|
|
|
139
152
|
}: ScreenProps) {
|
|
140
153
|
const { knobProps } = useResolvedKnobs({ component: "Screen" });
|
|
141
154
|
const scrollState = useScreenScrollController();
|
|
155
|
+
const [accessories] = useState(createBottomAccessoryStore);
|
|
142
156
|
const chromeInset = useBottomChromeInset();
|
|
143
157
|
const inset = noPadding ? null : (knobProps.panelPadding.padding as string);
|
|
144
158
|
const cap = maxWidth && !bleed ? maxWidth : null;
|
|
@@ -170,8 +184,14 @@ export function Screen({
|
|
|
170
184
|
</TopBarSlot>
|
|
171
185
|
) : null;
|
|
172
186
|
|
|
187
|
+
const accessory = <BottomAccessoryHost store={accessories} inset={inset} maxWidth={cap} />;
|
|
188
|
+
|
|
173
189
|
const shell = (page: ReactNode) => {
|
|
174
|
-
const scoped =
|
|
190
|
+
const scoped = (
|
|
191
|
+
<ScreenScrollScope controller={scrollState}>
|
|
192
|
+
<BottomAccessoryScope store={accessories}>{page}</BottomAccessoryScope>
|
|
193
|
+
</ScreenScrollScope>
|
|
194
|
+
);
|
|
175
195
|
return isWeb || !avoidKeyboard ? (
|
|
176
196
|
scoped
|
|
177
197
|
) : (
|
|
@@ -196,6 +216,7 @@ export function Screen({
|
|
|
196
216
|
<YStack flex={1} backgroundColor="$background">
|
|
197
217
|
{bar}
|
|
198
218
|
{inner}
|
|
219
|
+
{accessory}
|
|
199
220
|
{chromeClearance}
|
|
200
221
|
</YStack>,
|
|
201
222
|
);
|
|
@@ -203,6 +224,7 @@ export function Screen({
|
|
|
203
224
|
|
|
204
225
|
const scroller = (
|
|
205
226
|
<ScrollView
|
|
227
|
+
ref={scrollState.scroller as never}
|
|
206
228
|
flex={1}
|
|
207
229
|
backgroundColor="$background"
|
|
208
230
|
// flexGrow lets flex:1 children (e.g. EmptyState centering) fill the
|
|
@@ -221,17 +243,14 @@ export function Screen({
|
|
|
221
243
|
);
|
|
222
244
|
|
|
223
245
|
return shell(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
) : (
|
|
233
|
-
scroller
|
|
234
|
-
),
|
|
246
|
+
// minHeight 0: a flex column's min-height is its content by default, so
|
|
247
|
+
// without it the column grows to the page and an outer scroller (a
|
|
248
|
+
// shell's overflow region) scrolls the bar away with the content.
|
|
249
|
+
<YStack flex={1} minHeight={0} backgroundColor="$background">
|
|
250
|
+
{bar}
|
|
251
|
+
{scroller}
|
|
252
|
+
{accessory}
|
|
253
|
+
</YStack>,
|
|
235
254
|
);
|
|
236
255
|
}
|
|
237
256
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-7889 round 4: turning a paged list's page replaces its rows in place, so
|
|
3
|
+
* the page scrolls back to the list's top, the way a list reloads at its first
|
|
4
|
+
* row. `useRevealTop` moves the nearest Screen's scroll view only when the
|
|
5
|
+
* reader had scrolled past the block's top.
|
|
6
|
+
*/
|
|
7
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
8
|
+
import { act, cleanup } from "@testing-library/react";
|
|
9
|
+
import { useEffect } from "react";
|
|
10
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
11
|
+
import { Screen } from "./page";
|
|
12
|
+
import { revealOffset, useRevealTop } from "./screenScroll";
|
|
13
|
+
|
|
14
|
+
const original = {
|
|
15
|
+
rect: Element.prototype.getBoundingClientRect,
|
|
16
|
+
into: Element.prototype.scrollIntoView,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
Element.prototype.getBoundingClientRect = original.rect;
|
|
21
|
+
Element.prototype.scrollIntoView = original.into;
|
|
22
|
+
cleanup();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function stub(blockTop: number) {
|
|
26
|
+
const scrolled: Element[] = [];
|
|
27
|
+
Element.prototype.getBoundingClientRect = function (this: Element) {
|
|
28
|
+
const top = this.hasAttribute("data-block") ? blockTop : 0;
|
|
29
|
+
return { top, bottom: top + 10 } as DOMRect;
|
|
30
|
+
};
|
|
31
|
+
Element.prototype.scrollIntoView = function (this: Element) {
|
|
32
|
+
scrolled.push(this);
|
|
33
|
+
};
|
|
34
|
+
return scrolled;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let revealNow: () => void = () => undefined;
|
|
38
|
+
|
|
39
|
+
function Block() {
|
|
40
|
+
const { ref, reveal } = useRevealTop();
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
revealNow = reveal;
|
|
43
|
+
}, [reveal]);
|
|
44
|
+
return <div ref={ref} data-block="" />;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
describe("useRevealTop", () => {
|
|
48
|
+
it("scrolls a block whose top has scrolled away back to the top edge (web)", () => {
|
|
49
|
+
const scrolled = stub(-300);
|
|
50
|
+
renderWithProviders(
|
|
51
|
+
<Screen>
|
|
52
|
+
<Block />
|
|
53
|
+
</Screen>,
|
|
54
|
+
);
|
|
55
|
+
act(() => revealNow());
|
|
56
|
+
expect(scrolled).toHaveLength(1);
|
|
57
|
+
expect(scrolled[0]!.hasAttribute("data-block")).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("leaves a block whose top is on screen where it is", () => {
|
|
61
|
+
const scrolled = stub(80);
|
|
62
|
+
renderWithProviders(
|
|
63
|
+
<Screen>
|
|
64
|
+
<Block />
|
|
65
|
+
</Screen>,
|
|
66
|
+
);
|
|
67
|
+
act(() => revealNow());
|
|
68
|
+
expect(scrolled).toHaveLength(0);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("native offset: back to the block's top only when scrolled past it", () => {
|
|
72
|
+
expect(revealOffset(400, 900)).toBe(400);
|
|
73
|
+
expect(revealOffset(400, 400)).toBeNull();
|
|
74
|
+
expect(revealOffset(400, 120)).toBeNull();
|
|
75
|
+
expect(revealOffset(-4, 300)).toBe(0);
|
|
76
|
+
});
|
|
77
|
+
});
|