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

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 (286) hide show
  1. package/dist/{accordion-n5D6mcmS.js → accordion-xW-aFeGb.js} +1 -1
  2. package/dist/accordion.js +1 -1
  3. package/dist/{action-bar-Cq4dt4hP.js → action-bar-BSUuY6pJ.js} +1 -1
  4. package/dist/action-bar.js +1 -1
  5. package/dist/{action-sheet-dNnB26br.js → action-sheet-BouG2qh_.js} +1 -1
  6. package/dist/action-sheet.js +1 -1
  7. package/dist/{app-shell-DyPHYe4K.js → app-shell-D54YkU7E.js} +126 -110
  8. package/dist/app-shell.js +2 -2
  9. package/dist/{calendar-DRuJ7z0H.js → calendar-YQ784o4d.js} +139 -123
  10. package/dist/calendar.js +1 -1
  11. package/dist/{cascader-CivJ76VR.js → cascader-fq8fNWSr.js} +1 -1
  12. package/dist/cascader.js +1 -1
  13. package/dist/{chart-CgXbG6gZ.js → chart-vedR0BDN.js} +1 -1
  14. package/dist/chart.js +1 -1
  15. package/dist/{checkbox-D3E4gzMe.js → checkbox-DsJhlB5c.js} +3 -3
  16. package/dist/{checkbox-group-Dg5YN3fx.js → checkbox-group-pvX9R_yS.js} +2 -2
  17. package/dist/checkbox-group.js +1 -1
  18. package/dist/checkbox.js +1 -1
  19. package/dist/{collapsible-CT4_3aXm.js → collapsible-KzBs5HvA.js} +2 -2
  20. package/dist/collapsible.js +1 -1
  21. package/dist/{color-picker-CeOl4ikV.js → color-picker-i-MJ5VVs.js} +4 -4
  22. package/dist/color-picker.js +1 -1
  23. package/dist/{column-manager-CnOhzVGP.js → column-manager-D028QbfO.js} +5 -5
  24. package/dist/column-manager.js +1 -1
  25. package/dist/{combobox-C2qlkTw6.js → combobox-599heRN_.js} +1 -1
  26. package/dist/combobox.js +1 -1
  27. package/dist/{context-menu-WiKS4Zwv.js → context-menu-WM_tT9hz.js} +1 -1
  28. package/dist/context-menu.js +1 -1
  29. package/dist/{currency-field-LAawS9qo.js → currency-field-rS36pjCO.js} +1 -1
  30. package/dist/currency-field.js +1 -1
  31. package/dist/{dashboard-grid-Zzqmbzqq.js → dashboard-grid-Dh2Q3IQv.js} +2 -2
  32. package/dist/dashboard-grid.js +1 -1
  33. package/dist/{data-grid-Y5aX9njc.js → data-grid-D106baPp.js} +17 -17
  34. package/dist/data-grid.js +1 -1
  35. package/dist/{data-list-CyEq7M2D.js → data-list-BA0xrySM.js} +2 -2
  36. package/dist/data-list.js +1 -1
  37. package/dist/{date-field-CxubN_3u.js → date-field-BZ5JcvXJ.js} +1 -1
  38. package/dist/date-field.js +1 -1
  39. package/dist/{date-picker-6hj83x5D.js → date-picker-BvEbsbJC.js} +4 -4
  40. package/dist/date-picker.js +2 -2
  41. package/dist/{date-range-picker-CBWnFTgL.js → date-range-picker-uIr-yReE.js} +5 -5
  42. package/dist/date-range-picker.js +1 -1
  43. package/dist/{datetime-field-GMIqBuTa.js → datetime-field-DDs3mV9Z.js} +1 -1
  44. package/dist/datetime-field.js +1 -1
  45. package/dist/{datetime-picker-DwUYd3zF.js → datetime-picker-DDYXqrjm.js} +6 -6
  46. package/dist/datetime-picker.js +1 -1
  47. package/dist/{datetime-range-picker-CX_tBt6b.js → datetime-range-picker-CFTHW771.js} +6 -6
  48. package/dist/datetime-range-picker.js +1 -1
  49. package/dist/docs/accordion.examples.md +743 -0
  50. package/dist/docs/accordion.json +84 -28
  51. package/dist/docs/accordion.md +56 -152
  52. package/dist/docs/action-sheet.examples.md +771 -0
  53. package/dist/docs/action-sheet.json +91 -51
  54. package/dist/docs/action-sheet.md +72 -233
  55. package/dist/docs/app-shell.json +7 -0
  56. package/dist/docs/app-shell.md +1 -0
  57. package/dist/docs/breadcrumb.json +64 -16
  58. package/dist/docs/breadcrumb.md +489 -56
  59. package/dist/docs/collapsible.examples.md +575 -0
  60. package/dist/docs/collapsible.json +89 -49
  61. package/dist/docs/collapsible.md +47 -197
  62. package/dist/docs/context-menu.json +58 -18
  63. package/dist/docs/context-menu.md +442 -77
  64. package/dist/docs/field.json +15 -1
  65. package/dist/docs/field.md +3 -1
  66. package/dist/docs/floating-panel.json +56 -0
  67. package/dist/docs/floating-panel.md +329 -8
  68. package/dist/docs/hover-card.json +65 -17
  69. package/dist/docs/hover-card.md +422 -64
  70. package/dist/docs/loading-overlay.examples.md +577 -0
  71. package/dist/docs/loading-overlay.json +55 -23
  72. package/dist/docs/loading-overlay.md +49 -168
  73. package/dist/docs/menu.json +67 -0
  74. package/dist/docs/menu.md +8 -1
  75. package/dist/docs/menubar.json +55 -15
  76. package/dist/docs/menubar.md +488 -42
  77. package/dist/docs/pagination.json +89 -33
  78. package/dist/docs/pagination.md +462 -55
  79. package/dist/docs/popover.json +1 -1
  80. package/dist/docs/popover.md +1 -1
  81. package/dist/docs/select.json +55 -1
  82. package/dist/docs/select.md +7 -2
  83. package/dist/docs/toggle-group.examples.md +584 -0
  84. package/dist/docs/toggle-group.json +84 -20
  85. package/dist/docs/toggle-group.md +17 -182
  86. package/dist/docs/toggle.json +93 -37
  87. package/dist/docs/toggle.md +304 -51
  88. package/dist/{drawer-Du1aC1px.js → drawer-CQagePr_.js} +256 -256
  89. package/dist/drawer.js +1 -1
  90. package/dist/{entity-picker-BwJX0gNJ.js → entity-picker-CC4VoC3p.js} +2 -2
  91. package/dist/entity-picker.js +1 -1
  92. package/dist/{event-calendar-DzlL95E4.js → event-calendar-CjmF_e0H.js} +5 -5
  93. package/dist/event-calendar.js +1 -1
  94. package/dist/field-C-HRhke0.js +421 -0
  95. package/dist/{field-group-7zV68b3d.js → field-group-CU0PasvW.js} +1 -1
  96. package/dist/field-group.js +1 -1
  97. package/dist/field.js +1 -1
  98. package/dist/{filter-bar-DMuP5P6e.js → filter-bar-B3QJD7SZ.js} +11 -11
  99. package/dist/filter-bar.js +1 -1
  100. package/dist/{hover-card-CWCSZ5_p.js → hover-card-CTItbEfH.js} +2 -2
  101. package/dist/hover-card.js +1 -1
  102. package/dist/{import-export-center-DzAUMTq5.js → import-export-center-CW8YVZev.js} +1 -1
  103. package/dist/import-export-center.js +1 -1
  104. package/dist/index.js +132 -132
  105. package/dist/{listbox-CWU3DiEt.js → listbox-ZqiJ2yer.js} +1 -1
  106. package/dist/listbox.js +1 -1
  107. package/dist/{markdown-7wOBMXTl.js → markdown-BdskE4-L.js} +1 -1
  108. package/dist/markdown.js +1 -1
  109. package/dist/menu-parts-DXs5YuUA.js +932 -0
  110. package/dist/menu.js +1 -1
  111. package/dist/{menubar-k8Q4_p9l.js → menubar-CVoAFc6r.js} +2 -2
  112. package/dist/menubar.js +1 -1
  113. package/dist/{multi-select-DEd_92BC.js → multi-select-Dc2d6dDB.js} +1 -1
  114. package/dist/multi-select.js +1 -1
  115. package/dist/{number-field-BJKoidAE.js → number-field-BQ54hXmk.js} +1 -1
  116. package/dist/number-field.js +1 -1
  117. package/dist/{otp-input-Czz9Z6dQ.js → otp-input-DRooqa3f.js} +1 -1
  118. package/dist/otp-input.js +1 -1
  119. package/dist/{pagination-D0PUAFYm.js → pagination-BRXuyPzo.js} +1 -1
  120. package/dist/pagination.js +1 -1
  121. package/dist/{picker-frame-CT5WNEnw.js → picker-frame-B6sPCP5Y.js} +1 -1
  122. package/dist/{popover-B2t__iNO.js → popover-1DlOu95x.js} +198 -197
  123. package/dist/popover.js +1 -1
  124. package/dist/{prompt-composer-Lsfcz_i9.js → prompt-composer-tYIs39rn.js} +1 -1
  125. package/dist/prompt-composer.js +1 -1
  126. package/dist/{radio-group-_ZRUgcI5.js → radio-group-AW3xcYYh.js} +2 -2
  127. package/dist/radio-group.js +1 -1
  128. package/dist/{rating-C6AkIIUi.js → rating-h3qdHLNi.js} +1 -1
  129. package/dist/rating.js +1 -1
  130. package/dist/{saved-views-zM-DxT1F.js → saved-views-nqn0SDXn.js} +4 -4
  131. package/dist/saved-views.js +1 -1
  132. package/dist/{segmented-control-D52GeOlS.js → segmented-control-CbK7SurB.js} +2 -2
  133. package/dist/segmented-control.js +1 -1
  134. package/dist/select-d448Wkzb.js +1124 -0
  135. package/dist/select.js +1 -1
  136. package/dist/{side-navigation-CtZuP87S.js → side-navigation-CKRETc8E.js} +99 -99
  137. package/dist/side-navigation.js +1 -1
  138. package/dist/{slider-DQqQ0skr.js → slider-DQ2CnxTO.js} +1 -1
  139. package/dist/slider.js +1 -1
  140. package/dist/{split-button-BYowsA6Q.js → split-button-D4MPKSB2.js} +1 -1
  141. package/dist/split-button.js +1 -1
  142. package/dist/styles/action-bar.css +1 -1
  143. package/dist/styles/app-shell.css +1 -1
  144. package/dist/styles/cascader.css +2 -0
  145. package/dist/styles/chart.css +1 -1
  146. package/dist/styles/checkbox-group.css +2 -0
  147. package/dist/styles/checkbox.css +2 -0
  148. package/dist/styles/color-picker.css +3 -3
  149. package/dist/styles/column-manager.css +2 -2
  150. package/dist/styles/combobox.css +2 -0
  151. package/dist/styles/context-menu.css +1 -1
  152. package/dist/styles/currency-field.css +2 -0
  153. package/dist/styles/dashboard-grid.css +2 -2
  154. package/dist/styles/data-grid.css +4 -4
  155. package/dist/styles/data-list.css +3 -1
  156. package/dist/styles/date-field.css +2 -0
  157. package/dist/styles/date-picker.css +3 -1
  158. package/dist/styles/date-range-picker.css +3 -1
  159. package/dist/styles/datetime-field.css +2 -0
  160. package/dist/styles/datetime-picker.css +3 -1
  161. package/dist/styles/datetime-range-picker.css +3 -1
  162. package/dist/styles/entity-picker.css +3 -1
  163. package/dist/styles/event-calendar.css +2 -2
  164. package/dist/styles/field-group.css +2 -0
  165. package/dist/styles/field.css +2 -0
  166. package/dist/styles/filter-bar.css +4 -4
  167. package/dist/styles/floating-panel.css +1 -1
  168. package/dist/styles/hover-card.css +1 -1
  169. package/dist/styles/import-export-center.css +3 -3
  170. package/dist/styles/index.css +9 -9
  171. package/dist/styles/listbox.css +2 -0
  172. package/dist/styles/markdown.css +2 -0
  173. package/dist/styles/menu.css +1 -1
  174. package/dist/styles/menubar.css +1 -1
  175. package/dist/styles/multi-select.css +2 -0
  176. package/dist/styles/number-field.css +2 -0
  177. package/dist/styles/otp-input.css +2 -0
  178. package/dist/styles/pagination.css +1 -1
  179. package/dist/styles/popover.css +1 -1
  180. package/dist/styles/prompt-composer.css +2 -0
  181. package/dist/styles/radio-group.css +2 -0
  182. package/dist/styles/rating.css +2 -0
  183. package/dist/styles/saved-views.css +3 -3
  184. package/dist/styles/segmented-control.css +2 -0
  185. package/dist/styles/select.css +3 -1
  186. package/dist/styles/side-navigation.css +1 -1
  187. package/dist/styles/slider.css +2 -0
  188. package/dist/styles/split-button.css +1 -1
  189. package/dist/styles/switch.css +2 -0
  190. package/dist/styles/table.css +3 -3
  191. package/dist/styles/tags-input.css +2 -0
  192. package/dist/styles/text-field.css +2 -0
  193. package/dist/styles/textarea.css +2 -0
  194. package/dist/styles/time-field.css +2 -0
  195. package/dist/styles/time-picker.css +3 -1
  196. package/dist/styles/time-range-picker.css +3 -1
  197. package/dist/styles/toggle-group.css +3 -1
  198. package/dist/styles/toolbar.css +1 -1
  199. package/dist/styles/top-navigation.css +1 -1
  200. package/dist/styles/transfer.css +2 -0
  201. package/dist/styles/upload.css +2 -0
  202. package/dist/styles.css +1 -1
  203. package/dist/{switch-CcZAVLiW.js → switch-DxMukg7F.js} +1 -1
  204. package/dist/switch.js +1 -1
  205. package/dist/{table-D4oX9Gvn.js → table-BecApjeD.js} +13 -13
  206. package/dist/table.js +1 -1
  207. package/dist/{tags-input-O87zTh7h.js → tags-input-CqCeLtk-.js} +1 -1
  208. package/dist/tags-input.js +1 -1
  209. package/dist/{text-field-Cnjc7LB5.js → text-field-CMOkJ9Z6.js} +1 -1
  210. package/dist/text-field.js +1 -1
  211. package/dist/{textarea-DcA7jwOM.js → textarea-DfqPfXTr.js} +1 -1
  212. package/dist/textarea.js +1 -1
  213. package/dist/{time-field-BanhrUvf.js → time-field-GyLQsxcc.js} +1 -1
  214. package/dist/time-field.js +1 -1
  215. package/dist/{time-picker-Cu1iV039.js → time-picker-CGHPnust.js} +3 -3
  216. package/dist/time-picker.js +1 -1
  217. package/dist/{time-range-picker-sdbaFJFN.js → time-range-picker-BMRtAqPy.js} +4 -4
  218. package/dist/time-range-picker.js +1 -1
  219. package/dist/{toggle-zDTD5G3H.js → toggle-DSEEtL3Y.js} +7 -2
  220. package/dist/{toggle-group-D7GQyNQP.js → toggle-group-DZEWkVRo.js} +8 -3
  221. package/dist/toggle-group.js +1 -1
  222. package/dist/toggle.js +1 -1
  223. package/dist/{toolbar-DOV4BKY8.js → toolbar-BP7ka6lN.js} +1 -1
  224. package/dist/toolbar.js +1 -1
  225. package/dist/{top-navigation-D3rpgBV2.js → top-navigation-D8IHPOmm.js} +1 -1
  226. package/dist/top-navigation.js +1 -1
  227. package/dist/{transfer-CuLlF_nY.js → transfer-sKUvmEKe.js} +5 -5
  228. package/dist/transfer.js +1 -1
  229. package/dist/types/app-shell/app-shell-parts.d.ts +7 -0
  230. package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
  231. package/dist/types/app-shell/index.d.ts +1 -1
  232. package/dist/types/app-shell/index.d.ts.map +1 -1
  233. package/dist/types/calendar/calendar.d.ts.map +1 -1
  234. package/dist/types/calendar/use-clock-today.d.ts +10 -0
  235. package/dist/types/calendar/use-clock-today.d.ts.map +1 -0
  236. package/dist/types/field/field-defaults.d.ts +1 -1
  237. package/dist/types/field/field-defaults.d.ts.map +1 -1
  238. package/dist/types/field/field-help-sheet.d.ts +15 -0
  239. package/dist/types/field/field-help-sheet.d.ts.map +1 -0
  240. package/dist/types/field/field-parts.d.ts +1 -1
  241. package/dist/types/field/field-parts.d.ts.map +1 -1
  242. package/dist/types/field/field.types.d.ts +11 -0
  243. package/dist/types/field/field.types.d.ts.map +1 -1
  244. package/dist/types/field/index.d.ts +1 -1
  245. package/dist/types/field/index.d.ts.map +1 -1
  246. package/dist/types/menu/index.d.ts +1 -1
  247. package/dist/types/menu/index.d.ts.map +1 -1
  248. package/dist/types/menu/menu-defaults.d.ts.map +1 -1
  249. package/dist/types/menu/menu-parts.d.ts.map +1 -1
  250. package/dist/types/menu/menu-sheet-step.d.ts +6 -0
  251. package/dist/types/menu/menu-sheet-step.d.ts.map +1 -0
  252. package/dist/types/menu/menu.d.ts +1 -1
  253. package/dist/types/menu/menu.d.ts.map +1 -1
  254. package/dist/types/menu/menu.types.d.ts +15 -0
  255. package/dist/types/menu/menu.types.d.ts.map +1 -1
  256. package/dist/types/menu/use-menu-sheet.d.ts +9 -0
  257. package/dist/types/menu/use-menu-sheet.d.ts.map +1 -0
  258. package/dist/types/pagination/pagination-parts.d.ts.map +1 -1
  259. package/dist/types/picker-panel/picker-layer.d.ts +4 -1
  260. package/dist/types/picker-panel/picker-layer.d.ts.map +1 -1
  261. package/dist/types/picker-panel/use-picker-layer.d.ts.map +1 -1
  262. package/dist/types/popover/popover-parts.d.ts.map +1 -1
  263. package/dist/types/select/index.d.ts +1 -1
  264. package/dist/types/select/index.d.ts.map +1 -1
  265. package/dist/types/select/select-defaults.d.ts.map +1 -1
  266. package/dist/types/select/select-parts.d.ts.map +1 -1
  267. package/dist/types/select/select.d.ts +6 -2
  268. package/dist/types/select/select.d.ts.map +1 -1
  269. package/dist/types/select/select.types.d.ts +9 -0
  270. package/dist/types/select/select.types.d.ts.map +1 -1
  271. package/dist/types/select/use-select-sheet.d.ts +9 -0
  272. package/dist/types/select/use-select-sheet.d.ts.map +1 -0
  273. package/dist/types/toggle/toggle.d.ts.map +1 -1
  274. package/dist/types/toggle/toggle.types.d.ts +4 -1
  275. package/dist/types/toggle/toggle.types.d.ts.map +1 -1
  276. package/dist/types/toggle-group/toggle-group-parts.d.ts.map +1 -1
  277. package/dist/types/toggle-group/toggle-group.types.d.ts +4 -1
  278. package/dist/types/toggle-group/toggle-group.types.d.ts.map +1 -1
  279. package/dist/{upload-CPl38p-S.js → upload-CuMOaPK3.js} +1 -1
  280. package/dist/upload.js +1 -1
  281. package/dist/{use-date-picker-DWV7KWS7.js → use-date-picker-DdSX3RE4.js} +2 -2
  282. package/dist/{use-picker-draft-BJlHcb6J.js → use-picker-draft-I_pxqYsc.js} +48 -35
  283. package/package.json +6 -6
  284. package/dist/field-vOVzvq5t.js +0 -368
  285. package/dist/menu-parts-DgL617_H.js +0 -814
  286. package/dist/select-BkUuIVBK.js +0 -1017
