@aurodesignsystem-dev/auro-banner 0.0.0-pr92.2 → 0.0.0-pr96.0
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 +93 -81
- package/demo/api.html +3 -4
- package/demo/api.md +238 -229
- package/demo/auro-banner.min.js +99 -22
- package/demo/index.html +2 -2
- package/demo/index.md +35 -122
- package/dist/{auro-banner-pP9c4Izh.js → auro-banner-B-yqrP_2.js} +2 -2
- package/dist/index.d.ts +217 -61
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +20 -12
package/README.md
CHANGED
|
@@ -31,17 +31,20 @@ The details are broken down into `prefix`, `title`, `description`, `action`, and
|
|
|
31
31
|
**Do not** use `<auro-banner>` as a primary source of information.
|
|
32
32
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Use Cases
|
|
35
35
|
|
|
36
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
37
|
-
|
|
36
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
37
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
38
|
+
Use the `<auro-banner>` element to:
|
|
38
39
|
|
|
40
|
+
* grab the attention of a user
|
|
41
|
+
* direct your user to another resource for further information
|
|
39
42
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
40
43
|
|
|
41
44
|
## Install
|
|
42
45
|
|
|
43
46
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
44
|
-
[](https://github.com/AlaskaAirlines/auro-banner/actions/workflows/release.yml)
|
|
45
48
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-banner)
|
|
46
49
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
47
50
|

