@aurodesignsystem-dev/auro-banner 0.0.0-pr133.0 → 0.0.0-pr135.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 +79 -92
- package/demo/api.md +356 -352
- package/demo/api.min.js +491 -1
- package/demo/index.md +45 -47
- package/demo/index.min.js +491 -1
- package/demo/readme.md +191 -0
- package/dist/auro-banner-h7byfbT1.js +54 -0
- package/dist/index.d.ts +228 -91
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +8 -8
- package/demo/auro-banner.min.js +0 -457
- package/dist/auro-banner-B-yqrP_2.js +0 -54
package/README.md
CHANGED
|
@@ -12,26 +12,26 @@ The following sections are editable by making changes to the following files:
|
|
|
12
12
|
| SECTION | DESCRIPTION | FILE LOCATION |
|
|
13
13
|
|------------------------|---------------------------------------------------|-------------------------------------|
|
|
14
14
|
| Description | Description of the component | `./docs/partials/description.md` |
|
|
15
|
-
| Use
|
|
16
|
-
| Additional
|
|
17
|
-
| Component
|
|
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
18
|
-->
|
|
19
19
|
|
|
20
20
|
# Banner
|
|
21
21
|
|
|
22
22
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
|
-
The `<auro-banner>` element
|
|
24
|
+
The `<auro-banner>` element highlights a short message to draw attention or point people to more information. A banner combines an image with text, and the layout decides which parts it shows.
|
|
25
25
|
|
|
26
|
-
The
|
|
26
|
+
The text goes in the `prefix`, `title`, `description`, `action`, and `disclaimer` slots.
|
|
27
27
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
28
28
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
29
29
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
30
30
|
<!-- 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. -->
|
|
31
|
-
**
|
|
31
|
+
**Don't** use `<auro-banner>` as the main source of information on a page.
|
|
32
32
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
33
33
|
|
|
34
|
-
## Use
|
|
34
|
+
## Use cases
|
|
35
35
|
|
|
36
36
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
37
37
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
@@ -49,156 +49,143 @@ Use the `<auro-banner>` element to:
|
|
|
49
49
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
50
50
|