@@ -96,7 +96,7 @@
96
96
  "part": "scrim",
97
97
  "element": "div",
98
98
  "required": true,
99
- "purpose": "The wash, the one-cell grid that centers the panel, and the query container. In the document for the life of the family, so both directions of the fade are transitions."
99
+ "purpose": "The wash, the one-cell grid that centers the panel, and the query container. In the document for the life of the overlay, so both directions of the fade are transitions."
100
100
  },
101
101
  {
102
102
  "part": "panel",
@@ -135,7 +135,7 @@
135
135
  "type": "boolean",
136
136
  "defaultValue": "true",
137
137
  "appliesTo": "LoadingOverlay",
138
- "description": "Whether the data is still on its way. The consumer’s own fact: the family never moves it, so there is no controlled and uncontrolled pair"
138
+ "description": "Whether the data is still on its way. The consumer’s own fact: the overlay never moves it, so there is no controlled and uncontrolled pair"
139
139
  },
140
140
  {
141
141
  "name": "scope",
@@ -249,7 +249,7 @@
249
249
  "type": "(props) => ReactNode",
250
250
  "defaultValue": "—",
251
251
  "appliesTo": "LoadingOverlay",
252
- "description": "Substitutes the control. The family’s own control paint is written :not([data-ui]), so a Button here keeps its own"
252
+ "description": "Substitutes the control. The overlay’s own control paint is written :not([data-ui]), so a Button here keeps its own"
253
253
  },
