@multiplatform.one/components 7.86.0 → 7.87.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/geometry.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/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/cjs/CheckGlyph/index.native.js.map +1 -1
- 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/Collapsible.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/CopyMenuButton.native.js +1 -1
- package/dist/cjs/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/Dialog.native.js +1 -1
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/Diff/diff.native.js.map +1 -1
- package/dist/cjs/Diff/index.native.js.map +1 -1
- package/dist/cjs/DotIndicator/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/cjs/ElapsedProgress/index.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.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/MachineLiteral/index.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.native.js +1 -1
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Popover.native.js +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/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/cjs/Tabs/index.native.js +1 -1
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.native.js.map +1 -1
- 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/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.native.js +2 -2
- 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/AppShell.cjs +28 -9
- package/dist/cjs/appShell/AppShell.native.js +56 -14
- package/dist/cjs/appShell/AppShell.native.js.map +1 -1
- package/dist/cjs/appShell/BottomChromeClearance.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.native.js +1 -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 +2 -2
- 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/LogView.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.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.cjs +1 -0
- package/dist/cjs/index.native.js +40 -39
- 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 +1 -1
- package/dist/cjs/layouts/EmptyState.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/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/StatusGlyphStrip.native.js +1 -1
- package/dist/cjs/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/cjs/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/asyncFailure.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/barTitleSpan.native.js.map +1 -1
- package/dist/cjs/layouts/bottomAccessory.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/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/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.cjs +9 -2
- package/dist/cjs/views/ImageGrid.native.js +11 -4
- 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.cjs +2 -0
- package/dist/cjs/views/index.native.js +3 -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/sameNameScope.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/usePageFlowLoadMore.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.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/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/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/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/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/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/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/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/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/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/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/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/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/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/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
|
@@ -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>
|
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
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-179 UNIFORM-GRID, round 68: a grid of content cards gives every cell one
|
|
3
|
+
* width at its column count, counts columns from its own container through
|
|
4
|
+
* the ImageGrid geometry, and leaves an odd last card in the first column.
|
|
5
|
+
* jsdom has no layout, so these read the grid's structure and atoms; the
|
|
6
|
+
* Storybook probe in harvest-layout-rules.spec.ts measures the pixels.
|
|
7
|
+
*/
|
|
8
|
+
import { TestProviders, renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { cleanup, renderHook } from "@testing-library/react";
|
|
10
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
11
|
+
import { CardGrid } from "./CardGrid";
|
|
12
|
+
import { useImageGridGeometry } from "./ImageGrid";
|
|
13
|
+
|
|
14
|
+
vi.mock("tamagui", async (importOriginal) => ({
|
|
15
|
+
...((await importOriginal()) as Record<string, unknown>),
|
|
16
|
+
useWindowDimensions: () => ({ width: window.innerWidth, height: 900, scale: 1, fontScale: 1 }),
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const initialWidth = window.innerWidth;
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
cleanup();
|
|
22
|
+
window.innerWidth = initialWidth;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const wrapper = TestProviders;
|
|
26
|
+
|
|
27
|
+
function cards(count: number) {
|
|
28
|
+
return Array.from({ length: count }, (_, i) => (
|
|
29
|
+
<div key={i} data-testid={`card-${i}`}>
|
|
30
|
+
Card {i}
|
|
31
|
+
</div>
|
|
32
|
+
));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
describe("ImageGrid geometry for a measured container", () => {
|
|
36
|
+
it("counts columns from the container width, not the window", () => {
|
|
37
|
+
window.innerWidth = 1440;
|
|
38
|
+
const { result } = renderHook(() => useImageGridGeometry({ minTileWidth: 300, width: 632 }), {
|
|
39
|
+
wrapper,
|
|
40
|
+
});
|
|
41
|
+
const { gutter, columns } = result.current;
|
|
42
|
+
expect(columns).toBe(Math.max(1, Math.floor((632 + gutter) / (300 + gutter))));
|
|
43
|
+
expect(columns).toBe(2);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("falls back to the window until the container is measured", () => {
|
|
47
|
+
window.innerWidth = 1440;
|
|
48
|
+
const { result } = renderHook(() => useImageGridGeometry({ minTileWidth: 300 }), { wrapper });
|
|
49
|
+
const { gutter, columns } = result.current;
|
|
50
|
+
expect(columns).toBe(Math.floor((1440 + gutter) / (300 + gutter)));
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe("CardGrid (LC-179)", () => {
|
|
55
|
+
for (const count of [1, 3, 5]) {
|
|
56
|
+
it(`gives ${count} card${count === 1 ? "" : "s"} one track each and keeps an odd last card in column one`, () => {
|
|
57
|
+
window.innerWidth = 500;
|
|
58
|
+
const { container, getByTestId } = renderWithProviders(
|
|
59
|
+
<CardGrid minCardWidth="sm">{cards(count)}</CardGrid>,
|
|
60
|
+
);
|
|
61
|
+
const grid = container.querySelector("[data-card-grid]");
|
|
62
|
+
expect(grid?.getAttribute("data-columns")).toBe("2");
|
|
63
|
+
const rows = container.querySelectorAll("[data-card-grid-row]");
|
|
64
|
+
expect(rows.length).toBe(Math.ceil(count / 2));
|
|
65
|
+
const tracks = container.querySelectorAll("[data-card-grid-cell], [data-card-grid-pad]");
|
|
66
|
+
expect(tracks.length).toBe(rows.length * 2);
|
|
67
|
+
const atoms = new Set([...tracks].map((track) => (track as HTMLElement).className));
|
|
68
|
+
expect(atoms.size).toBe(1);
|
|
69
|
+
for (const row of rows) expect(row.children.length).toBe(2);
|
|
70
|
+
const last = rows[rows.length - 1]!;
|
|
71
|
+
expect(last.children[0]?.contains(getByTestId(`card-${count - 1}`))).toBe(true);
|
|
72
|
+
if (count % 2 === 1) expect(last.children[1]?.hasAttribute("data-card-grid-pad")).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
it("takes a numeric minimum card width as well as a ladder rung", () => {
|
|
77
|
+
window.innerWidth = 1440;
|
|
78
|
+
const { container } = renderWithProviders(<CardGrid minCardWidth={300}>{cards(4)}</CardGrid>);
|
|
79
|
+
const columns = Number(
|
|
80
|
+
container.querySelector("[data-card-grid]")?.getAttribute("data-columns"),
|
|
81
|
+
);
|
|
82
|
+
expect(columns).toBeGreaterThanOrEqual(4);
|
|
83
|
+
expect(container.querySelectorAll("[data-card-grid-cell]").length).toBe(4);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("caps the column count at maxColumns", () => {
|
|
87
|
+
window.innerWidth = 1440;
|
|
88
|
+
const { container } = renderWithProviders(
|
|
89
|
+
<CardGrid minCardWidth="sm" maxColumns={2}>
|
|
90
|
+
{cards(3)}
|
|
91
|
+
</CardGrid>,
|
|
92
|
+
);
|
|
93
|
+
expect(container.querySelector("[data-card-grid]")?.getAttribute("data-columns")).toBe("2");
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Meta } from "@storybook/react-native-web-vite";
|
|
2
|
+
import { YStack } from "tamagui";
|
|
3
|
+
import { Card } from "../Card";
|
|
4
|
+
import { Text } from "../Text";
|
|
5
|
+
import { CardGrid } from "./CardGrid";
|
|
6
|
+
|
|
7
|
+
const nodes = [
|
|
8
|
+
{ name: "ogden-01", role: "Control plane", detail: "8 cores, 32 GB, 4 apps" },
|
|
9
|
+
{ name: "ogden-02", role: "Worker", detail: "16 cores, 64 GB, 11 apps across two sites" },
|
|
10
|
+
{ name: "ogden-03", role: "Storage", detail: "4 cores, 16 GB" },
|
|
11
|
+
{ name: "compose-01", role: "Worker", detail: "8 cores, 32 GB, 6 apps" },
|
|
12
|
+
{ name: "build-01", role: "Runner", detail: "32 cores, 128 GB, CI only" },
|
|
13
|
+
{ name: "edge-01", role: "Ingress", detail: "2 cores, 4 GB" },
|
|
14
|
+
{ name: "edge-02", role: "Ingress", detail: "2 cores, 4 GB, standby" },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const twoColumnFrame = 520;
|
|
18
|
+
|
|
19
|
+
const meta: Meta = {
|
|
20
|
+
title: "Components/CardGrid",
|
|
21
|
+
parameters: {
|
|
22
|
+
status: { type: "stable" },
|
|
23
|
+
docs: {
|
|
24
|
+
description: {
|
|
25
|
+
component:
|
|
26
|
+
"Content cards on LC-179's uniform grid. Columns come from the grid's own measured width, a minimum card width (a tile-size rung or a number) and the theme gap, through the same geometry as ImageGrid. Every cell takes one width at that column count, a row's cards share its height, and an odd last card stays in the first column.",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
|
|
34
|
+
function NodeCard({ node }: { node: (typeof nodes)[number] }) {
|
|
35
|
+
return (
|
|
36
|
+
<Card>
|
|
37
|
+
<Card.Header>{node.name}</Card.Header>
|
|
38
|
+
<Text color="$color11">{node.role}</Text>
|
|
39
|
+
<Text>{node.detail}</Text>
|
|
40
|
+
</Card>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function Grid({ count, frame }: { count: number; frame?: number }) {
|
|
45
|
+
return (
|
|
46
|
+
<YStack padding="$4" width="100%" maxWidth={frame}>
|
|
47
|
+
<CardGrid minCardWidth="sm">
|
|
48
|
+
{nodes.slice(0, count).map((node) => (
|
|
49
|
+
<NodeCard key={node.name} node={node} />
|
|
50
|
+
))}
|
|
51
|
+
</CardGrid>
|
|
52
|
+
</YStack>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const OneCard = {
|
|
57
|
+
render: () => <Grid count={1} frame={twoColumnFrame} />,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const ThreeCards = {
|
|
61
|
+
render: () => <Grid count={3} frame={twoColumnFrame} />,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const FiveCards = {
|
|
65
|
+
render: () => <Grid count={5} frame={twoColumnFrame} />,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const FillsItsContainer = {
|
|
69
|
+
render: () => <Grid count={nodes.length} />,
|
|
70
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type TileSizeRung, tileSizeLadder } from "@multiplatform.one/theme";
|
|
2
|
+
import React, { useCallback, useId, useState } from "react";
|
|
3
|
+
import { View, XStack, YStack, isWeb, type YStackProps } from "tamagui";
|
|
4
|
+
import { tileTrack, useImageGridGeometry } from "./ImageGrid";
|
|
5
|
+
|
|
6
|
+
export interface CardGridProps extends Omit<YStackProps, "children" | "gap"> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
minCardWidth?: TileSizeRung | number;
|
|
9
|
+
maxColumns?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type LayoutEvent = { nativeEvent: { layout: { width: number } } };
|
|
13
|
+
|
|
14
|
+
const stretchCell = isWeb
|
|
15
|
+
? {
|
|
16
|
+
style: {
|
|
17
|
+
display: "grid",
|
|
18
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
19
|
+
justifyItems: "stretch",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
: undefined;
|
|
23
|
+
|
|
24
|
+
export function CardGrid({
|
|
25
|
+
children,
|
|
26
|
+
minCardWidth = "sm",
|
|
27
|
+
maxColumns,
|
|
28
|
+
onLayout,
|
|
29
|
+
...stackProps
|
|
30
|
+
}: CardGridProps) {
|
|
31
|
+
const gridId = useId();
|
|
32
|
+
const [width, setWidth] = useState<number>();
|
|
33
|
+
const minTileWidth =
|
|
34
|
+
typeof minCardWidth === "number" ? minCardWidth : tileSizeLadder[minCardWidth].minWidth;
|
|
35
|
+
const geometry = useImageGridGeometry({ minTileWidth, width });
|
|
36
|
+
const columns = Math.max(1, Math.min(geometry.columns, maxColumns ?? geometry.columns));
|
|
37
|
+
const { gutter } = geometry;
|
|
38
|
+
const handleLayout = useCallback(
|
|
39
|
+
(event: LayoutEvent) => {
|
|
40
|
+
const measured = event.nativeEvent.layout.width;
|
|
41
|
+
if (measured > 0) setWidth((prev) => (prev === measured ? prev : measured));
|
|
42
|
+
(onLayout as ((event: LayoutEvent) => void) | undefined)?.(event);
|
|
43
|
+
},
|
|
44
|
+
[onLayout],
|
|
45
|
+
);
|
|
46
|
+
const cards = React.Children.toArray(children);
|
|
47
|
+
const rowCount = Math.ceil(cards.length / columns);
|
|
48
|
+
return (
|
|
49
|
+
<YStack
|
|
50
|
+
data-card-grid
|
|
51
|
+
data-columns={columns}
|
|
52
|
+
gap={gutter}
|
|
53
|
+
width="100%"
|
|
54
|
+
maxWidth="100%"
|
|
55
|
+
onLayout={handleLayout as YStackProps["onLayout"]}
|
|
56
|
+
{...stackProps}
|
|
57
|
+
>
|
|
58
|
+
{Array.from({ length: rowCount }, (_, row) => {
|
|
59
|
+
const rowCards = cards.slice(row * columns, row * columns + columns);
|
|
60
|
+
return (
|
|
61
|
+
<XStack key={`${gridId}-row-${row}`} data-card-grid-row gap={gutter}>
|
|
62
|
+
{rowCards.map((card, col) => (
|
|
63
|
+
<View
|
|
64
|
+
key={`${gridId}-cell-${row}-${col}`}
|
|
65
|
+
{...tileTrack}
|
|
66
|
+
data-card-grid-cell
|
|
67
|
+
{...stretchCell}
|
|
68
|
+
>
|
|
69
|
+
{card}
|
|
70
|
+
</View>
|
|
71
|
+
))}
|
|
72
|
+
{Array.from({ length: columns - rowCards.length }, (_, pad) => (
|
|
73
|
+
<View
|
|
74
|
+
key={`${gridId}-pad-${row}-${pad}`}
|
|
75
|
+
{...tileTrack}
|
|
76
|
+
data-card-grid-pad
|
|
77
|
+
aria-hidden
|
|
78
|
+
/>
|
|
79
|
+
))}
|
|
80
|
+
</XStack>
|
|
81
|
+
);
|
|
82
|
+
})}
|
|
83
|
+
</YStack>
|
|
84
|
+
);
|
|
85
|
+
}
|
package/src/views/ImageGrid.tsx
CHANGED
|
@@ -143,12 +143,18 @@ export function useImageGridGeometry({
|
|
|
143
143
|
columns,
|
|
144
144
|
tileSize,
|
|
145
145
|
variant = "cards",
|
|
146
|
-
|
|
146
|
+
minTileWidth,
|
|
147
|
+
width,
|
|
148
|
+
}: Pick<ImageGridProps<unknown>, "columns" | "tileSize" | "variant"> & {
|
|
149
|
+
minTileWidth?: number;
|
|
150
|
+
width?: number;
|
|
151
|
+
} = {}): {
|
|
147
152
|
columns: number;
|
|
148
153
|
gutter: number;
|
|
149
154
|
} {
|
|
150
155
|
const { knobProps } = useResolvedKnobs({ component: "ImageGrid" });
|
|
151
156
|
const { width: windowWidth } = useWindowDimensions();
|
|
157
|
+
const span = width ?? windowWidth;
|
|
152
158
|
const gapToken = knobProps.gap.gap;
|
|
153
159
|
const themeGutter =
|
|
154
160
|
typeof gapToken === "number"
|
|
@@ -159,13 +165,15 @@ export function useImageGridGeometry({
|
|
|
159
165
|
gutter,
|
|
160
166
|
columns:
|
|
161
167
|
columns ??
|
|
162
|
-
(
|
|
163
|
-
? tileColumnsForWidth(
|
|
164
|
-
:
|
|
168
|
+
(minTileWidth !== undefined
|
|
169
|
+
? tileColumnsForWidth(span, { minWidth: minTileWidth, maxWidth: Infinity }, gutter)
|
|
170
|
+
: tileSize
|
|
171
|
+
? tileColumnsForWidth(span, tileSizeLadder[tileSize], gutter)
|
|
172
|
+
: columnsBySizeClass[variant][getLayoutSizeClass(span)]),
|
|
165
173
|
};
|
|
166
174
|
}
|
|
167
175
|
|
|
168
|
-
const tileTrack = { flexGrow: 1, flexShrink: 1, flexBasis: 0, minWidth: 0 } as const;
|
|
176
|
+
export const tileTrack = { flexGrow: 1, flexShrink: 1, flexBasis: 0, minWidth: 0 } as const;
|
|
169
177
|
|
|
170
178
|
/**
|
|
171
179
|
* Skeleton twin of the grid (LC-20 / DG-ST-02): aspect-correct muted blocks
|
package/src/views/index.ts
CHANGED
package/types/Chip/index.d.ts
CHANGED
|
@@ -21,7 +21,10 @@ export interface ChipProps {
|
|
|
21
21
|
icon?: ReactNode;
|
|
22
22
|
/** Selected/filter-on. LC-131: the theme's selected recipe on the neutral selection surface. */
|
|
23
23
|
selected?: boolean;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* A colour token shown as a leading square, e.g. `$green9` on a colour
|
|
26
|
+
* choice. A selected chip draws its check there instead: one leading mark.
|
|
27
|
+
*/
|
|
25
28
|
swatch?: ColorTokens;
|
|
26
29
|
/** Press the pill (filter / assist). Makes the pill a keyboard stop. */
|
|
27
30
|
onPress?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Chip/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAkB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKrE,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC3F;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,SAAS;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Chip/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAkB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKrE,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC3F;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,SAAS;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACpB;AAOD,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAyEF,qGAAqG;AACrG,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAEjE;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAWnE;AAkBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM;;;;EAO9C;AAgBD;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;6CAoCpB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;6CAmBnB,CAAC;AASH,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAgExC,wBAAgB,IAAI,CAAC,EACnB,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,IAAI,EACJ,OAAiB,EACjB,KAAc,EACd,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAe,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,GAAG,GACJ,EAAE,SAAS,2CAiQX;AAED,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ColorTokens } from "tamagui";
|
|
2
|
+
export interface ChoiceChipsOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** A colour sample for the option; the selected chip's check takes its place. */
|
|
6
|
+
swatch?: ColorTokens;
|
|
7
|
+
}
|
|
8
|
+
export interface ChoiceChipsProps {
|
|
9
|
+
/** The row's visible label, also the group's accessible name. */
|
|
10
|
+
label: string;
|
|
11
|
+
options: ReadonlyArray<ChoiceChipsOption>;
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A labelled single-choice row of chips (FZ-8440). The chips wrap inside the
|
|
18
|
+
* row's width instead of scrolling past the edge, at the `$2` row pitch the
|
|
19
|
+
* chip's press slop is sized for (K12). Unchosen chips rest outlined so the
|
|
20
|
+
* chosen one stands out by its selection tint alone, the way a checked menu
|
|
21
|
+
* row does (LC-262).
|
|
22
|
+
*/
|
|
23
|
+
export declare function ChoiceChips({ label, options, value, onChange, testID }: ChoiceChipsProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ChoiceChips/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CA6BxF"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type SchemePreference } from "@multiplatform.one/theme";
|
|
2
|
-
import { type ColorTokens } from "tamagui";
|
|
3
2
|
export interface ThemePresetPickerProps {
|
|
4
3
|
rows?: ReadonlyArray<"scheme" | "preset">;
|
|
5
4
|
useUserScheme?: () => SchemePreference;
|
|
6
5
|
/** Signed-in owner; none records this device's signed-out choice. */
|
|
7
6
|
userId?: string | null;
|
|
8
7
|
testID?: string;
|
|
9
|
-
fadeColor?: ColorTokens;
|
|
10
8
|
}
|
|
11
|
-
export declare function ThemePresetPicker({ rows, useUserScheme, userId, testID,
|
|
9
|
+
export declare function ThemePresetPicker({ rows, useUserScheme, userId, testID, }: ThemePresetPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ThemePresetPicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ThemePresetPicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAKlC,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,gBAAgB,CAAC;IACvC,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,iBAAiB,CAAC,EAChC,IAA2B,EAC3B,aAAmC,EACnC,MAAM,EACN,MAA8B,GAC/B,EAAE,sBAAsB,2CA6BxB"}
|