@aurodesignsystem-dev/auro-carousel 0.0.0-pr140.0 → 0.0.0-pr142.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/demo/readme.md ADDED
@@ -0,0 +1,164 @@
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
+ # Carousel
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-carousel>` is an [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) that displays a group of elements in a scrollable container.
25
+ <!-- AURO-GENERATED-CONTENT:END -->
26
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
27
+ <!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
28
+ <!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
29
+ <!-- AURO-GENERATED-CONTENT:END -->
30
+
31
+ ## Use cases
32
+
33
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
34
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
35
+ Use `<auro-carousel>` when people need to:
36
+
37
+ * Scroll through flight date options or shoulder dates
38
+ * Scroll through images
39
+ <!-- AURO-GENERATED-CONTENT:END -->
40
+
41
+ ## Install
42
+
43
+ <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
44
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-carousel/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-carousel/actions/workflows/release.yml)
45
+ [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-carousel?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-carousel)
46
+ [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-carousel?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
47
+ ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
48
+
49
+ <pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-carousel</code></pre>
50
+
51
+ <!-- AURO-GENERATED-CONTENT:END -->
52
+
53
+ ### Define dependency in project
54
+
55
+ <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
56
+ Import the component in each project that uses `<auro-carousel>`.
57
+
58
+ <!-- AURO-GENERATED-CONTENT:END -->
59
+ <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
60
+
61
+ <pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-carousel";</code></pre>
62
+
63
+ <!-- AURO-GENERATED-CONTENT:END -->
64
+
65
+ ### Use CDN
66
+
67
+ <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
68
+ If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
69
+
70
+ <pre class="language-html"><code class="language-html">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-carousel@latest/+esm"&gt;&lt;/script&gt;</code></pre>
71
+
72
+ <!-- AURO-GENERATED-CONTENT:END -->
73
+
74
+ ## Basic example
75
+
76
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
77
+ <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
78
+
79
+ <pre class="language-html"><code class="language-html">&lt;auro-carousel&gt;
80
+ &lt;span slot="ariaLabel"&gt;Flight date options&lt;/span&gt;
81
+ &lt;auro-pane date="2020-10-10" price="$435"&gt;&lt;/auro-pane&gt;
82
+ &lt;auro-pane date="2020-10-11" price="$435"&gt;&lt;/auro-pane&gt;
83
+ &lt;auro-pane date="2020-10-12" price="$435"&gt;&lt;/auro-pane&gt;
84
+ &lt;auro-pane date="2020-10-13" price="$435"&gt;&lt;/auro-pane&gt;
85
+ &lt;auro-pane date="2020-10-14" price="$435"&gt;&lt;/auro-pane&gt;
86
+ &lt;auro-pane date="2020-10-15" price="$435"&gt;&lt;/auro-pane&gt;
87
+ &lt;auro-pane date="2020-10-16" price="$435"&gt;&lt;/auro-pane&gt;
88
+ &lt;auro-pane date="2020-10-17" price="$435"&gt;&lt;/auro-pane&gt;
89
+ &lt;auro-pane date="2020-10-18" selected price="$435"&gt;&lt;/auro-pane&gt;
90
+ &lt;auro-pane date="2020-10-19" price="$435"&gt;&lt;/auro-pane&gt;
91
+ &lt;auro-pane date="2020-10-20" price="$435"&gt;&lt;/auro-pane&gt;
92
+ &lt;auro-pane date="2020-10-21" price="$435"&gt;&lt;/auro-pane&gt;
93
+ &lt;auro-pane date="2020-10-22" price="$435"&gt;&lt;/auro-pane&gt;
94
+ &lt;auro-pane date="2020-10-23" price="$435"&gt;&lt;/auro-pane&gt;
95
+ &lt;/auro-carousel&gt;</code></pre>
96
+ <!-- AURO-GENERATED-CONTENT:END -->
97
+
98
+ ## Custom component registration for version management
99
+
100
+ Every Auro component has two key parts: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
101
+ The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
102
+
103
+ Installing the component as described in the Install section imports the class and registers the component globally for you.
104
+
105
+ 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), register the class manually under a custom element name to avoid conflicts.
106
+
107
+ To do this, import only the component class and call the `register(name)` method with a unique name:
108
+
109
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
110
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
111
+
112
+ <pre class="language-js"><code class="language-js">// Import the class only
113
+ import { AuroCarousel } from '@aurodesignsystem/auro-carousel/class';
114
+ &#10;// Register with a custom name if desired
115
+ AuroCarousel.register('custom-carousel');</code></pre>
116
+
117
+ This creates a new custom element `<custom-carousel>` that behaves like `<auro-carousel>`, so both can be on the same page without interfering with each other.
118
+ <!-- AURO-GENERATED-CONTENT:END -->
119
+ <div class="exampleWrapper exampleWrapper--flex">
120
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
121
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
122
+ <custom-carousel scrollDistance="420" id="demo1">
123
+ <span slot="ariaLabel">Flight date options</span>
124
+ <auro-pane date="2020-10-10" price="$435"></auro-pane>
125
+ <auro-pane date="2020-10-11" price="$435"></auro-pane>
126
+ <auro-pane date="2020-10-12" price="$435"></auro-pane>
127
+ <auro-pane date="2020-10-13" selected price="$435"></auro-pane>
128
+ <auro-pane date="2020-10-14" price="$435" disabled></auro-pane>
129
+ <auro-pane date="2020-10-15" price="$435"></auro-pane>
130
+ <auro-pane date="2020-10-16" price="$435"></auro-pane>
131
+ <auro-pane date="2020-10-17" price="$435"></auro-pane>
132
+ <auro-pane date="2020-10-18" price="$435"></auro-pane>
133
+ <auro-pane date="2020-10-19" price="$435"></auro-pane>
134
+ <auro-pane date="2020-10-20" price="$435"></auro-pane>
135
+ <auro-pane date="2020-10-21" price="$435"></auro-pane>
136
+ <auro-pane date="2020-10-22" price="$435"></auro-pane>
137
+ <auro-pane date="2020-10-23" price="$435"></auro-pane>
138
+ </custom-carousel>
139
+ <!-- AURO-GENERATED-CONTENT:END -->
140
+ </div>
141
+ <auro-accordion alignRight>
142
+ <span slot="trigger">See code</span>
143
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
144
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
145
+
146
+ <pre class="language-html"><code class="language-html">&lt;custom-carousel scrollDistance="420" id="demo1"&gt;
147
+ &lt;span slot="ariaLabel"&gt;Flight date options&lt;/span&gt;
148
+ &lt;auro-pane date="2020-10-10" price="$435"&gt;&lt;/auro-pane&gt;
149
+ &lt;auro-pane date="2020-10-11" price="$435"&gt;&lt;/auro-pane&gt;
150
+ &lt;auro-pane date="2020-10-12" price="$435"&gt;&lt;/auro-pane&gt;
151
+ &lt;auro-pane date="2020-10-13" selected price="$435"&gt;&lt;/auro-pane&gt;
152
+ &lt;auro-pane date="2020-10-14" price="$435" disabled&gt;&lt;/auro-pane&gt;
153
+ &lt;auro-pane date="2020-10-15" price="$435"&gt;&lt;/auro-pane&gt;
154
+ &lt;auro-pane date="2020-10-16" price="$435"&gt;&lt;/auro-pane&gt;
155
+ &lt;auro-pane date="2020-10-17" price="$435"&gt;&lt;/auro-pane&gt;
156
+ &lt;auro-pane date="2020-10-18" price="$435"&gt;&lt;/auro-pane&gt;
157
+ &lt;auro-pane date="2020-10-19" price="$435"&gt;&lt;/auro-pane&gt;
158
+ &lt;auro-pane date="2020-10-20" price="$435"&gt;&lt;/auro-pane&gt;
159
+ &lt;auro-pane date="2020-10-21" price="$435"&gt;&lt;/auro-pane&gt;
160
+ &lt;auro-pane date="2020-10-22" price="$435"&gt;&lt;/auro-pane&gt;
161
+ &lt;auro-pane date="2020-10-23" price="$435"&gt;&lt;/auro-pane&gt;
162
+ &lt;/custom-carousel&gt;</code></pre>
163
+ <!-- AURO-GENERATED-CONTENT:END -->
164
+ </auro-accordion>