@warp-ds/elements 2.9.0-next.2 → 2.9.0-next.4
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 +101 -173
- package/dist/docs/affix/accessibility.md +1 -0
- package/dist/docs/affix/affix.md +58 -0
- package/dist/docs/affix/api.md +44 -0
- package/dist/docs/affix/examples.md +1 -0
- package/dist/docs/affix/usage.md +1 -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/accessibility.md +1 -0
- package/dist/docs/attention/api.md +132 -0
- package/dist/docs/attention/attention.md +144 -0
- package/dist/docs/attention/examples.md +1 -0
- package/dist/docs/attention/usage.md +1 -0
- package/dist/docs/badge/accessibility.md +1 -0
- package/dist/docs/badge/api.md +28 -0
- package/dist/docs/badge/badge.md +42 -0
- package/dist/docs/badge/examples.md +1 -0
- package/dist/docs/badge/usage.md +1 -0
- package/dist/docs/box/accessibility.md +1 -0
- package/dist/docs/box/api.md +52 -0
- package/dist/docs/box/box.md +66 -0
- package/dist/docs/box/examples.md +1 -0
- package/dist/docs/box/usage.md +1 -0
- package/dist/docs/breadcrumbs/accessibility.md +1 -0
- package/dist/docs/breadcrumbs/api.md +20 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +34 -0
- package/dist/docs/breadcrumbs/examples.md +1 -0
- package/dist/docs/breadcrumbs/usage.md +1 -0
- package/dist/docs/button/accessibility.md +1 -0
- package/dist/docs/button/api.md +155 -0
- package/dist/docs/button/button.md +169 -0
- package/dist/docs/button/examples.md +1 -0
- package/dist/docs/button/usage.md +1 -0
- package/dist/docs/card/accessibility.md +1 -0
- package/dist/docs/card/api.md +44 -0
- package/dist/docs/card/card.md +58 -0
- package/dist/docs/card/examples.md +1 -0
- package/dist/docs/card/usage.md +1 -0
- package/dist/docs/combobox/accessibility.md +1 -0
- package/dist/docs/combobox/api.md +132 -0
- package/dist/docs/combobox/combobox.md +146 -0
- package/dist/docs/combobox/examples.md +1 -0
- package/dist/docs/combobox/usage.md +1 -0
- package/dist/docs/datepicker/accessibility.md +1 -0
- package/dist/docs/datepicker/api.md +184 -0
- package/dist/docs/datepicker/datepicker.md +200 -0
- package/dist/docs/datepicker/examples.md +1 -0
- package/dist/docs/datepicker/usage.md +1 -0
- package/dist/docs/expandable/accessibility.md +1 -0
- package/dist/docs/expandable/api.md +100 -0
- package/dist/docs/expandable/examples.md +1 -0
- package/dist/docs/expandable/expandable.md +114 -0
- package/dist/docs/expandable/usage.md +1 -0
- package/dist/docs/link/accessibility.md +1 -0
- package/dist/docs/link/api.md +87 -0
- package/dist/docs/link/examples.md +1 -0
- package/dist/docs/link/link.md +101 -0
- package/dist/docs/link/usage.md +1 -0
- package/dist/docs/page-indicator/accessibility.md +1 -0
- package/dist/docs/page-indicator/api.md +28 -0
- package/dist/docs/page-indicator/examples.md +1 -0
- package/dist/docs/page-indicator/page-indicator.md +41 -0
- package/dist/docs/page-indicator/usage.md +1 -0
- package/dist/docs/pagination/accessibility.md +1 -0
- package/dist/docs/pagination/api.md +44 -0
- package/dist/docs/pagination/examples.md +1 -0
- package/dist/docs/pagination/pagination.md +58 -0
- package/dist/docs/pagination/usage.md +1 -0
- package/dist/docs/pill/accessibility.md +1 -0
- package/dist/docs/pill/api.md +76 -0
- package/dist/docs/pill/examples.md +1 -0
- package/dist/docs/pill/pill.md +90 -0
- package/dist/docs/pill/usage.md +1 -0
- package/dist/docs/select/accessibility.md +1 -0
- package/dist/docs/select/api.md +124 -0
- package/dist/docs/select/examples.md +1 -0
- package/dist/docs/select/select.md +138 -0
- package/dist/docs/select/usage.md +1 -0
- package/dist/docs/slider/accessibility.md +1 -0
- package/dist/docs/slider/api.md +220 -0
- package/dist/docs/slider/examples.md +1 -0
- package/dist/docs/slider/slider.md +234 -0
- package/dist/docs/slider/usage.md +1 -0
- package/dist/docs/slider-thumb/accessibility.md +1 -0
- package/dist/docs/slider-thumb/api.md +164 -0
- package/dist/docs/slider-thumb/examples.md +1 -0
- package/dist/docs/slider-thumb/slider-thumb.md +178 -0
- package/dist/docs/slider-thumb/usage.md +1 -0
- package/dist/docs/step/accessibility.md +1 -0
- package/dist/docs/step/api.md +28 -0
- package/dist/docs/step/examples.md +1 -0
- package/dist/docs/step/step.md +40 -0
- package/dist/docs/step/usage.md +1 -0
- package/dist/docs/step-indicator/accessibility.md +1 -0
- package/dist/docs/step-indicator/api.md +28 -0
- package/dist/docs/step-indicator/examples.md +1 -0
- package/dist/docs/step-indicator/step-indicator.md +42 -0
- package/dist/docs/step-indicator/usage.md +1 -0
- package/dist/docs/switch/accessibility.md +1 -0
- package/dist/docs/switch/api.md +52 -0
- package/dist/docs/switch/examples.md +1 -0
- package/dist/docs/switch/switch.md +64 -0
- package/dist/docs/switch/usage.md +1 -0
- package/dist/docs/tab/accessibility.md +1 -0
- package/dist/docs/tab/api.md +92 -0
- package/dist/docs/tab/examples.md +1 -0
- package/dist/docs/tab/tab.md +106 -0
- package/dist/docs/tab/usage.md +1 -0
- package/dist/docs/tab-panel/accessibility.md +1 -0
- package/dist/docs/tab-panel/api.md +37 -0
- package/dist/docs/tab-panel/examples.md +1 -0
- package/dist/docs/tab-panel/tab-panel.md +52 -0
- package/dist/docs/tab-panel/usage.md +1 -0
- package/dist/docs/tabs/accessibility.md +1 -0
- package/dist/docs/tabs/api.md +36 -0
- package/dist/docs/tabs/examples.md +1 -0
- package/dist/docs/tabs/tabs.md +50 -0
- package/dist/docs/tabs/usage.md +1 -0
- package/dist/docs/textarea/accessibility.md +1 -0
- package/dist/docs/textarea/api.md +156 -0
- package/dist/docs/textarea/examples.md +1 -0
- package/dist/docs/textarea/textarea.md +170 -0
- package/dist/docs/textarea/usage.md +1 -0
- package/dist/docs/textfield/accessibility.md +1 -0
- package/dist/docs/textfield/api.md +204 -0
- package/dist/docs/textfield/examples.md +1 -0
- package/dist/docs/textfield/textfield.md +218 -0
- package/dist/docs/textfield/usage.md +1 -0
- package/dist/docs/toast/accessibility.md +9 -0
- package/dist/docs/toast/api.md +71 -0
- package/dist/docs/toast/examples.md +29 -0
- package/dist/docs/toast/toast.md +150 -0
- package/dist/docs/toast/usage.md +31 -0
- package/dist/index.d.ts +104 -97
- package/dist/packages/affix/affix.d.ts +16 -2
- 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.d.ts +52 -0
- package/dist/packages/attention/attention.js +5 -5
- package/dist/packages/attention/attention.js.map +2 -2
- package/dist/packages/badge/badge.d.ts +8 -0
- package/dist/packages/badge/badge.js.map +2 -2
- package/dist/packages/box/box.d.ts +20 -0
- package/dist/packages/box/box.js.map +2 -2
- package/dist/packages/button/button.d.ts +60 -2
- package/dist/packages/button/button.js.map +2 -2
- package/dist/packages/card/card.d.ts +12 -0
- package/dist/packages/card/card.js.map +2 -2
- package/dist/packages/combobox/combobox.d.ts +60 -15
- package/dist/packages/combobox/combobox.js.map +2 -2
- package/dist/packages/datepicker/datepicker.d.ts +32 -5
- package/dist/packages/datepicker/datepicker.js +1 -1
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/expandable/expandable.d.ts +44 -0
- 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/link/link.d.ts +32 -0
- package/dist/packages/link/link.js.map +2 -2
- package/dist/packages/modal-header/modal-header.js +6 -6
- package/dist/packages/modal-header/modal-header.js.map +2 -2
- package/dist/packages/page-indicator/page-indicator.d.ts +8 -2
- package/dist/packages/page-indicator/page-indicator.js.map +2 -2
- package/dist/packages/pagination/pagination.d.ts +16 -0
- package/dist/packages/pagination/pagination.js +3 -3
- package/dist/packages/pagination/pagination.js.map +2 -2
- package/dist/packages/pill/pill.d.ts +24 -2
- package/dist/packages/pill/pill.js +3 -3
- package/dist/packages/pill/pill.js.map +2 -2
- package/dist/packages/select/select.d.ts +56 -12
- package/dist/packages/select/select.js +4 -4
- package/dist/packages/select/select.js.map +2 -2
- package/dist/packages/slider/slider.d.ts +65 -8
- package/dist/packages/slider/slider.js +7 -7
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.test.js +68 -0
- package/dist/packages/slider-thumb/slider-thumb.d.ts +44 -6
- package/dist/packages/slider-thumb/slider-thumb.js +24 -23
- package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
- package/dist/packages/step/step.d.ts +8 -0
- package/dist/packages/step/step.js +4 -4
- package/dist/packages/step/step.js.map +2 -2
- package/dist/packages/step-indicator/step-indicator.d.ts +8 -0
- package/dist/packages/step-indicator/step-indicator.js.map +2 -2
- package/dist/packages/switch/switch.d.ts +16 -0
- package/dist/packages/switch/switch.js.map +2 -2
- package/dist/packages/tab/tab.d.ts +28 -3
- package/dist/packages/tab/tab.js.map +2 -2
- package/dist/packages/tab-panel/tab-panel.d.ts +8 -2
- package/dist/packages/tab-panel/tab-panel.js.map +2 -2
- package/dist/packages/tabs/tabs.d.ts +4 -0
- package/dist/packages/tabs/tabs.js.map +2 -2
- package/dist/packages/textarea/textarea.d.ts +52 -1
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/packages/textfield/textfield.d.ts +92 -4
- package/dist/packages/textfield/textfield.js.map +2 -2
- package/dist/packages/toast/toast.js +4 -4
- package/dist/packages/toast/toast.js.map +2 -2
- package/dist/packages/toast-container/toast-container.d.ts +14 -0
- package/dist/packages/toast-container/toast-container.js.map +2 -2
- package/dist/web-types.json +77 -225
- package/package.json +8 -3
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
## Accessibility
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
## API Documentation
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
| Name | Type | Default | Summary |
|
|
20
|
+
|-|-|-|-|
|
|
21
|
+
| ariaLabel | `string` | `-` | - |
|
|
22
|
+
| clear | `boolean` | `false` | - |
|
|
23
|
+
| search | `boolean` | `false` | - |
|
|
24
|
+
| label | `string` | `-` | - |
|
|
25
|
+
|
|
26
|
+
### Property Details
|
|
27
|
+
|
|
28
|
+
#### ariaLabel
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- Type: `string`
|
|
33
|
+
- Default: `-`
|
|
34
|
+
|
|
35
|
+
#### clear
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
- Type: `boolean`
|
|
40
|
+
- Default: `false`
|
|
41
|
+
|
|
42
|
+
#### search
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
- Type: `boolean`
|
|
47
|
+
- Default: `false`
|
|
48
|
+
|
|
49
|
+
#### label
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- Type: `string`
|
|
54
|
+
- Default: `-`
|
|
55
|
+
|
|
56
|
+
### Types
|
|
57
|
+
|
|
58
|
+
No types documented.
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
|
|
24
|
+
|
|
25
|
+
- Type: `boolean`
|
|
26
|
+
- Default: `false`
|
|
27
|
+
|
|
28
|
+
#### search
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- Type: `boolean`
|
|
33
|
+
- Default: `false`
|
|
34
|
+
|
|
35
|
+
#### label
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
- Type: `string`
|
|
40
|
+
- Default: `-`
|
|
41
|
+
|
|
42
|
+
### Types
|
|
43
|
+
|
|
44
|
+
No types documented.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Examples
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Usage
|
|
@@ -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 @@
|
|
|
1
|
+
## Accessibility
|
|
@@ -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.
|