@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
@@ -208,7 +208,7 @@
208
208
  "type": "number | null",
209
209
  "defaultValue": "—",
210
210
  "appliesTo": "Rating",
211
- "description": "Present means controlled, for the life of the component; null is a controlled empty value. Put on the grid of the scale: 3,2 on a whole scale is 4"
211
+ "description": "Present means controlled, for the life of the component; null is a controlled empty value. Put on the grid of the scale: 3.2 on a whole scale is 4"
212
212
  },
213
213
  {
214
214
  "name": "defaultValue",
@@ -306,14 +306,14 @@
306
306
  "type": "string",
307
307
  "defaultValue": "the language in force",
308
308
  "appliesTo": "all members",
309
- "description": "The locale every number is written in: 4,6 and 1.284 in pt-BR"
309
+ "description": "The locale every number is written in: 4.6 and 1,284 in en-US"
310
310
  },
311
311
  {
312
312
  "name": "messages",
313
313
  "type": "Partial<RatingMessages>",
314
314
  "defaultValue": "—",
315
315
  "appliesTo": "all members",
316
- "description": "Words laid over the language in force, key by key: every string the family writes"
316
+ "description": "Words laid over the language in force, key by key: every string the rating writes"
317
317
  }
318
318
  ],
319
319
  "composition": [
@@ -367,11 +367,11 @@
367
367
  {
368
368
  "name": "onKeyDown, onPointerDown, onPointerOver, onPointerLeave",
369
369
  "payload": "the element’s own events",
370
- "when": "Composed with the family’s: the consumer’s handler runs first, and a preventDefault() in onKeyDown keeps the key from the family."
370
+ "when": "Composed with the rating’s own: the consumer’s handler runs first, and a preventDefault() in onKeyDown keeps the key from the rating."
371
371
  }
372
372
  ],
373
373
  "accessibility": [
374
- "The pattern is the WAI-ARIA APG’s Rating Radio Group: a radiogroup of native radios that share a name, each named by the itemLabel message — 3,5 de 5 — so the number is heard on every stop. Tab and Space are the platform’s.",
374
+ "The pattern is the WAI-ARIA APG’s Rating Radio Group: a radiogroup of native radios that share a name, each named by the itemLabel message — 3.5 out of 5 — so the number is heard on every stop. Tab and Space are the platform’s.",
375
375
  "The arrows depart from the radio example on purpose: they stop at both ends instead of wrapping, as the APG’s rating slider, Ark, MUI and Mantine do, because a rating that falls from five to one on one keystroke too many is a defect. Home and End reach the ends, and the inline arrows swap in a right-to-left document.",
376
376
  "Read-only has no platform answer for a radio, so the change is refused on the click a pointer and Space share, aria-readonly is announced, and every radio keeps its tab stop. aria-required and aria-invalid are written on the group; the native required is not, because it would engage the browser’s own validation.",
377
377
  "In the light and dark schemes a star does not reach 3:1 against the page: the value is always in the accessible name and may be written beside the stars, and the high-contrast scheme and forced colors draw lit and unlit stars as distinct shapes with a contrasting edge.",
@@ -417,7 +417,7 @@
417
417
  "part": "value",
418
418
  "element": "span aria-hidden=\"true\"",
419
419
  "required": false,
420
- "purpose": "The number, always to one place in the locale’s digits — 4,6 in pt-BR — and in tabular figures, so a column of displays lines up. showValue={false} removes it."
420
+ "purpose": "The number, always to one place in the locale’s digits — 4.6 or 4,6 — and in tabular figures, so a column of displays lines up. showValue={false} removes it."
421
421
  },
422
422
  {
423
423
  "part": "histogram",
@@ -435,7 +435,7 @@
435
435
  "part": "count",
436
436
  "element": "span aria-hidden=\"true\"",
437
437
  "required": false,
438
- "purpose": "How many ratings the value is made of, in the locale’s grouping — (1.284) beside five stars, 1.284 in a histogram row. Present only when count is."
438
+ "purpose": "How many ratings the value is made of, in the locale’s grouping — (1,284) beside five stars, 1,284 in a histogram row. Present only when count is."
439
439
  }
440
440
  ],
441
441
  "api": [
@@ -500,14 +500,14 @@
500
500
  "type": "string",
501
501
  "defaultValue": "the language in force",
502
502
  "appliesTo": "all members",
503
- "description": "The locale every number is written in: 4,6 and 1.284 in pt-BR"
503
+ "description": "The locale every number is written in: 4.6 and 1,284 in en-US"
504
504
  },
505
505
  {
506
506
  "name": "messages",
507
507
  "type": "Partial<RatingMessages>",
508
508
  "defaultValue": "—",
509
509
  "appliesTo": "all members",
510
- "description": "Words laid over the language in force, key by key: every string the family writes"
510
+ "description": "Words laid over the language in force, key by key: every string the rating writes"
511
511
  }
512
512
  ],
513
513
  "composition": [
@@ -542,8 +542,8 @@
542
542
  ],
543
543
  "events": [],
544
544
  "accessibility": [
545
- "The display is one image: role=\"img\" with an aria-label from displayLabel or displayLabelWithCount — Avaliação 4,6 de 5, 1.284 avaliações — and every symbol, number and count inside is hidden, so the value is said once.",
546
- "The value is written in the locale’s digits and, as a label read aloud, a whole value is written whole: 4 de 5, not 4,0 de 5.",
545
+ "The display is one image: role=\"img\" with an aria-label from displayLabel or displayLabelWithCount — Rated 4.6 out of 5, 1,284 ratings — and every symbol, number and count inside is hidden, so the value is said once.",
546
+ "The value is written in the locale’s digits and, as a label read aloud, a whole value is written whole: 4 out of 5, not 4.0 out of 5.",
547
547
  "A partial star is a clip of one shape, never a color alone; the number beside it is the reading that does not depend on seeing the fraction."
548
548
  ]
