@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
- package/dist/app-shell.js +1 -1
- package/dist/attachment-TZykYNu5.js +300 -0
- package/dist/attachment.js +2 -2
- package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
- package/dist/avatar-group.js +1 -1
- package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
- package/dist/command-palette.js +1 -1
- package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
- package/dist/data-list.js +1 -1
- package/dist/detail-panel-Cke3ZFU3.js +342 -0
- package/dist/detail-panel.js +2 -2
- package/dist/docs/action-bar.examples.md +768 -0
- package/dist/docs/action-bar.json +74 -50
- package/dist/docs/action-bar.md +49 -311
- package/dist/docs/app-shell.examples.md +1221 -64
- package/dist/docs/app-shell.json +92 -60
- package/dist/docs/app-shell.md +92 -57
- package/dist/docs/attachment.examples.md +689 -0
- package/dist/docs/attachment.json +69 -37
- package/dist/docs/attachment.md +44 -203
- package/dist/docs/avatar-group.json +111 -23
- package/dist/docs/avatar-group.md +487 -28
- package/dist/docs/button-group.json +98 -2
- package/dist/docs/button-group.md +411 -8
- package/dist/docs/calendar.examples.md +512 -0
- package/dist/docs/calendar.json +72 -24
- package/dist/docs/calendar.md +18 -147
- package/dist/docs/carousel.examples.md +868 -0
- package/dist/docs/carousel.json +58 -50
- package/dist/docs/carousel.md +66 -300
- package/dist/docs/cascader.examples.md +1269 -0
- package/dist/docs/cascader.json +72 -16
- package/dist/docs/cascader.md +78 -154
- package/dist/docs/chart.examples.md +734 -24
- package/dist/docs/chart.json +93 -13
- package/dist/docs/chart.md +28 -7
- package/dist/docs/clock.json +71 -15
- package/dist/docs/clock.md +326 -21
- package/dist/docs/code-block.json +79 -55
- package/dist/docs/code-block.md +417 -74
- package/dist/docs/color-picker.json +60 -12
- package/dist/docs/color-picker.md +245 -22
- package/dist/docs/column-manager.examples.md +764 -0
- package/dist/docs/column-manager.json +68 -12
- package/dist/docs/column-manager.md +44 -203
- package/dist/docs/command-palette.examples.md +747 -0
- package/dist/docs/command-palette.json +48 -24
- package/dist/docs/command-palette.md +60 -339
- package/dist/docs/currency-field.examples.md +355 -73
- package/dist/docs/currency-field.json +96 -64
- package/dist/docs/currency-field.md +57 -50
- package/dist/docs/dashboard-grid.examples.md +629 -0
- package/dist/docs/dashboard-grid.json +64 -16
- package/dist/docs/dashboard-grid.md +34 -152
- package/dist/docs/data-list.examples.md +1556 -0
- package/dist/docs/data-list.json +58 -18
- package/dist/docs/data-list.md +139 -224
- package/dist/docs/date-field.examples.md +543 -0
- package/dist/docs/date-field.json +64 -24
- package/dist/docs/date-field.md +22 -168
- package/dist/docs/datetime-field.examples.md +699 -0
- package/dist/docs/datetime-field.json +79 -31
- package/dist/docs/datetime-field.md +24 -269
- package/dist/docs/datetime-range-picker.examples.md +682 -0
- package/dist/docs/datetime-range-picker.json +117 -61
- package/dist/docs/datetime-range-picker.md +59 -224
- package/dist/docs/description-list.examples.md +652 -0
- package/dist/docs/description-list.json +49 -25
- package/dist/docs/description-list.md +33 -188
- package/dist/docs/detail-panel.examples.md +1177 -0
- package/dist/docs/detail-panel.json +69 -53
- package/dist/docs/detail-panel.md +114 -324
- package/dist/docs/entity-picker.examples.md +1037 -0
- package/dist/docs/entity-picker.json +66 -18
- package/dist/docs/entity-picker.md +56 -246
- package/dist/docs/event-calendar.examples.md +749 -49
- package/dist/docs/event-calendar.json +46 -22
- package/dist/docs/event-calendar.md +81 -11
- package/dist/docs/field-group.examples.md +554 -0
- package/dist/docs/field-group.json +98 -34
- package/dist/docs/field-group.md +55 -133
- package/dist/docs/filter-bar.examples.md +772 -0
- package/dist/docs/filter-bar.json +41 -25
- package/dist/docs/filter-bar.md +42 -246
- package/dist/docs/form.examples.md +579 -0
- package/dist/docs/form.json +87 -39
- package/dist/docs/form.md +53 -177
- package/dist/docs/fullscreen.examples.md +558 -0
- package/dist/docs/fullscreen.json +58 -18
- package/dist/docs/fullscreen.md +50 -169
- package/dist/docs/highlight.json +57 -25
- package/dist/docs/highlight.md +402 -50
- package/dist/docs/icon.json +85 -5
- package/dist/docs/icon.md +401 -10
- package/dist/docs/image.examples.md +670 -0
- package/dist/docs/image.json +44 -28
- package/dist/docs/image.md +24 -176
- package/dist/docs/import-export-center.examples.md +1280 -0
- package/dist/docs/import-export-center.json +67 -27
- package/dist/docs/import-export-center.md +121 -226
- package/dist/docs/list-item.examples.md +769 -0
- package/dist/docs/list-item.json +110 -38
- package/dist/docs/list-item.md +84 -201
- package/dist/docs/listbox.examples.md +858 -0
- package/dist/docs/listbox.json +76 -28
- package/dist/docs/listbox.md +41 -263
- package/dist/docs/markdown.json +79 -55
- package/dist/docs/markdown.md +581 -85
- package/dist/docs/media-viewer.examples.md +1038 -0
- package/dist/docs/media-viewer.json +70 -15
- package/dist/docs/media-viewer.md +84 -135
- package/dist/docs/message-scroller.examples.md +1193 -0
- package/dist/docs/message-scroller.json +41 -17
- package/dist/docs/message-scroller.md +80 -134
- package/dist/docs/message.examples.md +944 -0
- package/dist/docs/message.json +64 -16
- package/dist/docs/message.md +34 -326
- package/dist/docs/meter.json +58 -26
- package/dist/docs/meter.md +312 -32
- package/dist/docs/navigation-menu.examples.md +1107 -0
- package/dist/docs/navigation-menu.json +57 -41
- package/dist/docs/navigation-menu.md +105 -298
- package/dist/docs/notification-center.examples.md +1045 -0
- package/dist/docs/notification-center.json +71 -15
- package/dist/docs/notification-center.md +76 -266
- package/dist/docs/otp-input.examples.md +490 -0
- package/dist/docs/otp-input.json +65 -25
- package/dist/docs/otp-input.md +20 -191
- package/dist/docs/page-header.examples.md +1041 -0
- package/dist/docs/page-header.json +75 -43
- package/dist/docs/page-header.md +79 -291
- package/dist/docs/page.examples.md +633 -0
- package/dist/docs/page.json +48 -16
- package/dist/docs/page.md +62 -129
- package/dist/docs/prompt-composer.examples.md +630 -0
- package/dist/docs/prompt-composer.json +66 -18
- package/dist/docs/prompt-composer.md +35 -161
- package/dist/docs/prose.json +69 -37
- package/dist/docs/prose.md +393 -75
- package/dist/docs/rating.examples.md +525 -0
- package/dist/docs/rating.json +92 -28
- package/dist/docs/rating.md +27 -241
- package/dist/docs/saved-views.examples.md +1108 -0
- package/dist/docs/saved-views.json +53 -21
- package/dist/docs/saved-views.md +86 -171
- package/dist/docs/scroll-area.examples.md +837 -0
- package/dist/docs/scroll-area.json +64 -24
- package/dist/docs/scroll-area.md +57 -140
- package/dist/docs/section.examples.md +676 -0
- package/dist/docs/section.json +68 -20
- package/dist/docs/section.md +39 -162
- package/dist/docs/segmented-control.examples.md +480 -0
- package/dist/docs/segmented-control.json +76 -28
- package/dist/docs/segmented-control.md +20 -191
- package/dist/docs/side-navigation.examples.md +1468 -0
- package/dist/docs/side-navigation.json +53 -53
- package/dist/docs/side-navigation.md +79 -354
- package/dist/docs/slider.examples.md +505 -0
- package/dist/docs/slider.json +91 -51
- package/dist/docs/slider.md +47 -212
- package/dist/docs/sparkline.json +60 -36
- package/dist/docs/sparkline.md +447 -71
- package/dist/docs/split-button.examples.md +509 -0
- package/dist/docs/split-button.json +73 -41
- package/dist/docs/split-button.md +64 -194
- package/dist/docs/splitter.examples.md +921 -0
- package/dist/docs/splitter.json +94 -46
- package/dist/docs/splitter.md +75 -182
- package/dist/docs/stat-card.examples.md +725 -0
- package/dist/docs/stat-card.json +89 -41
- package/dist/docs/stat-card.md +55 -227
- package/dist/docs/status-indicator.json +80 -32
- package/dist/docs/status-indicator.md +409 -65
- package/dist/docs/stepper.json +53 -21
- package/dist/docs/stepper.md +369 -48
- package/dist/docs/table-of-contents.examples.md +550 -0
- package/dist/docs/table-of-contents.json +60 -28
- package/dist/docs/table-of-contents.md +70 -205
- package/dist/docs/tags-input.examples.md +541 -0
- package/dist/docs/tags-input.json +64 -16
- package/dist/docs/tags-input.md +15 -262
- package/dist/docs/time-field.examples.md +587 -0
- package/dist/docs/time-field.json +69 -29
- package/dist/docs/time-field.md +21 -223
- package/dist/docs/time-picker.json +117 -53
- package/dist/docs/time-picker.md +499 -54
- package/dist/docs/time-range-picker.examples.md +750 -0
- package/dist/docs/time-range-picker.json +139 -75
- package/dist/docs/time-range-picker.md +63 -225
- package/dist/docs/timeline.examples.md +617 -0
- package/dist/docs/timeline.json +44 -28
- package/dist/docs/timeline.md +34 -208
- package/dist/docs/toolbar.json +56 -16
- package/dist/docs/toolbar.md +357 -63
- package/dist/docs/top-navigation.examples.md +1206 -140
- package/dist/docs/top-navigation.json +49 -33
- package/dist/docs/top-navigation.md +87 -36
- package/dist/docs/tour.examples.md +960 -0
- package/dist/docs/tour.json +57 -25
- package/dist/docs/tour.md +60 -244
- package/dist/docs/transfer.examples.md +631 -0
- package/dist/docs/transfer.json +80 -16
- package/dist/docs/transfer.md +41 -170
- package/dist/docs/typography.json +96 -0
- package/dist/docs/typography.md +352 -4
- package/dist/docs/upload.examples.md +555 -53
- package/dist/docs/upload.json +62 -30
- package/dist/docs/upload.md +46 -11
- package/dist/docs/wizard.examples.md +1389 -0
- package/dist/docs/wizard.json +89 -49
- package/dist/docs/wizard.md +122 -263
- package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +58 -58
- package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
- package/dist/media-viewer.js +2 -2
- package/dist/message-P91bEGyV.js +455 -0
- package/dist/message.js +2 -2
- package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
- package/dist/page-header.js +1 -1
- package/dist/section-CVTQdWBl.js +216 -0
- package/dist/section.js +2 -2
- package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
- package/dist/side-navigation.js +1 -1
- package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
- package/dist/stat-card.js +1 -1
- package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
- package/dist/stepper.js +2 -2
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
- package/dist/timeline.js +1 -1
- package/dist/top-navigation-YSEQzBhD.js +744 -0
- package/dist/top-navigation.js +2 -2
- package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
- package/dist/transfer.js +1 -1
- package/dist/types/attachment/attachment-parts.d.ts +24 -11
- package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
- package/dist/types/attachment/attachment.d.ts +3 -3
- package/dist/types/attachment/attachment.d.ts.map +1 -1
- package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/types/carousel/carousel-parts.d.ts +2 -2
- package/dist/types/command-palette/command-palette.d.ts.map +1 -1
- package/dist/types/data-list/data-list.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
- package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
- package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
- package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
- package/dist/types/media-viewer/index.d.ts +2 -2
- package/dist/types/media-viewer/index.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
- package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
- package/dist/types/message/message-parts.d.ts +7 -0
- package/dist/types/message/message-parts.d.ts.map +1 -1
- package/dist/types/message/message.d.ts.map +1 -1
- package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
- package/dist/types/section/section-parts.d.ts +16 -8
- package/dist/types/section/section-parts.d.ts.map +1 -1
- package/dist/types/section/section.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
- package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper-parts.d.ts +11 -2
- package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper.d.ts.map +1 -1
- package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
- package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
- package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
- package/dist/wizard.js +1 -1
- package/package.json +6 -6
- package/dist/attachment-MqczA38F.js +0 -292
- package/dist/detail-panel-EImAtksY.js +0 -327
- package/dist/message-D1Dd6Y2k.js +0 -452
- package/dist/section-D_qOfdxR.js +0 -213
- package/dist/top-navigation-D8IHPOmm.js +0 -744
package/dist/docs/carousel.json
CHANGED
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"part": "autoplay",
|
|
126
126
|
"element": "button (CarouselAutoplay)",
|
|
127
127
|
"required": false,
|
|
128
|
-
"purpose": "The rotation control, named by the action it performs — Stop rotation, Resume rotation — with no pressed state.
|
|
128
|
+
"purpose": "The rotation control, named by the action it performs — Stop rotation, Resume rotation — with no pressed state. Hidden in a carousel that does not rotate. Written first, so it is first in the tab sequence."
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"part": "indicators",
|
|
@@ -152,126 +152,126 @@
|
|
|
152
152
|
"type": "number",
|
|
153
153
|
"defaultValue": "—",
|
|
154
154
|
"appliesTo": "Carousel",
|
|
155
|
-
"description": "Present means the consumer owns the page, counted from 0. defaultPage is the uncontrolled half"
|
|
155
|
+
"description": "Present means the consumer owns the page, counted from 0. defaultPage is the uncontrolled half."
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
"name": "defaultPage",
|
|
159
159
|
"type": "number",
|
|
160
160
|
"defaultValue": "0",
|
|
161
161
|
"appliesTo": "Carousel",
|
|
162
|
-
"description": "The page an uncontrolled carousel starts on"
|
|
162
|
+
"description": "The page an uncontrolled carousel starts on."
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"name": "autoplay",
|
|
166
166
|
"type": "boolean | number",
|
|
167
167
|
"defaultValue": "false",
|
|
168
168
|
"appliesTo": "Carousel",
|
|
169
|
-
"description": "Turns the rotation on: true waits autoplayDelay, a number waits that many milliseconds"
|
|
169
|
+
"description": "Turns the rotation on: true waits autoplayDelay, a number waits that many milliseconds."
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"name": "autoplayDelay",
|
|
173
173
|
"type": "number",
|
|
174
174
|
"defaultValue": "5000",
|
|
175
175
|
"appliesTo": "CarouselDefaultsProvider",
|
|
176
|
-
"description": "The wait on a page when autoplay is true; written as --slotted-carousel-autoplay-delay"
|
|
176
|
+
"description": "The wait on a page when autoplay is true; written as --slotted-carousel-autoplay-delay."
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
"name": "playing",
|
|
180
180
|
"type": "boolean",
|
|
181
181
|
"defaultValue": "—",
|
|
182
182
|
"appliesTo": "Carousel",
|
|
183
|
-
"description": "Present means the consumer owns whether the rotation runs. defaultPlaying is the uncontrolled half"
|
|
183
|
+
"description": "Present means the consumer owns whether the rotation runs. defaultPlaying is the uncontrolled half."
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
"name": "defaultPlaying",
|
|
187
187
|
"type": "boolean",
|
|
188
188
|
"defaultValue": "true with autoplay, false under reduced motion",
|
|
189
189
|
"appliesTo": "Carousel",
|
|
190
|
-
"description": "Whether an uncontrolled rotation starts running"
|
|
190
|
+
"description": "Whether an uncontrolled rotation starts running."
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
"name": "loop",
|
|
194
194
|
"type": "boolean",
|
|
195
195
|
"defaultValue": "false",
|
|
196
196
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
197
|
-
"description": "Next on the last page goes to the first; without it the rotation stops there"
|
|
197
|
+
"description": "Next on the last page goes to the first; without it the rotation stops there."
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
"name": "orientation",
|
|
201
201
|
"type": "'horizontal' | 'vertical'",
|
|
202
202
|
"defaultValue": "horizontal",
|
|
203
203
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
204
|
-
"description": "The axis of the track, the arrows and the keys"
|
|
204
|
+
"description": "The axis of the track, the arrows and the keys."
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
"name": "transition",
|
|
208
208
|
"type": "'slide' | 'fade'",
|
|
209
209
|
"defaultValue": "slide",
|
|
210
210
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
211
|
-
"description": "A scroll with snap, or slides stacked and crossfaded"
|
|
211
|
+
"description": "A scroll with snap, or slides stacked and crossfaded."
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
"name": "align",
|
|
215
215
|
"type": "'start' | 'center'",
|
|
216
216
|
"defaultValue": "start",
|
|
217
217
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
218
|
-
"description": "Where a page snaps; center makes every slide a page"
|
|
218
|
+
"description": "Where a page snaps; center makes every slide a page."
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
"name": "arrows",
|
|
222
222
|
"type": "'inset' | 'outside'",
|
|
223
223
|
"defaultValue": "inset",
|
|
224
224
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
225
|
-
"description": "Where previous and next stand when they are children of the root"
|
|
225
|
+
"description": "Where previous and next stand when they are children of the root."
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
"name": "size",
|
|
229
229
|
"type": "'sm' | 'md' | 'lg'",
|
|
230
230
|
"defaultValue": "md",
|
|
231
231
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
232
|
-
"description": "The step of the control scale the round controls take"
|
|
232
|
+
"description": "The step of the control scale the round controls take."
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
"name": "slidesPerView",
|
|
236
236
|
"type": "number",
|
|
237
237
|
"defaultValue": "1",
|
|
238
238
|
"appliesTo": "Carousel",
|
|
239
|
-
"description": "Written as --slotted-carousel-slides-per-view; unset, a container query of the consumer’s may write it"
|
|
239
|
+
"description": "Written as --slotted-carousel-slides-per-view; unset, a container query of the consumer’s may write it."
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
242
|
"name": "slidesPerMove",
|
|
243
243
|
"type": "number | 'page'",
|
|
244
244
|
"defaultValue": "page",
|
|
245
245
|
"appliesTo": "Carousel",
|
|
246
|
-
"description": "How many slides a page moves; page is the slides wholly in view"
|
|
246
|
+
"description": "How many slides a page moves; page is the slides wholly in view."
|
|
247
247
|
},
|
|
248
248
|
{
|
|
249
249
|
"name": "draggable",
|
|
250
250
|
"type": "boolean",
|
|
251
251
|
"defaultValue": "true",
|
|
252
252
|
"appliesTo": "Carousel, CarouselDefaultsProvider",
|
|
253
|
-
"description": "Whether a mouse drags the row; a finger and a trackpad always scroll it"
|
|
253
|
+
"description": "Whether a mouse drags the row; a finger and a trackpad always scroll it."
|
|
254
254
|
},
|
|
255
255
|
{
|
|
256
256
|
"name": "messages",
|
|
257
257
|
"type": "PartialMessages<CarouselMessages>",
|
|
258
258
|
"defaultValue": "—",
|
|
259
259
|
"appliesTo": "Carousel",
|
|
260
|
-
"description": "Words laid over the language in force, key by key: roleDescription, slide, indicators, indicator, previous, next, stop, start, viewport, announce — with {index}, {page} and {count}"
|
|
260
|
+
"description": "Words laid over the language in force, key by key: roleDescription, slide, indicators, indicator, previous, next, stop, start, viewport, announce — with {index}, {page} and {count}."
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
"name": "children",
|
|
264
264
|
"type": "ReactNode",
|
|
265
265
|
"defaultValue": "the chevron, play or pause glyph",
|
|
266
266
|
"appliesTo": "CarouselPrevious, CarouselNext, CarouselAutoplay",
|
|
267
|
-
"description": "Replaces the glyph; the accessible name stays the message unless aria-label is given"
|
|
267
|
+
"description": "Replaces the glyph; the accessible name stays the message unless aria-label is given."
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
"name": "CarouselDefaultsProvider",
|
|
271
271
|
"type": "{ orientation, transition, align, arrows, size, loop, draggable, autoplayDelay }",
|
|
272
272
|
"defaultValue": "—",
|
|
273
273
|
"appliesTo": "a subtree",
|
|
274
|
-
"description": "The decisions an application takes once"
|
|
274
|
+
"description": "The decisions an application takes once."
|
|
275
275
|
}
|
|
276
276
|
],
|
|
277
277
|
"composition": [],
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
{
|
|
290
290
|
"name": "onClick, onKeyDown, onFocus, onPointerEnter, onPointerLeave",
|
|
291
291
|
"payload": "the elements’ own events",
|
|
292
|
-
"when": "Whenever the elements fire them. The consumer’s handler runs first; preventing the default of a click or a key stops
|
|
292
|
+
"when": "Whenever the elements fire them. The consumer’s handler runs first; preventing the default of a click or a key stops Carousel from acting."
|
|
293
293
|
}
|
|
294
294
|
],
|
|
295
295
|
"accessibility": [
|
|
@@ -376,33 +376,33 @@
|
|
|
376
376
|
{
|
|
377
377
|
"id": "orientation",
|
|
378
378
|
"title": "A column of slides",
|
|
379
|
-
"note": "orientation=\"vertical\" turns the scroller and both arrows a quarter; the
|
|
379
|
+
"note": "orientation=\"vertical\" turns the scroller and both arrows a quarter; the keys that page it are now ArrowUp and ArrowDown, and ArrowLeft and ArrowRight are left to the page. The column needs a height, which --slotted-carousel-viewport-size gives it.",
|
|
380
380
|
"language": "tsx",
|
|
381
|
-
"source": "<Carousel aria-label=\"
|
|
382
|
-
"verdict": "
|
|
381
|
+
"source": "import {\n Carousel,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst NOTICES = [\n {\n title: 'Carrier cutoff moved',\n body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',\n },\n { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },\n { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },\n {\n title: 'Peak season hires',\n body: 'Twelve temporary pickers join the night shift on 3 November.',\n },\n];\n\nexport default function CarouselOrientationExample() {\n return (\n <Carousel aria-label=\"Operations notices\" orientation=\"vertical\" slidesPerView={2}>\n <CarouselViewport>\n {NOTICES.map((notice) => (\n <CarouselSlide key={notice.title}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {notice.title}\n </Heading>\n <Text size=\"sm\" tone=\"muted\">\n {notice.body}\n </Text>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n </Carousel>\n );\n}\n",
|
|
382
|
+
"verdict": "example"
|
|
383
383
|
},
|
|
384
384
|
{
|
|
385
385
|
"id": "transition",
|
|
386
386
|
"title": "Slide or fade",
|
|
387
387
|
"note": "slide moves the track on a spring timed by the theme’s long duration, which keeps the speed of a hand that lets go or of a movement it interrupts; fade stacks the slides and crossfades them — the arriving one on the enter curve, the leaving one faster on the exit curve. Under reduced motion both change at once.",
|
|
388
388
|
"language": "tsx",
|
|
389
|
-
"source": "<Carousel aria-label=\"
|
|
390
|
-
"verdict": "
|
|
389
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst NOTICES = [\n {\n title: 'Carrier cutoff moved',\n body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',\n },\n { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },\n { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },\n {\n title: 'Peak season hires',\n body: 'Twelve temporary pickers join the night shift on 3 November.',\n },\n];\n\nexport default function CarouselTransitionExample() {\n return (\n <Stack gap={6}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n transition=\"slide\"\n </Text>\n <Carousel aria-label=\"Notices that slide\" loop transition=\"slide\">\n <CarouselViewport>\n {NOTICES.map((notice) => (\n <CarouselSlide key={notice.title}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {notice.title}\n </Heading>\n <Text size=\"sm\" tone=\"muted\">\n {notice.body}\n </Text>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselControls>\n <CarouselPrevious />\n <CarouselIndicators />\n <CarouselNext />\n </CarouselControls>\n </Carousel>\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n transition=\"fade\"\n </Text>\n <Carousel aria-label=\"Notices that fade\" loop transition=\"fade\">\n <CarouselViewport>\n {NOTICES.map((notice) => (\n <CarouselSlide key={notice.title}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {notice.title}\n </Heading>\n <Text size=\"sm\" tone=\"muted\">\n {notice.body}\n </Text>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselControls>\n <CarouselPrevious />\n <CarouselIndicators />\n <CarouselNext />\n </CarouselControls>\n </Carousel>\n </Stack>\n </Stack>\n );\n}\n",
|
|
390
|
+
"verdict": "example"
|
|
391
391
|
},
|
|
392
392
|
{
|
|
393
393
|
"id": "align",
|
|
394
|
-
"title": "
|
|
394
|
+
"title": "Centered, with the neighbors showing",
|
|
395
395
|
"note": "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.",
|
|
396
396
|
"language": "tsx",
|
|
397
|
-
"source": "
|
|
398
|
-
"verdict": "
|
|
397
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Badge } from '@slotted/react/badge';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst DOCKS = [\n { name: 'Dock 1', status: 'Loading', tone: 'info' },\n { name: 'Dock 2', status: 'Free', tone: 'success' },\n { name: 'Dock 3', status: 'Maintenance', tone: 'warning' },\n { name: 'Dock 4', status: 'Blocked', tone: 'danger' },\n { name: 'Dock 5', status: 'Free', tone: 'success' },\n { name: 'Dock 6', status: 'Unloading', tone: 'info' },\n] as const;\n\nconst ALIGNMENTS = ['start', 'center'] as const;\n\nexport default function CarouselAlignExample() {\n return (\n <Stack gap={6}>\n {ALIGNMENTS.map((align) => (\n <Stack key={align} gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n align=\"{align}\"\n </Text>\n <Carousel align={align} aria-label={`Docks, aligned to the ${align}`} slidesPerView={3}>\n <CarouselViewport>\n {DOCKS.map((dock) => (\n <CarouselSlide key={dock.name}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {dock.name}\n </Heading>\n <Badge tone={dock.tone}>{dock.status}</Badge>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n <CarouselControls>\n <CarouselIndicators />\n </CarouselControls>\n </Carousel>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
398
|
+
"verdict": "example"
|
|
399
399
|
},
|
|
400
400
|
{
|
|
401
401
|
"id": "arrows",
|
|
402
402
|
"title": "Over the picture, or beside the row",
|
|
403
403
|
"note": "arrows=\"inset\" stands previous and next over the ends of the viewport, for a slideshow; \"outside\" gives them columns of their own, so a row of cards keeps its whole width and no arrow covers the first card.",
|
|
404
404
|
"language": "tsx",
|
|
405
|
-
"source": "<Carousel aria-label=\"
|
|
405
|
+
"source": "<Carousel aria-label=\"Best sellers\" arrows=\"outside\" slidesPerView={3}>\n <CarouselViewport>{cards}</CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n</Carousel>;\n",
|
|
406
406
|
"verdict": "excerpt"
|
|
407
407
|
},
|
|
408
408
|
{
|
|
@@ -410,40 +410,40 @@
|
|
|
410
410
|
"title": "Three control sizes",
|
|
411
411
|
"note": "size steps the round controls along the control scale — 30, 34 and 38 pixels at comfortable — and the density shrinks them with every other control. The dots keep the 24-pixel target in every size.",
|
|
412
412
|
"language": "tsx",
|
|
413
|
-
"source": "
|
|
414
|
-
"verdict": "
|
|
413
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst NOTICES = [\n {\n title: 'Carrier cutoff moved',\n body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',\n },\n { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },\n { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },\n {\n title: 'Peak season hires',\n body: 'Twelve temporary pickers join the night shift on 3 November.',\n },\n];\n\nconst SIZES = ['sm', 'md', 'lg'] as const;\n\nexport default function CarouselSizesExample() {\n return (\n <Stack gap={6}>\n {SIZES.map((size) => (\n <Stack key={size} gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n size=\"{size}\"\n </Text>\n <Carousel aria-label={`Notices, size ${size}`} size={size}>\n <CarouselViewport>\n {NOTICES.slice(0, 3).map((notice) => (\n <CarouselSlide key={notice.title}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {notice.title}\n </Heading>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselControls>\n <CarouselPrevious />\n <CarouselIndicators />\n <CarouselNext />\n </CarouselControls>\n </Carousel>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
414
|
+
"verdict": "example"
|
|
415
415
|
},
|
|
416
416
|
{
|
|
417
417
|
"id": "indicators",
|
|
418
418
|
"title": "Dots, a line, and many pages",
|
|
419
419
|
"note": "dots draw the current page as a bar three dots long; line shares the width between segments; past eight pages the dots window themselves, the ones two steps away shrink and the rest fold away while staying in the arrow ring.",
|
|
420
420
|
"language": "tsx",
|
|
421
|
-
"source": "
|
|
422
|
-
"verdict": "
|
|
421
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselCounter,\n CarouselIndicators,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst ZONES = [\n 'Ambient',\n 'Chilled',\n 'Frozen',\n 'Bulk',\n 'Pick face',\n 'Returns',\n 'Hazmat',\n 'Quarantine',\n 'Overflow',\n 'Mezzanine',\n];\n\nconst ROWS = [\n { label: 'variant=\"dots\"', name: 'Zones, dots', variant: 'dots', zones: ZONES.slice(0, 5) },\n { label: 'variant=\"line\"', name: 'Zones, line', variant: 'line', zones: ZONES.slice(0, 5) },\n { label: 'variant=\"dots\", ten pages', name: 'All zones, dots', variant: 'dots', zones: ZONES },\n] as const;\n\nexport default function CarouselIndicatorsExample() {\n return (\n <Stack gap={6}>\n {ROWS.map((row) => (\n <Stack key={row.name} gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n {row.label}\n </Text>\n <Carousel aria-label={row.name}>\n <CarouselViewport>\n {row.zones.map((zone) => (\n <CarouselSlide key={zone}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {zone}\n </Heading>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselControls>\n <CarouselIndicators variant={row.variant} />\n <CarouselCounter />\n </CarouselControls>\n </Carousel>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
422
|
+
"verdict": "example"
|
|
423
423
|
},
|
|
424
424
|
{
|
|
425
425
|
"id": "thumbnails",
|
|
426
426
|
"title": "A product gallery",
|
|
427
427
|
"note": "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.",
|
|
428
428
|
"language": "tsx",
|
|
429
|
-
"source": "<CarouselIndicators aria-label=\"
|
|
430
|
-
"verdict": "
|
|
429
|
+
"source": "import {\n Carousel,\n CarouselIndicator,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Image } from '@slotted/react/image';\n\nconst SITES = [\n { name: 'Rotterdam dock', src: picture('Rotterdam dock', '#1e3a5f') },\n { name: 'Cold storage', src: picture('Cold storage', '#0f766e') },\n { name: 'Cross-dock', src: picture('Cross-dock', '#7c2d12') },\n { name: 'Returns hall', src: picture('Returns hall', '#4c1d95') },\n { name: 'Outbound lanes', src: picture('Outbound lanes', '#374151') },\n];\n\nexport default function CarouselThumbnailsExample() {\n return (\n <Carousel aria-label=\"Northwind site photos\">\n <CarouselViewport>\n {SITES.map((site) => (\n <CarouselSlide key={site.name}>\n <Image alt={site.name} ratio=\"landscape\" src={site.src} />\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n <CarouselIndicators aria-label=\"Site photos\" variant=\"thumbnails\">\n {(page) => (\n <CarouselIndicator key={page} page={page}>\n <img alt={SITES[page]?.name ?? ''} src={SITES[page]?.src ?? ''} />\n </CarouselIndicator>\n )}\n </CarouselIndicators>\n </Carousel>\n );\n}\n\nfunction picture(name: string, color: string) {\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 500\"><rect width=\"800\" height=\"500\" fill=\"${color}\"/><text x=\"400\" y=\"270\" fill=\"#ffffff\" font-family=\"sans-serif\" font-size=\"56\" text-anchor=\"middle\">${name}</text></svg>`;\n\n return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n",
|
|
430
|
+
"verdict": "example"
|
|
431
431
|
},
|
|
432
432
|
{
|
|
433
433
|
"id": "autoplay",
|
|
434
434
|
"title": "A rotation the reader controls",
|
|
435
435
|
"note": "autoplay turns it on; the current dot fills over the delay. Hovering holds it with the time that was left, a hidden browser tab holds it, and the first keyboard focus inside stops it until the rotation control starts it again.",
|
|
436
436
|
"language": "tsx",
|
|
437
|
-
"source": "<Carousel aria-label=\"
|
|
438
|
-
"verdict": "
|
|
437
|
+
"source": "import {\n Carousel,\n CarouselAutoplay,\n CarouselControls,\n CarouselIndicators,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Image } from '@slotted/react/image';\n\nconst SITES = [\n { name: 'Rotterdam dock', src: picture('Rotterdam dock', '#1e3a5f') },\n { name: 'Cold storage', src: picture('Cold storage', '#0f766e') },\n { name: 'Cross-dock', src: picture('Cross-dock', '#7c2d12') },\n { name: 'Returns hall', src: picture('Returns hall', '#4c1d95') },\n { name: 'Outbound lanes', src: picture('Outbound lanes', '#374151') },\n];\n\nexport default function CarouselAutoplayExample() {\n return (\n <Carousel aria-label=\"Northwind site highlights\" autoplay={6000} loop>\n <CarouselViewport>\n {SITES.map((site) => (\n <CarouselSlide key={site.name}>\n <Image alt={site.name} ratio=\"landscape\" src={site.src} />\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselControls placement=\"overlay\">\n <CarouselAutoplay />\n <CarouselIndicators />\n </CarouselControls>\n </Carousel>\n );\n}\n\nfunction picture(name: string, color: string) {\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 500\"><rect width=\"800\" height=\"500\" fill=\"${color}\"/><text x=\"400\" y=\"270\" fill=\"#ffffff\" font-family=\"sans-serif\" font-size=\"56\" text-anchor=\"middle\">${name}</text></svg>`;\n\n return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n",
|
|
438
|
+
"verdict": "example"
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
441
|
"id": "multiple",
|
|
442
442
|
"title": "A row of cards that pages by what it shows",
|
|
443
443
|
"note": "slidesPerView={3} sizes the cards; the pages are read from the layout, so the row pages by three and its last page ends flush. --slotted-carousel-slide-min-size keeps a card readable when the container narrows: at 240 pixels the same carousel shows one card and the edge of the next.",
|
|
444
444
|
"language": "tsx",
|
|
445
|
-
"source": "<Carousel aria-label=\"
|
|
446
|
-
"verdict": "
|
|
445
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Badge } from '@slotted/react/badge';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst PRODUCTS = [\n { name: 'Pallet wrap', price: '€14.50', stock: 'In stock', tone: 'success' },\n { name: 'Thermal labels', price: '€32.00', stock: 'Low stock', tone: 'warning' },\n { name: 'Cold-chain crate', price: '€96.00', stock: 'Out of stock', tone: 'danger' },\n { name: 'Handheld scanner', price: '€389.00', stock: 'In stock', tone: 'success' },\n { name: 'Safety vest', price: '€9.90', stock: 'Backorder', tone: 'info' },\n { name: 'Pallet jack', price: '€420.00', stock: 'In stock', tone: 'success' },\n] as const;\n\nexport default function CarouselMultipleExample() {\n return (\n <Carousel aria-label=\"Warehouse supplies\" arrows=\"outside\" slidesPerView={3}>\n <CarouselViewport>\n {PRODUCTS.map((product) => (\n <CarouselSlide key={product.name}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {product.name}\n </Heading>\n <Text numeric=\"tabular\" size=\"sm\">\n {product.price}\n </Text>\n <Badge tone={product.tone}>{product.stock}</Badge>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n <CarouselControls>\n <CarouselIndicators variant=\"line\" />\n </CarouselControls>\n </Carousel>\n );\n}\n",
|
|
446
|
+
"verdict": "example"
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
449
|
"id": "loop",
|
|
@@ -458,40 +458,40 @@
|
|
|
458
458
|
"title": "A page the application owns",
|
|
459
459
|
"note": "page and onPageChange make the page the application’s; the request carries the reason — pointer, keyboard, scroll, timeout, resize, programmatic. The buttons outside the carousel move it through the same state, and the log shows each request.",
|
|
460
460
|
"language": "tsx",
|
|
461
|
-
"source": "const [page, setPage] = useState(0);\n
|
|
462
|
-
"verdict": "
|
|
461
|
+
"source": "import { useState } from 'react';\nimport {\n Carousel,\n CarouselAutoplay,\n CarouselControls,\n CarouselIndicators,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport type { CarouselPageRequest, CarouselPlayingRequest } from '@slotted/react/carousel';\nimport { Button } from '@slotted/react/button';\nimport { Card, CardBody } from '@slotted/react/card';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst NOTICES = [\n {\n title: 'Carrier cutoff moved',\n body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',\n },\n { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },\n { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },\n {\n title: 'Peak season hires',\n body: 'Twelve temporary pickers join the night shift on 3 November.',\n },\n];\n\nexport default function CarouselControlledExample() {\n const [page, setPage] = useState(0);\n const [playing, setPlaying] = useState(false);\n const [lastRequest, setLastRequest] = useState('No request yet.');\n\n function handlePageChange(next: number, request: CarouselPageRequest) {\n setPage(next);\n setLastRequest(`Page ${next + 1} requested by ${request.reason}.`);\n }\n\n function handlePlayingChange(next: boolean, request: CarouselPlayingRequest) {\n setPlaying(next);\n setLastRequest(`Rotation ${next ? 'started' : 'stopped'} by ${request.reason}.`);\n }\n\n function handlePrevious() {\n setPage((page + NOTICES.length - 1) % NOTICES.length);\n }\n\n function handleNext() {\n setPage((page + 1) % NOTICES.length);\n }\n\n return (\n <Stack gap={4}>\n <Carousel\n aria-label=\"Operations notices\"\n autoplay={4000}\n loop\n onPageChange={handlePageChange}\n onPlayingChange={handlePlayingChange}\n page={page}\n playing={playing}\n >\n <CarouselViewport>\n {NOTICES.map((notice) => (\n <CarouselSlide key={notice.title}>\n <Card>\n <CardBody>\n <Heading level={2} size=\"sm\">\n {notice.title}\n </Heading>\n <Text size=\"sm\" tone=\"muted\">\n {notice.body}\n </Text>\n </CardBody>\n </Card>\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselControls>\n <CarouselAutoplay />\n <CarouselIndicators />\n </CarouselControls>\n </Carousel>\n <Inline gap={2}>\n <Button onClick={handlePrevious} variant=\"outline\">\n Previous notice\n </Button>\n <Button onClick={handleNext} variant=\"outline\">\n Next notice\n </Button>\n </Inline>\n <Text size=\"sm\" tone=\"muted\">\n {lastRequest}\n </Text>\n </Stack>\n );\n}\n",
|
|
462
|
+
"verdict": "example"
|
|
463
463
|
},
|
|
464
464
|
{
|
|
465
465
|
"id": "states",
|
|
466
466
|
"title": "Every control in every state",
|
|
467
|
-
"note": "Hover lifts a round control onto the neutral hover ground, a press shrinks it to 94
|
|
467
|
+
"note": "Hover lifts a round control onto the neutral hover ground, a press shrinks it to 94 percent, focus draws the ring two pixels out; at an end it keeps its place in the disabled ink. Use Tab to see the rings.",
|
|
468
468
|
"language": "tsx",
|
|
469
469
|
"source": "<CarouselControls>\n <CarouselPrevious />\n <CarouselIndicators />\n <CarouselNext />\n</CarouselControls>;\n",
|
|
470
470
|
"verdict": "excerpt"
|
|
471
471
|
},
|
|
472
472
|
{
|
|
473
473
|
"id": "content",
|
|
474
|
-
"title": "Content
|
|
475
|
-
"note": "Cards of different heights stand at the height of the tallest; a long
|
|
474
|
+
"title": "Content Carousel does not choose",
|
|
475
|
+
"note": "Cards of different heights stand at the height of the tallest; a long name wraps inside its card; a right-to-left page mirrors the track, the arrows and the dots, and the counter still reads first to last.",
|
|
476
476
|
"language": "tsx",
|
|
477
|
-
"source": "<div dir=\"rtl\">\n <Carousel aria-label=\"
|
|
477
|
+
"source": "<div dir=\"rtl\">\n <Carousel aria-label=\"Gallery\" slidesPerView={2}>\n …\n </Carousel>\n</div>;\n",
|
|
478
478
|
"verdict": "excerpt"
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
481
|
"id": "empty",
|
|
482
482
|
"title": "Nothing yet, and loading",
|
|
483
|
-
"note": "With no slide the
|
|
483
|
+
"note": "With no slide the indicators draw nothing and the counter reads 0 / 0; the empty state is a ResultState the consumer puts in the viewport. While the pieces load, skeleton slides with the same anatomy hold the height.",
|
|
484
484
|
"language": "tsx",
|
|
485
|
-
"source": "
|
|
486
|
-
"verdict": "
|
|
485
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselCounter,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport {\n ResultState,\n ResultStateContent,\n ResultStateDescription,\n ResultStateTitle,\n} from '@slotted/react/result-state';\n\nexport default function CarouselEmptyExample() {\n return (\n <Carousel aria-label=\"Pending shipments\">\n <CarouselViewport>\n <ResultState>\n <ResultStateContent>\n <ResultStateTitle>No shipments waiting</ResultStateTitle>\n <ResultStateDescription>\n Shipments appear here once a carrier books a pickup.\n </ResultStateDescription>\n </ResultStateContent>\n </ResultState>\n </CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n <CarouselControls>\n <CarouselIndicators />\n <CarouselCounter />\n </CarouselControls>\n </Carousel>\n );\n}\n",
|
|
486
|
+
"verdict": "example"
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
"id": "composition",
|
|
490
490
|
"title": "Inside a product page",
|
|
491
491
|
"note": "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.",
|
|
492
492
|
"language": "tsx",
|
|
493
|
-
"source": "const gallery = useRef<CarouselHandle>(null);\n\n
|
|
494
|
-
"verdict": "
|
|
493
|
+
"source": "import { useRef, useState } from 'react';\nimport {\n Carousel,\n CarouselIndicator,\n CarouselIndicators,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport type { CarouselHandle } from '@slotted/react/carousel';\nimport { Button } from '@slotted/react/button';\nimport { Image } from '@slotted/react/image';\nimport { Segment, SegmentedControl } from '@slotted/react/segmented-control';\nimport { Stack } from '@slotted/react/stack';\nimport { Heading, Text } from '@slotted/react/typography';\n\nconst FINISHES = [\n { label: 'Graphite', value: 'graphite', src: picture('Graphite', '#374151') },\n { label: 'Cobalt', value: 'cobalt', src: picture('Cobalt', '#1e3a8a') },\n { label: 'Sand', value: 'sand', src: picture('Sand', '#a16207') },\n];\n\nexport default function CarouselCompositionExample() {\n const gallery = useRef<CarouselHandle>(null);\n const [page, setPage] = useState(0);\n\n const finish = FINISHES[page]?.value;\n\n function handleFinishChange(value: string) {\n gallery.current?.scrollToSlide(FINISHES.findIndex((item) => item.value === value));\n }\n\n return (\n <Stack gap={4}>\n <Carousel\n aria-label=\"Label printer photos\"\n handleRef={gallery}\n onPageChange={(next) => {\n setPage(next);\n }}\n >\n <CarouselViewport>\n {FINISHES.map((item) => (\n <CarouselSlide key={item.value}>\n <Image alt={`Label printer, ${item.label}`} ratio=\"landscape\" src={item.src} />\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselIndicators aria-label=\"Photos\" variant=\"thumbnails\">\n {(index) => (\n <CarouselIndicator key={index} page={index}>\n <img alt={FINISHES[index]?.label ?? ''} src={FINISHES[index]?.src ?? ''} />\n </CarouselIndicator>\n )}\n </CarouselIndicators>\n </Carousel>\n <Stack gap={1}>\n <Heading level={2} size=\"md\">\n Thermal label printer\n </Heading>\n <Text numeric=\"tabular\">€249.00</Text>\n </Stack>\n <SegmentedControl aria-label=\"Finish\" onValueChange={handleFinishChange} value={finish}>\n {FINISHES.map((item) => (\n <Segment key={item.value} value={item.value}>\n {item.label}\n </Segment>\n ))}\n </SegmentedControl>\n <Button>Add to order</Button>\n </Stack>\n );\n}\n\nfunction picture(name: string, color: string) {\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 500\"><rect width=\"800\" height=\"500\" fill=\"${color}\"/><text x=\"400\" y=\"270\" fill=\"#ffffff\" font-family=\"sans-serif\" font-size=\"56\" text-anchor=\"middle\">${name}</text></svg>`;\n\n return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n",
|
|
494
|
+
"verdict": "example"
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
497
|
"id": "keyboard",
|
|
@@ -500,6 +500,14 @@
|
|
|
500
500
|
"language": "tsx",
|
|
501
501
|
"source": "<Carousel aria-label=\"Collection\">\n <CarouselViewport>{slides}</CarouselViewport>\n <CarouselControls>\n <CarouselIndicators />\n </CarouselControls>\n</Carousel>;\n",
|
|
502
502
|
"verdict": "excerpt"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"id": "basic",
|
|
506
|
+
"title": "basic.tsx",
|
|
507
|
+
"note": null,
|
|
508
|
+
"language": "tsx",
|
|
509
|
+
"source": "import {\n Carousel,\n CarouselControls,\n CarouselCounter,\n CarouselIndicators,\n CarouselNext,\n CarouselPrevious,\n CarouselSlide,\n CarouselViewport,\n} from '@slotted/react/carousel';\nimport { Image } from '@slotted/react/image';\n\nconst SITES = [\n { name: 'Rotterdam dock', src: picture('Rotterdam dock', '#1e3a5f') },\n { name: 'Cold storage', src: picture('Cold storage', '#0f766e') },\n { name: 'Cross-dock', src: picture('Cross-dock', '#7c2d12') },\n { name: 'Returns hall', src: picture('Returns hall', '#4c1d95') },\n { name: 'Outbound lanes', src: picture('Outbound lanes', '#374151') },\n];\n\nexport default function CarouselBasicExample() {\n return (\n <Carousel aria-label=\"Northwind sites\">\n <CarouselViewport>\n {SITES.map((site) => (\n <CarouselSlide key={site.name}>\n <Image alt={site.name} ratio=\"landscape\" src={site.src} />\n </CarouselSlide>\n ))}\n </CarouselViewport>\n <CarouselPrevious />\n <CarouselNext />\n <CarouselControls>\n <CarouselIndicators />\n <CarouselCounter />\n </CarouselControls>\n </Carousel>\n );\n}\n\nfunction picture(name: string, color: string) {\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 500\"><rect width=\"800\" height=\"500\" fill=\"${color}\"/><text x=\"400\" y=\"270\" fill=\"#ffffff\" font-family=\"sans-serif\" font-size=\"56\" text-anchor=\"middle\">${name}</text></svg>`;\n\n return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n",
|
|
510
|
+
"verdict": "example"
|
|
503
511
|
}
|
|
504
512
|
]
|
|
505
513
|
}
|