@atlaskit/form 8.8.5 → 8.8.7
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 +13 -0
- package/dist/cjs/field.js +12 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/field.js +12 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/field.js +12 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/form-header.d.ts +9 -3
- package/dist/types/label.d.ts +2 -1
- package/package.json +3 -3
- package/report.api.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/form
|
|
2
2
|
|
|
3
|
+
## 8.8.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1c6c493447f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1c6c493447f) - [ux] Place label and message fields in correct aria attributes.
|
|
8
|
+
|
|
9
|
+
## 8.8.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades component types to support React 18.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 8.8.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/field.js
CHANGED
|
@@ -240,13 +240,24 @@ function Field(props) {
|
|
|
240
240
|
id: props.name
|
|
241
241
|
}));
|
|
242
242
|
}, [props.id, props.name]);
|
|
243
|
+
var getDescribedBy = function getDescribedBy() {
|
|
244
|
+
var value = '';
|
|
245
|
+
if (state.error) {
|
|
246
|
+
value += "".concat(fieldId, "-error ");
|
|
247
|
+
}
|
|
248
|
+
if (state.valid) {
|
|
249
|
+
value += "".concat(fieldId, "-valid ");
|
|
250
|
+
}
|
|
251
|
+
return "".concat(value).concat(fieldId, "-helper");
|
|
252
|
+
};
|
|
243
253
|
var extendedFieldProps = _objectSpread(_objectSpread({}, state.fieldProps), {}, {
|
|
244
254
|
name: props.name,
|
|
245
255
|
isDisabled: isDisabled,
|
|
246
256
|
isInvalid: Boolean(state.error),
|
|
247
257
|
isRequired: Boolean(props.isRequired),
|
|
248
258
|
'aria-invalid': state.error ? 'true' : 'false',
|
|
249
|
-
'aria-
|
|
259
|
+
'aria-describedby': getDescribedBy(),
|
|
260
|
+
'aria-labelledby': "".concat(fieldId, "-label"),
|
|
250
261
|
id: fieldId
|
|
251
262
|
});
|
|
252
263
|
return (0, _react2.jsx)("div", {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/field.js
CHANGED
|
@@ -222,6 +222,16 @@ export default function Field(props) {
|
|
|
222
222
|
() => props.id ? props.id : `${props.name}-${uid({
|
|
223
223
|
id: props.name
|
|
224
224
|
})}`, [props.id, props.name]);
|
|
225
|
+
const getDescribedBy = () => {
|
|
226
|
+
let value = '';
|
|
227
|
+
if (state.error) {
|
|
228
|
+
value += `${fieldId}-error `;
|
|
229
|
+
}
|
|
230
|
+
if (state.valid) {
|
|
231
|
+
value += `${fieldId}-valid `;
|
|
232
|
+
}
|
|
233
|
+
return `${value}${fieldId}-helper`;
|
|
234
|
+
};
|
|
225
235
|
const extendedFieldProps = {
|
|
226
236
|
...state.fieldProps,
|
|
227
237
|
name: props.name,
|
|
@@ -229,7 +239,8 @@ export default function Field(props) {
|
|
|
229
239
|
isInvalid: Boolean(state.error),
|
|
230
240
|
isRequired: Boolean(props.isRequired),
|
|
231
241
|
'aria-invalid': state.error ? 'true' : 'false',
|
|
232
|
-
'aria-
|
|
242
|
+
'aria-describedby': getDescribedBy(),
|
|
243
|
+
'aria-labelledby': `${fieldId}-label`,
|
|
233
244
|
id: fieldId
|
|
234
245
|
};
|
|
235
246
|
return jsx("div", {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/field.js
CHANGED
|
@@ -232,13 +232,24 @@ export default function Field(props) {
|
|
|
232
232
|
id: props.name
|
|
233
233
|
}));
|
|
234
234
|
}, [props.id, props.name]);
|
|
235
|
+
var getDescribedBy = function getDescribedBy() {
|
|
236
|
+
var value = '';
|
|
237
|
+
if (state.error) {
|
|
238
|
+
value += "".concat(fieldId, "-error ");
|
|
239
|
+
}
|
|
240
|
+
if (state.valid) {
|
|
241
|
+
value += "".concat(fieldId, "-valid ");
|
|
242
|
+
}
|
|
243
|
+
return "".concat(value).concat(fieldId, "-helper");
|
|
244
|
+
};
|
|
235
245
|
var extendedFieldProps = _objectSpread(_objectSpread({}, state.fieldProps), {}, {
|
|
236
246
|
name: props.name,
|
|
237
247
|
isDisabled: isDisabled,
|
|
238
248
|
isInvalid: Boolean(state.error),
|
|
239
249
|
isRequired: Boolean(props.isRequired),
|
|
240
250
|
'aria-invalid': state.error ? 'true' : 'false',
|
|
241
|
-
'aria-
|
|
251
|
+
'aria-describedby': getDescribedBy(),
|
|
252
|
+
'aria-labelledby': "".concat(fieldId, "-label"),
|
|
242
253
|
id: fieldId
|
|
243
254
|
});
|
|
244
255
|
return jsx("div", {
|
package/dist/esm/version.json
CHANGED
|
@@ -14,9 +14,15 @@ export interface FormHeaderProps {
|
|
|
14
14
|
*/
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
}
|
|
17
|
-
declare const FormHeaderContent: React.FC
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
declare const FormHeaderContent: React.FC<{
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
declare const FormHeaderDescription: React.FC<{
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}>;
|
|
23
|
+
declare const FormHeaderTitle: React.FC<{
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}>;
|
|
20
26
|
/**
|
|
21
27
|
* __Form header__
|
|
22
28
|
*
|
package/dist/types/label.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/form",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.7",
|
|
4
4
|
"description": "A form allows users to input information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"homepage": "https://atlassian.design/components/form/",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/icon": "^21.11.0",
|
|
42
|
-
"@atlaskit/theme": "^12.
|
|
42
|
+
"@atlaskit/theme": "^12.3.0",
|
|
43
43
|
"@atlaskit/tokens": "^1.2.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"react": "^16.8.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@atlaskit/button": "^16.
|
|
56
|
+
"@atlaskit/button": "^16.6.0",
|
|
57
57
|
"@atlaskit/calendar": "^13.0.0",
|
|
58
58
|
"@atlaskit/checkbox": "^12.4.0",
|
|
59
59
|
"@atlaskit/datetime-picker": "^12.3.0",
|