@multiplatform.one/components 9.4.0 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SheetModal/index.cjs +3 -5
- package/dist/cjs/SheetModal/index.native.js +1 -3
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.cjs +137 -81
- package/dist/cjs/charts/LineChart.native.js +209 -93
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/SeriesLegend.cjs +85 -0
- package/dist/cjs/charts/SeriesLegend.native.js +93 -0
- package/dist/cjs/charts/SeriesLegend.native.js.map +1 -0
- package/dist/cjs/charts/series.cjs +47 -3
- package/dist/cjs/charts/series.native.js +49 -5
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.cjs +8 -4
- package/dist/cjs/layouts/attachments.native.js +8 -4
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Carousel/geometry.native.js.map +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/ChatTurn/index.native.js.map +1 -1
- package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/esm/CheckGlyph/index.native.js.map +1 -1
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ChoiceChips/index.native.js.map +1 -1
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/Diff/diff.native.js.map +1 -1
- package/dist/esm/Diff/index.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DrillStack/DrillBar.native.js.map +1 -1
- package/dist/esm/DrillStack/context.native.js.map +1 -1
- package/dist/esm/DrillStack/drillMotion.native.js.map +1 -1
- package/dist/esm/DropDownPanel/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Kbd/index.native.js.map +1 -1
- package/dist/esm/Kbd/keys.native.js.map +1 -1
- package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/esm/Lightbox/shared.native.js.map +1 -1
- package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/esm/MachineLiteral/index.native.js.map +1 -1
- package/dist/esm/Material/index.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/MiddleEllipsisText/middleSplit.native.js.map +1 -1
- package/dist/esm/MiddleEllipsisText/types.native.js.map +1 -1
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/Quote/index.native.js.map +1 -1
- package/dist/esm/SchemeToggle/index.native.js.map +1 -1
- package/dist/esm/ScrollView.native.js.map +1 -1
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetBodyRegion.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +3 -5
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +1 -3
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/SheetScrollView/index.native.js.map +1 -1
- package/dist/esm/SheetScrollView/sheetHandoff.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/esm/SwipeDismissRow/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
- package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
- package/dist/esm/Video/VideoFrame.native.js.map +1 -1
- package/dist/esm/Video/types.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wizard/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/actions/DangerSection.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/actions/HeaderActions.native.js.map +1 -1
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/actions/devWarn.native.js.map +1 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/actions/severity.native.js.map +1 -1
- package/dist/esm/appShell/AppShell.native.js.map +1 -1
- package/dist/esm/appShell/BottomChromeClearance.native.js.map +1 -1
- package/dist/esm/appShell/Dock.native.js.map +1 -1
- package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.native.js.map +1 -1
- package/dist/esm/appShell/appTile.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/appShell/stackBack.native.js.map +1 -1
- package/dist/esm/appShell/systemBarFit.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.mjs +138 -82
- package/dist/esm/charts/LineChart.mjs.map +1 -1
- package/dist/esm/charts/LineChart.native.js +210 -94
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/SeriesLegend.mjs +60 -0
- package/dist/esm/charts/SeriesLegend.mjs.map +1 -0
- package/dist/esm/charts/SeriesLegend.native.js +65 -0
- package/dist/esm/charts/SeriesLegend.native.js.map +1 -0
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.mjs +43 -3
- package/dist/esm/charts/series.mjs.map +1 -1
- package/dist/esm/charts/series.native.js +45 -5
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/esm/code/Highlighter/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/esm/code/HoldSelect/tapGate.native.js.map +1 -1
- package/dist/esm/code/LogView.native.js.map +1 -1
- package/dist/esm/code/PayloadView/index.native.js.map +1 -1
- package/dist/esm/code/PayloadView/payloadModel.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/esm/formLayouts/SingleTaskColumn.native.js.map +1 -1
- package/dist/esm/formLayouts/index.native.js.map +1 -1
- package/dist/esm/hooks/index.native.js.map +1 -1
- package/dist/esm/hooks/useClipboard.native.js.map +1 -1
- package/dist/esm/hooks/useDirection.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/framing.native.js.map +1 -1
- package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/remoteArtCache.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/svgMarkup.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/types.native.js.map +1 -1
- package/dist/esm/images/index.native.js.map +1 -1
- package/dist/esm/index.gnome.native.js.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/Debug/index.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/asyncFailure.native.js.map +1 -1
- package/dist/esm/layouts/attachments.mjs +8 -4
- package/dist/esm/layouts/attachments.mjs.map +1 -1
- package/dist/esm/layouts/attachments.native.js +8 -4
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/barTitleSpan.native.js.map +1 -1
- package/dist/esm/layouts/bottomAccessory.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/shared/actionScan.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/restoreRetries.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/textRidesText.native.js.map +1 -1
- package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/CardGrid.native.js.map +1 -1
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/FilePreview.native.js.map +1 -1
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ListRow.native.js.map +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/ShortcutCard.native.js.map +1 -1
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/esm/views/ganttIntervals.native.js.map +1 -1
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/kanbanDnd.native.js.map +1 -1
- package/dist/esm/views/matrixMath.native.js.map +1 -1
- package/dist/esm/views/sameNameScope.native.js.map +1 -1
- package/dist/esm/views/treeViewDnd.native.js.map +1 -1
- package/dist/esm/views/treeViewLayout.native.js.map +1 -1
- package/dist/esm/views/treeViewMotion.native.js.map +1 -1
- package/dist/esm/views/treeViewReveal.native.js.map +1 -1
- package/dist/esm/views/usePageFlowLoadMore.native.js.map +1 -1
- package/dist/esm/views/widgetChrome.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +3 -5
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +1 -3
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/charts/LineChart.mjs +138 -82
- package/dist/jsx/charts/LineChart.mjs.map +1 -1
- package/dist/jsx/charts/LineChart.native.js +209 -93
- package/dist/jsx/charts/LineChart.native.js.map +1 -1
- package/dist/jsx/charts/SeriesLegend.mjs +60 -0
- package/dist/jsx/charts/SeriesLegend.mjs.map +1 -0
- package/dist/jsx/charts/SeriesLegend.native.js +93 -0
- package/dist/jsx/charts/SeriesLegend.native.js.map +1 -0
- package/dist/jsx/charts/series.mjs +43 -3
- package/dist/jsx/charts/series.mjs.map +1 -1
- package/dist/jsx/charts/series.native.js +49 -5
- package/dist/jsx/charts/series.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.mjs +8 -4
- package/dist/jsx/layouts/attachments.mjs.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +8 -4
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/package.json +7 -7
- package/src/Pagination.spec.tsx +1 -1
- package/src/SheetModal/SheetModal.noEdge.spec.tsx +63 -0
- package/src/SheetModal/index.native.tsx +1 -3
- package/src/SheetModal/index.tsx +3 -3
- package/src/actions/ActionButton.spec.tsx +6 -6
- package/src/charts/Charts.stories.tsx +25 -0
- package/src/charts/LineChart.tsx +185 -105
- package/src/charts/SeriesLegend.native.spec.tsx +99 -0
- package/src/charts/SeriesLegend.tsx +68 -0
- package/src/charts/multiSeriesLine.spec.tsx +111 -0
- package/src/charts/series.tsx +73 -11
- package/src/layouts/attachments.dropTarget.spec.tsx +91 -0
- package/src/layouts/attachments.tsx +12 -4
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/charts/LineChart.d.ts +21 -5
- package/types/charts/LineChart.d.ts.map +1 -1
- package/types/charts/SeriesLegend.d.ts +21 -0
- package/types/charts/SeriesLegend.d.ts.map +1 -0
- package/types/charts/series.d.ts +18 -1
- package/types/charts/series.d.ts.map +1 -1
- package/types/layouts/attachments.d.ts.map +1 -1
package/src/SheetModal/index.tsx
CHANGED
|
@@ -115,8 +115,8 @@ export interface SheetModalProps {
|
|
|
115
115
|
const fillSlot = { flex: 1, minHeight: 0 } as const;
|
|
116
116
|
const nonShrinking = { flexShrink: 0 } as const;
|
|
117
117
|
|
|
118
|
-
/** A compact sheet spans the window
|
|
119
|
-
const
|
|
118
|
+
/** A compact sheet spans the window and draws no edge, as tamagui's Sheet doesn't. */
|
|
119
|
+
const noEdges = { borderWidth: 0 } as const;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* LC-266 (FZ-8939): at regular width the sheet is the native panel's twin, a
|
|
@@ -349,7 +349,7 @@ export function SheetModal({
|
|
|
349
349
|
: null)}
|
|
350
350
|
borderBottomLeftRadius={0}
|
|
351
351
|
borderBottomRightRadius={0}
|
|
352
|
-
{...(regular ? regularPanel(windowWidth, panelWidth) :
|
|
352
|
+
{...(regular ? regularPanel(windowWidth, panelWidth) : noEdges)}
|
|
353
353
|
overflow="hidden"
|
|
354
354
|
{...frameRingReset}
|
|
355
355
|
>
|
|
@@ -26,7 +26,7 @@ describe("ActionButton (LC-260)", () => {
|
|
|
26
26
|
expect(button.querySelector("svg")).not.toBeNull();
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
it("the confirms are the accent plate; every other action is
|
|
29
|
+
it("the confirms are the accent plate; every other action is the neutral plate in content", () => {
|
|
30
30
|
renderWithProviders(
|
|
31
31
|
<>
|
|
32
32
|
{kinds.map((kind) => (
|
|
@@ -37,7 +37,7 @@ describe("ActionButton (LC-260)", () => {
|
|
|
37
37
|
for (const kind of kinds) {
|
|
38
38
|
const button = screen.getByRole("button", { name: standardActions[kind].label });
|
|
39
39
|
expect(button.getAttribute("data-mp-icon-button"), kind).toBe(
|
|
40
|
-
standardActions[kind].primary ? "primary" : "
|
|
40
|
+
standardActions[kind].primary ? "primary" : "plate",
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
expect(kinds.filter((kind) => standardActions[kind].primary).sort()).toEqual([
|
|
@@ -48,10 +48,10 @@ describe("ActionButton (LC-260)", () => {
|
|
|
48
48
|
]);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
it("a label names the action more precisely; primary={false} drops the plate", () => {
|
|
51
|
+
it("a label names the action more precisely; primary={false} drops the accent plate", () => {
|
|
52
52
|
renderWithProviders(<ActionButton kind="save" label="Save profile" primary={false} />);
|
|
53
53
|
const button = screen.getByRole("button", { name: "Save profile" });
|
|
54
|
-
expect(button.getAttribute("data-mp-icon-button")).toBe("
|
|
54
|
+
expect(button.getAttribute("data-mp-icon-button")).toBe("plate");
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
it("in a bar a plateless action takes the bar tint (LC-176)", () => {
|
|
@@ -82,7 +82,7 @@ describe("ActionButton (LC-260)", () => {
|
|
|
82
82
|
);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
it("import is
|
|
85
|
+
it("import is an icon-only button named Import, by default and by a sharper label (FZ-11009)", () => {
|
|
86
86
|
renderWithProviders(
|
|
87
87
|
<>
|
|
88
88
|
<ActionButton kind="import" />
|
|
@@ -92,7 +92,7 @@ describe("ActionButton (LC-260)", () => {
|
|
|
92
92
|
for (const name of ["Import", "Import certificate chain"]) {
|
|
93
93
|
const button = screen.getByRole("button", { name });
|
|
94
94
|
expect(button.getAttribute("data-mp-action")).toBe("import");
|
|
95
|
-
expect(button.getAttribute("data-mp-icon-button")).toBe("
|
|
95
|
+
expect(button.getAttribute("data-mp-icon-button")).toBe("plate");
|
|
96
96
|
expect(button.textContent).toBe("");
|
|
97
97
|
expect(button.querySelector("svg")).not.toBeNull();
|
|
98
98
|
}
|
|
@@ -83,6 +83,31 @@ export const SixCategories = {
|
|
|
83
83
|
},
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"];
|
|
87
|
+
const seriesOf = (id: string, values: number[]) => ({
|
|
88
|
+
id,
|
|
89
|
+
label: id,
|
|
90
|
+
data: values.map((value, index) => ({ label: months[index] as string, value })),
|
|
91
|
+
});
|
|
92
|
+
const accounts = [
|
|
93
|
+
seriesOf("Cash", [12, 14, 13, 16, 18, 19]),
|
|
94
|
+
seriesOf("Stocks", [30, 28, 34, 38, 36, 42]),
|
|
95
|
+
seriesOf("Bonds", [20, 21, 21, 22, 23, 23]),
|
|
96
|
+
seriesOf("Property", [44, 45, 45, 46, 47, 48]),
|
|
97
|
+
seriesOf("Crypto", [4, 9, 6, 11, 8, 12]),
|
|
98
|
+
seriesOf("Pension", [24, 25, 27, 28, 30, 31]),
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
export const MultiSeries = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<YStack maxWidth={560} gap="$5">
|
|
104
|
+
<LineChart series={accounts.slice(0, 1)} title="Net worth" />
|
|
105
|
+
<LineChart series={accounts.slice(0, 3)} title="Net worth" />
|
|
106
|
+
<LineChart series={accounts} title="Net worth" />
|
|
107
|
+
</YStack>
|
|
108
|
+
),
|
|
109
|
+
};
|
|
110
|
+
|
|
86
111
|
export const Line = {
|
|
87
112
|
render: () => (
|
|
88
113
|
<YStack maxWidth={560} gap="$4">
|
package/src/charts/LineChart.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { YStack, type YStackProps } from "tamagui";
|
|
1
3
|
import type { ChartHeight } from "./chartHeight";
|
|
2
4
|
import { useTranslation } from "../shared/i18n";
|
|
3
|
-
import type { YStackProps } from "tamagui";
|
|
4
5
|
import { XAxis, YAxis } from "./Axis";
|
|
5
6
|
import { ChartDataFrame } from "./ChartDataView";
|
|
6
7
|
import { ChartSurface } from "./ChartSurface";
|
|
@@ -13,13 +14,31 @@ import {
|
|
|
13
14
|
getLinearTicks,
|
|
14
15
|
valueDomain,
|
|
15
16
|
} from "./math";
|
|
16
|
-
import { AreaSeries, LineSeries } from "./series";
|
|
17
|
+
import { AreaSeries, LineSeries, seriesEncoding } from "./series";
|
|
18
|
+
import { SeriesLegend } from "./SeriesLegend";
|
|
19
|
+
import { G } from "./svg";
|
|
17
20
|
import type { ChartCurve, ChartDatum, ChartDatumEvents } from "./types";
|
|
18
21
|
import { useChartTheme } from "./useChartTheme";
|
|
19
22
|
|
|
23
|
+
/** One line of a multi-series chart (LC-293). */
|
|
24
|
+
export interface LineChartSeries {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
data: ChartDatum[];
|
|
28
|
+
/** Explicit series colour (a data value); defaults to the categorical cycle in order. */
|
|
29
|
+
color?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
export interface LineChartProps
|
|
21
33
|
extends ChartDatumEvents, Omit<YStackProps, "children" | "width" | "height"> {
|
|
22
|
-
|
|
34
|
+
/** A single series. */
|
|
35
|
+
data?: ChartDatum[];
|
|
36
|
+
/**
|
|
37
|
+
* Several series on one scale (LC-293): categorical colours in order, a
|
|
38
|
+
* marker shape per series and dashes from the fifth, and a legend whose
|
|
39
|
+
* entries toggle their series.
|
|
40
|
+
*/
|
|
41
|
+
series?: LineChartSeries[];
|
|
23
42
|
/** Drawing height as a theme size token or pixels (default 200). */
|
|
24
43
|
height?: ChartHeight;
|
|
25
44
|
/** Explicit width bypasses responsive measurement. */
|
|
@@ -48,11 +67,13 @@ export interface LineChartProps
|
|
|
48
67
|
}
|
|
49
68
|
|
|
50
69
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
70
|
+
* Line chart over category points: d3 point/linear scales, knob-driven
|
|
71
|
+
* chrome, 44px point hit targets. One series paints the theme identity;
|
|
72
|
+
* several share one scale and a toggling legend (LC-293).
|
|
53
73
|
*/
|
|
54
74
|
export function LineChart({
|
|
55
75
|
data,
|
|
76
|
+
series,
|
|
56
77
|
height = 200,
|
|
57
78
|
width,
|
|
58
79
|
color,
|
|
@@ -76,112 +97,171 @@ export function LineChart({
|
|
|
76
97
|
}: LineChartProps) {
|
|
77
98
|
const { t } = useTranslation();
|
|
78
99
|
const { palette, labelFontSize } = useChartTheme();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
100
|
+
const [hidden, setHidden] = useState<ReadonlySet<string>>(() => new Set());
|
|
101
|
+
const all: LineChartSeries[] = series ?? [{ id: "series", label: title ?? "", data: data ?? [] }];
|
|
102
|
+
const multi = all.length > 1;
|
|
103
|
+
const strokes = all.map((entry, index) =>
|
|
104
|
+
multi
|
|
105
|
+
? (entry.color ?? (palette.categorical[index % palette.categorical.length] as string))
|
|
106
|
+
: (color ?? entry.color ?? palette.single),
|
|
107
|
+
);
|
|
108
|
+
const encodings = all.map((_, index) =>
|
|
109
|
+
multi ? seriesEncoding(index) : { marker: "circle" as const, dash: undefined },
|
|
110
|
+
);
|
|
111
|
+
const flat = multi
|
|
112
|
+
? all.flatMap((entry) =>
|
|
113
|
+
entry.data.map((datum) => ({ ...datum, label: `${entry.label} ${datum.label}` })),
|
|
114
|
+
)
|
|
115
|
+
: (all[0]?.data ?? []);
|
|
82
116
|
const format = valueFormatter ?? formatChartValue;
|
|
117
|
+
const kind = typeLabel ?? (showArea ? t("Area chart") : t("Line chart"));
|
|
83
118
|
const ariaLabel =
|
|
84
119
|
label ??
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
120
|
+
(multi
|
|
121
|
+
? `${title ? `${kind}, ${title}` : kind}: ${all.length} series. ${all
|
|
122
|
+
.map((entry) =>
|
|
123
|
+
describeChart({
|
|
124
|
+
typeLabel: entry.label,
|
|
125
|
+
data: entry.data,
|
|
126
|
+
formatValue: valueFormatter,
|
|
127
|
+
}),
|
|
128
|
+
)
|
|
129
|
+
.join(" ")}`
|
|
130
|
+
: describeChart({ typeLabel: kind, title, data: flat, formatValue: valueFormatter }));
|
|
91
131
|
const interactive = Boolean(onDatumPress || onDatumHoverIn || onDatumHoverOut);
|
|
132
|
+
const toggle = (id: string) =>
|
|
133
|
+
setHidden((current) => {
|
|
134
|
+
const next = new Set(current);
|
|
135
|
+
if (next.has(id)) next.delete(id);
|
|
136
|
+
else next.add(id);
|
|
137
|
+
return next;
|
|
138
|
+
});
|
|
92
139
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
140
|
+
const categories: string[] = [];
|
|
141
|
+
for (const entry of all)
|
|
142
|
+
for (const datum of entry.data)
|
|
143
|
+
if (!categories.includes(datum.label)) categories.push(datum.label);
|
|
144
|
+
|
|
145
|
+
const chart = (
|
|
146
|
+
<ChartSurface
|
|
147
|
+
label={ariaLabel}
|
|
148
|
+
proof={{
|
|
149
|
+
kind: showArea ? "area" : "line",
|
|
150
|
+
separated: false,
|
|
151
|
+
datumText: false,
|
|
152
|
+
datumValues: chartDatumText(flat, valueFormatter),
|
|
153
|
+
datumCount: flat.length,
|
|
154
|
+
}}
|
|
155
|
+
height={height}
|
|
156
|
+
width={width}
|
|
157
|
+
{...(multi ? {} : stackProps)}
|
|
158
|
+
>
|
|
159
|
+
{(size) => {
|
|
160
|
+
const domain = valueDomain(flat.map((datum) => datum.value));
|
|
161
|
+
const marginScale = createLinearScale({ domain, range: [0, 1] });
|
|
162
|
+
const tickValues = getLinearTicks(marginScale, yTicks);
|
|
163
|
+
const plot = computeCartesianPlot(size, {
|
|
164
|
+
showXAxis,
|
|
165
|
+
showYAxis,
|
|
166
|
+
yTickLabels: tickValues.map((value) => format(value)),
|
|
167
|
+
fontSize: labelFontSize,
|
|
168
|
+
});
|
|
169
|
+
if (plot.width <= 0 || plot.height <= 0 || categories.length === 0) return null;
|
|
170
|
+
const xScale = createPointScale({
|
|
171
|
+
domain: categories,
|
|
172
|
+
range: [plot.x, plot.x + plot.width],
|
|
173
|
+
padding: 0.5,
|
|
174
|
+
});
|
|
175
|
+
const yScale = createLinearScale({
|
|
176
|
+
domain,
|
|
177
|
+
range: [plot.y + plot.height, plot.y],
|
|
178
|
+
});
|
|
179
|
+
return (
|
|
180
|
+
<>
|
|
181
|
+
{showYAxis || showGrid ? (
|
|
182
|
+
<YAxis
|
|
183
|
+
plot={plot}
|
|
184
|
+
scale={yScale}
|
|
185
|
+
ticks={yTicks}
|
|
186
|
+
tickFormat={(value) => format(value)}
|
|
187
|
+
showLabels={showYAxis}
|
|
188
|
+
showGrid={showGrid}
|
|
189
|
+
/>
|
|
190
|
+
) : null}
|
|
191
|
+
{all.map((entry, index) => {
|
|
192
|
+
if (hidden.has(entry.id)) return null;
|
|
193
|
+
const points = entry.data.map((datum) => ({
|
|
194
|
+
x: xScale(datum.label) ?? plot.x,
|
|
195
|
+
y: yScale(datum.value),
|
|
196
|
+
}));
|
|
197
|
+
const stroke = strokes[index] as string;
|
|
198
|
+
return (
|
|
199
|
+
<G key={entry.id}>
|
|
200
|
+
{showArea ? (
|
|
201
|
+
<AreaSeries
|
|
202
|
+
points={points}
|
|
203
|
+
baseline={plot.y + plot.height}
|
|
204
|
+
color={stroke}
|
|
205
|
+
opacity={areaOpacity}
|
|
206
|
+
curve={curve}
|
|
207
|
+
/>
|
|
208
|
+
) : null}
|
|
209
|
+
<LineSeries
|
|
210
|
+
seriesId={entry.id}
|
|
211
|
+
data={entry.data}
|
|
212
|
+
points={points}
|
|
213
|
+
color={stroke}
|
|
214
|
+
strokeWidth={strokeWidth}
|
|
215
|
+
curve={curve}
|
|
216
|
+
showPoints={showPoints}
|
|
217
|
+
marker={encodings[index]?.marker}
|
|
218
|
+
dash={encodings[index]?.dash}
|
|
219
|
+
bounds={size}
|
|
220
|
+
onDatumPress={onDatumPress}
|
|
221
|
+
onDatumHoverIn={onDatumHoverIn}
|
|
222
|
+
onDatumHoverOut={onDatumHoverOut}
|
|
223
|
+
datumLabel={
|
|
224
|
+
interactive
|
|
225
|
+
? (datum) => describeDatum({ datum, formatValue: valueFormatter })
|
|
226
|
+
: undefined
|
|
227
|
+
}
|
|
228
|
+
/>
|
|
229
|
+
</G>
|
|
230
|
+
);
|
|
231
|
+
})}
|
|
232
|
+
{showXAxis ? (
|
|
233
|
+
<XAxis
|
|
234
|
+
plot={plot}
|
|
235
|
+
scale={xScale}
|
|
236
|
+
tickValues={thinCategories(categories, plot.width, labelFontSize)}
|
|
169
237
|
/>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
238
|
+
) : null}
|
|
239
|
+
</>
|
|
240
|
+
);
|
|
241
|
+
}}
|
|
242
|
+
</ChartSurface>
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<ChartDataFrame data={flat} title={title} valueFormatter={valueFormatter} width={width}>
|
|
247
|
+
{multi ? (
|
|
248
|
+
<YStack gap="$2" {...stackProps}>
|
|
249
|
+
{chart}
|
|
250
|
+
<SeriesLegend
|
|
251
|
+
entries={all.map((entry, index) => ({
|
|
252
|
+
id: entry.id,
|
|
253
|
+
label: entry.label,
|
|
254
|
+
color: strokes[index] as string,
|
|
255
|
+
marker: encodings[index]?.marker ?? "circle",
|
|
256
|
+
dash: encodings[index]?.dash,
|
|
257
|
+
shown: !hidden.has(entry.id),
|
|
258
|
+
}))}
|
|
259
|
+
onToggle={toggle}
|
|
260
|
+
/>
|
|
261
|
+
</YStack>
|
|
262
|
+
) : (
|
|
263
|
+
chart
|
|
264
|
+
)}
|
|
185
265
|
</ChartDataFrame>
|
|
186
266
|
);
|
|
187
267
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-293 under tamagui's NATIVE build: a legend entry reaches the React Native
|
|
3
|
+
* host as a checkbox with its checked state, both as aria-checked and as
|
|
4
|
+
* accessibilityState, so VoiceOver and TalkBack read "checked" or "not
|
|
5
|
+
* checked" whatever RN version maps the aria props.
|
|
6
|
+
*/
|
|
7
|
+
import { act, createElement } from "react";
|
|
8
|
+
import { createRoot, type Root } from "react-dom/client";
|
|
9
|
+
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
|
10
|
+
|
|
11
|
+
const runtime = await vi.hoisted(async () => {
|
|
12
|
+
const { loadNativeTamagui } = await import("@multiplatform.one/test-utils/native-tamagui");
|
|
13
|
+
return loadNativeTamagui();
|
|
14
|
+
});
|
|
15
|
+
vi.mock("react-native-web", () => runtime.reactNative);
|
|
16
|
+
vi.mock("tamagui", () => ({
|
|
17
|
+
...runtime.core,
|
|
18
|
+
XStack: runtime.core.View,
|
|
19
|
+
YStack: runtime.core.View,
|
|
20
|
+
}));
|
|
21
|
+
vi.mock("@multiplatform.one/theme", () => ({
|
|
22
|
+
MIN_PRESS_TARGET: 44,
|
|
23
|
+
useResolvedKnobs: () => ({ knobProps: { body: {}, textAccentColor: "$color" } }),
|
|
24
|
+
}));
|
|
25
|
+
vi.mock("./svg", () => ({
|
|
26
|
+
Svg: () => null,
|
|
27
|
+
Line: () => null,
|
|
28
|
+
Path: () => null,
|
|
29
|
+
chartWebProps: () => ({}),
|
|
30
|
+
}));
|
|
31
|
+
const { SeriesLegend } = await import("./SeriesLegend");
|
|
32
|
+
const { TamaguiProvider, createTamagui, createTokens } = runtime.core;
|
|
33
|
+
const previousConfig = (globalThis as { __tamaguiConfig?: unknown }).__tamaguiConfig;
|
|
34
|
+
const config = createTamagui({
|
|
35
|
+
tokens: createTokens({ size: {}, space: {}, radius: {}, zIndex: {}, color: {} }),
|
|
36
|
+
themes: { light: { background: "rgb(240, 240, 240)", color: "rgb(20, 20, 20)" } },
|
|
37
|
+
shorthands: {},
|
|
38
|
+
media: {},
|
|
39
|
+
});
|
|
40
|
+
let container: HTMLDivElement;
|
|
41
|
+
let root: Root;
|
|
42
|
+
beforeAll(() => {
|
|
43
|
+
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
44
|
+
});
|
|
45
|
+
afterEach(() => {
|
|
46
|
+
act(() => root?.unmount());
|
|
47
|
+
container?.remove();
|
|
48
|
+
runtime.resetHosts();
|
|
49
|
+
});
|
|
50
|
+
afterAll(() => {
|
|
51
|
+
(globalThis as { __tamaguiConfig?: unknown }).__tamaguiConfig = previousConfig;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const entry = (id: string, shown: boolean) => ({
|
|
55
|
+
id,
|
|
56
|
+
label: id,
|
|
57
|
+
color: "rgb(0, 144, 255)",
|
|
58
|
+
marker: "circle" as const,
|
|
59
|
+
shown,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
function render(onToggle = vi.fn()) {
|
|
63
|
+
container = document.createElement("div");
|
|
64
|
+
document.body.append(container);
|
|
65
|
+
root = createRoot(container);
|
|
66
|
+
act(() =>
|
|
67
|
+
root.render(
|
|
68
|
+
createElement(
|
|
69
|
+
TamaguiProvider,
|
|
70
|
+
{ config, defaultTheme: "light" },
|
|
71
|
+
createElement(SeriesLegend, {
|
|
72
|
+
entries: [entry("Cash", true), entry("Stocks", false)],
|
|
73
|
+
onToggle,
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
76
|
+
),
|
|
77
|
+
);
|
|
78
|
+
return onToggle;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const checkboxes = () => runtime.allHostProps("View").filter((props) => props.role === "checkbox");
|
|
82
|
+
|
|
83
|
+
describe("LC-293 legend on native", () => {
|
|
84
|
+
it.each(["ios", "android"])("hands the %s host a checkbox with its checked state", (os) => {
|
|
85
|
+
(runtime.reactNative.Platform as { OS: string }).OS = os;
|
|
86
|
+
render();
|
|
87
|
+
const byLabel = new Map(checkboxes().map((props) => [props["aria-label"], props]));
|
|
88
|
+
expect(byLabel.get("Cash")).toMatchObject({
|
|
89
|
+
role: "checkbox",
|
|
90
|
+
"aria-checked": true,
|
|
91
|
+
accessibilityState: { checked: true },
|
|
92
|
+
});
|
|
93
|
+
expect(byLabel.get("Stocks")).toMatchObject({
|
|
94
|
+
role: "checkbox",
|
|
95
|
+
"aria-checked": false,
|
|
96
|
+
accessibilityState: { checked: false },
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { MIN_PRESS_TARGET, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
2
|
+
import { Text, XStack, isWeb } from "tamagui";
|
|
3
|
+
import { markerPath, type MarkerShape } from "./series";
|
|
4
|
+
import { Line, Path, Svg, chartWebProps } from "./svg";
|
|
5
|
+
|
|
6
|
+
export interface SeriesLegendEntry {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
color: string;
|
|
10
|
+
marker: MarkerShape;
|
|
11
|
+
dash?: string;
|
|
12
|
+
shown: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SeriesLegendProps {
|
|
16
|
+
entries: SeriesLegendEntry[];
|
|
17
|
+
onToggle: (id: string) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* LC-293: one checkbox per series, carrying its line, marker and name. Tapping
|
|
22
|
+
* an entry hides or shows that series. Native gets the checked state through
|
|
23
|
+
* accessibilityState as well, so it never rests on the RN version mapping
|
|
24
|
+
* aria-checked.
|
|
25
|
+
*/
|
|
26
|
+
export function SeriesLegend({ entries, onToggle }: SeriesLegendProps) {
|
|
27
|
+
const { knobProps } = useResolvedKnobs();
|
|
28
|
+
return (
|
|
29
|
+
<XStack flexWrap="wrap" columnGap="$3" {...chartWebProps({ "data-line-legend": "" })}>
|
|
30
|
+
{entries.map((entry) => (
|
|
31
|
+
<XStack
|
|
32
|
+
key={entry.id}
|
|
33
|
+
role="checkbox"
|
|
34
|
+
aria-checked={entry.shown}
|
|
35
|
+
aria-label={entry.label}
|
|
36
|
+
{...(isWeb ? {} : { accessibilityState: { checked: entry.shown } })}
|
|
37
|
+
onPress={() => onToggle(entry.id)}
|
|
38
|
+
minHeight={MIN_PRESS_TARGET}
|
|
39
|
+
alignItems="center"
|
|
40
|
+
gap="$2"
|
|
41
|
+
cursor="pointer"
|
|
42
|
+
opacity={entry.shown ? 1 : 0.45}
|
|
43
|
+
>
|
|
44
|
+
<Svg width={22} height={12}>
|
|
45
|
+
<Line
|
|
46
|
+
x1={1}
|
|
47
|
+
y1={6}
|
|
48
|
+
x2={21}
|
|
49
|
+
y2={6}
|
|
50
|
+
stroke={entry.color}
|
|
51
|
+
strokeWidth={2}
|
|
52
|
+
strokeDasharray={entry.dash}
|
|
53
|
+
/>
|
|
54
|
+
<Path d={markerPath(entry.marker, 11, 6, 3)} fill={entry.color} />
|
|
55
|
+
</Svg>
|
|
56
|
+
<Text
|
|
57
|
+
{...knobProps.body}
|
|
58
|
+
fontSize="$2"
|
|
59
|
+
color={knobProps.textAccentColor}
|
|
60
|
+
textDecorationLine={entry.shown ? "none" : "line-through"}
|
|
61
|
+
>
|
|
62
|
+
{entry.label}
|
|
63
|
+
</Text>
|
|
64
|
+
</XStack>
|
|
65
|
+
))}
|
|
66
|
+
</XStack>
|
|
67
|
+
);
|
|
68
|
+
}
|