@slotted/react 0.1.0-beta.27 → 0.1.0-beta.29

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 (237) hide show
  1. package/dist/attachment-AAjprQyU.js +292 -0
  2. package/dist/attachment-kinds-x-DEOvCy.js +17 -0
  3. package/dist/attachment.js +3 -2
  4. package/dist/{cascader-CwwtJs3W.js → cascader-DUiUVxBt.js} +1 -1
  5. package/dist/cascader.js +1 -1
  6. package/dist/{checkbox-group-DDlz-UF4.js → checkbox-group-Ben6o9Ze.js} +2 -2
  7. package/dist/checkbox-group.js +1 -1
  8. package/dist/{checkbox-Dw9R1CGR.js → checkbox-ruvmi9cK.js} +3 -3
  9. package/dist/checkbox.js +1 -1
  10. package/dist/{color-picker-2i3A60vD.js → color-picker-DP8MjvXk.js} +2 -2
  11. package/dist/color-picker.js +1 -1
  12. package/dist/{column-manager-D4HIwXPi.js → column-manager-NN-ZCcy9.js} +2 -2
  13. package/dist/column-manager.js +1 -1
  14. package/dist/{combobox-BpZ8i-61.js → combobox-BIi7grOR.js} +1 -1
  15. package/dist/combobox.js +1 -1
  16. package/dist/{currency-field-CTzBMH8g.js → currency-field-CAO2ZolW.js} +1 -1
  17. package/dist/currency-field.js +1 -1
  18. package/dist/{data-grid-CuHnCT01.js → data-grid-DSI_LFmJ.js} +15 -15
  19. package/dist/data-grid.js +1 -1
  20. package/dist/{data-list-CuzWmmGp.js → data-list-fAeBMZZT.js} +1 -1
  21. package/dist/data-list.js +1 -1
  22. package/dist/{date-field-B2WG_m4C.js → date-field-BEdt1xDF.js} +1 -1
  23. package/dist/date-field.js +1 -1
  24. package/dist/{date-picker-B2wqU3Mw.js → date-picker-CB3pyJob.js} +96 -75
  25. package/dist/date-picker.js +1 -1
  26. package/dist/date-range-picker-Dyp5_teF.js +522 -0
  27. package/dist/date-range-picker.js +1 -1
  28. package/dist/{datetime-field-CvKPkvaE.js → datetime-field-2tsqzWVH.js} +1 -1
  29. package/dist/datetime-field.js +1 -1
  30. package/dist/datetime-picker-D-fhwe8l.js +683 -0
  31. package/dist/datetime-picker.js +1 -1
  32. package/dist/{datetime-range-picker-0xs12Cf1.js → datetime-range-picker-Bh3mAEsM.js} +382 -361
  33. package/dist/datetime-range-picker.js +1 -1
  34. package/dist/docs/command-palette.json +1 -0
  35. package/dist/docs/command-palette.md +1 -1
  36. package/dist/docs/date-picker.json +11 -0
  37. package/dist/docs/date-picker.md +2 -1
  38. package/dist/docs/date-range-picker.json +11 -0
  39. package/dist/docs/date-range-picker.md +2 -1
  40. package/dist/docs/datetime-picker.json +11 -0
  41. package/dist/docs/datetime-picker.md +2 -1
  42. package/dist/docs/datetime-range-picker.json +11 -0
  43. package/dist/docs/datetime-range-picker.md +2 -1
  44. package/dist/docs/description-list.json +2 -1
  45. package/dist/docs/description-list.md +2 -2
  46. package/dist/docs/drawer.json +2 -0
  47. package/dist/docs/drawer.md +1 -1
  48. package/dist/docs/entity-picker.json +1 -0
  49. package/dist/docs/entity-picker.md +1 -1
  50. package/dist/docs/field-group.json +15 -0
  51. package/dist/docs/field-group.md +3 -1
  52. package/dist/docs/guidelines/forms.md +15 -3
  53. package/dist/docs/guidelines/index.md +2 -1
  54. package/dist/docs/guidelines/overviews.md +6 -6
  55. package/dist/docs/index.md +1 -0
  56. package/dist/docs/media-viewer.json +575 -0
  57. package/dist/docs/media-viewer.md +235 -0
  58. package/dist/docs/skills/theme-app/SKILL.md +8 -2
  59. package/dist/docs/stat-card.json +16 -1
  60. package/dist/docs/stat-card.md +3 -1
  61. package/dist/docs/tag.json +1 -0
  62. package/dist/docs/tag.md +1 -1
  63. package/dist/docs/time-picker.json +11 -0
  64. package/dist/docs/time-picker.md +2 -1
  65. package/dist/docs/time-range-picker.json +11 -0
  66. package/dist/docs/time-range-picker.md +2 -1
  67. package/dist/{entity-picker-BYAlDJL-.js → entity-picker-DfoAxqaa.js} +2 -2
  68. package/dist/entity-picker.js +1 -1
  69. package/dist/{event-calendar-BuZg4ghj.js → event-calendar-BiGeWzAG.js} +1 -1
  70. package/dist/event-calendar.js +1 -1
  71. package/dist/{field-CSSHwGq_.js → field-BjF0c0U9.js} +2 -2
  72. package/dist/{field-group-DeBTueJW.js → field-group-DQI8pfDT.js} +39 -37
  73. package/dist/field-group.js +1 -1
  74. package/dist/field.js +1 -1
  75. package/dist/{filter-bar-DeBYLpbg.js → filter-bar-Bb_8T3nU.js} +8 -8
  76. package/dist/filter-bar.js +1 -1
  77. package/dist/{import-export-center-CTliNoT9.js → import-export-center-Do0zrdSV.js} +1 -1
  78. package/dist/import-export-center.js +1 -1
  79. package/dist/index.js +73 -71
  80. package/dist/{listbox-BSx90S2g.js → listbox-Df177k5C.js} +1 -1
  81. package/dist/listbox.js +1 -1
  82. package/dist/{markdown-DX-mBYVT.js → markdown-B_niyRIl.js} +1 -1
  83. package/dist/markdown.js +1 -1
  84. package/dist/media-viewer-zEXcwfEY.js +629 -0
  85. package/dist/media-viewer.js +2 -0
  86. package/dist/{multi-select-Dh2gOp42.js → multi-select-DSSDlWVZ.js} +1 -1
  87. package/dist/multi-select.js +1 -1
  88. package/dist/{number-field-C20-8yda.js → number-field-DzOcs9uG.js} +1 -1
  89. package/dist/number-field.js +1 -1
  90. package/dist/{otp-input-YI-Emc5k.js → otp-input-ult9fNdj.js} +1 -1
  91. package/dist/otp-input.js +1 -1
  92. package/dist/{prompt-composer-DsnPcKa4.js → prompt-composer-D9oaFXDU.js} +1 -1
  93. package/dist/prompt-composer.js +1 -1
  94. package/dist/{radio-group-DA8_LbEz.js → radio-group-doL7tde1.js} +2 -2
  95. package/dist/radio-group.js +1 -1
  96. package/dist/{rating-DSSqi85N.js → rating-Cjrwmxyw.js} +1 -1
  97. package/dist/rating.js +1 -1
  98. package/dist/{saved-views-BKhAqvhI.js → saved-views-BKOHI-Od.js} +2 -2
  99. package/dist/saved-views.js +1 -1
  100. package/dist/{segmented-control-Dae5wU9X.js → segmented-control-Dl-nryCN.js} +2 -2
  101. package/dist/segmented-control.js +1 -1
  102. package/dist/{select-BcTau8q3.js → select-jdqT8lFi.js} +1 -1
  103. package/dist/select.js +1 -1
  104. package/dist/{slider-DNRphJot.js → slider-DuJGh0pf.js} +1 -1
  105. package/dist/slider.js +1 -1
  106. package/dist/{stat-card-BpKP2yxe.js → stat-card-BGtnZpnK.js} +43 -42
  107. package/dist/stat-card.js +1 -1
  108. package/dist/styles/action-sheet.css +1 -1
  109. package/dist/styles/attachment.css +1 -1
  110. package/dist/styles/cascader.css +2 -2
  111. package/dist/styles/checkbox-group.css +2 -2
  112. package/dist/styles/checkbox.css +2 -2
  113. package/dist/styles/color-picker.css +1 -1
  114. package/dist/styles/column-manager.css +3 -3
  115. package/dist/styles/combobox.css +1 -1
  116. package/dist/styles/command-palette.css +2 -2
  117. package/dist/styles/currency-field.css +1 -1
  118. package/dist/styles/data-grid.css +9 -9
  119. package/dist/styles/data-list.css +2 -2
  120. package/dist/styles/date-field.css +1 -1
  121. package/dist/styles/date-picker.css +2 -2
  122. package/dist/styles/date-range-picker.css +2 -2
  123. package/dist/styles/datetime-field.css +1 -1
  124. package/dist/styles/datetime-picker.css +2 -2
  125. package/dist/styles/datetime-range-picker.css +2 -2
  126. package/dist/styles/description-list.css +1 -1
  127. package/dist/styles/dialog.css +1 -1
  128. package/dist/styles/drawer.css +1 -1
  129. package/dist/styles/entity-picker.css +3 -3
  130. package/dist/styles/event-calendar.css +3 -3
  131. package/dist/styles/field-group.css +2 -2
  132. package/dist/styles/field.css +1 -1
  133. package/dist/styles/filter-bar.css +7 -7
  134. package/dist/styles/import-export-center.css +9 -9
  135. package/dist/styles/index.css +20 -18
  136. package/dist/styles/listbox.css +1 -1
  137. package/dist/styles/markdown.css +2 -2
  138. package/dist/styles/media-viewer.css +6 -0
  139. package/dist/styles/message-scroller.css +1 -1
  140. package/dist/styles/message.css +1 -1
  141. package/dist/styles/multi-select.css +2 -2
  142. package/dist/styles/number-field.css +1 -1
  143. package/dist/styles/otp-input.css +1 -1
  144. package/dist/styles/prompt-composer.css +1 -1
  145. package/dist/styles/radio-group.css +2 -2
  146. package/dist/styles/rating.css +1 -1
  147. package/dist/styles/saved-views.css +1 -1
  148. package/dist/styles/segmented-control.css +2 -2
  149. package/dist/styles/select.css +2 -2
  150. package/dist/styles/slider.css +1 -1
  151. package/dist/styles/stat-card.css +1 -1
  152. package/dist/styles/switch.css +1 -1
  153. package/dist/styles/table.css +9 -9
  154. package/dist/styles/tag.css +1 -1
  155. package/dist/styles/tags-input.css +2 -2
  156. package/dist/styles/text-field.css +1 -1
  157. package/dist/styles/textarea.css +1 -1
  158. package/dist/styles/time-field.css +1 -1
  159. package/dist/styles/time-picker.css +2 -2
  160. package/dist/styles/time-range-picker.css +2 -2
  161. package/dist/styles/toggle-group.css +1 -1
  162. package/dist/styles/transfer.css +2 -2
  163. package/dist/styles/upload.css +2 -2
  164. package/dist/styles/wizard.css +2 -2
  165. package/dist/styles.css +1 -1
  166. package/dist/{switch-gR_OvGG8.js → switch-Tr3blHWc.js} +1 -1
  167. package/dist/switch.js +1 -1
  168. package/dist/{table-Dx-RQ64i.js → table-Bm-PAtCn.js} +12 -12
  169. package/dist/table.js +1 -1
  170. package/dist/{tags-input-hZs5oaT1.js → tags-input-_cYR2JSK.js} +1 -1
  171. package/dist/tags-input.js +1 -1
  172. package/dist/{text-field-RGXN7zNu.js → text-field-DEm3MEe2.js} +1 -1
  173. package/dist/text-field.js +1 -1
  174. package/dist/{textarea-AhpUmnMk.js → textarea-BRRn55L2.js} +1 -1
  175. package/dist/textarea.js +1 -1
  176. package/dist/{time-field-xkxX8JF6.js → time-field-C9dFaZOx.js} +1 -1
  177. package/dist/time-field.js +1 -1
  178. package/dist/{time-picker-Da_UhP9X.js → time-picker-Cw9NezUE.js} +159 -138
  179. package/dist/time-picker.js +1 -1
  180. package/dist/{time-range-picker-CfVzD53N.js → time-range-picker-DmmUqGjV.js} +304 -283
  181. package/dist/time-range-picker.js +1 -1
  182. package/dist/{toggle-group-DoxPLYJ3.js → toggle-group-DiKxYOwh.js} +1 -1
  183. package/dist/toggle-group.js +1 -1
  184. package/dist/{transfer-DHjPhRlH.js → transfer-CmPxesyZ.js} +5 -5
  185. package/dist/transfer.js +1 -1
  186. package/dist/types/date-picker/date-picker.d.ts.map +1 -1
  187. package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
  188. package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
  189. package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
  190. package/dist/types/field/field-parts.d.ts.map +1 -1
  191. package/dist/types/field-group/field-group-parts.d.ts.map +1 -1
  192. package/dist/types/field-group/field-group.d.ts +1 -1
  193. package/dist/types/field-group/field-group.d.ts.map +1 -1
  194. package/dist/types/field-group/field-group.types.d.ts +9 -0
  195. package/dist/types/field-group/field-group.types.d.ts.map +1 -1
  196. package/dist/types/field-group/index.d.ts +1 -1
  197. package/dist/types/field-group/index.d.ts.map +1 -1
  198. package/dist/types/index.d.ts +1 -0
  199. package/dist/types/index.d.ts.map +1 -1
  200. package/dist/types/media-viewer/index.d.ts +9 -0
  201. package/dist/types/media-viewer/index.d.ts.map +1 -0
  202. package/dist/types/media-viewer/media-viewer-anatomy.d.ts +3 -0
  203. package/dist/types/media-viewer/media-viewer-anatomy.d.ts.map +1 -0
  204. package/dist/types/media-viewer/media-viewer-bar.d.ts +16 -0
  205. package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -0
  206. package/dist/types/media-viewer/media-viewer-context.d.ts +25 -0
  207. package/dist/types/media-viewer/media-viewer-context.d.ts.map +1 -0
  208. package/dist/types/media-viewer/media-viewer-controls.d.ts +14 -0
  209. package/dist/types/media-viewer/media-viewer-controls.d.ts.map +1 -0
  210. package/dist/types/media-viewer/media-viewer-defaults.d.ts +15 -0
  211. package/dist/types/media-viewer/media-viewer-defaults.d.ts.map +1 -0
  212. package/dist/types/media-viewer/media-viewer-fallback.d.ts +5 -0
  213. package/dist/types/media-viewer/media-viewer-fallback.d.ts.map +1 -0
  214. package/dist/types/media-viewer/media-viewer-media.d.ts +3 -0
  215. package/dist/types/media-viewer/media-viewer-media.d.ts.map +1 -0
  216. package/dist/types/media-viewer/media-viewer-stage.d.ts +9 -0
  217. package/dist/types/media-viewer/media-viewer-stage.d.ts.map +1 -0
  218. package/dist/types/media-viewer/media-viewer.d.ts +10 -0
  219. package/dist/types/media-viewer/media-viewer.d.ts.map +1 -0
  220. package/dist/types/media-viewer/media-viewer.types.d.ts +75 -0
  221. package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -0
  222. package/dist/types/media-viewer/use-media-viewer-state.d.ts +29 -0
  223. package/dist/types/media-viewer/use-media-viewer-state.d.ts.map +1 -0
  224. package/dist/types/stat-card/index.d.ts +1 -1
  225. package/dist/types/stat-card/index.d.ts.map +1 -1
  226. package/dist/types/stat-card/stat-card.d.ts +1 -1
  227. package/dist/types/stat-card/stat-card.d.ts.map +1 -1
  228. package/dist/types/stat-card/stat-card.types.d.ts +8 -0
  229. package/dist/types/stat-card/stat-card.types.d.ts.map +1 -1
  230. package/dist/types/time-picker/time-picker.d.ts.map +1 -1
  231. package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
  232. package/dist/{upload-BqVBpYaZ.js → upload-BmRZHySQ.js} +1 -1
  233. package/dist/upload.js +1 -1
  234. package/package.json +10 -6
  235. package/dist/attachment-C1wBuup6.js +0 -307
  236. package/dist/date-range-picker-BhQwOKkE.js +0 -501
  237. package/dist/datetime-picker-C-PwlBW5.js +0 -662
