@multiplatform.one/components 7.85.1 → 7.87.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/Chip/index.cjs +1 -1
- package/dist/cjs/Chip/index.native.js +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/ChoiceChips/index.cjs +63 -0
- package/dist/cjs/ChoiceChips/index.native.js +71 -0
- package/dist/cjs/ChoiceChips/index.native.js.map +1 -0
- package/dist/cjs/Dialog.cjs +86 -3
- package/dist/cjs/Dialog.native.js +94 -3
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/ThemePresetPicker/index.cjs +15 -32
- package/dist/cjs/ThemePresetPicker/index.native.js +17 -32
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/appShell/AppShell.cjs +28 -9
- package/dist/cjs/appShell/AppShell.native.js +55 -13
- package/dist/cjs/appShell/AppShell.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.cjs +15 -2
- package/dist/cjs/feedback/ConfirmDialog.native.js +16 -2
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/index.cjs +1 -0
- package/dist/cjs/feedback/index.native.js +1 -0
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +70 -21
- package/dist/cjs/layouts/AsyncBoundary.native.js +72 -21
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.cjs +17 -16
- package/dist/cjs/layouts/IdentityPlate.native.js +19 -18
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/asyncFailure.cjs +104 -0
- package/dist/cjs/layouts/asyncFailure.native.js +133 -0
- package/dist/cjs/layouts/asyncFailure.native.js.map +1 -0
- package/dist/cjs/layouts/index.cjs +4 -1
- package/dist/cjs/layouts/index.native.js +3 -0
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/tamagui.cjs +1 -0
- package/dist/cjs/tamagui.native.js +1 -0
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/cjs/views/CardGrid.cjs +106 -0
- package/dist/cjs/views/CardGrid.native.js +116 -0
- package/dist/cjs/views/CardGrid.native.js.map +1 -0
- package/dist/cjs/views/ImageGrid.cjs +9 -2
- package/dist/cjs/views/ImageGrid.native.js +9 -2
- package/dist/cjs/views/ImageGrid.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/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Carousel/geometry.native.js.map +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/esm/CheckGlyph/index.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +1 -1
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +1 -1
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ChoiceChips/index.mjs +38 -0
- package/dist/esm/ChoiceChips/index.mjs.map +1 -0
- package/dist/esm/ChoiceChips/index.native.js +43 -0
- package/dist/esm/ChoiceChips/index.native.js.map +1 -0
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.mjs +88 -6
- package/dist/esm/Dialog.mjs.map +1 -1
- package/dist/esm/Dialog.native.js +96 -6
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/Diff/diff.native.js.map +1 -1
- package/dist/esm/Diff/index.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Kbd/index.native.js.map +1 -1
- package/dist/esm/Kbd/keys.native.js.map +1 -1
- package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/esm/Lightbox/shared.native.js.map +1 -1
- package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/esm/MachineLiteral/index.native.js.map +1 -1
- package/dist/esm/Material/index.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/Quote/index.native.js.map +1 -1
- package/dist/esm/SchemeToggle/index.native.js.map +1 -1
- package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.mjs +16 -33
- package/dist/esm/ThemePresetPicker/index.mjs.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js +18 -33
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
- package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
- package/dist/esm/Video/VideoFrame.native.js.map +1 -1
- package/dist/esm/Video/types.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wizard/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/actions/DangerSection.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/actions/HeaderActions.native.js.map +1 -1
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/actions/devWarn.native.js.map +1 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/actions/severity.native.js.map +1 -1
- package/dist/esm/appShell/AppShell.mjs +28 -9
- package/dist/esm/appShell/AppShell.mjs.map +1 -1
- package/dist/esm/appShell/AppShell.native.js +55 -13
- package/dist/esm/appShell/AppShell.native.js.map +1 -1
- package/dist/esm/appShell/BottomChromeClearance.native.js.map +1 -1
- package/dist/esm/appShell/Dock.native.js.map +1 -1
- package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.native.js.map +1 -1
- package/dist/esm/appShell/appTile.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/esm/code/Highlighter/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/esm/code/LogView.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.mjs +14 -2
- package/dist/esm/feedback/ConfirmDialog.mjs.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js +15 -2
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.mjs +2 -2
- package/dist/esm/feedback/index.mjs.map +1 -1
- package/dist/esm/feedback/index.native.js +2 -2
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/esm/formLayouts/index.native.js.map +1 -1
- package/dist/esm/hooks/index.native.js.map +1 -1
- package/dist/esm/hooks/useClipboard.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/hooks/useHoldCue.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/framing.native.js.map +1 -1
- package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/index.native.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +70 -21
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +72 -21
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/Debug/index.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/IdentityPlate.mjs +17 -16
- package/dist/esm/layouts/IdentityPlate.mjs.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js +19 -18
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/asyncFailure.mjs +78 -0
- package/dist/esm/layouts/asyncFailure.mjs.map +1 -0
- package/dist/esm/layouts/asyncFailure.native.js +104 -0
- package/dist/esm/layouts/asyncFailure.native.js.map +1 -0
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/barTitleSpan.native.js.map +1 -1
- package/dist/esm/layouts/bottomAccessory.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/layouts/index.mjs +2 -1
- package/dist/esm/layouts/index.mjs.map +1 -1
- package/dist/esm/layouts/index.native.js +2 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/shared/actionScan.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/restoreRetries.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/textRidesText.native.js.map +1 -1
- package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/tamagui.mjs +2 -2
- package/dist/esm/tamagui.mjs.map +1 -1
- package/dist/esm/tamagui.native.js +2 -2
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/setTinted.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/CardGrid.mjs +70 -0
- package/dist/esm/views/CardGrid.mjs.map +1 -0
- package/dist/esm/views/CardGrid.native.js +77 -0
- package/dist/esm/views/CardGrid.native.js.map +1 -0
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.mjs +9 -3
- package/dist/esm/views/ImageGrid.mjs.map +1 -1
- package/dist/esm/views/ImageGrid.native.js +9 -3
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ListRow.native.js.map +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/ShortcutCard.native.js.map +1 -1
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/esm/views/ganttIntervals.native.js.map +1 -1
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -1
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/kanbanDnd.native.js.map +1 -1
- package/dist/esm/views/matrixMath.native.js.map +1 -1
- package/dist/esm/views/sameNameScope.native.js.map +1 -1
- package/dist/esm/views/treeViewDnd.native.js.map +1 -1
- package/dist/esm/views/treeViewLayout.native.js.map +1 -1
- package/dist/esm/views/treeViewMotion.native.js.map +1 -1
- package/dist/esm/views/treeViewReveal.native.js.map +1 -1
- package/dist/esm/views/usePageFlowLoadMore.native.js.map +1 -1
- package/dist/esm/views/widgetChrome.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +1 -1
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +1 -1
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/ChoiceChips/index.mjs +38 -0
- package/dist/jsx/ChoiceChips/index.mjs.map +1 -0
- package/dist/jsx/ChoiceChips/index.native.js +71 -0
- package/dist/jsx/ChoiceChips/index.native.js.map +1 -0
- package/dist/jsx/Dialog.mjs +88 -6
- package/dist/jsx/Dialog.mjs.map +1 -1
- package/dist/jsx/Dialog.native.js +94 -3
- package/dist/jsx/Dialog.native.js.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.mjs +16 -33
- package/dist/jsx/ThemePresetPicker/index.mjs.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.native.js +17 -32
- package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/jsx/appShell/AppShell.mjs +28 -9
- package/dist/jsx/appShell/AppShell.mjs.map +1 -1
- package/dist/jsx/appShell/AppShell.native.js +55 -13
- package/dist/jsx/appShell/AppShell.native.js.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.mjs +14 -2
- package/dist/jsx/feedback/ConfirmDialog.mjs.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.native.js +16 -2
- package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/jsx/feedback/index.mjs +2 -2
- package/dist/jsx/feedback/index.mjs.map +1 -1
- package/dist/jsx/feedback/index.native.js +1 -0
- package/dist/jsx/feedback/index.native.js.map +1 -1
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +1 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +70 -21
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +72 -21
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.mjs +17 -16
- package/dist/jsx/layouts/IdentityPlate.mjs.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js +19 -18
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/layouts/asyncFailure.mjs +78 -0
- package/dist/jsx/layouts/asyncFailure.mjs.map +1 -0
- package/dist/jsx/layouts/asyncFailure.native.js +133 -0
- package/dist/jsx/layouts/asyncFailure.native.js.map +1 -0
- package/dist/jsx/layouts/index.mjs +2 -1
- package/dist/jsx/layouts/index.mjs.map +1 -1
- package/dist/jsx/layouts/index.native.js +3 -0
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/tamagui.mjs +2 -2
- package/dist/jsx/tamagui.mjs.map +1 -1
- package/dist/jsx/tamagui.native.js +1 -0
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/dist/jsx/views/CardGrid.mjs +70 -0
- package/dist/jsx/views/CardGrid.mjs.map +1 -0
- package/dist/jsx/views/CardGrid.native.js +116 -0
- package/dist/jsx/views/CardGrid.native.js.map +1 -0
- package/dist/jsx/views/ImageGrid.mjs +9 -3
- package/dist/jsx/views/ImageGrid.mjs.map +1 -1
- package/dist/jsx/views/ImageGrid.native.js +9 -2
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -1
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +2 -0
- package/dist/jsx/views/index.native.js.map +1 -1
- package/package.json +9 -9
- package/src/Chip/index.tsx +5 -2
- package/src/ChoiceChips/ChoiceChips.spec.tsx +58 -0
- package/src/ChoiceChips/ChoiceChips.stories.tsx +49 -0
- package/src/ChoiceChips/index.tsx +57 -0
- package/src/Dialog.phoneSheet.spec.tsx +186 -0
- package/src/Dialog.tsx +143 -5
- package/src/ThemePresetPicker/ThemePresetPicker.spec.tsx +5 -13
- package/src/ThemePresetPicker/index.tsx +16 -41
- package/src/appShell/AppShell.spec.tsx +47 -0
- package/src/appShell/AppShell.stories.spec.tsx +27 -0
- package/src/appShell/AppShell.stories.tsx +82 -11
- package/src/appShell/AppShell.tsx +36 -12
- package/src/feedback/ConfirmDialog.tsx +26 -2
- package/src/feedback/index.ts +1 -1
- package/src/index.ts +1 -0
- package/src/layouts/AsyncBoundary.reason.spec.tsx +161 -0
- package/src/layouts/AsyncBoundary.stories.tsx +26 -0
- package/src/layouts/AsyncBoundary.tsx +107 -25
- package/src/layouts/IdentityPlate.native-press.spec.tsx +71 -0
- package/src/layouts/IdentityPlate.spec.tsx +69 -0
- package/src/layouts/IdentityPlate.tsx +14 -17
- package/src/layouts/asyncFailure.ts +110 -0
- package/src/layouts/index.tsx +7 -0
- package/src/layouts/pageTitleOneLine.spec.tsx +26 -0
- package/src/overlayStack.native-press.spec.tsx +34 -0
- package/src/surfaces.spec.tsx +42 -0
- package/src/tamagui.ts +8 -2
- package/src/testUtilsTimeouts.spec.ts +8 -0
- package/src/views/CardGrid.spec.tsx +95 -0
- package/src/views/CardGrid.stories.tsx +70 -0
- package/src/views/CardGrid.tsx +85 -0
- package/src/views/ImageGrid.tsx +13 -5
- package/src/views/index.ts +1 -0
- package/types/Chip/index.d.ts +4 -1
- package/types/Chip/index.d.ts.map +1 -1
- package/types/ChoiceChips/index.d.ts +24 -0
- package/types/ChoiceChips/index.d.ts.map +1 -0
- package/types/Dialog.d.ts +262 -2
- package/types/Dialog.d.ts.map +1 -1
- package/types/ThemePresetPicker/index.d.ts +1 -3
- package/types/ThemePresetPicker/index.d.ts.map +1 -1
- package/types/appShell/AppShell.d.ts +8 -0
- package/types/appShell/AppShell.d.ts.map +1 -1
- package/types/feedback/ConfirmDialog.d.ts +13 -1
- package/types/feedback/ConfirmDialog.d.ts.map +1 -1
- package/types/feedback/index.d.ts +1 -1
- package/types/feedback/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts +16 -1
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/layouts/IdentityPlate.d.ts +1 -1
- package/types/layouts/IdentityPlate.d.ts.map +1 -1
- package/types/layouts/asyncFailure.d.ts +21 -0
- package/types/layouts/asyncFailure.d.ts.map +1 -0
- package/types/layouts/index.d.ts +1 -0
- package/types/layouts/index.d.ts.map +1 -1
- package/types/tamagui.d.ts +2 -2
- package/types/tamagui.d.ts.map +1 -1
- package/types/views/CardGrid.d.ts +10 -0
- package/types/views/CardGrid.d.ts.map +1 -0
- package/types/views/ImageGrid.d.ts +10 -1
- package/types/views/ImageGrid.d.ts.map +1 -1
- package/types/views/index.d.ts +1 -0
- package/types/views/index.d.ts.map +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import { TamaguiProvider } from "tamagui";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { createDefaultThemeConfig } from "@multiplatform.one/theme";
|
|
5
|
+
import { ChoiceChips } from "./index";
|
|
6
|
+
|
|
7
|
+
const config = createDefaultThemeConfig({});
|
|
8
|
+
const colors = [
|
|
9
|
+
{ value: "", label: "(default)", swatch: "$color12" as const },
|
|
10
|
+
{ value: "blue", label: "blue", swatch: "$blue9" as const },
|
|
11
|
+
{ value: "green", label: "green", swatch: "$green9" as const },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
function renderChoices(value: string, onChange = vi.fn()) {
|
|
15
|
+
render(
|
|
16
|
+
<TamaguiProvider config={config.tamagui} defaultTheme="light">
|
|
17
|
+
<ChoiceChips label="Color" options={colors} value={value} onChange={onChange} />
|
|
18
|
+
</TamaguiProvider>,
|
|
19
|
+
);
|
|
20
|
+
return onChange;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
describe("ChoiceChips", () => {
|
|
24
|
+
it("labels the row with visible text that also names the group", () => {
|
|
25
|
+
renderChoices("blue");
|
|
26
|
+
const group = screen.getByRole("group", { name: "Color" });
|
|
27
|
+
expect(group.previousElementSibling?.textContent).toBe("Color");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("wraps the chips inside the row instead of scrolling them past its edge", () => {
|
|
31
|
+
renderChoices("blue");
|
|
32
|
+
const group = screen.getByRole("group", { name: "Color" });
|
|
33
|
+
expect(group.className).toContain("_fwr-wrap");
|
|
34
|
+
expect(group.className).toContain("_rowGap-c-space-2");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("marks the chosen chip once: the only tinted chip, its check in the swatch's place", () => {
|
|
38
|
+
renderChoices("blue");
|
|
39
|
+
const picked = screen.getByRole("button", { name: "Color: blue" });
|
|
40
|
+
expect(picked.getAttribute("aria-pressed")).toBe("true");
|
|
41
|
+
expect(picked.className).toContain("_bg-selectedBac");
|
|
42
|
+
expect(picked.querySelector("[data-chip-swatch]")).toBeNull();
|
|
43
|
+
expect(picked.querySelectorAll("svg")).toHaveLength(1);
|
|
44
|
+
for (const name of ["Color: (default)", "Color: green"]) {
|
|
45
|
+
const other = screen.getByRole("button", { name });
|
|
46
|
+
expect(other.getAttribute("aria-pressed")).toBe("false");
|
|
47
|
+
expect(other.className).toContain("_bg-transparent");
|
|
48
|
+
expect(other.querySelector("[data-chip-swatch]")).not.toBeNull();
|
|
49
|
+
expect(other.querySelectorAll("svg")).toHaveLength(0);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("reports the pressed option's value", () => {
|
|
54
|
+
const onChange = renderChoices("blue");
|
|
55
|
+
fireEvent.click(screen.getByRole("button", { name: "Color: green" }));
|
|
56
|
+
expect(onChange).toHaveBeenCalledWith("green");
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { YStack } from "tamagui";
|
|
4
|
+
import { ChoiceChips, type ChoiceChipsOption } from "./index";
|
|
5
|
+
|
|
6
|
+
const colors: ChoiceChipsOption[] = [
|
|
7
|
+
"blue",
|
|
8
|
+
"green",
|
|
9
|
+
"orange",
|
|
10
|
+
"pink",
|
|
11
|
+
"purple",
|
|
12
|
+
"red",
|
|
13
|
+
"teal",
|
|
14
|
+
"yellow",
|
|
15
|
+
"gray",
|
|
16
|
+
].map((hue) => ({ value: hue, label: hue, swatch: `$${hue}9` as ChoiceChipsOption["swatch"] }));
|
|
17
|
+
|
|
18
|
+
const sizes: ChoiceChipsOption[] = ["None", "Small", "Medium", "Large", "Full"].map((label) => ({
|
|
19
|
+
value: label.toLowerCase(),
|
|
20
|
+
label,
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
function Choices({
|
|
24
|
+
options,
|
|
25
|
+
label,
|
|
26
|
+
initial,
|
|
27
|
+
}: {
|
|
28
|
+
options: ChoiceChipsOption[];
|
|
29
|
+
label: string;
|
|
30
|
+
initial: string;
|
|
31
|
+
}) {
|
|
32
|
+
const [value, setValue] = useState(initial);
|
|
33
|
+
return <ChoiceChips label={label} options={options} value={value} onChange={setValue} />;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const meta: Meta<typeof ChoiceChips> = {
|
|
37
|
+
title: "Components/ChoiceChips",
|
|
38
|
+
component: ChoiceChips,
|
|
39
|
+
render: () => (
|
|
40
|
+
<YStack gap="$3" maxWidth={358}>
|
|
41
|
+
<Choices label="Color" options={colors} initial="purple" />
|
|
42
|
+
<Choices label="Border Radius" options={sizes} initial="medium" />
|
|
43
|
+
</YStack>
|
|
44
|
+
),
|
|
45
|
+
};
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof ChoiceChips>;
|
|
49
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { XStack, YStack, type ColorTokens } from "tamagui";
|
|
2
|
+
import { Chip } from "../Chip";
|
|
3
|
+
import { Paragraph } from "../Text";
|
|
4
|
+
|
|
5
|
+
export interface ChoiceChipsOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** A colour sample for the option; the selected chip's check takes its place. */
|
|
9
|
+
swatch?: ColorTokens;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ChoiceChipsProps {
|
|
13
|
+
/** The row's visible label, also the group's accessible name. */
|
|
14
|
+
label: string;
|
|
15
|
+
options: ReadonlyArray<ChoiceChipsOption>;
|
|
16
|
+
value: string | undefined;
|
|
17
|
+
onChange: (value: string) => void;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A labelled single-choice row of chips (FZ-8440). The chips wrap inside the
|
|
23
|
+
* row's width instead of scrolling past the edge, at the `$2` row pitch the
|
|
24
|
+
* chip's press slop is sized for (K12). Unchosen chips rest outlined so the
|
|
25
|
+
* chosen one stands out by its selection tint alone, the way a checked menu
|
|
26
|
+
* row does (LC-262).
|
|
27
|
+
*/
|
|
28
|
+
export function ChoiceChips({ label, options, value, onChange, testID }: ChoiceChipsProps) {
|
|
29
|
+
return (
|
|
30
|
+
<YStack testID={testID} gap="$1.5">
|
|
31
|
+
<Paragraph fontSize="$2" color="$color11">
|
|
32
|
+
{label}
|
|
33
|
+
</Paragraph>
|
|
34
|
+
<XStack
|
|
35
|
+
role="group"
|
|
36
|
+
aria-label={label}
|
|
37
|
+
flexWrap="wrap"
|
|
38
|
+
columnGap="$1.5"
|
|
39
|
+
rowGap="$2"
|
|
40
|
+
data-choice-chips=""
|
|
41
|
+
>
|
|
42
|
+
{options.map((option) => (
|
|
43
|
+
<Chip
|
|
44
|
+
key={option.value || "(default)"}
|
|
45
|
+
aria-label={`${label}: ${option.label}`}
|
|
46
|
+
variant="outlined"
|
|
47
|
+
selected={(value ?? "") === option.value}
|
|
48
|
+
swatch={option.swatch}
|
|
49
|
+
onPress={() => onChange(option.value)}
|
|
50
|
+
>
|
|
51
|
+
{option.label}
|
|
52
|
+
</Chip>
|
|
53
|
+
))}
|
|
54
|
+
</XStack>
|
|
55
|
+
</YStack>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-269 PHONE-DIALOG-AS-SHEET. At the overlay pivot and below a content
|
|
3
|
+
* dialog presents as a bottom sheet (SheetModal); an alert-shaped confirm
|
|
4
|
+
* stays a centred alert; desktop, an explicit eject and a dialog opened inside
|
|
5
|
+
* another overlay keep the centred dialog.
|
|
6
|
+
*/
|
|
7
|
+
import { OverlayStackProvider } from "@multiplatform.one/forms";
|
|
8
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { cleanup, fireEvent, waitFor } from "@testing-library/react";
|
|
10
|
+
import { useState, type ReactNode } from "react";
|
|
11
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
12
|
+
import { Dialog, type DialogPhonePresentation } from "./Dialog";
|
|
13
|
+
import { ConfirmDialog, confirmDialogPresentation } from "./feedback/ConfirmDialog";
|
|
14
|
+
import { DialogContent, DialogOverlay } from "./surfaces";
|
|
15
|
+
import { Paragraph } from "./Text";
|
|
16
|
+
|
|
17
|
+
const originalInnerWidth = window.innerWidth;
|
|
18
|
+
|
|
19
|
+
function setViewportWidth(width: number) {
|
|
20
|
+
Object.defineProperty(window, "innerWidth", {
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: width,
|
|
24
|
+
});
|
|
25
|
+
window.dispatchEvent(new Event("resize"));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
cleanup();
|
|
30
|
+
setViewportWidth(originalInnerWidth);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function ContentDialog({
|
|
34
|
+
phonePresentation,
|
|
35
|
+
onOpenChange,
|
|
36
|
+
}: {
|
|
37
|
+
phonePresentation?: DialogPhonePresentation;
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
39
|
+
}) {
|
|
40
|
+
const [open, setOpen] = useState(true);
|
|
41
|
+
return (
|
|
42
|
+
<Dialog
|
|
43
|
+
modal
|
|
44
|
+
open={open}
|
|
45
|
+
onOpenChange={(next) => {
|
|
46
|
+
setOpen(next);
|
|
47
|
+
onOpenChange?.(next);
|
|
48
|
+
}}
|
|
49
|
+
phonePresentation={phonePresentation}
|
|
50
|
+
>
|
|
51
|
+
<Dialog.Portal>
|
|
52
|
+
<DialogOverlay key="overlay" />
|
|
53
|
+
<DialogContent key="content" maxWidth={480}>
|
|
54
|
+
<Dialog.Title>Edit profile</Dialog.Title>
|
|
55
|
+
<Paragraph>Content dialog body</Paragraph>
|
|
56
|
+
</DialogContent>
|
|
57
|
+
</Dialog.Portal>
|
|
58
|
+
</Dialog>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const sheetFace = () => document.querySelector("[data-mp-dialog-face='sheet']");
|
|
63
|
+
const grabber = () => document.querySelector("[aria-label='Resize']");
|
|
64
|
+
const confirmFrame = () => document.querySelector("[data-mp-confirm-dialog]");
|
|
65
|
+
|
|
66
|
+
function centredFrameWith(text: string) {
|
|
67
|
+
return Array.from(document.querySelectorAll("[role='dialog'], [role='alertdialog']")).find(
|
|
68
|
+
(el) => el.textContent?.includes(text) && !el.closest("[data-mp-dialog-face]"),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function expectSheetHolding(text: string) {
|
|
73
|
+
await waitFor(() => expect(sheetFace()?.textContent).toContain(text));
|
|
74
|
+
expect(grabber()).not.toBeNull();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function expectCentredHolding(text: string) {
|
|
78
|
+
await waitFor(() => expect(document.body.textContent).toContain(text));
|
|
79
|
+
expect(sheetFace()).toBeNull();
|
|
80
|
+
expect(grabber()).toBeNull();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
describe("LC-269 a content dialog is a sheet at phone width", () => {
|
|
84
|
+
it("at 390 a house Dialog presents its content in the bottom sheet", async () => {
|
|
85
|
+
setViewportWidth(390);
|
|
86
|
+
renderWithProviders(<ContentDialog />);
|
|
87
|
+
await expectSheetHolding("Content dialog body");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("at 640, the pivot, it is still the sheet", async () => {
|
|
91
|
+
setViewportWidth(640);
|
|
92
|
+
renderWithProviders(<ContentDialog />);
|
|
93
|
+
await expectSheetHolding("Content dialog body");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("at 1440 the same dialog is the centred dialog (desktop unchanged)", async () => {
|
|
97
|
+
setViewportWidth(1440);
|
|
98
|
+
renderWithProviders(<ContentDialog />);
|
|
99
|
+
await expectCentredHolding("Content dialog body");
|
|
100
|
+
expect(centredFrameWith("Content dialog body")).toBeDefined();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('phonePresentation="dialog" ejects: centred at 390', async () => {
|
|
104
|
+
setViewportWidth(390);
|
|
105
|
+
renderWithProviders(<ContentDialog phonePresentation="dialog" />);
|
|
106
|
+
await expectCentredHolding("Content dialog body");
|
|
107
|
+
expect(centredFrameWith("Content dialog body")).toBeDefined();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("a dialog opened inside another overlay stays centred (LC-164: no sheet on a sheet)", async () => {
|
|
111
|
+
setViewportWidth(390);
|
|
112
|
+
renderWithProviders(
|
|
113
|
+
<OverlayStackProvider zIndex={100_000}>
|
|
114
|
+
<ContentDialog />
|
|
115
|
+
</OverlayStackProvider>,
|
|
116
|
+
);
|
|
117
|
+
await expectCentredHolding("Content dialog body");
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("Escape closes the sheet once", async () => {
|
|
121
|
+
setViewportWidth(390);
|
|
122
|
+
const onOpenChange = vi.fn();
|
|
123
|
+
renderWithProviders(<ContentDialog onOpenChange={onOpenChange} />);
|
|
124
|
+
await expectSheetHolding("Content dialog body");
|
|
125
|
+
fireEvent.keyDown(window, { key: "Escape" });
|
|
126
|
+
await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false));
|
|
127
|
+
expect(onOpenChange.mock.calls.filter(([next]) => next === false)).toHaveLength(1);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
function Confirm({ children, body }: { children?: ReactNode; body?: ReactNode }) {
|
|
132
|
+
return (
|
|
133
|
+
<ConfirmDialog
|
|
134
|
+
open
|
|
135
|
+
title="Jump to field"
|
|
136
|
+
body={body}
|
|
137
|
+
confirmLabel="Jump"
|
|
138
|
+
allowManyActions
|
|
139
|
+
onOpenChange={() => {}}
|
|
140
|
+
>
|
|
141
|
+
{children}
|
|
142
|
+
</ConfirmDialog>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
describe("LC-269 ConfirmDialog: alert-shaped stays an alert, content is a sheet", () => {
|
|
147
|
+
it("at 390 a title, one line and two actions stay a centred alert", async () => {
|
|
148
|
+
setViewportWidth(390);
|
|
149
|
+
renderWithProviders(<Confirm body="Your unsaved edits will be discarded." />);
|
|
150
|
+
await expectCentredHolding("Your unsaved edits will be discarded.");
|
|
151
|
+
expect(confirmFrame()?.getAttribute("role")).toBe("alertdialog");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it("at 390 a confirm holding a search and a list presents as the sheet", async () => {
|
|
155
|
+
setViewportWidth(390);
|
|
156
|
+
renderWithProviders(
|
|
157
|
+
<Confirm>
|
|
158
|
+
<input aria-label="Search fields" />
|
|
159
|
+
<Paragraph>Customer name</Paragraph>
|
|
160
|
+
</Confirm>,
|
|
161
|
+
);
|
|
162
|
+
await expectSheetHolding("Customer name");
|
|
163
|
+
expect(confirmFrame()).toBeNull();
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("at 1440 the content confirm is still the centred dialog", async () => {
|
|
167
|
+
setViewportWidth(1440);
|
|
168
|
+
renderWithProviders(
|
|
169
|
+
<Confirm>
|
|
170
|
+
<Paragraph>Customer name</Paragraph>
|
|
171
|
+
</Confirm>,
|
|
172
|
+
);
|
|
173
|
+
await expectCentredHolding("Customer name");
|
|
174
|
+
expect(confirmFrame()).not.toBeNull();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("classifies by shape", () => {
|
|
178
|
+
expect(confirmDialogPresentation({})).toBe("dialog");
|
|
179
|
+
expect(confirmDialogPresentation({ body: "One line." })).toBe("dialog");
|
|
180
|
+
expect(confirmDialogPresentation({ children: "One line." })).toBe("dialog");
|
|
181
|
+
expect(confirmDialogPresentation({ children: <Paragraph>List</Paragraph> })).toBe("sheet");
|
|
182
|
+
expect(confirmDialogPresentation({ body: "Wins", children: <Paragraph>List</Paragraph> })).toBe(
|
|
183
|
+
"dialog",
|
|
184
|
+
);
|
|
185
|
+
});
|
|
186
|
+
});
|
package/src/Dialog.tsx
CHANGED
|
@@ -16,17 +16,51 @@
|
|
|
16
16
|
* Their Portal binds the overlay stack (FZ-7869): a dialog opened from a sheet
|
|
17
17
|
* or another dialog sits one `$zIndex` step above it, and on native it would
|
|
18
18
|
* otherwise reach the root host with no zIndex and mount under the sheet.
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* LC-269 PHONE-DIALOG-AS-SHEET: at the overlay pivot and below (web 640, and
|
|
21
|
+
* every native window) the house Dialog is a content dialog, so its Portal
|
|
22
|
+
* presents in SheetModal: the bottom sheet on a phone, the width-capped panel
|
|
23
|
+
* at an iPad's regular width (FZ-8116). Desktop keeps the centred dialog.
|
|
24
|
+
* AlertDialog is the alert-shaped one and stays centred everywhere, as
|
|
25
|
+
* UIAlertController does. A dialog opened inside another overlay stays
|
|
26
|
+
* centred (LC-164: no sheet on a sheet), and `phonePresentation="dialog"`
|
|
27
|
+
* ejects. No tamagui Adapt: its content portal does not survive SheetModal's
|
|
28
|
+
* native window (a nested PortalProvider), so the Portal itself swaps hosts
|
|
29
|
+
* and the house DialogContent renders as the sheet's column and the house
|
|
30
|
+
* DialogOverlay as nothing (`DialogSheetFaceProvider`, theme). The raw
|
|
31
|
+
* tamagui Content and Overlay parts stay tamagui's.
|
|
20
32
|
*/
|
|
21
|
-
import {
|
|
22
|
-
|
|
33
|
+
import {
|
|
34
|
+
OverlayStackProvider,
|
|
35
|
+
overlayStackStep,
|
|
36
|
+
useOverlayParentZIndex,
|
|
37
|
+
useOverlayZIndex,
|
|
38
|
+
useViewportGtSm,
|
|
39
|
+
withOverlayStack,
|
|
40
|
+
} from "@multiplatform.one/forms";
|
|
41
|
+
import { DialogSheetFaceProvider } from "@multiplatform.one/theme";
|
|
42
|
+
import {
|
|
43
|
+
createContext,
|
|
44
|
+
forwardRef,
|
|
45
|
+
isValidElement,
|
|
46
|
+
useCallback,
|
|
47
|
+
useContext,
|
|
48
|
+
useImperativeHandle,
|
|
49
|
+
useRef,
|
|
50
|
+
useState,
|
|
51
|
+
type ComponentType,
|
|
52
|
+
type ReactNode,
|
|
53
|
+
} from "react";
|
|
23
54
|
import {
|
|
24
55
|
AlertDialog as TamaguiAlertDialog,
|
|
25
56
|
Dialog as TamaguiDialog,
|
|
57
|
+
SheetControllerContext,
|
|
26
58
|
withStaticProperties,
|
|
59
|
+
type DialogProps as TamaguiDialogProps,
|
|
27
60
|
type GetProps,
|
|
28
61
|
} from "tamagui";
|
|
29
62
|
import { useTranslation } from "./shared/i18n";
|
|
63
|
+
import { SheetModal } from "./SheetModal";
|
|
30
64
|
|
|
31
65
|
type Labelled = {
|
|
32
66
|
"aria-label"?: unknown;
|
|
@@ -75,9 +109,113 @@ function namedByContent<C extends ComponentType<any>>(Part: C, displayName: stri
|
|
|
75
109
|
return Close;
|
|
76
110
|
}
|
|
77
111
|
|
|
78
|
-
|
|
112
|
+
/**
|
|
113
|
+
* How a house Dialog presents at phone width (LC-269). `"sheet"`, the
|
|
114
|
+
* default, is a content dialog: SheetModal at the overlay pivot and below.
|
|
115
|
+
* `"dialog"` ejects and keeps the centred dialog at every width.
|
|
116
|
+
*/
|
|
117
|
+
export type DialogPhonePresentation = "sheet" | "dialog";
|
|
118
|
+
|
|
119
|
+
export type DialogProps = TamaguiDialogProps & {
|
|
120
|
+
phonePresentation?: DialogPhonePresentation;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
type DialogHandle = { open: (open: boolean) => void };
|
|
124
|
+
|
|
125
|
+
/** True where a house Dialog with this presentation draws as a sheet (LC-269). */
|
|
126
|
+
export function useDialogPresentsAsSheet(presentation: DialogPhonePresentation = "sheet"): boolean {
|
|
127
|
+
const wide = useViewportGtSm();
|
|
128
|
+
const nested = useOverlayParentZIndex() !== undefined;
|
|
129
|
+
return presentation === "sheet" && !wide && !nested;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type SheetPresentation = { open: boolean; dismiss: (open: boolean) => void };
|
|
133
|
+
|
|
134
|
+
const DialogSheetContext = createContext<SheetPresentation | null>(null);
|
|
135
|
+
|
|
136
|
+
const RootDialog = TamaguiDialog as unknown as ComponentType<
|
|
137
|
+
TamaguiDialogProps & { ref?: unknown }
|
|
138
|
+
>;
|
|
139
|
+
|
|
140
|
+
const DialogRoot = forwardRef<DialogHandle, DialogProps>(function Dialog(
|
|
141
|
+
{ phonePresentation = "sheet", children, open, defaultOpen, onOpenChange, ...props },
|
|
142
|
+
ref,
|
|
143
|
+
) {
|
|
144
|
+
const asSheet = useDialogPresentsAsSheet(phonePresentation);
|
|
145
|
+
const tamaguiRef = useRef<DialogHandle | null>(null);
|
|
146
|
+
useImperativeHandle(ref, () => ({ open: (next) => tamaguiRef.current?.open(next) }), []);
|
|
147
|
+
const [ownOpen, setOwnOpen] = useState(defaultOpen ?? false);
|
|
148
|
+
const isOpen = open ?? ownOpen;
|
|
149
|
+
// The web sheet reports one close from its Sheet and can report another
|
|
150
|
+
// from Escape; only the first may close it, or a consumer's onOpenChange
|
|
151
|
+
// (ConfirmDialog's onCancel) fires twice.
|
|
152
|
+
const openRef = useRef(isOpen);
|
|
153
|
+
openRef.current = isOpen;
|
|
154
|
+
const handleOpenChange = useCallback(
|
|
155
|
+
(next: boolean) => {
|
|
156
|
+
openRef.current = next;
|
|
157
|
+
setOwnOpen(next);
|
|
158
|
+
onOpenChange?.(next);
|
|
159
|
+
},
|
|
160
|
+
[onOpenChange],
|
|
161
|
+
);
|
|
162
|
+
const dismiss = useCallback((next: boolean) => {
|
|
163
|
+
if (next || !openRef.current) return;
|
|
164
|
+
tamaguiRef.current?.open(false);
|
|
165
|
+
}, []);
|
|
166
|
+
return (
|
|
167
|
+
<RootDialog
|
|
168
|
+
ref={tamaguiRef}
|
|
169
|
+
open={open}
|
|
170
|
+
defaultOpen={defaultOpen}
|
|
171
|
+
onOpenChange={handleOpenChange}
|
|
172
|
+
{...props}
|
|
173
|
+
>
|
|
174
|
+
<DialogSheetContext.Provider value={asSheet ? { open: isOpen, dismiss } : null}>
|
|
175
|
+
{children}
|
|
176
|
+
</DialogSheetContext.Provider>
|
|
177
|
+
</RootDialog>
|
|
178
|
+
);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
const StackedPortal = withOverlayStack(TamaguiDialog.Portal, "dropdown", "DialogPortal");
|
|
182
|
+
|
|
183
|
+
function DialogPortal(props: GetProps<typeof TamaguiDialog.Portal>) {
|
|
184
|
+
const sheet = useContext(DialogSheetContext);
|
|
185
|
+
const dialogZIndex = useOverlayZIndex("dropdown");
|
|
186
|
+
const [opened, setOpened] = useState(false);
|
|
187
|
+
if (sheet?.open && !opened) setOpened(true);
|
|
188
|
+
if (!sheet) return <StackedPortal {...props} />;
|
|
189
|
+
// A closed Sheet still mounts its frame off screen; a dialog that never
|
|
190
|
+
// opened mounts nothing, as tamagui's closed Dialog does.
|
|
191
|
+
if (!opened) return null;
|
|
192
|
+
// The sheet keeps the dialog's rung: SheetModal binds one step above the
|
|
193
|
+
// z it is opened from, so it lands on the dialog tier, covers a page sheet
|
|
194
|
+
// as a dialog does, and what it opens stacks one step above it (FZ-7869).
|
|
195
|
+
// tamagui's Dialog hands its subtree a hidden sheet controller while it is
|
|
196
|
+
// open and not adapted, which renders every Sheet under it as nothing; the
|
|
197
|
+
// null controller gives SheetModal (and any sheet in the content) its own.
|
|
198
|
+
return (
|
|
199
|
+
<SheetControllerContext.Provider value={null}>
|
|
200
|
+
<OverlayStackProvider zIndex={dialogZIndex - overlayStackStep()}>
|
|
201
|
+
<SheetModal open={sheet.open} onOpenChange={sheet.dismiss}>
|
|
202
|
+
<DialogSheetFaceProvider value>{props.children}</DialogSheetFaceProvider>
|
|
203
|
+
</SheetModal>
|
|
204
|
+
</OverlayStackProvider>
|
|
205
|
+
</SheetControllerContext.Provider>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
DialogPortal.displayName = "DialogPortal";
|
|
209
|
+
|
|
210
|
+
export const Dialog = withStaticProperties(DialogRoot, {
|
|
211
|
+
Trigger: TamaguiDialog.Trigger,
|
|
212
|
+
Portal: DialogPortal as unknown as typeof TamaguiDialog.Portal,
|
|
213
|
+
Overlay: TamaguiDialog.Overlay,
|
|
214
|
+
Content: TamaguiDialog.Content,
|
|
215
|
+
Title: TamaguiDialog.Title,
|
|
216
|
+
Description: TamaguiDialog.Description,
|
|
79
217
|
Close: namedByContent(TamaguiDialog.Close, "DialogClose"),
|
|
80
|
-
|
|
218
|
+
FocusScope: TamaguiDialog.FocusScope,
|
|
81
219
|
});
|
|
82
220
|
|
|
83
221
|
export const AlertDialog: typeof TamaguiAlertDialog = withStaticProperties(TamaguiAlertDialog, {
|
|
@@ -50,24 +50,16 @@ function Fixture({
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
describe("ThemePresetPicker", () => {
|
|
53
|
-
it("draws the LC-131 selected recipe and
|
|
53
|
+
it("draws the LC-131 selected recipe and wraps the preset chips under a visible label (FZ-8440)", () => {
|
|
54
54
|
render(<Fixture />);
|
|
55
55
|
const selected = screen.getByRole("button", { name: "Preset: Default" });
|
|
56
56
|
expect(selected.className).toContain("_bg-selectedBac");
|
|
57
57
|
expect(selected.className).toContain("_btc-transparent");
|
|
58
58
|
expect(selected.className).not.toContain("_btc-accentColor");
|
|
59
|
-
const row = screen.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
scrollHeight: { value: 40, configurable: true },
|
|
64
|
-
offsetHeight: { value: 40, configurable: true },
|
|
65
|
-
});
|
|
66
|
-
await act(async () => {
|
|
67
|
-
fireEvent.scroll(row, { target: { scrollLeft: 0 } });
|
|
68
|
-
await new Promise((resolve) => setTimeout(resolve, 120));
|
|
69
|
-
});
|
|
70
|
-
expect(screen.getByTestId("overflow-row-end-fade")).toBeDefined();
|
|
59
|
+
const row = screen.getByRole("group", { name: "Preset" });
|
|
60
|
+
expect(row.previousElementSibling?.textContent).toBe("Preset");
|
|
61
|
+
expect(row.className).toContain("_fwr-wrap");
|
|
62
|
+
expect(screen.queryByTestId("overflow-row-end-fade")).toBeNull();
|
|
71
63
|
});
|
|
72
64
|
|
|
73
65
|
it("lists registered presets at render time, including later registrations", () => {
|
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
type SchemePreference,
|
|
6
6
|
} from "@multiplatform.one/theme";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { YStack
|
|
9
|
-
import {
|
|
10
|
-
import { OverflowRow } from "../OverflowRow";
|
|
11
|
-
import { Paragraph } from "../Text";
|
|
8
|
+
import { YStack } from "tamagui";
|
|
9
|
+
import { ChoiceChips } from "../ChoiceChips";
|
|
12
10
|
|
|
13
11
|
export interface ThemePresetPickerProps {
|
|
14
12
|
rows?: ReadonlyArray<"scheme" | "preset">;
|
|
@@ -16,7 +14,6 @@ export interface ThemePresetPickerProps {
|
|
|
16
14
|
/** Signed-in owner; none records this device's signed-out choice. */
|
|
17
15
|
userId?: string | null;
|
|
18
16
|
testID?: string;
|
|
19
|
-
fadeColor?: ColorTokens;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
const titleCase = (name: string) =>
|
|
@@ -30,7 +27,6 @@ export function ThemePresetPicker({
|
|
|
30
27
|
useUserScheme = useSchemePreference,
|
|
31
28
|
userId,
|
|
32
29
|
testID = "theme-preset-picker",
|
|
33
|
-
fadeColor,
|
|
34
30
|
}: ThemePresetPickerProps) {
|
|
35
31
|
const { t } = useTranslation();
|
|
36
32
|
const scheme = useUserScheme();
|
|
@@ -40,43 +36,22 @@ export function ThemePresetPicker({
|
|
|
40
36
|
return (
|
|
41
37
|
<YStack testID={testID} gap="$3">
|
|
42
38
|
{rows.map((row) => {
|
|
43
|
-
const label = t(`themePresetPicker.${row}`, { defaultValue: titleCase(row) });
|
|
44
39
|
const options = row === "scheme" ? (["system", "light", "dark"] as const) : presets;
|
|
45
40
|
return (
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Chip
|
|
62
|
-
key={name}
|
|
63
|
-
aria-label={`${label}: ${optionLabel}`}
|
|
64
|
-
selected={(row === "scheme" ? scheme.setting : selectedPreset) === name}
|
|
65
|
-
onPress={() => {
|
|
66
|
-
if (
|
|
67
|
-
row === "scheme" &&
|
|
68
|
-
(name === "system" || name === "light" || name === "dark")
|
|
69
|
-
)
|
|
70
|
-
scheme.set(name);
|
|
71
|
-
else preset.choosePreset(name, userId ?? null);
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
{optionLabel}
|
|
75
|
-
</Chip>
|
|
76
|
-
);
|
|
77
|
-
})}
|
|
78
|
-
</OverflowRow>
|
|
79
|
-
</YStack>
|
|
41
|
+
<ChoiceChips
|
|
42
|
+
key={row}
|
|
43
|
+
label={t(`themePresetPicker.${row}`, { defaultValue: titleCase(row) })}
|
|
44
|
+
options={options.map((name) => ({
|
|
45
|
+
value: name,
|
|
46
|
+
label: t(`themePresetPicker.${row}s.${name}`, { defaultValue: titleCase(name) }),
|
|
47
|
+
}))}
|
|
48
|
+
value={row === "scheme" ? scheme.setting : selectedPreset}
|
|
49
|
+
onChange={(name) => {
|
|
50
|
+
if (row === "scheme" && (name === "system" || name === "light" || name === "dark"))
|
|
51
|
+
scheme.set(name);
|
|
52
|
+
else preset.choosePreset(name, userId ?? null);
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
80
55
|
);
|
|
81
56
|
})}
|
|
82
57
|
</YStack>
|