@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43

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 (298) hide show
  1. package/dist/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
  2. package/dist/app-shell.js +1 -1
  3. package/dist/attachment-TZykYNu5.js +300 -0
  4. package/dist/attachment.js +2 -2
  5. package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
  6. package/dist/avatar-group.js +1 -1
  7. package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
  8. package/dist/carousel.js +1 -1
  9. package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
  10. package/dist/command-palette.js +1 -1
  11. package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
  12. package/dist/data-grid.js +1 -1
  13. package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
  14. package/dist/data-list.js +1 -1
  15. package/dist/detail-panel-Cke3ZFU3.js +342 -0
  16. package/dist/detail-panel.js +2 -2
  17. package/dist/docs/action-bar.examples.md +768 -0
  18. package/dist/docs/action-bar.json +74 -50
  19. package/dist/docs/action-bar.md +49 -311
  20. package/dist/docs/app-shell.examples.md +1221 -64
  21. package/dist/docs/app-shell.json +92 -60
  22. package/dist/docs/app-shell.md +92 -57
  23. package/dist/docs/attachment.examples.md +689 -0
  24. package/dist/docs/attachment.json +69 -37
  25. package/dist/docs/attachment.md +44 -203
  26. package/dist/docs/avatar-group.json +111 -23
  27. package/dist/docs/avatar-group.md +487 -28
  28. package/dist/docs/button-group.json +98 -2
  29. package/dist/docs/button-group.md +411 -8
  30. package/dist/docs/calendar.examples.md +512 -0
  31. package/dist/docs/calendar.json +72 -24
  32. package/dist/docs/calendar.md +18 -147
  33. package/dist/docs/carousel.examples.md +868 -0
  34. package/dist/docs/carousel.json +58 -50
  35. package/dist/docs/carousel.md +66 -300
  36. package/dist/docs/cascader.examples.md +1269 -0
  37. package/dist/docs/cascader.json +72 -16
  38. package/dist/docs/cascader.md +78 -154
  39. package/dist/docs/chart.examples.md +734 -24
  40. package/dist/docs/chart.json +93 -13
  41. package/dist/docs/chart.md +28 -7
  42. package/dist/docs/clock.json +71 -15
  43. package/dist/docs/clock.md +326 -21
  44. package/dist/docs/code-block.json +79 -55
  45. package/dist/docs/code-block.md +417 -74
  46. package/dist/docs/color-picker.json +60 -12
  47. package/dist/docs/color-picker.md +245 -22
  48. package/dist/docs/column-manager.examples.md +764 -0
  49. package/dist/docs/column-manager.json +68 -12
  50. package/dist/docs/column-manager.md +44 -203
  51. package/dist/docs/command-palette.examples.md +747 -0
  52. package/dist/docs/command-palette.json +48 -24
  53. package/dist/docs/command-palette.md +60 -339
  54. package/dist/docs/currency-field.examples.md +355 -73
  55. package/dist/docs/currency-field.json +96 -64
  56. package/dist/docs/currency-field.md +57 -50
  57. package/dist/docs/dashboard-grid.examples.md +629 -0
  58. package/dist/docs/dashboard-grid.json +64 -16
  59. package/dist/docs/dashboard-grid.md +34 -152
  60. package/dist/docs/data-list.examples.md +1556 -0
  61. package/dist/docs/data-list.json +58 -18
  62. package/dist/docs/data-list.md +139 -224
  63. package/dist/docs/date-field.examples.md +543 -0
  64. package/dist/docs/date-field.json +64 -24
  65. package/dist/docs/date-field.md +22 -168
  66. package/dist/docs/datetime-field.examples.md +699 -0
  67. package/dist/docs/datetime-field.json +79 -31
  68. package/dist/docs/datetime-field.md +24 -269
  69. package/dist/docs/datetime-range-picker.examples.md +682 -0
  70. package/dist/docs/datetime-range-picker.json +117 -61
  71. package/dist/docs/datetime-range-picker.md +59 -224
  72. package/dist/docs/description-list.examples.md +652 -0
  73. package/dist/docs/description-list.json +49 -25
  74. package/dist/docs/description-list.md +33 -188
  75. package/dist/docs/detail-panel.examples.md +1177 -0
  76. package/dist/docs/detail-panel.json +69 -53
  77. package/dist/docs/detail-panel.md +114 -324
  78. package/dist/docs/entity-picker.examples.md +1037 -0
  79. package/dist/docs/entity-picker.json +66 -18
  80. package/dist/docs/entity-picker.md +56 -246
  81. package/dist/docs/event-calendar.examples.md +749 -49
  82. package/dist/docs/event-calendar.json +46 -22
  83. package/dist/docs/event-calendar.md +81 -11
  84. package/dist/docs/field-group.examples.md +554 -0
  85. package/dist/docs/field-group.json +98 -34
  86. package/dist/docs/field-group.md +55 -133
  87. package/dist/docs/filter-bar.examples.md +772 -0
  88. package/dist/docs/filter-bar.json +41 -25
  89. package/dist/docs/filter-bar.md +42 -246
  90. package/dist/docs/form.examples.md +579 -0
  91. package/dist/docs/form.json +87 -39
  92. package/dist/docs/form.md +53 -177
  93. package/dist/docs/fullscreen.examples.md +558 -0
  94. package/dist/docs/fullscreen.json +58 -18
  95. package/dist/docs/fullscreen.md +50 -169
  96. package/dist/docs/highlight.json +57 -25
  97. package/dist/docs/highlight.md +402 -50
  98. package/dist/docs/icon.json +85 -5
  99. package/dist/docs/icon.md +401 -10
  100. package/dist/docs/image.examples.md +670 -0
  101. package/dist/docs/image.json +44 -28
  102. package/dist/docs/image.md +24 -176
  103. package/dist/docs/import-export-center.examples.md +1280 -0
  104. package/dist/docs/import-export-center.json +67 -27
  105. package/dist/docs/import-export-center.md +121 -226
  106. package/dist/docs/list-item.examples.md +769 -0
  107. package/dist/docs/list-item.json +110 -38
  108. package/dist/docs/list-item.md +84 -201
  109. package/dist/docs/listbox.examples.md +858 -0
  110. package/dist/docs/listbox.json +76 -28
  111. package/dist/docs/listbox.md +41 -263
  112. package/dist/docs/markdown.json +79 -55
  113. package/dist/docs/markdown.md +581 -85
  114. package/dist/docs/media-viewer.examples.md +1038 -0
  115. package/dist/docs/media-viewer.json +70 -15
  116. package/dist/docs/media-viewer.md +84 -135
  117. package/dist/docs/message-scroller.examples.md +1193 -0
  118. package/dist/docs/message-scroller.json +41 -17
  119. package/dist/docs/message-scroller.md +80 -134
  120. package/dist/docs/message.examples.md +944 -0
  121. package/dist/docs/message.json +64 -16
  122. package/dist/docs/message.md +34 -326
  123. package/dist/docs/meter.json +58 -26
  124. package/dist/docs/meter.md +312 -32
  125. package/dist/docs/navigation-menu.examples.md +1107 -0
  126. package/dist/docs/navigation-menu.json +57 -41
  127. package/dist/docs/navigation-menu.md +105 -298
  128. package/dist/docs/notification-center.examples.md +1045 -0
  129. package/dist/docs/notification-center.json +71 -15
  130. package/dist/docs/notification-center.md +76 -266
  131. package/dist/docs/otp-input.examples.md +490 -0
  132. package/dist/docs/otp-input.json +65 -25
  133. package/dist/docs/otp-input.md +20 -191
  134. package/dist/docs/page-header.examples.md +1041 -0
  135. package/dist/docs/page-header.json +75 -43
  136. package/dist/docs/page-header.md +79 -291
  137. package/dist/docs/page.examples.md +633 -0
  138. package/dist/docs/page.json +48 -16
  139. package/dist/docs/page.md +62 -129
  140. package/dist/docs/prompt-composer.examples.md +630 -0
  141. package/dist/docs/prompt-composer.json +66 -18
  142. package/dist/docs/prompt-composer.md +35 -161
  143. package/dist/docs/prose.json +69 -37
  144. package/dist/docs/prose.md +393 -75
  145. package/dist/docs/rating.examples.md +525 -0
  146. package/dist/docs/rating.json +92 -28
  147. package/dist/docs/rating.md +27 -241
  148. package/dist/docs/saved-views.examples.md +1108 -0
  149. package/dist/docs/saved-views.json +53 -21
  150. package/dist/docs/saved-views.md +86 -171
  151. package/dist/docs/scroll-area.examples.md +837 -0
  152. package/dist/docs/scroll-area.json +64 -24
  153. package/dist/docs/scroll-area.md +57 -140
  154. package/dist/docs/section.examples.md +676 -0
  155. package/dist/docs/section.json +68 -20
  156. package/dist/docs/section.md +39 -162
  157. package/dist/docs/segmented-control.examples.md +480 -0
  158. package/dist/docs/segmented-control.json +76 -28
  159. package/dist/docs/segmented-control.md +20 -191
  160. package/dist/docs/side-navigation.examples.md +1468 -0
  161. package/dist/docs/side-navigation.json +53 -53
  162. package/dist/docs/side-navigation.md +79 -354
  163. package/dist/docs/slider.examples.md +505 -0
  164. package/dist/docs/slider.json +91 -51
  165. package/dist/docs/slider.md +47 -212
  166. package/dist/docs/sparkline.json +60 -36
  167. package/dist/docs/sparkline.md +447 -71
  168. package/dist/docs/split-button.examples.md +509 -0
  169. package/dist/docs/split-button.json +73 -41
  170. package/dist/docs/split-button.md +64 -194
  171. package/dist/docs/splitter.examples.md +921 -0
  172. package/dist/docs/splitter.json +94 -46
  173. package/dist/docs/splitter.md +75 -182
  174. package/dist/docs/stat-card.examples.md +725 -0
  175. package/dist/docs/stat-card.json +89 -41
  176. package/dist/docs/stat-card.md +55 -227
  177. package/dist/docs/status-indicator.json +80 -32
  178. package/dist/docs/status-indicator.md +409 -65
  179. package/dist/docs/stepper.json +53 -21
  180. package/dist/docs/stepper.md +369 -48
  181. package/dist/docs/table-of-contents.examples.md +550 -0
  182. package/dist/docs/table-of-contents.json +60 -28
  183. package/dist/docs/table-of-contents.md +70 -205
  184. package/dist/docs/tags-input.examples.md +541 -0
  185. package/dist/docs/tags-input.json +64 -16
  186. package/dist/docs/tags-input.md +15 -262
  187. package/dist/docs/time-field.examples.md +587 -0
  188. package/dist/docs/time-field.json +69 -29
  189. package/dist/docs/time-field.md +21 -223
  190. package/dist/docs/time-picker.json +117 -53
  191. package/dist/docs/time-picker.md +499 -54
  192. package/dist/docs/time-range-picker.examples.md +750 -0
  193. package/dist/docs/time-range-picker.json +139 -75
  194. package/dist/docs/time-range-picker.md +63 -225
  195. package/dist/docs/timeline.examples.md +617 -0
  196. package/dist/docs/timeline.json +44 -28
  197. package/dist/docs/timeline.md +34 -208
  198. package/dist/docs/toolbar.json +56 -16
  199. package/dist/docs/toolbar.md +357 -63
  200. package/dist/docs/top-navigation.examples.md +1206 -140
  201. package/dist/docs/top-navigation.json +49 -33
  202. package/dist/docs/top-navigation.md +87 -36
  203. package/dist/docs/tour.examples.md +960 -0
  204. package/dist/docs/tour.json +57 -25
  205. package/dist/docs/tour.md +60 -244
  206. package/dist/docs/transfer.examples.md +631 -0
  207. package/dist/docs/transfer.json +80 -16
  208. package/dist/docs/transfer.md +41 -170
  209. package/dist/docs/typography.json +96 -0
  210. package/dist/docs/typography.md +352 -4
  211. package/dist/docs/upload.examples.md +555 -53
  212. package/dist/docs/upload.json +62 -30
  213. package/dist/docs/upload.md +46 -11
  214. package/dist/docs/wizard.examples.md +1389 -0
  215. package/dist/docs/wizard.json +89 -49
  216. package/dist/docs/wizard.md +122 -263
  217. package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
  218. package/dist/entity-picker.js +1 -1
  219. package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
  220. package/dist/event-calendar.js +1 -1
  221. package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
  222. package/dist/filter-bar.js +1 -1
  223. package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
  224. package/dist/import-export-center.js +1 -1
  225. package/dist/index.js +58 -58
  226. package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
  227. package/dist/markdown.js +1 -1
  228. package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
  229. package/dist/media-viewer.js +2 -2
  230. package/dist/message-P91bEGyV.js +455 -0
  231. package/dist/message.js +2 -2
  232. package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
  233. package/dist/page-header.js +1 -1
  234. package/dist/section-CVTQdWBl.js +216 -0
  235. package/dist/section.js +2 -2
  236. package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
  237. package/dist/segmented-control.js +1 -1
  238. package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
  239. package/dist/side-navigation.js +1 -1
  240. package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
  241. package/dist/stat-card.js +1 -1
  242. package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
  243. package/dist/stepper.js +2 -2
  244. package/dist/styles/carousel.css +1 -1
  245. package/dist/styles/index.css +1 -1
  246. package/dist/styles.css +1 -1
  247. package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
  248. package/dist/timeline.js +1 -1
  249. package/dist/top-navigation-YSEQzBhD.js +744 -0
  250. package/dist/top-navigation.js +2 -2
  251. package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
  252. package/dist/transfer.js +1 -1
  253. package/dist/types/attachment/attachment-parts.d.ts +24 -11
  254. package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
  255. package/dist/types/attachment/attachment.d.ts +3 -3
  256. package/dist/types/attachment/attachment.d.ts.map +1 -1
  257. package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
  258. package/dist/types/carousel/carousel-parts.d.ts +2 -2
  259. package/dist/types/command-palette/command-palette.d.ts.map +1 -1
  260. package/dist/types/data-list/data-list.d.ts.map +1 -1
  261. package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
  262. package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
  263. package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
  264. package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
  265. package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
  266. package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
  267. package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
  268. package/dist/types/media-viewer/index.d.ts +2 -2
  269. package/dist/types/media-viewer/index.d.ts.map +1 -1
  270. package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
  271. package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
  272. package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
  273. package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
  274. package/dist/types/message/message-parts.d.ts +7 -0
  275. package/dist/types/message/message-parts.d.ts.map +1 -1
  276. package/dist/types/message/message.d.ts.map +1 -1
  277. package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
  278. package/dist/types/section/section-parts.d.ts +16 -8
  279. package/dist/types/section/section-parts.d.ts.map +1 -1
  280. package/dist/types/section/section.d.ts.map +1 -1
  281. package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
  282. package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
  283. package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
  284. package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
  285. package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
  286. package/dist/types/stepper/stepper-parts.d.ts +11 -2
  287. package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
  288. package/dist/types/stepper/stepper.d.ts.map +1 -1
  289. package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
  290. package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
  291. package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
  292. package/dist/wizard.js +1 -1
  293. package/package.json +6 -6
  294. package/dist/attachment-MqczA38F.js +0 -292
  295. package/dist/detail-panel-EImAtksY.js +0 -327
  296. package/dist/message-D1Dd6Y2k.js +0 -452
  297. package/dist/section-D_qOfdxR.js +0 -213
  298. package/dist/top-navigation-D8IHPOmm.js +0 -744
