@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
@@ -207,6 +207,62 @@
207
207
  "language": "tsx",
208
208
  "source": "<FloatingPanel aria-label=\"Notes\" onOpenChange={setOpen} open={open}>\n …\n</FloatingPanel>;\n",
209
209
  "verdict": "excerpt"
210
+ },
211
+ {
212
+ "id": "basic",
213
+ "title": "basic.tsx",
214
+ "note": null,
215
+ "language": "tsx",
216
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n FloatingPanelTitle,\n} from '@slotted/react/floating-panel';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FloatingPanelBasic() {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button onClick={() => setOpen(true)}>Open shipping estimate</Button>\n\n <FloatingPanel onOpenChange={setOpen} open={open}>\n <FloatingPanelHandle>\n <FloatingPanelTitle>Shipping estimate</FloatingPanelTitle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Stack gap={2}>\n <Text size=\"sm\">Order 48213, 14 cases</Text>\n <Text size=\"sm\">Freight $86.40</Text>\n <Text size=\"sm\">Total $1,326.40</Text>\n </Stack>\n </FloatingPanelBody>\n </FloatingPanel>\n </>\n );\n}\n",
217
+ "verdict": "example"
218
+ },
219
+ {
220
+ "id": "corners",
221
+ "title": "corners.tsx",
222
+ "note": null,
223
+ "language": "tsx",
224
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n FloatingPanelTitle,\n} from '@slotted/react/floating-panel';\nimport type { FloatingCorner } from '@slotted/react/floating-panel';\nimport { Text } from '@slotted/react/typography';\n\nconst DOCKS: readonly { corner: FloatingCorner; name: string; status: string }[] = [\n { corner: 'top-start', name: 'Inbound dock', status: 'Door 3 free' },\n { corner: 'top-end', name: 'Outbound dock', status: '2 trucks waiting' },\n { corner: 'bottom-start', name: 'Cold storage', status: '3.8 °C' },\n { corner: 'bottom-end', name: 'Returns', status: '11 parcels to sort' },\n];\n\nexport default function FloatingPanelCorners() {\n const [closed, setClosed] = useState<readonly FloatingCorner[]>(DOCKS.map((dock) => dock.corner));\n\n return (\n <>\n <Button onClick={() => setClosed([])}>Show all docks</Button>\n\n {DOCKS.map((dock) => (\n <FloatingPanel\n defaultPlace={dock.corner}\n key={dock.corner}\n onOpenChange={() => setClosed([...closed, dock.corner])}\n open={!closed.includes(dock.corner)}\n >\n <FloatingPanelHandle>\n <FloatingPanelTitle>{dock.name}</FloatingPanelTitle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Text size=\"sm\">{dock.status}</Text>\n </FloatingPanelBody>\n </FloatingPanel>\n ))}\n </>\n );\n}\n",
225
+ "verdict": "example"
226
+ },
227
+ {
228
+ "id": "label",
229
+ "title": "label.tsx",
230
+ "note": null,
231
+ "language": "tsx",
232
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n} from '@slotted/react/floating-panel';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FloatingPanelLabel() {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button onClick={() => setOpen(true)}>Open dispatch notes</Button>\n\n <FloatingPanel\n aria-label=\"Dispatch notes\"\n defaultPlace=\"bottom-start\"\n onOpenChange={setOpen}\n open={open}\n >\n <FloatingPanelHandle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Text size=\"sm\">Carrier pickup moved to 14:30 for order 48213.</Text>\n </FloatingPanelBody>\n </FloatingPanel>\n </>\n );\n}\n",
233
+ "verdict": "example"
234
+ },
235
+ {
236
+ "id": "messages",
237
+ "title": "messages.tsx",
238
+ "note": null,
239
+ "language": "tsx",
240
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n FloatingPanelTitle,\n} from '@slotted/react/floating-panel';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FloatingPanelMessages() {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button onClick={() => setOpen(true)}>Open packing timer</Button>\n\n <FloatingPanel\n defaultPlace=\"top-start\"\n messages={{ close: 'Dismiss the timer', move: 'Reposition the timer' }}\n onOpenChange={setOpen}\n open={open}\n >\n <FloatingPanelHandle>\n <FloatingPanelTitle>Packing timer</FloatingPanelTitle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Text size=\"sm\">Order 48213: 04:12 elapsed.</Text>\n </FloatingPanelBody>\n </FloatingPanel>\n </>\n );\n}\n",
241
+ "verdict": "example"
242
+ },
243
+ {
244
+ "id": "non-modal",
245
+ "title": "non-modal.tsx",
246
+ "note": null,
247
+ "language": "tsx",
248
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n FloatingPanelTitle,\n} from '@slotted/react/floating-panel';\nimport { Inline } from '@slotted/react/inline';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FloatingPanelNonModal() {\n const [open, setOpen] = useState(false);\n const [picked, setPicked] = useState(0);\n\n return (\n <>\n <Inline>\n <Button onClick={() => setPicked(picked + 1)}>Pick one case</Button>\n <Button onClick={() => setOpen(true)} variant=\"outline\">\n Open pick list\n </Button>\n </Inline>\n\n <FloatingPanel defaultPlace=\"bottom-start\" onOpenChange={setOpen} open={open}>\n <FloatingPanelHandle>\n <FloatingPanelTitle>Pick list</FloatingPanelTitle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Text size=\"sm\">Cases picked for order 48213: {picked} of 14</Text>\n </FloatingPanelBody>\n </FloatingPanel>\n </>\n );\n}\n",
249
+ "verdict": "example"
250
+ },
251
+ {
252
+ "id": "place",
253
+ "title": "place.tsx",
254
+ "note": null,
255
+ "language": "tsx",
256
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n FloatingPanelTitle,\n} from '@slotted/react/floating-panel';\nimport type { FloatingPlace } from '@slotted/react/floating-panel';\nimport { Inline } from '@slotted/react/inline';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FloatingPanelPlace() {\n const [open, setOpen] = useState(false);\n const [place, setPlace] = useState<FloatingPlace | undefined>(undefined);\n\n return (\n <>\n <Inline>\n <Button onClick={() => setOpen(true)}>Open route notes</Button>\n <Button onClick={() => setPlace({ x: 32, y: 96 })} variant=\"outline\">\n Pin to the top left\n </Button>\n </Inline>\n\n <FloatingPanel onOpenChange={setOpen} onPlaceChange={setPlace} open={open} place={place}>\n <FloatingPanelHandle>\n <FloatingPanelTitle>Route notes</FloatingPanelTitle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Text size=\"sm\">\n {place === undefined\n ? 'Not moved yet'\n : `Stored at x ${Math.round(place.x)}, y ${Math.round(place.y)}`}\n </Text>\n </FloatingPanelBody>\n </FloatingPanel>\n </>\n );\n}\n",
257
+ "verdict": "example"
258
+ },
259
+ {
260
+ "id": "steps",
261
+ "title": "steps.tsx",
262
+ "note": null,
263
+ "language": "tsx",
264
+ "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n FloatingPanel,\n FloatingPanelBody,\n FloatingPanelClose,\n FloatingPanelHandle,\n FloatingPanelTitle,\n} from '@slotted/react/floating-panel';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FloatingPanelSteps() {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button onClick={() => setOpen(true)}>Open pallet tracker</Button>\n\n <FloatingPanel\n defaultPlace=\"top-end\"\n largeStep={64}\n onOpenChange={setOpen}\n open={open}\n step={16}\n >\n <FloatingPanelHandle>\n <FloatingPanelTitle>Pallet tracker</FloatingPanelTitle>\n <FloatingPanelClose />\n </FloatingPanelHandle>\n <FloatingPanelBody>\n <Text size=\"sm\">Focus Move, then press an arrow key: 16 px, or 64 px with Shift.</Text>\n </FloatingPanelBody>\n </FloatingPanel>\n </>\n );\n}\n",
265
+ "verdict": "example"
210
266
  }
211
267
  ]
212
268
  }
@@ -17,16 +17,45 @@ import {
17
17
 
18
18
  ## Minimal example
19
19
 
20
- Excerpt — not a complete module
20
+ Example
21
21
 
22
22
  ```tsx
23
- <FloatingPanel onOpenChange={setOpen} open={open}>
24
- <FloatingPanelHandle>
25
- <FloatingPanelTitle>Calculator</FloatingPanelTitle>
26
- <FloatingPanelClose />
27
- </FloatingPanelHandle>
28
- <FloatingPanelBody>…</FloatingPanelBody>
29
- </FloatingPanel>;
23
+ import { useState } from 'react';
24
+
25
+ import { Button } from '@slotted/react/button';
26
+ import {
27
+ FloatingPanel,
28
+ FloatingPanelBody,
29
+ FloatingPanelClose,
30
+ FloatingPanelHandle,
31
+ FloatingPanelTitle,
32
+ } from '@slotted/react/floating-panel';
33
+ import { Stack } from '@slotted/react/stack';
34
+ import { Text } from '@slotted/react/typography';
35
+
36
+ export default function FloatingPanelBasic() {
37
+ const [open, setOpen] = useState(false);
38
+
39
+ return (
40
+ <>
41
+ <Button onClick={() => setOpen(true)}>Open shipping estimate</Button>
42
+
43
+ <FloatingPanel onOpenChange={setOpen} open={open}>
44
+ <FloatingPanelHandle>
45
+ <FloatingPanelTitle>Shipping estimate</FloatingPanelTitle>
46
+ <FloatingPanelClose />
47
+ </FloatingPanelHandle>
48
+ <FloatingPanelBody>
49
+ <Stack gap={2}>
50
+ <Text size="sm">Order 48213, 14 cases</Text>
51
+ <Text size="sm">Freight $86.40</Text>
52
+ <Text size="sm">Total $1,326.40</Text>
53
+ </Stack>
54
+ </FloatingPanelBody>
55
+ </FloatingPanel>
56
+ </>
57
+ );
58
+ }
30
59
  ```
31
60
 
32
61
  ## Anatomy
@@ -67,6 +96,22 @@ Excerpt — not a complete module
67
96
 
68
97
  ## Examples
69
98
 
99
+ ### Playground
100
+
101
+ A calculator left open over a page that stays usable: drag the handle, press a button of the page under it, and close the panel with Escape.
102
+
103
+ Excerpt — not a complete module
104
+
105
+ ```tsx
106
+ <FloatingPanel onOpenChange={setOpen} open={open}>
107
+ <FloatingPanelHandle>
108
+ <FloatingPanelTitle>Calculator</FloatingPanelTitle>
109
+ <FloatingPanelClose />
110
+ </FloatingPanelHandle>
111
+ <FloatingPanelBody>…</FloatingPanelBody>
112
+ </FloatingPanel>;
113
+ ```
114
+
70
115
  ### Moved by the keyboard, and stored where it was left
71
116
 
72
117
  The grip takes focus; an arrow key moves the panel by step, eight pixels, and by largeStep, thirty-two, with Shift. onPlaceChange reports the end of every move, so the application stores the place and hands it back as place.
@@ -90,3 +135,279 @@ Excerpt — not a complete module
90
135
  …
91
136
  </FloatingPanel>;
92
137
  ```
138
+
139
+ ### corners.tsx
140
+
141
+ Example
142
+
143
+ ```tsx
144
+ import { useState } from 'react';
145
+
146
+ import { Button } from '@slotted/react/button';
147
+ import {
148
+ FloatingPanel,
149
+ FloatingPanelBody,
150
+ FloatingPanelClose,
151
+ FloatingPanelHandle,
152
+ FloatingPanelTitle,
153
+ } from '@slotted/react/floating-panel';
154
+ import type { FloatingCorner } from '@slotted/react/floating-panel';
155
+ import { Text } from '@slotted/react/typography';
156
+
157
+ const DOCKS: readonly { corner: FloatingCorner; name: string; status: string }[] = [
158
+ { corner: 'top-start', name: 'Inbound dock', status: 'Door 3 free' },
159
+ { corner: 'top-end', name: 'Outbound dock', status: '2 trucks waiting' },
160
+ { corner: 'bottom-start', name: 'Cold storage', status: '3.8 °C' },
161
+ { corner: 'bottom-end', name: 'Returns', status: '11 parcels to sort' },
162
+ ];
163
+
164
+ export default function FloatingPanelCorners() {
165
+ const [closed, setClosed] = useState<readonly FloatingCorner[]>(DOCKS.map((dock) => dock.corner));
166
+
167
+ return (
168
+ <>
169
+ <Button onClick={() => setClosed([])}>Show all docks</Button>
170
+
171
+ {DOCKS.map((dock) => (
172
+ <FloatingPanel
173
+ defaultPlace={dock.corner}
174
+ key={dock.corner}
175
+ onOpenChange={() => setClosed([...closed, dock.corner])}
176
+ open={!closed.includes(dock.corner)}
177
+ >
178
+ <FloatingPanelHandle>
179
+ <FloatingPanelTitle>{dock.name}</FloatingPanelTitle>
180
+ <FloatingPanelClose />
181
+ </FloatingPanelHandle>
182
+ <FloatingPanelBody>
183
+ <Text size="sm">{dock.status}</Text>
184
+ </FloatingPanelBody>
185
+ </FloatingPanel>
186
+ ))}
187
+ </>
188
+ );
189
+ }
190
+ ```
191
+
192
+ ### label.tsx
193
+
194
+ Example
195
+
196
+ ```tsx
197
+ import { useState } from 'react';
198
+
199
+ import { Button } from '@slotted/react/button';
200
+ import {
201
+ FloatingPanel,
202
+ FloatingPanelBody,
203
+ FloatingPanelClose,
204
+ FloatingPanelHandle,
205
+ } from '@slotted/react/floating-panel';
206
+ import { Text } from '@slotted/react/typography';
207
+
208
+ export default function FloatingPanelLabel() {
209
+ const [open, setOpen] = useState(false);
210
+
211
+ return (
212
+ <>
213
+ <Button onClick={() => setOpen(true)}>Open dispatch notes</Button>
214
+
215
+ <FloatingPanel
216
+ aria-label="Dispatch notes"
217
+ defaultPlace="bottom-start"
218
+ onOpenChange={setOpen}
219
+ open={open}
220
+ >
221
+ <FloatingPanelHandle>
222
+ <FloatingPanelClose />
223
+ </FloatingPanelHandle>
224
+ <FloatingPanelBody>
225
+ <Text size="sm">Carrier pickup moved to 14:30 for order 48213.</Text>
226
+ </FloatingPanelBody>
227
+ </FloatingPanel>
228
+ </>
229
+ );
230
+ }
231
+ ```
232
+
233
+ ### messages.tsx
234
+
235
+ Example
236
+
237
+ ```tsx
238
+ import { useState } from 'react';
239
+
240
+ import { Button } from '@slotted/react/button';
241
+ import {
242
+ FloatingPanel,
243
+ FloatingPanelBody,
244
+ FloatingPanelClose,
245
+ FloatingPanelHandle,
246
+ FloatingPanelTitle,
247
+ } from '@slotted/react/floating-panel';
248
+ import { Text } from '@slotted/react/typography';
249
+
250
+ export default function FloatingPanelMessages() {
251
+ const [open, setOpen] = useState(false);
252
+
253
+ return (
254
+ <>
255
+ <Button onClick={() => setOpen(true)}>Open packing timer</Button>
256
+
257
+ <FloatingPanel
258
+ defaultPlace="top-start"
259
+ messages={{ close: 'Dismiss the timer', move: 'Reposition the timer' }}
260
+ onOpenChange={setOpen}
261
+ open={open}
262
+ >
263
+ <FloatingPanelHandle>
264
+ <FloatingPanelTitle>Packing timer</FloatingPanelTitle>
265
+ <FloatingPanelClose />
266
+ </FloatingPanelHandle>
267
+ <FloatingPanelBody>
268
+ <Text size="sm">Order 48213: 04:12 elapsed.</Text>
269
+ </FloatingPanelBody>
270
+ </FloatingPanel>
271
+ </>
272
+ );
273
+ }
274
+ ```
275
+
276
+ ### non-modal.tsx
277
+
278
+ Example
279
+
280
+ ```tsx
281
+ import { useState } from 'react';
282
+
283
+ import { Button } from '@slotted/react/button';
284
+ import {
285
+ FloatingPanel,
286
+ FloatingPanelBody,
287
+ FloatingPanelClose,
288
+ FloatingPanelHandle,
289
+ FloatingPanelTitle,
290
+ } from '@slotted/react/floating-panel';
291
+ import { Inline } from '@slotted/react/inline';
292
+ import { Text } from '@slotted/react/typography';
293
+
294
+ export default function FloatingPanelNonModal() {
295
+ const [open, setOpen] = useState(false);
296
+ const [picked, setPicked] = useState(0);
297
+
298
+ return (
299
+ <>
300
+ <Inline>
301
+ <Button onClick={() => setPicked(picked + 1)}>Pick one case</Button>
302
+ <Button onClick={() => setOpen(true)} variant="outline">
303
+ Open pick list
304
+ </Button>
305
+ </Inline>
306
+
307
+ <FloatingPanel defaultPlace="bottom-start" onOpenChange={setOpen} open={open}>
308
+ <FloatingPanelHandle>
309
+ <FloatingPanelTitle>Pick list</FloatingPanelTitle>
310
+ <FloatingPanelClose />
311
+ </FloatingPanelHandle>
312
+ <FloatingPanelBody>
313
+ <Text size="sm">Cases picked for order 48213: {picked} of 14</Text>
314
+ </FloatingPanelBody>
315
+ </FloatingPanel>
316
+ </>
317
+ );
318
+ }
319
+ ```
320
+
321
+ ### place.tsx
322
+
323
+ Example
324
+
325
+ ```tsx
326
+ import { useState } from 'react';
327
+
328
+ import { Button } from '@slotted/react/button';
329
+ import {
330
+ FloatingPanel,
331
+ FloatingPanelBody,
332
+ FloatingPanelClose,
333
+ FloatingPanelHandle,
334
+ FloatingPanelTitle,
335
+ } from '@slotted/react/floating-panel';
336
+ import type { FloatingPlace } from '@slotted/react/floating-panel';
337
+ import { Inline } from '@slotted/react/inline';
338
+ import { Text } from '@slotted/react/typography';
339
+
340
+ export default function FloatingPanelPlace() {
341
+ const [open, setOpen] = useState(false);
342
+ const [place, setPlace] = useState<FloatingPlace | undefined>(undefined);
343
+
344
+ return (
345
+ <>
346
+ <Inline>
347
+ <Button onClick={() => setOpen(true)}>Open route notes</Button>
348
+ <Button onClick={() => setPlace({ x: 32, y: 96 })} variant="outline">
349
+ Pin to the top left
350
+ </Button>
351
+ </Inline>
352
+
353
+ <FloatingPanel onOpenChange={setOpen} onPlaceChange={setPlace} open={open} place={place}>
354
+ <FloatingPanelHandle>
355
+ <FloatingPanelTitle>Route notes</FloatingPanelTitle>
356
+ <FloatingPanelClose />
357
+ </FloatingPanelHandle>
358
+ <FloatingPanelBody>
359
+ <Text size="sm">
360
+ {place === undefined
361
+ ? 'Not moved yet'
362
+ : `Stored at x ${Math.round(place.x)}, y ${Math.round(place.y)}`}
363
+ </Text>
364
+ </FloatingPanelBody>
365
+ </FloatingPanel>
366
+ </>
367
+ );
368
+ }
369
+ ```
370
+
371
+ ### steps.tsx
372
+
373
+ Example
374
+
375
+ ```tsx
376
+ import { useState } from 'react';
377
+
378
+ import { Button } from '@slotted/react/button';
379
+ import {
380
+ FloatingPanel,
381
+ FloatingPanelBody,
382
+ FloatingPanelClose,
383
+ FloatingPanelHandle,
384
+ FloatingPanelTitle,
385
+ } from '@slotted/react/floating-panel';
386
+ import { Text } from '@slotted/react/typography';
387
+
388
+ export default function FloatingPanelSteps() {
389
+ const [open, setOpen] = useState(false);
390
+
391
+ return (
392
+ <>
393
+ <Button onClick={() => setOpen(true)}>Open pallet tracker</Button>
394
+
395
+ <FloatingPanel
396
+ defaultPlace="top-end"
397
+ largeStep={64}
398
+ onOpenChange={setOpen}
399
+ open={open}
400
+ step={16}
401
+ >
402
+ <FloatingPanelHandle>
403
+ <FloatingPanelTitle>Pallet tracker</FloatingPanelTitle>
404
+ <FloatingPanelClose />
405
+ </FloatingPanelHandle>
406
+ <FloatingPanelBody>
407
+ <Text size="sm">Focus Move, then press an arrow key: 16 px, or 64 px with Shift.</Text>
408
+ </FloatingPanelBody>
409
+ </FloatingPanel>
410
+ </>
411
+ );
412
+ }
413
+ ```
@@ -45,14 +45,14 @@
45
45
  "docs": {
46
46
  "hoverCard": {
47
47
  "imports": {
48
- "source": "import { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardDefaultsProvider } from '@slotted/react';\nimport { PopoverBody, PopoverTitle, PopoverFooter } from '@slotted/react';"
48
+ "source": "import { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardDefaultsProvider } from '@slotted/react/hover-card';\nimport { PopoverBody, PopoverTitle, PopoverFooter } from '@slotted/react/popover';"
49
49
  },
50
50
  "anatomy": [
51
51
  {
52
52
  "part": "root",
53
53
  "element": "a, or the element render returns",
54
54
  "required": true,
55
- "purpose": "The trigger: the link the card is about. It carries data-ui=\"hover-card\", data-open while its card shows, and — only when the card is navigable — aria-haspopup=\"dialog\", aria-expanded and aria-controls. The card itself is the popover family unchanged, data-ui=\"popover\", so this family declares no other part."
55
+ "purpose": "The trigger: the link the card is about. It carries data-ui=\"hover-card\", data-open while its card shows, and — only when the card is navigable — aria-haspopup=\"dialog\", aria-expanded and aria-controls. The card itself is the popover family unchanged, data-ui=\"popover\", so the hover card declares no other part."
56
56
  }
57
57
  ],
58
58
  "api": [
@@ -110,14 +110,14 @@
110
110
  "type": "number",
111
111
  "defaultValue": "4",
112
112
  "appliesTo": "HoverCard",
113
- "description": "The popover’s own axis, with the family’s default: the halo the open mark draws plus the same again of air, so the arrow’s tip stands off the word."
113
+ "description": "The popover’s own axis, with the hover card’s default: the halo the open mark draws plus the same again of air, so the arrow’s tip stands off the word."
114
114
  },
115
115
  {
116
116
  "name": "side, align, size, width, arrow, mount, …",
117
117
  "type": "PopoverProps",
118
118
  "defaultValue": "—",
119
119
  "appliesTo": "HoverCard",
120
- "description": "Every prop of Popover except autoFocus, which the family forces off, reaches the popover it renders."
120
+ "description": "Every prop of Popover except autoFocus, which the hover card forces off, reaches the popover it renders."
121
121
  },
122
122
  {
123
123
  "name": "render",
@@ -147,7 +147,7 @@
147
147
  "type": "component",
148
148
  "defaultValue": "—",
149
149
  "appliesTo": "Inside a HoverCard",
150
- "description": "The popover’s layer and panel in one, with the family’s pointer handlers on the layer and the panel’s role decided by navigable. Its props reach the panel; the arrow is rendered under the popover’s arrow axis."
150
+ "description": "The popover’s layer and panel in one, with the hover card’s pointer handlers on the layer and the panel’s role decided by navigable. Its props reach the panel; the arrow is rendered under the popover’s arrow axis."
151
151
  },
152
152
  {
153
153
  "name": "ref",
@@ -161,7 +161,7 @@
161
161
  "type": "attributes",
162
162
  "defaultValue": "—",
163
163
  "appliesTo": "HoverCardTrigger",
164
- "description": "Anything an anchor takes — href, rel, target — reaches the link, and a consumer's own onPointerEnter or onFocus runs before the family's; preventDefault from it stops the family."
164
+ "description": "Anything an anchor takes — href, rel, target — reaches the link, and a consumer's own onPointerEnter or onFocus runs before the hover card's own; preventDefault from it stops the hover card's handler."
165
165
  }
166
166
  ],
167
167
  "events": [
@@ -173,9 +173,9 @@
173
173
  ],
174
174
  "accessibility": [
175
175
  "The platform supplies the link: it is a native anchor, so Enter follows it, a middle click opens it in a tab and a screen reader hears a link. The card never takes focus when it opens — autoFocus is forced off on the popover it holds — so the reader’s focus stays on the word under the pointer.",
176
- "The family answers WCAG 2.2 SC 1.4.13 item by item: the card is dismissible with Escape and no pointer movement, hoverable because the pointer may move onto it and the grace area keeps it open on the way, and persistent because it stays until hover and focus have left both link and card.",
177
- "A card the keyboard cannot enter is role=\"presentation\" and the link says nothing about it, because a popup the announced means cannot reach would be a lie a screen reader repeats. A navigable card is the APG’s non-modal dialog, named by its title, with aria-haspopup=\"dialog\", aria-expanded and aria-controls on the link, and Tab from the link enters it.",
178
- "Focus the family itself puts back on the link — after Escape inside the card, after a focus guard — does not reopen the card; the link holds the reopening back until focus has left it once. Without that rule a guard would close the card, focus the link, and open the card again."
176
+ "The hover card answers WCAG 2.2 SC 1.4.13 item by item: the card is dismissible with Escape and no pointer movement, hoverable because the pointer may move onto it and the grace area keeps it open on the way, and persistent because it stays until hover and focus have left both link and card.",
177
+ "A popup that assistive technology cannot reach is not announced: a card the keyboard cannot enter is role=\"presentation\", and the link says nothing about it. A navigable card is the APG’s non-modal dialog, named by its title, with aria-haspopup=\"dialog\", aria-expanded and aria-controls on the link, and Tab from the link enters it.",
178
+ "Focus that the hover card itself puts back on the link — after Escape inside the card, after a focus guard — does not reopen the card; the link holds the reopening back until focus has left it once. Without that rule a guard would close the card, focus the link, and open the card again."
179
179
  ]
180
180
  }
181
181
  },
@@ -218,16 +218,16 @@
218
218
  "title": "A document",
219
219
  "note": "The card a link to a spec shows: its title, who touched it last and its first lines. The trigger stays a link — Enter follows it, a middle click opens it in a tab — and the card adds nothing the destination does not have.",
220
220
  "language": "tsx",
221
- "source": "<HoverCard>\n <HoverCardTrigger href=\"/specs/checkout-pricing\">\n Checkout redesign — pricing table\n </HoverCardTrigger>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>Checkout redesign — pricing table</PopoverTitle>\n <PopoverDescription>Product spec · updated 2 hours ago</PopoverDescription>\n </PopoverHeader>\n <PopoverBody>…</PopoverBody>\n </HoverCardContent>\n</HoverCard>;\n",
222
- "verdict": "excerpt"
221
+ "source": "import { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport {\n PopoverBody,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n} from '@slotted/react/popover';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardLinkPreview() {\n return (\n <Text>\n Freight for October follows the{' '}\n <HoverCard>\n <HoverCardTrigger href=\"/documents/q4-carrier-rate-card\">\n Q4 carrier rate card\n </HoverCardTrigger>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>Q4 carrier rate card</PopoverTitle>\n <PopoverDescription>Spreadsheet, updated 2 hours ago</PopoverDescription>\n </PopoverHeader>\n <PopoverBody>\n <Text size=\"sm\">\n Freight rates by carrier and zone for October through December, with the fuel\n surcharge from Oct 1.\n </Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n , which Federal Shipping has already signed.\n </Text>\n );\n}\n",
222
+ "verdict": "example"
223
223
  },
224
224
  {
225
225
  "id": "navigable",
226
226
  "title": "Navigable",
227
227
  "note": "The card holds a control, so the page says so with navigable: the panel becomes a dialog named by its title, the link announces the popup, and Tab from the open link enters the card. Past its last control a focus guard closes it and puts focus back on the link, which does not reopen.",
228
228
  "language": "tsx",
229
- "source": "<HoverCard navigable>\n <HoverCardTrigger href=\"/people/ana\">@ana.souza</HoverCardTrigger>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>Ana Souza</PopoverTitle>\n </PopoverHeader>\n <PopoverBody>…</PopoverBody>\n <PopoverFooter>\n <Button size=\"sm\">Follow</Button>\n </PopoverFooter>\n </HoverCardContent>\n</HoverCard>;\n",
230
- "verdict": "excerpt"
229
+ "source": "import { Button } from '@slotted/react/button';\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport {\n PopoverBody,\n PopoverDescription,\n PopoverFooter,\n PopoverHeader,\n PopoverTitle,\n} from '@slotted/react/popover';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardNavigable() {\n return (\n <Text>\n The credit limit for Around the Horn is waiting on{' '}\n <HoverCard navigable>\n <HoverCardTrigger href=\"/people/andrew.fuller\">@andrew.fuller</HoverCardTrigger>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>Andrew Fuller</PopoverTitle>\n <PopoverDescription>Vice President, Sales</PopoverDescription>\n </PopoverHeader>\n <PopoverBody>\n <Text size=\"sm\">Approves credit limits above $25,000.</Text>\n </PopoverBody>\n <PopoverFooter>\n <Button size=\"sm\">Send message</Button>\n </PopoverFooter>\n </HoverCardContent>\n </HoverCard>\n .\n </Text>\n );\n}\n",
230
+ "verdict": "example"
231
231
  },
232
232
  {
233
233
  "id": "delay",
@@ -240,10 +240,10 @@
240
240
  {
241
241
  "id": "shared",
242
242
  "title": "One card, many mentions",
243
- "note": "A thread with four handles and one HoverCard around all of them. The mention the pointer rests on registers itself as the anchor, and the request carries the event whose currentTarget names the person, so the card fills from one state instead of mounting four.",
243
+ "note": "A thread with four handles and one HoverCard around all of them. The mention the pointer rests on registers itself as the anchor, and the request carries the event whose target sits inside the mention that names the person, so the card fills from one state instead of mounting four.",
244
244
  "language": "tsx",
245
- "source": "const [handle, setHandle] = useState<string | null>(null);\n\n<HoverCard\n onOpenChange={(open, request) => {\n const target = (request.source as Event | undefined)?.currentTarget;\n if (open && target instanceof HTMLElement) setHandle(target.dataset['handle'] ?? null);\n }}\n>\n <p>\n <HoverCardTrigger data-handle=\"ana.souza\" href=\"/people/ana\">\n @ana.souza\n </HoverCardTrigger>{' '}\n and{' '}\n <HoverCardTrigger data-handle=\"marcus.lee\" href=\"/people/marcus\">\n @marcus.lee\n </HoverCardTrigger>\n </p>\n <HoverCardContent>{people[handle]}</HoverCardContent>\n</HoverCard>;\n",
246
- "verdict": "excerpt"
245
+ "source": "import { useState } from 'react';\n\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport type { HoverCardChangeRequest } from '@slotted/react/hover-card';\nimport {\n PopoverBody,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n} from '@slotted/react/popover';\nimport { Text } from '@slotted/react/typography';\n\ninterface Person {\n handle: string;\n name: string;\n role: string;\n}\n\nconst nancy: Person = {\n handle: 'nancy.davolio',\n name: 'Nancy Davolio',\n role: 'Sales Representative, Seattle',\n};\nconst andrew: Person = {\n handle: 'andrew.fuller',\n name: 'Andrew Fuller',\n role: 'Vice President, Sales',\n};\nconst janet: Person = {\n handle: 'janet.leverling',\n name: 'Janet Leverling',\n role: 'Sales Representative, Kirkland',\n};\nconst people = [nancy, andrew, janet];\n\nexport default function HoverCardShared() {\n const [person, setPerson] = useState(nancy);\n\n function handleOpenChange(open: boolean, request: HoverCardChangeRequest) {\n const target = request.source instanceof Event ? request.source.target : null;\n const trigger = target instanceof Element ? target.closest<HTMLElement>('[data-handle]') : null;\n if (!open || trigger === null) return;\n\n const next = people.find((candidate) => candidate.handle === trigger.dataset['handle']);\n if (next !== undefined) setPerson(next);\n }\n\n return (\n <HoverCard onOpenChange={handleOpenChange}>\n <Text>\n The pricing table was drafted by{' '}\n <HoverCardTrigger data-handle={nancy.handle} href=\"/people/nancy.davolio\">\n @nancy.davolio\n </HoverCardTrigger>\n , approved by{' '}\n <HoverCardTrigger data-handle={andrew.handle} href=\"/people/andrew.fuller\">\n @andrew.fuller\n </HoverCardTrigger>{' '}\n and handed to{' '}\n <HoverCardTrigger data-handle={janet.handle} href=\"/people/janet.leverling\">\n @janet.leverling\n </HoverCardTrigger>{' '}\n for the carrier terms.\n </Text>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>{person.name}</PopoverTitle>\n <PopoverDescription>{person.role}</PopoverDescription>\n </PopoverHeader>\n <PopoverBody>\n <Text size=\"sm\">@{person.handle}</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n );\n}\n",
246
+ "verdict": "example"
247
247
  },
248
248
  {
249
249
  "id": "touch",
@@ -256,7 +256,7 @@
256
256
  {
257
257
  "id": "composition",
258
258
  "title": "On another family’s link",
259
- "note": "The trigger rendered onto Link: the link keeps its own paint and its identity, and takes only the state and the listeners from this family. The Close part inside the card is the popover’s, and it is what a touch reader has in place of Escape.",
259
+ "note": "The trigger rendered onto Link: the link keeps its own paint and its identity, and takes only the state and the listeners from the hover card. The Close part inside the card is the popover’s, and it is what a touch reader has in place of Escape.",
260
260
  "language": "tsx",
261
261
  "source": "<HoverCard>\n <HoverCardTrigger href=\"/people/ana\" render={(props) => <Link {...props} variant=\"neutral\" />}>\n Ana Souza\n </HoverCardTrigger>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>Ana Souza</PopoverTitle>\n <PopoverClose />\n </PopoverHeader>\n </HoverCardContent>\n</HoverCard>;\n",
262
262
  "verdict": "excerpt"
@@ -268,6 +268,54 @@
268
268
  "language": "tsx",
269
269
  "source": "<HoverCard onOpenChange={(open, request) => log(request.reason)}>\n <HoverCardTrigger href=\"/people/ana\">@ana.souza</HoverCardTrigger>\n <HoverCardContent>…</HoverCardContent>\n</HoverCard>;\n",
270
270
  "verdict": "excerpt"
271
+ },
272
+ {
273
+ "id": "basic",
274
+ "title": "basic.tsx",
275
+ "note": null,
276
+ "language": "tsx",
277
+ "source": "import { Avatar } from '@slotted/react/avatar';\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport { Inline } from '@slotted/react/inline';\nimport { PopoverBody } from '@slotted/react/popover';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardBasic() {\n return (\n <Text>\n The pricing table is ready for review. Ask{' '}\n <HoverCard>\n <HoverCardTrigger href=\"/people/nancy.davolio\">@nancy.davolio</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Inline align=\"center\" gap={3}>\n <Avatar name=\"Nancy Davolio\" />\n <Stack gap={1}>\n <Text weight=\"semibold\">Nancy Davolio</Text>\n <Text size=\"sm\" tone=\"muted\">\n Sales Representative, Seattle\n </Text>\n </Stack>\n </Inline>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>{' '}\n about the carrier rates.\n </Text>\n );\n}\n",
278
+ "verdict": "example"
279
+ },
280
+ {
281
+ "id": "controlled",
282
+ "title": "controlled.tsx",
283
+ "note": null,
284
+ "language": "tsx",
285
+ "source": "import { useState } from 'react';\n\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport type { HoverCardChangeRequest } from '@slotted/react/hover-card';\nimport {\n PopoverBody,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n} from '@slotted/react/popover';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardControlled() {\n const [open, setOpen] = useState(false);\n const [reason, setReason] = useState('none');\n\n function handleOpenChange(next: boolean, request: HoverCardChangeRequest) {\n setOpen(next);\n setReason(request.reason);\n }\n\n return (\n <Stack gap={3}>\n <Text>\n Stock for order 10251 ships from the{' '}\n <HoverCard open={open} onOpenChange={handleOpenChange}>\n <HoverCardTrigger href=\"/warehouses/seattle\">Seattle warehouse</HoverCardTrigger>\n <HoverCardContent>\n <PopoverHeader>\n <PopoverTitle>Seattle warehouse</PopoverTitle>\n <PopoverDescription>400 Pine Street, Dock 3</PopoverDescription>\n </PopoverHeader>\n <PopoverBody>\n <Text size=\"sm\">Pickups close at 4:30 PM, Monday to Friday.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n .\n </Text>\n <Text size=\"sm\" tone=\"muted\">\n Card {open ? 'open' : 'closed'}. Last request: {reason}.\n </Text>\n </Stack>\n );\n}\n",
286
+ "verdict": "example"
287
+ },
288
+ {
289
+ "id": "defaults",
290
+ "title": "defaults.tsx",
291
+ "note": null,
292
+ "language": "tsx",
293
+ "source": "import {\n HoverCard,\n HoverCardContent,\n HoverCardDefaultsProvider,\n HoverCardTrigger,\n} from '@slotted/react/hover-card';\nimport { PopoverBody } from '@slotted/react/popover';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardDefaults() {\n return (\n <HoverCardDefaultsProvider openDelay={200} closeDelay={200}>\n <Text>\n Escalate to{' '}\n <HoverCard>\n <HoverCardTrigger href=\"/people/steven.buchanan\">@steven.buchanan</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">Steven Buchanan, Sales Manager, London.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>{' '}\n or, for returns, to{' '}\n <HoverCard closeDelay={1000}>\n <HoverCardTrigger href=\"/people/margaret.peacock\">@margaret.peacock</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">Margaret Peacock, Sales Representative, Redmond.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n .\n </Text>\n </HoverCardDefaultsProvider>\n );\n}\n",
294
+ "verdict": "example"
295
+ },
296
+ {
297
+ "id": "delays",
298
+ "title": "delays.tsx",
299
+ "note": null,
300
+ "language": "tsx",
301
+ "source": "import { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport { PopoverBody } from '@slotted/react/popover';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardDelays() {\n return (\n <Stack gap={4}>\n <Text>\n Default delays, 600 ms to open and 300 ms to close:{' '}\n <HoverCard>\n <HoverCardTrigger href=\"/orders/10248\">Order 10248</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">Vins et alcools Chevalier, $440.00, shipped Jul 16.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n </Text>\n <Text>\n Immediate open, closes after 1 second:{' '}\n <HoverCard openDelay={0} closeDelay={1000}>\n <HoverCardTrigger href=\"/orders/10249\">Order 10249</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">Toms Spezialitäten, $1,863.40, shipped Jul 10.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n </Text>\n </Stack>\n );\n}\n",
302
+ "verdict": "example"
303
+ },
304
+ {
305
+ "id": "disabled",
306
+ "title": "disabled.tsx",
307
+ "note": null,
308
+ "language": "tsx",
309
+ "source": "import { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport { PopoverBody } from '@slotted/react/popover';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardDisabled() {\n return (\n <Text>\n Territory handoff from{' '}\n <HoverCard>\n <HoverCardTrigger href=\"/people/nancy.davolio\">@nancy.davolio</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">Nancy Davolio, Sales Representative, Seattle.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>{' '}\n to{' '}\n <HoverCard disabled>\n <HoverCardTrigger href=\"/people/robert.king\">@robert.king</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">Robert King, Sales Representative, London.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n , whose profile is archived.\n </Text>\n );\n}\n",
310
+ "verdict": "example"
311
+ },
312
+ {
313
+ "id": "placement",
314
+ "title": "placement.tsx",
315
+ "note": null,
316
+ "language": "tsx",
317
+ "source": "import { HoverCard, HoverCardContent, HoverCardTrigger } from '@slotted/react/hover-card';\nimport { PopoverBody } from '@slotted/react/popover';\nimport { Text } from '@slotted/react/typography';\n\nexport default function HoverCardPlacement() {\n return (\n <Text>\n Reorder{' '}\n <HoverCard side=\"top\" align=\"center\">\n <HoverCardTrigger href=\"/products/1001\">Chai</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">NW-1001, 39 units on hand.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>\n ,{' '}\n <HoverCard>\n <HoverCardTrigger href=\"/products/1002\">Chang</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">NW-1002, 17 units on hand.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>{' '}\n and{' '}\n <HoverCard side=\"inline-end\" align=\"center\">\n <HoverCardTrigger href=\"/products/1003\">Aniseed Syrup</HoverCardTrigger>\n <HoverCardContent>\n <PopoverBody>\n <Text size=\"sm\">NW-1003, 13 units on hand.</Text>\n </PopoverBody>\n </HoverCardContent>\n </HoverCard>{' '}\n before Friday.\n </Text>\n );\n}\n",
318
+ "verdict": "example"
271
319
  }
272
320
  ]
273
321
  }