549
549
  },
@@ -574,7 +574,7 @@
574
574
  "part": "scale",
575
575
  "element": "span",
576
576
  "required": false,
577
- "purpose": "The scale beside the figure, from the scale message: de 5."
577
+ "purpose": "The scale beside the figure, from the scale message: out of 5."
578
578
  },
579
579
  {
580
580
  "part": "insight",
@@ -791,14 +791,14 @@
791
791
  "type": "string",
792
792
  "defaultValue": "the language in force",
793
793
  "appliesTo": "all members",
794
- "description": "The locale every number is written in: 4,6 and 1.284 in pt-BR"
794
+ "description": "The locale every number is written in: 4.6 and 1,284 in en-US"
795
795
  },
796
796
  {
797
797
  "name": "messages",
798
798
  "type": "Partial<RatingMessages>",
799
799
  "defaultValue": "—",
800
800
  "appliesTo": "all members",
801
- "description": "Words laid over the language in force, key by key: every string the family writes"
801
+ "description": "Words laid over the language in force, key by key: every string the rating writes"
802
802
  }
803
803
  ],
804
804
  "composition": [
@@ -833,7 +833,7 @@
833
833
  ],
834
834
  "accessibility": [
835
835
  "The summary is a region named by its aria-label. The figure, the scale and the count are text; the stars beside them are one image with its own name.",
836
- "Each level is named in full by levelLabel — 5 estrelas: 1.052 avaliações, 82% — so a reader hears the level, its count and its share without reading the bar. Filtering, each is a toggle with aria-pressed, disabled where nobody rated.",
836
+ "Each level is named in full by levelLabel — 5 stars: 1,052 ratings, 82% — so a reader hears the level, its count and its share without reading the bar. Filtering, each is a toggle with aria-pressed, disabled where nobody rated.",
837
837
  "The spectrum’s axis, its interval and its mean are hidden: the count line says the margin or the interval in words, and the conclusion is text in a pill, never a color alone."
838
838
  ]
839
839
  }
@@ -942,31 +942,31 @@
942
942
  "title": "Half steps",
943
943
  "note": "step={0.5} puts two radios in each star: the half radio sits above the whole one, so the inline-start half of a star asks for the half value. Ten arrow stops for five stars is the cost.",
944
944
  "language": "tsx",
945
- "source": "<Rating aria-label=\"Rating in half points\" defaultValue={3.5} step={0.5} />;\n",
946
- "verdict": "excerpt"
945
+ "source": "import { Rating } from '@slotted/react/rating';\n\nexport default function RatingHalf() {\n return (\n <Rating\n aria-label=\"Packaging condition\"\n caption={({ preview, value }) => preview ?? value ?? 'No rating'}\n defaultValue={3.5}\n step={0.5}\n />\n );\n}\n",
946
+ "verdict": "example"
947
947
  },
948
948
  {
949
949
  "id": "states",
950
950
  "title": "Read-only, disabled and invalid",
951
951
  "note": "Read-only keeps every tab stop and the lit stars, and refuses every change; disabled dims the row and leaves the value readable; invalid writes aria-invalid and reddens the focus ring.",
952
952
  "language": "tsx",
953
- "source": "<Rating aria-label=\"Your previous score\" defaultValue={4} readOnly />;\n<Rating aria-label=\"Closed rating\" defaultValue={2} disabled />;\n<Rating aria-label=\"Required rating\" invalid required />;\n",
954
- "verdict": "excerpt"
953
+ "source": "import { Rating } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function RatingStates() {\n return (\n <Stack gap={4}>\n <Rating\n aria-label=\"Rating from the last audit\"\n caption=\"Read-only\"\n defaultValue={4}\n readOnly\n />\n <Rating aria-label=\"Closed review\" caption=\"Disabled\" defaultValue={2} disabled />\n <Rating aria-label=\"Supplier rating\" caption=\"Invalid and required\" invalid required />\n </Stack>\n );\n}\n",
954
+ "verdict": "example"
955
955
  },
956
956
  {
957
957
  "id": "field",
958
958
  "title": "Inside a field",
959
959
  "note": "The field names the group through aria-labelledby, says its description and error through aria-describedby, and hands down size, disabled, required and invalid. A checkbox beside it is the answer for a question that may not apply.",
960
960
  "language": "tsx",
961
- "source": "<Field required>\n <FieldLabel>Qualidade do som</FieldLabel>\n <Rating />\n <FieldDescription>De uma a cinco estrelas.</FieldDescription>\n</Field>;\n",
962
- "verdict": "excerpt"
961
+ "source": "import { Field, FieldDescription, FieldError, FieldLabel } from '@slotted/react/field';\nimport { Rating } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function RatingField() {\n return (\n <Stack gap={5}>\n <Field required>\n <FieldLabel>Delivery experience</FieldLabel>\n <Rating defaultValue={4} />\n <FieldDescription>From one star, poor, to five, excellent.</FieldDescription>\n </Field>\n <Field invalid required size=\"sm\">\n <FieldLabel>Packaging condition</FieldLabel>\n <Rating />\n <FieldError>Choose a rating before sending the review.</FieldError>\n </Field>\n </Stack>\n );\n}\n",
962
+ "verdict": "example"
963
963
  },