@@ -1173,7 +1173,7 @@
1173
1173
  "title": "Playground",
1174
1174
  "note": "One chart driven by the controls: kind, size, variant, palette, toolbar, trigger and legend. Hover, then Tab into the plot and walk it with the arrows.",
1175
1175
  "language": "tsx",
1176
- "source": "<Chart\n data={monthly}\n series={[{ kind: 'line', field: 'revenue', label: 'Receita' }]}\n title=\"Receita\"\n x={{ field: 'month' }}\n/>;\n",
1176
+ "source": "<Chart\n data={monthly}\n series={[{ kind: 'line', field: 'revenue', label: 'Revenue' }]}\n title=\"Revenue\"\n x={{ field: 'month' }}\n/>;\n",
1177
1177
  "verdict": "excerpt"
1178
1178
  },
1179
1179
  {
@@ -1229,7 +1229,7 @@
1229
1229
  "title": "Bars and a line on one axis",
1230
1230
  "note": "Revenue as bars and the target as a dashed line with markers: one kind per meaning, one scale for both.",
1231
1231
  "language": "tsx",
1232
- "source": "const series: ChartSeries[] = [\n { kind: 'bar', field: 'revenue', label: 'Receita' },\n {\n kind: 'line',\n field: 'target',\n label: 'Meta',\n tone: 'neutral',\n stroke: 'dashed',\n markers: 'all',\n },\n];\n",
1232
+ "source": "const series: ChartSeries[] = [\n { kind: 'bar', field: 'revenue', label: 'Revenue' },\n {\n kind: 'line',\n field: 'target',\n label: 'Target',\n tone: 'neutral',\n stroke: 'dashed',\n markers: 'all',\n },\n];\n",
1233
1233
  "verdict": "excerpt"
1234
1234
  },