@@ -63,6 +63,7 @@ Every active rule, one line each. Load this first; load a topic file when the ta
63
63
  | FM-22 | MUST | A set of choices is a `field-group` whose legend asks the question the choices answer. | `forms.md` |
64
64
  | FM-23 | SHOULD | One `necessity` holds for the whole application, set once through the field defaults provider; `optional` is preferred, which marks the fields a reader may skip and says nothing on the rest. | `forms.md` |
65
65
  | FM-24 | SHOULD | A format or a consequence of one answer is a one-line `description` under its control; the definition of a term is the field's `help` beside the label; what the whole record will do is the form's `aside`, beside the fields on a wide form and after them on a narrow one. | `forms.md` |
66
+ | FM-25 | SHOULD | A form inside a `dialog` takes the dialog's body as its measure, with fields whose answers are short (an amount, a date, a count, a currency) two to a row in two equal columns in the order the reader answers them, each control filling its column, and a field whose answer is long (a name, free text, a picker of records) on a row of its own. | `forms.md` |
66
67
  | LA-01 | SHOULD | A pager under a paged region is aligned to the end of the line. | `layout-alignment.md` |
67
68
  | LA-02 | MUST | A consumer's row in the navigation column's pinned parts is inset by `--slotted-app-shell-row-inset` and starts with a mark column `--slotted-app-shell-row-mark` wide, the avatar centred in it. | `layout-alignment.md` |
