@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.
Files changed (297) hide show
  1. package/dist/cjs/SheetModal/index.cjs +3 -5
  2. package/dist/cjs/SheetModal/index.native.js +1 -3
  3. package/dist/cjs/SheetModal/index.native.js.map +1 -1
  4. package/dist/cjs/charts/LineChart.cjs +137 -81
  5. package/dist/cjs/charts/LineChart.native.js +209 -93
  6. package/dist/cjs/charts/LineChart.native.js.map +1 -1
  7. package/dist/cjs/charts/SeriesLegend.cjs +85 -0
  8. package/dist/cjs/charts/SeriesLegend.native.js +93 -0
  9. package/dist/cjs/charts/SeriesLegend.native.js.map +1 -0
  10. package/dist/cjs/charts/series.cjs +47 -3
  11. package/dist/cjs/charts/series.native.js +49 -5
  12. package/dist/cjs/charts/series.native.js.map +1 -1
  13. package/dist/cjs/layouts/attachments.cjs +8 -4
  14. package/dist/cjs/layouts/attachments.native.js +8 -4
  15. package/dist/cjs/layouts/attachments.native.js.map +1 -1
  16. package/dist/esm/Accordion/index.native.js.map +1 -1
  17. package/dist/esm/AnimateHeight/index.native.js.map +1 -1
  18. package/dist/esm/Avatar/getInitials.native.js.map +1 -1
  19. package/dist/esm/Avatar/index.native.js.map +1 -1
  20. package/dist/esm/Badge/index.native.js.map +1 -1
  21. package/dist/esm/Button.native.js.map +1 -1
  22. package/dist/esm/Carousel/geometry.native.js.map +1 -1
  23. package/dist/esm/Carousel/index.native.js.map +1 -1
  24. package/dist/esm/ChatTurn/index.native.js.map +1 -1
  25. package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
  26. package/dist/esm/CheckGlyph/index.native.js.map +1 -1
  27. package/dist/esm/Chip/index.native.js.map +1 -1
  28. package/dist/esm/ChoiceChips/index.native.js.map +1 -1
  29. package/dist/esm/Collapsible.native.js.map +1 -1
  30. package/dist/esm/ContextMenu/index.native.js.map +1 -1
  31. package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
  32. package/dist/esm/CopyField/index.native.js.map +1 -1
  33. package/dist/esm/Dialog.native.js.map +1 -1
  34. package/dist/esm/Diff/diff.native.js.map +1 -1
  35. package/dist/esm/Diff/index.native.js.map +1 -1
  36. package/dist/esm/DotIndicator/index.native.js.map +1 -1
  37. package/dist/esm/DrillStack/DrillBar.native.js.map +1 -1
  38. package/dist/esm/DrillStack/context.native.js.map +1 -1
  39. package/dist/esm/DrillStack/drillMotion.native.js.map +1 -1
  40. package/dist/esm/DropDownPanel/index.native.js.map +1 -1
  41. package/dist/esm/DropdownMenu/index.native.js.map +1 -1
  42. package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
  43. package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
  44. package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
  45. package/dist/esm/Heading.native.js.map +1 -1
  46. package/dist/esm/Kbd/index.native.js.map +1 -1
  47. package/dist/esm/Kbd/keys.native.js.map +1 -1
  48. package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
  49. package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
  50. package/dist/esm/Lightbox/shared.native.js.map +1 -1
  51. package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
  52. package/dist/esm/MachineLiteral/index.native.js.map +1 -1
  53. package/dist/esm/Material/index.native.js.map +1 -1
  54. package/dist/esm/Meter/index.native.js.map +1 -1
  55. package/dist/esm/Meter/meter.native.js.map +1 -1
  56. package/dist/esm/MiddleEllipsisText/middleSplit.native.js.map +1 -1
  57. package/dist/esm/MiddleEllipsisText/types.native.js.map +1 -1
  58. package/dist/esm/Pagination.native.js.map +1 -1
  59. package/dist/esm/Popover.native.js.map +1 -1
  60. package/dist/esm/ProgressSteps/index.native.js.map +1 -1
  61. package/dist/esm/Quote/index.native.js.map +1 -1
  62. package/dist/esm/SchemeToggle/index.native.js.map +1 -1
  63. package/dist/esm/ScrollView.native.js.map +1 -1
  64. package/dist/esm/Separator/index.native.js.map +1 -1
  65. package/dist/esm/Sheet.native.js.map +1 -1
  66. package/dist/esm/SheetModal/SheetBodyRegion.native.js.map +1 -1
  67. package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
  68. package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
  69. package/dist/esm/SheetModal/detents.native.js.map +1 -1
  70. package/dist/esm/SheetModal/index.mjs +3 -5
  71. package/dist/esm/SheetModal/index.mjs.map +1 -1
  72. package/dist/esm/SheetModal/index.native.js +1 -3
  73. package/dist/esm/SheetModal/index.native.js.map +1 -1
  74. package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
  75. package/dist/esm/SheetScrollView/index.native.js.map +1 -1
  76. package/dist/esm/SheetScrollView/sheetHandoff.native.js.map +1 -1
  77. package/dist/esm/Skeleton/index.native.js.map +1 -1
  78. package/dist/esm/SkipLink/index.native.js.map +1 -1
  79. package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
  80. package/dist/esm/SortableList/index.native.js.map +1 -1
  81. package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
  82. package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
  83. package/dist/esm/SwipeDismissRow/index.native.js.map +1 -1
  84. package/dist/esm/Tabs/index.native.js.map +1 -1
  85. package/dist/esm/Text.native.js.map +1 -1
  86. package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
  87. package/dist/esm/Toast/index.native.js.map +1 -1
  88. package/dist/esm/Toast/store.native.js.map +1 -1
  89. package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
  90. package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
  91. package/dist/esm/TreeSelect/index.native.js.map +1 -1
  92. package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
  93. package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
  94. package/dist/esm/Video/VideoFrame.native.js.map +1 -1
  95. package/dist/esm/Video/types.native.js.map +1 -1
  96. package/dist/esm/Wheel/index.native.js.map +1 -1
  97. package/dist/esm/Wizard/index.native.js.map +1 -1
  98. package/dist/esm/actions/ActionBar.native.js.map +1 -1
  99. package/dist/esm/actions/DangerSection.native.js.map +1 -1
  100. package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
  101. package/dist/esm/actions/HeaderActions.native.js.map +1 -1
  102. package/dist/esm/actions/StandardAction.native.js.map +1 -1
  103. package/dist/esm/actions/devWarn.native.js.map +1 -1
  104. package/dist/esm/actions/index.native.js.map +1 -1
  105. package/dist/esm/actions/severity.native.js.map +1 -1
  106. package/dist/esm/appShell/AppShell.native.js.map +1 -1
  107. package/dist/esm/appShell/BottomChromeClearance.native.js.map +1 -1
  108. package/dist/esm/appShell/Dock.native.js.map +1 -1
  109. package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
  110. package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
  111. package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
  112. package/dist/esm/appShell/Springboard.native.js.map +1 -1
  113. package/dist/esm/appShell/SystemBar.native.js.map +1 -1
  114. package/dist/esm/appShell/TabBar.native.js.map +1 -1
  115. package/dist/esm/appShell/appTile.native.js.map +1 -1
  116. package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
  117. package/dist/esm/appShell/index.native.js.map +1 -1
  118. package/dist/esm/appShell/stackBack.native.js.map +1 -1
  119. package/dist/esm/appShell/systemBarFit.native.js.map +1 -1
  120. package/dist/esm/charts/Axis.native.js.map +1 -1
  121. package/dist/esm/charts/BarChart.native.js.map +1 -1
  122. package/dist/esm/charts/ChartDataView.native.js.map +1 -1
  123. package/dist/esm/charts/ChartSurface.native.js.map +1 -1
  124. package/dist/esm/charts/LineChart.mjs +138 -82
  125. package/dist/esm/charts/LineChart.mjs.map +1 -1
  126. package/dist/esm/charts/LineChart.native.js +210 -94
  127. package/dist/esm/charts/LineChart.native.js.map +1 -1
  128. package/dist/esm/charts/PieChart.native.js.map +1 -1
  129. package/dist/esm/charts/SeriesLegend.mjs +60 -0
  130. package/dist/esm/charts/SeriesLegend.mjs.map +1 -0
  131. package/dist/esm/charts/SeriesLegend.native.js +65 -0
  132. package/dist/esm/charts/SeriesLegend.native.js.map +1 -0
  133. package/dist/esm/charts/Sparkline.native.js.map +1 -1
  134. package/dist/esm/charts/accessibility.native.js.map +1 -1
  135. package/dist/esm/charts/chartHeight.native.js.map +1 -1
  136. package/dist/esm/charts/composeChart.native.js.map +1 -1
  137. package/dist/esm/charts/index.native.js.map +1 -1
  138. package/dist/esm/charts/math.native.js.map +1 -1
  139. package/dist/esm/charts/series.mjs +43 -3
  140. package/dist/esm/charts/series.mjs.map +1 -1
  141. package/dist/esm/charts/series.native.js +45 -5
  142. package/dist/esm/charts/series.native.js.map +1 -1
  143. package/dist/esm/charts/svg.native.js.map +1 -1
  144. package/dist/esm/charts/types.native.js.map +1 -1
  145. package/dist/esm/charts/useChartTheme.native.js.map +1 -1
  146. package/dist/esm/code/Code/index.native.js.map +1 -1
  147. package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
  148. package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
  149. package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
  150. package/dist/esm/code/Highlighter/index.native.js.map +1 -1
  151. package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
  152. package/dist/esm/code/HoldSelect/tapGate.native.js.map +1 -1
  153. package/dist/esm/code/LogView.native.js.map +1 -1
  154. package/dist/esm/code/PayloadView/index.native.js.map +1 -1
  155. package/dist/esm/code/PayloadView/payloadModel.native.js.map +1 -1
  156. package/dist/esm/code/Pre/index.native.js.map +1 -1
  157. package/dist/esm/code/index.native.js.map +1 -1
  158. package/dist/esm/componentColors.native.js.map +1 -1
  159. package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
  160. package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
  161. package/dist/esm/feedback/copy.native.js.map +1 -1
  162. package/dist/esm/feedback/index.native.js.map +1 -1
  163. package/dist/esm/feedback/notify.native.js.map +1 -1
  164. package/dist/esm/feedback/route.native.js.map +1 -1
  165. package/dist/esm/feedback/store.native.js.map +1 -1
  166. package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
  167. package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
  168. package/dist/esm/formLayouts/SingleTaskColumn.native.js.map +1 -1
  169. package/dist/esm/formLayouts/index.native.js.map +1 -1
  170. package/dist/esm/hooks/index.native.js.map +1 -1
  171. package/dist/esm/hooks/useClipboard.native.js.map +1 -1
  172. package/dist/esm/hooks/useDirection.native.js.map +1 -1
  173. package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
  174. package/dist/esm/icons/CheckRegular.native.js.map +1 -1
  175. package/dist/esm/icons/MinusRegular.native.js.map +1 -1
  176. package/dist/esm/icons/index.native.js.map +1 -1
  177. package/dist/esm/icons/lucide.native.js.map +1 -1
  178. package/dist/esm/icons/themed.native.js.map +1 -1
  179. package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
  180. package/dist/esm/images/Image/framing.native.js.map +1 -1
  181. package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
  182. package/dist/esm/images/Image/shared.native.js.map +1 -1
  183. package/dist/esm/images/Image/types.native.js.map +1 -1
  184. package/dist/esm/images/RemoteArt/remoteArtCache.native.js.map +1 -1
  185. package/dist/esm/images/RemoteArt/svgMarkup.native.js.map +1 -1
  186. package/dist/esm/images/RemoteArt/types.native.js.map +1 -1
  187. package/dist/esm/images/index.native.js.map +1 -1
  188. package/dist/esm/index.gnome.native.js.map +1 -1
  189. package/dist/esm/index.native.js.map +1 -1
  190. package/dist/esm/knobImmuneExports.native.js.map +1 -1
  191. package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
  192. package/dist/esm/layouts/Debug/index.native.js.map +1 -1
  193. package/dist/esm/layouts/EmptyState.native.js.map +1 -1
  194. package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
  195. package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
  196. package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
  197. package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
  198. package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
  199. package/dist/esm/layouts/StatusDot.native.js.map +1 -1
  200. package/dist/esm/layouts/StatusGlyphStrip.native.js.map +1 -1
  201. package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
  202. package/dist/esm/layouts/asyncFailure.native.js.map +1 -1
  203. package/dist/esm/layouts/attachments.mjs +8 -4
  204. package/dist/esm/layouts/attachments.mjs.map +1 -1
  205. package/dist/esm/layouts/attachments.native.js +8 -4
  206. package/dist/esm/layouts/attachments.native.js.map +1 -1
  207. package/dist/esm/layouts/barTitleSpan.native.js.map +1 -1
  208. package/dist/esm/layouts/bottomAccessory.native.js.map +1 -1
  209. package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
  210. package/dist/esm/layouts/index.native.js.map +1 -1
  211. package/dist/esm/layouts/page.native.js.map +1 -1
  212. package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
  213. package/dist/esm/layouts/screenScroll.native.js.map +1 -1
  214. package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
  215. package/dist/esm/layouts/sidebar.native.js.map +1 -1
  216. package/dist/esm/layouts/tags.native.js.map +1 -1
  217. package/dist/esm/layouts/timeline.native.js.map +1 -1
  218. package/dist/esm/layouts/toolbar.native.js.map +1 -1
  219. package/dist/esm/shared/actionScan.native.js.map +1 -1
  220. package/dist/esm/shared/i18n.native.js.map +1 -1
  221. package/dist/esm/shared/restoreRetries.native.js.map +1 -1
  222. package/dist/esm/shared/t.native.js.map +1 -1
  223. package/dist/esm/shared/textRidesText.native.js.map +1 -1
  224. package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
  225. package/dist/esm/surfaces.native.js.map +1 -1
  226. package/dist/esm/tamagui.native.js.map +1 -1
  227. package/dist/esm/testSetup.native.js.map +1 -1
  228. package/dist/esm/utils/unwrapText.native.js.map +1 -1
  229. package/dist/esm/views/Calendar.native.js.map +1 -1
  230. package/dist/esm/views/CardGrid.native.js.map +1 -1
  231. package/dist/esm/views/Dashboard.native.js.map +1 -1
  232. package/dist/esm/views/FilePreview.native.js.map +1 -1
  233. package/dist/esm/views/Gantt.native.js.map +1 -1
  234. package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
  235. package/dist/esm/views/ImageGrid.native.js.map +1 -1
  236. package/dist/esm/views/List.native.js.map +1 -1
  237. package/dist/esm/views/ListGroup.native.js.map +1 -1
  238. package/dist/esm/views/ListRow.native.js.map +1 -1
  239. package/dist/esm/views/Matrix.native.js.map +1 -1
  240. package/dist/esm/views/ReportBuilder.native.js.map +1 -1
  241. package/dist/esm/views/ShortcutCard.native.js.map +1 -1
  242. package/dist/esm/views/TreeView.native.js.map +1 -1
  243. package/dist/esm/views/calendarMath.native.js.map +1 -1
  244. package/dist/esm/views/ganttIntervals.native.js.map +1 -1
  245. package/dist/esm/views/ganttMath.native.js.map +1 -1
  246. package/dist/esm/views/index.native.js.map +1 -1
  247. package/dist/esm/views/kanbanDnd.native.js.map +1 -1
  248. package/dist/esm/views/matrixMath.native.js.map +1 -1
  249. package/dist/esm/views/sameNameScope.native.js.map +1 -1
  250. package/dist/esm/views/treeViewDnd.native.js.map +1 -1
  251. package/dist/esm/views/treeViewLayout.native.js.map +1 -1
  252. package/dist/esm/views/treeViewMotion.native.js.map +1 -1
  253. package/dist/esm/views/treeViewReveal.native.js.map +1 -1
  254. package/dist/esm/views/usePageFlowLoadMore.native.js.map +1 -1
  255. package/dist/esm/views/widgetChrome.native.js.map +1 -1
  256. package/dist/jsx/SheetModal/index.mjs +3 -5
  257. package/dist/jsx/SheetModal/index.mjs.map +1 -1
  258. package/dist/jsx/SheetModal/index.native.js +1 -3
  259. package/dist/jsx/SheetModal/index.native.js.map +1 -1
  260. package/dist/jsx/charts/LineChart.mjs +138 -82
  261. package/dist/jsx/charts/LineChart.mjs.map +1 -1
  262. package/dist/jsx/charts/LineChart.native.js +209 -93
  263. package/dist/jsx/charts/LineChart.native.js.map +1 -1
  264. package/dist/jsx/charts/SeriesLegend.mjs +60 -0
  265. package/dist/jsx/charts/SeriesLegend.mjs.map +1 -0
  266. package/dist/jsx/charts/SeriesLegend.native.js +93 -0
  267. package/dist/jsx/charts/SeriesLegend.native.js.map +1 -0
  268. package/dist/jsx/charts/series.mjs +43 -3
  269. package/dist/jsx/charts/series.mjs.map +1 -1
  270. package/dist/jsx/charts/series.native.js +49 -5
  271. package/dist/jsx/charts/series.native.js.map +1 -1
  272. package/dist/jsx/layouts/attachments.mjs +8 -4
  273. package/dist/jsx/layouts/attachments.mjs.map +1 -1
  274. package/dist/jsx/layouts/attachments.native.js +8 -4
  275. package/dist/jsx/layouts/attachments.native.js.map +1 -1
  276. package/package.json +7 -7
  277. package/src/Pagination.spec.tsx +1 -1
  278. package/src/SheetModal/SheetModal.noEdge.spec.tsx +63 -0
  279. package/src/SheetModal/index.native.tsx +1 -3
  280. package/src/SheetModal/index.tsx +3 -3
  281. package/src/actions/ActionButton.spec.tsx +6 -6
  282. package/src/charts/Charts.stories.tsx +25 -0
  283. package/src/charts/LineChart.tsx +185 -105
  284. package/src/charts/SeriesLegend.native.spec.tsx +99 -0
  285. package/src/charts/SeriesLegend.tsx +68 -0
  286. package/src/charts/multiSeriesLine.spec.tsx +111 -0
  287. package/src/charts/series.tsx +73 -11
  288. package/src/layouts/attachments.dropTarget.spec.tsx +91 -0
  289. package/src/layouts/attachments.tsx +12 -4
  290. package/types/SheetModal/index.native.d.ts.map +1 -1
  291. package/types/charts/LineChart.d.ts +21 -5
  292. package/types/charts/LineChart.d.ts.map +1 -1
  293. package/types/charts/SeriesLegend.d.ts +21 -0
  294. package/types/charts/SeriesLegend.d.ts.map +1 -0
  295. package/types/charts/series.d.ts +18 -1
  296. package/types/charts/series.d.ts.map +1 -1
  297. package/types/layouts/attachments.d.ts.map +1 -1
