@warp-ds/elements 2.9.0-next.5 → 2.9.0-next.6

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 (65) hide show
  1. package/dist/custom-elements.json +159 -97
  2. package/dist/docs/affix/affix.md +25 -23
  3. package/dist/docs/affix/api.md +25 -23
  4. package/dist/docs/alert/alert.md +12 -12
  5. package/dist/docs/alert/api.md +12 -12
  6. package/dist/docs/attention/api.md +46 -46
  7. package/dist/docs/attention/attention.md +46 -46
  8. package/dist/docs/badge/accessibility.md +44 -0
  9. package/dist/docs/badge/api.md +12 -8
  10. package/dist/docs/badge/badge.md +191 -10
  11. package/dist/docs/badge/examples.md +82 -0
  12. package/dist/docs/badge/usage.md +53 -0
  13. package/dist/docs/button/api.md +46 -42
  14. package/dist/docs/button/button.md +46 -42
  15. package/dist/docs/card/api.md +11 -11
  16. package/dist/docs/card/card.md +11 -11
  17. package/dist/docs/combobox/api.md +62 -62
  18. package/dist/docs/combobox/combobox.md +62 -62
  19. package/dist/docs/datepicker/api.md +74 -66
  20. package/dist/docs/datepicker/datepicker.md +74 -66
  21. package/dist/docs/expandable/api.md +26 -26
  22. package/dist/docs/expandable/expandable.md +26 -26
  23. package/dist/docs/link/api.md +28 -28
  24. package/dist/docs/link/link.md +28 -28
  25. package/dist/docs/page-indicator/api.md +6 -6
  26. package/dist/docs/page-indicator/page-indicator.md +6 -6
  27. package/dist/docs/pagination/api.md +3 -3
  28. package/dist/docs/pagination/pagination.md +3 -3
  29. package/dist/docs/pill/api.md +19 -15
  30. package/dist/docs/pill/pill.md +19 -15
  31. package/dist/docs/select/api.md +44 -44
  32. package/dist/docs/select/select.md +44 -44
  33. package/dist/docs/slider/api.md +80 -78
  34. package/dist/docs/slider/slider.md +80 -78
  35. package/dist/docs/slider-thumb/api.md +28 -76
  36. package/dist/docs/slider-thumb/slider-thumb.md +28 -76
  37. package/dist/docs/switch/api.md +16 -16
  38. package/dist/docs/switch/switch.md +16 -16
  39. package/dist/docs/tab/api.md +26 -40
  40. package/dist/docs/tab/tab.md +26 -40
  41. package/dist/docs/tab-panel/api.md +1 -17
  42. package/dist/docs/tab-panel/tab-panel.md +1 -17
  43. package/dist/docs/tabs/api.md +3 -3
  44. package/dist/docs/tabs/tabs.md +3 -3
  45. package/dist/docs/textarea/api.md +42 -40
  46. package/dist/docs/textarea/textarea.md +42 -40
  47. package/dist/docs/textfield/accessibility.md +15 -0
  48. package/dist/docs/textfield/api.md +86 -83
  49. package/dist/docs/textfield/examples.md +147 -0
  50. package/dist/docs/textfield/textfield.md +279 -86
  51. package/dist/docs/textfield/usage.md +30 -0
  52. package/dist/index.d.ts +220 -196
  53. package/dist/packages/badge/badge.d.ts +7 -5
  54. package/dist/packages/badge/badge.js.map +2 -2
  55. package/dist/packages/datepicker/datepicker.js +1 -1
  56. package/dist/packages/datepicker/datepicker.js.map +2 -2
  57. package/dist/packages/datepicker/datepicker.react.stories.d.ts +9 -1
  58. package/dist/packages/datepicker/react.d.ts +4 -0
  59. package/dist/packages/datepicker/react.js +4 -0
  60. package/dist/packages/textfield/textfield.d.ts +57 -60
  61. package/dist/packages/textfield/textfield.js +5 -5
  62. package/dist/packages/textfield/textfield.js.map +2 -2
  63. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  64. package/dist/web-types.json +392 -116
  65. package/package.json +1 -1
