@multiplatform.one/components 7.6.3 → 7.7.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/Accordion/index.native.js +1 -1
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- package/dist/cjs/Alert/index.cjs +13 -29
- package/dist/cjs/Alert/index.native.js +17 -37
- 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.cjs +4 -3
- package/dist/cjs/Badge/index.native.js +7 -6
- package/dist/cjs/Badge/index.native.js.map +1 -1
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Card.cjs +1 -9
- package/dist/cjs/Card.native.js +2 -7
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/CardFooter.cjs +1 -9
- package/dist/cjs/CardFooter.native.js +2 -7
- package/dist/cjs/CardFooter.native.js.map +1 -1
- package/dist/cjs/CardHeader.cjs +1 -9
- package/dist/cjs/CardHeader.native.js +2 -7
- package/dist/cjs/CardHeader.native.js.map +1 -1
- package/dist/cjs/Carousel/index.native.js +1 -1
- package/dist/cjs/Carousel/index.native.js.map +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/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/ErrorBoundary/index.native.js.map +1 -1
- package/dist/cjs/Heading.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/Pagination.native.js +1 -1
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/ProgressSteps/index.cjs +13 -6
- package/dist/cjs/ProgressSteps/index.native.js +14 -6
- package/dist/cjs/ProgressSteps/index.native.js.map +1 -1
- package/dist/cjs/Quote/index.native.js.map +1 -1
- package/dist/cjs/Separator/index.native.js.map +1 -1
- package/dist/cjs/SheetModal/detents.cjs +46 -0
- package/dist/cjs/SheetModal/detents.native.js +54 -0
- package/dist/cjs/SheetModal/detents.native.js.map +1 -0
- package/dist/cjs/SheetModal/index.native.js +8 -11
- package/dist/cjs/SheetModal/index.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.cjs +1 -1
- package/dist/cjs/SortableList/index.native.js +1 -1
- package/dist/cjs/SortableList/index.native.js.map +1 -1
- package/dist/cjs/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.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 +1 -1
- 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.cjs +3 -1
- package/dist/cjs/actions/ActionBar.native.js +11 -2
- package/dist/cjs/actions/ActionBar.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.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/charts/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.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/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.cjs +2 -15
- package/dist/cjs/code/Code/index.native.js +3 -13
- package/dist/cjs/code/Code/index.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.native.js +6 -6
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HighlightedCode/index.cjs +0 -5
- package/dist/cjs/code/HighlightedCode/index.native.js +0 -5
- package/dist/cjs/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.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/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/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/index.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/images/Image/types.native.js.map +1 -1
- package/dist/cjs/images/index.native.js.map +1 -1
- package/dist/cjs/index.native.js +29 -29
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.cjs +8 -0
- package/dist/cjs/knobImmuneExports.native.js +8 -0
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +2 -2
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/Debug/index.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/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/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.native.js +1 -1
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/breadcrumbs.cjs +3 -1
- package/dist/cjs/layouts/breadcrumbs.native.js +3 -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.map +1 -1
- package/dist/cjs/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.native.js +1 -1
- 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.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/t.native.js.map +1 -1
- package/dist/cjs/shared/textRidesText.native.js.map +1 -1
- package/dist/cjs/shared/useKeyboardInset.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.cjs +5 -0
- package/dist/cjs/tamagui.native.js +5 -0
- 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.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +3 -3
- package/dist/cjs/views/Dashboard.native.js +4 -4
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/Gantt.native.js +1 -1
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.native.js +1 -1
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/List.cjs +4 -5
- package/dist/cjs/views/List.native.js +4 -5
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +1 -1
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/TreeView.cjs +4 -1
- package/dist/cjs/views/TreeView.native.js +3 -0
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/calendarMath.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.native.js +1 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/kanbanDnd.native.js.map +1 -1
- package/dist/cjs/views/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/esm/Alert/index.mjs +14 -31
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/Alert/index.native.js +36 -57
- package/dist/esm/Alert/index.native.js.map +1 -1
- package/dist/esm/Badge/index.mjs +4 -3
- package/dist/esm/Badge/index.mjs.map +1 -1
- package/dist/esm/Badge/index.native.js +7 -6
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Card.mjs +3 -11
- package/dist/esm/Card.mjs.map +1 -1
- package/dist/esm/Card.native.js +7 -12
- package/dist/esm/Card.native.js.map +1 -1
- package/dist/esm/CardFooter.mjs +3 -11
- package/dist/esm/CardFooter.mjs.map +1 -1
- package/dist/esm/CardFooter.native.js +6 -11
- package/dist/esm/CardFooter.native.js.map +1 -1
- package/dist/esm/CardHeader.mjs +3 -11
- package/dist/esm/CardHeader.mjs.map +1 -1
- package/dist/esm/CardHeader.native.js +6 -11
- package/dist/esm/CardHeader.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.mjs +14 -7
- package/dist/esm/ProgressSteps/index.mjs.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js +15 -7
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.mjs +19 -0
- package/dist/esm/SheetModal/detents.mjs.map +1 -0
- package/dist/esm/SheetModal/detents.native.js +24 -0
- package/dist/esm/SheetModal/detents.native.js.map +1 -0
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +7 -10
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/SortableList/index.mjs +1 -1
- package/dist/esm/SortableList/index.mjs.map +1 -1
- package/dist/esm/SortableList/index.native.js +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.mjs +6 -4
- package/dist/esm/actions/ActionBar.mjs.map +1 -1
- package/dist/esm/actions/ActionBar.native.js +13 -4
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/code/Code/index.mjs +2 -15
- package/dist/esm/code/Code/index.mjs.map +1 -1
- package/dist/esm/code/Code/index.native.js +6 -16
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.mjs +0 -5
- package/dist/esm/code/HighlightedCode/index.mjs.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js +0 -5
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.mjs +8 -0
- package/dist/esm/knobImmuneExports.mjs.map +1 -1
- package/dist/esm/knobImmuneExports.native.js +8 -0
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.mjs +3 -1
- package/dist/esm/layouts/breadcrumbs.mjs.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js +3 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/tamagui.mjs +3 -2
- package/dist/esm/tamagui.mjs.map +1 -1
- package/dist/esm/tamagui.native.js +3 -2
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +3 -3
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +3 -3
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/List.mjs +4 -5
- package/dist/esm/views/List.mjs.map +1 -1
- package/dist/esm/views/List.native.js +4 -5
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/TreeView.mjs +4 -1
- package/dist/esm/views/TreeView.mjs.map +1 -1
- package/dist/esm/views/TreeView.native.js +3 -0
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/jsx/Alert/index.mjs +14 -31
- package/dist/jsx/Alert/index.mjs.map +1 -1
- package/dist/jsx/Alert/index.native.js +17 -37
- package/dist/jsx/Alert/index.native.js.map +1 -1
- package/dist/jsx/Badge/index.mjs +4 -3
- package/dist/jsx/Badge/index.mjs.map +1 -1
- package/dist/jsx/Badge/index.native.js +7 -6
- package/dist/jsx/Badge/index.native.js.map +1 -1
- package/dist/jsx/Card.mjs +3 -11
- package/dist/jsx/Card.mjs.map +1 -1
- package/dist/jsx/Card.native.js +2 -7
- package/dist/jsx/Card.native.js.map +1 -1
- package/dist/jsx/CardFooter.mjs +3 -11
- package/dist/jsx/CardFooter.mjs.map +1 -1
- package/dist/jsx/CardFooter.native.js +2 -7
- package/dist/jsx/CardFooter.native.js.map +1 -1
- package/dist/jsx/CardHeader.mjs +3 -11
- package/dist/jsx/CardHeader.mjs.map +1 -1
- package/dist/jsx/CardHeader.native.js +2 -7
- package/dist/jsx/CardHeader.native.js.map +1 -1
- package/dist/jsx/ProgressSteps/index.mjs +14 -7
- package/dist/jsx/ProgressSteps/index.mjs.map +1 -1
- package/dist/jsx/ProgressSteps/index.native.js +14 -6
- package/dist/jsx/ProgressSteps/index.native.js.map +1 -1
- package/dist/jsx/SheetModal/detents.mjs +19 -0
- package/dist/jsx/SheetModal/detents.mjs.map +1 -0
- package/dist/jsx/SheetModal/detents.native.js +54 -0
- package/dist/jsx/SheetModal/detents.native.js.map +1 -0
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +8 -11
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/SortableList/index.mjs +1 -1
- package/dist/jsx/SortableList/index.mjs.map +1 -1
- package/dist/jsx/SortableList/index.native.js +1 -1
- package/dist/jsx/SortableList/index.native.js.map +1 -1
- package/dist/jsx/actions/ActionBar.mjs +6 -4
- package/dist/jsx/actions/ActionBar.mjs.map +1 -1
- package/dist/jsx/actions/ActionBar.native.js +11 -2
- package/dist/jsx/actions/ActionBar.native.js.map +1 -1
- package/dist/jsx/code/Code/index.mjs +2 -15
- package/dist/jsx/code/Code/index.mjs.map +1 -1
- package/dist/jsx/code/Code/index.native.js +3 -13
- package/dist/jsx/code/Code/index.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +1 -1
- package/dist/jsx/code/HighlightedCode/index.mjs +0 -5
- package/dist/jsx/code/HighlightedCode/index.mjs.map +1 -1
- package/dist/jsx/code/HighlightedCode/index.native.js +0 -5
- package/dist/jsx/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/jsx/code/index.native.js +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +1 -1
- package/dist/jsx/index.native.js +1 -1
- package/dist/jsx/knobImmuneExports.mjs +8 -0
- package/dist/jsx/knobImmuneExports.mjs.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js +8 -0
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.mjs +3 -1
- package/dist/jsx/layouts/breadcrumbs.mjs.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.native.js +3 -1
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/tamagui.mjs +3 -2
- package/dist/jsx/tamagui.mjs.map +1 -1
- package/dist/jsx/tamagui.native.js +5 -0
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +3 -3
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +3 -3
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/List.mjs +4 -5
- package/dist/jsx/views/List.mjs.map +1 -1
- package/dist/jsx/views/List.native.js +4 -5
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/TreeView.mjs +4 -1
- package/dist/jsx/views/TreeView.mjs.map +1 -1
- package/dist/jsx/views/TreeView.native.js +3 -0
- package/dist/jsx/views/TreeView.native.js.map +1 -1
- package/package.json +9 -9
- package/src/Alert/index.tsx +9 -4
- package/src/AnimateHeight/AnimateHeight.stories.spec.tsx +37 -0
- package/src/AnimateHeight/AnimateHeight.stories.tsx +95 -0
- package/src/Avatar/Avatar.spec.tsx +4 -1
- package/src/Badge/Badge.spec.tsx +10 -11
- package/src/Badge/index.tsx +7 -6
- package/src/Button.spec.tsx +26 -15
- package/src/Card.tsx +8 -3
- package/src/CardFooter.spec.tsx +1 -1
- package/src/CardFooter.tsx +6 -3
- package/src/CardHeader.spec.tsx +1 -1
- package/src/CardHeader.tsx +6 -3
- package/src/Chip/Chip.spec.tsx +1 -1
- package/src/Pagination.spec.tsx +1 -1
- package/src/ProgressSteps/ProgressSteps.spec.tsx +29 -2
- package/src/ProgressSteps/index.tsx +21 -7
- package/src/SheetModal/SheetModal.spec.tsx +88 -0
- package/src/SheetModal/SheetModal.stories.spec.tsx +54 -0
- package/src/SheetModal/SheetModal.stories.tsx +109 -0
- package/src/SheetModal/detents.ts +55 -0
- package/src/SheetModal/index.native.tsx +13 -12
- package/src/SheetModal/index.tsx +5 -2
- package/src/Skeleton/Skeleton.spec.tsx +1 -1
- package/src/SortableList/SortableList.spec.tsx +41 -0
- package/src/SortableList/SortableList.stories.tsx +35 -2
- package/src/SortableList/index.tsx +1 -1
- package/src/TreeSelect/TreeSelect.stories.tsx +76 -1
- package/src/Wheel/Wheel.spec.tsx +1 -1
- package/src/actions/ActionBar.stories.spec.tsx +45 -0
- package/src/actions/ActionBar.stories.tsx +161 -0
- package/src/actions/ActionBar.tsx +8 -1
- package/src/charts/Axis.stories.spec.tsx +86 -0
- package/src/charts/Axis.stories.tsx +186 -0
- package/src/charts/ChartSurface.stories.spec.tsx +43 -0
- package/src/charts/ChartSurface.stories.tsx +148 -0
- package/src/code/Code/code.spec.tsx +27 -1
- package/src/code/Code/index.tsx +9 -2
- package/src/code/HighlightedCode/index.tsx +0 -1
- package/src/code/highlightedCode.spec.tsx +10 -1
- package/src/knobImmuneExports.ts +11 -0
- package/src/layouts/AsyncBoundary.spec.tsx +1 -1
- package/src/layouts/breadcrumbs.spec.tsx +17 -0
- package/src/layouts/breadcrumbs.tsx +19 -2
- package/src/layouts/tags.r7.spec.tsx +3 -1
- package/src/tamagui.ts +8 -0
- package/src/views/Dashboard.tsx +3 -3
- package/src/views/List.spec.tsx +42 -1
- package/src/views/List.tsx +6 -5
- package/src/views/TreeView.spec.tsx +26 -0
- package/src/views/TreeView.tsx +3 -0
- package/types/Alert/index.d.ts.map +1 -1
- package/types/Badge/index.d.ts.map +1 -1
- package/types/Card.d.ts.map +1 -1
- package/types/CardFooter.d.ts.map +1 -1
- package/types/CardHeader.d.ts.map +1 -1
- package/types/ProgressSteps/index.d.ts.map +1 -1
- package/types/SheetModal/detents.d.ts +38 -0
- package/types/SheetModal/detents.d.ts.map +1 -0
- package/types/SheetModal/index.d.ts +1 -1
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/actions/ActionBar.d.ts.map +1 -1
- package/types/code/Code/index.d.ts.map +1 -1
- package/types/code/HighlightedCode/index.d.ts.map +1 -1
- package/types/knobImmuneExports.d.ts.map +1 -1
- package/types/layouts/breadcrumbs.d.ts +7 -1
- package/types/layouts/breadcrumbs.d.ts.map +1 -1
- package/types/tamagui.d.ts +3 -1
- package/types/tamagui.d.ts.map +1 -1
- package/types/views/List.d.ts.map +1 -1
- package/types/views/TreeView.d.ts.map +1 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { fireEvent } from "@testing-library/react";
|
|
2
2
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
3
6
|
import { useState } from "react";
|
|
4
7
|
import { describe, expect, it, vi } from "vitest";
|
|
5
8
|
import { SortableList } from "./index";
|
|
6
9
|
|
|
10
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
|
|
7
12
|
const ITEMS = [
|
|
8
13
|
{ id: "mon", label: "Monday standup" },
|
|
9
14
|
{ id: "tue", label: "Tuesday review" },
|
|
@@ -14,10 +19,14 @@ const ITEMS = [
|
|
|
14
19
|
function Harness({
|
|
15
20
|
onChange = vi.fn(),
|
|
16
21
|
readOnly,
|
|
22
|
+
disabled,
|
|
23
|
+
compact,
|
|
17
24
|
canReorder,
|
|
18
25
|
}: {
|
|
19
26
|
onChange?: (next: typeof ITEMS) => void;
|
|
20
27
|
readOnly?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
compact?: boolean;
|
|
21
30
|
canReorder?: (item: (typeof ITEMS)[number], index: number) => boolean;
|
|
22
31
|
}) {
|
|
23
32
|
const [items, setItems] = useState(ITEMS);
|
|
@@ -28,6 +37,8 @@ function Harness({
|
|
|
28
37
|
getLabel={(item) => item.label}
|
|
29
38
|
canReorder={canReorder}
|
|
30
39
|
readOnly={readOnly}
|
|
40
|
+
disabled={disabled}
|
|
41
|
+
compact={compact}
|
|
31
42
|
onChange={(next) => {
|
|
32
43
|
setItems(next);
|
|
33
44
|
onChange(next);
|
|
@@ -119,4 +130,34 @@ describe("SortableList", () => {
|
|
|
119
130
|
const { container } = renderWithProviders(<Harness readOnly />);
|
|
120
131
|
expect(container.querySelectorAll("[data-sortable-handle]")).toHaveLength(0);
|
|
121
132
|
});
|
|
133
|
+
|
|
134
|
+
it("renders no handles when disabled (board 04)", () => {
|
|
135
|
+
const { container } = renderWithProviders(<Harness disabled />);
|
|
136
|
+
expect(container.querySelectorAll("[data-sortable-handle]")).toHaveLength(0);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("renders emptyMessage when there are no rows (board 04)", () => {
|
|
140
|
+
const { container } = renderWithProviders(
|
|
141
|
+
<SortableList
|
|
142
|
+
items={[]}
|
|
143
|
+
getId={(item: { id: string }) => item.id}
|
|
144
|
+
getLabel={(item: { label: string }) => item.label}
|
|
145
|
+
emptyMessage="No rows yet"
|
|
146
|
+
/>,
|
|
147
|
+
);
|
|
148
|
+
expect(container.textContent).toContain("No rows yet");
|
|
149
|
+
expect(container.querySelectorAll("[data-sortable-row]")).toHaveLength(0);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it("compact still renders grab handles (LC-76: density does not drop controls)", () => {
|
|
153
|
+
const { container } = renderWithProviders(<Harness compact />);
|
|
154
|
+
expect(container.querySelectorAll("[data-sortable-handle]")).toHaveLength(4);
|
|
155
|
+
expect(container.querySelector('[role="list"]')).toBeTruthy();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("spreads the outer radius fragment on the list frame, not the nested alias", () => {
|
|
159
|
+
const src = readFileSync(join(here, "index.tsx"), "utf8");
|
|
160
|
+
expect(src).toContain("{...knobProps.borderRadius}");
|
|
161
|
+
expect(src).not.toContain("knobProps.borderRadiusOuter");
|
|
162
|
+
});
|
|
122
163
|
});
|
|
@@ -21,13 +21,27 @@ const meta: Meta<typeof SortableList> = {
|
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
+
argTypes: {
|
|
25
|
+
disabled: { control: "boolean" },
|
|
26
|
+
readOnly: { control: "boolean" },
|
|
27
|
+
compact: { control: "boolean" },
|
|
28
|
+
disabledStyle: { control: "select", options: ["keepLabel", "dimWhole"] },
|
|
29
|
+
emptyMessage: { control: "text" },
|
|
30
|
+
},
|
|
24
31
|
};
|
|
25
32
|
export default meta;
|
|
26
33
|
|
|
27
34
|
type Story = StoryObj<typeof SortableList>;
|
|
28
35
|
|
|
29
|
-
function Demo(props: {
|
|
30
|
-
|
|
36
|
+
function Demo(props: {
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
locked?: string;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
compact?: boolean;
|
|
41
|
+
empty?: boolean;
|
|
42
|
+
disabledStyle?: "keepLabel" | "dimWhole";
|
|
43
|
+
}) {
|
|
44
|
+
const [items, setItems] = useState(props.empty ? [] : SEED);
|
|
31
45
|
return (
|
|
32
46
|
<SortableList
|
|
33
47
|
items={items}
|
|
@@ -35,6 +49,10 @@ function Demo(props: { readOnly?: boolean; locked?: string }) {
|
|
|
35
49
|
getLabel={(item) => item.label}
|
|
36
50
|
canReorder={props.locked ? (item) => item.id !== props.locked : undefined}
|
|
37
51
|
readOnly={props.readOnly}
|
|
52
|
+
disabled={props.disabled}
|
|
53
|
+
compact={props.compact}
|
|
54
|
+
disabledStyle={props.disabledStyle}
|
|
55
|
+
emptyMessage="No rows yet"
|
|
38
56
|
onChange={setItems}
|
|
39
57
|
aria-label="Sprint rituals"
|
|
40
58
|
/>
|
|
@@ -53,3 +71,18 @@ export const ReadOnly: Story = {
|
|
|
53
71
|
export const LockedRow: Story = {
|
|
54
72
|
render: () => <Demo locked="tue" />,
|
|
55
73
|
};
|
|
74
|
+
|
|
75
|
+
/** Board 04 — empty is a real state, not an error. */
|
|
76
|
+
export const Empty: Story = {
|
|
77
|
+
render: () => <Demo empty />,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** Board 04 — disabled list keeps labels, drops the handles. */
|
|
81
|
+
export const Disabled: Story = {
|
|
82
|
+
render: () => <Demo disabled />,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** Board 04 — compact nested well. */
|
|
86
|
+
export const Compact: Story = {
|
|
87
|
+
render: () => <Demo compact />,
|
|
88
|
+
};
|
|
@@ -47,7 +47,7 @@ export default meta;
|
|
|
47
47
|
|
|
48
48
|
type Story = StoryObj<typeof TreeSelect>;
|
|
49
49
|
|
|
50
|
-
export const
|
|
50
|
+
export const Default: Story = {
|
|
51
51
|
render: function Render() {
|
|
52
52
|
const [value, setValue] = useState("hdfc");
|
|
53
53
|
return (
|
|
@@ -67,6 +67,31 @@ export const Account: Story = {
|
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
export const Open: Story = {
|
|
71
|
+
render: function Render() {
|
|
72
|
+
const [value, setValue] = useState("hdfc");
|
|
73
|
+
const [open, setOpen] = useState(true);
|
|
74
|
+
return (
|
|
75
|
+
<YStack width={280} padding="$4">
|
|
76
|
+
<TreeSelect
|
|
77
|
+
label="Account"
|
|
78
|
+
nodes={accounts}
|
|
79
|
+
value={value}
|
|
80
|
+
onChange={setValue}
|
|
81
|
+
open={open}
|
|
82
|
+
onOpenChange={setOpen}
|
|
83
|
+
placeholder="Select account"
|
|
84
|
+
searchPlaceholder="Filter accounts"
|
|
85
|
+
emptyMessage="No matching accounts"
|
|
86
|
+
defaultExpandedIds={["assets", "current", "bank"]}
|
|
87
|
+
/>
|
|
88
|
+
</YStack>
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const Account: Story = Default;
|
|
94
|
+
|
|
70
95
|
export const Empty: Story = {
|
|
71
96
|
render: () => (
|
|
72
97
|
<YStack width={280} padding="$4">
|
|
@@ -74,3 +99,53 @@ export const Empty: Story = {
|
|
|
74
99
|
</YStack>
|
|
75
100
|
),
|
|
76
101
|
};
|
|
102
|
+
|
|
103
|
+
export const Disabled: Story = {
|
|
104
|
+
render: () => (
|
|
105
|
+
<YStack width={280} padding="$4">
|
|
106
|
+
<TreeSelect
|
|
107
|
+
label="Account"
|
|
108
|
+
nodes={accounts}
|
|
109
|
+
value="hdfc"
|
|
110
|
+
disabled
|
|
111
|
+
placeholder="Select account"
|
|
112
|
+
/>
|
|
113
|
+
</YStack>
|
|
114
|
+
),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const WithError: Story = {
|
|
118
|
+
render: () => (
|
|
119
|
+
<YStack width={280} padding="$4">
|
|
120
|
+
<TreeSelect
|
|
121
|
+
label="Account"
|
|
122
|
+
nodes={accounts}
|
|
123
|
+
required
|
|
124
|
+
error="An account is required"
|
|
125
|
+
placeholder="Select account"
|
|
126
|
+
/>
|
|
127
|
+
</YStack>
|
|
128
|
+
),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const ReadOnly: Story = {
|
|
132
|
+
render: () => (
|
|
133
|
+
<YStack width={280} padding="$4">
|
|
134
|
+
<TreeSelect
|
|
135
|
+
label="Account"
|
|
136
|
+
nodes={accounts}
|
|
137
|
+
value="hdfc"
|
|
138
|
+
readOnly
|
|
139
|
+
placeholder="Select account"
|
|
140
|
+
/>
|
|
141
|
+
</YStack>
|
|
142
|
+
),
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const Skeleton: Story = {
|
|
146
|
+
render: () => (
|
|
147
|
+
<YStack width={280} padding="$4">
|
|
148
|
+
<TreeSelect label="Account" nodes={accounts} skeleton placeholder="Select account" />
|
|
149
|
+
</YStack>
|
|
150
|
+
),
|
|
151
|
+
};
|
package/src/Wheel/Wheel.spec.tsx
CHANGED
|
@@ -272,7 +272,7 @@ describe("Wheel design-law (MPO-60)", () => {
|
|
|
272
272
|
it("exposes named exports and no default", async () => {
|
|
273
273
|
const mod = await import("./index");
|
|
274
274
|
expect(mod.Wheel).toBe(Wheel);
|
|
275
|
-
expect(mod
|
|
275
|
+
expect("default" in mod).toBe(false);
|
|
276
276
|
});
|
|
277
277
|
|
|
278
278
|
it("selected row type stays on body weight 400, never 600 (R7 / design-audit)", () => {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionBar was rendered inside DestructiveAction.stories but had no title of
|
|
3
|
+
* its own, so the gallery never listed it (MPO-193). These mount every
|
|
4
|
+
* exported story so an unrenderable one fails here, not in the Kitchen Sink.
|
|
5
|
+
*/
|
|
6
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
7
|
+
import { cleanup, screen } from "@testing-library/react";
|
|
8
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
9
|
+
import meta, { Alignments, CancelNeverDisabled, Default, WithSecondary } from "./ActionBar.stories";
|
|
10
|
+
|
|
11
|
+
afterEach(cleanup);
|
|
12
|
+
|
|
13
|
+
describe("ActionBar stories", () => {
|
|
14
|
+
it("declares the Components/ActionBar title against the component", () => {
|
|
15
|
+
expect(meta.title).toBe("Components/ActionBar");
|
|
16
|
+
expect(meta.component).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("Main renders the cancel and primary slots", () => {
|
|
20
|
+
renderWithProviders(
|
|
21
|
+
<>{Default.render?.(Default.args as never, { args: Default.args } as never)}</>,
|
|
22
|
+
);
|
|
23
|
+
expect(screen.getByText("Cancel")).toBeTruthy();
|
|
24
|
+
expect(screen.getByText("Save changes")).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("Cancel + secondary + primary renders every slot", () => {
|
|
28
|
+
renderWithProviders(<>{WithSecondary.render?.({} as never, {} as never)}</>);
|
|
29
|
+
expect(screen.getByText("Cancel")).toBeTruthy();
|
|
30
|
+
expect(screen.getByText("Save draft")).toBeTruthy();
|
|
31
|
+
expect(screen.getByText("Preview")).toBeTruthy();
|
|
32
|
+
expect(screen.getByText("Publish")).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("Alignments renders one bar per align value", () => {
|
|
36
|
+
renderWithProviders(<>{Alignments.render?.({} as never, {} as never)}</>);
|
|
37
|
+
expect(screen.getAllByText("Confirm")).toHaveLength(3);
|
|
38
|
+
expect(screen.getByText('align="between"')).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("the cancel-disabled story still paints a reachable cancel", () => {
|
|
42
|
+
renderWithProviders(<>{CancelNeverDisabled.render?.({} as never, {} as never)}</>);
|
|
43
|
+
expect(screen.getByText("Cancel")).toBeTruthy();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Button } from "@multiplatform.one/forms";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Paragraph, YStack } from "tamagui";
|
|
5
|
+
import { Card } from "../surfaces";
|
|
6
|
+
import { ActionBar, type ActionBarProps } from "./ActionBar";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Presses land in the story itself rather than the Actions panel: the panel's
|
|
10
|
+
* `action()` pulls the Storybook preview runtime into the module graph, which
|
|
11
|
+
* the package's own vitest run cannot load, and the colocated spec mounts
|
|
12
|
+
* these stories for real.
|
|
13
|
+
*/
|
|
14
|
+
function useLastPressed() {
|
|
15
|
+
const [last, setLast] = useState<string | null>(null);
|
|
16
|
+
return {
|
|
17
|
+
last,
|
|
18
|
+
press: (label: string) => () => setLast(label),
|
|
19
|
+
readout: (
|
|
20
|
+
<Paragraph size="$2" color="$color11">
|
|
21
|
+
{last === null ? "No action pressed yet." : `Last pressed: ${last}`}
|
|
22
|
+
</Paragraph>
|
|
23
|
+
),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const meta: Meta<typeof ActionBar> = {
|
|
28
|
+
title: "Components/ActionBar",
|
|
29
|
+
component: ActionBar,
|
|
30
|
+
parameters: {
|
|
31
|
+
status: { type: "beta" },
|
|
32
|
+
docs: {
|
|
33
|
+
description: {
|
|
34
|
+
component:
|
|
35
|
+
"The action row. Slots (`primary`, `secondary`, `cancel`) keep the primary singular by construction and order the row cancel → secondary → primary, so the trailing default lands under the thumb. `align` picks the justification: `end` for dialogs and toolbars, `start` for page-level forms. DG-ACT-05 strips `disabled` off the cancel slot and DEV-warns; DG-ACT-01 DEV-warns on a second primary, including one composed into free children; DG-OVL-04 DEV-warns past two actions inside a dialog region unless `allowManyActions` ejects.",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
argTypes: {
|
|
40
|
+
align: { control: "radio", options: ["start", "end", "between"] },
|
|
41
|
+
allowManyActions: { control: "boolean" },
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
|
|
46
|
+
type Story = StoryObj<typeof ActionBar>;
|
|
47
|
+
|
|
48
|
+
function Basic(args: Partial<ActionBarProps>) {
|
|
49
|
+
const { press, readout } = useLastPressed();
|
|
50
|
+
return (
|
|
51
|
+
<Card maxWidth={480}>
|
|
52
|
+
<YStack gap="$3">
|
|
53
|
+
{readout}
|
|
54
|
+
<ActionBar
|
|
55
|
+
{...args}
|
|
56
|
+
cancel={
|
|
57
|
+
<Button chromeless onPress={press("Cancel")}>
|
|
58
|
+
Cancel
|
|
59
|
+
</Button>
|
|
60
|
+
}
|
|
61
|
+
primary={
|
|
62
|
+
<Button accent onPress={press("Save changes")}>
|
|
63
|
+
Save changes
|
|
64
|
+
</Button>
|
|
65
|
+
}
|
|
66
|
+
/>
|
|
67
|
+
</YStack>
|
|
68
|
+
</Card>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function FullRow() {
|
|
73
|
+
const { press, readout } = useLastPressed();
|
|
74
|
+
return (
|
|
75
|
+
<Card maxWidth={520}>
|
|
76
|
+
<YStack gap="$3">
|
|
77
|
+
{readout}
|
|
78
|
+
<ActionBar
|
|
79
|
+
cancel={
|
|
80
|
+
<Button chromeless onPress={press("Cancel")}>
|
|
81
|
+
Cancel
|
|
82
|
+
</Button>
|
|
83
|
+
}
|
|
84
|
+
secondary={[
|
|
85
|
+
<Button key="draft" onPress={press("Save draft")}>
|
|
86
|
+
Save draft
|
|
87
|
+
</Button>,
|
|
88
|
+
<Button key="preview" onPress={press("Preview")}>
|
|
89
|
+
Preview
|
|
90
|
+
</Button>,
|
|
91
|
+
]}
|
|
92
|
+
primary={
|
|
93
|
+
<Button accent onPress={press("Publish")}>
|
|
94
|
+
Publish
|
|
95
|
+
</Button>
|
|
96
|
+
}
|
|
97
|
+
/>
|
|
98
|
+
</YStack>
|
|
99
|
+
</Card>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const Default: Story = {
|
|
104
|
+
name: "Main",
|
|
105
|
+
args: { align: "end" },
|
|
106
|
+
render: (args) => <Basic {...args} />,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const WithSecondary: Story = {
|
|
110
|
+
name: "Cancel + secondary + primary",
|
|
111
|
+
render: () => <FullRow />,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const Alignments: Story = {
|
|
115
|
+
render: () => (
|
|
116
|
+
<YStack gap="$4" maxWidth={520}>
|
|
117
|
+
{(["start", "end", "between"] as const).map((align) => (
|
|
118
|
+
<Card key={align}>
|
|
119
|
+
<YStack gap="$2">
|
|
120
|
+
<Paragraph size="$2">{`align="${align}"`}</Paragraph>
|
|
121
|
+
<ActionBar
|
|
122
|
+
align={align}
|
|
123
|
+
cancel={<Button chromeless>Cancel</Button>}
|
|
124
|
+
primary={<Button accent>Confirm</Button>}
|
|
125
|
+
/>
|
|
126
|
+
</YStack>
|
|
127
|
+
</Card>
|
|
128
|
+
))}
|
|
129
|
+
</YStack>
|
|
130
|
+
),
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const CancelNeverDisabled: Story = {
|
|
134
|
+
name: "Cancel is never disabled",
|
|
135
|
+
parameters: {
|
|
136
|
+
docs: {
|
|
137
|
+
description: {
|
|
138
|
+
story:
|
|
139
|
+
"DG-ACT-05: the cancel slot is handed `disabled`, the prop is stripped, and DEV logs `[actions] cancel-disabled`. A dismissal a user cannot reach is a trap, so the escape hatch stays live even while the primary is blocked. Open the console to see the warn.",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
render: () => {
|
|
144
|
+
return (
|
|
145
|
+
<Card maxWidth={480}>
|
|
146
|
+
<ActionBar
|
|
147
|
+
cancel={
|
|
148
|
+
<Button chromeless disabled>
|
|
149
|
+
Cancel
|
|
150
|
+
</Button>
|
|
151
|
+
}
|
|
152
|
+
primary={
|
|
153
|
+
<Button accent disabled>
|
|
154
|
+
Save changes
|
|
155
|
+
</Button>
|
|
156
|
+
}
|
|
157
|
+
/>
|
|
158
|
+
</Card>
|
|
159
|
+
);
|
|
160
|
+
},
|
|
161
|
+
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
Children,
|
|
13
|
+
Fragment,
|
|
13
14
|
cloneElement,
|
|
14
15
|
isValidElement,
|
|
15
16
|
useEffect,
|
|
@@ -194,10 +195,16 @@ export function ActionBar({
|
|
|
194
195
|
width="100%"
|
|
195
196
|
{...stackProps}
|
|
196
197
|
>
|
|
198
|
+
{/* `secondaryItems` is a plain array (asArray), so rendering it bare made
|
|
199
|
+
React warn "Each child in a list should have a unique key" and name
|
|
200
|
+
the CALLER — the screen that passed a single element into the slot —
|
|
201
|
+
instead of this file. Key it here, where the array is built. */}
|
|
197
202
|
{hasSlots ? (
|
|
198
203
|
<>
|
|
199
204
|
{cancelItems}
|
|
200
|
-
{secondaryItems
|
|
205
|
+
{secondaryItems.map((node, index) => (
|
|
206
|
+
<Fragment key={`mp-action-secondary-${index}`}>{node}</Fragment>
|
|
207
|
+
))}
|
|
201
208
|
{primary}
|
|
202
209
|
</>
|
|
203
210
|
) : null}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XAxis and YAxis are exported from the charts barrel but had no title of
|
|
3
|
+
* their own — only the composed charts had stories (MPO-193). happy-dom runs
|
|
4
|
+
* no layout, so a measured ChartSurface stays at width 0 and draws nothing;
|
|
5
|
+
* these specs render the same axis frame at an explicit pixel size so the
|
|
6
|
+
* marks the stories show are actually asserted.
|
|
7
|
+
*/
|
|
8
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { cleanup, screen } from "@testing-library/react";
|
|
10
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
11
|
+
import { ChartSurface } from "./ChartSurface";
|
|
12
|
+
import { XAxis, YAxis } from "./Axis";
|
|
13
|
+
import { computeCartesianPlot } from "./composeChart";
|
|
14
|
+
import { createBandScale, createLinearScale } from "./math";
|
|
15
|
+
import meta, { AxisLineAndTicks, Default, LabelTruncation, WideValueRange } from "./Axis.stories";
|
|
16
|
+
|
|
17
|
+
afterEach(cleanup);
|
|
18
|
+
|
|
19
|
+
const categories = ["Mon", "Tue", "Wed", "Thu", "Fri"];
|
|
20
|
+
|
|
21
|
+
function Frame({ showGrid = true }: { showGrid?: boolean }) {
|
|
22
|
+
return (
|
|
23
|
+
<ChartSurface label="Axis frame" width={400} height={200}>
|
|
24
|
+
{(size) => {
|
|
25
|
+
const plot = computeCartesianPlot(size, {
|
|
26
|
+
showXAxis: true,
|
|
27
|
+
showYAxis: true,
|
|
28
|
+
yTickLabels: ["0", "25", "50", "75", "100"],
|
|
29
|
+
fontSize: 12,
|
|
30
|
+
});
|
|
31
|
+
const xScale = createBandScale({
|
|
32
|
+
domain: categories,
|
|
33
|
+
range: [plot.x, plot.x + plot.width],
|
|
34
|
+
});
|
|
35
|
+
const yScale = createLinearScale({
|
|
36
|
+
domain: [0, 100],
|
|
37
|
+
range: [plot.y + plot.height, plot.y],
|
|
38
|
+
});
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<YAxis plot={plot} scale={yScale} ticks={4} showGrid={showGrid} />
|
|
42
|
+
<XAxis plot={plot} scale={xScale} />
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
}}
|
|
46
|
+
</ChartSurface>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
describe("Axis stories", () => {
|
|
51
|
+
it("declares the Components/Axis title against the component", () => {
|
|
52
|
+
expect(meta.title).toBe("Components/Axis");
|
|
53
|
+
expect(meta.component).toBeDefined();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("every exported story mounts", () => {
|
|
57
|
+
for (const story of [Default, AxisLineAndTicks, LabelTruncation, WideValueRange]) {
|
|
58
|
+
renderWithProviders(<>{story.render?.({} as never, {} as never)}</>);
|
|
59
|
+
cleanup();
|
|
60
|
+
}
|
|
61
|
+
expect(true).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("Long labels truncate renders both container widths", () => {
|
|
65
|
+
renderWithProviders(<>{LabelTruncation.render?.({} as never, {} as never)}</>);
|
|
66
|
+
expect(screen.getByText("520px container")).toBeTruthy();
|
|
67
|
+
expect(screen.getByText("280px container")).toBeTruthy();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("draws one x label per category and the y grid lines at a fixed size", () => {
|
|
71
|
+
const { container } = renderWithProviders(<Frame />);
|
|
72
|
+
const labels = Array.from(container.querySelectorAll("text")).map((node) => node.textContent);
|
|
73
|
+
for (const category of categories) expect(labels).toContain(category);
|
|
74
|
+
// 4-tick hint, plus the x baseline and one tick mark per category.
|
|
75
|
+
expect(container.querySelectorAll("line").length).toBeGreaterThan(categories.length);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("showGrid=false drops the horizontal rules", () => {
|
|
79
|
+
const withGrid = renderWithProviders(<Frame />).container.querySelectorAll("line").length;
|
|
80
|
+
cleanup();
|
|
81
|
+
const withoutGrid = renderWithProviders(<Frame showGrid={false} />).container.querySelectorAll(
|
|
82
|
+
"line",
|
|
83
|
+
).length;
|
|
84
|
+
expect(withoutGrid).toBeLessThan(withGrid);
|
|
85
|
+
});
|
|
86
|
+
});
|