@@ -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: only its top edge meets the page. */
119
- const bottomEdges = { borderLeftWidth: 0, borderRightWidth: 0, borderBottomWidth: 0 } as 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) : bottomEdges)}
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 a bare glyph, bold mono in content", () => {
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" : "neutral",
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("neutral");
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 a bare glyph named Import, by default and by a sharper label (FZ-11009)", () => {
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("neutral");
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">
@@ -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
- data: ChartDatum[];
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
- * Single-series line chart over category points: d3 point/linear scales,
52
- * knob-driven chrome, palette identity stroke, 44px point hit targets.
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
- // One line = one series: explicit `color` is a data value and passes
80
- // through; the default is the theme identity (LC-27).
81
- const stroke = color ?? palette.single;
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
- describeChart({
86
- typeLabel: typeLabel ?? (showArea ? t("Area chart") : t("Line chart")),
87
- title,
88
- data,
89
- formatValue: valueFormatter,
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
- return (
94
- <ChartDataFrame data={data} title={title} valueFormatter={valueFormatter} width={width}>
95
- <ChartSurface
96
- label={ariaLabel}
97
- proof={{
98
- kind: showArea ? "area" : "line",
99
- separated: false,
100
- datumText: false,
101
- datumValues: chartDatumText(data, valueFormatter),
102
- datumCount: data.length,
103
- }}
104
- height={height}
105
- width={width}
106
- {...stackProps}
107
- >
108
- {(size) => {
109
- const domain = valueDomain(data.map((datum) => datum.value));
110
- const marginScale = createLinearScale({ domain, range: [0, 1] });
111
- const tickValues = getLinearTicks(marginScale, yTicks);
112
- const plot = computeCartesianPlot(size, {
113
- showXAxis,
114
- showYAxis,
115
- yTickLabels: tickValues.map((value) => format(value)),
116
- fontSize: labelFontSize,
117
- });
118
- if (plot.width <= 0 || plot.height <= 0 || data.length === 0) return null;
119
- const xScale = createPointScale({
120
- domain: data.map((datum) => datum.label),
121
- range: [plot.x, plot.x + plot.width],
122
- padding: 0.5,
123
- });
124
- const yScale = createLinearScale({
125
- domain,
126
- range: [plot.y + plot.height, plot.y],
127
- });
128
- const points = data.map((datum) => ({
129
- x: xScale(datum.label) ?? plot.x,
130
- y: yScale(datum.value),
131
- }));
132
- return (
133
- <>
134
- {showYAxis || showGrid ? (
135
- <YAxis
136
- plot={plot}
137
- scale={yScale}
138
- ticks={yTicks}
139
- tickFormat={(value) => format(value)}
140
- showLabels={showYAxis}
141
- showGrid={showGrid}
142
- />
143
- ) : null}
144
- {showArea ? (
145
- <AreaSeries
146
- points={points}
147
- baseline={plot.y + plot.height}
148
- color={stroke}
149
- opacity={areaOpacity}
150
- curve={curve}
151
- />
152
- ) : null}
153
- <LineSeries
154
- data={data}
155
- points={points}
156
- color={stroke}
157
- strokeWidth={strokeWidth}
158
- curve={curve}
159
- showPoints={showPoints}
160
- bounds={size}
161
- onDatumPress={onDatumPress}
162
- onDatumHoverIn={onDatumHoverIn}
163
- onDatumHoverOut={onDatumHoverOut}
164
- datumLabel={
165
- interactive
166
- ? (datum) => describeDatum({ datum, formatValue: valueFormatter })
167
- : undefined
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
- {showXAxis ? (
171
- <XAxis
172
- plot={plot}
173
- scale={xScale}
174
- tickValues={thinCategories(
175
- data.map((datum) => datum.label),
176
- plot.width,
177
- labelFontSize,
178
- )}
179
- />
180
- ) : null}
181
- </>
182
- );
183
- }}
184
- </ChartSurface>
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
+ }