@warp-ds/elements 2.9.0-next.2 → 2.9.0-next.3
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/dist/custom-elements.json +17 -3
- package/dist/docs/affix/affix.md +56 -0
- package/dist/docs/affix/api.md +48 -0
- package/dist/docs/alert/accessibility.md +30 -0
- package/dist/docs/alert/alert.md +208 -0
- package/dist/docs/alert/api.md +39 -0
- package/dist/docs/alert/examples.md +84 -0
- package/dist/docs/alert/usage.md +42 -0
- package/dist/docs/attention/api.md +132 -0
- package/dist/docs/attention/attention.md +138 -0
- package/dist/docs/badge/api.md +28 -0
- package/dist/docs/badge/badge.md +36 -0
- package/dist/docs/box/api.md +52 -0
- package/dist/docs/box/box.md +60 -0
- package/dist/docs/breadcrumbs/api.md +20 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +28 -0
- package/dist/docs/button/api.md +155 -0
- package/dist/docs/button/button.md +163 -0
- package/dist/docs/card/api.md +44 -0
- package/dist/docs/card/card.md +52 -0
- package/dist/docs/combobox/api.md +132 -0
- package/dist/docs/combobox/combobox.md +140 -0
- package/dist/docs/datepicker/api.md +192 -0
- package/dist/docs/datepicker/datepicker.md +202 -0
- package/dist/docs/expandable/api.md +100 -0
- package/dist/docs/expandable/expandable.md +108 -0
- package/dist/docs/link/api.md +87 -0
- package/dist/docs/link/link.md +95 -0
- package/dist/docs/page-indicator/api.md +28 -0
- package/dist/docs/page-indicator/page-indicator.md +35 -0
- package/dist/docs/pagination/api.md +44 -0
- package/dist/docs/pagination/pagination.md +52 -0
- package/dist/docs/pill/api.md +76 -0
- package/dist/docs/pill/pill.md +84 -0
- package/dist/docs/select/api.md +116 -0
- package/dist/docs/select/select.md +124 -0
- package/dist/docs/slider/api.md +214 -0
- package/dist/docs/slider/slider.md +222 -0
- package/dist/docs/slider-thumb/api.md +116 -0
- package/dist/docs/slider-thumb/slider-thumb.md +124 -0
- package/dist/docs/step/api.md +28 -0
- package/dist/docs/step/step.md +34 -0
- package/dist/docs/step-indicator/api.md +28 -0
- package/dist/docs/step-indicator/step-indicator.md +36 -0
- package/dist/docs/switch/api.md +52 -0
- package/dist/docs/switch/switch.md +58 -0
- package/dist/docs/tab/api.md +76 -0
- package/dist/docs/tab/tab.md +84 -0
- package/dist/docs/tab-panel/api.md +21 -0
- package/dist/docs/tab-panel/tab-panel.md +30 -0
- package/dist/docs/tabs/api.md +36 -0
- package/dist/docs/tabs/tabs.md +44 -0
- package/dist/docs/textarea/api.md +156 -0
- package/dist/docs/textarea/textarea.md +164 -0
- package/dist/docs/textfield/api.md +194 -0
- package/dist/docs/textfield/textfield.md +202 -0
- package/dist/docs/toast-container/api.md +14 -0
- package/dist/docs/toast-container/toast-container.md +20 -0
- package/dist/packages/affix/affix.js +5 -5
- package/dist/packages/affix/affix.js.map +2 -2
- package/dist/packages/alert/alert.d.ts +15 -0
- package/dist/packages/alert/alert.js +6 -6
- package/dist/packages/alert/alert.js.map +2 -2
- package/dist/packages/attention/attention.js +5 -5
- package/dist/packages/attention/attention.js.map +2 -2
- package/dist/packages/datepicker/datepicker.js +1 -1
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/expandable/expandable.js +7 -7
- package/dist/packages/expandable/expandable.js.map +2 -2
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +2 -2
- package/dist/packages/icon/icon.test.js +14 -0
- package/dist/packages/modal-header/modal-header.js +6 -6
- package/dist/packages/modal-header/modal-header.js.map +2 -2
- package/dist/packages/pagination/pagination.js +3 -3
- package/dist/packages/pagination/pagination.js.map +2 -2
- package/dist/packages/pill/pill.js +3 -3
- package/dist/packages/pill/pill.js.map +2 -2
- package/dist/packages/select/select.js +4 -4
- package/dist/packages/select/select.js.map +2 -2
- package/dist/packages/step/step.js +4 -4
- package/dist/packages/step/step.js.map +2 -2
- package/dist/packages/toast/toast.js +4 -4
- package/dist/packages/toast/toast.js.map +2 -2
- package/dist/web-types.json +18 -5
- package/package.json +7 -2
|
@@ -269,11 +269,14 @@
|
|
|
269
269
|
"type": {
|
|
270
270
|
"text": "AlertVariants"
|
|
271
271
|
},
|
|
272
|
+
"default": "'info'",
|
|
273
|
+
"summary": "Visual style of the alert.",
|
|
272
274
|
"attribute": "variant",
|
|
273
275
|
"reflects": true,
|
|
274
276
|
"parsedType": {
|
|
275
277
|
"text": "'negative' | 'positive' | 'warning' | 'info'"
|
|
276
|
-
}
|
|
278
|
+
},
|
|
279
|
+
"description": "Controls both the color treatment and icon used by the component. Accepted values are `info`, `warning`, `positive`, and `negative`. Use the variant that matches the message severity so users can quickly distinguish informative messages from warnings, errors, and confirmations."
|
|
277
280
|
},
|
|
278
281
|
{
|
|
279
282
|
"kind": "field",
|
|
@@ -281,8 +284,11 @@
|
|
|
281
284
|
"type": {
|
|
282
285
|
"text": "boolean"
|
|
283
286
|
},
|
|
287
|
+
"default": "false",
|
|
288
|
+
"summary": "Whether the alert is visible.",
|
|
284
289
|
"attribute": "show",
|
|
285
|
-
"reflects": true
|
|
290
|
+
"reflects": true,
|
|
291
|
+
"description": "Alerts are hidden by default (`false`). Set this to `true` to render and expand the content. This is reflected as an attribute, so visibility can be controlled from markup (`show`) or from JavaScript (`element.show = true`)."
|
|
286
292
|
},
|
|
287
293
|
{
|
|
288
294
|
"kind": "field",
|
|
@@ -291,7 +297,10 @@
|
|
|
291
297
|
"text": "string"
|
|
292
298
|
},
|
|
293
299
|
"default": "'alert'",
|
|
294
|
-
"
|
|
300
|
+
"summary": "ARIA role announced to assistive technology.",
|
|
301
|
+
"attribute": "role",
|
|
302
|
+
"reflects": true,
|
|
303
|
+
"description": "Defaults to `alert` so urgent changes are announced by screen readers. Override this only when your use case requires a different announcement behavior, for example a less assertive live region strategy."
|
|
295
304
|
}
|
|
296
305
|
],
|
|
297
306
|
"attributes": [
|
|
@@ -300,6 +309,8 @@
|
|
|
300
309
|
"type": {
|
|
301
310
|
"text": "AlertVariants"
|
|
302
311
|
},
|
|
312
|
+
"default": "'info'",
|
|
313
|
+
"summary": "Visual style of the alert.",
|
|
303
314
|
"fieldName": "variant",
|
|
304
315
|
"parsedType": {
|
|
305
316
|
"text": "'negative' | 'positive' | 'warning' | 'info'"
|
|
@@ -310,6 +321,8 @@
|
|
|
310
321
|
"type": {
|
|
311
322
|
"text": "boolean"
|
|
312
323
|
},
|
|
324
|
+
"default": "false",
|
|
325
|
+
"summary": "Whether the alert is visible.",
|
|
313
326
|
"fieldName": "show"
|
|
314
327
|
},
|
|
315
328
|
{
|
|
@@ -318,6 +331,7 @@
|
|
|
318
331
|
"text": "string"
|
|
319
332
|
},
|
|
320
333
|
"default": "'alert'",
|
|
334
|
+
"summary": "ARIA role announced to assistive technology.",
|
|
321
335
|
"fieldName": "role"
|
|
322
336
|
}
|
|
323
337
|
],
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Affix (w-affix)
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.
|
|
6
|
+
|
|
7
|
+
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-affix--docs)
|
|
8
|
+
|
|
9
|
+
## API Documentation
|
|
10
|
+
|
|
11
|
+
### Properties
|
|
12
|
+
|
|
13
|
+
| Name | Type | Default | Summary |
|
|
14
|
+
|-|-|-|-|
|
|
15
|
+
| ariaLabel | `string` | `-` | - |
|
|
16
|
+
| clear | `boolean` | `false` | - |
|
|
17
|
+
| search | `boolean` | `false` | - |
|
|
18
|
+
| label | `string` | `-` | - |
|
|
19
|
+
|
|
20
|
+
### Property Details
|
|
21
|
+
|
|
22
|
+
#### ariaLabel
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- Type: `string`
|
|
27
|
+
- Default: `-`
|
|
28
|
+
|
|
29
|
+
#### clear
|
|
30
|
+
|
|
31
|
+
Add this property to render a clickable Warp close icon.
|
|
32
|
+
|
|
33
|
+
Set an `aria-label` that explains the action when using this.
|
|
34
|
+
|
|
35
|
+
- Type: `boolean`
|
|
36
|
+
- Default: `false`
|
|
37
|
+
|
|
38
|
+
#### search
|
|
39
|
+
|
|
40
|
+
Add this property to render a clickable Warp search icon.
|
|
41
|
+
|
|
42
|
+
Set an `aria-label` that explains the action when using this.
|
|
43
|
+
|
|
44
|
+
- Type: `boolean`
|
|
45
|
+
- Default: `false`
|
|
46
|
+
|
|
47
|
+
#### label
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
- Type: `string`
|
|
52
|
+
- Default: `-`
|
|
53
|
+
|
|
54
|
+
### Types
|
|
55
|
+
|
|
56
|
+
No types documented.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## API Documentation
|
|
2
|
+
|
|
3
|
+
### Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Summary |
|
|
6
|
+
|-|-|-|-|
|
|
7
|
+
| ariaLabel | `string` | `-` | - |
|
|
8
|
+
| clear | `boolean` | `false` | - |
|
|
9
|
+
| search | `boolean` | `false` | - |
|
|
10
|
+
| label | `string` | `-` | - |
|
|
11
|
+
|
|
12
|
+
### Property Details
|
|
13
|
+
|
|
14
|
+
#### ariaLabel
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
- Type: `string`
|
|
19
|
+
- Default: `-`
|
|
20
|
+
|
|
21
|
+
#### clear
|
|
22
|
+
|
|
23
|
+
Add this property to render a clickable Warp close icon.
|
|
24
|
+
|
|
25
|
+
Set an `aria-label` that explains the action when using this.
|
|
26
|
+
|
|
27
|
+
- Type: `boolean`
|
|
28
|
+
- Default: `false`
|
|
29
|
+
|
|
30
|
+
#### search
|
|
31
|
+
|
|
32
|
+
Add this property to render a clickable Warp search icon.
|
|
33
|
+
|
|
34
|
+
Set an `aria-label` that explains the action when using this.
|
|
35
|
+
|
|
36
|
+
- Type: `boolean`
|
|
37
|
+
- Default: `false`
|
|
38
|
+
|
|
39
|
+
#### label
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- Type: `string`
|
|
44
|
+
- Default: `-`
|
|
45
|
+
|
|
46
|
+
### Types
|
|
47
|
+
|
|
48
|
+
No types documented.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## Accessibility
|
|
2
|
+
|
|
3
|
+
For accessibility reasons, an alert should appear close to the element that triggered it.
|
|
4
|
+
|
|
5
|
+
Use the ARIA live region `role` attribute to provide meaning to the alert
|
|
6
|
+
element (defaults to "alert").
|
|
7
|
+
|
|
8
|
+
If you want to remove the role from the alert and
|
|
9
|
+
assign it to its particular child (e.g. title), you can do so by setting `role`
|
|
10
|
+
property of the `Alert` component to an empty string and assigning a respective
|
|
11
|
+
`role` attribute on the child element.
|
|
12
|
+
|
|
13
|
+
<style-isolate>
|
|
14
|
+
<w-alert variant="info" show role="">
|
|
15
|
+
<h3 role="alert" class="t5">
|
|
16
|
+
This is an alert styled as an information box
|
|
17
|
+
</h3>
|
|
18
|
+
<p>In this example only the title has the role of alert. All alerts can have a description.</p>
|
|
19
|
+
</w-alert>
|
|
20
|
+
</style-isolate>
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<w-alert variant="info" show role="">
|
|
24
|
+
<h3 role="alert" class="t5">This is an alert styled as an information box</h3>
|
|
25
|
+
<p>In this example only the title has the role of alert. All alerts can have a description.</p>
|
|
26
|
+
</w-alert>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Read more about live region `role`
|
|
30
|
+
attribute on [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#roles_with_implicit_live_region_attributes).
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Alert (w-alert)
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Alert is an inline component used for displaying different types of messages.
|
|
6
|
+
|
|
7
|
+
For accessibility reasons, alert should appear close to the element that triggered it.
|
|
8
|
+
|
|
9
|
+
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/feedback-alert--docs)
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Alert is an inline component used for displaying different types of messages.
|
|
14
|
+
|
|
15
|
+
Use alerts for contextual feedback that appears close to the related UI element or action.
|
|
16
|
+
|
|
17
|
+
### Basic Alert
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<w-alert show>
|
|
21
|
+
We have updated your preferences.
|
|
22
|
+
</w-alert>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Variants
|
|
26
|
+
|
|
27
|
+
Choose a variant that matches message severity:
|
|
28
|
+
|
|
29
|
+
- `info`: neutral information
|
|
30
|
+
- `positive`: confirmation/success
|
|
31
|
+
- `warning`: caution
|
|
32
|
+
- `negative`: errors or critical issues
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<w-alert variant="info" show>Informational message</w-alert>
|
|
36
|
+
<w-alert variant="positive" show>Your changes were saved</w-alert>
|
|
37
|
+
<w-alert variant="warning" show>Double-check this value before continuing</w-alert>
|
|
38
|
+
<w-alert variant="negative" show>Something went wrong</w-alert>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Visibility
|
|
42
|
+
|
|
43
|
+
Alerts are hidden by default. Set `show` to display them.
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<w-alert id="profile-alert" variant="positive">Profile saved</w-alert>
|
|
47
|
+
|
|
48
|
+
<script type="module">
|
|
49
|
+
const alert = document.querySelector('#profile-alert');
|
|
50
|
+
alert.show = true;
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Accessibility
|
|
55
|
+
|
|
56
|
+
For accessibility reasons, an alert should appear close to the element that triggered it.
|
|
57
|
+
|
|
58
|
+
Use the ARIA live region `role` attribute to provide meaning to the alert
|
|
59
|
+
element (defaults to "alert").
|
|
60
|
+
|
|
61
|
+
If you want to remove the role from the alert and
|
|
62
|
+
assign it to its particular child (e.g. title), you can do so by setting `role`
|
|
63
|
+
property of the `Alert` component to an empty string and assigning a respective
|
|
64
|
+
`role` attribute on the child element.
|
|
65
|
+
|
|
66
|
+
<style-isolate>
|
|
67
|
+
<w-alert variant="info" show role="">
|
|
68
|
+
<h3 role="alert" class="t5">
|
|
69
|
+
This is an alert styled as an information box
|
|
70
|
+
</h3>
|
|
71
|
+
<p>In this example only the title has the role of alert. All alerts can have a description.</p>
|
|
72
|
+
</w-alert>
|
|
73
|
+
</style-isolate>
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<w-alert variant="info" show role="">
|
|
77
|
+
<h3 role="alert" class="t5">This is an alert styled as an information box</h3>
|
|
78
|
+
<p>In this example only the title has the role of alert. All alerts can have a description.</p>
|
|
79
|
+
</w-alert>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Read more about live region `role`
|
|
83
|
+
attribute on [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#roles_with_implicit_live_region_attributes).
|
|
84
|
+
|
|
85
|
+
## Examples
|
|
86
|
+
|
|
87
|
+
### Basic
|
|
88
|
+
|
|
89
|
+
<style-isolate>
|
|
90
|
+
<w-alert show>
|
|
91
|
+
<p>We have updated your preferences.</p>
|
|
92
|
+
</w-alert>
|
|
93
|
+
</style-isolate>
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<w-alert show>
|
|
97
|
+
<p>We have updated your preferences.</p>
|
|
98
|
+
</w-alert>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Info
|
|
102
|
+
|
|
103
|
+
<style-isolate>
|
|
104
|
+
<w-alert variant="info" show>
|
|
105
|
+
<p>This is an informational alert.</p>
|
|
106
|
+
</w-alert>
|
|
107
|
+
</style-isolate>
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<w-alert variant="info" show>
|
|
111
|
+
<p>This is an informational alert.</p>
|
|
112
|
+
</w-alert>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Warning
|
|
116
|
+
|
|
117
|
+
<style-isolate>
|
|
118
|
+
<w-alert variant="warning" show>
|
|
119
|
+
<p>Please double-check this value before continuing.</p>
|
|
120
|
+
</w-alert>
|
|
121
|
+
</style-isolate>
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<w-alert variant="warning" show>
|
|
125
|
+
<p>Please double-check this value before continuing.</p>
|
|
126
|
+
</w-alert>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Negative
|
|
130
|
+
|
|
131
|
+
<style-isolate>
|
|
132
|
+
<w-alert variant="negative" show>
|
|
133
|
+
<p>Something went wrong. Try again.</p>
|
|
134
|
+
</w-alert>
|
|
135
|
+
</style-isolate>
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<w-alert variant="negative" show>
|
|
139
|
+
<p>Something went wrong. Try again.</p>
|
|
140
|
+
</w-alert>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Positive
|
|
144
|
+
|
|
145
|
+
<style-isolate>
|
|
146
|
+
<w-alert variant="positive" show>
|
|
147
|
+
<p>Your changes were saved successfully.</p>
|
|
148
|
+
</w-alert>
|
|
149
|
+
</style-isolate>
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<w-alert variant="positive" show>
|
|
153
|
+
<p>Your changes were saved successfully.</p>
|
|
154
|
+
</w-alert>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Programmatic Visibility
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<w-alert id="profile-alert" variant="positive">
|
|
161
|
+
<p>Profile saved</p>
|
|
162
|
+
</w-alert>
|
|
163
|
+
|
|
164
|
+
<script type="module">
|
|
165
|
+
const alert = document.querySelector('#profile-alert');
|
|
166
|
+
alert.show = true;
|
|
167
|
+
</script>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## API Documentation
|
|
171
|
+
|
|
172
|
+
### Properties
|
|
173
|
+
|
|
174
|
+
| Name | Type | Default | Summary |
|
|
175
|
+
|-|-|-|-|
|
|
176
|
+
| variant | [`AlertVariants`](#alertvariants) | `'info'` | Visual style of the alert. |
|
|
177
|
+
| show | `boolean` | `false` | Whether the alert is visible. |
|
|
178
|
+
| role | `string` | `'alert'` | ARIA role announced to assistive technology. |
|
|
179
|
+
|
|
180
|
+
### Property Details
|
|
181
|
+
|
|
182
|
+
#### variant
|
|
183
|
+
|
|
184
|
+
Controls both the color treatment and icon used by the component. Accepted values are `info`, `warning`, `positive`, and `negative`. Use the variant that matches the message severity so users can quickly distinguish informative messages from warnings, errors, and confirmations.
|
|
185
|
+
|
|
186
|
+
- Type: [`AlertVariants`](#alertvariants)
|
|
187
|
+
- Default: `'info'`
|
|
188
|
+
|
|
189
|
+
#### show
|
|
190
|
+
|
|
191
|
+
Alerts are hidden by default (`false`). Set this to `true` to render and expand the content. This is reflected as an attribute, so visibility can be controlled from markup (`show`) or from JavaScript (`element.show = true`).
|
|
192
|
+
|
|
193
|
+
- Type: `boolean`
|
|
194
|
+
- Default: `false`
|
|
195
|
+
|
|
196
|
+
#### role
|
|
197
|
+
|
|
198
|
+
Defaults to `alert` so urgent changes are announced by screen readers. Override this only when your use case requires a different announcement behavior, for example a less assertive live region strategy.
|
|
199
|
+
|
|
200
|
+
- Type: `string`
|
|
201
|
+
- Default: `'alert'`
|
|
202
|
+
|
|
203
|
+
### Types
|
|
204
|
+
|
|
205
|
+
#### AlertVariants
|
|
206
|
+
|
|
207
|
+
`'negative' | 'positive' | 'warning' | 'info'`
|
|
208
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
## API Documentation
|
|
2
|
+
|
|
3
|
+
### Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Summary |
|
|
6
|
+
|-|-|-|-|
|
|
7
|
+
| variant | [`AlertVariants`](#alertvariants) | `'info'` | Visual style of the alert. |
|
|
8
|
+
| show | `boolean` | `false` | Whether the alert is visible. |
|
|
9
|
+
| role | `string` | `'alert'` | ARIA role announced to assistive technology. |
|
|
10
|
+
|
|
11
|
+
### Property Details
|
|
12
|
+
|
|
13
|
+
#### variant
|
|
14
|
+
|
|
15
|
+
Controls both the color treatment and icon used by the component. Accepted values are `info`, `warning`, `positive`, and `negative`. Use the variant that matches the message severity so users can quickly distinguish informative messages from warnings, errors, and confirmations.
|
|
16
|
+
|
|
17
|
+
- Type: [`AlertVariants`](#alertvariants)
|
|
18
|
+
- Default: `'info'`
|
|
19
|
+
|
|
20
|
+
#### show
|
|
21
|
+
|
|
22
|
+
Alerts are hidden by default (`false`). Set this to `true` to render and expand the content. This is reflected as an attribute, so visibility can be controlled from markup (`show`) or from JavaScript (`element.show = true`).
|
|
23
|
+
|
|
24
|
+
- Type: `boolean`
|
|
25
|
+
- Default: `false`
|
|
26
|
+
|
|
27
|
+
#### role
|
|
28
|
+
|
|
29
|
+
Defaults to `alert` so urgent changes are announced by screen readers. Override this only when your use case requires a different announcement behavior, for example a less assertive live region strategy.
|
|
30
|
+
|
|
31
|
+
- Type: `string`
|
|
32
|
+
- Default: `'alert'`
|
|
33
|
+
|
|
34
|
+
### Types
|
|
35
|
+
|
|
36
|
+
#### AlertVariants
|
|
37
|
+
|
|
38
|
+
`'negative' | 'positive' | 'warning' | 'info'`
|
|
39
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
## Examples
|
|
2
|
+
|
|
3
|
+
### Basic
|
|
4
|
+
|
|
5
|
+
<style-isolate>
|
|
6
|
+
<w-alert show>
|
|
7
|
+
<p>We have updated your preferences.</p>
|
|
8
|
+
</w-alert>
|
|
9
|
+
</style-isolate>
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<w-alert show>
|
|
13
|
+
<p>We have updated your preferences.</p>
|
|
14
|
+
</w-alert>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Info
|
|
18
|
+
|
|
19
|
+
<style-isolate>
|
|
20
|
+
<w-alert variant="info" show>
|
|
21
|
+
<p>This is an informational alert.</p>
|
|
22
|
+
</w-alert>
|
|
23
|
+
</style-isolate>
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<w-alert variant="info" show>
|
|
27
|
+
<p>This is an informational alert.</p>
|
|
28
|
+
</w-alert>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Warning
|
|
32
|
+
|
|
33
|
+
<style-isolate>
|
|
34
|
+
<w-alert variant="warning" show>
|
|
35
|
+
<p>Please double-check this value before continuing.</p>
|
|
36
|
+
</w-alert>
|
|
37
|
+
</style-isolate>
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<w-alert variant="warning" show>
|
|
41
|
+
<p>Please double-check this value before continuing.</p>
|
|
42
|
+
</w-alert>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Negative
|
|
46
|
+
|
|
47
|
+
<style-isolate>
|
|
48
|
+
<w-alert variant="negative" show>
|
|
49
|
+
<p>Something went wrong. Try again.</p>
|
|
50
|
+
</w-alert>
|
|
51
|
+
</style-isolate>
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<w-alert variant="negative" show>
|
|
55
|
+
<p>Something went wrong. Try again.</p>
|
|
56
|
+
</w-alert>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Positive
|
|
60
|
+
|
|
61
|
+
<style-isolate>
|
|
62
|
+
<w-alert variant="positive" show>
|
|
63
|
+
<p>Your changes were saved successfully.</p>
|
|
64
|
+
</w-alert>
|
|
65
|
+
</style-isolate>
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<w-alert variant="positive" show>
|
|
69
|
+
<p>Your changes were saved successfully.</p>
|
|
70
|
+
</w-alert>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Programmatic Visibility
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<w-alert id="profile-alert" variant="positive">
|
|
77
|
+
<p>Profile saved</p>
|
|
78
|
+
</w-alert>
|
|
79
|
+
|
|
80
|
+
<script type="module">
|
|
81
|
+
const alert = document.querySelector('#profile-alert');
|
|
82
|
+
alert.show = true;
|
|
83
|
+
</script>
|
|
84
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
## Usage
|
|
2
|
+
|
|
3
|
+
Alert is an inline component used for displaying different types of messages.
|
|
4
|
+
|
|
5
|
+
Use alerts for contextual feedback that appears close to the related UI element or action.
|
|
6
|
+
|
|
7
|
+
### Basic Alert
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<w-alert show>
|
|
11
|
+
We have updated your preferences.
|
|
12
|
+
</w-alert>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Variants
|
|
16
|
+
|
|
17
|
+
Choose a variant that matches message severity:
|
|
18
|
+
|
|
19
|
+
- `info`: neutral information
|
|
20
|
+
- `positive`: confirmation/success
|
|
21
|
+
- `warning`: caution
|
|
22
|
+
- `negative`: errors or critical issues
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<w-alert variant="info" show>Informational message</w-alert>
|
|
26
|
+
<w-alert variant="positive" show>Your changes were saved</w-alert>
|
|
27
|
+
<w-alert variant="warning" show>Double-check this value before continuing</w-alert>
|
|
28
|
+
<w-alert variant="negative" show>Something went wrong</w-alert>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Visibility
|
|
32
|
+
|
|
33
|
+
Alerts are hidden by default. Set `show` to display them.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<w-alert id="profile-alert" variant="positive">Profile saved</w-alert>
|
|
37
|
+
|
|
38
|
+
<script type="module">
|
|
39
|
+
const alert = document.querySelector('#profile-alert');
|
|
40
|
+
alert.show = true;
|
|
41
|
+
</script>
|
|
42
|
+
```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
## API Documentation
|
|
2
|
+
|
|
3
|
+
### Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Summary |
|
|
6
|
+
|-|-|-|-|
|
|
7
|
+
| show | `boolean` | `false` | - |
|
|
8
|
+
| placement | `Directions` | `'bottom'` | - |
|
|
9
|
+
| tooltip | `boolean` | `false` | - |
|
|
10
|
+
| callout | `boolean` | `false` | - |
|
|
11
|
+
| popover | `boolean` | `false` | - |
|
|
12
|
+
| highlight | `boolean` | `false` | - |
|
|
13
|
+
| canClose | `boolean` | `false` | - |
|
|
14
|
+
| noArrow | `boolean` | `false` | - |
|
|
15
|
+
| distance | `number` | `8` | - |
|
|
16
|
+
| skidding | `number` | `0` | - |
|
|
17
|
+
| flip | `boolean` | `false` | - |
|
|
18
|
+
| crossAxis | `boolean` | `false` | - |
|
|
19
|
+
| fallbackPlacements | `Directions[]` | `-` | - |
|
|
20
|
+
| _initialPlacement | `unknown` | `-` | - |
|
|
21
|
+
| _actualDirection | `unknown` | `-` | - |
|
|
22
|
+
|
|
23
|
+
### Property Details
|
|
24
|
+
|
|
25
|
+
#### show
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- Type: `boolean`
|
|
30
|
+
- Default: `false`
|
|
31
|
+
|
|
32
|
+
#### placement
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
- Type: `Directions`
|
|
37
|
+
- Default: `'bottom'`
|
|
38
|
+
|
|
39
|
+
#### tooltip
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- Type: `boolean`
|
|
44
|
+
- Default: `false`
|
|
45
|
+
|
|
46
|
+
#### callout
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
- Type: `boolean`
|
|
51
|
+
- Default: `false`
|
|
52
|
+
|
|
53
|
+
#### popover
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
- Type: `boolean`
|
|
58
|
+
- Default: `false`
|
|
59
|
+
|
|
60
|
+
#### highlight
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- Type: `boolean`
|
|
65
|
+
- Default: `false`
|
|
66
|
+
|
|
67
|
+
#### canClose
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
- Type: `boolean`
|
|
72
|
+
- Default: `false`
|
|
73
|
+
|
|
74
|
+
#### noArrow
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
- Type: `boolean`
|
|
79
|
+
- Default: `false`
|
|
80
|
+
|
|
81
|
+
#### distance
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
- Type: `number`
|
|
86
|
+
- Default: `8`
|
|
87
|
+
|
|
88
|
+
#### skidding
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
- Type: `number`
|
|
93
|
+
- Default: `0`
|
|
94
|
+
|
|
95
|
+
#### flip
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
- Type: `boolean`
|
|
100
|
+
- Default: `false`
|
|
101
|
+
|
|
102
|
+
#### crossAxis
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
- Type: `boolean`
|
|
107
|
+
- Default: `false`
|
|
108
|
+
|
|
109
|
+
#### fallbackPlacements
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
- Type: `Directions[]`
|
|
114
|
+
- Default: `-`
|
|
115
|
+
|
|
116
|
+
#### _initialPlacement
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
- Type: `unknown`
|
|
121
|
+
- Default: `-`
|
|
122
|
+
|
|
123
|
+
#### _actualDirection
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
- Type: `unknown`
|
|
128
|
+
- Default: `-`
|
|
129
|
+
|
|
130
|
+
### Types
|
|
131
|
+
|
|
132
|
+
No types documented.
|