254
254
  {
255
255
  "name": "ref",
@@ -270,7 +270,7 @@
270
270
  {
271
271
  "name": "onCancel",
272
272
  "payload": "{ reason: \"dismiss\" | \"escape\"; source: Event }",
273
- "when": "The reader presses the control or the Escape key. The family commits nothing — it does not lower loading and does not hide itself — because the operation has not stopped until the application has stopped it."
273
+ "when": "The reader presses the control or the Escape key. The overlay commits nothing — it does not lower loading and does not hide itself — because the operation has not stopped until the application has stopped it."
274
274
  },
275
275
  {
276
276
  "name": "onReveal",
@@ -279,8 +279,8 @@
279
279
  }
280
280
  ],
281
281
  "accessibility": [
282
- "The covered content carries inert while the layer blocks, which takes it out of the tab order and out of the accessibility tree. It is the capability the two surveyed implementations that document accessibility both decline: Quasar states that the content it covers stays focusable and asks the developer to solve it, and Mantine says the same in its usage section.",
283
- "The region carries aria-busy=\"true\" while it waits, which is the platform’s own answer: ARIA 1.2 asks an author to set it on the region until it is finished loading. Page scope writes it nowhere, because the busy region would be the document root and this family owns no part of it.",
282
+ "The covered content carries inert while the layer blocks, which takes it out of the tab order and out of the accessibility tree. A covered control is neither focusable nor announced, so the reader does not reach a field the wait has made unsafe to edit.",
283
+ "The region carries aria-busy=\"true\" while it waits, which is the platform’s own answer: ARIA 1.2 asks an author to set it on the region until it is finished loading. Page scope writes it nowhere, because the busy region would be the document root and LoadingOverlay owns no part of it.",
284
284
  "One overlay is one announcement. A visually-hidden role=\"status\" holds the label while waiting and is emptied afterwards, and emptying a live region announces nothing, so a wait says one thing. The two painted lines carry aria-hidden, so the same sentence is not heard twice.",
285
285
  "Focus is read before the content goes inert. If it was inside, it moves to the control or to the panel itself — the container destination the APG advises for content that must be read before it is operated — and returns to where it came from when the wait ends. Focus that was elsewhere is never moved: a background save does not take the caret out of another form.",
286
286
  "There is no APG pattern for a loading overlay: the pattern index holds none for a busy region or a blocking layer, and claiming the Dialog pattern would import aria-modal and a close affordance into something that is neither. Page scope makes the rest of the document inert instead, which is what ARIA 1.2 asks of a modal element, and writes no aria-modal because that property inherits only into dialog and alertdialog.",
@@ -358,24 +358,24 @@
358
358
  "title": "When the whole application waits",
359
359
  "note": "scope=\"page\" portals the layer, makes every sibling of the portal root inert and locks the document scroll. Reach for it only when partial interaction would be unsafe — a month-end close, not a row that is saving.",
360
360
  "language": "tsx",
361
- "source": "<LoadingOverlay\n scope=\"page\"\n loading={closing}\n messages={{ label: 'Closing the accounting period' }}\n description=\"Do not close this tab.\"\n/>;\n",
362
- "verdict": "excerpt"
361
+ "source": "import { useRef, useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\n\nexport default function LoadingOverlayPage() {\n const [closing, setClosing] = useState(false);\n const timer = useRef<number | undefined>(undefined);\n\n const close = () => {\n setClosing(true);\n timer.current = window.setTimeout(() => setClosing(false), 4000);\n };\n const stop = () => {\n window.clearTimeout(timer.current);\n setClosing(false);\n };\n\n return (\n <>\n <Inline>\n <Button onClick={close}>Close March period</Button>\n </Inline>\n <LoadingOverlay\n cancellable\n description=\"Keep this tab open.\"\n loading={closing}\n messages={{ label: 'Closing the accounting period' }}\n onCancel={stop}\n scope=\"page\"\n />\n </>\n );\n}\n",
362
+ "verdict": "example"
363
363
  },
