@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
- package/dist/app-shell.js +1 -1
- package/dist/attachment-TZykYNu5.js +300 -0
- package/dist/attachment.js +2 -2
- package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
- package/dist/avatar-group.js +1 -1
- package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
- package/dist/command-palette.js +1 -1
- package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
- package/dist/data-list.js +1 -1
- package/dist/detail-panel-Cke3ZFU3.js +342 -0
- package/dist/detail-panel.js +2 -2
- package/dist/docs/action-bar.examples.md +768 -0
- package/dist/docs/action-bar.json +74 -50
- package/dist/docs/action-bar.md +49 -311
- package/dist/docs/app-shell.examples.md +1221 -64
- package/dist/docs/app-shell.json +92 -60
- package/dist/docs/app-shell.md +92 -57
- package/dist/docs/attachment.examples.md +689 -0
- package/dist/docs/attachment.json +69 -37
- package/dist/docs/attachment.md +44 -203
- package/dist/docs/avatar-group.json +111 -23
- package/dist/docs/avatar-group.md +487 -28
- package/dist/docs/button-group.json +98 -2
- package/dist/docs/button-group.md +411 -8
- package/dist/docs/calendar.examples.md +512 -0
- package/dist/docs/calendar.json +72 -24
- package/dist/docs/calendar.md +18 -147
- package/dist/docs/carousel.examples.md +868 -0
- package/dist/docs/carousel.json +58 -50
- package/dist/docs/carousel.md +66 -300
- package/dist/docs/cascader.examples.md +1269 -0
- package/dist/docs/cascader.json +72 -16
- package/dist/docs/cascader.md +78 -154
- package/dist/docs/chart.examples.md +734 -24
- package/dist/docs/chart.json +93 -13
- package/dist/docs/chart.md +28 -7
- package/dist/docs/clock.json +71 -15
- package/dist/docs/clock.md +326 -21
- package/dist/docs/code-block.json +79 -55
- package/dist/docs/code-block.md +417 -74
- package/dist/docs/color-picker.json +60 -12
- package/dist/docs/color-picker.md +245 -22
- package/dist/docs/column-manager.examples.md +764 -0
- package/dist/docs/column-manager.json +68 -12
- package/dist/docs/column-manager.md +44 -203
- package/dist/docs/command-palette.examples.md +747 -0
- package/dist/docs/command-palette.json +48 -24
- package/dist/docs/command-palette.md +60 -339
- package/dist/docs/currency-field.examples.md +355 -73
- package/dist/docs/currency-field.json +96 -64
- package/dist/docs/currency-field.md +57 -50
- package/dist/docs/dashboard-grid.examples.md +629 -0
- package/dist/docs/dashboard-grid.json +64 -16
- package/dist/docs/dashboard-grid.md +34 -152
- package/dist/docs/data-list.examples.md +1556 -0
- package/dist/docs/data-list.json +58 -18
- package/dist/docs/data-list.md +139 -224
- package/dist/docs/date-field.examples.md +543 -0
- package/dist/docs/date-field.json +64 -24
- package/dist/docs/date-field.md +22 -168
- package/dist/docs/datetime-field.examples.md +699 -0
- package/dist/docs/datetime-field.json +79 -31
- package/dist/docs/datetime-field.md +24 -269
- package/dist/docs/datetime-range-picker.examples.md +682 -0
- package/dist/docs/datetime-range-picker.json +117 -61
- package/dist/docs/datetime-range-picker.md +59 -224
- package/dist/docs/description-list.examples.md +652 -0
- package/dist/docs/description-list.json +49 -25
- package/dist/docs/description-list.md +33 -188
- package/dist/docs/detail-panel.examples.md +1177 -0
- package/dist/docs/detail-panel.json +69 -53
- package/dist/docs/detail-panel.md +114 -324
- package/dist/docs/entity-picker.examples.md +1037 -0
- package/dist/docs/entity-picker.json +66 -18
- package/dist/docs/entity-picker.md +56 -246
- package/dist/docs/event-calendar.examples.md +749 -49
- package/dist/docs/event-calendar.json +46 -22
- package/dist/docs/event-calendar.md +81 -11
- package/dist/docs/field-group.examples.md +554 -0
- package/dist/docs/field-group.json +98 -34
- package/dist/docs/field-group.md +55 -133
- package/dist/docs/filter-bar.examples.md +772 -0
- package/dist/docs/filter-bar.json +41 -25
- package/dist/docs/filter-bar.md +42 -246
- package/dist/docs/form.examples.md +579 -0
- package/dist/docs/form.json +87 -39
- package/dist/docs/form.md +53 -177
- package/dist/docs/fullscreen.examples.md +558 -0
- package/dist/docs/fullscreen.json +58 -18
- package/dist/docs/fullscreen.md +50 -169
- package/dist/docs/highlight.json +57 -25
- package/dist/docs/highlight.md +402 -50
- package/dist/docs/icon.json +85 -5
- package/dist/docs/icon.md +401 -10
- package/dist/docs/image.examples.md +670 -0
- package/dist/docs/image.json +44 -28
- package/dist/docs/image.md +24 -176
- package/dist/docs/import-export-center.examples.md +1280 -0
- package/dist/docs/import-export-center.json +67 -27
- package/dist/docs/import-export-center.md +121 -226
- package/dist/docs/list-item.examples.md +769 -0
- package/dist/docs/list-item.json +110 -38
- package/dist/docs/list-item.md +84 -201
- package/dist/docs/listbox.examples.md +858 -0
- package/dist/docs/listbox.json +76 -28
- package/dist/docs/listbox.md +41 -263
- package/dist/docs/markdown.json +79 -55
- package/dist/docs/markdown.md +581 -85
- package/dist/docs/media-viewer.examples.md +1038 -0
- package/dist/docs/media-viewer.json +70 -15
- package/dist/docs/media-viewer.md +84 -135
- package/dist/docs/message-scroller.examples.md +1193 -0
- package/dist/docs/message-scroller.json +41 -17
- package/dist/docs/message-scroller.md +80 -134
- package/dist/docs/message.examples.md +944 -0
- package/dist/docs/message.json +64 -16
- package/dist/docs/message.md +34 -326
- package/dist/docs/meter.json +58 -26
- package/dist/docs/meter.md +312 -32
- package/dist/docs/navigation-menu.examples.md +1107 -0
- package/dist/docs/navigation-menu.json +57 -41
- package/dist/docs/navigation-menu.md +105 -298
- package/dist/docs/notification-center.examples.md +1045 -0
- package/dist/docs/notification-center.json +71 -15
- package/dist/docs/notification-center.md +76 -266
- package/dist/docs/otp-input.examples.md +490 -0
- package/dist/docs/otp-input.json +65 -25
- package/dist/docs/otp-input.md +20 -191
- package/dist/docs/page-header.examples.md +1041 -0
- package/dist/docs/page-header.json +75 -43
- package/dist/docs/page-header.md +79 -291
- package/dist/docs/page.examples.md +633 -0
- package/dist/docs/page.json +48 -16
- package/dist/docs/page.md +62 -129
- package/dist/docs/prompt-composer.examples.md +630 -0
- package/dist/docs/prompt-composer.json +66 -18
- package/dist/docs/prompt-composer.md +35 -161
- package/dist/docs/prose.json +69 -37
- package/dist/docs/prose.md +393 -75
- package/dist/docs/rating.examples.md +525 -0
- package/dist/docs/rating.json +92 -28
- package/dist/docs/rating.md +27 -241
- package/dist/docs/saved-views.examples.md +1108 -0
- package/dist/docs/saved-views.json +53 -21
- package/dist/docs/saved-views.md +86 -171
- package/dist/docs/scroll-area.examples.md +837 -0
- package/dist/docs/scroll-area.json +64 -24
- package/dist/docs/scroll-area.md +57 -140
- package/dist/docs/section.examples.md +676 -0
- package/dist/docs/section.json +68 -20
- package/dist/docs/section.md +39 -162
- package/dist/docs/segmented-control.examples.md +480 -0
- package/dist/docs/segmented-control.json +76 -28
- package/dist/docs/segmented-control.md +20 -191
- package/dist/docs/side-navigation.examples.md +1468 -0
- package/dist/docs/side-navigation.json +53 -53
- package/dist/docs/side-navigation.md +79 -354
- package/dist/docs/slider.examples.md +505 -0
- package/dist/docs/slider.json +91 -51
- package/dist/docs/slider.md +47 -212
- package/dist/docs/sparkline.json +60 -36
- package/dist/docs/sparkline.md +447 -71
- package/dist/docs/split-button.examples.md +509 -0
- package/dist/docs/split-button.json +73 -41
- package/dist/docs/split-button.md +64 -194
- package/dist/docs/splitter.examples.md +921 -0
- package/dist/docs/splitter.json +94 -46
- package/dist/docs/splitter.md +75 -182
- package/dist/docs/stat-card.examples.md +725 -0
- package/dist/docs/stat-card.json +89 -41
- package/dist/docs/stat-card.md +55 -227
- package/dist/docs/status-indicator.json +80 -32
- package/dist/docs/status-indicator.md +409 -65
- package/dist/docs/stepper.json +53 -21
- package/dist/docs/stepper.md +369 -48
- package/dist/docs/table-of-contents.examples.md +550 -0
- package/dist/docs/table-of-contents.json +60 -28
- package/dist/docs/table-of-contents.md +70 -205
- package/dist/docs/tags-input.examples.md +541 -0
- package/dist/docs/tags-input.json +64 -16
- package/dist/docs/tags-input.md +15 -262
- package/dist/docs/time-field.examples.md +587 -0
- package/dist/docs/time-field.json +69 -29
- package/dist/docs/time-field.md +21 -223
- package/dist/docs/time-picker.json +117 -53
- package/dist/docs/time-picker.md +499 -54
- package/dist/docs/time-range-picker.examples.md +750 -0
- package/dist/docs/time-range-picker.json +139 -75
- package/dist/docs/time-range-picker.md +63 -225
- package/dist/docs/timeline.examples.md +617 -0
- package/dist/docs/timeline.json +44 -28
- package/dist/docs/timeline.md +34 -208
- package/dist/docs/toolbar.json +56 -16
- package/dist/docs/toolbar.md +357 -63
- package/dist/docs/top-navigation.examples.md +1206 -140
- package/dist/docs/top-navigation.json +49 -33
- package/dist/docs/top-navigation.md +87 -36
- package/dist/docs/tour.examples.md +960 -0
- package/dist/docs/tour.json +57 -25
- package/dist/docs/tour.md +60 -244
- package/dist/docs/transfer.examples.md +631 -0
- package/dist/docs/transfer.json +80 -16
- package/dist/docs/transfer.md +41 -170
- package/dist/docs/typography.json +96 -0
- package/dist/docs/typography.md +352 -4
- package/dist/docs/upload.examples.md +555 -53
- package/dist/docs/upload.json +62 -30
- package/dist/docs/upload.md +46 -11
- package/dist/docs/wizard.examples.md +1389 -0
- package/dist/docs/wizard.json +89 -49
- package/dist/docs/wizard.md +122 -263
- package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +58 -58
- package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
- package/dist/media-viewer.js +2 -2
- package/dist/message-P91bEGyV.js +455 -0
- package/dist/message.js +2 -2
- package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
- package/dist/page-header.js +1 -1
- package/dist/section-CVTQdWBl.js +216 -0
- package/dist/section.js +2 -2
- package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
- package/dist/side-navigation.js +1 -1
- package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
- package/dist/stat-card.js +1 -1
- package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
- package/dist/stepper.js +2 -2
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
- package/dist/timeline.js +1 -1
- package/dist/top-navigation-YSEQzBhD.js +744 -0
- package/dist/top-navigation.js +2 -2
- package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
- package/dist/transfer.js +1 -1
- package/dist/types/attachment/attachment-parts.d.ts +24 -11
- package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
- package/dist/types/attachment/attachment.d.ts +3 -3
- package/dist/types/attachment/attachment.d.ts.map +1 -1
- package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/types/carousel/carousel-parts.d.ts +2 -2
- package/dist/types/command-palette/command-palette.d.ts.map +1 -1
- package/dist/types/data-list/data-list.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
- package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
- package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
- package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
- package/dist/types/media-viewer/index.d.ts +2 -2
- package/dist/types/media-viewer/index.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
- package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
- package/dist/types/message/message-parts.d.ts +7 -0
- package/dist/types/message/message-parts.d.ts.map +1 -1
- package/dist/types/message/message.d.ts.map +1 -1
- package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
- package/dist/types/section/section-parts.d.ts +16 -8
- package/dist/types/section/section-parts.d.ts.map +1 -1
- package/dist/types/section/section.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
- package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper-parts.d.ts +11 -2
- package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper.d.ts.map +1 -1
- package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
- package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
- package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
- package/dist/wizard.js +1 -1
- package/package.json +6 -6
- package/dist/attachment-MqczA38F.js +0 -292
- package/dist/detail-panel-EImAtksY.js +0 -327
- package/dist/message-D1Dd6Y2k.js +0 -452
- package/dist/section-D_qOfdxR.js +0 -213
- package/dist/top-navigation-D8IHPOmm.js +0 -744
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"type": "ReactNode | (fullscreen: boolean) => ReactNode",
|
|
171
171
|
"defaultValue": "maximize / minimize",
|
|
172
172
|
"appliesTo": "FullscreenTrigger",
|
|
173
|
-
"description": "A mark in place of the
|
|
173
|
+
"description": "A mark in place of the default one"
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
"name": "disabled",
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
"type": "(props) => ReactNode",
|
|
215
215
|
"defaultValue": "—",
|
|
216
216
|
"appliesTo": "Fullscreen, FullscreenTrigger",
|
|
217
|
-
"description": "Substitutes the element and hands it every attribute and the ref callback
|
|
217
|
+
"description": "Substitutes the element and hands it every attribute and the ref callback Fullscreen was going to write"
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
220
|
"name": "ref",
|
|
@@ -252,12 +252,12 @@
|
|
|
252
252
|
{
|
|
253
253
|
"name": "onClick",
|
|
254
254
|
"payload": "the button’s own event",
|
|
255
|
-
"when": "On the control, before
|
|
255
|
+
"when": "On the control, before Fullscreen acts. preventDefault() refuses the press."
|
|
256
256
|
}
|
|
257
257
|
],
|
|
258
258
|
"accessibility": [
|
|
259
259
|
"The control is a native button whose label says what the press does next, so it carries no aria-pressed: the APG Button pattern (w3.org/WAI/ARIA/apg/patterns/button/) keeps aria-pressed for a toggle whose label does not change. A screen reader hears “Full screen, button” and then “Exit full screen, button”.",
|
|
260
|
-
"Escape in native full screen belongs to the browser, and
|
|
260
|
+
"Escape in native full screen belongs to the browser, and Fullscreen writes no listener for it; the specification makes it leave before any close watcher. In the layout, Escape asks through the one layer stack, so a list opened inside closes first.",
|
|
261
261
|
"While the region is full screen, Tab wraps inside it: what is outside is not painted, and a focus there would be invisible. On the way out, focus returns to the element that held it when it came from outside, and the page’s and the region’s scroll return to where they were.",
|
|
262
262
|
"Entering is announced politely with how to leave (“Full screen. Press Escape to exit.”), and leaving is announced too; the layout does not make the page inert, because an inert page would silence that announcement. The cost is that a screen reader’s virtual cursor can reach the covered page."
|
|
263
263
|
]
|
|
@@ -327,8 +327,8 @@
|
|
|
327
327
|
"title": "Inside the page, where the browser will not",
|
|
328
328
|
"note": "mode=\"layout\" never asks the browser: the region is fixed over the page, the page behind stops scrolling, and Escape leaves. It is the picture an iframe without allow=\"fullscreen\" or a phone browser gets under the default mode too.",
|
|
329
329
|
"language": "tsx",
|
|
330
|
-
"source": "<Fullscreen mode=\"layout\">\n
|
|
331
|
-
"verdict": "
|
|
330
|
+
"source": "import { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function FullscreenLayoutExample() {\n return (\n <Fullscreen mode=\"layout\">\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Supply agreement\n </Heading>\n <FullscreenTrigger />\n </Inline>\n </CardHeader>\n <CardBody>\n <Stack gap={3}>\n <Text>\n 4.1 Delivery. Meridian Packaging delivers pallets to the Rotterdam warehouse every\n Tuesday and Friday before 14:00.\n </Text>\n <Text>\n 4.2 Payment. Northwind settles each invoice 30 days after the delivery date.\n </Text>\n <Text>4.3 Returns. Damaged pallets are collected within 5 working days.</Text>\n </Stack>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
331
|
+
"verdict": "example"
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
334
|
"id": "fill",
|
|
@@ -343,24 +343,24 @@
|
|
|
343
343
|
"title": "The page holds the state",
|
|
344
344
|
"note": "The page owns fullscreen and every change arrives as a request with its reason: pointer or keyboard from the control, escape when the reader left on their own. The log under the panel prints each one.",
|
|
345
345
|
"language": "tsx",
|
|
346
|
-
"source": "const [presenting, setPresenting] = useState(false);\n
|
|
347
|
-
"verdict": "
|
|
346
|
+
"source": "import { useState } from 'react';\n\nimport { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport type { FullscreenChangeRequest } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function FullscreenControlledExample() {\n const [presenting, setPresenting] = useState(false);\n const [reason, setReason] = useState('none yet');\n\n function handleChange(next: boolean, request: FullscreenChangeRequest) {\n setReason(request.reason);\n setPresenting(next);\n }\n\n return (\n <Fullscreen fullscreen={presenting} onFullscreenChange={handleChange}>\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Cold storage\n </Heading>\n <FullscreenTrigger />\n </Inline>\n </CardHeader>\n <CardBody>\n <Stack gap={2}>\n <Text>Full screen: {presenting ? 'on' : 'off'}</Text>\n <Text>Last request: {reason}</Text>\n </Stack>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
347
|
+
"verdict": "example"
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
"id": "error",
|
|
351
351
|
"title": "Refused, and still full screen",
|
|
352
|
-
"note": "When the browser has no API or refuses, the region enters the layout and onFullscreenError says why — unsupported or refused. The panel prints the last error. A page that prefers
|
|
352
|
+
"note": "When the browser has no API or refuses, the region enters the layout and onFullscreenError says why — unsupported or refused. The panel prints the last error. A controlled page that prefers no layout fallback sets the state back to false from the same handler.",
|
|
353
353
|
"language": "tsx",
|
|
354
|
-
"source": "
|
|
355
|
-
"verdict": "
|
|
354
|
+
"source": "import { useState } from 'react';\n\nimport { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport type { FullscreenError } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Heading, Text } from '@slotted/react/typography';\n\nexport default function FullscreenErrorExample() {\n const [failure, setFailure] = useState<FullscreenError | null>(null);\n\n function handleError(error: FullscreenError) {\n setFailure(error);\n }\n\n return (\n <Fullscreen onFullscreenError={handleError}>\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Warehouse floor plan\n </Heading>\n <FullscreenTrigger />\n </Inline>\n </CardHeader>\n <CardBody>\n <Text>Last error: {failure?.kind ?? 'none'}</Text>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
355
|
+
"verdict": "example"
|
|
356
356
|
},
|
|
357
357
|
{
|
|
358
358
|
"id": "overlays",
|
|
359
359
|
"title": "A menu opened from inside",
|
|
360
360
|
"note": "The select in the panel opens its list inside the region while it is full screen: the portal root follows the element the browser shows. Escape in the layout closes the list first and the region on the second press.",
|
|
361
361
|
"language": "tsx",
|
|
362
|
-
"source": "<Fullscreen>\n
|
|
363
|
-
"verdict": "
|
|
362
|
+
"source": "import { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport {\n Select,\n SelectContent,\n SelectItem,\n type SelectOption,\n SelectTrigger,\n SelectValue,\n} from '@slotted/react/select';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst PERIODS: SelectOption[] = [\n { value: '30d', label: 'Last 30 days' },\n { value: '90d', label: 'Last 90 days' },\n { value: 'ytd', label: 'Year to date' },\n];\n\nexport default function FullscreenOverlaysExample() {\n return (\n <Fullscreen>\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Open purchase orders\n </Heading>\n <FullscreenTrigger />\n </Inline>\n </CardHeader>\n <CardBody>\n <Stack gap={3}>\n <Select defaultValue=\"90d\" items={PERIODS}>\n <SelectTrigger aria-label=\"Period\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {PERIODS.map((period) => (\n <SelectItem key={period.value} value={period.value}>\n {period.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <Text>38 orders waiting for a delivery date.</Text>\n </Stack>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
363
|
+
"verdict": "example"
|
|
364
364
|
},
|
|
365
365
|
{
|
|
366
366
|
"id": "document",
|
|
@@ -373,7 +373,7 @@
|
|
|
373
373
|
{
|
|
374
374
|
"id": "keyboard",
|
|
375
375
|
"title": "The keyboard, key by key",
|
|
376
|
-
"note": "Tab reaches the control, Space or Enter presses it and the reason says keyboard. While full screen, Tab wraps inside the region. Escape in native full screen belongs to the browser —
|
|
376
|
+
"note": "Tab reaches the control, Space or Enter presses it and the reason says keyboard. While full screen, Tab wraps inside the region. Escape in native full screen belongs to the browser — Fullscreen writes no listener and reports the leave as escape.",
|
|
377
377
|
"language": "tsx",
|
|
378
378
|
"source": "<Fullscreen onFullscreenChange={(next, request) => log(request.reason)}>\n <FullscreenTrigger />\n</Fullscreen>;\n",
|
|
379
379
|
"verdict": "excerpt"
|
|
@@ -383,8 +383,8 @@
|
|
|
383
383
|
"title": "The control: two variants, three steps, every state",
|
|
384
384
|
"note": "ghost stands in a bar that is already framed, outline over content and carries its own ground. Each step reads the control scale, so the control lines up with a button of the same step. Disabled keeps the words legible and refuses the press.",
|
|
385
385
|
"language": "tsx",
|
|
386
|
-
"source": "<FullscreenTrigger size=\"sm\" variant=\"outline\"
|
|
387
|
-
"verdict": "
|
|
386
|
+
"source": "import { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FullscreenTriggerExample() {\n return (\n <Fullscreen>\n <Stack gap={3}>\n <Text size=\"sm\" tone=\"muted\">\n Ghost, steps sm, md and lg\n </Text>\n <Inline align=\"center\" gap={3}>\n <FullscreenTrigger size=\"sm\" />\n <FullscreenTrigger size=\"md\" />\n <FullscreenTrigger size=\"lg\" />\n </Inline>\n <Text size=\"sm\" tone=\"muted\">\n Outline, steps sm, md and lg\n </Text>\n <Inline align=\"center\" gap={3}>\n <FullscreenTrigger size=\"sm\" variant=\"outline\" />\n <FullscreenTrigger size=\"md\" variant=\"outline\" />\n <FullscreenTrigger size=\"lg\" variant=\"outline\" />\n </Inline>\n <Text size=\"sm\" tone=\"muted\">\n Disabled\n </Text>\n <Inline align=\"center\" gap={3}>\n <FullscreenTrigger disabled />\n </Inline>\n </Stack>\n </Fullscreen>\n );\n}\n",
|
|
387
|
+
"verdict": "example"
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
390
|
"id": "iconOnly",
|
|
@@ -405,10 +405,50 @@
|
|
|
405
405
|
{
|
|
406
406
|
"id": "composition",
|
|
407
407
|
"title": "Defaults once, words and mark of the consumer",
|
|
408
|
-
"note": "A provider sets the control’s step and variant for a subtree. children and icon take a function of the state, so a “Present” control keeps following it; render puts the wiring on the consumer’s own element.",
|
|
408
|
+
"note": "A provider sets the mode, the navigation interface, the control’s step and its variant for a subtree. children and icon take a function of the state, so a “Present” control keeps following it; render puts the wiring on the consumer’s own element.",
|
|
409
409
|
"language": "tsx",
|
|
410
|
-
"source": "<FullscreenDefaultsProvider size=\"sm\">\n <Fullscreen>\n <FullscreenTrigger
|
|
410
|
+
"source": "<FullscreenDefaultsProvider size=\"sm\">\n <Fullscreen>\n <FullscreenTrigger\n icon={(on) => (\n <Icon>\n <Glyph name={on ? 'x' : 'presentation'} />\n </Icon>\n )}\n >\n {(on) => (on ? 'End presentation' : 'Present')}\n </FullscreenTrigger>\n </Fullscreen>\n</FullscreenDefaultsProvider>;\n",
|
|
411
411
|
"verdict": "excerpt"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"id": "basic",
|
|
415
|
+
"title": "basic.tsx",
|
|
416
|
+
"note": null,
|
|
417
|
+
"language": "tsx",
|
|
418
|
+
"source": "import { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport {\n DescriptionList,\n DescriptionListDescription,\n DescriptionListItem,\n DescriptionListTerm,\n} from '@slotted/react/description-list';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Heading } from '@slotted/react/typography';\n\nconst REGIONS = [\n { term: 'Northern Europe', value: '€2.41M' },\n { term: 'DACH', value: '€1.76M' },\n { term: 'Iberia', value: '€1.18M' },\n { term: 'Nordics', value: '€0.94M' },\n];\n\nexport default function FullscreenBasicExample() {\n return (\n <Fullscreen>\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Revenue by region\n </Heading>\n <FullscreenTrigger />\n </Inline>\n </CardHeader>\n <CardBody>\n <DescriptionList>\n {REGIONS.map(({ term, value }) => (\n <DescriptionListItem key={term}>\n <DescriptionListTerm>{term}</DescriptionListTerm>\n <DescriptionListDescription>{value}</DescriptionListDescription>\n </DescriptionListItem>\n ))}\n </DescriptionList>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
419
|
+
"verdict": "example"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"id": "content",
|
|
423
|
+
"title": "content.tsx",
|
|
424
|
+
"note": null,
|
|
425
|
+
"language": "tsx",
|
|
426
|
+
"source": "import { Card, CardBody } from '@slotted/react/card';\nimport {\n DescriptionList,\n DescriptionListDescription,\n DescriptionListItem,\n DescriptionListTerm,\n} from '@slotted/react/description-list';\nimport { Fullscreen, FullscreenContent, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst REGIONS = [\n { term: 'Northern Europe', value: '€2.41M' },\n { term: 'DACH', value: '€1.76M' },\n { term: 'Iberia', value: '€1.18M' },\n { term: 'Nordics', value: '€0.94M' },\n];\n\nexport default function FullscreenContentExample() {\n return (\n <Fullscreen>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Q3 revenue by region\n </Heading>\n <FullscreenTrigger />\n </Inline>\n\n <FullscreenContent>\n <Card>\n <CardBody>\n <DescriptionList>\n {REGIONS.map(({ term, value }) => (\n <DescriptionListItem key={term}>\n <DescriptionListTerm>{term}</DescriptionListTerm>\n <DescriptionListDescription>{value}</DescriptionListDescription>\n </DescriptionListItem>\n ))}\n </DescriptionList>\n </CardBody>\n </Card>\n </FullscreenContent>\n\n <Text size=\"sm\" tone=\"muted\">\n Source: accounting close.\n </Text>\n </Fullscreen>\n );\n}\n",
|
|
427
|
+
"verdict": "example"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"id": "defaults",
|
|
431
|
+
"title": "defaults.tsx",
|
|
432
|
+
"note": null,
|
|
433
|
+
"language": "tsx",
|
|
434
|
+
"source": "import { Card, CardBody } from '@slotted/react/card';\nimport {\n Fullscreen,\n FullscreenDefaultsProvider,\n FullscreenTrigger,\n} from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nexport default function FullscreenDefaultsExample() {\n return (\n <FullscreenDefaultsProvider mode=\"layout\" size=\"sm\" variant=\"outline\">\n <Stack gap={3}>\n <Fullscreen>\n <Card>\n <CardBody>\n <Inline align=\"center\" justify=\"between\">\n <Text>Inbound dock</Text>\n <FullscreenTrigger />\n </Inline>\n </CardBody>\n </Card>\n </Fullscreen>\n\n <Fullscreen>\n <Card>\n <CardBody>\n <Inline align=\"center\" justify=\"between\">\n <Text>Outbound dock</Text>\n <FullscreenTrigger />\n </Inline>\n </CardBody>\n </Card>\n </Fullscreen>\n\n <Fullscreen>\n <Card>\n <CardBody>\n <Inline align=\"center\" justify=\"between\">\n <Text>Returns dock</Text>\n <FullscreenTrigger size=\"lg\" variant=\"ghost\" />\n </Inline>\n </CardBody>\n </Card>\n </Fullscreen>\n </Stack>\n </FullscreenDefaultsProvider>\n );\n}\n",
|
|
435
|
+
"verdict": "example"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"id": "icon-only",
|
|
439
|
+
"title": "icon-only.tsx",
|
|
440
|
+
"note": null,
|
|
441
|
+
"language": "tsx",
|
|
442
|
+
"source": "import { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport {\n DescriptionList,\n DescriptionListDescription,\n DescriptionListItem,\n DescriptionListTerm,\n} from '@slotted/react/description-list';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Inline } from '@slotted/react/inline';\nimport { Heading } from '@slotted/react/typography';\n\nconst DOCKS = [\n { term: 'Dock 1', value: 'Inbound, 06:00' },\n { term: 'Dock 2', value: 'Outbound, 08:30' },\n { term: 'Dock 3', value: 'Returns, 11:15' },\n];\n\nexport default function FullscreenIconOnlyExample() {\n return (\n <Fullscreen>\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Dock schedule\n </Heading>\n <FullscreenTrigger iconOnly variant=\"outline\" />\n </Inline>\n </CardHeader>\n <CardBody>\n <DescriptionList>\n {DOCKS.map(({ term, value }) => (\n <DescriptionListItem key={term}>\n <DescriptionListTerm>{term}</DescriptionListTerm>\n <DescriptionListDescription>{value}</DescriptionListDescription>\n </DescriptionListItem>\n ))}\n </DescriptionList>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
443
|
+
"verdict": "example"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"id": "words",
|
|
447
|
+
"title": "words.tsx",
|
|
448
|
+
"note": null,
|
|
449
|
+
"language": "tsx",
|
|
450
|
+
"source": "import { Card, CardBody, CardHeader } from '@slotted/react/card';\nimport { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';\nimport { Glyph, Icon } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst MESSAGES = {\n enter: 'Present',\n entered: 'Presenting. Press Escape to exit.',\n exit: 'End presentation',\n exited: 'Presentation ended.',\n};\n\nexport default function FullscreenWordsExample() {\n return (\n <Fullscreen messages={MESSAGES}>\n <Card>\n <CardHeader>\n <Inline align=\"center\" justify=\"between\">\n <Heading level={2} size=\"md\">\n Quarterly inventory review\n </Heading>\n <FullscreenTrigger\n icon={(on) => (\n <Icon>\n <Glyph name={on ? 'x' : 'presentation'} />\n </Icon>\n )}\n variant=\"outline\"\n />\n </Inline>\n </CardHeader>\n <CardBody>\n <Text>Stock value fell 3.2% against the second quarter.</Text>\n </CardBody>\n </Card>\n </Fullscreen>\n );\n}\n",
|
|
451
|
+
"verdict": "example"
|
|
412
452
|
}
|
|
413
453
|
]
|
|
414
454
|
}
|
package/dist/docs/fullscreen.md
CHANGED
|
@@ -11,14 +11,53 @@ import { Fullscreen, FullscreenContent, FullscreenTrigger, FullscreenDefaultsPro
|
|
|
11
11
|
|
|
12
12
|
## Minimal example
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Example
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
import { Card, CardBody, CardHeader } from '@slotted/react/card';
|
|
18
|
+
import {
|
|
19
|
+
DescriptionList,
|
|
20
|
+
DescriptionListDescription,
|
|
21
|
+
DescriptionListItem,
|
|
22
|
+
DescriptionListTerm,
|
|
23
|
+
} from '@slotted/react/description-list';
|
|
24
|
+
import { Fullscreen, FullscreenTrigger } from '@slotted/react/fullscreen';
|
|
25
|
+
import { Inline } from '@slotted/react/inline';
|
|
26
|
+
import { Heading } from '@slotted/react/typography';
|
|
27
|
+
|
|
28
|
+
const REGIONS = [
|
|
29
|
+
{ term: 'Northern Europe', value: '€2.41M' },
|
|
30
|
+
{ term: 'DACH', value: '€1.76M' },
|
|
31
|
+
{ term: 'Iberia', value: '€1.18M' },
|
|
32
|
+
{ term: 'Nordics', value: '€0.94M' },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export default function FullscreenBasicExample() {
|
|
36
|
+
return (
|
|
37
|
+
<Fullscreen>
|
|
38
|
+
<Card>
|
|
39
|
+
<CardHeader>
|
|
40
|
+
<Inline align="center" justify="between">
|
|
41
|
+
<Heading level={2} size="md">
|
|
42
|
+
Revenue by region
|
|
43
|
+
</Heading>
|
|
44
|
+
<FullscreenTrigger />
|
|
45
|
+
</Inline>
|
|
46
|
+
</CardHeader>
|
|
47
|
+
<CardBody>
|
|
48
|
+
<DescriptionList>
|
|
49
|
+
{REGIONS.map(({ term, value }) => (
|
|
50
|
+
<DescriptionListItem key={term}>
|
|
51
|
+
<DescriptionListTerm>{term}</DescriptionListTerm>
|
|
52
|
+
<DescriptionListDescription>{value}</DescriptionListDescription>
|
|
53
|
+
</DescriptionListItem>
|
|
54
|
+
))}
|
|
55
|
+
</DescriptionList>
|
|
56
|
+
</CardBody>
|
|
57
|
+
</Card>
|
|
58
|
+
</Fullscreen>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
22
61
|
```
|
|
23
62
|
|
|
24
63
|
## Anatomy
|
|
@@ -44,13 +83,13 @@ Excerpt — not a complete module
|
|
|
44
83
|
| `variant` | `'ghost' \| 'outline'` | ghost | FullscreenTrigger | ghost inside a framed bar; outline over content, with its own ground |
|
|
45
84
|
| `iconOnly` | `boolean` | false | FullscreenTrigger | The mark alone in a square; the words stay as the accessible name |
|
|
46
85
|
| `children` | `ReactNode \| (fullscreen: boolean) => ReactNode` | the message | FullscreenTrigger | Words in place of the message the state picks |
|
|
47
|
-
| `icon` | `ReactNode \| (fullscreen: boolean) => ReactNode` | maximize / minimize | FullscreenTrigger | A mark in place of the
|
|
86
|
+
| `icon` | `ReactNode \| (fullscreen: boolean) => ReactNode` | maximize / minimize | FullscreenTrigger | A mark in place of the default one |
|
|
48
87
|
| `disabled` | `boolean` | false | FullscreenTrigger | The native attribute; the press is refused |
|
|
49
88
|
| `type` | `'button' \| 'submit' \| 'reset'` | button | FullscreenTrigger | The native type; a button unless the consumer says otherwise |
|
|
50
89
|
| `target` | `FullscreenHandle` | the nearest Fullscreen | FullscreenTrigger | The handle of a region the control is not inside |
|
|
51
90
|
| `useFullscreen` | `(target, options) => FullscreenHandle` | — | any element | The state and the actions for any element: { fullscreen, mode, supported, error, enter, exit, toggle } |
|
|
52
91
|
| `FullscreenDefaultsProvider` | `{ mode, navigationUI, size, variant }` | — | a subtree | The decisions an application takes once; an instance still wins |
|
|
53
|
-
| `render` | `(props) => ReactNode` | — | Fullscreen, FullscreenTrigger | Substitutes the element and hands it every attribute and the ref callback
|
|
92
|
+
| `render` | `(props) => ReactNode` | — | Fullscreen, FullscreenTrigger | Substitutes the element and hands it every attribute and the ref callback Fullscreen was going to write |
|
|
54
93
|
| `ref` | `Ref<HTMLDivElement> / Ref<HTMLButtonElement>` | — | Fullscreen, FullscreenTrigger | The native elements |
|
|
55
94
|
| `FullscreenContent` | `ComponentPropsWithRef<'div'> & { render? }` | — | a direct child of Fullscreen | The part that takes the height in full screen; render substitutes its element |
|
|
56
95
|
| `useFullscreenContext` | `() => FullscreenHandle \| null` | — | inside Fullscreen | The handle for a consumer control of its own |
|
|
@@ -61,7 +100,7 @@ Excerpt — not a complete module
|
|
|
61
100
|
| --- | --- | --- |
|
|
62
101
|
| `onFullscreenChange` | `(fullscreen: boolean, request: ChangeRequest<boolean>)` | Before the state moves. The reason is pointer or keyboard from the control, programmatic from the handle, and escape when the reader left on their own — Escape in the layout, or the browser’s own exit in native, which has already happened by then. cancel() refuses it. |
|
|
63
102
|
| `onFullscreenError` | `({ kind: 'unsupported' \| 'refused', cause?: unknown })` | When the browser has no API or refuses the request. The region has already entered the layout and the state stays true. |
|
|
64
|
-
| `onClick` | `the button’s own event` | On the control, before
|
|
103
|
+
| `onClick` | `the button’s own event` | On the control, before Fullscreen acts. preventDefault() refuses the press. |
|
|
65
104
|
|
|
66
105
|
## Axes and defaults
|
|
67
106
|
|
|
@@ -75,7 +114,7 @@ Excerpt — not a complete module
|
|
|
75
114
|
## Rules
|
|
76
115
|
|
|
77
116
|
- The control is a native button whose label says what the press does next, so it carries no aria-pressed: the APG Button pattern (w3.org/WAI/ARIA/apg/patterns/button/) keeps aria-pressed for a toggle whose label does not change. A screen reader hears “Full screen, button” and then “Exit full screen, button”.
|
|
78
|
-
- Escape in native full screen belongs to the browser, and
|
|
117
|
+
- Escape in native full screen belongs to the browser, and Fullscreen writes no listener for it; the specification makes it leave before any close watcher. In the layout, Escape asks through the one layer stack, so a list opened inside closes first.
|
|
79
118
|
- While the region is full screen, Tab wraps inside it: what is outside is not painted, and a focus there would be invisible. On the way out, focus returns to the element that held it when it came from outside, and the page’s and the region’s scroll return to where they were.
|
|
80
119
|
- Entering is announced politely with how to leave (“Full screen. Press Escape to exit.”), and leaving is announced too; the layout does not make the page inert, because an inert page would silence that announcement. The cost is that a screen reader’s virtual cursor can reach the covered page.
|
|
81
120
|
|
|
@@ -85,162 +124,4 @@ Excerpt — not a complete module
|
|
|
85
124
|
|
|
86
125
|
## Examples
|
|
87
126
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
mode="layout" never asks the browser: the region is fixed over the page, the page behind stops scrolling, and Escape leaves. It is the picture an iframe without allow="fullscreen" or a phone browser gets under the default mode too.
|
|
91
|
-
|
|
92
|
-
Excerpt — not a complete module
|
|
93
|
-
|
|
94
|
-
```tsx
|
|
95
|
-
<Fullscreen mode="layout">
|
|
96
|
-
<FullscreenTrigger />
|
|
97
|
-
<ContractTerms />
|
|
98
|
-
</Fullscreen>;
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### The height of the screen, not only its width
|
|
102
|
-
|
|
103
|
-
The browser stretches the region and none of its children. FullscreenContent takes the height a bar and a caption leave, and the chart’s plot grows into it; a region with a single card gives the card the height instead.
|
|
104
|
-
|
|
105
|
-
Excerpt — not a complete module
|
|
106
|
-
|
|
107
|
-
```tsx
|
|
108
|
-
<Fullscreen>
|
|
109
|
-
<Toolbar>
|
|
110
|
-
<FullscreenTrigger />
|
|
111
|
-
</Toolbar>
|
|
112
|
-
<FullscreenContent>
|
|
113
|
-
<Chart title="Revenue by month" {...revenue} />
|
|
114
|
-
</FullscreenContent>
|
|
115
|
-
<Text>Source: accounting close.</Text>
|
|
116
|
-
</Fullscreen>;
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### The page holds the state
|
|
120
|
-
|
|
121
|
-
The page owns fullscreen and every change arrives as a request with its reason: pointer or keyboard from the control, escape when the reader left on their own. The log under the panel prints each one.
|
|
122
|
-
|
|
123
|
-
Excerpt — not a complete module
|
|
124
|
-
|
|
125
|
-
```tsx
|
|
126
|
-
const [presenting, setPresenting] = useState(false);
|
|
127
|
-
|
|
128
|
-
<Fullscreen
|
|
129
|
-
fullscreen={presenting}
|
|
130
|
-
onFullscreenChange={(next, request) => {
|
|
131
|
-
log(request.reason);
|
|
132
|
-
setPresenting(next);
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
<FullscreenTrigger />
|
|
136
|
-
</Fullscreen>;
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Refused, and still full screen
|
|
140
|
-
|
|
141
|
-
When the browser has no API or refuses, the region enters the layout and onFullscreenError says why — unsupported or refused. The panel prints the last error. A page that prefers nothing sets the state back to false from the same handler.
|
|
142
|
-
|
|
143
|
-
Excerpt — not a complete module
|
|
144
|
-
|
|
145
|
-
```tsx
|
|
146
|
-
<Fullscreen onFullscreenError={(error) => setNotice(error.kind)}>
|
|
147
|
-
<FullscreenTrigger />
|
|
148
|
-
</Fullscreen>;
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### A menu opened from inside
|
|
152
|
-
|
|
153
|
-
The select in the panel opens its list inside the region while it is full screen: the portal root follows the element the browser shows. Escape in the layout closes the list first and the region on the second press.
|
|
154
|
-
|
|
155
|
-
Excerpt — not a complete module
|
|
156
|
-
|
|
157
|
-
```tsx
|
|
158
|
-
<Fullscreen>
|
|
159
|
-
<Select defaultValue="6m">
|
|
160
|
-
<SelectTrigger aria-label="Period">
|
|
161
|
-
<SelectValue />
|
|
162
|
-
</SelectTrigger>
|
|
163
|
-
<SelectContent>
|
|
164
|
-
<SelectItem value="3m">Last 3 months</SelectItem>
|
|
165
|
-
<SelectItem value="6m">Last 6 months</SelectItem>
|
|
166
|
-
</SelectContent>
|
|
167
|
-
</Select>
|
|
168
|
-
<FullscreenTrigger />
|
|
169
|
-
</Fullscreen>;
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### The whole document
|
|
173
|
-
|
|
174
|
-
useFullscreen takes any element — here document.documentElement — and hands its handle to a control that is not inside any region. Presentation mode for the whole application is this line and nothing else.
|
|
175
|
-
|
|
176
|
-
Excerpt — not a complete module
|
|
177
|
-
|
|
178
|
-
```tsx
|
|
179
|
-
const page = useFullscreen(document.documentElement);
|
|
180
|
-
|
|
181
|
-
<FullscreenTrigger target={page} variant="outline" />;
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### The keyboard, key by key
|
|
185
|
-
|
|
186
|
-
Tab reaches the control, Space or Enter presses it and the reason says keyboard. While full screen, Tab wraps inside the region. Escape in native full screen belongs to the browser — the family writes no listener and reports the leave as escape.
|
|
187
|
-
|
|
188
|
-
Excerpt — not a complete module
|
|
189
|
-
|
|
190
|
-
```tsx
|
|
191
|
-
<Fullscreen onFullscreenChange={(next, request) => log(request.reason)}>
|
|
192
|
-
<FullscreenTrigger />
|
|
193
|
-
</Fullscreen>;
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### The control: two variants, three steps, every state
|
|
197
|
-
|
|
198
|
-
ghost stands in a bar that is already framed, outline over content and carries its own ground. Each step reads the control scale, so the control lines up with a button of the same step. Disabled keeps the words legible and refuses the press.
|
|
199
|
-
|
|
200
|
-
Excerpt — not a complete module
|
|
201
|
-
|
|
202
|
-
```tsx
|
|
203
|
-
<FullscreenTrigger size="sm" variant="outline" />;
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### The mark alone
|
|
207
|
-
|
|
208
|
-
iconOnly draws the control square from its height and keeps the words, visually hidden, as its name — so it still says “Exit full screen” to a screen reader when the mark turns inward.
|
|
209
|
-
|
|
210
|
-
Excerpt — not a complete module
|
|
211
|
-
|
|
212
|
-
```tsx
|
|
213
|
-
<FullscreenTrigger iconOnly />;
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### The control outside the region
|
|
217
|
-
|
|
218
|
-
A toolbar above a chart holds the control; the chart is the region. useFullscreen gives the handle, target hands it to the control, and the control changes with the chart’s state. Inside the region, a second control takes the reader back.
|
|
219
|
-
|
|
220
|
-
Excerpt — not a complete module
|
|
221
|
-
|
|
222
|
-
```tsx
|
|
223
|
-
const [chart, setChart] = useState<HTMLElement | null>(null);
|
|
224
|
-
const handle = useFullscreen(chart);
|
|
225
|
-
|
|
226
|
-
<>
|
|
227
|
-
<FullscreenTrigger target={handle} />
|
|
228
|
-
<section ref={setChart}>…</section>
|
|
229
|
-
</>;
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Defaults once, words and mark of the consumer
|
|
233
|
-
|
|
234
|
-
A provider sets the control’s step and variant for a subtree. children and icon take a function of the state, so a “Present” control keeps following it; render puts the wiring on the consumer’s own element.
|
|
235
|
-
|
|
236
|
-
Excerpt — not a complete module
|
|
237
|
-
|
|
238
|
-
```tsx
|
|
239
|
-
<FullscreenDefaultsProvider size="sm">
|
|
240
|
-
<Fullscreen>
|
|
241
|
-
<FullscreenTrigger icon={(on) => (on ? <X size={14} /> : <Presentation size={14} />)}>
|
|
242
|
-
{(on) => (on ? 'Terminar' : 'Apresentar')}
|
|
243
|
-
</FullscreenTrigger>
|
|
244
|
-
</Fullscreen>
|
|
245
|
-
</FullscreenDefaultsProvider>;
|
|
246
|
-
```
|
|
127
|
+
See [fullscreen.examples.md](./fullscreen.examples.md).
|