1235
1235
  {
@@ -1269,7 +1269,7 @@
1269
1269
  "title": "A donut with the total inside",
1270
1270
  "note": "innerRadius opens the middle, and the center holds the total; legendValues puts each slice’s value beside its name. slotField and toneField give each slice the slot or tone its record names, so a category keeps the color it has everywhere else; a slice that names none takes the next free slot.",
1271
1271
  "language": "tsx",
1272
- "source": "<Chart\n data={tickets}\n legendValues\n series={[{ kind: 'pie', field: 'n', label: 'Tickets', innerRadius: 0.64 }]}\n title=\"Tickets por estado\"\n x={{ field: 'status' }}\n/>;\n",
1272
+ "source": "<Chart\n data={tickets}\n legendValues\n series={[{ kind: 'pie', field: 'n', label: 'Tickets', innerRadius: 0.64 }]}\n title=\"Tickets by status\"\n x={{ field: 'status' }}\n/>;\n",
1273
1273
  "verdict": "excerpt"
1274
1274
  },
1275
1275
  {
@@ -1277,15 +1277,15 @@
1277
1277
  "title": "Two measures of each record",
1278
1278
  "note": "Sixty tickets by effort and impact in two groups; the tooltip follows the point, not the axis, because a value axis has no categories to gather.",
1279
1279
  "language": "tsx",
1280
- "source": "<Chart\n data={tickets}\n recordKey=\"id\"\n series={[\n { kind: 'scatter', field: 'product', label: 'Product' },\n { kind: 'scatter', field: 'infra', label: 'Infrastructure' },\n ]}\n title=\"Effort and impact\"\n x={{ field: 'effort', type: 'value', label: 'Effort (h)' }}\n/>;\n",
1281
- "verdict": "excerpt"
1280
+ "source": "import { Chart } from '@slotted/react/chart';\n\nconst shipments = [\n { id: 'E-1001', distance: 120, express: 1.4, ground: null, parcels: 38 },\n { id: 'E-1002', distance: 340, express: 2.1, ground: null, parcels: 12 },\n { id: 'E-1003', distance: 620, express: 2.8, ground: null, parcels: 55 },\n { id: 'E-1004', distance: 910, express: 3.2, ground: null, parcels: 21 },\n { id: 'E-1005', distance: 1480, express: 4.1, ground: null, parcels: 30 },\n { id: 'G-2001', distance: 150, express: null, ground: 2.2, parcels: null },\n { id: 'G-2002', distance: 380, express: null, ground: 3.1, parcels: null },\n { id: 'G-2003', distance: 700, express: null, ground: 4.4, parcels: null },\n { id: 'G-2004', distance: 1020, express: null, ground: 5.6, parcels: null },\n { id: 'G-2005', distance: 1500, express: null, ground: 7.3, parcels: null },\n];\n\nexport default function ChartScatterExample() {\n return (\n <Chart\n data={shipments}\n description=\"Dot area is the number of parcels in the express shipment\"\n recordKey=\"id\"\n series={[\n { kind: 'scatter', field: 'express', label: 'Express', sizeField: 'parcels' },\n { kind: 'scatter', field: 'ground', label: 'Ground' },\n ]}\n title=\"Transit time by distance\"\n x={{ field: 'distance', type: 'value', label: 'Distance (km)' }}\n y={{ label: 'Transit (days)' }}\n />\n );\n}\n",
1281
+ "verdict": "example"
1282
1282
  },
1283
1283
  {
1284
1284
  "id": "bubble",
1285
1285
  "title": "A third measure as size",
1286
1286
  "note": "sizeField scales each dot by the customers affected, by area rather than radius, so twice the customers reads as twice the ink.",
1287
1287
  "language": "tsx",
1288
- "source": "const product: ChartSeries = {\n kind: 'scatter',\n field: 'product',\n label: 'Produto',\n sizeField: 'customers',\n};\n",
1288
+ "source": "const product: ChartSeries = {\n kind: 'scatter',\n field: 'product',\n label: 'Product',\n sizeField: 'customers',\n};\n",
1289
1289
  "verdict": "excerpt"
1290
1290
  },
1291
1291
  {
@@ -1333,8 +1333,8 @@
1333
1333
  "title": "A legend that toggles",
1334
1334
  "note": "Click a series to hide it, Shift+click to show it alone; arrows move along the legend. The legend holds one line: narrower than its items, the ones that do not fit wait behind +N.",
1335
1335
  "language": "tsx",
1336
- "source": "const [hidden, setHidden] = useState<readonly string[]>([]);\n\n<Chart {...channels} hidden={hidden} onHiddenChange={setHidden} title=\"Acquisition channels\" />;\n",
1337
- "verdict": "excerpt"
1336
+ "source": "import { useState } from 'react';\n\nimport { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst quarters = [\n {\n quarter: 'Q1',\n beverages: 82,\n bakery: 41,\n dairy: 66,\n produce: 74,\n meat: 58,\n frozen: 36,\n snacks: 49,\n household: 63,\n care: 28,\n },\n {\n quarter: 'Q2',\n beverages: 94,\n bakery: 44,\n dairy: 63,\n produce: 81,\n meat: 61,\n frozen: 33,\n snacks: 55,\n household: 60,\n care: 31,\n },\n {\n quarter: 'Q3',\n beverages: 101,\n bakery: 47,\n dairy: 69,\n produce: 88,\n meat: 64,\n frozen: 30,\n snacks: 52,\n household: 66,\n care: 35,\n },\n {\n quarter: 'Q4',\n beverages: 97,\n bakery: 52,\n dairy: 72,\n produce: 79,\n meat: 70,\n frozen: 38,\n snacks: 60,\n household: 71,\n care: 39,\n },\n];\n\nexport default function ChartLegendExample() {\n const [hidden, setHidden] = useState<readonly string[]>([]);\n\n return (\n <Stack gap={3}>\n <Chart\n data={quarters}\n hidden={hidden}\n legendValues\n onHiddenChange={setHidden}\n series={[\n { kind: 'line', field: 'beverages', label: 'Beverages' },\n { kind: 'line', field: 'bakery', label: 'Bakery' },\n { kind: 'line', field: 'dairy', label: 'Dairy' },\n { kind: 'line', field: 'produce', label: 'Produce' },\n { kind: 'line', field: 'meat', label: 'Meat' },\n { kind: 'line', field: 'frozen', label: 'Frozen' },\n { kind: 'line', field: 'snacks', label: 'Snacks' },\n { kind: 'line', field: 'household', label: 'Household' },\n { kind: 'line', field: 'care', label: 'Personal care' },\n ]}\n title=\"Sales by category\"\n x={{ field: 'quarter' }}\n />\n\n <Text size=\"sm\" tone=\"muted\">\n {hidden.length} of 9 categories hidden.\n </Text>\n </Stack>\n );\n}\n",
1337
+ "verdict": "example"
1338
1338
  },