|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
$ npm i @aurodesignsystem/auro-banner
|
|
54
|
-
```
|
|
52
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-banner</code></pre>
|
|
55
53
|
|
|
56
54
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
57
55
|
|
|
58
|
-
### Define
|
|
56
|
+
### Define dependency in project
|
|
59
57
|
|
|
60
58
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
61
|
-
|
|
59
|
+
Import the component in each project that uses `<auro-banner>`.
|
|
62
60
|
|
|
63
61
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
64
62
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
import "@aurodesignsystem/auro-banner";
|
|
68
|
-
```
|
|
64
|
+
<pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-banner";</code></pre>
|
|
69
65
|
|
|
70
66
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
71
67
|
|
|
72
68
|
### Use CDN
|
|
73
69
|
|
|
74
70
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
75
|
-
|
|
71
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-banner@latest/+esm"></script>
|
|
79
|
-
```
|
|
73
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-banner@latest/+esm"></script></code></pre>
|
|
80
74
|
|
|
81
75
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
82
76
|
|
|
83
|
-
## Basic
|
|
77
|
+
## Basic example
|
|
84
78
|
|
|
85
79
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
86
80
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<img
|
|
82
|
+
<pre class="language-html"><code class="language-html"><auro-banner billboard>
|
|
83
|
+
<picture slot="displayImage">
|
|
84
|
+
<source srcset="https://picsum.photos/id/196/1124/800" media="(min-width: 1024px)">
|
|
85
|
+
<source srcset="https://picsum.photos/id/196/1124/1000" media="(min-width: 768px)">
|
|
86
|
+
<source srcset="https://picsum.photos/id/196/736/750" media="(min-width: 736px)">
|
|
87
|
+
<source srcset="https://picsum.photos/id/196/736/1400" media="(min-width: 375px)">
|
|
88
|
+
<source srcset="https://picsum.photos/id/196/320/700" media="(min-width: 320px)">
|
|
89
|
+
<img src="https://picsum.photos/id/196/225/550" alt="" />
|
|
90
|
+
</picture>
|
|
91
|
+
<img
|
|
99
92
|
slot="contentImage"
|
|
100
93
|
src="https://images.contentstack.io/v3/assets/blt2cefe12c88e9dd91/bltc1fa673bb196d177/6633f3de693c294c708b20de/oneworld-travel-bright-Horizontal-300.png"
|
|
101
|
-
alt="
|
|
102
|
-
|
|
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.
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
alt="oneworld"/>
|
|
95
|
+
<p slot="description">
|
|
96
|
+
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.
|
|
97
|
+
</p>
|
|
98
|
+
<auro-hyperlink
|
|
106
99
|
type="cta"
|
|
107
100
|
variant="secondary"
|
|
108
101
|
href="/"
|
|
109
102
|
slot="action"
|
|
110
|
-
target="_blank"
|
|
103
|
+
target="_blank">
|
|
111
104
|
More info
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```
|
|
105
|
+
</auro-hyperlink>
|
|
106
|
+
</auro-banner></code></pre>
|
|
115
107
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
108
|
|
|
117
|
-
## Custom
|
|
109
|
+
## Custom component registration for version management
|
|
118
110
|
|
|
119
|
-
|
|
111
|
+
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.
|
|
120
112
|
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
121
113
|
|
|
122
|
-
|
|
114
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
123
115
|
|
|
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),
|
|
116
|
+
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.
|
|
125
117
|
|
|
126
|
-
|
|
118
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
127
119
|
|
|
128
120
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
129
121
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
130
122
|
|
|
131
|
-
|
|
132
|
-
// Import the class only
|
|
123
|
+
<pre class="language-js"><code class="language-js">// Import the class only
|
|
133
124
|
import { AuroBanner } from '@aurodesignsystem/auro-banner/class';
|
|
125
|
+
// Register with a custom name if desired
|
|
126
|
+
AuroBanner.register('custom-banner');</code></pre>
|
|
134
127
|
|
|
135
|
-
|
|
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.
|
|
128
|
+
This creates a `<custom-banner>` element that works exactly like `<auro-banner>`, so both can be used on the same page without affecting each other.
|
|
140
129
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
141
130
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
131
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
132
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
133
|
+
<custom-banner billboard>
|
|
134
|
+
<picture slot="displayImage">
|
|
135
|
+
<source srcset="https://picsum.photos/id/196/1124/800" media="(min-width: 1024px)">
|
|
136
|
+
<source srcset="https://picsum.photos/id/196/1124/1000" media="(min-width: 768px)">
|
|
137
|
+
<source srcset="https://picsum.photos/id/196/736/750" media="(min-width: 736px)">
|
|
138
|
+
<source srcset="https://picsum.photos/id/196/736/1400" media="(min-width: 375px)">
|
|
139
|
+
<source srcset="https://picsum.photos/id/196/320/700" media="(min-width: 320px)">
|
|
140
|
+
<img src="https://picsum.photos/id/196/225/550" alt="" />
|
|
141
|
+
</picture>
|
|
142
|
+
<img
|
|
154
143
|
slot="contentImage"
|
|
155
144
|
src="https://images.contentstack.io/v3/assets/blt2cefe12c88e9dd91/bltc1fa673bb196d177/6633f3de693c294c708b20de/oneworld-travel-bright-Horizontal-300.png"
|
|
156
|
-
alt="
|
|
157
|
-
|
|
145
|
+
alt="oneworld"/>
|
|
146
|
+
<p slot="description">
|
|
158
147
|
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
|
-
|
|
160
|
-
|
|
148
|
+
</p>
|
|
149
|
+
<auro-hyperlink
|
|
161
150
|
type="cta"
|
|
162
151
|
variant="secondary"
|
|
163
152
|
href="/"
|
|
164
153
|
slot="action"
|
|
165
154
|
target="_blank">
|
|
166
155
|
More info
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
156
|
+
</auro-hyperlink>
|
|
157
|
+
</custom-banner>
|
|
158
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
170
159
|
</div>
|
|
171
160
|
<auro-accordion alignRight>
|
|
172
|
-
|
|
161
|
+
<span slot="trigger">See code</span>
|
|
173
162
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
174
163
|
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
175
164
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<img
|
|
165
|
+
<pre class="language-html"><code class="language-html"><custom-banner billboard>
|
|
166
|
+
<picture slot="displayImage">
|
|
167
|
+
<source srcset="https://picsum.photos/id/196/1124/800" media="(min-width: 1024px)">
|
|
168
|
+
<source srcset="https://picsum.photos/id/196/1124/1000" media="(min-width: 768px)">
|
|
169
|
+
<source srcset="https://picsum.photos/id/196/736/750" media="(min-width: 736px)">
|
|
170
|
+
<source srcset="https://picsum.photos/id/196/736/1400" media="(min-width: 375px)">
|
|
171
|
+
<source srcset="https://picsum.photos/id/196/320/700" media="(min-width: 320px)">
|
|
172
|
+
<img src="https://picsum.photos/id/196/225/550" alt="" />
|
|
173
|
+
</picture>
|
|
174
|
+
<img
|
|
187
175
|
slot="contentImage"
|
|
188
176
|
src="https://images.contentstack.io/v3/assets/blt2cefe12c88e9dd91/bltc1fa673bb196d177/6633f3de693c294c708b20de/oneworld-travel-bright-Horizontal-300.png"
|
|
189
|
-
alt="
|
|
190
|
-
|
|
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.
|
|
192
|
-
|
|
193
|
-
|
|
177
|
+
alt="oneworld"/>
|
|
178
|
+
<p slot="description">
|
|
179
|
+
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.
|
|
180
|
+
</p>
|
|
181
|
+
<auro-hyperlink
|
|
194
182
|
type="cta"
|
|
195
183
|
variant="secondary"
|
|
196
184
|
href="/"
|
|
197
185
|
slot="action"
|
|
198
|
-
target="_blank"
|
|
186
|
+
target="_blank">
|
|
199
187
|
More info
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
```
|
|
188
|
+
</auro-hyperlink>
|
|
189
|
+
</custom-banner></code></pre>
|
|
203
190
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
204
191
|
</auro-accordion>
|