@multiplatform.one/components 7.86.0 → 7.87.1
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/Chip/index.cjs +1 -1
- package/dist/cjs/Chip/index.native.js +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/ChoiceChips/index.cjs +63 -0
- package/dist/cjs/ChoiceChips/index.native.js +71 -0
- package/dist/cjs/ChoiceChips/index.native.js.map +1 -0
- package/dist/cjs/ThemePresetPicker/index.cjs +15 -32
- package/dist/cjs/ThemePresetPicker/index.native.js +17 -32
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/appShell/AppShell.cjs +28 -9
- package/dist/cjs/appShell/AppShell.native.js +55 -13
- package/dist/cjs/appShell/AppShell.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.cjs +7 -9
- package/dist/cjs/code/Highlighter/index.native.js +13 -15
- package/dist/cjs/code/Highlighter/index.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/IdentityPlate.cjs +17 -16
- package/dist/cjs/layouts/IdentityPlate.native.js +19 -18
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/views/Calendar.cjs +2 -2
- package/dist/cjs/views/Calendar.native.js +2 -2
- package/dist/cjs/views/Calendar.native.js.map +1 -1
- package/dist/cjs/views/CardGrid.cjs +106 -0
- package/dist/cjs/views/CardGrid.native.js +116 -0
- package/dist/cjs/views/CardGrid.native.js.map +1 -0
- package/dist/cjs/views/ImageGrid.cjs +9 -2
- package/dist/cjs/views/ImageGrid.native.js +9 -2
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +2 -0
- package/dist/cjs/views/index.native.js +2 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Carousel/geometry.native.js.map +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/esm/CheckGlyph/index.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +1 -1
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +1 -1
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ChoiceChips/index.mjs +38 -0
- package/dist/esm/ChoiceChips/index.mjs.map +1 -0
- package/dist/esm/ChoiceChips/index.native.js +43 -0
- package/dist/esm/ChoiceChips/index.native.js.map +1 -0
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/Diff/diff.native.js.map +1 -1
- package/dist/esm/Diff/index.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Kbd/index.native.js.map +1 -1
- package/dist/esm/Kbd/keys.native.js.map +1 -1
- package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/esm/Lightbox/shared.native.js.map +1 -1
- package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/esm/MachineLiteral/index.native.js.map +1 -1
- package/dist/esm/Material/index.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/Quote/index.native.js.map +1 -1
- package/dist/esm/SchemeToggle/index.native.js.map +1 -1
- package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.mjs +16 -33
- package/dist/esm/ThemePresetPicker/index.mjs.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js +18 -33
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
- package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
- package/dist/esm/Video/VideoFrame.native.js.map +1 -1
- package/dist/esm/Video/types.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wizard/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/actions/DangerSection.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/actions/HeaderActions.native.js.map +1 -1
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/actions/devWarn.native.js.map +1 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/actions/severity.native.js.map +1 -1
- package/dist/esm/appShell/AppShell.mjs +28 -9
- package/dist/esm/appShell/AppShell.mjs.map +1 -1
- package/dist/esm/appShell/AppShell.native.js +55 -13
- package/dist/esm/appShell/AppShell.native.js.map +1 -1
- package/dist/esm/appShell/BottomChromeClearance.native.js.map +1 -1
- package/dist/esm/appShell/Dock.native.js.map +1 -1
- package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.native.js.map +1 -1
- package/dist/esm/appShell/appTile.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/esm/code/Highlighter/index.mjs +7 -9
- package/dist/esm/code/Highlighter/index.mjs.map +1 -1
- package/dist/esm/code/Highlighter/index.native.js +13 -15
- package/dist/esm/code/Highlighter/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/esm/code/LogView.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/esm/formLayouts/index.native.js.map +1 -1
- package/dist/esm/hooks/index.native.js.map +1 -1
- package/dist/esm/hooks/useClipboard.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/hooks/useHoldCue.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/framing.native.js.map +1 -1
- package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/index.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/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/Debug/index.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/IdentityPlate.mjs +17 -16
- package/dist/esm/layouts/IdentityPlate.mjs.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js +19 -18
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/asyncFailure.native.js.map +1 -1
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/barTitleSpan.native.js.map +1 -1
- package/dist/esm/layouts/bottomAccessory.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/shared/actionScan.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/restoreRetries.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/textRidesText.native.js.map +1 -1
- package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/setTinted.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.mjs +2 -2
- package/dist/esm/views/Calendar.mjs.map +1 -1
- package/dist/esm/views/Calendar.native.js +2 -2
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/CardGrid.mjs +70 -0
- package/dist/esm/views/CardGrid.mjs.map +1 -0
- package/dist/esm/views/CardGrid.native.js +77 -0
- package/dist/esm/views/CardGrid.native.js.map +1 -0
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.mjs +9 -3
- package/dist/esm/views/ImageGrid.mjs.map +1 -1
- package/dist/esm/views/ImageGrid.native.js +9 -3
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ListRow.native.js.map +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/ShortcutCard.native.js.map +1 -1
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/esm/views/ganttIntervals.native.js.map +1 -1
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -1
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/kanbanDnd.native.js.map +1 -1
- package/dist/esm/views/matrixMath.native.js.map +1 -1
- package/dist/esm/views/sameNameScope.native.js.map +1 -1
- package/dist/esm/views/treeViewDnd.native.js.map +1 -1
- package/dist/esm/views/treeViewLayout.native.js.map +1 -1
- package/dist/esm/views/treeViewMotion.native.js.map +1 -1
- package/dist/esm/views/treeViewReveal.native.js.map +1 -1
- package/dist/esm/views/usePageFlowLoadMore.native.js.map +1 -1
- package/dist/esm/views/widgetChrome.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +1 -1
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +1 -1
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/ChoiceChips/index.mjs +38 -0
- package/dist/jsx/ChoiceChips/index.mjs.map +1 -0
- package/dist/jsx/ChoiceChips/index.native.js +71 -0
- package/dist/jsx/ChoiceChips/index.native.js.map +1 -0
- package/dist/jsx/ThemePresetPicker/index.mjs +16 -33
- package/dist/jsx/ThemePresetPicker/index.mjs.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.native.js +17 -32
- package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/jsx/appShell/AppShell.mjs +28 -9
- package/dist/jsx/appShell/AppShell.mjs.map +1 -1
- package/dist/jsx/appShell/AppShell.native.js +55 -13
- package/dist/jsx/appShell/AppShell.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/index.mjs +7 -9
- package/dist/jsx/code/Highlighter/index.mjs.map +1 -1
- package/dist/jsx/code/Highlighter/index.native.js +13 -15
- package/dist/jsx/code/Highlighter/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 +1 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.mjs +17 -16
- package/dist/jsx/layouts/IdentityPlate.mjs.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js +19 -18
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/views/Calendar.mjs +2 -2
- package/dist/jsx/views/Calendar.mjs.map +1 -1
- package/dist/jsx/views/Calendar.native.js +2 -2
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/CardGrid.mjs +70 -0
- package/dist/jsx/views/CardGrid.mjs.map +1 -0
- package/dist/jsx/views/CardGrid.native.js +116 -0
- package/dist/jsx/views/CardGrid.native.js.map +1 -0
- package/dist/jsx/views/ImageGrid.mjs +9 -3
- package/dist/jsx/views/ImageGrid.mjs.map +1 -1
- package/dist/jsx/views/ImageGrid.native.js +9 -2
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -1
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +2 -0
- package/dist/jsx/views/index.native.js.map +1 -1
- package/package.json +9 -9
- package/src/Chip/index.tsx +5 -2
- package/src/ChoiceChips/ChoiceChips.spec.tsx +58 -0
- package/src/ChoiceChips/ChoiceChips.stories.tsx +49 -0
- package/src/ChoiceChips/index.tsx +57 -0
- package/src/SheetModal/SheetModal.stories.tsx +5 -5
- package/src/ThemePresetPicker/ThemePresetPicker.spec.tsx +5 -13
- package/src/ThemePresetPicker/index.tsx +16 -41
- package/src/appShell/AppShell.spec.tsx +47 -0
- package/src/appShell/AppShell.stories.spec.tsx +27 -0
- package/src/appShell/AppShell.stories.tsx +82 -11
- package/src/appShell/AppShell.tsx +36 -12
- package/src/code/Highlighter/index.ts +10 -12
- package/src/index.ts +1 -0
- package/src/layouts/IdentityPlate.native-press.spec.tsx +71 -0
- package/src/layouts/IdentityPlate.spec.tsx +69 -0
- package/src/layouts/IdentityPlate.tsx +14 -17
- package/src/testUtilsTimeouts.spec.ts +8 -0
- package/src/views/Calendar.tsx +2 -2
- package/src/views/CardGrid.spec.tsx +95 -0
- package/src/views/CardGrid.stories.tsx +70 -0
- package/src/views/CardGrid.tsx +85 -0
- package/src/views/ImageGrid.tsx +13 -5
- package/src/views/index.ts +1 -0
- package/types/Chip/index.d.ts +4 -1
- package/types/Chip/index.d.ts.map +1 -1
- package/types/ChoiceChips/index.d.ts +24 -0
- package/types/ChoiceChips/index.d.ts.map +1 -0
- package/types/ThemePresetPicker/index.d.ts +1 -3
- package/types/ThemePresetPicker/index.d.ts.map +1 -1
- package/types/appShell/AppShell.d.ts +8 -0
- package/types/appShell/AppShell.d.ts.map +1 -1
- package/types/code/Highlighter/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/IdentityPlate.d.ts +1 -1
- package/types/layouts/IdentityPlate.d.ts.map +1 -1
- package/types/views/CardGrid.d.ts +10 -0
- package/types/views/CardGrid.d.ts.map +1 -0
- package/types/views/ImageGrid.d.ts +10 -1
- package/types/views/ImageGrid.d.ts.map +1 -1
- package/types/views/index.d.ts +1 -0
- package/types/views/index.d.ts.map +1 -1
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
type SchemePreference,
|
|
6
6
|
} from "@multiplatform.one/theme";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { YStack
|
|
9
|
-
import {
|
|
10
|
-
import { OverflowRow } from "../OverflowRow";
|
|
11
|
-
import { Paragraph } from "../Text";
|
|
8
|
+
import { YStack } from "tamagui";
|
|
9
|
+
import { ChoiceChips } from "../ChoiceChips";
|
|
12
10
|
|
|
13
11
|
export interface ThemePresetPickerProps {
|
|
14
12
|
rows?: ReadonlyArray<"scheme" | "preset">;
|
|
@@ -16,7 +14,6 @@ export interface ThemePresetPickerProps {
|
|
|
16
14
|
/** Signed-in owner; none records this device's signed-out choice. */
|
|
17
15
|
userId?: string | null;
|
|
18
16
|
testID?: string;
|
|
19
|
-
fadeColor?: ColorTokens;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
const titleCase = (name: string) =>
|
|
@@ -30,7 +27,6 @@ export function ThemePresetPicker({
|
|
|
30
27
|
useUserScheme = useSchemePreference,
|
|
31
28
|
userId,
|
|
32
29
|
testID = "theme-preset-picker",
|
|
33
|
-
fadeColor,
|
|
34
30
|
}: ThemePresetPickerProps) {
|
|
35
31
|
const { t } = useTranslation();
|
|
36
32
|
const scheme = useUserScheme();
|
|
@@ -40,43 +36,22 @@ export function ThemePresetPicker({
|
|
|
40
36
|
return (
|
|
41
37
|
<YStack testID={testID} gap="$3">
|
|
42
38
|
{rows.map((row) => {
|
|
43
|
-
const label = t(`themePresetPicker.${row}`, { defaultValue: titleCase(row) });
|
|
44
39
|
const options = row === "scheme" ? (["system", "light", "dark"] as const) : presets;
|
|
45
40
|
return (
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Chip
|
|
62
|
-
key={name}
|
|
63
|
-
aria-label={`${label}: ${optionLabel}`}
|
|
64
|
-
selected={(row === "scheme" ? scheme.setting : selectedPreset) === name}
|
|
65
|
-
onPress={() => {
|
|
66
|
-
if (
|
|
67
|
-
row === "scheme" &&
|
|
68
|
-
(name === "system" || name === "light" || name === "dark")
|
|
69
|
-
)
|
|
70
|
-
scheme.set(name);
|
|
71
|
-
else preset.choosePreset(name, userId ?? null);
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
{optionLabel}
|
|
75
|
-
</Chip>
|
|
76
|
-
);
|
|
77
|
-
})}
|
|
78
|
-
</OverflowRow>
|
|
79
|
-
</YStack>
|
|
41
|
+
<ChoiceChips
|
|
42
|
+
key={row}
|
|
43
|
+
label={t(`themePresetPicker.${row}`, { defaultValue: titleCase(row) })}
|
|
44
|
+
options={options.map((name) => ({
|
|
45
|
+
value: name,
|
|
46
|
+
label: t(`themePresetPicker.${row}s.${name}`, { defaultValue: titleCase(name) }),
|
|
47
|
+
}))}
|
|
48
|
+
value={row === "scheme" ? scheme.setting : selectedPreset}
|
|
49
|
+
onChange={(name) => {
|
|
50
|
+
if (row === "scheme" && (name === "system" || name === "light" || name === "dark"))
|
|
51
|
+
scheme.set(name);
|
|
52
|
+
else preset.choosePreset(name, userId ?? null);
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
80
55
|
);
|
|
81
56
|
})}
|
|
82
57
|
</YStack>
|
|
@@ -242,6 +242,53 @@ describe("AppShell on a phone", () => {
|
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
244
|
|
|
245
|
+
describe("AppShell destination sections and counts (LC-175, FZ-8912)", () => {
|
|
246
|
+
const grouped: AppShellDestination[] = [
|
|
247
|
+
{ key: "/", label: "Home", icon: HouseIcon },
|
|
248
|
+
{ key: "/inbox", label: "Inbox", icon: SparkleIcon, section: "Operations", count: 8 },
|
|
249
|
+
{ key: "/setup", label: "Setup", icon: LightningIcon, section: "Setup", placement: "more" },
|
|
250
|
+
{ key: "/recs", label: "Recs", icon: LightningIcon, section: "Operations", count: 0 },
|
|
251
|
+
{ key: "/races", label: "Races", icon: HouseIcon },
|
|
252
|
+
];
|
|
253
|
+
|
|
254
|
+
function groups() {
|
|
255
|
+
const sidebar = screen.getByTestId("app-shell-sidebar");
|
|
256
|
+
return [...sidebar.querySelectorAll('[role="group"]')].map((group) => {
|
|
257
|
+
const titleId = group.getAttribute("aria-labelledby");
|
|
258
|
+
return {
|
|
259
|
+
title: titleId ? (document.getElementById(titleId)?.textContent ?? null) : null,
|
|
260
|
+
rows: [...group.querySelectorAll("[data-sidebar-row]")].map((row) => row.textContent),
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
it("builds one titled sidebar section per title in declaration order, untitled ones leading", () => {
|
|
266
|
+
size.value = "expanded";
|
|
267
|
+
shell("/inbox", { destinations: grouped });
|
|
268
|
+
expect(groups()).toEqual([
|
|
269
|
+
{ title: null, rows: ["Home", "Races"] },
|
|
270
|
+
{ title: "Operations", rows: ["Inbox(8)", "Recs(0)"] },
|
|
271
|
+
{ title: "Setup", rows: ["Setup"] },
|
|
272
|
+
]);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it("shows a count as a plain number in the row's meta ink, never a badge (LC-118)", () => {
|
|
276
|
+
size.value = "expanded";
|
|
277
|
+
shell("/", { destinations: grouped });
|
|
278
|
+
const inbox = [
|
|
279
|
+
...screen.getByTestId("app-shell-sidebar").querySelectorAll("[data-sidebar-row]"),
|
|
280
|
+
].find((row) => row.textContent?.startsWith("Inbox"))!;
|
|
281
|
+
expect(inbox.querySelector('[role="status"], [aria-live], [data-badge]')).toBeNull();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it("leaves the phone's tab bar and pull-down as they were: sections are a sidebar grouping", () => {
|
|
285
|
+
shell("/", { destinations: grouped });
|
|
286
|
+
const tabs = screen.getAllByRole("tab").map((tab) => tab.textContent);
|
|
287
|
+
expect(tabs).toEqual(["Home", "Inbox", "Recs", "Races"]);
|
|
288
|
+
expect(screen.getByTestId("app-shell-more")).toBeTruthy();
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
245
292
|
describe("AppShell at regular width", () => {
|
|
246
293
|
it("lists every destination in the sidebar, under the app's name, and no tab bar", () => {
|
|
247
294
|
size.value = "expanded";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-9215: TabHost keeps the MPO TabBar when any tab lacks its platform's
|
|
3
|
+
* glyph, so the Components/AppShell stories need an SF Symbol on every tab
|
|
4
|
+
* for Kitchen Sink on iOS to draw the native tabs One ships.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { destinations } from "./AppShell.stories";
|
|
8
|
+
|
|
9
|
+
const tabs = destinations.filter((item) => (item.placement ?? "tab") === "tab");
|
|
10
|
+
|
|
11
|
+
describe("Components/AppShell stories draw native tabs on iOS (FZ-9215)", () => {
|
|
12
|
+
it("gives every tab an SF Symbol and a filled selected glyph where One has one", () => {
|
|
13
|
+
expect(tabs.length).toBeGreaterThanOrEqual(3);
|
|
14
|
+
for (const tab of tabs) expect(tab.nativeIcon?.sfSymbol, tab.label).toMatch(/\S/);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("uses One's glyphs for the same destinations", () => {
|
|
18
|
+
const symbols = Object.fromEntries(tabs.map((tab) => [tab.key, tab.nativeIcon]));
|
|
19
|
+
expect(symbols["/"]).toMatchObject({ sfSymbol: "house", sfSymbolSelected: "house.fill" });
|
|
20
|
+
expect(symbols["/pokemon"]).toMatchObject({ sfSymbol: "sparkles" });
|
|
21
|
+
expect(symbols["/moves"]).toMatchObject({ sfSymbol: "bolt", sfSymbolSelected: "bolt.fill" });
|
|
22
|
+
expect(symbols["/backoffice"]).toMatchObject({
|
|
23
|
+
sfSymbol: "square.grid.2x2",
|
|
24
|
+
sfSymbolSelected: "square.grid.2x2.fill",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -16,11 +16,26 @@ import { Pagination } from "../Pagination";
|
|
|
16
16
|
import { Text } from "../Text";
|
|
17
17
|
import { AppShell, type AppShellDestination } from "./AppShell";
|
|
18
18
|
|
|
19
|
-
const destinations: AppShellDestination[] = [
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
export const destinations: AppShellDestination[] = [
|
|
20
|
+
{
|
|
21
|
+
key: "/",
|
|
22
|
+
label: "Home",
|
|
23
|
+
icon: HouseIcon,
|
|
24
|
+
nativeIcon: { sfSymbol: "house", sfSymbolSelected: "house.fill" },
|
|
25
|
+
},
|
|
26
|
+
{ key: "/pokemon", label: "Pokemon", icon: SparkleIcon, nativeIcon: { sfSymbol: "sparkles" } },
|
|
27
|
+
{
|
|
28
|
+
key: "/moves",
|
|
29
|
+
label: "Moves",
|
|
30
|
+
icon: LightningIcon,
|
|
31
|
+
nativeIcon: { sfSymbol: "bolt", sfSymbolSelected: "bolt.fill" },
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "/backoffice",
|
|
35
|
+
label: "Backoffice",
|
|
36
|
+
icon: SquaresFourIcon,
|
|
37
|
+
nativeIcon: { sfSymbol: "square.grid.2x2", sfSymbolSelected: "square.grid.2x2.fill" },
|
|
38
|
+
},
|
|
24
39
|
{ key: "/settings", label: "Settings", icon: GearIcon, placement: "more" },
|
|
25
40
|
];
|
|
26
41
|
|
|
@@ -40,10 +55,18 @@ function Mark() {
|
|
|
40
55
|
);
|
|
41
56
|
}
|
|
42
57
|
|
|
43
|
-
function DemoPage({
|
|
58
|
+
function DemoPage({
|
|
59
|
+
path,
|
|
60
|
+
open,
|
|
61
|
+
items,
|
|
62
|
+
}: {
|
|
63
|
+
path: string;
|
|
64
|
+
open: (path: string) => void;
|
|
65
|
+
items: AppShellDestination[];
|
|
66
|
+
}) {
|
|
44
67
|
const pushed = path.split("/").filter(Boolean).length > 1;
|
|
45
|
-
const name =
|
|
46
|
-
const title = pushed ? "Pikachu" : (name?.label ?? "Home");
|
|
68
|
+
const name = items.find((item) => path.startsWith(item.key) && item.key !== "/");
|
|
69
|
+
const title = pushed ? "Pikachu" : (name?.label ?? items[0]?.label ?? "Home");
|
|
47
70
|
return (
|
|
48
71
|
<Screen>
|
|
49
72
|
<PageHeader title={title} subtitle={pushed ? "#025 · Electric" : "1,025 entries"} />
|
|
@@ -67,11 +90,50 @@ function DemoPage({ path, open }: { path: string; open: (path: string) => void }
|
|
|
67
90
|
);
|
|
68
91
|
}
|
|
69
92
|
|
|
70
|
-
|
|
93
|
+
const grouped: AppShellDestination[] = [
|
|
94
|
+
{ key: "/", label: "Races", icon: HouseIcon },
|
|
95
|
+
{ key: "/edge", label: "Edge", icon: LightningIcon },
|
|
96
|
+
{ key: "/market", label: "The market", icon: SparkleIcon },
|
|
97
|
+
...["Positions", "Timeline", "Caps", "Alerts", "Feeds"].map((label) => ({
|
|
98
|
+
key: `/${label.toLowerCase()}`,
|
|
99
|
+
label,
|
|
100
|
+
icon: StackIcon,
|
|
101
|
+
section: "Operations",
|
|
102
|
+
placement: "more" as const,
|
|
103
|
+
})),
|
|
104
|
+
{
|
|
105
|
+
key: "/inbox",
|
|
106
|
+
label: "Inbox",
|
|
107
|
+
icon: StackIcon,
|
|
108
|
+
section: "Operations",
|
|
109
|
+
placement: "more",
|
|
110
|
+
count: 3,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: "/recommendations",
|
|
114
|
+
label: "Recommendations",
|
|
115
|
+
icon: SparkleIcon,
|
|
116
|
+
section: "Operations",
|
|
117
|
+
placement: "more",
|
|
118
|
+
count: 12,
|
|
119
|
+
},
|
|
120
|
+
{ key: "/settings", label: "Settings", icon: GearIcon, section: "Setup", placement: "more" },
|
|
121
|
+
{ key: "/enroll", label: "Enroll device", icon: GearIcon, section: "Setup", placement: "more" },
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
function Demo({
|
|
125
|
+
initialPath,
|
|
126
|
+
accessory,
|
|
127
|
+
items = destinations,
|
|
128
|
+
}: {
|
|
129
|
+
initialPath: string;
|
|
130
|
+
accessory?: boolean;
|
|
131
|
+
items?: AppShellDestination[];
|
|
132
|
+
}) {
|
|
71
133
|
const [path, setPath] = useState(initialPath);
|
|
72
134
|
return (
|
|
73
135
|
<AppShell
|
|
74
|
-
destinations={
|
|
136
|
+
destinations={items}
|
|
75
137
|
path={path}
|
|
76
138
|
onNavigate={setPath}
|
|
77
139
|
onBack={setPath}
|
|
@@ -81,7 +143,7 @@ function Demo({ initialPath, accessory }: { initialPath: string; accessory?: boo
|
|
|
81
143
|
accessory={accessory ? <Pagination total={41} defaultPage={1} variant="dots" /> : undefined}
|
|
82
144
|
ownChrome={["/backoffice"]}
|
|
83
145
|
>
|
|
84
|
-
<DemoPage path={path} open={setPath} />
|
|
146
|
+
<DemoPage path={path} open={setPath} items={items} />
|
|
85
147
|
</AppShell>
|
|
86
148
|
);
|
|
87
149
|
}
|
|
@@ -110,3 +172,12 @@ export const Pushed: Story = { render: () => <Demo initialPath="/pokemon/pikachu
|
|
|
110
172
|
export const WithAccessory: Story = {
|
|
111
173
|
render: () => <Demo initialPath="/pokemon" accessory />,
|
|
112
174
|
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Titled sidebar sections and counts (LC-175 amendment, FZ-8912): untitled
|
|
178
|
+
* destinations lead, each `section` is one titled group, a `count` is a plain
|
|
179
|
+
* number after the label. The phone keeps its tab bar and pull-down.
|
|
180
|
+
*/
|
|
181
|
+
export const GroupedSidebar: Story = {
|
|
182
|
+
render: () => <Demo initialPath="/" items={grouped} />,
|
|
183
|
+
};
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
type ShellSidebarPanel,
|
|
46
46
|
} from "../layouts/shellSidebarSlot";
|
|
47
47
|
import { BottomAccessory } from "../layouts/bottomAccessory";
|
|
48
|
-
import { Sidebar } from "../layouts/sidebar";
|
|
48
|
+
import { Sidebar, type SidebarItem, type SidebarSection } from "../layouts/sidebar";
|
|
49
49
|
import { useTranslation } from "../shared/i18n";
|
|
50
50
|
import type { TabBarIcon, TabBarItem } from "./TabBar";
|
|
51
51
|
import { TabHost } from "./TabHost";
|
|
@@ -66,6 +66,33 @@ export interface AppShellDestination {
|
|
|
66
66
|
placement?: "tab" | "more";
|
|
67
67
|
/** Runs instead of `onNavigate(key)`, e.g. an external link. */
|
|
68
68
|
onPress?: () => void;
|
|
69
|
+
/**
|
|
70
|
+
* The regular-width sidebar's group title. Untitled destinations lead in one
|
|
71
|
+
* untitled group; each title is one section, in first-appearance order. The
|
|
72
|
+
* phone's tab bar and pull-down ignore it (LC-175).
|
|
73
|
+
*/
|
|
74
|
+
section?: string;
|
|
75
|
+
/** A plain number after the sidebar row's label, e.g. unread items (LC-118). */
|
|
76
|
+
count?: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function sidebarSections(
|
|
80
|
+
destinations: readonly AppShellDestination[],
|
|
81
|
+
row: (item: AppShellDestination) => SidebarItem,
|
|
82
|
+
): SidebarSection[] {
|
|
83
|
+
const untitled: SidebarItem[] = [];
|
|
84
|
+
const titled = new Map<string, SidebarItem[]>();
|
|
85
|
+
for (const item of destinations) {
|
|
86
|
+
if (!item.section) {
|
|
87
|
+
untitled.push(row(item));
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const rows = titled.get(item.section) ?? [];
|
|
91
|
+
rows.push(row(item));
|
|
92
|
+
titled.set(item.section, rows);
|
|
93
|
+
}
|
|
94
|
+
const sections: SidebarSection[] = [...titled].map(([title, items]) => ({ title, items }));
|
|
95
|
+
return untitled.length ? [{ items: untitled }, ...sections] : sections;
|
|
69
96
|
}
|
|
70
97
|
|
|
71
98
|
export interface AppShellProps {
|
|
@@ -504,17 +531,14 @@ export function AppShell({
|
|
|
504
531
|
</XStack>
|
|
505
532
|
) : undefined
|
|
506
533
|
}
|
|
507
|
-
sections={
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
})),
|
|
516
|
-
},
|
|
517
|
-
]}
|
|
534
|
+
sections={sidebarSections(destinations, (item) => ({
|
|
535
|
+
label: item.label,
|
|
536
|
+
value: item.key,
|
|
537
|
+
icon: createElement(item.icon),
|
|
538
|
+
count: item.count,
|
|
539
|
+
active: item === destination,
|
|
540
|
+
onPress: () => go(item),
|
|
541
|
+
}))}
|
|
518
542
|
>
|
|
519
543
|
{sidebarSlot.panel ? <StackedPanel panel={sidebarSlot.panel} /> : null}
|
|
520
544
|
</Sidebar>
|
|
@@ -89,19 +89,17 @@ const tokenizeTimeLimit = 0;
|
|
|
89
89
|
const tokenizeMaxLineLength = 5000;
|
|
90
90
|
|
|
91
91
|
function getHighlighter(): Promise<any> {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
withNamedGroupMatchAll(() => jsEngine.defaultJavaScriptRegexConstructor(pattern)),
|
|
101
|
-
}),
|
|
92
|
+
highlighterPromise ??= Promise.all([import("shiki"), import("shiki/engine/javascript")]).then(
|
|
93
|
+
([shiki, jsEngine]) =>
|
|
94
|
+
shiki.createHighlighter({
|
|
95
|
+
themes: [],
|
|
96
|
+
langs: [],
|
|
97
|
+
engine: jsEngine.createJavaScriptRegexEngine({
|
|
98
|
+
regexConstructor: (pattern: string) =>
|
|
99
|
+
withNamedGroupMatchAll(() => jsEngine.defaultJavaScriptRegexConstructor(pattern)),
|
|
102
100
|
}),
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
}),
|
|
102
|
+
);
|
|
105
103
|
return highlighterPromise;
|
|
106
104
|
}
|
|
107
105
|
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createDefaultThemeConfig } from "@multiplatform.one/theme";
|
|
2
|
+
import { cleanup, render, screen } from "@testing-library/react";
|
|
3
|
+
import { createElement, forwardRef, type ComponentProps } from "react";
|
|
4
|
+
import { TamaguiProvider, isWeb } from "tamagui";
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
6
|
+
import { IdentityPlate } from "./IdentityPlate";
|
|
7
|
+
|
|
8
|
+
vi.mock("@multiplatform.one/platform", async (importOriginal) => ({
|
|
9
|
+
...(await importOriginal<typeof import("@multiplatform.one/platform")>()),
|
|
10
|
+
isWeb: false,
|
|
11
|
+
isNative: true,
|
|
12
|
+
}));
|
|
13
|
+
const scrollers = vi.hoisted(() => [] as { horizontal?: boolean }[]);
|
|
14
|
+
vi.mock("../ScrollView", async () => {
|
|
15
|
+
const native = await import("../ScrollView/index.native");
|
|
16
|
+
const ScrollView = forwardRef<unknown, ComponentProps<typeof native.ScrollView>>((props, ref) => {
|
|
17
|
+
scrollers.push(props as { horizontal?: boolean });
|
|
18
|
+
return createElement(
|
|
19
|
+
"div",
|
|
20
|
+
{ "data-testid": "facts-scroller" },
|
|
21
|
+
createElement(native.ScrollView, { ...props, ref } as never),
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
return { ...native, ScrollView };
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const config = createDefaultThemeConfig();
|
|
28
|
+
const labels = ["16", "corp", "incus03", "incus", "Private", "3 days ago"];
|
|
29
|
+
|
|
30
|
+
afterEach(() => {
|
|
31
|
+
cleanup();
|
|
32
|
+
scrollers.length = 0;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function plate(facts: string[]) {
|
|
36
|
+
return render(
|
|
37
|
+
<TamaguiProvider config={config.tamagui} defaultTheme="light" disableInjectCSS>
|
|
38
|
+
<IdentityPlate
|
|
39
|
+
title="affine"
|
|
40
|
+
status="Running"
|
|
41
|
+
statusTone="positive"
|
|
42
|
+
facts={facts.map((label) => ({ label }))}
|
|
43
|
+
/>
|
|
44
|
+
</TamaguiProvider>,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
describe("IdentityPlate's facts on native (FZ-8074)", () => {
|
|
49
|
+
it("runs tamagui's native build", () => {
|
|
50
|
+
expect(isWeb).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("keeps every fact on one sideways-scrolling line", () => {
|
|
54
|
+
const { container } = plate(labels);
|
|
55
|
+
const scroller = screen.getByTestId("facts-scroller");
|
|
56
|
+
expect(scrollers.at(-1)?.horizontal).toBe(true);
|
|
57
|
+
for (const label of labels) {
|
|
58
|
+
const fact = screen.getByText(label);
|
|
59
|
+
expect(scroller.contains(fact)).toBe(true);
|
|
60
|
+
for (let el: HTMLElement | null = fact; el && el !== container; el = el.parentElement) {
|
|
61
|
+
expect(el.style.flexWrap).not.toBe("wrap");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("draws no scroller without facts", () => {
|
|
67
|
+
plate([]);
|
|
68
|
+
expect(screen.queryByTestId("facts-scroller")).toBeNull();
|
|
69
|
+
expect(scrollers).toHaveLength(0);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { act, cleanup, fireEvent, screen } from "@testing-library/react";
|
|
3
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
4
|
+
import { IdentityPlate } from "./IdentityPlate";
|
|
5
|
+
|
|
6
|
+
afterEach(cleanup);
|
|
7
|
+
|
|
8
|
+
const facts = ["16", "corp", "incus03", "incus", "Private", "3 days ago"].map((label) => ({
|
|
9
|
+
label,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
function factsSlot() {
|
|
13
|
+
const slot = document.querySelector<HTMLElement>("[data-slot='facts']");
|
|
14
|
+
if (!slot) throw new Error("no facts slot");
|
|
15
|
+
return slot;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function between(fact: HTMLElement, slot: HTMLElement): HTMLElement[] {
|
|
19
|
+
const chain: HTMLElement[] = [];
|
|
20
|
+
for (
|
|
21
|
+
let node = fact.parentElement;
|
|
22
|
+
node && node !== slot.parentElement;
|
|
23
|
+
node = node.parentElement
|
|
24
|
+
)
|
|
25
|
+
chain.push(node);
|
|
26
|
+
return chain;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe("IdentityPlate facts (FZ-8074)", () => {
|
|
30
|
+
it("lays every fact on one line: nothing between a fact and the plate wraps", () => {
|
|
31
|
+
renderWithProviders(<IdentityPlate title="postgres" status="Running" facts={facts} />);
|
|
32
|
+
const slot = factsSlot();
|
|
33
|
+
for (const label of facts.map((fact) => fact.label)) {
|
|
34
|
+
const wraps = between(screen.getByText(label), slot).filter(
|
|
35
|
+
(node) => getComputedStyle(node).flexWrap === "wrap",
|
|
36
|
+
);
|
|
37
|
+
expect(wraps, label).toEqual([]);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("scrolls the facts sideways and fades only the hidden edge when they overflow", async () => {
|
|
42
|
+
renderWithProviders(<IdentityPlate title="postgres" status="Running" facts={facts} />);
|
|
43
|
+
const slot = factsSlot();
|
|
44
|
+
const scroller = [...slot.querySelectorAll<HTMLElement>("*")].find(
|
|
45
|
+
(node) =>
|
|
46
|
+
getComputedStyle(node).overflowX === "auto" ||
|
|
47
|
+
getComputedStyle(node).overflowX === "scroll",
|
|
48
|
+
);
|
|
49
|
+
expect(scroller, "no horizontal scroller in the facts slot").toBeTruthy();
|
|
50
|
+
expect(slot.querySelector("[data-testid='overflow-row-end-fade']")).toBeNull();
|
|
51
|
+
Object.defineProperties(scroller!, {
|
|
52
|
+
scrollWidth: { configurable: true, value: 520 },
|
|
53
|
+
offsetWidth: { configurable: true, value: 360 },
|
|
54
|
+
scrollHeight: { configurable: true, value: 20 },
|
|
55
|
+
offsetHeight: { configurable: true, value: 20 },
|
|
56
|
+
});
|
|
57
|
+
await act(async () => {
|
|
58
|
+
fireEvent.scroll(scroller!, { target: { scrollLeft: 0 } });
|
|
59
|
+
await new Promise((resolve) => setTimeout(resolve, 120));
|
|
60
|
+
});
|
|
61
|
+
expect(slot.querySelector("[data-testid='overflow-row-end-fade']")).toBeTruthy();
|
|
62
|
+
expect(slot.querySelector("[data-testid='overflow-row-start-fade']")).toBeNull();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("draws no facts row without facts", () => {
|
|
66
|
+
renderWithProviders(<IdentityPlate title="postgres" status="Running" />);
|
|
67
|
+
expect(document.querySelector("[data-slot='facts']")).toBeNull();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -11,6 +11,7 @@ import { IconSlot, useGlyphColor, useResolvedKnobs } from "@multiplatform.one/th
|
|
|
11
11
|
import type { ReactNode } from "react";
|
|
12
12
|
import { SizableText, Text, View, XStack, YStack, isWeb } from "tamagui";
|
|
13
13
|
import { sectionHeading } from "../componentColors";
|
|
14
|
+
import { OverflowRow } from "../OverflowRow";
|
|
14
15
|
import { StatusMark, type StatusTone } from "./StatusDot";
|
|
15
16
|
|
|
16
17
|
export type IdentityPlateTone = StatusTone;
|
|
@@ -31,7 +32,7 @@ export interface IdentityPlateProps {
|
|
|
31
32
|
status?: string;
|
|
32
33
|
/** The status dot's tone. Omitted: no dot. */
|
|
33
34
|
statusTone?: IdentityPlateTone;
|
|
34
|
-
/** Key facts
|
|
35
|
+
/** Key facts on one line under the status; it scrolls sideways when they overflow. */
|
|
35
36
|
facts?: readonly IdentityPlateFact[];
|
|
36
37
|
/** Header actions on the name's row (close, menu). */
|
|
37
38
|
trailing?: ReactNode;
|
|
@@ -95,22 +96,18 @@ export function IdentityPlate({
|
|
|
95
96
|
) : null}
|
|
96
97
|
</XStack>
|
|
97
98
|
{facts.length > 0 ? (
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</Text>
|
|
111
|
-
</XStack>
|
|
112
|
-
))}
|
|
113
|
-
</XStack>
|
|
99
|
+
<YStack minWidth={0} data-slot="facts">
|
|
100
|
+
<OverflowRow>
|
|
101
|
+
{facts.map((fact) => (
|
|
102
|
+
<XStack key={fact.key ?? fact.label} alignItems="center" gap="$1.5" flexShrink={0}>
|
|
103
|
+
{fact.icon ? <FactGlyph icon={fact.icon} /> : null}
|
|
104
|
+
<Text {...knobProps.textRole.meta} numberOfLines={1}>
|
|
105
|
+
{fact.label}
|
|
106
|
+
</Text>
|
|
107
|
+
</XStack>
|
|
108
|
+
))}
|
|
109
|
+
</OverflowRow>
|
|
110
|
+
</YStack>
|
|
114
111
|
) : null}
|
|
115
112
|
</YStack>
|
|
116
113
|
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getConfig } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
describe("@multiplatform.one/test-utils/setup (FZ-8447)", () => {
|
|
5
|
+
it("gives testing-library waits five seconds by default", () => {
|
|
6
|
+
expect(getConfig().asyncUtilTimeout).toBe(5000);
|
|
7
|
+
});
|
|
8
|
+
});
|
package/src/views/Calendar.tsx
CHANGED
|
@@ -1848,7 +1848,7 @@ export function Calendar({
|
|
|
1848
1848
|
<FloatingPanel
|
|
1849
1849
|
open={overflowDayKey === dayKey}
|
|
1850
1850
|
onOpenChange={(open) => setOverflowDayKey(open ? dayKey : null)}
|
|
1851
|
-
|
|
1851
|
+
widthMode="fit-content"
|
|
1852
1852
|
trigger={
|
|
1853
1853
|
<XStack
|
|
1854
1854
|
role="button"
|
|
@@ -2284,7 +2284,7 @@ export function Calendar({
|
|
|
2284
2284
|
onOpenChange={(open) => {
|
|
2285
2285
|
if (!open) commitEditor();
|
|
2286
2286
|
}}
|
|
2287
|
-
|
|
2287
|
+
widthMode="fit-content"
|
|
2288
2288
|
trigger={
|
|
2289
2289
|
<YStack
|
|
2290
2290
|
{...knobProps.borderRadius}
|