@instructure/ui-text-area 11.7.4-snapshot-121 → 11.7.4-snapshot-126
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 +7 -1
- package/es/TextArea/v2/index.js +10 -1
- package/lib/TextArea/v2/index.js +10 -1
- package/package.json +14 -14
- package/src/TextArea/v2/index.tsx +17 -0
- package/src/TextArea/v2/props.ts +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TextArea/v2/index.d.ts.map +1 -1
- package/types/TextArea/v2/props.d.ts +3 -1
- package/types/TextArea/v2/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
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.4-snapshot-
|
|
6
|
+
## [11.7.4-snapshot-126](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-snapshot-126) (2026-07-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** keep form field messages out of the control's accessible name ([409d077](https://github.com/instructure/instructure-ui/commit/409d077a3095b318fd7d2e150bb01bc2732c9bf5))
|
|
12
|
+
* **many:** only reference rendered messages via aria-describedby ([ccc9516](https://github.com/instructure/instructure-ui/commit/ccc95165ec8dae6d06e001c0a20fcebef1cf9962))
|
|
7
13
|
|
|
8
14
|
|
|
9
15
|
### Features
|
package/es/TextArea/v2/index.js
CHANGED
|
@@ -90,6 +90,9 @@ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
90
90
|
isSuccess
|
|
91
91
|
};
|
|
92
92
|
}, [messages]);
|
|
93
|
+
const hasMessages = !!messages?.some(m => !!m.text);
|
|
94
|
+
const messagesId = `${id}-messages`;
|
|
95
|
+
const labelId = `${id}-label`;
|
|
93
96
|
|
|
94
97
|
// Use styles
|
|
95
98
|
const styles = useStyleNew({
|
|
@@ -309,7 +312,11 @@ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
309
312
|
id: id,
|
|
310
313
|
required: required,
|
|
311
314
|
"aria-required": required,
|
|
312
|
-
"aria-invalid": isInvalid ? 'true' : undefined
|
|
315
|
+
"aria-invalid": isInvalid ? 'true' : undefined
|
|
316
|
+
// Keep messages in the description so the accessible name contains only the label.
|
|
317
|
+
,
|
|
318
|
+
"aria-describedby": [rest['aria-describedby'], hasMessages ? messagesId : null].filter(Boolean).join(' ') || undefined,
|
|
319
|
+
"aria-labelledby": hasMessages ? rest['aria-labelledby'] || labelId : rest['aria-labelledby'],
|
|
313
320
|
disabled: disabled,
|
|
314
321
|
readOnly: readOnly,
|
|
315
322
|
css: styles?.textArea,
|
|
@@ -318,6 +325,8 @@ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
318
325
|
return _jsx(FormField, {
|
|
319
326
|
...pickProps(props, FormField.allowedProps),
|
|
320
327
|
label: label,
|
|
328
|
+
messagesId: messagesId,
|
|
329
|
+
labelId: labelId,
|
|
321
330
|
vAlign: "top",
|
|
322
331
|
id: id,
|
|
323
332
|
elementRef: el => {
|
package/lib/TextArea/v2/index.js
CHANGED
|
@@ -103,6 +103,9 @@ const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
103
103
|
isSuccess
|
|
104
104
|
};
|
|
105
105
|
}, [messages]);
|
|
106
|
+
const hasMessages = !!messages?.some(m => !!m.text);
|
|
107
|
+
const messagesId = `${id}-messages`;
|
|
108
|
+
const labelId = `${id}-label`;
|
|
106
109
|
|
|
107
110
|
// Use styles
|
|
108
111
|
const styles = (0, _emotion.useStyleNew)({
|
|
@@ -322,7 +325,11 @@ const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
322
325
|
id: id,
|
|
323
326
|
required: required,
|
|
324
327
|
"aria-required": required,
|
|
325
|
-
"aria-invalid": isInvalid ? 'true' : undefined
|
|
328
|
+
"aria-invalid": isInvalid ? 'true' : undefined
|
|
329
|
+
// Keep messages in the description so the accessible name contains only the label.
|
|
330
|
+
,
|
|
331
|
+
"aria-describedby": [rest['aria-describedby'], hasMessages ? messagesId : null].filter(Boolean).join(' ') || undefined,
|
|
332
|
+
"aria-labelledby": hasMessages ? rest['aria-labelledby'] || labelId : rest['aria-labelledby'],
|
|
326
333
|
disabled: disabled,
|
|
327
334
|
readOnly: readOnly,
|
|
328
335
|
css: styles?.textArea,
|
|
@@ -331,6 +338,8 @@ const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
331
338
|
return (0, _jsxRuntime.jsx)(_latest.FormField, {
|
|
332
339
|
...(0, _pickProps.pickProps)(props, _latest.FormField.allowedProps),
|
|
333
340
|
label: label,
|
|
341
|
+
messagesId: messagesId,
|
|
342
|
+
labelId: labelId,
|
|
334
343
|
vAlign: "top",
|
|
335
344
|
id: id,
|
|
336
345
|
elementRef: el => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-text-area",
|
|
3
|
-
"version": "11.7.4-snapshot-
|
|
3
|
+
"version": "11.7.4-snapshot-126",
|
|
4
4
|
"description": "A styled HTML text area component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,25 +15,25 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/debounce": "11.7.4-snapshot-
|
|
19
|
-
"@instructure/emotion": "11.7.4-snapshot-
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-dom-utils": "11.7.4-snapshot-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-react-utils": "11.7.4-snapshot-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
27
|
-
"@instructure/uid": "11.7.4-snapshot-
|
|
18
|
+
"@instructure/debounce": "11.7.4-snapshot-126",
|
|
19
|
+
"@instructure/emotion": "11.7.4-snapshot-126",
|
|
20
|
+
"@instructure/shared-types": "11.7.4-snapshot-126",
|
|
21
|
+
"@instructure/ui-dom-utils": "11.7.4-snapshot-126",
|
|
22
|
+
"@instructure/ui-form-field": "11.7.4-snapshot-126",
|
|
23
|
+
"@instructure/ui-a11y-utils": "11.7.4-snapshot-126",
|
|
24
|
+
"@instructure/ui-react-utils": "11.7.4-snapshot-126",
|
|
25
|
+
"@instructure/ui-themes": "11.7.4-snapshot-126",
|
|
26
|
+
"@instructure/ui-utils": "11.7.4-snapshot-126",
|
|
27
|
+
"@instructure/uid": "11.7.4-snapshot-126"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@testing-library/jest-dom": "^6.9.1",
|
|
31
31
|
"@testing-library/react": "16.3.2",
|
|
32
32
|
"@testing-library/user-event": "^14.6.1",
|
|
33
33
|
"vitest": "^4.1.9",
|
|
34
|
-
"@instructure/ui-
|
|
35
|
-
"@instructure/ui-
|
|
36
|
-
"@instructure/ui-color-utils": "11.7.4-snapshot-
|
|
34
|
+
"@instructure/ui-babel-preset": "11.7.4-snapshot-126",
|
|
35
|
+
"@instructure/ui-axe-check": "11.7.4-snapshot-126",
|
|
36
|
+
"@instructure/ui-color-utils": "11.7.4-snapshot-126"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": ">=18 <=19"
|
|
@@ -128,6 +128,10 @@ const TextArea = forwardRef<TextAreaElement, TextAreaProps>((props, ref) => {
|
|
|
128
128
|
return { isInvalid, isSuccess }
|
|
129
129
|
}, [messages])
|
|
130
130
|
|
|
131
|
+
const hasMessages = !!messages?.some((m) => !!m.text)
|
|
132
|
+
const messagesId = `${id}-messages`
|
|
133
|
+
const labelId = `${id}-label`
|
|
134
|
+
|
|
131
135
|
// Use styles
|
|
132
136
|
const styles = useStyleNew({
|
|
133
137
|
generateStyle,
|
|
@@ -393,6 +397,17 @@ const TextArea = forwardRef<TextAreaElement, TextAreaProps>((props, ref) => {
|
|
|
393
397
|
required={required}
|
|
394
398
|
aria-required={required}
|
|
395
399
|
aria-invalid={isInvalid ? 'true' : undefined}
|
|
400
|
+
// Keep messages in the description so the accessible name contains only the label.
|
|
401
|
+
aria-describedby={
|
|
402
|
+
[rest['aria-describedby'], hasMessages ? messagesId : null]
|
|
403
|
+
.filter(Boolean)
|
|
404
|
+
.join(' ') || undefined
|
|
405
|
+
}
|
|
406
|
+
aria-labelledby={
|
|
407
|
+
hasMessages
|
|
408
|
+
? rest['aria-labelledby'] || labelId
|
|
409
|
+
: rest['aria-labelledby']
|
|
410
|
+
}
|
|
396
411
|
disabled={disabled}
|
|
397
412
|
readOnly={readOnly}
|
|
398
413
|
css={styles?.textArea}
|
|
@@ -404,6 +419,8 @@ const TextArea = forwardRef<TextAreaElement, TextAreaProps>((props, ref) => {
|
|
|
404
419
|
<FormField
|
|
405
420
|
{...pickProps(props, FormField.allowedProps)}
|
|
406
421
|
label={label}
|
|
422
|
+
messagesId={messagesId}
|
|
423
|
+
labelId={labelId}
|
|
407
424
|
vAlign="top"
|
|
408
425
|
id={id}
|
|
409
426
|
elementRef={(el) => {
|
package/src/TextArea/v2/props.ts
CHANGED
|
@@ -113,7 +113,9 @@ type TextAreaOwnProps = {
|
|
|
113
113
|
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
116
|
+
* Valid values are `0`, `none`, `auto`, and Spacing token values,
|
|
117
|
+
* see https://instructure.design/layout-spacing. Apply these values via
|
|
118
|
+
* familiar CSS-like shorthand. For example, `margin="general.spaceMd auto"`.
|
|
117
119
|
*/
|
|
118
120
|
margin?: Spacing
|
|
119
121
|
}
|