@aurodesignsystem-dev/auro-carousel 0.0.0-pr142.1 → 0.0.0-pr142.2
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/demo/api.md +14 -14
- package/demo/api.min.js +3 -3
- package/demo/index.min.js +3 -3
- package/dist/index.d.ts +10 -10
- package/package.json +1 -1
package/demo/api.md
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
Displays a group of elements, such as flight date options or images, in a horizontally scrollable container with buttons to scroll left and right.
|
|
7
7
|
|
|
8
8
|
**Key capabilities:**
|
|
9
|
-
- **Scroll buttons**: Shows left and right buttons on
|
|
9
|
+
- **Scroll buttons**: Shows left and right buttons on screens at least 576 pixels wide when the carousel can scroll that way, or at all times when you add `displayArrows`.
|
|
10
10
|
- **Centered selection**: Scrolls the first element with the `selected` attribute to the center when you add `centerSelected`.
|
|
11
11
|
- **Custom scroll distance**: Sets how far each button press scrolls, in pixels, with `scrollDistance`.
|
|
12
12
|
- **Accessible names**: Names the carousel and its scroll buttons through the `ariaLabel`, `ariaLabel.scroll.left`, and `ariaLabel.scroll.right` slots.
|
|
13
13
|
|
|
14
14
|
### Properties and attributes
|
|
15
15
|
|
|
16
|
-
| Properties | Attributes | Modifiers | Type | Default | Description
|
|
17
|
-
| -------------- | -------------- | --------- | ------- | ------- |
|
|
18
|
-
| displayArrows | displayarrows | | boolean | | Shows the left and right scroll buttons at all times, instead of
|
|
19
|
-
| scrollDistance | scrolldistance | | number | `300` | Sets how many pixels the carousel scrolls when someone selects the left or right button.
|
|
20
|
-
| label | label | | string | | Deprecated: Use the `ariaLabel` slot instead.<br>Sets the text that screen readers announce as the carousel's name.
|
|
21
|
-
| | centerselected | | boolean | | Centers the carousel on the first element that has the `selected` attribute when the carousel first renders.
|
|
16
|
+
| Properties | Attributes | Modifiers | Type | Default | Description |
|
|
17
|
+
| -------------- | -------------- | --------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
18
|
+
| displayArrows | displayarrows | | boolean | | Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens. |
|
|
19
|
+
| scrollDistance | scrolldistance | | number | `300` | Sets how many pixels the carousel scrolls when someone selects the left or right button. |
|
|
20
|
+
| label | label | | string | | Deprecated: Use the `ariaLabel` slot instead.<br>Sets the text that screen readers announce as the carousel's name. |
|
|
21
|
+
| | centerselected | | boolean | | Centers the carousel on the first element that has the `selected` attribute when the carousel first renders. |
|
|
22
22
|
|
|
23
23
|
### Methods
|
|
24
24
|
|
|
@@ -38,12 +38,12 @@ Displays a group of elements, such as flight date options or images, in a horizo
|
|
|
38
38
|
|
|
39
39
|
### Slots
|
|
40
40
|
|
|
41
|
-
| Name | Description
|
|
42
|
-
| ---------------------- |
|
|
43
|
-
| (default) | The elements to scroll through, such as `auro-pane` elements or images.
|
|
44
|
-
| ariaLabel
|
|
45
|
-
| ariaLabel.scroll.
|
|
46
|
-
| ariaLabel
|
|
41
|
+
| Name | Description |
|
|
42
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| (default) | The elements to scroll through, such as `auro-pane` elements or images. |
|
|
44
|
+
| ariaLabel.scroll.left | Text that screen readers announce for the left scroll button, for example "Show earlier dates". Defaults to "Scroll Left". |
|
|
45
|
+
| ariaLabel.scroll.right | Text that screen readers announce for the right scroll button, for example "Show later dates". Defaults to "Scroll Right". |
|
|
46
|
+
| ariaLabel | Text that screen readers announce as the carousel's name, for example "Flight date options". Required unless you set the deprecated `label` attribute, and takes priority over it when both are set. |
|
|
47
47
|
|
|
48
48
|
### CSS shadow parts
|
|
49
49
|
|
|
@@ -295,7 +295,7 @@ Use the `scrollDistance` attribute to set how many pixels the carousel scrolls w
|
|
|
295
295
|
|
|
296
296
|
#### Center element
|
|
297
297
|
|
|
298
|
-
Use the `centerElement` method to center an element inside the carousel, such as a pane when someone selects it. The element must be a descendant of the carousel, or the method throws an error. The carousel can only center
|
|
298
|
+
Use the `centerElement` method to center an element inside the carousel, such as a pane when someone selects it. The element must be a descendant of the carousel, or the method throws an error. The carousel can only center an element that has enough content on both sides of it.
|
|
299
299
|
|
|
300
300
|
This example doesn't use `centerSelected`, so it doesn't center the selected pane on load. The method doesn't run on its own, so call it from an event handler, such as a click listener. The code below shows a vanilla JS example and a React example.
|
|
301
301
|
|
package/demo/api.min.js
CHANGED
|
@@ -317,7 +317,7 @@ var tokensCss = i$5`:host{--ds-auro-carousel-gradient-color-one: var(--ds-basic-
|
|
|
317
317
|
* Displays a group of elements, such as flight date options or images, in a horizontally scrollable container with buttons to scroll left and right.
|
|
318
318
|
*
|
|
319
319
|
* **Key capabilities:**
|
|
320
|
-
* - **Scroll buttons**: Shows left and right buttons on
|
|
320
|
+
* - **Scroll buttons**: Shows left and right buttons on screens at least 576 pixels wide when the carousel can scroll that way, or at all times when you add `displayArrows`.
|
|
321
321
|
* - **Centered selection**: Scrolls the first element with the `selected` attribute to the center when you add `centerSelected`.
|
|
322
322
|
* - **Custom scroll distance**: Sets how far each button press scrolls, in pixels, with `scrollDistance`.
|
|
323
323
|
* - **Accessible names**: Names the carousel and its scroll buttons through the `ariaLabel`, `ariaLabel.scroll.left`, and `ariaLabel.scroll.right` slots.
|
|
@@ -337,7 +337,7 @@ var tokensCss = i$5`:host{--ds-auro-carousel-gradient-color-one: var(--ds-basic-
|
|
|
337
337
|
* @attr {boolean} centerselected - Centers the carousel on the first element that has the `selected` attribute when the carousel first renders.
|
|
338
338
|
*
|
|
339
339
|
* @slot - The elements to scroll through, such as `auro-pane` elements or images.
|
|
340
|
-
* @slot ariaLabel - Text that screen readers announce as the carousel's name, for example "Flight date options".
|
|
340
|
+
* @slot ariaLabel - Text that screen readers announce as the carousel's name, for example "Flight date options". Required unless you set the deprecated `label` attribute, and takes priority over it when both are set.
|
|
341
341
|
* @slot ariaLabel.scroll.left - Text that screen readers announce for the left scroll button, for example "Show earlier dates". Defaults to "Scroll Left".
|
|
342
342
|
* @slot ariaLabel.scroll.right - Text that screen readers announce for the right scroll button, for example "Show later dates". Defaults to "Scroll Right".
|
|
343
343
|
*
|
|
@@ -397,7 +397,7 @@ class AuroCarousel extends i$2 {
|
|
|
397
397
|
static get properties() {
|
|
398
398
|
return {
|
|
399
399
|
/**
|
|
400
|
-
* Shows the left and right scroll buttons at all times, instead of
|
|
400
|
+
* Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens.
|
|
401
401
|
*/
|
|
402
402
|
displayArrows: { type: Boolean, attribute: "displayarrows" },
|
|
403
403
|
|
package/demo/index.min.js
CHANGED
|
@@ -299,7 +299,7 @@ var tokensCss = i$5`:host{--ds-auro-carousel-gradient-color-one: var(--ds-basic-
|
|
|
299
299
|
* Displays a group of elements, such as flight date options or images, in a horizontally scrollable container with buttons to scroll left and right.
|
|
300
300
|
*
|
|
301
301
|
* **Key capabilities:**
|
|
302
|
-
* - **Scroll buttons**: Shows left and right buttons on
|
|
302
|
+
* - **Scroll buttons**: Shows left and right buttons on screens at least 576 pixels wide when the carousel can scroll that way, or at all times when you add `displayArrows`.
|
|
303
303
|
* - **Centered selection**: Scrolls the first element with the `selected` attribute to the center when you add `centerSelected`.
|
|
304
304
|
* - **Custom scroll distance**: Sets how far each button press scrolls, in pixels, with `scrollDistance`.
|
|
305
305
|
* - **Accessible names**: Names the carousel and its scroll buttons through the `ariaLabel`, `ariaLabel.scroll.left`, and `ariaLabel.scroll.right` slots.
|
|
@@ -319,7 +319,7 @@ var tokensCss = i$5`:host{--ds-auro-carousel-gradient-color-one: var(--ds-basic-
|
|
|
319
319
|
* @attr {boolean} centerselected - Centers the carousel on the first element that has the `selected` attribute when the carousel first renders.
|
|
320
320
|
*
|
|
321
321
|
* @slot - The elements to scroll through, such as `auro-pane` elements or images.
|
|
322
|
-
* @slot ariaLabel - Text that screen readers announce as the carousel's name, for example "Flight date options".
|
|
322
|
+
* @slot ariaLabel - Text that screen readers announce as the carousel's name, for example "Flight date options". Required unless you set the deprecated `label` attribute, and takes priority over it when both are set.
|
|
323
323
|
* @slot ariaLabel.scroll.left - Text that screen readers announce for the left scroll button, for example "Show earlier dates". Defaults to "Scroll Left".
|
|
324
324
|
* @slot ariaLabel.scroll.right - Text that screen readers announce for the right scroll button, for example "Show later dates". Defaults to "Scroll Right".
|
|
325
325
|
*
|
|
@@ -379,7 +379,7 @@ class AuroCarousel extends i$2 {
|
|
|
379
379
|
static get properties() {
|
|
380
380
|
return {
|
|
381
381
|
/**
|
|
382
|
-
* Shows the left and right scroll buttons at all times, instead of
|
|
382
|
+
* Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens.
|
|
383
383
|
*/
|
|
384
384
|
displayArrows: { type: Boolean, attribute: "displayarrows" },
|
|
385
385
|
|
package/dist/index.d.ts
CHANGED
|
@@ -81,9 +81,9 @@ export type AuroCarouselProps = {
|
|
|
81
81
|
centerselected?: unknown;
|
|
82
82
|
/** Centers the carousel on the first element that has the `selected` attribute when the carousel first renders. */
|
|
83
83
|
undefined?: unknown;
|
|
84
|
-
/** Shows the left and right scroll buttons at all times, instead of
|
|
84
|
+
/** Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens. */
|
|
85
85
|
displayarrows?: AuroCarousel["displayArrows"];
|
|
86
|
-
/** Shows the left and right scroll buttons at all times, instead of
|
|
86
|
+
/** Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens. */
|
|
87
87
|
displayArrows?: AuroCarousel["displayArrows"];
|
|
88
88
|
/** Sets how many pixels the carousel scrolls when someone selects the left or right button. */
|
|
89
89
|
scrolldistance?: AuroCarousel["scrollDistance"];
|
|
@@ -104,9 +104,9 @@ export type AuroCarouselSolidJsProps = {
|
|
|
104
104
|
"bool:centerselected"?: unknown;
|
|
105
105
|
/** Centers the carousel on the first element that has the `selected` attribute when the carousel first renders. */
|
|
106
106
|
"prop:undefined"?: unknown;
|
|
107
|
-
/** Shows the left and right scroll buttons at all times, instead of
|
|
107
|
+
/** Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens. */
|
|
108
108
|
"bool:displayarrows"?: AuroCarousel["displayArrows"];
|
|
109
|
-
/** Shows the left and right scroll buttons at all times, instead of
|
|
109
|
+
/** Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens. */
|
|
110
110
|
"prop:displayArrows"?: AuroCarousel["displayArrows"];
|
|
111
111
|
/** Sets how many pixels the carousel scrolls when someone selects the left or right button. */
|
|
112
112
|
"attr:scrolldistance"?: AuroCarousel["scrollDistance"];
|
|
@@ -131,7 +131,7 @@ export type CustomElements = {
|
|
|
131
131
|
* Displays a group of elements, such as flight date options or images, in a horizontally scrollable container with buttons to scroll left and right.
|
|
132
132
|
*
|
|
133
133
|
* **Key capabilities:**
|
|
134
|
-
* - **Scroll buttons**: Shows left and right buttons on
|
|
134
|
+
* - **Scroll buttons**: Shows left and right buttons on screens at least 576 pixels wide when the carousel can scroll that way, or at all times when you add `displayArrows`.
|
|
135
135
|
* - **Centered selection**: Scrolls the first element with the `selected` attribute to the center when you add `centerSelected`.
|
|
136
136
|
* - **Custom scroll distance**: Sets how far each button press scrolls, in pixels, with `scrollDistance`.
|
|
137
137
|
* - **Accessible names**: Names the carousel and its scroll buttons through the `ariaLabel`, `ariaLabel.scroll.left`, and `ariaLabel.scroll.right` slots.
|
|
@@ -141,7 +141,7 @@ export type CustomElements = {
|
|
|
141
141
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
142
142
|
*
|
|
143
143
|
* - `centerselected`/`undefined`: Centers the carousel on the first element that has the `selected` attribute when the carousel first renders.
|
|
144
|
-
* - `displayarrows`/`displayArrows`: Shows the left and right scroll buttons at all times, instead of
|
|
144
|
+
* - `displayarrows`/`displayArrows`: Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens.
|
|
145
145
|
* - `scrolldistance`/`scrollDistance`: Sets how many pixels the carousel scrolls when someone selects the left or right button.
|
|
146
146
|
* - `label`: Deprecated: Use the `ariaLabel` slot instead.
|
|
147
147
|
* Sets the text that screen readers announce as the carousel's name.
|
|
@@ -158,9 +158,9 @@ export type CustomElements = {
|
|
|
158
158
|
* Areas where markup can be added to the component.
|
|
159
159
|
*
|
|
160
160
|
* - `(default)`: The elements to scroll through, such as `auro-pane` elements or images.
|
|
161
|
-
* - `ariaLabel`: Text that screen readers announce as the carousel's name, for example "Flight date options". Takes priority over the `label` attribute.
|
|
162
161
|
* - `ariaLabel.scroll.left`: Text that screen readers announce for the left scroll button, for example "Show earlier dates". Defaults to "Scroll Left".
|
|
163
162
|
* - `ariaLabel.scroll.right`: Text that screen readers announce for the right scroll button, for example "Show later dates". Defaults to "Scroll Right".
|
|
163
|
+
* - `ariaLabel`: Text that screen readers announce as the carousel's name, for example "Flight date options". Required unless you set the deprecated `label` attribute, and takes priority over it when both are set.
|
|
164
164
|
*
|
|
165
165
|
* ## Methods
|
|
166
166
|
*
|
|
@@ -195,7 +195,7 @@ export type CustomElementsSolidJs = {
|
|
|
195
195
|
* Displays a group of elements, such as flight date options or images, in a horizontally scrollable container with buttons to scroll left and right.
|
|
196
196
|
*
|
|
197
197
|
* **Key capabilities:**
|
|
198
|
-
* - **Scroll buttons**: Shows left and right buttons on
|
|
198
|
+
* - **Scroll buttons**: Shows left and right buttons on screens at least 576 pixels wide when the carousel can scroll that way, or at all times when you add `displayArrows`.
|
|
199
199
|
* - **Centered selection**: Scrolls the first element with the `selected` attribute to the center when you add `centerSelected`.
|
|
200
200
|
* - **Custom scroll distance**: Sets how far each button press scrolls, in pixels, with `scrollDistance`.
|
|
201
201
|
* - **Accessible names**: Names the carousel and its scroll buttons through the `ariaLabel`, `ariaLabel.scroll.left`, and `ariaLabel.scroll.right` slots.
|
|
@@ -205,7 +205,7 @@ export type CustomElementsSolidJs = {
|
|
|
205
205
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
206
206
|
*
|
|
207
207
|
* - `centerselected`/`undefined`: Centers the carousel on the first element that has the `selected` attribute when the carousel first renders.
|
|
208
|
-
* - `displayarrows`/`displayArrows`: Shows the left and right scroll buttons at all times, instead of
|
|
208
|
+
* - `displayarrows`/`displayArrows`: Shows the left and right scroll buttons at all times, instead of hiding each one when the carousel can't scroll further in that direction. The buttons stay hidden on small screens.
|
|
209
209
|
* - `scrolldistance`/`scrollDistance`: Sets how many pixels the carousel scrolls when someone selects the left or right button.
|
|
210
210
|
* - `label`: Deprecated: Use the `ariaLabel` slot instead.
|
|
211
211
|
* Sets the text that screen readers announce as the carousel's name.
|
|
@@ -222,9 +222,9 @@ export type CustomElementsSolidJs = {
|
|
|
222
222
|
* Areas where markup can be added to the component.
|
|
223
223
|
*
|
|
224
224
|
* - `(default)`: The elements to scroll through, such as `auro-pane` elements or images.
|
|
225
|
-
* - `ariaLabel`: Text that screen readers announce as the carousel's name, for example "Flight date options". Takes priority over the `label` attribute.
|
|
226
225
|
* - `ariaLabel.scroll.left`: Text that screen readers announce for the left scroll button, for example "Show earlier dates". Defaults to "Scroll Left".
|
|
227
226
|
* - `ariaLabel.scroll.right`: Text that screen readers announce for the right scroll button, for example "Show later dates". Defaults to "Scroll Right".
|
|
227
|
+
* - `ariaLabel`: Text that screen readers announce as the carousel's name, for example "Flight date options". Required unless you set the deprecated `label` attribute, and takes priority over it when both are set.
|
|
228
228
|
*
|
|
229
229
|
* ## Methods
|
|
230
230
|
*
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem-dev/auro-carousel",
|
|
10
|
-
"version": "0.0.0-pr142.
|
|
10
|
+
"version": "0.0.0-pr142.2",
|
|
11
11
|
"description": "auro-carousel HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|