68
69
  | LA-03 | SHOULD | Below the header's narrow step the header's actions occupy one row: one action beside a plain title becomes its icon-only form, and two or more stand in a `toolbar` that folds into its menu, each item with its counterpart and the primary one without, so it stays. Beside a plain title that row is the title's line; under a rich title (visual, marks, subheading) `page-header` gives the toolbar a full row of its own. | `layout-alignment.md` |
@@ -91,7 +92,7 @@ Every active rule, one line each. Load this first; load a topic file when the ta
91
92
  | OV-01 | SHOULD | The figure leads to the list page of the records it counts, and that list opens with the figure's condition applied as the bar's own pills, which the reader removes like any other. | `overviews.md` |
92
93
  | OV-02 | SHOULD | Below 600 pixels the figures are one `list` of rows that are destinations — label, comparison, number — followed by the records to act on, the work in flight, the charts, and the history last. | `overviews.md` |
93
94
  | OV-03 | SHOULD | Where the reader's scope holds one category, the chart is not drawn and one sentence states the numbers it would have compared. | `overviews.md` |
94
- | OV-04 | SHOULD | The thresholds are stated once in words beside the figures, and a figure past one says so in its own comparison line, on the line the placeholder reserves. | `overviews.md` |
95
+ | OV-04 | SHOULD | The thresholds are stated once in words beside the figures, and a figure past one says so in its own comparison line, on the line the placeholder reserves; the card takes `attention` at the threshold's level (`warning` or `danger`). | `overviews.md` |
95
96
  | OV-05 | SHOULD | A chart takes the `card` `variant` when it is one of two or more peer tiles in one grid with no section heading of its own, and stays `plain` when it is the body of a titled section or the only content of a tab. | `overviews.md` |