1339
1339
  {
1340
1340
  "id": "legend-values",
@@ -1397,7 +1397,7 @@
1397
1397
  "title": "More series than slots",
1398
1398
  "note": "Eleven channels over eight color slots: the first eight take the palette, the rest take the overflow neutral, and the legend says which is which.",
1399
1399
  "language": "tsx",
1400
- "source": "<Chart {...elevenChannels} title=\"Onze canais\" />;\n",
1400
+ "source": "<Chart {...elevenChannels} title=\"Eleven channels\" />;\n",
1401
1401
  "verdict": "excerpt"
1402
1402
  },
1403
1403
  {
@@ -1413,7 +1413,7 @@
1413
1413
  "title": "Missing values stay missing",
1414
1414
  "note": "A null breaks the line on the left; connectNulls bridges it on the right, for a series where the gap is a sampling artifact rather than a fact.",
1415
1415
  "language": "tsx",
1416
- "source": "const revenue: ChartSeries = {\n kind: 'line',\n field: 'revenue',\n label: 'Receita',\n connectNulls: true,\n};\n",
1416
+ "source": "const revenue: ChartSeries = {\n kind: 'line',\n field: 'revenue',\n label: 'Revenue',\n connectNulls: true,\n};\n",
1417
1417
  "verdict": "excerpt"
1418
1418
  },
1419
1419
  {
@@ -1426,7 +1426,7 @@
1426
1426
  },
1427
1427
  {
1428
1428
  "id": "long-labels",
1429
- "title": "Content the family did not choose",
1429
+ "title": "Content the application did not choose",
1430
1430
  "note": "A title of fifteen words, category names of seven, a series named with markup: the title wraps, names on the axis and in the legend truncate with the whole name kept, and markup is text, never HTML.",
1431
1431
  "language": "tsx",
1432
1432
  "source": "<Chart {...segments} title={longTitle} />;\n",
@@ -1453,7 +1453,7 @@
1453
1453
  "title": "Nothing to show",
1454
1454
  "note": "An empty series renders a message in the same box the drawing would take, never a blank plot and never an axis with nothing on it.",
1455
1455
  "language": "tsx",
1456
- "source": "<Chart data={[]} series={revenueSeries} title=\"Receita\" x={{ field: 'month' }} />;\n",
1456
+ "source": "<Chart data={[]} series={revenueSeries} title=\"Revenue\" x={{ field: 'month' }} />;\n",
1457
1457
  "verdict": "excerpt"
1458
1458
  },
1459
1459
  {
@@ -1509,7 +1509,7 @@
1509
1509
  "title": "Color from the design system",
1510
1510
  "note": "categorical tells series apart, sequential orders them by one hue for ranked data, focus draws the first series in color and the rest in neutral. slot and tone pin a series to a color.",
1511
1511
  "language": "tsx",
1512
- "source": "<Chart {...channels} palette=\"categorical\" />;\n<Chart {...ranked} palette=\"sequential\" />;\n<Chart {...channels} palette=\"focus\" />;\n\nconst cost: ChartSeries = { kind: 'line', field: 'cost', label: 'Custo', slot: 5 };\nconst target: ChartSeries = { kind: 'line', field: 'target', label: 'Meta', tone: 'neutral' };\n",
1512
+ "source": "<Chart {...channels} palette=\"categorical\" />;\n<Chart {...ranked} palette=\"sequential\" />;\n<Chart {...channels} palette=\"focus\" />;\n\nconst cost: ChartSeries = { kind: 'line', field: 'cost', label: 'Cost', slot: 5 };\nconst target: ChartSeries = { kind: 'line', field: 'target', label: 'Target', tone: 'neutral' };\n",
1513
1513
  "verdict": "excerpt"
1514
1514
  },
