@instructure/ui-text-input 11.7.5-snapshot-23 → 11.7.5-snapshot-24
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/CHANGELOG.md +5 -2
- package/es/TextInput/v2/index.js +3 -1
- package/es/TextInput/v2/props.js +1 -1
- package/lib/TextInput/v2/index.js +3 -1
- package/lib/TextInput/v2/props.js +1 -1
- package/package.json +13 -13
- package/src/TextInput/v2/index.tsx +7 -1
- package/src/TextInput/v2/props.ts +7 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TextInput/v2/index.d.ts +2 -0
- package/types/TextInput/v2/index.d.ts.map +1 -1
- package/types/TextInput/v2/props.d.ts +5 -0
- package/types/TextInput/v2/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.7.5-snapshot-
|
|
6
|
+
## [11.7.5-snapshot-24](https://github.com/instructure/instructure-ui/compare/v11.7.4...v11.7.5-snapshot-24) (2026-08-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui-text-input,ui-select:** add forcePlaceholder prop to TextInput ([7a87063](https://github.com/instructure/instructure-ui/commit/7a870631b091839b360d1ca8bb4fd6ea171315da))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
package/es/TextInput/v2/index.js
CHANGED
|
@@ -46,6 +46,7 @@ let TextInput = (_dec = withDeterministicId(), _dec2 = withStyleNew(generateStyl
|
|
|
46
46
|
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
47
47
|
interaction: undefined,
|
|
48
48
|
isRequired: false,
|
|
49
|
+
forcePlaceholder: false,
|
|
49
50
|
display: 'block',
|
|
50
51
|
shouldNotWrap: false,
|
|
51
52
|
renderBeforeInputElementGap: 'default',
|
|
@@ -174,6 +175,7 @@ let TextInput = (_dec = withDeterministicId(), _dec2 = withStyleNew(generateStyl
|
|
|
174
175
|
value,
|
|
175
176
|
defaultValue,
|
|
176
177
|
isRequired,
|
|
178
|
+
forcePlaceholder,
|
|
177
179
|
onFocus,
|
|
178
180
|
...rest
|
|
179
181
|
} = this.props;
|
|
@@ -197,7 +199,7 @@ let TextInput = (_dec = withDeterministicId(), _dec2 = withStyleNew(generateStyl
|
|
|
197
199
|
css: this.props.styles?.textInput,
|
|
198
200
|
defaultValue: defaultValue,
|
|
199
201
|
value: value,
|
|
200
|
-
placeholder: interaction === 'enabled' ? placeholder : undefined,
|
|
202
|
+
placeholder: forcePlaceholder || interaction === 'enabled' ? placeholder : undefined,
|
|
201
203
|
ref: this.handleInputRef,
|
|
202
204
|
type: type,
|
|
203
205
|
id: this.id,
|
package/es/TextInput/v2/props.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
const allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'renderBeforeInputElementGap', 'placeholder', 'isRequired', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus', 'margin'];
|
|
25
|
+
const allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'renderBeforeInputElementGap', 'placeholder', 'isRequired', 'forcePlaceholder', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus', 'margin'];
|
|
26
26
|
export { allowedProps };
|
|
@@ -57,6 +57,7 @@ let TextInput = exports.TextInput = (_dec = (0, _withDeterministicId.withDetermi
|
|
|
57
57
|
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
58
58
|
interaction: undefined,
|
|
59
59
|
isRequired: false,
|
|
60
|
+
forcePlaceholder: false,
|
|
60
61
|
display: 'block',
|
|
61
62
|
shouldNotWrap: false,
|
|
62
63
|
renderBeforeInputElementGap: 'default',
|
|
@@ -185,6 +186,7 @@ let TextInput = exports.TextInput = (_dec = (0, _withDeterministicId.withDetermi
|
|
|
185
186
|
value,
|
|
186
187
|
defaultValue,
|
|
187
188
|
isRequired,
|
|
189
|
+
forcePlaceholder,
|
|
188
190
|
onFocus,
|
|
189
191
|
...rest
|
|
190
192
|
} = this.props;
|
|
@@ -208,7 +210,7 @@ let TextInput = exports.TextInput = (_dec = (0, _withDeterministicId.withDetermi
|
|
|
208
210
|
css: this.props.styles?.textInput,
|
|
209
211
|
defaultValue: defaultValue,
|
|
210
212
|
value: value,
|
|
211
|
-
placeholder: interaction === 'enabled' ? placeholder : undefined,
|
|
213
|
+
placeholder: forcePlaceholder || interaction === 'enabled' ? placeholder : undefined,
|
|
212
214
|
ref: this.handleInputRef,
|
|
213
215
|
type: type,
|
|
214
216
|
id: this.id,
|
|
@@ -28,4 +28,4 @@ exports.allowedProps = void 0;
|
|
|
28
28
|
* SOFTWARE.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
const allowedProps = exports.allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'renderBeforeInputElementGap', 'placeholder', 'isRequired', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus', 'margin'];
|
|
31
|
+
const allowedProps = exports.allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'renderBeforeInputElementGap', 'placeholder', 'isRequired', 'forcePlaceholder', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus', 'margin'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-text-input",
|
|
3
|
-
"version": "11.7.5-snapshot-
|
|
3
|
+
"version": "11.7.5-snapshot-24",
|
|
4
4
|
"description": "A styled HTML text input component.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
"@testing-library/react": "16.3.2",
|
|
19
19
|
"@testing-library/user-event": "^14.6.1",
|
|
20
20
|
"vitest": "^4.1.9",
|
|
21
|
-
"@instructure/ui-
|
|
22
|
-
"@instructure/ui-
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
21
|
+
"@instructure/ui-badge": "11.7.5-snapshot-24",
|
|
22
|
+
"@instructure/ui-babel-preset": "11.7.5-snapshot-24",
|
|
23
|
+
"@instructure/ui-color-utils": "11.7.5-snapshot-24",
|
|
24
|
+
"@instructure/ui-axe-check": "11.7.5-snapshot-24"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.29.7",
|
|
28
|
-
"@instructure/emotion": "11.7.5-snapshot-
|
|
29
|
-
"@instructure/shared-types": "11.7.5-snapshot-
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/ui-
|
|
32
|
-
"@instructure/ui-form-field": "11.7.5-snapshot-
|
|
33
|
-
"@instructure/ui-react-utils": "11.7.5-snapshot-
|
|
34
|
-
"@instructure/ui-tag": "11.7.5-snapshot-
|
|
35
|
-
"@instructure/ui-themes": "11.7.5-snapshot-
|
|
28
|
+
"@instructure/emotion": "11.7.5-snapshot-24",
|
|
29
|
+
"@instructure/shared-types": "11.7.5-snapshot-24",
|
|
30
|
+
"@instructure/ui-a11y-utils": "11.7.5-snapshot-24",
|
|
31
|
+
"@instructure/ui-dom-utils": "11.7.5-snapshot-24",
|
|
32
|
+
"@instructure/ui-form-field": "11.7.5-snapshot-24",
|
|
33
|
+
"@instructure/ui-react-utils": "11.7.5-snapshot-24",
|
|
34
|
+
"@instructure/ui-tag": "11.7.5-snapshot-24",
|
|
35
|
+
"@instructure/ui-themes": "11.7.5-snapshot-24"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": ">=18 <=19"
|
|
@@ -59,6 +59,7 @@ class TextInput extends Component<TextInputProps> {
|
|
|
59
59
|
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
60
60
|
interaction: undefined,
|
|
61
61
|
isRequired: false,
|
|
62
|
+
forcePlaceholder: false,
|
|
62
63
|
display: 'block',
|
|
63
64
|
shouldNotWrap: false,
|
|
64
65
|
renderBeforeInputElementGap: 'default',
|
|
@@ -222,6 +223,7 @@ class TextInput extends Component<TextInputProps> {
|
|
|
222
223
|
value,
|
|
223
224
|
defaultValue,
|
|
224
225
|
isRequired,
|
|
226
|
+
forcePlaceholder,
|
|
225
227
|
onFocus,
|
|
226
228
|
...rest
|
|
227
229
|
} = this.props
|
|
@@ -250,7 +252,11 @@ class TextInput extends Component<TextInputProps> {
|
|
|
250
252
|
css={this.props.styles?.textInput}
|
|
251
253
|
defaultValue={defaultValue}
|
|
252
254
|
value={value}
|
|
253
|
-
placeholder={
|
|
255
|
+
placeholder={
|
|
256
|
+
forcePlaceholder || interaction === 'enabled'
|
|
257
|
+
? placeholder
|
|
258
|
+
: undefined
|
|
259
|
+
}
|
|
254
260
|
ref={this.handleInputRef}
|
|
255
261
|
type={type}
|
|
256
262
|
id={this.id}
|
|
@@ -74,6 +74,7 @@ type TextInputOwnProps = {
|
|
|
74
74
|
* When "disabled", the input changes visibly to indicate that it cannot
|
|
75
75
|
* receive user interactions. When "readonly" the input still cannot receive
|
|
76
76
|
* user interactions but it keeps the same styles as if it were enabled.
|
|
77
|
+
* Note: placeholder is only displayed when interaction is enabled. You can force it with forcePlaceholder prop
|
|
77
78
|
*/
|
|
78
79
|
interaction?: InteractionType
|
|
79
80
|
|
|
@@ -139,6 +140,11 @@ type TextInputOwnProps = {
|
|
|
139
140
|
*/
|
|
140
141
|
isRequired?: boolean
|
|
141
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Always displays placeholder when textInput is empty, regardless of interaction type
|
|
145
|
+
*/
|
|
146
|
+
forcePlaceholder?: boolean
|
|
147
|
+
|
|
142
148
|
/**
|
|
143
149
|
* provides a reference to the underlying html root element
|
|
144
150
|
*/
|
|
@@ -229,6 +235,7 @@ const allowedProps: AllowedPropKeys = [
|
|
|
229
235
|
'renderBeforeInputElementGap',
|
|
230
236
|
'placeholder',
|
|
231
237
|
'isRequired',
|
|
238
|
+
'forcePlaceholder',
|
|
232
239
|
'elementRef',
|
|
233
240
|
'inputRef',
|
|
234
241
|
'inputContainerRef',
|