@aurodesignsystem-dev/auro-toast 0.0.0-pr154.0 → 0.0.0-pr156.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 +24 -36
- package/custom-elements.json +458 -0
- package/demo/api.md +8 -7
- package/demo/api.min.js +86 -17
- package/demo/index.min.js +85 -16
- package/dist/{auro-toaster-BVtBRPDA.js → auro-toaster-BghWbuzd.js} +3 -3
- package/dist/index.d.ts +14 -5
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +4 -2
- package/src/auro-toast.js +538 -0
- package/src/auro-toaster.js +175 -0
- package/src/buttonVersion.js +1 -0
- package/src/iconVersion.js +1 -0
- package/src/index.js +4 -0
- package/src/registered.js +5 -0
- package/src/styles/color.scss +34 -0
- package/src/styles/style-toaster.scss +27 -0
- package/src/styles/style.scss +61 -0
- package/src/styles/tokens.scss +8 -0
package/README.md
CHANGED
|
@@ -49,9 +49,7 @@ The `<auro-toast>` use cases include:
|
|
|
49
49
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
50
50
|

|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
$ npm i @aurodesignsystem/auro-toast
|
|
54
|
-
```
|
|
52
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-toast</code></pre>
|
|
55
53
|
|
|
56
54
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
57
55
|
|
|
@@ -63,9 +61,7 @@ Defining the dependency within each project that is using the `<auro-toast>` com
|
|
|
63
61
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
64
62
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
import "@aurodesignsystem/auro-toast";
|
|
68
|
-
```
|
|
64
|
+
<pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-toast";</code></pre>
|
|
69
65
|
|
|
70
66
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
71
67
|
|
|
@@ -74,9 +70,7 @@ import "@aurodesignsystem/auro-toast";
|
|
|
74
70
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
75
71
|
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.
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-toast@latest/+esm"></script>
|
|
79
|
-
```
|
|
73
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-toast@latest/+esm"></script></code></pre>
|
|
80
74
|
|
|
81
75
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
82
76
|
|
|
@@ -85,18 +79,16 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
85
79
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
86
80
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
<auro-button id="basicToastBtn">
|
|
82
|
+
<pre class="language-html"><code class="language-html"><auro-button id="basicToastBtn">
|
|
90
83
|
Show default notification
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
</auro-button>
|
|
85
|
+
<!--
|
|
93
86
|
NOTE: The manually added style is NOT necessary for use,
|
|
94
87
|
Demo purposes ONLY!
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
-->
|
|
89
|
+
<auro-toast style="display: block; margin: 0.5rem 0;" id="basicToast">
|
|
97
90
|
Default notification with no error type.
|
|
98
|
-
|
|
99
|
-
```
|
|
91
|
+
</auro-toast></code></pre>
|
|
100
92
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
101
93
|
|
|
102
94
|
## Custom Component Registration for Version Management
|
|
@@ -113,39 +105,35 @@ You can do this by importing only the component class and using the `register(na
|
|
|
113
105
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
114
106
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
115
107
|
|
|
116
|
-
|
|
117
|
-
// Import the class only
|
|
108
|
+
<pre class="language-js"><code class="language-js">// Import the class only
|
|
118
109
|
import { AuroToast } from '@aurodesignsystem/auro-toast/class';
|
|
119
|
-
|
|
110
|
+
|
|
120
111
|
// Register with a custom name if desired
|
|
121
|
-
AuroToast.register('custom-toast')
|
|
122
|
-
```
|
|
112
|
+
AuroToast.register('custom-toast');</code></pre>
|
|
123
113
|
|
|
124
114
|
This will create a new custom element `<custom-toast>` that behaves exactly like `<auro-toast>`, allowing both to coexist on the same page without interfering with each other.
|
|
125
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
126
116
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
118
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
119
|
+
<auro-button id="customToastBtn">
|
|
130
120
|
Show default notification
|
|
131
|
-
|
|
132
|
-
|
|
121
|
+
</auro-button>
|
|
122
|
+
<custom-toast style="display: block; margin: 0.5rem 0;" id="customToast">
|
|
133
123
|
Default notification with no error type.
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
</custom-toast>
|
|
125
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
136
126
|
</div>
|
|
137
127
|
<auro-accordion alignRight>
|
|
138
|
-
|
|
128
|
+
<span slot="trigger">See code</span>
|
|
139
129
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
140
130
|
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
141
131
|
|
|
142
|
-
|
|
143
|
-
<auro-button id="customToastBtn">
|
|
132
|
+
<pre class="language-html"><code class="language-html"><auro-button id="customToastBtn">
|
|
144
133
|
Show default notification
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
</auro-button>
|
|
135
|
+
<custom-toast style="display: block; margin: 0.5rem 0;" id="customToast">
|
|
147
136
|
Default notification with no error type.
|
|
148
|
-
|
|
149
|
-
```
|
|
137
|
+
</custom-toast></code></pre>
|
|
150
138
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
151
139
|
</auro-accordion>
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/auro-toast.js",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "class",
|
|
11
|
+
"description": "The `auro-toast` element provides users a way to display short, temporary messages.",
|
|
12
|
+
"name": "AuroToast",
|
|
13
|
+
"cssParts": [
|
|
14
|
+
{
|
|
15
|
+
"description": "Apply css to the toast close button",
|
|
16
|
+
"name": "close-button"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"description": "Apply css to the toast type icon",
|
|
20
|
+
"name": "type-icon"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"members": [
|
|
24
|
+
{
|
|
25
|
+
"kind": "method",
|
|
26
|
+
"name": "_hasAncestorLiveRegion",
|
|
27
|
+
"description": "Walks the DOM ancestors (crossing shadow boundaries) looking for any\nactive live region — either an aria-live=\"polite/assertive\" attribute or\nan implicit live region role (alert, status, log).\naria-live=\"off\" is not considered active and is intentionally ignored.",
|
|
28
|
+
"privacy": "private",
|
|
29
|
+
"return": {
|
|
30
|
+
"type": {
|
|
31
|
+
"text": "boolean"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"kind": "method",
|
|
37
|
+
"name": "_initializeDefaults",
|
|
38
|
+
"type": {
|
|
39
|
+
"text": "_initializeDefaults() => void"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "method",
|
|
44
|
+
"name": "_returnFocus",
|
|
45
|
+
"description": "Returns focus to the trigger element when the toast is manually closed.\nNot called on auto-dismiss — moving focus during auto-dismiss would\ninterrupt the AT user's current position in the page.",
|
|
46
|
+
"privacy": "private",
|
|
47
|
+
"return": {
|
|
48
|
+
"type": {
|
|
49
|
+
"text": "void"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"kind": "method",
|
|
55
|
+
"name": "_scheduleAutoHide",
|
|
56
|
+
"description": "(Re-)schedules the auto-hide timer based on current visible/disableAutoHide/\nvariant/timeTilHide values. Called from updated() on property changes and\nfrom connectedCallback() to re-arm auto-hide after a reconnect (e.g. the\nnode is re-parented elsewhere in the DOM), since updated() does not run\nagain on reconnect alone.",
|
|
57
|
+
"privacy": "private",
|
|
58
|
+
"return": {
|
|
59
|
+
"type": {
|
|
60
|
+
"text": "void"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"kind": "method",
|
|
66
|
+
"name": "_syncStandaloneRole",
|
|
67
|
+
"description": "Sets or removes the live-region role on the host depending on whether\nthe toast is standalone. Extracted so connectedCallback and updated()\nstay in sync without duplicating the logic.",
|
|
68
|
+
"privacy": "private",
|
|
69
|
+
"return": {
|
|
70
|
+
"type": {
|
|
71
|
+
"text": "void"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"kind": "method",
|
|
77
|
+
"name": "clickToClose",
|
|
78
|
+
"privacy": "private",
|
|
79
|
+
"return": {
|
|
80
|
+
"type": {
|
|
81
|
+
"text": "void"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"kind": "method",
|
|
87
|
+
"name": "closeToast",
|
|
88
|
+
"privacy": "private",
|
|
89
|
+
"return": {
|
|
90
|
+
"type": {
|
|
91
|
+
"text": "void"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"kind": "field",
|
|
97
|
+
"name": "disableAutoHide",
|
|
98
|
+
"privacy": "public",
|
|
99
|
+
"type": {
|
|
100
|
+
"text": "boolean"
|
|
101
|
+
},
|
|
102
|
+
"description": "Prevents the toast from auto-hiding on the default time.",
|
|
103
|
+
"attribute": "disableautohide",
|
|
104
|
+
"reflects": true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"kind": "method",
|
|
108
|
+
"name": "fadeOutToast",
|
|
109
|
+
"privacy": "private",
|
|
110
|
+
"return": {
|
|
111
|
+
"type": {
|
|
112
|
+
"text": "void"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"kind": "method",
|
|
118
|
+
"name": "getVariantIcon",
|
|
119
|
+
"description": "Determines which type icon to render based on the variant prop.",
|
|
120
|
+
"privacy": "private",
|
|
121
|
+
"return": {
|
|
122
|
+
"type": {
|
|
123
|
+
"text": "HTMLElement"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"kind": "method",
|
|
129
|
+
"name": "handleSlotContent",
|
|
130
|
+
"description": "Mirrors any defined custom type svg into the correct place in the template.",
|
|
131
|
+
"privacy": "private",
|
|
132
|
+
"return": {
|
|
133
|
+
"type": {
|
|
134
|
+
"text": "void"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"kind": "field",
|
|
140
|
+
"name": "noIcon",
|
|
141
|
+
"privacy": "public",
|
|
142
|
+
"type": {
|
|
143
|
+
"text": "boolean"
|
|
144
|
+
},
|
|
145
|
+
"description": "Removes icon from the toast UI.",
|
|
146
|
+
"attribute": "noicon",
|
|
147
|
+
"reflects": true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"kind": "method",
|
|
151
|
+
"name": "register",
|
|
152
|
+
"static": true,
|
|
153
|
+
"parameters": [
|
|
154
|
+
{
|
|
155
|
+
"name": "name",
|
|
156
|
+
"default": "\"auro-toast\"",
|
|
157
|
+
"description": "The name of the element that you want to register.",
|
|
158
|
+
"optional": true,
|
|
159
|
+
"type": {
|
|
160
|
+
"text": "string"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"description": "This will register this element with the browser.",
|
|
165
|
+
"type": {
|
|
166
|
+
"text": "register(name?: string = \"auro-toast\") => void"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"kind": "method",
|
|
171
|
+
"name": "setOnClick",
|
|
172
|
+
"description": "For mobile, set the onclick function so the toast can be dismissed if it is tapped on anywhere inside the toast.\nIgnores clicks on the close button -- clickToClose() already handles those, and re-running\nfadeOutToast() for the same click is what caused a double close (see AB#1643472).",
|
|
173
|
+
"privacy": "private",
|
|
174
|
+
"return": {
|
|
175
|
+
"type": {
|
|
176
|
+
"text": "void"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"kind": "field",
|
|
182
|
+
"name": "timeTilHide",
|
|
183
|
+
"privacy": "public",
|
|
184
|
+
"type": {
|
|
185
|
+
"text": "number"
|
|
186
|
+
},
|
|
187
|
+
"description": "Sets the time in milliseconds until the toast hides.",
|
|
188
|
+
"attribute": "timetilhide",
|
|
189
|
+
"reflects": true
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"kind": "field",
|
|
193
|
+
"name": "trigger",
|
|
194
|
+
"privacy": "public",
|
|
195
|
+
"type": {
|
|
196
|
+
"text": "string"
|
|
197
|
+
},
|
|
198
|
+
"description": "The id of the element that triggered the toast.\nWhen the toast is manually closed, focus will return to this element.\nTakes precedence over the triggerElement property if both are set.",
|
|
199
|
+
"attribute": "trigger",
|
|
200
|
+
"reflects": true
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"kind": "field",
|
|
204
|
+
"name": "triggerElement",
|
|
205
|
+
"privacy": "public",
|
|
206
|
+
"type": {
|
|
207
|
+
"text": "HTMLElement"
|
|
208
|
+
},
|
|
209
|
+
"description": "A direct reference to the element that triggered the toast.\nWhen the toast is manually closed, focus will return to this element.\nUse the trigger attribute instead if you prefer a declarative approach."
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "field",
|
|
213
|
+
"name": "variant",
|
|
214
|
+
"privacy": "public",
|
|
215
|
+
"type": {
|
|
216
|
+
"text": "'error' | 'success' | 'custom'"
|
|
217
|
+
},
|
|
218
|
+
"description": "Component will render visually based on which variant value is set.",
|
|
219
|
+
"attribute": "variant",
|
|
220
|
+
"reflects": true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"kind": "field",
|
|
224
|
+
"name": "visible",
|
|
225
|
+
"privacy": "public",
|
|
226
|
+
"type": {
|
|
227
|
+
"text": "boolean"
|
|
228
|
+
},
|
|
229
|
+
"description": "Sets state of toast to visible",
|
|
230
|
+
"attribute": "visible",
|
|
231
|
+
"reflects": true
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
"events": [
|
|
235
|
+
{
|
|
236
|
+
"name": "toast-close",
|
|
237
|
+
"type": {
|
|
238
|
+
"text": "{ visible: boolean }"
|
|
239
|
+
},
|
|
240
|
+
"description": "Notifies that the toast has been closed"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "onToastClose",
|
|
244
|
+
"type": {
|
|
245
|
+
"text": "Object"
|
|
246
|
+
},
|
|
247
|
+
"description": "**Deprecated**, use `toast-close` event instead.",
|
|
248
|
+
"deprecated": "Use `toast-close` event instead."
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"attributes": [
|
|
252
|
+
{
|
|
253
|
+
"name": "disableautohide",
|
|
254
|
+
"type": {
|
|
255
|
+
"text": "boolean"
|
|
256
|
+
},
|
|
257
|
+
"description": "Prevents the toast from auto-hiding on the default time.",
|
|
258
|
+
"fieldName": "disableAutoHide"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "noicon",
|
|
262
|
+
"type": {
|
|
263
|
+
"text": "boolean"
|
|
264
|
+
},
|
|
265
|
+
"description": "Removes icon from the toast UI.",
|
|
266
|
+
"fieldName": "noIcon"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "timetilhide",
|
|
270
|
+
"type": {
|
|
271
|
+
"text": "number"
|
|
272
|
+
},
|
|
273
|
+
"description": "Sets the time in milliseconds until the toast hides.",
|
|
274
|
+
"fieldName": "timeTilHide"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "trigger",
|
|
278
|
+
"type": {
|
|
279
|
+
"text": "string"
|
|
280
|
+
},
|
|
281
|
+
"description": "The id of the element that triggered the toast.\nWhen the toast is manually closed, focus will return to this element.\nTakes precedence over the triggerElement property if both are set.",
|
|
282
|
+
"fieldName": "trigger"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "variant",
|
|
286
|
+
"type": {
|
|
287
|
+
"text": "'error' | 'success' | 'custom'"
|
|
288
|
+
},
|
|
289
|
+
"description": "Component will render visually based on which variant value is set.",
|
|
290
|
+
"fieldName": "variant"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "visible",
|
|
294
|
+
"type": {
|
|
295
|
+
"text": "boolean"
|
|
296
|
+
},
|
|
297
|
+
"description": "Sets state of toast to visible",
|
|
298
|
+
"fieldName": "visible"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"superclass": {
|
|
302
|
+
"name": "LitElement",
|
|
303
|
+
"package": "lit"
|
|
304
|
+
},
|
|
305
|
+
"tagName": "auro-toast",
|
|
306
|
+
"customElement": true,
|
|
307
|
+
"modulePath": "src/auro-toast.js"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"exports": [
|
|
311
|
+
{
|
|
312
|
+
"kind": "js",
|
|
313
|
+
"name": "AuroToast",
|
|
314
|
+
"declaration": {
|
|
315
|
+
"name": "AuroToast",
|
|
316
|
+
"module": "src/auro-toast.js"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"kind": "javascript-module",
|
|
323
|
+
"path": "src/auro-toaster.js",
|
|
324
|
+
"declarations": [
|
|
325
|
+
{
|
|
326
|
+
"kind": "class",
|
|
327
|
+
"description": "",
|
|
328
|
+
"name": "AuroToaster",
|
|
329
|
+
"members": [
|
|
330
|
+
{
|
|
331
|
+
"kind": "field",
|
|
332
|
+
"name": "_announcedErrorToasts",
|
|
333
|
+
"default": "new WeakSet()"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "field",
|
|
337
|
+
"name": "_assertiveResetTimer",
|
|
338
|
+
"default": "undefined"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"kind": "method",
|
|
342
|
+
"name": "_onSlotChange",
|
|
343
|
+
"parameters": [
|
|
344
|
+
{
|
|
345
|
+
"name": "e"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"description": "Handles slot changes — checks if a newly slotted error toast\nis already visible at the time it is added to the toaster.",
|
|
349
|
+
"privacy": "private"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"kind": "field",
|
|
353
|
+
"name": "_onToastRequestAnnounce"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"kind": "method",
|
|
357
|
+
"name": "_setAssertiveTemporarily",
|
|
358
|
+
"description": "Temporarily sets the live region to assertive so the error toast\ninterrupts the screen reader, then resets to polite after 3 seconds.\nThis ensures subsequent polite toasts don't keep interrupting the user,\neven if the error toast remains visible (errors are never auto-dismissed).",
|
|
359
|
+
"privacy": "private"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"kind": "method",
|
|
363
|
+
"name": "register",
|
|
364
|
+
"static": true,
|
|
365
|
+
"parameters": [
|
|
366
|
+
{
|
|
367
|
+
"name": "name",
|
|
368
|
+
"default": "\"auro-toaster\"",
|
|
369
|
+
"description": "The name of the element that you want to register to.",
|
|
370
|
+
"optional": true,
|
|
371
|
+
"type": {
|
|
372
|
+
"text": "string"
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
"description": "This will register this element with the browser."
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"superclass": {
|
|
380
|
+
"name": "LitElement",
|
|
381
|
+
"package": "lit"
|
|
382
|
+
},
|
|
383
|
+
"customElement": true,
|
|
384
|
+
"modulePath": "src/auro-toaster.js"
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"exports": [
|
|
388
|
+
{
|
|
389
|
+
"kind": "js",
|
|
390
|
+
"name": "AuroToaster",
|
|
391
|
+
"declaration": {
|
|
392
|
+
"name": "AuroToaster",
|
|
393
|
+
"module": "src/auro-toaster.js"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"kind": "javascript-module",
|
|
400
|
+
"path": "src/buttonVersion.js",
|
|
401
|
+
"declarations": [],
|
|
402
|
+
"exports": [
|
|
403
|
+
{
|
|
404
|
+
"kind": "js",
|
|
405
|
+
"name": "default",
|
|
406
|
+
"declaration": {
|
|
407
|
+
"name": "12.3.2",
|
|
408
|
+
"module": "src/buttonVersion.js"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"kind": "javascript-module",
|
|
415
|
+
"path": "src/iconVersion.js",
|
|
416
|
+
"declarations": [],
|
|
417
|
+
"exports": [
|
|
418
|
+
{
|
|
419
|
+
"kind": "js",
|
|
420
|
+
"name": "default",
|
|
421
|
+
"declaration": {
|
|
422
|
+
"name": "9.2.0",
|
|
423
|
+
"module": "src/iconVersion.js"
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"kind": "javascript-module",
|
|
430
|
+
"path": "src/index.js",
|
|
431
|
+
"declarations": [],
|
|
432
|
+
"exports": [
|
|
433
|
+
{
|
|
434
|
+
"kind": "js",
|
|
435
|
+
"name": "AuroToast",
|
|
436
|
+
"declaration": {
|
|
437
|
+
"name": "AuroToast",
|
|
438
|
+
"module": "src/index.js"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"kind": "js",
|
|
443
|
+
"name": "AuroToaster",
|
|
444
|
+
"declaration": {
|
|
445
|
+
"name": "AuroToaster",
|
|
446
|
+
"module": "src/index.js"
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
]
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"kind": "javascript-module",
|
|
453
|
+
"path": "src/registered.js",
|
|
454
|
+
"declarations": [],
|
|
455
|
+
"exports": []
|
|
456
|
+
}
|
|
457
|
+
]
|
|
458
|
+
}
|
package/demo/api.md
CHANGED
|
@@ -9,9 +9,9 @@ The `auro-toast` element provides users a way to display short, temporary messag
|
|
|
9
9
|
|
|
10
10
|
| Properties | Attributes | Modifiers | Type | Default | Description |
|
|
11
11
|
| --------------- | --------------- | --------- | -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
12
|
-
| disableAutoHide |
|
|
13
|
-
| noIcon |
|
|
14
|
-
| timeTilHide |
|
|
12
|
+
| disableAutoHide | disableautohide | | boolean | | Prevents the toast from auto-hiding on the default time. |
|
|
13
|
+
| noIcon | noicon | | boolean | | Removes icon from the toast UI. |
|
|
14
|
+
| timeTilHide | timetilhide | | number | | Sets the time in milliseconds until the toast hides. |
|
|
15
15
|
| trigger | trigger | | string | | The id of the element that triggered the toast.<br>When the toast is manually closed, focus will return to this element.<br>Takes precedence over the triggerElement property if both are set. |
|
|
16
16
|
| triggerElement | | | HTMLElement | | A direct reference to the element that triggered the toast.<br>When the toast is manually closed, focus will return to this element.<br>Use the trigger attribute instead if you prefer a declarative approach. |
|
|
17
17
|
| variant | variant | | `error` \| `success` \| `custom` | | Component will render visually based on which variant value is set. |
|
|
@@ -25,9 +25,10 @@ The `auro-toast` element provides users a way to display short, temporary messag
|
|
|
25
25
|
|
|
26
26
|
### Events
|
|
27
27
|
|
|
28
|
-
| Name | Description
|
|
29
|
-
| ------------ |
|
|
30
|
-
|
|
|
28
|
+
| Name | Description |
|
|
29
|
+
| ------------ | ------------------------------------------------ |
|
|
30
|
+
| toast-close | Notifies that the toast has been closed |
|
|
31
|
+
| onToastClose | **Deprecated**, use `toast-close` event instead. |
|
|
31
32
|
|
|
32
33
|
### CSS Shadow Parts
|
|
33
34
|
|
|
@@ -513,7 +514,7 @@ export function initDynamicToastsExample() {
|
|
|
513
514
|
console.log("Toast added:", toastId);
|
|
514
515
|
|
|
515
516
|
// optional cleanup if your component doesn't auto-remove itself
|
|
516
|
-
toast.addEventListener("
|
|
517
|
+
toast.addEventListener("toast-close", () => {
|
|
517
518
|
activeToasts.delete(toastId);
|
|
518
519
|
});
|
|
519
520
|
});
|