@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
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
+
import { Paragraph, YStack } from "tamagui";
|
|
3
|
+
import { Card } from "../surfaces";
|
|
4
|
+
import { XAxis, YAxis } from "./Axis";
|
|
5
|
+
import { ChartSurface } from "./ChartSurface";
|
|
6
|
+
import { computeCartesianPlot } from "./composeChart";
|
|
7
|
+
import { createBandScale, createLinearScale, formatAxisTick, getLinearTicks } from "./math";
|
|
8
|
+
import type { ChartSize } from "./types";
|
|
9
|
+
import { useChartTheme } from "./useChartTheme";
|
|
10
|
+
|
|
11
|
+
const weekdays = ["Mon", "Tue", "Wed", "Thu", "Fri"];
|
|
12
|
+
const longLabels = [
|
|
13
|
+
"Engineering",
|
|
14
|
+
"Customer Success",
|
|
15
|
+
"Finance and Legal",
|
|
16
|
+
"People Operations",
|
|
17
|
+
"Infrastructure",
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
interface AxisFrameProps {
|
|
21
|
+
size: ChartSize;
|
|
22
|
+
categories: string[];
|
|
23
|
+
domain: [number, number];
|
|
24
|
+
showXLabels?: boolean;
|
|
25
|
+
showYGrid?: boolean;
|
|
26
|
+
showYLine?: boolean;
|
|
27
|
+
showYTicks?: boolean;
|
|
28
|
+
yTicks?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Both axes drawn against a real plot rectangle. The left margin is derived
|
|
33
|
+
* from the widest y tick LABEL (computeCartesianPlot), not a magic number, so
|
|
34
|
+
* the axis never clips its own text.
|
|
35
|
+
*/
|
|
36
|
+
function AxisFrame({
|
|
37
|
+
size,
|
|
38
|
+
categories,
|
|
39
|
+
domain,
|
|
40
|
+
showXLabels = true,
|
|
41
|
+
showYGrid = true,
|
|
42
|
+
showYLine = false,
|
|
43
|
+
showYTicks = false,
|
|
44
|
+
yTicks = 4,
|
|
45
|
+
}: AxisFrameProps) {
|
|
46
|
+
const { labelFontSize } = useChartTheme();
|
|
47
|
+
const marginScale = createLinearScale({ domain, range: [0, 1] });
|
|
48
|
+
const tickValues = getLinearTicks(marginScale, yTicks);
|
|
49
|
+
const plot = computeCartesianPlot(size, {
|
|
50
|
+
showXAxis: true,
|
|
51
|
+
showYAxis: true,
|
|
52
|
+
yTickLabels: tickValues.map((value) => formatAxisTick(value)),
|
|
53
|
+
fontSize: labelFontSize,
|
|
54
|
+
});
|
|
55
|
+
if (plot.width <= 0 || plot.height <= 0) return null;
|
|
56
|
+
const xScale = createBandScale({
|
|
57
|
+
domain: categories,
|
|
58
|
+
range: [plot.x, plot.x + plot.width],
|
|
59
|
+
});
|
|
60
|
+
const yScale = createLinearScale({
|
|
61
|
+
domain,
|
|
62
|
+
range: [plot.y + plot.height, plot.y],
|
|
63
|
+
});
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<YAxis
|
|
67
|
+
plot={plot}
|
|
68
|
+
scale={yScale}
|
|
69
|
+
ticks={yTicks}
|
|
70
|
+
showGrid={showYGrid}
|
|
71
|
+
showLine={showYLine}
|
|
72
|
+
showTicks={showYTicks}
|
|
73
|
+
/>
|
|
74
|
+
<XAxis plot={plot} scale={xScale} showLabels={showXLabels} />
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const meta: Meta<typeof XAxis> = {
|
|
80
|
+
title: "Components/Axis",
|
|
81
|
+
component: XAxis,
|
|
82
|
+
parameters: {
|
|
83
|
+
status: { type: "beta" },
|
|
84
|
+
docs: {
|
|
85
|
+
description: {
|
|
86
|
+
component:
|
|
87
|
+
"The two axis primitives the cartesian charts compose. `XAxis` is categorical: a baseline, tick marks, and a label centred under each band or point, truncated with an ellipsis once it is wider than its step so nothing overflows the surface (LC-10). `YAxis` is continuous: nice d3 ticks, right-aligned labels in the left margin, and horizontal grid lines on by default with the axis line off, because the grid already carries the edge. All chrome resolves through `useChartTheme` — axis lines take the border role, grid the divider role, labels the muted text role at the AA floor. Tick numbers ride the charts package's own density register, the declared exemption to the house number channel.",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
export default meta;
|
|
93
|
+
|
|
94
|
+
type Story = StoryObj<typeof XAxis>;
|
|
95
|
+
|
|
96
|
+
export const Default: Story = {
|
|
97
|
+
name: "Main",
|
|
98
|
+
render: () => (
|
|
99
|
+
<YStack maxWidth={560}>
|
|
100
|
+
<Card>
|
|
101
|
+
<ChartSurface label="Empty axis frame, weekdays across a 0 to 100 value axis." height={220}>
|
|
102
|
+
{(size) => <AxisFrame size={size} categories={weekdays} domain={[0, 100]} />}
|
|
103
|
+
</ChartSurface>
|
|
104
|
+
</Card>
|
|
105
|
+
</YStack>
|
|
106
|
+
),
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const AxisLineAndTicks: Story = {
|
|
110
|
+
name: "Grid off, axis line on",
|
|
111
|
+
parameters: {
|
|
112
|
+
docs: {
|
|
113
|
+
description: {
|
|
114
|
+
story:
|
|
115
|
+
"`showGrid={false}` with `showLine` and `showTicks` on: the classic ticked frame for charts that must not carry horizontal rules across the plot.",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
render: () => (
|
|
120
|
+
<YStack maxWidth={560}>
|
|
121
|
+
<Card>
|
|
122
|
+
<ChartSurface label="Ticked axis frame with no grid." height={220}>
|
|
123
|
+
{(size) => (
|
|
124
|
+
<AxisFrame
|
|
125
|
+
size={size}
|
|
126
|
+
categories={weekdays}
|
|
127
|
+
domain={[0, 100]}
|
|
128
|
+
showYGrid={false}
|
|
129
|
+
showYLine
|
|
130
|
+
showYTicks
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
133
|
+
</ChartSurface>
|
|
134
|
+
</Card>
|
|
135
|
+
</YStack>
|
|
136
|
+
),
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const LabelTruncation: Story = {
|
|
140
|
+
name: "Long labels truncate",
|
|
141
|
+
parameters: {
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story:
|
|
145
|
+
"Department names wider than their band. XAxis truncates each label to its step with an ellipsis rather than letting text collide or run off the surface.",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
render: () => (
|
|
150
|
+
<YStack gap="$4">
|
|
151
|
+
{[520, 280].map((width) => (
|
|
152
|
+
<Card key={width} width={width}>
|
|
153
|
+
<YStack gap="$2">
|
|
154
|
+
<Paragraph size="$2">{`${width}px container`}</Paragraph>
|
|
155
|
+
<ChartSurface label={`Department axis at ${width}px`} height={180}>
|
|
156
|
+
{(size) => <AxisFrame size={size} categories={longLabels} domain={[0, 40]} />}
|
|
157
|
+
</ChartSurface>
|
|
158
|
+
</YStack>
|
|
159
|
+
</Card>
|
|
160
|
+
))}
|
|
161
|
+
</YStack>
|
|
162
|
+
),
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const WideValueRange: Story = {
|
|
166
|
+
name: "Nice ticks on a wide range",
|
|
167
|
+
parameters: {
|
|
168
|
+
docs: {
|
|
169
|
+
description: {
|
|
170
|
+
story:
|
|
171
|
+
"A 0 to 1,250,000 domain. YAxis asks d3 for nice ticks and formats them through the charts density register, so the left margin stays a handful of characters wide.",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
render: () => (
|
|
176
|
+
<YStack maxWidth={560}>
|
|
177
|
+
<Card>
|
|
178
|
+
<ChartSurface label="Weekday axis against a 0 to 1.25 million value axis." height={220}>
|
|
179
|
+
{(size) => (
|
|
180
|
+
<AxisFrame size={size} categories={weekdays} domain={[0, 1250000]} yTicks={5} />
|
|
181
|
+
)}
|
|
182
|
+
</ChartSurface>
|
|
183
|
+
</Card>
|
|
184
|
+
</YStack>
|
|
185
|
+
),
|
|
186
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChartSurface is exported from the charts barrel but only ever appeared
|
|
3
|
+
* inside the composed charts' stories, so it had no title of its own
|
|
4
|
+
* (MPO-193). These mount every exported story and assert the surface really
|
|
5
|
+
* paints: an explicit width draws immediately, and the accessible summary
|
|
6
|
+
* lands on the SVG root as one described image (Axiom 12).
|
|
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 meta, { Default, FixedWidth, Responsive } from "./ChartSurface.stories";
|
|
12
|
+
|
|
13
|
+
afterEach(cleanup);
|
|
14
|
+
|
|
15
|
+
describe("ChartSurface stories", () => {
|
|
16
|
+
it("declares the Components/ChartSurface title against the component", () => {
|
|
17
|
+
expect(meta.title).toBe("Components/ChartSurface");
|
|
18
|
+
expect(meta.component).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("Explicit width draws without any layout pass", () => {
|
|
22
|
+
const { container } = renderWithProviders(<>{FixedWidth.render?.({} as never, {} as never)}</>);
|
|
23
|
+
const root = screen.getByRole("img", { name: "Five categorical dots" });
|
|
24
|
+
expect(root.getAttribute("width")).toBe("360");
|
|
25
|
+
expect(container.querySelectorAll("circle")).toHaveLength(5);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("Main mounts and carries its generated summary as the accessible name", () => {
|
|
29
|
+
renderWithProviders(
|
|
30
|
+
<>{Default.render?.(Default.args as never, { args: Default.args } as never)}</>,
|
|
31
|
+
);
|
|
32
|
+
// happy-dom runs no layout, so the measured surface holds at width 0 and
|
|
33
|
+
// draws nothing — the label still has to be the declared summary.
|
|
34
|
+
expect(Default.args?.label).toBe("Sessions per weekday, peaking Thursday at 9.");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("Tracks the container mounts one surface per width", () => {
|
|
38
|
+
renderWithProviders(<>{Responsive.render?.({} as never, {} as never)}</>);
|
|
39
|
+
expect(screen.getByText("520px container")).toBeTruthy();
|
|
40
|
+
expect(screen.getByText("320px container")).toBeTruthy();
|
|
41
|
+
expect(screen.getByText("200px container")).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
+
import { Paragraph, YStack } from "tamagui";
|
|
3
|
+
import { Card } from "../surfaces";
|
|
4
|
+
import { ChartSurface } from "./ChartSurface";
|
|
5
|
+
import { createBandScale, createLinearScale } from "./math";
|
|
6
|
+
import { Circle, Line, Rect } from "./svg";
|
|
7
|
+
import type { ChartSize } from "./types";
|
|
8
|
+
import { useChartTheme } from "./useChartTheme";
|
|
9
|
+
|
|
10
|
+
const bars = [
|
|
11
|
+
{ label: "Mon", value: 3 },
|
|
12
|
+
{ label: "Tue", value: 7 },
|
|
13
|
+
{ label: "Wed", value: 5 },
|
|
14
|
+
{ label: "Thu", value: 9 },
|
|
15
|
+
{ label: "Fri", value: 6 },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The point of the surface is that children get PIXELS, not a 0-100 viewBox:
|
|
20
|
+
* scales resolve against the measured viewport, so strokes stay 1px and hit
|
|
21
|
+
* targets stay honest at any container width.
|
|
22
|
+
*/
|
|
23
|
+
function Marks({ size }: { size: ChartSize }) {
|
|
24
|
+
const { palette, gridColor } = useChartTheme();
|
|
25
|
+
const x = createBandScale({
|
|
26
|
+
domain: bars.map((bar) => bar.label),
|
|
27
|
+
range: [8, size.width - 8],
|
|
28
|
+
});
|
|
29
|
+
const y = createLinearScale({ domain: [0, 10], range: [size.height - 8, 8] });
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<Line
|
|
33
|
+
x1={8}
|
|
34
|
+
y1={size.height - 8}
|
|
35
|
+
x2={size.width - 8}
|
|
36
|
+
y2={size.height - 8}
|
|
37
|
+
stroke={gridColor}
|
|
38
|
+
strokeWidth={1}
|
|
39
|
+
/>
|
|
40
|
+
{bars.map((bar) => (
|
|
41
|
+
<Rect
|
|
42
|
+
key={bar.label}
|
|
43
|
+
x={x(bar.label) ?? 0}
|
|
44
|
+
y={y(bar.value)}
|
|
45
|
+
width={x.bandwidth()}
|
|
46
|
+
height={size.height - 8 - y(bar.value)}
|
|
47
|
+
fill={palette.single}
|
|
48
|
+
/>
|
|
49
|
+
))}
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function Dots({ size }: { size: ChartSize }) {
|
|
55
|
+
const { palette } = useChartTheme();
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
{bars.map((bar, index) => (
|
|
59
|
+
<Circle
|
|
60
|
+
key={bar.label}
|
|
61
|
+
cx={((index + 1) / (bars.length + 1)) * size.width}
|
|
62
|
+
cy={size.height / 2}
|
|
63
|
+
r={6 + index * 2}
|
|
64
|
+
fill={palette.categorical[index % palette.categorical.length]}
|
|
65
|
+
/>
|
|
66
|
+
))}
|
|
67
|
+
</>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const meta: Meta<typeof ChartSurface> = {
|
|
72
|
+
title: "Components/ChartSurface",
|
|
73
|
+
component: ChartSurface,
|
|
74
|
+
parameters: {
|
|
75
|
+
status: { type: "beta" },
|
|
76
|
+
docs: {
|
|
77
|
+
description: {
|
|
78
|
+
component:
|
|
79
|
+
'The responsive SVG viewport every chart in this package draws into. It measures its own width through `onLayout` (ResizeObserver-backed on web) and hands children a pixel-space `{ width, height }`, so scales land on real device pixels: strokes stay crisp, nothing is stretched by `preserveAspectRatio`, and a 44px touch target really is 44px. `label` is the generated accessible summary and renders as `role="img"`, so the chart is one described image rather than a pile of unlabelled shapes. Pass an explicit `width` to bypass measurement for SSR, tests, and fixed layouts. The draw-in fade drops entirely at `animation="none"` or OS reduced motion.',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
argTypes: {
|
|
84
|
+
label: { control: "text" },
|
|
85
|
+
height: { control: { type: "range", min: 80, max: 320, step: 10 } },
|
|
86
|
+
width: { control: "number" },
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
export default meta;
|
|
90
|
+
|
|
91
|
+
type Story = StoryObj<typeof ChartSurface>;
|
|
92
|
+
|
|
93
|
+
export const Default: Story = {
|
|
94
|
+
name: "Main",
|
|
95
|
+
args: { label: "Sessions per weekday, peaking Thursday at 9.", height: 200 },
|
|
96
|
+
render: (args) => (
|
|
97
|
+
<YStack maxWidth={560}>
|
|
98
|
+
<Card>
|
|
99
|
+
<ChartSurface {...args}>{(size) => <Marks size={size} />}</ChartSurface>
|
|
100
|
+
</Card>
|
|
101
|
+
</YStack>
|
|
102
|
+
),
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const Responsive: Story = {
|
|
106
|
+
name: "Tracks the container",
|
|
107
|
+
parameters: {
|
|
108
|
+
docs: {
|
|
109
|
+
description: {
|
|
110
|
+
story:
|
|
111
|
+
"Same surface, three container widths. No `width` prop: each instance measures its own parent, so the band scale re-solves instead of scaling a fixed viewBox.",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
render: () => (
|
|
116
|
+
<YStack gap="$4">
|
|
117
|
+
{[520, 320, 200].map((width) => (
|
|
118
|
+
<Card key={width} width={width}>
|
|
119
|
+
<YStack gap="$2">
|
|
120
|
+
<Paragraph size="$2">{`${width}px container`}</Paragraph>
|
|
121
|
+
<ChartSurface label={`Sessions per weekday at ${width}px`} height={140}>
|
|
122
|
+
{(size) => <Marks size={size} />}
|
|
123
|
+
</ChartSurface>
|
|
124
|
+
</YStack>
|
|
125
|
+
</Card>
|
|
126
|
+
))}
|
|
127
|
+
</YStack>
|
|
128
|
+
),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const FixedWidth: Story = {
|
|
132
|
+
name: "Explicit width",
|
|
133
|
+
parameters: {
|
|
134
|
+
docs: {
|
|
135
|
+
description: {
|
|
136
|
+
story:
|
|
137
|
+
"An explicit `width` bypasses measurement entirely — the path SSR and tests take, where no layout pass ever runs.",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
render: () => (
|
|
142
|
+
<Card alignSelf="flex-start">
|
|
143
|
+
<ChartSurface label="Five categorical dots" width={360} height={120}>
|
|
144
|
+
{(size) => <Dots size={size} />}
|
|
145
|
+
</ChartSurface>
|
|
146
|
+
</Card>
|
|
147
|
+
),
|
|
148
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
import { Code, CodeInline } from "./index";
|
|
4
4
|
|
|
5
5
|
describe("Code", () => {
|
|
@@ -21,6 +21,15 @@ describe("Code", () => {
|
|
|
21
21
|
const codeElement = container.querySelector("code");
|
|
22
22
|
expect(codeElement).toBeDefined();
|
|
23
23
|
});
|
|
24
|
+
|
|
25
|
+
it("keeps data-code-font and does not emit a dataset attribute", () => {
|
|
26
|
+
const { container } = renderWithProviders(<Code>const test = "hello"</Code>);
|
|
27
|
+
const codeElement = container.querySelector("code");
|
|
28
|
+
expect(codeElement).toBeTruthy();
|
|
29
|
+
expect(codeElement!.getAttribute("data-code-font")).toBe("mono");
|
|
30
|
+
// React lowercases an unknown dataSet prop to dataset="[object Object]".
|
|
31
|
+
expect(codeElement!.hasAttribute("dataset")).toBe(false);
|
|
32
|
+
});
|
|
24
33
|
});
|
|
25
34
|
|
|
26
35
|
describe("CodeInline", () => {
|
|
@@ -42,4 +51,21 @@ describe("CodeInline", () => {
|
|
|
42
51
|
const codeElement = container.querySelector("code");
|
|
43
52
|
expect(codeElement).toBeDefined();
|
|
44
53
|
});
|
|
54
|
+
|
|
55
|
+
it("emits data-code-font on web without a dataSet host-prop leak", () => {
|
|
56
|
+
const leak = /does not recognize the `dataSet` prop on a DOM element/;
|
|
57
|
+
const errorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
|
58
|
+
try {
|
|
59
|
+
const { container } = renderWithProviders(<CodeInline>npm install</CodeInline>);
|
|
60
|
+
const codeElement = container.querySelector("code");
|
|
61
|
+
expect(codeElement).toBeDefined();
|
|
62
|
+
expect(codeElement?.getAttribute("data-code-font")).toBe("mono");
|
|
63
|
+
const leaks = errorSpy.mock.calls
|
|
64
|
+
.map((args) => args.map(String).join(" "))
|
|
65
|
+
.filter((message) => leak.test(message));
|
|
66
|
+
expect(leaks).toEqual([]);
|
|
67
|
+
} finally {
|
|
68
|
+
errorSpy.mockRestore();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
45
71
|
});
|
package/src/code/Code/index.tsx
CHANGED
|
@@ -40,7 +40,6 @@ export const Code = CodeFrame.styleable((props, ref) => {
|
|
|
40
40
|
fontFamily="$mono"
|
|
41
41
|
letterSpacing={0}
|
|
42
42
|
data-code-font="mono"
|
|
43
|
-
{...({ dataSet: { codeFont: "mono" } } as object)}
|
|
44
43
|
/>
|
|
45
44
|
);
|
|
46
45
|
});
|
|
@@ -57,6 +56,9 @@ const CodeInlineFrame = styled(Paragraph, {
|
|
|
57
56
|
backgroundColor: componentColors.code.background,
|
|
58
57
|
cursor: "inherit",
|
|
59
58
|
borderRadius: "$3",
|
|
59
|
+
// Pin (dial: surrounding prose): 0.9× size / 0.7× leading. Size reaches
|
|
60
|
+
// the chip through context, not sizeToken. Lettered in spec § Code and
|
|
61
|
+
// CodeInline; these ratios are the house metrics already shipping.
|
|
60
62
|
fontSize: "90%" as CSSProperties["fontSize"],
|
|
61
63
|
lineHeight: "70%" as CSSProperties["lineHeight"],
|
|
62
64
|
paddingHorizontal: "0.6%",
|
|
@@ -79,7 +81,12 @@ export const CodeInline = CodeInlineFrame.styleable((props, ref) => {
|
|
|
79
81
|
fontFamily="$mono"
|
|
80
82
|
letterSpacing={0}
|
|
81
83
|
data-code-font="mono"
|
|
82
|
-
|
|
84
|
+
// react-native-web reads dataSet; React-DOM warns on the camel host
|
|
85
|
+
// prop. Keep the kebab attribute on every target; spread dataSet
|
|
86
|
+
// only when TAMAGUI_TARGET is native.
|
|
87
|
+
{...(process.env.TAMAGUI_TARGET === "native"
|
|
88
|
+
? ({ dataSet: { codeFont: "mono" } } as object)
|
|
89
|
+
: {})}
|
|
83
90
|
/>
|
|
84
91
|
);
|
|
85
92
|
});
|
|
@@ -115,9 +115,18 @@ describe("HighlightedCode", () => {
|
|
|
115
115
|
<HighlightedCode tokens={tokens} />
|
|
116
116
|
</Preset>,
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
// querySelector("span") used to land on renderWithProviders' Theme
|
|
119
|
+
// wrapper (`t_light _dsp_contents`), never the code line, so this guard
|
|
120
|
+
// asserted null and had been red on main. Select the line itself.
|
|
121
|
+
const line = container.querySelector("[data-code-font]") as HTMLElement | null;
|
|
119
122
|
expect(line).toBeTruthy();
|
|
120
123
|
expect(container.textContent).toContain("const");
|
|
121
124
|
expect(line!.getAttribute("data-code-font")).toBe("mono");
|
|
125
|
+
// The actual LC-07 pin: bodyFont serif / fontWeight bold must not reach
|
|
126
|
+
// code text, so the line keeps the mono family class.
|
|
127
|
+
expect(line!.className).toContain("font_mono");
|
|
128
|
+
// React does not recognise `dataSet`; leaving it on the line logged an
|
|
129
|
+
// unknown-prop error and wrote dataset="[object Object]" on every node.
|
|
130
|
+
expect(container.querySelectorAll("[dataset]")).toHaveLength(0);
|
|
122
131
|
});
|
|
123
132
|
});
|
package/src/knobImmuneExports.ts
CHANGED
|
@@ -38,6 +38,17 @@ export const knobImmuneExports: Readonly<Record<string, string>> = {
|
|
|
38
38
|
// qualifies for a row (house implementations ARE the knob story). The
|
|
39
39
|
// weight-knob question stays an ADJUDICATION-CANDIDATE on the component
|
|
40
40
|
// header (MPO-21 G10 / G0-clay R9).
|
|
41
|
+
// MPO-21 G1 — Fold's substrate. Logic shell only; Accordion (and Fold)
|
|
42
|
+
// own the painted chrome. Restored with the three below after MPO-21 R9 G8
|
|
43
|
+
// (the Adapt drop) rewrote this file from a pre-MPO-21 copy and took them
|
|
44
|
+
// out as collateral; Adapt itself stays dropped.
|
|
45
|
+
Collapsible:
|
|
46
|
+
"composition root (open/close shell); knobs land on composing surfaces (Accordion, Fold)",
|
|
47
|
+
Unspaced:
|
|
48
|
+
"spacing opt-out marker; paints nothing, tells the parent stack to skip gap on its children",
|
|
49
|
+
VisuallyHidden: "a11y hide utility; paints nothing visible, no chrome for knobs to reach",
|
|
50
|
+
LinearGradient:
|
|
51
|
+
"paint primitive (color stops are content); no opinionated chrome, consumers own the stops",
|
|
41
52
|
ListItem:
|
|
42
53
|
"raw list-row primitive consumed as lego by house list surfaces (List, sidebar, tags) which own the knob story. ADJUDICATION-CANDIDATE + BACKLOG: painted row with own padding/press states — deserves a house shadow or Tamagui* demotion once consumers migrate",
|
|
43
54
|
|
|
@@ -229,7 +229,7 @@ function SchemeWrap({
|
|
|
229
229
|
children: ReactNode;
|
|
230
230
|
}) {
|
|
231
231
|
return (
|
|
232
|
-
<TamaguiProvider config={houseConfig} defaultTheme={scheme} disableInjectCSS>
|
|
232
|
+
<TamaguiProvider config={houseConfig.tamagui} defaultTheme={scheme} disableInjectCSS>
|
|
233
233
|
<YStack backgroundColor="$background">{children}</YStack>
|
|
234
234
|
</TamaguiProvider>
|
|
235
235
|
);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
2
|
import { fireEvent } from "@testing-library/react";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
3
5
|
import { describe, expect, it, vi } from "vitest";
|
|
4
6
|
import { Breadcrumbs } from "./breadcrumbs";
|
|
5
7
|
|
|
@@ -28,6 +30,21 @@ describe("Breadcrumbs", () => {
|
|
|
28
30
|
expect(["400", "normal"]).toContain(String(linkWeight));
|
|
29
31
|
});
|
|
30
32
|
|
|
33
|
+
it("hides the slash separators from AT and paints them as T-HELPER ink", () => {
|
|
34
|
+
const { container } = renderWithProviders(<Breadcrumbs items={items} />);
|
|
35
|
+
const separators = [...container.querySelectorAll('[data-testid="breadcrumb-separator"]')];
|
|
36
|
+
expect(separators).toHaveLength(2);
|
|
37
|
+
for (const sep of separators) {
|
|
38
|
+
expect(sep.getAttribute("aria-hidden")).toBe("true");
|
|
39
|
+
expect(sep.textContent).toBe("/");
|
|
40
|
+
}
|
|
41
|
+
// Distinct token from MPO-40: separators ride textAccentColor (AA floor
|
|
42
|
+
// at $color11), not componentColors.text.subtle ($color8).
|
|
43
|
+
const source = readFileSync(join(import.meta.dirname, "breadcrumbs.tsx"), "utf8");
|
|
44
|
+
expect(source).toMatch(/color=\{knobProps\.textAccentColor\}/);
|
|
45
|
+
expect(source).not.toMatch(/color=\{componentColors\.text\.subtle\}/);
|
|
46
|
+
});
|
|
47
|
+
|
|
31
48
|
it("calls onNavigate from a path crumb and keeps the current page inert", () => {
|
|
32
49
|
const onNavigate = vi.fn();
|
|
33
50
|
const { container } = renderWithProviders(
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
* Breadcrumbs — wayfinding trail (Polaris / Primer / GOV.UK).
|
|
3
3
|
*
|
|
4
4
|
* Landmark `<nav>` + ordered list; last crumb is the current page
|
|
5
|
-
* (`aria-current="page"`, not a link). Separators stay the RTL-neutral
|
|
5
|
+
* (`aria-current="page"`, not a link). Separators stay the RTL-neutral `/`,
|
|
6
|
+
* `aria-hidden` (the list already names the trail), and T-HELPER ink via
|
|
7
|
+
* `knobProps.textAccentColor` — not `componentColors.text.subtle` ($color8),
|
|
8
|
+
* which measured 1.89:1 / 2.21:1 against the 4.5 floor. Distinct from
|
|
9
|
+
* MPO-40 / !272 (outlined intent `$color11` on the warning surface).
|
|
6
10
|
* LC-71: keyboard ring on each link (and the overflow control), never the
|
|
7
11
|
* trail container. LC-03 / LC-35: tight chromeless trail.
|
|
12
|
+
* Crumb `minHeight` is a Vocabulary `pin` at 44, not a size `floor` — see
|
|
13
|
+
* `docs/design/letters/breadcrumbs-size-pin.md`.
|
|
8
14
|
*/
|
|
9
15
|
|
|
10
16
|
import {
|
|
@@ -120,12 +126,17 @@ export function Breadcrumbs({ items, onNavigate, label, maxVisible }: Breadcrumb
|
|
|
120
126
|
// Tight trail: crumbs hug the "/" separators so the path reads as one unit.
|
|
121
127
|
// The space knob still scales the gap, but from a tight base — not the
|
|
122
128
|
// panel-level knobProps.gap (which is sized for stacked layout sections).
|
|
129
|
+
// Spec: separators are T-HELPER (`textAccentColor`), never the $color8
|
|
130
|
+
// `text.subtle` ramp that fails AA on the page.
|
|
123
131
|
const spaceGap = knobProps.gap.gap;
|
|
124
132
|
const trailGap =
|
|
125
133
|
spaceGap === "$2" ? ("$1" as const) : spaceGap === "$5" ? ("$2" as const) : ("$1.5" as const);
|
|
126
134
|
// Vertical pad only (theme-propagation SP-FIXED / DG-LAY-04 / LC-03): grow
|
|
127
135
|
// the clickable box to ≥44 without horizontal padding that would re-spread
|
|
128
136
|
// the trail. No minWidth floor — the ring must hug the link, not a 44px well.
|
|
137
|
+
// Height is PINNED at MIN_PRESS_TARGET across size stops (font still remaps).
|
|
138
|
+
// That is Vocabulary `pin (forced: WCAG 2.5.5)`, not `floor`. Do not raise
|
|
139
|
+
// the box at large — lettered in docs/design/letters/breadcrumbs-size-pin.md.
|
|
129
140
|
const crumbPadY = Math.max(0, Math.ceil((MIN_PRESS_TARGET - CRUMB_LINE_PX) / 2));
|
|
130
141
|
const crumbRadius = knobProps.borderRadius.borderRadius;
|
|
131
142
|
|
|
@@ -238,7 +249,13 @@ export function Breadcrumbs({ items, onNavigate, label, maxVisible }: Breadcrumb
|
|
|
238
249
|
</Text>
|
|
239
250
|
)}
|
|
240
251
|
{!isLastSlot && (
|
|
241
|
-
<Text
|
|
252
|
+
<Text
|
|
253
|
+
aria-hidden
|
|
254
|
+
color={knobProps.textAccentColor}
|
|
255
|
+
data-testid="breadcrumb-separator"
|
|
256
|
+
fontSize={separatorSize}
|
|
257
|
+
userSelect="none"
|
|
258
|
+
>
|
|
242
259
|
/
|
|
243
260
|
</Text>
|
|
244
261
|
)}
|
|
@@ -4,7 +4,9 @@ import { Tags } from "./tags";
|
|
|
4
4
|
|
|
5
5
|
describe("Tags design law", () => {
|
|
6
6
|
it("paints the field label at weight 400 (R7 / §6.1)", () => {
|
|
7
|
-
const { container } = renderWithProviders(
|
|
7
|
+
const { container } = renderWithProviders(
|
|
8
|
+
<Tags tags={[{ id: "alpha", label: "alpha" }]} label="Topics" />,
|
|
9
|
+
);
|
|
8
10
|
const label = container.querySelector("label") as HTMLElement | null;
|
|
9
11
|
const node = label ?? (container.querySelector("*") as HTMLElement);
|
|
10
12
|
expect(container.textContent).toContain("Topics");
|
package/src/tamagui.ts
CHANGED
|
@@ -30,18 +30,26 @@
|
|
|
30
30
|
// quiet = opacity 0.5). Raw stays reachable as TamaguiSeparator below.
|
|
31
31
|
export {
|
|
32
32
|
Circle,
|
|
33
|
+
Collapsible,
|
|
33
34
|
Group,
|
|
34
35
|
ListItem,
|
|
35
36
|
ScrollView,
|
|
36
37
|
Spacer,
|
|
37
38
|
Square,
|
|
39
|
+
Unspaced,
|
|
38
40
|
View,
|
|
41
|
+
VisuallyHidden,
|
|
39
42
|
XGroup,
|
|
40
43
|
XStack,
|
|
41
44
|
YGroup,
|
|
42
45
|
YStack,
|
|
43
46
|
} from "tamagui";
|
|
44
47
|
|
|
48
|
+
// MPO-21 G2: LinearGradient is NOT on the main tamagui barrel — it lives
|
|
49
|
+
// on the `tamagui/linear-gradient` subpath.
|
|
50
|
+
export { LinearGradient } from "tamagui/linear-gradient";
|
|
51
|
+
export type { LinearGradientProps } from "tamagui/linear-gradient";
|
|
52
|
+
|
|
45
53
|
// Text primitives: NONE re-exported raw anymore (MPO-20). The former
|
|
46
54
|
// "typography substrate" registry rows were the single biggest knob hole in
|
|
47
55
|
// the catalog: FontKnobStyles rescues family/leading/tracking on WEB ONLY,
|
package/src/views/Dashboard.tsx
CHANGED
|
@@ -379,7 +379,7 @@ export function KPICard({ config, ...stackProps }: KPICardProps) {
|
|
|
379
379
|
{...stackProps}
|
|
380
380
|
>
|
|
381
381
|
<XStack justifyContent="space-between" alignItems="flex-start">
|
|
382
|
-
<Text {...knobProps.label} color={
|
|
382
|
+
<Text {...knobProps.label} color={knobProps.textAccentColor} flex={1}>
|
|
383
383
|
{config.title}
|
|
384
384
|
</Text>
|
|
385
385
|
{config.icon ? (
|
|
@@ -408,7 +408,7 @@ export function KPICard({ config, ...stackProps }: KPICardProps) {
|
|
|
408
408
|
label={knobProps.label}
|
|
409
409
|
/>
|
|
410
410
|
{config.previousValue !== undefined && (
|
|
411
|
-
<Text {...knobProps.label} color={
|
|
411
|
+
<Text {...knobProps.label} color={knobProps.textAccentColor}>
|
|
412
412
|
{t("vs {{previousValue}}", { previousValue: formatMetric(config.previousValue) })}
|
|
413
413
|
</Text>
|
|
414
414
|
)}
|
|
@@ -689,7 +689,7 @@ export function Dashboard({
|
|
|
689
689
|
</H3>
|
|
690
690
|
)}
|
|
691
691
|
{description && (
|
|
692
|
-
<Text {...knobProps.body} {...knobProps.label} color={
|
|
692
|
+
<Text {...knobProps.body} {...knobProps.label} color={knobProps.textAccentColor}>
|
|
693
693
|
{description}
|
|
694
694
|
</Text>
|
|
695
695
|
)}
|