1515
1515
  {
@@ -1535,6 +1535,86 @@
1535
1535
  "language": "tsx",
1536
1536
  "source": "<SlottedProvider locale=\"pt-BR\" catalogs={{ 'pt-BR': PT_BR }}>\n <App />\n</SlottedProvider>;\n",
1537
1537
  "verdict": "excerpt"
1538
+ },
1539
+ {
1540
+ "id": "areas",
1541
+ "title": "areas.tsx",
1542
+ "note": null,
1543
+ "language": "tsx",
1544
+ "source": "import { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\n\nconst weekly = [\n { week: 'W1', orders: 120, stock: 900, store: 60, web: 30, marketplace: 30 },\n { week: 'W2', orders: 138, stock: 780, store: 62, web: 32, marketplace: 44 },\n { week: 'W3', orders: 131, stock: 1020, store: 58, web: 36, marketplace: 37 },\n { week: 'W4', orders: 156, stock: 860, store: 55, web: 40, marketplace: 61 },\n { week: 'W5', orders: 149, stock: 940, store: 54, web: 42, marketplace: 53 },\n { week: 'W6', orders: 172, stock: 820, store: 52, web: 46, marketplace: 74 },\n];\n\nexport default function ChartAreasExample() {\n return (\n <Stack gap={6}>\n <Chart\n data={weekly}\n series={[{ kind: 'line', field: 'orders', label: 'Orders' }]}\n size=\"sm\"\n title=\"Orders per week, linear\"\n x={{ field: 'week' }}\n />\n\n <Chart\n data={weekly}\n series={[\n { kind: 'area', field: 'store', label: 'Store', stack: 'total', curve: 'monotone' },\n { kind: 'area', field: 'web', label: 'Web', stack: 'total', curve: 'monotone' },\n {\n kind: 'area',\n field: 'marketplace',\n label: 'Marketplace',\n stack: 'total',\n curve: 'monotone',\n },\n ]}\n size=\"sm\"\n stackMode=\"percent\"\n title=\"Share of orders by channel, monotone\"\n x={{ field: 'week' }}\n />\n\n <Chart\n data={weekly}\n series={[\n { kind: 'line', field: 'stock', label: 'Units in stock', curve: 'step', markers: 'all' },\n ]}\n size=\"sm\"\n title=\"Stock on hand, step\"\n x={{ field: 'week' }}\n />\n </Stack>\n );\n}\n",
1545
+ "verdict": "example"
1546
+ },
1547
+ {
1548
+ "id": "axes",
1549
+ "title": "axes.tsx",
1550
+ "note": null,
1551
+ "language": "tsx",
1552
+ "source": "import { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\n\nconst daily = [\n { day: '2026-03-02', sessions: 1840 },\n { day: '2026-03-03', sessions: 1920 },\n { day: '2026-03-04', sessions: 2105 },\n { day: '2026-03-05', sessions: 1980 },\n { day: '2026-03-06', sessions: 2210 },\n { day: '2026-03-09', sessions: 2480 },\n { day: '2026-03-10', sessions: 2390 },\n { day: '2026-03-11', sessions: 2310 },\n { day: '2026-03-12', sessions: 2560 },\n { day: '2026-03-13', sessions: 2680 },\n];\n\nconst users = [\n { month: 'Jan', active: 800 },\n { month: 'Feb', active: 1600 },\n { month: 'Mar', active: 3200 },\n { month: 'Apr', active: 6400 },\n { month: 'May', active: 12800 },\n { month: 'Jun', active: 25600 },\n];\n\nconst monthly = [\n { month: 'Jan', orders: 320, margin: 0.31 },\n { month: 'Feb', orders: 340, margin: 0.34 },\n { month: 'Mar', orders: 310, margin: 0.29 },\n { month: 'Apr', orders: 365, margin: 0.36 },\n];\n\nexport default function ChartAxesExample() {\n return (\n <Stack gap={6}>\n <Chart\n data={daily}\n grid=\"both\"\n series={[{ kind: 'area', field: 'sessions', label: 'Sessions' }]}\n size=\"sm\"\n title=\"Daily sessions, time axis\"\n x={{ field: 'day', type: 'time', format: { month: 'short', day: 'numeric' } }}\n />\n\n <Chart\n data={users}\n grid=\"none\"\n series={[{ kind: 'line', field: 'active', label: 'Active users', markers: 'all' }]}\n size=\"sm\"\n title=\"Active users, logarithmic scale\"\n x={{ field: 'month' }}\n y={{ scale: 'log', format: { notation: 'compact' } }}\n />\n\n <Chart\n data={monthly}\n series={[\n { kind: 'bar', field: 'orders', label: 'Orders' },\n { kind: 'line', field: 'margin', label: 'Margin', axis: 'end', markers: 'all' },\n ]}\n size=\"sm\"\n title=\"Orders and margin, two axes\"\n x={{ field: 'month' }}\n y={[{ label: 'Orders' }, { label: 'Margin', format: { style: 'percent' } }]}\n />\n </Stack>\n );\n}\n",
1553
+ "verdict": "example"
1554
+ },
1555
+ {
1556
+ "id": "bars",
1557
+ "title": "bars.tsx",
1558
+ "note": null,
1559
+ "language": "tsx",
1560
+ "source": "import { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\n\nconst orders = [\n { month: 'Jan', store: 320, web: 210, marketplace: 140 },\n { month: 'Feb', store: 340, web: 245, marketplace: 150 },\n { month: 'Mar', store: 310, web: 270, marketplace: 190 },\n { month: 'Apr', store: 365, web: 310, marketplace: 220 },\n];\n\nconst regions = [\n { region: 'North America', revenue: 412 },\n { region: 'Europe', revenue: 318 },\n { region: 'Asia Pacific', revenue: 226 },\n { region: 'Latin America', revenue: 94 },\n];\n\nexport default function ChartBarsExample() {\n return (\n <Stack gap={6}>\n <Chart\n data={orders}\n series={[\n { kind: 'bar', field: 'store', label: 'Store' },\n { kind: 'bar', field: 'web', label: 'Web' },\n { kind: 'bar', field: 'marketplace', label: 'Marketplace' },\n ]}\n size=\"sm\"\n title=\"Orders by channel, grouped\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={orders}\n series={[\n { kind: 'bar', field: 'store', label: 'Store', stack: 'total' },\n { kind: 'bar', field: 'web', label: 'Web', stack: 'total' },\n { kind: 'bar', field: 'marketplace', label: 'Marketplace', stack: 'total' },\n ]}\n size=\"sm\"\n title=\"Orders by channel, stacked\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={regions}\n orientation=\"horizontal\"\n series={[{ kind: 'bar', field: 'revenue', label: 'Revenue', labels: true }]}\n size=\"sm\"\n title=\"Revenue by region, horizontal\"\n x={{ field: 'region' }}\n />\n </Stack>\n );\n}\n",
1561
+ "verdict": "example"
1562
+ },
1563
+ {
1564
+ "id": "basic",
1565
+ "title": "basic.tsx",
1566
+ "note": null,
1567
+ "language": "tsx",
1568
+ "source": "import { Chart } from '@slotted/react/chart';\n\nconst monthly = [\n { month: 'Jan', revenue: 42, cost: 30, target: 40 },\n { month: 'Feb', revenue: 48, cost: 32, target: 44 },\n { month: 'Mar', revenue: 45, cost: 35, target: 48 },\n { month: 'Apr', revenue: 53, cost: 34, target: 52 },\n { month: 'May', revenue: 61, cost: 38, target: 56 },\n { month: 'Jun', revenue: 58, cost: 41, target: 60 },\n];\n\nexport default function ChartBasicExample() {\n return (\n <Chart\n data={monthly}\n description=\"Thousands of dollars, January to June\"\n help=\"Revenue recognized in the month, excluding taxes.\"\n series={[\n { kind: 'line', field: 'revenue', label: 'Revenue', markers: 'last' },\n { kind: 'line', field: 'cost', label: 'Cost', markers: 'last' },\n { kind: 'line', field: 'target', label: 'Target', tone: 'neutral', stroke: 'dashed' },\n ]}\n title=\"Revenue and cost\"\n x={{ field: 'month' }}\n />\n );\n}\n",
1569
+ "verdict": "example"
1570
+ },
1571
+ {
1572
+ "id": "forecast",
1573
+ "title": "forecast.tsx",
1574
+ "note": null,
1575
+ "language": "tsx",
1576
+ "source": "import { Chart } from '@slotted/react/chart';\n\nconst monthly = [\n { month: 'Jan', actual: 42, forecast: null, low: null, high: null },\n { month: 'Feb', actual: 48, forecast: null, low: null, high: null },\n { month: 'Mar', actual: 45, forecast: null, low: null, high: null },\n { month: 'Apr', actual: 53, forecast: null, low: null, high: null },\n { month: 'May', actual: 61, forecast: null, low: null, high: null },\n { month: 'Jun', actual: 58, forecast: 58, low: 58, high: 58 },\n { month: 'Jul', actual: null, forecast: 63, low: 57, high: 69 },\n { month: 'Aug', actual: null, forecast: 68, low: 58, high: 78 },\n];\n\nexport default function ChartForecastExample() {\n return (\n <Chart\n annotations={[\n { kind: 'band', from: 50, to: 60, label: 'Target corridor', tone: 'success' },\n { kind: 'line', value: 70, label: 'Capacity', tone: 'warning' },\n { kind: 'line', axis: 'x', value: 'Apr', label: 'Price change' },\n ]}\n data={monthly}\n series={[\n {\n id: 'actual',\n kind: 'line',\n field: 'actual',\n label: 'Actual',\n endLabel: { strong: true },\n },\n {\n id: 'forecast',\n kind: 'line',\n field: 'forecast',\n label: 'Forecast',\n stroke: 'dashed',\n endLabel: true,\n },\n { kind: 'range', lower: 'low', upper: 'high', label: 'Likely range', of: 'forecast' },\n ]}\n size=\"lg\"\n title=\"Revenue forecast\"\n x={{ field: 'month' }}\n />\n );\n}\n",
1577
+ "verdict": "example"
1578
+ },
1579
+ {
1580
+ "id": "interaction",
1581
+ "title": "interaction.tsx",
1582
+ "note": null,
1583
+ "language": "tsx",
1584
+ "source": "import { useState } from 'react';\n\nimport { Chart } from '@slotted/react/chart';\nimport type { ChartPoint, ChartRange, ChartZoom } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst daily = [\n { day: 'Mar 2', sessions: 1840 },\n { day: 'Mar 3', sessions: 1920 },\n { day: 'Mar 4', sessions: 2105 },\n { day: 'Mar 5', sessions: 1980 },\n { day: 'Mar 6', sessions: 2210 },\n { day: 'Mar 9', sessions: 2480 },\n { day: 'Mar 10', sessions: 2390 },\n { day: 'Mar 11', sessions: 2310 },\n { day: 'Mar 12', sessions: 2560 },\n { day: 'Mar 13', sessions: 2680 },\n { day: 'Mar 16', sessions: 2740 },\n { day: 'Mar 17', sessions: 2620 },\n];\n\nexport default function ChartInteractionExample() {\n const [selection, setSelection] = useState<ChartPoint | null>(null);\n const [range, setRange] = useState<ChartRange | null>(null);\n const [zoom, setZoom] = useState<ChartZoom>({ start: 0, end: 1 });\n\n return (\n <Stack gap={3}>\n <Chart\n data={daily}\n onRangeChange={setRange}\n onSelectionChange={setSelection}\n onZoomChange={setZoom}\n range={range}\n rangeSelectable\n selectable\n selection={selection}\n series={[{ kind: 'area', field: 'sessions', label: 'Sessions' }]}\n title=\"Daily sessions\"\n x={{ field: 'day' }}\n zoom={zoom}\n zoomable\n />\n\n <Text size=\"sm\" tone=\"muted\">\n Point: {selection ? selection.key : 'none'}. Range:{' '}\n {range ? `${range.from} to ${range.to}` : 'none'}. Visible: {Math.round(zoom.start * 100)}%\n to {Math.round(zoom.end * 100)}%.\n </Text>\n </Stack>\n );\n}\n",
1585
+ "verdict": "example"
1586
+ },
1587
+ {
1588
+ "id": "pies",
1589
+ "title": "pies.tsx",
1590
+ "note": null,
1591
+ "language": "tsx",
1592
+ "source": "import { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\n\nconst regions = [\n { region: 'North America', revenue: 412, slot: 1 },\n { region: 'Europe', revenue: 318, slot: 2 },\n { region: 'Asia Pacific', revenue: 226, slot: 3 },\n { region: 'Latin America', revenue: 94, slot: 5 },\n];\n\nconst tickets = [\n { status: 'Open', count: 24, tone: 'warning' },\n { status: 'Waiting on customer', count: 41, tone: 'info' },\n { status: 'Resolved', count: 132, tone: 'success' },\n { status: 'Escalated', count: 9, tone: 'danger' },\n];\n\nexport default function ChartPiesExample() {\n return (\n <Stack gap={6}>\n <Chart\n data={regions}\n series={[\n { kind: 'pie', field: 'revenue', label: 'Revenue', labels: true, slotField: 'slot' },\n ]}\n title=\"Revenue by region\"\n x={{ field: 'region' }}\n />\n\n <Chart\n data={tickets}\n legendValues\n series={[\n { kind: 'pie', field: 'count', label: 'Tickets', innerRadius: 0.64, toneField: 'tone' },\n ]}\n title=\"Support tickets by status\"\n x={{ field: 'status' }}\n />\n </Stack>\n );\n}\n",
1593
+ "verdict": "example"
1594
+ },
1595
+ {
1596
+ "id": "states",
1597
+ "title": "states.tsx",
1598
+ "note": null,
1599
+ "language": "tsx",
1600
+ "source": "import { useState } from 'react';\n\nimport { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\n\nconst monthly = [\n { month: 'Jan', revenue: 42, cost: 30 },\n { month: 'Feb', revenue: 48, cost: 32 },\n { month: 'Mar', revenue: 45, cost: 35 },\n { month: 'Apr', revenue: 53, cost: 34 },\n];\n\nexport default function ChartStatesExample() {\n const [failed, setFailed] = useState(true);\n\n return (\n <Stack gap={6}>\n <Chart\n data={monthly}\n loading\n series={[\n { kind: 'line', field: 'revenue', label: 'Revenue' },\n { kind: 'line', field: 'cost', label: 'Cost' },\n ]}\n size=\"sm\"\n title=\"Loading\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={[]}\n series={[{ kind: 'line', field: 'revenue', label: 'Revenue' }]}\n size=\"sm\"\n title=\"No data\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={monthly}\n defaultHidden={['revenue', 'cost']}\n series={[\n { kind: 'line', field: 'revenue', label: 'Revenue' },\n { kind: 'line', field: 'cost', label: 'Cost' },\n ]}\n size=\"sm\"\n title=\"Every series hidden\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={monthly}\n error={failed}\n onRetry={() => {\n setFailed(false);\n }}\n series={[{ kind: 'line', field: 'revenue', label: 'Revenue' }]}\n size=\"sm\"\n title=\"Failed, then retried\"\n x={{ field: 'month' }}\n />\n </Stack>\n );\n}\n",
1601
+ "verdict": "example"
1602
+ },
1603
+ {
1604
+ "id": "tiles",
1605
+ "title": "tiles.tsx",
1606
+ "note": null,
1607
+ "language": "tsx",
1608
+ "source": "import { Chart } from '@slotted/react/chart';\nimport { Grid } from '@slotted/react/grid';\n\nconst monthly = [\n { month: 'Jan', revenue: 42 },\n { month: 'Feb', revenue: 48 },\n { month: 'Mar', revenue: 45 },\n { month: 'Apr', revenue: 53 },\n { month: 'May', revenue: 61 },\n { month: 'Jun', revenue: 58 },\n];\n\nconst orders = [\n { month: 'Jan', store: 320, web: 210, marketplace: 140 },\n { month: 'Feb', store: 340, web: 245, marketplace: 150 },\n { month: 'Mar', store: 310, web: 270, marketplace: 190 },\n { month: 'Apr', store: 365, web: 310, marketplace: 220 },\n];\n\nconst deliveries = [\n { month: 'Jan', delivered: 910, late: 64 },\n { month: 'Feb', delivered: 980, late: 52 },\n { month: 'Mar', delivered: 1020, late: 71 },\n { month: 'Apr', delivered: 1105, late: 48 },\n];\n\nexport default function ChartTilesExample() {\n return (\n <Grid columns={2} gap={4}>\n <Chart\n data={monthly}\n description=\"Last 6 months\"\n series={[{ kind: 'line', field: 'revenue', label: 'Revenue', markers: 'last' }]}\n size=\"sm\"\n title=\"Revenue\"\n toolbar=\"hover\"\n variant=\"card\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={orders}\n description=\"Ordered by volume\"\n palette=\"sequential\"\n series={[\n { kind: 'bar', field: 'store', label: 'Store' },\n { kind: 'bar', field: 'web', label: 'Web' },\n { kind: 'bar', field: 'marketplace', label: 'Marketplace' },\n ]}\n size=\"sm\"\n title=\"Orders by channel\"\n toolbar=\"none\"\n variant=\"card\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={orders}\n palette=\"focus\"\n series={[\n { kind: 'line', field: 'web', label: 'Web' },\n { kind: 'line', field: 'store', label: 'Store' },\n { kind: 'line', field: 'marketplace', label: 'Marketplace' },\n ]}\n size=\"sm\"\n title=\"Web against the other channels\"\n toolbar=\"none\"\n variant=\"card\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={deliveries}\n series={[\n { kind: 'bar', field: 'delivered', label: 'Delivered', slot: 5 },\n { kind: 'bar', field: 'late', label: 'Late', tone: 'danger' },\n ]}\n size=\"sm\"\n texture\n title=\"Deliveries\"\n toolbar=\"none\"\n variant=\"card\"\n x={{ field: 'month' }}\n />\n </Grid>\n );\n}\n",
1609
+ "verdict": "example"
1610
+ },
1611
+ {
1612
+ "id": "tooltip",
1613
+ "title": "tooltip.tsx",
1614
+ "note": null,
1615
+ "language": "tsx",
1616
+ "source": "import { Chart } from '@slotted/react/chart';\nimport { Stack } from '@slotted/react/stack';\n\nconst orders = [\n { month: 'Jan', store: 320, web: 210, marketplace: 140 },\n { month: 'Feb', store: 340, web: 245, marketplace: 150 },\n { month: 'Mar', store: 310, web: 270, marketplace: 190 },\n { month: 'Apr', store: 365, web: 310, marketplace: 220 },\n];\n\nexport default function ChartTooltipExample() {\n return (\n <Stack gap={6}>\n <Chart\n data={orders}\n defaultActivePoint={{ series: 'web', key: 'Mar' }}\n series={[\n { kind: 'bar', field: 'store', label: 'Store', stack: 'total' },\n { kind: 'bar', field: 'web', label: 'Web', stack: 'total' },\n { kind: 'bar', field: 'marketplace', label: 'Marketplace', stack: 'total' },\n ]}\n size=\"sm\"\n title=\"trigger axis, rows sorted by value\"\n tooltip={{ sort: 'desc' }}\n trigger=\"axis\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={orders}\n defaultActivePoint={{ series: 'web', key: 'Mar' }}\n series={[\n { kind: 'line', field: 'store', label: 'Store' },\n { kind: 'line', field: 'web', label: 'Web' },\n { kind: 'line', field: 'marketplace', label: 'Marketplace' },\n ]}\n size=\"sm\"\n title=\"trigger item, line indicator\"\n tooltip={{ indicator: 'line' }}\n trigger=\"item\"\n x={{ field: 'month' }}\n />\n\n <Chart\n data={orders}\n legendValues\n series={[\n { kind: 'line', field: 'store', label: 'Store' },\n { kind: 'line', field: 'web', label: 'Web' },\n { kind: 'line', field: 'marketplace', label: 'Marketplace' },\n ]}\n size=\"sm\"\n title=\"trigger none, values in the legend\"\n trigger=\"none\"\n x={{ field: 'month' }}\n />\n </Stack>\n );\n}\n",
1617
+ "verdict": "example"
1538
1618
  }
