@multiplatform.one/components 7.69.2 → 7.71.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/DotIndicator/index.cjs +21 -11
- package/dist/cjs/DotIndicator/index.native.js +21 -11
- package/dist/cjs/DotIndicator/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +12 -5
- package/dist/cjs/Pagination.native.js +12 -5
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +5 -5
- package/dist/cjs/Tabs/index.native.js +5 -5
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/appShell/index.cjs +1 -3
- package/dist/cjs/appShell/index.native.js +0 -2
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/componentColors.cjs +3 -3
- package/dist/cjs/componentColors.native.js +3 -3
- package/dist/cjs/layouts/ViewSwitcher.cjs +6 -11
- package/dist/cjs/layouts/ViewSwitcher.native.js +6 -11
- package/dist/cjs/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/bottomAccessory.cjs +173 -0
- package/dist/cjs/layouts/bottomAccessory.native.js +225 -0
- package/dist/cjs/layouts/bottomAccessory.native.js.map +1 -0
- package/dist/cjs/{appShell/BottomAccessory.cjs → layouts/bottomSafeArea.cjs} +12 -14
- package/dist/cjs/layouts/bottomSafeArea.native.js +75 -0
- package/dist/cjs/layouts/bottomSafeArea.native.js.map +1 -0
- package/dist/cjs/layouts/index.cjs +2 -0
- package/dist/cjs/layouts/index.native.js +2 -0
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +16 -5
- package/dist/cjs/layouts/page.native.js +16 -5
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.cjs +44 -0
- package/dist/cjs/layouts/screenScroll.native.js +52 -0
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.mjs +21 -11
- package/dist/esm/DotIndicator/index.mjs.map +1 -1
- package/dist/esm/DotIndicator/index.native.js +21 -11
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/Pagination.mjs +12 -5
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +12 -5
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +5 -5
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +5 -5
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/appShell/index.mjs +1 -2
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +1 -2
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/componentColors.mjs +3 -3
- package/dist/esm/componentColors.native.js +3 -3
- package/dist/esm/layouts/ViewSwitcher.mjs +6 -11
- package/dist/esm/layouts/ViewSwitcher.mjs.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js +6 -11
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/bottomAccessory.mjs +144 -0
- package/dist/esm/layouts/bottomAccessory.mjs.map +1 -0
- package/dist/esm/layouts/bottomAccessory.native.js +193 -0
- package/dist/esm/layouts/bottomAccessory.native.js.map +1 -0
- package/dist/esm/layouts/bottomSafeArea.mjs +16 -0
- package/dist/esm/layouts/bottomSafeArea.mjs.map +1 -0
- package/dist/esm/layouts/bottomSafeArea.native.js +47 -0
- package/dist/esm/layouts/bottomSafeArea.native.js.map +1 -0
- package/dist/esm/layouts/index.mjs +2 -0
- package/dist/esm/layouts/index.mjs.map +1 -1
- package/dist/esm/layouts/index.native.js +2 -0
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +16 -5
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +16 -5
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.mjs +43 -1
- package/dist/esm/layouts/screenScroll.mjs.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js +51 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/Alert/index.native.js.map +1 -1
- package/dist/jsx/AnimateHeight/index.native.js.map +1 -1
- package/dist/jsx/Avatar/getInitials.native.js.map +1 -1
- package/dist/jsx/Avatar/index.native.js.map +1 -1
- package/dist/jsx/Badge/index.native.js.map +1 -1
- package/dist/jsx/Button.native.js.map +1 -1
- package/dist/jsx/Card.native.js.map +1 -1
- package/dist/jsx/CardFooter.native.js.map +1 -1
- package/dist/jsx/CardHeader.native.js.map +1 -1
- package/dist/jsx/Carousel/index.native.js.map +1 -1
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/Collapsible.native.js.map +1 -1
- package/dist/jsx/ContextMenu/index.native.js.map +1 -1
- package/dist/jsx/CopyField/index.native.js.map +1 -1
- package/dist/jsx/Dialog.native.js.map +1 -1
- package/dist/jsx/DotIndicator/index.mjs +21 -11
- package/dist/jsx/DotIndicator/index.mjs.map +1 -1
- package/dist/jsx/DotIndicator/index.native.js +21 -11
- package/dist/jsx/DotIndicator/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/jsx/ErrorBoundary/index.native.js.map +1 -1
- package/dist/jsx/Heading.native.js.map +1 -1
- package/dist/jsx/Kbd/index.native.js.map +1 -1
- package/dist/jsx/Kbd/keys.native.js.map +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/jsx/Lightbox/shared.native.js.map +1 -1
- package/dist/jsx/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/jsx/Material/index.native.js.map +1 -1
- package/dist/jsx/Meter/index.native.js.map +1 -1
- package/dist/jsx/Meter/meter.native.js.map +1 -1
- package/dist/jsx/OverflowRow/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +12 -5
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +12 -5
- package/dist/jsx/Pagination.native.js.map +1 -1
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/ProgressSteps/index.native.js.map +1 -1
- package/dist/jsx/Quote/index.native.js.map +1 -1
- package/dist/jsx/SchemeToggle/index.native.js.map +1 -1
- package/dist/jsx/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/jsx/Separator/index.native.js.map +1 -1
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/jsx/SheetModal/detents.native.js.map +1 -1
- package/dist/jsx/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/jsx/Skeleton/index.native.js.map +1 -1
- package/dist/jsx/SkipLink/index.native.js.map +1 -1
- package/dist/jsx/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/jsx/SortableList/index.native.js.map +1 -1
- package/dist/jsx/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +5 -5
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +5 -5
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Text.native.js.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/jsx/Toast/index.native.js.map +1 -1
- package/dist/jsx/Toast/store.native.js.map +1 -1
- package/dist/jsx/Tooltip/nativePress.native.js.map +1 -1
- package/dist/jsx/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/jsx/TreeSelect/index.native.js.map +1 -1
- package/dist/jsx/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/jsx/Video/PlayerChrome.native.js.map +1 -1
- package/dist/jsx/Video/VideoFrame.native.js.map +1 -1
- package/dist/jsx/Video/types.native.js.map +1 -1
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/Wizard/index.native.js.map +1 -1
- package/dist/jsx/actions/ActionBar.native.js.map +1 -1
- package/dist/jsx/actions/DangerSection.native.js.map +1 -1
- package/dist/jsx/actions/DestructiveAction.native.js.map +1 -1
- package/dist/jsx/actions/HeaderActions.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.native.js.map +1 -1
- package/dist/jsx/actions/devWarn.native.js.map +1 -1
- package/dist/jsx/actions/index.native.js.map +1 -1
- package/dist/jsx/actions/severity.native.js.map +1 -1
- package/dist/jsx/appShell/Dock.native.js.map +1 -1
- package/dist/jsx/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js.map +1 -1
- package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabBar.native.js.map +1 -1
- package/dist/jsx/appShell/appTile.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +1 -2
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +0 -2
- package/dist/jsx/appShell/index.native.js.map +1 -1
- package/dist/jsx/charts/Axis.native.js.map +1 -1
- package/dist/jsx/charts/BarChart.native.js.map +1 -1
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
- package/dist/jsx/charts/ChartSurface.native.js.map +1 -1
- package/dist/jsx/charts/LineChart.native.js.map +1 -1
- package/dist/jsx/charts/PieChart.native.js.map +1 -1
- package/dist/jsx/charts/Sparkline.native.js.map +1 -1
- package/dist/jsx/charts/accessibility.native.js.map +1 -1
- package/dist/jsx/charts/chartHeight.native.js.map +1 -1
- package/dist/jsx/charts/composeChart.native.js.map +1 -1
- package/dist/jsx/charts/index.native.js.map +1 -1
- package/dist/jsx/charts/math.native.js.map +1 -1
- package/dist/jsx/charts/series.native.js.map +1 -1
- package/dist/jsx/charts/svg.native.js.map +1 -1
- package/dist/jsx/charts/types.native.js.map +1 -1
- package/dist/jsx/charts/useChartTheme.native.js.map +1 -1
- package/dist/jsx/code/Code/index.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/jsx/code/Pre/index.native.js.map +1 -1
- package/dist/jsx/code/index.native.js.map +1 -1
- package/dist/jsx/componentColors.mjs +3 -3
- package/dist/jsx/componentColors.native.js +3 -3
- package/dist/jsx/componentColors.native.js.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js.map +1 -1
- package/dist/jsx/feedback/copy.native.js.map +1 -1
- package/dist/jsx/feedback/index.native.js.map +1 -1
- package/dist/jsx/feedback/notify.native.js.map +1 -1
- package/dist/jsx/feedback/route.native.js.map +1 -1
- package/dist/jsx/feedback/store.native.js.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/jsx/formLayouts/index.native.js.map +1 -1
- package/dist/jsx/hooks/index.native.js.map +1 -1
- package/dist/jsx/hooks/useClipboard.native.js.map +1 -1
- package/dist/jsx/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/jsx/hooks/useHoldCue.native.js.map +1 -1
- package/dist/jsx/icons/CheckRegular.native.js.map +1 -1
- package/dist/jsx/icons/MinusRegular.native.js.map +1 -1
- package/dist/jsx/icons/index.native.js.map +1 -1
- package/dist/jsx/icons/lucide.native.js.map +1 -1
- package/dist/jsx/icons/themed.native.js.map +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/jsx/images/Image/framing.native.js.map +1 -1
- package/dist/jsx/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/jsx/images/Image/shared.native.js.map +1 -1
- package/dist/jsx/images/Image/types.native.js.map +1 -1
- package/dist/jsx/images/index.native.js.map +1 -1
- package/dist/jsx/index.native.js +1 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/Debug/index.native.js.map +1 -1
- package/dist/jsx/layouts/EmptyState.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/jsx/layouts/PageTemplates.native.js.map +1 -1
- package/dist/jsx/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/jsx/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/jsx/layouts/StatusDot.native.js.map +1 -1
- package/dist/jsx/layouts/ViewSwitcher.mjs +6 -11
- package/dist/jsx/layouts/ViewSwitcher.mjs.map +1 -1
- package/dist/jsx/layouts/ViewSwitcher.native.js +6 -11
- package/dist/jsx/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/bottomAccessory.mjs +144 -0
- package/dist/jsx/layouts/bottomAccessory.mjs.map +1 -0
- package/dist/jsx/layouts/bottomAccessory.native.js +225 -0
- package/dist/jsx/layouts/bottomAccessory.native.js.map +1 -0
- package/dist/jsx/layouts/bottomSafeArea.mjs +16 -0
- package/dist/jsx/layouts/bottomSafeArea.mjs.map +1 -0
- package/dist/jsx/layouts/bottomSafeArea.native.js +75 -0
- package/dist/jsx/layouts/bottomSafeArea.native.js.map +1 -0
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/layouts/index.mjs +2 -0
- package/dist/jsx/layouts/index.mjs.map +1 -1
- package/dist/jsx/layouts/index.native.js +2 -0
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +16 -5
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +16 -5
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.mjs +43 -1
- package/dist/jsx/layouts/screenScroll.mjs.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js +52 -0
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/layouts/toolbar.native.js.map +1 -1
- package/dist/jsx/shared/actionScan.native.js.map +1 -1
- package/dist/jsx/shared/i18n.native.js.map +1 -1
- package/dist/jsx/shared/restoreRetries.native.js.map +1 -1
- package/dist/jsx/shared/t.native.js.map +1 -1
- package/dist/jsx/shared/textRidesText.native.js.map +1 -1
- package/dist/jsx/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/jsx/surfaces.native.js.map +1 -1
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/dist/jsx/testSetup.native.js.map +1 -1
- package/dist/jsx/utils/setTinted.native.js.map +1 -1
- package/dist/jsx/utils/unwrapText.native.js.map +1 -1
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/Gantt.native.js.map +1 -1
- package/dist/jsx/views/GanttDateGrip.native.js.map +1 -1
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/ListRow.native.js.map +1 -1
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.native.js.map +1 -1
- package/dist/jsx/views/ShortcutCard.native.js.map +1 -1
- package/dist/jsx/views/TreeView.native.js.map +1 -1
- package/dist/jsx/views/calendarMath.native.js.map +1 -1
- package/dist/jsx/views/ganttIntervals.native.js.map +1 -1
- package/dist/jsx/views/ganttMath.native.js.map +1 -1
- package/dist/jsx/views/index.native.js.map +1 -1
- package/dist/jsx/views/kanbanDnd.native.js.map +1 -1
- package/dist/jsx/views/matrixMath.native.js.map +1 -1
- package/dist/jsx/views/treeViewDnd.native.js.map +1 -1
- package/dist/jsx/views/treeViewLayout.native.js.map +1 -1
- package/dist/jsx/views/treeViewMotion.native.js.map +1 -1
- package/dist/jsx/views/treeViewReveal.native.js.map +1 -1
- package/dist/jsx/views/widgetChrome.native.js.map +1 -1
- package/package.json +9 -9
- package/src/DotIndicator/index.tsx +52 -12
- package/src/DotIndicator/pageControl.spec.tsx +105 -0
- package/src/Pagination.stories.tsx +23 -0
- package/src/Pagination.tsx +17 -5
- package/src/Tabs/Tabs.bandColor.spec.tsx +19 -8
- package/src/Tabs/Tabs.measurement.spec.tsx +11 -14
- package/src/Tabs/Tabs.native.spec.tsx +10 -3
- package/src/Tabs/index.tsx +5 -5
- package/src/accentControls.spec.tsx +190 -0
- package/src/appShell/TabBar.spec.tsx +1 -1
- package/src/appShell/index.ts +0 -1
- package/src/componentColors.ts +3 -3
- package/src/icons/slots.nativeInk.spec.tsx +2 -1
- package/src/layouts/ViewSwitcher.spec.tsx +12 -12
- package/src/layouts/ViewSwitcher.tsx +6 -7
- package/src/layouts/bottomAccessory.spec.tsx +147 -0
- package/src/layouts/bottomAccessory.tsx +206 -0
- package/src/layouts/bottomSafeArea.native.tsx +43 -0
- package/src/layouts/bottomSafeArea.tsx +13 -0
- package/src/layouts/index.tsx +2 -0
- package/src/layouts/layouts.spec.tsx +6 -9
- package/src/layouts/page.tsx +31 -12
- package/src/layouts/revealTop.spec.tsx +77 -0
- package/src/layouts/screenScroll.tsx +67 -1
- package/types/Collapsible.d.ts +1 -1
- package/types/DotIndicator/index.d.ts +18 -4
- package/types/DotIndicator/index.d.ts.map +1 -1
- package/types/Pagination.d.ts +7 -1
- package/types/Pagination.d.ts.map +1 -1
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/appShell/index.d.ts +0 -1
- package/types/appShell/index.d.ts.map +1 -1
- package/types/componentColors.d.ts +3 -3
- package/types/layouts/ViewSwitcher.d.ts.map +1 -1
- package/types/layouts/bottomAccessory.d.ts +54 -0
- package/types/layouts/bottomAccessory.d.ts.map +1 -0
- package/types/layouts/bottomSafeArea.d.ts +6 -0
- package/types/layouts/bottomSafeArea.d.ts.map +1 -0
- package/types/layouts/bottomSafeArea.native.d.ts +15 -0
- package/types/layouts/bottomSafeArea.native.d.ts.map +1 -0
- package/types/layouts/index.d.ts +2 -0
- package/types/layouts/index.d.ts.map +1 -1
- package/types/layouts/page.d.ts +8 -0
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/screenScroll.d.ts +24 -0
- package/types/layouts/screenScroll.d.ts.map +1 -1
- package/dist/cjs/appShell/BottomAccessory.native.js +0 -53
- package/dist/cjs/appShell/BottomAccessory.native.js.map +0 -1
- package/dist/esm/appShell/BottomAccessory.mjs +0 -18
- package/dist/esm/appShell/BottomAccessory.mjs.map +0 -1
- package/dist/esm/appShell/BottomAccessory.native.js +0 -25
- package/dist/esm/appShell/BottomAccessory.native.js.map +0 -1
- package/dist/jsx/appShell/BottomAccessory.mjs +0 -18
- package/dist/jsx/appShell/BottomAccessory.mjs.map +0 -1
- package/dist/jsx/appShell/BottomAccessory.native.js +0 -53
- package/dist/jsx/appShell/BottomAccessory.native.js.map +0 -1
- package/src/appShell/BottomAccessory.tsx +0 -18
- package/types/appShell/BottomAccessory.d.ts +0 -11
- package/types/appShell/BottomAccessory.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","widgetChrome_exports","NestedIconWell","splitNestedControl","useWidgetChrome","module","exports","import_jsx_runtime","require","import_theme","import_tamagui","nested","px","hitSlop","box","onPress","resolved","useResolvedKnobs","knobProps","control","nestedControl","interactive","cursor","hoverStyle","hoverKnobProps","pressStyle","pressKnobProps","focusVisibleStyle","focusVisibleKnobProps","role"],"sources":["
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","widgetChrome_exports","NestedIconWell","splitNestedControl","useWidgetChrome","module","exports","import_jsx_runtime","require","import_theme","import_tamagui","nested","px","hitSlop","box","onPress","resolved","useResolvedKnobs","knobProps","control","nestedControl","interactive","cursor","hoverStyle","hoverKnobProps","pressStyle","pressKnobProps","focusVisibleStyle","focusVisibleKnobProps","role","param","color","radius","children","identity","useChartPalette","single","fill","ink","useReadableTextOn","jsx","YStack","alignItems","justifyContent","backgroundColor","overflow","IconSlot","icon"],"sources":["widgetChrome.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar widgetChrome_exports = {};\n__export(widgetChrome_exports, {\n NestedIconWell: () => NestedIconWell,\n splitNestedControl: () => splitNestedControl,\n useWidgetChrome: () => useWidgetChrome\n});\nmodule.exports = __toCommonJS(widgetChrome_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_tamagui = require(\"tamagui\");\nfunction splitNestedControl(nested) {\n var { px, hitSlop, ...box } = nested;\n return {\n px,\n hitSlop,\n box\n };\n}\nfunction useWidgetChrome(onPress) {\n var resolved = (0, import_theme.useResolvedKnobs)();\n var { knobProps, control } = resolved;\n var nested = splitNestedControl(knobProps.nestedControl);\n var interactive = onPress ? {\n cursor: \"pointer\",\n hoverStyle: control.hoverKnobProps,\n pressStyle: control.pressKnobProps,\n focusVisibleStyle: control.focusVisibleKnobProps,\n onPress,\n role: \"button\"\n } : void 0;\n return {\n knobProps,\n control,\n nested,\n interactive\n };\n}\nfunction NestedIconWell(param) {\n var { color, box, px, radius, children } = param;\n var identity = (0, import_theme.useChartPalette)().single;\n var fill = color || identity;\n var ink = (0, import_theme.useReadableTextOn)(fill);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ...box,\n ...radius,\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: fill,\n color: ink,\n overflow: \"hidden\",\n \"data-nested-px\": px,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.IconSlot, {\n icon: children,\n color: ink\n })\n });\n}\n//# sourceMappingURL=widgetChrome.js.map\n"],"mappings":"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","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.71.0",
|
|
4
4
|
"description": "multiplatform.one ui components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@floating-ui/react": "^0.27.20",
|
|
61
|
-
"@multiplatform.one/forms": "^7.
|
|
62
|
-
"@multiplatform.one/i18n": "^7.
|
|
63
|
-
"@multiplatform.one/platform": "^7.
|
|
64
|
-
"@multiplatform.one/router": "^7.
|
|
65
|
-
"@multiplatform.one/theme": "^7.
|
|
61
|
+
"@multiplatform.one/forms": "^7.71.0",
|
|
62
|
+
"@multiplatform.one/i18n": "^7.71.0",
|
|
63
|
+
"@multiplatform.one/platform": "^7.71.0",
|
|
64
|
+
"@multiplatform.one/router": "^7.71.0",
|
|
65
|
+
"@multiplatform.one/theme": "^7.71.0",
|
|
66
66
|
"@phosphor-icons/react": "^2.1.10",
|
|
67
67
|
"@shopify/flash-list": "^2.3.1",
|
|
68
68
|
"@tamagui/colors": "2.7.6",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"tamagui": "2.7.6"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@multiplatform.one/config": "7.
|
|
93
|
-
"@multiplatform.one/storybook": "7.
|
|
94
|
-
"@multiplatform.one/test-utils": "7.
|
|
92
|
+
"@multiplatform.one/config": "7.71.0",
|
|
93
|
+
"@multiplatform.one/storybook": "7.71.0",
|
|
94
|
+
"@multiplatform.one/test-utils": "7.71.0",
|
|
95
95
|
"@tamagui/build": "2.7.6",
|
|
96
96
|
"@testing-library/jest-dom": "^7.0.1",
|
|
97
97
|
"@testing-library/react": "^16.3.3",
|
|
@@ -40,11 +40,22 @@ import { withInterp } from "../shared/t";
|
|
|
40
40
|
export type DotVariant = "dots" | "bars" | "pills";
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* What the dots stand for. The
|
|
43
|
+
* What the dots stand for. The idioms differ only in a11y vocabulary:
|
|
44
44
|
* a carousel marks its current slide (`aria-current="true"`, "Go to item N"),
|
|
45
|
-
* a wizard marks its current step (`aria-current="step"`, "Go to step N")
|
|
45
|
+
* a wizard marks its current step (`aria-current="step"`, "Go to step N"),
|
|
46
|
+
* a pager marks its current page (`aria-current="page"`, "Go to page N").
|
|
46
47
|
*/
|
|
47
|
-
export type DotIdiom = "item" | "step";
|
|
48
|
+
export type DotIdiom = "item" | "step" | "page";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* How a long strip collapses to its window.
|
|
52
|
+
*
|
|
53
|
+
* - `distance` — Instagram / Swiper `dynamicBullets`: marks shrink with their
|
|
54
|
+
* distance from the active one.
|
|
55
|
+
* - `edge` — iOS UIPageControl: every mark in the window is full size except
|
|
56
|
+
* the last two toward an edge with more pages beyond it.
|
|
57
|
+
*/
|
|
58
|
+
export type DotWindowing = "distance" | "edge";
|
|
48
59
|
|
|
49
60
|
export interface DotIndicatorProps {
|
|
50
61
|
/** Total number of dots */
|
|
@@ -77,6 +88,10 @@ export interface DotIndicatorProps {
|
|
|
77
88
|
* `data-pagination-dot`, which probes and specs already assert against.
|
|
78
89
|
*/
|
|
79
90
|
dotStateAttribute?: string;
|
|
91
|
+
/** Marks shown before the strip windows (default 5) */
|
|
92
|
+
maxVisible?: number;
|
|
93
|
+
/** How the window shrinks its marks (default `distance`) */
|
|
94
|
+
windowing?: DotWindowing;
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
// ── Knob mappings ─────────────────────────────────────────────
|
|
@@ -135,9 +150,9 @@ function activeMarkWidth(variant: DotVariant, itemSize: number, geometryActive:
|
|
|
135
150
|
return geometryActive;
|
|
136
151
|
}
|
|
137
152
|
|
|
138
|
-
function windowRange(active: number, total: number): [number, number] {
|
|
139
|
-
if (total <=
|
|
140
|
-
const half = Math.floor(
|
|
153
|
+
function windowRange(active: number, total: number, size: number): [number, number] {
|
|
154
|
+
if (total <= size) return [0, Math.max(0, total - 1)];
|
|
155
|
+
const half = Math.floor(size / 2);
|
|
141
156
|
let start = active - half;
|
|
142
157
|
let end = active + half;
|
|
143
158
|
if (start < 0) {
|
|
@@ -157,9 +172,19 @@ function windowScale(
|
|
|
157
172
|
start: number,
|
|
158
173
|
end: number,
|
|
159
174
|
total: number,
|
|
175
|
+
size: number,
|
|
176
|
+
windowing: DotWindowing,
|
|
160
177
|
): number {
|
|
161
|
-
if (total <=
|
|
178
|
+
if (total <= size) return 1;
|
|
162
179
|
if (index < start || index > end) return 0;
|
|
180
|
+
if (windowing === "edge") {
|
|
181
|
+
if (index === active) return 1;
|
|
182
|
+
const moreBefore = start > 0;
|
|
183
|
+
const moreAfter = end < total - 1;
|
|
184
|
+
if ((moreBefore && index === start) || (moreAfter && index === end)) return 0.5;
|
|
185
|
+
if ((moreBefore && index === start + 1) || (moreAfter && index === end - 1)) return 0.75;
|
|
186
|
+
return 1;
|
|
187
|
+
}
|
|
163
188
|
const dist = Math.abs(index - active);
|
|
164
189
|
if (dist === 0) return 1;
|
|
165
190
|
if (dist === 1) return 0.72;
|
|
@@ -273,6 +298,8 @@ export function DotIndicator({
|
|
|
273
298
|
activeDotSize,
|
|
274
299
|
transition,
|
|
275
300
|
dotStateAttribute = "data-dot-state",
|
|
301
|
+
maxVisible = WINDOW,
|
|
302
|
+
windowing = "distance",
|
|
276
303
|
}: DotIndicatorProps) {
|
|
277
304
|
const { t } = useTranslation();
|
|
278
305
|
const { knobProps } = useResolvedKnobs();
|
|
@@ -302,9 +329,13 @@ export function DotIndicator({
|
|
|
302
329
|
// No onChange means the indicator is read-only (informational), which is
|
|
303
330
|
// different from disabled (interactive but blocked)
|
|
304
331
|
const interactive = !disabled && !!onChange;
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
332
|
+
const label =
|
|
333
|
+
idiom === "step"
|
|
334
|
+
? t("Go to step {{number}}")
|
|
335
|
+
: idiom === "page"
|
|
336
|
+
? t("Go to page {{number}}")
|
|
337
|
+
: t("Go to item {{number}}");
|
|
338
|
+
const currentValue = idiom === "item" ? "true" : idiom;
|
|
308
339
|
// LC-68: motion gates on the resolved animation knob (undefined at "none"
|
|
309
340
|
// / prefers-reduced-motion). Host `transition` may name the tween but cannot
|
|
310
341
|
// re-enable motion the knob turned off.
|
|
@@ -312,7 +343,8 @@ export function DotIndicator({
|
|
|
312
343
|
? (transition ?? knobProps.motion.slide.transition)
|
|
313
344
|
: undefined;
|
|
314
345
|
const clampedActive = Math.min(Math.max(0, activeIndex), Math.max(0, total - 1));
|
|
315
|
-
const
|
|
346
|
+
const windowSize = Math.max(1, Math.floor(maxVisible));
|
|
347
|
+
const [winStart, winEnd] = windowRange(clampedActive, total, windowSize);
|
|
316
348
|
|
|
317
349
|
const focusMark = (index: number) => {
|
|
318
350
|
requestAnimationFrame(() => {
|
|
@@ -343,7 +375,15 @@ export function DotIndicator({
|
|
|
343
375
|
const isActive = index === activeIndex;
|
|
344
376
|
// Completion is what a step ALREADY did; the current step outranks it.
|
|
345
377
|
const isCompleted = !isActive && !!completedSteps?.has(index);
|
|
346
|
-
const scale = windowScale(
|
|
378
|
+
const scale = windowScale(
|
|
379
|
+
index,
|
|
380
|
+
clampedActive,
|
|
381
|
+
winStart,
|
|
382
|
+
winEnd,
|
|
383
|
+
total,
|
|
384
|
+
windowSize,
|
|
385
|
+
windowing,
|
|
386
|
+
);
|
|
347
387
|
const hidden = scale === 0;
|
|
348
388
|
const baseWidth = isActive ? activeSize : idleWidth;
|
|
349
389
|
const dotWidth = Math.max(1, Math.round(baseWidth * scale));
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-7889: the phone list pager is the dot strip, the iOS UIPageControl
|
|
3
|
+
* idiom. Clay: "why don't you use the nice page[r] that I created ... It
|
|
4
|
+
* didn't have like the numbers in it it was like dots".
|
|
5
|
+
*
|
|
6
|
+
* - A `page` strip names its dots "Go to page N" and marks the current one
|
|
7
|
+
* `aria-current="page"`.
|
|
8
|
+
* - `windowing="edge"` shows a window of full-size dots and shrinks only the
|
|
9
|
+
* last two toward an edge with more pages beyond it.
|
|
10
|
+
* - `<Pagination variant="dots" idiom="page">` is that strip between chevrons:
|
|
11
|
+
* seven dots at most, every dot jumps, the forward control never submits.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { fireEvent } from "@testing-library/react";
|
|
15
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
16
|
+
import { describe, expect, it, vi } from "vitest";
|
|
17
|
+
import { Pagination } from "../Pagination";
|
|
18
|
+
import { DotIndicator } from "./index";
|
|
19
|
+
|
|
20
|
+
const heights = (container: HTMLElement) =>
|
|
21
|
+
Array.from(container.querySelectorAll<HTMLElement>("[data-dot-index]"))
|
|
22
|
+
.filter((target) => target.getAttribute("data-dot-hidden") !== "true")
|
|
23
|
+
.map((target) =>
|
|
24
|
+
Number(target.querySelector("[data-mark-height]")?.getAttribute("data-mark-height")),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
describe("DotIndicator page idiom (FZ-7889)", () => {
|
|
28
|
+
it("names its dots as pages", () => {
|
|
29
|
+
const { container } = renderWithProviders(
|
|
30
|
+
<DotIndicator total={3} activeIndex={1} idiom="page" onChange={() => {}} />,
|
|
31
|
+
);
|
|
32
|
+
expect(container.querySelectorAll("[aria-label^='Go to page']")).toHaveLength(3);
|
|
33
|
+
expect(container.querySelector("[aria-current='page']")?.getAttribute("aria-label")).toBe(
|
|
34
|
+
"Go to page 2",
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("edge windowing keeps the window full size and shrinks the two dots before more pages", () => {
|
|
39
|
+
const { container } = renderWithProviders(
|
|
40
|
+
<DotIndicator total={20} activeIndex={10} maxVisible={7} windowing="edge" />,
|
|
41
|
+
);
|
|
42
|
+
const visible = heights(container);
|
|
43
|
+
expect(visible).toHaveLength(7);
|
|
44
|
+
const full = visible[3];
|
|
45
|
+
expect(visible[0]).toBeLessThan(visible[1]);
|
|
46
|
+
expect(visible[1]).toBeLessThan(full);
|
|
47
|
+
expect(visible[2]).toBe(full);
|
|
48
|
+
expect(visible[4]).toBe(full);
|
|
49
|
+
expect(visible[5]).toBeLessThan(full);
|
|
50
|
+
expect(visible[6]).toBeLessThan(visible[5]);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("at the first page no dot shrinks toward the start", () => {
|
|
54
|
+
const { container } = renderWithProviders(
|
|
55
|
+
<DotIndicator total={20} activeIndex={0} maxVisible={7} windowing="edge" />,
|
|
56
|
+
);
|
|
57
|
+
const visible = heights(container);
|
|
58
|
+
expect(visible).toHaveLength(7);
|
|
59
|
+
expect(visible[1]).toBe(visible[2]);
|
|
60
|
+
expect(visible[2]).toBe(visible[4]);
|
|
61
|
+
expect(visible[6]).toBeLessThan(visible[4]);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("a short strip never windows or shrinks", () => {
|
|
65
|
+
const { container } = renderWithProviders(
|
|
66
|
+
<DotIndicator total={5} activeIndex={2} maxVisible={7} windowing="edge" />,
|
|
67
|
+
);
|
|
68
|
+
const visible = heights(container);
|
|
69
|
+
expect(visible).toHaveLength(5);
|
|
70
|
+
expect(new Set(visible).size).toBe(1);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("Pagination idiom page (FZ-7889)", () => {
|
|
75
|
+
it("is the dot strip between chevrons: no page numbers, at most seven dots", () => {
|
|
76
|
+
const { container, queryByText } = renderWithProviders(
|
|
77
|
+
<Pagination variant="dots" idiom="page" total={12} page={6} />,
|
|
78
|
+
);
|
|
79
|
+
expect(container.querySelector("[aria-label='Go to previous page']")).not.toBeNull();
|
|
80
|
+
expect(container.querySelector("[aria-label='Go to next page']")).not.toBeNull();
|
|
81
|
+
expect(container.querySelector("[aria-label='Submit']")).toBeNull();
|
|
82
|
+
expect(queryByText("6")).toBeNull();
|
|
83
|
+
expect(container.querySelectorAll("[data-pagination-dot]")).toHaveLength(12);
|
|
84
|
+
const shown = Array.from(container.querySelectorAll("[data-dot-index]")).filter(
|
|
85
|
+
(dot) => dot.getAttribute("data-dot-hidden") !== "true",
|
|
86
|
+
);
|
|
87
|
+
expect(shown).toHaveLength(7);
|
|
88
|
+
expect(container.querySelector("[aria-current='page']")?.getAttribute("aria-label")).toBe(
|
|
89
|
+
"Go to page 6",
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("every dot jumps to its page, and next stops at the last page", () => {
|
|
94
|
+
const onPageChange = vi.fn();
|
|
95
|
+
const { container } = renderWithProviders(
|
|
96
|
+
<Pagination variant="dots" idiom="page" total={3} page={3} onPageChange={onPageChange} />,
|
|
97
|
+
);
|
|
98
|
+
fireEvent.click(container.querySelector("[aria-label='Go to page 1']")!);
|
|
99
|
+
expect(onPageChange).toHaveBeenLastCalledWith(1);
|
|
100
|
+
const next = container.querySelector("[aria-label='Go to next page']")!;
|
|
101
|
+
expect(next.getAttribute("aria-disabled") === "true" || next.hasAttribute("disabled")).toBe(
|
|
102
|
+
true,
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -245,3 +245,26 @@ export const Simple: Story = {
|
|
|
245
245
|
</YStack>
|
|
246
246
|
),
|
|
247
247
|
};
|
|
248
|
+
|
|
249
|
+
export const PageDots: Story = {
|
|
250
|
+
parameters: {
|
|
251
|
+
docs: {
|
|
252
|
+
description: {
|
|
253
|
+
story:
|
|
254
|
+
'The phone list pager (FZ-7889): `idiom="page"` on the dot strip, the iOS ' +
|
|
255
|
+
"UIPageControl idiom. Chevrons, no numbers, every dot jumps, and past seven pages " +
|
|
256
|
+
"the strip windows with the two dots toward more pages shrinking.",
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
render: () => {
|
|
261
|
+
const [few, setFew] = useState(2);
|
|
262
|
+
const [many, setMany] = useState(10);
|
|
263
|
+
return (
|
|
264
|
+
<YStack gap="$4">
|
|
265
|
+
<Pagination variant="dots" idiom="page" total={3} page={few} onPageChange={setFew} />
|
|
266
|
+
<Pagination variant="dots" idiom="page" total={20} page={many} onPageChange={setMany} />
|
|
267
|
+
</YStack>
|
|
268
|
+
);
|
|
269
|
+
},
|
|
270
|
+
};
|
package/src/Pagination.tsx
CHANGED
|
@@ -139,8 +139,17 @@ export interface PaginationProps extends Omit<XStackProps, "children" | "onChang
|
|
|
139
139
|
boundaryCount?: number;
|
|
140
140
|
/** Show first/last double-chevron buttons (numbered variant) */
|
|
141
141
|
showFirstLast?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* What a dot strip counts. `step` (default) is the wizard; `page` is the
|
|
144
|
+
* iOS UIPageControl pager for a list: chevrons, every dot jumps to its
|
|
145
|
+
* page, and a long strip windows to seven with shrinking edge dots.
|
|
146
|
+
*/
|
|
147
|
+
idiom?: "step" | "page";
|
|
142
148
|
}
|
|
143
149
|
|
|
150
|
+
/** UIPageControl shows about seven dots before it windows. */
|
|
151
|
+
const pageDotWindow = 7;
|
|
152
|
+
|
|
144
153
|
export function Pagination({
|
|
145
154
|
total,
|
|
146
155
|
activeIndex,
|
|
@@ -161,6 +170,7 @@ export function Pagination({
|
|
|
161
170
|
boundaryCount = 1,
|
|
162
171
|
showFirstLast = false,
|
|
163
172
|
openEnded = false,
|
|
173
|
+
idiom = "step",
|
|
164
174
|
...stackProps
|
|
165
175
|
}: PaginationProps) {
|
|
166
176
|
const { t } = useTranslation();
|
|
@@ -246,7 +256,8 @@ export function Pagination({
|
|
|
246
256
|
|
|
247
257
|
const isSimple = variant === "simple";
|
|
248
258
|
const isNumbered = variant === "numbered";
|
|
249
|
-
const
|
|
259
|
+
const pageDots = idiom === "page" && !isNumbered && !isSimple;
|
|
260
|
+
const isPageNavigation = isNumbered || isSimple || pageDots;
|
|
250
261
|
|
|
251
262
|
// The two idioms differ in which glyphs the controls take, whether the
|
|
252
263
|
// control is circular, and whether the last step submits — not in structure.
|
|
@@ -384,24 +395,25 @@ export function Pagination({
|
|
|
384
395
|
total={total}
|
|
385
396
|
activeIndex={index}
|
|
386
397
|
variant={variant}
|
|
387
|
-
idiom="step"
|
|
398
|
+
idiom={pageDots ? "page" : "step"}
|
|
399
|
+
{...(pageDots ? { maxVisible: pageDotWindow, windowing: "edge" as const } : undefined)}
|
|
388
400
|
rail
|
|
389
401
|
completedSteps={completedSteps}
|
|
390
402
|
dotSize={step.mark}
|
|
391
403
|
activeDotSize={step.active}
|
|
392
404
|
transition={motionTransition}
|
|
393
405
|
dotStateAttribute="data-pagination-dot"
|
|
394
|
-
onChange={allowJumpTo && !disabled ? goTo : undefined}
|
|
406
|
+
onChange={(allowJumpTo || pageDots) && !disabled ? goTo : undefined}
|
|
395
407
|
// A strip nobody can press has no disabled state — only a jumpable
|
|
396
408
|
// one is "interactive but blocked".
|
|
397
|
-
disabled={allowJumpTo && disabled}
|
|
409
|
+
disabled={(allowJumpTo || pageDots) && disabled}
|
|
398
410
|
/>
|
|
399
411
|
)}
|
|
400
412
|
|
|
401
413
|
<Button
|
|
402
414
|
size={knobProps.sizeToken}
|
|
403
415
|
chromeless={!submits}
|
|
404
|
-
|
|
416
|
+
accent={submits}
|
|
405
417
|
icon={isPageNavigation ? NextIcon : submits ? CheckIcon : NextArrowIcon}
|
|
406
418
|
onPress={handleNext}
|
|
407
419
|
disabled={!canNext}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { createDefaultThemeConfig } from "@multiplatform.one/theme";
|
|
3
|
+
import type { ReactElement } from "react";
|
|
4
|
+
import { TamaguiProvider } from "tamagui";
|
|
2
5
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { componentColors } from "../componentColors";
|
|
4
6
|
import { Tabs } from "./index";
|
|
5
7
|
|
|
8
|
+
const houseConfig = createDefaultThemeConfig();
|
|
9
|
+
|
|
10
|
+
function renderWithHouseThemes(ui: ReactElement) {
|
|
11
|
+
return renderWithProviders(
|
|
12
|
+
<TamaguiProvider config={houseConfig.tamagui} defaultTheme="light">
|
|
13
|
+
{ui}
|
|
14
|
+
</TamaguiProvider>,
|
|
15
|
+
{ tamagui: false },
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
describe("selected tab ink follows the selection tier", () => {
|
|
7
20
|
it.each([undefined, "rebeccapurple"])(
|
|
8
21
|
"inherits selection ink without replacing explicit icon colour %s",
|
|
9
22
|
(color) => {
|
|
10
|
-
const result =
|
|
23
|
+
const result = renderWithHouseThemes(
|
|
11
24
|
<Tabs
|
|
12
25
|
value="one"
|
|
13
26
|
items={[
|
|
@@ -16,19 +29,17 @@ describe("selected tab ink follows the selection tier", () => {
|
|
|
16
29
|
/>,
|
|
17
30
|
);
|
|
18
31
|
const icon = result.getByTestId("tab-icon");
|
|
19
|
-
expect(icon.parentElement!.className).toContain("_col-
|
|
32
|
+
expect(icon.parentElement!.className).toContain("_col-selectedCol");
|
|
20
33
|
expect(icon.getAttribute("color")).toBe(color ?? null);
|
|
21
34
|
},
|
|
22
35
|
);
|
|
23
36
|
it.each(["band", "contained", "underline"] as const)(
|
|
24
|
-
"uses
|
|
37
|
+
"uses the accent selected ink for %s tabs",
|
|
25
38
|
(variant) => {
|
|
26
|
-
const result =
|
|
39
|
+
const result = renderWithHouseThemes(
|
|
27
40
|
<Tabs variant={variant} value="one" items={[{ value: "one", label: "Selected" }]} />,
|
|
28
41
|
);
|
|
29
|
-
expect(result.getByText("Selected").className).toContain(
|
|
30
|
-
`_col-${componentColors.selection.ink.slice(1)}`,
|
|
31
|
-
);
|
|
42
|
+
expect(result.getByText("Selected").className).toContain("_col-selectedCol");
|
|
32
43
|
},
|
|
33
44
|
);
|
|
34
45
|
});
|
|
@@ -219,20 +219,17 @@ describe("Tabs selection indicator colour", () => {
|
|
|
219
219
|
fireEvent.pointerDown(selected);
|
|
220
220
|
expect(indicator.className).toContain("_bg-color5");
|
|
221
221
|
fireEvent[event](selected);
|
|
222
|
-
expect(indicator.className).toContain("_bg-
|
|
222
|
+
expect(indicator.className).toContain("_bg-selectedBac");
|
|
223
223
|
},
|
|
224
224
|
);
|
|
225
225
|
|
|
226
|
-
it.each([undefined, "accent"] as const)(
|
|
227
|
-
|
|
228
|
-
(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
expect(indicator.getAttribute("data-observed-theme")).toBe("light");
|
|
234
|
-
},
|
|
235
|
-
);
|
|
226
|
+
it.each([undefined, "accent"] as const)("keeps %s underline on the host accent", (intent) => {
|
|
227
|
+
const tree = renderSelectionTabs({ accent: intent === "accent" });
|
|
228
|
+
act(() => observed.interactions.get("tab-5")("select", last));
|
|
229
|
+
const indicator = tree.container.querySelector('[data-tabs-indicator="underline"]')!;
|
|
230
|
+
expect(indicator.className).toContain("_bg-accentBackg");
|
|
231
|
+
expect(indicator.getAttribute("data-observed-theme")).toBe("light");
|
|
232
|
+
});
|
|
236
233
|
|
|
237
234
|
it.each(["error", "warning", "success"] as const)(
|
|
238
235
|
"keeps %s underline in its intent theme",
|
|
@@ -245,11 +242,11 @@ describe("Tabs selection indicator colour", () => {
|
|
|
245
242
|
},
|
|
246
243
|
);
|
|
247
244
|
|
|
248
|
-
it("paints the contained thumb with the host
|
|
245
|
+
it("paints the contained thumb with the host accent tint", () => {
|
|
249
246
|
const tree = renderSelectionTabs({ variant: "contained" });
|
|
250
247
|
act(() => observed.interactions.get("tab-5")("select", last));
|
|
251
248
|
const indicator = tree.container.querySelector('[data-tabs-indicator="thumb"]')!;
|
|
252
|
-
expect(indicator.className).toContain("_bg-
|
|
249
|
+
expect(indicator.className).toContain("_bg-selectedBac");
|
|
253
250
|
expect(indicator.getAttribute("data-observed-theme")).toBe("light");
|
|
254
251
|
const selected = tree.getByRole("tab", { name: "Tab 6" });
|
|
255
252
|
fireEvent.pointerEnter(selected);
|
|
@@ -258,6 +255,6 @@ describe("Tabs selection indicator colour", () => {
|
|
|
258
255
|
expect(indicator.className).toContain("_bg-color5");
|
|
259
256
|
fireEvent.pointerUp(selected);
|
|
260
257
|
fireEvent.pointerLeave(selected);
|
|
261
|
-
expect(indicator.className).toContain("_bg-
|
|
258
|
+
expect(indicator.className).toContain("_bg-selectedBac");
|
|
262
259
|
});
|
|
263
260
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { createDefaultThemeConfig } from "@multiplatform.one/theme";
|
|
2
3
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
4
|
import { Tabs } from "./index";
|
|
4
5
|
import { act, cleanup } from "@testing-library/react";
|
|
6
|
+
import { TamaguiProvider } from "tamagui";
|
|
5
7
|
|
|
6
8
|
const observed = vi.hoisted(() => ({ triggers: new Map<string, any>() }));
|
|
7
9
|
|
|
@@ -23,6 +25,8 @@ vi.mock("tamagui", async (importOriginal) => {
|
|
|
23
25
|
};
|
|
24
26
|
});
|
|
25
27
|
|
|
28
|
+
const houseConfig = createDefaultThemeConfig();
|
|
29
|
+
|
|
26
30
|
afterEach(() => {
|
|
27
31
|
cleanup();
|
|
28
32
|
observed.triggers.clear();
|
|
@@ -31,19 +35,22 @@ afterEach(() => {
|
|
|
31
35
|
describe("native Tabs accessibility contract", () => {
|
|
32
36
|
it("paints and clears contained thumb feedback through native press handlers", () => {
|
|
33
37
|
const result = renderWithProviders(
|
|
34
|
-
<
|
|
38
|
+
<TamaguiProvider config={houseConfig.tamagui} defaultTheme="light">
|
|
39
|
+
<Tabs variant="contained" value="one" items={[{ value: "one", label: "One" }]} />
|
|
40
|
+
</TamaguiProvider>,
|
|
41
|
+
{ tamagui: false },
|
|
35
42
|
);
|
|
36
43
|
act(() =>
|
|
37
44
|
observed.triggers.get("one").onInteraction("select", { x: 0, y: 0, width: 100, height: 40 }),
|
|
38
45
|
);
|
|
39
46
|
const indicator = result.container.querySelector('[data-tabs-indicator="thumb"]')!;
|
|
40
|
-
expect(indicator.className).toContain("_bg-
|
|
47
|
+
expect(indicator.className).toContain("_bg-selectedBac");
|
|
41
48
|
expect(observed.triggers.get("one").onPressIn).toBeTypeOf("function");
|
|
42
49
|
expect(observed.triggers.get("one").onPressOut).toBeTypeOf("function");
|
|
43
50
|
act(() => observed.triggers.get("one").onPressIn());
|
|
44
51
|
expect(indicator.className).toContain("_bg-color5");
|
|
45
52
|
act(() => observed.triggers.get("one").onPressOut());
|
|
46
|
-
expect(indicator.className).toContain("_bg-
|
|
53
|
+
expect(indicator.className).toContain("_bg-selectedBac");
|
|
47
54
|
});
|
|
48
55
|
it("names each button and exposes selected and disabled states", () => {
|
|
49
56
|
const result = renderWithProviders(
|
package/src/Tabs/index.tsx
CHANGED
|
@@ -625,7 +625,7 @@ function TabsRoot({
|
|
|
625
625
|
<UnderlineIndicator
|
|
626
626
|
x={activeLayout.x}
|
|
627
627
|
width={activeLayout.width}
|
|
628
|
-
backgroundColor={indicatorTheme ? "$color9" : componentColors.
|
|
628
|
+
backgroundColor={indicatorTheme ? "$color9" : componentColors.indicator.mark}
|
|
629
629
|
data-tabs-indicator="underline"
|
|
630
630
|
{...transitionProps(knobProps.motion.control, ["width"])}
|
|
631
631
|
/>
|
|
@@ -640,7 +640,7 @@ function TabsRoot({
|
|
|
640
640
|
? componentColors.selection.press
|
|
641
641
|
: hoverValue === currentValue
|
|
642
642
|
? componentColors.selection.hover
|
|
643
|
-
:
|
|
643
|
+
: "$selectedBackground"
|
|
644
644
|
}
|
|
645
645
|
data-tabs-indicator="thumb"
|
|
646
646
|
{...thumbRadius}
|
|
@@ -834,12 +834,12 @@ function TabsRoot({
|
|
|
834
834
|
backgroundColor={
|
|
835
835
|
isBand || isActive || isDisabled ? "transparent" : feedbackBackground
|
|
836
836
|
}
|
|
837
|
-
{...(isActive && !isDisabled ? { color:
|
|
837
|
+
{...(isActive && !isDisabled ? { color: "$selectedColor" } : undefined)}
|
|
838
838
|
{...(kbRing ? keyboardFocusRingProps : undefined)}
|
|
839
839
|
>
|
|
840
840
|
<IconSlot
|
|
841
841
|
icon={item.icon}
|
|
842
|
-
color={isActive && !isDisabled ?
|
|
842
|
+
color={isActive && !isDisabled ? "$selectedColor" : undefined}
|
|
843
843
|
/>
|
|
844
844
|
<TabLabel
|
|
845
845
|
flexShrink={1}
|
|
@@ -851,7 +851,7 @@ function TabsRoot({
|
|
|
851
851
|
isDisabled
|
|
852
852
|
? disabledState.textKnobProps.color
|
|
853
853
|
: isActive
|
|
854
|
-
?
|
|
854
|
+
? "$selectedColor"
|
|
855
855
|
: knobProps.textRole.label.color
|
|
856
856
|
}
|
|
857
857
|
>
|