364
364
  {
365
365
  "id": "veil",
366
366
  "title": "Three ways to say out of reach",
367
367
  "note": "wash is the theme’s own scrim; blur adds a backdrop filter, so text stops being legible before it stops being visible; none blocks exactly as much and dims nothing, for a wait short enough that a wash would read as a flash.",
368
368
  "language": "tsx",
369
- "source": "<LoadingOverlay veil=\"wash\">{rows}</LoadingOverlay>;\n<LoadingOverlay veil=\"blur\">{rows}</LoadingOverlay>;\n<LoadingOverlay veil=\"none\">{rows}</LoadingOverlay>;\n",
370
- "verdict": "excerpt"
369
+ "source": "import { Card, CardBody } from '@slotted/react/card';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst VEILS = [\n { veil: 'wash', title: 'Open invoices', value: '14 invoices, $48,210.00' },\n { veil: 'blur', title: 'Overdue balance', value: '3 customers, $6,940.50' },\n { veil: 'none', title: 'Pending refunds', value: '2 orders, $318.00' },\n] as const;\n\nexport default function LoadingOverlayVeil() {\n return (\n <Stack gap={4}>\n {VEILS.map(({ veil, title, value }) => (\n <LoadingOverlay\n description={veil}\n key={veil}\n messages={{ label: 'Refreshing balances' }}\n veil={veil}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n {title}\n </Heading>\n <Text>{value}</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n ))}\n </Stack>\n );\n}\n",
370
+ "verdict": "example"
371
371
  },
372
372
  {
373
373
  "id": "sizes",
374
374
  "title": "Three steps, and each moves three things",
375
375
  "note": "The mark grows on the control-height scale, the two lines on the control type scale, and the panel on the space scale. Switch the toolbar to dense: the type and the mark shrink together and the meaning does not change.",
376
376
  "language": "tsx",
377
- "source": "<LoadingOverlay size=\"sm\" messages={{ label: 'Reconciling' }} />;\n<LoadingOverlay size=\"md\" messages={{ label: 'Reconciling' }} />;\n<LoadingOverlay size=\"lg\" messages={{ label: 'Reconciling' }} />;\n",
378
- "verdict": "excerpt"
377
+ "source": "import { Card, CardBody } from '@slotted/react/card';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst SIZES = [\n { size: 'sm', title: 'Bank statement', value: '312 lines, 18 unmatched' },\n { size: 'md', title: 'Card payouts', value: '41 payouts, 2 on hold' },\n { size: 'lg', title: 'Supplier invoices', value: '27 invoices, 5 due this week' },\n] as const;\n\nexport default function LoadingOverlaySizes() {\n return (\n <Stack gap={4}>\n {SIZES.map(({ size, title, value }) => (\n <LoadingOverlay\n description={size}\n key={size}\n messages={{ label: 'Reconciling' }}\n size={size}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n {title}\n </Heading>\n <Text>{value}</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n ))}\n </Stack>\n );\n}\n",
378
+ "verdict": "example"
379
379
  },
