@warp-ds/elements 2.9.0-next.5 → 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.
Files changed (79) hide show
  1. package/dist/custom-elements.json +221 -118
  2. package/dist/docs/affix/affix.md +49 -61
  3. package/dist/docs/affix/api.md +25 -23
  4. package/dist/docs/affix/examples.md +24 -38
  5. package/dist/docs/alert/accessibility.md +4 -9
  6. package/dist/docs/alert/alert.md +36 -51
  7. package/dist/docs/alert/api.md +12 -12
  8. package/dist/docs/alert/examples.md +20 -30
  9. package/dist/docs/attention/accessibility.md +50 -0
  10. package/dist/docs/attention/api.md +72 -59
  11. package/dist/docs/attention/attention.md +305 -56
  12. package/dist/docs/attention/examples.md +91 -0
  13. package/dist/docs/attention/usage.md +91 -0
  14. package/dist/docs/badge/accessibility.md +44 -0
  15. package/dist/docs/badge/api.md +12 -8
  16. package/dist/docs/badge/badge.md +178 -10
  17. package/dist/docs/badge/examples.md +69 -0
  18. package/dist/docs/badge/usage.md +53 -0
  19. package/dist/docs/button/api.md +46 -42
  20. package/dist/docs/button/button.md +46 -42
  21. package/dist/docs/card/api.md +11 -11
  22. package/dist/docs/card/card.md +11 -11
  23. package/dist/docs/combobox/api.md +62 -62
  24. package/dist/docs/combobox/combobox.md +62 -62
  25. package/dist/docs/datepicker/api.md +74 -66
  26. package/dist/docs/datepicker/datepicker.md +74 -66
  27. package/dist/docs/expandable/api.md +26 -26
  28. package/dist/docs/expandable/expandable.md +26 -26
  29. package/dist/docs/link/api.md +28 -28
  30. package/dist/docs/link/link.md +28 -28
  31. package/dist/docs/page-indicator/api.md +6 -6
  32. package/dist/docs/page-indicator/page-indicator.md +6 -6
  33. package/dist/docs/pagination/api.md +3 -3
  34. package/dist/docs/pagination/pagination.md +3 -3
  35. package/dist/docs/pill/api.md +19 -15
  36. package/dist/docs/pill/pill.md +19 -15
  37. package/dist/docs/select/api.md +44 -44
  38. package/dist/docs/select/select.md +44 -44
  39. package/dist/docs/slider/api.md +80 -78
  40. package/dist/docs/slider/slider.md +80 -78
  41. package/dist/docs/slider-thumb/api.md +28 -76
  42. package/dist/docs/slider-thumb/slider-thumb.md +28 -76
  43. package/dist/docs/switch/api.md +16 -16
  44. package/dist/docs/switch/switch.md +16 -16
  45. package/dist/docs/tab/api.md +26 -40
  46. package/dist/docs/tab/tab.md +26 -40
  47. package/dist/docs/tab-panel/api.md +1 -17
  48. package/dist/docs/tab-panel/tab-panel.md +1 -17
  49. package/dist/docs/tabs/api.md +3 -3
  50. package/dist/docs/tabs/tabs.md +3 -3
  51. package/dist/docs/textarea/accessibility.md +5 -0
  52. package/dist/docs/textarea/api.md +52 -65
  53. package/dist/docs/textarea/examples.md +81 -0
  54. package/dist/docs/textarea/textarea.md +151 -65
  55. package/dist/docs/textarea/usage.md +9 -0
  56. package/dist/docs/textfield/accessibility.md +15 -0
  57. package/dist/docs/textfield/api.md +86 -83
  58. package/dist/docs/textfield/examples.md +130 -0
  59. package/dist/docs/textfield/textfield.md +258 -86
  60. package/dist/docs/textfield/usage.md +26 -0
  61. package/dist/index.d.ts +456 -330
  62. package/dist/packages/attention/attention.d.ts +46 -37
  63. package/dist/packages/attention/attention.js +20 -20
  64. package/dist/packages/attention/attention.js.map +3 -3
  65. package/dist/packages/badge/badge.d.ts +7 -5
  66. package/dist/packages/badge/badge.js.map +2 -2
  67. package/dist/packages/datepicker/datepicker.js +1 -1
  68. package/dist/packages/datepicker/datepicker.js.map +2 -2
  69. package/dist/packages/datepicker/datepicker.react.stories.d.ts +9 -1
  70. package/dist/packages/datepicker/react.d.ts +4 -0
  71. package/dist/packages/datepicker/react.js +4 -0
  72. package/dist/packages/textarea/textarea.d.ts +38 -29
  73. package/dist/packages/textarea/textarea.js.map +2 -2
  74. package/dist/packages/textfield/textfield.d.ts +57 -60
  75. package/dist/packages/textfield/textfield.js +5 -5
  76. package/dist/packages/textfield/textfield.js.map +2 -2
  77. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  78. package/dist/web-types.json +573 -153
  79. package/package.json +1 -2
