@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
package/dist/docs/carousel.md
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
Excerpt — not a complete module
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
|
-
<Carousel aria-label="
|
|
28
|
+
<Carousel aria-label="Autumn Collection">
|
|
29
29
|
<CarouselViewport>
|
|
30
30
|
{pieces.map((piece) => (
|
|
31
31
|
<CarouselSlide key={piece.name}>
|
|
@@ -144,14 +144,14 @@ Excerpt — not a complete module
|
|
|
144
144
|
</Carousel>;
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
###
|
|
147
|
+
### Centerd, with the neighbours showing
|
|
148
148
|
|
|
149
|
-
align="center" makes every slide a page and
|
|
149
|
+
align="center" makes every slide a page and centers it; --slotted-carousel-peek pads the viewport so the slides either side show at its edges. Press a slide that peeks and it comes to the center.
|
|
150
150
|
|
|
151
151
|
Excerpt — not a complete module
|
|
152
152
|
|
|
153
153
|
```tsx
|
|
154
|
-
<Carousel align="center" aria-label="
|
|
154
|
+
<Carousel align="center" aria-label="One-of-a-kind pieces" className="peek">
|
|
155
155
|
<CarouselViewport>{slides}</CarouselViewport>
|
|
156
156
|
<CarouselPrevious />
|
|
157
157
|
<CarouselNext />
|
|
@@ -206,7 +206,7 @@ Excerpt — not a complete module
|
|
|
206
206
|
|
|
207
207
|
### A product gallery
|
|
208
208
|
|
|
209
|
-
variant="thumbnails" with a function child draws each indicator from the consumer’s picture. The strip scrolls on its own when it holds more than it shows, and keeps the current picture in view — one carousel, nothing to
|
|
209
|
+
variant="thumbnails" with a function child draws each indicator from the consumer’s picture. The strip scrolls on its own when it holds more than it shows, and keeps the current picture in view — one carousel, nothing to synchronize.
|
|
210
210
|
|
|
211
211
|
Excerpt — not a complete module
|
|
212
212
|
|
|
@@ -266,7 +266,7 @@ loop sends next on the last page to the first and previous on the first to the l
|
|
|
266
266
|
Excerpt — not a complete module
|
|
267
267
|
|
|
268
268
|
```tsx
|
|
269
|
-
<Carousel aria-label="
|
|
269
|
+
<Carousel aria-label="Collection" loop>
|
|
270
270
|
…
|
|
271
271
|
</Carousel>;
|
|
272
272
|
```
|
|
@@ -281,7 +281,7 @@ Excerpt — not a complete module
|
|
|
281
281
|
const [page, setPage] = useState(0);
|
|
282
282
|
|
|
283
283
|
<Carousel
|
|
284
|
-
aria-label="
|
|
284
|
+
aria-label="Collection"
|
|
285
285
|
page={page}
|
|
286
286
|
onPageChange={(next, request) => {
|
|
287
287
|
log(request.reason);
|
|
@@ -327,12 +327,12 @@ With no slide the controls are disabled and the counter reads 0 / 0; the empty s
|
|
|
327
327
|
Excerpt — not a complete module
|
|
328
328
|
|
|
329
329
|
```tsx
|
|
330
|
-
<Carousel aria-label="
|
|
330
|
+
<Carousel aria-label="Collection">
|
|
331
331
|
<CarouselViewport>
|
|
332
332
|
{pieces.length === 0 ? (
|
|
333
333
|
<ResultState status="empty">
|
|
334
334
|
<ResultStateContent>
|
|
335
|
-
<ResultStateTitle>
|
|
335
|
+
<ResultStateTitle>No pieces in this collection</ResultStateTitle>
|
|
336
336
|
</ResultStateContent>
|
|
337
337
|
</ResultState>
|
|
338
338
|
) : (
|
|
@@ -344,7 +344,7 @@ Excerpt — not a complete module
|
|
|
344
344
|
|
|
345
345
|
### Inside a product page
|
|
346
346
|
|
|
347
|
-
The gallery beside the buy box, as a product page lays them out: the picture and its thumbnails on the start, the name, the price and the action on the end. handleRef.scrollToSlide takes the gallery to the picture of the
|
|
347
|
+
The gallery beside the buy box, as a product page lays them out: the picture and its thumbnails on the start, the name, the price and the action on the end. handleRef.scrollToSlide takes the gallery to the picture of the color chosen.
|
|
348
348
|
|
|
349
349
|
Excerpt — not a complete module
|
|
350
350
|
|
|
@@ -357,7 +357,7 @@ const gallery = useRef<CarouselHandle>(null);
|
|
|
357
357
|
</Carousel>
|
|
358
358
|
<SegmentedControl
|
|
359
359
|
aria-label="Cor"
|
|
360
|
-
onValueChange={(
|
|
360
|
+
onValueChange={(color) => gallery.current?.scrollToSlide(photoOf(color))}
|
|
361
361
|
>
|
|
362
362
|
…
|
|
363
363
|
</SegmentedControl>
|
|
@@ -371,7 +371,7 @@ Tab reaches the rotation control, the viewport, the arrows and then one tab stop
|
|
|
371
371
|
Excerpt — not a complete module
|
|
372
372
|
|
|
373
373
|
```tsx
|
|
374
|
-
<Carousel aria-label="
|
|
374
|
+
<Carousel aria-label="Collection">
|
|
375
375
|
<CarouselViewport>{slides}</CarouselViewport>
|
|
376
376
|
<CarouselControls>
|
|
377
377
|
<CarouselIndicators />
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
### Lines for a trend
|
|
9
9
|
|
|
10
|
-
Revenue and cost with a marker on the last point, and the target dashed in the neutral tone so it reads as a reference before its
|
|
10
|
+
Revenue and cost with a marker on the last point, and the target dashed in the neutral tone so it reads as a reference before its color does.
|
|
11
11
|
|
|
12
12
|
Excerpt — not a complete module
|
|
13
13
|
|
|
@@ -15,12 +15,12 @@ Excerpt — not a complete module
|
|
|
15
15
|
<Chart
|
|
16
16
|
data={monthly}
|
|
17
17
|
series={[
|
|
18
|
-
{ kind: 'line', field: 'revenue', label: '
|
|
19
|
-
{ kind: 'line', field: 'cost', label: '
|
|
20
|
-
{ kind: 'line', field: 'target', label: '
|
|
18
|
+
{ kind: 'line', field: 'revenue', label: 'Revenue', markers: 'last' },
|
|
19
|
+
{ kind: 'line', field: 'cost', label: 'Cost', markers: 'last' },
|
|
20
|
+
{ kind: 'line', field: 'target', label: 'Target', tone: 'neutral', stroke: 'dashed' },
|
|
21
21
|
]}
|
|
22
|
-
title="
|
|
23
|
-
x={{ field: 'month', label: '
|
|
22
|
+
title="Revenue and cost"
|
|
23
|
+
x={{ field: 'month', label: 'Month' }}
|
|
24
24
|
y={{ format: brlThousands }}
|
|
25
25
|
/>;
|
|
26
26
|
```
|
|
@@ -37,10 +37,10 @@ Excerpt — not a complete module
|
|
|
37
37
|
series={channels.map((channel) => ({
|
|
38
38
|
...channel,
|
|
39
39
|
kind: 'area',
|
|
40
|
-
stack: '
|
|
40
|
+
stack: 'channel',
|
|
41
41
|
curve: 'monotone',
|
|
42
42
|
}))}
|
|
43
|
-
title="
|
|
43
|
+
title="Sessions by channel"
|
|
44
44
|
x={{ field: 'month' }}
|
|
45
45
|
/>;
|
|
46
46
|
```
|
|
@@ -52,7 +52,7 @@ Three channels side by side in each month; the band under the pointer lights the
|
|
|
52
52
|
Excerpt — not a complete module
|
|
53
53
|
|
|
54
54
|
```tsx
|
|
55
|
-
<Chart data={orders} series={channels} title="
|
|
55
|
+
<Chart data={orders} series={channels} title="Orders by channel" x={{ field: 'month' }} />;
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### A ranking reads across
|
|
@@ -65,8 +65,8 @@ Excerpt — not a complete module
|
|
|
65
65
|
<Chart
|
|
66
66
|
data={regions}
|
|
67
67
|
orientation="horizontal"
|
|
68
|
-
series={[{ kind: 'bar', field: 'value', label: '
|
|
69
|
-
title="
|
|
68
|
+
series={[{ kind: 'bar', field: 'value', label: 'Revenue', labels: true }]}
|
|
69
|
+
title="Revenue by region"
|
|
70
70
|
x={{ field: 'region' }}
|
|
71
71
|
/>;
|
|
72
72
|
```
|
|
@@ -92,7 +92,7 @@ Excerpt — not a complete module
|
|
|
92
92
|
data={orders}
|
|
93
93
|
series={channels.map((channel) => ({ ...channel, kind: 'area', stack: 'total' }))}
|
|
94
94
|
stackMode="percent"
|
|
95
|
-
title="
|
|
95
|
+
title="Share by channel"
|
|
96
96
|
x={{ field: 'month' }}
|
|
97
97
|
/>;
|
|
98
98
|
```
|
|
@@ -127,12 +127,12 @@ Excerpt — not a complete module
|
|
|
127
127
|
<Chart
|
|
128
128
|
data={monthly}
|
|
129
129
|
series={[
|
|
130
|
-
{ kind: 'bar', field: 'orders', label: '
|
|
131
|
-
{ kind: 'line', field: 'margin', label: '
|
|
130
|
+
{ kind: 'bar', field: 'orders', label: 'Orders' },
|
|
131
|
+
{ kind: 'line', field: 'margin', label: 'Margin', axis: 'end', markers: 'all' },
|
|
132
132
|
]}
|
|
133
|
-
title="
|
|
133
|
+
title="Orders and margin"
|
|
134
134
|
x={{ field: 'month' }}
|
|
135
|
-
y={[{ label: '
|
|
135
|
+
y={[{ label: 'Orders' }, { label: 'Margin', format: { style: 'percent' } }]}
|
|
136
136
|
/>;
|
|
137
137
|
```
|
|
138
138
|
|
|
@@ -145,8 +145,8 @@ Excerpt — not a complete module
|
|
|
145
145
|
```tsx
|
|
146
146
|
<Chart
|
|
147
147
|
data={daily}
|
|
148
|
-
series={[{ kind: 'area', field: 'sessions', label: '
|
|
149
|
-
title="
|
|
148
|
+
series={[{ kind: 'area', field: 'sessions', label: 'Sessions' }]}
|
|
149
|
+
title="Daily sessions"
|
|
150
150
|
x={{ field: 'day', type: 'time' }}
|
|
151
151
|
/>;
|
|
152
152
|
```
|
|
@@ -170,15 +170,15 @@ Excerpt — not a complete module
|
|
|
170
170
|
```tsx
|
|
171
171
|
<Chart
|
|
172
172
|
data={regions}
|
|
173
|
-
series={[{ kind: 'pie', field: 'value', label: '
|
|
174
|
-
title="
|
|
173
|
+
series={[{ kind: 'pie', field: 'value', label: 'Revenue', labels: true }]}
|
|
174
|
+
title="Revenue by region"
|
|
175
175
|
x={{ field: 'region' }}
|
|
176
176
|
/>;
|
|
177
177
|
```
|
|
178
178
|
|
|
179
179
|
### A donut with the total inside
|
|
180
180
|
|
|
181
|
-
innerRadius opens the middle, and the center holds the total; legendValues puts each slice’s value beside its name. slotField and toneField give each slice the slot or tone its record names, so a category keeps the
|
|
181
|
+
innerRadius opens the middle, and the center holds the total; legendValues puts each slice’s value beside its name. slotField and toneField give each slice the slot or tone its record names, so a category keeps the color it has everywhere else; a slice that names none takes the next free slot.
|
|
182
182
|
|
|
183
183
|
Excerpt — not a complete module
|
|
184
184
|
|
|
@@ -203,11 +203,11 @@ Excerpt — not a complete module
|
|
|
203
203
|
data={tickets}
|
|
204
204
|
recordKey="id"
|
|
205
205
|
series={[
|
|
206
|
-
{ kind: 'scatter', field: 'product', label: '
|
|
207
|
-
{ kind: 'scatter', field: 'infra', label: '
|
|
206
|
+
{ kind: 'scatter', field: 'product', label: 'Product' },
|
|
207
|
+
{ kind: 'scatter', field: 'infra', label: 'Infrastructure' },
|
|
208
208
|
]}
|
|
209
|
-
title="
|
|
210
|
-
x={{ field: 'effort', type: 'value', label: '
|
|
209
|
+
title="Effort and impact"
|
|
210
|
+
x={{ field: 'effort', type: 'value', label: 'Effort (h)' }}
|
|
211
211
|
/>;
|
|
212
212
|
```
|
|
213
213
|
|
|
@@ -234,9 +234,9 @@ Excerpt — not a complete module
|
|
|
234
234
|
|
|
235
235
|
```tsx
|
|
236
236
|
const annotations: ChartAnnotation[] = [
|
|
237
|
-
{ kind: 'band', from: 55, to: 70, label: '
|
|
238
|
-
{ kind: 'line', value: 80, label: '
|
|
239
|
-
{ kind: 'line', axis: 'x', value: 'jun', label: '
|
|
237
|
+
{ kind: 'band', from: 55, to: 70, label: 'Tolerance', tone: 'success' },
|
|
238
|
+
{ kind: 'line', value: 80, label: 'Annual target', tone: 'danger' },
|
|
239
|
+
{ kind: 'line', axis: 'x', value: 'jun', label: 'Campaign' },
|
|
240
240
|
];
|
|
241
241
|
```
|
|
242
242
|
|
|
@@ -249,7 +249,7 @@ Excerpt — not a complete module
|
|
|
249
249
|
```tsx
|
|
250
250
|
const [hidden, setHidden] = useState<readonly string[]>([]);
|
|
251
251
|
|
|
252
|
-
<Chart {...channels} hidden={hidden} onHiddenChange={setHidden} title="
|
|
252
|
+
<Chart {...channels} hidden={hidden} onHiddenChange={setHidden} title="Acquisition channels" />;
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
### Values in the legend
|
|
@@ -259,7 +259,7 @@ Each legend item carries its series’ value at the active point, and the last v
|
|
|
259
259
|
Excerpt — not a complete module
|
|
260
260
|
|
|
261
261
|
```tsx
|
|
262
|
-
<Chart {...channels} legendValues title="
|
|
262
|
+
<Chart {...channels} legendValues title="Acquisition channels" />;
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
### Three ways to read a point
|
|
@@ -336,7 +336,7 @@ Excerpt — not a complete module
|
|
|
336
336
|
|
|
337
337
|
### More series than slots
|
|
338
338
|
|
|
339
|
-
Eleven channels over eight
|
|
339
|
+
Eleven channels over eight color slots: the first eight take the palette, the rest take the overflow neutral, and the legend says which is which.
|
|
340
340
|
|
|
341
341
|
Excerpt — not a complete module
|
|
342
342
|
|
|
@@ -356,7 +356,7 @@ Excerpt — not a complete module
|
|
|
356
356
|
|
|
357
357
|
### Missing values stay missing
|
|
358
358
|
|
|
359
|
-
A null breaks the line on the left; connectNulls bridges it on the right, for a series where the gap is a sampling
|
|
359
|
+
A null breaks the line on the left; connectNulls bridges it on the right, for a series where the gap is a sampling artifact rather than a fact.
|
|
360
360
|
|
|
361
361
|
Excerpt — not a complete module
|
|
362
362
|
|
|
@@ -377,8 +377,8 @@ Excerpt — not a complete module
|
|
|
377
377
|
|
|
378
378
|
```tsx
|
|
379
379
|
const series: ChartSeries[] = [
|
|
380
|
-
{ kind: 'bar', field: 'operating', label: '
|
|
381
|
-
{ kind: 'bar', field: 'fx', label: '
|
|
380
|
+
{ kind: 'bar', field: 'operating', label: 'Operational', stack: 'r' },
|
|
381
|
+
{ kind: 'bar', field: 'fx', label: 'Exchange', stack: 'r', tone: 'warning' },
|
|
382
382
|
];
|
|
383
383
|
```
|
|
384
384
|
|
|
@@ -394,7 +394,7 @@ Excerpt — not a complete module
|
|
|
394
394
|
|
|
395
395
|
### Texture as a second channel
|
|
396
396
|
|
|
397
|
-
texture adds a pattern per slot, so a series is told apart in print, in
|
|
397
|
+
texture adds a pattern per slot, so a series is told apart in print, in grayscale or by a reader who does not see the difference between two hues.
|
|
398
398
|
|
|
399
399
|
Excerpt — not a complete module
|
|
400
400
|
|
|
@@ -450,7 +450,7 @@ Excerpt — not a complete module
|
|
|
450
450
|
|
|
451
451
|
```tsx
|
|
452
452
|
<Grid columns={4} gap={4}>
|
|
453
|
-
<Chart {...revenue} description="
|
|
453
|
+
<Chart {...revenue} description="Last 12 months" size="sm" variant="card" />
|
|
454
454
|
<Chart {...orders} loading size="sm" variant="card" />
|
|
455
455
|
</Grid>;
|
|
456
456
|
```
|
|
@@ -468,11 +468,11 @@ Excerpt — not a complete module
|
|
|
468
468
|
<Section>
|
|
469
469
|
<SectionHeader>
|
|
470
470
|
<SectionTitle>
|
|
471
|
-
<SectionHeading>
|
|
471
|
+
<SectionHeading>Revenue</SectionHeading>
|
|
472
472
|
</SectionTitle>
|
|
473
473
|
</SectionHeader>
|
|
474
474
|
<SectionBody>
|
|
475
|
-
<Chart aria-label="
|
|
475
|
+
<Chart aria-label="Revenue, last 12 months" data={data} series={series} />
|
|
476
476
|
</SectionBody>
|
|
477
477
|
</Section>;
|
|
478
478
|
```
|
|
@@ -501,9 +501,9 @@ const [full, setFull] = useState(false);
|
|
|
501
501
|
<Chart {...revenue} fullscreen={full} onFullscreenChange={setFull} />;
|
|
502
502
|
```
|
|
503
503
|
|
|
504
|
-
###
|
|
504
|
+
### Color from the design system
|
|
505
505
|
|
|
506
|
-
categorical tells series apart, sequential orders them by one hue for ranked data, focus draws the first series in
|
|
506
|
+
categorical tells series apart, sequential orders them by one hue for ranked data, focus draws the first series in color and the rest in neutral. slot and tone pin a series to a color.
|
|
507
507
|
|
|
508
508
|
Excerpt — not a complete module
|
|
509
509
|
|
|
@@ -523,7 +523,7 @@ help puts an information control beside the title; its note opens on click or En
|
|
|
523
523
|
Excerpt — not a complete module
|
|
524
524
|
|
|
525
525
|
```tsx
|
|
526
|
-
<Chart {...revenue} help="
|
|
526
|
+
<Chart {...revenue} help="Revenue recognized in the month, excluding taxes. Updated at 6 AM." />;
|
|
527
527
|
```
|
|
528
528
|
|
|
529
529
|
### The same data as a table
|
package/dist/docs/chart.json
CHANGED
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
"part": "legend-marker",
|
|
321
321
|
"element": "span",
|
|
322
322
|
"required": false,
|
|
323
|
-
"purpose": "The series’ mark in its
|
|
323
|
+
"purpose": "The series’ mark in its color and shape: a line, a bar or a dot, dashed when the series is."
|
|
324
324
|
},
|
|
325
325
|
{
|
|
326
326
|
"part": "legend-label",
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
"type": "readonly ChartSeries[]",
|
|
481
481
|
"defaultValue": "—",
|
|
482
482
|
"appliesTo": "Chart",
|
|
483
|
-
"description": "What is drawn: kind, field, label, and how. Order is legend order and
|
|
483
|
+
"description": "What is drawn: kind, field, label, and how. Order is legend order and color order"
|
|
484
484
|
},
|
|
485
485
|
{
|
|
486
486
|
"name": "x",
|
|
@@ -648,7 +648,7 @@
|
|
|
648
648
|
"type": "boolean",
|
|
649
649
|
"defaultValue": "false",
|
|
650
650
|
"appliesTo": "Chart",
|
|
651
|
-
"description": "A pattern per slot, as a second channel beside
|
|
651
|
+
"description": "A pattern per slot, as a second channel beside color"
|
|
652
652
|
},
|
|
653
653
|
{
|
|
654
654
|
"name": "renderer",
|
|
@@ -961,8 +961,8 @@
|
|
|
961
961
|
"Inside the plot the keyboard follows an adaptation of the APG Grid pattern: Left and Right move along the categories, Up and Down between series, Home and End to the ends, Page keys by a tenth; Enter selects, + − and 0 zoom, Escape clears. The tooltip is aria-hidden, and a polite live region says the point reached — only the last one, so holding an arrow does not queue twelve sentences.",
|
|
962
962
|
"The legend is a toolbar of toggle buttons with a roving tab stop: aria-pressed says whether a series is drawn, Enter hides it, Shift+Enter shows it alone, and the live region confirms the change.",
|
|
963
963
|
"Every chart has a table view with the same numbers in their formats, reachable from the toolbar or the menu; it is the complete reading for anyone the drawing does not serve.",
|
|
964
|
-
"
|
|
965
|
-
"The eight slots of the data scale keep adjacent
|
|
964
|
+
"Color is never the only channel: series differ in stroke and marker shape, texture adds a pattern per slot, and under forced colors the drawing is redrawn in system colors with the legend markers kept by mask.",
|
|
965
|
+
"The eight slots of the data scale keep adjacent colors apart under simulated protanopia and deuteranopia in every scheme, and each clears 3:1 against the surface."
|
|
966
966
|
]
|
|
967
967
|
}
|
|
968
968
|
},
|
|
@@ -1089,9 +1089,9 @@
|
|
|
1089
1089
|
{
|
|
1090
1090
|
"id": "line",
|
|
1091
1091
|
"title": "Lines for a trend",
|
|
1092
|
-
"note": "Revenue and cost with a marker on the last point, and the target dashed in the neutral tone so it reads as a reference before its
|
|
1092
|
+
"note": "Revenue and cost with a marker on the last point, and the target dashed in the neutral tone so it reads as a reference before its color does.",
|
|
1093
1093
|
"language": "tsx",
|
|
1094
|
-
"source": "<Chart\n data={monthly}\n series={[\n { kind: 'line', field: 'revenue', label: '
|
|
1094
|
+
"source": "<Chart\n data={monthly}\n series={[\n { kind: 'line', field: 'revenue', label: 'Revenue', markers: 'last' },\n { kind: 'line', field: 'cost', label: 'Cost', markers: 'last' },\n { kind: 'line', field: 'target', label: 'Target', tone: 'neutral', stroke: 'dashed' },\n ]}\n title=\"Revenue and cost\"\n x={{ field: 'month', label: 'Month' }}\n y={{ format: brlThousands }}\n/>;\n",
|
|
1095
1095
|
"verdict": "excerpt"
|
|
1096
1096
|
},
|
|
1097
1097
|
{
|
|
@@ -1099,7 +1099,7 @@
|
|
|
1099
1099
|
"title": "Areas, stacked and smoothed",
|
|
1100
1100
|
"note": "Three channels stacked with a monotone curve: the wash sits under each line and the tooltip adds the stack’s total.",
|
|
1101
1101
|
"language": "tsx",
|
|
1102
|
-
"source": "<Chart\n data={sessions}\n series={channels.map((channel) => ({\n ...channel,\n kind: 'area',\n stack: '
|
|
1102
|
+
"source": "<Chart\n data={sessions}\n series={channels.map((channel) => ({\n ...channel,\n kind: 'area',\n stack: 'channel',\n curve: 'monotone',\n }))}\n title=\"Sessions by channel\"\n x={{ field: 'month' }}\n/>;\n",
|
|
1103
1103
|
"verdict": "excerpt"
|
|
1104
1104
|
},
|
|
1105
1105
|
{
|
|
@@ -1107,7 +1107,7 @@
|
|
|
1107
1107
|
"title": "Grouped bars",
|
|
1108
1108
|
"note": "Three channels side by side in each month; the band under the pointer lights the whole category, not one bar.",
|
|
1109
1109
|
"language": "tsx",
|
|
1110
|
-
"source": "<Chart data={orders} series={channels} title=\"
|
|
1110
|
+
"source": "<Chart data={orders} series={channels} title=\"Orders by channel\" x={{ field: 'month' }} />;\n",
|
|
1111
1111
|
"verdict": "excerpt"
|
|
1112
1112
|
},
|
|
1113
1113
|
{
|
|
@@ -1115,7 +1115,7 @@
|
|
|
1115
1115
|
"title": "A ranking reads across",
|
|
1116
1116
|
"note": "Horizontal bars with value labels: long category names get the room a vertical axis cannot give them.",
|
|
1117
1117
|
"language": "tsx",
|
|
1118
|
-
"source": "<Chart\n data={regions}\n orientation=\"horizontal\"\n series={[{ kind: 'bar', field: 'value', label: '
|
|
1118
|
+
"source": "<Chart\n data={regions}\n orientation=\"horizontal\"\n series={[{ kind: 'bar', field: 'value', label: 'Revenue', labels: true }]}\n title=\"Revenue by region\"\n x={{ field: 'region' }}\n/>;\n",
|
|
1119
1119
|
"verdict": "excerpt"
|
|
1120
1120
|
},
|
|
1121
1121
|
{
|
|
@@ -1131,7 +1131,7 @@
|
|
|
1131
1131
|
"title": "Shares of a whole",
|
|
1132
1132
|
"note": "stackMode=\"percent\" draws each month as 100 %, so a channel growing in share reads even when the total falls.",
|
|
1133
1133
|
"language": "tsx",
|
|
1134
|
-
"source": "<Chart\n data={orders}\n series={channels.map((channel) => ({ ...channel, kind: 'area', stack: 'total' }))}\n stackMode=\"percent\"\n title=\"
|
|
1134
|
+
"source": "<Chart\n data={orders}\n series={channels.map((channel) => ({ ...channel, kind: 'area', stack: 'total' }))}\n stackMode=\"percent\"\n title=\"Share by channel\"\n x={{ field: 'month' }}\n/>;\n",
|
|
1135
1135
|
"verdict": "excerpt"
|
|
1136
1136
|
},
|
|
1137
1137
|
{
|
|
@@ -1147,7 +1147,7 @@
|
|
|
1147
1147
|
"title": "Two units, two axes",
|
|
1148
1148
|
"note": "Orders on the start axis and margin in percent on the end one; each axis is named at its own top, so neither needs the legend to be read.",
|
|
1149
1149
|
"language": "tsx",
|
|
1150
|
-
"source": "<Chart\n data={monthly}\n series={[\n { kind: 'bar', field: 'orders', label: '
|
|
1150
|
+
"source": "<Chart\n data={monthly}\n series={[\n { kind: 'bar', field: 'orders', label: 'Orders' },\n { kind: 'line', field: 'margin', label: 'Margin', axis: 'end', markers: 'all' },\n ]}\n title=\"Orders and margin\"\n x={{ field: 'month' }}\n y={[{ label: 'Orders' }, { label: 'Margin', format: { style: 'percent' } }]}\n/>;\n",
|
|
1151
1151
|
"verdict": "excerpt"
|
|
1152
1152
|
},
|
|
1153
1153
|
{
|
|
@@ -1155,7 +1155,7 @@
|
|
|
1155
1155
|
"title": "Dates on a time axis",
|
|
1156
1156
|
"note": "Forty days of sessions: ticks fall on real dates, gaps in the calendar stay gaps, and the dates are wall-clock days, not shifted by the reader’s time zone.",
|
|
1157
1157
|
"language": "tsx",
|
|
1158
|
-
"source": "<Chart\n data={daily}\n series={[{ kind: 'area', field: 'sessions', label: '
|
|
1158
|
+
"source": "<Chart\n data={daily}\n series={[{ kind: 'area', field: 'sessions', label: 'Sessions' }]}\n title=\"Daily sessions\"\n x={{ field: 'day', type: 'time' }}\n/>;\n",
|
|
1159
1159
|
"verdict": "excerpt"
|
|
1160
1160
|
},
|
|
1161
1161
|
{
|
|
@@ -1171,13 +1171,13 @@
|
|
|
1171
1171
|
"title": "Parts of a whole",
|
|
1172
1172
|
"note": "Revenue by region with labels outside the slices; the tooltip adds each slice’s share of the total.",
|
|
1173
1173
|
"language": "tsx",
|
|
1174
|
-
"source": "<Chart\n data={regions}\n series={[{ kind: 'pie', field: 'value', label: '
|
|
1174
|
+
"source": "<Chart\n data={regions}\n series={[{ kind: 'pie', field: 'value', label: 'Revenue', labels: true }]}\n title=\"Revenue by region\"\n x={{ field: 'region' }}\n/>;\n",
|
|
1175
1175
|
"verdict": "excerpt"
|
|
1176
1176
|
},
|
|
1177
1177
|
{
|
|
1178
1178
|
"id": "donut",
|
|
1179
1179
|
"title": "A donut with the total inside",
|
|
1180
|
-
"note": "innerRadius opens the middle, and the center holds the total; legendValues puts each slice’s value beside its name. slotField and toneField give each slice the slot or tone its record names, so a category keeps the
|
|
1180
|
+
"note": "innerRadius opens the middle, and the center holds the total; legendValues puts each slice’s value beside its name. slotField and toneField give each slice the slot or tone its record names, so a category keeps the color it has everywhere else; a slice that names none takes the next free slot.",
|
|
1181
1181
|
"language": "tsx",
|
|
1182
1182
|
"source": "<Chart\n data={tickets}\n legendValues\n series={[{ kind: 'pie', field: 'n', label: 'Tickets', innerRadius: 0.64 }]}\n title=\"Tickets por estado\"\n x={{ field: 'status' }}\n/>;\n",
|
|
1183
1183
|
"verdict": "excerpt"
|
|
@@ -1187,7 +1187,7 @@
|
|
|
1187
1187
|
"title": "Two measures of each record",
|
|
1188
1188
|
"note": "Sixty tickets by effort and impact in two groups; the tooltip follows the point, not the axis, because a value axis has no categories to gather.",
|
|
1189
1189
|
"language": "tsx",
|
|
1190
|
-
"source": "<Chart\n data={tickets}\n recordKey=\"id\"\n series={[\n { kind: 'scatter', field: 'product', label: '
|
|
1190
|
+
"source": "<Chart\n data={tickets}\n recordKey=\"id\"\n series={[\n { kind: 'scatter', field: 'product', label: 'Product' },\n { kind: 'scatter', field: 'infra', label: 'Infrastructure' },\n ]}\n title=\"Effort and impact\"\n x={{ field: 'effort', type: 'value', label: 'Effort (h)' }}\n/>;\n",
|
|
1191
1191
|
"verdict": "excerpt"
|
|
1192
1192
|
},
|
|
1193
1193
|
{
|
|
@@ -1203,7 +1203,7 @@
|
|
|
1203
1203
|
"title": "Targets, ranges and events",
|
|
1204
1204
|
"note": "A band for the tolerance range, a line for the annual target and a vertical line on the month the campaign started — each labelled on the plot.",
|
|
1205
1205
|
"language": "tsx",
|
|
1206
|
-
"source": "const annotations: ChartAnnotation[] = [\n { kind: 'band', from: 55, to: 70, label: '
|
|
1206
|
+
"source": "const annotations: ChartAnnotation[] = [\n { kind: 'band', from: 55, to: 70, label: 'Tolerance', tone: 'success' },\n { kind: 'line', value: 80, label: 'Annual target', tone: 'danger' },\n { kind: 'line', axis: 'x', value: 'jun', label: 'Campaign' },\n];\n",
|
|
1207
1207
|
"verdict": "excerpt"
|
|
1208
1208
|
},
|
|
1209
1209
|
{
|
|
@@ -1211,7 +1211,7 @@
|
|
|
1211
1211
|
"title": "A legend that toggles",
|
|
1212
1212
|
"note": "Click a series to hide it, Shift+click to show it alone; arrows move along the legend. The legend holds one line: narrower than its items, the ones that do not fit wait behind +N.",
|
|
1213
1213
|
"language": "tsx",
|
|
1214
|
-
"source": "const [hidden, setHidden] = useState<readonly string[]>([]);\n\n<Chart {...channels} hidden={hidden} onHiddenChange={setHidden} title=\"
|
|
1214
|
+
"source": "const [hidden, setHidden] = useState<readonly string[]>([]);\n\n<Chart {...channels} hidden={hidden} onHiddenChange={setHidden} title=\"Acquisition channels\" />;\n",
|
|
1215
1215
|
"verdict": "excerpt"
|
|
1216
1216
|
},
|
|
1217
1217
|
{
|
|
@@ -1219,7 +1219,7 @@
|
|
|
1219
1219
|
"title": "Values in the legend",
|
|
1220
1220
|
"note": "Each legend item carries its series’ value at the active point, and the last value when nothing is active — a readout that never covers the drawing.",
|
|
1221
1221
|
"language": "tsx",
|
|
1222
|
-
"source": "<Chart {...channels} legendValues title=\"
|
|
1222
|
+
"source": "<Chart {...channels} legendValues title=\"Acquisition channels\" />;\n",
|
|
1223
1223
|
"verdict": "excerpt"
|
|
1224
1224
|
},
|
|
1225
1225
|
{
|
|
@@ -1273,7 +1273,7 @@
|
|
|
1273
1273
|
{
|
|
1274
1274
|
"id": "many-series",
|
|
1275
1275
|
"title": "More series than slots",
|
|
1276
|
-
"note": "Eleven channels over eight
|
|
1276
|
+
"note": "Eleven channels over eight color slots: the first eight take the palette, the rest take the overflow neutral, and the legend says which is which.",
|
|
1277
1277
|
"language": "tsx",
|
|
1278
1278
|
"source": "<Chart {...elevenChannels} title=\"Onze canais\" />;\n",
|
|
1279
1279
|
"verdict": "excerpt"
|
|
@@ -1289,7 +1289,7 @@
|
|
|
1289
1289
|
{
|
|
1290
1290
|
"id": "gaps",
|
|
1291
1291
|
"title": "Missing values stay missing",
|
|
1292
|
-
"note": "A null breaks the line on the left; connectNulls bridges it on the right, for a series where the gap is a sampling
|
|
1292
|
+
"note": "A null breaks the line on the left; connectNulls bridges it on the right, for a series where the gap is a sampling artifact rather than a fact.",
|
|
1293
1293
|
"language": "tsx",
|
|
1294
1294
|
"source": "const revenue: ChartSeries = {\n kind: 'line',\n field: 'revenue',\n label: 'Receita',\n connectNulls: true,\n};\n",
|
|
1295
1295
|
"verdict": "excerpt"
|
|
@@ -1299,7 +1299,7 @@
|
|
|
1299
1299
|
"title": "Values below zero",
|
|
1300
1300
|
"note": "Monthly result with its exchange component: a stack splits by sign, so losses hang from the baseline and gains grow from it.",
|
|
1301
1301
|
"language": "tsx",
|
|
1302
|
-
"source": "const series: ChartSeries[] = [\n { kind: 'bar', field: 'operating', label: '
|
|
1302
|
+
"source": "const series: ChartSeries[] = [\n { kind: 'bar', field: 'operating', label: 'Operational', stack: 'r' },\n { kind: 'bar', field: 'fx', label: 'Exchange', stack: 'r', tone: 'warning' },\n];\n",
|
|
1303
1303
|
"verdict": "excerpt"
|
|
1304
1304
|
},
|
|
1305
1305
|
{
|
|
@@ -1313,7 +1313,7 @@
|
|
|
1313
1313
|
{
|
|
1314
1314
|
"id": "texture",
|
|
1315
1315
|
"title": "Texture as a second channel",
|
|
1316
|
-
"note": "texture adds a pattern per slot, so a series is told apart in print, in
|
|
1316
|
+
"note": "texture adds a pattern per slot, so a series is told apart in print, in grayscale or by a reader who does not see the difference between two hues.",
|
|
1317
1317
|
"language": "tsx",
|
|
1318
1318
|
"source": "<Chart {...orders} texture />;\n",
|
|
1319
1319
|
"verdict": "excerpt"
|
|
@@ -1355,7 +1355,7 @@
|
|
|
1355
1355
|
"title": "A row of tiles",
|
|
1356
1356
|
"note": "Four cards in one row: with and without a description, loading, a donut, eight series. Every tile is one height and every plot starts on one line.",
|
|
1357
1357
|
"language": "tsx",
|
|
1358
|
-
"source": "<Grid columns={4} gap={4}>\n <Chart {...revenue} description=\"
|
|
1358
|
+
"source": "<Grid columns={4} gap={4}>\n <Chart {...revenue} description=\"Last 12 months\" size=\"sm\" variant=\"card\" />\n <Chart {...orders} loading size=\"sm\" variant=\"card\" />\n</Grid>;\n",
|
|
1359
1359
|
"verdict": "excerpt"
|
|
1360
1360
|
},
|
|
1361
1361
|
{
|
|
@@ -1363,7 +1363,7 @@
|
|
|
1363
1363
|
"title": "On the page, or as a card",
|
|
1364
1364
|
"note": "plain sits on the page’s own surface for a report; card draws its own surface, border and padding, and fills the grid cell it is given. Inside a section whose heading already names the chart, leave title out and pass aria-label: it names the plot.",
|
|
1365
1365
|
"language": "tsx",
|
|
1366
|
-
"source": "<Chart {...revenue} variant=\"plain\" />;\n<Chart {...revenue} variant=\"card\" />;\n\n<Section>\n <SectionHeader>\n <SectionTitle>\n <SectionHeading>
|
|
1366
|
+
"source": "<Chart {...revenue} variant=\"plain\" />;\n<Chart {...revenue} variant=\"card\" />;\n\n<Section>\n <SectionHeader>\n <SectionTitle>\n <SectionHeading>Revenue</SectionHeading>\n </SectionTitle>\n </SectionHeader>\n <SectionBody>\n <Chart aria-label=\"Revenue, last 12 months\" data={data} series={series} />\n </SectionBody>\n</Section>;\n",
|
|
1367
1367
|
"verdict": "excerpt"
|
|
1368
1368
|
},
|
|
1369
1369
|
{
|
|
@@ -1384,8 +1384,8 @@
|
|
|
1384
1384
|
},
|
|
1385
1385
|
{
|
|
1386
1386
|
"id": "palette",
|
|
1387
|
-
"title": "
|
|
1388
|
-
"note": "categorical tells series apart, sequential orders them by one hue for ranked data, focus draws the first series in
|
|
1387
|
+
"title": "Color from the design system",
|
|
1388
|
+
"note": "categorical tells series apart, sequential orders them by one hue for ranked data, focus draws the first series in color and the rest in neutral. slot and tone pin a series to a color.",
|
|
1389
1389
|
"language": "tsx",
|
|
1390
1390
|
"source": "<Chart {...channels} palette=\"categorical\" />;\n<Chart {...ranked} palette=\"sequential\" />;\n<Chart {...channels} palette=\"focus\" />;\n\nconst cost: ChartSeries = { kind: 'line', field: 'cost', label: 'Custo', slot: 5 };\nconst target: ChartSeries = { kind: 'line', field: 'target', label: 'Meta', tone: 'neutral' };\n",
|
|
1391
1391
|
"verdict": "excerpt"
|
|
@@ -1395,7 +1395,7 @@
|
|
|
1395
1395
|
"title": "A note behind the title",
|
|
1396
1396
|
"note": "help puts an information control beside the title; its note opens on click or Enter, anchored to it, and closes on Escape or outside.",
|
|
1397
1397
|
"language": "tsx",
|
|
1398
|
-
"source": "<Chart {...revenue} help=\"
|
|
1398
|
+
"source": "<Chart {...revenue} help=\"Revenue recognized in the month, excluding taxes. Updated at 6 AM.\" />;\n",
|
|
1399
1399
|
"verdict": "excerpt"
|
|
1400
1400
|
},
|
|
1401
1401
|
{
|
package/dist/docs/chart.md
CHANGED
|
@@ -73,7 +73,7 @@ Excerpt — not a complete module
|
|
|
73
73
|
| Name | Type | Default | Applies to | Description |
|
|
74
74
|
| --- | --- | --- | --- | --- |
|
|
75
75
|
| `data` | `readonly ChartRecord[]` | — | Chart | One record per category or per point. Fields are named by x and by each series |
|
|
76
|
-
| `series` | `readonly ChartSeries[]` | — | Chart | What is drawn: kind, field, label, and how. Order is legend order and
|
|
76
|
+
| `series` | `readonly ChartSeries[]` | — | Chart | What is drawn: kind, field, label, and how. Order is legend order and color order |
|
|
77
77
|
| `x` | `ChartXAxis` | — | Chart | The category field, and its type (category, time, value), label, format and extent |
|
|
78
78
|
| `y` | `ChartYAxis \| [ChartYAxis, ChartYAxis]` | — | Chart | The value axis, or the start and end axes: label, format, scale, extent |
|
|
79
79
|
| `min` | `number` | — | x, y | The lowest value the axis must hold. The data widens the extent, never narrows it |
|
|
@@ -97,7 +97,7 @@ Excerpt — not a complete module
|
|
|
97
97
|
| `palette` | `'categorical' \| 'sequential' \| 'focus'` | categorical | Chart | Which ramp the eight slots take |
|
|
98
98
|
| `toolbar` | `'visible' \| 'hover' \| 'none'` | visible | Chart | When the toolbar shows: always, on hover or focus within, or never |
|
|
99
99
|
| `grid` | `'horizontal' \| 'vertical' \| 'both' \| 'none'` | horizontal | Chart | Which grid lines are drawn |
|
|
100
|
-
| `texture` | `boolean` | false | Chart | A pattern per slot, as a second channel beside
|
|
100
|
+
| `texture` | `boolean` | false | Chart | A pattern per slot, as a second channel beside color |
|
|
101
101
|
| `renderer` | `'auto' \| 'svg' \| 'canvas'` | auto | Chart | SVG, or canvas past a few thousand points |
|
|
102
102
|
| `sampling` | `'auto' \| 'none'` | auto | Chart | Downsamples a long line for the screen; the table keeps every value |
|
|
103
103
|
| `animate` | `boolean` | true | Chart | Transitions; off under reduced motion regardless |
|
|
@@ -180,8 +180,8 @@ Excerpt — not a complete module
|
|
|
180
180
|
- Inside the plot the keyboard follows an adaptation of the APG Grid pattern: Left and Right move along the categories, Up and Down between series, Home and End to the ends, Page keys by a tenth; Enter selects, + − and 0 zoom, Escape clears. The tooltip is aria-hidden, and a polite live region says the point reached — only the last one, so holding an arrow does not queue twelve sentences.
|
|
181
181
|
- The legend is a toolbar of toggle buttons with a roving tab stop: aria-pressed says whether a series is drawn, Enter hides it, Shift+Enter shows it alone, and the live region confirms the change.
|
|
182
182
|
- Every chart has a table view with the same numbers in their formats, reachable from the toolbar or the menu; it is the complete reading for anyone the drawing does not serve.
|
|
183
|
-
-
|
|
184
|
-
- The eight slots of the data scale keep adjacent
|
|
183
|
+
- Color is never the only channel: series differ in stroke and marker shape, texture adds a pattern per slot, and under forced colors the drawing is redrawn in system colors with the legend markers kept by mask.
|
|
184
|
+
- The eight slots of the data scale keep adjacent colors apart under simulated protanopia and deuteranopia in every scheme, and each clears 3:1 against the surface.
|
|
185
185
|
|
|
186
186
|
## Tokens
|
|
187
187
|
|