@aurodesignsystem-dev/auro-alert 0.0.0-pr122.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 +29 -42
- package/demo/api.md +147 -157
- package/demo/api.min.js +425 -1
- package/demo/index.md +15 -15
- package/demo/index.min.js +425 -1
- package/demo/readme.md +115 -0
- package/dist/{auro-alert-C5hNY0oc.js → auro-alert-BUDoiSly.js} +7 -7
- package/dist/index.d.ts +149 -77
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +8 -8
- package/demo/auro-alert.min.js +0 -413
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
|
|
@@ -45,84 +45,71 @@ The `auro-alert` element should be used:
|
|
|
45
45
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
46
46
|

|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
$ npm i @aurodesignsystem/auro-alert
|
|
50
|
-
```
|
|
48
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-alert</code></pre>
|
|
51
49
|
|
|
52
50
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
53
51
|
|
|
54
|
-
### Define
|
|
52
|
+
### Define dependency in project
|
|
55
53
|
|
|
56
54
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
57
|
-
|
|
55
|
+
Import the component in each project that uses `<auro-alert>`.
|
|
58
56
|
|
|
59
57
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
60
58
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
import "@aurodesignsystem/auro-alert";
|
|
64
|
-
```
|
|
60
|
+
<pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-alert";</code></pre>
|
|
65
61
|
|
|
66
62
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
67
63
|
|
|
68
64
|
### Use CDN
|
|
69
65
|
|
|
70
66
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
71
|
-
|
|
67
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-alert@latest/+esm"></script>
|
|
75
|
-
```
|
|
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>
|
|
76
70
|
|
|
77
71
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
78
72
|
|
|
79
|
-
## Basic
|
|
73
|
+
## Basic example
|
|
80
74
|
|
|
81
75
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
82
76
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
<auro-alert>This is a default error with no error type specified.</auro-alert>
|
|
86
|
-
```
|
|
78
|
+
<pre class="language-html"><code class="language-html"><auro-alert>This is a default alert with no type set.</auro-alert></code></pre>
|
|
87
79
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
88
80
|
|
|
89
|
-
## Custom
|
|
81
|
+
## Custom component registration for version management
|
|
90
82
|
|
|
91
|
-
|
|
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.
|
|
92
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.
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
95
87
|
|
|
96
|
-
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.
|
|
97
89
|
|
|
98
|
-
|
|
90
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
99
91
|
|
|
100
92
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
101
93
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
102
94
|
|
|
103
|
-
|
|
104
|
-
// Import the class only
|
|
95
|
+
<pre class="language-js"><code class="language-js">// Import the class only
|
|
105
96
|
import { AuroAlert } from '@aurodesignsystem/auro-alert/class';
|
|
97
|
+
// Register with a custom name if desired
|
|
98
|
+
AuroAlert.register('custom-alert');</code></pre>
|
|
106
99
|
|
|
107
|
-
|
|
108
|
-
AuroAlert.register('custom-alert');
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
This will create a new custom element `<custom-alert>` that behaves exactly like `<auro-alert>`, allowing both to coexist on the same page without interfering with each other.
|
|
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.
|
|
112
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
102
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
104
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
105
|
+
<custom-alert type="warning">Salutations World!</custom-alert>
|
|
106
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
118
107
|
</div>
|
|
119
108
|
<auro-accordion alignRight>
|
|
120
|
-
|
|
109
|
+
<span slot="trigger">See code</span>
|
|
121
110
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
122
111
|
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
123
112
|
|
|
124
|
-
|
|
125
|
-
<custom-alert type="warning">Salutations World!</custom-alert>
|
|
126
|
-
```
|
|
113
|
+
<pre class="language-html"><code class="language-html"><custom-alert type="warning">Salutations World!</custom-alert></code></pre>
|
|
127
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
128
115
|
</auro-accordion>
|
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 | hiddenAudible | | boolean | |
|
|
14
|
-
| hiddenVisually | hiddenVisually | | boolean | |
|
|
15
|
-
| noIcon | noIcon | | boolean | | Removes icon from alert
|
|
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,128 +36,118 @@ 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
|
|
39
48
|
|
|
40
49
|
<div class="exampleWrapper">
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
51
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
52
|
+
<auro-alert>This is a default alert with no type set.</auro-alert>
|
|
53
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
45
54
|
</div>
|
|
46
55
|
<auro-accordion alignRight>
|
|
47
|
-
|
|
56
|
+
<span slot="trigger">See code</span>
|
|
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
|
-
|
|
52
|
-
<auro-alert>This is a default error with no error type specified.</auro-alert>
|
|
53
|
-
```
|
|
60
|
+
<pre class="language-html"><code class="language-html"><auro-alert>This is a default alert with no type set.</auro-alert></code></pre>
|
|
54
61
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
55
62
|
</auro-accordion>
|
|
56
63
|
|
|
57
|
-
## Property
|
|
64
|
+
## Property and attribute examples
|
|
58
65
|
|
|
59
66
|
### Hidden
|
|
60
67
|
|
|
61
|
-
Use the `hidden` attribute to hide the
|
|
68
|
+
Use the `hidden` attribute to hide the alert both visually and from screen readers.
|
|
62
69
|
|
|
63
70
|
<div class="exampleWrapper">
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden.html) -->
|
|
72
|
+
<!-- The below content is automatically added from ./../apiExamples/hidden.html -->
|
|
73
|
+
<auro-alert hidden type="error">This content is hidden visually and from screen readers.</auro-alert>
|
|
74
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
68
75
|
</div>
|
|
69
76
|
<auro-accordion alignRight>
|
|
70
|
-
|
|
77
|
+
<span slot="trigger">See code</span>
|
|
71
78
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden.html) -->
|
|
72
79
|
<!-- The below code snippet is automatically added from ./../apiExamples/hidden.html -->
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
<auro-alert hidden type="error">This content will be hidden visually and from screen readers.</auro-alert>
|
|
76
|
-
```
|
|
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>
|
|
77
82
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
78
83
|
</auro-accordion>
|
|
79
84
|
|
|
80
|
-
### Hidden
|
|
85
|
+
### Hidden audibly
|
|
81
86
|
|
|
82
|
-
Use the `hiddenAudible` attribute to hide the
|
|
87
|
+
Use the `hiddenAudible` attribute to hide the alert from screen readers while keeping it visible.
|
|
83
88
|
|
|
84
89
|
<div class="exampleWrapper">
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden-audible.html) -->
|
|
91
|
+
<!-- The below content is automatically added from ./../apiExamples/hidden-audible.html -->
|
|
92
|
+
<auro-alert hiddenAudible type="error">This content is hidden from screen readers.</auro-alert>
|
|
93
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
89
94
|
</div>
|
|
90
95
|
<auro-accordion alignRight>
|
|
91
|
-
|
|
96
|
+
<span slot="trigger">See code</span>
|
|
92
97
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden-audible.html) -->
|
|
93
98
|
<!-- The below code snippet is automatically added from ./../apiExamples/hidden-audible.html -->
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
<auro-alert hiddenAudible type="error">This content will be hidden from screen readers.</auro-alert>
|
|
97
|
-
```
|
|
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>
|
|
98
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
99
102
|
</auro-accordion>
|
|
100
103
|
|
|
101
|
-
### Hidden
|
|
104
|
+
### Hidden visually
|
|
102
105
|
|
|
103
|
-
Use the `hiddenVisually` attribute to
|
|
106
|
+
Use the `hiddenVisually` attribute to hide the alert visually while screen readers still read it.
|
|
104
107
|
|
|
105
108
|
<div class="exampleWrapper">
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden-visually.html) -->
|
|
110
|
+
<!-- The below content is automatically added from ./../apiExamples/hidden-visually.html -->
|
|
111
|
+
<auro-alert hiddenVisually type="error">This content is hidden visually, but screen readers still read it.</auro-alert>
|
|
112
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
110
113
|
</div>
|
|
111
114
|
<auro-accordion alignRight>
|
|
112
|
-
|
|
115
|
+
<span slot="trigger">See code</span>
|
|
113
116
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden-visually.html) -->
|
|
114
117
|
<!-- The below code snippet is automatically added from ./../apiExamples/hidden-visually.html -->
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
<auro-alert hiddenVisually type="error">This content will be hidden visually, but screen readers will still pick it up.</auro-alert>
|
|
118
|
-
```
|
|
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>
|
|
119
120
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
120
121
|
</auro-accordion>
|
|
121
122
|
|
|
122
|
-
### No
|
|
123
|
+
### No icon
|
|
123
124
|
|
|
124
125
|
Use the `noIcon` attribute to remove the icon from the alert UI when the `type` attribute is set.
|
|
125
126
|
|
|
126
127
|
<div class="exampleWrapper">
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<auro-alert noIcon type="error">Transaction failed.</auro-alert>
|
|
130
|
-
<br />
|
|
131
|
-
<auro-alert noIcon type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
132
|
-
<br />
|
|
133
|
-
<auro-alert noIcon type="success">Your status with flight 20 to Aruba had been updated.</auro-alert>
|
|
134
|
-
<br />
|
|
135
|
-
<auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
136
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
137
|
-
</div>
|
|
138
|
-
<auro-accordion alignRight>
|
|
139
|
-
<span slot="trigger">See code</span>
|
|
140
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/type-noicon.html) -->
|
|
141
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/type-noicon.html -->
|
|
142
|
-
|
|
143
|
-
```html
|
|
128
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/type-noicon.html) -->
|
|
129
|
+
<!-- The below content is automatically added from ./../apiExamples/type-noicon.html -->
|
|
144
130
|
<auro-alert noIcon type="error">Transaction failed.</auro-alert>
|
|
145
131
|
<br />
|
|
146
132
|
<auro-alert noIcon type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
147
133
|
<br />
|
|
148
|
-
<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>
|
|
149
135
|
<br />
|
|
150
|
-
<auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
151
|
-
|
|
136
|
+
<auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
137
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
138
|
+
</div>
|
|
139
|
+
<auro-accordion alignRight>
|
|
140
|
+
<span slot="trigger">See code</span>
|
|
141
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/type-noicon.html) -->
|
|
142
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/type-noicon.html -->
|
|
143
|
+
|
|
144
|
+
<pre class="language-html"><code class="language-html"><auro-alert noIcon type="error">Transaction failed.</auro-alert>
|
|
145
|
+
<br />
|
|
146
|
+
<auro-alert noIcon type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
147
|
+
<br />
|
|
148
|
+
<auro-alert noIcon type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
149
|
+
<br />
|
|
150
|
+
<auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert></code></pre>
|
|
152
151
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
153
152
|
</auro-accordion>
|
|
154
153
|
|
|
@@ -157,137 +156,128 @@ Use the `noIcon` attribute to remove the icon from the alert UI when the `type`
|
|
|
157
156
|
Use the `type` attribute to apply an icon and border color that match the alert’s purpose. It supports the following values: `error`, `information`, `success`, and `warning`.
|
|
158
157
|
|
|
159
158
|
<div class="exampleWrapper">
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<auro-alert type="error">Transaction failed.</auro-alert>
|
|
163
|
-
<br />
|
|
164
|
-
<auro-alert type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
165
|
-
<br />
|
|
166
|
-
<auro-alert type="success">Your status with flight 20 to Aruba had been updated.</auro-alert>
|
|
167
|
-
<br />
|
|
168
|
-
<auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
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/type.html) -->
|
|
174
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/type.html -->
|
|
175
|
-
|
|
176
|
-
```html
|
|
159
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/type.html) -->
|
|
160
|
+
<!-- The below content is automatically added from ./../apiExamples/type.html -->
|
|
177
161
|
<auro-alert type="error">Transaction failed.</auro-alert>
|
|
178
162
|
<br />
|
|
179
163
|
<auro-alert type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
180
164
|
<br />
|
|
181
|
-
<auro-alert type="success">Your status
|
|
165
|
+
<auro-alert type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
182
166
|
<br />
|
|
183
|
-
<auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
184
|
-
|
|
167
|
+
<auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
|
|
168
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
169
|
+
</div>
|
|
170
|
+
<auro-accordion alignRight>
|
|
171
|
+
<span slot="trigger">See code</span>
|
|
172
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/type.html) -->
|
|
173
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/type.html -->
|
|
174
|
+
|
|
175
|
+
<pre class="language-html"><code class="language-html"><auro-alert type="error">Transaction failed.</auro-alert>
|
|
176
|
+
<br />
|
|
177
|
+
<auro-alert type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
|
|
178
|
+
<br />
|
|
179
|
+
<auro-alert type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
|
|
180
|
+
<br />
|
|
181
|
+
<auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert></code></pre>
|
|
185
182
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
186
183
|
</auro-accordion>
|
|
187
184
|
|
|
188
|
-
## Common
|
|
185
|
+
## Common usage patterns
|
|
189
186
|
|
|
190
|
-
### Multi-line
|
|
187
|
+
### Multi-line alert
|
|
191
188
|
|
|
192
189
|
If you need to present multiple lines in the same alert, wrap each line in a `<p>` tag.
|
|
193
190
|
|
|
194
191
|
<div class="exampleWrapper">
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
192
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/multiline.html) -->
|
|
193
|
+
<!-- The below content is automatically added from ./../apiExamples/multiline.html -->
|
|
194
|
+
<auro-alert type="error">
|
|
195
|
+
<p>This is error message 1.</p>
|
|
196
|
+
<p>This is error message 2.</p>
|
|
197
|
+
</auro-alert>
|
|
198
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
202
199
|
</div>
|
|
203
200
|
<auro-accordion alignRight>
|
|
204
|
-
|
|
201
|
+
<span slot="trigger">See code</span>
|
|
205
202
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multiline.html) -->
|
|
206
203
|
<!-- The below code snippet is automatically added from ./../apiExamples/multiline.html -->
|
|
207
204
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
</auro-alert>
|
|
213
|
-
```
|
|
205
|
+
<pre class="language-html"><code class="language-html"><auro-alert type="error">
|
|
206
|
+
<p>This is error message 1.</p>
|
|
207
|
+
<p>This is error message 2.</p>
|
|
208
|
+
</auro-alert></code></pre>
|
|
214
209
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
215
210
|
</auro-accordion>
|
|
216
211
|
|
|
217
212
|
### Customize content
|
|
218
213
|
|
|
219
|
-
|
|
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.
|
|
220
215
|
|
|
221
216
|
<div class="exampleWrapper">
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
217
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/custom-content.html) -->
|
|
218
|
+
<!-- The below content is automatically added from ./../apiExamples/custom-content.html -->
|
|
219
|
+
<auro-alert type="information">
|
|
220
|
+
<style>
|
|
226
221
|
.contentWrapper { padding-top: .25rem; }
|
|
227
222
|
.contentWrapper * { line-height: 1.2 !important; font-size: var(--ds-text-body-size-sm); }
|
|
228
223
|
.leanPara { margin: 0 0 var(--ds-size-xs) 0 !important; }
|
|
229
224
|
.unstyled { padding-left: 20px; }
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
225
|
+
</style>
|
|
226
|
+
<div class="contentWrapper leanPara">
|
|
227
|
+
<p class="leanPara">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Interdum varius sit amet mattis vulputate.</p>
|
|
228
|
+
<p>Eu nisl nunc mi ipsum faucibus vitae. Tristique senectus et netus et malesuada fames ac turpis. Nunc sed velit dignissim sodales ut. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et ligula. Vel pharetra vel turpis nunc eget lorem. Vitae sapien pellentesque habitant morbi tristique senectus et. </p>
|
|
229
|
+
<ul class="unstyled">
|
|
230
|
+
<li>Varius sit amet mattis vulputate enim. </li>
|
|
231
|
+
<li>Amet risus nullam eget felis eget nunc. Id consectetur purus ut faucibus pulvinar.</li>
|
|
232
|
+
</ul>
|
|
233
|
+
<p class="leanPara">Sem viverra aliquet eget sit amet tellus cras adipiscing enim. Porttitor rhoncus dolor purus non enim. Sit amet nulla facilisi morbi tempus iaculis urna id. Nec ullamcorper sit amet risus nullam eget felis.</p>
|
|
234
|
+
<p class="fineprint" style="margin: 0;">
|
|
240
235
|
* Non arcu risus quis varius quam quisque id. Euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis. Nec feugiat nisl pretium fusce id velit ut tortor.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
236
|
+
</p>
|
|
237
|
+
</div>
|
|
238
|
+
</auro-alert>
|
|
239
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
245
240
|
</div>
|
|
246
241
|
<auro-accordion alignRight>
|
|
247
|
-
|
|
242
|
+
<span slot="trigger">See code</span>
|
|
248
243
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/custom-content.html) -->
|
|
249
244
|
<!-- The below code snippet is automatically added from ./../apiExamples/custom-content.html -->
|
|
250
245
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<style>
|
|
246
|
+
<pre class="language-html"><code class="language-html"><auro-alert type="information">
|
|
247
|
+
<style>
|
|
254
248
|
.contentWrapper { padding-top: .25rem; }
|
|
255
249
|
.contentWrapper * { line-height: 1.2 !important; font-size: var(--ds-text-body-size-sm); }
|
|
256
250
|
.leanPara { margin: 0 0 var(--ds-size-xs) 0 !important; }
|
|
257
251
|
.unstyled { padding-left: 20px; }
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
252
|
+
</style>
|
|
253
|
+
<div class="contentWrapper leanPara">
|
|
254
|
+
<p class="leanPara">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Interdum varius sit amet mattis vulputate.</p>
|
|
255
|
+
<p>Eu nisl nunc mi ipsum faucibus vitae. Tristique senectus et netus et malesuada fames ac turpis. Nunc sed velit dignissim sodales ut. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et ligula. Vel pharetra vel turpis nunc eget lorem. Vitae sapien pellentesque habitant morbi tristique senectus et. </p>
|
|
256
|
+
<ul class="unstyled">
|
|
257
|
+
<li>Varius sit amet mattis vulputate enim. </li>
|
|
258
|
+
<li>Amet risus nullam eget felis eget nunc. Id consectetur purus ut faucibus pulvinar.</li>
|
|
259
|
+
</ul>
|
|
260
|
+
<p class="leanPara">Sem viverra aliquet eget sit amet tellus cras adipiscing enim. Porttitor rhoncus dolor purus non enim. Sit amet nulla facilisi morbi tempus iaculis urna id. Nec ullamcorper sit amet risus nullam eget felis.</p>
|
|
261
|
+
<p class="fineprint" style="margin: 0;">
|
|
268
262
|
* Non arcu risus quis varius quam quisque id. Euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis. Nec feugiat nisl pretium fusce id velit ut tortor.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
```
|
|
263
|
+
</p>
|
|
264
|
+
</div>
|
|
265
|
+
</auro-alert></code></pre>
|
|
273
266
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
274
267
|
</auro-accordion>
|
|
275
268
|
|
|
276
|
-
## Restyle
|
|
269
|
+
## Restyle with CSS custom properties
|
|
277
270
|
|
|
278
|
-
|
|
271
|
+
Restyle the component by changing the values of the following tokens.
|
|
279
272
|
|
|
280
273
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
281
274
|
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
282
275
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
:host {
|
|
276
|
+
<pre class="language-scss"><code class="language-scss">@use '@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska' as v;
|
|
277
|
+
:host {
|
|
287
278
|
--ds-auro-alert-border-color: var(--ds-basic-color-status-default, #{v.$ds-basic-color-status-default});
|
|
288
279
|
--ds-auro-alert-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
289
280
|
--ds-auro-alert-icon-color: transparent;
|
|
290
281
|
--ds-auro-alert-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
291
|
-
}
|
|
292
|
-
```
|
|
282
|
+
}</code></pre>
|
|
293
283
|
<!-- AURO-GENERATED-CONTENT:END -->
|