@instructure/ui-number-input 11.7.9-snapshot-5 → 11.7.10-snapshot--1
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
CHANGED
|
@@ -3,12 +3,18 @@
|
|
|
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.
|
|
6
|
+
## [11.7.10-snapshot--1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.10-snapshot--1) (2026-10-14)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **many:** Stop wrapping form field controls in their label ([#2740](https://github.com/instructure/instructure-ui/issues/2740)) ([467269e](https://github.com/instructure/instructure-ui/commit/467269ea6d66c88ef9deb8bd14980730bbd645e8))
|
|
9
11
|
|
|
10
12
|
|
|
13
|
+
## [11.7.9](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9) (2026-10-13)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
11
16
|
|
|
17
|
+
* **many:** Stop wrapping form field controls in their label ([#2740](https://github.com/instructure/instructure-ui/issues/2740)) ([467269e](https://github.com/instructure/instructure-ui/commit/467269ea6d66c88ef9deb8bd14980730bbd645e8))
|
|
12
18
|
|
|
13
19
|
|
|
14
20
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
|
@@ -78,9 +78,6 @@ const NumberInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
78
78
|
// Computed values
|
|
79
79
|
const invalid = !!messages && messages.some(message => message.type === 'error' || message.type === 'newError');
|
|
80
80
|
const success = !!messages && messages.some(message => message.type === 'success');
|
|
81
|
-
const hasMessages = !!messages?.some(m => !!m.text);
|
|
82
|
-
const messagesId = id ? `${id}-messages` : undefined;
|
|
83
|
-
const labelId = id ? `${id}-label` : undefined;
|
|
84
81
|
const interaction = getInteraction({
|
|
85
82
|
props
|
|
86
83
|
});
|
|
@@ -228,8 +225,6 @@ const NumberInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
228
225
|
return _jsx(FormField, {
|
|
229
226
|
...pickProps(props, FormField.allowedProps),
|
|
230
227
|
label: label,
|
|
231
|
-
messagesId: messagesId,
|
|
232
|
-
labelId: labelId,
|
|
233
228
|
inline: display === 'inline-block',
|
|
234
229
|
id: id,
|
|
235
230
|
elementRef: handleRef,
|
|
@@ -238,7 +233,9 @@ const NumberInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
238
233
|
disabled: interaction === 'disabled',
|
|
239
234
|
readOnly: interaction === 'readonly',
|
|
240
235
|
"data-cid": "NumberInput",
|
|
241
|
-
children:
|
|
236
|
+
children: ({
|
|
237
|
+
describedBy
|
|
238
|
+
}) => _jsx("span", {
|
|
242
239
|
css: styles?.inputWidth,
|
|
243
240
|
style: width ? {
|
|
244
241
|
width
|
|
@@ -248,11 +245,8 @@ const NumberInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
248
245
|
children: [_jsx("input", {
|
|
249
246
|
...passedProps,
|
|
250
247
|
css: styles?.input,
|
|
251
|
-
"aria-invalid": invalid ? 'true' : undefined
|
|
252
|
-
|
|
253
|
-
,
|
|
254
|
-
"aria-describedby": [passedProps['aria-describedby'], hasMessages ? messagesId : null].filter(Boolean).join(' ') || undefined,
|
|
255
|
-
"aria-labelledby": hasMessages ? passedProps['aria-labelledby'] || labelId : passedProps['aria-labelledby'],
|
|
248
|
+
"aria-invalid": invalid ? 'true' : undefined,
|
|
249
|
+
"aria-describedby": [passedProps['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined,
|
|
256
250
|
id: id,
|
|
257
251
|
type: allowStringValue ? 'text' : 'number',
|
|
258
252
|
inputMode: inputMode,
|
|
@@ -85,9 +85,6 @@ const NumberInput = exports.NumberInput = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
85
85
|
// Computed values
|
|
86
86
|
const invalid = !!messages && messages.some(message => message.type === 'error' || message.type === 'newError');
|
|
87
87
|
const success = !!messages && messages.some(message => message.type === 'success');
|
|
88
|
-
const hasMessages = !!messages?.some(m => !!m.text);
|
|
89
|
-
const messagesId = id ? `${id}-messages` : undefined;
|
|
90
|
-
const labelId = id ? `${id}-label` : undefined;
|
|
91
88
|
const interaction = (0, _uiReactUtils.getInteraction)({
|
|
92
89
|
props
|
|
93
90
|
});
|
|
@@ -235,8 +232,6 @@ const NumberInput = exports.NumberInput = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
235
232
|
return (0, _jsxRuntime.jsx)(_latest.FormField, {
|
|
236
233
|
...(0, _uiReactUtils.pickProps)(props, _latest.FormField.allowedProps),
|
|
237
234
|
label: label,
|
|
238
|
-
messagesId: messagesId,
|
|
239
|
-
labelId: labelId,
|
|
240
235
|
inline: display === 'inline-block',
|
|
241
236
|
id: id,
|
|
242
237
|
elementRef: handleRef,
|
|
@@ -245,7 +240,9 @@ const NumberInput = exports.NumberInput = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
245
240
|
disabled: interaction === 'disabled',
|
|
246
241
|
readOnly: interaction === 'readonly',
|
|
247
242
|
"data-cid": "NumberInput",
|
|
248
|
-
children: (
|
|
243
|
+
children: ({
|
|
244
|
+
describedBy
|
|
245
|
+
}) => (0, _jsxRuntime.jsx)("span", {
|
|
249
246
|
css: styles?.inputWidth,
|
|
250
247
|
style: width ? {
|
|
251
248
|
width
|
|
@@ -255,11 +252,8 @@ const NumberInput = exports.NumberInput = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
255
252
|
children: [(0, _jsxRuntime.jsx)("input", {
|
|
256
253
|
...passedProps,
|
|
257
254
|
css: styles?.input,
|
|
258
|
-
"aria-invalid": invalid ? 'true' : undefined
|
|
259
|
-
|
|
260
|
-
,
|
|
261
|
-
"aria-describedby": [passedProps['aria-describedby'], hasMessages ? messagesId : null].filter(Boolean).join(' ') || undefined,
|
|
262
|
-
"aria-labelledby": hasMessages ? passedProps['aria-labelledby'] || labelId : passedProps['aria-labelledby'],
|
|
255
|
+
"aria-invalid": invalid ? 'true' : undefined,
|
|
256
|
+
"aria-describedby": [passedProps['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined,
|
|
263
257
|
id: id,
|
|
264
258
|
type: allowStringValue ? 'text' : 'number',
|
|
265
259
|
inputMode: inputMode,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-number-input",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.10-snapshot--1",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/emotion": "11.7.
|
|
19
|
-
"@instructure/shared-types": "11.7.
|
|
20
|
-
"@instructure/ui-a11y-utils": "11.7.
|
|
21
|
-
"@instructure/ui-form-field": "11.7.
|
|
22
|
-
"@instructure/ui-icons": "11.7.
|
|
23
|
-
"@instructure/ui-react-utils": "11.7.
|
|
24
|
-
"@instructure/ui-themes": "11.7.
|
|
25
|
-
"@instructure/ui-utils": "11.7.
|
|
26
|
-
"@instructure/uid": "11.7.
|
|
18
|
+
"@instructure/emotion": "11.7.10-snapshot--1",
|
|
19
|
+
"@instructure/shared-types": "11.7.10-snapshot--1",
|
|
20
|
+
"@instructure/ui-a11y-utils": "11.7.10-snapshot--1",
|
|
21
|
+
"@instructure/ui-form-field": "11.7.10-snapshot--1",
|
|
22
|
+
"@instructure/ui-icons": "11.7.10-snapshot--1",
|
|
23
|
+
"@instructure/ui-react-utils": "11.7.10-snapshot--1",
|
|
24
|
+
"@instructure/ui-themes": "11.7.10-snapshot--1",
|
|
25
|
+
"@instructure/ui-utils": "11.7.10-snapshot--1",
|
|
26
|
+
"@instructure/uid": "11.7.10-snapshot--1",
|
|
27
27
|
"keycode": "^2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@instructure/ui-babel-preset": "11.7.
|
|
31
|
-
"@instructure/ui-scripts": "11.7.
|
|
30
|
+
"@instructure/ui-babel-preset": "11.7.10-snapshot--1",
|
|
31
|
+
"@instructure/ui-scripts": "11.7.10-snapshot--1",
|
|
32
32
|
"vitest": "^5.0.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
@@ -115,10 +115,6 @@ const NumberInput = forwardRef<NumberInputHandle, NumberInputProps>(
|
|
|
115
115
|
const success =
|
|
116
116
|
!!messages && messages.some((message) => message.type === 'success')
|
|
117
117
|
|
|
118
|
-
const hasMessages = !!messages?.some((m) => !!m.text)
|
|
119
|
-
const messagesId = id ? `${id}-messages` : undefined
|
|
120
|
-
const labelId = id ? `${id}-label` : undefined
|
|
121
|
-
|
|
122
118
|
const interaction = getInteraction({ props })
|
|
123
119
|
if (
|
|
124
120
|
interaction === 'disabled' &&
|
|
@@ -330,8 +326,6 @@ const NumberInput = forwardRef<NumberInputHandle, NumberInputProps>(
|
|
|
330
326
|
<FormField
|
|
331
327
|
{...pickProps(props, FormField.allowedProps)}
|
|
332
328
|
label={label}
|
|
333
|
-
messagesId={messagesId}
|
|
334
|
-
labelId={labelId}
|
|
335
329
|
inline={display === 'inline-block'}
|
|
336
330
|
id={id}
|
|
337
331
|
elementRef={handleRef}
|
|
@@ -341,45 +335,40 @@ const NumberInput = forwardRef<NumberInputHandle, NumberInputProps>(
|
|
|
341
335
|
readOnly={interaction === 'readonly'}
|
|
342
336
|
data-cid="NumberInput"
|
|
343
337
|
>
|
|
344
|
-
|
|
345
|
-
<span css={styles?.
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
onKeyDown={handleKeyDown}
|
|
377
|
-
/>
|
|
378
|
-
{showArrows && interaction !== 'readonly'
|
|
379
|
-
? renderArrows(renderIcons)
|
|
380
|
-
: null}
|
|
338
|
+
{({ describedBy }) => (
|
|
339
|
+
<span css={styles?.inputWidth} style={width ? { width } : undefined}>
|
|
340
|
+
<span css={styles?.inputContainer}>
|
|
341
|
+
<input
|
|
342
|
+
{...passedProps}
|
|
343
|
+
css={styles?.input}
|
|
344
|
+
aria-invalid={invalid ? 'true' : undefined}
|
|
345
|
+
aria-describedby={
|
|
346
|
+
[passedProps['aria-describedby'], describedBy]
|
|
347
|
+
.filter(Boolean)
|
|
348
|
+
.join(' ') || undefined
|
|
349
|
+
}
|
|
350
|
+
id={id}
|
|
351
|
+
type={allowStringValue ? 'text' : 'number'}
|
|
352
|
+
inputMode={inputMode}
|
|
353
|
+
placeholder={
|
|
354
|
+
interaction === 'enabled' ? placeholder : undefined
|
|
355
|
+
}
|
|
356
|
+
ref={handleInputRef}
|
|
357
|
+
required={isRequired}
|
|
358
|
+
value={value}
|
|
359
|
+
disabled={interaction === 'disabled'}
|
|
360
|
+
readOnly={interaction === 'readonly'}
|
|
361
|
+
onFocus={handleFocus}
|
|
362
|
+
onBlur={handleBlur}
|
|
363
|
+
onChange={handleChange}
|
|
364
|
+
onKeyDown={handleKeyDown}
|
|
365
|
+
/>
|
|
366
|
+
{showArrows && interaction !== 'readonly'
|
|
367
|
+
? renderArrows(renderIcons)
|
|
368
|
+
: null}
|
|
369
|
+
</span>
|
|
381
370
|
</span>
|
|
382
|
-
|
|
371
|
+
)}
|
|
383
372
|
</FormField>
|
|
384
373
|
)
|
|
385
374
|
}
|