@slashsuite/ui-react 0.12.1 → 0.13.0
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/MIGRATING.md +386 -8
- package/README.md +89 -44
- package/agent-docs/components/app-shell.md +9 -6
- package/agent-docs/components/article-layout.md +140 -0
- package/agent-docs/components/audio.md +42 -0
- package/agent-docs/components/badge.md +2 -1
- package/agent-docs/components/body-text.md +26 -15
- package/agent-docs/components/bottom-sheet.md +27 -17
- package/agent-docs/components/breadcrumbs.md +10 -6
- package/agent-docs/components/button.md +2 -2
- package/agent-docs/components/call-to-action.md +59 -0
- package/agent-docs/components/callout.md +4 -3
- package/agent-docs/components/card-grid.md +15 -7
- package/agent-docs/components/card.md +33 -18
- package/agent-docs/components/cart-button.md +63 -0
- package/agent-docs/components/chat-composer.md +4 -3
- package/agent-docs/components/checkbox.md +11 -5
- package/agent-docs/components/cluster.md +10 -8
- package/agent-docs/components/code-example.md +2 -2
- package/agent-docs/components/code.md +7 -5
- package/agent-docs/components/colour-scheme-toggle.md +12 -6
- package/agent-docs/components/colour-swatch.md +41 -0
- package/agent-docs/components/combobox.md +88 -0
- package/agent-docs/components/confirm-dialog.md +98 -0
- package/agent-docs/components/container.md +2 -1
- package/agent-docs/components/copy-button.md +7 -5
- package/agent-docs/components/copy-line.md +6 -5
- package/agent-docs/components/date-field.md +14 -11
- package/agent-docs/components/date-range-picker.md +16 -9
- package/agent-docs/components/date-time-field.md +73 -0
- package/agent-docs/components/dialog.md +22 -68
- package/agent-docs/components/disclosure.md +4 -0
- package/agent-docs/components/docs-layout.md +10 -6
- package/agent-docs/components/drawer.md +13 -4
- package/agent-docs/components/embed-frame.md +48 -0
- package/agent-docs/components/empty-state.md +4 -1
- package/agent-docs/components/field-dialog.md +6 -5
- package/agent-docs/components/field.md +10 -7
- package/agent-docs/components/fieldset.md +4 -4
- package/agent-docs/components/flow-diagram.md +87 -0
- package/agent-docs/components/form-layout.md +4 -1
- package/agent-docs/components/form-row.md +7 -7
- package/agent-docs/components/full-bleed-layout.md +0 -2
- package/agent-docs/components/headings.md +13 -7
- package/agent-docs/components/hero.md +11 -2
- package/agent-docs/components/icon-button.md +1 -3
- package/agent-docs/components/icon.md +6 -13
- package/agent-docs/components/image.md +24 -14
- package/agent-docs/components/input.md +8 -7
- package/agent-docs/components/key-value-list.md +4 -1
- package/agent-docs/components/lightbox.md +1 -1
- package/agent-docs/components/list-layout.md +5 -7
- package/agent-docs/components/list-row.md +37 -34
- package/agent-docs/components/loading.md +2 -2
- package/agent-docs/components/markdown.md +13 -13
- package/agent-docs/components/media-tile.md +8 -4
- package/agent-docs/components/menu.md +19 -12
- package/agent-docs/components/meta-list.md +2 -2
- package/agent-docs/components/morph.md +11 -5
- package/agent-docs/components/navigation-progress.md +2 -2
- package/agent-docs/components/number-field.md +75 -0
- package/agent-docs/components/outline-region.md +19 -8
- package/agent-docs/components/page-fade.md +2 -1
- package/agent-docs/components/pill.md +7 -6
- package/agent-docs/components/popover.md +63 -0
- package/agent-docs/components/price.md +49 -0
- package/agent-docs/components/product-tile.md +78 -0
- package/agent-docs/components/promo-banner.md +46 -0
- package/agent-docs/components/prose-layout.md +1 -1
- package/agent-docs/components/radio-group.md +9 -6
- package/agent-docs/components/scroll-strip.md +3 -3
- package/agent-docs/components/segmented-control.md +4 -2
- package/agent-docs/components/select.md +8 -3
- package/agent-docs/components/show.md +2 -2
- package/agent-docs/components/side-column.md +13 -9
- package/agent-docs/components/sidebar-layout.md +1 -1
- package/agent-docs/components/site-footer.md +4 -4
- package/agent-docs/components/site-search.md +21 -9
- package/agent-docs/components/slider.md +59 -0
- package/agent-docs/components/sortable-list.md +15 -10
- package/agent-docs/components/stack.md +3 -3
- package/agent-docs/components/stacked-bar.md +7 -4
- package/agent-docs/components/state-machine.md +95 -0
- package/agent-docs/components/status-pages.md +13 -6
- package/agent-docs/components/stepper.md +54 -0
- package/agent-docs/components/switch.md +4 -4
- package/agent-docs/components/table-of-contents.md +78 -0
- package/agent-docs/components/table.md +35 -24
- package/agent-docs/components/tabs.md +24 -26
- package/agent-docs/components/text-link.md +12 -7
- package/agent-docs/components/textarea.md +4 -2
- package/agent-docs/components/toast.md +19 -14
- package/agent-docs/components/video.md +7 -2
- package/agent-docs/llms.txt +22 -3
- package/dist/AppShell.d.ts +25 -9
- package/dist/AppShell.js +67 -33
- package/dist/AppShellMenu.d.ts +31 -18
- package/dist/AppShellMenu.js +72 -45
- package/dist/ArticleLayout.d.ts +36 -0
- package/dist/ArticleLayout.js +27 -0
- package/dist/Audio.d.ts +16 -0
- package/dist/Audio.js +11 -0
- package/dist/Badge.d.ts +2 -1
- package/dist/Badge.js +3 -2
- package/dist/BottomSheet.d.ts +17 -6
- package/dist/BottomSheet.js +62 -11
- package/dist/Breadcrumbs.d.ts +8 -6
- package/dist/Breadcrumbs.js +17 -7
- package/dist/Button.d.ts +1 -0
- package/dist/Button.js +4 -3
- package/dist/CallToAction.d.ts +25 -0
- package/dist/CallToAction.js +17 -0
- package/dist/Callout.d.ts +2 -2
- package/dist/Callout.js +2 -2
- package/dist/Card.d.ts +88 -31
- package/dist/Card.js +55 -92
- package/dist/CardBody.d.ts +2 -0
- package/dist/CardBody.js +33 -3
- package/dist/CardGrid.d.ts +32 -4
- package/dist/CardGrid.js +42 -8
- package/dist/CardParts.d.ts +7 -1
- package/dist/CardParts.js +7 -2
- package/dist/CartButton.d.ts +33 -0
- package/dist/CartButton.js +18 -0
- package/dist/ChatComposer.d.ts +10 -4
- package/dist/ChatComposer.js +35 -13
- package/dist/Checkbox.d.ts +21 -3
- package/dist/Checkbox.js +66 -20
- package/dist/Chevron.js +1 -1
- package/dist/Cluster.d.ts +28 -15
- package/dist/Cluster.js +21 -4
- package/dist/Code.d.ts +15 -3
- package/dist/Code.js +23 -3
- package/dist/CodeBlock.d.ts +4 -4
- package/dist/CodeBlock.js +2 -2
- package/dist/CodeBody.d.ts +1 -1
- package/dist/CodeBody.js +4 -10
- package/dist/CodeExample.d.ts +1 -1
- package/dist/CodeExample.js +3 -2
- package/dist/ColourSchemeToggle.d.ts +21 -5
- package/dist/ColourSchemeToggle.js +15 -9
- package/dist/ColourSwatch.d.ts +15 -0
- package/dist/ColourSwatch.js +14 -0
- package/dist/Combobox.d.ts +42 -0
- package/dist/Combobox.js +43 -0
- package/dist/ConfirmDialog.d.ts +40 -0
- package/dist/ConfirmDialog.js +36 -0
- package/dist/Container.d.ts +3 -3
- package/dist/Container.js +1 -1
- package/dist/CopyButton.d.ts +8 -2
- package/dist/CopyButton.js +38 -28
- package/dist/CopyLine.d.ts +4 -2
- package/dist/CopyLine.js +4 -4
- package/dist/DateCalendar.d.ts +2 -0
- package/dist/DateCalendar.js +11 -9
- package/dist/DateField.d.ts +52 -21
- package/dist/DateField.js +73 -37
- package/dist/DateFieldCalendar.d.ts +12 -8
- package/dist/DateFieldCalendar.js +37 -18
- package/dist/DateRangePicker.d.ts +23 -3
- package/dist/DateRangePicker.js +10 -8
- package/dist/DateTimeField.d.ts +31 -0
- package/dist/DateTimeField.js +19 -0
- package/dist/Dialog.d.ts +42 -6
- package/dist/Dialog.js +50 -12
- package/dist/Disclosure.js +9 -1
- package/dist/DocsLayout.d.ts +13 -5
- package/dist/DocsLayout.js +11 -9
- package/dist/Drawer.d.ts +22 -7
- package/dist/Drawer.js +89 -8
- package/dist/EmbedFrame.d.ts +36 -0
- package/dist/EmbedFrame.js +18 -0
- package/dist/Field.d.ts +41 -4
- package/dist/Field.js +61 -25
- package/dist/FieldDialog.d.ts +8 -3
- package/dist/FieldDialog.js +19 -9
- package/dist/Fieldset.d.ts +3 -3
- package/dist/Fieldset.js +7 -9
- package/dist/FileDrop.js +2 -1
- package/dist/FlowDiagram.d.ts +92 -0
- package/dist/FlowDiagram.js +100 -0
- package/dist/FormRow.d.ts +6 -4
- package/dist/FormRow.js +11 -9
- package/dist/Hero.d.ts +30 -7
- package/dist/Hero.js +23 -9
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +1 -1
- package/dist/IconButton.js +1 -1
- package/dist/Image.d.ts +33 -9
- package/dist/Image.js +61 -16
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +4 -4
- package/dist/InputShell.d.ts +7 -0
- package/dist/InputShell.js +18 -3
- package/dist/KeyValueList.d.ts +2 -2
- package/dist/Lightbox.js +5 -3
- package/dist/ListRow.d.ts +4 -5
- package/dist/ListRow.js +36 -26
- package/dist/Mark.d.ts +10 -0
- package/dist/Mark.js +9 -0
- package/dist/Markdown.d.ts +18 -4
- package/dist/Markdown.js +176 -37
- package/dist/MediaTile.d.ts +9 -3
- package/dist/MediaTile.js +8 -4
- package/dist/Menu.d.ts +19 -8
- package/dist/Menu.js +13 -11
- package/dist/MetaList.d.ts +4 -3
- package/dist/MetaList.js +12 -4
- package/dist/Morph.d.ts +15 -1
- package/dist/Morph.js +70 -22
- package/dist/NavigationProgress.d.ts +2 -2
- package/dist/NavigationProgress.js +7 -5
- package/dist/NumberField.d.ts +66 -0
- package/dist/NumberField.js +68 -0
- package/dist/OutlineRegion.d.ts +41 -10
- package/dist/OutlineRegion.js +31 -6
- package/dist/PageFade.d.ts +9 -5
- package/dist/PageFade.js +39 -8
- package/dist/PageLayouts.d.ts +15 -5
- package/dist/PageLayouts.js +3 -3
- package/dist/Pill.d.ts +9 -4
- package/dist/Pill.js +15 -6
- package/dist/Popover.d.ts +31 -0
- package/dist/Popover.js +43 -0
- package/dist/Price.d.ts +21 -0
- package/dist/Price.js +34 -0
- package/dist/ProductTile.d.ts +36 -0
- package/dist/ProductTile.js +31 -0
- package/dist/ProgressBar.js +4 -2
- package/dist/PromoBanner.d.ts +25 -0
- package/dist/PromoBanner.js +16 -0
- package/dist/RadioGroup.d.ts +18 -8
- package/dist/RadioGroup.js +42 -18
- package/dist/ScrollStrip.d.ts +1 -1
- package/dist/ScrollStrip.js +1 -1
- package/dist/SearchInput.d.ts +17 -2
- package/dist/SearchInput.js +72 -13
- package/dist/SegmentedField.d.ts +15 -0
- package/dist/SegmentedField.js +15 -0
- package/dist/Select.js +5 -4
- package/dist/Show.d.ts +1 -1
- package/dist/Show.js +1 -1
- package/dist/SideColumn.d.ts +42 -15
- package/dist/SideColumn.js +45 -19
- package/dist/SiteFooter.d.ts +3 -3
- package/dist/SiteFooter.js +4 -3
- package/dist/SiteSearch.d.ts +57 -27
- package/dist/SiteSearch.js +13 -93
- package/dist/Slider.d.ts +27 -0
- package/dist/Slider.js +58 -0
- package/dist/SortableList.d.ts +19 -35
- package/dist/SortableList.js +36 -88
- package/dist/Stack.d.ts +4 -4
- package/dist/StackedBar.d.ts +13 -4
- package/dist/StackedBar.js +12 -7
- package/dist/StateMachine.d.ts +65 -0
- package/dist/StateMachine.js +113 -0
- package/dist/StatusPages.d.ts +28 -10
- package/dist/StatusPages.js +10 -10
- package/dist/Stepper.d.ts +21 -0
- package/dist/Stepper.js +33 -0
- package/dist/Steps.js +4 -3
- package/dist/Switch.d.ts +3 -3
- package/dist/Switch.js +18 -14
- package/dist/Table.d.ts +32 -9
- package/dist/Table.js +50 -20
- package/dist/TableCells.d.ts +24 -21
- package/dist/TableCells.js +68 -27
- package/dist/TableEditCell.d.ts +1 -1
- package/dist/TableOfContents.d.ts +34 -0
- package/dist/TableOfContents.js +23 -0
- package/dist/Tabs.d.ts +31 -16
- package/dist/Tabs.js +97 -22
- package/dist/TextLink.d.ts +18 -5
- package/dist/TextLink.js +19 -6
- package/dist/Textarea.d.ts +12 -1
- package/dist/Textarea.js +15 -2
- package/dist/ToastRegion.d.ts +17 -9
- package/dist/ToastRegion.js +70 -13
- package/dist/Tooltip.d.ts +10 -2
- package/dist/Tooltip.js +32 -11
- package/dist/Video.d.ts +19 -4
- package/dist/Video.js +15 -5
- package/dist/cardContext.d.ts +7 -0
- package/dist/cardContext.js +14 -0
- package/dist/cardControl.d.ts +15 -0
- package/dist/cardControl.js +32 -0
- package/dist/cardForm.d.ts +39 -0
- package/dist/cardForm.js +81 -0
- package/dist/cardWait.js +2 -1
- package/dist/colourScheme.d.ts +12 -2
- package/dist/colourScheme.js +32 -6
- package/dist/control.d.ts +30 -8
- package/dist/control.js +74 -7
- package/dist/copyScript.d.ts +7 -8
- package/dist/copyScript.js +8 -9
- package/dist/cx.d.ts +22 -3
- package/dist/cx.js +22 -3
- package/dist/dateLocale.d.ts +17 -0
- package/dist/dateLocale.js +30 -0
- package/dist/density.d.ts +15 -1
- package/dist/density.js +27 -8
- package/dist/emptySlot.d.ts +1 -0
- package/dist/fieldAnnounce.d.ts +11 -0
- package/dist/fieldAnnounce.js +36 -0
- package/dist/fieldControl.d.ts +7 -2
- package/dist/fieldControl.js +6 -2
- package/dist/fieldWait.d.ts +3 -3
- package/dist/fieldWait.js +3 -4
- package/dist/flowLayout.d.ts +68 -0
- package/dist/flowLayout.js +105 -0
- package/dist/fromXState.d.ts +73 -0
- package/dist/fromXState.js +110 -0
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +15 -0
- package/dist/index.d.ts +37 -11
- package/dist/index.js +24 -2
- package/dist/isoDate.d.ts +8 -1
- package/dist/isoDate.js +20 -1
- package/dist/labelWords.d.ts +16 -7
- package/dist/labelWords.js +14 -12
- package/dist/listRowProps.d.ts +17 -15
- package/dist/modal.d.ts +5 -0
- package/dist/modal.js +21 -1
- package/dist/navFold.js +6 -3
- package/dist/optionCard.d.ts +18 -0
- package/dist/optionCard.js +16 -0
- package/dist/scrollBody.d.ts +16 -0
- package/dist/scrollBody.js +15 -0
- package/dist/scrollEdges.d.ts +7 -0
- package/dist/scrollEdges.js +39 -5
- package/dist/scrollStop.d.ts +6 -2
- package/dist/scrollStop.js +24 -8
- package/dist/shownDate.d.ts +28 -10
- package/dist/shownDate.js +41 -22
- package/dist/siteSearchBody.d.ts +34 -0
- package/dist/siteSearchBody.js +117 -0
- package/dist/size.d.ts +7 -1
- package/dist/sortableDrop.d.ts +44 -0
- package/dist/sortableDrop.js +78 -0
- package/dist/sortableSlide.d.ts +9 -0
- package/dist/sortableSlide.js +70 -0
- package/dist/sortableTitle.d.ts +10 -0
- package/dist/sortableTitle.js +48 -0
- package/dist/stateMachineDots.d.ts +45 -0
- package/dist/stateMachineDots.js +162 -0
- package/dist/stickyColumn.d.ts +2 -2
- package/dist/stickyColumn.js +2 -2
- package/dist/switcher.d.ts +10 -5
- package/dist/switcher.js +7 -5
- package/dist/tableColumns.d.ts +17 -0
- package/dist/tableColumns.js +30 -2
- package/dist/tableEmpty.js +5 -5
- package/dist/tableRow.d.ts +26 -2
- package/dist/tableRow.js +23 -1
- package/dist/tableSort.d.ts +10 -5
- package/dist/tableSort.js +15 -4
- package/dist/target.d.ts +12 -0
- package/dist/target.js +12 -0
- package/dist/textBox.js +1 -1
- package/dist/truncated.d.ts +31 -0
- package/dist/truncated.js +51 -0
- package/dist/typography.d.ts +19 -11
- package/dist/typography.js +11 -13
- package/dist/useFlowLayout.d.ts +27 -0
- package/dist/useFlowLayout.js +119 -0
- package/package.json +3 -2
|
@@ -2,47 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Group: Feedback
|
|
4
4
|
|
|
5
|
-
When to use: A
|
|
5
|
+
When to use: A short form or a message the reader must deal with before they go on.
|
|
6
6
|
|
|
7
7
|
### Use instead
|
|
8
8
|
- Drawer (drawer.md): A record or a long form is worked on beside the page.
|
|
9
|
+
- ConfirmDialog (confirm-dialog.md): One yes-or-no question before an action.
|
|
9
10
|
- FieldDialog (field-dialog.md): Only one text value is asked for.
|
|
10
11
|
- BottomSheet (bottom-sheet.md): Content sits over a map or a canvas that must stay usable: not modal.
|
|
11
12
|
- Lightbox (lightbox.md): One photo or video is shown at full size.
|
|
12
13
|
|
|
13
14
|
### The one right way
|
|
14
|
-
A
|
|
15
|
+
A result that needs no answer is a `Callout` in the page, where it does not take the page away.
|
|
15
16
|
```tsx
|
|
16
|
-
import {
|
|
17
|
-
import { Button, Dialog } from "@slashsuite/ui-react";
|
|
17
|
+
import { Button, Callout, Stack } from "@slashsuite/ui-react";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
24
|
-
Delete build
|
|
25
|
-
</Button>
|
|
26
|
-
{open && (
|
|
27
|
-
<Dialog
|
|
28
|
-
title="Delete build"
|
|
29
|
-
description="This removes the build and every snapshot in it."
|
|
30
|
-
onClose={() => setOpen(false)}
|
|
31
|
-
footer={
|
|
32
|
-
<>
|
|
33
|
-
<Button variant="ghost" onClick={() => setOpen(false)}>
|
|
34
|
-
Cancel
|
|
35
|
-
</Button>
|
|
36
|
-
<Button tone="danger" onClick={() => setOpen(false)}>
|
|
37
|
-
Delete
|
|
38
|
-
</Button>
|
|
39
|
-
</>
|
|
40
|
-
}
|
|
41
|
-
/>
|
|
42
|
-
)}
|
|
43
|
-
</>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
19
|
+
<Stack gap="sm">
|
|
20
|
+
<Button variant="outline">Save</Button>
|
|
21
|
+
<Callout tone="positive">Your review is saved.</Callout>
|
|
22
|
+
</Stack>
|
|
46
23
|
```
|
|
47
24
|
|
|
48
25
|
### Do
|
|
@@ -50,40 +27,12 @@ function Example() {
|
|
|
50
27
|
- A `title` that names the action, a `description` with the consequence, and the actions in `footer`: Cancel as `variant="ghost"` first, then the one action, `tone="danger"` when it destroys something.
|
|
51
28
|
- A form is the Dialog's own `onSubmit`: the body, the error and the footer are one form, so the footer's `Button type="submit"` and Enter in a field submit it, with no form id and no `form` attribute. The footer is Cancel (`variant="ghost"`), then the one submit button. With `onSubmit`, put no `<form method="dialog">` in the footer: it would nest a form.
|
|
52
29
|
- An error about one field is that `Field`'s `error`. An error about the whole submit (the server refused it, a conflict, no connection) is the Dialog's `error`: an alert between the body and the footer, beside the button that was pressed however tall the body is.
|
|
53
|
-
- A tall body scrolls inside the dialog, which is never taller than the screen: the title, the description and the footer stay on screen, so the actions are always in reach. There is nothing to set.
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- After async work (a save), keep the `<dialog>` from the event before the `await` (`const dialog = event.currentTarget.closest("dialog")`) and call `dialog?.close()` when it resolves.
|
|
30
|
+
- A tall body scrolls inside the dialog, which is never taller than the screen: the title, the description and the footer stay on screen, so the actions are always in reach. A scroll that reaches the end of the body stops there and never moves the page behind. There is nothing to set.
|
|
31
|
+
- Every Dialog has a close button in its top corner, named "Close" (set `closeLabel` to the reader's language). A notice or a list to read needs no footer: the close button is the way out.
|
|
32
|
+
- A yes-or-no question before an action is a `ConfirmDialog`. One text field is a `FieldDialog`. A record or a long form is a `Drawer`. A message that needs no answer is a `Callout` in the page, or a `Toast` when it should not move the page.
|
|
33
|
+
- It fades and slides in, and out again on close, but a `<dialog>` only animates out while it is still in the DOM. So `onClose` is called once the exit has finished: put `setOpen(false)` there and nowhere else. Esc, the backdrop and a `<form method="dialog">` close it that way already. Your own Cancel or action button closes it by calling `.close()` on its `<dialog>`, which a click handler finds with `event.currentTarget.closest("dialog")`. A button that calls `setOpen(false)` itself unmounts the dialog at once, and it vanishes with no exit animation. After async work (a save), keep the `<dialog>` from the event before the `await` (`const dialog = event.currentTarget.closest("dialog")`) and call `dialog?.close()` when it resolves.
|
|
57
34
|
|
|
58
35
|
### Don't
|
|
59
|
-
With no Cancel and no consequence, the only way out of the dialog is the one button that destroys the build.
|
|
60
|
-
```tsx
|
|
61
|
-
import { useState } from "react";
|
|
62
|
-
import { Button, Dialog } from "@slashsuite/ui-react";
|
|
63
|
-
|
|
64
|
-
function Example() {
|
|
65
|
-
const [open, setOpen] = useState(false);
|
|
66
|
-
return (
|
|
67
|
-
<>
|
|
68
|
-
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
69
|
-
Delete build
|
|
70
|
-
</Button>
|
|
71
|
-
{open && (
|
|
72
|
-
<Dialog
|
|
73
|
-
title="Are you sure?"
|
|
74
|
-
onClose={() => setOpen(false)}
|
|
75
|
-
footer={
|
|
76
|
-
<Button tone="danger" onClick={() => setOpen(false)}>
|
|
77
|
-
Delete
|
|
78
|
-
</Button>
|
|
79
|
-
}
|
|
80
|
-
/>
|
|
81
|
-
)}
|
|
82
|
-
</>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
36
|
A modal for a message makes the reader dismiss it before they can carry on.
|
|
88
37
|
```tsx
|
|
89
38
|
import { useState } from "react";
|
|
@@ -150,29 +99,34 @@ function Example() {
|
|
|
150
99
|
- A Dialog is the browser's own `<dialog>` opened with `showModal()`: the page behind goes inert, focus stays inside it and Esc closes it.
|
|
151
100
|
- The fade and slide are switched off under `prefers-reduced-motion: reduce`, and then it closes at once.
|
|
152
101
|
- It is named by its `title`, an `h2`, through `aria-labelledby`.
|
|
153
|
-
- A click on the backdrop closes it, and so
|
|
102
|
+
- A click on the backdrop closes it, and so do the close button and a submit of a `<form method="dialog">`; every close calls `onClose`.
|
|
103
|
+
- The close button comes last in the keyboard order, after the footer, so opening still focuses the first field or the first footer button.
|
|
154
104
|
- The browser focuses the first focusable element in it when it opens; put `autoFocus` on the button that should have focus first.
|
|
155
105
|
- A tall body that holds nothing focusable, such as plain text, takes a tab stop so the arrow keys can scroll it. A tall form keeps its first focus on its first field.
|
|
106
|
+
- Once a form's `onSubmit` settles (a returned promise resolves or rejects), the focus moves to the first field marked invalid (`aria-invalid="true"`), so a failed submit puts the reader on what to fix.
|
|
156
107
|
|
|
157
108
|
### Props
|
|
158
109
|
### Dialog
|
|
159
|
-
A modal on the browser's own `<dialog>`: it is opened with `showModal()` on mount, so render it only while it is open. The page behind goes inert, Esc closes it and focus stays inside; a click on the backdrop (the `<dialog>` element itself, not its contents) closes it too. A windowed dialog is never taller than the screen: a tall body scrolls and the title and footer stay on screen.
|
|
110
|
+
A modal on the browser's own `<dialog>`: it is opened with `showModal()` on mount, so render it only while it is open. The page behind goes inert, Esc closes it and focus stays inside; a click on the backdrop (the `<dialog>` element itself, not its contents) closes it too, and so does the close button in its top corner, which every dialog has. The close button comes last in the keyboard order, so the open focuses the first field, not it. A windowed dialog is never taller than the screen: a tall body scrolls and the title and footer stay on screen, and a scroll inside it never carries on to the page behind.
|
|
111
|
+
- closeLabel: string (default Close). The name of the close button in the top corner, for an app in another language.
|
|
160
112
|
- description: ReactNode. A muted line under the title.
|
|
161
113
|
- error: ReactNode. What went wrong with the whole submit (the server refused it, no connection): a danger
|
|
162
114
|
`Callout`, announced as an alert, between the body and the footer, so it stays beside the
|
|
163
115
|
buttons however tall the body is. An error about one field is that `Field`'s `error`.
|
|
164
116
|
- footer: ReactNode. Actions under the body, right-aligned: Cancel (`variant="ghost"`), then the one main action.
|
|
165
117
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
166
|
-
- onClose: () => void (required). Called when the dialog closes: Esc, a click on the backdrop, or a
|
|
118
|
+
- onClose: () => void (required). Called when the dialog closes: its close button, Esc, a click on the backdrop, or a
|
|
119
|
+
`<form method="dialog">` submit.
|
|
167
120
|
- onSubmit: ((event: FormEvent<HTMLFormElement>) => void | Promise<unknown>). Makes the dialog a form: one `<form noValidate>` holds the body, the `error` and the footer,
|
|
168
121
|
so a `Button type="submit"` in the footer or Enter in a field submits it, with no `form`
|
|
169
122
|
attribute or id. The default is prevented before this runs, and a rejection is yours to
|
|
170
|
-
catch and show as `error`.
|
|
123
|
+
catch and show as `error`. Once the submit settles, the focus moves to the first field marked
|
|
124
|
+
invalid (`aria-invalid="true"`), if any. Put no `<form method="dialog">` in the footer of a form dialog:
|
|
171
125
|
it would nest a form.
|
|
172
126
|
- title: ReactNode (required). The dialog's accessible name, shown as its heading.
|
|
173
127
|
- width: "sm" | "md" | "lg" | "full" (default md). The panel's width: `sm` (320px) is a list, `md` (440px) holds a form, `lg` (640px) a wider
|
|
174
128
|
form or a table. `full` fills the whole screen, for media or a player: the body takes the
|
|
175
129
|
height between the header and the footer and scrolls if it is taller. It has no backdrop to
|
|
176
|
-
click
|
|
130
|
+
click: its close button and Esc close it.
|
|
177
131
|
|
|
178
132
|
A single photo or video is a `Lightbox`.
|
|
@@ -4,6 +4,9 @@ Group: Content
|
|
|
4
4
|
|
|
5
5
|
When to use: Detail the person may not need on first sight: a history, an FAQ answer, the fine print.
|
|
6
6
|
|
|
7
|
+
### Use instead
|
|
8
|
+
- Popover (popover.md): The detail floats beside its button and leaves the page as it is.
|
|
9
|
+
|
|
7
10
|
### The one right way
|
|
8
11
|
Detail the person may not need, behind a summary that says what it is, is a `Disclosure`.
|
|
9
12
|
```tsx
|
|
@@ -53,6 +56,7 @@ import { Callout, Disclosure } from "@slashsuite/ui-react";
|
|
|
53
56
|
- The summary is a real `<button>` with `aria-expanded` and `aria-controls`; Enter and Space toggle it.
|
|
54
57
|
- The body is a `role="group"` named by the summary, and hidden from assistive tech while closed.
|
|
55
58
|
- The chevron is decorative. The focus ring comes from the component.
|
|
59
|
+
- The body slides open and shut and the chevron turns; under `prefers-reduced-motion: reduce` it opens and closes at once. Find in page still finds text in a closed body and opens it.
|
|
56
60
|
|
|
57
61
|
### Props
|
|
58
62
|
### Disclosure
|
|
@@ -11,7 +11,7 @@ import { DocsLayout, Section, Text } from "@slashsuite/ui-react";
|
|
|
11
11
|
|
|
12
12
|
<DocsLayout
|
|
13
13
|
nav={[{ title: "Guides", items: [{ label: "Install", href: "#install", selected: true }] }]}
|
|
14
|
-
|
|
14
|
+
asideLabel="Docs"
|
|
15
15
|
title="Install"
|
|
16
16
|
contents={[
|
|
17
17
|
{ id: "do-setup", label: "Setup", level: 2 },
|
|
@@ -53,7 +53,7 @@ import { Breadcrumbs, DocsLayout, Prose, Section, Text } from "@slashsuite/ui-re
|
|
|
53
53
|
],
|
|
54
54
|
},
|
|
55
55
|
]}
|
|
56
|
-
|
|
56
|
+
asideLabel="Docs"
|
|
57
57
|
breadcrumbs={<Breadcrumbs items={[{ label: "Docs", href: "#docs" }, "Install"]} />}
|
|
58
58
|
title="Install"
|
|
59
59
|
description="Add the CLI to a project and run its first capture."
|
|
@@ -86,7 +86,7 @@ import { Breadcrumbs, DocsLayout, Prose, Section, Text } from "@slashsuite/ui-re
|
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
### Do
|
|
89
|
-
- Give `nav` the docs pages in reading order, in groups: each group's `title` over its links, a group with no title at the top. `
|
|
89
|
+
- Give `nav` the docs pages in reading order, in groups: each group's `title` over its links, a group with no title at the top. `asideLabel` names the rail and the disclosure it folds behind below `md`.
|
|
90
90
|
- Give `contents` the page's own headings (`id`, `label`, `level` 2 or 3) in order; the layout draws the On this page list, a closed disclosure above the article below `xl` and a sticky column right of it from `xl`. With fewer than two there is no list.
|
|
91
91
|
- `current` is the id of the heading being read, a value the page passes; a site that follows the reader computes it. Left out, no entry is marked.
|
|
92
92
|
- Give `previous` and `next` the pages either side in reading order; they are links, not cards, so they add no heading to the outline.
|
|
@@ -131,14 +131,16 @@ import {
|
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
### Accessibility
|
|
134
|
-
- The rail is an `<aside>` named `
|
|
134
|
+
- The rail is an `<aside>` named `asideLabel`; each group is a `<nav>` named by its title (the top group by `asideLabel`), and the current page has `aria-current="page"`.
|
|
135
135
|
- The title is the page's one `h1`.
|
|
136
136
|
- The On this page list is one `<nav>` named `contentsLabel` at every width, so there is one copy of each link; the entry for `current` has `aria-current="location"`.
|
|
137
137
|
- Previous and next are one `<nav>` named from `previousLabel` and `nextLabel`; each link's name is its visible text, the word then the page ("Previous Install").
|
|
138
138
|
|
|
139
139
|
### Props
|
|
140
140
|
### DocsLayout
|
|
141
|
-
A docs page: a `SidebarLayout` whose rail is the docs `nav` (each group's title over its links, folded behind a disclosure named `
|
|
141
|
+
A docs page: a `SidebarLayout` whose rail is the docs `nav` (each group's title over its links, folded behind a disclosure named `asideLabel` below `md`), and a canvas of the page's title, an "On this page" list of its `contents`, the article and the previous and next links. The contents list is rendered once: from `xl` a 12rem column right of the article that sticks under the header, below `xl` a closed disclosure above the article. `current` marks the heading being read; it is a value the page passes (a site that follows the reader computes it), with no scroll spy inside. The previous and next links are links, not cards, so they add no heading to the page's outline. While `loading` the canvas waits, as in `SidebarLayout`: an empty title is a bone and what the article holds draws its own bones; the nav, the contents list and the previous and next links are navigation, drawn as themselves. The layout owns the wait.
|
|
142
|
+
- asideLabel: string (required). Names the rail's landmark, and the disclosure it folds behind below `md` ("Docs", "All
|
|
143
|
+
components"), as `SidebarLayout`'s `asideLabel` does.
|
|
142
144
|
- breadcrumbs: ReactNode. A `Breadcrumbs` above the title.
|
|
143
145
|
- children: ReactNode (required). The article. Wrap long text in a `Prose`.
|
|
144
146
|
- contents: DocsHeading[] (default []). The page's own headings, in order. With fewer than two there is no "On this page" list.
|
|
@@ -146,8 +148,10 @@ A docs page: a `SidebarLayout` whose rail is the docs `nav` (each group's title
|
|
|
146
148
|
- current: string. The id of the heading being read: its entry is marked (`aria-current="location"`). A value the page passes, never tracked inside.
|
|
147
149
|
- description: ReactNode. The line under the title (a `Lead`).
|
|
148
150
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
151
|
+
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
152
|
+
Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
|
|
153
|
+
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
149
154
|
- nav: DocsNavGroup[] (required). The docs nav, in reading order: each group's title over a vertical pill list of its pages.
|
|
150
|
-
- navLabel: string (required). Names the nav's landmark, and the disclosure it folds behind below `md` ("Docs", "All components").
|
|
151
155
|
- next: DocsNeighbour. The page after this one in reading order.
|
|
152
156
|
- nextLabel: string (default Next). The word over the next page's label.
|
|
153
157
|
- previous: DocsNeighbour. The page before this one in reading order.
|
|
@@ -49,8 +49,9 @@ function Example() {
|
|
|
49
49
|
### Do
|
|
50
50
|
- Render it only while it is open: `{open && <Drawer … onClose={() => setOpen(false)} />}`. It opens itself on mount.
|
|
51
51
|
- Use it for a record to read or edit, or a form with several fields; a yes-or-no question is a `Dialog`.
|
|
52
|
-
- The actions go in `footer`, pinned under the body, which scrolls between the header and the footer.
|
|
52
|
+
- The actions go in `footer`, pinned under the body, which scrolls between the header and the footer. A scroll that reaches the end of the body stops there and never moves the page behind.
|
|
53
53
|
- `width` is `sm`, `md` (the default) or `lg`; choose by the content, `sm` for one field and `lg` for a table. `description` is a muted line under the title, as on a `Dialog`.
|
|
54
|
+
- For a form, give it `onSubmit`, as on a `Dialog`: the body and the footer become one form, so a `Button type="submit"` in the footer or Enter in a field submits it. What went wrong with the whole submit is `error`, pinned above the footer; a field's own error is its `Field`'s.
|
|
54
55
|
- Set `closeLabel` to the reader's language when the page is not in English.
|
|
55
56
|
- It slides out again on close, but only while it is still in the DOM, so `onClose` is called once the exit has finished: put `setOpen(false)` there and nowhere else. Esc, the scrim and the close button close it that way already. A Cancel or Save button in the `footer` closes it by calling `.close()` on its `<dialog>`, which a click handler finds with `event.currentTarget.closest("dialog")`. A button that calls `setOpen(false)` itself unmounts the drawer at once, with no exit animation. After async work, keep the `<dialog>` from the event before the `await` and call `.close()` when it resolves.
|
|
56
57
|
|
|
@@ -113,16 +114,24 @@ function Example() {
|
|
|
113
114
|
- A Drawer is the browser's own `<dialog>` opened with `showModal()`: the page behind goes inert, focus stays inside it and Esc closes it.
|
|
114
115
|
- It is named by its `title`, an `h2`, through `aria-labelledby`.
|
|
115
116
|
- The header's close button is an `IconButton` named by `closeLabel` ("Close" by default); a click on the scrim closes it too.
|
|
117
|
+
- On a touch screen a swipe to the right drags it off: past a third of its width, or a quick flick, closes it, and a shorter one springs back. A vertical swipe scrolls the body, and a swipe that starts in a field or a slider is the field's own.
|
|
116
118
|
- Closing, or unmounting it, hands focus back to the element that opened it.
|
|
117
119
|
- The slide in and out is switched off under `prefers-reduced-motion: reduce`, and then it closes at once.
|
|
118
120
|
|
|
119
121
|
### Props
|
|
120
122
|
### Drawer
|
|
121
|
-
A modal slide-over anchored to the right edge, on the browser's own `<dialog>`: it is opened with `showModal()` on mount, so render it only while it is open. The page behind goes inert, Esc closes it and focus stays inside; a click on the scrim (the `<dialog>` element itself, not its contents) closes it too. The header holds the title, an optional `description` under it and a close button; the body scrolls between it and an optional pinned `footer`.
|
|
123
|
+
A modal slide-over anchored to the right edge, on the browser's own `<dialog>`: it is opened with `showModal()` on mount, so render it only while it is open. The page behind goes inert, Esc closes it and focus stays inside; a click on the scrim (the `<dialog>` element itself, not its contents) closes it too, and on touch a swipe to the right drags it off (a short one springs back). The header holds the title, an optional `description` under it and a close button; the body scrolls between it and an optional pinned `footer`, and a scroll in it never carries on to the page behind. `onSubmit` makes it a form and `error` shows what went wrong with the submit, as on a `Dialog`.
|
|
122
124
|
- closeLabel: string (default Close). The accessible name of the close button.
|
|
123
125
|
- description: ReactNode. A muted line under the title, as on a `Dialog`.
|
|
124
|
-
-
|
|
126
|
+
- error: ReactNode. What went wrong with the whole submit, as on a `Dialog`: a danger `Callout`, announced as an
|
|
127
|
+
alert, pinned between the body and the footer. An error about one field is that `Field`'s `error`.
|
|
128
|
+
- footer: ReactNode. Actions pinned under the scrolling body, right-aligned: Cancel (`variant="ghost"`), then the one main action.
|
|
125
129
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
126
|
-
- onClose: () => void (required). Called when the drawer closes: Esc, a click on the scrim or the
|
|
130
|
+
- onClose: () => void (required). Called when the drawer closes: Esc, a click on the scrim, the close button or a swipe to the right on touch.
|
|
131
|
+
- onSubmit: ((event: FormEvent<HTMLFormElement>) => void | Promise<unknown>). Makes the drawer a form, as on a `Dialog`: one `<form noValidate>` holds the body, the `error`
|
|
132
|
+
and the footer, so a `Button type="submit"` in the footer or Enter in a field submits it. The
|
|
133
|
+
default is prevented before this runs, and a rejection is yours to catch and show as `error`.
|
|
134
|
+
Once the submit settles, the focus moves to the first field marked invalid
|
|
135
|
+
(`aria-invalid="true"`), if any.
|
|
127
136
|
- title: ReactNode (required). The drawer's accessible name, shown as its heading.
|
|
128
137
|
- width: "sm" | "md" | "lg" (default md). The panel's width: `md` holds a form or a record; `sm` (320px) is narrower and `lg` (640px) wider.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## EmbedFrame
|
|
2
|
+
|
|
3
|
+
Group: Content
|
|
4
|
+
|
|
5
|
+
When to use: Showing a third party's map, player or form in an `<iframe>` inside your page.
|
|
6
|
+
|
|
7
|
+
### Use instead
|
|
8
|
+
- Video (video.md): The video is your own file: the native player.
|
|
9
|
+
|
|
10
|
+
### The one right way
|
|
11
|
+
The frame fixes the height and clips the corners; `status` covers the embed until its own load event says it is ready.
|
|
12
|
+
```tsx
|
|
13
|
+
import { EmbedFrame } from "@slashsuite/ui-react";
|
|
14
|
+
|
|
15
|
+
<EmbedFrame label="Map of the shops" height="sm" status="loading">
|
|
16
|
+
<iframe title="Map of the shops" src="about:blank" sandbox="allow-scripts" />
|
|
17
|
+
</EmbedFrame>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Do
|
|
21
|
+
- Put the `<iframe>` or the map's container as the child: it fills the frame, which rounds and clips its corners and draws the hairline.
|
|
22
|
+
- `height` is `sm` (18rem), `md` (24rem, the default) or `viewport`, 55% of the screen's height, for a map that is the page's main content.
|
|
23
|
+
- `status` is `ready` (the default), `loading` or `error`. Set it from the embed's own load and error events: `loading` lays a pulsing cover over the embed, `error` lays `errorLabel` over it.
|
|
24
|
+
- `label` names the frame for a screen reader; give the `<iframe>` its own `title` as well.
|
|
25
|
+
- `errorLabel` says what failed and what to do, as "The map could not load. Check the address below."; the default is "Could not load.".
|
|
26
|
+
|
|
27
|
+
### Don't
|
|
28
|
+
A bare `<iframe>` keeps the browser's 150px height and square border, and shows a blank box while it loads or after it fails.
|
|
29
|
+
```tsx
|
|
30
|
+
<iframe title="Map of the shops" src="about:blank" sandbox="allow-scripts" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Accessibility
|
|
34
|
+
- A region named by `label`. While `loading` it is `aria-busy` and says `loadingLabel` to a screen reader.
|
|
35
|
+
- The error words are an alert, announced when they appear. The embed stays mounted under both covers.
|
|
36
|
+
|
|
37
|
+
### Props
|
|
38
|
+
### EmbedFrame
|
|
39
|
+
A rounded, clipped frame with a hairline, at a fixed height, for a map or an `<iframe>`: the embed in `children` fills it. `status` lays a centred overlay over the embed while it loads or after it failed; the embed stays mounted under it, so it can finish loading. The frame is a region named by `label`.
|
|
40
|
+
- children: ReactNode (required). The embed: an `<iframe>` or a map's container. It fills the frame.
|
|
41
|
+
- errorLabel: string (default Could not load.). The words over the embed when `status` is `error`: say what failed and what to do.
|
|
42
|
+
- height: "sm" | "md" | "viewport" (default md). `sm` 18rem, `md` 24rem, or `viewport`, 55% of the small viewport's height, for a map that is
|
|
43
|
+
the page's main content.
|
|
44
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
45
|
+
- label: string (required). Names the frame's region: what the embed shows, as "Map of the shops".
|
|
46
|
+
- loadingLabel: string (default Loading). What a screen reader hears while `status` is `loading`.
|
|
47
|
+
- status: "loading" | "error" | "ready" (default ready). `loading` lays a pulsing cover over the embed and marks the region busy; `error` lays
|
|
48
|
+
`errorLabel` over it, announced. Set it from the embed's own load and error events.
|
|
@@ -56,7 +56,7 @@ import { Card, Text } from "@slashsuite/ui-react";
|
|
|
56
56
|
### EmptyState
|
|
57
57
|
The one empty look: what a list, a table or a page shows when there is nothing in it yet. Give it to the part's `empty` slot (`ListLayout`, `CardGrid`, `TableBody`, `Timeline`, `ChatThread`, a `Stack as="ul"`), which shows it when the part has no children and picks its size. `md` is a centred `title`, the `children` as the explanation under it (a `Text`, then `Steps` for a "get started" list), and `actions` (buttons, links) in a centred row at the bottom, with an optional `icon` above the title. A named `<section>`. On its own it draws a dashed frame round itself; inside a `Card` the card is the frame. `level` is the title's heading level, one below the heading that holds it: a 2 on the page, a 3 in a `Section`. `sm` is the one-line form for inside a table, a timeline or a list: the title as one centred muted line, the `children` under it in the same small text and the `actions` after. It is a plain block with no heading and no landmark, so a table cell or a card does not grow a region.
|
|
58
58
|
- actions: ReactNode. Buttons or links in a centred row at the bottom.
|
|
59
|
-
- icon: "page" | "grid" | "search" | "table" | "type" | "diff" | "baseline" | "review" | "ci" | "self-host" | "privacy" | "capture" | "branch" | "theme" | "speed" | "chevron-right" | "chevron-down" | "close" | "external-link" | "settings" | "bell" | "check" | "plus" | "more" | "window" | "card" | "pointer" | "field" | "compass" | "briefcase". One of the library's icons, at feature size in the muted ink above the title.
|
|
59
|
+
- icon: "page" | "grid" | "search" | "alert" | "table" | "type" | "diff" | "baseline" | "review" | "ci" | "self-host" | "privacy" | "capture" | "branch" | "theme" | "speed" | "chevron-right" | "chevron-down" | "close" | "external-link" | "settings" | "bell" | "check" | "plus" | "minus" | "more" | "window" | "card" | "pointer" | "field" | "compass" | "briefcase" | "cart" | "pause" | "play". One of the library's icons, at feature size in the muted ink above the title.
|
|
60
60
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
61
61
|
- level: 2 | 3 | 4 | 5 | 6 (default one below the heading that holds it: 2 on the page). The title's heading level, 2 to 6. It does not change how the title looks.
|
|
62
62
|
- padding: "default" | "inset" (default default). `inset` pads all four sides, for an empty state in a `Card flush`, whose body has no padding
|
|
@@ -65,3 +65,6 @@ sides inside its frame either way.
|
|
|
65
65
|
- size: "sm" | "md" (default the slot's: sm in a TableBody, a Timeline or a Stack as="ul", else md). `md` is the titled block; `sm` one muted line with no heading, for inside a table, a timeline or
|
|
66
66
|
a list. `icon` and `level` do nothing at `sm`.
|
|
67
67
|
- title: ReactNode (required). The heading, centred: what is missing ("No projects yet"). It names the section.
|
|
68
|
+
|
|
69
|
+
### Types
|
|
70
|
+
- EmptySize: `"sm" | "md"`. An `EmptyState`'s size: `md` a block with its heading, `sm` one muted line inside a card or a cell.
|
|
@@ -42,7 +42,7 @@ function Example() {
|
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### Do
|
|
45
|
-
- Render it only while it is open, and give every string it shows: `title`, `label`, `placeholder`, `hint`, `emptyReason`, `submit` and `busyLabel`, and a `description` under the title when the question needs a sentence.
|
|
45
|
+
- Render it only while it is open, and give every string it shows: `title`, `label`, `placeholder`, `hint`, `emptyReason`, `submit` and `busyLabel`, and a `description` under the title when the question needs a sentence. `cancelLabel` rewords Cancel, for an app in another language.
|
|
46
46
|
- `onSubmit` gets the trimmed value and returns a promise. Resolving closes the dialog; rejecting shows the error message under the field and keeps the dialog open.
|
|
47
47
|
- More than one field is a `Dialog` with `onSubmit` holding its `Field`s, or a `Drawer`.
|
|
48
48
|
|
|
@@ -78,16 +78,17 @@ function Example() {
|
|
|
78
78
|
### Accessibility
|
|
79
79
|
- It is a `Dialog`: native `<dialog>`, page behind inert, focus kept inside, Esc closes, named by its `title`.
|
|
80
80
|
- The input has focus when it opens and is named by `label`.
|
|
81
|
-
-
|
|
82
|
-
- While `onSubmit` is pending the button is busy (`aria-busy`); a rejection shows in the field's error line,
|
|
81
|
+
- The submit button is never disabled: an empty submit marks the field invalid, shows `emptyReason` as its error (announced politely) and moves the focus to it. Typing clears the error.
|
|
82
|
+
- While `onSubmit` is pending the button is busy (`aria-busy`); a rejection shows in the field's error line, announced politely from a live region inside the dialog.
|
|
83
83
|
|
|
84
84
|
### Props
|
|
85
85
|
### FieldDialog
|
|
86
86
|
A `Dialog` with one text field and Cancel / submit buttons. Render it only while open.
|
|
87
87
|
- busyLabel: string (required). What the submit button says while `onSubmit` runs.
|
|
88
|
+
- cancelLabel: string (default Cancel). The button that closes the dialog without submitting, for an app in another language.
|
|
88
89
|
- description: string. A muted line under the title.
|
|
89
|
-
- emptyReason: string (required).
|
|
90
|
-
- hint: string (required). A muted line under the field
|
|
90
|
+
- emptyReason: string (required). The field's error when it is submitted empty: the submit button stays enabled, so this says what is missing.
|
|
91
|
+
- hint: string (required). A muted line under the field.
|
|
91
92
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
92
93
|
- label: string (required). The visible label above the field, which names it.
|
|
93
94
|
- onClose: () => void (required). Called when the dialog closes: Cancel, Esc, the backdrop, or a resolved `onSubmit`.
|
|
@@ -18,9 +18,10 @@ import { Field, Input } from "@slashsuite/ui-react";
|
|
|
18
18
|
- Wrap every `Input`, `Textarea` and `Select` in a `Field`, with no `htmlFor` and no `id` on the control: the `Field` links its label, hint and error to the control itself, and the `label` is always in the accessibility tree. Pass `htmlFor` only when something else must name the control by a fixed id.
|
|
19
19
|
- `labelHidden` draws no label text but keeps it for assistive tech: use it only when the control's purpose is plain from what surrounds it (a search box in a toolbar). Otherwise leave the label visible; a placeholder is not a label. With `layout="row"` it draws as a column.
|
|
20
20
|
- A `hint` is the one line of help under the control.
|
|
21
|
-
-
|
|
21
|
+
- `required` puts a red asterisk after the label (hidden from a screen reader, which hears the control's own required state) and marks the control required.
|
|
22
|
+
- A validation message is `error`, not `hint`: a red line with an alert icon under the hint, which stays in view while the value is fixed.
|
|
22
23
|
- Inside a `FormGrid` a `Field` takes one column; `span="full"` runs it across both.
|
|
23
|
-
- A `Checkbox`, a `Switch`, a `RadioGroup` and a `
|
|
24
|
+
- A `Checkbox`, a `Switch`, a `RadioGroup`, a `DateField` and a `NumberField` draw their own `label` and note (a `hint`, and an `error` under it); do not wrap them in a `Field`. A group of them is a `Fieldset`.
|
|
24
25
|
- `layout="row"` puts the label beside the control, for a compact setting or a drawer row: the hint or error sits under the control, and stacked rows line their controls up.
|
|
25
26
|
|
|
26
27
|
### Don't
|
|
@@ -43,14 +44,14 @@ import { Field, Input } from "@slashsuite/ui-react";
|
|
|
43
44
|
|
|
44
45
|
### Accessibility
|
|
45
46
|
- The label is a real `<label>` tied to the control, so clicking the text focuses the control and a screen reader reads it as the control's name.
|
|
46
|
-
- An `error` is
|
|
47
|
-
- The control is described by the hint
|
|
48
|
-
-
|
|
47
|
+
- An `error` is not an alert: its text is announced once, politely, through the page's one live region for field errors (the open dialog's, inside a dialog), so several errors at once queue rather than interrupt each other.
|
|
48
|
+
- The control is described by the hint and then the error through `aria-describedby`, so a screen reader on the control hears both.
|
|
49
|
+
- The control is `aria-invalid="false"` until an error shows; an `error` marks it `aria-invalid` and turns its edge red. A value the browser finds invalid (`required`, `type="email"`) turns the edge red too, once the user has changed it or tried to submit.
|
|
49
50
|
|
|
50
51
|
### Props
|
|
51
52
|
### Field
|
|
52
|
-
A label above a control, with a hint
|
|
53
|
-
- error: ReactNode.
|
|
53
|
+
A label above a control, with a hint line under it and, when set, an error line under the hint (an alert icon and red text, announced politely). The hint stays while the error shows. `required` marks the label with a red asterisk and makes the control inside `required`. Inside a `FormGrid`, `span="full"` runs the field across both columns. The `Input`, `Select`, `Textarea` or `FileDrop` inside takes the label, the note (`aria-describedby`) and, with an error, `aria-invalid` and a red edge by itself: give it no `id` and the Field no `htmlFor`. While `loading` the label is drawn and the control is a bone of its height, read from the density around it (`sm` in a `sm` card or table).
|
|
54
|
+
- error: ReactNode. A red line under the hint, with an alert icon; the control is `aria-invalid` while it shows.
|
|
54
55
|
- hint: ReactNode. A muted line under the control that says more.
|
|
55
56
|
- htmlFor: string. A fixed id for the control inside, only when something else must name it. Unset, the Field makes one.
|
|
56
57
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
@@ -65,4 +66,6 @@ their controls up; a long label wraps inside it. `column` puts the label above i
|
|
|
65
66
|
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
66
67
|
Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
|
|
67
68
|
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
69
|
+
- required: boolean (default false). The control must be filled: a red asterisk after the label (hidden from assistive tech) and
|
|
70
|
+
`required` on the `Input`, `Select`, `Textarea` or `FileDrop` inside.
|
|
68
71
|
- span: "full". `full` spans every column of a `FormGrid`; unset takes one. It does nothing outside a `FormGrid`.
|
|
@@ -24,7 +24,7 @@ import { Checkbox, Fieldset } from "@slashsuite/ui-react";
|
|
|
24
24
|
- Several checkboxes answering one question: a `Fieldset` with the `Checkbox`es straight inside.
|
|
25
25
|
- A set of fields that belong together (opening hours, a low and high pair): a `Fieldset` round `Field`s, in a `FormGrid` for a row.
|
|
26
26
|
- The filter chips of one facet: a `Fieldset` round a `ButtonGroup` of `variant="outline"` `size="sm"` `Button`s with `pressed`. One `Fieldset` per facet; stack several in a `Stack`.
|
|
27
|
-
- The `label` names the group in the `Field` label's look. A `hint` is one muted line under the group, and an `error`
|
|
27
|
+
- The `label` names the group in the `Field` label's look. A `hint` is one muted line under the group, and an `error` goes under it in red.
|
|
28
28
|
- One choice of several is a `RadioGroup`, which is its own group: never put it in a `Fieldset`. One control is a `Field`, or a `Checkbox` or `Switch` on its own.
|
|
29
29
|
|
|
30
30
|
### Don't
|
|
@@ -70,13 +70,13 @@ import { Fieldset, Radio, RadioGroup } from "@slashsuite/ui-react";
|
|
|
70
70
|
|
|
71
71
|
### Accessibility
|
|
72
72
|
- A `<fieldset>` named by its `<legend>`, so a screen reader announces the group's name on entering it.
|
|
73
|
-
- The hint
|
|
73
|
+
- The hint and then the error are the group's `aria-describedby`; the error is announced politely when it appears.
|
|
74
74
|
- `disabled` on the group disables every control in it.
|
|
75
75
|
|
|
76
76
|
### Props
|
|
77
77
|
### Fieldset
|
|
78
|
-
A labelled group of controls: several `Checkbox`es answering one question, a set of `Field`s that belong together, or the filter chips of one facet (a `ButtonGroup` of `outline` `sm` pressed `Button`s). It is a `<fieldset>` named by its `label`, drawn as its `<legend>` in the `Field` label's look, over the children in one column; a `ButtonGroup` or a `FormGrid` inside lays out a row. `hint` is a muted line under the group and its `aria-describedby`; `error`
|
|
78
|
+
A labelled group of controls: several `Checkbox`es answering one question, a set of `Field`s that belong together, or the filter chips of one facet (a `ButtonGroup` of `outline` `sm` pressed `Button`s). It is a `<fieldset>` named by its `label`, drawn as its `<legend>` in the `Field` label's look, over the children in one column; a `ButtonGroup` or a `FormGrid` inside lays out a row. `hint` is a muted line under the group and its `aria-describedby`; `error` adds a red line under it with an alert icon, announced politely. `disabled` disables every control inside. One choice of several is a `RadioGroup`, never inside a `Fieldset`. Other props go on the `<fieldset>`.
|
|
79
79
|
- children: ReactNode. `Checkbox`es, `Field`s (in a `FormGrid` for a row), or a `ButtonGroup` of chips.
|
|
80
|
-
- error: ReactNode. A red line under the
|
|
80
|
+
- error: ReactNode. A red line under the hint, with an alert icon, announced politely.
|
|
81
81
|
- hint: ReactNode. A muted line under the group.
|
|
82
82
|
- label: ReactNode (required). The group's name, drawn as its `<legend>`.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
## FlowDiagram
|
|
2
|
+
|
|
3
|
+
Group: Data
|
|
4
|
+
|
|
5
|
+
When to use: Things that move from one step to another along named arrows, loops and branches included: a review flow, a deploy pipeline, the states an order goes through.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
One box carries a tone, the step that waits on a person, and its label says so too.
|
|
9
|
+
```tsx
|
|
10
|
+
import { FlowDiagram } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<FlowDiagram
|
|
13
|
+
label="How a build lands"
|
|
14
|
+
nodes={[
|
|
15
|
+
{ id: "launched", label: "Building" },
|
|
16
|
+
{ id: "gate", label: "Waiting on a reviewer", tone: "warn" },
|
|
17
|
+
{ id: "merged", label: "Merged" },
|
|
18
|
+
]}
|
|
19
|
+
edges={[
|
|
20
|
+
{ from: "launched", to: "gate", label: "hand off" },
|
|
21
|
+
{ from: "gate", to: "launched", label: "send back" },
|
|
22
|
+
{ from: "gate", to: "merged", label: "land" },
|
|
23
|
+
]}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Do
|
|
28
|
+
- Give it `nodes` (`{ id, label }`) and `edges` (`{ from, to }`, by id) and nothing else: it ranks the boxes along the arrows and routes every arrow round them, loops and arrows back included. Their order is only a hint.
|
|
29
|
+
- `label` on an edge is a word or two: the event or the action that moves along it (`submit`, `approve`).
|
|
30
|
+
- `direction` is `down` (default) for a flow read from the top, or `right` for a short pipeline read from the start.
|
|
31
|
+
- `tone` says what a box means: `warn` for a step that waits on a person, `danger` for a failure, `positive` for done. Say it in the label too, and leave the rest `neutral`.
|
|
32
|
+
- `content` goes under a box's label and the box grows to hold it: a few `Pill`s, a short list. It is display only, so no links or buttons.
|
|
33
|
+
- `group` frames boxes that belong together (a lane, an owner) in a dashed frame named by it. `active` rings the one box a thing is in now.
|
|
34
|
+
- `overlay` draws on top of the diagram in its own coordinates, from each box's place and each arrow's SVG path (`FlowLayout`): a marker on an arrow, a count over a box.
|
|
35
|
+
- A diagram wider or taller than its room scrolls inside its own box, so the page never scrolls sideways.
|
|
36
|
+
|
|
37
|
+
### Don't
|
|
38
|
+
- Do not colour every box: a tone on every step means nothing.
|
|
39
|
+
- Do not draw steps that only run in a line with no branch or loop: that is `Steps`.
|
|
40
|
+
|
|
41
|
+
A tone on every box means nothing: the one that needs a person no longer stands out.
|
|
42
|
+
```tsx
|
|
43
|
+
import { FlowDiagram } from "@slashsuite/ui-react";
|
|
44
|
+
|
|
45
|
+
<FlowDiagram
|
|
46
|
+
label="How a build lands"
|
|
47
|
+
nodes={[
|
|
48
|
+
{ id: "launched", label: "Building", tone: "info" },
|
|
49
|
+
{ id: "gate", label: "Waiting on a reviewer", tone: "warn" },
|
|
50
|
+
{ id: "merged", label: "Merged", tone: "positive" },
|
|
51
|
+
]}
|
|
52
|
+
edges={[
|
|
53
|
+
{ from: "launched", to: "gate", label: "hand off" },
|
|
54
|
+
{ from: "gate", to: "launched", label: "send back" },
|
|
55
|
+
{ from: "gate", to: "merged", label: "land" },
|
|
56
|
+
]}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Accessibility
|
|
61
|
+
- The diagram is an image named by `label`, with the count of boxes and arrows. It takes the keyboard focus so a diagram that scrolls can be scrolled with the arrow keys.
|
|
62
|
+
- A visually hidden list after it carries every box, in `nodes` order: its label, `current` for `active`, its group, its content, and an item per arrow out of it naming the target and the arrow's label.
|
|
63
|
+
- `overlay` is hidden from assistive tech and the pointer: say in a box's label or content what it shows.
|
|
64
|
+
|
|
65
|
+
### Props
|
|
66
|
+
### FlowDiagram
|
|
67
|
+
Boxes joined by arrows, laid out for you: a flow, a pipeline, a state machine. Give it the `nodes` and the `edges` between them and it places every box in ranks `direction` (`down` or `right`) and routes every arrow round them, loops and arrows back up included (dagre's layered layout). Each box is as wide as its label and its `content`, so no text spills; boxes with a `group` share a dashed frame; `active` rings one box in the accent. The diagram is drawn at its own size and scrolls inside its own box when it is wider or taller than the room it has, so it never makes the page scroll sideways. It is an image named by `label`; every box and every arrow is also a visually hidden list after it. `overlay` draws on top of the diagram in its own coordinates: it is handed the laid-out `FlowLayout` (each box's place and each arrow's SVG path), for a marker that follows an arrow. It is not hit by the pointer, and it is hidden from a screen reader. While `loading` with no nodes it draws one bone the height of a small diagram.
|
|
68
|
+
- active: string. The `id` of the one box to ring in the accent: the current step, the state a thing is in now.
|
|
69
|
+
- direction: "down" | "right" (default down). Where the arrows run: `down` (top to bottom) or `right` (start to end).
|
|
70
|
+
- edges: readonly FlowEdge[] (required). The arrows. One whose `from` or `to` is not a node's `id` is not drawn.
|
|
71
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
72
|
+
- label: string (required). What the diagram shows: its accessible name, and the name of its hidden list.
|
|
73
|
+
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
74
|
+
Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
|
|
75
|
+
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
76
|
+
- nodes: readonly FlowNode[] (required). The boxes, each with a unique `id`. Their order is only a hint: the layout ranks them by the arrows.
|
|
77
|
+
- overlay: ((layout: FlowLayout) => ReactNode). Draws on top of the diagram, in its coordinates, from the laid-out boxes and arrow paths.
|
|
78
|
+
|
|
79
|
+
### Types
|
|
80
|
+
- FlowNode: `{ id: string; label: string; tone?: Tone; group?: string; content?: ReactNode }`. One box of a `FlowDiagram`: its `id` (what an arrow's `from` and `to` name), its `label`, a `tone` that says what it means, the `group` it is framed in, and `content` drawn under the label (a few `Pill`s, a short list).
|
|
81
|
+
- FlowEdge: `{ from: string; to: string; label?: string }`. One arrow of a `FlowDiagram`, from one node's `id` to another's, with an optional short `label` on it.
|
|
82
|
+
- FlowDirection: `"down" | "right"`. `down` reads from the top, `right` from the start edge.
|
|
83
|
+
- FlowLayout: `{ width: number; height: number; nodes: readonly FlowNodeBox[]; groups: readonly (FlowBox & { name: string })[]; edges: readonly FlowEdgePath[] }`. The whole diagram as laid out, in one coordinate space: `width` and `height`, a box per node and per group, and a path per arrow. `FlowDiagram` hands it to `overlay`.
|
|
84
|
+
- FlowNodeBox: `{ x: number; y: number; width: number; height: number; id: string }`. A node as laid out: its `id` and its box. A group's box (`group`) is the frame round its nodes.
|
|
85
|
+
- FlowEdgePath: `{ from: string; to: string; index: number; points: readonly FlowPoint[]; path: string; labelAt: FlowPoint | null }`. An arrow as laid out: the `from` and `to` ids, its place in `edges` (`index`), the points dagre routed it through, the SVG path drawn through them (it ends on the target's edge, at the arrowhead's tip) and its label's centre when it has one.
|
|
86
|
+
- FlowBox: `{ x: number; y: number; width: number; height: number }`. Where a node or a group sits, its top left corner and its size, in CSS pixels.
|
|
87
|
+
- FlowPoint: `{ x: number; y: number }`. A point in the diagram's own space, in CSS pixels from its top left corner.
|
|
@@ -94,6 +94,7 @@ import {
|
|
|
94
94
|
- Save and Cancel go in `actions`, at the end of the form: a `type="submit"` Button first, then a ghost Cancel. The header has no `actions` here.
|
|
95
95
|
- Handle the submit with `onSubmit`: other props go on the `<form>` itself.
|
|
96
96
|
- A failed submit (the server refused it, no connection) is `error`: an alert directly above the `actions`. An error about one field is that `Field`'s `error`.
|
|
97
|
+
- A closing remark about the whole form (when you will hear back, what happens next) is `note`: a muted line set apart under the `actions`. A remark about one field is that `Field`'s `hint`.
|
|
97
98
|
- A form in a small panel is a `Dialog` or `FieldDialog`; a sign-in is `CenteredLayout`.
|
|
98
99
|
|
|
99
100
|
### Don't
|
|
@@ -128,7 +129,7 @@ import { Button, Card, Field, Input, ListLayout, Stack } from "@slashsuite/ui-re
|
|
|
128
129
|
|
|
129
130
|
### Props
|
|
130
131
|
### FormLayout
|
|
131
|
-
A form page: header (no header `actions`), then a `max-w-3xl` column that starts at the Container's start edge (it is not re-centred), with an `actions` row at the end. `error` is the submit's failure, a danger `Callout` (an alert) directly above that row. Other props go on the `<form>`. While `loading` it owns the wait and passes it to everything inside, the header too.
|
|
132
|
+
A form page: header (no header `actions`), then a `max-w-3xl` column that starts at the Container's start edge (it is not re-centred), with an `actions` row at the end. `note` is a muted line under that row, set apart from the form: a closing remark about the whole submit (when you will hear back, what happens next), never a field's hint. `error` is the submit's failure, a danger `Callout` (an alert) directly above that row. Other props go on the `<form>`. While `loading` it owns the wait and passes it to everything inside, the header too.
|
|
132
133
|
- actions: ReactNode. The row at the end of the form: its submit and cancel buttons.
|
|
133
134
|
- breadcrumbs: ReactNode. A `Breadcrumbs` above the title.
|
|
134
135
|
- description: ReactNode. The lede under the title: a `Lead`, so it outranks the body text after it.
|
|
@@ -137,5 +138,7 @@ alert directly above the `actions`. An error about one field is that `Field`'s `
|
|
|
137
138
|
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
138
139
|
Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
|
|
139
140
|
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
141
|
+
- note: ReactNode. A muted line under the `actions`, set apart from them: a closing remark about the whole form
|
|
142
|
+
("We reply within two working days."). A note about one field is that `Field`'s `hint`.
|
|
140
143
|
- tabs: ReactNode. A `Tabs` (or similar) under the title.
|
|
141
144
|
- title: ReactNode (required). The page's `h1`.
|
|
@@ -24,7 +24,7 @@ import { Button, FormRow, FormRowField, Input } from "@slashsuite/ui-react";
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
### Do
|
|
27
|
-
- A form of several fields is a `FormGrid` of `Field`s: two columns
|
|
27
|
+
- A form of several fields is a `FormGrid` of `Field`s: two columns once the grid is 36rem wide (its own width, so one in a `Dialog`), one below. A long control, such as a `Textarea`, takes `span="full"`.
|
|
28
28
|
- A line of controls to edit one record in place is a `FormRow` of `FormRowField`s, with the save `Button` as `actions`.
|
|
29
29
|
- `FormRowField` `span` 1 to 4 is its share of the row's width.
|
|
30
30
|
- The `hint` or `error` goes on the `FormRow`, once, under the whole line. A `FormRowField` has no hint or error, and a `Field` does not belong inside a `FormRow`.
|
|
@@ -64,14 +64,14 @@ import { Field, FormGrid, Input, Textarea } from "@slashsuite/ui-react";
|
|
|
64
64
|
|
|
65
65
|
### Accessibility
|
|
66
66
|
- `FormRowField` renders a `<label>` tied to its control by `htmlFor`, as `Field` does.
|
|
67
|
-
- The row's `error` is
|
|
68
|
-
-
|
|
67
|
+
- The row's `error` sits under its hint and is announced politely, as `Field`'s is.
|
|
68
|
+
- Narrower than 36rem (the row's own width) the fields and the action stack in reading order.
|
|
69
69
|
|
|
70
70
|
### Props
|
|
71
71
|
### FormRow
|
|
72
|
-
An inline-edit row: several controls side by side with proportional widths (`FormRowField` `span` 1 to 4), optional `actions` after them (a save button), and one `hint` or `error` line under the whole row. Every control sits on the bottom edge, so the actions line up with them whatever the labels do.
|
|
72
|
+
An inline-edit row: several controls side by side with proportional widths (`FormRowField` `span` 1 to 4), optional `actions` after them (a save button), and one `hint` or `error` line under the whole row. Every control sits on the bottom edge, so the actions line up with them whatever the labels do. Narrower than 36rem (the row's own width, not the viewport's) the fields and the actions stack. The row owns the note, so the fields beside each other keep their height: a `FormRowField` has no `hint` or `error` of its own.
|
|
73
73
|
- actions: ReactNode. A button or two after the last field. It keeps its own width.
|
|
74
|
-
- error: ReactNode.
|
|
74
|
+
- error: ReactNode. A red line under the hint, announced politely, as `Field`'s is.
|
|
75
75
|
- hint: ReactNode. One muted line under the whole row.
|
|
76
76
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
77
77
|
|
|
@@ -86,8 +86,8 @@ Left out, the part takes the nearest loading layout's or part's; `false` opts it
|
|
|
86
86
|
- span: 2 | 3 | 4 | 1 (default 1). The field's share of the row, 1 to 4: a `span` of 2 is twice as wide as a 1.
|
|
87
87
|
|
|
88
88
|
### FormGrid
|
|
89
|
-
Two columns of `Field`s
|
|
89
|
+
Two columns of `Field`s once the grid is 36rem wide, one below that. It folds by its own width, not the viewport's, so it stays one column in a `Dialog` or a side column. A `Field` takes one column; `span="full"` runs it across both, and a `FormRow` is always full width.
|
|
90
90
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
91
91
|
|
|
92
92
|
### Types
|
|
93
|
-
- FormRowSpan: `
|
|
93
|
+
- FormRowSpan: `2 | 3 | 4 | 1`. Relative widths in a `FormRow`: a field of `span` 2 is twice as wide as one of `span` 1.
|