@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 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. |
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,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 Shadow Parts
39
+ ### CSS shadow parts
31
40
 
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 |
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 error with no error type specified.</auro-alert>
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">&lt;auro-alert&gt;This is a default error with no error type specified.&lt;/auro-alert&gt;</code></pre>
60
+ <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
61
  <!-- AURO-GENERATED-CONTENT:END -->
53
62
  </auro-accordion>
54
63
 
55
- ## Property & Attribute Examples
64
+ ## Property and attribute examples
56
65
 
57
66
  ### Hidden
58
67
 
59
- Use the `hidden` attribute to hide the `auro-alert` component from the user and screenreader.
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 will be hidden visually and from screen readers.</auro-alert>
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">&lt;auro-alert hidden type="error"&gt;This content will be hidden visually and from screen readers.&lt;/auro-alert&gt;</code></pre>
81
+ <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
82
  <!-- AURO-GENERATED-CONTENT:END -->
74
83
  </auro-accordion>
75
84
 
76
- ### Hidden Audibly
85
+ ### Hidden audibly
77
86
 
78
- Use the `hiddenAudible` attribute to hide the `auro-alert` component from the screenreader only.
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 will be hidden from screen readers.</auro-alert>
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">&lt;auro-alert hiddenAudible type="error"&gt;This content will be hidden from screen readers.&lt;/auro-alert&gt;</code></pre>
100
+ <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
101
  <!-- AURO-GENERATED-CONTENT:END -->
93
102
  </auro-accordion>
94
103
 
95
- ### Hidden Visually
104
+ ### Hidden visually
96
105
 
97
- Use the `hiddenVisually` attribute to visually hide the `auro-alert` component from the user only.
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 will be hidden visually, but screen readers will still pick it up.</auro-alert>
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">&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>
119
+ <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
120
  <!-- AURO-GENERATED-CONTENT:END -->
112
121
  </auro-accordion>
113
122
 
114
- ### No Icon
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 with flight 20 to Aruba had been updated.</auro-alert>
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
  &lt;br /&gt;
137
146
  &lt;auro-alert noIcon type="information"&gt;You are confirmed on Flight 20 to Aruba.&lt;/auro-alert&gt;
138
147
  &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;
148
+ &lt;auro-alert noIcon type="success"&gt;Your status for Flight 20 to Aruba has been updated.&lt;/auro-alert&gt;
140
149
  &lt;br /&gt;
141
150
  &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
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 with flight 20 to Aruba had been updated.</auro-alert>
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
  &lt;br /&gt;
168
177
  &lt;auro-alert type="information"&gt;You are confirmed on Flight 20 to Aruba.&lt;/auro-alert&gt;
169
178
  &lt;br /&gt;
170
- &lt;auro-alert type="success"&gt;Your status with flight 20 to Aruba had been updated.&lt;/auro-alert&gt;
179
+ &lt;auro-alert type="success"&gt;Your status for Flight 20 to Aruba has been updated.&lt;/auro-alert&gt;
171
180
  &lt;br /&gt;
172
181
  &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
182
  <!-- AURO-GENERATED-CONTENT:END -->
174
183
  </auro-accordion>
175
184
 
176
- ## Common Usage Patterns & Functional Examples
185
+ ## Common usage patterns
177
186
 
178
- ### Multi-line Alert
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
- 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.
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 Component with CSS Variables
269
+ ## Restyle with CSS custom properties
261
270
 
262
- The component may be restyled by changing the values of the following token(s).
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 -->