@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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
## ProductTile
|
|
2
|
+
|
|
3
|
+
Group: Content
|
|
4
|
+
|
|
5
|
+
When to use: A shop's grid of products, or a row of them on a landing page.
|
|
6
|
+
|
|
7
|
+
### Use instead
|
|
8
|
+
- Price (price.md): The price stands alone: a cart line or a product's own page.
|
|
9
|
+
- MediaTile (media-tile.md): The tile is a photo or a video to open, not a thing to buy.
|
|
10
|
+
|
|
11
|
+
### The one right way
|
|
12
|
+
A shop's grid is `ProductTile`s in a `CardGrid`: each one link, named by its name and price.
|
|
13
|
+
```tsx
|
|
14
|
+
import { CardGrid, ProductTile } from "@slashsuite/ui-react";
|
|
15
|
+
|
|
16
|
+
<CardGrid as="ul" columns={3} minColumns={2}>
|
|
17
|
+
<ProductTile href="#print-dusk" name="Print: harbour at dusk" src={first?.src} price="R420" />
|
|
18
|
+
<ProductTile
|
|
19
|
+
href="#print-hills"
|
|
20
|
+
name="Print: hills over the bay"
|
|
21
|
+
src={second?.src}
|
|
22
|
+
price="R380"
|
|
23
|
+
was="R450"
|
|
24
|
+
status="sale"
|
|
25
|
+
/>
|
|
26
|
+
<ProductTile
|
|
27
|
+
href="#print-moon"
|
|
28
|
+
name="Print: the bay by moonlight"
|
|
29
|
+
src={third?.src}
|
|
30
|
+
price="R420"
|
|
31
|
+
status="sold-out"
|
|
32
|
+
/>
|
|
33
|
+
</CardGrid>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Do
|
|
37
|
+
- `href` is the product's page; the whole tile is one link, and an in-app path goes through `LinkProvider`.
|
|
38
|
+
- `name` and `price` are the tile's words; `was` adds the old price on a sale, as `Price` does.
|
|
39
|
+
- `status` puts a word on the picture's top-left corner: `sale` in the danger tone, `sold-out` on the media scrim. `statusLabel` is that word in the app's own language.
|
|
40
|
+
- `src` is the picture, cropped `square` (the default) or `3:4` for clothes on a person. It is decoration: the name says what it is.
|
|
41
|
+
- Put a set of them in a `CardGrid` with `as="ul"`, and `minColumns={2}` to keep two to a row on a phone.
|
|
42
|
+
|
|
43
|
+
### Don't
|
|
44
|
+
- Do not link the picture and the name apart: that is two stops for a keyboard, and the picture's link has no name.
|
|
45
|
+
|
|
46
|
+
A picture with a separate link under it is two stops for a keyboard, and the picture's link has no name.
|
|
47
|
+
```tsx
|
|
48
|
+
<div>
|
|
49
|
+
<a href="#print-dusk">
|
|
50
|
+
<img src={first?.src} alt="" />
|
|
51
|
+
</a>
|
|
52
|
+
<a href="#print-dusk">Print: harbour at dusk</a> R420
|
|
53
|
+
</div>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Accessibility
|
|
57
|
+
- One link, named by what it says: "Linen shirt, R52, was R65, Sale". The picture has an empty `alt`.
|
|
58
|
+
- While `loading` the picture, name and price that are not here yet are bones and the link is `aria-busy`.
|
|
59
|
+
- `id`, `data-*` and `aria-*` go on the link.
|
|
60
|
+
|
|
61
|
+
### Props
|
|
62
|
+
### ProductTile
|
|
63
|
+
One thing for sale in a shop's grid: its picture, its name and its `Price` (with the was price on a sale), and a corner word for `sale` or `sold-out`. The whole tile is one link to the product's page, named by what it says: "Linen shirt, R52, was R65, Sale". The picture is decoration, since the name says what it is. It fills its column, so a set of them goes in a `CardGrid`. While `loading` the picture, the name and the price that are not here yet are bones.
|
|
64
|
+
- aspect: "square" | "3:4" (default square). The picture's shape: `square` for most things, `3:4` for clothes on a person.
|
|
65
|
+
- href: string (required). The product's page; an in-app path goes through `LinkProvider`.
|
|
66
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
67
|
+
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
68
|
+
Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
|
|
69
|
+
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
70
|
+
- name: string | undefined (required). The product's name, the tile's first words. While `loading`, none yet is a bone.
|
|
71
|
+
- price: string | undefined (required). The price, formatted by the app ("R52"), as `Price`'s `value`.
|
|
72
|
+
- src: string. The product's picture. Left out, or if it fails to load, the picture's placeholder shows.
|
|
73
|
+
- status: "sale" | "sold-out". A word on the picture's top-left corner: `sale`, or `sold-out` when there are none left.
|
|
74
|
+
- statusLabel: string (default Sale, or Sold out). The corner's word, for an app in another language.
|
|
75
|
+
- was: string. The price before the sale, struck through after `price`.
|
|
76
|
+
|
|
77
|
+
### Types
|
|
78
|
+
- ProductTileStatus: `"sale" | "sold-out"`. What a tile's corner says: the thing is on sale, or there are none left.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## PromoBanner
|
|
2
|
+
|
|
3
|
+
Group: Content
|
|
4
|
+
|
|
5
|
+
When to use: A shop's offer of the week, above the header or as the page's first block: one line and one action.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
One offer and one action whose words say where it goes.
|
|
9
|
+
```tsx
|
|
10
|
+
import { PromoBanner } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<PromoBanner action="Shop refills" href="#refills">
|
|
13
|
+
Refills from R390 this week
|
|
14
|
+
</PromoBanner>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Do
|
|
18
|
+
- `children` is the offer, one short line ("Refills from R390 this week"); `action` is the action's words ("Shop refills").
|
|
19
|
+
- `href` makes the action a link (an in-app path goes through `LinkProvider`); `onClick` a button, to open a dialog.
|
|
20
|
+
- Put it above the `AppShell`'s header or as the first block of the page, one per page. The fill and the action's colours are the theme's, held to AA in every theme.
|
|
21
|
+
|
|
22
|
+
### Don't
|
|
23
|
+
- Do not make a strip from a `Callout` and a `Button`: a toned callout is a message about the page, and an outline button on its tint is not held to the offer's contrast.
|
|
24
|
+
|
|
25
|
+
A toned Callout is a message about the page, not an offer, and its button is not held to the strip's contrast.
|
|
26
|
+
```tsx
|
|
27
|
+
import { Callout } from "@slashsuite/ui-react";
|
|
28
|
+
|
|
29
|
+
<Callout tone="positive" title="Refills from R390 this week">
|
|
30
|
+
Shop refills on the refills page.
|
|
31
|
+
</Callout>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Accessibility
|
|
35
|
+
- The offer is a paragraph and the action a link or a button named by its words, so the action says what it does without the offer.
|
|
36
|
+
- The action's focus ring is drawn inside it, so it shows on the accent fill.
|
|
37
|
+
- `id`, `data-*` and `aria-*` go on the strip.
|
|
38
|
+
|
|
39
|
+
### Props
|
|
40
|
+
### PromoBanner
|
|
41
|
+
A slim full-width strip that carries one offer and one action: "Refills from R390 this week", then "Shop refills". It is the theme's accent fill with its label colour, and the action is a small surface pill on it, so both hold AA contrast in every theme. Put it above the `AppShell`'s header or as the first block of the page; one per page. The words wrap and stay centred on a phone. With `href` the action is a link (an in-app path goes through `LinkProvider`), with `onClick` a button.
|
|
42
|
+
- action: string (required). The action's words: "Shop refills".
|
|
43
|
+
- children: ReactNode (required). The offer, one short line: "Refills from R390 this week".
|
|
44
|
+
- href: string. Where the action goes; an in-app path goes through `LinkProvider`.
|
|
45
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
46
|
+
- onClick: MouseEventHandler<HTMLButtonElement>. The action as a button instead of a link: it opens a dialog, say.
|
|
@@ -84,4 +84,4 @@ Left out, the part takes the nearest loading layout's or part's; `false` opts it
|
|
|
84
84
|
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
85
85
|
- tabs: ReactNode. A `Tabs` (or similar) under the title.
|
|
86
86
|
- title: ReactNode (required). The page's `h1`.
|
|
87
|
-
- width: "
|
|
87
|
+
- width: "full" | "narrow" | "wide" (default narrow). The column's width, as a `Stack`'s: `narrow` max-w-3xl, `wide` max-w-5xl, `full` the Container's width.
|
|
@@ -18,7 +18,7 @@ import { Radio, RadioGroup } from "@slashsuite/ui-react";
|
|
|
18
18
|
### Do
|
|
19
19
|
- Give the `RadioGroup` a `label` that names the question, and a `Radio` per option with its own `label` and a `value`.
|
|
20
20
|
- Keep the choice with `defaultValue`, or control it with `value` and `onChange(value)`. `name` posts it in a form.
|
|
21
|
-
- A `hint` on a `Radio` is a muted line under its label, for the option that needs a sentence; a `hint` on the group is a line under the group's label.
|
|
21
|
+
- A `hint` on a `Radio` is a muted line under its label, for the option that needs a sentence; a `hint` on the group is a line under the group's label. When every option needs one (a plan, a delivery speed), `variant="card"` makes each a bordered card, the label its title.
|
|
22
22
|
- An `error` on the group is a red line under the options and marks every circle red; it is the same wording rule as `Field`'s. The group draws its own label and error, so it is never put in a `Field`.
|
|
23
23
|
- `disabled` on the group disables every option; on a `Radio` it disables that one. Say why in the group's `hint`.
|
|
24
24
|
- `required` marks a choice the form cannot submit without; the group is `aria-required`.
|
|
@@ -39,17 +39,17 @@ import { Checkbox, Stack } from "@slashsuite/ui-react";
|
|
|
39
39
|
### Accessibility
|
|
40
40
|
- The group is a `role="radiogroup"` named by its label; each `Radio` is a native `<input type="radio">` inside its `<label>`, so clicking the words chooses it.
|
|
41
41
|
- The group is one tab stop. The arrow keys move between the options and choose, wrapping at each end and skipping a disabled one.
|
|
42
|
-
- An `error` is
|
|
42
|
+
- An `error` is announced politely, not as an alert, and the group is `aria-invalid`; a `hint` is the option's `aria-describedby`.
|
|
43
43
|
- The focus ring is drawn round the option that has focus, by the component.
|
|
44
44
|
|
|
45
45
|
### Props
|
|
46
46
|
### RadioGroup
|
|
47
|
-
A named group of radios, one chosen. The `label` names the group; `hint` is a muted line under the options that says more (the group's description); an `error`
|
|
47
|
+
A named group of radios, one chosen. The `label` names the group; `hint` is a muted line under the options that says more (the group's description); an `error` adds a red line with an alert icon under it, announced politely, and marks the group invalid. `required` puts a red asterisk after the label. Give it `value` and `onChange`, or `defaultValue` and let it keep the choice. `name` posts the choice in a form. The arrow keys move between the radios and choose, and the group is one tab stop. `size` sizes every radio in the group, the same scale as a `Checkbox`. `variant="card"` draws each radio as an option card: a bordered box, its label the title and its hint the description, the chosen one with an accent edge. While `loading` the labels are drawn and each circle is a bone.
|
|
48
48
|
- children: ReactNode (required). The `Radio`s.
|
|
49
49
|
- defaultValue: string. The `value` chosen to begin with, when the group keeps its own choice.
|
|
50
50
|
- disabled: boolean. Disables every radio.
|
|
51
|
-
- error: ReactNode.
|
|
52
|
-
- hint: ReactNode. A muted line under the options that says more; it describes the group
|
|
51
|
+
- error: ReactNode. A red line under the hint, with an alert icon; marks the group invalid. Like `Field`'s `error`.
|
|
52
|
+
- hint: ReactNode. A muted line under the options that says more; it describes the group, and stays while `error` shows.
|
|
53
53
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
54
54
|
- label: ReactNode (required). The group's visible name, above the options.
|
|
55
55
|
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
@@ -57,10 +57,13 @@ Left out, the part takes the nearest loading layout's or part's; `false` opts it
|
|
|
57
57
|
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
58
58
|
- name: string. The form field the choice posts under.
|
|
59
59
|
- onChange: (value: string) => void. Called with the chosen radio's `value`.
|
|
60
|
-
- required: boolean. Marks the choice required: the group is `aria-required`, and a form will not submit with no option chosen.
|
|
60
|
+
- required: boolean. Marks the choice required: a red asterisk after the label, the group is `aria-required`, and a form will not submit with no option chosen.
|
|
61
61
|
- size: "sm" | "md" | "lg" (default md). The size of every radio in the group: `sm` is `text-xs` and a smaller circle, `lg` `text-base`
|
|
62
62
|
and a larger one.
|
|
63
63
|
- value: string. The `value` of the chosen radio.
|
|
64
|
+
- variant: "card" | "plain" (default plain). `plain` is a column of circles and their words. `card` makes each radio a bordered box the
|
|
65
|
+
width of the group, its label a title and its `hint` the description: for a few options that
|
|
66
|
+
each need a line of explaining (a plan, a delivery speed). The whole card is the click target.
|
|
64
67
|
|
|
65
68
|
### Radio
|
|
66
69
|
One option of a `RadioGroup`: a `label` and, under it, an optional `hint`. Click the label or the circle. While `loading` the circle is a bone.
|
|
@@ -5,7 +5,7 @@ Group: Content
|
|
|
5
5
|
When to use: A row of media or people that is longer than the page is wide: recent statuses, a team.
|
|
6
6
|
|
|
7
7
|
### The one right way
|
|
8
|
-
A row of media that runs past the page is a `ScrollStrip`: one line, a
|
|
8
|
+
A row of media that runs past the page is a `ScrollStrip`: one line, a themed scrollbar, snapping.
|
|
9
9
|
```tsx
|
|
10
10
|
import { MediaTile, ScrollStrip } from "@slashsuite/ui-react";
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ import { MediaTile, ScrollStrip } from "@slashsuite/ui-react";
|
|
|
19
19
|
### Do
|
|
20
20
|
- Put `MediaTile`s or `Avatar`s as the children and name the strip with `label`. They keep their own width and never shrink or wrap.
|
|
21
21
|
- `gap` is a `Cluster`'s: `xs`, `sm` (the default) or `md`; the `Size` type lists every default that is not `md`.
|
|
22
|
-
- It scrolls only when the items run past its width, with a
|
|
22
|
+
- It scrolls only when the items run past its width, with a themed scrollbar, and the items snap to the start edge.
|
|
23
23
|
|
|
24
24
|
### Don't
|
|
25
25
|
- Do not use it for a few items that fit: that is a `Cluster`. A grid that wraps is a `CardGrid`.
|
|
@@ -41,7 +41,7 @@ import { Cluster, MediaTile } from "@slashsuite/ui-react";
|
|
|
41
41
|
|
|
42
42
|
### Props
|
|
43
43
|
### ScrollStrip
|
|
44
|
-
A single row of items that scrolls sideways when it runs past the width of its parent, with a
|
|
44
|
+
A single row of items that scrolls sideways when it runs past the width of its parent, with a themed scrollbar and the items snapping into place: a strip of `MediaTile`s or `Avatar`s. Items never shrink or wrap. The strip takes the keyboard focus, so the arrow keys scroll it without a pointer. A grid that wraps is a `CardGrid` or a `Cluster`.
|
|
45
45
|
- children: ReactNode (required). The items, one after another: `MediaTile`s, `Avatar`s. They keep their own width.
|
|
46
46
|
- gap: "sm" | "md" | "xs" (default sm). The space between items, as `Cluster`'s `gap`.
|
|
47
47
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
@@ -114,7 +114,7 @@ A joined pill group where one option is filled: a mode or a range chosen in plac
|
|
|
114
114
|
- fill: boolean (default false). The group takes its parent's full width and the options grow to share it, so the border ends
|
|
115
115
|
at the last option. Still a pill.
|
|
116
116
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
117
|
-
- items: Segment[] (required). The options in order: `{ value, label }` buttons, or links (`href`), the current link marked by its `selected` or by a `value` equal to the group's. Either may carry a `count`; a button may be `disabled`.
|
|
117
|
+
- items: Segment[] | SwitchButton[] (required). The options in order: `{ value, label }` buttons, or links (`href`), the current link marked by its `selected` or by a `value` equal to the group's. Either may carry a `count`; a button may be `disabled`.
|
|
118
118
|
- label: string (required). The accessible name of the group.
|
|
119
119
|
- onChange: ((value: string) => void). Called with the option's `value` when one is chosen, by click or arrow key.
|
|
120
120
|
- size: Size | ResponsiveSize (default md). The control's height and text, on the scale of a `Button`. `{ base: "md", md: "lg" }` changes
|
|
@@ -130,4 +130,6 @@ filled pill from 32rem up. Implies `fill`.
|
|
|
130
130
|
For five options that will not fit one row.
|
|
131
131
|
|
|
132
132
|
### Types
|
|
133
|
-
- Segment: `
|
|
133
|
+
- Segment: `SwitchButton | SwitchLink`. One option of a SegmentedControl: a button with a `value`, or a link with an `href`; never both kinds in one group.
|
|
134
|
+
- SwitchButton: `{ label: ReactNode; count?: number; title?: string; value: string; disabled?: boolean; disabledReason?: string }`. An option that is a button: it calls `onChange(value)`.
|
|
135
|
+
- SwitchLink: `{ label: ReactNode; count?: number; title?: string; value?: string; selected?: boolean; external?: boolean; href: string }`. An option that is a link: `href`, drawn by the app's router link through `LinkProvider`. The router changes the page; `selected` on the item, or a `value` equal to the group's, marks the current one. `external` opens a new tab.
|
|
@@ -56,10 +56,15 @@ import { Field, Select } from "@slashsuite/ui-react";
|
|
|
56
56
|
### Select
|
|
57
57
|
A native `<select>` styled like `Input`, keeping the browser's own arrow, over its `items`. Takes `size` and `width` too: inside a `Field` it fills the row, and on its own it is as wide as its longest choice. The `ref` reaches the `<select>`.
|
|
58
58
|
- disabled: boolean (native). Disables the select; say why in its `Field` hint.
|
|
59
|
-
- items: readonly
|
|
59
|
+
- items: readonly SelectItem[] (required). The choices, in order.
|
|
60
60
|
- name: string (native). The key the value posts under in a form.
|
|
61
61
|
- ref: Ref<HTMLSelectElement>. The `<select>` itself, for focus control.
|
|
62
|
-
- size:
|
|
62
|
+
- size: Size | ResponsiveSize (default md). `sm` is compact, `text-sm` with less padding, for dense forms and table rows; `md` is `text-base`;
|
|
63
63
|
`lg` is `text-lg` with more padding, for a hero form. Under an `AppShell density="compact"` each
|
|
64
64
|
is one type step down, and on a touch screen a field is never under 16px.
|
|
65
|
-
|
|
65
|
+
`{ base: "md", md: "lg" }` changes size at the `md` breakpoint (48rem), in CSS, as a `Button`'s
|
|
66
|
+
does: give the field and the buttons in its row the same value, so the row stays aligned.
|
|
67
|
+
- width: "sm" | "md" | "lg" | "auto" | "xs" | "fill" | "full" (default full inside a `Field`, `auto` outside one). As an `Input`'s `width`.
|
|
68
|
+
|
|
69
|
+
### Types
|
|
70
|
+
- SelectItem: `{ value: string; label: string; disabled?: boolean }`. One choice of a `Select`.
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
- Give exactly one of `from` or `below`, each `sm`, `md` or `lg`. There is no default: the reader sees the rule.
|
|
65
65
|
- `as="span"` inside phrasing content: a run in a `<p>`, a `Kbd` hint in a button row.
|
|
66
66
|
- The wrapper adds no box, so its children sit in the parent's row, grid or `Stack` and the parent's gap spaces them. To keep two items together, put a `Cluster` inside the `Show`.
|
|
67
|
-
- Hidden content stays mounted, so two `Show`s of one stateful panel mount it twice. A panel shown at every width that folds on a phone is a `SideColumn
|
|
67
|
+
- Hidden content stays mounted, so two `Show`s of one stateful panel mount it twice. A panel shown at every width that folds on a phone is a `SideColumn fold`, not two `Show`s.
|
|
68
68
|
|
|
69
69
|
### Don't
|
|
70
70
|
- Never write `hidden sm:block` or `sm:hidden` in an app: the breakpoint is a `Show`.
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
|
|
111
111
|
### Props
|
|
112
112
|
### Show
|
|
113
|
-
Shows its children only from a width up (`from`) or only below it (`below`), by CSS alone: the same markup on the server and the client, with no script. Hidden is `display: none`, so the content is out of the accessibility tree and the tab order too. Shown, the wrapper adds no box, so the children sit in the parent's row, grid or Stack and take its gap. Content that only fits a wide screen is in a `Show from`; its narrow-screen form is in a `Show below` at the same breakpoint. Hidden content stays mounted, so two `Show`s of the same content mount it twice: a stateful panel shown at every width with a fold is a `SideColumn
|
|
113
|
+
Shows its children only from a width up (`from`) or only below it (`below`), by CSS alone: the same markup on the server and the client, with no script. Hidden is `display: none`, so the content is out of the accessibility tree and the tab order too. Shown, the wrapper adds no box, so the children sit in the parent's row, grid or Stack and take its gap. Content that only fits a wide screen is in a `Show from`; its narrow-screen form is in a `Show below` at the same breakpoint. Hidden content stays mounted, so two `Show`s of the same content mount it twice: a stateful panel shown at every width with a fold is a `SideColumn fold`. `as="span"` is for phrasing content (inside a `<p>` or a button row).
|
|
114
114
|
- as: "div" | "span" (default div). The element: `div`, or `span` inside phrasing content.
|
|
115
115
|
- below: "sm" | "md" | "lg". Shown below this width, gone from it up.
|
|
116
116
|
- from: "sm" | "md" | "lg". Shown from this width up, gone below it.
|
|
@@ -24,9 +24,10 @@ import { Card, SideColumn, Text } from "@slashsuite/ui-react";
|
|
|
24
24
|
|
|
25
25
|
### Do
|
|
26
26
|
- `children` are the main area and `aside` is the side column. From `lg` the aside is `asideWidth` wide on the right and the main area takes the room left; below `lg` the aside stacks under the main area.
|
|
27
|
-
- `
|
|
27
|
+
- `side="start"` puts the aside on the left from `lg` and first in reading order, so below `lg` it stacks above the main area. Use it for a column the main area depends on, such as filters; `end`, the default, is for one that supports it.
|
|
28
|
+
- `asideWidth` is `xs` (12rem), `sm` (18rem), `md` (24rem, the default) or `third` (one third of the row, the main area two thirds). `xs`, `sm` and `md` are exact, whatever the aside holds; there is no other width.
|
|
28
29
|
- `sticky` keeps the aside in view from `lg` as a long page scrolls: it sticks under the header and, when it is taller than the screen, scrolls itself.
|
|
29
|
-
- `asideLabel` is for an aside that should not take a phone's screen: below `lg` it folds, closed, behind a disclosure
|
|
30
|
+
- `asideLabel` names the aside's landmark. `fold` is for an aside that should not take a phone's screen: below `lg` it folds, closed, behind a disclosure named by `asideLabel` (so `fold` needs it), and from `lg` it is the same column, always shown, with no toggle. The aside stays mounted while folded, so state inside it is kept. Left out, the aside is always shown.
|
|
30
31
|
- It sets no page width, padding or header of its own: put it inside a layout, a `Card` or a panel. Space inside each column with a `Stack`.
|
|
31
32
|
- `DetailLayout`'s aside is a `SideColumn asideWidth="third"`, so a split inside a page that wants the thirds is `SideColumn asideWidth="third"`, never a `CardGrid`. A rail of links on the left is `SidebarLayout`. A `Stack` with `rowFrom` and a `ClusterGrow` sizes the side by its content, so it is not a fixed column.
|
|
32
33
|
|
|
@@ -52,19 +53,22 @@ import { Card, ClusterGrow, Overline, Stack, Text } from "@slashsuite/ui-react";
|
|
|
52
53
|
|
|
53
54
|
### Accessibility
|
|
54
55
|
- The side column is an `<aside>`, a complementary landmark; the main area is a plain `div`. Give the aside a heading, or set `asideLabel`, which also names it, when it needs a name.
|
|
55
|
-
- In the DOM the main area comes first and the aside second, so that is the reading and tab order on every screen.
|
|
56
|
+
- In the DOM the main area comes first and the aside second (the aside first with `side="start"`), so that is the reading and tab order on every screen.
|
|
56
57
|
- A `sticky` aside that is taller than the screen and holds no link or field takes a tab stop of its own, named by `asideLabel`, so the keyboard can scroll it.
|
|
57
|
-
- With `
|
|
58
|
+
- With `fold` the aside is a native `<details>` disclosure below `lg`: its `<summary>` is the toggle, on the keyboard like any button. From `lg` the summary is gone and, once the page has loaded, the `<details>` is open for real, so the aside is in the accessibility tree.
|
|
58
59
|
|
|
59
60
|
### Props
|
|
60
61
|
### SideColumn
|
|
61
|
-
A main area beside a side column, in the Container the page already has: from `lg` the `aside` is `asideWidth` on the right and `children` take the room left; below `lg` the aside stacks under `children`. It sets no page width, padding or header of its own, so it sits inside a layout, a `Card` or a panel. `asideWidth` is `sm` (18rem), `md` (24rem) or `third` (one third of the row, the main area two thirds: the split `DetailLayout` draws). A rail of links on the left is `SidebarLayout`. `asideLabel` is for an aside that should not take the phone's screen: below `lg` it folds, closed, behind a native disclosure
|
|
62
|
-
- aside: ReactNode (required). The side column: `asideWidth` wide on
|
|
63
|
-
- asideLabel: string.
|
|
64
|
-
- asideWidth: "sm" | "md" | "third" (default md). The aside's width from `lg`: `sm` 18rem, `md` 24rem, or `third`, one third of the row.
|
|
62
|
+
A main area beside a side column, in the Container the page already has: from `lg` the `aside` is `asideWidth` on the right and `children` take the room left; below `lg` the aside stacks under `children`. It sets no page width, padding or header of its own, so it sits inside a layout, a `Card` or a panel. `asideWidth` is `xs` (12rem), `sm` (18rem), `md` (24rem) or `third` (one third of the row, the main area two thirds: the split `DetailLayout` draws). A rail of links on the left is `SidebarLayout`. `side="start"` puts the aside on the left from `lg`, and first in reading order, so below `lg` it stacks above `children`. `asideLabel` names the `<aside>` landmark. `fold` is for an aside that should not take the phone's screen: below `lg` it folds, closed, behind a native disclosure named by `asideLabel`, and from `lg` it is the same column, always shown. The aside stays mounted while folded, so a conversation or a draft inside it is kept. `sticky` keeps the aside in view from `lg` as a long page scrolls: it sticks under AppShell's header and, if it is taller than the room left, scrolls itself (a tab stop named by `asideLabel`) so its end stays reachable.
|
|
63
|
+
- aside: ReactNode (required). The side column: `asideWidth` wide on `side` from `lg`, stacked with `children` below it.
|
|
64
|
+
- asideLabel: string. Names the `<aside>` landmark, and the disclosure when `fold` is set. Left out, the aside is unnamed.
|
|
65
|
+
- asideWidth: "sm" | "md" | "xs" | "third" (default md). The aside's width from `lg`: `xs` 12rem, `sm` 18rem, `md` 24rem, or `third`, one third of the row.
|
|
66
|
+
- fold: boolean (default false). Folds the aside, closed, behind a disclosure named by `asideLabel` below `lg`.
|
|
65
67
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
68
|
+
- side: "end" | "start" (default end). The aside's side from `lg`: `end` (the right) or `start` (the left, and first in reading order).
|
|
66
69
|
- sticky: boolean (default false). From `lg`, keeps the aside in view under the header as the page scrolls; an aside taller than
|
|
67
70
|
the screen scrolls inside itself.
|
|
68
71
|
|
|
69
72
|
### Types
|
|
70
|
-
-
|
|
73
|
+
- SideColumnSide: `"end" | "start"`. Which side of the main area a `SideColumn`'s aside sits on from `lg`: `end` (the right) or `start` (the left).
|
|
74
|
+
- SideColumnWidth: `"sm" | "md" | "xs" | "third"`. How wide a `SideColumn`'s aside is from `lg`: `xs` 12rem, `sm` 18rem, `md` 24rem, or `third` a third of the row.
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
- From `md` the rail is a fixed width beside the page; below it, the rail stacks above the page.
|
|
86
86
|
- From `md` the rail stays in view under the shell's header as a long page scrolls, with or without `asideLabel`; it is always on, not an option. A rail taller than the screen scrolls inside itself, so its last link is reachable. Below `md` nothing sticks.
|
|
87
87
|
- The rail has no background or border: it is a list of links on the page.
|
|
88
|
-
- Once the page has loaded, a rail that scrolls shows its current link (the one with `aria-current`) in view, with its own
|
|
88
|
+
- Once the page has loaded, a rail that scrolls shows its current link (the one with `aria-current`) in view, with its own themed scrollbar, and the folded disclosure reads `asideLabel` and the current link, such as "All components: Button". Nothing to set; in Astro, hydrate the layout (`client:load`).
|
|
89
89
|
- Facts about one record go in `DetailLayout`'s aside, not a rail.
|
|
90
90
|
- A docs site uses `DocsLayout`, which is this rail with the docs page's title, contents list and neighbours fixed.
|
|
91
91
|
|
|
@@ -22,7 +22,7 @@ import { SiteFooter, Text } from "@slashsuite/ui-react";
|
|
|
22
22
|
|
|
23
23
|
### Do
|
|
24
24
|
- Put it in `AppShell`'s `footer` slot: `<AppShell footer={<SiteFooter ... />}>`.
|
|
25
|
-
- `brand` is the site's mark, linked to `brandHref` (
|
|
25
|
+
- `brand` is the site's mark, linked to `brandHref` (the `LinkProvider`'s `home` by default, else `/`) and named by `brandLabel`. `children` is the contact line beside it, at body size.
|
|
26
26
|
- `links` are the site's own pages (Privacy, Terms, GitHub, a mail address), one wrapping row; `external` opens one in a new tab. `notes` are lines of fine print under them (a licence, a legal name, a credit), one paragraph each.
|
|
27
27
|
- Links go through the app's `LinkProvider`, like every link.
|
|
28
28
|
|
|
@@ -52,12 +52,12 @@ import { Caption, MetaList, Stack, Text, TextLink } from "@slashsuite/ui-react";
|
|
|
52
52
|
### SiteFooter
|
|
53
53
|
The footer a site puts in `AppShell`'s `footer` slot: the site's mark linked home with a contact line beside it, a row of the site's own links (Privacy, Terms, GitHub), then lines of fine print. It is not a `<footer>`: the shell draws the one `contentinfo` landmark around its slot. No link columns, newsletter form or social icons: a site footer is this and nothing else.
|
|
54
54
|
- brand: ReactNode. The site's mark (a wordmark, a logo), linked to `brandHref`. Left out, there is no brand.
|
|
55
|
-
- brandHref: string (default /). Where the brand links. Needs `brand`.
|
|
55
|
+
- brandHref: string (default the nearest `LinkProvider`'s `home`, else "/"). Where the brand links. Needs `brand`.
|
|
56
56
|
- brandLabel: string. Names the brand link for assistive tech ("PixelSlash home"). Needs `brand`.
|
|
57
57
|
- children: ReactNode. A sentence at body size beside the brand: the contact line ("Email hello@...").
|
|
58
58
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
59
|
-
- links: SiteFooterLink[] (default []). The site's own links (Privacy, Terms, GitHub, a mail address), one wrapping row.
|
|
60
|
-
- notes: ReactNode[] (default []). Lines of fine print under the links (a licence, a trademark, a credit), one paragraph each.
|
|
59
|
+
- links: readonly SiteFooterLink[] (default []). The site's own links (Privacy, Terms, GitHub, a mail address), one wrapping row.
|
|
60
|
+
- notes: readonly ReactNode[] (default []). Lines of fine print under the links (a licence, a trademark, a credit), one paragraph each.
|
|
61
61
|
|
|
62
62
|
### Types
|
|
63
63
|
- SiteFooterLink: `{ label: string; href: string; external?: boolean }`. One link in a `SiteFooter`'s row: its words, where it goes, and whether it opens a new tab.
|
|
@@ -23,12 +23,13 @@ import { Cluster, ColourSchemeToggle, SiteSearch } from "@slashsuite/ui-react";
|
|
|
23
23
|
|
|
24
24
|
### Do
|
|
25
25
|
- Put one `SiteSearch` in `AppShell`'s `controls`, on every page, and pass every page as `items`: `{ label, description, href, keywords }`.
|
|
26
|
-
- `label` names the phone's icon button and titles the dialog: say what is searched ("Search components"). `resultsLabel` names the list of matches
|
|
26
|
+
- `label` names the phone's icon button and titles the dialog: say what is searched ("Search components"). For an app in another language: `resultsLabel` names the list of matches ("Results"), `buttonLabel` is the wide button's text ("Search"), `placeholder` the field's ("Search"), `hintLabel` the line before typing ("Type a name"), `noResultsLabel` the words before the typed text when nothing matches ("No results for"), `allResultsLabel` the words before it on the full results link ("See all results for") and `countLabel` turns the count into what a screen reader hears ("3 results").
|
|
27
27
|
- Give `items` in the nav's order: results of the same rank keep it.
|
|
28
28
|
- `keywords` are other names a page answers to (the exports it documents); they match but are not shown.
|
|
29
29
|
- A result ranks by the name starting with the text, then the name containing it, then a keyword, then the description.
|
|
30
|
-
- From `sm` up the button reads Search with its key (Ctrl K, or ⌘ K on a Mac); below `sm` it is the search icon alone.
|
|
31
|
-
- It searches names, not page text, and needs no service.
|
|
30
|
+
- From `sm` up the button reads `buttonLabel` (Search) with its key (Ctrl K, or ⌘ K on a Mac); below `sm` it is the search icon alone.
|
|
31
|
+
- It searches names, not page text, and needs no service. A site that also has a full text search page passes `resultsHref`, the page's address for a query (`(query) => '/search?q=' + encodeURIComponent(query)`): its link is the last row once something is typed, matches or not, and Enter in the field goes there.
|
|
32
|
+
- `size` sets the button's height on a `Button`'s scale (default `sm`), so it lines up with the header's other controls of the same size.
|
|
32
33
|
|
|
33
34
|
### Don't
|
|
34
35
|
A field and a hand-filtered list in the page body is a second search with no shortcut, no keys and no count read out. Use `SiteSearch`.
|
|
@@ -37,31 +38,42 @@ import { Input, ListRow, Stack } from "@slashsuite/ui-react";
|
|
|
37
38
|
|
|
38
39
|
<Stack gap="sm">
|
|
39
40
|
<Input type="search" aria-label="Filter" icon="search" defaultValue="dia" />
|
|
40
|
-
<
|
|
41
|
+
<Stack divided>
|
|
41
42
|
<ListRow href="#dialog" size="sm">
|
|
42
43
|
Dialog
|
|
43
44
|
</ListRow>
|
|
44
|
-
<ListRow href="#field-dialog" size="sm"
|
|
45
|
+
<ListRow href="#field-dialog" size="sm">
|
|
45
46
|
FieldDialog
|
|
46
47
|
</ListRow>
|
|
47
|
-
</
|
|
48
|
+
</Stack>
|
|
48
49
|
</Stack>
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
### Accessibility
|
|
52
53
|
- Ctrl+K or Cmd+K opens it from anywhere on the page; the button carries `aria-keyshortcuts`.
|
|
53
54
|
- It opens a `Dialog` titled by `label` with focus in the search field; Esc closes it and focus goes back to where it was.
|
|
54
|
-
- Enter opens the first result. ArrowDown moves from the field to the results and ArrowUp and ArrowDown move between them; they are links, so Tab reaches them too.
|
|
55
|
+
- The field is a `search` landmark. Enter opens the first result, or with `resultsHref` the full results page; an Enter that commits an input method's composition does nothing. ArrowDown moves from the field to the results and ArrowUp and ArrowDown move between them; they are links, so Tab reaches them too.
|
|
55
56
|
- A polite live region reads the result count as you type ("3 results").
|
|
56
57
|
|
|
57
58
|
### Props
|
|
58
59
|
### SiteSearch
|
|
59
|
-
The site's search: a header button that opens a dialog with a search field over a list of links to the pages that match. Put it in `AppShell`'s `controls` and pass every page as `items`. Ctrl+K (⌘ K on a Mac) opens it from anywhere on the page, and the button shows that key. Typing filters by name, then by `keywords`, then by description; Enter opens the first result, the arrow keys move through them, and Esc closes it and puts focus back where it was. Render it once per page.
|
|
60
|
+
The site's search: a header button that opens a dialog with a search field over a list of links to the pages that match. Put it in `AppShell`'s `controls` and pass every page as `items`. Ctrl+K (⌘ K on a Mac) opens it from anywhere on the page, and the button shows that key. Typing filters by name, then by `keywords`, then by description; Enter opens the first result (or, with `resultsHref`, the full results page), the arrow keys move through them, and Esc closes it and puts focus back where it was. The field is a `<search>` landmark. Render it once per page.
|
|
61
|
+
- allResultsLabel: string (default See all results for). The full results link's text; the typed text follows it: "See all results for tabel".
|
|
62
|
+
- buttonLabel: string (default Search). The wide button's text, which is also its accessible name.
|
|
63
|
+
- countLabel: ((count: number) => string) (default `No results`, `1 result`, `4 results`). What a screen reader hears for the number of matches once something is typed.
|
|
64
|
+
- hintLabel: string (default Type a name). The muted line under the field before anything is typed.
|
|
60
65
|
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
61
66
|
- items: readonly SiteSearchItem[] (required). Every page to search, in the order ties are listed (the rail's order).
|
|
62
67
|
- label: string (required). The dialog's title and the phone's icon button's accessible name: "Search components". The wide
|
|
63
|
-
button is named by its own text,
|
|
68
|
+
button is named by its own text, `buttonLabel`.
|
|
69
|
+
- noResultsLabel: string (default No results for). The muted line when nothing matches; the typed text follows it: "No results for tabel".
|
|
70
|
+
- placeholder: string (default Search). The search field's placeholder.
|
|
71
|
+
- resultsHref: ((query: string) => string). The site's full results page for a query, built from the typed text (trimmed):
|
|
72
|
+
`(query) => "/search?q=" + encodeURIComponent(query)`. Given, a link to it is the last row
|
|
73
|
+
once something is typed, matches or not, and Enter in the field goes there.
|
|
64
74
|
- resultsLabel: string (default Results). The name of the list of matches, for an app in another language.
|
|
75
|
+
- size: "sm" | "md" | "lg" (default sm). The trigger's height and text, on the scale of a `Button` and an `IconButton`, so it lines up
|
|
76
|
+
with the other controls in a header row.
|
|
65
77
|
|
|
66
78
|
### Types
|
|
67
79
|
- SiteSearchItem: `{ label: string; description?: string; href: string; keywords?: string[] }`. One page the search can find.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
## Slider
|
|
2
|
+
|
|
3
|
+
Group: Forms
|
|
4
|
+
|
|
5
|
+
When to use: A value set by eye where near enough is fine: an opacity, a volume, a price range filter.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A level set by eye (an opacity, a volume) is a `Slider` in a `Field`, its value written beside it.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Field, Slider } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<Field label="Overlay opacity">
|
|
13
|
+
<Slider defaultValue={0.6} min={0} max={1} step={0.05} formatOptions={{ style: "percent" }} />
|
|
14
|
+
</Field>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Do
|
|
18
|
+
- Put a `Slider` in a `Field`, which names it and draws its hint and error, as an `Input`.
|
|
19
|
+
- Set `min`, `max` and `step`; without them it runs 0 to 100 in steps of 1 and starts halfway.
|
|
20
|
+
- Its value is written beside the track; `formatOptions` sets how (`{ style: "percent" }` for 0 to 1) and assistive tech reads it the same way.
|
|
21
|
+
- Keep it with `defaultValue`, or control it with `value` and the input's own `onChange`.
|
|
22
|
+
- `size` and `width` are the same choices as on `Input`.
|
|
23
|
+
- A figure the person must hit exactly is a `NumberField`.
|
|
24
|
+
|
|
25
|
+
### Don't
|
|
26
|
+
A figure the person must hit exactly is typed: a `NumberField`, not a `Slider`.
|
|
27
|
+
```tsx
|
|
28
|
+
import { NumberField } from "@slashsuite/ui-react";
|
|
29
|
+
|
|
30
|
+
<NumberField
|
|
31
|
+
label="Overlay opacity"
|
|
32
|
+
defaultValue={0.6}
|
|
33
|
+
minValue={0}
|
|
34
|
+
maxValue={1}
|
|
35
|
+
step={0.05}
|
|
36
|
+
formatOptions={{ style: "percent" }}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Accessibility
|
|
41
|
+
- A native `<input type="range">`: arrow keys, Page Up, Page Down, Home and End move it, and it keeps the browser's touch handling.
|
|
42
|
+
- `aria-valuetext` is the written value, so a screen reader hears "40%", not "0.4".
|
|
43
|
+
- The focus ring comes from the component.
|
|
44
|
+
|
|
45
|
+
### Props
|
|
46
|
+
### Slider
|
|
47
|
+
A range slider for one number between `min` and `max` (0 and 100 unless given), in steps of `step`: the browser's own `<input type="range">` in the accent colour, with its value written beside the track (`formatOptions` sets how) and read out the same way. Put it in a `Field`, which names it and draws the hint and the error, as an `Input`. Arrow keys, Page Up, Page Down, Home and End move it. `size` sets its height and the value's type, to line up with an `Input` of that size; `width` is an `Input`'s. `onChange` is the input's own, on every move. The `ref` reaches the `<input>`.
|
|
48
|
+
- defaultValue: number. The number it starts with, uncontrolled. Without one it starts halfway, as the browser's does.
|
|
49
|
+
- formatOptions: NumberFormatOptions. How the value beside the track is written, in the locale of the app's `I18nProvider` or else
|
|
50
|
+
the browser's: `{ style: "percent" }` (for a value from 0 to 1), `{ style: "currency",
|
|
51
|
+
currency: "EUR" }`, `{ style: "unit", unit: "kilogram" }`. Assistive tech reads it the same way.
|
|
52
|
+
- ref: Ref<HTMLInputElement>. The `<input>` itself, for focus control.
|
|
53
|
+
- size: Size | ResponsiveSize (default md). `sm` is compact, `text-sm` with less padding, for dense forms and table rows; `md` is `text-base`;
|
|
54
|
+
`lg` is `text-lg` with more padding, for a hero form. Under an `AppShell density="compact"` each
|
|
55
|
+
is one type step down, and on a touch screen a field is never under 16px.
|
|
56
|
+
`{ base: "md", md: "lg" }` changes size at the `md` breakpoint (48rem), in CSS, as a `Button`'s
|
|
57
|
+
does: give the field and the buttons in its row the same value, so the row stays aligned.
|
|
58
|
+
- value: number. The number it holds, controlled, with `onChange`.
|
|
59
|
+
- width: "sm" | "md" | "lg" | "auto" | "xs" | "fill" | "full" (default full). `full` (default) fills the parent; `fill` grows to fill the room left in a row beside other items (it can shrink to nothing, so buttons stay on the line); `xs`, `sm`, `md`, `lg` are fixed; `auto` adds no width class, so the control is as wide as the browser makes it.
|
|
@@ -39,22 +39,23 @@ function Example() {
|
|
|
39
39
|
- `onReorder` reports each drop as `{ id, section, target }`: the item that moved, the section it lands in, and `{ id, position }`, the item it was dropped before or after. Apply it to your own data and render again. The list never reorders itself.
|
|
40
40
|
- Moving an item into another section is how the user changes its group, such as a ticket's priority: read `section`, not the old one.
|
|
41
41
|
- An empty section shows a quiet "Drop here" row and still takes a drop. A drop there reports `{ id, section }` with no `target`.
|
|
42
|
-
- Put a meta line in a `SortableItem`'s children: `Pill`s, an `Avatar`.
|
|
42
|
+
- Put a meta line in a `SortableItem`'s children: `Pill`s, an `Avatar`.
|
|
43
43
|
- A list with no groups takes `SortableItem`s directly, and its moves have no `section`. Two lists on one page never take each other's items.
|
|
44
44
|
|
|
45
45
|
### Don't
|
|
46
|
+
- Do not put buttons or links in a row: the arrow keys move between rows and the handle.
|
|
46
47
|
- Do not add up and down buttons to rows: the drag and the keyboard already move an item, and buttons cannot move it into another section.
|
|
47
48
|
|
|
48
49
|
Up and down buttons on every row are a wall of controls, and they cannot move a task into another band.
|
|
49
50
|
```tsx
|
|
50
|
-
import { Button, Card, ListRow } from "@slashsuite/ui-react";
|
|
51
|
+
import { Button, Card, ListRow, Stack } from "@slashsuite/ui-react";
|
|
51
52
|
|
|
52
53
|
<Card flush>
|
|
53
|
-
|
|
54
|
-
(task
|
|
54
|
+
<Stack divided>
|
|
55
|
+
{["Ship the invoice export", "Book the car service", "Review the quote"].map((task) => (
|
|
55
56
|
<ListRow
|
|
56
57
|
key={task}
|
|
57
|
-
|
|
58
|
+
|
|
58
59
|
actions={
|
|
59
60
|
<>
|
|
60
61
|
<Button size="sm" variant="outline">
|
|
@@ -68,16 +69,17 @@ import { Button, Card, ListRow } from "@slashsuite/ui-react";
|
|
|
68
69
|
>
|
|
69
70
|
{task}
|
|
70
71
|
</ListRow>
|
|
71
|
-
)
|
|
72
|
-
|
|
72
|
+
))}
|
|
73
|
+
</Stack>
|
|
73
74
|
</Card>
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
### Accessibility
|
|
77
78
|
- The list is a grid with one row per item. Tab moves into it, and the arrow keys move between rows.
|
|
78
|
-
- To move an item from the keyboard: on its row, press the Right arrow to reach its grip handle, named "Reorder <title>", and press Enter. Each Up or Down arrow moves the drop line one gap, across section headings and into an empty section's "Drop here" row, and Enter drops. Escape cancels, leaves the order as it was and puts focus back on the handle. Tab does not leave the list during a move: it steps between the page's drop areas, and only Enter or Escape ends it.
|
|
79
|
+
- To move an item from the keyboard: on its row, press the Right arrow to reach its grip handle, named "Reorder <title>" (`reorderLabel` renames the word), and press Enter. Each Up or Down arrow moves the drop line one gap, across section headings and into an empty section's "Drop here" row, and Enter drops. Escape cancels, leaves the order as it was and puts focus back on the handle. Tab does not leave the list during a move: it steps between the page's drop areas, and only Enter or Escape ends it.
|
|
79
80
|
- While an item is moved, a screen reader announces it by its `title` and announces each drop position.
|
|
80
|
-
- A
|
|
81
|
+
- A `title` too long for the row is cut with an ellipsis and shows in full in a tooltip on hover, a tap and while its row has keyboard focus; the row's name is already the whole title.
|
|
82
|
+
- A pointer drags an item by its grip handle only, so text in a row can still be selected; on a touch screen a long press on the handle starts the drag. The other rows slide to their new places, with no motion under `prefers-reduced-motion`.
|
|
81
83
|
- Section headings are row headers with the section's title, and the "Drop here" row cannot be focused or dragged.
|
|
82
84
|
|
|
83
85
|
### Props
|
|
@@ -92,15 +94,18 @@ A list the user puts in order: items under section headings, moved by dragging a
|
|
|
92
94
|
One group of a `SortableList` under a heading that shows its title and how many items it holds. An empty section still takes a drop: it shows a quiet "Drop here" row in place of items.
|
|
93
95
|
- children: ReactNode. Its `SortableItem`s, each a direct child. With none it shows a quiet `emptyLabel` row.
|
|
94
96
|
- emptyLabel: string (default Drop here). The quiet row an empty section shows, where a drop lands.
|
|
97
|
+
- endLabel: string (default End of). The word before `title` in the name of the section's last drop place, which a screen reader
|
|
98
|
+
announces while a move lands there: "End of Doing".
|
|
95
99
|
- id: string. The section's id, reported as `section` in a move that lands in it.
|
|
96
100
|
The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
97
101
|
- title: string (required). The heading over its items.
|
|
98
102
|
|
|
99
103
|
### SortableItem
|
|
100
|
-
One row of a `SortableList`: a grip handle, the title, and an optional meta line under it. A pointer drags the row
|
|
104
|
+
One row of a `SortableList`: a grip handle, the title, and an optional meta line under it. A pointer drags the row by its handle only (a drag that starts anywhere else on the row is no drag); the handle (`reorderLabel` and the title, "Reorder <title>") is also how a keyboard or screen reader starts a move. A title cut to one line shows in full in a tooltip on hover, on the row's keyboard focus and on a tap.
|
|
101
105
|
- children: ReactNode. A meta line under the title: `Pill`s, an `Avatar`.
|
|
102
106
|
- id: string. The item's id, reported in a move.
|
|
103
107
|
The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
108
|
+
- reorderLabel: string (default Reorder). The word before `title` in the handle's accessible name: "Reorder Write the brief".
|
|
104
109
|
- title: string (required). Its one line; also what a screen reader announces while it is dragged.
|
|
105
110
|
|
|
106
111
|
### Types
|
|
@@ -150,7 +150,7 @@ import { Card, Display, Lead, Overline, Stack, Text } from "@slashsuite/ui-react
|
|
|
150
150
|
A vertical column of blocks a fixed `gap` apart: `xs` between lines of text (a heading and the line under it), `sm` inside a group, `md` between blocks, `lg` between groups, `xl` between a page's top-level blocks (`gap-12`, `sm:gap-16`: the one responsive page rhythm). Left out, the gap comes from where the Stack sits: `xs` inside a `Card`, `Dialog`, `Drawer`, `BottomSheet`, `Callout` or `ListRow`, and `md` on the page. `width` caps the column: `compact` is the width of one card or one picture's column (28rem), `narrow` is a reading measure, `wide` is wider again, `full` is the parent's whole width and `default` sets nothing. A capped Stack starts at its parent's start edge (it is never re-centred), so its first line lines up with every other block on the page. A width cap on any one block (a `Card`, an `Image`) is a Stack around it. `align="start"` keeps each child at its own width, capped at the column's (a `Button` under a form's fields); left out, every child spans the column. `divided` draws a line between each pair of children and sets them touching, with no gap: it is for rows that carry their own padding (`ListRow`s in a `Card flush`). Space and a line between blocks is a `Divider` in the Stack instead. `rowFrom` turns the column into a row from `sm`, `md` or `lg` (a column below it): the blocks sit side by side, `gap` apart, and a `ClusterGrow` around one of them takes the width left. Without it the Stack is always a column; a row that is a row at every width is a `Cluster`. `as` is a closed set: `div` (default), `section`, `form`, `ul` or `ol`. A `form` takes the form props (`onSubmit`, `action`, `method`, `noValidate`, ...). A `ul` or `ol` is drawn with no markers and its children are `<li>`s, as in `BulletList` and `Timeline`: the Stack does not wrap them, so a child is one list item and `Text as="li"` or a bare `<li>` both work. A `ul` or `ol` takes `empty` (an `EmptyState`, one muted line here), drawn in place of the list when it has no children.
|
|
151
151
|
- align: "start" | "stretch" (default stretch). Where the children sit across the column: `stretch` spans it, `start` keeps each child at its
|
|
152
152
|
own width (a `Button` under a form's fields).
|
|
153
|
-
- as: "
|
|
153
|
+
- as: "form" | "div" | "ol" | "section" | "ul". The element: `div`, `section`, `form` (takes the form's props), `ul` or `ol` (no markers; each child is an `<li>`).
|
|
154
154
|
- divided: boolean. A line between each pair of children, which then touch (no gap): rows that carry their own
|
|
155
155
|
padding. Space and a line between blocks is a `Divider` in the Stack instead.
|
|
156
156
|
|
|
@@ -162,7 +162,7 @@ Such as `ListRow`s in a `Card flush`.
|
|
|
162
162
|
area beside a side column on a wide screen, stacked on a phone. In the row the blocks sit side by side
|
|
163
163
|
the same `gap` apart and are as tall as the tallest; wrap the one that takes the width left in a
|
|
164
164
|
`ClusterGrow`. Left out, the Stack is always a column.
|
|
165
|
-
- width: "compact" | "
|
|
165
|
+
- width: "compact" | "full" | "default" | "narrow" | "wide" (default default). Caps the column: `compact` max-w-md (one card or one picture's column), `narrow` max-w-3xl (a
|
|
166
166
|
reading measure), `wide` max-w-5xl, `full` the parent's whole width, `default` sets nothing.
|
|
167
167
|
|
|
168
168
|
### Section
|
|
@@ -186,7 +186,7 @@ A landing page's section under the `Hero` is `size="lg"`: its opening is capped
|
|
|
186
186
|
reading measure at the start edge and its blocks sit `lg` apart. A feature card in it is
|
|
187
187
|
a `Card href icon titleStyle="name"` in a `CardGrid`; text beside code is a `SideColumn`.
|
|
188
188
|
- title: ReactNode. The heading at the top, which names the section.
|
|
189
|
-
- width: "compact" | "
|
|
189
|
+
- width: "compact" | "full" | "default" | "narrow" | "wide" (default default). Caps the column: `compact` max-w-md (one card or one picture's column), `narrow` max-w-3xl (a
|
|
190
190
|
reading measure), `wide` max-w-5xl, `full` the parent's whole width, `default` sets nothing.
|
|
191
191
|
|
|
192
192
|
### Types
|