@multiplatform.one/components 7.68.0 → 7.69.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/ContextMenu/index.cjs +18 -9
- package/dist/cjs/ContextMenu/index.native.js +18 -9
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/SchemeToggle/index.cjs +85 -0
- package/dist/cjs/SchemeToggle/index.native.js +95 -0
- package/dist/cjs/SchemeToggle/index.native.js.map +1 -0
- package/dist/cjs/SheetModal/SheetHeader.cjs +4 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js +4 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +11 -5
- package/dist/cjs/layouts/page.native.js +11 -5
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.mjs +19 -10
- package/dist/esm/ContextMenu/index.mjs.map +1 -1
- package/dist/esm/ContextMenu/index.native.js +19 -10
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/SchemeToggle/index.mjs +59 -0
- package/dist/esm/SchemeToggle/index.mjs.map +1 -0
- package/dist/esm/SchemeToggle/index.native.js +66 -0
- package/dist/esm/SchemeToggle/index.native.js.map +1 -0
- package/dist/esm/SheetModal/SheetHeader.mjs +4 -1
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +4 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +12 -6
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +12 -6
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/jsx/Accordion/index.native.js +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 +3 -3
- 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.mjs +19 -10
- package/dist/jsx/ContextMenu/index.mjs.map +1 -1
- package/dist/jsx/ContextMenu/index.native.js +18 -9
- 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.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 +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/index.native.js +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 +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 +1 -1
- package/dist/jsx/OverflowRow/index.native.js.map +1 -1
- package/dist/jsx/Pagination.native.js +1 -1
- 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.mjs +59 -0
- package/dist/jsx/SchemeToggle/index.mjs.map +1 -0
- package/dist/jsx/SchemeToggle/index.native.js +95 -0
- package/dist/jsx/SchemeToggle/index.native.js.map +1 -0
- 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.mjs +4 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +4 -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.native.js +1 -1
- 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 +2 -2
- 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 +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 +2 -2
- 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 +2 -2
- package/dist/jsx/actions/HeaderActions.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.native.js +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/BottomAccessory.native.js.map +1 -1
- package/dist/jsx/appShell/Dock.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js +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 +1 -1
- package/dist/jsx/appShell/TabBar.native.js.map +1 -1
- package/dist/jsx/appShell/appTile.native.js +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.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 +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 +7 -7
- 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 +5 -5
- package/dist/jsx/code/index.native.js.map +1 -1
- 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 +2 -2
- 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 +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +2 -2
- 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 +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 +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/index.native.js +1 -1
- package/dist/jsx/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/jsx/images/Image/shared.native.js +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.js +1 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +36 -35
- 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 +2 -2
- 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.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +1 -1
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/layouts/index.native.js +3 -3
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +12 -6
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +13 -7
- 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.native.js.map +1 -1
- package/dist/jsx/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js +1 -1
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/layouts/tags.native.js +2 -2
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.native.js +2 -2
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/layouts/toolbar.native.js +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 +1 -1
- package/dist/jsx/surfaces.native.js.map +1 -1
- package/dist/jsx/tamagui.native.js +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 +1 -1
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +2 -2
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/Gantt.native.js +2 -2
- 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 +2 -2
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/Kanban.native.js +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 +2 -2
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.native.js +2 -2
- 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 +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/ContextMenu/ContextMenu.spec.tsx +4 -3
- package/src/ContextMenu/index.tsx +30 -17
- package/src/Pagination.spec.tsx +24 -19
- package/src/SchemeToggle/SchemeToggle.spec.tsx +64 -0
- package/src/SchemeToggle/index.tsx +77 -0
- package/src/SheetModal/SheetHeader.tsx +4 -1
- package/src/index.ts +1 -0
- package/src/layouts/navBar.spec.tsx +36 -0
- package/src/layouts/page.tsx +17 -8
- package/types/ContextMenu/index.d.ts +13 -3
- package/types/ContextMenu/index.d.ts.map +1 -1
- package/types/SchemeToggle/index.d.ts +20 -0
- package/types/SchemeToggle/index.d.ts.map +1 -0
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -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"
|
|
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":["../../../src/views/widgetChrome.tsx"],"sourcesContent":[null],"mappings":"AAAA;;AAAA,IACEA,SAAA,GAAAC,MAAA,CAAAC,cAAA;AAAA,IACAC,gBAAA,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IACAC,iBAAA,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACAC,YAAA,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IAAAC,QACK,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EAEP,SAASC,IAAA,IAAAD,GAAA,EA8DHZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AA3DC;AAUL,IAAAC,WAAY,GAAAA,CAAAC,EAAA,EAASC,IAAG,EAAAC,MAAQ,EAAAC,IAAA;EAChC,IAAAF,IAAO,IAAE,OAAIA,IAAS,KAAI,mBAAAA,IAAA;IAC5B,SAAAG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,GAGO,IAAS,CAAAX,YAAA,CAAAe,IAAgB,CAAAL,EAAA,EAAAI,GAAkC,KAAAA,GAAA,KAAAF,MAAA,EAC1DnB,SAAA,CAAAiB,EAAW,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAiBI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EAClC;EACA,OAAME,EAAA;AACN;AACI,IACEM,YAAQ,GAAAC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IACRE,oBAAoB;AAAAhB,QACpB,CAAAgB,oBAAoB;EAAAC,cACpB,EAAAA,CAAA,KAAmBA,cAAQ;EAAAC,kBAC3B,EAAAA,CAAA,KAAAA,kBAAA;EAAAC,eACM,EAAAA,CAAA,KAAAA;AAAA,EACR;AAEJC,MAAA,CAAAC,OAAS,GAAAR,YAAW,CAAAG,oBAAiB,CAAY;AACnD,IAAAM,kBAAA,GAAAC,OAAA;AAEO,IAAAC,YAAS,GAAAD,OAAe;AAAA,IAC7BE,cAAA,GAAAF,OAAA;AAAA,SACAL,mBAAAQ,MAAA;EACA;IAAAC,EAAA;IAAAC,OAAA;IAAA,GAAAC;EAAA,IAAAH,MAAA;EACA;IACAC,EAAA;IAOCC,OAAA;IACDC;EACA;AACA;AACA,SACEV,gBAAAW,OAAA;EAAA,IAACC,QAAA,OAAAP,YAAA,CAAAQ,gBAAA;EAAA;IAAAC,SAAA;IAAAC;EAAA,IAAAH,QAAA;EAAA,IACEL,MAAG,GAAAR,kBAAA,CAAAe,SAAA,CAAAE,aAAA;EAAA,IACHC,WAAG,GAAAN,OAAA;IAAAO,MACJ,WAAW;IAAAC,UACX,EAAAJ,OAAe,CAAAK,cAAA;IAAAC,UACf,EAAAN,OAAiB,CAAAO,cAAA;IAAAC,iBACJ,EAAIR,OAAA,CAAAS,qBAAA;IAAAb,OACjB;IAASc,IACT;EAAgB,IAEhB;EAAsC;IACxCX,SAAA;IAEJC,OAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.69.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.69.0",
|
|
62
|
+
"@multiplatform.one/i18n": "^7.69.0",
|
|
63
|
+
"@multiplatform.one/platform": "^7.69.0",
|
|
64
|
+
"@multiplatform.one/router": "^7.69.0",
|
|
65
|
+
"@multiplatform.one/theme": "^7.69.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.69.0",
|
|
93
|
+
"@multiplatform.one/storybook": "7.69.0",
|
|
94
|
+
"@multiplatform.one/test-utils": "7.69.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",
|
|
@@ -61,9 +61,10 @@ describe("ContextMenu", () => {
|
|
|
61
61
|
expect(copy.getAttribute("data-mp-font-weight")).toBe("400");
|
|
62
62
|
expect(copy.className).toMatch(/_btlr-0px/);
|
|
63
63
|
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
expect(selected?.
|
|
64
|
+
// LC-262: the accent check alone marks the chosen row, no grey fill;
|
|
65
|
+
// hover is $color3; the check trails the label.
|
|
66
|
+
expect(selected?.hasAttribute("data-mp-selected-fill")).toBe(false);
|
|
67
|
+
expect(selected?.className).not.toMatch(/_bg-color2(?: |$)/);
|
|
67
68
|
fireEvent.focus(selected as HTMLElement);
|
|
68
69
|
expect(selected?.getAttribute("data-highlighted")).toBe("true");
|
|
69
70
|
expect(selected?.className).toMatch(/_bg-0focus-color3(?: |$)/);
|
|
@@ -12,18 +12,20 @@ import { IconSlot } from "@multiplatform.one/theme";
|
|
|
12
12
|
* content-sized, `OVERLAY_ANCHOR_GAP` from the point, and flips toward the
|
|
13
13
|
* start or up where the viewport runs out. A keyboard open opens from the
|
|
14
14
|
* target's bottom start corner. Native tablets (window > 640) open at the
|
|
15
|
-
* long-press point; phones keep the sheet.
|
|
15
|
+
* long-press point; phones keep the sheet. `anchor="trigger"` opens it on
|
|
16
|
+
* native as the pull-down under its trigger instead (a bar button, FZ-8158).
|
|
16
17
|
*
|
|
17
|
-
* Rows: 44 tall, padX 13 (`menuRowFrame` $3),
|
|
18
|
-
*
|
|
18
|
+
* Rows: 44 tall, padX 13 (`menuRowFrame` $3), leading glyph where the row has
|
|
19
|
+
* one, the chosen row marked by the accent check alone with no grey fill
|
|
20
|
+
* (LC-262), hover `$color3`, label weight 400, keyboard 2px ring offset 0.
|
|
19
21
|
* Sheet at ≤640 via FloatingPanel's overlay family pivot.
|
|
20
22
|
*/
|
|
21
23
|
|
|
22
24
|
import {
|
|
23
25
|
transitionProps,
|
|
24
26
|
hairline,
|
|
27
|
+
useIdentityInkOnSurface,
|
|
25
28
|
keyboardFocusRingProps,
|
|
26
|
-
menuRowChecked,
|
|
27
29
|
menuRowFrame,
|
|
28
30
|
useResolvedKnobs,
|
|
29
31
|
warnBareDisabled,
|
|
@@ -80,6 +82,17 @@ export interface ContextMenuProps {
|
|
|
80
82
|
onOpenChange?: (open: boolean) => void;
|
|
81
83
|
maxHeight?: number;
|
|
82
84
|
closeOnSelect?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* `"content"` hugs the trigger, so an icon button keeps its own width in a
|
|
87
|
+
* bar; `"stretch"` (default) fills the row.
|
|
88
|
+
*/
|
|
89
|
+
triggerSizing?: "stretch" | "content";
|
|
90
|
+
/**
|
|
91
|
+
* Where a native long-press opens the menu: `"point"` (default) at the press
|
|
92
|
+
* on a tablet and as a sheet on a phone, `"trigger"` as the pull-down under
|
|
93
|
+
* the trigger at every width. The web always opens at the pointer.
|
|
94
|
+
*/
|
|
95
|
+
anchor?: "point" | "trigger";
|
|
83
96
|
}
|
|
84
97
|
|
|
85
98
|
interface ContextMenuContextValue {
|
|
@@ -120,9 +133,6 @@ const ItemRow = styled(XStack, {
|
|
|
120
133
|
outlineWidth: 0,
|
|
121
134
|
},
|
|
122
135
|
variants: {
|
|
123
|
-
selected: {
|
|
124
|
-
true: menuRowChecked,
|
|
125
|
-
},
|
|
126
136
|
disabled: {
|
|
127
137
|
true: {
|
|
128
138
|
cursor: "default",
|
|
@@ -156,6 +166,8 @@ function ContextMenuRoot({
|
|
|
156
166
|
onOpenChange,
|
|
157
167
|
maxHeight,
|
|
158
168
|
closeOnSelect,
|
|
169
|
+
triggerSizing,
|
|
170
|
+
anchor = "point",
|
|
159
171
|
}: ContextMenuProps) {
|
|
160
172
|
const [open, setOpen] = useControllableState({
|
|
161
173
|
prop: openProp,
|
|
@@ -184,6 +196,7 @@ function ContextMenuRoot({
|
|
|
184
196
|
<ContextMenuCheckboxItem
|
|
185
197
|
key={(entry as ContextMenuItemSpec).key ?? index}
|
|
186
198
|
checked={(entry as ContextMenuItemSpec).checked!}
|
|
199
|
+
icon={(entry as ContextMenuItemSpec).icon}
|
|
187
200
|
onCheckedChange={(entry as ContextMenuItemSpec).onCheckedChange}
|
|
188
201
|
onSelect={(entry as ContextMenuItemSpec).onSelect}
|
|
189
202
|
closeOnSelect={(entry as ContextMenuItemSpec).closeOnSelect}
|
|
@@ -237,7 +250,11 @@ function ContextMenuRoot({
|
|
|
237
250
|
onOpenChange={setOpen}
|
|
238
251
|
trigger={trigger}
|
|
239
252
|
contentPadding="none"
|
|
253
|
+
triggerSizing={triggerSizing}
|
|
240
254
|
{...freeOverlay}
|
|
255
|
+
{...(anchor === "trigger" && !isWeb
|
|
256
|
+
? { compactFace: "menu" as const, anchorMode: "attach" as const, triggerEcho: false }
|
|
257
|
+
: null)}
|
|
241
258
|
>
|
|
242
259
|
<ContextMenuList maxHeight={maxHeight}>{body}</ContextMenuList>
|
|
243
260
|
</FloatingPanel>
|
|
@@ -395,7 +412,6 @@ export interface ContextMenuItemProps extends Omit<
|
|
|
395
412
|
interface ItemBodyProps extends ContextMenuItemProps {
|
|
396
413
|
trailing?: ReactNode;
|
|
397
414
|
closeOnSelectDefault?: boolean;
|
|
398
|
-
selected?: boolean;
|
|
399
415
|
}
|
|
400
416
|
|
|
401
417
|
const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function ContextMenuItemBody(
|
|
@@ -411,7 +427,6 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
411
427
|
closeOnSelectDefault = true,
|
|
412
428
|
role = "menuitem",
|
|
413
429
|
trailing,
|
|
414
|
-
selected = false,
|
|
415
430
|
...props
|
|
416
431
|
},
|
|
417
432
|
forwardedRef,
|
|
@@ -463,7 +478,6 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
463
478
|
ref={forwardedRef}
|
|
464
479
|
role={role}
|
|
465
480
|
disabled={disabled}
|
|
466
|
-
selected={selected}
|
|
467
481
|
aria-disabled={disabled || undefined}
|
|
468
482
|
aria-busy={busy || undefined}
|
|
469
483
|
data-mp-busy={busy ? "true" : undefined}
|
|
@@ -471,7 +485,6 @@ const ContextMenuItemBody = forwardRef<TamaguiElement, ItemBodyProps>(function C
|
|
|
471
485
|
{...transitionProps(knobProps.motion.control)}
|
|
472
486
|
onPress={handleSelect}
|
|
473
487
|
data-mp-hover-fill={HOVER_FILL}
|
|
474
|
-
data-mp-selected-fill={selected ? menuRowChecked.backgroundColor : undefined}
|
|
475
488
|
data-mp-pad-x={String(knobProps.menuRow.paddingHorizontal)}
|
|
476
489
|
data-mp-row-height={rowHeight}
|
|
477
490
|
data-mp-font-weight="400"
|
|
@@ -576,22 +589,19 @@ const ContextMenuItem = forwardRef<TamaguiElement, ContextMenuItemProps>(
|
|
|
576
589
|
},
|
|
577
590
|
);
|
|
578
591
|
|
|
579
|
-
export interface ContextMenuCheckboxItemProps extends Omit<
|
|
580
|
-
ContextMenuItemProps,
|
|
581
|
-
"destructive" | "icon"
|
|
582
|
-
> {
|
|
592
|
+
export interface ContextMenuCheckboxItemProps extends Omit<ContextMenuItemProps, "destructive"> {
|
|
583
593
|
checked: boolean;
|
|
584
594
|
onCheckedChange?: (checked: boolean) => void;
|
|
585
595
|
}
|
|
586
596
|
|
|
587
597
|
const ContextMenuCheckboxItem = forwardRef<TamaguiElement, ContextMenuCheckboxItemProps>(
|
|
588
598
|
function ContextMenuCheckboxItem({ checked, onCheckedChange, onSelect, ...props }, ref) {
|
|
599
|
+
const markColor = useIdentityInkOnSurface();
|
|
589
600
|
return (
|
|
590
601
|
<ContextMenuItemBody
|
|
591
602
|
ref={ref}
|
|
592
603
|
role={"menuitemcheckbox" as "menuitem"}
|
|
593
604
|
aria-checked={checked}
|
|
594
|
-
selected={checked}
|
|
595
605
|
closeOnSelectDefault={false}
|
|
596
606
|
onSelect={() => {
|
|
597
607
|
onCheckedChange?.(!checked);
|
|
@@ -605,8 +615,11 @@ const ContextMenuCheckboxItem = forwardRef<TamaguiElement, ContextMenuCheckboxIt
|
|
|
605
615
|
justifyContent="center"
|
|
606
616
|
opacity={checked ? 1 : 0}
|
|
607
617
|
data-mp-check="trailing"
|
|
618
|
+
{...(isWeb && markColor
|
|
619
|
+
? ({ style: { color: markColor } } as Record<string, unknown>)
|
|
620
|
+
: {})}
|
|
608
621
|
>
|
|
609
|
-
<IconSlot icon={<CheckIcon size={14} weight="bold" />} />
|
|
622
|
+
<IconSlot icon={<CheckIcon size={14} weight="bold" />} color={markColor} />
|
|
610
623
|
</View>
|
|
611
624
|
}
|
|
612
625
|
{...props}
|
package/src/Pagination.spec.tsx
CHANGED
|
@@ -38,6 +38,9 @@ const iconPaths = (el: Element | null | undefined): string =>
|
|
|
38
38
|
.map((p) => p.getAttribute("d") ?? "")
|
|
39
39
|
.join("|");
|
|
40
40
|
|
|
41
|
+
/** LC-176: an icon-only button's glyph is Phosphor bold. */
|
|
42
|
+
const iconButtonGlyph: IconProps = { weight: "bold" };
|
|
43
|
+
|
|
41
44
|
/** Reference fingerprint from a standalone render of the phosphor glyph. */
|
|
42
45
|
const refPaths = (IconComponent: Icon, props: IconProps = {}): string => {
|
|
43
46
|
const { container, unmount } = render(<IconComponent {...props} />);
|
|
@@ -47,10 +50,6 @@ const refPaths = (IconComponent: Icon, props: IconProps = {}): string => {
|
|
|
47
50
|
return d;
|
|
48
51
|
};
|
|
49
52
|
|
|
50
|
-
// LC-176: a pager's chevrons are icon buttons in content, drawn as the bold
|
|
51
|
-
// glyph.
|
|
52
|
-
const BAR_GLYPH: IconProps = { weight: "bold" };
|
|
53
|
-
|
|
54
53
|
const byLabel = (container: HTMLElement, label: string) => {
|
|
55
54
|
const el = container.querySelector(`[aria-label="${label}"]`);
|
|
56
55
|
expect(el, `button "${label}"`).toBeTruthy();
|
|
@@ -65,16 +64,16 @@ describe("Pagination directional glyphs (numbered variant)", () => {
|
|
|
65
64
|
clearDirs();
|
|
66
65
|
const { container } = renderNumbered();
|
|
67
66
|
expect(iconPaths(byLabel(container, "Go to previous page"))).toBe(
|
|
68
|
-
refPaths(CaretLeftIcon,
|
|
67
|
+
refPaths(CaretLeftIcon, iconButtonGlyph),
|
|
69
68
|
);
|
|
70
69
|
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
71
|
-
refPaths(CaretRightIcon,
|
|
70
|
+
refPaths(CaretRightIcon, iconButtonGlyph),
|
|
72
71
|
);
|
|
73
72
|
expect(iconPaths(byLabel(container, "Go to first page"))).toBe(
|
|
74
|
-
refPaths(CaretDoubleLeftIcon,
|
|
73
|
+
refPaths(CaretDoubleLeftIcon, iconButtonGlyph),
|
|
75
74
|
);
|
|
76
75
|
expect(iconPaths(byLabel(container, "Go to last page"))).toBe(
|
|
77
|
-
refPaths(CaretDoubleRightIcon,
|
|
76
|
+
refPaths(CaretDoubleRightIcon, iconButtonGlyph),
|
|
78
77
|
);
|
|
79
78
|
});
|
|
80
79
|
|
|
@@ -82,16 +81,16 @@ describe("Pagination directional glyphs (numbered variant)", () => {
|
|
|
82
81
|
document.documentElement.dir = "rtl";
|
|
83
82
|
const { container } = renderNumbered();
|
|
84
83
|
expect(iconPaths(byLabel(container, "Go to previous page"))).toBe(
|
|
85
|
-
refPaths(CaretRightIcon,
|
|
84
|
+
refPaths(CaretRightIcon, iconButtonGlyph),
|
|
86
85
|
);
|
|
87
86
|
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
88
|
-
refPaths(CaretLeftIcon,
|
|
87
|
+
refPaths(CaretLeftIcon, iconButtonGlyph),
|
|
89
88
|
);
|
|
90
89
|
expect(iconPaths(byLabel(container, "Go to first page"))).toBe(
|
|
91
|
-
refPaths(CaretDoubleRightIcon,
|
|
90
|
+
refPaths(CaretDoubleRightIcon, iconButtonGlyph),
|
|
92
91
|
);
|
|
93
92
|
expect(iconPaths(byLabel(container, "Go to last page"))).toBe(
|
|
94
|
-
refPaths(CaretDoubleLeftIcon,
|
|
93
|
+
refPaths(CaretDoubleLeftIcon, iconButtonGlyph),
|
|
95
94
|
);
|
|
96
95
|
});
|
|
97
96
|
|
|
@@ -99,21 +98,21 @@ describe("Pagination directional glyphs (numbered variant)", () => {
|
|
|
99
98
|
clearDirs();
|
|
100
99
|
const { container } = renderNumbered();
|
|
101
100
|
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
102
|
-
refPaths(CaretRightIcon,
|
|
101
|
+
refPaths(CaretRightIcon, iconButtonGlyph),
|
|
103
102
|
);
|
|
104
103
|
|
|
105
104
|
await act(async () => {
|
|
106
105
|
document.documentElement.dir = "rtl";
|
|
107
106
|
});
|
|
108
107
|
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
109
|
-
refPaths(CaretLeftIcon,
|
|
108
|
+
refPaths(CaretLeftIcon, iconButtonGlyph),
|
|
110
109
|
);
|
|
111
110
|
|
|
112
111
|
await act(async () => {
|
|
113
112
|
document.documentElement.dir = "ltr";
|
|
114
113
|
});
|
|
115
114
|
expect(iconPaths(byLabel(container, "Go to next page"))).toBe(
|
|
116
|
-
refPaths(CaretRightIcon,
|
|
115
|
+
refPaths(CaretRightIcon, iconButtonGlyph),
|
|
117
116
|
);
|
|
118
117
|
});
|
|
119
118
|
});
|
|
@@ -123,16 +122,22 @@ describe("Pagination directional glyphs (dots variant)", () => {
|
|
|
123
122
|
document.documentElement.dir = "rtl";
|
|
124
123
|
const { container } = renderWithProviders(<Pagination total={5} activeIndex={2} />);
|
|
125
124
|
expect(iconPaths(byLabel(container, "Previous page"))).toBe(
|
|
126
|
-
refPaths(ArrowRightIcon,
|
|
125
|
+
refPaths(ArrowRightIcon, iconButtonGlyph),
|
|
126
|
+
);
|
|
127
|
+
expect(iconPaths(byLabel(container, "Next page"))).toBe(
|
|
128
|
+
refPaths(ArrowLeftIcon, iconButtonGlyph),
|
|
127
129
|
);
|
|
128
|
-
expect(iconPaths(byLabel(container, "Next page"))).toBe(refPaths(ArrowLeftIcon, BAR_GLYPH));
|
|
129
130
|
});
|
|
130
131
|
|
|
131
132
|
it("keeps arrows physical in LTR", () => {
|
|
132
133
|
clearDirs();
|
|
133
134
|
const { container } = renderWithProviders(<Pagination total={5} activeIndex={2} />);
|
|
134
|
-
expect(iconPaths(byLabel(container, "Previous page"))).toBe(
|
|
135
|
-
|
|
135
|
+
expect(iconPaths(byLabel(container, "Previous page"))).toBe(
|
|
136
|
+
refPaths(ArrowLeftIcon, iconButtonGlyph),
|
|
137
|
+
);
|
|
138
|
+
expect(iconPaths(byLabel(container, "Next page"))).toBe(
|
|
139
|
+
refPaths(ArrowRightIcon, iconButtonGlyph),
|
|
140
|
+
);
|
|
136
141
|
});
|
|
137
142
|
|
|
138
143
|
it("never mirrors the direction-neutral submit checkmark", () => {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CircleHalfIcon, MoonIcon, SunIcon } from "@phosphor-icons/react";
|
|
2
|
+
import { fireEvent, render, waitFor } from "@testing-library/react";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
5
|
+
import type { SchemePreference, ThemeScheme } from "@multiplatform.one/theme";
|
|
6
|
+
import { SchemeToggle, toggledScheme } from "./index";
|
|
7
|
+
|
|
8
|
+
function preference(setting: ThemeScheme, value: "light" | "dark") {
|
|
9
|
+
const set = vi.fn();
|
|
10
|
+
const useUserScheme = (): SchemePreference => ({ setting, value, set });
|
|
11
|
+
return { set, useUserScheme };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe("SchemeToggle (FZ-8158)", () => {
|
|
15
|
+
it("a tap always flips what is on screen", () => {
|
|
16
|
+
expect(toggledScheme("light")).toBe("dark");
|
|
17
|
+
expect(toggledScheme("dark")).toBe("light");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("names the current setting and flips the resolved look on a tap", () => {
|
|
21
|
+
const { set, useUserScheme } = preference("system", "dark");
|
|
22
|
+
const { getByRole } = renderWithProviders(<SchemeToggle useUserScheme={useUserScheme} />);
|
|
23
|
+
fireEvent.click(getByRole("button", { name: "Appearance: System" }));
|
|
24
|
+
expect(set).toHaveBeenCalledWith("light");
|
|
25
|
+
expect(document.querySelector('[role="menu"]')).toBeFalsy();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("picks System, Light or Dark explicitly from its context menu", async () => {
|
|
29
|
+
const { set, useUserScheme } = preference("dark", "dark");
|
|
30
|
+
const { getByRole } = renderWithProviders(<SchemeToggle useUserScheme={useUserScheme} />);
|
|
31
|
+
fireEvent.contextMenu(getByRole("button", { name: "Appearance: Dark" }));
|
|
32
|
+
await waitFor(() => {
|
|
33
|
+
expect(document.querySelector('[role="menu"]')).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
const rows = [...document.querySelectorAll('[role="menuitemcheckbox"]')];
|
|
36
|
+
expect(rows.map((row) => row.textContent)).toEqual(["System", "Light", "Dark"]);
|
|
37
|
+
expect(rows.map((row) => row.getAttribute("aria-checked"))).toEqual(["false", "false", "true"]);
|
|
38
|
+
// LC-262: every row carries its glyph; the chosen one is marked by the check, no grey fill.
|
|
39
|
+
for (const row of rows) expect(row.querySelectorAll("svg").length).toBe(2);
|
|
40
|
+
expect(rows[2]!.className).not.toMatch(/_bg-color2(?: |$)/);
|
|
41
|
+
fireEvent.click(rows[0]!);
|
|
42
|
+
expect(set).toHaveBeenCalledWith("system");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("its glyph names the setting: sun for Light, moon for Dark, circle-half for System (FZ-8158 r5)", () => {
|
|
46
|
+
const pathOf = (node: ParentNode) => node.querySelector("svg path")?.getAttribute("d");
|
|
47
|
+
const cases = [
|
|
48
|
+
["light", "light", SunIcon],
|
|
49
|
+
["dark", "dark", MoonIcon],
|
|
50
|
+
["system", "dark", CircleHalfIcon],
|
|
51
|
+
] as const;
|
|
52
|
+
for (const [setting, value, Icon] of cases) {
|
|
53
|
+
const { useUserScheme } = preference(setting, value);
|
|
54
|
+
const { getByRole, unmount } = renderWithProviders(
|
|
55
|
+
<SchemeToggle useUserScheme={useUserScheme} />,
|
|
56
|
+
);
|
|
57
|
+
const name = `Appearance: ${setting[0]!.toUpperCase()}${setting.slice(1)}`;
|
|
58
|
+
const expected = render(<Icon weight="bold" />);
|
|
59
|
+
expect(pathOf(getByRole("button", { name })), setting).toBe(pathOf(expected.container));
|
|
60
|
+
expected.unmount();
|
|
61
|
+
unmount();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CircleHalfIcon, MoonIcon, SunIcon } from "@phosphor-icons/react";
|
|
2
|
+
import { IconButton, type IconButtonProps } from "@multiplatform.one/forms";
|
|
3
|
+
import {
|
|
4
|
+
useSchemePreference,
|
|
5
|
+
type SchemePreference,
|
|
6
|
+
type ThemeScheme,
|
|
7
|
+
} from "@multiplatform.one/theme";
|
|
8
|
+
import { useTranslation } from "react-i18next";
|
|
9
|
+
import { ContextMenu } from "../ContextMenu";
|
|
10
|
+
|
|
11
|
+
const schemes = ["system", "light", "dark"] as const;
|
|
12
|
+
const schemeNames: Record<ThemeScheme, string> = {
|
|
13
|
+
system: "System",
|
|
14
|
+
light: "Light",
|
|
15
|
+
dark: "Dark",
|
|
16
|
+
};
|
|
17
|
+
const schemeGlyphs = {
|
|
18
|
+
system: CircleHalfIcon,
|
|
19
|
+
light: SunIcon,
|
|
20
|
+
dark: MoonIcon,
|
|
21
|
+
} as const satisfies Record<ThemeScheme, unknown>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A tap always flips what is on screen. A three-way cycle through System
|
|
25
|
+
* would spend a tap on no visible change whenever System resolves to the
|
|
26
|
+
* current look, and on native the OS look is unreadable while an explicit
|
|
27
|
+
* choice overrides Appearance. System lives in the long-press menu.
|
|
28
|
+
*/
|
|
29
|
+
export function toggledScheme(resolved: "light" | "dark"): ThemeScheme {
|
|
30
|
+
return resolved === "dark" ? "light" : "dark";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface SchemeToggleProps extends Omit<
|
|
34
|
+
IconButtonProps,
|
|
35
|
+
"icon" | "aria-label" | "onPress" | "onLongPress"
|
|
36
|
+
> {
|
|
37
|
+
useUserScheme?: () => SchemePreference;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The appearance control for a bar. Its glyph names the setting (sun, moon,
|
|
42
|
+
* or circle-half for System); a tap flips light and dark; a long-press opens
|
|
43
|
+
* the System / Light / Dark pull-down under the button on native, and a
|
|
44
|
+
* right-click opens the same menu on the web.
|
|
45
|
+
*/
|
|
46
|
+
export function SchemeToggle({
|
|
47
|
+
useUserScheme = useSchemePreference,
|
|
48
|
+
...buttonProps
|
|
49
|
+
}: SchemeToggleProps) {
|
|
50
|
+
const { t } = useTranslation();
|
|
51
|
+
const scheme = useUserScheme();
|
|
52
|
+
const name = (value: ThemeScheme) =>
|
|
53
|
+
t(`themePresetPicker.schemes.${value}`, { defaultValue: schemeNames[value] });
|
|
54
|
+
return (
|
|
55
|
+
<ContextMenu
|
|
56
|
+
triggerSizing="content"
|
|
57
|
+
anchor="trigger"
|
|
58
|
+
closeOnSelect
|
|
59
|
+
items={schemes.map((value) => {
|
|
60
|
+
const Glyph = schemeGlyphs[value];
|
|
61
|
+
return {
|
|
62
|
+
label: name(value),
|
|
63
|
+
icon: <Glyph size={18} weight="bold" />,
|
|
64
|
+
checked: scheme.setting === value,
|
|
65
|
+
onSelect: () => scheme.set(value),
|
|
66
|
+
};
|
|
67
|
+
})}
|
|
68
|
+
>
|
|
69
|
+
<IconButton
|
|
70
|
+
icon={schemeGlyphs[scheme.setting]}
|
|
71
|
+
{...buttonProps}
|
|
72
|
+
aria-label={`${t("schemeToggle.label", { defaultValue: "Appearance" })}: ${name(scheme.setting)}`}
|
|
73
|
+
onPress={() => scheme.set(toggledScheme(scheme.value))}
|
|
74
|
+
/>
|
|
75
|
+
</ContextMenu>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconButtonGroup } from "@multiplatform.one/forms";
|
|
1
2
|
import { Surface } from "@multiplatform.one/theme";
|
|
2
3
|
import type { ReactNode } from "react";
|
|
3
4
|
import { View, XStack } from "tamagui";
|
|
@@ -24,7 +25,9 @@ export function SheetHeader({
|
|
|
24
25
|
{header}
|
|
25
26
|
</View>
|
|
26
27
|
<XStack testID="sheet-modal-header-actions" flexShrink={0} alignItems="center">
|
|
27
|
-
<Surface bar>
|
|
28
|
+
<Surface bar>
|
|
29
|
+
<IconButtonGroup>{actions}</IconButtonGroup>
|
|
30
|
+
</Surface>
|
|
28
31
|
</XStack>
|
|
29
32
|
</XStack>
|
|
30
33
|
);
|
package/src/index.ts
CHANGED
|
@@ -182,4 +182,40 @@ describe("bar glyphs carry their weight (LC-176)", () => {
|
|
|
182
182
|
),
|
|
183
183
|
).toBe(true);
|
|
184
184
|
});
|
|
185
|
+
it("the bar's trailing icon buttons and a page header's actions are one group", () => {
|
|
186
|
+
renderWithProviders(
|
|
187
|
+
<Screen
|
|
188
|
+
topBar={
|
|
189
|
+
<ScreenToolbar
|
|
190
|
+
leading={<PageBackButton />}
|
|
191
|
+
trailing={
|
|
192
|
+
<>
|
|
193
|
+
<PageBarButton icon={SlidersHorizontalIcon} aria-label="Filter" />
|
|
194
|
+
<PageMenuButton edge="end" />
|
|
195
|
+
</>
|
|
196
|
+
}
|
|
197
|
+
/>
|
|
198
|
+
}
|
|
199
|
+
>
|
|
200
|
+
<PageHeader
|
|
201
|
+
title="Nodes"
|
|
202
|
+
actions={
|
|
203
|
+
<>
|
|
204
|
+
<PageBarButton icon={SlidersHorizontalIcon} aria-label="Sort" />
|
|
205
|
+
<PageBarButton icon={SlidersHorizontalIcon} aria-label="Share" />
|
|
206
|
+
</>
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
</Screen>,
|
|
210
|
+
);
|
|
211
|
+
for (const label of ["Filter", "Sort"]) {
|
|
212
|
+
const group = screen.getByLabelText(label).closest("[data-mp-icon-button-group]");
|
|
213
|
+
// No glass module under jsdom: the bar's group is a bare row.
|
|
214
|
+
expect(group?.getAttribute("data-mp-icon-button-group")).toBe("bar");
|
|
215
|
+
}
|
|
216
|
+
expect(screen.getByLabelText("More actions").closest("[data-mp-icon-button-group]")).toBe(
|
|
217
|
+
screen.getByLabelText("Filter").closest("[data-mp-icon-button-group]"),
|
|
218
|
+
);
|
|
219
|
+
expect(screen.getByLabelText("Back").closest("[data-mp-icon-button-group]")).toBeNull();
|
|
220
|
+
});
|
|
185
221
|
});
|
package/src/layouts/page.tsx
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
useResolvedKnobs,
|
|
30
30
|
type PageTitleScale,
|
|
31
31
|
} from "@multiplatform.one/theme";
|
|
32
|
-
import { Button, type ButtonProps } from "@multiplatform.one/forms";
|
|
32
|
+
import { Button, IconButtonGroup, type ButtonProps } from "@multiplatform.one/forms";
|
|
33
33
|
import { CaretLeftIcon, CaretRightIcon, DotsThreeIcon } from "@phosphor-icons/react";
|
|
34
34
|
import { useState, type ReactNode } from "react";
|
|
35
35
|
import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent } from "react-native";
|
|
@@ -376,7 +376,18 @@ export function PageHeader({
|
|
|
376
376
|
data-page-header-actions=""
|
|
377
377
|
>
|
|
378
378
|
{/* LC-153: page-head actions are a bar; neutral buttons go plain. */}
|
|
379
|
-
<Surface bar>
|
|
379
|
+
<Surface bar>
|
|
380
|
+
<IconButtonGroup
|
|
381
|
+
{...knobProps.gap}
|
|
382
|
+
justifyContent="flex-end"
|
|
383
|
+
flexWrap="wrap"
|
|
384
|
+
flexGrow={1}
|
|
385
|
+
flexShrink={1}
|
|
386
|
+
minWidth={0}
|
|
387
|
+
>
|
|
388
|
+
{actions}
|
|
389
|
+
</IconButtonGroup>
|
|
390
|
+
</Surface>
|
|
380
391
|
</XStack>
|
|
381
392
|
) : null}
|
|
382
393
|
</XStack>
|
|
@@ -558,16 +569,15 @@ function InlineToolbar({ leading, trailing, children, ...rest }: ScreenToolbarPr
|
|
|
558
569
|
{leading}
|
|
559
570
|
</XStack>
|
|
560
571
|
{children}
|
|
561
|
-
<
|
|
572
|
+
<IconButtonGroup
|
|
562
573
|
{...knobProps.gap}
|
|
563
|
-
alignItems="center"
|
|
564
574
|
flexWrap="wrap"
|
|
565
575
|
flexShrink={1}
|
|
566
576
|
minWidth={0}
|
|
567
577
|
justifyContent="flex-end"
|
|
568
578
|
>
|
|
569
579
|
{trailing}
|
|
570
|
-
</
|
|
580
|
+
</IconButtonGroup>
|
|
571
581
|
</XStack>
|
|
572
582
|
</Surface>
|
|
573
583
|
);
|
|
@@ -638,16 +648,15 @@ function PinnedTopBar({
|
|
|
638
648
|
{/* Pushes the actions to the trailing edge (LC-102: no space-between)
|
|
639
649
|
without widening the leading group the bar title clears. */}
|
|
640
650
|
<XStack flexGrow={1} />
|
|
641
|
-
<
|
|
651
|
+
<IconButtonGroup
|
|
642
652
|
{...knobProps.gap}
|
|
643
|
-
alignItems="center"
|
|
644
653
|
flexShrink={1}
|
|
645
654
|
minWidth={0}
|
|
646
655
|
justifyContent="flex-end"
|
|
647
656
|
onLayout={measureSide("trailing")}
|
|
648
657
|
>
|
|
649
658
|
{trailing}
|
|
650
|
-
</
|
|
659
|
+
</IconButtonGroup>
|
|
651
660
|
{title ? (
|
|
652
661
|
<XStack
|
|
653
662
|
position="absolute"
|