@multiplatform.one/components 7.66.0 → 7.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Alert/index.cjs +5 -0
- package/dist/cjs/Alert/index.native.js +5 -0
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.cjs +6 -34
- package/dist/cjs/Avatar/getInitials.native.js +8 -34
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.cjs +28 -23
- package/dist/cjs/Avatar/index.native.js +30 -25
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Card.cjs +67 -11
- package/dist/cjs/Card.native.js +71 -11
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/Chip/index.cjs +54 -8
- package/dist/cjs/Chip/index.native.js +57 -10
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.cjs +5 -2
- package/dist/cjs/DropdownMenu/index.native.js +5 -2
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.cjs +3 -1
- package/dist/cjs/OverflowRow/index.native.js +3 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +4 -6
- package/dist/cjs/Pagination.native.js +4 -6
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.cjs +5 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js +5 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.cjs +104 -0
- package/dist/cjs/SheetModal/SheetNavigation.native.js +132 -0
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/cjs/SheetModal/index.cjs +30 -17
- package/dist/cjs/SheetModal/index.native.js +86 -58
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/ThemePlayground/index.cjs +1 -2
- package/dist/cjs/actions/StandardAction.cjs +131 -0
- package/dist/cjs/actions/StandardAction.native.js +136 -0
- package/dist/cjs/actions/StandardAction.native.js.map +1 -0
- package/dist/cjs/actions/index.cjs +9 -2
- package/dist/cjs/actions/index.native.js +8 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.cjs +51 -0
- package/dist/cjs/appShell/TabHost.native.js +151 -0
- package/dist/cjs/appShell/TabHost.native.js.map +1 -0
- package/dist/cjs/appShell/index.cjs +2 -0
- package/dist/cjs/appShell/index.native.js +2 -0
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +8 -20
- package/dist/cjs/charts/ChartDataView.native.js +10 -20
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +87 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js +91 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.cjs +0 -1
- package/dist/cjs/layouts/EmptyState.native.js +0 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.cjs +1 -0
- package/dist/cjs/layouts/PageTemplates.native.js +2 -0
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +22 -12
- package/dist/cjs/layouts/page.native.js +27 -16
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.cjs +51 -21
- package/dist/cjs/layouts/sidebar.native.js +53 -23
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.cjs +9 -6
- package/dist/cjs/layouts/toolbar.native.js +9 -6
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.cjs +55 -14
- package/dist/cjs/views/ImageGrid.native.js +58 -15
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +19 -25
- package/dist/cjs/views/ListGroup.native.js +19 -25
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.cjs +3 -6
- package/dist/cjs/views/ReportBuilder.native.js +3 -6
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +2 -0
- package/dist/cjs/views/index.native.js +2 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/esm/Alert/index.mjs +5 -0
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/Alert/index.native.js +5 -0
- package/dist/esm/Alert/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.mjs +7 -32
- package/dist/esm/Avatar/getInitials.mjs.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js +9 -32
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.mjs +30 -24
- package/dist/esm/Avatar/index.mjs.map +1 -1
- package/dist/esm/Avatar/index.native.js +32 -26
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Card.mjs +69 -13
- package/dist/esm/Card.mjs.map +1 -1
- package/dist/esm/Card.native.js +73 -13
- package/dist/esm/Card.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +54 -9
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +57 -11
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +5 -2
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +5 -2
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.mjs +4 -2
- package/dist/esm/OverflowRow/index.mjs.map +1 -1
- package/dist/esm/OverflowRow/index.native.js +4 -2
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.mjs +4 -6
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +4 -6
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.mjs +5 -1
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +5 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.mjs +79 -0
- package/dist/esm/SheetModal/SheetNavigation.mjs.map +1 -0
- package/dist/esm/SheetModal/SheetNavigation.native.js +104 -0
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/esm/SheetModal/index.mjs +32 -19
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +88 -60
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/ThemePlayground/index.mjs +1 -2
- package/dist/esm/ThemePlayground/index.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.mjs +104 -0
- package/dist/esm/actions/StandardAction.mjs.map +1 -0
- package/dist/esm/actions/StandardAction.native.js +106 -0
- package/dist/esm/actions/StandardAction.native.js.map +1 -0
- package/dist/esm/actions/index.mjs +3 -1
- package/dist/esm/actions/index.mjs.map +1 -1
- package/dist/esm/actions/index.native.js +3 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.mjs.map +1 -1
- package/dist/esm/appShell/TabHost.mjs +25 -0
- package/dist/esm/appShell/TabHost.mjs.map +1 -0
- package/dist/esm/appShell/TabHost.native.js +118 -0
- package/dist/esm/appShell/TabHost.native.js.map +1 -0
- package/dist/esm/appShell/index.mjs +2 -1
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +2 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +8 -20
- package/dist/esm/charts/ChartDataView.mjs.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js +10 -20
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +87 -0
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +91 -0
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.mjs +0 -1
- package/dist/esm/layouts/EmptyState.mjs.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js +0 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.mjs +2 -1
- package/dist/esm/layouts/PageTemplates.mjs.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js +3 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +22 -12
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +27 -16
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.mjs +51 -21
- package/dist/esm/layouts/sidebar.mjs.map +1 -1
- package/dist/esm/layouts/sidebar.native.js +53 -23
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.mjs +9 -6
- package/dist/esm/layouts/toolbar.mjs.map +1 -1
- package/dist/esm/layouts/toolbar.native.js +9 -6
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.mjs +53 -14
- package/dist/esm/views/ImageGrid.mjs.map +1 -1
- package/dist/esm/views/ImageGrid.native.js +56 -15
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +20 -26
- package/dist/esm/views/ListGroup.mjs.map +1 -1
- package/dist/esm/views/ListGroup.native.js +20 -26
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.mjs +4 -7
- package/dist/esm/views/ReportBuilder.mjs.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js +4 -7
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -2
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -2
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/jsx/Accordion/index.native.js +1 -1
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/Alert/index.mjs +5 -0
- package/dist/jsx/Alert/index.mjs.map +1 -1
- package/dist/jsx/Alert/index.native.js +5 -0
- package/dist/jsx/Alert/index.native.js.map +1 -1
- package/dist/jsx/AnimateHeight/index.native.js.map +1 -1
- package/dist/jsx/Avatar/getInitials.mjs +7 -32
- package/dist/jsx/Avatar/getInitials.mjs.map +1 -1
- package/dist/jsx/Avatar/getInitials.native.js +8 -34
- package/dist/jsx/Avatar/getInitials.native.js.map +1 -1
- package/dist/jsx/Avatar/index.mjs +30 -24
- package/dist/jsx/Avatar/index.mjs.map +1 -1
- package/dist/jsx/Avatar/index.native.js +30 -25
- package/dist/jsx/Avatar/index.native.js.map +1 -1
- package/dist/jsx/Badge/index.native.js.map +1 -1
- package/dist/jsx/Button.native.js.map +1 -1
- package/dist/jsx/Card.mjs +69 -13
- package/dist/jsx/Card.mjs.map +1 -1
- package/dist/jsx/Card.native.js +71 -11
- package/dist/jsx/Card.native.js.map +1 -1
- package/dist/jsx/CardFooter.native.js.map +1 -1
- package/dist/jsx/CardHeader.native.js.map +1 -1
- package/dist/jsx/Carousel/index.native.js +3 -3
- package/dist/jsx/Carousel/index.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +54 -9
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +57 -10
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/Collapsible.native.js.map +1 -1
- package/dist/jsx/ContextMenu/index.native.js.map +1 -1
- package/dist/jsx/CopyField/index.native.js.map +1 -1
- package/dist/jsx/Dialog.native.js.map +1 -1
- package/dist/jsx/DotIndicator/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +5 -2
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +5 -2
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/jsx/ErrorBoundary/index.native.js.map +1 -1
- package/dist/jsx/Heading.native.js.map +1 -1
- package/dist/jsx/Kbd/index.native.js.map +1 -1
- package/dist/jsx/Kbd/keys.native.js.map +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.native.js +1 -1
- package/dist/jsx/Lightbox/shared.native.js.map +1 -1
- package/dist/jsx/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/jsx/Material/index.native.js.map +1 -1
- package/dist/jsx/Meter/index.native.js +1 -1
- package/dist/jsx/Meter/index.native.js.map +1 -1
- package/dist/jsx/Meter/meter.native.js.map +1 -1
- package/dist/jsx/OverflowRow/index.mjs +4 -2
- package/dist/jsx/OverflowRow/index.mjs.map +1 -1
- package/dist/jsx/OverflowRow/index.native.js +4 -2
- package/dist/jsx/OverflowRow/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +4 -6
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +5 -7
- package/dist/jsx/Pagination.native.js.map +1 -1
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/ProgressSteps/index.native.js.map +1 -1
- package/dist/jsx/Quote/index.native.js.map +1 -1
- package/dist/jsx/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/jsx/Separator/index.native.js.map +1 -1
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs +5 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +5 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetNavigation.mjs +79 -0
- package/dist/jsx/SheetModal/SheetNavigation.mjs.map +1 -0
- package/dist/jsx/SheetModal/SheetNavigation.native.js +132 -0
- package/dist/jsx/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/jsx/SheetModal/detents.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +32 -19
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +86 -58
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/jsx/Skeleton/index.native.js.map +1 -1
- package/dist/jsx/SkipLink/index.native.js.map +1 -1
- package/dist/jsx/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/jsx/SortableList/index.native.js.map +1 -1
- package/dist/jsx/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/jsx/Tabs/index.native.js +1 -1
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Text.native.js.map +1 -1
- package/dist/jsx/ThemePlayground/index.mjs +1 -2
- package/dist/jsx/ThemePlayground/index.mjs.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.native.js +2 -2
- package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/jsx/Toast/index.native.js.map +1 -1
- package/dist/jsx/Toast/store.native.js.map +1 -1
- package/dist/jsx/Tooltip/nativePress.native.js.map +1 -1
- package/dist/jsx/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/jsx/TreeSelect/index.native.js +1 -1
- package/dist/jsx/TreeSelect/index.native.js.map +1 -1
- package/dist/jsx/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/jsx/Video/PlayerChrome.native.js.map +1 -1
- package/dist/jsx/Video/VideoFrame.native.js.map +1 -1
- package/dist/jsx/Video/types.native.js.map +1 -1
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/Wizard/index.native.js +2 -2
- package/dist/jsx/Wizard/index.native.js.map +1 -1
- package/dist/jsx/actions/ActionBar.native.js.map +1 -1
- package/dist/jsx/actions/DangerSection.native.js.map +1 -1
- package/dist/jsx/actions/DestructiveAction.native.js.map +1 -1
- package/dist/jsx/actions/HeaderActions.native.js +2 -2
- package/dist/jsx/actions/HeaderActions.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.mjs +104 -0
- package/dist/jsx/actions/StandardAction.mjs.map +1 -0
- package/dist/jsx/actions/StandardAction.native.js +136 -0
- package/dist/jsx/actions/StandardAction.native.js.map +1 -0
- package/dist/jsx/actions/devWarn.native.js.map +1 -1
- package/dist/jsx/actions/index.mjs +3 -1
- package/dist/jsx/actions/index.mjs.map +1 -1
- package/dist/jsx/actions/index.native.js +8 -1
- package/dist/jsx/actions/index.native.js.map +1 -1
- package/dist/jsx/actions/severity.native.js.map +1 -1
- package/dist/jsx/appShell/BottomAccessory.native.js.map +1 -1
- package/dist/jsx/appShell/Dock.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js +1 -1
- package/dist/jsx/appShell/Springboard.native.js.map +1 -1
- package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabBar.mjs.map +1 -1
- package/dist/jsx/appShell/TabBar.native.js +1 -1
- package/dist/jsx/appShell/TabBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.mjs +25 -0
- package/dist/jsx/appShell/TabHost.mjs.map +1 -0
- package/dist/jsx/appShell/TabHost.native.js +151 -0
- package/dist/jsx/appShell/TabHost.native.js.map +1 -0
- package/dist/jsx/appShell/appTile.native.js +1 -1
- package/dist/jsx/appShell/appTile.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +2 -1
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +2 -0
- package/dist/jsx/appShell/index.native.js.map +1 -1
- package/dist/jsx/charts/Axis.native.js.map +1 -1
- package/dist/jsx/charts/BarChart.native.js.map +1 -1
- package/dist/jsx/charts/ChartDataView.mjs +8 -20
- package/dist/jsx/charts/ChartDataView.mjs.map +1 -1
- package/dist/jsx/charts/ChartDataView.native.js +11 -21
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
- package/dist/jsx/charts/ChartSurface.native.js.map +1 -1
- package/dist/jsx/charts/LineChart.native.js.map +1 -1
- package/dist/jsx/charts/PieChart.native.js.map +1 -1
- package/dist/jsx/charts/Sparkline.native.js.map +1 -1
- package/dist/jsx/charts/accessibility.native.js.map +1 -1
- package/dist/jsx/charts/chartHeight.native.js.map +1 -1
- package/dist/jsx/charts/composeChart.native.js.map +1 -1
- package/dist/jsx/charts/index.native.js.map +1 -1
- package/dist/jsx/charts/math.native.js.map +1 -1
- package/dist/jsx/charts/series.native.js.map +1 -1
- package/dist/jsx/charts/svg.native.js.map +1 -1
- package/dist/jsx/charts/types.native.js.map +1 -1
- package/dist/jsx/charts/useChartTheme.native.js.map +1 -1
- package/dist/jsx/code/Code/index.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +7 -7
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/jsx/code/Pre/index.native.js.map +1 -1
- package/dist/jsx/code/index.native.js +5 -5
- package/dist/jsx/code/index.native.js.map +1 -1
- package/dist/jsx/componentColors.native.js.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +2 -2
- package/dist/jsx/feedback/NotifyHost.native.js.map +1 -1
- package/dist/jsx/feedback/copy.native.js.map +1 -1
- package/dist/jsx/feedback/index.native.js.map +1 -1
- package/dist/jsx/feedback/notify.native.js.map +1 -1
- package/dist/jsx/feedback/route.native.js.map +1 -1
- package/dist/jsx/feedback/store.native.js.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/jsx/formLayouts/index.native.js.map +1 -1
- package/dist/jsx/hooks/index.native.js +1 -1
- package/dist/jsx/hooks/index.native.js.map +1 -1
- package/dist/jsx/hooks/useClipboard.native.js.map +1 -1
- package/dist/jsx/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/jsx/hooks/useHoldCue.native.js.map +1 -1
- package/dist/jsx/icons/CheckRegular.native.js.map +1 -1
- package/dist/jsx/icons/MinusRegular.native.js.map +1 -1
- package/dist/jsx/icons/index.native.js.map +1 -1
- package/dist/jsx/icons/lucide.native.js.map +1 -1
- package/dist/jsx/icons/themed.native.js.map +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/jsx/images/Image/framing.native.js.map +1 -1
- package/dist/jsx/images/Image/index.native.js +1 -1
- package/dist/jsx/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/jsx/images/Image/shared.native.js +1 -1
- package/dist/jsx/images/Image/shared.native.js.map +1 -1
- package/dist/jsx/images/Image/types.native.js.map +1 -1
- package/dist/jsx/images/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +37 -35
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +87 -0
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +93 -2
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/Debug/index.native.js.map +1 -1
- package/dist/jsx/layouts/EmptyState.mjs +0 -1
- package/dist/jsx/layouts/EmptyState.mjs.map +1 -1
- package/dist/jsx/layouts/EmptyState.native.js +0 -1
- package/dist/jsx/layouts/EmptyState.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/jsx/layouts/PageTemplates.mjs +2 -1
- package/dist/jsx/layouts/PageTemplates.mjs.map +1 -1
- package/dist/jsx/layouts/PageTemplates.native.js +2 -0
- package/dist/jsx/layouts/PageTemplates.native.js.map +1 -1
- package/dist/jsx/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/jsx/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/jsx/layouts/StatusDot.native.js.map +1 -1
- package/dist/jsx/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +1 -1
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/layouts/index.native.js +3 -3
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +22 -12
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +29 -18
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/jsx/layouts/sidebar.mjs +51 -21
- package/dist/jsx/layouts/sidebar.mjs.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js +54 -24
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/layouts/tags.native.js +2 -2
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.native.js +2 -2
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/layouts/toolbar.mjs +9 -6
- package/dist/jsx/layouts/toolbar.mjs.map +1 -1
- package/dist/jsx/layouts/toolbar.native.js +10 -7
- package/dist/jsx/layouts/toolbar.native.js.map +1 -1
- package/dist/jsx/shared/actionScan.native.js.map +1 -1
- package/dist/jsx/shared/i18n.native.js.map +1 -1
- package/dist/jsx/shared/restoreRetries.native.js.map +1 -1
- package/dist/jsx/shared/t.native.js.map +1 -1
- package/dist/jsx/shared/textRidesText.native.js.map +1 -1
- package/dist/jsx/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/jsx/surfaces.native.js +1 -1
- package/dist/jsx/surfaces.native.js.map +1 -1
- package/dist/jsx/tamagui.native.js +1 -1
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/dist/jsx/testSetup.native.js.map +1 -1
- package/dist/jsx/utils/setTinted.native.js.map +1 -1
- package/dist/jsx/utils/unwrapText.native.js.map +1 -1
- package/dist/jsx/views/Calendar.native.js +1 -1
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +2 -2
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/Gantt.native.js +2 -2
- package/dist/jsx/views/Gantt.native.js.map +1 -1
- package/dist/jsx/views/GanttDateGrip.native.js.map +1 -1
- package/dist/jsx/views/ImageGrid.mjs +53 -14
- package/dist/jsx/views/ImageGrid.mjs.map +1 -1
- package/dist/jsx/views/ImageGrid.native.js +60 -17
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/Kanban.native.js +1 -1
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.mjs +20 -26
- package/dist/jsx/views/ListGroup.mjs.map +1 -1
- package/dist/jsx/views/ListGroup.native.js +19 -25
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/ListRow.native.js.map +1 -1
- package/dist/jsx/views/Matrix.native.js +2 -2
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.mjs +4 -7
- package/dist/jsx/views/ReportBuilder.mjs.map +1 -1
- package/dist/jsx/views/ReportBuilder.native.js +5 -8
- package/dist/jsx/views/ReportBuilder.native.js.map +1 -1
- package/dist/jsx/views/ShortcutCard.native.js.map +1 -1
- package/dist/jsx/views/TreeView.native.js.map +1 -1
- package/dist/jsx/views/calendarMath.native.js.map +1 -1
- package/dist/jsx/views/ganttIntervals.native.js.map +1 -1
- package/dist/jsx/views/ganttMath.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -2
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +3 -1
- package/dist/jsx/views/index.native.js.map +1 -1
- package/dist/jsx/views/kanbanDnd.native.js.map +1 -1
- package/dist/jsx/views/matrixMath.native.js.map +1 -1
- package/dist/jsx/views/treeViewDnd.native.js.map +1 -1
- package/dist/jsx/views/treeViewLayout.native.js.map +1 -1
- package/dist/jsx/views/treeViewMotion.native.js.map +1 -1
- package/dist/jsx/views/treeViewReveal.native.js.map +1 -1
- package/dist/jsx/views/widgetChrome.native.js.map +1 -1
- package/package.json +13 -9
- package/src/Alert/Alert.spec.tsx +22 -0
- package/src/Alert/index.tsx +5 -0
- package/src/AlertDialogContent.stories.tsx +4 -3
- package/src/Avatar/Avatar.ink.spec.tsx +74 -0
- package/src/Avatar/Avatar.spec.tsx +35 -8
- package/src/Avatar/getInitials.ts +12 -30
- package/src/Avatar/index.tsx +37 -22
- package/src/Button.stories.tsx +1 -1
- package/src/Card.spec.tsx +45 -0
- package/src/Card.stories.tsx +7 -6
- package/src/Card.tsx +57 -18
- package/src/CardFooter.stories.tsx +3 -2
- package/src/CardHeader.stories.tsx +2 -1
- package/src/Chip/Chip.spec.tsx +72 -1
- package/src/Chip/index.tsx +86 -7
- package/src/DialogContent.stories.tsx +9 -11
- package/src/DropdownMenu/DropdownMenu.avatarTrigger.spec.tsx +62 -0
- package/src/DropdownMenu/DropdownMenu.stories.tsx +47 -1
- package/src/DropdownMenu/index.tsx +7 -3
- package/src/OverflowRow/OverflowRow.native.spec.tsx +17 -2
- package/src/OverflowRow/index.tsx +6 -2
- package/src/Pagination.spec.tsx +43 -15
- package/src/Pagination.tsx +11 -9
- package/src/Panel.stories.tsx +5 -6
- package/src/SheetModal/SheetHeader.tsx +3 -2
- package/src/SheetModal/SheetModal.fill.spec.tsx +1 -1
- package/src/SheetModal/SheetModal.menus.spec.tsx +125 -26
- package/src/SheetModal/SheetModal.native.spec.tsx +35 -0
- package/src/SheetModal/SheetModal.regularWidth.native.spec.tsx +117 -0
- package/src/SheetModal/SheetModal.stories.spec.tsx +7 -3
- package/src/SheetModal/SheetModal.stories.tsx +30 -20
- package/src/SheetModal/SheetNavigation.tsx +93 -0
- package/src/SheetModal/index.native.tsx +108 -69
- package/src/SheetModal/index.tsx +39 -22
- package/src/SkipLink/SkipLink.stories.tsx +2 -2
- package/src/Tabs/Tabs.stories.tsx +2 -2
- package/src/ThemePlayground/index.tsx +1 -2
- package/src/Tooltip/Tooltip.spec.tsx +2 -2
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/actions/ActionBar.stories.spec.tsx +5 -5
- package/src/actions/ActionBar.stories.tsx +8 -25
- package/src/actions/ActionButton.spec.tsx +125 -0
- package/src/actions/ActionButton.stories.tsx +113 -0
- package/src/actions/DestructiveAction.stories.tsx +4 -3
- package/src/actions/StandardAction.tsx +185 -0
- package/src/actions/index.ts +14 -0
- package/src/appShell/TabBar.tsx +5 -0
- package/src/appShell/TabHost.native.spec.tsx +188 -0
- package/src/appShell/TabHost.native.tsx +154 -0
- package/src/appShell/TabHost.tsx +36 -0
- package/src/appShell/index.ts +1 -0
- package/src/charts/ChartDataView.tsx +9 -14
- package/src/icons/nativeIconInk.dark.spec.tsx +159 -0
- package/src/index.ts +2 -0
- package/src/layouts/AsyncBoundary.spec.tsx +24 -1
- package/src/layouts/AsyncBoundary.stories.tsx +8 -1
- package/src/layouts/AsyncBoundary.tsx +71 -2
- package/src/layouts/AsyncSkeleton.stories.tsx +9 -1
- package/src/layouts/EmptyState.stories.tsx +3 -2
- package/src/layouts/EmptyState.tsx +0 -1
- package/src/layouts/PageHeader.stories.tsx +88 -4
- package/src/layouts/PageTemplates.spec.tsx +28 -1
- package/src/layouts/PageTemplates.stories.tsx +6 -7
- package/src/layouts/PageTemplates.tsx +8 -1
- package/src/layouts/ScreenToolbar.stories.tsx +3 -2
- package/src/layouts/Sidebar.spec.tsx +48 -0
- package/src/layouts/layouts.spec.tsx +33 -0
- package/src/layouts/navBar.spec.tsx +22 -0
- package/src/layouts/page.tsx +31 -13
- package/src/layouts/pageChrome.phone.spec.tsx +11 -5
- package/src/layouts/sidebar.tsx +84 -31
- package/src/layouts/toolbar.tsx +16 -2
- package/src/overlayElevation.spec.tsx +3 -4
- package/src/surfaces.spec.tsx +60 -0
- package/src/views/ImageGrid.photos.spec.tsx +46 -0
- package/src/views/ImageGrid.tsx +52 -27
- package/src/views/ListGroup.native-press.spec.tsx +66 -0
- package/src/views/ListGroup.spec.tsx +25 -6
- package/src/views/ListGroup.tsx +20 -30
- package/src/views/ReportBuilder.tsx +2 -10
- package/src/views/index.ts +8 -1
- package/types/Alert/index.d.ts.map +1 -1
- package/types/Avatar/getInitials.d.ts +3 -27
- package/types/Avatar/getInitials.d.ts.map +1 -1
- package/types/Avatar/index.d.ts +15 -2
- package/types/Avatar/index.d.ts.map +1 -1
- package/types/Card.d.ts +15 -1
- package/types/Card.d.ts.map +1 -1
- package/types/Chip/index.d.ts +38 -3
- package/types/Chip/index.d.ts.map +1 -1
- package/types/DropdownMenu/index.d.ts +2 -1
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/OverflowRow/index.d.ts.map +1 -1
- package/types/Pagination.d.ts +4 -1
- package/types/Pagination.d.ts.map +1 -1
- package/types/SheetModal/SheetHeader.d.ts +1 -1
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/SheetModal/SheetNavigation.d.ts +14 -0
- package/types/SheetModal/SheetNavigation.d.ts.map +1 -0
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +6 -0
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/ThemePlayground/index.d.ts.map +1 -1
- package/types/actions/StandardAction.d.ts +64 -0
- package/types/actions/StandardAction.d.ts.map +1 -0
- package/types/actions/index.d.ts +2 -0
- package/types/actions/index.d.ts.map +1 -1
- package/types/appShell/TabBar.d.ts +8 -0
- package/types/appShell/TabBar.d.ts.map +1 -1
- package/types/appShell/TabHost.d.ts +23 -0
- package/types/appShell/TabHost.d.ts.map +1 -0
- package/types/appShell/TabHost.native.d.ts +56 -0
- package/types/appShell/TabHost.native.d.ts.map +1 -0
- package/types/appShell/index.d.ts +1 -0
- package/types/appShell/index.d.ts.map +1 -1
- package/types/charts/ChartDataView.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts +13 -2
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/layouts/EmptyState.d.ts.map +1 -1
- package/types/layouts/PageTemplates.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/sidebar.d.ts +25 -3
- package/types/layouts/sidebar.d.ts.map +1 -1
- package/types/layouts/toolbar.d.ts +9 -0
- package/types/layouts/toolbar.d.ts.map +1 -1
- package/types/views/ImageGrid.d.ts +19 -1
- package/types/views/ImageGrid.d.ts.map +1 -1
- package/types/views/ListGroup.d.ts +4 -1
- package/types/views/ListGroup.d.ts.map +1 -1
- package/types/views/ReportBuilder.d.ts.map +1 -1
- package/types/views/index.d.ts +1 -1
- package/types/views/index.d.ts.map +1 -1
|
@@ -15,8 +15,12 @@ vi.mock("tamagui", () => ({
|
|
|
15
15
|
}));
|
|
16
16
|
vi.mock("../hooks/useDirection", async () => import("../hooks/useDirection.native"));
|
|
17
17
|
vi.mock("../ScrollView", async () => import("../ScrollView/index.native"));
|
|
18
|
+
const ground = vi.hoisted(() => ({ elevated: false }));
|
|
18
19
|
vi.mock("@multiplatform.one/theme", () => ({
|
|
19
|
-
|
|
20
|
+
useElevatedSurface: () => ground.elevated,
|
|
21
|
+
useResolvedKnobs: () => ({
|
|
22
|
+
knobProps: { gap: { gap: "$3" }, elevatedSurface: { backgroundColor: "$color4" } },
|
|
23
|
+
}),
|
|
20
24
|
}));
|
|
21
25
|
vi.mock("tamagui/linear-gradient", () => ({
|
|
22
26
|
LinearGradient: ({ testID, ...props }: Record<string, unknown>) =>
|
|
@@ -33,7 +37,7 @@ const { TamaguiProvider, createTamagui, createTokens } = runtime.core;
|
|
|
33
37
|
const previousConfig = (globalThis as { __tamaguiConfig?: unknown }).__tamaguiConfig;
|
|
34
38
|
const config = createTamagui({
|
|
35
39
|
tokens: createTokens({ size: {}, space: {}, radius: {}, zIndex: {}, color: {} }),
|
|
36
|
-
themes: { light: { background: "rgb(240, 240, 240)" } },
|
|
40
|
+
themes: { light: { background: "rgb(240, 240, 240)", color4: "rgb(36, 36, 36)" } },
|
|
37
41
|
shorthands: {},
|
|
38
42
|
media: {},
|
|
39
43
|
});
|
|
@@ -46,6 +50,7 @@ afterEach(() => {
|
|
|
46
50
|
act(() => root?.unmount());
|
|
47
51
|
container?.remove();
|
|
48
52
|
runtime.resetHosts();
|
|
53
|
+
ground.elevated = false;
|
|
49
54
|
(runtime.reactNative.I18nManager as { isRTL: boolean }).isRTL = false;
|
|
50
55
|
});
|
|
51
56
|
afterAll(() => {
|
|
@@ -176,6 +181,16 @@ describe("OverflowRow through native Tamagui", () => {
|
|
|
176
181
|
]);
|
|
177
182
|
});
|
|
178
183
|
|
|
184
|
+
it("on an elevated ground fades to the overlay fill, not the page (FZ-8116)", () => {
|
|
185
|
+
ground.elevated = true;
|
|
186
|
+
render();
|
|
187
|
+
scroll(0);
|
|
188
|
+
expect(JSON.parse(fade("end")!.getAttribute("data-colors")!)).toEqual([
|
|
189
|
+
"rgba(36, 36, 36, 0)",
|
|
190
|
+
"rgb(36, 36, 36)",
|
|
191
|
+
]);
|
|
192
|
+
});
|
|
193
|
+
|
|
179
194
|
it("can omit the fades without losing scroll events", () => {
|
|
180
195
|
const onScroll = vi.fn();
|
|
181
196
|
render({ fade: false, onScroll });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getRgba } from "@tamagui/core";
|
|
2
|
-
import { useResolvedKnobs, type SizeKey } from "@multiplatform.one/theme";
|
|
2
|
+
import { useElevatedSurface, useResolvedKnobs, type SizeKey } from "@multiplatform.one/theme";
|
|
3
3
|
import {
|
|
4
4
|
Children,
|
|
5
5
|
forwardRef,
|
|
@@ -60,7 +60,7 @@ export const OverflowRow = forwardRef<ComponentRef<typeof ScrollView>, OverflowR
|
|
|
60
60
|
{
|
|
61
61
|
children,
|
|
62
62
|
fade = "$2",
|
|
63
|
-
fadeColor
|
|
63
|
+
fadeColor: fadeColorProp,
|
|
64
64
|
gap,
|
|
65
65
|
containerProps,
|
|
66
66
|
onScroll,
|
|
@@ -73,6 +73,10 @@ export const OverflowRow = forwardRef<ComponentRef<typeof ScrollView>, OverflowR
|
|
|
73
73
|
ref,
|
|
74
74
|
) {
|
|
75
75
|
const { knobProps } = useResolvedKnobs();
|
|
76
|
+
const elevatedGround = useElevatedSurface();
|
|
77
|
+
const fadeColor =
|
|
78
|
+
fadeColorProp ??
|
|
79
|
+
((elevatedGround ? knobProps.elevatedSurface.backgroundColor : "$background") as ColorTokens);
|
|
76
80
|
const direction = useDirection();
|
|
77
81
|
const rtl = direction === "rtl";
|
|
78
82
|
const theme = useTheme();
|
package/src/Pagination.spec.tsx
CHANGED
|
@@ -47,6 +47,10 @@ const refPaths = (IconComponent: Icon, props: IconProps = {}): string => {
|
|
|
47
47
|
return d;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
// LC-176: a pager's chevrons are icon buttons in content, drawn as the bold
|
|
51
|
+
// glyph.
|
|
52
|
+
const BAR_GLYPH: IconProps = { weight: "bold" };
|
|
53
|
+
|
|
50
54
|
const byLabel = (container: HTMLElement, label: string) => {
|
|
51
55
|
const el = container.querySelector(`[aria-label="${label}"]`);
|
|
52
56
|
expect(el, `button "${label}"`).toBeTruthy();
|
|
@@ -60,35 +64,57 @@ describe("Pagination directional glyphs (numbered variant)", () => {
|
|
|
60
64
|
it("points prev/next carets toward their targets in LTR", () => {
|
|
61
65
|
clearDirs();
|
|
62
66
|
const { container } = renderNumbered();
|
|
63
|
-
expect(iconPaths(byLabel(container, "Go to previous page"))).toBe(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
expect(iconPaths(byLabel(container, "Go to
|
|
67
|
+
expect(iconPaths(byLabel(container, "Go to previous page"))).toBe(
|
|
68
|
+
refPaths(CaretLeftIcon, BAR_GLYPH),
|
|
69
|
+
);
|
|
70
|
+
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
71
|
+
refPaths(CaretRightIcon, BAR_GLYPH),
|
|
72
|
+
);
|
|
73
|
+
expect(iconPaths(byLabel(container, "Go to first page"))).toBe(
|
|
74
|
+
refPaths(CaretDoubleLeftIcon, BAR_GLYPH),
|
|
75
|
+
);
|
|
76
|
+
expect(iconPaths(byLabel(container, "Go to last page"))).toBe(
|
|
77
|
+
refPaths(CaretDoubleRightIcon, BAR_GLYPH),
|
|
78
|
+
);
|
|
67
79
|
});
|
|
68
80
|
|
|
69
81
|
it("swaps all four caret pairs in RTL so they point toward their targets", () => {
|
|
70
82
|
document.documentElement.dir = "rtl";
|
|
71
83
|
const { container } = renderNumbered();
|
|
72
|
-
expect(iconPaths(byLabel(container, "Go to previous page"))).toBe(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
expect(iconPaths(byLabel(container, "Go to
|
|
84
|
+
expect(iconPaths(byLabel(container, "Go to previous page"))).toBe(
|
|
85
|
+
refPaths(CaretRightIcon, BAR_GLYPH),
|
|
86
|
+
);
|
|
87
|
+
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
88
|
+
refPaths(CaretLeftIcon, BAR_GLYPH),
|
|
89
|
+
);
|
|
90
|
+
expect(iconPaths(byLabel(container, "Go to first page"))).toBe(
|
|
91
|
+
refPaths(CaretDoubleRightIcon, BAR_GLYPH),
|
|
92
|
+
);
|
|
93
|
+
expect(iconPaths(byLabel(container, "Go to last page"))).toBe(
|
|
94
|
+
refPaths(CaretDoubleLeftIcon, BAR_GLYPH),
|
|
95
|
+
);
|
|
76
96
|
});
|
|
77
97
|
|
|
78
98
|
it("re-mirrors live when the document direction flips (useDirection reactivity)", async () => {
|
|
79
99
|
clearDirs();
|
|
80
100
|
const { container } = renderNumbered();
|
|
81
|
-
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
101
|
+
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
102
|
+
refPaths(CaretRightIcon, BAR_GLYPH),
|
|
103
|
+
);
|
|
82
104
|
|
|
83
105
|
await act(async () => {
|
|
84
106
|
document.documentElement.dir = "rtl";
|
|
85
107
|
});
|
|
86
|
-
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
108
|
+
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
109
|
+
refPaths(CaretLeftIcon, BAR_GLYPH),
|
|
110
|
+
);
|
|
87
111
|
|
|
88
112
|
await act(async () => {
|
|
89
113
|
document.documentElement.dir = "ltr";
|
|
90
114
|
});
|
|
91
|
-
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
115
|
+
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
116
|
+
refPaths(CaretRightIcon, BAR_GLYPH),
|
|
117
|
+
);
|
|
92
118
|
});
|
|
93
119
|
});
|
|
94
120
|
|
|
@@ -96,15 +122,17 @@ describe("Pagination directional glyphs (dots variant)", () => {
|
|
|
96
122
|
it("swaps the prev/next arrows in RTL", () => {
|
|
97
123
|
document.documentElement.dir = "rtl";
|
|
98
124
|
const { container } = renderWithProviders(<Pagination total={5} activeIndex={2} />);
|
|
99
|
-
expect(iconPaths(byLabel(container, "Previous page"))).toBe(
|
|
100
|
-
|
|
125
|
+
expect(iconPaths(byLabel(container, "Previous page"))).toBe(
|
|
126
|
+
refPaths(ArrowRightIcon, BAR_GLYPH),
|
|
127
|
+
);
|
|
128
|
+
expect(iconPaths(byLabel(container, "Next page"))).toBe(refPaths(ArrowLeftIcon, BAR_GLYPH));
|
|
101
129
|
});
|
|
102
130
|
|
|
103
131
|
it("keeps arrows physical in LTR", () => {
|
|
104
132
|
clearDirs();
|
|
105
133
|
const { container } = renderWithProviders(<Pagination total={5} activeIndex={2} />);
|
|
106
|
-
expect(iconPaths(byLabel(container, "Previous page"))).toBe(refPaths(ArrowLeftIcon));
|
|
107
|
-
expect(iconPaths(byLabel(container, "Next page"))).toBe(refPaths(ArrowRightIcon));
|
|
134
|
+
expect(iconPaths(byLabel(container, "Previous page"))).toBe(refPaths(ArrowLeftIcon, BAR_GLYPH));
|
|
135
|
+
expect(iconPaths(byLabel(container, "Next page"))).toBe(refPaths(ArrowRightIcon, BAR_GLYPH));
|
|
108
136
|
});
|
|
109
137
|
|
|
110
138
|
it("never mirrors the direction-neutral submit checkmark", () => {
|
package/src/Pagination.tsx
CHANGED
|
@@ -128,7 +128,10 @@ export interface PaginationProps extends Omit<XStackProps, "children" | "onChang
|
|
|
128
128
|
totalItems?: number;
|
|
129
129
|
/** Items per page (numbered summary slot) */
|
|
130
130
|
pageSize?: number;
|
|
131
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Show the "1–25 of 312" summary. Requires totalItems + pageSize. The
|
|
133
|
+
* simple variant reads it between its chevrons in place of "2 of 13".
|
|
134
|
+
*/
|
|
132
135
|
showSummary?: boolean;
|
|
133
136
|
/** Pages shown either side of the current page before collapsing to an ellipsis */
|
|
134
137
|
siblingCount?: number;
|
|
@@ -262,7 +265,7 @@ export function Pagination({
|
|
|
262
265
|
// Bidi-isolate the whole formatted range so an RTL paragraph can't
|
|
263
266
|
// reorder the latin/numeric runs ("1–5 of 5" ⇏ "of 5 5–1").
|
|
264
267
|
const summary =
|
|
265
|
-
isNumbered && showSummary && totalItems != null && pageSize != null
|
|
268
|
+
(isNumbered || isSimple) && showSummary && totalItems != null && pageSize != null
|
|
266
269
|
? bidiIsolate(
|
|
267
270
|
totalItems === 0
|
|
268
271
|
? t("0 of 0")
|
|
@@ -308,12 +311,11 @@ export function Pagination({
|
|
|
308
311
|
|
|
309
312
|
<Button
|
|
310
313
|
size={knobProps.sizeToken}
|
|
311
|
-
circular={!isPageNavigation}
|
|
312
314
|
chromeless
|
|
313
315
|
icon={isPageNavigation ? PrevIcon : PrevArrowIcon}
|
|
314
316
|
onPress={handlePrev}
|
|
315
317
|
disabled={!canPrev}
|
|
316
|
-
// LC-40: the Button's own disabled
|
|
318
|
+
// LC-40: the Button's own disabled dim owns the treatment — the
|
|
317
319
|
// legacy opacity 0.3 dim stacked on top of it (double-dim).
|
|
318
320
|
aria-label={isPageNavigation ? t("Go to previous page") : t("Previous page")}
|
|
319
321
|
onKeyDown={activateOnEnterSpace(handlePrev, canPrev)}
|
|
@@ -330,9 +332,10 @@ export function Pagination({
|
|
|
330
332
|
flexShrink={1}
|
|
331
333
|
minWidth={0}
|
|
332
334
|
>
|
|
333
|
-
{
|
|
334
|
-
|
|
335
|
-
|
|
335
|
+
{summary ??
|
|
336
|
+
(openEnded
|
|
337
|
+
? withInterp(t("Page {{number}}"), { number: currentPage })
|
|
338
|
+
: bidiIsolate(withInterp(t("{{page}} of {{total}}"), { page: currentPage, total })))}
|
|
336
339
|
</Text>
|
|
337
340
|
) : isNumbered ? (
|
|
338
341
|
<XStack alignItems="center" {...knobProps.gap}>
|
|
@@ -397,7 +400,6 @@ export function Pagination({
|
|
|
397
400
|
|
|
398
401
|
<Button
|
|
399
402
|
size={knobProps.sizeToken}
|
|
400
|
-
circular={!isPageNavigation}
|
|
401
403
|
chromeless={!submits}
|
|
402
404
|
theme={submits ? "active" : undefined}
|
|
403
405
|
icon={isPageNavigation ? NextIcon : submits ? CheckIcon : NextArrowIcon}
|
|
@@ -423,7 +425,7 @@ export function Pagination({
|
|
|
423
425
|
/>
|
|
424
426
|
)}
|
|
425
427
|
|
|
426
|
-
{summary && (
|
|
428
|
+
{summary && isNumbered && (
|
|
427
429
|
<Text
|
|
428
430
|
{...knobProps.body}
|
|
429
431
|
color={knobProps.textAccentColor}
|
package/src/Panel.stories.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
// Catalog Button + Input (G-15 story honesty / LC-56, UX-P06).
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Input } from "@multiplatform.one/forms";
|
|
4
|
+
import { YStack } from "tamagui";
|
|
5
|
+
import { ActionBar } from "./actions/ActionBar";
|
|
6
|
+
import { ActionButton } from "./actions/StandardAction";
|
|
5
7
|
import { Panel } from "./surfaces";
|
|
6
8
|
import { Paragraph, SizableText } from "./Text";
|
|
7
9
|
|
|
@@ -52,10 +54,7 @@ export const InteractiveContent: Story = {
|
|
|
52
54
|
<Panel maxWidth={420}>
|
|
53
55
|
<SizableText fontWeight="600">Interactive content</SizableText>
|
|
54
56
|
<Input placeholder="Focus me" inputProps={{ "aria-label": "Focus demo" }} />
|
|
55
|
-
<
|
|
56
|
-
<Button>Cancel</Button>
|
|
57
|
-
<Button>Submit</Button>
|
|
58
|
-
</XStack>
|
|
57
|
+
<ActionBar cancel={<ActionButton kind="cancel" />} primary={<ActionButton kind="submit" />} />
|
|
59
58
|
</Panel>
|
|
60
59
|
),
|
|
61
60
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Surface } from "@multiplatform.one/theme";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import { View, XStack } from "tamagui";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The sheet's header row: what the sheet is about, and its frequent actions as
|
|
6
7
|
* icon buttons in the trailing area (LC-262 DIRECT-ACTIONS), never hidden in a
|
|
7
|
-
* menu.
|
|
8
|
+
* menu. The actions are a bar (LC-153), so they take the bar tint (LC-176).
|
|
8
9
|
*/
|
|
9
10
|
export function SheetHeader({
|
|
10
11
|
header,
|
|
@@ -23,7 +24,7 @@ export function SheetHeader({
|
|
|
23
24
|
{header}
|
|
24
25
|
</View>
|
|
25
26
|
<XStack testID="sheet-modal-header-actions" flexShrink={0} alignItems="center">
|
|
26
|
-
{actions}
|
|
27
|
+
<Surface bar>{actions}</Surface>
|
|
27
28
|
</XStack>
|
|
28
29
|
</XStack>
|
|
29
30
|
);
|
|
@@ -57,7 +57,7 @@ describe("native fill allocates the sheet body", () => {
|
|
|
57
57
|
|
|
58
58
|
it("opens every link between the frame and the body, not just the outer one", () => {
|
|
59
59
|
const view = renderNative({ fill: true });
|
|
60
|
-
for (const id of ["sheet-modal-surface", "sheet-modal-content"]) {
|
|
60
|
+
for (const id of ["sheet-modal-surface", "sheet-modal-clip", "sheet-modal-content"]) {
|
|
61
61
|
const link = classes(view.getByTestId(id));
|
|
62
62
|
expect(link, `${id} grows`).toEqual(expect.arrayContaining(flexOne));
|
|
63
63
|
expect(link, `${id} can collapse`).toContain(minZero);
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
* web never presents a second bottom sheet; it opens over its trigger. At page
|
|
4
4
|
* level a DropdownMenu keeps its sheet on the web, a Select with a short list
|
|
5
5
|
* (seven or fewer options) opens over its trigger and a long one keeps its
|
|
6
|
-
* sheet.
|
|
6
|
+
* sheet. Round 3: inside the sheet a long list is a row that pushes its
|
|
7
|
+
* checkmark list onto the sheet's own stack, and a short unglyphed one opens a
|
|
8
|
+
* menu beside its field. The native face is pinned in forms'
|
|
9
|
+
* FloatingPanel.menuFace.native.spec.tsx.
|
|
7
10
|
*/
|
|
8
11
|
import { Select } from "@multiplatform.one/forms";
|
|
9
12
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
10
|
-
import { cleanup, fireEvent, waitFor } from "@testing-library/react";
|
|
13
|
+
import { cleanup, fireEvent, waitFor, within } from "@testing-library/react";
|
|
14
|
+
import { useState } from "react";
|
|
11
15
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
12
16
|
import { Button } from "tamagui";
|
|
13
17
|
import {
|
|
@@ -85,7 +89,7 @@ describe("menus inside a SheetModal at 390 (FZ-7830)", () => {
|
|
|
85
89
|
expect(document.querySelector('[data-testid="floating-panel-viewport"]')).toBeFalsy();
|
|
86
90
|
});
|
|
87
91
|
|
|
88
|
-
it("a Select in the sheet opens its listbox
|
|
92
|
+
it("a short Select in the sheet opens its listbox in place, not as a second sheet", async () => {
|
|
89
93
|
const result = renderWithProviders(
|
|
90
94
|
<SheetModal open onOpenChange={() => {}}>
|
|
91
95
|
<Select aria-label="Exposure" options={options} defaultValue="tailnet" />
|
|
@@ -99,17 +103,16 @@ describe("menus inside a SheetModal at 390 (FZ-7830)", () => {
|
|
|
99
103
|
expect(panelSheets().length).toBe(0);
|
|
100
104
|
});
|
|
101
105
|
|
|
102
|
-
it("a long Select in the sheet
|
|
106
|
+
it("a long Select in the sheet is a row that pushes its list inside the sheet, not a second sheet", async () => {
|
|
103
107
|
const result = renderWithProviders(
|
|
104
108
|
<SheetModal open onOpenChange={() => {}}>
|
|
105
109
|
<Select aria-label="Region" options={regions} defaultValue="helsinki" />
|
|
106
110
|
</SheetModal>,
|
|
107
111
|
);
|
|
108
|
-
|
|
109
|
-
fireEvent.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
await result.findByTestId("select-dropdown");
|
|
112
|
+
expect(result.queryByTestId("select-trigger")).toBeNull();
|
|
113
|
+
fireEvent.click(await result.findByTestId("sheet-picker-row"));
|
|
114
|
+
await result.findByTestId("sheet-modal-page");
|
|
115
|
+
expect(result.queryByTestId("select-dropdown")).toBeNull();
|
|
113
116
|
expect(panelSheets().length).toBe(0);
|
|
114
117
|
});
|
|
115
118
|
|
|
@@ -191,24 +194,53 @@ describe("LC-262 inside a sheet at 390 (FZ-7830 round 2)", () => {
|
|
|
191
194
|
expect(onValueChange).toHaveBeenLastCalledWith("public");
|
|
192
195
|
});
|
|
193
196
|
|
|
194
|
-
it("a short list missing a glyph
|
|
195
|
-
const six = [...exposure, { label: "Mesh", value: "mesh", icon: <GlobeIcon /> }];
|
|
197
|
+
it("a short list missing a glyph keeps its trigger and opens a menu beside it, never over it", async () => {
|
|
196
198
|
const bare = exposure.map(({ icon: _icon, ...rest }) => rest);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
199
|
+
const box = (x: number, y: number, width: number, height: number) =>
|
|
200
|
+
({
|
|
201
|
+
x,
|
|
202
|
+
y,
|
|
203
|
+
left: x,
|
|
204
|
+
top: y,
|
|
205
|
+
right: x + width,
|
|
206
|
+
bottom: y + height,
|
|
207
|
+
width,
|
|
208
|
+
height,
|
|
209
|
+
toJSON: () => ({}),
|
|
210
|
+
}) as DOMRect;
|
|
211
|
+
const field = box(16, 300, 358, 44);
|
|
212
|
+
const rect = vi
|
|
213
|
+
.spyOn(HTMLElement.prototype, "getBoundingClientRect")
|
|
214
|
+
.mockImplementation(function (this: HTMLElement) {
|
|
215
|
+
return this.closest('[data-fp-reference], [data-testid="select-trigger"]')
|
|
216
|
+
? field
|
|
217
|
+
: box(0, 0, 0, 0);
|
|
218
|
+
});
|
|
219
|
+
const result = renderWithProviders(
|
|
220
|
+
<SheetModal open onOpenChange={() => {}}>
|
|
221
|
+
<Select aria-label="Exposure" options={bare} defaultValue="tailnet" />
|
|
222
|
+
</SheetModal>,
|
|
223
|
+
);
|
|
224
|
+
expect(result.queryByRole("radiogroup")).toBeNull();
|
|
225
|
+
const trigger = (await result.findAllByTestId("select-trigger"))[0];
|
|
226
|
+
fireEvent.pointerDown(trigger);
|
|
227
|
+
fireEvent.mouseDown(trigger);
|
|
228
|
+
fireEvent.click(trigger);
|
|
229
|
+
const dropdown = await result.findByTestId("select-dropdown");
|
|
230
|
+
await waitFor(() => expect(dropdown.style.top).toBe("344px"));
|
|
231
|
+
expect(panelSheets().length).toBe(0);
|
|
232
|
+
rect.mockRestore();
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it("past five options, even with glyphs, the Select pushes its list instead of opening a menu", async () => {
|
|
236
|
+
const six = [...exposure, { label: "Mesh", value: "mesh", icon: <GlobeIcon /> }];
|
|
237
|
+
const result = renderWithProviders(
|
|
238
|
+
<SheetModal open onOpenChange={() => {}}>
|
|
239
|
+
<Select aria-label="Exposure" options={six} defaultValue="tailnet" />
|
|
240
|
+
</SheetModal>,
|
|
241
|
+
);
|
|
242
|
+
expect(result.queryByTestId("select-trigger")).toBeNull();
|
|
243
|
+
expect(result.getByTestId("sheet-picker-row")).toBeTruthy();
|
|
212
244
|
});
|
|
213
245
|
|
|
214
246
|
it("at page level the same five options keep their trigger, each menu row with its glyph", async () => {
|
|
@@ -245,3 +277,70 @@ describe("LC-262 inside a sheet at 390 (FZ-7830 round 2)", () => {
|
|
|
245
277
|
expect(document.querySelector("[data-fp-trigger-row]")).toBeNull();
|
|
246
278
|
});
|
|
247
279
|
});
|
|
280
|
+
|
|
281
|
+
describe("long choice lists push inside the sheet at 390 (FZ-7830 round 3)", () => {
|
|
282
|
+
function Region({ onValue }: { onValue?: (value: string) => void }) {
|
|
283
|
+
const [value, setValue] = useState("helsinki");
|
|
284
|
+
return (
|
|
285
|
+
<SheetModal open onOpenChange={() => {}} header={<span>keycloak</span>}>
|
|
286
|
+
<Select
|
|
287
|
+
label="Region"
|
|
288
|
+
options={regions}
|
|
289
|
+
value={value}
|
|
290
|
+
onValueChange={(next) => {
|
|
291
|
+
setValue(next as string);
|
|
292
|
+
onValue?.(next as string);
|
|
293
|
+
}}
|
|
294
|
+
/>
|
|
295
|
+
</SheetModal>
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
it("is a Settings row: the label, the current value and a chevron, with no field trigger", async () => {
|
|
300
|
+
const result = renderWithProviders(<Region />);
|
|
301
|
+
const row = await result.findByTestId("sheet-picker-row");
|
|
302
|
+
expect(row.getAttribute("role")).toBe("button");
|
|
303
|
+
expect(row.getAttribute("aria-label")).toBe("Region");
|
|
304
|
+
expect(row.textContent).toContain("Region");
|
|
305
|
+
expect(result.getByTestId("sheet-picker-value").textContent).toBe("Helsinki");
|
|
306
|
+
expect(row.querySelector("svg")).toBeTruthy();
|
|
307
|
+
expect(result.queryByTestId("select-trigger")).toBeNull();
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it("pushes a checkmark list with Back and the title, and Back returns with the value set", async () => {
|
|
311
|
+
const onValue = vi.fn();
|
|
312
|
+
const result = renderWithProviders(<Region onValue={onValue} />);
|
|
313
|
+
fireEvent.click(await result.findByTestId("sheet-picker-row"));
|
|
314
|
+
const page = await result.findByTestId("sheet-modal-page");
|
|
315
|
+
expect(within(page).getByRole("heading").textContent).toBe("Region");
|
|
316
|
+
const list = within(page).getByRole("radiogroup");
|
|
317
|
+
expect(within(list).getAllByRole("radio")).toHaveLength(8);
|
|
318
|
+
expect(
|
|
319
|
+
within(list)
|
|
320
|
+
.getByRole("radio", { name: /Helsinki/ })
|
|
321
|
+
.getAttribute("aria-checked"),
|
|
322
|
+
).toBe("true");
|
|
323
|
+
fireEvent.click(within(list).getByRole("radio", { name: /Tokyo/ }));
|
|
324
|
+
expect(onValue).toHaveBeenCalledWith("tokyo");
|
|
325
|
+
await waitFor(() =>
|
|
326
|
+
expect(
|
|
327
|
+
within(result.getByTestId("sheet-modal-page"))
|
|
328
|
+
.getByRole("radio", { name: /Tokyo/ })
|
|
329
|
+
.getAttribute("aria-checked"),
|
|
330
|
+
).toBe("true"),
|
|
331
|
+
);
|
|
332
|
+
fireEvent.click(within(page).getByRole("button", { name: "Back" }));
|
|
333
|
+
await waitFor(() => expect(result.queryByTestId("sheet-modal-page")).toBeNull());
|
|
334
|
+
expect(result.getByTestId("sheet-picker-value").textContent).toBe("Tokyo");
|
|
335
|
+
expect(panelSheets().length).toBe(0);
|
|
336
|
+
expect(result.queryByTestId("select-dropdown")).toBeNull();
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it("at page level the same eight options keep their field and sheet", async () => {
|
|
340
|
+
const result = renderWithProviders(
|
|
341
|
+
<Select label="Region" options={regions} defaultValue="helsinki" />,
|
|
342
|
+
);
|
|
343
|
+
expect(result.queryByTestId("sheet-picker-row")).toBeNull();
|
|
344
|
+
expect(result.getByTestId("select-trigger")).toBeTruthy();
|
|
345
|
+
});
|
|
346
|
+
});
|
|
@@ -4,6 +4,8 @@ import { act } from "@testing-library/react";
|
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import { Animated, PanResponder } from "react-native";
|
|
6
6
|
import { Text } from "tamagui";
|
|
7
|
+
import { useSheetNavigation } from "@multiplatform.one/forms";
|
|
8
|
+
import { fireEvent } from "@testing-library/react";
|
|
7
9
|
import { SheetModal } from "./index.native";
|
|
8
10
|
|
|
9
11
|
const modal = vi.hoisted(() => ({ onShow: undefined as undefined | (() => void) }));
|
|
@@ -166,3 +168,36 @@ describe("SheetModal native presentation lifecycle", () => {
|
|
|
166
168
|
);
|
|
167
169
|
});
|
|
168
170
|
});
|
|
171
|
+
|
|
172
|
+
describe("SheetModal native navigation stack (FZ-7830 round 3)", () => {
|
|
173
|
+
function Pusher() {
|
|
174
|
+
const store = useSheetNavigation();
|
|
175
|
+
return (
|
|
176
|
+
<Text
|
|
177
|
+
onPress={() => store?.push({ id: "region", title: "Region", content: <Text>Tokyo</Text> })}
|
|
178
|
+
>
|
|
179
|
+
Region row
|
|
180
|
+
</Text>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
it("shows a pushed page in place of the body with its title and Back, and Back pops it", () => {
|
|
185
|
+
const result = renderWithProviders(
|
|
186
|
+
<SheetModal open onOpenChange={onOpenChange} header={<Text>keycloak</Text>}>
|
|
187
|
+
<Pusher />
|
|
188
|
+
</SheetModal>,
|
|
189
|
+
);
|
|
190
|
+
expect(result.queryByTestId("sheet-modal-page")).toBeNull();
|
|
191
|
+
act(() => {
|
|
192
|
+
fireEvent.click(result.getByText("Region row"));
|
|
193
|
+
});
|
|
194
|
+
const page = result.getByTestId("sheet-modal-page");
|
|
195
|
+
expect(page.textContent).toContain("Region");
|
|
196
|
+
expect(page.textContent).toContain("Tokyo");
|
|
197
|
+
expect(result.getByText("Region row").closest("[aria-hidden='true']")).toBeTruthy();
|
|
198
|
+
act(() => {
|
|
199
|
+
fireEvent.click(result.getByRole("button", { name: "Back" }));
|
|
200
|
+
});
|
|
201
|
+
expect(result.queryByTestId("sheet-modal-page")).toBeNull();
|
|
202
|
+
});
|
|
203
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-8116 (LC-266): at regular width (an iPad, a wide Android window) the
|
|
3
|
+
* native SheetModal is the compact sheet as a panel: bottom-pinned, slid up
|
|
4
|
+
* with its grabber, capped at SHEET_PANEL_WIDTH and centred, top corners
|
|
5
|
+
* rounded, on the elevated overlay surface. A tap on the scrim dismisses. At
|
|
6
|
+
* compact width (iPhone, Slide Over) it stays the full-width bottom sheet.
|
|
7
|
+
*/
|
|
8
|
+
import { SHEET_PANEL_WIDTH } from "@multiplatform.one/forms";
|
|
9
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
10
|
+
import { OVERLAY_BREAKPOINT } from "@multiplatform.one/theme";
|
|
11
|
+
import { act, cleanup, fireEvent } from "@testing-library/react";
|
|
12
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
13
|
+
import { Text } from "tamagui";
|
|
14
|
+
import type { SheetModalProps } from "./index";
|
|
15
|
+
import { SheetModal } from "./index.native";
|
|
16
|
+
|
|
17
|
+
const screen = vi.hoisted(() => ({ width: 820, height: 1180 }));
|
|
18
|
+
vi.mock("react-native-web", async (importOriginal) => ({
|
|
19
|
+
...(await importOriginal<typeof import("react-native")>()),
|
|
20
|
+
ActionSheetIOS: undefined,
|
|
21
|
+
Modal: ({ children }: { children: import("react").ReactNode }) => children,
|
|
22
|
+
useWindowDimensions: () => ({ ...screen, scale: 2, fontScale: 1 }),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
cleanup();
|
|
27
|
+
screen.width = 820;
|
|
28
|
+
screen.height = 1180;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function open(props: Partial<SheetModalProps> = {}) {
|
|
32
|
+
const view = renderWithProviders(
|
|
33
|
+
<SheetModal open onOpenChange={() => {}} {...props}>
|
|
34
|
+
<Text>Settings</Text>
|
|
35
|
+
</SheetModal>,
|
|
36
|
+
);
|
|
37
|
+
const frame = view.getByTestId("sheet-modal-frame");
|
|
38
|
+
const surface = view.getByTestId("sheet-modal-surface");
|
|
39
|
+
const container = frame.parentElement as HTMLElement;
|
|
40
|
+
return { view, frame, surface, container };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function px(value: string) {
|
|
44
|
+
return Number.parseFloat(value);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
describe("SheetModal native at regular width (FZ-8116)", () => {
|
|
48
|
+
it("is a bottom panel, centred and capped at the panel width", () => {
|
|
49
|
+
const { frame, container } = open();
|
|
50
|
+
expect(frame.style.width).toBe(`${SHEET_PANEL_WIDTH}px`);
|
|
51
|
+
expect(container.style.justifyContent).toBe("flex-end");
|
|
52
|
+
expect(container.style.alignItems).toBe("center");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("keeps the grabber, squares its bottom corners and leaves the bottom edge open", () => {
|
|
56
|
+
const { view, surface } = open();
|
|
57
|
+
expect(view.queryByTestId("sheet-modal-grabber")).not.toBeNull();
|
|
58
|
+
expect(surface.getAttribute("data-sheet-form")).toBe("panel");
|
|
59
|
+
expect(String(surface.className)).toMatch(/\b_bbw-0px\b/);
|
|
60
|
+
expect(String(surface.className)).toMatch(/\b_bblr-0px\b/);
|
|
61
|
+
expect(String(surface.className)).toMatch(/\b_bbrr-0px\b/);
|
|
62
|
+
expect(String(surface.className)).not.toMatch(/\b_btlr-0px\b/);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("keeps its shadow: an inner view clips, not the surface", () => {
|
|
66
|
+
const { view, surface } = open();
|
|
67
|
+
const clip = view.getByTestId("sheet-modal-clip");
|
|
68
|
+
expect(surface.contains(clip)).toBe(true);
|
|
69
|
+
expect(surface.className).not.toContain("_ox-hidden");
|
|
70
|
+
expect(clip.className).toContain("_ox-hidden");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("grows to its content up to the large detent, not a form-sheet height", () => {
|
|
74
|
+
const { frame } = open({ fill: true });
|
|
75
|
+
expect(px(frame.style.maxHeight)).toBeGreaterThan(620);
|
|
76
|
+
expect(px(frame.style.maxHeight)).toBeLessThanOrEqual(Math.round(1180 * 0.85));
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("spans a regular window narrower than the cap", () => {
|
|
80
|
+
screen.width = OVERLAY_BREAKPOINT + 1;
|
|
81
|
+
const { frame } = open();
|
|
82
|
+
expect(px(frame.style.width)).toBe(Math.min(SHEET_PANEL_WIDTH, OVERLAY_BREAKPOINT + 1));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("dismisses on a tap on the scrim beside the panel", () => {
|
|
86
|
+
vi.useFakeTimers();
|
|
87
|
+
try {
|
|
88
|
+
const onOpenChange = vi.fn();
|
|
89
|
+
const view = renderWithProviders(
|
|
90
|
+
<SheetModal open onOpenChange={onOpenChange}>
|
|
91
|
+
<Text>Settings</Text>
|
|
92
|
+
</SheetModal>,
|
|
93
|
+
);
|
|
94
|
+
act(() => {
|
|
95
|
+
vi.runAllTimers();
|
|
96
|
+
});
|
|
97
|
+
fireEvent.click(view.getByRole("button", { name: "Close" }));
|
|
98
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
|
99
|
+
} finally {
|
|
100
|
+
vi.useRealTimers();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it.each([
|
|
105
|
+
["an iPhone", 390, 844],
|
|
106
|
+
["iPad Slide Over", 320, 1180],
|
|
107
|
+
])("stays the full-width bottom sheet on %s", (_name, width, height) => {
|
|
108
|
+
screen.width = width;
|
|
109
|
+
screen.height = height;
|
|
110
|
+
const { view, frame, surface, container } = open();
|
|
111
|
+
expect(frame.style.width).toBe("");
|
|
112
|
+
expect(container.style.justifyContent).toBe("flex-end");
|
|
113
|
+
expect(container.style.alignItems).toBe("");
|
|
114
|
+
expect(view.queryByTestId("sheet-modal-grabber")).not.toBeNull();
|
|
115
|
+
expect(surface.getAttribute("data-sheet-form")).toBe("bottom");
|
|
116
|
+
});
|
|
117
|
+
});
|