1539
1619
  ]
1540
1620
  }
@@ -11,15 +11,36 @@ import { Chart, ChartDefaultsProvider, ChartTooltipContent, preloadChartEngine }
11
11
 
12
12
  ## Minimal example
13
13
 
14
- Excerpt — not a complete module
14
+ Example
15
15
 
16
16
  ```tsx
17
- <Chart
18
- data={monthly}
19
- series={[{ kind: 'line', field: 'revenue', label: 'Receita' }]}
20
- title="Receita"
21
- x={{ field: 'month' }}
22
- />;
17
+ import { Chart } from '@slotted/react/chart';
18
+
19
+ const monthly = [
20
+ { month: 'Jan', revenue: 42, cost: 30, target: 40 },
21
+ { month: 'Feb', revenue: 48, cost: 32, target: 44 },
22
+ { month: 'Mar', revenue: 45, cost: 35, target: 48 },
23
+ { month: 'Apr', revenue: 53, cost: 34, target: 52 },
24
+ { month: 'May', revenue: 61, cost: 38, target: 56 },
25
+ { month: 'Jun', revenue: 58, cost: 41, target: 60 },
26
+ ];
27
+
28
+ export default function ChartBasicExample() {
29
+ return (
30
+ <Chart
31
+ data={monthly}
32
+ description="Thousands of dollars, January to June"
33
+ help="Revenue recognized in the month, excluding taxes."
34
+ series={[
35
+ { kind: 'line', field: 'revenue', label: 'Revenue', markers: 'last' },
36
+ { kind: 'line', field: 'cost', label: 'Cost', markers: 'last' },
37
+ { kind: 'line', field: 'target', label: 'Target', tone: 'neutral', stroke: 'dashed' },
38
+ ]}
39
+ title="Revenue and cost"
40
+ x={{ field: 'month' }}
41
+ />
42
+ );
43
+ }
23
44
  ```
