@multiplatform.one/components 7.74.0 → 7.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Accordion/index.cjs +23 -37
- package/dist/cjs/Accordion/index.native.js +34 -48
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/AnimateHeight/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Badge/index.native.js.map +1 -1
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/CardFooter.native.js.map +1 -1
- package/dist/cjs/CardHeader.cjs +1 -0
- package/dist/cjs/CardHeader.native.js +1 -0
- package/dist/cjs/CardHeader.native.js.map +1 -1
- package/dist/cjs/Carousel/index.native.js +3 -3
- package/dist/cjs/Carousel/index.native.js.map +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/Collapsible.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/DotIndicator/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/cjs/ErrorBoundary/index.native.js.map +1 -1
- package/dist/cjs/Heading.native.js.map +1 -1
- package/dist/cjs/Kbd/index.native.js.map +1 -1
- package/dist/cjs/Kbd/keys.native.js.map +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.native.js +1 -1
- package/dist/cjs/Lightbox/shared.native.js.map +1 -1
- package/dist/cjs/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/cjs/Material/index.native.js.map +1 -1
- package/dist/cjs/Meter/index.native.js +1 -1
- package/dist/cjs/Meter/index.native.js.map +1 -1
- package/dist/cjs/Meter/meter.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.native.js +1 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.native.js +1 -1
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Popover.native.js +1 -1
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/ProgressSteps/index.native.js.map +1 -1
- package/dist/cjs/Quote/index.native.js.map +1 -1
- package/dist/cjs/SchemeToggle/index.native.js +1 -1
- package/dist/cjs/SchemeToggle/index.native.js.map +1 -1
- package/dist/cjs/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/cjs/Separator/index.native.js.map +1 -1
- package/dist/cjs/Sheet.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.cjs +28 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js +30 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/cjs/SheetModal/detents.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +5 -1
- package/dist/cjs/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/cjs/Skeleton/index.native.js.map +1 -1
- package/dist/cjs/SkipLink/index.native.js.map +1 -1
- package/dist/cjs/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/cjs/SortableList/index.native.js.map +1 -1
- package/dist/cjs/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/cjs/Tabs/index.native.js +1 -1
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.native.js.map +1 -1
- package/dist/cjs/ThemePresetPicker/index.native.js +2 -2
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/Toast/index.native.js.map +1 -1
- package/dist/cjs/Toast/store.native.js.map +1 -1
- package/dist/cjs/Tooltip/nativePress.native.js.map +1 -1
- package/dist/cjs/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/cjs/TreeSelect/index.native.js +1 -1
- package/dist/cjs/TreeSelect/index.native.js.map +1 -1
- package/dist/cjs/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/cjs/Video/PlayerChrome.native.js.map +1 -1
- package/dist/cjs/Video/VideoFrame.native.js.map +1 -1
- package/dist/cjs/Video/types.native.js.map +1 -1
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/Wizard/index.native.js +2 -2
- package/dist/cjs/Wizard/index.native.js.map +1 -1
- package/dist/cjs/actions/ActionBar.native.js.map +1 -1
- package/dist/cjs/actions/DangerSection.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.native.js.map +1 -1
- package/dist/cjs/actions/HeaderActions.native.js +2 -2
- package/dist/cjs/actions/HeaderActions.native.js.map +1 -1
- package/dist/cjs/actions/StandardAction.cjs +26 -2
- package/dist/cjs/actions/StandardAction.native.js +31 -3
- package/dist/cjs/actions/StandardAction.native.js.map +1 -1
- package/dist/cjs/actions/devWarn.native.js.map +1 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/actions/severity.native.js.map +1 -1
- package/dist/cjs/appShell/Dock.native.js.map +1 -1
- package/dist/cjs/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/cjs/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/cjs/appShell/Springboard.native.js +1 -1
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabBar.native.js +1 -1
- package/dist/cjs/appShell/TabBar.native.js.map +1 -1
- package/dist/cjs/appShell/appTile.native.js +1 -1
- package/dist/cjs/appShell/appTile.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.native.js +1 -1
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/charts/ChartSurface.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/PieChart.native.js.map +1 -1
- package/dist/cjs/charts/Sparkline.native.js.map +1 -1
- package/dist/cjs/charts/accessibility.native.js.map +1 -1
- package/dist/cjs/charts/chartHeight.native.js.map +1 -1
- package/dist/cjs/charts/composeChart.native.js.map +1 -1
- package/dist/cjs/charts/index.native.js.map +1 -1
- package/dist/cjs/charts/math.native.js.map +1 -1
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/charts/svg.native.js.map +1 -1
- package/dist/cjs/charts/types.native.js.map +1 -1
- package/dist/cjs/charts/useChartTheme.native.js.map +1 -1
- package/dist/cjs/code/Code/index.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.native.js +7 -7
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/cjs/code/Pre/index.native.js.map +1 -1
- package/dist/cjs/code/index.native.js +5 -5
- package/dist/cjs/code/index.native.js.map +1 -1
- package/dist/cjs/componentColors.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/NotifyHost.native.js +2 -2
- package/dist/cjs/feedback/NotifyHost.native.js.map +1 -1
- package/dist/cjs/feedback/copy.native.js.map +1 -1
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/feedback/notify.native.js.map +1 -1
- package/dist/cjs/feedback/route.native.js.map +1 -1
- package/dist/cjs/feedback/store.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/cjs/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/cjs/formLayouts/index.native.js.map +1 -1
- package/dist/cjs/hooks/index.native.js +1 -1
- package/dist/cjs/hooks/index.native.js.map +1 -1
- package/dist/cjs/hooks/useClipboard.native.js.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/cjs/hooks/useHoldCue.native.js.map +1 -1
- package/dist/cjs/icons/CheckRegular.native.js.map +1 -1
- package/dist/cjs/icons/MinusRegular.native.js.map +1 -1
- package/dist/cjs/icons/index.native.js.map +1 -1
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.native.js.map +1 -1
- package/dist/cjs/images/Image/index.native.js +1 -1
- package/dist/cjs/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/cjs/images/Image/shared.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/images/Image/types.native.js.map +1 -1
- package/dist/cjs/images/index.native.js.map +1 -1
- package/dist/cjs/index.native.js +36 -36
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +2 -2
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/Debug/index.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/cjs/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/cjs/layouts/StatusDot.native.js.map +1 -1
- package/dist/cjs/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.native.js +1 -1
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/bottomAccessory.native.js.map +1 -1
- package/dist/cjs/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/cjs/layouts/index.native.js +3 -3
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +119 -2
- package/dist/cjs/layouts/page.native.js +124 -4
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.cjs +20 -0
- package/dist/cjs/layouts/screenScroll.native.js +29 -0
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/cjs/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.cjs +26 -4
- package/dist/cjs/layouts/sidebar.native.js +31 -6
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.native.js +2 -2
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.native.js +2 -2
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.native.js +1 -1
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/shared/actionScan.native.js.map +1 -1
- package/dist/cjs/shared/i18n.native.js.map +1 -1
- package/dist/cjs/shared/restoreRetries.native.js.map +1 -1
- package/dist/cjs/shared/t.native.js.map +1 -1
- package/dist/cjs/shared/textRidesText.native.js.map +1 -1
- package/dist/cjs/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/tamagui.native.js +1 -1
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/cjs/testSetup.native.js.map +1 -1
- package/dist/cjs/utils/setTinted.native.js.map +1 -1
- package/dist/cjs/utils/unwrapText.native.js.map +1 -1
- package/dist/cjs/views/Calendar.native.js +1 -1
- package/dist/cjs/views/Calendar.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.native.js +2 -2
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/Gantt.native.js +2 -2
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/GanttDateGrip.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.native.js +2 -2
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/Kanban.native.js +1 -1
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ListRow.cjs +2 -1
- package/dist/cjs/views/ListRow.native.js +2 -1
- package/dist/cjs/views/ListRow.native.js.map +1 -1
- package/dist/cjs/views/Matrix.native.js +2 -2
- package/dist/cjs/views/Matrix.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +2 -2
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -1
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/calendarMath.native.js.map +1 -1
- package/dist/cjs/views/ganttIntervals.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.native.js +1 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/kanbanDnd.native.js.map +1 -1
- package/dist/cjs/views/matrixMath.native.js.map +1 -1
- package/dist/cjs/views/treeViewDnd.native.js.map +1 -1
- package/dist/cjs/views/treeViewLayout.native.js.map +1 -1
- package/dist/cjs/views/treeViewMotion.native.js.map +1 -1
- package/dist/cjs/views/treeViewReveal.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.native.js.map +1 -1
- package/dist/esm/Accordion/index.mjs +23 -37
- package/dist/esm/Accordion/index.mjs.map +1 -1
- package/dist/esm/Accordion/index.native.js +33 -47
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/CardHeader.mjs +1 -0
- package/dist/esm/CardHeader.mjs.map +1 -1
- package/dist/esm/CardHeader.native.js +1 -0
- package/dist/esm/CardHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.mjs +29 -3
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +29 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +8 -4
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.mjs +28 -4
- package/dist/esm/actions/StandardAction.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.native.js +32 -4
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +120 -4
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +123 -4
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.mjs +21 -2
- package/dist/esm/layouts/screenScroll.mjs.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js +30 -2
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.mjs +26 -4
- package/dist/esm/layouts/sidebar.mjs.map +1 -1
- package/dist/esm/layouts/sidebar.native.js +30 -5
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/views/ListRow.mjs +2 -1
- package/dist/esm/views/ListRow.mjs.map +1 -1
- package/dist/esm/views/ListRow.native.js +2 -1
- package/dist/esm/views/ListRow.native.js.map +1 -1
- package/dist/jsx/Accordion/index.mjs +23 -37
- package/dist/jsx/Accordion/index.mjs.map +1 -1
- package/dist/jsx/Accordion/index.native.js +33 -47
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/CardHeader.mjs +1 -0
- package/dist/jsx/CardHeader.mjs.map +1 -1
- package/dist/jsx/CardHeader.native.js +1 -0
- package/dist/jsx/CardHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs +29 -3
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +30 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +8 -4
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/actions/StandardAction.mjs +28 -4
- package/dist/jsx/actions/StandardAction.mjs.map +1 -1
- package/dist/jsx/actions/StandardAction.native.js +30 -2
- package/dist/jsx/actions/StandardAction.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +120 -4
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +122 -2
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.mjs +21 -2
- package/dist/jsx/layouts/screenScroll.mjs.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js +29 -0
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/sidebar.mjs +26 -4
- package/dist/jsx/layouts/sidebar.mjs.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js +30 -5
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/views/ListRow.mjs +2 -1
- package/dist/jsx/views/ListRow.mjs.map +1 -1
- package/dist/jsx/views/ListRow.native.js +2 -1
- package/dist/jsx/views/ListRow.native.js.map +1 -1
- package/package.json +9 -9
- package/src/Accordion/Accordion.spec.tsx +6 -7
- package/src/Accordion/index.tsx +30 -45
- package/src/CardHeader.spec.tsx +11 -8
- package/src/CardHeader.tsx +3 -0
- package/src/ContextMenu/ContextMenu.spec.tsx +4 -5
- package/src/DropdownMenu/DropdownMenu.spec.tsx +3 -4
- package/src/SheetModal/SheetHeader.tsx +55 -1
- package/src/SheetModal/SheetModal.menus.spec.tsx +2 -2
- package/src/SheetModal/SheetModal.stories.spec.tsx +23 -0
- package/src/SheetModal/SheetModal.stories.tsx +53 -6
- package/src/SheetModal/index.tsx +13 -5
- package/src/actions/StandardAction.tsx +29 -4
- package/src/checkedRow.native-press.spec.tsx +136 -0
- package/src/checkedRow.spec.tsx +4 -3
- package/src/icons/slots.nativeInk.spec.tsx +1 -1
- package/src/layouts/Sidebar.spec.tsx +34 -0
- package/src/layouts/navBar.spec.tsx +28 -0
- package/src/layouts/page.tsx +127 -4
- package/src/layouts/screenNesting.spec.tsx +201 -0
- package/src/layouts/screenScroll.tsx +23 -0
- package/src/layouts/sidebar.tsx +30 -0
- package/src/views/ListGroup.spec.tsx +14 -0
- package/src/views/ListRow.tsx +12 -2
- package/types/Accordion/index.d.ts.map +1 -1
- package/types/CardHeader.d.ts.map +1 -1
- package/types/SheetModal/SheetHeader.d.ts +8 -1
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/SheetModal/index.d.ts +5 -1
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/actions/StandardAction.d.ts.map +1 -1
- package/types/layouts/page.d.ts +14 -21
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/screenScroll.d.ts +8 -0
- package/types/layouts/screenScroll.d.ts.map +1 -1
- package/types/layouts/sidebar.d.ts +12 -1
- package/types/layouts/sidebar.d.ts.map +1 -1
- package/types/views/ListRow.d.ts +3 -1
- package/types/views/ListRow.d.ts.map +1 -1
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
import { IconButtonGroup } from "@multiplatform.one/forms";
|
|
2
2
|
import { Surface } from "@multiplatform.one/theme";
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
Children,
|
|
5
|
+
Fragment,
|
|
6
|
+
cloneElement,
|
|
7
|
+
isValidElement,
|
|
8
|
+
type ReactElement,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from "react";
|
|
4
11
|
import { View, XStack } from "tamagui";
|
|
12
|
+
import { OverlayHeader, type OverlayHeaderProps } from "../actions/StandardAction";
|
|
13
|
+
|
|
14
|
+
function countItems(node: ReactNode): number {
|
|
15
|
+
return Children.toArray(node).reduce<number>(
|
|
16
|
+
(count, child) =>
|
|
17
|
+
count +
|
|
18
|
+
(isValidElement<{ children?: ReactNode }>(child) && child.type === Fragment
|
|
19
|
+
? countItems(child.props.children)
|
|
20
|
+
: 1),
|
|
21
|
+
0,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function isOverlayHeader(node: ReactNode): node is ReactElement<OverlayHeaderProps> {
|
|
26
|
+
return isValidElement(node) && node.type === OverlayHeader;
|
|
27
|
+
}
|
|
5
28
|
|
|
6
29
|
/**
|
|
7
30
|
* The sheet's header row: what the sheet is about, and its frequent actions as
|
|
8
31
|
* icon buttons in the trailing area (LC-262 DIRECT-ACTIONS), never hidden in a
|
|
9
32
|
* menu. The actions are a bar (LC-153), so they take the bar tint (LC-176).
|
|
33
|
+
*
|
|
34
|
+
* An `OverlayHeader` is the sheet's bar (FZ-8439, the iOS 26 sheet): ✕ leading,
|
|
35
|
+
* the accent ✓ trailing, and `actions` between the title and the ✓, so the
|
|
36
|
+
* confirm keeps the trailing edge. A lone action is not a group: on iOS its
|
|
37
|
+
* glass is the same circle as the ✕, not a capsule.
|
|
10
38
|
*/
|
|
11
39
|
export function SheetHeader({
|
|
12
40
|
header,
|
|
@@ -18,6 +46,32 @@ export function SheetHeader({
|
|
|
18
46
|
/** Names the sheet: on the header content alone, so the actions stay out of it. */
|
|
19
47
|
titleId?: string;
|
|
20
48
|
}) {
|
|
49
|
+
if (isOverlayHeader(header)) {
|
|
50
|
+
const own = header.props.actions;
|
|
51
|
+
return (
|
|
52
|
+
<Surface bar>
|
|
53
|
+
{actions
|
|
54
|
+
? cloneElement(header, {
|
|
55
|
+
actions: (
|
|
56
|
+
<XStack testID="sheet-modal-header-actions" flexShrink={0} alignItems="center">
|
|
57
|
+
{countItems(own) + countItems(actions) > 1 ? (
|
|
58
|
+
<IconButtonGroup>
|
|
59
|
+
{own}
|
|
60
|
+
{actions}
|
|
61
|
+
</IconButtonGroup>
|
|
62
|
+
) : (
|
|
63
|
+
<>
|
|
64
|
+
{own}
|
|
65
|
+
{actions}
|
|
66
|
+
</>
|
|
67
|
+
)}
|
|
68
|
+
</XStack>
|
|
69
|
+
),
|
|
70
|
+
})
|
|
71
|
+
: header}
|
|
72
|
+
</Surface>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
21
75
|
if (!actions) return <>{header}</>;
|
|
22
76
|
return (
|
|
23
77
|
<XStack alignItems="center" gap="$2">
|
|
@@ -335,8 +335,8 @@ describe("LC-262 inside a sheet at 390 (FZ-7830 round 2)", () => {
|
|
|
335
335
|
expect(rows.length).toBe(5);
|
|
336
336
|
expect(rows.every((r) => r.querySelector("svg"))).toBe(true);
|
|
337
337
|
const chosen = rows.find((r) => r.getAttribute("aria-selected") === "true") as HTMLElement;
|
|
338
|
-
// The check on the light checked
|
|
339
|
-
expect(chosen.className).toMatch(/(?:^| )_bg-
|
|
338
|
+
// The check on the light checked tint marks it (LC-262, FZ-8355 r6, FZ-8557).
|
|
339
|
+
expect(chosen.className).toMatch(/(?:^| )_bg-color3(?: |$)/);
|
|
340
340
|
expect(chosen.querySelectorAll("svg").length).toBe(2);
|
|
341
341
|
});
|
|
342
342
|
|
|
@@ -13,6 +13,7 @@ import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
|
13
13
|
import { cleanup, fireEvent, screen } from "@testing-library/react";
|
|
14
14
|
import { afterEach, describe, expect, it } from "vitest";
|
|
15
15
|
import meta, {
|
|
16
|
+
ConfirmWithActions,
|
|
16
17
|
Default,
|
|
17
18
|
OpenOnMount,
|
|
18
19
|
OwnedMeasuredViewport,
|
|
@@ -57,6 +58,28 @@ describe("SheetModal stories", () => {
|
|
|
57
58
|
expect(move[0]!.getAttribute("data-mp-icon-button")).toBe("primary");
|
|
58
59
|
});
|
|
59
60
|
|
|
61
|
+
it("FZ-8439: ✕ leads, the accent ✓ trails, and the body has no Cancel/confirm row", () => {
|
|
62
|
+
renderWithProviders(<>{OpenOnMount.render?.({} as never, {} as never)}</>);
|
|
63
|
+
const header = document.querySelector('[data-mp-overlay-header="confirm"]')!;
|
|
64
|
+
const buttons = Array.from(header.querySelectorAll('[role="button"]'));
|
|
65
|
+
expect(buttons[0]!.getAttribute("aria-label")).toBe("Cancel");
|
|
66
|
+
expect(buttons.at(-1)!.getAttribute("aria-label")).toBe("Move");
|
|
67
|
+
expect(screen.queryAllByText(/^(Cancel|Move)$/)).toHaveLength(0);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("FZ-8439: header actions sit between the title and the ✓, so the confirm keeps the trailing edge", () => {
|
|
71
|
+
renderWithProviders(<>{ConfirmWithActions.render?.({} as never, {} as never)}</>);
|
|
72
|
+
const header = document.querySelector('[data-mp-overlay-header="confirm"]')!;
|
|
73
|
+
const names = Array.from(header.querySelectorAll('[role="button"]')).map((button) =>
|
|
74
|
+
button.getAttribute("aria-label"),
|
|
75
|
+
);
|
|
76
|
+
expect(names[0]).toBe("Cancel");
|
|
77
|
+
expect(names.at(-1)).toBe("Save");
|
|
78
|
+
expect(names.indexOf("Share")).toBeGreaterThan(0);
|
|
79
|
+
expect(names.indexOf("Share")).toBeLessThan(names.length - 1);
|
|
80
|
+
expect(screen.getAllByRole("dialog", { name: "Edit document" }).length).toBeGreaterThan(0);
|
|
81
|
+
});
|
|
82
|
+
|
|
60
83
|
it("the scrollable story fills the body with rows", () => {
|
|
61
84
|
renderWithProviders(<>{Scrollable.render?.({} as never, {} as never)}</>);
|
|
62
85
|
expect(screen.getAllByText("Project 1").length).toBeGreaterThan(0);
|
|
@@ -10,6 +10,8 @@ import { Button, Input, Select } from "@multiplatform.one/forms";
|
|
|
10
10
|
import {
|
|
11
11
|
ArrowClockwiseIcon,
|
|
12
12
|
CloudArrowUpIcon,
|
|
13
|
+
ExportIcon,
|
|
14
|
+
FolderIcon,
|
|
13
15
|
GlobeIcon,
|
|
14
16
|
HouseIcon,
|
|
15
17
|
LockIcon,
|
|
@@ -30,6 +32,12 @@ import { OverlayHeader } from "../actions/StandardAction";
|
|
|
30
32
|
import { SheetModal } from "./index";
|
|
31
33
|
import { Paragraph, SizableText } from "../Text";
|
|
32
34
|
|
|
35
|
+
const projectOptions = ["Inbox", "Launch", "Backlog", "Archive"].map((label) => ({
|
|
36
|
+
label,
|
|
37
|
+
value: label.toLowerCase(),
|
|
38
|
+
icon: <FolderIcon />,
|
|
39
|
+
}));
|
|
40
|
+
|
|
33
41
|
function Harness({
|
|
34
42
|
scrollable = false,
|
|
35
43
|
snapPoint,
|
|
@@ -40,6 +48,7 @@ function Harness({
|
|
|
40
48
|
startOpen?: boolean;
|
|
41
49
|
}) {
|
|
42
50
|
const [open, setOpen] = useState(startOpen);
|
|
51
|
+
const [project, setProject] = useState("launch");
|
|
43
52
|
return (
|
|
44
53
|
<YStack minHeight={480} gap="$3">
|
|
45
54
|
<Button onPress={() => setOpen(true)}>Open sheet</Button>
|
|
@@ -68,11 +77,12 @@ function Harness({
|
|
|
68
77
|
))}
|
|
69
78
|
</YStack>
|
|
70
79
|
) : (
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
<Select
|
|
81
|
+
label="Project"
|
|
82
|
+
options={projectOptions}
|
|
83
|
+
value={project}
|
|
84
|
+
onValueChange={(value) => setProject(value as string)}
|
|
85
|
+
/>
|
|
76
86
|
)}
|
|
77
87
|
</SheetModal>
|
|
78
88
|
</YStack>
|
|
@@ -88,7 +98,7 @@ const meta: Meta<typeof SheetModal> = {
|
|
|
88
98
|
docs: {
|
|
89
99
|
description: {
|
|
90
100
|
component:
|
|
91
|
-
"Modal bottom sheet. Anatomy follows the Apple HIG sheet (grabber, percent detent, swipe to dismiss) with Radix Dialog semantics: `role=dialog`, `aria-modal`, focus moved in, trapped, and returned on close, and Escape dismissal wired here because tamagui's Sheet has no key handling of its own.
|
|
101
|
+
"Modal bottom sheet. Anatomy follows the Apple HIG sheet (grabber, percent detent, swipe to dismiss) with Radix Dialog semantics: `role=dialog`, `aria-modal`, focus moved in, trapped, and returned on close, and Escape dismissal wired here because tamagui's Sheet has no key handling of its own. A sheet that confirms carries its Cancel and confirm in the header as `OverlayHeader`: ✕ leading, the accent ✓ trailing, never a Cancel/confirm row in the body (FZ-8439). Web renders tamagui's Sheet; the native twin is an RN Modal, because a raw Sheet cannot re-present from a trigger tap on device.",
|
|
92
102
|
},
|
|
93
103
|
},
|
|
94
104
|
},
|
|
@@ -129,6 +139,43 @@ export const OpenOnMount: Story = {
|
|
|
129
139
|
render: () => <Harness startOpen />,
|
|
130
140
|
};
|
|
131
141
|
|
|
142
|
+
/**
|
|
143
|
+
* FZ-8439: a confirming sheet with frequent actions. ✕ Cancel leads, Share
|
|
144
|
+
* sits between the title and the ✓, and Save keeps the trailing edge.
|
|
145
|
+
*/
|
|
146
|
+
function ConfirmWithActionsHarness() {
|
|
147
|
+
const [open, setOpen] = useState(true);
|
|
148
|
+
const [name, setName] = useState("Launch plan");
|
|
149
|
+
return (
|
|
150
|
+
<YStack minHeight={480} gap="$3">
|
|
151
|
+
<Button onPress={() => setOpen(true)}>Open sheet</Button>
|
|
152
|
+
<SheetModal
|
|
153
|
+
open={open}
|
|
154
|
+
onOpenChange={setOpen}
|
|
155
|
+
header={
|
|
156
|
+
<OverlayHeader
|
|
157
|
+
title="Edit document"
|
|
158
|
+
closeKind="cancel"
|
|
159
|
+
onClose={() => setOpen(false)}
|
|
160
|
+
onConfirm={() => setOpen(false)}
|
|
161
|
+
confirmKind="save"
|
|
162
|
+
/>
|
|
163
|
+
}
|
|
164
|
+
headerActions={
|
|
165
|
+
<HeaderActions actions={[{ icon: ExportIcon, label: "Share", onPress: noop }]} />
|
|
166
|
+
}
|
|
167
|
+
>
|
|
168
|
+
<Input label="Name" value={name} onChangeText={setName} />
|
|
169
|
+
</SheetModal>
|
|
170
|
+
</YStack>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export const ConfirmWithActions: Story = {
|
|
175
|
+
name: "Confirm with header actions",
|
|
176
|
+
render: () => <ConfirmWithActionsHarness />,
|
|
177
|
+
};
|
|
178
|
+
|
|
132
179
|
const exposureOptions = [
|
|
133
180
|
{ label: "Private", value: "private", icon: <LockIcon /> },
|
|
134
181
|
{ label: "Tailnet", value: "tailnet", icon: <ShieldCheckIcon /> },
|
package/src/SheetModal/index.tsx
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
import { transitionProps, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
13
13
|
import { OverlayStackProvider, useOverlayZIndex } from "@multiplatform.one/forms";
|
|
14
|
-
import {
|
|
14
|
+
import { useEffect, useId, useRef, type ReactNode } from "react";
|
|
15
15
|
import { isWeb, Sheet, View, useWindowDimensions } from "tamagui";
|
|
16
|
-
import {
|
|
16
|
+
import { OverlayTitleIdContext } from "../actions/StandardAction";
|
|
17
17
|
import { DialogRegionContext, SheetFrame } from "../surfaces";
|
|
18
18
|
import { largeDetentRatio, resolveWebSnap } from "./detents";
|
|
19
|
-
import { SheetHeader } from "./SheetHeader";
|
|
19
|
+
import { isOverlayHeader, SheetHeader } from "./SheetHeader";
|
|
20
20
|
import { SheetNavigation } from "./SheetNavigation";
|
|
21
21
|
import { useSheetFrameFocus } from "./useSheetFrameFocus";
|
|
22
22
|
|
|
@@ -24,7 +24,11 @@ export interface SheetModalProps {
|
|
|
24
24
|
open: boolean;
|
|
25
25
|
onOpenChange: (open: boolean) => void;
|
|
26
26
|
children?: ReactNode;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Fixed content above the (scrollable) body. A sheet that confirms or
|
|
29
|
+
* dismisses passes `OverlayHeader`: ✕ leading, the accent ✓ trailing, the
|
|
30
|
+
* title between (FZ-8439). Its body holds no Cancel/confirm row.
|
|
31
|
+
*/
|
|
28
32
|
header?: ReactNode;
|
|
29
33
|
/**
|
|
30
34
|
* The sheet's frequent actions, as icon buttons in the header's trailing
|
|
@@ -93,7 +97,7 @@ export function SheetModal({
|
|
|
93
97
|
fill = false,
|
|
94
98
|
}: SheetModalProps) {
|
|
95
99
|
const titleId = useId();
|
|
96
|
-
const overlayHeader =
|
|
100
|
+
const overlayHeader = isOverlayHeader(headerContent);
|
|
97
101
|
const header =
|
|
98
102
|
headerContent || headerActions ? (
|
|
99
103
|
<SheetHeader
|
|
@@ -136,6 +140,10 @@ export function SheetModal({
|
|
|
136
140
|
height={5}
|
|
137
141
|
width={36}
|
|
138
142
|
borderRadius={100}
|
|
143
|
+
marginBottom={0}
|
|
144
|
+
marginHorizontal={0}
|
|
145
|
+
alignSelf="center"
|
|
146
|
+
y={10}
|
|
139
147
|
aria-label="Resize"
|
|
140
148
|
/>
|
|
141
149
|
<SheetFrame
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type StandardActionKind,
|
|
16
16
|
} from "@multiplatform.one/forms";
|
|
17
17
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
18
|
-
import { createContext, useContext, type ReactNode } from "react";
|
|
18
|
+
import { createContext, useContext, useState, type ReactNode } from "react";
|
|
19
19
|
import { XStack, isWeb } from "tamagui";
|
|
20
20
|
import { useTranslation } from "../shared/i18n";
|
|
21
21
|
import { SizableText } from "../Text";
|
|
@@ -126,6 +126,14 @@ export function OverlayHeader({
|
|
|
126
126
|
const { knobProps } = useResolvedKnobs();
|
|
127
127
|
const titleId = useContext(OverlayTitleIdContext);
|
|
128
128
|
const confirms = onConfirm != null;
|
|
129
|
+
// iOS centres a sheet's title on the bar, so both sides take the wider
|
|
130
|
+
// side's width however many actions trail.
|
|
131
|
+
const [leading, setLeading] = useState(0);
|
|
132
|
+
const [trailing, setTrailing] = useState(0);
|
|
133
|
+
const sideWidth = Math.max(leading, trailing);
|
|
134
|
+
const measure =
|
|
135
|
+
(set: (width: number) => void) => (event: { nativeEvent: { layout: { width: number } } }) =>
|
|
136
|
+
set(Math.ceil(event.nativeEvent.layout.width));
|
|
129
137
|
const heading =
|
|
130
138
|
typeof title === "string" ? (
|
|
131
139
|
<SizableText
|
|
@@ -168,7 +176,13 @@ export function OverlayHeader({
|
|
|
168
176
|
data-mp-overlay-header={confirms ? "confirm" : "dismiss"}
|
|
169
177
|
testID={testID}
|
|
170
178
|
>
|
|
171
|
-
{confirms ?
|
|
179
|
+
{confirms ? (
|
|
180
|
+
<XStack minWidth={sideWidth} alignItems="center">
|
|
181
|
+
<XStack alignItems="center" onLayout={measure(setLeading)}>
|
|
182
|
+
{close}
|
|
183
|
+
</XStack>
|
|
184
|
+
</XStack>
|
|
185
|
+
) : null}
|
|
172
186
|
<XStack
|
|
173
187
|
id={titleId}
|
|
174
188
|
flex={1}
|
|
@@ -178,8 +192,19 @@ export function OverlayHeader({
|
|
|
178
192
|
>
|
|
179
193
|
{heading}
|
|
180
194
|
</XStack>
|
|
181
|
-
{
|
|
182
|
-
|
|
195
|
+
{confirms ? (
|
|
196
|
+
<XStack minWidth={sideWidth} alignItems="center" justifyContent="flex-end">
|
|
197
|
+
<XStack alignItems="center" onLayout={measure(setTrailing)} {...knobProps.gap}>
|
|
198
|
+
{actions}
|
|
199
|
+
{confirm}
|
|
200
|
+
</XStack>
|
|
201
|
+
</XStack>
|
|
202
|
+
) : (
|
|
203
|
+
<>
|
|
204
|
+
{actions}
|
|
205
|
+
{close}
|
|
206
|
+
</>
|
|
207
|
+
)}
|
|
183
208
|
</XStack>
|
|
184
209
|
);
|
|
185
210
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-8557, under tamagui's NATIVE build (vitest.native.config.mjs) with the
|
|
3
|
+
* React Native animation driver every MPO app runs on a phone.
|
|
4
|
+
*
|
|
5
|
+
* A checked menu row paints the theme's selection tint on native (LC-262):
|
|
6
|
+
* `$color5` over the dark `$color4` overlay, `$color3` over the light panel.
|
|
7
|
+
* On iOS the appearance menu's checked "Dark" row painted the page colour, a
|
|
8
|
+
* hole through the panel that hid its rounded bottom (FZ-8550 KS sim, main
|
|
9
|
+
* before this lane, when dark rested on `$color2`).
|
|
10
|
+
*/
|
|
11
|
+
import { createDefaultThemeConfig, nativeAnimationConfig } from "@multiplatform.one/theme";
|
|
12
|
+
import { Button } from "@multiplatform.one/forms";
|
|
13
|
+
import { createAnimations } from "@tamagui/animations-react-native";
|
|
14
|
+
import { act, cleanup, render, screen } from "@testing-library/react";
|
|
15
|
+
import type { ReactNode } from "react";
|
|
16
|
+
import { TamaguiProvider, YStack, isWeb } from "tamagui";
|
|
17
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
18
|
+
import { ContextMenu } from "./ContextMenu";
|
|
19
|
+
|
|
20
|
+
vi.mock("@multiplatform.one/theme", async (original) => ({
|
|
21
|
+
...(await original<typeof import("@multiplatform.one/theme")>()),
|
|
22
|
+
transitionProps: (await import("@multiplatform.one/theme/src/theme/transitionProps.native"))
|
|
23
|
+
.transitionProps,
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
// The harness resolves forms web-first, and the web panel portals out of the
|
|
27
|
+
// menu's context under tamagui's native build. The phone's panel is a Modal
|
|
28
|
+
// over the `$color4` overlay surface; this stands in for it inline.
|
|
29
|
+
vi.mock("@multiplatform.one/forms", async (original) => ({
|
|
30
|
+
...(await original<typeof import("@multiplatform.one/forms")>()),
|
|
31
|
+
FloatingPanel: ({
|
|
32
|
+
open,
|
|
33
|
+
trigger,
|
|
34
|
+
children,
|
|
35
|
+
}: {
|
|
36
|
+
open?: boolean;
|
|
37
|
+
trigger?: ReactNode;
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
}) => (
|
|
40
|
+
<>
|
|
41
|
+
{trigger}
|
|
42
|
+
{open ? <YStack backgroundColor="$color4">{children}</YStack> : null}
|
|
43
|
+
</>
|
|
44
|
+
),
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
const config = createDefaultThemeConfig({
|
|
48
|
+
animations: createAnimations(nativeAnimationConfig),
|
|
49
|
+
});
|
|
50
|
+
type Scheme = "light" | "dark";
|
|
51
|
+
const themes = config.tamagui.themes as unknown as Record<Scheme, Record<string, { val: string }>>;
|
|
52
|
+
|
|
53
|
+
afterEach(cleanup);
|
|
54
|
+
|
|
55
|
+
const settle = () =>
|
|
56
|
+
act(async () => {
|
|
57
|
+
await new Promise((done) => setTimeout(done, 450));
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/** `rgba(r,g,b,a)` with whole channels, from the hex, rgb() and hsl() forms both sides use. */
|
|
61
|
+
function rgb(colour: string): string {
|
|
62
|
+
const probe = document.createElement("div");
|
|
63
|
+
probe.style.color = colour;
|
|
64
|
+
const css = probe.style.color.replace(/\s+/g, "");
|
|
65
|
+
const hsl = css.match(/^hsla?\(([\d.]+),([\d.]+)%,([\d.]+)%(?:,([\d.]+))?\)$/);
|
|
66
|
+
let channels: number[];
|
|
67
|
+
if (hsl) {
|
|
68
|
+
const [h, s, l] = [Number(hsl[1]) / 360, Number(hsl[2]) / 100, Number(hsl[3]) / 100];
|
|
69
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
70
|
+
const p = 2 * l - q;
|
|
71
|
+
const hue = (t: number) => {
|
|
72
|
+
const u = t < 0 ? t + 1 : t > 1 ? t - 1 : t;
|
|
73
|
+
if (u < 1 / 6) return p + (q - p) * 6 * u;
|
|
74
|
+
if (u < 1 / 2) return q;
|
|
75
|
+
if (u < 2 / 3) return p + (q - p) * (2 / 3 - u) * 6;
|
|
76
|
+
return p;
|
|
77
|
+
};
|
|
78
|
+
channels = [hue(h + 1 / 3), hue(h), hue(h - 1 / 3)].map((v) => v * 255);
|
|
79
|
+
channels.push(hsl[4] === undefined ? 1 : Number(hsl[4]));
|
|
80
|
+
} else {
|
|
81
|
+
const parts = css
|
|
82
|
+
.match(/^rgba?\(([^)]*)\)$/)?.[1]
|
|
83
|
+
?.split(",")
|
|
84
|
+
.map(Number);
|
|
85
|
+
if (!parts) return css;
|
|
86
|
+
channels = [...parts.slice(0, 3), parts[3] ?? 1];
|
|
87
|
+
}
|
|
88
|
+
const [r, g, b, a] = channels;
|
|
89
|
+
return `rgba(${Math.round(r!)},${Math.round(g!)},${Math.round(b!)},${Number(a!.toFixed(2))})`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const token = (scheme: Scheme, key: string) => rgb(themes[scheme][key]!.val);
|
|
93
|
+
|
|
94
|
+
/** The nearest painted box around a row's label: the row's own fill, else the panel's. */
|
|
95
|
+
function fillUnder(label: string): string {
|
|
96
|
+
for (let node = screen.getByText(label).parentElement; node; node = node.parentElement) {
|
|
97
|
+
const fill = node.style.backgroundColor;
|
|
98
|
+
if (fill && fill !== "transparent" && rgb(fill) !== "rgba(0,0,0,0)") return rgb(fill);
|
|
99
|
+
}
|
|
100
|
+
throw new Error(`nothing painted under ${label}`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const tint = { light: "color3", dark: "color5" } as const;
|
|
104
|
+
|
|
105
|
+
describe("a checked menu row paints the selection tint on native (LC-262, FZ-8557)", () => {
|
|
106
|
+
it("runs on tamagui's native build", () => {
|
|
107
|
+
expect(isWeb).toBe(false);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
for (const scheme of ["light", "dark"] as const) {
|
|
111
|
+
it(`${scheme}: the checked row is ${tint[scheme]}, not the page, and the others paint nothing`, async () => {
|
|
112
|
+
render(
|
|
113
|
+
<TamaguiProvider config={config.tamagui} defaultTheme={scheme} disableInjectCSS>
|
|
114
|
+
<ContextMenu
|
|
115
|
+
defaultOpen
|
|
116
|
+
items={[
|
|
117
|
+
{ label: "System", checked: false },
|
|
118
|
+
{ label: "Light", checked: false },
|
|
119
|
+
{ label: "Dark", checked: true },
|
|
120
|
+
]}
|
|
121
|
+
>
|
|
122
|
+
<Button>Appearance</Button>
|
|
123
|
+
</ContextMenu>
|
|
124
|
+
</TamaguiProvider>,
|
|
125
|
+
);
|
|
126
|
+
await settle();
|
|
127
|
+
const checked = fillUnder("Dark");
|
|
128
|
+
expect(checked).toBe(token(scheme, tint[scheme]));
|
|
129
|
+
expect(checked).not.toBe(token(scheme, "background"));
|
|
130
|
+
expect(checked).not.toBe(token(scheme, "color2"));
|
|
131
|
+
const panel = fillUnder("System");
|
|
132
|
+
expect(fillUnder("Light")).toBe(panel);
|
|
133
|
+
expect(checked).not.toBe(panel);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
});
|
package/src/checkedRow.spec.tsx
CHANGED
|
@@ -22,8 +22,8 @@ function restFills(el: Element) {
|
|
|
22
22
|
.filter((c) => /^_bg-(?!0)/.test(c));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
const checkedFill = { light: "
|
|
25
|
+
/** A tint one step off the panel: light $color3 on white, dark $color5 over the $color4 overlay (FZ-8557). */
|
|
26
|
+
const checkedFill = { light: "color3", dark: "color5" } as const;
|
|
27
27
|
|
|
28
28
|
/** A checked row rests on its scheme's checked fill, and only on it. */
|
|
29
29
|
function expectTint(el: Element | null | undefined, scheme: (typeof schemes)[number]) {
|
|
@@ -69,7 +69,8 @@ describe("a checked menu or picker row is highlighted under its check (LC-262, F
|
|
|
69
69
|
expect(checked.querySelector("[data-mp-check]")?.getAttribute("data-mp-check")).toBe(
|
|
70
70
|
"trailing",
|
|
71
71
|
);
|
|
72
|
-
|
|
72
|
+
// Hover keeps the checked fill; an unchecked row hovers on $color3.
|
|
73
|
+
expect(checked.className).toMatch(new RegExp(`_bg-0hover-${checkedFill[scheme]}`));
|
|
73
74
|
expect(unchecked.className).toMatch(/_bg-0hover-color3/);
|
|
74
75
|
await waitFor(() => {
|
|
75
76
|
expect(document.activeElement?.getAttribute("role")).not.toBe("menuitemcheckbox");
|
|
@@ -61,7 +61,7 @@ describe("shared icon slot ink without CSS inheritance", () => {
|
|
|
61
61
|
);
|
|
62
62
|
const [switcher, accordion, well] = screen.getAllByTestId("icon");
|
|
63
63
|
expect(switcher.dataset.color).toBe(switcher.dataset.selectedInk);
|
|
64
|
-
expect(accordion.dataset.color).toBe(accordion.dataset.
|
|
64
|
+
expect(accordion.dataset.color).toBe(accordion.dataset.ink);
|
|
65
65
|
expect(well.dataset.color).toBe(well.dataset.well);
|
|
66
66
|
},
|
|
67
67
|
);
|
|
@@ -77,3 +77,37 @@ describe("Sidebar as a document rail (FZ-8000)", () => {
|
|
|
77
77
|
expect(nav.className).toContain("mp-hairline-ie");
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
+
|
|
81
|
+
describe("Sidebar nesting", () => {
|
|
82
|
+
const items = [
|
|
83
|
+
{ value: "a", label: "Alpha", onPress: () => {} },
|
|
84
|
+
{ value: "b", label: "Beta", onPress: () => {} },
|
|
85
|
+
{ value: "c", label: "Child", depth: 1, onPress: () => {} },
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
it("indents a child row by one icon column per level", () => {
|
|
89
|
+
const result = renderWithProviders(<Sidebar sections={[{ items }]} />);
|
|
90
|
+
const rows = Array.from(result.container.querySelectorAll("[data-sidebar-row]"));
|
|
91
|
+
expect(rows[2].getAttribute("data-depth")).toBe("1");
|
|
92
|
+
expect(rows[2].querySelectorAll("[data-sidebar-indent]")).toHaveLength(1);
|
|
93
|
+
expect(rows[0].querySelectorAll("[data-sidebar-indent]")).toHaveLength(0);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe("Sidebar footer", () => {
|
|
98
|
+
const sections = [{ items: [{ value: "a", label: "Alpha" }] }];
|
|
99
|
+
|
|
100
|
+
it("pins the footer under the sections inside the rail", () => {
|
|
101
|
+
const result = renderWithProviders(
|
|
102
|
+
<Sidebar sections={sections} testID="rail" footer={<span>Account</span>} />,
|
|
103
|
+
);
|
|
104
|
+
const footer = result.getByTestId("rail").querySelector("[data-sidebar-footer]")!;
|
|
105
|
+
expect(footer).not.toBeNull();
|
|
106
|
+
expect(footer.textContent).toContain("Account");
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("draws no footer slot without a footer", () => {
|
|
110
|
+
const result = renderWithProviders(<Sidebar sections={sections} testID="rail" />);
|
|
111
|
+
expect(result.getByTestId("rail").querySelector("[data-sidebar-footer]")).toBeNull();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -111,6 +111,34 @@ describe("Screen top bar (LC-157)", () => {
|
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
+
describe("back control alignment (FZ-7993)", () => {
|
|
115
|
+
function caretPull(container: HTMLElement): number | null {
|
|
116
|
+
const caret = container.querySelector("[data-back-caret]");
|
|
117
|
+
const cls = String((caret as HTMLElement | null)?.className || "")
|
|
118
|
+
.split(" ")
|
|
119
|
+
.find((c) => c.startsWith("_marginInlineStart-"));
|
|
120
|
+
return cls
|
|
121
|
+
? Number.parseFloat(cls.slice("_marginInlineStart-".length).replace("--", "-"))
|
|
122
|
+
: null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
it("pulls the caret by its glyph's bearing, so its point sits on the large title's edge", () => {
|
|
126
|
+
const { container } = renderWithProviders(
|
|
127
|
+
<Screen topBar={<ScreenToolbar leading={<PageBackButton label="Components" />} />}>
|
|
128
|
+
<PageHeader title="DataTable" />
|
|
129
|
+
</Screen>,
|
|
130
|
+
);
|
|
131
|
+
const back = container.querySelector('[data-top-bar-control="back"]');
|
|
132
|
+
expect(back?.querySelector("[data-back-caret] svg")).toBeTruthy();
|
|
133
|
+
const pull = caretPull(container);
|
|
134
|
+
expect(pull).not.toBeNull();
|
|
135
|
+
expect(pull!).toBeLessThan(0);
|
|
136
|
+
const svg = back!.querySelector("[data-back-caret] svg")!;
|
|
137
|
+
const size = Number(svg.getAttribute("width"));
|
|
138
|
+
expect(Math.abs(pull!)).toBe(Math.round((size * 72) / 256));
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
114
142
|
function AccentProbe() {
|
|
115
143
|
const tint = useGlyphTintOnSurface();
|
|
116
144
|
return <span data-testid="accent-probe" data-label={tint.label} data-glyph={tint.glyph} />;
|