380
380
  {
381
381
  "id": "shapes",
@@ -390,16 +390,16 @@
390
390
  "title": "Two flashes, and the two durations that prevent them",
391
391
  "note": "delay is the wait before anything is painted, so data that arrives in eighty milliseconds draws nothing. minDuration holds a layer that did appear, so it is not taken away thirty milliseconds later. Both default to zero and cost no timer.",
392
392
  "language": "tsx",
393
- "source": "<LoadingOverlayDefaultsProvider delay={200} minDuration={400}>\n <App />\n</LoadingOverlayDefaultsProvider>;\n",
394
- "verdict": "excerpt"
393
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayTiming() {\n const [loading, setLoading] = useState(false);\n const [shown, setShown] = useState(0);\n\n const look = (ms: number) => {\n setLoading(true);\n setTimeout(() => setLoading(false), ms);\n };\n\n return (\n <Stack gap={4}>\n <Inline gap={2}>\n <Button onClick={() => look(100)} variant=\"outline\">\n Fast lookup (100 ms)\n </Button>\n <Button onClick={() => look(500)}>Slower lookup (500 ms)</Button>\n </Inline>\n <LoadingOverlay\n delay={300}\n loading={loading}\n messages={{ label: 'Looking up rates' }}\n minDuration={600}\n onReveal={() => setShown((count) => count + 1)}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Exchange rates\n </Heading>\n <Text>1 EUR = 1.08 USD, 1 GBP = 1.27 USD.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n <Text size=\"sm\" tone=\"muted\">\n Layers drawn: {shown}\n </Text>\n </Stack>\n );\n}\n",
394
+ "verdict": "example"
395
395
  },
396
396
  {
397
397
  "id": "cancel",
398
398
  "title": "A wait that has gone wrong",
399
399
  "note": "cancellable renders the control and binds Escape to it. The request carries the reason and commits nothing: abort the work and lower loading when it has actually stopped, which is what the second card is showing.",
400
400
  "language": "tsx",
401
- "source": "<LoadingOverlay\n loading={importing}\n cancellable\n messages={{ label: 'Importing 4 812 rows' }}\n onCancel={(request) => abort(request.reason)}\n>\n {rows}\n</LoadingOverlay>;\n",
402
- "verdict": "excerpt"
401
+ "source": "import { useRef, useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayCancel() {\n const [importing, setImporting] = useState(false);\n const [outcome, setOutcome] = useState('No import has run yet.');\n const timer = useRef<number | undefined>(undefined);\n\n const start = () => {\n setImporting(true);\n setOutcome('Importing.');\n timer.current = window.setTimeout(() => {\n setImporting(false);\n setOutcome('Imported 4 812 rows.');\n }, 6000);\n };\n const stop = (reason: string) => {\n window.clearTimeout(timer.current);\n setImporting(false);\n setOutcome(`Import stopped (reason: ${reason}).`);\n };\n\n return (\n <Stack gap={4}>\n <Inline>\n <Button onClick={start}>Import price list</Button>\n </Inline>\n <LoadingOverlay\n cancellable\n loading={importing}\n messages={{ label: 'Importing 4 812 rows' }}\n onCancel={(request) => stop(request.reason)}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Price list\n </Heading>\n <Text>4 812 rows, last updated 12 Nov.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n <Text size=\"sm\" tone=\"muted\">\n {outcome}\n </Text>\n </Stack>\n );\n}\n",
402
+ "verdict": "example"
403
403
  },
404
404
  {
405
405
  "id": "focus",
@@ -412,23 +412,23 @@
412
412
  {
413
413
  "id": "indicator",
414
414
  "title": "A wait with a number on it",
415
- "note": "The mark is a slot. The default is the contained loader; a determinate import passes a ProgressBar with its own value, and the family that owns a measured quantity draws it.",
415
+ "note": "The mark is a slot. The default is the contained loader; a determinate import passes a ProgressBar with its own value, and progress-indicator owns the measured quantity and draws it.",
416
416
  "language": "tsx",
417
- "source": "<LoadingOverlay\n messages={{ label: 'Uploading contrato.pdf' }}\n indicator={<ProgressBar value={62} label=\"Uploaded\" hideLabel />}\n/>;\n",
418
- "verdict": "excerpt"
417
+ "source": "import { useRef, useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { ProgressBar } from '@slotted/react/progress-indicator';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayIndicator() {\n const [progress, setProgress] = useState<number | null>(null);\n const timer = useRef<number | undefined>(undefined);\n\n const upload = () => {\n setProgress(0);\n timer.current = window.setInterval(() => {\n setProgress((value) => {\n const next = (value ?? 0) + 10;\n if (next < 100) return next;\n window.clearInterval(timer.current);\n return null;\n });\n }, 400);\n };\n\n return (\n <Stack gap={4}>\n <Inline>\n <Button onClick={upload}>Upload manifest</Button>\n </Inline>\n <LoadingOverlay\n indicator={<ProgressBar hideLabel label=\"Uploaded\" value={progress ?? 100} />}\n loading={progress !== null}\n messages={{ label: 'Uploading carrier-manifest.csv' }}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Carrier manifest\n </Heading>\n <Text>Pickup list for 14 Nov, 38 shipments.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n </Stack>\n );\n}\n",
418
+ "verdict": "example"
419
419
  },
420
420
  {
421
421
  "id": "content",
422
- "title": "Words the family did not choose",
422
+ "title": "Words the overlay did not choose",
423
423
  "note": "A translated sentence is longer than the English one that was measured. The panel wraps it, keeps its own measure, and never truncates: the announcement holds the same sentence whole for the reader who would otherwise lose it.",
424
424
  "language": "tsx",
425
- "source": "<LoadingOverlay\n messages={{ label: 'Reconciling the period entries against the bank statement' }}\n description=\"Stopping now would leave half the period reconciled.\"\n/>;\n",
426
- "verdict": "excerpt"
425
+ "source": "import { Card, CardBody } from '@slotted/react/card';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayContent() {\n return (\n <LoadingOverlay\n cancellable\n description=\"Stopping now would leave half the period reconciled.\"\n messages={{\n cancel: 'Stop reconciling',\n label: 'Reconciling the period entries against the bank statement',\n }}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n March close\n </Heading>\n <Text>1 204 entries, 37 without a bank match.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n );\n}\n",
426
+ "verdict": "example"
427
427
  },
428
428
  {
429
429
  "id": "composition",
430
430
  "title": "The parts a consumer owns",
431
- "note": "render puts the region on the element the page already has. renderCancel puts this library’s own Button in the slot, and the family’s control paint steps back for it — the part stays the part, and only the paint is the consumer’s.",
431
+ "note": "render puts the region on the element the page already has. renderCancel puts this library’s own Button in the slot, and the overlay’s control paint steps back for it — the part stays the part, and only the paint is the consumer’s.",
432
432
  "language": "tsx",
433
433
  "source": "<LoadingOverlay\n render={(props) => <section {...props} />}\n renderCancel={(props) => <Button {...props} variant=\"outline\" size=\"sm\" />}\n cancellable\n>\n {rows}\n</LoadingOverlay>;\n",
434
434
  "verdict": "excerpt"
@@ -440,6 +440,38 @@
440
440
  "language": "tsx",
441
441
  "source": "<LoadingOverlay messages={{ label: 'Saving changes' }} loadedLabel=\"Changes saved\">\n {fields}\n</LoadingOverlay>;\n",
442
442
  "verdict": "excerpt"
443
+ },
444
+ {
445
+ "id": "announce",
446
+ "title": "announce.tsx",
447
+ "note": null,
448
+ "language": "tsx",
449
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayAnnounce() {\n const [saving, setSaving] = useState(false);\n const [refreshing, setRefreshing] = useState(false);\n\n const save = () => {\n setSaving(true);\n setTimeout(() => setSaving(false), 2500);\n };\n const refresh = () => {\n setRefreshing(true);\n setTimeout(() => setRefreshing(false), 2500);\n };\n\n return (\n <Stack gap={4}>\n <Inline gap={2}>\n <Button onClick={save}>Save prices</Button>\n <Button onClick={refresh} variant=\"outline\">\n Refresh stock\n </Button>\n </Inline>\n <LoadingOverlay\n loadedLabel=\"Prices saved\"\n loading={saving}\n messages={{ label: 'Saving prices' }}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Price list\n </Heading>\n <Text>Announces the wait and the result.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n <LoadingOverlay live=\"off\" loading={refreshing} messages={{ label: 'Refreshing stock' }}>\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Stock levels\n </Heading>\n <Text>Announces nothing: the page says it elsewhere.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n </Stack>\n );\n}\n",
450
+ "verdict": "example"
451
+ },
452
+ {
453
+ "id": "basic",
454
+ "title": "basic.tsx",
455
+ "note": null,
456
+ "language": "tsx",
457
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport { Field, FieldLabel } from '@slotted/react/field';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { TextField } from '@slotted/react/text-field';\nimport { Heading } from '@slotted/react/typography';\n\nexport default function LoadingOverlayBasic() {\n const [saving, setSaving] = useState(false);\n\n const save = () => {\n setSaving(true);\n setTimeout(() => setSaving(false), 2500);\n };\n\n return (\n <LoadingOverlay loading={saving} messages={{ label: 'Saving the customer' }}>\n <Card>\n <CardHeader>\n <Heading level={3} size=\"md\">\n Customer profile\n </Heading>\n </CardHeader>\n <CardBody>\n <Stack gap={4}>\n <Field>\n <FieldLabel>Company</FieldLabel>\n <TextField defaultValue=\"Northwind Traders\" />\n </Field>\n <Inline>\n <Button onClick={save}>Save customer</Button>\n </Inline>\n </Stack>\n </CardBody>\n </Card>\n </LoadingOverlay>\n );\n}\n",
458
+ "verdict": "example"
459
+ },
460
+ {
461
+ "id": "compose",
462
+ "title": "compose.tsx",
463
+ "note": null,
464
+ "language": "tsx",
465
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Inline } from '@slotted/react/inline';\nimport { LoadingOverlay } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayCompose() {\n const [syncing, setSyncing] = useState(true);\n\n return (\n <Stack gap={4}>\n <Inline>\n <Button onClick={() => setSyncing(true)} variant=\"outline\">\n Sync again\n </Button>\n </Inline>\n <LoadingOverlay\n cancellable\n loading={syncing}\n messages={{ label: 'Syncing the warehouse feed' }}\n onCancel={() => setSyncing(false)}\n render={(props) => <section {...props} />}\n renderCancel={(props) => <Button {...props} size=\"sm\" variant=\"outline\" />}\n >\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Warehouse feed\n </Heading>\n <Text>Lisbon and Rotterdam, 6 docks.</Text>\n <Text>Last sync at 09:40, 212 pallets received.</Text>\n <Text>Next sync at 10:10.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n </Stack>\n );\n}\n",
466
+ "verdict": "example"
467
+ },
468
+ {
469
+ "id": "defaults",
470
+ "title": "defaults.tsx",
471
+ "note": null,
472
+ "language": "tsx",
473
+ "source": "import { Card, CardBody } from '@slotted/react/card';\nimport { LoadingOverlay, LoadingOverlayDefaultsProvider } from '@slotted/react/loading-overlay';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function LoadingOverlayDefaults() {\n return (\n <LoadingOverlayDefaultsProvider delay={200} minDuration={400} size=\"sm\" veil=\"blur\">\n <Stack gap={4}>\n <LoadingOverlay messages={{ label: 'Loading orders' }}>\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Open orders\n </Heading>\n <Text>Takes the blur and the small step from the provider.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n <LoadingOverlay messages={{ label: 'Loading returns' }} veil=\"wash\">\n <Card>\n <CardBody>\n <Heading level={3} size=\"md\">\n Returns\n </Heading>\n <Text>Keeps the small step and sets its own veil.</Text>\n </CardBody>\n </Card>\n </LoadingOverlay>\n </Stack>\n </LoadingOverlayDefaultsProvider>\n );\n}\n",
474
+ "verdict": "example"
443
475
  }
444
476
  ]
445
477
  }
@@ -11,12 +11,51 @@ import { LoadingOverlay, LoadingOverlayDefaultsProvider } from '@slotted/react';
11
11
 
12
12
  ## Minimal example
13
13
 
14
- Excerpt — not a complete module
14
+ Example
15
15
 
16
16
  ```tsx
17
- <LoadingOverlay loading={saving} messages={{ label: 'Saving changes' }}>
18
- <BillingForm />
19
- </LoadingOverlay>;
17
+ import { useState } from 'react';
18
+
19
+ import { Button } from '@slotted/react/button';
20
+ import { Card, CardBody, CardHeader } from '@slotted/react/card';
21
+ import { Field, FieldLabel } from '@slotted/react/field';
22
+ import { Inline } from '@slotted/react/inline';
23
+ import { LoadingOverlay } from '@slotted/react/loading-overlay';
24
+ import { Stack } from '@slotted/react/stack';
25
+ import { TextField } from '@slotted/react/text-field';
26
+ import { Heading } from '@slotted/react/typography';
27
+
28
+ export default function LoadingOverlayBasic() {
29
+ const [saving, setSaving] = useState(false);
30
+
31
+ const save = () => {
32
+ setSaving(true);
33
+ setTimeout(() => setSaving(false), 2500);
34
+ };
35
+
36
+ return (
37
+ <LoadingOverlay loading={saving} messages={{ label: 'Saving the customer' }}>
38
+ <Card>
39
+ <CardHeader>
40
+ <Heading level={3} size="md">
41
+ Customer profile
42
+ </Heading>
43
+ </CardHeader>
44
+ <CardBody>
45
+ <Stack gap={4}>
46
+ <Field>
47
+ <FieldLabel>Company</FieldLabel>
48
+ <TextField defaultValue="Northwind Traders" />
49
+ </Field>
50
+ <Inline>
51
+ <Button onClick={save}>Save customer</Button>
52
+ </Inline>
53
+ </Stack>
54
+ </CardBody>
55
+ </Card>
56
+ </LoadingOverlay>
57
+ );
58
+ }
20
59
  ```
21
60
 
22
61
  ## Anatomy
@@ -37,7 +76,7 @@ Excerpt — not a complete module
37
76
 
38
77
  | Name | Type | Default | Applies to | Description |
39
78
  | --- | --- | --- | --- | --- |
40
- | `loading` | `boolean` | true | LoadingOverlay | Whether the data is still on its way. The consumer’s own fact: the family never moves it, so there is no controlled and uncontrolled pair |
79
+ | `loading` | `boolean` | true | LoadingOverlay | Whether the data is still on its way. The consumer’s own fact: the overlay never moves it, so there is no controlled and uncontrolled pair |
41
80
  | `scope` | `'region' \| 'page'` | region | LoadingOverlay | What is covered. region is the box this element wraps; page is the whole viewport, portalled and modal |
42
81
  | `veil` | `'wash' \| 'blur' \| 'none'` | wash | LoadingOverlay | How the covered content is obscured. none blocks exactly as much and dims nothing |
43
82
  | `size` | `'sm' \| 'md' \| 'lg'` | md | LoadingOverlay | The panel’s step: its padding, its type, and the size of the default mark |
@@ -53,7 +92,7 @@ Excerpt — not a complete module
53
92
  | `children` | `ReactNode` | — | LoadingOverlay | Covered rather than replaced: the content keeps its geometry, stays measured, and goes inert while the layer blocks |
54
93
  | `indicator` | `ReactNode` | — | LoadingOverlay | Replaces the mark. A determinate wait passes progress-indicator’s own ProgressBar with a value |
55
94
  | `render` | `(props) => ReactNode` | — | LoadingOverlay | Substitutes the region’s element. Every data attribute, the ref and aria-busy are handed to it |
56
- | `renderCancel` | `(props) => ReactNode` | — | LoadingOverlay | Substitutes the control. The family’s own control paint is written :not([data-ui]), so a Button here keeps its own |
95
+ | `renderCancel` | `(props) => ReactNode` | — | LoadingOverlay | Substitutes the control. The overlay’s own control paint is written :not([data-ui]), so a Button here keeps its own |
57
96
  | `ref` | `Ref<HTMLDivElement>` | — | LoadingOverlay | Reaches the region element; the props are that element’s, extended |
58
97
  | `LoadingOverlayDefaultsProvider` | `LoadingOverlayDefaults` | — | Application | Sets veil, size, live, loadedLabel, delay and minDuration once for everything below it; a prop still wins |
59
98
 
@@ -61,7 +100,7 @@ Excerpt — not a complete module
61
100
 
62
101
  | Name | Payload | When |
63
102
  | --- | --- | --- |
64
- | `onCancel` | `{ reason: "dismiss" \| "escape"; source: Event }` | The reader presses the control or the Escape key. The family commits nothing — it does not lower loading and does not hide itself — because the operation has not stopped until the application has stopped it. |
103
+ | `onCancel` | `{ reason: "dismiss" \| "escape"; source: Event }` | The reader presses the control or the Escape key. The overlay commits nothing — it does not lower loading and does not hide itself — because the operation has not stopped until the application has stopped it. |
65
104
  | `onReveal` | `void` | The covered content is reachable again, which is later than loading turning false whenever minDuration is still holding the layer. It is the moment an application moves focus on. |
66
105
 
67
106
  ## Axes and defaults
@@ -75,8 +114,8 @@ Excerpt — not a complete module
75
114
 
76
115
  ## Rules
77
116
 
78
- - The covered content carries inert while the layer blocks, which takes it out of the tab order and out of the accessibility tree. It is the capability the two surveyed implementations that document accessibility both decline: Quasar states that the content it covers stays focusable and asks the developer to solve it, and Mantine says the same in its usage section.
79
- - The region carries aria-busy="true" while it waits, which is the platform’s own answer: ARIA 1.2 asks an author to set it on the region until it is finished loading. Page scope writes it nowhere, because the busy region would be the document root and this family owns no part of it.
117
+ - The covered content carries inert while the layer blocks, which takes it out of the tab order and out of the accessibility tree. A covered control is neither focusable nor announced, so the reader does not reach a field the wait has made unsafe to edit.
118
+ - The region carries aria-busy="true" while it waits, which is the platform’s own answer: ARIA 1.2 asks an author to set it on the region until it is finished loading. Page scope writes it nowhere, because the busy region would be the document root and LoadingOverlay owns no part of it.
80
119
  - One overlay is one announcement. A visually-hidden role="status" holds the label while waiting and is emptied afterwards, and emptying a live region announces nothing, so a wait says one thing. The two painted lines carry aria-hidden, so the same sentence is not heard twice.
81
120
  - Focus is read before the content goes inert. If it was inside, it moves to the control or to the panel itself — the container destination the APG advises for content that must be read before it is operated — and returns to where it came from when the wait ends. Focus that was elsewhere is never moved: a background save does not take the caret out of another form.
82
121
  - There is no APG pattern for a loading overlay: the pattern index holds none for a busy region or a blocking layer, and claiming the Dialog pattern would import aria-modal and a close affordance into something that is neither. Page scope makes the rest of the document inert instead, which is what ARIA 1.2 asks of a modal element, and writes no aria-modal because that property inherits only into dialog and alertdialog.
@@ -88,162 +127,4 @@ Excerpt — not a complete module
88
127
 
89
128
  ## Examples
90
129
 
91
- ### The content is still there
92
-
93
- The covered card keeps its height, so nothing below it moves twice per save. Tab from the button above: focus walks past the covered fields, because they are inert rather than merely dimmed.
94
-
95
- Excerpt — not a complete module
96
-
97
- ```tsx
98
- <LoadingOverlay loading={saving} messages={{ label: 'Saving changes' }}>
99
- <Card>
100
- <CardBody>{fields}</CardBody>
101
- </Card>
102
- </LoadingOverlay>;
103
- ```
104
-
105
- ### When the whole application waits
106
-
107
- scope="page" portals the layer, makes every sibling of the portal root inert and locks the document scroll. Reach for it only when partial interaction would be unsafe — a month-end close, not a row that is saving.
108
-
109
- Excerpt — not a complete module
110
-
111
- ```tsx
112
- <LoadingOverlay
113
- scope="page"
114
- loading={closing}
115
- messages={{ label: 'Closing the accounting period' }}
116
- description="Do not close this tab."
117
- />;
118
- ```
119
-
120
- ### Three ways to say out of reach
121
-
122
- wash is the theme’s own scrim; blur adds a backdrop filter, so text stops being legible before it stops being visible; none blocks exactly as much and dims nothing, for a wait short enough that a wash would read as a flash.
123
-
124
- Excerpt — not a complete module
125
-
126
- ```tsx
127
- <LoadingOverlay veil="wash">{rows}</LoadingOverlay>;
128
- <LoadingOverlay veil="blur">{rows}</LoadingOverlay>;
129
- <LoadingOverlay veil="none">{rows}</LoadingOverlay>;
130
- ```
131
-
132
- ### Three steps, and each moves three things
133
-
134
- The mark grows on the control-height scale, the two lines on the control type scale, and the panel on the space scale. Switch the toolbar to dense: the type and the mark shrink together and the meaning does not change.
135
-
136
- Excerpt — not a complete module
137
-
138
- ```tsx
139
- <LoadingOverlay size="sm" messages={{ label: 'Reconciling' }} />;
140
- <LoadingOverlay size="md" messages={{ label: 'Reconciling' }} />;
141
- <LoadingOverlay size="lg" messages={{ label: 'Reconciling' }} />;
142
- ```
143
-
144
- ### The panel answers the region, not the viewport
145
-
146
- A tall region gets a column, a short one gets a bar carrying the same four things, and a small one gets the mark alone. Nothing is lost in the third: the words are in the live region, which is where they were doing the work.
147
-
148
- Excerpt — not a complete module
149
-
150
- ```tsx
151
- <LoadingOverlay messages={{ label: 'Updating the row' }} cancellable>
152
- <TableRow />
153
- </LoadingOverlay>;
154
- ```
155
-
156
- ### Two flashes, and the two durations that prevent them
157
-
158
- delay is the wait before anything is painted, so data that arrives in eighty milliseconds draws nothing. minDuration holds a layer that did appear, so it is not taken away thirty milliseconds later. Both default to zero and cost no timer.
159
-
160
- Excerpt — not a complete module
161
-
162
- ```tsx
163
- <LoadingOverlayDefaultsProvider delay={200} minDuration={400}>
164
- <App />
165
- </LoadingOverlayDefaultsProvider>;
166
- ```
167
-
168
- ### A wait that has gone wrong
169
-
170
- cancellable renders the control and binds Escape to it. The request carries the reason and commits nothing: abort the work and lower loading when it has actually stopped, which is what the second card is showing.
171
-
172
- Excerpt — not a complete module
173
-
174
- ```tsx
175
- <LoadingOverlay
176
- loading={importing}
177
- cancellable
178
- messages={{ label: 'Importing 4 812 rows' }}
179
- onCancel={(request) => abort(request.reason)}
180
- >
181
- {rows}
182
- </LoadingOverlay>;
183
- ```
184
-
185
- ### Where the keyboard goes
186
-
187
- Put the caret in the field and press Save. Focus was inside the content that is about to go inert, so it moves to the panel; when the wait ends it returns to the field it came from. Focus that was elsewhere is never moved.
188
-
189
- Excerpt — not a complete module
190
-
191
- ```tsx
192
- <LoadingOverlay loading={saving} cancellable>
193
- <form>{fields}</form>
194
- </LoadingOverlay>;
195
- ```
196
-
197
- ### A wait with a number on it
198
-
199
- The mark is a slot. The default is the contained loader; a determinate import passes a ProgressBar with its own value, and the family that owns a measured quantity draws it.
200
-
201
- Excerpt — not a complete module
202
-
203
- ```tsx
204
- <LoadingOverlay
205
- messages={{ label: 'Uploading contrato.pdf' }}
206
- indicator={<ProgressBar value={62} label="Uploaded" hideLabel />}
207
- />;
208
- ```
209
-
210
- ### Words the family did not choose
211
-
212
- A translated sentence is longer than the English one that was measured. The panel wraps it, keeps its own measure, and never truncates: the announcement holds the same sentence whole for the reader who would otherwise lose it.
213
-
214
- Excerpt — not a complete module
215
-
216
- ```tsx
217
- <LoadingOverlay
218
- messages={{ label: 'Reconciling the period entries against the bank statement' }}
219
- description="Stopping now would leave half the period reconciled."
220
- />;
221
- ```
222
-
223
- ### The parts a consumer owns
224
-
225
- render puts the region on the element the page already has. renderCancel puts this library’s own Button in the slot, and the family’s control paint steps back for it — the part stays the part, and only the paint is the consumer’s.
226
-
227
- Excerpt — not a complete module
228
-
229
- ```tsx
230
- <LoadingOverlay
231
- render={(props) => <section {...props} />}
232
- renderCancel={(props) => <Button {...props} variant="outline" size="sm" />}
233
- cancellable
234
- >
235
- {rows}
236
- </LoadingOverlay>;
237
- ```
238
-
239
- ### What a screen reader gets
240
-
241
- aria-busy on the region, one role="status" holding one sentence, and the covered subtree out of the accessibility tree entirely. Emptying the live region announces nothing, so a wait says one thing unless loadedLabel asks for a second.
242
-
243
- Excerpt — not a complete module
244
-
245
- ```tsx
246
- <LoadingOverlay messages={{ label: 'Saving changes' }} loadedLabel="Changes saved">
247
- {fields}
248
- </LoadingOverlay>;
249
- ```
130
+ See [loading-overlay.examples.md](./loading-overlay.examples.md).
@@ -103,6 +103,7 @@
103
103
  "shift": true,
104
104
  "hideWhenDetached": true,
105
105
  "portal": true,
106
+ "presentation": "popover",
106
107
  "disabled": false,
107
108
  "loading": false,
108
109
  "sideOffset": 0,
@@ -136,7 +137,12 @@
136
137
  ],
137
138
  "parts": [
138
139
  "root",
140
+ "backdrop",
139
141
  "content",
142
+ "grip",
143
+ "step",
144
+ "back",
145
+ "title",
140
146
  "header",
141
147
  "group",
142
148
  "group-label",
@@ -164,12 +170,42 @@
164
170
  "required": true,
165
171
  "purpose": "The layer the menu is positioned on. It carries data-ui=\"menu\", the resolved size, side and align, and data-open while the menu is open. The gap between the trigger and the surface is the layer's own padding, so the pointer never crosses the page on its way into a submenu."
166
172
  },
173
+ {
174
+ "part": "backdrop",
175
+ "element": "div",
176
+ "required": false,
177
+ "purpose": "The scrim over the page while the menu is a sheet (presentation=\"auto\" on a phone), aria-hidden. A press on it dismisses every step; on a second step it is clear, since the first already dims the page."
178
+ },
167
179
  {
168
180
  "part": "content",
169
181
  "element": "div",
170
182
  "required": true,
171
183
  "purpose": "The painted surface, carrying role=\"menu\". It lays out the columns every item uses, is never taller than the room left in the window, and scrolls inside that height."
172
184
  },
185
+ {
186
+ "part": "grip",
187
+ "element": "span",
188
+ "required": false,
189
+ "purpose": "The bar at the top of the sheet, aria-hidden. A pull down on it dismisses the step it belongs to."
190
+ },
191
+ {
192
+ "part": "step",
193
+ "element": "div",
194
+ "required": false,
195
+ "purpose": "The head of a submenu drawn as the second step of a sheet: the back control, then the name of the item that opened it."
196
+ },
197
+ {
198
+ "part": "back",
199
+ "element": "button",
200
+ "required": false,
201
+ "purpose": "Returns to the first step of the sheet, named by messages.back, with focus on the item that opened the step."
202
+ },
203
+ {
204
+ "part": "title",
205
+ "element": "div",
206
+ "required": false,
207
+ "purpose": "The name of the item that opened the step, as a reader hears it."
208
+ },
173
209
  {
174
210
  "part": "header",
175
211
  "element": "div",
@@ -433,6 +469,20 @@
433
469
  "appliesTo": "Menu",
434
470
  "description": "Whether the layer is rendered at the end of the document."
435
471
  },
472
+ {
473
+ "name": "presentation",
474
+ "type": "'popover' | 'auto'",
475
+ "defaultValue": "popover",
476
+ "appliesTo": "Menu, MenuDefaultsProvider",
477
+ "description": "auto draws the menu as a bottom sheet under (max-width: 480px) and (pointer: coarse): modal, as ActionSheet draws its actions, every item at least --slotted-target-min tall, dismissed by its grip, its scrim, Escape and the platform’s way back, with focus given back to the trigger. A submenu opens as a second step of the same sheet. A menu on a bar stays anchored."
478
+ },
479
+ {
480
+ "name": "messages",
481
+ "type": "Partial<MenuMessages>",
482
+ "defaultValue": "—",
483
+ "appliesTo": "Menu",
484
+ "description": "Words laid over the catalog of the language in force: back, the name of the control that returns from a submenu step to the first step of a sheet."
485
+ },
436
486
  {
437
487
  "name": "disabled",
438
488
  "type": "boolean",
@@ -643,6 +693,7 @@
643
693
  }
644
694
  },
645
695
  "tokens": [
696
+ "--slotted-border-strong",
646
697
  "--slotted-border-subtle",
647
698
  "--slotted-border-width-thin",
648
699
  "--slotted-control-font-size-lg",
@@ -663,6 +714,17 @@
663
714
  "--slotted-control-transition-duration",
664
715
  "--slotted-control-transition-easing",
665
716
  "--slotted-disabled-foreground",
717
+ "--slotted-drawer-border-color",
718
+ "--slotted-drawer-radius",
719
+ "--slotted-drawer-resizer-line-color",
720
+ "--slotted-drawer-scrim",
721
+ "--slotted-drawer-scrim-backdrop-filter",
722
+ "--slotted-drawer-slide-duration",
723
+ "--slotted-drawer-slide-easing",
724
+ "--slotted-drawer-slide-exit-duration",
725
+ "--slotted-drawer-slide-exit-easing",
726
+ "--slotted-drawer-surface",
727
+ "--slotted-duration-long",
666
728
  "--slotted-duration-medium",
667
729
  "--slotted-duration-short",
668
730
  "--slotted-easing-enter",
@@ -670,6 +732,7 @@
670
732
  "--slotted-easing-standard",
671
733
  "--slotted-focus-ring-color",
672
734
  "--slotted-focus-ring-width",
735
+ "--slotted-font-family-heading",
673
736
  "--slotted-font-family-sans",
674
737
  "--slotted-font-size-xs",
675
738
  "--slotted-font-weight-semibold",
@@ -696,12 +759,16 @@
696
759
  "--slotted-menu-text-muted",
697
760
  "--slotted-overlay-max-block-size",
698
761
  "--slotted-radius-lg",
762
+ "--slotted-scrim",
763
+ "--slotted-shadow-lg",
699
764
  "--slotted-shadow-md",
700
765
  "--slotted-space-1",
766
+ "--slotted-space-11",
701
767
  "--slotted-space-2",
702
768
  "--slotted-space-5",
703
769
  "--slotted-space-6",
704
770
  "--slotted-surface-raised",
771
+ "--slotted-target-min",
705
772
  "--slotted-text",
706
773
  "--slotted-text-muted",
707
774
  "--slotted-tone-accent-subtle-active",
package/dist/docs/menu.md CHANGED
@@ -46,7 +46,12 @@ export default function MenuBasic() {
46
46
  | Part | Element | Required |
47
47
  | --- | --- | --- |
48
48
  | `root` | div, or the element render returns | yes |
49
+ | `backdrop` | div | no |
49
50
  | `content` | div | yes |
51
+ | `grip` | span | no |
52
+ | `step` | div | no |
53
+ | `back` | button | no |
54
+ | `title` | div | no |
50
55
  | `header` | div | no |
51
56
  | `group` | div | no |
52
57
  | `group-label` | div | no |
@@ -91,6 +96,8 @@ export default function MenuBasic() {
91
96
  | `shift` | `boolean` | true | Menu | Whether the surface slides along its edge to stay in the window. |
92
97
  | `hideWhenDetached` | `boolean` | true | Menu | Whether the surface hides once its trigger has scrolled out of view. |
93
98
  | `portal` | `boolean` | true | Menu | Whether the layer is rendered at the end of the document. |
99
+ | `presentation` | `'popover' \| 'auto'` | popover | Menu, MenuDefaultsProvider | auto draws the menu as a bottom sheet under (max-width: 480px) and (pointer: coarse): modal, as ActionSheet draws its actions, every item at least --slotted-target-min tall, dismissed by its grip, its scrim, Escape and the platform’s way back, with focus given back to the trigger. A submenu opens as a second step of the same sheet. A menu on a bar stays anchored. |
100
+ | `messages` | `Partial<MenuMessages>` | — | Menu | Words laid over the catalog of the language in force: back, the name of the control that returns from a submenu step to the first step of a sheet. |
94
101
  | `disabled` | `boolean` | false | Menu, MenuItem | A disabled menu never opens, and its trigger keeps aria-expanded="false". A disabled item stays focusable and runs nothing. |
95
102
  | `loading` | `boolean` | false | MenuContent | Whether the items are on their way. The surface keeps its width, sets aria-busy and shows the MenuEmpty message. |
96
103
  | `sideOffset` | `number` | 0 | Menu | Extra distance from the trigger, in pixels, beyond the layer's own gap. |
@@ -158,7 +165,7 @@ export default function MenuBasic() {
158
165
 
159
166
  ## Tokens
160
167
 
161
- `--slotted-border-subtle`, `--slotted-border-width-thin`, `--slotted-control-font-size-lg`, `--slotted-control-font-size-md`, `--slotted-control-font-size-sm`, `--slotted-control-gap-lg`, `--slotted-control-gap-md`, `--slotted-control-gap-sm`, `--slotted-control-height-lg`, `--slotted-control-height-md`, `--slotted-control-height-sm`, `--slotted-control-icon-size-lg`, `--slotted-control-icon-size-md`, `--slotted-control-icon-size-sm`, `--slotted-control-padding-inline-lg`, `--slotted-control-padding-inline-md`, `--slotted-control-padding-inline-sm`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-disabled-foreground`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-width`, `--slotted-font-family-sans`, `--slotted-font-size-xs`, `--slotted-font-weight-semibold`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-menu-backdrop-filter`, `--slotted-menu-border-color`, `--slotted-menu-gap`, `--slotted-menu-group-label-height`, `--slotted-menu-highlight`, `--slotted-menu-highlight-active`, `--slotted-menu-item-radius`, `--slotted-menu-measure`, `--slotted-menu-measure-lg`, `--slotted-menu-measure-sm`, `--slotted-menu-min-measure`, `--slotted-menu-padding-block`, `--slotted-menu-padding-inline`, `--slotted-menu-radius`, `--slotted-menu-separator-color`, `--slotted-menu-shadow`, `--slotted-menu-surface`, `--slotted-menu-text`, `--slotted-menu-text-muted`, `--slotted-overlay-max-block-size`, `--slotted-radius-lg`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-2`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-surface-raised`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-subtle-active`, `--slotted-tone-accent-surface`, `--slotted-tone-accent-text`, `--slotted-tone-danger-subtle-active`, `--slotted-tone-danger-surface`, `--slotted-tone-danger-text`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-tone-secondary-surface`, `--slotted-tone-secondary-text`, `--slotted-tone-success-subtle-active`, `--slotted-tone-success-surface`, `--slotted-tone-success-text`, `--slotted-tone-warning-subtle-active`, `--slotted-tone-warning-surface`, `--slotted-tone-warning-text`, `--slotted-z-index-popover`
168
+ `--slotted-border-strong`, `--slotted-border-subtle`, `--slotted-border-width-thin`, `--slotted-control-font-size-lg`, `--slotted-control-font-size-md`, `--slotted-control-font-size-sm`, `--slotted-control-gap-lg`, `--slotted-control-gap-md`, `--slotted-control-gap-sm`, `--slotted-control-height-lg`, `--slotted-control-height-md`, `--slotted-control-height-sm`, `--slotted-control-icon-size-lg`, `--slotted-control-icon-size-md`, `--slotted-control-icon-size-sm`, `--slotted-control-padding-inline-lg`, `--slotted-control-padding-inline-md`, `--slotted-control-padding-inline-sm`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-disabled-foreground`, `--slotted-drawer-border-color`, `--slotted-drawer-radius`, `--slotted-drawer-resizer-line-color`, `--slotted-drawer-scrim`, `--slotted-drawer-scrim-backdrop-filter`, `--slotted-drawer-slide-duration`, `--slotted-drawer-slide-easing`, `--slotted-drawer-slide-exit-duration`, `--slotted-drawer-slide-exit-easing`, `--slotted-drawer-surface`, `--slotted-duration-long`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-xs`, `--slotted-font-weight-semibold`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-menu-backdrop-filter`, `--slotted-menu-border-color`, `--slotted-menu-gap`, `--slotted-menu-group-label-height`, `--slotted-menu-highlight`, `--slotted-menu-highlight-active`, `--slotted-menu-item-radius`, `--slotted-menu-measure`, `--slotted-menu-measure-lg`, `--slotted-menu-measure-sm`, `--slotted-menu-min-measure`, `--slotted-menu-padding-block`, `--slotted-menu-padding-inline`, `--slotted-menu-radius`, `--slotted-menu-separator-color`, `--slotted-menu-shadow`, `--slotted-menu-surface`, `--slotted-menu-text`, `--slotted-menu-text-muted`, `--slotted-overlay-max-block-size`, `--slotted-radius-lg`, `--slotted-scrim`, `--slotted-shadow-lg`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-11`, `--slotted-space-2`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-surface-raised`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-subtle-active`, `--slotted-tone-accent-surface`, `--slotted-tone-accent-text`, `--slotted-tone-danger-subtle-active`, `--slotted-tone-danger-surface`, `--slotted-tone-danger-text`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-tone-secondary-surface`, `--slotted-tone-secondary-text`, `--slotted-tone-success-subtle-active`, `--slotted-tone-success-surface`, `--slotted-tone-success-text`, `--slotted-tone-warning-subtle-active`, `--slotted-tone-warning-surface`, `--slotted-tone-warning-text`, `--slotted-z-index-popover`
162
169
 
163
170
  ## Examples
164
171