96
97
  | OV-06 | SHOULD | The cards of one row carry a label of at most three words, the figure, and the same optional parts on every card — a comparison of one line on each, or on none. | `overviews.md` |
97
98
  | OV-07 | SHOULD | The overview is one `dashboard-grid` whose blocks are each one of its widgets, and each headline figure is a widget of its own whose title is the figure's label. | `overviews.md` |
@@ -45,15 +45,15 @@ Do: Decide the chart from the scope the page already reads, and write the senten
45
45
  Don't: Draw one group of bars, or leave an empty chart region for a reader scoped to one place.
46
46
  Check: Sign in as a reader whose scope holds one category: the overview draws no comparison chart, and one sentence states that category's numbers.
47
47
 
48
- ### OV-04 · A threshold is said, not painted
48
+ ### OV-04 · A threshold is said, then painted
49
49
 
50
50
  Level: SHOULD
51
51
  Applies to: a figure of an overview whose reading changes at a share the product states — overdue receivables against all receivables
52
- Rule: The thresholds are stated once in words beside the figures, and a figure past one says so in its own comparison line, on the line the placeholder reserves.
53
- Why: The figure card's tone is the trend's and paints nothing on a card without one, and a mark added beside the label moves the card's header to a second line.
54
- Do: Keep the shares in one place of the page's code and one sentence on screen ("a warning from 20 percent of receivables and a danger from 33"), and end the crossed figure's comparison with the threshold it passed ("26% of receivables, above 20%").
55
- Don't: Set a tone on a card with no trend and expect it to read, or add a badge to the card's header for the crossing.
56
- Check: Bring a figure past each stated threshold: the threshold sentence stands beside the figures, and the figure's own comparison line says it crossed, on the line its placeholder reserved.
52
+ Rule: The thresholds are stated once in words beside the figures, and a figure past one says so in its own comparison line, on the line the placeholder reserves; the card takes `attention` at the threshold's level (`warning` or `danger`).
53
+ Why: Colour is a second channel: `attention` paints the value and the edge of the card, and a reader who does not see the colour reads the crossing in the comparison. The card's `tone` is the trend's and paints nothing on a card without one, and a mark added beside the label moves the card's header to a second line.
54
+ Do: Keep the shares in one place of the page's code and one sentence on screen ("a warning from 20 percent of receivables and a danger from 33"), end the crossed figure's comparison with the threshold it passed ("26% of receivables, above 20%"), and set `attention` to `warning` on that card.
55
+ Don't: Set `attention` on a card whose comparison does not name the threshold, set `tone` to flag a crossing, or add a badge to the card's header for the crossing.
56
+ Check: Bring a figure past each stated threshold: the threshold sentence stands beside the figures, the figure's own comparison line says it crossed, on the line its placeholder reserved, and the card carries `attention` at the threshold's level.
57
57
 
58
58
  ### OV-05 · A chart is framed only as a tile
59
59
 
@@ -115,6 +115,7 @@ Each family is documented in `./<family>.md`.
115
115
  - dialog: Modal dialog and alert dialog.
116
116
  - drawer: Panel that slides in from an edge.
117
117
  - hover-card: Preview card that opens on hover or focus.
118
+ - media-viewer: Full-screen viewer of files: fitted, zoomed, stepped.
118
119
  - menu: List of actions opened from a trigger.
119
120
  - popover: Floating panel anchored to a trigger.
120
121
  - tooltip: Short label shown on hover or focus.