@@ -18,40 +18,40 @@ A single line text input element.
18
18
 
19
19
  | Name | Type | Default | Summary |
20
20
  |-|-|-|-|
21
- | shadowRootOptions | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
22
21
  | disabled | `boolean` | `false` | - |
22
+ | helpText | `string` | `-` | - |
23
23
  | invalid | `boolean` | `false` | - |
24
24
  | label | `string` | `-` | - |
25
- | helpText | `string` | `-` | - |
25
+ | maxHeight | `unknown` | `-` | - |
26
26
  | maxRows | `number` | `-` | - |
27
+ | minHeight | `unknown` | `-` | - |
27
28
  | minRows | `number` | `-` | - |
28
29
  | name | `string` | `-` | - |
30
+ | optional | `boolean` | `false` | - |
29
31
  | placeholder | `string` | `-` | - |
30
- | readOnly | `boolean` | `false` | - |
32
+ | readOnly | `boolean` | `false` | **Deprecated**: Use the native readonly attribute instead. Here for API consistency with `w-textfield`. |
31
33
  | readonly | `boolean` | `false` | - |
32
34
  | required | `boolean` | `false` | - |
35
+ | shadowRootOptions | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
36
+ | validationMessage | `string` | `-` | Returns the validation message if the textarea is invalid, otherwise an empty string |
37
+ | validity | `ValidityState` | `-` | Returns the validity state of the textarea |
33
38
  | value | `string` | `-` | - |
34
- | optional | `boolean` | `false` | - |
35
- | minHeight | `unknown` | `-` | - |
36
- | maxHeight | `unknown` | `-` | - |
37
- | validationMessage | `string` | `-` | - |
38
- | validity | `ValidityState` | `-` | - |
39
39
 
40
40
  ### Property Details
41
41
 
42
- #### shadowRootOptions
42
+ #### disabled
43
43
 
44
44
 
45
45
 
46
- - Type: `object`
47
- - Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }`
46
+ - Type: `boolean`
47
+ - Default: `false`
48
48
 
49
- #### disabled
49
+ #### helpText
50
50
 
51
51
 
52
52
 
53
- - Type: `boolean`
54
- - Default: `false`
53
+ - Type: `string`
54
+ - Default: `-`
55
55
 
56
56
  #### invalid
57
57
 
@@ -67,11 +67,11 @@ A single line text input element.
67
67
  - Type: `string`
68
68
  - Default: `-`
69
69
 
70
- #### helpText
70
+ #### maxHeight
71
71
 
72
72
 
73
73
 
74
- - Type: `string`
74
+ - Type: `unknown`
75
75
  - Default: `-`
76
76
 
77
77
  #### maxRows
@@ -81,75 +81,70 @@ A single line text input element.
81
81
  - Type: `number`
82
82
  - Default: `-`
83
83
 
84
- #### minRows
84
+ #### minHeight
85
85
 
86
86
 
87
87
 
88
- - Type: `number`
88
+ - Type: `unknown`
89
89
  - Default: `-`
90
90
 
91
- #### name
91
+ #### minRows
92
92
 
93
93
 
94
94
 
95
- - Type: `string`
95
+ - Type: `number`
96
96
  - Default: `-`
97
97
 
98
- #### placeholder
98
+ #### name
99
99
 
100
100
 
101
101
 
102
102
  - Type: `string`
103
103
  - Default: `-`
104
104
 
105
- #### readOnly
105
+ #### optional
106
106
 
107
107
 
108
108
 
109
109
  - Type: `boolean`
110
110
  - Default: `false`
111
111
 
112
- #### readonly
112
+ #### placeholder
113
113
 
114
114
 
115
115
 
116
- - Type: `boolean`
117
- - Default: `false`
116
+ - Type: `string`
117
+ - Default: `-`
118
118
 
119
- #### required
119
+ #### readOnly
120
+
121
+ **Deprecated**: Use the native readonly attribute instead. Here for API consistency with `w-textfield`.
120
122
 
121
123
 
122
124
 
123
125
  - Type: `boolean`
124
126
  - Default: `false`
125
127
 
126
- #### value
127
-
128
-
129
-
130
- - Type: `string`
131
- - Default: `-`
132
-
133
- #### optional
128
+ #### readonly
134
129
 
135
130
 
136
131
 
137
132
  - Type: `boolean`
138
133
  - Default: `false`
139
134
 
140
- #### minHeight
135
+ #### required
141
136
 
142
137
 
143
138
 
144
- - Type: `unknown`
145
- - Default: `-`
139
+ - Type: `boolean`
140
+ - Default: `false`
146
141
 
147
- #### maxHeight
142
+ #### shadowRootOptions
148
143
 
149
144
 
150
145
 
151
- - Type: `unknown`
152
- - Default: `-`
146
+ - Type: `object`
147
+ - Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }`
153
148
 