@@ -2,74 +2,64 @@
2
2
 
3
3
  ### Basic
4
4
 
5
- <style-isolate>
6
- <w-alert show>
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
- ### Info
13
+ </elements-example>
18
14
 
19
- <style-isolate>
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
- ### Warning
25
+ </elements-example>
32
26
 
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>
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
- ### Negative
37
+ </elements-example>
46
38
 
47
- <style-isolate>
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
- ### Positive
49
+ </elements-example>
60
50
 
61
- <style-isolate>
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
+ ```
@@ -4,128 +4,141 @@
4
4
 
5
5
  | Name | Type | Default | Summary |
6
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
7
  | _actualDirection | `unknown` | `-` | - |
8
+ | _initialPlacement | `unknown` | `-` | - |
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
 
25
- #### show
26
-
25
+ #### _actualDirection
27
26
 
28
27
 
29
- - Type: `boolean`
30
- - Default: `false`
31
28
 
32
- #### placement
29
+ - Type: `unknown`
30
+ - Default: `-`
33
31
 
32
+ #### _initialPlacement
34
33
 
35
34
 
36
- - Type: `Directions`
37
- - Default: `'bottom'`
38
35
 
39
- #### tooltip
36
+ - Type: `unknown`
37
+ - Default: `-`
40
38
 
39
+ #### callout
41
40
 
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
- #### callout
47
-
47
+ #### canClose
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
- #### popover
54
-
55
+ #### crossAxis
55
56
 
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
- #### highlight
63
+ #### distance
61
64
 
65
+ Distance offset between trigger and attention panel.
66
+ Defines the main-axis spacing in pixels from the anchor element.
62
67
 
68
+ - Type: `number`
69
+ - Default: `8`
63
70
 
64
- - Type: `boolean`
65
- - Default: `false`
71
+ #### fallbackPlacements
66
72
 
67
- #### canClose
73
+ Ordered list of fallback placements.
74
+ Provides explicit alternative placements to try when `flip` is enabled and the preferred placement does not fit.
68
75
 
76
+ - Type: `Directions[]`
77
+ - Default: `[]`
69
78
 
79
+ #### flip
80
+
81
+ Enables automatic flipping when placement has no space.
82
+ Allows the component to choose an alternative side if the preferred placement would overflow.
70
83
 
71
84
  - Type: `boolean`
72
85
  - Default: `false`
73
86
 
74
- #### noArrow
75
-
87
+ #### highlight
76
88
 
89
+ Renders the component with highlight styling.
90
+ Use highlight mode to visually emphasize important contextual information.
77
91
 
78
92
  - Type: `boolean`
79
93
  - Default: `false`
80
94
 
81
- #### distance
82
-
83
-
84
-
85
- - Type: `number`
86
- - Default: `8`
95
+ #### noArrow
87
96
 
88
- #### skidding
97
+ Hides the directional arrow of the attention component.
98
+ Disable the arrow when the visual connection to the trigger should not be shown.
89
99
 
100
+ - Type: `boolean`
101
+ - Default: `false`
90
102
 
103
+ #### placement
91
104
 
92
- - Type: `number`
93
- - Default: `0`
105
+ Preferred placement relative to the trigger element.
106
+ Sets the initial direction for positioning, for example `top`, `right`, `bottom`, or `left` variants.
94
107
 
95
- #### flip
108
+ - Type: `Directions`
109
+ - Default: `'bottom'`
96
110
 
111
+ #### popover
97
112
 
113
+ Enables native popover behavior for the attention element.
114
+ When enabled, the component uses popover semantics and styling suitable for floating surface UI.
98
115
 
99
116
  - Type: `boolean`
100
117
  - Default: `false`
101
118
 
102
- #### crossAxis
103
-
119
+ #### show
104
120
 
121
+ Controls whether the attention panel is visible.
122
+ Set to `true` to show the attention content and `false` to hide it.
105
123
 
106
124
  - Type: `boolean`
107
125
  - Default: `false`
108
126
 
109
- #### fallbackPlacements
110
-
111
-
112
-
113
- - Type: `Directions[]`
114
- - Default: `-`
115
-
116
- #### _initialPlacement
117
-
127
+ #### skidding
118
128
 
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
- - Type: `unknown`
121
- - Default: `-`
122
-
123
- #### _actualDirection
132
+ - Type: `number`
133
+ - Default: `0`
124
134
 
135
+ #### tooltip
125
136
 
137
+ Renders the component with tooltip styling and behavior.
138
+ Use for compact, non-modal contextual hints anchored to another element.
126
139
 
127
- - Type: `unknown`
128
- - Default: `-`
140
+ - Type: `boolean`
141
+ - Default: `false`
129
142
 
130
143
  ### Types
131
144