@aurodesignsystem-dev/auro-alert 0.0.0-pr123.0 → 0.0.0-pr124.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/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 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` |
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 Cases
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
- The `auro-alert` element should be used:
35
+ Use `auro-alert` to:
36
36
 
37
- * To communicate important, time-sensitive or state-changing information to users
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 Dependency in Project
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
- Defining the dependency within each project that is using the `<auro-alert>` component.
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
- 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.
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">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-alert@latest/+esm"&gt;&lt;/script&gt;</code></pre>
70
70
 
71
71
  <!-- AURO-GENERATED-CONTENT:END -->
72
72
 
73
- ## Basic Example
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">&lt;auro-alert&gt;This is a default error with no error type specified.&lt;/auro-alert&gt;</code></pre>
78
+ <pre class="language-html"><code class="language-html">&lt;auro-alert&gt;This is a default alert with no type set.&lt;/auro-alert&gt;</code></pre>
79
79
  <!-- AURO-GENERATED-CONTENT:END -->
80
80
 
81
- ## Custom Component Registration for Version Management
81
+ ## Custom component registration for version management
82
82
 
83
- 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.
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
- When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
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), you can manually register the class under a custom element name to avoid conflicts.
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
- You can do this by importing only the component class and using the `register(name)` method with a unique name:
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
  &#10;// Register with a custom name if desired
98
98
  AuroAlert.register('custom-alert');</code></pre>
99
99
 
100
- 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.
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
- The `auro-alert` element is used to provide contextual feedback messages for typical user actions.
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">&lt;auro-alert type="success"&gt;Your changes are saved.&lt;/auro-alert&gt;</code></pre>
7
16
 
8
- ### Properties & Attributes
17
+ ### Properties and attributes
9
18
 
10
- | Properties | Attributes | Modifiers | Type | Default | Description |
11
- | -------------- | -------------- | --------- | -------------------------------------------------- | ------- | ----------------------------------------------------------------------------------- |
12
- | hidden | hidden | | boolean | | If present, the component will be hidden both visually and from screen readers |
13
- | hiddenAudible | hiddenaudible | | boolean | | If present, the component will be hidden from screen readers, but seen visually |
14
- | hiddenVisually | hiddenvisually | | boolean | | If present, the component will be hidden visually, but still read by screen readers |
15
- | noIcon | noicon | | boolean | | Removes icon from alert UI when `type` attribute is set |
16
- | type | type | | `information` \| `error` \| `success` \| `warning` | | Component will render visually based on which type value is set |
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. Screen readers announce `error`, `success`, and `warning` alerts right away because they use `role="alert"`, but `information` alerts aren't announced automatically. |
17
26
 
18
27
  ### Methods
19
28
 
20
- | Name | Parameters | Return | Description |
21
- | -------- | -------------------------------------------------------------------- | ------ | ------------------------------------------------- |
22
- | register | `name` (string) - The name of the element that you want to register. | | This will register this element with the browser. |
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,21 @@ 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 Shadow Parts
39
+ ### CSS shadow parts
40
+
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. |
45
+
46
+ ### CSS custom properties
31
47
 
32
- | Name | Description |
33
- | ------------- | ---------------------------------------------------- |
34
- | alert | Use for customizing the style of the alert container |
35
- | alert-content | Use for customizing the style of the alert content |
48
+ | Name | Description |
49
+ | ------------------------------- | ------------------------------ |
50
+ | --ds-auro-alert-border-color | Color of the alert's border. |
51
+ | --ds-auro-alert-container-color | Background color of the alert. |
52
+ | --ds-auro-alert-icon-color | Color of the alert's icon. |
53
+ | --ds-auro-alert-text-color | Color of the alert's text. |
36
54
  <!-- AURO-GENERATED-CONTENT:END -->
37
55
 
38
56
  ## Basic
@@ -40,7 +58,7 @@ The `auro-alert` element is used to provide contextual feedback messages for typ
40
58
  <div class="exampleWrapper">
41
59
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
42
60
  <!-- The below content is automatically added from ./../apiExamples/basic.html -->
43
- <auro-alert>This is a default error with no error type specified.</auro-alert>
61
+ <auro-alert>This is a default alert with no type set.</auro-alert>
44
62
  <!-- AURO-GENERATED-CONTENT:END -->
45
63
  </div>
46
64
  <auro-accordion alignRight>
@@ -48,20 +66,20 @@ The `auro-alert` element is used to provide contextual feedback messages for typ
48
66
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
49
67
  <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
50
68
 
51
- <pre class="language-html"><code class="language-html">&lt;auro-alert&gt;This is a default error with no error type specified.&lt;/auro-alert&gt;</code></pre>
69
+ <pre class="language-html"><code class="language-html">&lt;auro-alert&gt;This is a default alert with no type set.&lt;/auro-alert&gt;</code></pre>
52
70
  <!-- AURO-GENERATED-CONTENT:END -->
53
71
  </auro-accordion>
54
72
 
55
- ## Property & Attribute Examples
73
+ ## Property and attribute examples
56
74
 
57
75
  ### Hidden
58
76
 
59
- Use the `hidden` attribute to hide the `auro-alert` component from the user and screenreader.
77
+ Use the `hidden` attribute to hide the alert both visually and from screen readers.
60
78
 
61
79
  <div class="exampleWrapper">
62
80
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden.html) -->
63
81
  <!-- The below content is automatically added from ./../apiExamples/hidden.html -->
64
- <auro-alert hidden type="error">This content will be hidden visually and from screen readers.</auro-alert>
82
+ <auro-alert hidden type="error">This content is hidden visually and from screen readers.</auro-alert>
65
83
  <!-- AURO-GENERATED-CONTENT:END -->
66
84
  </div>
67
85
  <auro-accordion alignRight>
@@ -69,18 +87,18 @@ Use the `hidden` attribute to hide the `auro-alert` component from the user and
69
87
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden.html) -->
70
88
  <!-- The below code snippet is automatically added from ./../apiExamples/hidden.html -->
71
89
 
72
- <pre class="language-html"><code class="language-html">&lt;auro-alert hidden type="error"&gt;This content will be hidden visually and from screen readers.&lt;/auro-alert&gt;</code></pre>
90
+ <pre class="language-html"><code class="language-html">&lt;auro-alert hidden type="error"&gt;This content is hidden visually and from screen readers.&lt;/auro-alert&gt;</code></pre>
73
91
  <!-- AURO-GENERATED-CONTENT:END -->
74
92
  </auro-accordion>
75
93
 
76
- ### Hidden Audibly
94
+ ### Hidden audibly
77
95
 
78
- Use the `hiddenAudible` attribute to hide the `auro-alert` component from the screenreader only.
96
+ Use the `hiddenAudible` attribute to hide the alert from screen readers while keeping it visible.
79
97
 
80
98
  <div class="exampleWrapper">
81
99
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden-audible.html) -->
82
100
  <!-- The below content is automatically added from ./../apiExamples/hidden-audible.html -->
83
- <auro-alert hiddenAudible type="error">This content will be hidden from screen readers.</auro-alert>
101
+ <auro-alert hiddenAudible type="error">This content is hidden from screen readers.</auro-alert>
84
102
  <!-- AURO-GENERATED-CONTENT:END -->
85
103
  </div>
86
104
  <auro-accordion alignRight>
@@ -88,18 +106,18 @@ Use the `hiddenAudible` attribute to hide the `auro-alert` component from the sc
88
106
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden-audible.html) -->
89
107
  <!-- The below code snippet is automatically added from ./../apiExamples/hidden-audible.html -->
90
108
 
91
- <pre class="language-html"><code class="language-html">&lt;auro-alert hiddenAudible type="error"&gt;This content will be hidden from screen readers.&lt;/auro-alert&gt;</code></pre>
109
+ <pre class="language-html"><code class="language-html">&lt;auro-alert hiddenAudible type="error"&gt;This content is hidden from screen readers.&lt;/auro-alert&gt;</code></pre>
92
110
  <!-- AURO-GENERATED-CONTENT:END -->
93
111
  </auro-accordion>
94
112
 
95
- ### Hidden Visually
113
+ ### Hidden visually
96
114
 
97
- Use the `hiddenVisually` attribute to visually hide the `auro-alert` component from the user only.
115
+ Use the `hiddenVisually` attribute to hide the alert visually while screen readers still read it.
98
116
 
99
117
  <div class="exampleWrapper">
100
118
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden-visually.html) -->
101
119
  <!-- The below content is automatically added from ./../apiExamples/hidden-visually.html -->
102
- <auro-alert hiddenVisually type="error">This content will be hidden visually, but screen readers will still pick it up.</auro-alert>
120
+ <auro-alert hiddenVisually type="error">This content is hidden visually, but screen readers still read it.</auro-alert>
103
121
  <!-- AURO-GENERATED-CONTENT:END -->
104
122
  </div>
105
123
  <auro-accordion alignRight>
@@ -107,11 +125,11 @@ Use the `hiddenVisually` attribute to visually hide the `auro-alert` component f
107
125
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden-visually.html) -->
108
126
  <!-- The below code snippet is automatically added from ./../apiExamples/hidden-visually.html -->
109
127
 
110
- <pre class="language-html"><code class="language-html">&lt;auro-alert hiddenVisually type="error"&gt;This content will be hidden visually, but screen readers will still pick it up.&lt;/auro-alert&gt;</code></pre>
128
+ <pre class="language-html"><code class="language-html">&lt;auro-alert hiddenVisually type="error"&gt;This content is hidden visually, but screen readers still read it.&lt;/auro-alert&gt;</code></pre>
111
129
  <!-- AURO-GENERATED-CONTENT:END -->
112
130
  </auro-accordion>
113
131
 
114
- ### No Icon
132
+ ### No icon
115
133
 
116
134
  Use the `noIcon` attribute to remove the icon from the alert UI when the `type` attribute is set.
117
135
 
@@ -122,7 +140,7 @@ Use the `noIcon` attribute to remove the icon from the alert UI when the `type`
122
140
  <br />
123
141
  <auro-alert noIcon type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
124
142
  <br />
125
- <auro-alert noIcon type="success">Your status with flight 20 to Aruba had been updated.</auro-alert>
143
+ <auro-alert noIcon type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
126
144
  <br />
127
145
  <auro-alert noIcon type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
128
146
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -136,7 +154,7 @@ Use the `noIcon` attribute to remove the icon from the alert UI when the `type`
136
154
  &lt;br /&gt;
137
155
  &lt;auro-alert noIcon type="information"&gt;You are confirmed on Flight 20 to Aruba.&lt;/auro-alert&gt;
138
156
  &lt;br /&gt;
139
- &lt;auro-alert noIcon type="success"&gt;Your status with flight 20 to Aruba had been updated.&lt;/auro-alert&gt;
157
+ &lt;auro-alert noIcon type="success"&gt;Your status for Flight 20 to Aruba has been updated.&lt;/auro-alert&gt;
140
158
  &lt;br /&gt;
141
159
  &lt;auro-alert noIcon type="warning"&gt;Warning. Session timed out. Look for a confirmation email to verify your transaction.&lt;/auro-alert&gt;</code></pre>
142
160
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -144,7 +162,7 @@ Use the `noIcon` attribute to remove the icon from the alert UI when the `type`
144
162
 
145
163
  ### Type
146
164
 
147
- 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`.
165
+ 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`. The `error`, `success`, and `warning` types use `role="alert"`, so screen readers announce them right away. The `information` type doesn't use it, so screen readers don't announce it automatically.
148
166
 
149
167
  <div class="exampleWrapper">
150
168
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/type.html) -->
@@ -153,7 +171,7 @@ Use the `type` attribute to apply an icon and border color that match the alert
153
171
  <br />
154
172
  <auro-alert type="information">You are confirmed on Flight 20 to Aruba.</auro-alert>
155
173
  <br />
156
- <auro-alert type="success">Your status with flight 20 to Aruba had been updated.</auro-alert>
174
+ <auro-alert type="success">Your status for Flight 20 to Aruba has been updated.</auro-alert>
157
175
  <br />
158
176
  <auro-alert type="warning">Warning. Session timed out. Look for a confirmation email to verify your transaction.</auro-alert>
159
177
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -167,15 +185,15 @@ Use the `type` attribute to apply an icon and border color that match the alert
167
185
  &lt;br /&gt;
168
186
  &lt;auro-alert type="information"&gt;You are confirmed on Flight 20 to Aruba.&lt;/auro-alert&gt;
169
187
  &lt;br /&gt;
170
- &lt;auro-alert type="success"&gt;Your status with flight 20 to Aruba had been updated.&lt;/auro-alert&gt;
188
+ &lt;auro-alert type="success"&gt;Your status for Flight 20 to Aruba has been updated.&lt;/auro-alert&gt;
171
189
  &lt;br /&gt;
172
190
  &lt;auro-alert type="warning"&gt;Warning. Session timed out. Look for a confirmation email to verify your transaction.&lt;/auro-alert&gt;</code></pre>
173
191
  <!-- AURO-GENERATED-CONTENT:END -->
174
192
  </auro-accordion>
175
193
 
176
- ## Common Usage Patterns & Functional Examples
194
+ ## Common usage patterns
177
195
 
178
- ### Multi-line Alert
196
+ ### Multi-line alert
179
197
 
180
198
  If you need to present multiple lines in the same alert, wrap each line in a `<p>` tag.
181
199
 
@@ -202,7 +220,7 @@ If you need to present multiple lines in the same alert, wrap each line in a `<p
202
220
 
203
221
  ### Customize content
204
222
 
205
- While Auro components, `auro-alert` included, come with a pre-defined UI opinion, another feature that is fully supported is a user's ability to customize any content in the slot. The following example illustrates how a user can completely customize the content in the `<slot>` of the element, while not needing to recreate the `auro-alert` UI.
223
+ 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
224
 
207
225
  <div class="exampleWrapper">
208
226
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/custom-content.html) -->
@@ -257,9 +275,9 @@ While Auro components, `auro-alert` included, come with a pre-defined UI opinion
257
275
  <!-- AURO-GENERATED-CONTENT:END -->
258
276
  </auro-accordion>
259
277
 
260
- ## Restyle Component with CSS Variables
278
+ ## Restyle with CSS custom properties
261
279
 
262
- The component may be restyled by changing the values of the following token(s).
280
+ Restyle the component by changing the values of the following tokens.
263
281
 
264
282
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
265
283
  <!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->