964
964
  {
965
965
  "id": "labels",
966
966
  "title": "Words for the value",
967
967
  "note": "caption as a function receives the value held and the value under the pointer, so the word follows the pointer and settles back. Each radio keeps its own number as its accessible name, through the itemLabel message.",
968
968
  "language": "tsx",
969
- "source": "const WORDS = ['Terrible', 'Poor', 'Fair', 'Good', 'Excellent'];\n\n<Rating\n aria-label=\"Atendimento\"\n caption={({ preview, value }) => {\n const shown = preview ?? value;\n return shown === null ? 'No rating' : WORDS[shown - 1];\n }}\n defaultValue={4}\n/>;\n",
969
+ "source": "const WORDS = ['Terrible', 'Poor', 'Fair', 'Good', 'Excellent'];\n\n<Rating\n aria-label=\"Delivery\"\n caption={({ preview, value }) => {\n const shown = preview ?? value;\n return shown === null ? 'No rating' : WORDS[shown - 1];\n }}\n defaultValue={4}\n/>;\n",
970
970
  "verdict": "excerpt"
971
971
  },
972
972
  {
@@ -982,7 +982,7 @@
982
982
  "title": "A finger along the row",
983
983
  "note": "A finger or a pen dragged along the stars asks for the value under it, and only when that value changes; the root carries data-dragging so the fill follows without easing. A mouse does not scrub: it previews on hover and chooses on press.",
984
984
  "language": "tsx",
985
- "source": "<Rating aria-label=\"Arraste para avaliar\" max={10} size=\"lg\" />;\n",
985
+ "source": "<Rating aria-label=\"Drag to rate\" max={10} size=\"lg\" />;\n",
986
986
  "verdict": "excerpt"
987
987
  },
