@aurodesignsystem-dev/auro-alert 0.0.0-pr123.0 → 0.0.0-pr124.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 +17 -17
- package/demo/api.md +50 -41
- package/demo/api.min.js +48 -30
- package/demo/index.md +11 -9
- package/demo/index.min.js +48 -30
- package/demo/readme.md +17 -17
- package/dist/{auro-alert-Cxqj9ihp.js → auro-alert-BUDoiSly.js} +7 -7
- package/dist/index.d.ts +50 -40
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +6 -8
- package/custom-elements.json +0 -245
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ 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
|
# Alert
|
|
@@ -28,13 +28,13 @@ The `auro-alert` component renders inline notifications with automatic styling b
|
|
|
28
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
29
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
30
30
|
|
|
31
|
-
## Use
|
|
31
|
+
## Use cases
|
|
32
32
|
|
|
33
33
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
34
34
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
35
|
-
|
|
35
|
+
Use `auro-alert` to:
|
|
36
36
|
|
|
37
|
-
*
|
|
37
|
+
* Communicate important, time-sensitive, or state-changing information to users.
|
|
38
38
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
39
39
|
|
|
40
40
|
## Install
|
|
@@ -49,10 +49,10 @@ The `auro-alert` element should be used:
|
|
|
49
49
|
|
|
50
50
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
51
51
|
|
|
52
|
-
### Define
|
|
52
|
+
### Define dependency in project
|
|
53
53
|
|
|
54
54
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
55
|
-
|
|
55
|
+
Import the component in each project that uses `<auro-alert>`.
|
|
56
56
|
|
|
57
57
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
58
58
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -64,30 +64,30 @@ Defining the dependency within each project that is using the `<auro-alert>` com
|
|
|
64
64
|
### Use CDN
|
|
65
65
|
|
|
66
66
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
67
|
-
|
|
67
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
68
68
|
|
|
69
69
|
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-alert@latest/+esm"></script></code></pre>
|
|
70
70
|
|
|
71
71
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
72
72
|
|
|
73
|
-
## Basic
|
|
73
|
+
## Basic example
|
|
74
74
|
|
|
75
75
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
76
76
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
77
77
|
|
|
78
|
-
<pre class="language-html"><code class="language-html"><auro-alert>This is a default
|
|
78
|
+
<pre class="language-html"><code class="language-html"><auro-alert>This is a default alert with no type set.</auro-alert></code></pre>
|
|
79
79
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
80
80
|
|
|
81
|
-
## Custom
|
|
81
|
+
## Custom component registration for version management
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
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.
|
|
84
84
|
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
87
87
|
|
|
88
|
-
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),
|
|
88
|
+
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.
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
91
91
|
|
|
92
92
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
93
93
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
@@ -97,7 +97,7 @@ import { AuroAlert } from '@aurodesignsystem/auro-alert/class';
|
|
|
97
97
|
// Register with a custom name if desired
|
|
98
98
|
AuroAlert.register('custom-alert');</code></pre>
|
|
99
99
|
|
|
100
|
-
This
|
|
100
|
+
This creates a `<custom-alert>` element that behaves exactly like `<auro-alert>`, so both can exist on the same page without interfering with each other.
|
|
101
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
102
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
103
103
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
package/demo/api.md
CHANGED
|
@@ -3,23 +3,32 @@
|
|
|
3
3
|
|
|
4
4
|
# auro-alert
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Shows an inline message that gives feedback about a user action, such as an error, success, warning, or information message.
|
|
7
|
+
|
|
8
|
+
**Key capabilities**
|
|
9
|
+
- **Alert types**: Set `type` to `error`, `information`, `success`, or `warning` to change the icon and border color.
|
|
10
|
+
- **Optional icon**: Set `noIcon` to remove the icon.
|
|
11
|
+
- **Hiding**: Set `hidden` to hide the alert from everyone, `hiddenVisually` to hide it visually but keep it available to screen readers, or `hiddenAudible` to keep it visible but hidden from screen readers.
|
|
12
|
+
- **Custom content**: The default slot accepts any content, and each `<p>` tag starts a new line.
|
|
13
|
+
|
|
14
|
+
**Example**
|
|
15
|
+
<pre class="language-html"><code class="language-html"><auro-alert type="success">Your changes are saved.</auro-alert></code></pre>
|
|
7
16
|
|
|
8
|
-
### Properties
|
|
17
|
+
### Properties and attributes
|
|
9
18
|
|
|
10
|
-
| Properties | Attributes | Modifiers | Type | Default | Description
|
|
11
|
-
| -------------- | -------------- | --------- | -------------------------------------------------- | ------- |
|
|
12
|
-
| hidden | hidden | | boolean | |
|
|
13
|
-
| hiddenAudible |
|
|
14
|
-
| hiddenVisually |
|
|
15
|
-
| noIcon |
|
|
16
|
-
| type | type | | `information` \| `error` \| `success` \| `warning` | |
|
|
19
|
+
| Properties | Attributes | Modifiers | Type | Default | Relevant when | Description |
|
|
20
|
+
| -------------- | -------------- | --------- | -------------------------------------------------- | ------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| hidden | hidden | | boolean | | | Hides the alert both visually and from screen readers. |
|
|
22
|
+
| hiddenAudible | hiddenAudible | | boolean | | | Hides the alert from screen readers while keeping it visible. |
|
|
23
|
+
| hiddenVisually | hiddenVisually | | boolean | | | Hides the alert visually while keeping it available to screen readers. |
|
|
24
|
+
| noIcon | noIcon | | boolean | | `type` | Removes the icon from the alert. Applies only when `type` is set, because an alert without a type has no icon. |
|
|
25
|
+
| type | type | | `information` \| `error` \| `success` \| `warning` | | | Sets the alert's purpose, which controls its icon and border color: `error`, `warning`, `success`, or `information`. Without a value, the alert shows no icon and uses a default border color. |
|
|
17
26
|
|
|
18
27
|
### Methods
|
|
19
28
|
|
|
20
|
-
| Name | Parameters
|
|
21
|
-
| -------- |
|
|
22
|
-
| register | `name` (string) - The name
|
|
29
|
+
| Name | Parameters | Return | Description |
|
|
30
|
+
| -------- | ------------------------------------------------------------- | ------ | -------------------------------------------------------- |
|
|
31
|
+
| register | `name` (string) - The tag name to register the element under. | | Registers the element with the browser under a tag name. |
|
|
23
32
|
|
|
24
33
|
### Slots
|
|
25
34
|
|
|
@@ -27,12 +36,12 @@ The `auro-alert` element is used to provide contextual feedback messages for typ
|
|
|
27
36
|
| --------- | ---------------------------------------------------------------------------------------- |
|
|
28
37
|
| (default) | Provide text for the alert. If using multiple lines, separate each line with `<p>` tags. |
|
|
29
38
|
|
|
30
|
-
### CSS
|
|
39
|
+
### CSS shadow parts
|
|
31
40
|
|
|
32
|
-
| Name | Description
|
|
33
|
-
| ------------- |
|
|
34
|
-
| alert |
|
|
35
|
-
| alert-content |
|
|
41
|
+
| Name | Description |
|
|
42
|
+
| ------------- | -------------------------------------------------------- |
|
|
43
|
+
| alert | The outer container that holds the icon and the message. |
|
|
44
|
+
| alert-content | The area next to the icon that holds the alert message. |
|
|
36
45
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
37
46
|
|
|
38
47
|
## Basic
|
|
@@ -40,7 +49,7 @@ The `auro-alert` element is used to provide contextual feedback messages for typ
|
|
|
40
49
|
<div class="exampleWrapper">
|
|
41
50
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
42
51
|
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
43
|
-
<auro-alert>This is a default
|
|
52
|
+
<auro-alert>This is a default alert with no type set.</auro-alert>
|
|
44
53
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
45
54
|
</div>
|
|
46
55
|
<auro-accordion alignRight>
|
|
@@ -48,20 +57,20 @@ The `auro-alert` element is used to provide contextual feedback messages for typ
|
|
|
48
57
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
49
58
|
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
50
59
|
|
|
51
|
-
<pre class="language-html"><code class="language-html"><auro-alert>This is a default
|
|
60
|
+
<pre class="language-html"><code class="language-html"><auro-alert>This is a default alert with no type set.</auro-alert></code></pre>
|
|
52
61
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
53
62
|
</auro-accordion>
|
|
54
63
|
|
|
55
|
-
## Property
|
|
64
|
+
## Property and attribute examples
|
|
56
65
|
|
|
57
66
|
### Hidden
|
|
58
67
|
|
|
59
|
-
Use the `hidden` attribute to hide the
|
|
68
|
+
Use the `hidden` attribute to hide the alert both visually and from screen readers.
|
|
60
69
|
|
|
61
70
|
<div class="exampleWrapper">
|
|
62
71
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden.html) -->
|
|
63
72
|
<!-- The below content is automatically added from ./../apiExamples/hidden.html -->
|
|
64
|
-
<auro-alert hidden type="error">This content
|
|
73
|
+
<auro-alert hidden type="error">This content is hidden visually and from screen readers.</auro-alert>
|
|
65
74
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
66
75
|
</div>
|
|
67
76
|
<auro-accordion alignRight>
|
|
@@ -69,18 +78,18 @@ Use the `hidden` attribute to hide the `auro-alert` component from the user and
|
|
|
69
78
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden.html) -->
|
|
70
79
|
<!-- The below code snippet is automatically added from ./../apiExamples/hidden.html -->
|
|
71
80
|
|
|
72
|
-
<pre class="language-html"><code class="language-html"><auro-alert hidden type="error">This content
|
|
81
|
+
<pre class="language-html"><code class="language-html"><auro-alert hidden type="error">This content is hidden visually and from screen readers.</auro-alert></code></pre>
|
|
73
82
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
74
83
|
</auro-accordion>
|
|
75
84
|
|
|
76
|
-
### Hidden
|
|
85
|
+
### Hidden audibly
|
|
77
86
|
|
|
78
|
-
Use the `hiddenAudible` attribute to hide the
|
|
87
|
+
Use the `hiddenAudible` attribute to hide the alert from screen readers while keeping it visible.
|
|
79
88
|
|
|
80
89
|
<div class="exampleWrapper">
|
|
81
90
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden-audible.html) -->
|
|
82
91
|
<!-- The below content is automatically added from ./../apiExamples/hidden-audible.html -->
|
|
83
|
-
<auro-alert hiddenAudible type="error">This content
|
|
92
|
+
<auro-alert hiddenAudible type="error">This content is hidden from screen readers.</auro-alert>
|
|
84
93
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
85
94
|
</div>
|
|
86
95
|
<auro-accordion alignRight>
|
|
@@ -88,18 +97,18 @@ Use the `hiddenAudible` attribute to hide the `auro-alert` component from the sc
|
|
|
88
97
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden-audible.html) -->
|
|
89
98
|
<!-- The below code snippet is automatically added from ./../apiExamples/hidden-audible.html -->
|
|
90
99
|
|
|
91
|
-
<pre class="language-html"><code class="language-html"><auro-alert hiddenAudible type="error">This content
|
|
100
|
+
<pre class="language-html"><code class="language-html"><auro-alert hiddenAudible type="error">This content is hidden from screen readers.</auro-alert></code></pre>
|
|
92
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
93
102
|
</auro-accordion>
|
|
94
103
|
|
|
95
|
-
### Hidden
|
|
104
|
+
### Hidden visually
|
|
96
105
|
|
|
97
|
-
Use the `hiddenVisually` attribute to
|
|
106
|
+
Use the `hiddenVisually` attribute to hide the alert visually while screen readers still read it.
|
|
98
107
|
|
|
99
108
|
<div class="exampleWrapper">
|
|
100
109
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden-visually.html) -->
|
|
101
110
|
<!-- The below content is automatically added from ./../apiExamples/hidden-visually.html -->
|
|
102
|
-
<auro-alert hiddenVisually type="error">This content
|
|
111
|
+
<auro-alert hiddenVisually type="error">This content is hidden visually, but screen readers still read it.</auro-alert>
|
|
103
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
104
113
|
</div>
|
|
105
114
|
<auro-accordion alignRight>
|
|
@@ -107,11 +116,11 @@ Use the `hiddenVisually` attribute to visually hide the `auro-alert` component f
|
|
|
107
116
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden-visually.html) -->
|
|
108
117
|
<!-- The below code snippet is automatically added from ./../apiExamples/hidden-visually.html -->
|
|
109
118
|
|
|
110
|
-
<pre class="language-html"><code class="language-html"><auro-alert hiddenVisually type="error">This content
|
|
119
|
+
<pre class="language-html"><code class="language-html"><auro-alert hiddenVisually type="error">This content is hidden visually, but screen readers still read it.</auro-alert></code></pre>
|
|
111
120
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
121
|
</auro-accordion>
|
|
113
122
|
|
|
114
|
-
### No
|
|
123
|
+
### No icon
|
|
115
124
|
|
|
116
125
|
Use the `noIcon` attribute to remove the icon from the alert UI when the `type` attribute is set.
|
|
117
126
|
|
|
@@ -122,7 +131,7 @@ Use the `noIcon` attribute to remove the icon from the alert UI when the `type`
|
|
|
122
131
|
<br />
|
|
123
132
|
<auro-alert noIcon type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
124
133
|
<br />
|
|
125
|
-
<auro-alert noIcon type="success">Your status
|
|
134
|
+
<auro-alert noIcon type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
126
135
|
<br />
|
|
127
136
|
<auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
128
137
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -136,7 +145,7 @@ Use the `noIcon` attribute to remove the icon from the alert UI when the `type`
|
|
|
136
145
|
<br />
|
|
137
146
|
<auro-alert noIcon type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
138
147
|
<br />
|
|
139
|
-
<auro-alert noIcon type="success">Your status
|
|
148
|
+
<auro-alert noIcon type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
140
149
|
<br />
|
|
141
150
|
<auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert></code></pre>
|
|
142
151
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -153,7 +162,7 @@ Use the `type` attribute to apply an icon and border color that match the alert
|
|
|
153
162
|
<br />
|
|
154
163
|
<auro-alert type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
155
164
|
<br />
|
|
156
|
-
<auro-alert type="success">Your status
|
|
165
|
+
<auro-alert type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
157
166
|
<br />
|
|
158
167
|
<auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
159
168
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -167,15 +176,15 @@ Use the `type` attribute to apply an icon and border color that match the alert
|
|
|
167
176
|
<br />
|
|
168
177
|
<auro-alert type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
169
178
|
<br />
|
|
170
|
-
<auro-alert type="success">Your status
|
|
179
|
+
<auro-alert type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
171
180
|
<br />
|
|
172
181
|
<auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert></code></pre>
|
|
173
182
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
174
183
|
</auro-accordion>
|
|
175
184
|
|
|
176
|
-
## Common
|
|
185
|
+
## Common usage patterns
|
|
177
186
|
|
|
178
|
-
### Multi-line
|
|
187
|
+
### Multi-line alert
|
|
179
188
|
|
|
180
189
|
If you need to present multiple lines in the same alert, wrap each line in a `<p>` tag.
|
|
181
190
|
|
|
@@ -202,7 +211,7 @@ If you need to present multiple lines in the same alert, wrap each line in a `<p
|
|
|
202
211
|
|
|
203
212
|
### Customize content
|
|
204
213
|
|
|
205
|
-
|
|
214
|
+
Put your own content in the default slot to replace the standard alert text. The following example customizes the slot content and keeps the alert's icon and border.
|
|
206
215
|
|
|
207
216
|
<div class="exampleWrapper">
|
|
208
217
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/custom-content.html) -->
|
|
@@ -257,9 +266,9 @@ While Auro components, `auro-alert` included, come with a pre-defined UI opinion
|
|
|
257
266
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
258
267
|
</auro-accordion>
|
|
259
268
|
|
|
260
|
-
## Restyle
|
|
269
|
+
## Restyle with CSS custom properties
|
|
261
270
|
|
|
262
|
-
|
|
271
|
+
Restyle the component by changing the values of the following tokens.
|
|
263
272
|
|
|
264
273
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
265
274
|
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|