@instructure/ui-number-input 11.7.9-snapshot-5 → 11.7.10

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.9-snapshot-5](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-5) (2026-10-13)
6
+ ## [11.7.10](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.10) (2026-10-14)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-number-input
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: _jsx("span", {
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
- // Keep messages in the description so the accessible name contains only the label.
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: (0, _jsxRuntime.jsx)("span", {
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
- // Keep messages in the description so the accessible name contains only the label.
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.9-snapshot-5",
3
+ "version": "11.7.10",
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.9-snapshot-5",
19
- "@instructure/shared-types": "11.7.9-snapshot-5",
20
- "@instructure/ui-a11y-utils": "11.7.9-snapshot-5",
21
- "@instructure/ui-form-field": "11.7.9-snapshot-5",
22
- "@instructure/ui-icons": "11.7.9-snapshot-5",
23
- "@instructure/ui-react-utils": "11.7.9-snapshot-5",
24
- "@instructure/ui-themes": "11.7.9-snapshot-5",
25
- "@instructure/ui-utils": "11.7.9-snapshot-5",
26
- "@instructure/uid": "11.7.9-snapshot-5",
18
+ "@instructure/emotion": "11.7.10",
19
+ "@instructure/shared-types": "11.7.10",
20
+ "@instructure/ui-a11y-utils": "11.7.10",
21
+ "@instructure/ui-form-field": "11.7.10",
22
+ "@instructure/ui-icons": "11.7.10",
23
+ "@instructure/ui-react-utils": "11.7.10",
24
+ "@instructure/ui-themes": "11.7.10",
25
+ "@instructure/ui-utils": "11.7.10",
26
+ "@instructure/uid": "11.7.10",
27
27
  "keycode": "^2"
28
28
  },
29
29
  "devDependencies": {
30
- "@instructure/ui-babel-preset": "11.7.9-snapshot-5",
31
- "@instructure/ui-scripts": "11.7.9-snapshot-5",
30
+ "@instructure/ui-babel-preset": "11.7.10",
31
+ "@instructure/ui-scripts": "11.7.10",
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
- <span css={styles?.inputWidth} style={width ? { width } : undefined}>
345
- <span css={styles?.inputContainer}>
346
- <input
347
- {...passedProps}
348
- css={styles?.input}
349
- aria-invalid={invalid ? 'true' : undefined}
350
- // Keep messages in the description so the accessible name contains only the label.
351
- aria-describedby={
352
- [
353
- passedProps['aria-describedby'],
354
- hasMessages ? messagesId : null
355
- ]
356
- .filter(Boolean)
357
- .join(' ') || undefined
358
- }
359
- aria-labelledby={
360
- hasMessages
361
- ? passedProps['aria-labelledby'] || labelId
362
- : passedProps['aria-labelledby']
363
- }
364
- id={id}
365
- type={allowStringValue ? 'text' : 'number'}
366
- inputMode={inputMode}
367
- placeholder={interaction === 'enabled' ? placeholder : undefined}
368
- ref={handleInputRef}
369
- required={isRequired}
370
- value={value}
371
- disabled={interaction === 'disabled'}
372
- readOnly={interaction === 'readonly'}
373
- onFocus={handleFocus}
374
- onBlur={handleBlur}
375
- onChange={handleChange}
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
- </span>
371
+ )}
383
372
  </FormField>
384
373
  )
385
374
  }