@aurodesignsystem-dev/auro-slideshow 0.0.0-pr78.0 → 0.0.0-pr79.1
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/README.md +48 -61
- package/custom-elements.json +643 -0
- package/demo/api.md +539 -565
- package/demo/api.min.js +3349 -1
- package/demo/index.md +76 -80
- package/demo/index.min.js +3349 -1
- package/demo/readme.md +168 -0
- package/dist/{auro-slideshow-B2IA2NHn.js → auro-slideshow-Di9AtYIy.js} +5 -5
- package/dist/index.d.ts +237 -107
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +5 -3
- package/demo/auro-slideshow.min.js +0 -3341
package/demo/readme.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The README.md file is a compiled document. No edits should be made directly to this file.
|
|
3
|
+
|
|
4
|
+
README.md is created by running `npm run build:docs`.
|
|
5
|
+
|
|
6
|
+
This file is generated based on a template fetched from
|
|
7
|
+
`https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/README.md`
|
|
8
|
+
and copied to `./componentDocs/README.md` each time the docs are compiled.
|
|
9
|
+
|
|
10
|
+
The following sections are editable by making changes to the following files:
|
|
11
|
+
|
|
12
|
+
| SECTION | DESCRIPTION | FILE LOCATION |
|
|
13
|
+
|------------------------|---------------------------------------------------|-------------------------------------|
|
|
14
|
+
| Description | Description of the component | `./docs/partials/description.md` |
|
|
15
|
+
| Use Cases | Examples for when to use this component | `./docs/partials/useCases.md` |
|
|
16
|
+
| Additional Information | For use to add any component specific information | `./docs/partials/readmeAddlInfo.md` |
|
|
17
|
+
| Component Example Code | HTML sample code of the components use | `./apiExamples/basic.html` |
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
# Slideshow
|
|
21
|
+
|
|
22
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
|
+
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
|
+
`<auro-slideshow>` is an [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) for the purpose of displaying a sequence of slides, which can automatically advance through the content or be manually controlled by the user.
|
|
25
|
+
|
|
26
|
+
The `<auro-slideshow>` element is a wrapper element. All slides are slotted content and must be direct children of the element. Slides must have assigned `width` and `height` properties to display properly.
|
|
27
|
+
|
|
28
|
+
`<auro-slideshow>` is a fully customizable element and does not come with any features turned on by default. The features of `<auro-slideshow>` are turned on by including the proper attributes on the element.
|
|
29
|
+
|
|
30
|
+
**Note:** If all the slides can fit on the screen at once, the slideshow will not activate.
|
|
31
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
32
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
33
|
+
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
34
|
+
|
|
35
|
+
### Properties usage
|
|
36
|
+
|
|
37
|
+
`autoplay` and `autoScroll` are mutually exclusive properties and should not be used together on the same component instance.
|
|
38
|
+
|
|
39
|
+
Both `navigation` and `pagination` can be used together, but at least one must be used to give users a clear way to control the slides manually.
|
|
40
|
+
|
|
41
|
+
### Mobile behavior
|
|
42
|
+
|
|
43
|
+
On mobile devices, `autoScroll` and `navigation` controls are automatically disabled. Users can navigate the slideshow by swiping left or right.
|
|
44
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
45
|
+
|
|
46
|
+
## Use Cases
|
|
47
|
+
|
|
48
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
49
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
50
|
+
The `<auro-slideshow>` element should be used in situations where:
|
|
51
|
+
|
|
52
|
+
* A series of images or content needs to be displayed in a space-saving way
|
|
53
|
+
* Autoplaying or autoscrolling functionality is needed
|
|
54
|
+
* A current slide indicator is required
|
|
55
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
60
|
+
[](https://github.com/AlaskaAirlines/auro-slideshow/actions/workflows/release.yml)
|
|
61
|
+
[](https://www.npmjs.com/package/@aurodesignsystem/auro-slideshow)
|
|
62
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-slideshow</code></pre>
|
|
66
|
+
|
|
67
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
68
|
+
|
|
69
|
+
### Define Dependency in Project
|
|
70
|
+
|
|
71
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
72
|
+
Defining the dependency within each project that is using the `<auro-slideshow>` component.
|
|
73
|
+
|
|
74
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
75
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
76
|
+
|
|
77
|
+
<pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-slideshow";</code></pre>
|
|
78
|
+
|
|
79
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
80
|
+
|
|
81
|
+
### Use CDN
|
|
82
|
+
|
|
83
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
84
|
+
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
85
|
+
|
|
86
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-slideshow@latest/+esm"></script></code></pre>
|
|
87
|
+
|
|
88
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
89
|
+
|
|
90
|
+
## Basic Example
|
|
91
|
+
|
|
92
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
93
|
+
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
94
|
+
|
|
95
|
+
<pre class="language-html"><code class="language-html"><auro-slideshow>
|
|
96
|
+
<div style="height: 480px">
|
|
97
|
+
<img style="object-fit: cover;" src="https://picsum.photos/1000/480?random=1" alt="Random image 1">
|
|
98
|
+
</div>
|
|
99
|
+
<div style="height: 480px">
|
|
100
|
+
<img style="object-fit: cover;" src="https://picsum.photos/1000/480?random=2" alt="Random image 2">
|
|
101
|
+
</div>
|
|
102
|
+
<div style="height: 480px">
|
|
103
|
+
<img style="object-fit: cover;" src="https://picsum.photos/1000/480?random=3" alt="Random image 3">
|
|
104
|
+
</div>
|
|
105
|
+
<div style="height: 480px">
|
|
106
|
+
<img style="object-fit: cover;" src="https://picsum.photos/1000/480?random=4" alt="Random image 4">
|
|
107
|
+
</div>
|
|
108
|
+
<div style="height: 480px">
|
|
109
|
+
<img style="object-fit: cover;" src="https://picsum.photos/1000/480?random=5" alt="Random image 5">
|
|
110
|
+
</div>
|
|
111
|
+
</auro-slideshow></code></pre>
|
|
112
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
|
+
|
|
114
|
+
## Custom Component Registration for Version Management
|
|
115
|
+
|
|
116
|
+
There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
|
|
117
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
118
|
+
|
|
119
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
120
|
+
|
|
121
|
+
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
|
|
122
|
+
|
|
123
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
124
|
+
|
|
125
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
126
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
127
|
+
|
|
128
|
+
<pre class="language-js"><code class="language-js">// Import the class only
|
|
129
|
+
import { AuroSlideshow } from '@aurodesignsystem/auro-slideshow/class';
|
|
130
|
+
// Register with a custom name if desired
|
|
131
|
+
AuroSlideshow.register('custom-slideshow');</code></pre>
|
|
132
|
+
|
|
133
|
+
This will create a new custom element `<custom-slideshow>` that behaves exactly like `<auro-slideshow>`, allowing both to coexist on the same page without interfering with each other.
|
|
134
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
135
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
136
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
137
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
138
|
+
<custom-slideshow navigation>
|
|
139
|
+
<div style="width: 400px; border: 2px solid #000; display: flex; justify-content: center;">
|
|
140
|
+
<p>Slide 1</p>
|
|
141
|
+
</div>
|
|
142
|
+
<div style="width: 400px; border: 2px solid #000; display: flex; justify-content: center;">
|
|
143
|
+
<p>Slide 2</p>
|
|
144
|
+
</div>
|
|
145
|
+
<div style="width: 400px; border: 2px solid #000; display: flex; justify-content: center;">
|
|
146
|
+
<p>Slide 3</p>
|
|
147
|
+
</div>
|
|
148
|
+
</custom-slideshow>
|
|
149
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
150
|
+
</div>
|
|
151
|
+
<auro-accordion alignRight>
|
|
152
|
+
<span slot="trigger">See code</span>
|
|
153
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
154
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
155
|
+
|
|
156
|
+
<pre class="language-html"><code class="language-html"><custom-slideshow navigation>
|
|
157
|
+
<div style="width: 400px; border: 2px solid #000; display: flex; justify-content: center;">
|
|
158
|
+
<p>Slide 1</p>
|
|
159
|
+
</div>
|
|
160
|
+
<div style="width: 400px; border: 2px solid #000; display: flex; justify-content: center;">
|
|
161
|
+
<p>Slide 2</p>
|
|
162
|
+
</div>
|
|
163
|
+
<div style="width: 400px; border: 2px solid #000; display: flex; justify-content: center;">
|
|
164
|
+
<p>Slide 3</p>
|
|
165
|
+
</div>
|
|
166
|
+
</custom-slideshow></code></pre>
|
|
167
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
168
|
+
</auro-accordion>
|