@atlaskit/radio 8.2.0 → 8.3.0

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
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/radio
2
2
 
3
+ ## 8.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cd29488c8bef2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd29488c8bef2) -
8
+ Add `labelId` to radio group.
9
+
10
+ ## 8.2.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 8.2.0
4
17
 
5
18
  ### Minor Changes
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/radio.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/radio.d.ts"
14
14
  ]
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/radio-group.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/radio-group.d.ts"
14
14
  ]
@@ -25,6 +25,7 @@ function RadioGroup(props) {
25
25
  isDisabled = props.isDisabled,
26
26
  isRequired = props.isRequired,
27
27
  isInvalid = props.isInvalid,
28
+ labelId = props.labelId,
28
29
  _props$onInvalid = props.onInvalid,
29
30
  onInvalid = _props$onInvalid === void 0 ? _noop.default : _props$onInvalid,
30
31
  name = props.name,
@@ -47,8 +48,10 @@ function RadioGroup(props) {
47
48
  // If not then act as an uncontrolled component using the value from state
48
49
  var value = typeof propValue !== 'undefined' ? propValue : selectedValue;
49
50
  return /*#__PURE__*/_react.default.createElement("div", {
50
- role: "radiogroup",
51
- "aria-labelledby": ariaLabelledBy,
51
+ role: "radiogroup"
52
+ // TODO: Make `aria-labelledby` a `never` in TS. See https://product-fabric.atlassian.net/browse/DSP-23009
53
+ ,
54
+ "aria-labelledby": labelId || ariaLabelledBy,
52
55
  "data-testid": testId,
53
56
  "aria-describedby": isInvalid ? "".concat(id || uid, "-error") : undefined,
54
57
  id: id || uid
package/dist/cjs/radio.js CHANGED
@@ -20,7 +20,7 @@ var _colors = require("@atlaskit/theme/colors");
20
20
  var _excluded = ["ariaLabel", "aria-labelledby", "isDisabled", "isRequired", "isInvalid", "isChecked", "label", "labelId", "name", "onChange", "value", "testId", "analyticsContext"];
21
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
22
  var packageName = "@atlaskit/radio";
23
- var packageVersion = "8.1.8";
23
+ var packageVersion = "0.0.0-development";
24
24
  var noop = _noop.default;
25
25
  var labelPaddingStyles = null;
26
26
  var labelStyles = null;
@@ -14,6 +14,7 @@ export default function RadioGroup(props) {
14
14
  isDisabled,
15
15
  isRequired,
16
16
  isInvalid,
17
+ labelId,
17
18
  onInvalid = noop,
18
19
  name,
19
20
  analyticsContext,
@@ -33,8 +34,10 @@ export default function RadioGroup(props) {
33
34
  // If not then act as an uncontrolled component using the value from state
34
35
  const value = typeof propValue !== 'undefined' ? propValue : selectedValue;
35
36
  return /*#__PURE__*/React.createElement("div", {
36
- role: "radiogroup",
37
- "aria-labelledby": ariaLabelledBy,
37
+ role: "radiogroup"
38
+ // TODO: Make `aria-labelledby` a `never` in TS. See https://product-fabric.atlassian.net/browse/DSP-23009
39
+ ,
40
+ "aria-labelledby": labelId || ariaLabelledBy,
38
41
  "data-testid": testId,
39
42
  "aria-describedby": isInvalid ? `${id || uid}-error` : undefined,
40
43
  id: id || uid
@@ -9,7 +9,7 @@ import __noop from '@atlaskit/ds-lib/noop';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { B200, B300, B400, B50, N10, N100, N20, N30, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
11
11
  const packageName = "@atlaskit/radio";
12
- const packageVersion = "8.1.8";
12
+ const packageVersion = "0.0.0-development";
13
13
  const noop = __noop;
14
14
  const labelPaddingStyles = null;
15
15
  const labelStyles = null;
@@ -16,6 +16,7 @@ export default function RadioGroup(props) {
16
16
  isDisabled = props.isDisabled,
17
17
  isRequired = props.isRequired,
18
18
  isInvalid = props.isInvalid,
19
+ labelId = props.labelId,
19
20
  _props$onInvalid = props.onInvalid,
20
21
  onInvalid = _props$onInvalid === void 0 ? noop : _props$onInvalid,
21
22
  name = props.name,
@@ -38,8 +39,10 @@ export default function RadioGroup(props) {
38
39
  // If not then act as an uncontrolled component using the value from state
39
40
  var value = typeof propValue !== 'undefined' ? propValue : selectedValue;
40
41
  return /*#__PURE__*/React.createElement("div", {
41
- role: "radiogroup",
42
- "aria-labelledby": ariaLabelledBy,
42
+ role: "radiogroup"
43
+ // TODO: Make `aria-labelledby` a `never` in TS. See https://product-fabric.atlassian.net/browse/DSP-23009
44
+ ,
45
+ "aria-labelledby": labelId || ariaLabelledBy,
43
46
  "data-testid": testId,
44
47
  "aria-describedby": isInvalid ? "".concat(id || uid, "-error") : undefined,
45
48
  id: id || uid
package/dist/esm/radio.js CHANGED
@@ -11,7 +11,7 @@ import __noop from '@atlaskit/ds-lib/noop';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { B200, B300, B400, B50, N10, N100, N20, N30, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
13
13
  var packageName = "@atlaskit/radio";
14
- var packageVersion = "8.1.8";
14
+ var packageVersion = "0.0.0-development";
15
15
  var noop = __noop;
16
16
  var labelPaddingStyles = null;
17
17
  var labelStyles = null;
@@ -45,8 +45,16 @@ export interface RadioGroupProps {
45
45
  analyticsContext?: Record<string, any>;
46
46
  /**
47
47
  * The id of the element that links to this radio group.
48
+ *
49
+ * @deprecated Use the `labelId` prop instead.
48
50
  */
49
51
  'aria-labelledby'?: string;
52
+ /**
53
+ * This sets the `aria-labelledby` attribute. It sets an accessible name for
54
+ * the radio, for people who use assistive technology. Use of a visible label
55
+ * is highly recommended for greater accessibility support.
56
+ */
57
+ labelId?: string;
50
58
  /**
51
59
  * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
52
60
  * The specified `testId` is applied to the root element of `RadioGroup`. If no `testId` is supplied in the `options` prop, then the one supplied to `RadioGroup` will also be propagated to
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type RadioProps } from './types';
3
2
  /**
4
3
  * __Radio__
@@ -45,8 +45,16 @@ export interface RadioGroupProps {
45
45
  analyticsContext?: Record<string, any>;
46
46
  /**
47
47
  * The id of the element that links to this radio group.
48
+ *
49
+ * @deprecated Use the `labelId` prop instead.
48
50
  */
49
51
  'aria-labelledby'?: string;
52
+ /**
53
+ * This sets the `aria-labelledby` attribute. It sets an accessible name for
54
+ * the radio, for people who use assistive technology. Use of a visible label
55
+ * is highly recommended for greater accessibility support.
56
+ */
57
+ labelId?: string;
50
58
  /**
51
59
  * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
52
60
  * The specified `testId` is applied to the root element of `RadioGroup`. If no `testId` is supplied in the `options` prop, then the one supplied to `RadioGroup` will also be propagated to
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type RadioProps } from './types';
3
2
  /**
4
3
  * __Radio__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/radio",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "description": "A radio input allows users to select only one option from a number of choices. Radio is generally displayed in a radio group.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,8 +42,8 @@
42
42
  "@atlaskit/css": "^0.12.0",
43
43
  "@atlaskit/ds-lib": "^5.0.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
- "@atlaskit/theme": "^19.0.0",
46
- "@atlaskit/tokens": "^6.0.0",
45
+ "@atlaskit/theme": "^20.0.0",
46
+ "@atlaskit/tokens": "^6.1.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@compiled/react": "^0.18.3"
49
49
  },
@@ -54,16 +54,15 @@
54
54
  "@af/accessibility-testing": "workspace:^",
55
55
  "@af/integration-testing": "workspace:^",
56
56
  "@af/visual-regression": "workspace:^",
57
- "@atlaskit/button": "^23.3.0",
57
+ "@atlaskit/button": "^23.4.0",
58
58
  "@atlaskit/checkbox": "^17.1.0",
59
59
  "@atlaskit/docs": "^11.0.0",
60
- "@atlaskit/form": "^12.0.0",
60
+ "@atlaskit/form": "^12.2.0",
61
61
  "@atlaskit/link": "^3.2.0",
62
- "@atlaskit/primitives": "^14.11.0",
63
- "@atlaskit/section-message": "^8.5.0",
62
+ "@atlaskit/primitives": "^14.12.0",
63
+ "@atlaskit/section-message": "^8.6.0",
64
64
  "@atlaskit/ssr": "workspace:^",
65
- "@atlaskit/visual-regression": "workspace:^",
66
- "@atlassian/ssr-tests": "^0.2.0",
65
+ "@atlassian/ssr-tests": "^0.3.0",
67
66
  "@testing-library/react": "^13.4.0",
68
67
  "@testing-library/user-event": "^14.4.3",
69
68
  "react-dom": "^18.2.0"
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/types.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/types.d.ts"
14
14
  ]