24
45
 
25
46
  ## Anatomy
@@ -219,7 +219,7 @@
219
219
  "type": "boolean",
220
220
  "defaultValue": "false",
221
221
  "appliesTo": "Clock",
222
- "description": "Answers no key and no press, and takes every time out of the tab sequence."
222
+ "description": "Answers no press, and takes every time out of the tab sequence."
223
223
  },
224
224
  {
225
225
  "name": "readOnly",
@@ -267,12 +267,12 @@
267
267
  }
268
268
  ],
269
269
  "accessibility": [
270
- "Each grid is a listbox with one tab stop, so a clock is two stops rather than twenty-eight.",
270
+ "Each grid is a listbox with one tab stop: a clock with minutes has two stops, and one with seconds has three.",
271
271
  "The arrows move focus and choose nothing. A listbox whose selection followed focus would write a time at every step of a walk.",
272
272
  "A part of the day is a group with its own name, so a screen reader hears \"Afternoon\" once and not before each of its six hours.",
273
273
  "Under a 12-hour cycle an hour is named whole, \"02 PM\", because the figure alone names two hours.",
274
274
  "A refused hour carries aria-disabled rather than being removed, and it is struck through as well as dimmed, because color alone says nothing under forced colors.",
275
- "The hour it is is an outline and the chosen hour a fill, so the two facts are told apart without color."
275
+ "The hour set by now is an outline and the chosen hour a fill, so the two facts are told apart without color."
276
276
  ]
277
277
  }
278
278
  },
@@ -334,16 +334,16 @@
334
334
  "title": "The step decides the minutes",
335
335
  "note": "Four across for a quarter of an hour, six for five minutes, ten for one minute. Nothing scrolls at any of the three.",
336
336
  "language": "tsx",