988
988
  {
@@ -996,7 +996,7 @@
996
996
  {
997
997
  "id": "fractions",
998
998
  "title": "Any fraction",
999
- "note": "Each star is lit by its own share of the value, so 4,6 lights six tenths of the fifth star and 2,25 a quarter of the third — the display draws what the input member cannot offer.",
999
+ "note": "Each star is lit by its own share of the value, so 4.6 lights six tenths of the fifth star and 2.25 a quarter of the third — the display draws what the input member cannot offer.",
1000
1000
  "language": "tsx",
1001
1001
  "source": "<RatingDisplay value={4.6} />;\n<RatingDisplay value={3.5} />;\n<RatingDisplay value={2.25} />;\n",
1002
1002
  "verdict": "excerpt"
@@ -1012,7 +1012,7 @@
1012
1012
  {
1013
1013
  "id": "histogram",
1014
1014
  "title": "Histogram in a list",
1015
- "note": "Five bars beside the number, each the share of the largest level, so a reader comparing products sees that 3,3 from a split audience and 3,3 from a lukewarm one are different products.",
1015
+ "note": "Five bars beside the number, each the share of the largest level, so a reader comparing products sees that 3.3 from a split audience and 3.3 from a lukewarm one are different products.",
1016
1016
  "language": "tsx",
1017
1017
  "source": "<RatingDisplay count={8} distribution={[3, 0, 1, 0, 4]} value={3.25} variant=\"histogram\" />;\n",
1018
1018
  "verdict": "excerpt"
@@ -1027,7 +1027,7 @@
1027
1027
  },
1028
1028
  {
1029
1029
  "id": "content",
1030
- "title": "Content the family did not choose",
1030
+ "title": "Content the rating did not choose",
1031
1031
  "note": "Ten symbols in a narrow column shrink rather than wrap, another locale changes the separators, and a different symbol comes through renderSymbol, drawn in both the unlit and the lit layer.",
1032
1032
  "language": "tsx",
1033
1033
  "source": "<RatingDisplay max={10} value={7.5} />;\n<RatingDisplay count={1284} locale=\"en-US\" value={4.6} />;\n<RatingDisplay\n renderSymbol={() => (\n <Icon>\n <Glyph name=\"dot\" />\n </Icon>\n )}\n value={3}\n/>;\n",
@@ -1054,8 +1054,8 @@
1054
1054
  "title": "Spectrum",
1055
1055
  "note": "The same counts on the axis of the scale: a column per level, the mean, its 95% interval and the three buckets. Few readings widen the interval until the count says the mean is uncertain.",
1056
1056
  "language": "tsx",
1057
- "source": "<RatingSummary aria-label=\"Ratings summary\" counts={[9, 18, 47, 158, 1052]} variant=\"spectrum\" />;\n",
1058
- "verdict": "excerpt"
1057
+ "source": "import { RatingSummary } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function RatingSpectrum() {\n return (\n <Stack gap={6}>\n <RatingSummary\n aria-label=\"Trail boots ratings\"\n counts={[9, 18, 47, 158, 1052]}\n variant=\"spectrum\"\n />\n <RatingSummary\n aria-label=\"Camp stove ratings\"\n counts={[40, 12, 10, 14, 60]}\n variant=\"spectrum\"\n />\n <RatingSummary aria-label=\"Rain jacket ratings\" counts={[0, 1, 2, 4, 5]} variant=\"spectrum\" />\n </Stack>\n );\n}\n",
1058
+ "verdict": "example"
1059
1059
  },
1060
1060
  {
1061
1061
  "id": "insight",
@@ -1080,6 +1080,70 @@
1080
1080
  "language": "tsx",
1081
1081
  "source": "<Measure>\n <RatingSummary aria-label=\"Ratings\" counts={[9, 18, 47, 158, 1052]} />\n</Measure>;\n",
1082
1082
  "verdict": "excerpt"
1083
+ },
1084
+ {
1085
+ "id": "basic",
1086
+ "title": "basic.tsx",
1087
+ "note": null,
1088
+ "language": "tsx",
1089
+ "source": "import { Rating } from '@slotted/react/rating';\n\nconst WORDS = ['No rating', 'Terrible', 'Poor', 'Fair', 'Good', 'Excellent'];\n\nexport default function RatingBasic() {\n return (\n <Rating\n aria-label=\"Delivery experience\"\n caption={({ preview, value }) => WORDS[preview ?? value ?? 0]}\n defaultValue={4}\n />\n );\n}\n",
1090
+ "verdict": "example"
1091
+ },
1092
+ {
1093
+ "id": "controlled",
1094
+ "title": "controlled.tsx",
1095
+ "note": null,
1096
+ "language": "tsx",
1097
+ "source": "import { useState } from 'react';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Rating } from '@slotted/react/rating';\nimport type { RatingChangeRequest } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function RatingControlled() {\n const [value, setValue] = useState<number | null>(3);\n const [reason, setReason] = useState('none');\n\n const summary = `Value ${value ?? 'empty'}, last request ${reason}.`;\n\n function handleValueChange(next: number | null, request: RatingChangeRequest) {\n setValue(next);\n setReason(request.reason);\n }\n\n return (\n <Stack gap={4}>\n <Rating aria-label=\"Supplier rating\" onValueChange={handleValueChange} value={value} />\n <Text size=\"sm\" tone=\"muted\">\n {summary}\n </Text>\n <Inline>\n <Button onClick={() => setValue(null)} size=\"sm\" tone=\"secondary\" variant=\"outline\">\n Reset\n </Button>\n </Inline>\n </Stack>\n );\n}\n",
1098
+ "verdict": "example"
1099
+ },
1100
+ {
1101
+ "id": "provider",
1102
+ "title": "provider.tsx",
1103
+ "note": null,
1104
+ "language": "tsx",
1105
+ "source": "import { Rating, RatingProvider } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function RatingProviderExample() {\n return (\n <RatingProvider clearable={false} max={10} size=\"lg\" tone=\"info\">\n <Stack gap={4}>\n <Rating aria-label=\"Likelihood to reorder\" defaultValue={8} />\n <Rating aria-label=\"Carrier punctuality\" defaultValue={2} max={5} tone=\"danger\" />\n </Stack>\n </RatingProvider>\n );\n}\n",
1106
+ "verdict": "example"
1107
+ },
1108
+ {
1109
+ "id": "sizes",
1110
+ "title": "sizes.tsx",
1111
+ "note": null,
1112
+ "language": "tsx",
1113
+ "source": "import { Inline } from '@slotted/react/inline';\nimport { Rating } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function RatingSizes() {\n return (\n <Stack gap={4}>\n <Inline align=\"center\" gap={3}>\n <Rating aria-label=\"Order accuracy, small\" defaultValue={2} size=\"sm\" />\n <Text size=\"sm\" tone=\"muted\">\n sm\n </Text>\n </Inline>\n <Inline align=\"center\" gap={3}>\n <Rating aria-label=\"Order accuracy, medium\" defaultValue={3} size=\"md\" />\n <Text size=\"sm\" tone=\"muted\">\n md\n </Text>\n </Inline>\n <Inline align=\"center\" gap={3}>\n <Rating aria-label=\"Order accuracy, large\" defaultValue={4} size=\"lg\" />\n <Text size=\"sm\" tone=\"muted\">\n lg\n </Text>\n </Inline>\n </Stack>\n );\n}\n",
1114
+ "verdict": "example"
1115
+ },
1116
+ {
1117
+ "id": "summary",
1118
+ "title": "summary.tsx",
1119
+ "note": null,
1120
+ "language": "tsx",
1121
+ "source": "import { useState } from 'react';\nimport { RatingSummary } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst COUNTS = [9, 18, 47, 158, 1052];\n\nexport default function RatingSummaryExample() {\n const [levels, setLevels] = useState<readonly number[]>([5]);\n\n const shown =\n levels.length === 0 ? 'Showing all reviews.' : `Showing ${levels.join(', ')} star reviews.`;\n\n return (\n <Stack gap={4}>\n <RatingSummary\n aria-label=\"Trail boots ratings\"\n counts={COUNTS}\n filterable\n onSelectedLevelsChange={setLevels}\n selectedLevels={levels}\n />\n <Text size=\"sm\" tone=\"muted\">\n {shown}\n </Text>\n </Stack>\n );\n}\n",
1122
+ "verdict": "example"
1123
+ },
1124
+ {
1125
+ "id": "symbol",
1126
+ "title": "symbol.tsx",
1127
+ "note": null,
1128
+ "language": "tsx",
1129
+ "source": "import { Glyph, Icon } from '@slotted/react/icon';\nimport { Rating } from '@slotted/react/rating';\n\nexport default function RatingSymbol() {\n return (\n <Rating\n aria-label=\"Warehouse cleanliness\"\n defaultValue={3}\n renderSymbol={() => (\n <Icon>\n <Glyph name=\"circle\" />\n </Icon>\n )}\n tone=\"success\"\n />\n );\n}\n",
1130
+ "verdict": "example"
1131
+ },
1132
+ {
1133
+ "id": "tones",
1134
+ "title": "tones.tsx",
1135
+ "note": null,
1136
+ "language": "tsx",
1137
+ "source": "import { Inline } from '@slotted/react/inline';\nimport { RatingDisplay } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function RatingTones() {\n return (\n <Stack gap={3}>\n <Inline align=\"center\" gap={3}>\n <RatingDisplay tone=\"accent\" value={4.6} />\n <Text size=\"sm\" tone=\"muted\">\n accent\n </Text>\n </Inline>\n <Inline align=\"center\" gap={3}>\n <RatingDisplay tone=\"info\" value={4.2} />\n <Text size=\"sm\" tone=\"muted\">\n info\n </Text>\n </Inline>\n <Inline align=\"center\" gap={3}>\n <RatingDisplay tone=\"success\" value={3.8} />\n <Text size=\"sm\" tone=\"muted\">\n success\n </Text>\n </Inline>\n <Inline align=\"center\" gap={3}>\n <RatingDisplay tone=\"warning\" value={3.5} />\n <Text size=\"sm\" tone=\"muted\">\n warning\n </Text>\n </Inline>\n <Inline align=\"center\" gap={3}>\n <RatingDisplay tone=\"danger\" value={2.25} />\n <Text size=\"sm\" tone=\"muted\">\n danger\n </Text>\n </Inline>\n </Stack>\n );\n}\n",
1138
+ "verdict": "example"
1139
+ },
1140
+ {
1141
+ "id": "variants",
1142
+ "title": "variants.tsx",
1143
+ "note": null,
1144
+ "language": "tsx",
1145
+ "source": "import { RatingDisplay } from '@slotted/react/rating';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function RatingVariants() {\n return (\n <Stack gap={4}>\n <RatingDisplay count={1284} value={4.6} />\n <RatingDisplay count={1284} size=\"sm\" value={4.6} variant=\"compact\" />\n <RatingDisplay count={8} distribution={[3, 0, 1, 0, 4]} value={3.25} variant=\"histogram\" />\n </Stack>\n );\n}\n",
1146
+ "verdict": "example"
1083
1147
  }
1084
1148
  ]
1085
1149
  }
