@warp-ds/elements 2.9.0-next.6 → 2.9.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/dist/custom-elements.json +62 -21
- package/dist/docs/affix/affix.md +24 -38
- package/dist/docs/affix/examples.md +24 -38
- package/dist/docs/alert/accessibility.md +4 -9
- package/dist/docs/alert/alert.md +24 -39
- package/dist/docs/alert/examples.md +20 -30
- package/dist/docs/attention/accessibility.md +50 -0
- package/dist/docs/attention/api.md +40 -27
- package/dist/docs/attention/attention.md +276 -27
- package/dist/docs/attention/examples.md +91 -0
- package/dist/docs/attention/usage.md +91 -0
- package/dist/docs/badge/badge.md +23 -36
- package/dist/docs/badge/examples.md +23 -36
- package/dist/docs/textarea/accessibility.md +5 -0
- package/dist/docs/textarea/api.md +32 -47
- package/dist/docs/textarea/examples.md +81 -0
- package/dist/docs/textarea/textarea.md +133 -49
- package/dist/docs/textarea/usage.md +9 -0
- package/dist/docs/textfield/examples.md +32 -49
- package/dist/docs/textfield/textfield.md +39 -60
- package/dist/docs/textfield/usage.md +7 -11
- package/dist/index.d.ts +236 -134
- package/dist/packages/attention/attention.d.ts +46 -37
- package/dist/packages/attention/attention.js +20 -20
- package/dist/packages/attention/attention.js.map +3 -3
- package/dist/packages/textarea/textarea.d.ts +38 -29
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/web-types.json +182 -38
- package/package.json +1 -2
|
@@ -10,15 +10,8 @@ assign it to its particular child (e.g. title), you can do so by setting `role`
|
|
|
10
10
|
property of the `Alert` component to an empty string and assigning a respective
|
|
11
11
|
`role` attribute on the child element.
|
|
12
12
|
|
|
13
|
-
<
|
|
14
|
-
|
|
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
|
-
|
|
13
|
+
<elements-example>
|
|
14
|
+
|
|
22
15
|
```html
|
|
23
16
|
<w-alert variant="info" show role="">
|
|
24
17
|
<h3 role="alert" class="t5">This is an alert styled as an information box</h3>
|
|
@@ -26,5 +19,7 @@ property of the `Alert` component to an empty string and assigning a respective
|
|
|
26
19
|
</w-alert>
|
|
27
20
|
```
|
|
28
21
|
|
|
22
|
+
</elements-example>
|
|
23
|
+
|
|
29
24
|
Read more about live region `role`
|
|
30
25
|
attribute on [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#roles_with_implicit_live_region_attributes).
|
package/dist/docs/alert/alert.md
CHANGED
|
@@ -63,15 +63,8 @@ assign it to its particular child (e.g. title), you can do so by setting `role`
|
|
|
63
63
|
property of the `Alert` component to an empty string and assigning a respective
|
|
64
64
|
`role` attribute on the child element.
|
|
65
65
|
|
|
66
|
-
<
|
|
67
|
-
|
|
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
|
-
|
|
66
|
+
<elements-example>
|
|
67
|
+
|
|
75
68
|
```html
|
|
76
69
|
<w-alert variant="info" show role="">
|
|
77
70
|
<h3 role="alert" class="t5">This is an alert styled as an information box</h3>
|
|
@@ -79,6 +72,8 @@ property of the `Alert` component to an empty string and assigning a respective
|
|
|
79
72
|
</w-alert>
|
|
80
73
|
```
|
|
81
74
|
|
|
75
|
+
</elements-example>
|
|
76
|
+
|
|
82
77
|
Read more about live region `role`
|
|
83
78
|
attribute on [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#roles_with_implicit_live_region_attributes).
|
|
84
79
|
|
|
@@ -86,74 +81,64 @@ attribute on [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/AR
|
|
|
86
81
|
|
|
87
82
|
### Basic
|
|
88
83
|
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
<p>We have updated your preferences.</p>
|
|
92
|
-
</w-alert>
|
|
93
|
-
</style-isolate>
|
|
94
|
-
|
|
84
|
+
<elements-example>
|
|
85
|
+
|
|
95
86
|
```html
|
|
96
87
|
<w-alert show>
|
|
97
88
|
<p>We have updated your preferences.</p>
|
|
98
89
|
</w-alert>
|
|
99
90
|
```
|
|
100
91
|
|
|
101
|
-
|
|
92
|
+
</elements-example>
|
|
102
93
|
|
|
103
|
-
|
|
104
|
-
<w-alert variant="info" show>
|
|
105
|
-
<p>This is an informational alert.</p>
|
|
106
|
-
</w-alert>
|
|
107
|
-
</style-isolate>
|
|
94
|
+
### Info
|
|
108
95
|
|
|
96
|
+
<elements-example>
|
|
97
|
+
|
|
109
98
|
```html
|
|
110
99
|
<w-alert variant="info" show>
|
|
111
100
|
<p>This is an informational alert.</p>
|
|
112
101
|
</w-alert>
|
|
113
102
|
```
|
|
114
103
|
|
|
115
|
-
|
|
104
|
+
</elements-example>
|
|
116
105
|
|
|
117
|
-
|
|
118
|
-
<w-alert variant="warning" show>
|
|
119
|
-
<p>Please double-check this value before continuing.</p>
|
|
120
|
-
</w-alert>
|
|
121
|
-
</style-isolate>
|
|
106
|
+
### Warning
|
|
122
107
|
|
|
108
|
+
<elements-example>
|
|
109
|
+
|
|
123
110
|
```html
|
|
124
111
|
<w-alert variant="warning" show>
|
|
125
112
|
<p>Please double-check this value before continuing.</p>
|
|
126
113
|
</w-alert>
|
|
127
114
|
```
|
|
128
115
|
|
|
129
|
-
|
|
116
|
+
</elements-example>
|
|
130
117
|
|
|
131
|
-
|
|
132
|
-
<w-alert variant="negative" show>
|
|
133
|
-
<p>Something went wrong. Try again.</p>
|
|
134
|
-
</w-alert>
|
|
135
|
-
</style-isolate>
|
|
118
|
+
### Negative
|
|
136
119
|
|
|
120
|
+
<elements-example>
|
|
121
|
+
|
|
137
122
|
```html
|
|
138
123
|
<w-alert variant="negative" show>
|
|
139
124
|
<p>Something went wrong. Try again.</p>
|
|
140
125
|
</w-alert>
|
|
141
126
|
```
|
|
142
127
|
|
|
143
|
-
|
|
128
|
+
</elements-example>
|
|
144
129
|
|
|
145
|
-
|
|
146
|
-
<w-alert variant="positive" show>
|
|
147
|
-
<p>Your changes were saved successfully.</p>
|
|
148
|
-
</w-alert>
|
|
149
|
-
</style-isolate>
|
|
130
|
+
### Positive
|
|
150
131
|
|
|
132
|
+
<elements-example>
|
|
133
|
+
|
|
151
134
|
```html
|
|
152
135
|
<w-alert variant="positive" show>
|
|
153
136
|
<p>Your changes were saved successfully.</p>
|
|
154
137
|
</w-alert>
|
|
155
138
|
```
|
|
156
139
|
|
|
140
|
+
</elements-example>
|
|
141
|
+
|
|
157
142
|
### Programmatic Visibility
|
|
158
143
|
|
|
159
144
|
```html
|
|
@@ -2,74 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
### Basic
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<p>We have updated your preferences.</p>
|
|
8
|
-
</w-alert>
|
|
9
|
-
</style-isolate>
|
|
10
|
-
|
|
5
|
+
<elements-example>
|
|
6
|
+
|
|
11
7
|
```html
|
|
12
8
|
<w-alert show>
|
|
13
9
|
<p>We have updated your preferences.</p>
|
|
14
10
|
</w-alert>
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
</elements-example>
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
<w-alert variant="info" show>
|
|
21
|
-
<p>This is an informational alert.</p>
|
|
22
|
-
</w-alert>
|
|
23
|
-
</style-isolate>
|
|
15
|
+
### Info
|
|
24
16
|
|
|
17
|
+
<elements-example>
|
|
18
|
+
|
|
25
19
|
```html
|
|
26
20
|
<w-alert variant="info" show>
|
|
27
21
|
<p>This is an informational alert.</p>
|
|
28
22
|
</w-alert>
|
|
29
23
|
```
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
</elements-example>
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
<w-alert variant="warning" show>
|
|
35
|
-
<p>Please double-check this value before continuing.</p>
|
|
36
|
-
</w-alert>
|
|
37
|
-
</style-isolate>
|
|
27
|
+
### Warning
|
|
38
28
|
|
|
29
|
+
<elements-example>
|
|
30
|
+
|
|
39
31
|
```html
|
|
40
32
|
<w-alert variant="warning" show>
|
|
41
33
|
<p>Please double-check this value before continuing.</p>
|
|
42
34
|
</w-alert>
|
|
43
35
|
```
|
|
44
36
|
|
|
45
|
-
|
|
37
|
+
</elements-example>
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
<w-alert variant="negative" show>
|
|
49
|
-
<p>Something went wrong. Try again.</p>
|
|
50
|
-
</w-alert>
|
|
51
|
-
</style-isolate>
|
|
39
|
+
### Negative
|
|
52
40
|
|
|
41
|
+
<elements-example>
|
|
42
|
+
|
|
53
43
|
```html
|
|
54
44
|
<w-alert variant="negative" show>
|
|
55
45
|
<p>Something went wrong. Try again.</p>
|
|
56
46
|
</w-alert>
|
|
57
47
|
```
|
|
58
48
|
|
|
59
|
-
|
|
49
|
+
</elements-example>
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
<w-alert variant="positive" show>
|
|
63
|
-
<p>Your changes were saved successfully.</p>
|
|
64
|
-
</w-alert>
|
|
65
|
-
</style-isolate>
|
|
51
|
+
### Positive
|
|
66
52
|
|
|
53
|
+
<elements-example>
|
|
54
|
+
|
|
67
55
|
```html
|
|
68
56
|
<w-alert variant="positive" show>
|
|
69
57
|
<p>Your changes were saved successfully.</p>
|
|
70
58
|
</w-alert>
|
|
71
59
|
```
|
|
72
60
|
|
|
61
|
+
</elements-example>
|
|
62
|
+
|
|
73
63
|
### Programmatic Visibility
|
|
74
64
|
|
|
75
65
|
```html
|
|
@@ -1 +1,51 @@
|
|
|
1
1
|
## Accessibility
|
|
2
|
+
|
|
3
|
+
`w-attention` provides built-in accessibility helpers for tooltip/popover/callout messaging:
|
|
4
|
+
|
|
5
|
+
- It sets `role="tooltip"` for tooltip mode.
|
|
6
|
+
- It sets `role="img"` for non-tooltip variants.
|
|
7
|
+
- It provides a default localized `aria-label` describing the attention type and arrow direction.
|
|
8
|
+
|
|
9
|
+
### Authoring Guidance
|
|
10
|
+
|
|
11
|
+
- Provide meaningful text in the `message` slot.
|
|
12
|
+
- Ensure the `target` slot content is keyboard-accessible (for example `w-button` or a native button).
|
|
13
|
+
- For hover-triggered tooltips, also support focus/blur so keyboard users receive the same information.
|
|
14
|
+
|
|
15
|
+
### Reading Order and Placement
|
|
16
|
+
|
|
17
|
+
For left/top placements, placing the attention message before the target in DOM order can improve screen reader flow.
|
|
18
|
+
|
|
19
|
+
### Precise ARIA Targeting
|
|
20
|
+
|
|
21
|
+
If only part of the message should be announced as details, set an explicit id on the relevant message content and reference it from the target with `aria-details`.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<w-attention id="accessible-attention" placement="right" popover>
|
|
25
|
+
<div slot="message">
|
|
26
|
+
<p id="aria-content" role="tooltip">Important contextual text</p>
|
|
27
|
+
<p>Secondary text</p>
|
|
28
|
+
</div>
|
|
29
|
+
<w-button aria-details="aria-content" slot="target" variant="secondary">
|
|
30
|
+
Open
|
|
31
|
+
</w-button>
|
|
32
|
+
</w-attention>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Dismissible Attention
|
|
36
|
+
|
|
37
|
+
When `can-close` is used, ensure your app listens to the `close` event and updates `show` accordingly so the UI and assistive technology state stay in sync.
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<w-attention id="dismissible" can-close highlight>
|
|
41
|
+
<w-button slot="target" variant="secondary">Show message</w-button>
|
|
42
|
+
<span slot="message">Dismissible message</span>
|
|
43
|
+
</w-attention>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
const attention = document.getElementById('dismissible');
|
|
47
|
+
attention.addEventListener('close', () => {
|
|
48
|
+
attention.show = false;
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|-|-|-|-|
|
|
7
7
|
| _actualDirection | `unknown` | `-` | - |
|
|
8
8
|
| _initialPlacement | `unknown` | `-` | - |
|
|
9
|
-
| callout | `boolean` | `false` |
|
|
10
|
-
| canClose | `boolean` | `false` |
|
|
11
|
-
| crossAxis | `boolean` | `false` |
|
|
12
|
-
| distance | `number` | `8` |
|
|
13
|
-
| fallbackPlacements | `Directions[]` |
|
|
14
|
-
| flip | `boolean` | `false` |
|
|
15
|
-
| highlight | `boolean` | `false` |
|
|
16
|
-
| noArrow | `boolean` | `false` |
|
|
17
|
-
| placement | `Directions` | `'bottom'` |
|
|
18
|
-
| popover | `boolean` | `false` |
|
|
19
|
-
| show | `boolean` | `false` |
|
|
20
|
-
| skidding | `number` | `0` | - |
|
|
21
|
-
| tooltip | `boolean` | `false` |
|
|
9
|
+
| callout | `boolean` | `false` | Renders the component as an inline callout. |
|
|
10
|
+
| canClose | `boolean` | `false` | Shows a close button inside the attention component. |
|
|
11
|
+
| crossAxis | `boolean` | `false` | Allows overflow checks on the cross axis when flipping. |
|
|
12
|
+
| distance | `number` | `8` | Distance offset between trigger and attention panel. |
|
|
13
|
+
| fallbackPlacements | `Directions[]` | `[]` | Ordered list of fallback placements. |
|
|
14
|
+
| flip | `boolean` | `false` | Enables automatic flipping when placement has no space. |
|
|
15
|
+
| highlight | `boolean` | `false` | Renders the component with highlight styling. |
|
|
16
|
+
| noArrow | `boolean` | `false` | Hides the directional arrow of the attention component. |
|
|
17
|
+
| placement | `Directions` | `'bottom'` | Preferred placement relative to the trigger element. |
|
|
18
|
+
| popover | `boolean` | `false` | Enables native popover behavior for the attention element. |
|
|
19
|
+
| show | `boolean` | `false` | Controls whether the attention panel is visible. |
|
|
20
|
+
| skidding | `number` | `0` | Cross-axis offset for fine-grained positioning. |
|
|
21
|
+
| tooltip | `boolean` | `false` | Renders the component with tooltip styling and behavior. |
|
|
22
22
|
|
|
23
23
|
### Property Details
|
|
24
24
|
|
|
@@ -38,91 +38,104 @@
|
|
|
38
38
|
|
|
39
39
|
#### callout
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Renders the component as an inline callout.
|
|
42
|
+
Callout mode is used for always-in-flow informational content instead of floating overlay behavior.
|
|
42
43
|
|
|
43
44
|
- Type: `boolean`
|
|
44
45
|
- Default: `false`
|
|
45
46
|
|
|
46
47
|
#### canClose
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
Shows a close button inside the attention component.
|
|
50
|
+
Adds an internal dismiss action that lets users close the attention panel.
|
|
49
51
|
|
|
50
52
|
- Type: `boolean`
|
|
51
53
|
- Default: `false`
|
|
52
54
|
|
|
53
55
|
#### crossAxis
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
Allows overflow checks on the cross axis when flipping.
|
|
58
|
+
Use with `flip` to improve collision handling when space is constrained horizontally or vertically.
|
|
56
59
|
|
|
57
60
|
- Type: `boolean`
|
|
58
61
|
- Default: `false`
|
|
59
62
|
|
|
60
63
|
#### distance
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
Distance offset between trigger and attention panel.
|
|
66
|
+
Defines the main-axis spacing in pixels from the anchor element.
|
|
63
67
|
|
|
64
68
|
- Type: `number`
|
|
65
69
|
- Default: `8`
|
|
66
70
|
|
|
67
71
|
#### fallbackPlacements
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
Ordered list of fallback placements.
|
|
74
|
+
Provides explicit alternative placements to try when `flip` is enabled and the preferred placement does not fit.
|
|
70
75
|
|
|
71
76
|
- Type: `Directions[]`
|
|
72
|
-
- Default:
|
|
77
|
+
- Default: `[]`
|
|
73
78
|
|
|
74
79
|
#### flip
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
Enables automatic flipping when placement has no space.
|
|
82
|
+
Allows the component to choose an alternative side if the preferred placement would overflow.
|
|
77
83
|
|
|
78
84
|
- Type: `boolean`
|
|
79
85
|
- Default: `false`
|
|
80
86
|
|
|
81
87
|
#### highlight
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
Renders the component with highlight styling.
|
|
90
|
+
Use highlight mode to visually emphasize important contextual information.
|
|
84
91
|
|
|
85
92
|
- Type: `boolean`
|
|
86
93
|
- Default: `false`
|
|
87
94
|
|
|
88
95
|
#### noArrow
|
|
89
96
|
|
|
90
|
-
|
|
97
|
+
Hides the directional arrow of the attention component.
|
|
98
|
+
Disable the arrow when the visual connection to the trigger should not be shown.
|
|
91
99
|
|
|
92
100
|
- Type: `boolean`
|
|
93
101
|
- Default: `false`
|
|
94
102
|
|
|
95
103
|
#### placement
|
|
96
104
|
|
|
97
|
-
|
|
105
|
+
Preferred placement relative to the trigger element.
|
|
106
|
+
Sets the initial direction for positioning, for example `top`, `right`, `bottom`, or `left` variants.
|
|
98
107
|
|
|
99
108
|
- Type: `Directions`
|
|
100
109
|
- Default: `'bottom'`
|
|
101
110
|
|
|
102
111
|
#### popover
|
|
103
112
|
|
|
104
|
-
|
|
113
|
+
Enables native popover behavior for the attention element.
|
|
114
|
+
When enabled, the component uses popover semantics and styling suitable for floating surface UI.
|
|
105
115
|
|
|
106
116
|
- Type: `boolean`
|
|
107
117
|
- Default: `false`
|
|
108
118
|
|
|
109
119
|
#### show
|
|
110
120
|
|
|
111
|
-
|
|
121
|
+
Controls whether the attention panel is visible.
|
|
122
|
+
Set to `true` to show the attention content and `false` to hide it.
|
|
112
123
|
|
|
113
124
|
- Type: `boolean`
|
|
114
125
|
- Default: `false`
|
|
115
126
|
|
|
116
127
|
#### skidding
|
|
117
128
|
|
|
118
|
-
|
|
129
|
+
Cross-axis offset for fine-grained positioning.
|
|
130
|
+
Moves the panel along the cross axis in pixels to adjust alignment with the trigger.
|
|
119
131
|
|
|
120
132
|
- Type: `number`
|
|
121
133
|
- Default: `0`
|
|
122
134
|
|
|
123
135
|
#### tooltip
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
Renders the component with tooltip styling and behavior.
|
|
138
|
+
Use for compact, non-modal contextual hints anchored to another element.
|
|
126
139
|
|
|
127
140
|
- Type: `boolean`
|
|
128
141
|
- Default: `false`
|