@slotted/react 0.1.0-beta.29 → 0.1.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-shell-CXlO6z0w.js → app-shell-ClwskWBN.js} +1 -1
- package/dist/app-shell.js +2 -2
- package/dist/docs/AGENTS.snippet.md +1 -1
- package/dist/docs/accordion.json +5 -5
- package/dist/docs/accordion.md +11 -11
- package/dist/docs/action-bar.json +19 -19
- package/dist/docs/action-bar.md +29 -29
- package/dist/docs/action-sheet.json +5 -5
- package/dist/docs/action-sheet.md +15 -15
- package/dist/docs/alert.json +11 -11
- package/dist/docs/alert.md +17 -17
- package/dist/docs/app-shell.examples.md +8 -8
- package/dist/docs/app-shell.json +11 -11
- package/dist/docs/app-shell.md +2 -2
- package/dist/docs/attachment.json +1 -1
- package/dist/docs/attachment.md +1 -1
- package/dist/docs/avatar-group.json +1 -1
- package/dist/docs/avatar-group.md +1 -1
- package/dist/docs/avatar.json +10 -10
- package/dist/docs/avatar.md +9 -9
- package/dist/docs/badge.json +5 -5
- package/dist/docs/badge.md +5 -5
- package/dist/docs/breadcrumb.json +2 -2
- package/dist/docs/breadcrumb.md +2 -2
- package/dist/docs/button-group.json +1 -1
- package/dist/docs/button-group.md +1 -1
- package/dist/docs/button.json +11 -11
- package/dist/docs/button.md +7 -7
- package/dist/docs/calendar.json +4 -4
- package/dist/docs/calendar.md +3 -3
- package/dist/docs/card.json +2 -2
- package/dist/docs/card.md +2 -2
- package/dist/docs/carousel.json +11 -11
- package/dist/docs/carousel.md +12 -12
- package/dist/docs/chart.examples.md +41 -41
- package/dist/docs/chart.json +28 -28
- package/dist/docs/chart.md +4 -4
- package/dist/docs/checkbox-group.examples.md +12 -12
- package/dist/docs/checkbox-group.json +6 -6
- package/dist/docs/checkbox-group.md +1 -1
- package/dist/docs/checkbox.examples.md +8 -8
- package/dist/docs/checkbox.json +7 -7
- package/dist/docs/checkbox.md +4 -4
- package/dist/docs/code-block.json +1 -1
- package/dist/docs/code-block.md +1 -1
- package/dist/docs/collapsible.json +12 -12
- package/dist/docs/collapsible.md +21 -21
- package/dist/docs/color-picker.json +25 -25
- package/dist/docs/color-picker.md +15 -15
- package/dist/docs/column-manager.json +1 -1
- package/dist/docs/column-manager.md +1 -1
- package/dist/docs/combobox.json +1 -1
- package/dist/docs/combobox.md +1 -1
- package/dist/docs/context-menu.json +1 -1
- package/dist/docs/context-menu.md +1 -1
- package/dist/docs/currency-field.examples.md +1 -1
- package/dist/docs/currency-field.json +5 -5
- package/dist/docs/currency-field.md +4 -4
- package/dist/docs/dashboard-grid.json +1 -1
- package/dist/docs/data-grid.json +2 -2
- package/dist/docs/data-grid.md +1 -1
- package/dist/docs/data-grid.props.md +1 -1
- package/dist/docs/date-field.json +4 -4
- package/dist/docs/date-field.md +9 -9
- package/dist/docs/date-picker.json +1 -1
- package/dist/docs/date-range-picker.json +1 -1
- package/dist/docs/datetime-field.json +3 -3
- package/dist/docs/datetime-field.md +7 -7
- package/dist/docs/datetime-picker.json +1 -1
- package/dist/docs/datetime-range-picker.examples.md +2 -2
- package/dist/docs/datetime-range-picker.json +3 -3
- package/dist/docs/datetime-range-picker.md +2 -2
- package/dist/docs/description-list.json +5 -5
- package/dist/docs/description-list.md +4 -4
- package/dist/docs/detail-panel.json +9 -9
- package/dist/docs/detail-panel.md +11 -11
- package/dist/docs/dialog.examples.md +5 -5
- package/dist/docs/dialog.json +12 -12
- package/dist/docs/dialog.md +4 -4
- package/dist/docs/dialog.props.md +2 -2
- package/dist/docs/drawer.examples.md +14 -14
- package/dist/docs/drawer.json +8 -8
- package/dist/docs/drawer.md +1 -1
- package/dist/docs/entity-picker.json +1 -1
- package/dist/docs/entity-picker.md +2 -2
- package/dist/docs/event-calendar.examples.md +3 -3
- package/dist/docs/event-calendar.json +5 -5
- package/dist/docs/event-calendar.md +2 -2
- package/dist/docs/field-group.json +5 -5
- package/dist/docs/field-group.md +9 -9
- package/dist/docs/field.examples.md +3 -3
- package/dist/docs/field.json +4 -4
- package/dist/docs/field.md +1 -1
- package/dist/docs/form.json +6 -6
- package/dist/docs/form.md +10 -10
- package/dist/docs/fullscreen.json +3 -3
- package/dist/docs/fullscreen.md +6 -6
- package/dist/docs/guidelines/async-feedback.md +2 -2
- package/dist/docs/guidelines/builders.md +1 -1
- package/dist/docs/guidelines/composition.md +4 -4
- package/dist/docs/guidelines/conversations.md +1 -1
- package/dist/docs/guidelines/index.md +2 -2
- package/dist/docs/guidelines/layout-alignment.md +5 -5
- package/dist/docs/guidelines/overviews.md +3 -3
- package/dist/docs/guidelines/own-elements.md +7 -7
- package/dist/docs/guidelines/record-pages.md +1 -1
- package/dist/docs/highlight.json +11 -11
- package/dist/docs/highlight.md +18 -18
- package/dist/docs/icon.json +2 -2
- package/dist/docs/icon.md +2 -2
- package/dist/docs/image.json +3 -3
- package/dist/docs/image.md +3 -3
- package/dist/docs/import-export-center.json +25 -25
- package/dist/docs/import-export-center.md +21 -21
- package/dist/docs/inline-message.json +14 -14
- package/dist/docs/inline-message.md +20 -20
- package/dist/docs/inline.json +1 -1
- package/dist/docs/inline.md +1 -1
- package/dist/docs/kbd.json +2 -2
- package/dist/docs/kbd.md +2 -2
- package/dist/docs/link.json +7 -7
- package/dist/docs/link.md +7 -7
- package/dist/docs/list-item.json +1 -1
- package/dist/docs/list-item.md +1 -1
- package/dist/docs/list.json +2 -2
- package/dist/docs/list.md +1 -1
- package/dist/docs/listbox.json +1 -1
- package/dist/docs/listbox.md +1 -1
- package/dist/docs/loading-overlay.json +2 -2
- package/dist/docs/loading-overlay.md +2 -2
- package/dist/docs/media-viewer.json +1 -1
- package/dist/docs/media-viewer.md +1 -1
- package/dist/docs/message-scroller.json +1 -1
- package/dist/docs/message-scroller.md +1 -1
- package/dist/docs/message.json +11 -11
- package/dist/docs/message.md +17 -17
- package/dist/docs/multi-select.json +1 -1
- package/dist/docs/notification-center.json +18 -18
- package/dist/docs/notification-center.md +25 -22
- package/dist/docs/number-field.examples.md +4 -4
- package/dist/docs/number-field.json +3 -3
- package/dist/docs/otp-input.json +9 -9
- package/dist/docs/otp-input.md +12 -12
- package/dist/docs/page-header.json +9 -9
- package/dist/docs/page-header.md +23 -23
- package/dist/docs/pagination.json +2 -2
- package/dist/docs/pagination.md +1 -1
- package/dist/docs/popover.examples.md +1 -1
- package/dist/docs/popover.json +3 -3
- package/dist/docs/popover.md +1 -1
- package/dist/docs/progress-indicator.json +4 -4
- package/dist/docs/progress-indicator.md +4 -4
- package/dist/docs/prompt-composer.json +3 -3
- package/dist/docs/prompt-composer.md +4 -4
- package/dist/docs/prose.json +1 -1
- package/dist/docs/prose.md +1 -1
- package/dist/docs/radio-group.examples.md +16 -16
- package/dist/docs/radio-group.json +9 -9
- package/dist/docs/radio-group.md +2 -2
- package/dist/docs/rating.json +18 -18
- package/dist/docs/rating.md +19 -23
- package/dist/docs/result-state.json +13 -13
- package/dist/docs/result-state.md +18 -20
- package/dist/docs/saved-views.json +1 -1
- package/dist/docs/scroll-area.json +5 -5
- package/dist/docs/scroll-area.md +6 -6
- package/dist/docs/section.json +6 -6
- package/dist/docs/section.md +11 -11
- package/dist/docs/segmented-control.json +15 -15
- package/dist/docs/segmented-control.md +39 -39
- package/dist/docs/skeleton.json +1 -1
- package/dist/docs/skeleton.md +1 -1
- package/dist/docs/skills/build-own-element/SKILL.md +3 -3
- package/dist/docs/skills/compose-screen/SKILL.md +2 -2
- package/dist/docs/skills/index.md +2 -2
- package/dist/docs/skills/review-screen/SKILL.md +3 -3
- package/dist/docs/skills/theme-app/SKILL.md +9 -9
- package/dist/docs/skills/waiting-states/SKILL.md +1 -1
- package/dist/docs/slider.json +9 -9
- package/dist/docs/slider.md +19 -19
- package/dist/docs/sparkline.json +8 -8
- package/dist/docs/sparkline.md +6 -6
- package/dist/docs/split-button.json +11 -11
- package/dist/docs/split-button.md +27 -27
- package/dist/docs/stack.json +1 -1
- package/dist/docs/stack.md +1 -1
- package/dist/docs/stat-card.json +3 -3
- package/dist/docs/stat-card.md +2 -2
- package/dist/docs/status-indicator.json +8 -8
- package/dist/docs/status-indicator.md +5 -5
- package/dist/docs/stepper.json +4 -4
- package/dist/docs/stepper.md +4 -4
- package/dist/docs/switch.json +5 -5
- package/dist/docs/switch.md +11 -7
- package/dist/docs/table-of-contents.json +9 -9
- package/dist/docs/table-of-contents.md +13 -13
- package/dist/docs/table.examples.md +1 -1
- package/dist/docs/table.json +1 -1
- package/dist/docs/tabs.json +1 -1
- package/dist/docs/tabs.md +1 -1
- package/dist/docs/tag.json +21 -21
- package/dist/docs/tag.md +18 -18
- package/dist/docs/tags-input.json +1 -1
- package/dist/docs/tags-input.md +1 -1
- package/dist/docs/text-field.examples.md +5 -5
- package/dist/docs/text-field.json +5 -5
- package/dist/docs/text-field.md +1 -1
- package/dist/docs/textarea.examples.md +4 -4
- package/dist/docs/textarea.json +2 -2
- package/dist/docs/time-field.json +3 -3
- package/dist/docs/time-field.md +7 -7
- package/dist/docs/time-picker.json +4 -4
- package/dist/docs/time-picker.md +7 -7
- package/dist/docs/time-range-picker.json +4 -4
- package/dist/docs/time-range-picker.md +5 -5
- package/dist/docs/toast.json +5 -5
- package/dist/docs/toast.md +5 -5
- package/dist/docs/toggle-group.json +13 -13
- package/dist/docs/toggle-group.md +38 -38
- package/dist/docs/toggle.json +8 -8
- package/dist/docs/toggle.md +8 -8
- package/dist/docs/tokens.md +15 -15
- package/dist/docs/toolbar.json +11 -11
- package/dist/docs/toolbar.md +28 -28
- package/dist/docs/tooltip.json +3 -3
- package/dist/docs/tooltip.md +3 -3
- package/dist/docs/top-navigation.examples.md +13 -13
- package/dist/docs/top-navigation.json +10 -10
- package/dist/docs/top-navigation.md +7 -7
- package/dist/docs/tour.json +8 -8
- package/dist/docs/tour.md +5 -5
- package/dist/docs/typography.json +2 -2
- package/dist/docs/typography.md +2 -2
- package/dist/docs/upload.examples.md +5 -5
- package/dist/docs/upload.json +10 -10
- package/dist/docs/upload.md +3 -3
- package/dist/{form-Im9lGi45.js → form-DnV8ndwm.js} +1 -1
- package/dist/form.js +1 -1
- package/dist/index.js +8 -8
- package/dist/{rating-Cjrwmxyw.js → rating-BtrkTAi0.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{side-navigation-CvIGfGjZ.js → side-navigation-DNMpckRs.js} +1 -1
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-DuJGh0pf.js → slider-CU89H3i0.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/side-navigation.css +1 -1
- package/dist/styles/top-navigation.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{top-navigation-D_Jt0jNw.js → top-navigation-C73WDqLg.js} +1 -1
- package/dist/top-navigation.js +1 -1
- package/dist/types/alert/alert.types.d.ts +2 -2
- package/dist/types/alert/alert.types.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell-demo/atrio.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell-demo/aurora.d.ts +6 -6
- package/dist/types/app-shell/app-shell-demo/aurora.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell-demo/cadence.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell-parts.d.ts +2 -2
- package/dist/types/app-shell/app-shell.types.d.ts +1 -1
- package/dist/types/app-shell/index.d.ts +2 -2
- package/dist/types/avatar/avatar.types.d.ts +8 -8
- package/dist/types/avatar/avatar.types.d.ts.map +1 -1
- package/dist/types/badge/badge.types.d.ts +4 -4
- package/dist/types/badge/badge.types.d.ts.map +1 -1
- package/dist/types/breadcrumb/breadcrumb-parts.d.ts +1 -1
- package/dist/types/button/button.constants.d.ts +1 -1
- package/dist/types/button-group/button-group-separator.d.ts +1 -1
- package/dist/types/card/card-selection.d.ts +1 -1
- package/dist/types/carousel/carousel-catalogue.d.ts +6 -6
- package/dist/types/carousel/carousel-parts.d.ts +2 -2
- package/dist/types/code-block/code-block.types.d.ts +1 -1
- package/dist/types/collapsible/collapsible.types.d.ts +1 -1
- package/dist/types/color-picker/color-picker.d.ts +7 -7
- package/dist/types/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/color-picker/color-picker.types.d.ts +5 -5
- package/dist/types/color-picker/color-picker.types.d.ts.map +1 -1
- package/dist/types/column-manager/column-manager.d.ts +2 -2
- package/dist/types/column-manager/column-manager.d.ts.map +1 -1
- package/dist/types/combobox/combobox-collection.d.ts +1 -1
- package/dist/types/combobox/combobox-defaults.d.ts +1 -1
- package/dist/types/command-palette/command-palette-defaults.d.ts +1 -1
- package/dist/types/data-grid/data-grid-context.d.ts +2 -2
- package/dist/types/description-list/description-list-clipboard.d.ts +1 -1
- package/dist/types/detail-panel/detail-panel-demo.d.ts.map +1 -1
- package/dist/types/dialog/dialog.types.d.ts +1 -1
- package/dist/types/drawer/drawer.types.d.ts +1 -1
- package/dist/types/entity-picker/entity-picker.d.ts +1 -1
- package/dist/types/field/field-parts.d.ts +1 -1
- package/dist/types/field/field.d.ts +1 -1
- package/dist/types/field/field.types.d.ts +1 -1
- package/dist/types/form/form.d.ts +1 -1
- package/dist/types/form/form.types.d.ts +1 -1
- package/dist/types/highlight/highlight.types.d.ts +1 -1
- package/dist/types/icon/glyph.d.ts +1 -1
- package/dist/types/icon/icon.d.ts +2 -2
- package/dist/types/icon/icon.types.d.ts +1 -1
- package/dist/types/icon/icon.types.d.ts.map +1 -1
- package/dist/types/image/image.d.ts +1 -1
- package/dist/types/import-export-center/import-export-center-defaults.d.ts +3 -3
- package/dist/types/import-export-center/import-export-center-demo.d.ts +2 -2
- package/dist/types/import-export-center/import-export-center-demo.d.ts.map +1 -1
- package/dist/types/import-export-center/import-export-center.types.d.ts +3 -3
- package/dist/types/import-export-center/use-job-toasts.d.ts +3 -3
- package/dist/types/inline/inline.d.ts +1 -1
- package/dist/types/inline-message/inline-message-defaults.d.ts +1 -1
- package/dist/types/inline-message/inline-message.d.ts +2 -2
- package/dist/types/inline-message/inline-message.types.d.ts +1 -1
- package/dist/types/inline-message/inline-message.types.d.ts.map +1 -1
- package/dist/types/kbd/kbd.types.d.ts +1 -1
- package/dist/types/list/list.types.d.ts +1 -1
- package/dist/types/listbox/listbox-defaults.d.ts +1 -1
- package/dist/types/listbox/listbox-parts.d.ts +2 -2
- package/dist/types/menu/menu-defaults.d.ts +1 -1
- package/dist/types/menu/menu-parts.d.ts +1 -1
- package/dist/types/message/message-demo.d.ts +2 -2
- package/dist/types/message/message-demo.d.ts.map +1 -1
- package/dist/types/message-scroller/message-scroller.d.ts +1 -1
- package/dist/types/notification-center/notification-center-defaults.d.ts +2 -2
- package/dist/types/notification-center/notification-center-demo.d.ts +1 -1
- package/dist/types/notification-center/notification-center-demo.d.ts.map +1 -1
- package/dist/types/notification-center/notification-center.types.d.ts +2 -2
- package/dist/types/otp-input/otp-input.d.ts +1 -1
- package/dist/types/page/page-demo.d.ts +2 -2
- package/dist/types/page/page-demo.d.ts.map +1 -1
- package/dist/types/progress-indicator/loader.d.ts +1 -1
- package/dist/types/progress-indicator/progress-circle.d.ts +1 -1
- package/dist/types/progress-indicator/progress-indicator.types.d.ts +1 -1
- package/dist/types/rating/rating-summary.d.ts +1 -1
- package/dist/types/rating/rating.types.d.ts +1 -1
- package/dist/types/result-state/result-state-demo.d.ts +1 -1
- package/dist/types/result-state/result-state.types.d.ts +1 -1
- package/dist/types/segmented-control/segmented-control.types.d.ts +1 -1
- package/dist/types/select/select.types.d.ts +1 -1
- package/dist/types/side-navigation/side-navigation.d.ts +1 -1
- package/dist/types/stat-card/stat-card.d.ts +1 -1
- package/dist/types/status-indicator/status-indicator.types.d.ts +3 -3
- package/dist/types/status-indicator/status-indicator.types.d.ts.map +1 -1
- package/dist/types/switch/switch.types.d.ts +1 -1
- package/dist/types/table/table-parts.d.ts +1 -1
- package/dist/types/table/table.types.d.ts +1 -1
- package/dist/types/table-of-contents/table-of-contents-demo.d.ts.map +1 -1
- package/dist/types/tabs/tabs.types.d.ts +2 -2
- package/dist/types/tag/tag.types.d.ts +3 -3
- package/dist/types/tag/tag.types.d.ts.map +1 -1
- package/dist/types/tags-input/tags-input.d.ts +1 -1
- package/dist/types/theme/theme-scope.d.ts +2 -2
- package/dist/types/theme/theme-scope.d.ts.map +1 -1
- package/dist/types/toast/toast-defaults.d.ts +1 -1
- package/dist/types/toast/toast.types.d.ts +2 -2
- package/dist/types/toast/toast.types.d.ts.map +1 -1
- package/dist/types/toggle/toggle.types.d.ts +1 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts +1 -1
- package/dist/types/tooltip/tooltip-defaults.d.ts +1 -1
- package/dist/types/tour/tour.types.d.ts +2 -2
- package/dist/types/typography/text.d.ts +1 -1
- package/dist/types/typography/typography.attributes.d.ts +1 -1
- package/dist/types/typography/typography.types.d.ts +1 -1
- package/dist/types/typography/typography.types.d.ts.map +1 -1
- package/dist/{wizard-CpYwQGQ-.js → wizard-CmEJK55_.js} +2 -2
- package/dist/wizard.js +1 -1
- package/package.json +18 -6
|
@@ -14,10 +14,10 @@ import { Segment, SegmentedControl, SegmentedControlDefaultsProvider } from '@sl
|
|
|
14
14
|
Excerpt — not a complete module
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
|
-
<SegmentedControl aria-label="
|
|
18
|
-
<Segment value="day">
|
|
19
|
-
<Segment value="week">
|
|
20
|
-
<Segment value="month">
|
|
17
|
+
<SegmentedControl aria-label="Chart period" defaultValue="week">
|
|
18
|
+
<Segment value="day">Day</Segment>
|
|
19
|
+
<Segment value="week">Week</Segment>
|
|
20
|
+
<Segment value="month">Month</Segment>
|
|
21
21
|
</SegmentedControl>;
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -45,7 +45,7 @@ Excerpt — not a complete module
|
|
|
45
45
|
| `condense` | `'none' \| 'icons'` | none | SegmentedControl | What the control does when it is narrower than its labels need. icons keeps the marks and hides the words, and makes the control take its parent’s width so there is a width to ask a question about |
|
|
46
46
|
| `fullWidth` | `boolean` | false | SegmentedControl | Whether the equal columns spread across the whole line. Left alone every column is the widest label’s |
|
|
47
47
|
| `disabled` | `boolean` | false | SegmentedControl | Unstated rather than false, so the control defers to the field around it. Stated, it reaches every radio as the native attribute, which is also what makes the browser skip it with the arrows |
|
|
48
|
-
| `readOnly` | `boolean` | — | SegmentedControl | Enforced by the family, because a radio ignores readonly: the change is refused on the click a pointer and Space share, and the control keeps its
|
|
48
|
+
| `readOnly` | `boolean` | — | SegmentedControl | Enforced by the family, because a radio ignores readonly: the change is refused on the click a pointer and Space share, and the control keeps its colors and its tab stops |
|
|
49
49
|
| `invalid` | `boolean` | — | SegmentedControl | Writes aria-invalid and data-invalid, and points the focus ring at the danger step so the outline and its shadow move together |
|
|
50
50
|
| `required` | `boolean` | — | SegmentedControl | Writes aria-required on the control rather than the native attribute on a radio, so describing a field does not change what submitting the form does |
|
|
51
51
|
| `value, on Segment` | `string` | — | Segment | What this segment selects, and what the control’s value holds. It is required: a segment with no value is a choice a reader cannot make |
|
|
@@ -78,7 +78,7 @@ Excerpt — not a complete module
|
|
|
78
78
|
- The pattern is the WAI-ARIA APG’s Radio Group (w3.org/WAI/ARIA/apg/patterns/radio/), and its entire keyboard table is the platform’s: Tab lands on the checked segment or on the first when none is checked, Space checks the focused one, both pairs of arrows move focus and the choice together, the set wraps, and disabled segments are skipped — including the arrow directions of a right-to-left document.
|
|
79
79
|
- A segment is a real input type="radio" and not a button. Primer builds the row of buttons and pays one tab stop per segment where the pattern gives one for the set; Angular Material writes radiogroup around children carrying aria-pressed, which is a group whose role and children disagree. The family whose items are buttons is toggle-group, and the difference a reader feels is the arrows.
|
|
80
80
|
- That is why the segments share a name, and why one is generated when none is written: grouping is by name within the form owner, so an unnamed set is not a set. The value reaches FormData with no wiring, which is what makes this the family for a choice a form submits.
|
|
81
|
-
- The ring is drawn on the segment and put out on the radio that holds the focus, so the family never paints two rings in two
|
|
81
|
+
- The ring is drawn on the segment and put out on the radio that holds the focus, so the family never paints two rings in two colors. It sits on the segment’s own edge rather than off it, because the segments are flush inside the track and an offset ring would be drawn across the neighbour beside it.
|
|
82
82
|
- Read-only has no platform answer for a radio, so it is enforced: the change is refused on the click a pointer and Space share, aria-readonly announces it, and the control keeps its tab stops and its full contrast — it must not be mistaken for an unavailable one.
|
|
83
83
|
- The thumb is shorter than the control it lives in, so the radio reaches the track’s own edge and the target is the control’s height rather than the thumb’s. With the segment never narrower than 24 CSS pixels, WCAG 2.2 SC 2.5.8 holds at the smallest step and the tightest density.
|
|
84
84
|
- Condensing hides the words and keeps them: the accessible name of every segment is the same whether the control has room for its labels or not.
|
|
@@ -96,9 +96,9 @@ Each step reads the control scale and the track measures its segments back from
|
|
|
96
96
|
Excerpt — not a complete module
|
|
97
97
|
|
|
98
98
|
```tsx
|
|
99
|
-
<SegmentedControl aria-label="
|
|
100
|
-
<Segment value="grid">
|
|
101
|
-
<Segment value="list">
|
|
99
|
+
<SegmentedControl aria-label="View" defaultValue="grid" size="sm">
|
|
100
|
+
<Segment value="grid">Grid</Segment>
|
|
101
|
+
<Segment value="list">List</Segment>
|
|
102
102
|
</SegmentedControl>;
|
|
103
103
|
```
|
|
104
104
|
|
|
@@ -109,16 +109,16 @@ The thumb travels on whichever axis the segments do, and the platform moves the
|
|
|
109
109
|
Excerpt — not a complete module
|
|
110
110
|
|
|
111
111
|
```tsx
|
|
112
|
-
<SegmentedControl aria-label="
|
|
113
|
-
<Segment value="card">
|
|
114
|
-
<Segment value="transfer">
|
|
115
|
-
<Segment value="invoice">
|
|
112
|
+
<SegmentedControl aria-label="Payment" defaultValue="invoice" orientation="vertical">
|
|
113
|
+
<Segment value="card">Card</Segment>
|
|
114
|
+
<Segment value="transfer">Wire transfer</Segment>
|
|
115
|
+
<Segment value="invoice">ACH transfer</Segment>
|
|
116
116
|
</SegmentedControl>;
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
### Every state the contract declares
|
|
120
120
|
|
|
121
|
-
Hover, focus, one segment unavailable, the whole control unavailable, read-only and invalid. Read-only keeps its
|
|
121
|
+
Hover, focus, one segment unavailable, the whole control unavailable, read-only and invalid. Read-only keeps its colors and refuses the change; only disabled loses them.
|
|
122
122
|
|
|
123
123
|
Excerpt — not a complete module
|
|
124
124
|
|
|
@@ -139,23 +139,23 @@ A segment with only a mark draws square and takes its accessible name from an ar
|
|
|
139
139
|
Excerpt — not a complete module
|
|
140
140
|
|
|
141
141
|
```tsx
|
|
142
|
-
<SegmentedControl aria-label="
|
|
143
|
-
<Segment aria-label="
|
|
144
|
-
<Segment aria-label="
|
|
142
|
+
<SegmentedControl aria-label="Alignment" defaultValue="center">
|
|
143
|
+
<Segment aria-label="Start" icon={<AlignStartIcon />} value="start" />
|
|
144
|
+
<Segment aria-label="Center" icon={<AlignCenterIcon />} value="center" />
|
|
145
145
|
</SegmentedControl>;
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
### A track, or the words alone
|
|
149
149
|
|
|
150
|
-
underline draws the same radio group as words: each as wide as itself, the chosen one in the text
|
|
150
|
+
underline draws the same radio group as words: each as wide as itself, the chosen one in the text color and underlined, the others muted. One tab stop, the arrows move the value, and inside a field the label names the set.
|
|
151
151
|
|
|
152
152
|
Excerpt — not a complete module
|
|
153
153
|
|
|
154
154
|
```tsx
|
|
155
|
-
<SegmentedControl aria-label="
|
|
156
|
-
<Segment value="day">
|
|
157
|
-
<Segment value="week">
|
|
158
|
-
<Segment value="month">
|
|
155
|
+
<SegmentedControl aria-label="Period" defaultValue="month" variant="underline">
|
|
156
|
+
<Segment value="day">Day</Segment>
|
|
157
|
+
<Segment value="week">Week</Segment>
|
|
158
|
+
<Segment value="month">Month</Segment>
|
|
159
159
|
</SegmentedControl>;
|
|
160
160
|
```
|
|
161
161
|
|
|
@@ -166,12 +166,12 @@ Below the width its labels need, a control told to condense keeps its marks and
|
|
|
166
166
|
Excerpt — not a complete module
|
|
167
167
|
|
|
168
168
|
```tsx
|
|
169
|
-
<SegmentedControl aria-label="
|
|
169
|
+
<SegmentedControl aria-label="Report" condense="icons" defaultValue="table">
|
|
170
170
|
<Segment icon={<TableIcon />} value="table">
|
|
171
|
-
|
|
171
|
+
Table
|
|
172
172
|
</Segment>
|
|
173
173
|
<Segment icon={<ChartIcon />} value="chart">
|
|
174
|
-
|
|
174
|
+
Chart
|
|
175
175
|
</Segment>
|
|
176
176
|
</SegmentedControl>;
|
|
177
177
|
```
|
|
@@ -183,10 +183,10 @@ Left alone every column is the widest label’s, which is the rule Carbon states
|
|
|
183
183
|
Excerpt — not a complete module
|
|
184
184
|
|
|
185
185
|
```tsx
|
|
186
|
-
<SegmentedControl aria-label="
|
|
187
|
-
<Segment value="morning">
|
|
188
|
-
<Segment value="afternoon">
|
|
189
|
-
<Segment value="evening">
|
|
186
|
+
<SegmentedControl aria-label="Delivery" defaultValue="afternoon" fullWidth>
|
|
187
|
+
<Segment value="morning">Morning</Segment>
|
|
188
|
+
<Segment value="afternoon">Afternoon</Segment>
|
|
189
|
+
<Segment value="evening">Evening</Segment>
|
|
190
190
|
</SegmentedControl>;
|
|
191
191
|
```
|
|
192
192
|
|
|
@@ -198,12 +198,12 @@ Excerpt — not a complete module
|
|
|
198
198
|
|
|
199
199
|
```tsx
|
|
200
200
|
<Field>
|
|
201
|
-
<FieldLabel>
|
|
201
|
+
<FieldLabel>Invoice currency</FieldLabel>
|
|
202
202
|
<SegmentedControl defaultValue="brl" name="currency">
|
|
203
203
|
<Segment value="brl">BRL</Segment>
|
|
204
204
|
<Segment value="usd">USD</Segment>
|
|
205
205
|
</SegmentedControl>
|
|
206
|
-
<FieldDescription>
|
|
206
|
+
<FieldDescription>The conversion uses the exchange rate of the issue date.</FieldDescription>
|
|
207
207
|
</Field>;
|
|
208
208
|
```
|
|
209
209
|
|
|
@@ -235,9 +235,9 @@ A label longer than its column, a five-segment set in a narrow frame, and a righ
|
|
|
235
235
|
Excerpt — not a complete module
|
|
236
236
|
|
|
237
237
|
```tsx
|
|
238
|
-
<SegmentedControl aria-label="
|
|
239
|
-
<Segment value="now">
|
|
240
|
-
<Segment value="digest">
|
|
238
|
+
<SegmentedControl aria-label="Frequency" defaultValue="now" fullWidth>
|
|
239
|
+
<Segment value="now">Immediately</Segment>
|
|
240
|
+
<Segment value="digest">Once a day, in the evening digest</Segment>
|
|
241
241
|
</SegmentedControl>;
|
|
242
242
|
```
|
|
243
243
|
|
|
@@ -249,8 +249,8 @@ Excerpt — not a complete module
|
|
|
249
249
|
|
|
250
250
|
```tsx
|
|
251
251
|
<SegmentedControlDefaultsProvider fullWidth size="sm">
|
|
252
|
-
<SegmentedControl aria-label="
|
|
253
|
-
<Segment value="grid">
|
|
252
|
+
<SegmentedControl aria-label="View" render={(props) => <nav {...props} />}>
|
|
253
|
+
<Segment value="grid">Grid</Segment>
|
|
254
254
|
</SegmentedControl>
|
|
255
255
|
</SegmentedControlDefaultsProvider>;
|
|
256
256
|
```
|
|
@@ -262,8 +262,8 @@ Tab lands on the checked segment; both pairs of arrows move focus and the choice
|
|
|
262
262
|
Excerpt — not a complete module
|
|
263
263
|
|
|
264
264
|
```tsx
|
|
265
|
-
<SegmentedControl aria-label="
|
|
266
|
-
<Segment value="standard">
|
|
267
|
-
<Segment value="express">
|
|
265
|
+
<SegmentedControl aria-label="Shipping">
|
|
266
|
+
<Segment value="standard">Standard</Segment>
|
|
267
|
+
<Segment value="express">Express</Segment>
|
|
268
268
|
</SegmentedControl>;
|
|
269
269
|
```
|
package/dist/docs/skeleton.json
CHANGED
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"The region carries aria-busy=\"true\" while it waits, which is the platform’s own answer: ARIA 1.2 asks an author to set it on the container before the first change and clear it when the last change is complete. There is no APG pattern for a skeleton — the index holds thirty patterns and none is this one.",
|
|
231
231
|
"One region is one announcement. A visually-hidden role=\"status\" holds the label while waiting and is emptied afterwards, and emptying a live region announces nothing, so twelve placeholders do not become twelve messages. loadedLabel opts into a second.",
|
|
232
232
|
"Under prefers-reduced-motion the loop stops rather than shortening: an infinite animation that hurries is still moving. animation=\"none\", set once through the provider, is the author-side mechanism WCAG 2.2 SC 2.2.2 asks for.",
|
|
233
|
-
"The placeholder is visible in all three
|
|
233
|
+
"The placeholder is visible in all three color schemes. The fill is the unavailable surface carried a little toward the text color, and a hairline rim takes over in high contrast, where that surface is the page’s own white."
|
|
234
234
|
]
|
|
235
235
|
}
|
|
236
236
|
},
|
package/dist/docs/skeleton.md
CHANGED
|
@@ -72,7 +72,7 @@ Excerpt — not a complete module
|
|
|
72
72
|
- The region carries aria-busy="true" while it waits, which is the platform’s own answer: ARIA 1.2 asks an author to set it on the container before the first change and clear it when the last change is complete. There is no APG pattern for a skeleton — the index holds thirty patterns and none is this one.
|
|
73
73
|
- One region is one announcement. A visually-hidden role="status" holds the label while waiting and is emptied afterwards, and emptying a live region announces nothing, so twelve placeholders do not become twelve messages. loadedLabel opts into a second.
|
|
74
74
|
- Under prefers-reduced-motion the loop stops rather than shortening: an infinite animation that hurries is still moving. animation="none", set once through the provider, is the author-side mechanism WCAG 2.2 SC 2.2.2 asks for.
|
|
75
|
-
- The placeholder is visible in all three
|
|
75
|
+
- The placeholder is visible in all three color schemes. The fill is the unavailable surface carried a little toward the text color, and a hairline rim takes over in high contrast, where that surface is the page’s own white.
|
|
76
76
|
|
|
77
77
|
## Tokens
|
|
78
78
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build-own-element
|
|
3
|
-
description: Use when writing a component, widget or visual element that no family of @slotted/react draws — a timeline strip, a seat map, a heat grid, a bespoke control. Proves first that no family answers, then builds the element from the theme's tokens with the states, focus, target size, forced
|
|
3
|
+
description: Use when writing a component, widget or visual element that no family of @slotted/react draws — a timeline strip, a seat map, a heat grid, a bespoke control. Proves first that no family answers, then builds the element from the theme's tokens with the states, focus, target size, forced colors and motion the families keep.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Build an element of the application's own
|
|
@@ -37,7 +37,7 @@ Fixed, read from the theme:
|
|
|
37
37
|
- a tone carries the meaning the `tone` group gives it, and a data series takes
|
|
38
38
|
the `data` slots in order;
|
|
39
39
|
- how its states yield, how focus is drawn, how large a target is, what forced
|
|
40
|
-
|
|
40
|
+
colors keep and how it moves (OE-02 to OE-07).
|
|
41
41
|
|
|
42
42
|
A new appearance is a new combination of tokens, never a new value.
|
|
43
43
|
|
|
@@ -85,6 +85,6 @@ why no token covers it (CP-05).
|
|
|
85
85
|
## 5. Done
|
|
86
86
|
|
|
87
87
|
1. Each `Check` of `../../guidelines/own-elements.md` passes.
|
|
88
|
-
2. The element's CSS holds no
|
|
88
|
+
2. The element's CSS holds no color or length literal without its comment.
|
|
89
89
|
3. Every custom property the element reads is listed in
|
|
90
90
|
`../../tokens.md` above "Read by their family only".
|
|
@@ -25,7 +25,7 @@ that fact.
|
|
|
25
25
|
| Lists records, searches, filters, pages | `list-pages.md` |
|
|
26
26
|
| Shows one record, its figures and its related records | `record-pages.md` |
|
|
27
27
|
| Creates or edits a record | `forms.md` |
|
|
28
|
-
|
|
|
28
|
+
| Summarizes a domain in figures and charts | `overviews.md` |
|
|
29
29
|
| Places a list beside a tree of its places | `browsing.md` |
|
|
30
30
|
| Reads records over a chosen period | `reports.md` |
|
|
31
31
|
| Writes or reads a rule the system runs later | `builders.md` |
|
|
@@ -75,7 +75,7 @@ element stands in that slot.
|
|
|
75
75
|
own state at once and renders the region from a deferred value (in React,
|
|
76
76
|
useDeferredValue or startTransition) (CP-09). A list longer than a hundred
|
|
77
77
|
rows is a `data-grid`, which windows its rows where it has a height of its
|
|
78
|
-
own and is served in pages below 600 pixels (LP-12, LP-14). Its columns, its disabled keys and a function row key are module constants or
|
|
78
|
+
own and is served in pages below 600 pixels (LP-12, LP-14). Its columns, its disabled keys and a function row key are module constants or memoized: a new one on a render of the screen renders every mounted row again. Its renderers, its messages and its tree may be written inline.
|
|
79
79
|
- An element of the screen's own made `position: sticky` stops under the
|
|
80
80
|
page's chrome: its offset starts at `--slotted-page-sticky-top`, and its
|
|
81
81
|
height cap subtracts it (LA-06). An offset from the scroller's edge alone
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Each skill, with when it applies. Read a skill before its task.
|
|
4
4
|
|
|
5
|
-
- build-own-element: `./build-own-element/SKILL.md` — Use when writing a component, widget or visual element that no family of @slotted/react draws — a timeline strip, a seat map, a heat grid, a bespoke control. Proves first that no family answers, then builds the element from the theme's tokens with the states, focus, target size, forced
|
|
5
|
+
- build-own-element: `./build-own-element/SKILL.md` — Use when writing a component, widget or visual element that no family of @slotted/react draws — a timeline strip, a seat map, a heat grid, a bespoke control. Proves first that no family answers, then builds the element from the theme's tokens with the states, focus, target size, forced colors and motion the families keep.
|
|
6
6
|
- compose-screen: `./compose-screen/SKILL.md` — Use when writing or changing a screen of an application built with @slotted/react — a list of records, the page of one record, a form that writes one, an overview, a report, a tree beside a list, a rule builder, a conversation or a ledger. Applies the Slotted guidelines in order and ends with each Check of the rules read.
|
|
7
7
|
- review-screen: `./review-screen/SKILL.md` — Use when reviewing, auditing or fixing an existing screen of an application built with @slotted/react, or when asked whether a screen follows the Slotted guidelines. Reads the rules that apply, sweeps the screen's code for the defects found without running it, and reports each finding with its rule, level and place.
|
|
8
|
-
- theme-app: `./theme-app/SKILL.md` — Use when changing how an application built with @slotted/react looks, as a whole or in one region — its brand
|
|
8
|
+
- theme-app: `./theme-app/SKILL.md` — Use when changing how an application built with @slotted/react looks, as a whole or in one region — its brand color, a light, dark or high-contrast scheme, density, fonts, corners, or the shape of a control. Chooses the narrowest level that reaches the change — a seed, a token, a family token or a theme rule — and where it is declared.
|
|
9
9
|
- waiting-states: `./waiting-states/SKILL.md` — Use when building or reviewing anything a person waits in front of in an application built with @slotted/react — placeholders, a control's own loading state, a loading overlay, a progress indicator, or the empty and error states beside them. Decides which indicator answers which wait and how placeholders are built from the anatomy they stand in for.
|
|
@@ -34,15 +34,15 @@ Each search below finds a defect without running the screen.
|
|
|
34
34
|
|
|
35
35
|
| Search the screen's files for | Defect | Rule |
|
|
36
36
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | ------------ |
|
|
37
|
-
| A
|
|
38
|
-
| A rule of the application's CSS that sets
|
|
37
|
+
| A color literal (hex, rgb, hsl, oklch), a length in pixels or rem other than zero, or a font size, in the screen's CSS | a value the theme has a token for | CP-05, OE-01 |
|
|
38
|
+
| A rule of the application's CSS that sets color, border, radius, padding or type on a family's `data-ui` or `data-part` | the screen restyles a family instead of setting its axes | OE-08 |
|
|
39
39
|
| A control that starts a request and is not in its `loading` state until the answer, except a Refresh of the whole page | a control that fires twice | AF-03 |
|
|
40
40
|
| A Refresh of the whole page drawing a spinner on its button, or a refetch of data on screen with no `page-header` progress bar | a wait in the wrong place, and no wait shown for the page | AF-07 |
|
|
41
41
|
| An empty state drawn from the initial value of the data, before the first answer | a wait shown as nothing | AF-01 |
|
|
42
42
|
| A spinner standing in a region that has no items yet | placeholders missing | AF-02 |
|
|
43
43
|
| Siblings of the page's own spaced by margins, or text with a font size of its own | layout outside the primitives | CP-02 |
|
|
44
44
|
| A grid or flex track around a family that scrolls, with no zero minimum | the page scrolls, not the family | CP-03 |
|
|
45
|
-
| A badge, a tag or a
|
|
45
|
+
| A badge, a tag or a color beside a family that already draws the same state | a state stated twice | CP-06 |
|
|
46
46
|
| An element of the screen's own that takes focus with no ring in its `focus-visible` state | focus not drawn | OE-03 |
|
|
47
47
|
| A `data-grid` or `table` with no `variant` on a page whose `width` is not `bleed` | a grid with no frame on the page's surface | LP-15 |
|
|
48
48
|
| A list page's `page-header` with a heading and no subheading, no figures and no solid primary action | a header that does not say what the list covers | LP-16 |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: theme-app
|
|
3
|
-
description: Use when changing how an application built with @slotted/react looks, as a whole or in one region — its brand
|
|
3
|
+
description: Use when changing how an application built with @slotted/react looks, as a whole or in one region — its brand color, a light, dark or high-contrast scheme, density, fonts, corners, or the shape of a control. Chooses the narrowest level that reaches the change — a seed, a token, a family token or a theme rule — and where it is declared.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Theme an application
|
|
@@ -14,7 +14,7 @@ Take the first row that reaches the change.
|
|
|
14
14
|
|
|
15
15
|
| The change | Level | Declared in |
|
|
16
16
|
| ------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
17
|
-
| The brand
|
|
17
|
+
| The brand color, or the color of one intent | a seed: `--slotted-seed-accent` or another name of `SEED_NAMES` | the theme's `seeds`, or a scope |
|
|
18
18
|
| Light, dark, high contrast, or the system's preference | the scheme: `light`, `dark`, `high-contrast`, `system` | `data-slotted-scheme`, or the scheme of the `ThemeScope` component from `@slotted/react/theme` |
|
|
19
19
|
| How tight controls and rows are | the density: `comfortable`, `compact`, `dense` | `data-slotted-density`, or the density of the `ThemeScope` component from `@slotted/react/theme` |
|
|
20
20
|
| How round corners are, chosen by the reader | the corners: `square`, `soft`, `standard`, `round` | `data-slotted-corners`, or the corners of the `ThemeScope` component from `@slotted/react/theme`; the theme's `corners` holds each radius scale |
|
|
@@ -24,8 +24,8 @@ Take the first row that reaches the change.
|
|
|
24
24
|
| One family's look | a token the family's page lists under Tokens | the theme's `components` |
|
|
25
25
|
| What no token reaches | a theme rule | the theme's `rules` |
|
|
26
26
|
|
|
27
|
-
Every
|
|
28
|
-
new seed keeps the ratios of every scheme. A
|
|
27
|
+
Every color token derives from the six seeds within contrast bounds, so a
|
|
28
|
+
new seed keeps the ratios of every scheme. A color of the `tone`, `surface`,
|
|
29
29
|
`text` or `border` groups is changed through its seed, or through its
|
|
30
30
|
derivation in the recipe, never declared by hand.
|
|
31
31
|
|
|
@@ -63,16 +63,16 @@ has.
|
|
|
63
63
|
`data-slotted-variant-<axis>` attribute on the subtree's root or on an
|
|
64
64
|
ancestor of the scheme's root.
|
|
65
65
|
2. A seed for a subtree: the seed property on an element that also carries
|
|
66
|
-
`data-slotted-seeds`, or the seeds of the `ThemeScope` component from `@slotted/react/theme`. Every
|
|
66
|
+
`data-slotted-seeds`, or the seeds of the `ThemeScope` component from `@slotted/react/theme`. Every color under it
|
|
67
67
|
derives again from that seed.
|
|
68
|
-
3. A
|
|
68
|
+
3. A color the reader picks at runtime: write the seed property on the element
|
|
69
69
|
that carries `data-slotted-theme`, with `seedStyle` from
|
|
70
70
|
`@slotted/theme/seeds`, which leaves the token contract out of the bundle.
|
|
71
71
|
4. A bar of the application's own that floats over scrolling content — a phone
|
|
72
72
|
tab bar, a sticky banner — is a material: its background reads
|
|
73
73
|
`--slotted-surface-material` and its backdrop filter reads
|
|
74
74
|
`--slotted-material-backdrop`. The theme makes both opaque under reduced
|
|
75
|
-
transparency and forced
|
|
75
|
+
transparency and forced colors. A page header becomes that material once
|
|
76
76
|
content passes under it with its `material` input, set on the header or on
|
|
77
77
|
its defaults. A theme draws the command palette as one by setting
|
|
78
78
|
`--slotted-command-palette-surface` to the material surface and
|
|
@@ -93,7 +93,7 @@ has.
|
|
|
93
93
|
`--slotted-chart-overlay-backdrop-filter`. A chart's table view takes
|
|
94
94
|
`--slotted-chart-table-surface` and its sticky header
|
|
95
95
|
`--slotted-chart-table-header-surface`; `--slotted-chart-surface` stays
|
|
96
|
-
opaque, because the series
|
|
96
|
+
opaque, because the series colors mix with it.
|
|
97
97
|
|
|
98
98
|
## 4. Restyle a control
|
|
99
99
|
|
|
@@ -120,6 +120,6 @@ has.
|
|
|
120
120
|
## 5. Done
|
|
121
121
|
|
|
122
122
|
1. The application's own CSS declares no token of the `tone`, `surface`,
|
|
123
|
-
`text` or `border` groups, and sets no
|
|
123
|
+
`text` or `border` groups, and sets no color, border, radius, padding or
|
|
124
124
|
type on a family's `data-ui` or `data-part`.
|
|
125
125
|
2. `themeConformance` passes for the theme.
|
|
@@ -45,7 +45,7 @@ family's indicator (AF-03).
|
|
|
45
45
|
|
|
46
46
|
## 2. Placeholders are the anatomy, not rectangles
|
|
47
47
|
|
|
48
|
-
Placeholders are the same layout as the content, drawn in one
|
|
48
|
+
Placeholders are the same layout as the content, drawn in one color. Build
|
|
49
49
|
them from the loaded markup:
|
|
50
50
|
|
|
51
51
|
1. Keep the container, the parts, the grid, the inset and the gap tokens the
|
package/dist/docs/slider.json
CHANGED
|
@@ -345,9 +345,9 @@
|
|
|
345
345
|
"Each thumb’s own min and max follow its neighbour, which is the multi-thumb pattern’s requirement that the announced range of a dependent slider be updated when the value changes. Radix and Ark clamp in script and leave the announced range as the scale’s, so a reader is told a thumb may reach a value it cannot. The tab order stays the array’s order however the thumbs move, which is the pattern’s second requirement.",
|
|
346
346
|
"The whole keyboard table is the family’s: arrows by step, Shift and the page keys by largeStep, Home and End to this thumb’s own bounds. The inline arrows follow the reading direction and the block arrows do not — a scale has a direction and bidi is not it — which is what the pattern’s note about reversing the direction means in a mirrored document.",
|
|
347
347
|
"aria-valuetext carries the formatted string, because aria-valuenow alone announces 1480 for a scale showing R$ 1.480,00. A mark that carries a label becomes that string at its own value, which is exactly the case the pattern names for the property and the one Ark and Mantine make a consumer write a function for.",
|
|
348
|
-
"aria-required, never the native required. The native attribute engages browser constraint validation and changes submit
|
|
348
|
+
"aria-required, never the native required. The native attribute engages browser constraint validation and changes submit behavior, which the library must not impose as a side effect of describing a field. disabled is native, because that is what the word means; readonly is not, because input[type=range] does not answer it, so the family refuses the change itself and writes aria-readonly.",
|
|
349
349
|
"The target is the band rather than the thumb: it is floored at 24 CSS pixels in the cross axis, which is WCAG 2.2 SC 2.5.8, and a press anywhere on it moves the nearest thumb and starts a drag. The APG’s own warning about touch-based assistive technologies is why the keyboard reaches every value the pointer can.",
|
|
350
|
-
"Nothing is said by
|
|
350
|
+
"Nothing is said by color alone. Invalid is announced by aria-invalid and said in words by the field’s error; the fill and the thumb change tone as well as color, and in the high-contrast scheme the rail is a white channel with a black edge so the fill is still visible inside it.",
|
|
351
351
|
"The bubble is aria-hidden. The input beneath it already announces the value, and a second copy would announce it twice."
|
|
352
352
|
]
|
|
353
353
|
}
|
|
@@ -433,7 +433,7 @@
|
|
|
433
433
|
"title": "Playground",
|
|
434
434
|
"note": "One scale with every axis on it, driven by the controls below the canvas. Press anywhere on the band: the nearest thumb moves there and keeps following the pointer.",
|
|
435
435
|
"language": "tsx",
|
|
436
|
-
"source": "<Field>\n <FieldLabel>Volume</FieldLabel>\n <Slider defaultValue={40} format={{ style: 'percent' }} max={1} step={0.01} />\n <FieldDescription>
|
|
436
|
+
"source": "<Field>\n <FieldLabel>Volume</FieldLabel>\n <Slider defaultValue={40} format={{ style: 'percent' }} max={1} step={0.01} />\n <FieldDescription>Applies to all app alerts.</FieldDescription>\n</Field>;\n",
|
|
437
437
|
"verdict": "excerpt"
|
|
438
438
|
},
|
|
439
439
|
{
|
|
@@ -449,7 +449,7 @@
|
|
|
449
449
|
"title": "Which axis the scale runs along",
|
|
450
450
|
"note": "A vertical scale puts its minimum at the bottom, where the browser’s own vertical range input puts it. The arrows follow: Up increases in both orientations, and only the inline pair mirrors in a right-to-left document.",
|
|
451
451
|
"language": "tsx",
|
|
452
|
-
"source": "<Slider aria-label=\"
|
|
452
|
+
"source": "<Slider aria-label=\"Treble\" defaultValue={70} orientation=\"vertical\" />;\n<Slider aria-label=\"Mids\" defaultValue={35} orientation=\"vertical\" />;\n<Slider aria-label=\"Bass\" defaultValue={50} orientation=\"vertical\" />;\n",
|
|
453
453
|
"verdict": "excerpt"
|
|
454
454
|
},
|
|
455
455
|
{
|
|
@@ -457,7 +457,7 @@
|
|
|
457
457
|
"title": "Two thumbs, and the distance between them",
|
|
458
458
|
"note": "An array of values makes a range. Each thumb’s own min and max follow its neighbour, so the two cannot cross and a screen reader is told the range each one actually has — which is what the multi-thumb pattern requires and what clamping in script leaves wrong.",
|
|
459
459
|
"language": "tsx",
|
|
460
|
-
"source": "<Slider\n defaultValue={[240, 780]}\n max={1000}\n minStepsBetween={2}\n name=\"
|
|
460
|
+
"source": "<Slider\n defaultValue={[240, 780]}\n max={1000}\n minStepsBetween={2}\n name=\"price\"\n step={10}\n thumbLabels={['Minimum price', 'Maximum price']}\n/>;\n",
|
|
461
461
|
"verdict": "excerpt"
|
|
462
462
|
},
|
|
463
463
|
{
|
|
@@ -465,7 +465,7 @@
|
|
|
465
465
|
"title": "A scale a reader can read",
|
|
466
466
|
"note": "Marks are ruler ticks beside the rail rather than dots on it, so a tick never has to be legible against the fill and against the empty channel at once. A label of two words wraps rather than running into its neighbour, and one long word overflows its box rather than being clipped: nothing on this scale leaves the DOM.",
|
|
467
467
|
"language": "tsx",
|
|
468
|
-
"source": "<Slider\n defaultValue={50}\n marks={[\n { value: 0, label: '
|
|
468
|
+
"source": "<Slider\n defaultValue={50}\n marks={[\n { value: 0, label: 'Low' },\n { value: 25, label: 'Reduced' },\n { value: 50, label: 'Medium' },\n { value: 75, label: 'High' },\n { value: 100, label: 'Maximum' },\n ]}\n step={25}\n/>;\n\n// Numbers alone draw ticks and reserve no room for labels.\n<Slider defaultValue={6} marks={[2, 4, 6, 8]} max={10} />;\n",
|
|
469
469
|
"verdict": "excerpt"
|
|
470
470
|
},
|
|
471
471
|
{
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
"title": "Where the number stands",
|
|
490
490
|
"note": "auto shows the bubble while a thumb is dragged or focused, always keeps it there, and none withdraws both the bubble and the read-out. The room the bubble stands in is reserved either way, so nothing moves when a drag begins.",
|
|
491
491
|
"language": "tsx",
|
|
492
|
-
"source": "<Slider defaultValue={40} valueLabel=\"auto\" />;\n<Slider defaultValue={40} valueLabel=\"always\" />;\n\n// A value that is a sentence belongs in a label of the consumer’s own.\n<Slider defaultValue={2} marks={
|
|
492
|
+
"source": "<Slider defaultValue={40} valueLabel=\"auto\" />;\n<Slider defaultValue={40} valueLabel=\"always\" />;\n\n// A value that is a sentence belongs in a label of the consumer’s own.\n<Slider defaultValue={2} marks={DELIVERY} max={2} valueLabel=\"none\" />;\n",
|
|
493
493
|
"verdict": "excerpt"
|
|
494
494
|
},
|
|
495
495
|
{
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
"title": "Content the family did not choose",
|
|
506
506
|
"note": "A five-label scale at 240 pixels, a mark label of four words, a negative range and a value written in a locale that groups with a full stop. Nothing is truncated and nothing is taken out of the DOM.",
|
|
507
507
|
"language": "tsx",
|
|
508
|
-
"source": "<Slider\n defaultValue={[-1480, 2960]}\n format={{ maximumFractionDigits: 2, minimumFractionDigits: 2 }}\n locale=\"pt-BR\"\n max={4000}\n min={-4000}\n step={20}\n thumbLabels={['
|
|
508
|
+
"source": "<Slider\n defaultValue={[-1480, 2960]}\n format={{ maximumFractionDigits: 2, minimumFractionDigits: 2 }}\n locale=\"pt-BR\"\n max={4000}\n min={-4000}\n step={20}\n thumbLabels={['Minimum balance', 'Maximum balance']}\n/>;\n",
|
|
509
509
|
"verdict": "excerpt"
|
|
510
510
|
},
|
|
511
511
|
{
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
"title": "In a field, in a form, and beside a number",
|
|
514
514
|
"note": "The label, the description, the error and the identifier arrive from the field with nothing written. name submits one value per thumb, and a number field beside the scale is the pairing the guide recommends when precision matters.",
|
|
515
515
|
"language": "tsx",
|
|
516
|
-
"source": "<SliderDefaultsProvider valueLabel=\"always\">\n <Field invalid>\n <FieldLabel>
|
|
516
|
+
"source": "<SliderDefaultsProvider valueLabel=\"always\">\n <Field invalid>\n <FieldLabel>Stake</FieldLabel>\n <Slider defaultValue={96} name=\"stake\" />\n <FieldError>The stake cannot exceed ninety percent.</FieldError>\n </Field>\n</SliderDefaultsProvider>;\n\nconst handle = useRef<SliderHandle>(null);\n<Slider handle={handle} />;\n<Button onClick={() => handle.current?.focusThumb(1)}>Go to maximum</Button>;\n",
|
|
517
517
|
"verdict": "excerpt"
|
|
518
518
|
},
|
|
519
519
|
{
|
package/dist/docs/slider.md
CHANGED
|
@@ -17,7 +17,7 @@ Excerpt — not a complete module
|
|
|
17
17
|
<Field>
|
|
18
18
|
<FieldLabel>Volume</FieldLabel>
|
|
19
19
|
<Slider defaultValue={40} format={{ style: 'percent' }} max={1} step={0.01} />
|
|
20
|
-
<FieldDescription>
|
|
20
|
+
<FieldDescription>Applies to all app alerts.</FieldDescription>
|
|
21
21
|
</Field>;
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -89,9 +89,9 @@ Excerpt — not a complete module
|
|
|
89
89
|
- Each thumb’s own min and max follow its neighbour, which is the multi-thumb pattern’s requirement that the announced range of a dependent slider be updated when the value changes. Radix and Ark clamp in script and leave the announced range as the scale’s, so a reader is told a thumb may reach a value it cannot. The tab order stays the array’s order however the thumbs move, which is the pattern’s second requirement.
|
|
90
90
|
- The whole keyboard table is the family’s: arrows by step, Shift and the page keys by largeStep, Home and End to this thumb’s own bounds. The inline arrows follow the reading direction and the block arrows do not — a scale has a direction and bidi is not it — which is what the pattern’s note about reversing the direction means in a mirrored document.
|
|
91
91
|
- aria-valuetext carries the formatted string, because aria-valuenow alone announces 1480 for a scale showing R$ 1.480,00. A mark that carries a label becomes that string at its own value, which is exactly the case the pattern names for the property and the one Ark and Mantine make a consumer write a function for.
|
|
92
|
-
- aria-required, never the native required. The native attribute engages browser constraint validation and changes submit
|
|
92
|
+
- aria-required, never the native required. The native attribute engages browser constraint validation and changes submit behavior, which the library must not impose as a side effect of describing a field. disabled is native, because that is what the word means; readonly is not, because input[type=range] does not answer it, so the family refuses the change itself and writes aria-readonly.
|
|
93
93
|
- The target is the band rather than the thumb: it is floored at 24 CSS pixels in the cross axis, which is WCAG 2.2 SC 2.5.8, and a press anywhere on it moves the nearest thumb and starts a drag. The APG’s own warning about touch-based assistive technologies is why the keyboard reaches every value the pointer can.
|
|
94
|
-
- Nothing is said by
|
|
94
|
+
- Nothing is said by color alone. Invalid is announced by aria-invalid and said in words by the field’s error; the fill and the thumb change tone as well as color, and in the high-contrast scheme the rail is a white channel with a black edge so the fill is still visible inside it.
|
|
95
95
|
- The bubble is aria-hidden. The input beneath it already announces the value, and a second copy would announce it twice.
|
|
96
96
|
|
|
97
97
|
## Tokens
|
|
@@ -124,9 +124,9 @@ A vertical scale puts its minimum at the bottom, where the browser’s own verti
|
|
|
124
124
|
Excerpt — not a complete module
|
|
125
125
|
|
|
126
126
|
```tsx
|
|
127
|
-
<Slider aria-label="
|
|
128
|
-
<Slider aria-label="
|
|
129
|
-
<Slider aria-label="
|
|
127
|
+
<Slider aria-label="Treble" defaultValue={70} orientation="vertical" />;
|
|
128
|
+
<Slider aria-label="Mids" defaultValue={35} orientation="vertical" />;
|
|
129
|
+
<Slider aria-label="Bass" defaultValue={50} orientation="vertical" />;
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### Two thumbs, and the distance between them
|
|
@@ -140,9 +140,9 @@ Excerpt — not a complete module
|
|
|
140
140
|
defaultValue={[240, 780]}
|
|
141
141
|
max={1000}
|
|
142
142
|
minStepsBetween={2}
|
|
143
|
-
name="
|
|
143
|
+
name="price"
|
|
144
144
|
step={10}
|
|
145
|
-
thumbLabels={['
|
|
145
|
+
thumbLabels={['Minimum price', 'Maximum price']}
|
|
146
146
|
/>;
|
|
147
147
|
```
|
|
148
148
|
|
|
@@ -156,11 +156,11 @@ Excerpt — not a complete module
|
|
|
156
156
|
<Slider
|
|
157
157
|
defaultValue={50}
|
|
158
158
|
marks={[
|
|
159
|
-
{ value: 0, label: '
|
|
160
|
-
{ value: 25, label: '
|
|
161
|
-
{ value: 50, label: '
|
|
162
|
-
{ value: 75, label: '
|
|
163
|
-
{ value: 100, label: '
|
|
159
|
+
{ value: 0, label: 'Low' },
|
|
160
|
+
{ value: 25, label: 'Reduced' },
|
|
161
|
+
{ value: 50, label: 'Medium' },
|
|
162
|
+
{ value: 75, label: 'High' },
|
|
163
|
+
{ value: 100, label: 'Maximum' },
|
|
164
164
|
]}
|
|
165
165
|
step={25}
|
|
166
166
|
/>;
|
|
@@ -208,7 +208,7 @@ Excerpt — not a complete module
|
|
|
208
208
|
<Slider defaultValue={40} valueLabel="always" />;
|
|
209
209
|
|
|
210
210
|
// A value that is a sentence belongs in a label of the consumer’s own.
|
|
211
|
-
<Slider defaultValue={2} marks={
|
|
211
|
+
<Slider defaultValue={2} marks={DELIVERY} max={2} valueLabel="none" />;
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
### Every state the family paints
|
|
@@ -238,7 +238,7 @@ Excerpt — not a complete module
|
|
|
238
238
|
max={4000}
|
|
239
239
|
min={-4000}
|
|
240
240
|
step={20}
|
|
241
|
-
thumbLabels={['
|
|
241
|
+
thumbLabels={['Minimum balance', 'Maximum balance']}
|
|
242
242
|
/>;
|
|
243
243
|
```
|
|
244
244
|
|
|
@@ -251,15 +251,15 @@ Excerpt — not a complete module
|
|
|
251
251
|
```tsx
|
|
252
252
|
<SliderDefaultsProvider valueLabel="always">
|
|
253
253
|
<Field invalid>
|
|
254
|
-
<FieldLabel>
|
|
255
|
-
<Slider defaultValue={96} name="
|
|
256
|
-
<FieldError>
|
|
254
|
+
<FieldLabel>Stake</FieldLabel>
|
|
255
|
+
<Slider defaultValue={96} name="stake" />
|
|
256
|
+
<FieldError>The stake cannot exceed ninety percent.</FieldError>
|
|
257
257
|
</Field>
|
|
258
258
|
</SliderDefaultsProvider>;
|
|
259
259
|
|
|
260
260
|
const handle = useRef<SliderHandle>(null);
|
|
261
261
|
<Slider handle={handle} />;
|
|
262
|
-
<Button onClick={() => handle.current?.focusThumb(1)}>
|
|
262
|
+
<Button onClick={() => handle.current?.focusThumb(1)}>Go to maximum</Button>;
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
### What the keyboard does, and which arrows mirror
|