@@ -11,10 +11,22 @@ import { Rating, RatingDisplay, RatingProvider, RatingSummary } from '@slotted/r
11
11
 
12
12
  ## Minimal example
13
13
 
14
- Excerpt — not a complete module
14
+ Example
15
15
 
16
16
  ```tsx
17
- <Rating aria-label="Your rating" defaultValue={4} />;
17
+ import { Rating } from '@slotted/react/rating';
18
+
19
+ const WORDS = ['No rating', 'Terrible', 'Poor', 'Fair', 'Good', 'Excellent'];
20
+
21
+ export default function RatingBasic() {
22
+ return (
23
+ <Rating
24
+ aria-label="Delivery experience"
25
+ caption={({ preview, value }) => WORDS[preview ?? value ?? 0]}
26
+ defaultValue={4}
27
+ />
28
+ );
29
+ }
18
30
  ```
19
31
 
20
32
  ## Anatomy
@@ -83,7 +95,7 @@ Excerpt — not a complete module
83
95
 
84
96
  | Name | Type | Default | Applies to | Description |
85
97
  | --- | --- | --- | --- | --- |
86
- | `value` | `number \| null` | — | Rating | Present means controlled, for the life of the component; null is a controlled empty value. Put on the grid of the scale: 3,2 on a whole scale is 4 |
98
+ | `value` | `number \| null` | — | Rating | Present means controlled, for the life of the component; null is a controlled empty value. Put on the grid of the scale: 3.2 on a whole scale is 4 |
87
99
  | `defaultValue` | `number \| null` | null | Rating | The value an uncontrolled rating starts from, read once |
88
100
  | `max` | `number` | 5 | all members, RatingProvider | How many symbols, or how many levels a summary reads from counts |
89
101
  | `step` | `1 \| 0.5` | 1 | Rating | A whole symbol or half of one. Finer fractions are declined: a third of a 20-pixel star is below the minimum target |
@@ -97,8 +109,8 @@ Excerpt — not a complete module
97
109
  | `name` | `string` | generated | Rating | The submission name every radio shares. Generated with useId when it is not written |
98
110
  | `form` | `string` | — | Rating | The form the radios submit with |
99
111
  | `caption` | `ReactNode \| ((state: { value, preview }) => ReactNode)` | — | Rating | A word for the value in the value part. A function follows the pointer |
100
- | `locale` | `string` | the language in force | all members | The locale every number is written in: 4,6 and 1.284 in pt-BR |
101
- | `messages` | `Partial<RatingMessages>` | — | all members | Words laid over the language in force, key by key: every string the family writes |
112
+ | `locale` | `string` | the language in force | all members | The locale every number is written in: 4.6 and 1,284 in en-US |
113
+ | `messages` | `Partial<RatingMessages>` | — | all members | Words laid over the language in force, key by key: every string the rating writes |
102
114
  | `render` | `(props: RatingRootProps) => ReactNode` | — | Rating | Substitutes the div root and hands it every attribute and handler |
103
115
  | `renderSymbol` | `(state: { index, fill }) => ReactNode` | <Icon><Glyph name="star" /></Icon> | Rating | Replaces the symbol. It is drawn in the unlit layer and in the lit one, so it lights the way the star does |
104
116
  | `RatingProvider` | `{ size, tone, max, clearable, insightThresholds }` | — | a subtree | The decisions an application takes once. insightThresholds merges key by key; the instance always wins. The words and the locale come from SlottedProvider |