@@ -0,0 +1,575 @@
1
+ {
2
+ "family": "media-viewer",
3
+ "ui": "media-viewer",
4
+ "binding": "react",
5
+ "catalog": {
6
+ "group": "Overlays",
7
+ "summary": "Full-screen viewer of files: fitted, zoomed, stepped."
8
+ },
9
+ "axes": {},
10
+ "members": {
11
+ "mediaViewer": {
12
+ "nativeElement": "div",
13
+ "defaults": {
14
+ "minZoom": 1,
15
+ "maxZoom": 4,
16
+ "zoomStep": 0.25,
17
+ "loop": false
18
+ },
19
+ "capabilities": [
20
+ "open",
21
+ "value",
22
+ "zoom",
23
+ "content",
24
+ "wiring"
25
+ ],
26
+ "states": [
27
+ "default",
28
+ "hover",
29
+ "active",
30
+ "focus-visible",
31
+ "open",
32
+ "disabled",
33
+ "loading",
34
+ "current"
35
+ ],
36
+ "parts": [
37
+ "root",
38
+ "bar",
39
+ "close",
40
+ "heading",
41
+ "title",
42
+ "position",
43
+ "actions",
44
+ "download",
45
+ "stage",
46
+ "frame",
47
+ "text",
48
+ "media",
49
+ "unsupported",
50
+ "tile",
51
+ "status",
52
+ "retry",
53
+ "previous",
54
+ "next",
55
+ "zoom",
56
+ "zoom-out",
57
+ "zoom-level",
58
+ "zoom-in",
59
+ "fit",
60
+ "rotate",
61
+ "caption",
62
+ "thumbnails",
63
+ "thumbnail"
64
+ ]
65
+ }
66
+ },
67
+ "docs": {
68
+ "mediaViewer": {
69
+ "imports": {
70
+ "source": "import { MediaViewer, MediaViewerActions, MediaViewerBar, MediaViewerCaption, MediaViewerClose, MediaViewerDefaultsProvider, MediaViewerDownload, MediaViewerNext, MediaViewerPosition, MediaViewerPrevious, MediaViewerStage, MediaViewerThumbnails, MediaViewerTitle, MediaViewerZoom } from '@slotted/react';"
71
+ },
72
+ "anatomy": [
73
+ {
74
+ "part": "root",
75
+ "element": "div",
76
+ "required": true,
77
+ "purpose": "The viewer inside the dialog’s full-screen content. Carries data-ui=\"media-viewer\", data-kind, data-zoomed, data-loading, and data-slotted-scheme=\"dark\" — or high-contrast when that is the page’s scheme."
78
+ },
79
+ {
80
+ "part": "bar",
81
+ "element": "div",
82
+ "required": true,
83
+ "purpose": "The row above the stage: close, the file’s name and position, the actions."
84
+ },
85
+ {
86
+ "part": "close",
87
+ "element": "button",
88
+ "required": true,
89
+ "purpose": "Closes the viewer."
90
+ },
91
+ {
92
+ "part": "heading",
93
+ "element": "div",
94
+ "required": true,
95
+ "purpose": "The column that holds the title and the position."
96
+ },
97
+ {
98
+ "part": "title",
99
+ "element": "h2",
100
+ "required": true,
101
+ "purpose": "The file’s name, cut in the middle so the extension stays, and the dialog’s accessible name."
102
+ },
103
+ {
104
+ "part": "position",
105
+ "element": "p",
106
+ "required": false,
107
+ "purpose": "Which of how many, and the dialog’s description. Absent for a set of one."
108
+ },
109
+ {
110
+ "part": "actions",
111
+ "element": "div",
112
+ "required": true,
113
+ "purpose": "The consumer’s own controls; absent children, the download."
114
+ },
115
+ {
116
+ "part": "download",
117
+ "element": "a download",
118
+ "required": false,
119
+ "purpose": "The platform’s download of the item’s downloadHref."
120
+ },
121
+ {
122
+ "part": "stage",
123
+ "element": "div",
124
+ "required": true,
125
+ "purpose": "Where the file is drawn and the scrollport of a zoomed picture; focus lands here when the viewer opens."
126
+ },
127
+ {
128
+ "part": "frame",
129
+ "element": "div",
130
+ "required": false,
131
+ "purpose": "The box a zoomed or turned picture takes, axes swapped at a quarter turn. At the fit it steps out of the layout."
132
+ },
133
+ {
134
+ "part": "media",
135
+ "element": "img, iframe, video or audio",
136
+ "required": false,
137
+ "purpose": "The file itself, drawn by the platform: a picture, the browser’s PDF or text reader, a film or a sound with native controls."
138
+ },
139
+ {
140
+ "part": "unsupported",
141
+ "element": "div",
142
+ "required": false,
143
+ "purpose": "For a kind the browser cannot draw: the tile, a heading, one sentence and the download."
144
+ },
145
+ {
146
+ "part": "tile",
147
+ "element": "span",
148
+ "required": false,
149
+ "purpose": "The mark of the file’s kind, with its extension across its foot."
150
+ },
151
+ {
152
+ "part": "text",
153
+ "element": "div",
154
+ "required": false,
155
+ "purpose": "The page a text file is set on: JSON indented, the rest as written, cut at 1 MiB with a note."
156
+ },
157
+ {
158
+ "part": "retry",
159
+ "element": "button",
160
+ "required": false,
161
+ "purpose": "Loads the file again after it did not load."
162
+ },
163
+ {
164
+ "part": "status",
165
+ "element": "div role=\"status\"",
166
+ "required": false,
167
+ "purpose": "Announces a file that is loading; when it did not load, the tile, a heading, a sentence, retry and the download."
168
+ },
169
+ {
170
+ "part": "previous",
171
+ "element": "button",
172
+ "required": false,
173
+ "purpose": "The previous file, over the stage’s start. Disabled at the first without loop; hidden below 600 pixels, where the swipe steps."
174
+ },
175
+ {
176
+ "part": "next",
177
+ "element": "button",
178
+ "required": false,
179
+ "purpose": "The next file, over the stage’s end, under the same rules."
180
+ },
181
+ {
182
+ "part": "zoom",
183
+ "element": "div role=\"group\"",
184
+ "required": false,
185
+ "purpose": "The floating pill under the stage. Present only for a picture that loaded."
186
+ },
187
+ {
188
+ "part": "zoom-out",
189
+ "element": "button",
190
+ "required": false,
191
+ "purpose": "One zoomStep down."
192
+ },
193
+ {
194
+ "part": "zoom-level",
195
+ "element": "output",
196
+ "required": false,
197
+ "purpose": "The level as a percentage of the fit, in tabular figures."
198
+ },
199
+ {
200
+ "part": "zoom-in",
201
+ "element": "button",
202
+ "required": false,
203
+ "purpose": "One zoomStep up."
204
+ },
205
+ {
206
+ "part": "fit",
207
+ "element": "button",
208
+ "required": false,
209
+ "purpose": "Back to the whole picture."
210
+ },
211
+ {
212
+ "part": "rotate",
213
+ "element": "button",
214
+ "required": false,
215
+ "purpose": "A quarter turn clockwise."
216
+ },
217
+ {
218
+ "part": "caption",
219
+ "element": "p",
220
+ "required": false,
221
+ "purpose": "The item’s caption under the stage, in its own direction."
222
+ },
223
+ {
224
+ "part": "thumbnails",
225
+ "element": "div role=\"group\"",
226
+ "required": false,
227
+ "purpose": "A strip of the set, composed by the consumer with MediaViewerThumbnails."
228
+ },
229
+ {
230
+ "part": "thumbnail",
231
+ "element": "button",
232
+ "required": false,
233
+ "purpose": "One file of the strip; the current one carries aria-current and a frame."
234
+ }
235
+ ],
236
+ "api": [
237
+ {
238
+ "name": "items",
239
+ "type": "MediaViewerItem[]",
240
+ "defaultValue": "—",
241
+ "appliesTo": "MediaViewer",
242
+ "description": "{ id, src, name, type, caption?, downloadHref?, thumbnail?, width?, height? }; type is a MIME type"
243
+ },
244
+ {
245
+ "name": "open",
246
+ "type": "boolean",
247
+ "defaultValue": "—",
248
+ "appliesTo": "MediaViewer",
249
+ "description": "Whether the viewer is shown, controlled"
250
+ },
251
+ {
252
+ "name": "defaultOpen",
253
+ "type": "boolean",
254
+ "defaultValue": "false",
255
+ "appliesTo": "MediaViewer",
256
+ "description": "The first open state, uncontrolled"
257
+ },
258
+ {
259
+ "name": "value",
260
+ "type": "string",
261
+ "defaultValue": "—",
262
+ "appliesTo": "MediaViewer",
263
+ "description": "The id of the item shown, controlled"
264
+ },
265
+ {
266
+ "name": "defaultValue",
267
+ "type": "string",
268
+ "defaultValue": "the first item",
269
+ "appliesTo": "MediaViewer",
270
+ "description": "The first item shown, uncontrolled"
271
+ },
272
+ {
273
+ "name": "zoom",
274
+ "type": "number",
275
+ "defaultValue": "—",
276
+ "appliesTo": "MediaViewer",
277
+ "description": "The level, a multiple of the fit, controlled"
278
+ },
279
+ {
280
+ "name": "defaultZoom",
281
+ "type": "number",
282
+ "defaultValue": "1",
283
+ "appliesTo": "MediaViewer",
284
+ "description": "The first level, uncontrolled"
285
+ },
286
+ {
287
+ "name": "rotation",
288
+ "type": "0 | 90 | 180 | 270",
289
+ "defaultValue": "—",
290
+ "appliesTo": "MediaViewer",
291
+ "description": "The turn, controlled"
292
+ },
293
+ {
294
+ "name": "defaultRotation",
295
+ "type": "0 | 90 | 180 | 270",
296
+ "defaultValue": "0",
297
+ "appliesTo": "MediaViewer",
298
+ "description": "The first turn, uncontrolled"
299
+ },
300
+ {
301
+ "name": "minZoom",
302
+ "type": "number",
303
+ "defaultValue": "1",
304
+ "appliesTo": "MediaViewer",
305
+ "description": "The lowest level; 1 is the whole picture"
306
+ },
307
+ {
308
+ "name": "maxZoom",
309
+ "type": "number",
310
+ "defaultValue": "4",
311
+ "appliesTo": "MediaViewer",
312
+ "description": "The highest level"
313
+ },
314
+ {
315
+ "name": "zoomStep",
316
+ "type": "number",
317
+ "defaultValue": "0.25",
318
+ "appliesTo": "MediaViewer",
319
+ "description": "What a button, a key or 100 pixels of wheel add"
320
+ },
321
+ {
322
+ "name": "loop",
323
+ "type": "boolean",
324
+ "defaultValue": "false",
325
+ "appliesTo": "MediaViewer",
326
+ "description": "Steps wrap at the ends instead of stopping"
327
+ },
328
+ {
329
+ "name": "fullscreenToggle",
330
+ "type": "boolean",
331
+ "defaultValue": "false",
332
+ "appliesTo": "MediaViewer",
333
+ "description": "Passed to dialog: asks the platform for the whole screen"
334
+ },
335
+ {
336
+ "name": "container",
337
+ "type": "Element | null",
338
+ "defaultValue": "a layer beside the viewer",
339
+ "appliesTo": "MediaViewer",
340
+ "description": "Where the layer is written"
341
+ },
342
+ {
343
+ "name": "messages",
344
+ "type": "Partial<MediaViewerMessages>",
345
+ "defaultValue": "—",
346
+ "appliesTo": "MediaViewer",
347
+ "description": "Words laid over the language in force, key by key: close, previous, next, zoomIn, zoomOut, fit, rotate, download, position, zoomLevel, unsupportedTitle, unsupported, errorTitle, error, retry, truncated, loading, announce, label"
348
+ },
349
+ {
350
+ "name": "children",
351
+ "type": "ReactNode",
352
+ "defaultValue": "the anatomy",
353
+ "appliesTo": "MediaViewer",
354
+ "description": "The parts, arranged by the consumer"
355
+ },
356
+ {
357
+ "name": "children",
358
+ "type": "ReactNode",
359
+ "defaultValue": "the download",
360
+ "appliesTo": "MediaViewerActions",
361
+ "description": "The product’s own controls"
362
+ },
363
+ {
364
+ "name": "children",
365
+ "type": "ReactNode",
366
+ "defaultValue": "close, title, position, actions",
367
+ "appliesTo": "MediaViewerBar",
368
+ "description": "The bar’s own arrangement"
369
+ },
370
+ {
371
+ "name": "render",
372
+ "type": "(props) => ReactNode",
373
+ "defaultValue": "—",
374
+ "appliesTo": "close, download, previous, next",
375
+ "description": "Renders the wiring into another element"
376
+ },
377
+ {
378
+ "name": "ref",
379
+ "type": "Ref<HTMLElement>",
380
+ "defaultValue": "—",
381
+ "appliesTo": "every part",
382
+ "description": "Reaches the native element; each part extends its own element props"
383
+ }
384
+ ],
385
+ "composition": [
386
+ {
387
+ "name": "MediaViewerDefaultsProvider",
388
+ "type": "{ minZoom, maxZoom, zoomStep, loop, messages }",
389
+ "defaultValue": "—",
390
+ "appliesTo": "a subtree",
391
+ "description": "Sets them once; a viewer that states one still wins"
392
+ },
393
+ {
394
+ "name": "render",
395
+ "type": "(props) => ReactNode",
396
+ "defaultValue": "—",
397
+ "appliesTo": "close, download, previous, next",
398
+ "description": "The consumer element receives data-part and the wiring; spread it"
399
+ },
400
+ {
401
+ "name": "onClick",
402
+ "type": "handler",
403
+ "defaultValue": "—",
404
+ "appliesTo": "close, previous, next",
405
+ "description": "Composed: the page handler runs first and preventDefault refuses the family behaviour"
406
+ },
407
+ {
408
+ "name": "useMediaViewer",
409
+ "type": "() => context",
410
+ "defaultValue": "—",
411
+ "appliesTo": "a part of the consumer’s own",
412
+ "description": "The item, the index, the level and the requests"
413
+ }
414
+ ],
415
+ "events": [
416
+ {
417
+ "name": "onOpenChange",
418
+ "payload": "(open, { reason: 'pointer' | 'keyboard' | 'escape' | 'outsidePress' | 'back' | 'programmatic', cancel() })",
419
+ "when": "The close button, Escape, the platform’s back, a click on the ground beside the picture, a pull down on a finger, or a set that became empty."
420
+ },
421
+ {
422
+ "name": "onValueChange",
423
+ "payload": "(id, { reason: 'pointer' | 'keyboard' | 'remove' | 'programmatic', cancel() })",
424
+ "when": "A step by a button, a thumbnail, an arrow, Home, End or a swipe; remove when the shown item left the set and its neighbour takes its place."
425
+ },
426
+ {
427
+ "name": "onZoomChange",
428
+ "payload": "(zoom, { reason: 'pointer' | 'keyboard' | 'select' | 'programmatic', cancel() })",
429
+ "when": "The wheel, a pinch, a double-click, the pill or a key; select when a step puts the level back to the fit."
430
+ },
431
+ {
432
+ "name": "onRotationChange",
433
+ "payload": "(0 | 90 | 180 | 270, { reason: 'pointer' | 'keyboard' | 'select' | 'programmatic', cancel() })",
434
+ "when": "The rotate button or R; select when a step puts the turn back to 0."
435
+ }
436
+ ],
437
+ "accessibility": [
438
+ "The layer is dialog’s: focus enters it, Tab stays inside, Escape and the platform’s back close it, and focus returns to the opener.",
439
+ "The dialog is named by the file’s title and described by its position, so a reader hears “police-report.pdf, 3 of 5” when it opens; a step announces the new name and position politely.",
440
+ "Focus lands on the stage rather than on the close button, because the content is the picture; the stage is named by the file and takes the arrows, plus, minus, zero and R.",
441
+ "The family’s keys give way inside a video, an audio, a frame or a field, whose own keys win; Ctrl and Meta combinations stay the browser’s zoom. A text file keeps the arrows that scroll it.",
442
+ "A text file is fetched and set as text, never executed, so an HTML file shows its source; the stage holding it scrolls under a finger as a document does.",
443
+ "Every control is a real button with a name from the catalog, and the level is an output that is not live, so the zoom does not chatter at every wheel event.",
444
+ "The viewer draws the dark scheme on its dark ground in light and dark, and keeps the high-contrast scheme when the reader chose it."
445
+ ]
446
+ }
447
+ },
448
+ "tokens": [
449
+ "--slotted-border-subtle",
450
+ "--slotted-border-width-thick",
451
+ "--slotted-border-width-thin",
452
+ "--slotted-control-height-lg",
453
+ "--slotted-control-height-md",
454
+ "--slotted-control-icon-size-lg",
455
+ "--slotted-control-icon-size-md",
456
+ "--slotted-control-radius",
457
+ "--slotted-control-transition-duration",
458
+ "--slotted-control-transition-easing",
459
+ "--slotted-duration-short",
460
+ "--slotted-easing-enter",
461
+ "--slotted-focus-ring-color",
462
+ "--slotted-focus-ring-offset",
463
+ "--slotted-focus-ring-width",
464
+ "--slotted-font-family-mono",
465
+ "--slotted-font-size-md",
466
+ "--slotted-font-size-sm",
467
+ "--slotted-font-size-xs",
468
+ "--slotted-font-weight-medium",
469
+ "--slotted-font-weight-semibold",
470
+ "--slotted-line-height-md",
471
+ "--slotted-line-height-sm",
472
+ "--slotted-media-viewer-control-radius",
473
+ "--slotted-media-viewer-ground",
474
+ "--slotted-media-viewer-step-surface",
475
+ "--slotted-media-viewer-text-measure",
476
+ "--slotted-media-viewer-text-surface",
477
+ "--slotted-media-viewer-thumbnail-size",
478
+ "--slotted-media-viewer-tile-glyph-size",
479
+ "--slotted-media-viewer-tile-size",
480
+ "--slotted-media-viewer-zoom-surface",
481
+ "--slotted-radius-full",
482
+ "--slotted-radius-lg",
483
+ "--slotted-radius-md",
484
+ "--slotted-radius-sm",
485
+ "--slotted-shadow-lg",
486
+ "--slotted-shadow-md",
487
+ "--slotted-space-1",
488
+ "--slotted-space-2",
489
+ "--slotted-space-3",
490
+ "--slotted-space-4",
491
+ "--slotted-space-5",
492
+ "--slotted-space-6",
493
+ "--slotted-space-7",
494
+ "--slotted-surface",
495
+ "--slotted-surface-raised",
496
+ "--slotted-text",
497
+ "--slotted-text-muted",
498
+ "--slotted-tone-secondary-subtle-active",
499
+ "--slotted-tone-secondary-subtle-hover"
500
+ ],
501
+ "examples": [
502
+ {
503
+ "id": "images",
504
+ "title": "The photographs of a claim",
505
+ "note": "Open any photograph: it stands whole on the dark ground, never larger than its own pixels. Previous and next walk the set; the bar says which of how many.",
506
+ "language": "tsx",
507
+ "source": "<>\n <AttachmentTrigger\n onClick={() => {\n setValue(file.id);\n setOpen(true);\n }}\n />\n <MediaViewer\n items={files}\n open={open}\n onOpenChange={setOpen}\n value={value}\n onValueChange={setValue}\n />\n</>;\n",
508
+ "verdict": "excerpt"
509
+ },
510
+ {
511
+ "id": "zoom",
512
+ "title": "Zoom around a point",
513
+ "note": "The wheel zooms around the point under the pointer by distance, so a trackpad’s many small events do not jump to the maximum. Drag to pan; double-click returns to the fit.",
514
+ "language": "tsx",
515
+ "source": "<MediaViewer items={files} defaultOpen minZoom={1} maxZoom={8} zoomStep={0.5} />;\n",
516
+ "verdict": "excerpt"
517
+ },
518
+ {
519
+ "id": "kinds",
520
+ "title": "A photograph, a PDF, a JSON export and a spreadsheet",
521
+ "note": "The PDF opens in the browser’s own reader; the JSON export is read as text, indented and never executed, as a log, a CSV or source would be. A spreadsheet the browser cannot draw gets its tile, a sentence and the download.",
522
+ "language": "tsx",
523
+ "source": "const files = [\n { id: 'front', name: 'front.jpg', type: 'image/jpeg', src: frontUrl },\n { id: 'report', name: 'police-report.pdf', type: 'application/pdf', src: reportUrl },\n { id: 'export', name: 'claim-0914.json', type: 'application/json', src: exportUrl },\n { id: 'estimate', name: 'estimate.xlsx', type: '', src: estimateUrl, downloadHref: estimateUrl },\n];\n",
524
+ "verdict": "excerpt"
525
+ },
526
+ {
527
+ "id": "states",
528
+ "title": "A picture that fails to load",
529
+ "note": "The photograph’s address no longer answers: the stage says what happened and offers to try again or to download, and the zoom pill leaves because there is nothing to zoom.",
530
+ "language": "tsx",
531
+ "source": "const scan = { id: 'scan', name: 'scan.png', type: 'image/png', src, width: 2480, height: 3508 };\n",
532
+ "verdict": "excerpt"
533
+ },
534
+ {
535
+ "id": "content",
536
+ "title": "A long name and a set of one",
537
+ "note": "A scanner’s name is cut in the middle so the extension stays; the whole name is in the tooltip and the accessible name. A single file draws no steps and no position.",
538
+ "language": "tsx",
539
+ "source": "<MediaViewer items={[scan]} defaultOpen />;\n",
540
+ "verdict": "excerpt"
541
+ },
542
+ {
543
+ "id": "thumbnails",
544
+ "title": "A strip of the set",
545
+ "note": "Composed under the stage: the current photograph is framed and the others dimmed until the pointer reaches them. A press steps straight to that file.",
546
+ "language": "tsx",
547
+ "source": "<MediaViewer items={files} defaultOpen>\n <MediaViewerBar />\n <MediaViewerStage />\n <MediaViewerPrevious />\n <MediaViewerNext />\n <MediaViewerZoom />\n <MediaViewerCaption />\n <MediaViewerThumbnails aria-label=\"Claim photographs\" />\n</MediaViewer>;\n",
548
+ "verdict": "excerpt"
549
+ },
550
+ {
551
+ "id": "composition",
552
+ "title": "Actions of the product, defaults of the application",
553
+ "note": "The bar takes the product’s own controls beside the download. A provider sets the limits, the loop and the words once for every viewer under it.",
554
+ "language": "tsx",
555
+ "source": "<MediaViewerDefaultsProvider maxZoom={6} loop>\n <MediaViewer items={files} defaultOpen>\n <MediaViewerBar>\n <MediaViewerClose />\n <MediaViewerTitle />\n <MediaViewerActions>\n <Button onClick={share}>Share</Button>\n <MediaViewerDownload />\n </MediaViewerActions>\n </MediaViewerBar>\n <MediaViewerStage />\n </MediaViewer>\n</MediaViewerDefaultsProvider>;\n",
556
+ "verdict": "excerpt"
557
+ },
558
+ {
559
+ "id": "controlled",
560
+ "title": "The application holds the file and the level",
561
+ "note": "Every move is a request with a reason: the step says pointer, keyboard or remove, the level says pointer, keyboard or select. The log below the openers shows each one.",
562
+ "language": "tsx",
563
+ "source": "<MediaViewer\n items={files}\n open={open}\n onOpenChange={setOpen}\n value={value}\n onValueChange={(next, { reason }) => {\n setValue(next);\n log(`step by ${reason}`);\n }}\n zoom={zoom}\n onZoomChange={(next) => setZoom(next)}\n/>;\n",
564
+ "verdict": "excerpt"
565
+ },
566
+ {
567
+ "id": "keyboard",
568
+ "title": "Every key of the viewer",
569
+ "note": "Arrows step while the picture fits and pan once it is zoomed; plus, minus and zero zoom; R turns; Home and End reach the ends; Escape closes and focus returns to the opener.",
570
+ "language": "tsx",
571
+ "source": "<MediaViewer items={files} defaultOpen />;\n",
572
+ "verdict": "excerpt"
573
+ }
574
+ ]
575
+ }