154
149
  #### validationMessage
155
150
 
@@ -165,6 +160,13 @@ Returns the validity state of the textarea
165
160
  - Type: `ValidityState`
166
161
  - Default: `-`
167
162
 
163
+ #### value
164
+
165
+
166
+
167
+ - Type: `string`
168
+ - Default: `-`
169
+
168
170
  ### Types
169
171
 
170
172
  No types documented.
@@ -1 +1,16 @@
1
1
  ## Accessibility
2
+
3
+ If a visible label isn't specified, an `aria-label` must be provided to the text field for accessibility. If the field is labeled by a separate element, an `aria-labelledby` property must be provided using the `id` of the labeling element instead.
4
+
5
+ - Always provide a visible label (do not rely on `placeholder` alone).
6
+ - Do not rely on color alone for interaction feedback (e.g. error states).
7
+ - Interaction patterns should follow platform-native expectations (e.g. tap zones, keyboard navigation, etc) and must not block accessibility tools.
8
+
9
+ ### When used with an affix
10
+
11
+ When `search` or `clear` set on the [affix](#with-affix) component it renders a button and a default `aria-label`. If the `aria-label` incorrect for your context, you may provide your own describing the action.
12
+
13
+ ```html
14
+ <w-affix search aria-label="Ad Search"></w-affix>
15
+ <w-affix clear aria-label="Clear text input"></w-affix>
16
+ ```
@@ -4,126 +4,154 @@
4
4
 
5
5
  | Name | Type | Default | Summary |
6
6
  |-|-|-|-|
7
- | shadowRootOptions | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
8
- | disabled | `boolean` | `false` | - |
9
- | invalid | `boolean` | `false` | - |
10
- | id | `string` | `-` | - |
11
- | label | `string` | `-` | - |
12
- | helpText | `string` | `-` | - |
13
- | size | `string` | `-` | - |
14
- | max | `number` | `-` | - |
15
- | min | `number` | `-` | - |
16
- | minLength | `number` | `-` | - |
17
- | maxLength | `number` | `-` | - |
18
- | pattern | `string` | `-` | - |
19
- | placeholder | `string` | `-` | - |
20
- | readOnly | `boolean` | `false` | - |
21
- | readonly | `boolean` | `false` | - |
22
- | required | `boolean` | `false` | - |
23
- | type | `string` | `-` | - |
24
- | value | `string` | `-` | - |
25
- | name | `string` | `-` | - |
26
- | step | `number` | `-` | - |
27
- | autocomplete | `string | undefined` | `-` | - |
28
- | formatter | `(value: string) => string` | `-` | - |
29
- | _hasPrefix | `unknown` | `-` | - |
30
- | _hasSuffix | `unknown` | `-` | - |
7
+ | 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
+ | 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
+ | helpText | `string` | `-` | Description shown below the input field |
11
+ | invalid | `boolean` | `false` | Mark the form field as invalid. |
12
+ | label | `string` | `-` | Either a `label` or an `aria-label` must be provided. |
13
+ | 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
+ | maxLength | `number` | `-` | **Deprecated**: Use the native `maxlength` attribute |
15
+ | 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
+ | 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
+ | minLength | `number` | `-` | **Deprecated**: Use the native `minlength` attribute |
18
+ | 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
+ | 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
+ | 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
+ | placeholder | `string` | `-` | Shown in the textfield when it doesn't have a value |
22
+ | readOnly | `boolean` | `false` | **Deprecated**: Use the native readonly attribute instead. |
23
+ | readonly | `boolean` | `false` | Whether the input can be selected but not changed by the user. |
24
+ | required | `boolean` | `false` | Whether user input is required on the input before form submission. |
25
+ | 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. |
26
+ | step | `number` | `-` | Forces `number` inputs to be a whole number of `step` |
27
+ | type | `string` | `-` | The [type of input](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#input_types). |
28
+ | value | `string` | `-` | Lets you set the current value. |
31
29
 
32
30
  ### Property Details
33
31
 
34
- #### shadowRootOptions
35
-
32
+ #### autocomplete
36
33
 
34
+ 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.
37
35
 
38
- - Type: `object`
39
- - Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }`
36
+ - Type: `string \| undefined`
37
+ - Default: `-`
40
38
 
41
39
  #### disabled
42
40
 
41
+ Keep in mind that using disabled in its current form is an anti-pattern.
43
42
 
43
+ There will always be users who don't understand why an element is disabled, or users who can't even see that it is disabled because of poor lighting conditions or other reasons.
44
+
45
+ Please consider more informative alternatives before choosing to use disabled on an element.
44
46
 
45
47
  - Type: `boolean`
46
48
  - Default: `false`
47
49
 
48
- #### invalid
49
-
50
+ #### formatter
50
51
 
52
+ Function to format value when the input field.
51
53
 
52
- - Type: `boolean`
53
- - Default: `false`
54
+ Only active when the input field does not have focus,
55
+ similar to the accessible input [masking example from Filament Group](https://filamentgroup.github.io/politespace/demo/demo.html).
54
56
 
55
- #### id
57
+ - Type: `(value: string) => string`
58
+ - Default: `-`
56
59
 
60
+ #### helpText
57
61
 
62
+ Use in combination with `invalid` to show as a validation error message,
63
+ or on its own to show a help text.
58
64
 
59
65
  - Type: `string`
60
66
  - Default: `-`
61
67
 
62
- #### label
68
+ #### invalid
69
+
70
+ Mark the form field as invalid. Make sure to also set a `help-text` to help users fix the validation problem.
71
+
72
+ - Type: `boolean`
73
+ - Default: `false`
63
74
 
75
+ #### label
64
76
 
77
+ Either a `label` or an `aria-label` must be provided.
65
78
 
66
79
  - Type: `string`
67
80
  - Default: `-`
68
81
 
69
- #### helpText
70
-
82
+ #### max
71
83
 
84
+ Use with `type="number"` to set the [maximum allowed value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#maxlength).
72
85
 
73
- - Type: `string`
86
+ - Type: `number`
74
87
  - Default: `-`
75
88
 
76
- #### size
89
+ #### maxLength
77
90
 
91
+ **Deprecated**: Use the native `maxlength` attribute
78
92
 
79
93
 
80
- - Type: `string`
81
- - Default: `-`
82
94
 
83
- #### max
95
+ - Type: `number`
96
+ - Default: `-`
84
97
 
98
+ #### maxlength
85
99
 
100
+ 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.
86
101
 
87
102
  - Type: `number`
88
103
  - Default: `-`
89
104
 
90
105
  #### min
91
106
 
92
-
107
+ Use with `type="number"` to set the [minimum allowed value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#minlength).
93
108
 
94
109
  - Type: `number`
95
110
  - Default: `-`
96
111
 
97
112
  #### minLength
98
113
 
114
+ **Deprecated**: Use the native `minlength` attribute
115
+
99
116
 
100
117
 
101
118
  - Type: `number`
102
119
  - Default: `-`
103
120
 
104
- #### maxLength
105
-
121
+ #### minlength
106
122
 
123
+ 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.
107
124
 
108
125
  - Type: `number`
109
126
  - Default: `-`
110
127
 
111
- #### pattern
128
+ #### name
112
129
 
130
+ The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the input field when submitting the form.
113
131
 
132
+ - Type: `string`
133
+ - Default: `-`
134
+
135
+ #### pattern
136
+
137
+ 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)
114
138
 
115
139
  - Type: `string`
116
140
  - Default: `-`
117
141
 
118
142
  #### placeholder
119
143
 
144
+ Set a text that is shown in the textfield when it doesn't have a value.
120
145
 
146
+ Placeholder text should not be used as a substitute for labeling the element with a visible label.
121
147
 
122
148
  - Type: `string`
123
149
  - Default: `-`
124
150
 
125
151
  #### readOnly
126
152
 
153
+ **Deprecated**: Use the native readonly attribute instead.
154
+
127
155
 
128
156
 
129
157
  - Type: `boolean`
@@ -131,72 +159,47 @@
131
159
 
132
160
  #### readonly
133
161
 
134
-
162
+ Whether the input can be selected but not changed by the user.
135
163
 
136
164
  - Type: `boolean`
137
165
  - Default: `false`
138
166
 
139
167
  #### required
140
168
 
141
-
169
+ Whether user input is required on the input before form submission.
142
170
 
143
171
  - Type: `boolean`
144
172
  - Default: `false`
145
173
 
146
- #### type
147
-
148
-
149
-
150
- - Type: `string`
151
- - Default: `-`
152
-
153
- #### value
154
-
155
-
156
-
157
- - Type: `string`
158
- - Default: `-`
159
-
160
- #### name
161
-
174
+ #### size
162
175
 
176
+ 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.
163
177
 
164
178
  - Type: `string`
165
179
  - Default: `-`
166
180
 
167
181
  #### step
168
182
 
183
+ When used with `number` this attribute forces inputs to be a whole number of `step`.
169
184
 
185
+ For example with a `step="5"` only values that divide evenly on 5 are allowed.
186
+ Using arrow up and down in the input field increments and decrements by 5.
170
187
 
171
188
  - Type: `number`
172
189
  - Default: `-`
173
190
 
174
- #### autocomplete
175
-
176
-
177
-
178
- - Type: `string | undefined`
179
- - Default: `-`
180
-
181
- #### formatter
182
-
183
-
184
-
185
- - Type: `(value: string) => string`
186
- - Default: `-`
187
-
188
- #### _hasPrefix
189
-
191
+ #### type
190
192
 
193
+ The [type of input](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#input_types).
191
194
 
192
- - Type: `unknown`
195
+ - Type: `string`
193
196
  - Default: `-`
194
197
 
195
- #### _hasSuffix
196
-
198
+ #### value
197
199
 
200
+ Lets you set the current value.
198
201
 
199
- - Type: `unknown`
202
+ - Type: `string`
200
203
  - Default: `-`
201
204
 
202
205
  ### Types
@@ -1 +1,148 @@
1
1
  ## Examples
2
+
3
+ ### Placeholder
4
+
5
+ Placeholder text can be used to describe the expected value or formatting for the textfield.
6
+
7
+ Placeholder text will only appear when the textfield is empty, and must not be used as a
8
+ substitute for labeling the element with a visible label.
9
+
10
+ <style-isolate>
11
+ <w-textfield label="Email" placeholder="ola.nordmann@finn.no"></w-textfield>
12
+ </style-isolate>
13
+
14
+ ```html
15
+ <w-textfield label="Email" placeholder="ola.nordmann@finn.no"></w-textfield>
16
+ ```
17
+
18
+ ### Prefix label
19
+
20
+ <style-isolate>
21
+ <w-textfield label="Price">
22
+ <w-affix slot="prefix" label="kr"></w-affix>
23
+ </w-textfield>
24
+ </style-isolate>
25
+
26
+ ```html
27
+ <w-textfield label="Price">
28
+ <w-affix slot="prefix" label="kr"></w-affix>
29
+ </w-textfield>
30
+ ```
31
+
32
+ ### Suffix Label
33
+
34
+ <style-isolate>
35
+ <w-textfield label="Price">
36
+ <w-affix slot="suffix" label="kr"></w-affix>
37
+ </w-textfield>
38
+ </style-isolate>
39
+
40
+ ```html
41
+ <w-textfield label="Price">
42
+ <w-affix slot="suffix" label="kr"></w-affix>
43
+ </w-textfield>
44
+ ```
45
+
46
+ ### Prefix Search Icon
47
+
48
+ <style-isolate>
49
+ <w-textfield label="Search">
50
+ <w-affix slot="prefix" search></w-affix>
51
+ </w-textfield>
52
+ </style-isolate>
53
+
54
+ ```html
55
+ <w-textfield label="Search">
56
+ <w-affix slot="prefix" search></w-affix>
57
+ </w-textfield>
58
+ ```
59
+
60
+ ### Suffix Search Icon
61
+
62
+ If you wrap the textfield with affix in a form element, clicking the search button will automatically submit the form
63
+
64
+ <style-isolate>
65
+ <form>
66
+ <w-textfield label="Search">
67
+ <w-affix slot="suffix" search></w-affix>
68
+ </w-textfield>
69
+ </form>
70
+ </style-isolate>
71
+
72
+ ```html
73
+ <form>
74
+ <w-textfield label="Search">
75
+ <w-affix slot="prefix" search></w-affix>
76
+ </w-textfield>
77
+ </form>
78
+ ```
79
+
80
+ ### Suffix Clear Icon
81
+
82
+ Clicking the clear button will reset the textfield
83
+
84
+ <style-isolate>
85
+ <w-textfield label="Search input">
86
+ <w-affix slot="suffix" clear></w-affix>
87
+ </w-textfield>
88
+ </style-isolate>
89
+
90
+ ```html
91
+ <w-textfield label="Search input">
92
+ <w-affix slot="suffix" clear></w-affix>
93
+ </w-textfield>
94
+ ```
95
+
96
+ ### Affix with arbitrary icon
97
+
98
+ <style-isolate>
99
+ <w-textfield label="Award">
100
+ <w-affix slot="prefix" icon="AwardMedal"></w-affix>
101
+ </w-textfield>
102
+ </style-isolate>
103
+
104
+ ```html
105
+ <w-textfield label="Award">
106
+ <w-affix slot="prefix" icon="AwardMedal"></w-affix>
107
+ </w-textfield>
108
+ ```
109
+
110
+ ### Disabled
111
+
112
+ Keep in mind that using disabled in its current form is an anti-pattern.
113
+
114
+ There will always be users who don't understand why an element is disabled, or users who can't even see that
115
+ it is disabled because of poor lighting conditions or other reasons.
116
+
117
+ Please consider more informative alternatives before choosing to use disabled on an element.
118
+
119
+ <style-isolate>
120
+ <div class="flex flex-col space-y-32">
121
+ <w-textfield label="Email" disabled value="ola.nordmann@finn.no"></w-textfield>
122
+ <w-textfield label="Email" disabled></w-textfield>
123
+ </div>
124
+ </style-isolate>
125
+
126
+ ```html
127
+ <div class="flex flex-col space-y-32">
128
+ <w-textfield label="Email" disabled value="ola.nordmann@finn.no"></w-textfield>
129
+ <w-textfield label="Email" disabled></w-textfield>
130
+ </div>
131
+ ```
132
+
133
+ ### Read only
134
+
135
+ The readonly boolean attribute makes the w-textfield's text content immutable. Unlike disabled the w-textfield remains focusable and the contents can still be copied. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/readOnly) for more information.
136
+
137
+ <style-isolate>
138
+ <w-textfield label="Email" type="email" value="ola.nordmann@finn.no" readonly></w-textfield>
139
+ </style-isolate>
140
+
141
+ ```html
142
+ <w-textfield
143
+ label="Email"
144
+ type="email"
145
+ value="ola.nordmann@finn.no"
146
+ readonly
147
+ ></w-textfield>
148
+ ```