@@ -117,8 +129,8 @@ Excerpt — not a complete module
117
129
  | `count` | `number` | — | RatingDisplay | How many ratings. Written beside the number and added to the accessible name |
118
130
  | `distribution` | `readonly number[]` | — | RatingDisplay | Counts per level, lowest first, drawn by the histogram variant |
119
131
  | `showValue` | `boolean` | true | RatingDisplay | Whether the number is written beside the symbols |
120
- | `locale` | `string` | the language in force | all members | The locale every number is written in: 4,6 and 1.284 in pt-BR |
121
- | `messages` | `Partial<RatingMessages>` | — | all members | Words laid over the language in force, key by key: every string the family writes |
132
+ | `locale` | `string` | the language in force | all members | The locale every number is written in: 4.6 and 1,284 in en-US |
133
+ | `messages` | `Partial<RatingMessages>` | — | all members | Words laid over the language in force, key by key: every string the rating writes |
122
134
  | `render` | `(props: RatingRootProps) => ReactNode` | — | RatingDisplay | Substitutes the div root and hands it every attribute and handler |
123
135
  | `renderSymbol` | `(state: { index, fill }) => ReactNode` | <Icon><Glyph name="star" /></Icon> | RatingDisplay | Replaces the symbol. It is drawn in the unlit layer and in the lit one, so it lights the way the star does |
124
136
  | `RatingProvider` | `{ size, tone, max, clearable, insightThresholds }` | — | a subtree | The decisions an application takes once. insightThresholds merges key by key; the instance always wins. The words and the locale come from SlottedProvider |
@@ -138,8 +150,8 @@ Excerpt — not a complete module
138
150
  | `insightThresholds` | `Partial<RatingInsightThresholds>` | { divided: 0.25, few: 30, margin: 0.5, consensus: 0.8 } | RatingSummary, RatingProvider | Where the conclusions are drawn, merged over the provider’s |
139
151
  | `size` | `'sm' \| 'md' \| 'lg'` | md | all members, RatingProvider | The step the symbols and the text sit at. The symbol does not follow density; the text does |
140
152
  | `tone` | `'accent' \| 'info' \| 'success' \| 'warning' \| 'danger'` | warning | all members, RatingProvider | The color a lit symbol takes. secondary is declined: its solid step is a ground, and a star lit in it reads as unlit |
141
- | `locale` | `string` | the language in force | all members | The locale every number is written in: 4,6 and 1.284 in pt-BR |
142
- | `messages` | `Partial<RatingMessages>` | — | all members | Words laid over the language in force, key by key: every string the family writes |
153
+ | `locale` | `string` | the language in force | all members | The locale every number is written in: 4.6 and 1,284 in en-US |
154
+ | `messages` | `Partial<RatingMessages>` | — | all members | Words laid over the language in force, key by key: every string the rating writes |
143
155
  | `render` | `(props: RatingRootProps) => ReactNode` | — | RatingSummary | Substitutes the section root and hands it every attribute and handler |
144
156
  | `RatingProvider` | `{ size, tone, max, clearable, insightThresholds }` | — | a subtree | The decisions an application takes once. insightThresholds merges key by key; the instance always wins. The words and the locale come from SlottedProvider |
145
157
  | `ref` | `Ref<HTMLElement>` | — | RatingSummary | Reaches the section |
@@ -152,7 +164,7 @@ Excerpt — not a complete module
152
164
  | --- | --- | --- |
153
165
  | `onValueChange` | `(value: number \| null, request: ChangeRequest<number \| null>)` | Before the value moves. reason is pointer for a press or a scrub, keyboard for an arrow, Home, End or a Space the keyboard synthesised, and clear for a press on the checked star or Backspace and Delete. cancel() refuses the move. A request equal to the value held is not emitted. |
154
166
  | `onPreviewChange` | `(value: number \| null)` | When the pointer moves over a radio, with its value, and with null when the pointer leaves the group. It is an event, not a state model: nothing the consumer owns has moved. |
155
- | `onKeyDown, onPointerDown, onPointerOver, onPointerLeave` | `the element’s own events` | Composed with the family’s: the consumer’s handler runs first, and a preventDefault() in onKeyDown keeps the key from the family. |
167
+ | `onKeyDown, onPointerDown, onPointerOver, onPointerLeave` | `the element’s own events` | Composed with the rating’s own: the consumer’s handler runs first, and a preventDefault() in onKeyDown keeps the key from the rating. |
156
168
 
157
169
  ### ratingSummary
158
170
 
@@ -171,16 +183,16 @@ Excerpt — not a complete module
171
183
 
172
184
  ## Rules
173
185
 
174
- - The pattern is the WAI-ARIA APG’s Rating Radio Group: a radiogroup of native radios that share a name, each named by the itemLabel message — 3,5 de 5 — so the number is heard on every stop. Tab and Space are the platform’s.
186
+ - The pattern is the WAI-ARIA APG’s Rating Radio Group: a radiogroup of native radios that share a name, each named by the itemLabel message — 3.5 out of 5 — so the number is heard on every stop. Tab and Space are the platform’s.
175
187
  - The arrows depart from the radio example on purpose: they stop at both ends instead of wrapping, as the APG’s rating slider, Ark, MUI and Mantine do, because a rating that falls from five to one on one keystroke too many is a defect. Home and End reach the ends, and the inline arrows swap in a right-to-left document.
