@multiplatform.one/components 7.69.1 → 7.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Accordion/index.native.js +1 -1
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/AnimateHeight/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Badge/index.native.js.map +1 -1
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/CardFooter.native.js.map +1 -1
- package/dist/cjs/CardHeader.native.js.map +1 -1
- package/dist/cjs/Carousel/index.native.js +3 -3
- package/dist/cjs/Carousel/index.native.js.map +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/Collapsible.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.cjs +17 -6
- package/dist/cjs/ContextMenu/index.native.js +17 -6
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/DotIndicator/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.cjs +9 -3
- package/dist/cjs/DropdownMenu/index.native.js +9 -3
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/cjs/ErrorBoundary/index.native.js.map +1 -1
- package/dist/cjs/Heading.native.js.map +1 -1
- package/dist/cjs/Kbd/index.native.js.map +1 -1
- package/dist/cjs/Kbd/keys.native.js.map +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.native.js +1 -1
- package/dist/cjs/Lightbox/shared.native.js.map +1 -1
- package/dist/cjs/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/cjs/Material/index.native.js.map +1 -1
- package/dist/cjs/Meter/index.native.js +1 -1
- package/dist/cjs/Meter/index.native.js.map +1 -1
- package/dist/cjs/Meter/meter.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.native.js +1 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +1 -1
- package/dist/cjs/Pagination.native.js +2 -2
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/ProgressSteps/index.native.js.map +1 -1
- package/dist/cjs/Quote/index.native.js.map +1 -1
- package/dist/cjs/SchemeToggle/index.native.js +1 -1
- package/dist/cjs/SchemeToggle/index.native.js.map +1 -1
- package/dist/cjs/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/cjs/Separator/index.native.js.map +1 -1
- package/dist/cjs/Sheet.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/cjs/SheetModal/detents.native.js.map +1 -1
- package/dist/cjs/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/cjs/Skeleton/index.native.js.map +1 -1
- package/dist/cjs/SkipLink/index.native.js.map +1 -1
- package/dist/cjs/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/cjs/SortableList/index.native.js.map +1 -1
- package/dist/cjs/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +5 -5
- package/dist/cjs/Tabs/index.native.js +6 -6
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.native.js.map +1 -1
- package/dist/cjs/ThemePresetPicker/index.native.js +2 -2
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/Toast/index.native.js.map +1 -1
- package/dist/cjs/Toast/store.native.js.map +1 -1
- package/dist/cjs/Tooltip/nativePress.native.js.map +1 -1
- package/dist/cjs/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/cjs/TreeSelect/index.cjs +6 -3
- package/dist/cjs/TreeSelect/index.native.js +7 -4
- package/dist/cjs/TreeSelect/index.native.js.map +1 -1
- package/dist/cjs/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/cjs/Video/PlayerChrome.native.js.map +1 -1
- package/dist/cjs/Video/VideoFrame.native.js.map +1 -1
- package/dist/cjs/Video/types.native.js.map +1 -1
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/Wizard/index.native.js +2 -2
- package/dist/cjs/Wizard/index.native.js.map +1 -1
- package/dist/cjs/actions/ActionBar.native.js.map +1 -1
- package/dist/cjs/actions/DangerSection.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.native.js.map +1 -1
- package/dist/cjs/actions/HeaderActions.native.js +2 -2
- package/dist/cjs/actions/HeaderActions.native.js.map +1 -1
- package/dist/cjs/actions/StandardAction.native.js +1 -1
- package/dist/cjs/actions/StandardAction.native.js.map +1 -1
- package/dist/cjs/actions/devWarn.native.js.map +1 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/actions/severity.native.js.map +1 -1
- package/dist/cjs/appShell/BottomAccessory.native.js.map +1 -1
- package/dist/cjs/appShell/Dock.native.js.map +1 -1
- package/dist/cjs/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/cjs/appShell/ScopeMenu.cjs +4 -1
- package/dist/cjs/appShell/ScopeMenu.native.js +4 -1
- package/dist/cjs/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/cjs/appShell/Springboard.native.js +1 -1
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabBar.native.js +1 -1
- package/dist/cjs/appShell/TabBar.native.js.map +1 -1
- package/dist/cjs/appShell/appTile.native.js +1 -1
- package/dist/cjs/appShell/appTile.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.native.js +1 -1
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/charts/ChartSurface.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/PieChart.native.js.map +1 -1
- package/dist/cjs/charts/Sparkline.native.js.map +1 -1
- package/dist/cjs/charts/accessibility.native.js.map +1 -1
- package/dist/cjs/charts/chartHeight.native.js.map +1 -1
- package/dist/cjs/charts/composeChart.native.js.map +1 -1
- package/dist/cjs/charts/index.native.js.map +1 -1
- package/dist/cjs/charts/math.native.js.map +1 -1
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/charts/svg.native.js.map +1 -1
- package/dist/cjs/charts/types.native.js.map +1 -1
- package/dist/cjs/charts/useChartTheme.native.js.map +1 -1
- package/dist/cjs/code/Code/index.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.native.js +7 -7
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/cjs/code/Pre/index.native.js.map +1 -1
- package/dist/cjs/code/index.native.js +5 -5
- package/dist/cjs/code/index.native.js.map +1 -1
- package/dist/cjs/componentColors.cjs +3 -3
- package/dist/cjs/componentColors.native.js +3 -3
- package/dist/cjs/componentColors.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/NotifyHost.native.js +2 -2
- package/dist/cjs/feedback/NotifyHost.native.js.map +1 -1
- package/dist/cjs/feedback/copy.native.js.map +1 -1
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/feedback/notify.native.js.map +1 -1
- package/dist/cjs/feedback/route.native.js.map +1 -1
- package/dist/cjs/feedback/store.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/cjs/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/cjs/formLayouts/index.native.js.map +1 -1
- package/dist/cjs/hooks/index.native.js +1 -1
- package/dist/cjs/hooks/index.native.js.map +1 -1
- package/dist/cjs/hooks/useClipboard.native.js.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/cjs/hooks/useHoldCue.native.js.map +1 -1
- package/dist/cjs/icons/CheckRegular.native.js.map +1 -1
- package/dist/cjs/icons/MinusRegular.native.js.map +1 -1
- package/dist/cjs/icons/index.native.js.map +1 -1
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.native.js.map +1 -1
- package/dist/cjs/images/Image/index.native.js +1 -1
- package/dist/cjs/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/cjs/images/Image/shared.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/images/Image/types.native.js.map +1 -1
- package/dist/cjs/images/index.native.js.map +1 -1
- package/dist/cjs/index.native.js +36 -36
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +2 -2
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/Debug/index.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/cjs/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/cjs/layouts/StatusDot.native.js.map +1 -1
- package/dist/cjs/layouts/ViewSwitcher.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/attachments.native.js +1 -1
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/cjs/layouts/index.native.js +3 -3
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.native.js +2 -2
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/cjs/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.native.js +1 -1
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.native.js +2 -2
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.native.js +2 -2
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.native.js +1 -1
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/shared/actionScan.native.js.map +1 -1
- package/dist/cjs/shared/i18n.native.js.map +1 -1
- package/dist/cjs/shared/restoreRetries.native.js.map +1 -1
- package/dist/cjs/shared/t.native.js.map +1 -1
- package/dist/cjs/shared/textRidesText.native.js.map +1 -1
- package/dist/cjs/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/tamagui.native.js +1 -1
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/cjs/testSetup.native.js.map +1 -1
- package/dist/cjs/utils/setTinted.native.js.map +1 -1
- package/dist/cjs/utils/unwrapText.native.js.map +1 -1
- package/dist/cjs/views/Calendar.native.js +1 -1
- package/dist/cjs/views/Calendar.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.native.js +2 -2
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/Gantt.native.js +2 -2
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/GanttDateGrip.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.native.js +2 -2
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/Kanban.native.js +1 -1
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ListRow.native.js.map +1 -1
- package/dist/cjs/views/Matrix.native.js +2 -2
- package/dist/cjs/views/Matrix.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +2 -2
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -1
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/calendarMath.native.js.map +1 -1
- package/dist/cjs/views/ganttIntervals.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.native.js +1 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/kanbanDnd.native.js.map +1 -1
- package/dist/cjs/views/matrixMath.native.js.map +1 -1
- package/dist/cjs/views/treeViewDnd.native.js.map +1 -1
- package/dist/cjs/views/treeViewLayout.native.js.map +1 -1
- package/dist/cjs/views/treeViewMotion.native.js.map +1 -1
- package/dist/cjs/views/treeViewReveal.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.mjs +18 -7
- package/dist/esm/ContextMenu/index.mjs.map +1 -1
- package/dist/esm/ContextMenu/index.native.js +18 -7
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +10 -4
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +10 -4
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/Pagination.mjs +1 -1
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +1 -1
- 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/TreeSelect/index.mjs +7 -4
- package/dist/esm/TreeSelect/index.mjs.map +1 -1
- package/dist/esm/TreeSelect/index.native.js +7 -4
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.mjs +5 -2
- package/dist/esm/appShell/ScopeMenu.mjs.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js +5 -2
- package/dist/esm/appShell/ScopeMenu.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/jsx/ContextMenu/index.mjs +18 -7
- package/dist/jsx/ContextMenu/index.mjs.map +1 -1
- package/dist/jsx/ContextMenu/index.native.js +17 -6
- package/dist/jsx/ContextMenu/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +10 -4
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +9 -3
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +1 -1
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +1 -1
- package/dist/jsx/Pagination.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/TreeSelect/index.mjs +7 -4
- package/dist/jsx/TreeSelect/index.mjs.map +1 -1
- package/dist/jsx/TreeSelect/index.native.js +6 -3
- package/dist/jsx/TreeSelect/index.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.mjs +5 -2
- package/dist/jsx/appShell/ScopeMenu.mjs.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js +4 -1
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/componentColors.mjs +3 -3
- package/dist/jsx/componentColors.native.js +3 -3
- 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/package.json +9 -9
- package/src/ContextMenu/ContextMenu.spec.tsx +5 -5
- package/src/ContextMenu/index.tsx +21 -8
- package/src/DropdownMenu/DropdownMenu.spec.tsx +5 -4
- package/src/DropdownMenu/index.tsx +10 -4
- package/src/Pagination.tsx +1 -1
- package/src/SchemeToggle/SchemeToggle.spec.tsx +3 -2
- package/src/SheetModal/SheetModal.menus.spec.tsx +2 -2
- 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/TreeSelect/index.tsx +12 -3
- package/src/accentControls.spec.tsx +190 -0
- package/src/appShell/ScopeMenu.tsx +6 -3
- package/src/checkedRow.spec.tsx +64 -10
- 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/layouts.spec.tsx +6 -9
- package/types/Collapsible.d.ts +1 -1
- package/types/ContextMenu/index.d.ts +1 -0
- package/types/ContextMenu/index.d.ts.map +1 -1
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/TreeSelect/index.d.ts.map +1 -1
- package/types/appShell/ScopeMenu.d.ts.map +1 -1
- package/types/componentColors.d.ts +3 -3
- package/types/layouts/ViewSwitcher.d.ts.map +1 -1
|
@@ -16,16 +16,17 @@ import { IconSlot } from "@multiplatform.one/theme";
|
|
|
16
16
|
* native as the pull-down under its trigger instead (a bar button, FZ-8158).
|
|
17
17
|
*
|
|
18
18
|
* Rows: 44 tall, padX 13 (`menuRowFrame` $3), leading glyph where the row has
|
|
19
|
-
* one, the chosen row
|
|
20
|
-
*
|
|
19
|
+
* one, the chosen row on the checked fill under its check (`menuRowChecked`,
|
|
20
|
+
* LC-262), hover `$color3`, label weight 400, keyboard 2px ring offset 0.
|
|
21
21
|
* Sheet at ≤640 via FloatingPanel's overlay family pivot.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
transitionProps,
|
|
26
26
|
hairline,
|
|
27
|
-
useIdentityInkOnSurface,
|
|
28
27
|
keyboardFocusRingProps,
|
|
28
|
+
useMenuRowCheckInk,
|
|
29
|
+
menuRowChecked,
|
|
29
30
|
menuRowFrame,
|
|
30
31
|
useResolvedKnobs,
|
|
31
32
|
warnBareDisabled,
|
|
@@ -133,6 +134,9 @@ const ItemRow = styled(XStack, {
|
|
|
133
134
|
outlineWidth: 0,
|
|
134
135
|
},
|
|
135
136
|
variants: {
|
|
137
|
+
selected: {
|
|
138
|
+
true: {},
|
|
139
|
+
},
|
|
136
140
|
disabled: {
|
|
137
141
|
true: {
|
|
138
142
|
cursor: "default",
|
|
@@ -412,6 +416,7 @@ export interface ContextMenuItemProps extends Omit<
|
|
|
412
416
|
interface ItemBodyProps extends ContextMenuItemProps {
|
|
413
417
|
trailing?: ReactNode;
|
|
414
418
|
closeOnSelectDefault?: boolean;
|
|
419
|
+
selected?: boolean;
|
|
415
420
|
}
|
|
416
421
|
|
|
417
422
|
const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function ContextMenuItemBody(
|
|
@@ -427,6 +432,7 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
427
432
|
closeOnSelectDefault = true,
|
|
428
433
|
role = "menuitem",
|
|
429
434
|
trailing,
|
|
435
|
+
selected = false,
|
|
430
436
|
...props
|
|
431
437
|
},
|
|
432
438
|
forwardedRef,
|
|
@@ -464,10 +470,13 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
464
470
|
pressStyle: { backgroundColor: "$red4" },
|
|
465
471
|
}
|
|
466
472
|
: undefined;
|
|
473
|
+
const checkedFill = menuRowChecked(knobProps.scheme);
|
|
467
474
|
const focusFill =
|
|
468
475
|
destructive && !disabled
|
|
469
476
|
? { backgroundColor: "$red3" as const }
|
|
470
|
-
:
|
|
477
|
+
: selected
|
|
478
|
+
? { backgroundColor: checkedFill.backgroundColor }
|
|
479
|
+
: { backgroundColor: HOVER_FILL };
|
|
471
480
|
const ring = kbRing
|
|
472
481
|
? { ...keyboardFocusRingProps, outlineOffset: 0 }
|
|
473
482
|
: { outlineWidth: 0 as const };
|
|
@@ -478,6 +487,7 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
478
487
|
ref={forwardedRef}
|
|
479
488
|
role={role}
|
|
480
489
|
disabled={disabled}
|
|
490
|
+
selected={selected}
|
|
481
491
|
aria-disabled={disabled || undefined}
|
|
482
492
|
aria-busy={busy || undefined}
|
|
483
493
|
data-mp-busy={busy ? "true" : undefined}
|
|
@@ -485,12 +495,14 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
485
495
|
{...transitionProps(knobProps.motion.control)}
|
|
486
496
|
onPress={handleSelect}
|
|
487
497
|
data-mp-hover-fill={HOVER_FILL}
|
|
498
|
+
data-mp-selected-fill={selected ? checkedFill.backgroundColor : undefined}
|
|
488
499
|
data-mp-pad-x={String(knobProps.menuRow.paddingHorizontal)}
|
|
489
500
|
data-mp-row-height={rowHeight}
|
|
490
501
|
data-mp-font-weight="400"
|
|
491
502
|
data-mp-ring-offset="0"
|
|
492
503
|
data-mp-kb-ring={kbRing ? "true" : undefined}
|
|
493
504
|
{...highlightFill}
|
|
505
|
+
{...(selected ? checkedFill : undefined)}
|
|
494
506
|
{...(explainedDisable ? { paddingVertical: "$1.5" } : {})}
|
|
495
507
|
{...(props as Record<string, unknown>)}
|
|
496
508
|
{...(isWeb
|
|
@@ -596,12 +608,13 @@ export interface ContextMenuCheckboxItemProps extends Omit<ContextMenuItemProps,
|
|
|
596
608
|
|
|
597
609
|
const ContextMenuCheckboxItem = forwardRef<TamaguiElement, ContextMenuCheckboxItemProps>(
|
|
598
610
|
function ContextMenuCheckboxItem({ checked, onCheckedChange, onSelect, ...props }, ref) {
|
|
599
|
-
const
|
|
611
|
+
const checkInk = useMenuRowCheckInk();
|
|
600
612
|
return (
|
|
601
613
|
<ContextMenuItemBody
|
|
602
614
|
ref={ref}
|
|
603
615
|
role={"menuitemcheckbox" as "menuitem"}
|
|
604
616
|
aria-checked={checked}
|
|
617
|
+
selected={checked}
|
|
605
618
|
closeOnSelectDefault={false}
|
|
606
619
|
onSelect={() => {
|
|
607
620
|
onCheckedChange?.(!checked);
|
|
@@ -615,11 +628,11 @@ const ContextMenuCheckboxItem = forwardRef<TamaguiElement, ContextMenuCheckboxIt
|
|
|
615
628
|
justifyContent="center"
|
|
616
629
|
opacity={checked ? 1 : 0}
|
|
617
630
|
data-mp-check="trailing"
|
|
618
|
-
{...(isWeb &&
|
|
619
|
-
? ({ style: { color:
|
|
631
|
+
{...(isWeb && checkInk
|
|
632
|
+
? ({ style: { color: checkInk } } as Record<string, unknown>)
|
|
620
633
|
: {})}
|
|
621
634
|
>
|
|
622
|
-
<IconSlot icon={<CheckIcon size={14} weight="bold"
|
|
635
|
+
<IconSlot icon={<CheckIcon size={14} weight="bold" color={checkInk} />} />
|
|
623
636
|
</View>
|
|
624
637
|
}
|
|
625
638
|
{...props}
|
|
@@ -517,18 +517,19 @@ describe("DropdownMenu FloatingPanel cover contract", () => {
|
|
|
517
517
|
expect(edit.className).toMatch(/_btlr-0px/);
|
|
518
518
|
});
|
|
519
519
|
|
|
520
|
-
it("trails the check on the selected row
|
|
520
|
+
it("trails the check on the selected row, which rests on the checked fill (FZ-8355 r6)", async () => {
|
|
521
521
|
renderOpen();
|
|
522
522
|
await waitFor(() => {
|
|
523
523
|
expect(document.querySelector('[role="menuitemcheckbox"]')).toBeTruthy();
|
|
524
524
|
});
|
|
525
525
|
const selected = document.querySelector<HTMLElement>('[role="menuitemcheckbox"]');
|
|
526
526
|
expect(selected?.getAttribute("aria-checked")).toBe("true");
|
|
527
|
-
expect(selected?.getAttribute("data-mp-selected-fill")).toBe("
|
|
528
|
-
expect(selected?.className).toMatch(/(?:^| )_bg-
|
|
527
|
+
expect(selected?.getAttribute("data-mp-selected-fill")).toBe("$color4");
|
|
528
|
+
expect(selected?.className).toMatch(/(?:^| )_bg-color4(?: |$)/);
|
|
529
529
|
fireEvent.focus(selected as HTMLElement);
|
|
530
530
|
expect(selected?.getAttribute("data-highlighted")).toBe("true");
|
|
531
|
-
expect(selected?.className).toMatch(/_bg-0focus-
|
|
531
|
+
expect(selected?.className).toMatch(/_bg-0focus-color4(?: |$)/);
|
|
532
|
+
expect(selected?.className).not.toMatch(/_bg-0focus-color3(?: |$)/);
|
|
532
533
|
const check = selected?.querySelector("[data-mp-check]");
|
|
533
534
|
expect(check?.getAttribute("data-mp-check")).toBe("trailing");
|
|
534
535
|
expect(selected?.lastElementChild).toBe(check);
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
Surface,
|
|
27
27
|
hairline,
|
|
28
28
|
keyboardFocusRingProps,
|
|
29
|
+
useMenuRowCheckInk,
|
|
29
30
|
menuRowChecked,
|
|
30
31
|
menuRowFrame,
|
|
31
32
|
useResolvedKnobs,
|
|
@@ -224,7 +225,7 @@ const ItemRow = styled(XStack, {
|
|
|
224
225
|
},
|
|
225
226
|
variants: {
|
|
226
227
|
selected: {
|
|
227
|
-
true:
|
|
228
|
+
true: {},
|
|
228
229
|
},
|
|
229
230
|
disabled: {
|
|
230
231
|
true: {
|
|
@@ -749,10 +750,13 @@ const DropdownMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(
|
|
|
749
750
|
pressStyle: { backgroundColor: "$red4" },
|
|
750
751
|
}
|
|
751
752
|
: undefined;
|
|
753
|
+
const checkedFill = menuRowChecked(knobProps.scheme);
|
|
752
754
|
const focusFill =
|
|
753
755
|
destructive && !disabled
|
|
754
756
|
? { backgroundColor: "$red3" as const }
|
|
755
|
-
:
|
|
757
|
+
: selected
|
|
758
|
+
? { backgroundColor: checkedFill.backgroundColor }
|
|
759
|
+
: { backgroundColor: HOVER_FILL };
|
|
756
760
|
const ring = kbRing
|
|
757
761
|
? { ...keyboardFocusRingProps, outlineOffset: 0 }
|
|
758
762
|
: { outlineWidth: 0 as const, outlineStyle: "none" as const };
|
|
@@ -771,12 +775,13 @@ const DropdownMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(
|
|
|
771
775
|
{...transitionProps(knobProps.motion.control)}
|
|
772
776
|
onPress={handleSelect}
|
|
773
777
|
data-mp-hover-fill={HOVER_FILL}
|
|
774
|
-
data-mp-selected-fill={selected ?
|
|
778
|
+
data-mp-selected-fill={selected ? checkedFill.backgroundColor : undefined}
|
|
775
779
|
data-mp-pad-x={String(knobProps.menuRow.paddingHorizontal)}
|
|
776
780
|
data-mp-row-height={rowHeight}
|
|
777
781
|
data-mp-font-weight="400"
|
|
778
782
|
data-mp-ring-offset="0"
|
|
779
783
|
{...highlightFill}
|
|
784
|
+
{...(selected ? checkedFill : undefined)}
|
|
780
785
|
{...(explainedDisable ? { paddingVertical: "$1.5" } : {})}
|
|
781
786
|
{...(props as Record<string, unknown>)}
|
|
782
787
|
{...(isWeb
|
|
@@ -886,6 +891,7 @@ export interface DropdownMenuCheckboxItemProps extends Omit<DropdownMenuItemProp
|
|
|
886
891
|
|
|
887
892
|
const DropdownMenuCheckboxItem = forwardRef<TamaguiElement, DropdownMenuCheckboxItemProps>(
|
|
888
893
|
function DropdownMenuCheckboxItem({ checked, onCheckedChange, onSelect, ...props }, ref) {
|
|
894
|
+
const checkInk = useMenuRowCheckInk();
|
|
889
895
|
return (
|
|
890
896
|
<DropdownMenuItemBody
|
|
891
897
|
ref={ref}
|
|
@@ -906,7 +912,7 @@ const DropdownMenuCheckboxItem = forwardRef<TamaguiElement, DropdownMenuCheckbox
|
|
|
906
912
|
opacity={checked ? 1 : 0}
|
|
907
913
|
data-mp-check="trailing"
|
|
908
914
|
>
|
|
909
|
-
<IconSlot icon={<CheckIcon size={14} weight="bold" />} />
|
|
915
|
+
<IconSlot icon={<CheckIcon size={14} weight="bold" color={checkInk} />} />
|
|
910
916
|
</View>
|
|
911
917
|
}
|
|
912
918
|
{...props}
|
package/src/Pagination.tsx
CHANGED
|
@@ -401,7 +401,7 @@ export function Pagination({
|
|
|
401
401
|
<Button
|
|
402
402
|
size={knobProps.sizeToken}
|
|
403
403
|
chromeless={!submits}
|
|
404
|
-
|
|
404
|
+
accent={submits}
|
|
405
405
|
icon={isPageNavigation ? NextIcon : submits ? CheckIcon : NextArrowIcon}
|
|
406
406
|
onPress={handleNext}
|
|
407
407
|
disabled={!canNext}
|
|
@@ -35,9 +35,10 @@ describe("SchemeToggle (FZ-8158)", () => {
|
|
|
35
35
|
const rows = [...document.querySelectorAll('[role="menuitemcheckbox"]')];
|
|
36
36
|
expect(rows.map((row) => row.textContent)).toEqual(["System", "Light", "Dark"]);
|
|
37
37
|
expect(rows.map((row) => row.getAttribute("aria-checked"))).toEqual(["false", "false", "true"]);
|
|
38
|
-
// LC-262: every row carries its glyph; the chosen one
|
|
38
|
+
// LC-262 (FZ-8355 r6): every row carries its glyph; the chosen one sits on the checked fill under its check.
|
|
39
39
|
for (const row of rows) expect(row.querySelectorAll("svg").length).toBe(2);
|
|
40
|
-
expect(rows[2]!.
|
|
40
|
+
expect(rows[2]!.hasAttribute("data-mp-selected-fill")).toBe(true);
|
|
41
|
+
expect(rows[0]!.hasAttribute("data-mp-selected-fill")).toBe(false);
|
|
41
42
|
fireEvent.click(rows[0]!);
|
|
42
43
|
expect(set).toHaveBeenCalledWith("system");
|
|
43
44
|
});
|
|
@@ -257,8 +257,8 @@ describe("LC-262 inside a sheet at 390 (FZ-7830 round 2)", () => {
|
|
|
257
257
|
expect(rows.length).toBe(5);
|
|
258
258
|
expect(rows.every((r) => r.querySelector("svg"))).toBe(true);
|
|
259
259
|
const chosen = rows.find((r) => r.getAttribute("aria-selected") === "true") as HTMLElement;
|
|
260
|
-
// The
|
|
261
|
-
expect(chosen.className).
|
|
260
|
+
// The check on the light checked fill marks it (LC-262, FZ-8355 r6).
|
|
261
|
+
expect(chosen.className).toMatch(/(?:^| )_bg-color4(?: |$)/);
|
|
262
262
|
expect(chosen.querySelectorAll("svg").length).toBe(2);
|
|
263
263
|
});
|
|
264
264
|
|
|
@@ -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
|
>
|
package/src/TreeSelect/index.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
ensureFocusVisibleRing,
|
|
27
27
|
ensureKeyboardModalityTracking,
|
|
28
28
|
keyboardFocusRingProps,
|
|
29
|
+
useMenuRowCheckInk,
|
|
29
30
|
menuRowChecked,
|
|
30
31
|
useResolvedKnobs,
|
|
31
32
|
} from "@multiplatform.one/theme";
|
|
@@ -108,6 +109,8 @@ function TreeSelectRows({
|
|
|
108
109
|
}) {
|
|
109
110
|
const { t } = useTranslation();
|
|
110
111
|
const { knobProps } = useResolvedKnobs();
|
|
112
|
+
const checkInk = useMenuRowCheckInk();
|
|
113
|
+
const checkedFill = menuRowChecked(knobProps.scheme);
|
|
111
114
|
const nestedPx = knobProps.nestedControl.px;
|
|
112
115
|
const indentStep = 16;
|
|
113
116
|
const expandIconSize = nestedPx <= 28 ? 14 : nestedPx >= 36 ? 18 : 16;
|
|
@@ -172,8 +175,14 @@ function TreeSelectRows({
|
|
|
172
175
|
gap="$2"
|
|
173
176
|
cursor="pointer"
|
|
174
177
|
position="relative"
|
|
175
|
-
backgroundColor={isSelected ?
|
|
176
|
-
hoverStyle={
|
|
178
|
+
backgroundColor={isSelected ? checkedFill.backgroundColor : "transparent"}
|
|
179
|
+
hoverStyle={
|
|
180
|
+
isSelected
|
|
181
|
+
? checkedFill.hoverStyle
|
|
182
|
+
: keyboardRing
|
|
183
|
+
? undefined
|
|
184
|
+
: { backgroundColor: "$color3" }
|
|
185
|
+
}
|
|
177
186
|
{...(isActive && keyboardRing ? keyboardFocusRingProps : undefined)}
|
|
178
187
|
onPress={(e) => {
|
|
179
188
|
const target = (e as unknown as { target?: HTMLElement }).target;
|
|
@@ -261,7 +270,7 @@ function TreeSelectRows({
|
|
|
261
270
|
) : null}
|
|
262
271
|
{isSelected ? (
|
|
263
272
|
<View flexShrink={0} width={14} height={14}>
|
|
264
|
-
<CheckIcon size={14} weight="bold" />
|
|
273
|
+
<CheckIcon size={14} weight="bold" color={checkInk} />
|
|
265
274
|
</View>
|
|
266
275
|
) : null}
|
|
267
276
|
</XStack>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-172 FILL-CONTRAST, FZ-7970: every filled or selected control takes its
|
|
3
|
+
* colour from the active theme's accent, so switching a preset's accent
|
|
4
|
+
* changes every one of their fills. Each control paints an accent token (never
|
|
5
|
+
* a neutral ramp step or a literal), and the tokens resolve to a different
|
|
6
|
+
* hue in each colour theme.
|
|
7
|
+
*/
|
|
8
|
+
import { render } from "@testing-library/react";
|
|
9
|
+
import {
|
|
10
|
+
Button,
|
|
11
|
+
Checkbox,
|
|
12
|
+
Progress,
|
|
13
|
+
RadioGroup,
|
|
14
|
+
Slider,
|
|
15
|
+
Switch,
|
|
16
|
+
ToggleGroup,
|
|
17
|
+
} from "@multiplatform.one/forms";
|
|
18
|
+
import {
|
|
19
|
+
createThemesBuilder,
|
|
20
|
+
defaultAccentTheme,
|
|
21
|
+
defaultBaseTheme,
|
|
22
|
+
defaultBuilderOptions,
|
|
23
|
+
normalizeToHex,
|
|
24
|
+
} from "@multiplatform.one/theme";
|
|
25
|
+
import { configWithoutAnimations } from "@tamagui/config";
|
|
26
|
+
import { animationsCSS } from "@tamagui/config/v5-css";
|
|
27
|
+
import type { ReactNode } from "react";
|
|
28
|
+
import { TamaguiProvider, Theme, createTamagui } from "tamagui";
|
|
29
|
+
import { describe, expect, it } from "vitest";
|
|
30
|
+
import { Tabs } from "./Tabs";
|
|
31
|
+
import { ViewSwitcher } from "./layouts/ViewSwitcher";
|
|
32
|
+
|
|
33
|
+
const houseThemes = createThemesBuilder(
|
|
34
|
+
defaultBaseTheme,
|
|
35
|
+
defaultAccentTheme,
|
|
36
|
+
defaultBuilderOptions,
|
|
37
|
+
).themes() as Record<string, Record<string, string>>;
|
|
38
|
+
const houseConfig = createTamagui({
|
|
39
|
+
...configWithoutAnimations,
|
|
40
|
+
animations: animationsCSS,
|
|
41
|
+
themes: houseThemes as any,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Tamagui names a token class by its first 11 characters plus a hash.
|
|
45
|
+
const accentClass = /_(bg|btc|col)-(accentBackg|accentColor|selectedBac|selectedCol)/;
|
|
46
|
+
|
|
47
|
+
function renderUnder(hue: string, element: ReactNode) {
|
|
48
|
+
return render(
|
|
49
|
+
<TamaguiProvider config={houseConfig} defaultTheme="light" disableInjectCSS>
|
|
50
|
+
<Theme name={hue as "blue"}>{element}</Theme>
|
|
51
|
+
</TamaguiProvider>,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function toHex(raw: string | null | undefined): string | null {
|
|
56
|
+
if (!raw) return null;
|
|
57
|
+
const rgb = raw.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
58
|
+
if (rgb)
|
|
59
|
+
return `#${rgb
|
|
60
|
+
.slice(1, 4)
|
|
61
|
+
.map((n) => Number(n).toString(16).padStart(2, "0"))
|
|
62
|
+
.join("")}`;
|
|
63
|
+
return normalizeToHex(raw);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The background an element paints: its inline style, else its atomic class's injected rule. */
|
|
67
|
+
function paintedBackground(el: HTMLElement): string | null {
|
|
68
|
+
if (el.style.backgroundColor) return toHex(el.style.backgroundColor);
|
|
69
|
+
const cls = Array.from(el.classList).find(
|
|
70
|
+
(c) => c.startsWith("_bg-") && !/^_bg-0(hover|press|active|focus|disabled)/.test(c),
|
|
71
|
+
);
|
|
72
|
+
if (!cls) return null;
|
|
73
|
+
for (const sheet of Array.from(document.styleSheets)) {
|
|
74
|
+
for (const rule of Array.from(sheet.cssRules)) {
|
|
75
|
+
if (rule instanceof CSSStyleRule && rule.selectorText.endsWith(`.${cls}`)) {
|
|
76
|
+
const value = rule.style.getPropertyValue("background-color");
|
|
77
|
+
if (value) return toHex(value.trim());
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function paintsAccent(root: Element): boolean {
|
|
85
|
+
return [root, ...root.querySelectorAll("*")].some((el) =>
|
|
86
|
+
accentClass.test((el as HTMLElement).className?.toString() ?? ""),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const controls: [string, ReactNode, (root: HTMLElement, hue: string) => boolean][] = [
|
|
91
|
+
["Switch on track", <Switch key="s" label="On" name="on" defaultValue />, paintsAccent],
|
|
92
|
+
["Checkbox checked", <Checkbox key="c" label="On" name="c" checked />, paintsAccent],
|
|
93
|
+
[
|
|
94
|
+
"Radio selected",
|
|
95
|
+
<RadioGroup
|
|
96
|
+
key="r"
|
|
97
|
+
label="Pick"
|
|
98
|
+
value="a"
|
|
99
|
+
options={[
|
|
100
|
+
{ label: "A", value: "a" },
|
|
101
|
+
{ label: "B", value: "b" },
|
|
102
|
+
]}
|
|
103
|
+
/>,
|
|
104
|
+
paintsAccent,
|
|
105
|
+
],
|
|
106
|
+
["Progress fill", <Progress key="p" label="Done" value={50} />, paintsAccent],
|
|
107
|
+
[
|
|
108
|
+
"Primary Button",
|
|
109
|
+
<Button key="b" accent>
|
|
110
|
+
Save
|
|
111
|
+
</Button>,
|
|
112
|
+
(root, hue) => Boolean(root.querySelector(`.t_${hue}_accent`)?.textContent?.includes("Save")),
|
|
113
|
+
],
|
|
114
|
+
[
|
|
115
|
+
"Selected segment",
|
|
116
|
+
<ToggleGroup
|
|
117
|
+
key="t"
|
|
118
|
+
label="Align"
|
|
119
|
+
defaultValue="left"
|
|
120
|
+
options={[
|
|
121
|
+
{ label: "Left", value: "left" },
|
|
122
|
+
{ label: "Right", value: "right" },
|
|
123
|
+
]}
|
|
124
|
+
/>,
|
|
125
|
+
paintsAccent,
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
"Selected tab",
|
|
129
|
+
<Tabs
|
|
130
|
+
key="tab"
|
|
131
|
+
value="one"
|
|
132
|
+
items={[
|
|
133
|
+
{ value: "one", label: "One" },
|
|
134
|
+
{ value: "two", label: "Two" },
|
|
135
|
+
]}
|
|
136
|
+
/>,
|
|
137
|
+
paintsAccent,
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
"Selected view",
|
|
141
|
+
<ViewSwitcher
|
|
142
|
+
key="v"
|
|
143
|
+
views={[
|
|
144
|
+
{ type: "list", label: "List" },
|
|
145
|
+
{ type: "board", label: "Board" },
|
|
146
|
+
]}
|
|
147
|
+
currentView="list"
|
|
148
|
+
onViewChange={() => {}}
|
|
149
|
+
/>,
|
|
150
|
+
paintsAccent,
|
|
151
|
+
],
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
describe("LC-172 every filled or selected control takes the theme accent", () => {
|
|
155
|
+
for (const [name, element, check] of controls) {
|
|
156
|
+
it.each(["blue", "pink"])(`${name} paints the accent under %s`, (hue) => {
|
|
157
|
+
const { container } = renderUnder(hue, element);
|
|
158
|
+
expect(check(container, hue)).toBe(true);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
it.each(["blue", "pink"])("Slider range paints the resolved accent ink under %s", (hue) => {
|
|
163
|
+
const { container } = render(
|
|
164
|
+
<TamaguiProvider config={houseConfig} defaultTheme="light">
|
|
165
|
+
<Theme name={hue as "blue"}>
|
|
166
|
+
<Slider label="Level" name="sl" value={[50]} />
|
|
167
|
+
</Theme>
|
|
168
|
+
</TamaguiProvider>,
|
|
169
|
+
);
|
|
170
|
+
const fill = container.querySelector('[data-slider-part="fill"]') as HTMLElement;
|
|
171
|
+
expect(fill).toBeTruthy();
|
|
172
|
+
expect(paintedBackground(fill)).toBe(
|
|
173
|
+
normalizeToHex(String(houseThemes[`light_${hue}`].accentColor)),
|
|
174
|
+
);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it.each(["light", "dark"])("%s: the accent tokens differ between colour themes", (scheme) => {
|
|
178
|
+
const keys = ["accentBackground", "accentColor", "selectedBackground", "selectedColor"];
|
|
179
|
+
for (const key of keys) {
|
|
180
|
+
const blue = houseThemes[`${scheme}_blue`]?.[key];
|
|
181
|
+
const pink = houseThemes[`${scheme}_pink`]?.[key];
|
|
182
|
+
expect(blue, key).toBeTruthy();
|
|
183
|
+
expect(pink, key).toBeTruthy();
|
|
184
|
+
expect(blue, key).not.toBe(pink);
|
|
185
|
+
}
|
|
186
|
+
expect(houseThemes[`${scheme}_blue_accent`].background).not.toBe(
|
|
187
|
+
houseThemes[`${scheme}_pink_accent`].background,
|
|
188
|
+
);
|
|
189
|
+
});
|
|
190
|
+
});
|