337
- "source": "<Clock aria-label=\"Departure time\" step={300} />;\n",
338
- "verdict": "excerpt"
337
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\nimport { plainTime } from '@slotted/core/date';\n\nconst NOON = plainTime(12, 0);\n\nexport default function ClockSteps() {\n return (\n <Stack gap={5}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Dock door slots, every 15 minutes\n </Text>\n <Clock aria-label=\"Dock door slot\" defaultValue={NOON} step={900} />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Carrier pickups, every 5 minutes\n </Text>\n <Clock aria-label=\"Carrier pickup\" defaultValue={NOON} step={300} />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Shift handover, every minute\n </Text>\n <Clock aria-label=\"Shift handover\" defaultValue={NOON} step={60} />\n </Stack>\n </Stack>\n );\n}\n",
338
+ "verdict": "example"
339
339
  },
340
340
  {
341
341
  "id": "hour-cycle",
342
342
  "title": "Twelve and twenty-four hours",
343
343
  "note": "The locale decides the cycle and hourCycle overrides it. A 24-hour clock names the parts of the day, and a 12-hour one names the halves.",
344
344
  "language": "tsx",
345
- "source": "<Clock aria-label=\"Departure time\" hourCycle={12} />;\n",
346
- "verdict": "excerpt"
345
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\nimport { plainTime } from '@slotted/core/date';\n\nconst DEPARTURE = plainTime(18, 45);\n\nexport default function ClockHourCycle() {\n return (\n <Stack gap={5}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Depot in Memphis, 12-hour cycle\n </Text>\n <Clock aria-label=\"Departure, 12-hour cycle\" defaultValue={DEPARTURE} hourCycle={12} />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Depot in Rotterdam, 24-hour cycle\n </Text>\n <Clock aria-label=\"Departure, 24-hour cycle\" defaultValue={DEPARTURE} hourCycle={24} />\n </Stack>\n </Stack>\n );\n}\n",
346
+ "verdict": "example"
347
347
  },
348
348
  {
349
349
  "id": "seconds",
@@ -358,24 +358,24 @@
358
358
  "title": "A stated list of times",
359
359
  "note": "A clinic open at 08:40, 09:20 and 13:45 has no step. The times are drawn whole, under the part of the day each one is in, and one press chooses.",
360
360
  "language": "tsx",
361
- "source": "<Clock aria-label=\"Appointment\" options={times} renderSlot={(slot) => slot.label} />;\n",
362
- "verdict": "excerpt"
361
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { plainTime } from '@slotted/core/date';\nimport type { PlainTime } from '@slotted/core/date';\n\nconst APPOINTMENTS = [\n plainTime(8, 40),\n plainTime(9, 20),\n plainTime(10, 10),\n plainTime(13, 45),\n plainTime(15, 20),\n plainTime(18, 30),\n];\n\nconst isBooked = (time: PlainTime) => time.hour === 10;\n\nexport default function ClockSlots() {\n return (\n <Clock\n aria-label=\"Receiving appointment\"\n defaultValue={plainTime(13, 45)}\n isTimeUnavailable={isBooked}\n options={APPOINTMENTS}\n renderSlot={(slot) => (slot.unavailable ? `${slot.label} booked` : slot.label)}\n />\n );\n}\n",
362
+ "verdict": "example"
363
363
  },
364
364
  {
365
365
  "id": "bounds",
366
366
  "title": "Bounds and refused times",
367
367
  "note": "An hour is refused when every time in it is, and keeps its focus. An hour with one accepted time is not refused, and the press takes that time.",
368
368
  "language": "tsx",
369
- "source": "<Clock aria-label=\"Visit\" isTimeUnavailable={isLunch} max={plainTime(18)} min={plainTime(8)} />;\n",
370
- "verdict": "excerpt"
369
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { plainTime } from '@slotted/core/date';\nimport type { PlainTime } from '@slotted/core/date';\n\nconst isLunch = (time: PlainTime) => time.hour === 12;\n\nexport default function ClockBounds() {\n return (\n <Clock\n aria-label=\"Service visit\"\n defaultValue={plainTime(9, 0)}\n isTimeUnavailable={isLunch}\n max={plainTime(18, 0)}\n min={plainTime(8, 0)}\n />\n );\n}\n",
370
+ "verdict": "example"
371
371
  },
372
372
  {
373
373
  "id": "states",
374
374
  "title": "Disabled, read only and the hour it is",
375
375
  "note": "A read-only clock keeps its ink and answers no press. now outlines the hour it is, apart from the chosen one.",
376
376
  "language": "tsx",
377
- "source": "<>\n <Clock aria-label=\"Now\" now={plainTime(10, 20)} />\n <Clock aria-label=\"Read only\" readOnly />\n <Clock aria-label=\"Disabled\" disabled />\n</>;\n",
378
- "verdict": "excerpt"
377
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\nimport { plainTime } from '@slotted/core/date';\n\nconst PICKUP = plainTime(14, 30);\n\nexport default function ClockStates() {\n return (\n <Stack gap={5}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Read only, set by the carrier contract\n </Text>\n <Clock aria-label=\"Contract pickup\" defaultValue={PICKUP} readOnly />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Disabled, the order has shipped\n </Text>\n <Clock aria-label=\"Shipped pickup\" defaultValue={PICKUP} disabled />\n </Stack>\n </Stack>\n );\n}\n",
378
+ "verdict": "example"
379
379
  },
380
380
  {
381
381
  "id": "density",
@@ -396,10 +396,66 @@
396
396
  {
397
397
  "id": "keyboard",
398
398
  "title": "The keyboard",
399
- "note": "One tab stop for the hours and one for the minutes. The arrows move on both axes and choose nothing.",
399
+ "note": "One tab stop for each grid. The arrows move on both axes and choose nothing.",
400
400
  "language": "tsx",
401
- "source": "// ArrowLeft / ArrowRight one time, mirrored under dir=\"rtl\"\n// ArrowUp / ArrowDown the same column, a row either way\n// Home / End the first and last time of the row\n// PageUp / PageDown the first and last row\n// Enter / Space chooses the time focus is on\n",
401
+ "source": "// ArrowLeft / ArrowRight one time, mirrored under dir=\"rtl\"\n// ArrowUp / ArrowDown the same column, a row either way\n// Home / End the first and last time of the row\n// PageUp / PageDown the same column of the first and last row\n// Enter / Space chooses the time focus is on\n",
402
402
  "verdict": "excerpt"
403
+ },
404
+ {
405
+ "id": "basic",
406
+ "title": "basic.tsx",
407
+ "note": null,
408
+ "language": "tsx",
409
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { plainTime } from '@slotted/core/date';\n\nexport default function ClockBasic() {\n return <Clock aria-label=\"Pickup time\" defaultValue={plainTime(14, 30)} />;\n}\n",
410
+ "verdict": "example"
411
+ },
412
+ {
413
+ "id": "controlled",
414
+ "title": "controlled.tsx",
415
+ "note": null,
416
+ "language": "tsx",
417
+ "source": "import { Clock } from '@slotted/react/clock';\nimport type { ClockChangeRequest } from '@slotted/react/clock';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\nimport { plainTime } from '@slotted/core/date';\nimport type { PlainTime } from '@slotted/core/date';\nimport { useState } from 'react';\n\nexport default function ClockControlled() {\n const [time, setTime] = useState<PlainTime | null>(plainTime(8, 30));\n const [unit, setUnit] = useState('none');\n\n const label = time === null ? 'none' : `${pad(time.hour)}:${pad(time.minute)}`;\n\n function handleValueChange(next: PlainTime | null, request: ClockChangeRequest) {\n setTime(next);\n setUnit(request.unit);\n }\n\n return (\n <Stack gap={3}>\n <Clock aria-label=\"Cross-dock cutoff\" onValueChange={handleValueChange} value={time} />\n <Text size=\"sm\" tone=\"muted\">\n Cutoff {label}. Last press in the grid of: {unit}.\n </Text>\n </Stack>\n );\n}\n\nfunction pad(value: number): string {\n return String(value).padStart(2, '0');\n}\n",
418
+ "verdict": "example"
419
+ },
420
+ {
421
+ "id": "empty",
422
+ "title": "empty.tsx",
423
+ "note": null,
424
+ "language": "tsx",
425
+ "source": "import { Clock } from '@slotted/react/clock';\nimport type { PlainTime } from '@slotted/core/date';\n\nconst NO_TIMES: readonly PlainTime[] = [];\n\nexport default function ClockEmpty() {\n return (\n <Clock\n aria-label=\"Dock appointment\"\n messages={{ empty: 'No dock appointments left today.' }}\n options={NO_TIMES}\n />\n );\n}\n",
426
+ "verdict": "example"
427
+ },
428
+ {
429
+ "id": "focus",
430
+ "title": "focus.tsx",
431
+ "note": null,
432
+ "language": "tsx",
433
+ "source": "import { Button } from '@slotted/react/button';\nimport { Clock } from '@slotted/react/clock';\nimport type { ClockHandle } from '@slotted/react/clock';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { plainTime } from '@slotted/core/date';\nimport { useRef } from 'react';\n\nexport default function ClockFocus() {\n const clock = useRef<ClockHandle>(null);\n\n return (\n <Stack gap={3}>\n <Clock aria-label=\"Pickup time\" defaultValue={plainTime(11, 15)} ref={clock} />\n <Inline>\n <Button onClick={() => clock.current?.focus()} variant=\"outline\">\n Focus the clock\n </Button>\n </Inline>\n </Stack>\n );\n}\n",
434
+ "verdict": "example"
435
+ },
436
+ {
437
+ "id": "granularity",
438
+ "title": "granularity.tsx",
439
+ "note": null,
440
+ "language": "tsx",
441
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\nimport { plainTime } from '@slotted/core/date';\n\nconst CUTOFF = plainTime(16, 30, 15);\n\nexport default function ClockGranularity() {\n return (\n <Stack gap={5}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Shift start, hour\n </Text>\n <Clock aria-label=\"Shift start\" defaultValue={CUTOFF} granularity=\"hour\" />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Order cutoff, minute\n </Text>\n <Clock aria-label=\"Order cutoff\" defaultValue={CUTOFF} granularity=\"minute\" />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Scan timestamp, second\n </Text>\n <Clock aria-label=\"Scan timestamp\" defaultValue={CUTOFF} granularity=\"second\" step={15} />\n </Stack>\n </Stack>\n );\n}\n",
442
+ "verdict": "example"
443
+ },
444
+ {
445
+ "id": "locale",
446
+ "title": "locale.tsx",
447
+ "note": null,
448
+ "language": "tsx",
449
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { plainTime } from '@slotted/core/date';\n\nconst SHIFTS = {\n afternoon: 'Late shift',\n evening: 'Closing shift',\n hours: 'Start hour',\n minutes: 'Start minute',\n morning: 'Early shift',\n night: 'Night shift',\n};\n\nexport default function ClockLocale() {\n return (\n <Clock\n aria-label=\"Shift start\"\n defaultValue={plainTime(6, 0)}\n locale=\"en-GB\"\n messages={SHIFTS}\n />\n );\n}\n",
450
+ "verdict": "example"
451
+ },
452
+ {
453
+ "id": "now",
454
+ "title": "now.tsx",
455
+ "note": null,
456
+ "language": "tsx",
457
+ "source": "import { Clock } from '@slotted/react/clock';\nimport { plainTime } from '@slotted/core/date';\n\nexport default function ClockNow() {\n return (\n <Clock\n aria-label=\"Reschedule pickup\"\n defaultValue={plainTime(14, 30)}\n now={plainTime(10, 20)}\n />\n );\n}\n",
458
+ "verdict": "example"
403
459
  }
404
460
  ]
405
461
  }