176
188
  - Read-only has no platform answer for a radio, so the change is refused on the click a pointer and Space share, aria-readonly is announced, and every radio keeps its tab stop. aria-required and aria-invalid are written on the group; the native required is not, because it would engage the browser’s own validation.
177
189
  - In the light and dark schemes a star does not reach 3:1 against the page: the value is always in the accessible name and may be written beside the stars, and the high-contrast scheme and forced colors draw lit and unlit stars as distinct shapes with a contrasting edge.
178
190
  - Under a coarse pointer each target grows to 44 pixels, and a finger can scrub along the row without losing vertical scrolling.
179
- - The display is one image: role="img" with an aria-label from displayLabel or displayLabelWithCount — Avaliação 4,6 de 5, 1.284 avaliações — and every symbol, number and count inside is hidden, so the value is said once.
180
- - The value is written in the locale’s digits and, as a label read aloud, a whole value is written whole: 4 de 5, not 4,0 de 5.
191
+ - The display is one image: role="img" with an aria-label from displayLabel or displayLabelWithCount — Rated 4.6 out of 5, 1,284 ratings — and every symbol, number and count inside is hidden, so the value is said once.
192
+ - The value is written in the locale’s digits and, as a label read aloud, a whole value is written whole: 4 out of 5, not 4.0 out of 5.
181
193
  - A partial star is a clip of one shape, never a color alone; the number beside it is the reading that does not depend on seeing the fraction.
182
194
  - The summary is a region named by its aria-label. The figure, the scale and the count are text; the stars beside them are one image with its own name.
183
- - Each level is named in full by levelLabel — 5 estrelas: 1.052 avaliações, 82% — so a reader hears the level, its count and its share without reading the bar. Filtering, each is a toggle with aria-pressed, disabled where nobody rated.
195
+ - Each level is named in full by levelLabel — 5 stars: 1,052 ratings, 82% — so a reader hears the level, its count and its share without reading the bar. Filtering, each is a toggle with aria-pressed, disabled where nobody rated.
184
196
  - The spectrum’s axis, its interval and its mean are hidden: the count line says the margin or the interval in words, and the conclusion is text in a pill, never a color alone.
185
197
 
186
198
  ## Tokens
@@ -189,230 +201,4 @@ Excerpt — not a complete module
189
201
 
190
202
  ## Examples
191
203
 
