@warp-ds/elements 2.9.1-next.3 → 2.9.1-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 +83 -239
- package/dist/docs/affix/affix.md +9 -10
- package/dist/docs/affix/api.md +9 -10
- package/dist/docs/alert/alert.md +4 -2
- package/dist/docs/alert/api.md +4 -2
- package/dist/docs/attention/api.md +16 -14
- package/dist/docs/attention/attention.md +16 -14
- package/dist/docs/badge/api.md +5 -6
- package/dist/docs/badge/badge.md +5 -6
- package/dist/docs/box/api.md +3 -4
- package/dist/docs/box/box.md +3 -4
- package/dist/docs/breadcrumbs/accessibility.md +46 -0
- package/dist/docs/breadcrumbs/api.md +8 -8
- package/dist/docs/breadcrumbs/breadcrumbs.md +127 -9
- package/dist/docs/breadcrumbs/examples.md +35 -0
- package/dist/docs/breadcrumbs/usage.md +36 -0
- package/dist/docs/button/api.md +15 -13
- package/dist/docs/button/button.md +15 -13
- package/dist/docs/card/api.md +5 -6
- package/dist/docs/card/card.md +5 -6
- package/dist/docs/combobox/api.md +18 -19
- package/dist/docs/combobox/combobox.md +18 -19
- package/dist/docs/datepicker/api.md +38 -39
- package/dist/docs/datepicker/datepicker.md +38 -39
- package/dist/docs/expandable/api.md +11 -12
- package/dist/docs/expandable/expandable.md +11 -12
- package/dist/docs/link/api.md +8 -6
- package/dist/docs/link/link.md +8 -6
- package/dist/docs/page-indicator/api.md +7 -8
- package/dist/docs/page-indicator/page-indicator.md +7 -8
- package/dist/docs/pagination/api.md +17 -9
- package/dist/docs/pagination/pagination.md +17 -9
- package/dist/docs/pill/api.md +30 -17
- package/dist/docs/pill/pill.md +30 -17
- package/dist/docs/select/api.md +17 -9
- package/dist/docs/select/select.md +17 -9
- package/dist/docs/slider/api.md +37 -116
- package/dist/docs/slider/examples.md +331 -0
- package/dist/docs/slider/slider.md +378 -118
- package/dist/docs/slider/usage.md +10 -0
- package/dist/docs/slider-thumb/api.md +26 -55
- package/dist/docs/slider-thumb/slider-thumb.md +26 -57
- package/dist/docs/step/api.md +3 -4
- package/dist/docs/step/step.md +3 -4
- package/dist/docs/step-indicator/api.md +3 -4
- package/dist/docs/step-indicator/step-indicator.md +3 -4
- package/dist/docs/switch/api.md +13 -5
- package/dist/docs/switch/switch.md +13 -5
- package/dist/docs/tab/api.md +9 -62
- package/dist/docs/tab/tab.md +9 -70
- package/dist/docs/tab-panel/api.md +7 -11
- package/dist/docs/tab-panel/tab-panel.md +7 -19
- package/dist/docs/tabs/accessibility.md +11 -0
- package/dist/docs/tabs/api.md +10 -18
- package/dist/docs/tabs/examples.md +68 -0
- package/dist/docs/tabs/tabs.md +97 -20
- package/dist/docs/tabs/usage.md +8 -0
- package/dist/docs/textarea/api.md +15 -16
- package/dist/docs/textarea/textarea.md +15 -16
- package/dist/docs/textfield/api.md +14 -15
- package/dist/docs/textfield/textfield.md +14 -15
- package/dist/index.d.ts +124 -224
- package/dist/packages/breadcrumbs/breadcrumbs.d.ts +7 -1
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +2 -2
- package/dist/packages/pagination/pagination.test.js +38 -0
- package/dist/packages/slider/slider.d.ts +34 -45
- package/dist/packages/slider/slider.js +1 -1
- package/dist/packages/slider/slider.js.map +2 -2
- package/dist/packages/slider-thumb/slider-thumb.d.ts +36 -31
- package/dist/packages/slider-thumb/slider-thumb.js +1 -1
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/packages/tab/tab.d.ts +29 -24
- package/dist/packages/tab/tab.js +3 -3
- package/dist/packages/tab/tab.js.map +2 -2
- package/dist/packages/tab-panel/tab-panel.d.ts +9 -8
- package/dist/packages/tab-panel/tab-panel.js +3 -3
- package/dist/packages/tab-panel/tab-panel.js.map +2 -2
- package/dist/packages/tabs/index.d.ts +1 -0
- package/dist/packages/tabs/index.js +0 -1
- package/dist/packages/tabs/react.d.ts +4 -3
- package/dist/packages/tabs/tabs.d.ts +9 -3
- package/dist/packages/tabs/tabs.js.map +2 -2
- package/dist/packages/tabs/tabs.react.stories.d.ts +2 -2
- package/dist/web-types.json +201 -93
- package/package.json +2 -1
- package/dist/docs/tab/accessibility.md +0 -1
- package/dist/docs/tab/examples.md +0 -1
- package/dist/docs/tab/usage.md +0 -1
- package/dist/docs/tab-panel/accessibility.md +0 -1
- package/dist/docs/tab-panel/examples.md +0 -1
- package/dist/docs/tab-panel/usage.md +0 -1
package/dist/docs/tabs/api.md
CHANGED
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
## API
|
|
1
|
+
## `<w-tabs>` API
|
|
2
|
+
|
|
3
|
+
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
2
4
|
|
|
3
5
|
### Properties
|
|
4
6
|
|
|
5
7
|
| Name | Type | Default | Summary |
|
|
6
8
|
|-|-|-|-|
|
|
7
|
-
| active | `string` |
|
|
8
|
-
| activeTab | `unknown` | `-` | - |
|
|
9
|
-
| tabs | `unknown` | `-` | - |
|
|
9
|
+
| active | `string` | `"" (Shows the first tab)` | The `id` of the panel that should be active. |
|
|
10
10
|
|
|
11
11
|
### Property Details
|
|
12
12
|
|
|
13
13
|
#### active
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The `id` of the panel that should be active.
|
|
16
16
|
|
|
17
17
|
- Type: `string`
|
|
18
|
-
- Default:
|
|
19
|
-
|
|
20
|
-
#### activeTab
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Type: `unknown`
|
|
25
|
-
- Default: `-`
|
|
18
|
+
- Default: `"" (Shows the first tab)`
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
### Events
|
|
28
21
|
|
|
22
|
+
#### change
|
|
29
23
|
|
|
24
|
+
Includes `details.panelId` with the now active tab's ID
|
|
30
25
|
|
|
31
|
-
- Type: `
|
|
32
|
-
- Default: `-`
|
|
26
|
+
- Type: `WarpTabsChangeEvent`
|
|
33
27
|
|
|
34
|
-
### Types
|
|
35
28
|
|
|
36
|
-
No types documented.
|
|
@@ -1 +1,69 @@
|
|
|
1
1
|
## Examples
|
|
2
|
+
|
|
3
|
+
<elements-example>
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<w-tabs>
|
|
7
|
+
<w-tab for="roald-amundsen">Tab 1</w-tab>
|
|
8
|
+
<w-tab for="fridtjof-nansen">Tab 2</w-tab>
|
|
9
|
+
<w-tab for="tor-heyerdahl">Tab 3</w-tab>
|
|
10
|
+
<w-tab-panel id="roald-amundsen">Tab one selected!</w-tab-panel>
|
|
11
|
+
<w-tab-panel id="fridtjof-nansen">Tab two selected!</w-tab-panel>
|
|
12
|
+
<w-tab-panel id="tor-heyerdahl">Tab three selected!</w-tab-panel>
|
|
13
|
+
</w-tabs>
|
|
14
|
+
|
|
15
|
+
<script type="module">
|
|
16
|
+
const tabs = document.querySelector('w-tabs');
|
|
17
|
+
|
|
18
|
+
tabs.addEventListener('change', (event) => {
|
|
19
|
+
// event.detail = { panelId: string }
|
|
20
|
+
console.log('Active panel:', event.detail.panelId);
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</elements-example>
|
|
26
|
+
|
|
27
|
+
### Tabs with icons
|
|
28
|
+
|
|
29
|
+
Icons can be added to tabs using the `icon` slot. By default, icons appear beside the label.
|
|
30
|
+
|
|
31
|
+
<elements-example>
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<w-tabs active="fridtjof-nansen">
|
|
35
|
+
<w-tab for="roald-amundsen">
|
|
36
|
+
<w-icon name="Info" slot="icon"></w-icon>
|
|
37
|
+
Tab 1
|
|
38
|
+
</w-tab>
|
|
39
|
+
<w-tab for="fridtjof-nansen">
|
|
40
|
+
<w-icon name="Success" slot="icon"></w-icon>
|
|
41
|
+
Tab 2
|
|
42
|
+
</w-tab>
|
|
43
|
+
<w-tab-panel id="roald-amundsen">Content one</w-tab-panel>
|
|
44
|
+
<w-tab-panel id="fridtjof-nansen">Content two</w-tab-panel>
|
|
45
|
+
</w-tabs>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
</elements-example>
|
|
49
|
+
|
|
50
|
+
Use the `over` attribute to position icons above the label:
|
|
51
|
+
|
|
52
|
+
<elements-example>
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<w-tabs>
|
|
56
|
+
<w-tab for="roald-amundsen" over>
|
|
57
|
+
<w-icon name="Info" slot="icon"></w-icon>
|
|
58
|
+
Tab 1
|
|
59
|
+
</w-tab>
|
|
60
|
+
<w-tab for="fridtjof-nansen" over>
|
|
61
|
+
<w-icon name="Success" slot="icon"></w-icon>
|
|
62
|
+
Tab 2
|
|
63
|
+
</w-tab>
|
|
64
|
+
<w-tab-panel id="roald-amundsen">Content one</w-tab-panel>
|
|
65
|
+
<w-tab-panel id="fridtjof-nansen">Content two</w-tab-panel>
|
|
66
|
+
</w-tabs>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
</elements-example>
|
package/dist/docs/tabs/tabs.md
CHANGED
|
@@ -4,47 +4,124 @@
|
|
|
4
4
|
|
|
5
5
|
Tabs are used to organize content by grouping similar information on the same page.
|
|
6
6
|
|
|
7
|
-
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/tabs--docs)
|
|
8
|
-
|
|
9
7
|
## Usage
|
|
10
8
|
|
|
9
|
+
The tabs component consists of three custom elements that work together:
|
|
10
|
+
|
|
11
|
+
- `<w-tabs>` - The container that manages tab state and keyboard navigation
|
|
12
|
+
- `<w-tab>` - Individual tab buttons
|
|
13
|
+
- `<w-tab-panel>` - Content panels associated with each tab
|
|
14
|
+
|
|
15
|
+
Each `<w-tab>` has a `for` attribute that matches the `id` of its corresponding `<w-tab-panel>`.
|
|
16
|
+
|
|
11
17
|
## Accessibility
|
|
12
18
|
|
|
19
|
+
The tabs component follows the WAI-ARIA Tabs pattern:
|
|
20
|
+
|
|
21
|
+
- The tab list gets `role="tablist"`
|
|
22
|
+
- Each tab button gets `role="tab"` with `aria-selected` reflecting its active state
|
|
23
|
+
- Each tab button gets `aria-controls` pointing to its associated panel
|
|
24
|
+
- Each panel gets `role="tabpanel"` with `aria-labelledby` pointing to its associated tab
|
|
25
|
+
- Keyboard navigation is supported:
|
|
26
|
+
- `ArrowLeft`/`ArrowRight`: Navigate between tabs
|
|
27
|
+
- `Home`: Move to first tab
|
|
28
|
+
- `End`: Move to last tab
|
|
29
|
+
|
|
13
30
|
## Examples
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
<elements-example>
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<w-tabs>
|
|
36
|
+
<w-tab for="roald-amundsen">Tab 1</w-tab>
|
|
37
|
+
<w-tab for="fridtjof-nansen">Tab 2</w-tab>
|
|
38
|
+
<w-tab for="tor-heyerdahl">Tab 3</w-tab>
|
|
39
|
+
<w-tab-panel id="roald-amundsen">Tab one selected!</w-tab-panel>
|
|
40
|
+
<w-tab-panel id="fridtjof-nansen">Tab two selected!</w-tab-panel>
|
|
41
|
+
<w-tab-panel id="tor-heyerdahl">Tab three selected!</w-tab-panel>
|
|
42
|
+
</w-tabs>
|
|
43
|
+
|
|
44
|
+
<script type="module">
|
|
45
|
+
const tabs = document.querySelector('w-tabs');
|
|
46
|
+
|
|
47
|
+
tabs.addEventListener('change', (event) => {
|
|
48
|
+
// event.detail = { panelId: string }
|
|
49
|
+
console.log('Active panel:', event.detail.panelId);
|
|
50
|
+
});
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
</elements-example>
|
|
55
|
+
|
|
56
|
+
### Tabs with icons
|
|
57
|
+
|
|
58
|
+
Icons can be added to tabs using the `icon` slot. By default, icons appear beside the label.
|
|
59
|
+
|
|
60
|
+
<elements-example>
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<w-tabs active="fridtjof-nansen">
|
|
64
|
+
<w-tab for="roald-amundsen">
|
|
65
|
+
<w-icon name="Info" slot="icon"></w-icon>
|
|
66
|
+
Tab 1
|
|
67
|
+
</w-tab>
|
|
68
|
+
<w-tab for="fridtjof-nansen">
|
|
69
|
+
<w-icon name="Success" slot="icon"></w-icon>
|
|
70
|
+
Tab 2
|
|
71
|
+
</w-tab>
|
|
72
|
+
<w-tab-panel id="roald-amundsen">Content one</w-tab-panel>
|
|
73
|
+
<w-tab-panel id="fridtjof-nansen">Content two</w-tab-panel>
|
|
74
|
+
</w-tabs>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
</elements-example>
|
|
78
|
+
|
|
79
|
+
Use the `over` attribute to position icons above the label:
|
|
80
|
+
|
|
81
|
+
<elements-example>
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<w-tabs>
|
|
85
|
+
<w-tab for="roald-amundsen" over>
|
|
86
|
+
<w-icon name="Info" slot="icon"></w-icon>
|
|
87
|
+
Tab 1
|
|
88
|
+
</w-tab>
|
|
89
|
+
<w-tab for="fridtjof-nansen" over>
|
|
90
|
+
<w-icon name="Success" slot="icon"></w-icon>
|
|
91
|
+
Tab 2
|
|
92
|
+
</w-tab>
|
|
93
|
+
<w-tab-panel id="roald-amundsen">Content one</w-tab-panel>
|
|
94
|
+
<w-tab-panel id="fridtjof-nansen">Content two</w-tab-panel>
|
|
95
|
+
</w-tabs>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
</elements-example>
|
|
99
|
+
|
|
100
|
+
## `<w-tabs>` API
|
|
101
|
+
|
|
102
|
+
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
16
103
|
|
|
17
104
|
### Properties
|
|
18
105
|
|
|
19
106
|
| Name | Type | Default | Summary |
|
|
20
107
|
|-|-|-|-|
|
|
21
|
-
| active | `string` |
|
|
22
|
-
| activeTab | `unknown` | `-` | - |
|
|
23
|
-
| tabs | `unknown` | `-` | - |
|
|
108
|
+
| active | `string` | `"" (Shows the first tab)` | The `id` of the panel that should be active. |
|
|
24
109
|
|
|
25
110
|
### Property Details
|
|
26
111
|
|
|
27
112
|
#### active
|
|
28
113
|
|
|
29
|
-
|
|
114
|
+
The `id` of the panel that should be active.
|
|
30
115
|
|
|
31
116
|
- Type: `string`
|
|
32
|
-
- Default:
|
|
33
|
-
|
|
34
|
-
#### activeTab
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- Type: `unknown`
|
|
39
|
-
- Default: `-`
|
|
117
|
+
- Default: `"" (Shows the first tab)`
|
|
40
118
|
|
|
41
|
-
|
|
119
|
+
### Events
|
|
42
120
|
|
|
121
|
+
#### change
|
|
43
122
|
|
|
123
|
+
Includes `details.panelId` with the now active tab's ID
|
|
44
124
|
|
|
45
|
-
- Type: `
|
|
46
|
-
- Default: `-`
|
|
125
|
+
- Type: `WarpTabsChangeEvent`
|
|
47
126
|
|
|
48
|
-
### Types
|
|
49
127
|
|
|
50
|
-
No types documented.
|
package/dist/docs/tabs/usage.md
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
1
|
## Usage
|
|
2
|
+
|
|
3
|
+
The tabs component consists of three custom elements that work together:
|
|
4
|
+
|
|
5
|
+
- `<w-tabs>` - The container that manages tab state and keyboard navigation
|
|
6
|
+
- `<w-tab>` - Individual tab buttons
|
|
7
|
+
- `<w-tab-panel>` - Content panels associated with each tab
|
|
8
|
+
|
|
9
|
+
Each `<w-tab>` has a `for` attribute that matches the `id` of its corresponding `<w-tab-panel>`.
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
## API
|
|
1
|
+
## `<w-textarea>` API
|
|
2
|
+
|
|
3
|
+
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
2
4
|
|
|
3
5
|
### Properties
|
|
4
6
|
|
|
5
7
|
| Name | Type | Default | Summary |
|
|
6
8
|
|-|-|-|-|
|
|
7
9
|
| disabled | `boolean` | `false` | Makes the element not focusable and hides it from form submits |
|
|
8
|
-
|
|
|
10
|
+
| help-text | `string` | `-` | Description shown below the input field |
|
|
9
11
|
| invalid | `boolean` | `false` | Mark the form field as invalid. |
|
|
10
12
|
| label | `string` | `-` | Either a `label` or an `aria-label` must be provided. |
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
+
| maximum-rows | `number` | `-` | Sets the maximum number of text rows before the content starts scrolling. |
|
|
14
|
+
| minimum-rows | `number` | `-` | Sets the minimum number of text rows the textarea should display |
|
|
13
15
|
| name | `string` | `-` | The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the input field when submitting the form |
|
|
14
16
|
| optional | `boolean` | `false` | Show an icon behind the label indicating the field is optional |
|
|
15
17
|
| placeholder | `string` | `-` | Shown in the textarea when it doesn't have a value |
|
|
16
|
-
|
|
|
18
|
+
| read-only | `boolean` | `false` | **Deprecated**: Use the native `readonly` attribute instead |
|
|
17
19
|
| readonly | `boolean` | `false` | Whether the input can be selected but not changed by the user |
|
|
18
20
|
| required | `boolean` | `false` | Whether user input is required on the input before form submission |
|
|
19
|
-
| validationMessage | `string` | `-` | Returns the validation message if the textarea is invalid, otherwise an empty string |
|
|
20
|
-
| validity | `ValidityState` | `-` | Returns the validity state of the textarea |
|
|
21
|
+
| validationMessage (JS only) | `string` | `-` | Returns the validation message if the textarea is invalid, otherwise an empty string |
|
|
22
|
+
| validity (JS only) | `ValidityState` | `-` | Returns the validity state of the textarea |
|
|
21
23
|
| value | `string` | `-` | Lets you set the current value |
|
|
22
24
|
|
|
23
25
|
### Property Details
|
|
@@ -33,7 +35,7 @@ Please consider more informative alternatives before choosing to use disabled on
|
|
|
33
35
|
- Type: `boolean`
|
|
34
36
|
- Default: `false`
|
|
35
37
|
|
|
36
|
-
####
|
|
38
|
+
#### help-text
|
|
37
39
|
|
|
38
40
|
Use in combination with `invalid` to show as a validation error message,
|
|
39
41
|
or on its own to show a help text.
|
|
@@ -57,14 +59,14 @@ Either a `label` or an `aria-label` must be provided.
|
|
|
57
59
|
- Type: `string`
|
|
58
60
|
- Default: `-`
|
|
59
61
|
|
|
60
|
-
####
|
|
62
|
+
#### maximum-rows
|
|
61
63
|
|
|
62
64
|
Sets the maximum number of text rows before the content starts scrolling.
|
|
63
65
|
|
|
64
66
|
- Type: `number`
|
|
65
67
|
- Default: `-`
|
|
66
68
|
|
|
67
|
-
####
|
|
69
|
+
#### minimum-rows
|
|
68
70
|
|
|
69
71
|
Sets the minimum number of text rows the textarea should display
|
|
70
72
|
|
|
@@ -94,7 +96,7 @@ Placeholder text should not be used as a substitute for labeling the element wit
|
|
|
94
96
|
- Type: `string`
|
|
95
97
|
- Default: `-`
|
|
96
98
|
|
|
97
|
-
####
|
|
99
|
+
#### read-only
|
|
98
100
|
|
|
99
101
|
**Deprecated**: Use the native `readonly` attribute instead
|
|
100
102
|
|
|
@@ -117,14 +119,14 @@ Whether user input is required on the input before form submission
|
|
|
117
119
|
- Type: `boolean`
|
|
118
120
|
- Default: `false`
|
|
119
121
|
|
|
120
|
-
#### validationMessage
|
|
122
|
+
#### validationMessage (JS only)
|
|
121
123
|
|
|
122
124
|
Returns the validation message if the textarea is invalid, otherwise an empty string
|
|
123
125
|
|
|
124
126
|
- Type: `string`
|
|
125
127
|
- Default: `-`
|
|
126
128
|
|
|
127
|
-
#### validity
|
|
129
|
+
#### validity (JS only)
|
|
128
130
|
|
|
129
131
|
Returns the validity state of the textarea
|
|
130
132
|
|
|
@@ -138,6 +140,3 @@ Lets you set the current value
|
|
|
138
140
|
- Type: `string`
|
|
139
141
|
- Default: `-`
|
|
140
142
|
|
|
141
|
-
### Types
|
|
142
|
-
|
|
143
|
-
No types documented.
|
|
@@ -111,26 +111,28 @@ Makes the textarea content immutable while remaining focusable. The contents can
|
|
|
111
111
|
|
|
112
112
|
</elements-example>
|
|
113
113
|
|
|
114
|
-
## API
|
|
114
|
+
## `<w-textarea>` API
|
|
115
|
+
|
|
116
|
+
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
115
117
|
|
|
116
118
|
### Properties
|
|
117
119
|
|
|
118
120
|
| Name | Type | Default | Summary |
|
|
119
121
|
|-|-|-|-|
|
|
120
122
|
| disabled | `boolean` | `false` | Makes the element not focusable and hides it from form submits |
|
|
121
|
-
|
|
|
123
|
+
| help-text | `string` | `-` | Description shown below the input field |
|
|
122
124
|
| invalid | `boolean` | `false` | Mark the form field as invalid. |
|
|
123
125
|
| label | `string` | `-` | Either a `label` or an `aria-label` must be provided. |
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
+
| maximum-rows | `number` | `-` | Sets the maximum number of text rows before the content starts scrolling. |
|
|
127
|
+
| minimum-rows | `number` | `-` | Sets the minimum number of text rows the textarea should display |
|
|
126
128
|
| name | `string` | `-` | The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the input field when submitting the form |
|
|
127
129
|
| optional | `boolean` | `false` | Show an icon behind the label indicating the field is optional |
|
|
128
130
|
| placeholder | `string` | `-` | Shown in the textarea when it doesn't have a value |
|
|
129
|
-
|
|
|
131
|
+
| read-only | `boolean` | `false` | **Deprecated**: Use the native `readonly` attribute instead |
|
|
130
132
|
| readonly | `boolean` | `false` | Whether the input can be selected but not changed by the user |
|
|
131
133
|
| required | `boolean` | `false` | Whether user input is required on the input before form submission |
|
|
132
|
-
| validationMessage | `string` | `-` | Returns the validation message if the textarea is invalid, otherwise an empty string |
|
|
133
|
-
| validity | `ValidityState` | `-` | Returns the validity state of the textarea |
|
|
134
|
+
| validationMessage (JS only) | `string` | `-` | Returns the validation message if the textarea is invalid, otherwise an empty string |
|
|
135
|
+
| validity (JS only) | `ValidityState` | `-` | Returns the validity state of the textarea |
|
|
134
136
|
| value | `string` | `-` | Lets you set the current value |
|
|
135
137
|
|
|
136
138
|
### Property Details
|
|
@@ -146,7 +148,7 @@ Please consider more informative alternatives before choosing to use disabled on
|
|
|
146
148
|
- Type: `boolean`
|
|
147
149
|
- Default: `false`
|
|
148
150
|
|
|
149
|
-
####
|
|
151
|
+
#### help-text
|
|
150
152
|
|
|
151
153
|
Use in combination with `invalid` to show as a validation error message,
|
|
152
154
|
or on its own to show a help text.
|
|
@@ -170,14 +172,14 @@ Either a `label` or an `aria-label` must be provided.
|
|
|
170
172
|
- Type: `string`
|
|
171
173
|
- Default: `-`
|
|
172
174
|
|
|
173
|
-
####
|
|
175
|
+
#### maximum-rows
|
|
174
176
|
|
|
175
177
|
Sets the maximum number of text rows before the content starts scrolling.
|
|
176
178
|
|
|
177
179
|
- Type: `number`
|
|
178
180
|
- Default: `-`
|
|
179
181
|
|
|
180
|
-
####
|
|
182
|
+
#### minimum-rows
|
|
181
183
|
|
|
182
184
|
Sets the minimum number of text rows the textarea should display
|
|
183
185
|
|
|
@@ -207,7 +209,7 @@ Placeholder text should not be used as a substitute for labeling the element wit
|
|
|
207
209
|
- Type: `string`
|
|
208
210
|
- Default: `-`
|
|
209
211
|
|
|
210
|
-
####
|
|
212
|
+
#### read-only
|
|
211
213
|
|
|
212
214
|
**Deprecated**: Use the native `readonly` attribute instead
|
|
213
215
|
|
|
@@ -230,14 +232,14 @@ Whether user input is required on the input before form submission
|
|
|
230
232
|
- Type: `boolean`
|
|
231
233
|
- Default: `false`
|
|
232
234
|
|
|
233
|
-
#### validationMessage
|
|
235
|
+
#### validationMessage (JS only)
|
|
234
236
|
|
|
235
237
|
Returns the validation message if the textarea is invalid, otherwise an empty string
|
|
236
238
|
|
|
237
239
|
- Type: `string`
|
|
238
240
|
- Default: `-`
|
|
239
241
|
|
|
240
|
-
#### validity
|
|
242
|
+
#### validity (JS only)
|
|
241
243
|
|
|
242
244
|
Returns the validity state of the textarea
|
|
243
245
|
|
|
@@ -251,6 +253,3 @@ Lets you set the current value
|
|
|
251
253
|
- Type: `string`
|
|
252
254
|
- Default: `-`
|
|
253
255
|
|
|
254
|
-
### Types
|
|
255
|
-
|
|
256
|
-
No types documented.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
## API
|
|
1
|
+
## `<w-textfield>` API
|
|
2
|
+
|
|
3
|
+
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
2
4
|
|
|
3
5
|
### Properties
|
|
4
6
|
|
|
@@ -6,20 +8,20 @@
|
|
|
6
8
|
|-|-|-|-|
|
|
7
9
|
| autocomplete | `string \| undefined` | `-` | A space-separated string that hints to browsers [what type of content it can suggest](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#value) to autofill. |
|
|
8
10
|
| disabled | `boolean` | `false` | Makes the element not focusable and hides it from form submits |
|
|
9
|
-
| formatter | `(value: string) => string` | `-` | Function to format value when the input field |
|
|
10
|
-
|
|
|
11
|
+
| formatter (JS only) | `(value: string) => string` | `-` | Function to format value when the input field |
|
|
12
|
+
| help-text | `string` | `-` | Description shown below the input field |
|
|
11
13
|
| invalid | `boolean` | `false` | Mark the form field as invalid. |
|
|
12
14
|
| label | `string` | `-` | Either a `label` or an `aria-label` must be provided. |
|
|
13
15
|
| max | `number` | `-` | Use with `type="number"` to set the [maximum allowed value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#maxlength). |
|
|
14
|
-
|
|
|
16
|
+
| max-length | `number` | `-` | **Deprecated**: Use the native `maxlength` attribute |
|
|
15
17
|
| maxlength | `number` | `-` | For `text`, `search`, `url`, `tel`, `email` and `password` fields, sets the [maximum string length](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#maxlength) allowed. |
|
|
16
18
|
| min | `number` | `-` | Use with `type="number"` to set the [minimum allowed value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#minlength). |
|
|
17
|
-
|
|
|
19
|
+
| min-length | `number` | `-` | **Deprecated**: Use the native `minlength` attribute |
|
|
18
20
|
| minlength | `number` | `-` | For `text`, `search`, `url`, `tel`, `email` and `password` fields, sets the [minimum string length](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#minlength) required. |
|
|
19
21
|
| name | `string` | `-` | The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the input field when submitting the form. |
|
|
20
22
|
| pattern | `string` | `-` | Sets a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions) that the input's value must [match to pass validation](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#pattern) |
|
|
21
23
|
| placeholder | `string` | `-` | Shown in the textfield when it doesn't have a value |
|
|
22
|
-
|
|
|
24
|
+
| read-only | `boolean` | `false` | **Deprecated**: Use the native readonly attribute instead. |
|
|
23
25
|
| readonly | `boolean` | `false` | Whether the input can be selected but not changed by the user. |
|
|
24
26
|
| required | `boolean` | `false` | Whether user input is required on the input before form submission. |
|
|
25
27
|
| size | `string` | `-` | Sets the [size](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#size) (width) of the input field to fit the expected length of inputs. |
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
|
|
34
36
|
A space-separated string that hints to browsers [what type of content it can suggest](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#value) to autofill.
|
|
35
37
|
|
|
36
|
-
- Type: `string
|
|
38
|
+
- Type: `string | undefined`
|
|
37
39
|
- Default: `-`
|
|
38
40
|
|
|
39
41
|
#### disabled
|
|
@@ -47,7 +49,7 @@ Please consider more informative alternatives before choosing to use disabled on
|
|
|
47
49
|
- Type: `boolean`
|
|
48
50
|
- Default: `false`
|
|
49
51
|
|
|
50
|
-
#### formatter
|
|
52
|
+
#### formatter (JS only)
|
|
51
53
|
|
|
52
54
|
Function to format value when the input field.
|
|
53
55
|
|
|
@@ -57,7 +59,7 @@ similar to the accessible input [masking example from Filament Group](https://fi
|
|
|
57
59
|
- Type: `(value: string) => string`
|
|
58
60
|
- Default: `-`
|
|
59
61
|
|
|
60
|
-
####
|
|
62
|
+
#### help-text
|
|
61
63
|
|
|
62
64
|
Use in combination with `invalid` to show as a validation error message,
|
|
63
65
|
or on its own to show a help text.
|
|
@@ -86,7 +88,7 @@ Use with `type="number"` to set the [maximum allowed value](https://developer.mo
|
|
|
86
88
|
- Type: `number`
|
|
87
89
|
- Default: `-`
|
|
88
90
|
|
|
89
|
-
####
|
|
91
|
+
#### max-length
|
|
90
92
|
|
|
91
93
|
**Deprecated**: Use the native `maxlength` attribute
|
|
92
94
|
|
|
@@ -109,7 +111,7 @@ Use with `type="number"` to set the [minimum allowed value](https://developer.mo
|
|
|
109
111
|
- Type: `number`
|
|
110
112
|
- Default: `-`
|
|
111
113
|
|
|
112
|
-
####
|
|
114
|
+
#### min-length
|
|
113
115
|
|
|
114
116
|
**Deprecated**: Use the native `minlength` attribute
|
|
115
117
|
|
|
@@ -148,7 +150,7 @@ Placeholder text should not be used as a substitute for labeling the element wit
|
|
|
148
150
|
- Type: `string`
|
|
149
151
|
- Default: `-`
|
|
150
152
|
|
|
151
|
-
####
|
|
153
|
+
#### read-only
|
|
152
154
|
|
|
153
155
|
**Deprecated**: Use the native readonly attribute instead.
|
|
154
156
|
|
|
@@ -202,6 +204,3 @@ Lets you set the current value.
|
|
|
202
204
|
- Type: `string`
|
|
203
205
|
- Default: `-`
|
|
204
206
|
|
|
205
|
-
### Types
|
|
206
|
-
|
|
207
|
-
No types documented.
|
|
@@ -181,7 +181,9 @@ The readonly boolean attribute makes the w-textfield's text content immutable. U
|
|
|
181
181
|
|
|
182
182
|
</elements-example>
|
|
183
183
|
|
|
184
|
-
## API
|
|
184
|
+
## `<w-textfield>` API
|
|
185
|
+
|
|
186
|
+
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
185
187
|
|
|
186
188
|
### Properties
|
|
187
189
|
|
|
@@ -189,20 +191,20 @@ The readonly boolean attribute makes the w-textfield's text content immutable. U
|
|
|
189
191
|
|-|-|-|-|
|
|
190
192
|
| autocomplete | `string \| undefined` | `-` | A space-separated string that hints to browsers [what type of content it can suggest](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#value) to autofill. |
|
|
191
193
|
| disabled | `boolean` | `false` | Makes the element not focusable and hides it from form submits |
|
|
192
|
-
| formatter | `(value: string) => string` | `-` | Function to format value when the input field |
|
|
193
|
-
|
|
|
194
|
+
| formatter (JS only) | `(value: string) => string` | `-` | Function to format value when the input field |
|
|
195
|
+
| help-text | `string` | `-` | Description shown below the input field |
|
|
194
196
|
| invalid | `boolean` | `false` | Mark the form field as invalid. |
|
|
195
197
|
| label | `string` | `-` | Either a `label` or an `aria-label` must be provided. |
|
|
196
198
|
| max | `number` | `-` | Use with `type="number"` to set the [maximum allowed value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#maxlength). |
|
|
197
|
-
|
|
|
199
|
+
| max-length | `number` | `-` | **Deprecated**: Use the native `maxlength` attribute |
|
|
198
200
|
| maxlength | `number` | `-` | For `text`, `search`, `url`, `tel`, `email` and `password` fields, sets the [maximum string length](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#maxlength) allowed. |
|
|
199
201
|
| min | `number` | `-` | Use with `type="number"` to set the [minimum allowed value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#minlength). |
|
|
200
|
-
|
|
|
202
|
+
| min-length | `number` | `-` | **Deprecated**: Use the native `minlength` attribute |
|
|
201
203
|
| minlength | `number` | `-` | For `text`, `search`, `url`, `tel`, `email` and `password` fields, sets the [minimum string length](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#minlength) required. |
|
|
202
204
|
| name | `string` | `-` | The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the input field when submitting the form. |
|
|
203
205
|
| pattern | `string` | `-` | Sets a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions) that the input's value must [match to pass validation](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#pattern) |
|
|
204
206
|
| placeholder | `string` | `-` | Shown in the textfield when it doesn't have a value |
|
|
205
|
-
|
|
|
207
|
+
| read-only | `boolean` | `false` | **Deprecated**: Use the native readonly attribute instead. |
|
|
206
208
|
| readonly | `boolean` | `false` | Whether the input can be selected but not changed by the user. |
|
|
207
209
|
| required | `boolean` | `false` | Whether user input is required on the input before form submission. |
|
|
208
210
|
| size | `string` | `-` | Sets the [size](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#size) (width) of the input field to fit the expected length of inputs. |
|
|
@@ -216,7 +218,7 @@ The readonly boolean attribute makes the w-textfield's text content immutable. U
|
|
|
216
218
|
|
|
217
219
|
A space-separated string that hints to browsers [what type of content it can suggest](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#value) to autofill.
|
|
218
220
|
|
|
219
|
-
- Type: `string
|
|
221
|
+
- Type: `string | undefined`
|
|
220
222
|
- Default: `-`
|
|
221
223
|
|
|
222
224
|
#### disabled
|
|
@@ -230,7 +232,7 @@ Please consider more informative alternatives before choosing to use disabled on
|
|
|
230
232
|
- Type: `boolean`
|
|
231
233
|
- Default: `false`
|
|
232
234
|
|
|
233
|
-
#### formatter
|
|
235
|
+
#### formatter (JS only)
|
|
234
236
|
|
|
235
237
|
Function to format value when the input field.
|
|
236
238
|
|
|
@@ -240,7 +242,7 @@ similar to the accessible input [masking example from Filament Group](https://fi
|
|
|
240
242
|
- Type: `(value: string) => string`
|
|
241
243
|
- Default: `-`
|
|
242
244
|
|
|
243
|
-
####
|
|
245
|
+
#### help-text
|
|
244
246
|
|
|
245
247
|
Use in combination with `invalid` to show as a validation error message,
|
|
246
248
|
or on its own to show a help text.
|
|
@@ -269,7 +271,7 @@ Use with `type="number"` to set the [maximum allowed value](https://developer.mo
|
|
|
269
271
|
- Type: `number`
|
|
270
272
|
- Default: `-`
|
|
271
273
|
|
|
272
|
-
####
|
|
274
|
+
#### max-length
|
|
273
275
|
|
|
274
276
|
**Deprecated**: Use the native `maxlength` attribute
|
|
275
277
|
|
|
@@ -292,7 +294,7 @@ Use with `type="number"` to set the [minimum allowed value](https://developer.mo
|
|
|
292
294
|
- Type: `number`
|
|
293
295
|
- Default: `-`
|
|
294
296
|
|
|
295
|
-
####
|
|
297
|
+
#### min-length
|
|
296
298
|
|
|
297
299
|
**Deprecated**: Use the native `minlength` attribute
|
|
298
300
|
|
|
@@ -331,7 +333,7 @@ Placeholder text should not be used as a substitute for labeling the element wit
|
|
|
331
333
|
- Type: `string`
|
|
332
334
|
- Default: `-`
|
|
333
335
|
|
|
334
|
-
####
|
|
336
|
+
#### read-only
|
|
335
337
|
|
|
336
338
|
**Deprecated**: Use the native readonly attribute instead.
|
|
337
339
|
|
|
@@ -385,6 +387,3 @@ Lets you set the current value.
|
|
|
385
387
|
- Type: `string`
|
|
386
388
|
- Default: `-`
|
|
387
389
|
|
|
388
|
-
### Types
|
|
389
|
-
|
|
390
|
-
No types documented.
|