@multiplatform.one/components 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Avatar/index.cjs +1 -1
- package/dist/cjs/Avatar/index.native.js +1 -1
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Carousel/index.cjs +1 -1
- package/dist/cjs/Carousel/index.native.js +1 -1
- package/dist/cjs/Chip/index.cjs +37 -16
- package/dist/cjs/Chip/index.native.js +38 -16
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/DropDownPanel/index.cjs +1 -1
- package/dist/cjs/DropDownPanel/index.native.js +1 -1
- package/dist/cjs/DropDownPanel/index.native.js.map +1 -1
- package/dist/cjs/Meter/meter.cjs +3 -3
- package/dist/cjs/Meter/meter.native.js +3 -3
- package/dist/cjs/Meter/meter.native.js.map +1 -1
- package/dist/cjs/{ScrollView/index.cjs → ScrollView.cjs} +2 -2
- package/dist/cjs/{ScrollView/useRevealFocusedField.cjs → ScrollView.native.js} +8 -5
- package/dist/cjs/ScrollView.native.js.map +1 -0
- package/dist/cjs/SheetModal/index.cjs +9 -5
- package/dist/cjs/SheetModal/index.native.js +6 -4
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/SheetScrollView/index.cjs +1 -1
- package/dist/cjs/SheetScrollView/index.native.js +1 -1
- package/dist/cjs/Tabs/index.cjs +64 -14
- package/dist/cjs/Tabs/index.native.js +74 -19
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/appShell/SettingsSplit.cjs +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +1 -1
- package/dist/cjs/charts/ChartDataView.native.js +1 -1
- package/dist/cjs/code/CodeBlock/index.cjs +1 -1
- package/dist/cjs/code/CodeBlock/index.native.js +1 -1
- package/dist/cjs/code/LogView.cjs +2 -2
- package/dist/cjs/code/LogView.native.js +2 -2
- package/dist/cjs/code/LogView.native.js.map +1 -1
- package/dist/cjs/code/PayloadView/index.cjs +1 -1
- package/dist/cjs/code/PayloadView/index.native.js +1 -1
- package/dist/cjs/hooks/useDirection.cjs +2 -27
- package/dist/cjs/hooks/useDirection.native.js +5 -8
- package/dist/cjs/hooks/useDirection.native.js.map +1 -1
- package/dist/cjs/index.cjs +11 -11
- package/dist/cjs/index.native.js +11 -11
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.cjs +2 -2
- package/dist/cjs/layouts/IdentityPlate.native.js +2 -2
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/StatusDot.cjs +9 -2
- package/dist/cjs/layouts/StatusDot.native.js +9 -2
- package/dist/cjs/layouts/StatusDot.native.js.map +1 -1
- package/dist/cjs/layouts/StatusGlyphStrip.cjs +1 -1
- package/dist/cjs/layouts/StatusGlyphStrip.native.js +1 -1
- package/dist/cjs/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.cjs +1 -3
- package/dist/cjs/layouts/attachments.native.js +1 -3
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/index.cjs +1 -0
- package/dist/cjs/layouts/index.native.js +1 -0
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +1 -1
- package/dist/cjs/layouts/page.native.js +1 -1
- package/dist/cjs/layouts/sidebar.cjs +4 -7
- package/dist/cjs/layouts/sidebar.native.js +4 -7
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.cjs +1 -1
- package/dist/cjs/layouts/tags.native.js +1 -1
- package/dist/cjs/layouts/toolbar.cjs +1 -1
- package/dist/cjs/layouts/toolbar.native.js +1 -1
- package/dist/cjs/tamagui.cjs +1 -1
- package/dist/cjs/tamagui.native.js +1 -1
- package/dist/cjs/views/Calendar.cjs +1 -1
- package/dist/cjs/views/Calendar.native.js +1 -1
- package/dist/cjs/views/Dashboard.cjs +1 -1
- package/dist/cjs/views/Dashboard.native.js +1 -1
- package/dist/cjs/views/FilePreview.cjs +1 -2
- package/dist/cjs/views/FilePreview.native.js +1 -2
- package/dist/cjs/views/Gantt.cjs +1 -1
- package/dist/cjs/views/Gantt.native.js +1 -1
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/Kanban.cjs +1 -1
- package/dist/cjs/views/Kanban.native.js +1 -1
- package/dist/cjs/views/Matrix.cjs +1 -1
- package/dist/cjs/views/Matrix.native.js +1 -1
- package/dist/cjs/views/ReportBuilder.cjs +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +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.mjs +1 -1
- package/dist/esm/Avatar/index.native.js +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.mjs +1 -1
- package/dist/esm/Carousel/index.native.js +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/ChatTurn/index.native.js.map +1 -1
- package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/esm/CheckGlyph/index.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +37 -17
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +38 -17
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ChoiceChips/index.native.js.map +1 -1
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/Diff/diff.native.js.map +1 -1
- package/dist/esm/Diff/index.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DrillStack/DrillBar.native.js.map +1 -1
- package/dist/esm/DrillStack/context.native.js.map +1 -1
- package/dist/esm/DrillStack/drillMotion.native.js.map +1 -1
- package/dist/esm/DropDownPanel/index.mjs +2 -2
- package/dist/esm/DropDownPanel/index.mjs.map +1 -1
- package/dist/esm/DropDownPanel/index.native.js +2 -2
- package/dist/esm/DropDownPanel/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Kbd/index.native.js.map +1 -1
- package/dist/esm/Kbd/keys.native.js.map +1 -1
- package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/esm/Lightbox/shared.native.js.map +1 -1
- package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/esm/MachineLiteral/index.native.js.map +1 -1
- package/dist/esm/Material/index.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.mjs +3 -3
- package/dist/esm/Meter/meter.mjs.map +1 -1
- package/dist/esm/Meter/meter.native.js +3 -3
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/MiddleEllipsisText/middleSplit.native.js.map +1 -1
- package/dist/esm/MiddleEllipsisText/types.native.js.map +1 -1
- package/dist/esm/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.mjs +3 -0
- package/dist/esm/ScrollView.mjs.map +1 -0
- package/dist/esm/ScrollView.native.js +3 -0
- package/dist/esm/ScrollView.native.js.map +1 -0
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetBodyRegion.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +10 -6
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +7 -5
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/SheetScrollView/index.mjs +1 -1
- package/dist/esm/SheetScrollView/index.native.js +1 -1
- package/dist/esm/SheetScrollView/index.native.js.map +1 -1
- package/dist/esm/SheetScrollView/sheetHandoff.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/esm/SwipeDismissRow/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +64 -14
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +74 -19
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/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.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.mjs +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js +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/appShell/stackBack.native.js.map +1 -1
- package/dist/esm/appShell/systemBarFit.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +1 -1
- package/dist/esm/charts/ChartDataView.native.js +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.mjs +1 -1
- package/dist/esm/code/CodeBlock/index.native.js +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/HoldSelect/tapGate.native.js.map +1 -1
- package/dist/esm/code/LogView.mjs +2 -2
- package/dist/esm/code/LogView.mjs.map +1 -1
- package/dist/esm/code/LogView.native.js +2 -2
- package/dist/esm/code/LogView.native.js.map +1 -1
- package/dist/esm/code/PayloadView/index.mjs +1 -1
- package/dist/esm/code/PayloadView/index.native.js +1 -1
- package/dist/esm/code/PayloadView/index.native.js.map +1 -1
- package/dist/esm/code/PayloadView/payloadModel.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/esm/formLayouts/SingleTaskColumn.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/useDirection.mjs +1 -26
- package/dist/esm/hooks/useDirection.mjs.map +1 -1
- package/dist/esm/hooks/useDirection.native.js +1 -4
- package/dist/esm/hooks/useDirection.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/framing.native.js.map +1 -1
- package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/remoteArtCache.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/svgMarkup.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/types.native.js.map +1 -1
- package/dist/esm/images/index.native.js.map +1 -1
- package/dist/esm/index.gnome.native.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.native.js +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.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 +1 -1
- package/dist/esm/layouts/IdentityPlate.mjs.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.mjs +8 -2
- package/dist/esm/layouts/StatusDot.mjs.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js +8 -2
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/StatusGlyphStrip.mjs +2 -2
- package/dist/esm/layouts/StatusGlyphStrip.mjs.map +1 -1
- package/dist/esm/layouts/StatusGlyphStrip.native.js +2 -2
- 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.native.js.map +1 -1
- package/dist/esm/layouts/attachments.mjs +1 -3
- package/dist/esm/layouts/attachments.mjs.map +1 -1
- package/dist/esm/layouts/attachments.native.js +1 -3
- 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 -2
- package/dist/esm/layouts/index.mjs.map +1 -1
- package/dist/esm/layouts/index.native.js +2 -2
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +1 -1
- package/dist/esm/layouts/page.native.js +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.mjs +4 -7
- package/dist/esm/layouts/sidebar.mjs.map +1 -1
- package/dist/esm/layouts/sidebar.native.js +4 -7
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.mjs +1 -1
- package/dist/esm/layouts/tags.native.js +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.mjs +1 -1
- package/dist/esm/layouts/toolbar.native.js +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 +1 -1
- package/dist/esm/tamagui.native.js +1 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.mjs +1 -1
- package/dist/esm/views/Calendar.native.js +1 -1
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/CardGrid.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +1 -1
- package/dist/esm/views/Dashboard.native.js +1 -1
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/FilePreview.mjs +1 -2
- package/dist/esm/views/FilePreview.mjs.map +1 -1
- package/dist/esm/views/FilePreview.native.js +1 -2
- package/dist/esm/views/FilePreview.native.js.map +1 -1
- package/dist/esm/views/Gantt.mjs +1 -1
- package/dist/esm/views/Gantt.native.js +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.native.js.map +1 -1
- package/dist/esm/views/Kanban.mjs +1 -1
- package/dist/esm/views/Kanban.native.js +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.mjs +1 -1
- package/dist/esm/views/Matrix.native.js +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.mjs +1 -1
- package/dist/esm/views/ReportBuilder.native.js +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.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/Avatar/index.mjs +1 -1
- package/dist/jsx/Avatar/index.native.js +1 -1
- package/dist/jsx/Carousel/index.mjs +1 -1
- package/dist/jsx/Carousel/index.native.js +1 -1
- package/dist/jsx/Chip/index.mjs +37 -17
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +38 -16
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/DropDownPanel/index.mjs +2 -2
- package/dist/jsx/DropDownPanel/index.mjs.map +1 -1
- package/dist/jsx/DropDownPanel/index.native.js +1 -1
- package/dist/jsx/DropDownPanel/index.native.js.map +1 -1
- package/dist/jsx/Meter/meter.mjs +3 -3
- package/dist/jsx/Meter/meter.mjs.map +1 -1
- package/dist/jsx/Meter/meter.native.js +3 -3
- package/dist/jsx/Meter/meter.native.js.map +1 -1
- package/dist/jsx/ScrollView.mjs +3 -0
- package/dist/jsx/ScrollView.mjs.map +1 -0
- package/dist/{cjs/ScrollView/revealFocusedField.cjs → jsx/ScrollView.native.js} +8 -13
- package/dist/jsx/ScrollView.native.js.map +1 -0
- package/dist/jsx/SheetModal/index.mjs +10 -6
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +6 -4
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/SheetScrollView/index.mjs +1 -1
- package/dist/jsx/SheetScrollView/index.native.js +1 -1
- package/dist/jsx/SheetScrollView/index.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +64 -14
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +74 -19
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/appShell/SettingsSplit.mjs +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/jsx/charts/ChartDataView.mjs +1 -1
- package/dist/jsx/charts/ChartDataView.native.js +1 -1
- package/dist/jsx/code/CodeBlock/index.mjs +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +1 -1
- package/dist/jsx/code/LogView.mjs +2 -2
- package/dist/jsx/code/LogView.mjs.map +1 -1
- package/dist/jsx/code/LogView.native.js +2 -2
- package/dist/jsx/code/LogView.native.js.map +1 -1
- package/dist/jsx/code/PayloadView/index.mjs +1 -1
- package/dist/jsx/code/PayloadView/index.native.js +1 -1
- package/dist/jsx/hooks/useDirection.mjs +1 -26
- package/dist/jsx/hooks/useDirection.mjs.map +1 -1
- package/dist/jsx/hooks/useDirection.native.js +5 -8
- package/dist/jsx/hooks/useDirection.native.js.map +1 -1
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.native.js +11 -11
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.mjs +1 -1
- package/dist/jsx/layouts/IdentityPlate.mjs.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js +2 -2
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/layouts/StatusDot.mjs +8 -2
- package/dist/jsx/layouts/StatusDot.mjs.map +1 -1
- package/dist/jsx/layouts/StatusDot.native.js +9 -2
- package/dist/jsx/layouts/StatusDot.native.js.map +1 -1
- package/dist/jsx/layouts/StatusGlyphStrip.mjs +2 -2
- package/dist/jsx/layouts/StatusGlyphStrip.mjs.map +1 -1
- package/dist/jsx/layouts/StatusGlyphStrip.native.js +1 -1
- package/dist/jsx/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.mjs +1 -3
- package/dist/jsx/layouts/attachments.mjs.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +1 -3
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/index.mjs +2 -2
- package/dist/jsx/layouts/index.mjs.map +1 -1
- package/dist/jsx/layouts/index.native.js +1 -0
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +1 -1
- package/dist/jsx/layouts/page.native.js +1 -1
- package/dist/jsx/layouts/sidebar.mjs +4 -7
- package/dist/jsx/layouts/sidebar.mjs.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js +4 -7
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/layouts/tags.mjs +1 -1
- package/dist/jsx/layouts/tags.native.js +1 -1
- package/dist/jsx/layouts/toolbar.mjs +1 -1
- package/dist/jsx/layouts/toolbar.native.js +1 -1
- package/dist/jsx/layouts/toolbar.native.js.map +1 -1
- package/dist/jsx/tamagui.mjs +1 -1
- package/dist/jsx/tamagui.native.js +1 -1
- package/dist/jsx/views/Calendar.mjs +1 -1
- package/dist/jsx/views/Calendar.native.js +1 -1
- package/dist/jsx/views/Dashboard.mjs +1 -1
- package/dist/jsx/views/Dashboard.native.js +1 -1
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/FilePreview.mjs +1 -2
- package/dist/jsx/views/FilePreview.mjs.map +1 -1
- package/dist/jsx/views/FilePreview.native.js +1 -2
- package/dist/jsx/views/Gantt.mjs +1 -1
- package/dist/jsx/views/Gantt.native.js +1 -1
- package/dist/jsx/views/Kanban.mjs +1 -1
- package/dist/jsx/views/Kanban.native.js +1 -1
- package/dist/jsx/views/Matrix.mjs +1 -1
- package/dist/jsx/views/Matrix.native.js +1 -1
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.mjs +1 -1
- package/dist/jsx/views/ReportBuilder.native.js +1 -1
- package/package.json +7 -7
- package/src/Avatar/index.tsx +1 -1
- package/src/Carousel/Carousel.native.spec.tsx +4 -2
- package/src/Chip/Chip.native-press.spec.tsx +48 -0
- package/src/Chip/Chip.stories.tsx +14 -0
- package/src/Chip/Chip.trailingArea.spec.tsx +259 -0
- package/src/Chip/Chip.trailingToggle.spec.tsx +2 -2
- package/src/Chip/index.tsx +44 -18
- package/src/DropDownPanel/index.tsx +2 -2
- package/src/Meter/Meter.spec.tsx +5 -4
- package/src/Meter/meter.ts +4 -3
- package/src/ScrollView.ts +2 -0
- package/src/SheetModal/SheetModal.consumerProps.native.spec.tsx +89 -0
- package/src/SheetModal/SheetModal.consumerProps.spec.tsx +104 -0
- package/src/SheetModal/SheetModal.stories.tsx +36 -4
- package/src/SheetModal/index.native.tsx +7 -5
- package/src/SheetModal/index.tsx +31 -8
- package/src/Tabs/Tabs.measurement.spec.tsx +2 -2
- package/src/Tabs/Tabs.stories.tsx +6 -3
- package/src/Tabs/Tabs.tamagui.spec.tsx +213 -0
- package/src/Tabs/index.tsx +96 -25
- package/src/actions/ActionButton.spec.tsx +31 -0
- package/src/code/LogView.tsx +1 -1
- package/src/feedback/ConfirmDialog.stories.tsx +41 -5
- package/src/hooks/useDirection.ts +2 -67
- package/src/index.ts +1 -1
- package/src/layouts/IdentityPlate.native-press.spec.tsx +3 -3
- package/src/layouts/IdentityPlate.tsx +1 -1
- package/src/layouts/Sidebar.spec.tsx +29 -0
- package/src/layouts/StatusDot.tsx +9 -1
- package/src/layouts/StatusGlyphStrip.tsx +2 -2
- package/src/layouts/attachments.tsx +1 -1
- package/src/layouts/index.tsx +1 -0
- package/src/layouts/sidebar.tsx +5 -3
- package/src/layouts/warningScope.spec.tsx +71 -0
- package/src/linearGradientSetup.native.spec.ts +2 -2
- package/src/tamagui.ts +1 -1
- package/src/textAccentSecondary.spec.tsx +2 -2
- package/src/views/FilePreview.tsx +1 -1
- package/types/Chip/index.d.ts +14 -0
- package/types/Chip/index.d.ts.map +1 -1
- package/types/Meter/meter.d.ts +5 -4
- package/types/Meter/meter.d.ts.map +1 -1
- package/types/ScrollView.d.ts +3 -0
- package/types/ScrollView.d.ts.map +1 -0
- package/types/SheetModal/index.d.ts +15 -1
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +2 -2
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/hooks/useDirection.d.ts +2 -28
- package/types/hooks/useDirection.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/layouts/IdentityPlate.d.ts.map +1 -1
- package/types/layouts/StatusDot.d.ts +2 -0
- package/types/layouts/StatusDot.d.ts.map +1 -1
- package/types/layouts/StatusGlyphStrip.d.ts.map +1 -1
- package/types/layouts/index.d.ts +1 -1
- package/types/layouts/index.d.ts.map +1 -1
- package/types/layouts/sidebar.d.ts.map +1 -1
- package/dist/cjs/OverflowRow/index.cjs +0 -239
- package/dist/cjs/OverflowRow/index.native.js +0 -252
- package/dist/cjs/OverflowRow/index.native.js.map +0 -1
- package/dist/cjs/ScrollView/index.native.js +0 -89
- package/dist/cjs/ScrollView/index.native.js.map +0 -1
- package/dist/cjs/ScrollView/revealFocusedField.native.js +0 -39
- package/dist/cjs/ScrollView/revealFocusedField.native.js.map +0 -1
- package/dist/cjs/ScrollView/useRevealFocusedField.native.js +0 -76
- package/dist/cjs/ScrollView/useRevealFocusedField.native.js.map +0 -1
- package/dist/esm/OverflowRow/index.mjs +0 -213
- package/dist/esm/OverflowRow/index.mjs.map +0 -1
- package/dist/esm/OverflowRow/index.native.js +0 -223
- package/dist/esm/OverflowRow/index.native.js.map +0 -1
- package/dist/esm/ScrollView/index.mjs +0 -3
- package/dist/esm/ScrollView/index.mjs.map +0 -1
- package/dist/esm/ScrollView/index.native.js +0 -61
- package/dist/esm/ScrollView/index.native.js.map +0 -1
- package/dist/esm/ScrollView/revealFocusedField.mjs +0 -11
- package/dist/esm/ScrollView/revealFocusedField.mjs.map +0 -1
- package/dist/esm/ScrollView/revealFocusedField.native.js +0 -11
- package/dist/esm/ScrollView/revealFocusedField.native.js.map +0 -1
- package/dist/esm/ScrollView/useRevealFocusedField.mjs +0 -3
- package/dist/esm/ScrollView/useRevealFocusedField.mjs.map +0 -1
- package/dist/esm/ScrollView/useRevealFocusedField.native.js +0 -48
- package/dist/esm/ScrollView/useRevealFocusedField.native.js.map +0 -1
- package/dist/jsx/OverflowRow/index.mjs +0 -213
- package/dist/jsx/OverflowRow/index.mjs.map +0 -1
- package/dist/jsx/OverflowRow/index.native.js +0 -252
- package/dist/jsx/OverflowRow/index.native.js.map +0 -1
- package/dist/jsx/ScrollView/index.mjs +0 -3
- package/dist/jsx/ScrollView/index.mjs.map +0 -1
- package/dist/jsx/ScrollView/index.native.js +0 -89
- package/dist/jsx/ScrollView/index.native.js.map +0 -1
- package/dist/jsx/ScrollView/revealFocusedField.mjs +0 -11
- package/dist/jsx/ScrollView/revealFocusedField.mjs.map +0 -1
- package/dist/jsx/ScrollView/revealFocusedField.native.js +0 -39
- package/dist/jsx/ScrollView/revealFocusedField.native.js.map +0 -1
- package/dist/jsx/ScrollView/useRevealFocusedField.mjs +0 -3
- package/dist/jsx/ScrollView/useRevealFocusedField.mjs.map +0 -1
- package/dist/jsx/ScrollView/useRevealFocusedField.native.js +0 -76
- package/dist/jsx/ScrollView/useRevealFocusedField.native.js.map +0 -1
- package/src/OverflowRow/OverflowRow.native.spec.tsx +0 -335
- package/src/OverflowRow/OverflowRow.spec.tsx +0 -51
- package/src/OverflowRow/OverflowRow.stories.tsx +0 -138
- package/src/OverflowRow/index.tsx +0 -264
- package/src/ScrollView/ScrollView.native.spec.tsx +0 -278
- package/src/ScrollView/index.native.tsx +0 -68
- package/src/ScrollView/index.tsx +0 -2
- package/src/ScrollView/revealFocusedField.spec.ts +0 -26
- package/src/ScrollView/revealFocusedField.ts +0 -24
- package/src/ScrollView/useRevealFocusedField.native.ts +0 -65
- package/src/ScrollView/useRevealFocusedField.ts +0 -4
- package/src/hooks/useDirection.native.ts +0 -16
- package/src/hooks/useDirection.spec.tsx +0 -89
- package/types/OverflowRow/index.d.ts +0 -12
- package/types/OverflowRow/index.d.ts.map +0 -1
- package/types/ScrollView/index.d.ts +0 -3
- package/types/ScrollView/index.d.ts.map +0 -1
- package/types/ScrollView/index.native.d.ts +0 -4
- package/types/ScrollView/index.native.d.ts.map +0 -1
- package/types/ScrollView/revealFocusedField.d.ts +0 -15
- package/types/ScrollView/revealFocusedField.d.ts.map +0 -1
- package/types/ScrollView/useRevealFocusedField.d.ts +0 -4
- package/types/ScrollView/useRevealFocusedField.d.ts.map +0 -1
- package/types/ScrollView/useRevealFocusedField.native.d.ts +0 -12
- package/types/ScrollView/useRevealFocusedField.native.d.ts.map +0 -1
- package/types/hooks/useDirection.native.d.ts +0 -11
- package/types/hooks/useDirection.native.d.ts.map +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-11120: the web twin of `SheetModal.consumerProps.native.spec.tsx`. A
|
|
3
|
+
* sheet that asks for a wider regular-width panel gets it, centred and inside
|
|
4
|
+
* the window, and a `keyboardShouldPersistTaps` reaches the sheet's own scroll
|
|
5
|
+
* body. A sheet that passes neither is unchanged: the panel cap (LC-266), and
|
|
6
|
+
* no value on the body, so the browser's focus handling stays as it was.
|
|
7
|
+
*/
|
|
8
|
+
import { SHEET_PANEL_WIDTH } from "@multiplatform.one/forms";
|
|
9
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
10
|
+
import { cleanup, waitFor } from "@testing-library/react";
|
|
11
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
12
|
+
import { Text } from "tamagui";
|
|
13
|
+
import type { SheetModalProps } from "./index";
|
|
14
|
+
import { SheetModal } from "./index";
|
|
15
|
+
|
|
16
|
+
const screen = vi.hoisted(() => ({ width: 1440, height: 900 }));
|
|
17
|
+
const scrolls = vi.hoisted(() => ({ persist: [] as unknown[] }));
|
|
18
|
+
vi.mock("tamagui", async (importOriginal) => {
|
|
19
|
+
const tamagui = await importOriginal<typeof import("tamagui")>();
|
|
20
|
+
const { createElement, forwardRef } = await import("react");
|
|
21
|
+
const ScrollView = forwardRef<unknown, Record<string, unknown>>((props, ref) => {
|
|
22
|
+
if (props.testID === "sheet-modal-scroll")
|
|
23
|
+
scrolls.persist.push(props.keyboardShouldPersistTaps);
|
|
24
|
+
return createElement(tamagui.Sheet.ScrollView as never, { ...props, ref });
|
|
25
|
+
});
|
|
26
|
+
const Sheet = Object.assign(
|
|
27
|
+
(props: Record<string, unknown>) => createElement(tamagui.Sheet as never, props),
|
|
28
|
+
tamagui.Sheet,
|
|
29
|
+
{ ScrollView },
|
|
30
|
+
);
|
|
31
|
+
return {
|
|
32
|
+
...tamagui,
|
|
33
|
+
Sheet,
|
|
34
|
+
useWindowDimensions: () => ({ ...screen, scale: 1, fontScale: 1 }),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
cleanup();
|
|
40
|
+
screen.width = 1440;
|
|
41
|
+
scrolls.persist = [];
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
async function open(props: Partial<SheetModalProps> = {}) {
|
|
45
|
+
renderWithProviders(
|
|
46
|
+
<SheetModal open onOpenChange={() => {}} {...props}>
|
|
47
|
+
<Text>Terminals</Text>
|
|
48
|
+
</SheetModal>,
|
|
49
|
+
);
|
|
50
|
+
let frame: HTMLElement | null = null;
|
|
51
|
+
await waitFor(() => {
|
|
52
|
+
frame = document.querySelector('[role="dialog"]:not([data-sheet-cover])');
|
|
53
|
+
expect(frame).not.toBeNull();
|
|
54
|
+
});
|
|
55
|
+
return frame as unknown as HTMLElement;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const atoms = (node: Element) => String(node.className).split(/\s+/).filter(Boolean);
|
|
59
|
+
const widthOf = (frame: HTMLElement) =>
|
|
60
|
+
frame.style.width || atoms(frame).find((a) => a.startsWith("_w-")) || "";
|
|
61
|
+
|
|
62
|
+
describe("SheetModal web panelWidth (FZ-11120, LC-266)", () => {
|
|
63
|
+
it("draws the panel at the width the sheet asks for, centred", async () => {
|
|
64
|
+
const frame = await open({ panelWidth: 1100 });
|
|
65
|
+
expect(frame.getAttribute("data-sheet-form")).toBe("panel");
|
|
66
|
+
expect(widthOf(frame)).toContain("1100px");
|
|
67
|
+
expect(atoms(frame)).toContain("_als-center");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("never runs the panel past the window", async () => {
|
|
71
|
+
screen.width = 1024;
|
|
72
|
+
const frame = await open({ panelWidth: 1366 });
|
|
73
|
+
expect(widthOf(frame)).toContain("1024px");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("keeps the panel cap when the sheet asks for nothing", async () => {
|
|
77
|
+
const frame = await open();
|
|
78
|
+
expect(widthOf(frame)).toContain(`${SHEET_PANEL_WIDTH}px`);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("ignores it at phone width, where the sheet already spans the window", async () => {
|
|
82
|
+
screen.width = 390;
|
|
83
|
+
const frame = await open({ panelWidth: 1100 });
|
|
84
|
+
expect(frame.getAttribute("data-sheet-form")).toBe("bottom");
|
|
85
|
+
expect(widthOf(frame)).not.toContain("1100px");
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe("SheetModal web keyboardShouldPersistTaps (FZ-11120, LC-99)", () => {
|
|
90
|
+
it.each([false, true])(
|
|
91
|
+
"hands the consumer's value to the scroll body (fill %s)",
|
|
92
|
+
async (fill) => {
|
|
93
|
+
await open({ scrollable: true, fill, keyboardShouldPersistTaps: "always" });
|
|
94
|
+
await waitFor(() => expect(scrolls.persist.length).toBeGreaterThan(0));
|
|
95
|
+
expect(new Set(scrolls.persist)).toEqual(new Set(["always"]));
|
|
96
|
+
},
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
it.each([false, true])("leaves the body unset when none is given (fill %s)", async (fill) => {
|
|
100
|
+
await open({ scrollable: true, fill });
|
|
101
|
+
await waitFor(() => expect(scrolls.persist.length).toBeGreaterThan(0));
|
|
102
|
+
expect(new Set(scrolls.persist)).toEqual(new Set([undefined]));
|
|
103
|
+
});
|
|
104
|
+
});
|
|
@@ -9,6 +9,10 @@ import {
|
|
|
9
9
|
import { Button, Input, Select } from "@multiplatform.one/forms";
|
|
10
10
|
import {
|
|
11
11
|
ArrowClockwiseIcon,
|
|
12
|
+
CalendarIcon,
|
|
13
|
+
ReceiptIcon,
|
|
14
|
+
UserIcon,
|
|
15
|
+
WarningIcon,
|
|
12
16
|
CloudArrowUpIcon,
|
|
13
17
|
ExportIcon,
|
|
14
18
|
FolderIcon,
|
|
@@ -32,6 +36,8 @@ import { OverlayHeader } from "../actions/StandardAction";
|
|
|
32
36
|
import { sheetDetent } from "./detents";
|
|
33
37
|
import { SheetModal } from "./index";
|
|
34
38
|
import { Paragraph, SizableText } from "../Text";
|
|
39
|
+
import { H2 } from "../Heading";
|
|
40
|
+
import { ListGroup, ListGroupItem, ListRow } from "../views";
|
|
35
41
|
|
|
36
42
|
const projectOptions = ["Inbox", "Launch", "Backlog", "Archive"].map((label) => ({
|
|
37
43
|
label,
|
|
@@ -39,25 +45,46 @@ const projectOptions = ["Inbox", "Launch", "Backlog", "Archive"].map((label) =>
|
|
|
39
45
|
icon: <FolderIcon />,
|
|
40
46
|
}));
|
|
41
47
|
|
|
48
|
+
function CustomerPage() {
|
|
49
|
+
return (
|
|
50
|
+
<YStack padding="$4" gap="$4" width="100%" maxWidth={560}>
|
|
51
|
+
<H2>Acme Corp</H2>
|
|
52
|
+
<ListGroup aria-label="Customer">
|
|
53
|
+
<ListGroupItem>
|
|
54
|
+
<ListRow icon={<UserIcon />} title="Jane Doe" meta="Contact" />
|
|
55
|
+
</ListGroupItem>
|
|
56
|
+
<ListGroupItem>
|
|
57
|
+
<ListRow icon={<ReceiptIcon />} title="Open invoices" meta="12" />
|
|
58
|
+
</ListGroupItem>
|
|
59
|
+
<ListGroupItem>
|
|
60
|
+
<ListRow icon={<WarningIcon />} title="Overdue" meta="3" />
|
|
61
|
+
</ListGroupItem>
|
|
62
|
+
<ListGroupItem>
|
|
63
|
+
<ListRow icon={<CalendarIcon />} title="Renewal" meta="March" />
|
|
64
|
+
</ListGroupItem>
|
|
65
|
+
</ListGroup>
|
|
66
|
+
</YStack>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
42
70
|
function Harness({
|
|
43
71
|
scrollable = false,
|
|
44
72
|
snapPoint,
|
|
45
73
|
detents,
|
|
46
74
|
startOpen = false,
|
|
75
|
+
overPage = false,
|
|
47
76
|
}: {
|
|
48
77
|
scrollable?: boolean;
|
|
49
78
|
snapPoint?: number;
|
|
50
79
|
detents?: number[];
|
|
51
80
|
startOpen?: boolean;
|
|
81
|
+
overPage?: boolean;
|
|
52
82
|
}) {
|
|
53
83
|
const [open, setOpen] = useState(startOpen);
|
|
54
84
|
const [project, setProject] = useState("launch");
|
|
55
85
|
return (
|
|
56
86
|
<YStack minHeight={480} gap="$3">
|
|
57
|
-
<Button onPress={() => setOpen(true)}>Open sheet</Button>
|
|
58
|
-
<Paragraph size="$2">
|
|
59
|
-
Dismiss by tapping the scrim, dragging to the bottom, or pressing Escape.
|
|
60
|
-
</Paragraph>
|
|
87
|
+
{overPage ? <CustomerPage /> : <Button onPress={() => setOpen(true)}>Open sheet</Button>}
|
|
61
88
|
<SheetModal
|
|
62
89
|
open={open}
|
|
63
90
|
onOpenChange={setOpen}
|
|
@@ -154,6 +181,11 @@ export const OpenOnMount: Story = {
|
|
|
154
181
|
render: () => <Harness startOpen />,
|
|
155
182
|
};
|
|
156
183
|
|
|
184
|
+
export const OverPage: Story = {
|
|
185
|
+
name: "Over a page",
|
|
186
|
+
render: () => <Harness startOpen overPage />,
|
|
187
|
+
};
|
|
188
|
+
|
|
157
189
|
/**
|
|
158
190
|
* FZ-8439: a confirming sheet with frequent actions. The title leads, Share
|
|
159
191
|
* sits between the title and the ✓, and Save keeps the trailing edge.
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
useResolvedKnobs,
|
|
29
29
|
type MotionStop,
|
|
30
30
|
nativeAnimationConfig as animationConfig,
|
|
31
|
-
|
|
31
|
+
sheetScrim,
|
|
32
32
|
sheetHandle,
|
|
33
33
|
sheetHandleTone,
|
|
34
34
|
sheetHandleZone,
|
|
@@ -98,6 +98,8 @@ export function SheetModal({
|
|
|
98
98
|
children,
|
|
99
99
|
header: headerContent,
|
|
100
100
|
headerActions,
|
|
101
|
+
panelWidth,
|
|
102
|
+
keyboardShouldPersistTaps = "handled",
|
|
101
103
|
snapPoint,
|
|
102
104
|
detents,
|
|
103
105
|
scrollable,
|
|
@@ -448,7 +450,7 @@ export function SheetModal({
|
|
|
448
450
|
accessibilityLabel={t("Close")}
|
|
449
451
|
>
|
|
450
452
|
<Animated.View testID="sheet-modal-scrim" style={{ flex: 1, opacity: scrimOpacity }}>
|
|
451
|
-
<View flex={1} backgroundColor={
|
|
453
|
+
<View flex={1} backgroundColor={sheetScrim} />
|
|
452
454
|
</Animated.View>
|
|
453
455
|
</Pressable>
|
|
454
456
|
<Animated.View
|
|
@@ -462,7 +464,7 @@ export function SheetModal({
|
|
|
462
464
|
}}
|
|
463
465
|
testID="sheet-modal-frame"
|
|
464
466
|
style={{
|
|
465
|
-
...(regular ? { width: sheetPanelWidth(windowWidth) } : null),
|
|
467
|
+
...(regular ? { width: sheetPanelWidth(windowWidth, panelWidth) } : null),
|
|
466
468
|
// MPO-64: flex children default to flexShrink 0, so without this
|
|
467
469
|
// the sheet cannot give way to the keyboard.
|
|
468
470
|
flexShrink: 1,
|
|
@@ -557,7 +559,7 @@ export function SheetModal({
|
|
|
557
559
|
<RNScrollView
|
|
558
560
|
testID="sheet-modal-scroll"
|
|
559
561
|
style={fillSlot}
|
|
560
|
-
keyboardShouldPersistTaps=
|
|
562
|
+
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
|
|
561
563
|
>
|
|
562
564
|
{titleScrolls ? (
|
|
563
565
|
<YStack gap={knobProps.gap.gap}>
|
|
@@ -580,7 +582,7 @@ export function SheetModal({
|
|
|
580
582
|
<RNScrollView
|
|
581
583
|
testID="sheet-modal-scroll"
|
|
582
584
|
style={{ flexGrow: 0 }}
|
|
583
|
-
keyboardShouldPersistTaps=
|
|
585
|
+
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
|
|
584
586
|
>
|
|
585
587
|
{titleScrolls ? (
|
|
586
588
|
<YStack gap={knobProps.gap.gap}>
|
package/src/SheetModal/index.tsx
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
|
-
|
|
13
|
+
sheetScrim,
|
|
14
14
|
sheetHandle,
|
|
15
15
|
sheetHandleTone,
|
|
16
16
|
sheetHandleWidthRatio,
|
|
@@ -70,8 +70,22 @@ export interface SheetModalProps {
|
|
|
70
70
|
* sheet, so no existing sheet changes shape.
|
|
71
71
|
*/
|
|
72
72
|
detents?: number[];
|
|
73
|
+
/**
|
|
74
|
+
* The panel's width on a regular-width window, for a body that needs more
|
|
75
|
+
* than `SHEET_PANEL_WIDTH`: two panes side by side (FZ-11120, LC-266). The
|
|
76
|
+
* panel stays centred and never runs past the window, the way an iPad form
|
|
77
|
+
* sheet takes its `preferredContentSize`. A compact window ignores it, since
|
|
78
|
+
* the sheet already spans it.
|
|
79
|
+
*/
|
|
80
|
+
panelWidth?: number;
|
|
73
81
|
/** Wrap children in the sheet's scroll container. */
|
|
74
82
|
scrollable?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The `scrollable` body's own `keyboardShouldPersistTaps` (FZ-11120, LC-99).
|
|
85
|
+
* Omitted, native runs at `"handled"` and web keeps its focus handling;
|
|
86
|
+
* `"always"` keeps the keyboard up through any tap in the body.
|
|
87
|
+
*/
|
|
88
|
+
keyboardShouldPersistTaps?: "always" | "never" | "handled";
|
|
75
89
|
/**
|
|
76
90
|
* Opt the body into the sheet's remaining height instead of sizing it to
|
|
77
91
|
* its content. A consumer-owned viewport (a virtualized list, a measured
|
|
@@ -109,9 +123,9 @@ const bottomEdges = { borderLeftWidth: 0, borderRightWidth: 0, borderBottomWidth
|
|
|
109
123
|
* bottom panel `sheetPanelWidth` wide and centred with the scrim on both
|
|
110
124
|
* sides. Its side edges stay, so it reads as a panel rather than a band.
|
|
111
125
|
*/
|
|
112
|
-
function regularPanel(windowWidth: number) {
|
|
126
|
+
function regularPanel(windowWidth: number, panelWidth: number | undefined) {
|
|
113
127
|
return {
|
|
114
|
-
width: sheetPanelWidth(windowWidth),
|
|
128
|
+
width: sheetPanelWidth(windowWidth, panelWidth),
|
|
115
129
|
alignSelf: "center",
|
|
116
130
|
borderBottomWidth: 0,
|
|
117
131
|
} as const;
|
|
@@ -245,6 +259,8 @@ export function SheetModal({
|
|
|
245
259
|
children,
|
|
246
260
|
header: headerContent,
|
|
247
261
|
headerActions,
|
|
262
|
+
panelWidth,
|
|
263
|
+
keyboardShouldPersistTaps,
|
|
248
264
|
snapPoint,
|
|
249
265
|
detents,
|
|
250
266
|
scrollable,
|
|
@@ -302,7 +318,7 @@ export function SheetModal({
|
|
|
302
318
|
>
|
|
303
319
|
<Sheet.Overlay
|
|
304
320
|
data-sheet-scrim=""
|
|
305
|
-
backgroundColor={
|
|
321
|
+
backgroundColor={sheetScrim}
|
|
306
322
|
{...transitionProps(knobProps.motion.scrim)}
|
|
307
323
|
enterStyle={{ opacity: 0 }}
|
|
308
324
|
exitStyle={{ opacity: 0 }}
|
|
@@ -312,7 +328,7 @@ export function SheetModal({
|
|
|
312
328
|
{...sheetHandle}
|
|
313
329
|
{...sheetHandleTone(knobProps.scheme)}
|
|
314
330
|
{...(regular
|
|
315
|
-
? { width: Math.round(sheetPanelWidth(windowWidth) * sheetHandleWidthRatio) }
|
|
331
|
+
? { width: Math.round(sheetPanelWidth(windowWidth, panelWidth) * sheetHandleWidthRatio) }
|
|
316
332
|
: null)}
|
|
317
333
|
aria-label="Resize"
|
|
318
334
|
data-sheet-grabber=""
|
|
@@ -333,7 +349,7 @@ export function SheetModal({
|
|
|
333
349
|
: null)}
|
|
334
350
|
borderBottomLeftRadius={0}
|
|
335
351
|
borderBottomRightRadius={0}
|
|
336
|
-
{...(regular ? regularPanel(windowWidth) : bottomEdges)}
|
|
352
|
+
{...(regular ? regularPanel(windowWidth, panelWidth) : bottomEdges)}
|
|
337
353
|
overflow="hidden"
|
|
338
354
|
{...frameRingReset}
|
|
339
355
|
>
|
|
@@ -349,7 +365,11 @@ export function SheetModal({
|
|
|
349
365
|
{fill ? (
|
|
350
366
|
<View testID="sheet-modal-body" {...fillSlot}>
|
|
351
367
|
{scrollable ? (
|
|
352
|
-
<Sheet.ScrollView
|
|
368
|
+
<Sheet.ScrollView
|
|
369
|
+
testID="sheet-modal-scroll"
|
|
370
|
+
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
|
|
371
|
+
{...fillSlot}
|
|
372
|
+
>
|
|
353
373
|
{titleScrolls ? (
|
|
354
374
|
<YStack gap={knobProps.gap.gap}>
|
|
355
375
|
{headerSlot}
|
|
@@ -364,7 +384,10 @@ export function SheetModal({
|
|
|
364
384
|
)}
|
|
365
385
|
</View>
|
|
366
386
|
) : scrollable ? (
|
|
367
|
-
<Sheet.ScrollView
|
|
387
|
+
<Sheet.ScrollView
|
|
388
|
+
testID="sheet-modal-scroll"
|
|
389
|
+
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
|
|
390
|
+
>
|
|
368
391
|
{titleScrolls ? (
|
|
369
392
|
<YStack gap={knobProps.gap.gap}>
|
|
370
393
|
{headerSlot}
|
|
@@ -224,7 +224,7 @@ describe("Tabs selection indicator colour", () => {
|
|
|
224
224
|
);
|
|
225
225
|
|
|
226
226
|
it.each([undefined, "accent"] as const)("keeps %s underline on the host accent", (intent) => {
|
|
227
|
-
const tree = renderSelectionTabs({ accent: intent === "accent" });
|
|
227
|
+
const tree = renderSelectionTabs({ variant: "underline", accent: intent === "accent" });
|
|
228
228
|
act(() => observed.interactions.get("tab-5")("select", last));
|
|
229
229
|
const indicator = tree.container.querySelector('[data-tabs-indicator="underline"]')!;
|
|
230
230
|
expect(indicator.className).toContain("_bg-accentBackg");
|
|
@@ -234,7 +234,7 @@ describe("Tabs selection indicator colour", () => {
|
|
|
234
234
|
it.each(["error", "warning", "success"] as const)(
|
|
235
235
|
"keeps %s underline in its intent theme",
|
|
236
236
|
(intent) => {
|
|
237
|
-
const tree = renderSelectionTabs({ [intent]: true });
|
|
237
|
+
const tree = renderSelectionTabs({ variant: "underline", [intent]: true });
|
|
238
238
|
act(() => observed.interactions.get("tab-5")("select", last));
|
|
239
239
|
const indicator = tree.container.querySelector('[data-tabs-indicator="underline"]')!;
|
|
240
240
|
expect(indicator.className).toContain("_bg-color9");
|
|
@@ -24,12 +24,12 @@ const meta: Meta<typeof Tabs> = {
|
|
|
24
24
|
docs: {
|
|
25
25
|
description: {
|
|
26
26
|
component:
|
|
27
|
-
"Themed app-level Tabs over the tamagui primitive.
|
|
27
|
+
"Themed app-level Tabs over the tamagui primitive. Frame (tamagui v3 bordered box, default), underline (desk-style), contained (segmented) and band variants, a sliding selection fill with a roving hover and focus highlight, scrollable overflow with edge fades, lazy-mountable panels, full keyboard support (ArrowLeft/Right, Home/End). Frappe form layouts are tab-heavy — SchemaForm's tab layout is the follow-up consumer.",
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
argTypes: {
|
|
32
|
-
variant: { control: "select", options: ["underline", "contained", "band"] },
|
|
32
|
+
variant: { control: "select", options: ["frame", "underline", "contained", "band"] },
|
|
33
33
|
distribution: { control: "select", options: ["content", "equal"] },
|
|
34
34
|
size: { control: "select", options: ["$2", "$3", "$4", "$5"] },
|
|
35
35
|
accent: { control: "boolean" },
|
|
@@ -85,8 +85,11 @@ const baseItems: TabsItem[] = [
|
|
|
85
85
|
// React element's props tree trips a throwing @react-navigation context
|
|
86
86
|
// getter ("Couldn't find an UnhandledLinkingContext context"), which kills
|
|
87
87
|
// story loading for the ENTIRE native storybook (verified on iOS sim).
|
|
88
|
+
export const Main: Story = {
|
|
89
|
+
render: (args) => <Tabs {...args} items={baseItems} />,
|
|
90
|
+
};
|
|
91
|
+
|
|
88
92
|
export const Underline: Story = {
|
|
89
|
-
name: "Main",
|
|
90
93
|
args: { variant: "underline" },
|
|
91
94
|
render: (args) => <Tabs {...args} items={baseItems} />,
|
|
92
95
|
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-11426 (FZ-11419's Tabs step): Tabs follows tamagui.dev's v3 Tabs. The
|
|
3
|
+
* default variant is `frame`: a bordered box (`controlBorderOutlined` edge,
|
|
4
|
+
* `containerRadius` corners, at least a hairline under every preset), tabs
|
|
5
|
+
* that fill the row, the active tab a sliding `$selectedBackground` fill, a
|
|
6
|
+
* hairline separator under the strip and the panel on a `$background` plate
|
|
7
|
+
* padded by `panelPadding`. tamagui's roving intent indicator slides to the
|
|
8
|
+
* hovered or keyboard-focused tab and fades out when neither rests on one.
|
|
9
|
+
*
|
|
10
|
+
* happy-dom cascades no Tamagui CSS, so this compares the atomic classes each
|
|
11
|
+
* part asks for with a probe that spreads the same fragments.
|
|
12
|
+
*/
|
|
13
|
+
import {
|
|
14
|
+
boldPreset,
|
|
15
|
+
consolePreset,
|
|
16
|
+
createDefaultThemeConfig,
|
|
17
|
+
defaultPreset,
|
|
18
|
+
densePreset,
|
|
19
|
+
heroPreset,
|
|
20
|
+
Preset,
|
|
21
|
+
roomyPreset,
|
|
22
|
+
storefrontPreset,
|
|
23
|
+
useResolvedKnobs,
|
|
24
|
+
} from "@multiplatform.one/theme";
|
|
25
|
+
import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
26
|
+
import { TamaguiProvider, View, YStack } from "tamagui";
|
|
27
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
28
|
+
import { Tabs, type TabsItem } from "./index";
|
|
29
|
+
|
|
30
|
+
afterEach(cleanup);
|
|
31
|
+
|
|
32
|
+
const presets = {
|
|
33
|
+
Default: defaultPreset,
|
|
34
|
+
Bold: boldPreset,
|
|
35
|
+
Hero: heroPreset,
|
|
36
|
+
Dense: densePreset,
|
|
37
|
+
Roomy: roomyPreset,
|
|
38
|
+
Console: consolePreset,
|
|
39
|
+
Storefront: storefrontPreset,
|
|
40
|
+
} as const;
|
|
41
|
+
|
|
42
|
+
const houseConfig = createDefaultThemeConfig();
|
|
43
|
+
const schemes = ["light", "dark"] as const;
|
|
44
|
+
type Scheme = (typeof schemes)[number];
|
|
45
|
+
type Knobs = (typeof presets)[keyof typeof presets]["knobs"];
|
|
46
|
+
|
|
47
|
+
const cells = Object.entries(presets).flatMap(([name, preset]) =>
|
|
48
|
+
schemes.map((scheme) => [name, scheme, preset.knobs] as const),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const items: TabsItem[] = [
|
|
52
|
+
{ value: "profile", label: "Profile", content: "Profile body" },
|
|
53
|
+
{ value: "connections", label: "Connections", content: "Connections body" },
|
|
54
|
+
{ value: "notifications", label: "Notifications", content: "Notifications body" },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
function FrameProbe() {
|
|
58
|
+
const { knobProps } = useResolvedKnobs({ component: "Tabs" });
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<View
|
|
62
|
+
testID="frame-probe"
|
|
63
|
+
{...knobProps.controlBorderOutlined}
|
|
64
|
+
{...knobProps.containerRadius}
|
|
65
|
+
/>
|
|
66
|
+
<View testID="panel-probe" {...knobProps.panelPadding} />
|
|
67
|
+
</>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function houseRender(
|
|
72
|
+
knobs: Knobs,
|
|
73
|
+
scheme: Scheme,
|
|
74
|
+
props: Partial<Parameters<typeof Tabs>[0]> = {},
|
|
75
|
+
) {
|
|
76
|
+
return render(
|
|
77
|
+
<TamaguiProvider config={houseConfig.tamagui} defaultTheme={scheme} disableInjectCSS>
|
|
78
|
+
<YStack backgroundColor="$background">
|
|
79
|
+
<Preset overrides={knobs}>
|
|
80
|
+
<FrameProbe />
|
|
81
|
+
<Tabs items={items} {...props} />
|
|
82
|
+
</Preset>
|
|
83
|
+
</YStack>
|
|
84
|
+
</TamaguiProvider>,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const dump = (el: Element) => `class="${el.className}"`;
|
|
89
|
+
const STATE = /\d*(hover|active|focus|press)/;
|
|
90
|
+
|
|
91
|
+
function rest(el: Element, ...prefixes: string[]): string[] {
|
|
92
|
+
return Array.from(el.classList)
|
|
93
|
+
.filter((c) => prefixes.some((p) => c.startsWith(p)))
|
|
94
|
+
.filter((c) => !STATE.test(c))
|
|
95
|
+
.sort();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const edgeColour = (el: Element) => rest(el, "_btc-", "_brc-", "_bbc-", "_blc-", "_bc-");
|
|
99
|
+
const edgeWidth = (el: Element) => rest(el, "_btw-", "_brw-", "_bbw-", "_blw-", "_bw-");
|
|
100
|
+
const radius = (el: Element) => rest(el, "_btlr-", "_btrr-", "_bbrr-", "_bblr-", "_br-");
|
|
101
|
+
const padding = (el: Element) => rest(el, "_pt-", "_pr-", "_pb-", "_pl-", "_p-");
|
|
102
|
+
|
|
103
|
+
const root = () => document.querySelector("[data-tabs-variant]") as HTMLElement;
|
|
104
|
+
const tabs = () => screen.getAllByRole("tab");
|
|
105
|
+
const grows = (el: HTMLElement) => el.style.flexGrow === "1" || el.classList.contains("_fg-1");
|
|
106
|
+
|
|
107
|
+
describe("frame Tabs: tamagui v3's bordered box", () => {
|
|
108
|
+
it.each(cells)("%s, %s: the default variant is the frame", (_name, scheme, knobs) => {
|
|
109
|
+
houseRender(knobs, scheme);
|
|
110
|
+
expect(root().getAttribute("data-tabs-variant")).toBe("frame");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it.each(cells)(
|
|
114
|
+
"%s, %s: the root edge and corners are the outlined fragment and the container radius",
|
|
115
|
+
(_name, scheme, knobs) => {
|
|
116
|
+
houseRender(knobs, scheme);
|
|
117
|
+
const probe = screen.getByTestId("frame-probe");
|
|
118
|
+
expect(edgeWidth(probe).length, dump(probe)).toBeGreaterThan(0);
|
|
119
|
+
expect(edgeWidth(probe), dump(probe)).not.toContain("_bw-0px");
|
|
120
|
+
expect(edgeWidth(root()), dump(root())).toEqual(edgeWidth(probe));
|
|
121
|
+
expect(edgeColour(root()), dump(root())).toEqual(edgeColour(probe));
|
|
122
|
+
expect(radius(root()), dump(root())).toEqual(radius(probe));
|
|
123
|
+
expect(rest(root(), "_ox-", "_oy-", "_ov-"), dump(root())).not.toEqual([]);
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
it.each(cells)("%s, %s: the tabs fill the row", (_name, scheme, knobs) => {
|
|
128
|
+
houseRender(knobs, scheme);
|
|
129
|
+
const list = document.querySelector("[data-tabs-list]") as HTMLElement;
|
|
130
|
+
expect(grows(list), list.outerHTML.slice(0, 400)).toBe(true);
|
|
131
|
+
expect(list.style.alignSelf, list.outerHTML.slice(0, 400)).toBe("stretch");
|
|
132
|
+
const row = list.parentElement as HTMLElement;
|
|
133
|
+
expect(grows(row), row.outerHTML.slice(0, 300)).toBe(true);
|
|
134
|
+
for (const tab of tabs()) expect(grows(tab), dump(tab)).toBe(true);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it.each(cells)(
|
|
138
|
+
"%s, %s: the active tab is a sliding fill, never an underline",
|
|
139
|
+
(_name, scheme, knobs) => {
|
|
140
|
+
houseRender(knobs, scheme);
|
|
141
|
+
const thumb = document.querySelector('[data-tabs-indicator="thumb"]') as HTMLElement;
|
|
142
|
+
expect(thumb, root().outerHTML.slice(0, 400)).not.toBeNull();
|
|
143
|
+
expect(rest(thumb, "_bg-"), dump(thumb)).toEqual([expect.stringMatching(/^_bg-selectedBac/)]);
|
|
144
|
+
expect(document.querySelector('[data-tabs-indicator="underline"]')).toBeNull();
|
|
145
|
+
},
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
it.each(cells)(
|
|
149
|
+
"%s, %s: a hairline separates the strip and the panel sits on a padded plate",
|
|
150
|
+
(_name, scheme, knobs) => {
|
|
151
|
+
houseRender(knobs, scheme);
|
|
152
|
+
const strip = root().firstElementChild as HTMLElement;
|
|
153
|
+
expect(strip.classList.contains("mp-hairline-b"), dump(strip)).toBe(true);
|
|
154
|
+
const host = document.querySelector("[data-tabs-panels]") as HTMLElement;
|
|
155
|
+
expect(rest(host, "_bg-"), dump(host)).toEqual(["_bg-background"]);
|
|
156
|
+
const panel = screen.getByRole("tabpanel");
|
|
157
|
+
const probe = screen.getByTestId("panel-probe");
|
|
158
|
+
expect(padding(probe).length, dump(probe)).toBeGreaterThan(0);
|
|
159
|
+
expect(padding(panel), dump(panel)).toEqual(padding(probe));
|
|
160
|
+
},
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
describe("frame Tabs: the roving intent indicator", () => {
|
|
165
|
+
const intent = () => document.querySelector('[data-tabs-indicator="intent"]') as HTMLElement;
|
|
166
|
+
|
|
167
|
+
it.each(schemes)("%s: hover moves the intent highlight; leaving hides it", (scheme) => {
|
|
168
|
+
houseRender(defaultPreset.knobs, scheme);
|
|
169
|
+
const [, connections, notifications] = tabs();
|
|
170
|
+
fireEvent.mouseEnter(connections);
|
|
171
|
+
expect(intent(), root().outerHTML.slice(0, 400)).not.toBeNull();
|
|
172
|
+
expect(intent().getAttribute("data-intent-value")).toBe("connections");
|
|
173
|
+
expect(rest(intent(), "_o-"), dump(intent())).toEqual(["_o-1"]);
|
|
174
|
+
expect(rest(intent(), "_bg-"), dump(intent())).toEqual(["_bg-color3"]);
|
|
175
|
+
fireEvent.mouseLeave(connections);
|
|
176
|
+
fireEvent.mouseEnter(notifications);
|
|
177
|
+
expect(intent().getAttribute("data-intent-value")).toBe("notifications");
|
|
178
|
+
fireEvent.mouseLeave(notifications);
|
|
179
|
+
expect(intent().getAttribute("data-intent-value")).toBeNull();
|
|
180
|
+
expect(rest(intent(), "_o-"), dump(intent())).toEqual(["_o-0"]);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it("the active tab shows no intent highlight over its fill", () => {
|
|
184
|
+
houseRender(defaultPreset.knobs, "light");
|
|
185
|
+
fireEvent.mouseEnter(tabs()[0]);
|
|
186
|
+
expect(intent()?.getAttribute("data-intent-value") ?? null).toBeNull();
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("keyboard focus under manual activation moves the intent highlight", () => {
|
|
190
|
+
houseRender(defaultPreset.knobs, "light", { activationMode: "manual" });
|
|
191
|
+
act(() => tabs()[2].focus());
|
|
192
|
+
expect(intent().getAttribute("data-intent-value")).toBe("notifications");
|
|
193
|
+
expect(tabs()[0]).toHaveAttribute("aria-selected", "true");
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
describe("frame Tabs keeps tab semantics", () => {
|
|
198
|
+
it("role=tab, aria-selected, one tab stop, Arrow, Home and End", () => {
|
|
199
|
+
houseRender(defaultPreset.knobs, "light");
|
|
200
|
+
const [first, second, third] = tabs();
|
|
201
|
+
expect(first).toHaveAttribute("aria-selected", "true");
|
|
202
|
+
expect(tabs().filter((tab) => tab.getAttribute("tabindex") === "0")).toEqual([first]);
|
|
203
|
+
act(() => first.focus());
|
|
204
|
+
fireEvent.keyDown(first, { key: "ArrowRight" });
|
|
205
|
+
expect(document.activeElement).toBe(second);
|
|
206
|
+
expect(second).toHaveAttribute("aria-selected", "true");
|
|
207
|
+
fireEvent.keyDown(second, { key: "End" });
|
|
208
|
+
expect(document.activeElement).toBe(third);
|
|
209
|
+
fireEvent.keyDown(third, { key: "Home" });
|
|
210
|
+
expect(document.activeElement).toBe(first);
|
|
211
|
+
expect(first).toHaveAttribute("aria-selected", "true");
|
|
212
|
+
});
|
|
213
|
+
});
|