192
- ### Half steps
193
-
194
- step={0.5} puts two radios in each star: the half radio sits above the whole one, so the inline-start half of a star asks for the half value. Ten arrow stops for five stars is the cost.
195
-
196
- Excerpt — not a complete module
197
-
198
- ```tsx
199
- <Rating aria-label="Rating in half points" defaultValue={3.5} step={0.5} />;
200
- ```
201
-
202
- ### Read-only, disabled and invalid
203
-
204
- Read-only keeps every tab stop and the lit stars, and refuses every change; disabled dims the row and leaves the value readable; invalid writes aria-invalid and reddens the focus ring.
205
-
206
- Excerpt — not a complete module
207
-
208
- ```tsx
209
- <Rating aria-label="Your previous score" defaultValue={4} readOnly />;
210
- <Rating aria-label="Closed rating" defaultValue={2} disabled />;
211
- <Rating aria-label="Required rating" invalid required />;
212
- ```
213
-
214
- ### Inside a field
215
-
216
- The field names the group through aria-labelledby, says its description and error through aria-describedby, and hands down size, disabled, required and invalid. A checkbox beside it is the answer for a question that may not apply.
217
-
218
- Excerpt — not a complete module
219
-
220
- ```tsx
221
- <Field required>
222
- <FieldLabel>Qualidade do som</FieldLabel>
223
- <Rating />
224
- <FieldDescription>De uma a cinco estrelas.</FieldDescription>
225
- </Field>;
226
- ```
227
-
228
- ### Words for the value
229
-
230
- caption as a function receives the value held and the value under the pointer, so the word follows the pointer and settles back. Each radio keeps its own number as its accessible name, through the itemLabel message.
231
-
232
- Excerpt — not a complete module
233
-
234
- ```tsx
235
- const WORDS = ['Terrible', 'Poor', 'Fair', 'Good', 'Excellent'];
236
-
237
- <Rating
238
- aria-label="Atendimento"
239
- caption={({ preview, value }) => {
240
- const shown = preview ?? value;
241
- return shown === null ? 'No rating' : WORDS[shown - 1];
242
- }}
243
- defaultValue={4}
244
- />;
245
- ```
246
-
247
- ### The keyboard
248
-
249
- Tab lands on the checked star, or on the first. The arrows move one step and stop at both ends instead of wrapping; Home and End reach them; Backspace and Delete empty the value. The inline arrows swap in a right-to-left document.
250
-
251
- Excerpt — not a complete module
252
-
253
- ```tsx
254
- <Rating
255
- aria-label="Delivery"
256
- defaultValue={3}
257
- onValueChange={(value, request) => console.log(value, request.reason)}
258
- />;
259
- ```
260
-
261
- ### A finger along the row
262
-
263
- A finger or a pen dragged along the stars asks for the value under it, and only when that value changes; the root carries data-dragging so the fill follows without easing. A mouse does not scrub: it previews on hover and chooses on press.
264
-
265
- Excerpt — not a complete module
266
-
267
- ```tsx
268
- <Rating aria-label="Arraste para avaliar" max={10} size="lg" />;
269
- ```
270
-
271
- ### Playground
272
-
273
- A reported value on the controls below the canvas. It is one image: the stars, the number and the count are hidden, and the name says all three once.
274
-
275
- Excerpt — not a complete module
276
-
277
- ```tsx
278
- <RatingDisplay count={1284} value={4.6} />;
279
- ```
280
-
281
- ### Any fraction
282
-
283
- Each star is lit by its own share of the value, so 4,6 lights six tenths of the fifth star and 2,25 a quarter of the third — the display draws what the input member cannot offer.
284
-
285
- Excerpt — not a complete module
286
-
287
- ```tsx
288
- <RatingDisplay value={4.6} />;
289
- <RatingDisplay value={3.5} />;
290
- <RatingDisplay value={2.25} />;
291
- ```
292
-
293
- ### Compact
294
-
295
- One star, the number and the count, for a card or a table cell with no room for five. The name still says the whole value and the scale.
296
-
297
- Excerpt — not a complete module
298
-
299
- ```tsx
300
- <RatingDisplay count={1284} size="sm" value={4.6} variant="compact" />;
301
- ```
302
-
303
- ### Histogram in a list
304
-
305
- Five bars beside the number, each the share of the largest level, so a reader comparing products sees that 3,3 from a split audience and 3,3 from a lukewarm one are different products.
306
-
307
- Excerpt — not a complete module
308
-
309
- ```tsx
310
- <RatingDisplay count={8} distribution={[3, 0, 1, 0, 4]} value={3.25} variant="histogram" />;
311
- ```
312
-
313
- ### With and without a count
314
-
315
- count is written in the locale’s grouping and added to the accessible name; without it the name says only the value. A product nobody rated shows zero, not an empty row.
316
-
317
- Excerpt — not a complete module
318
-
319
- ```tsx
320
- <RatingDisplay count={1284} value={4.6} />;
321
- <RatingDisplay value={3.5} />;
322
- <RatingDisplay count={0} value={0} />;
323
- ```
324
-
325
- ### Content the family did not choose
326
-
327
- Ten symbols in a narrow column shrink rather than wrap, another locale changes the separators, and a different symbol comes through renderSymbol, drawn in both the unlit and the lit layer.
328
-
329
- Excerpt — not a complete module
330
-
331
- ```tsx
332
- <RatingDisplay max={10} value={7.5} />;
333
- <RatingDisplay count={1284} locale="en-US" value={4.6} />;
334
- <RatingDisplay
335
- renderSymbol={() => (
336
- <Icon>
337
- <Glyph name="dot" />
338
- </Icon>
339
- )}
340
- value={3}
341
- />;
342
- ```
343
-
344
- ### Playground
345
-
346
- The bars variant: the mean as a figure, its scale, the stars and the count, then one bar per level, highest first, each the level’s share of the total.
347
-
348
- Excerpt — not a complete module
349
-
350
- ```tsx
351
- <RatingSummary aria-label="Customer ratings" counts={[9, 18, 47, 158, 1052]} />;
352
- ```
353
-
354
- ### Levels that filter
355
-
356
- filterable turns each level into a toggle with aria-pressed; a level nobody chose is disabled. The pressed levels are a state model of their own, controlled or not, with the reason pointer or keyboard.
357
-
358
- Excerpt — not a complete module
359
-
360
- ```tsx
361
- const [levels, setLevels] = useState<readonly number[]>([5]);
362
-
363
- <RatingSummary
364
- aria-label="Filter ratings"
365
- counts={[9, 18, 47, 158, 1052]}
366
- filterable
367
- onSelectedLevelsChange={setLevels}
368
- selectedLevels={levels}
369
- />;
370
- ```
371
-
372
- ### Spectrum
373
-
374
- The same counts on the axis of the scale: a column per level, the mean, its 95% interval and the three buckets. Few readings widen the interval until the count says the mean is uncertain.
375
-
376
- Excerpt — not a complete module
377
-
378
- ```tsx
379
- <RatingSummary aria-label="Ratings summary" counts={[9, 18, 47, 158, 1052]} variant="spectrum" />;
380
- ```
381
-
382
- ### The conclusion
383
-
384
- The first conclusion that holds: divided when both ends pass a quarter, few under thirty readings or with a margin of half a star, consensus when four in five are positive, mixed otherwise. Thresholds come from the provider or the instance.
385
-
386
- Excerpt — not a complete module
387
-
388
- ```tsx
389
- <RatingSummary counts={[40, 12, 10, 14, 60]} variant="spectrum" />;
390
- <RatingSummary counts={[1, 0, 2, 3, 4]} variant="spectrum" />;
391
- <RatingSummary
392
- counts={[9, 18, 47, 158, 1052]}
393
- insightThresholds={{ consensus: 0.95 }}
394
- variant="spectrum"
395
- />;
396
- ```
397
-
398
- ### Nothing rated yet
399
-
400
- No figure and no scale: an absent mean is not a nought. The stars stay unlit, the count says why, and the conclusion is withheld.
401
-
402
- Excerpt — not a complete module
403
-
404
- ```tsx
405
- <RatingSummary aria-label="No ratings" counts={[0, 0, 0, 0, 0]} />;
406
- ```
407
-
408
- ### At a phone’s width
409
-
410
- The aggregate and the distribution stand side by side while both fit and stack when they do not; the spectrum keeps its axis and lets the count wrap.
411
-
412
- Excerpt — not a complete module
413
-
414
- ```tsx
415
- <Measure>
416
- <RatingSummary aria-label="Ratings" counts={[9, 18, 47, 158, 1052]} />
417
- </Measure>;
418
- ```
204
+ See [rating.examples.md](./rating.examples.md).