|
|
@@ -52,17 +55,10 @@ $ npm i @aurodesignsystem/auro-banner
|
|
|
52
55
|
|
|
53
56
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
54
57
|
|
|
55
|
-
###
|
|
56
|
-
|
|
57
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
|
|
58
|
-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
59
|
-
|
|
60
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
61
|
-
|
|
62
|
-
### Define dependency in project component
|
|
58
|
+
### Define Dependency in Project
|
|
63
59
|
|
|
64
60
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
65
|
-
Defining the
|
|
61
|
+
Defining the dependency within each project that is using the `<auro-banner>` component.
|
|
66
62
|
|
|
67
63
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
68
64
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -72,19 +68,32 @@ import "@aurodesignsystem/auro-banner";
|
|
|
72
68
|
```
|
|
73
69
|
|
|
74
70
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
75
|
-
|
|
71
|
+
|
|
72
|
+
### Use CDN
|
|
73
|
+
|
|
74
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
75
|
+
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.
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-banner@latest/+esm"></script>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
82
|
+
|
|
83
|
+
## Basic Example
|
|
84
|
+
|
|
76
85
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
77
86
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
78
87
|
|
|
79
88
|
```html
|
|
80
89
|
<auro-banner billboard>
|
|
81
90
|
<picture slot="displayImage">
|
|
82
|
-
<source srcset="https://picsum.photos/id/
|
|
83
|
-
<source srcset="https://picsum.photos/id/
|
|
84
|
-
<source srcset="https://picsum.photos/id/
|
|
85
|
-
<source srcset="https://picsum.photos/id/
|
|
86
|
-
<source srcset="https://picsum.photos/id/
|
|
87
|
-
<img src="https://picsum.photos/id/
|
|
91
|
+
<source srcset="https://picsum.photos/id/196/1124/800" media="(min-width: 1024px)">
|
|
92
|
+
<source srcset="https://picsum.photos/id/196/1124/1000" media="(min-width: 768px)">
|
|
93
|
+
<source srcset="https://picsum.photos/id/196/736/750" media="(min-width: 736px)">
|
|
94
|
+
<source srcset="https://picsum.photos/id/196/736/1400" media="(min-width: 375px)">
|
|
95
|
+
<source srcset="https://picsum.photos/id/196/320/700" media="(min-width: 320px)">
|
|
96
|
+
<img src="https://picsum.photos/id/196/225/550" alt="" />
|
|
88
97
|
</picture>
|
|
89
98
|
<img
|
|
90
99
|
slot="contentImage"
|
|
@@ -94,8 +103,8 @@ import "@aurodesignsystem/auro-banner";
|
|
|
94
103
|
We’ll explain any additional costs before you book your car rental. More details on what’s included? Just check the Ts&Cs of any car.
|
|
95
104
|
</p>
|
|
96
105
|
<auro-hyperlink
|
|
97
|
-
cta
|
|
98
|
-
secondary
|
|
106
|
+
type="cta"
|
|
107
|
+
variant="secondary"
|
|
99
108
|
href="/"
|
|
100
109
|
slot="action"
|
|
101
110
|
target="_blank">
|
|
@@ -105,43 +114,74 @@ import "@aurodesignsystem/auro-banner";
|
|
|
105
114
|
```
|
|
106
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
107
116
|
|
|
108
|
-
##
|
|
117
|
+
## Custom Component Registration for Version Management
|
|
109
118
|
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
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.
|
|
120
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
112
121
|
|
|
113
|
-
|
|
114
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-banner@latest/+esm"></script>
|
|
115
|
-
```
|
|
122
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
116
123
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## auro-banner use cases
|
|
124
|
+
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.
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
123
|
-
Use the `<auro-banner>` element to:
|
|
126
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
124
127
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
128
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
129
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
```js
|
|
132
|
+
// Import the class only
|
|
133
|
+
import { AuroBanner } from '@aurodesignsystem/auro-banner/class';
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
// Register with a custom name if desired
|
|
136
|
+
AuroBanner.register('custom-banner');
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This will create a new custom element `<custom-banner>` that behaves exactly like `<auro-banner>`, allowing both sets of components to coexist on the same page without interfering with each other.
|
|
140
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
141
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
142
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
143
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
144
|
+
<custom-banner billboard>
|
|
145
|
+
<picture slot="displayImage">
|
|
146
|
+
<source srcset="https://picsum.photos/id/196/1124/800" media="(min-width: 1024px)">
|
|
147
|
+
<source srcset="https://picsum.photos/id/196/1124/1000" media="(min-width: 768px)">
|
|
148
|
+
<source srcset="https://picsum.photos/id/196/736/750" media="(min-width: 736px)">
|
|
149
|
+
<source srcset="https://picsum.photos/id/196/736/1400" media="(min-width: 375px)">
|
|
150
|
+
<source srcset="https://picsum.photos/id/196/320/700" media="(min-width: 320px)">
|
|
151
|
+
<img src="https://picsum.photos/id/196/225/550" alt="" />
|
|
152
|
+
</picture>
|
|
153
|
+
<img
|
|
154
|
+
slot="contentImage"
|
|
155
|
+
src="https://images.contentstack.io/v3/assets/blt2cefe12c88e9dd91/bltc1fa673bb196d177/6633f3de693c294c708b20de/oneworld-travel-bright-Horizontal-300.png"
|
|
156
|
+
alt="Random insert"/>
|
|
157
|
+
<p slot="description">
|
|
158
|
+
We’ll explain any additional costs before you book your car rental. More details on what’s included? Just check the Ts&Cs of any car.
|
|
159
|
+
</p>
|
|
160
|
+
<auro-hyperlink
|
|
161
|
+
type="cta"
|
|
162
|
+
variant="secondary"
|
|
163
|
+
href="/"
|
|
164
|
+
slot="action"
|
|
165
|
+
target="_blank">
|
|
166
|
+
More info
|
|
167
|
+
</auro-hyperlink>
|
|
168
|
+
</custom-banner>
|
|
169
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
170
|
+
</div>
|
|
171
|
+
<auro-accordion alignRight>
|
|
172
|
+
<span slot="trigger">See code</span>
|
|
173
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
174
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
135
175
|
|
|
136
176
|
```html
|
|
137
|
-
<
|
|
177
|
+
<custom-banner billboard>
|
|
138
178
|
<picture slot="displayImage">
|
|
139
|
-
<source srcset="https://picsum.photos/id/
|
|
140
|
-
<source srcset="https://picsum.photos/id/
|
|
141
|
-
<source srcset="https://picsum.photos/id/
|
|
142
|
-
<source srcset="https://picsum.photos/id/
|
|
143
|
-
<source srcset="https://picsum.photos/id/
|
|
144
|
-
<img src="https://picsum.photos/id/
|
|
179
|
+
<source srcset="https://picsum.photos/id/196/1124/800" media="(min-width: 1024px)">
|
|
180
|
+
<source srcset="https://picsum.photos/id/196/1124/1000" media="(min-width: 768px)">
|
|
181
|
+
<source srcset="https://picsum.photos/id/196/736/750" media="(min-width: 736px)">
|
|
182
|
+
<source srcset="https://picsum.photos/id/196/736/1400" media="(min-width: 375px)">
|
|
183
|
+
<source srcset="https://picsum.photos/id/196/320/700" media="(min-width: 320px)">
|
|
184
|
+
<img src="https://picsum.photos/id/196/225/550" alt="" />
|
|
145
185
|
</picture>
|
|
146
186
|
<img
|
|
147
187
|
slot="contentImage"
|
|
@@ -151,42 +191,14 @@ Use the `<auro-banner>` element to:
|
|
|
151
191
|
We’ll explain any additional costs before you book your car rental. More details on what’s included? Just check the Ts&Cs of any car.
|
|
152
192
|
</p>
|
|
153
193
|
<auro-hyperlink
|
|
154
|
-
cta
|
|
155
|
-
secondary
|
|
194
|
+
type="cta"
|
|
195
|
+
variant="secondary"
|
|
156
196
|
href="/"
|
|
157
197
|
slot="action"
|
|
158
198
|
target="_blank">
|
|
159
199
|
More info
|
|
160
200
|
</auro-hyperlink>
|
|
161
|
-
</
|
|
201
|
+
</custom-banner>
|
|
162
202
|
```
|
|
163
203
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
164
|
-
|
|
165
|
-
## Development
|
|
166
|
-
|
|
167
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
|
|
168
|
-
In order to develop against this project, if you are not part of the core team, you will be required to fork the project prior to submitting a pull request.
|
|
169
|
-
|
|
170
|
-
Please be sure to review the [contribution guidelines](https://auro.alaskaair.com/contributing) for this project. Please make sure to **pay special attention** to the **conventional commits** section of the document.
|
|
171
|
-
|
|
172
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
173
|
-
|
|
174
|
-
### Start development environment
|
|
175
|
-
|
|
176
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
|
|
177
|
-
Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the **dev server**.
|
|
178
|
-
|
|
179
|
-
```shell
|
|
180
|
-
$ npm run dev
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
Open [localhost:8000](http://localhost:8000/)
|
|
184
|
-
|
|
185
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
186
|
-
|
|
187
|
-
### Testing
|
|
188
|
-
|
|
189
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
|
|
190
|
-
Automated tests are required for every Auro component. See `.\test\auro-banner.test.js` for the tests for this component. Run `npm run test` to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See [the testing documentation](https://auro.alaskaair.com/support/tests) for more details.
|
|
191
|
-
|
|
192
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
204
|
+
</auro-accordion>
|
package/demo/api.html
CHANGED
|
@@ -51,9 +51,8 @@
|
|
|
51
51
|
<script type="module" data-demo-script="true" src="./api.min.js"></script>
|
|
52
52
|
|
|
53
53
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest
|
|
56
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-
|
|
57
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/dist/auro-hyperlink__bundled.js" type="module"></script>
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
|
|
56
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
58
57
|
</body>
|
|
59
58
|
</html>
|