@atlaskit/radio 5.4.5 → 5.4.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/radio
2
2
 
3
+ ## 5.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal change to update token references. There is no expected behaviour or visual change.
8
+
9
+ ## 5.4.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`22d4be4674b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/22d4be4674b) - Fixes issue where disabled radios were using the wrong background and border tokens
14
+ - [`8e6acf8f038`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8e6acf8f038) - Updates tokens used for border and dot, improved tokens appearance when radio is both checked and disabled
15
+
3
16
  ## 5.4.5
4
17
 
5
18
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -17,7 +16,5 @@ Object.defineProperty(exports, "RadioGroup", {
17
16
  return _radioGroup.default;
18
17
  }
19
18
  });
20
-
21
19
  var _radioGroup = _interopRequireDefault(require("./radio-group"));
22
-
23
20
  var _radio = _interopRequireDefault(require("./radio"));
@@ -1,70 +1,55 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.default = RadioGroup;
11
-
12
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
-
16
11
  var _react = _interopRequireWildcard(require("react"));
17
-
18
12
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
19
-
20
13
  var _radio = _interopRequireDefault(require("./radio"));
21
-
22
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
16
  var noOptions = [];
27
-
28
17
  function RadioGroup(props) {
29
18
  var onChange = props.onChange,
30
- _props$options = props.options,
31
- options = _props$options === void 0 ? noOptions : _props$options,
32
- propValue = props.value,
33
- defaultValue = props.defaultValue,
34
- isDisabled = props.isDisabled,
35
- isRequired = props.isRequired,
36
- isInvalid = props.isInvalid,
37
- _props$onInvalid = props.onInvalid,
38
- onInvalid = _props$onInvalid === void 0 ? _noop.default : _props$onInvalid,
39
- name = props.name,
40
- analyticsContext = props.analyticsContext,
41
- ariaLabelledBy = props['aria-labelledby'];
42
-
19
+ _props$options = props.options,
20
+ options = _props$options === void 0 ? noOptions : _props$options,
21
+ propValue = props.value,
22
+ defaultValue = props.defaultValue,
23
+ isDisabled = props.isDisabled,
24
+ isRequired = props.isRequired,
25
+ isInvalid = props.isInvalid,
26
+ _props$onInvalid = props.onInvalid,
27
+ onInvalid = _props$onInvalid === void 0 ? _noop.default : _props$onInvalid,
28
+ name = props.name,
29
+ analyticsContext = props.analyticsContext,
30
+ ariaLabelledBy = props['aria-labelledby'];
43
31
  var _useState = (0, _react.useState)(propValue !== undefined ? propValue : defaultValue),
44
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
45
- selectedValue = _useState2[0],
46
- setSelectedValue = _useState2[1];
47
-
32
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
33
+ selectedValue = _useState2[0],
34
+ setSelectedValue = _useState2[1];
48
35
  var onRadioChange = (0, _react.useCallback)(function (e, analyticsEvent) {
49
36
  setSelectedValue(e.currentTarget.value);
50
-
51
37
  if (onChange) {
52
38
  onChange(e, analyticsEvent);
53
39
  }
54
- }, [onChange]); // If propValue is provided than act as a controlled component
55
- // If not then act as an uncontrolled component using the value from state
40
+ }, [onChange]);
56
41
 
42
+ // If propValue is provided than act as a controlled component
43
+ // If not then act as an uncontrolled component using the value from state
57
44
  var value = typeof propValue !== 'undefined' ? propValue : selectedValue;
58
45
  return /*#__PURE__*/_react.default.createElement("div", {
59
46
  role: "radiogroup",
60
47
  "aria-labelledby": ariaLabelledBy
61
48
  }, options.map(function (_ref, index) {
62
49
  var optionProps = (0, _extends2.default)({}, _ref);
63
-
64
50
  if (typeof isDisabled !== 'undefined') {
65
51
  optionProps.isDisabled = isDisabled;
66
52
  }
67
-
68
53
  var isChecked = value != null && optionProps.value === value;
69
54
  return /*#__PURE__*/_react.default.createElement(_radio.default, (0, _extends2.default)({}, optionProps, {
70
55
  name: name || optionProps.name,
package/dist/cjs/radio.js CHANGED
@@ -1,39 +1,27 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
10
  var _react = require("react");
15
-
16
11
  var _react2 = require("@emotion/react");
17
-
18
12
  var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
19
-
20
13
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
21
-
22
14
  var _colors = require("@atlaskit/theme/colors");
23
-
24
15
  var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
25
-
26
16
  var _constants = require("@atlaskit/theme/constants");
27
-
28
17
  var _styles = _interopRequireDefault(require("./styles"));
29
-
30
18
  var _excluded = ["ariaLabel", "isDisabled", "isRequired", "isInvalid", "isChecked", "label", "mode", "name", "onChange", "value", "testId", "analyticsContext"];
31
19
  var packageName = "@atlaskit/radio";
32
- var packageVersion = "5.4.5";
20
+ var packageVersion = "5.4.7";
33
21
  var fontFamily = (0, _constants.fontFamily)();
34
22
  var noop = _noop.default;
35
23
  var labelPaddingStyles = (0, _react2.css)({
36
- padding: "var(--ds-scale-025, 2px)".concat(" ", "var(--ds-scale-050, 4px)")
24
+ padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-050, 4px)")
37
25
  });
38
26
  var labelStyles = (0, _react2.css)({
39
27
  display: 'flex',
@@ -55,7 +43,6 @@ var darkLabelStyles = (0, _react2.css)({
55
43
  });
56
44
  var radioStyles = (0, _react2.css)({
57
45
  display: 'flex',
58
-
59
46
  /*
60
47
  The circle should be 14px * 14px centred in a 24px * 24px box.
61
48
  This is inclusive of a 2px border and inner circle with 2px radius.
@@ -65,20 +52,17 @@ var radioStyles = (0, _react2.css)({
65
52
  */
66
53
  width: '24px',
67
54
  height: '24px',
68
- // TODO Delete this comment after verifying spacing token -> previous value `0`
69
- margin: "var(--ds-scale-0, 0px)",
55
+ margin: "var(--ds-space-0, 0px)",
70
56
  position: 'relative',
71
57
  alignItems: 'center',
72
58
  justifyContent: 'center',
73
59
  flexShrink: 0,
74
60
  backgroundColor: 'var(--radio-background-color)',
75
-
76
61
  /* Border should be 2px, multiply by 24/14 to offset scale */
77
62
  border: 'calc(2px * 12 / 7) solid var(--radio-border-color)',
78
63
  borderRadius: '50%',
79
64
  MozAppearance: 'none',
80
65
  outline: 'none',
81
-
82
66
  /*
83
67
  Change the variables --radio-background-color, --radio-border-color,
84
68
  -radio-dot-color and -radio-dot-opacity according to user interactions.
@@ -88,7 +72,6 @@ var radioStyles = (0, _react2.css)({
88
72
  '--radio-border-color': 'var(--local-border)',
89
73
  '--radio-dot-color': 'var(--local-dot-checked)',
90
74
  '--radio-dot-opacity': 0,
91
-
92
75
  /* 24px * 7 / 12 === 14px height and width */
93
76
  transform: 'scale(calc(7 / 12))',
94
77
  transition: 'border-color 0.2s ease-in-out, background-color 0.2s ease-in-out',
@@ -141,30 +124,26 @@ var radioStyles = (0, _react2.css)({
141
124
  '--radio-background-color': 'var(--local-background-disabled)',
142
125
  '--radio-border-color': 'var(--local-border-disabled)',
143
126
  '--radio-dot-color': 'var(--local-dot-disabled)'
144
- },
145
- '&:checked:disabled': {
146
- '--radio-border-color': 'transparent' // TODO: Investigate token solution
147
-
148
127
  }
149
128
  });
150
129
  var RadioWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Radio(props, ref) {
151
130
  var ariaLabel = props.ariaLabel,
152
- _props$isDisabled = props.isDisabled,
153
- isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
154
- isRequired = props.isRequired,
155
- _props$isInvalid = props.isInvalid,
156
- isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
157
- _props$isChecked = props.isChecked,
158
- isChecked = _props$isChecked === void 0 ? false : _props$isChecked,
159
- label = props.label,
160
- mode = props.mode,
161
- name = props.name,
162
- _props$onChange = props.onChange,
163
- onChange = _props$onChange === void 0 ? noop : _props$onChange,
164
- value = props.value,
165
- testId = props.testId,
166
- analyticsContext = props.analyticsContext,
167
- rest = (0, _objectWithoutProperties2.default)(props, _excluded);
131
+ _props$isDisabled = props.isDisabled,
132
+ isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
133
+ isRequired = props.isRequired,
134
+ _props$isInvalid = props.isInvalid,
135
+ isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
136
+ _props$isChecked = props.isChecked,
137
+ isChecked = _props$isChecked === void 0 ? false : _props$isChecked,
138
+ label = props.label,
139
+ mode = props.mode,
140
+ name = props.name,
141
+ _props$onChange = props.onChange,
142
+ onChange = _props$onChange === void 0 ? noop : _props$onChange,
143
+ value = props.value,
144
+ testId = props.testId,
145
+ analyticsContext = props.analyticsContext,
146
+ rest = (0, _objectWithoutProperties2.default)(props, _excluded);
168
147
  var onChangeAnalytics = (0, _usePlatformLeafEventHandler.usePlatformLeafEventHandler)({
169
148
  fn: onChange,
170
149
  action: 'changed',
@@ -176,11 +155,13 @@ var RadioWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Radio(props, re
176
155
  var radioCustomProperties = (0, _react.useMemo)(function () {
177
156
  return (0, _react2.css)((0, _styles.default)(mode));
178
157
  }, [mode]);
179
- return (// https://product-fabric.atlassian.net/browse/DST-1971
158
+ return (
159
+ // https://product-fabric.atlassian.net/browse/DST-1971
180
160
  // eslint-disable-next-line jsx-a11y/label-has-associated-control,jsx-a11y/label-has-for
181
161
  (0, _react2.jsx)("label", {
182
162
  "data-testid": testId && "".concat(testId, "--radio-label"),
183
- "data-disabled": isDisabled ? 'true' : undefined // TODO these will no longer be dynamic styles when legacy theming removed
163
+ "data-disabled": isDisabled ? 'true' : undefined
164
+ // TODO these will no longer be dynamic styles when legacy theming removed
184
165
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
185
166
  ,
186
167
  css: [labelStyles, mode === 'light' ? lightLabelStyles : darkLabelStyles]
@@ -193,10 +174,12 @@ var RadioWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Radio(props, re
193
174
  required: isRequired,
194
175
  type: "radio",
195
176
  value: value,
196
- "data-testid": testId && "".concat(testId, "--radio-input") // isInvalid is used in a nonstandard way so cannot
177
+ "data-testid": testId && "".concat(testId, "--radio-input")
178
+ // isInvalid is used in a nonstandard way so cannot
197
179
  // use :invalid selector
198
180
  ,
199
- "data-invalid": isInvalid ? 'true' : undefined // TODO radioCustomProperties can be defined at top of file when legacy theming removed
181
+ "data-invalid": isInvalid ? 'true' : undefined
182
+ // TODO radioCustomProperties can be defined at top of file when legacy theming removed
200
183
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
201
184
  ,
202
185
  css: [radioStyles, radioCustomProperties],
@@ -206,6 +189,7 @@ var RadioWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Radio(props, re
206
189
  }, label) : null)
207
190
  );
208
191
  });
192
+
209
193
  /**
210
194
  * __Radio__
211
195
  *
@@ -215,7 +199,6 @@ var RadioWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Radio(props, re
215
199
  * - [Code](https://atlassian.design/components/radio/code)
216
200
  * - [Usage](https://atlassian.design/components/radio/usage)
217
201
  */
218
-
219
202
  var Radio = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Radio(props, ref) {
220
203
  return (0, _react2.jsx)(_components.default.Consumer, null, function (_ref) {
221
204
  var mode = _ref.mode;
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getRadioCustomProperties;
7
-
8
7
  var _colors = require("@atlaskit/theme/colors");
9
-
10
8
  var radioThemeColors = {
11
9
  light: {
12
10
  background: "var(--ds-background-input, ".concat(_colors.N10, ")"),
@@ -15,13 +13,13 @@ var radioThemeColors = {
15
13
  backgroundChecked: "var(--ds-background-brand-bold, ".concat(_colors.B400, ")"),
16
14
  backgroundCheckedHover: "var(--ds-background-brand-bold-hovered, ".concat(_colors.B300, ")"),
17
15
  backgroundCheckedActive: "var(--ds-background-brand-bold-pressed, ".concat(_colors.B50, ")"),
18
- backgroundDisabled: "var(--ds-background-input, ".concat(_colors.N20, ")"),
19
- dotChecked: "var(--ds-text-inverse, ".concat(_colors.N10, ")"),
20
- dotDisabled: "var(--ds-text-disabled, ".concat(_colors.N70, ")"),
21
- dotActive: "var(--ds-text-inverse, ".concat(_colors.B400, ")"),
16
+ backgroundDisabled: "var(--ds-background-disabled, ".concat(_colors.N20, ")"),
17
+ dotChecked: "var(--ds-icon-inverse, ".concat(_colors.N10, ")"),
18
+ dotDisabled: "var(--ds-icon-disabled, ".concat(_colors.N70, ")"),
19
+ dotActive: "var(--ds-icon-inverse, ".concat(_colors.B400, ")"),
22
20
  border: "var(--ds-border-input, ".concat(_colors.N40, ")"),
23
21
  borderHover: "var(--ds-border-input, ".concat(_colors.N40, ")"),
24
- borderDisabled: "var(--ds-background-disabled, ".concat(_colors.N20, ")"),
22
+ borderDisabled: "var(--ds-border-disabled, ".concat(_colors.N20, ")"),
25
23
  borderFocus: "var(--ds-border-focused, ".concat(_colors.B100, ")")
26
24
  },
27
25
  dark: {
@@ -31,17 +29,16 @@ var radioThemeColors = {
31
29
  backgroundChecked: "var(--ds-background-brand-bold, ".concat(_colors.B400, ")"),
32
30
  backgroundCheckedHover: "var(--ds-background-brand-bold-hovered, ".concat(_colors.B75, ")"),
33
31
  backgroundCheckedActive: "var(--ds-background-brand-bold-pressed, ".concat(_colors.B200, ")"),
34
- backgroundDisabled: "var(--ds-background-input, ".concat(_colors.DN10, ")"),
35
- dotChecked: "var(--ds-text-inverse, ".concat(_colors.DN10, ")"),
36
- dotDisabled: "var(--ds-text-disabled, ".concat(_colors.DN90, ")"),
37
- dotActive: "var(--ds-text-inverse, ".concat(_colors.DN10, ")"),
32
+ backgroundDisabled: "var(--ds-background-disabled, ".concat(_colors.DN10, ")"),
33
+ dotChecked: "var(--ds-icon-inverse, ".concat(_colors.DN10, ")"),
34
+ dotDisabled: "var(--ds-icon-disabled, ".concat(_colors.DN90, ")"),
35
+ dotActive: "var(--ds-icon-inverse, ".concat(_colors.DN10, ")"),
38
36
  border: "var(--ds-border-input, ".concat(_colors.DN80, ")"),
39
37
  borderHover: "var(--ds-border-input, ".concat(_colors.DN200, ")"),
40
- borderDisabled: "var(--ds-background-disabled, ".concat(_colors.DN10, ")"),
38
+ borderDisabled: "var(--ds-border-disabled, ".concat(_colors.DN10, ")"),
41
39
  borderFocus: "var(--ds-border-focused, ".concat(_colors.B75, ")")
42
40
  }
43
41
  };
44
-
45
42
  function getRadioCustomProperties(mode) {
46
43
  var radioColors = radioThemeColors[mode];
47
44
  return {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/radio",
3
- "version": "5.4.5",
3
+ "version": "5.4.7",
4
4
  "sideEffects": false
5
5
  }
@@ -20,23 +20,23 @@ export default function RadioGroup(props) {
20
20
  const [selectedValue, setSelectedValue] = useState(propValue !== undefined ? propValue : defaultValue);
21
21
  const onRadioChange = useCallback((e, analyticsEvent) => {
22
22
  setSelectedValue(e.currentTarget.value);
23
-
24
23
  if (onChange) {
25
24
  onChange(e, analyticsEvent);
26
25
  }
27
- }, [onChange]); // If propValue is provided than act as a controlled component
28
- // If not then act as an uncontrolled component using the value from state
26
+ }, [onChange]);
29
27
 
28
+ // If propValue is provided than act as a controlled component
29
+ // If not then act as an uncontrolled component using the value from state
30
30
  const value = typeof propValue !== 'undefined' ? propValue : selectedValue;
31
31
  return /*#__PURE__*/React.createElement("div", {
32
32
  role: "radiogroup",
33
33
  "aria-labelledby": ariaLabelledBy
34
- }, options.map(({ ...optionProps
34
+ }, options.map(({
35
+ ...optionProps
35
36
  }, index) => {
36
37
  if (typeof isDisabled !== 'undefined') {
37
38
  optionProps.isDisabled = isDisabled;
38
39
  }
39
-
40
40
  const isChecked = value != null && optionProps.value === value;
41
41
  return /*#__PURE__*/React.createElement(Radio, _extends({}, optionProps, {
42
42
  name: name || optionProps.name,
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { forwardRef, memo, useMemo } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -10,11 +9,11 @@ import GlobalTheme from '@atlaskit/theme/components';
10
9
  import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
11
10
  import getRadioCustomProperties from './styles';
12
11
  const packageName = "@atlaskit/radio";
13
- const packageVersion = "5.4.5";
12
+ const packageVersion = "5.4.7";
14
13
  const fontFamily = getFontFamily();
15
14
  const noop = __noop;
16
15
  const labelPaddingStyles = css({
17
- padding: `${"var(--ds-scale-025, 2px)"} ${"var(--ds-scale-050, 4px)"}`
16
+ padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"}`
18
17
  });
19
18
  const labelStyles = css({
20
19
  display: 'flex',
@@ -36,7 +35,6 @@ const darkLabelStyles = css({
36
35
  });
37
36
  const radioStyles = css({
38
37
  display: 'flex',
39
-
40
38
  /*
41
39
  The circle should be 14px * 14px centred in a 24px * 24px box.
42
40
  This is inclusive of a 2px border and inner circle with 2px radius.
@@ -46,20 +44,17 @@ const radioStyles = css({
46
44
  */
47
45
  width: '24px',
48
46
  height: '24px',
49
- // TODO Delete this comment after verifying spacing token -> previous value `0`
50
- margin: "var(--ds-scale-0, 0px)",
47
+ margin: "var(--ds-space-0, 0px)",
51
48
  position: 'relative',
52
49
  alignItems: 'center',
53
50
  justifyContent: 'center',
54
51
  flexShrink: 0,
55
52
  backgroundColor: 'var(--radio-background-color)',
56
-
57
53
  /* Border should be 2px, multiply by 24/14 to offset scale */
58
54
  border: 'calc(2px * 12 / 7) solid var(--radio-border-color)',
59
55
  borderRadius: '50%',
60
56
  MozAppearance: 'none',
61
57
  outline: 'none',
62
-
63
58
  /*
64
59
  Change the variables --radio-background-color, --radio-border-color,
65
60
  -radio-dot-color and -radio-dot-opacity according to user interactions.
@@ -69,7 +64,6 @@ const radioStyles = css({
69
64
  '--radio-border-color': 'var(--local-border)',
70
65
  '--radio-dot-color': 'var(--local-dot-checked)',
71
66
  '--radio-dot-opacity': 0,
72
-
73
67
  /* 24px * 7 / 12 === 14px height and width */
74
68
  transform: 'scale(calc(7 / 12))',
75
69
  transition: 'border-color 0.2s ease-in-out, background-color 0.2s ease-in-out',
@@ -122,10 +116,6 @@ const radioStyles = css({
122
116
  '--radio-background-color': 'var(--local-background-disabled)',
123
117
  '--radio-border-color': 'var(--local-border-disabled)',
124
118
  '--radio-dot-color': 'var(--local-dot-disabled)'
125
- },
126
- '&:checked:disabled': {
127
- '--radio-border-color': 'transparent' // TODO: Investigate token solution
128
-
129
119
  }
130
120
  });
131
121
  const RadioWithMode = /*#__PURE__*/forwardRef(function Radio(props, ref) {
@@ -154,11 +144,13 @@ const RadioWithMode = /*#__PURE__*/forwardRef(function Radio(props, ref) {
154
144
  packageVersion
155
145
  });
156
146
  const radioCustomProperties = useMemo(() => css(getRadioCustomProperties(mode)), [mode]);
157
- return (// https://product-fabric.atlassian.net/browse/DST-1971
147
+ return (
148
+ // https://product-fabric.atlassian.net/browse/DST-1971
158
149
  // eslint-disable-next-line jsx-a11y/label-has-associated-control,jsx-a11y/label-has-for
159
150
  jsx("label", {
160
151
  "data-testid": testId && `${testId}--radio-label`,
161
- "data-disabled": isDisabled ? 'true' : undefined // TODO these will no longer be dynamic styles when legacy theming removed
152
+ "data-disabled": isDisabled ? 'true' : undefined
153
+ // TODO these will no longer be dynamic styles when legacy theming removed
162
154
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
163
155
  ,
164
156
  css: [labelStyles, mode === 'light' ? lightLabelStyles : darkLabelStyles]
@@ -171,10 +163,12 @@ const RadioWithMode = /*#__PURE__*/forwardRef(function Radio(props, ref) {
171
163
  required: isRequired,
172
164
  type: "radio",
173
165
  value: value,
174
- "data-testid": testId && `${testId}--radio-input` // isInvalid is used in a nonstandard way so cannot
166
+ "data-testid": testId && `${testId}--radio-input`
167
+ // isInvalid is used in a nonstandard way so cannot
175
168
  // use :invalid selector
176
169
  ,
177
- "data-invalid": isInvalid ? 'true' : undefined // TODO radioCustomProperties can be defined at top of file when legacy theming removed
170
+ "data-invalid": isInvalid ? 'true' : undefined
171
+ // TODO radioCustomProperties can be defined at top of file when legacy theming removed
178
172
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
179
173
  ,
180
174
  css: [radioStyles, radioCustomProperties],
@@ -184,6 +178,7 @@ const RadioWithMode = /*#__PURE__*/forwardRef(function Radio(props, ref) {
184
178
  }, label) : null)
185
179
  );
186
180
  });
181
+
187
182
  /**
188
183
  * __Radio__
189
184
  *
@@ -193,7 +188,6 @@ const RadioWithMode = /*#__PURE__*/forwardRef(function Radio(props, ref) {
193
188
  * - [Code](https://atlassian.design/components/radio/code)
194
189
  * - [Usage](https://atlassian.design/components/radio/usage)
195
190
  */
196
-
197
191
  const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Radio(props, ref) {
198
192
  return jsx(GlobalTheme.Consumer, null, ({
199
193
  mode
@@ -7,13 +7,13 @@ const radioThemeColors = {
7
7
  backgroundChecked: `var(--ds-background-brand-bold, ${B400})`,
8
8
  backgroundCheckedHover: `var(--ds-background-brand-bold-hovered, ${B300})`,
9
9
  backgroundCheckedActive: `var(--ds-background-brand-bold-pressed, ${B50})`,
10
- backgroundDisabled: `var(--ds-background-input, ${N20})`,
11
- dotChecked: `var(--ds-text-inverse, ${N10})`,
12
- dotDisabled: `var(--ds-text-disabled, ${N70})`,
13
- dotActive: `var(--ds-text-inverse, ${B400})`,
10
+ backgroundDisabled: `var(--ds-background-disabled, ${N20})`,
11
+ dotChecked: `var(--ds-icon-inverse, ${N10})`,
12
+ dotDisabled: `var(--ds-icon-disabled, ${N70})`,
13
+ dotActive: `var(--ds-icon-inverse, ${B400})`,
14
14
  border: `var(--ds-border-input, ${N40})`,
15
15
  borderHover: `var(--ds-border-input, ${N40})`,
16
- borderDisabled: `var(--ds-background-disabled, ${N20})`,
16
+ borderDisabled: `var(--ds-border-disabled, ${N20})`,
17
17
  borderFocus: `var(--ds-border-focused, ${B100})`
18
18
  },
19
19
  dark: {
@@ -23,13 +23,13 @@ const radioThemeColors = {
23
23
  backgroundChecked: `var(--ds-background-brand-bold, ${B400})`,
24
24
  backgroundCheckedHover: `var(--ds-background-brand-bold-hovered, ${B75})`,
25
25
  backgroundCheckedActive: `var(--ds-background-brand-bold-pressed, ${B200})`,
26
- backgroundDisabled: `var(--ds-background-input, ${DN10})`,
27
- dotChecked: `var(--ds-text-inverse, ${DN10})`,
28
- dotDisabled: `var(--ds-text-disabled, ${DN90})`,
29
- dotActive: `var(--ds-text-inverse, ${DN10})`,
26
+ backgroundDisabled: `var(--ds-background-disabled, ${DN10})`,
27
+ dotChecked: `var(--ds-icon-inverse, ${DN10})`,
28
+ dotDisabled: `var(--ds-icon-disabled, ${DN90})`,
29
+ dotActive: `var(--ds-icon-inverse, ${DN10})`,
30
30
  border: `var(--ds-border-input, ${DN80})`,
31
31
  borderHover: `var(--ds-border-input, ${DN200})`,
32
- borderDisabled: `var(--ds-background-disabled, ${DN10})`,
32
+ borderDisabled: `var(--ds-border-disabled, ${DN10})`,
33
33
  borderFocus: `var(--ds-border-focused, ${B75})`
34
34
  }
35
35
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/radio",
3
- "version": "5.4.5",
3
+ "version": "5.4.7",
4
4
  "sideEffects": false
5
5
  }
@@ -6,44 +6,40 @@ import Radio from './radio';
6
6
  var noOptions = [];
7
7
  export default function RadioGroup(props) {
8
8
  var onChange = props.onChange,
9
- _props$options = props.options,
10
- options = _props$options === void 0 ? noOptions : _props$options,
11
- propValue = props.value,
12
- defaultValue = props.defaultValue,
13
- isDisabled = props.isDisabled,
14
- isRequired = props.isRequired,
15
- isInvalid = props.isInvalid,
16
- _props$onInvalid = props.onInvalid,
17
- onInvalid = _props$onInvalid === void 0 ? noop : _props$onInvalid,
18
- name = props.name,
19
- analyticsContext = props.analyticsContext,
20
- ariaLabelledBy = props['aria-labelledby'];
21
-
9
+ _props$options = props.options,
10
+ options = _props$options === void 0 ? noOptions : _props$options,
11
+ propValue = props.value,
12
+ defaultValue = props.defaultValue,
13
+ isDisabled = props.isDisabled,
14
+ isRequired = props.isRequired,
15
+ isInvalid = props.isInvalid,
16
+ _props$onInvalid = props.onInvalid,
17
+ onInvalid = _props$onInvalid === void 0 ? noop : _props$onInvalid,
18
+ name = props.name,
19
+ analyticsContext = props.analyticsContext,
20
+ ariaLabelledBy = props['aria-labelledby'];
22
21
  var _useState = useState(propValue !== undefined ? propValue : defaultValue),
23
- _useState2 = _slicedToArray(_useState, 2),
24
- selectedValue = _useState2[0],
25
- setSelectedValue = _useState2[1];
26
-
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ selectedValue = _useState2[0],
24
+ setSelectedValue = _useState2[1];
27
25
  var onRadioChange = useCallback(function (e, analyticsEvent) {
28
26
  setSelectedValue(e.currentTarget.value);
29
-
30
27
  if (onChange) {
31
28
  onChange(e, analyticsEvent);
32
29
  }
33
- }, [onChange]); // If propValue is provided than act as a controlled component
34
- // If not then act as an uncontrolled component using the value from state
30
+ }, [onChange]);
35
31
 
32
+ // If propValue is provided than act as a controlled component
33
+ // If not then act as an uncontrolled component using the value from state
36
34
  var value = typeof propValue !== 'undefined' ? propValue : selectedValue;
37
35
  return /*#__PURE__*/React.createElement("div", {
38
36
  role: "radiogroup",
39
37
  "aria-labelledby": ariaLabelledBy
40
38
  }, options.map(function (_ref, index) {
41
39
  var optionProps = _extends({}, _ref);
42
-
43
40
  if (typeof isDisabled !== 'undefined') {
44
41
  optionProps.isDisabled = isDisabled;
45
42
  }
46
-
47
43
  var isChecked = value != null && optionProps.value === value;
48
44
  return /*#__PURE__*/React.createElement(Radio, _extends({}, optionProps, {
49
45
  name: name || optionProps.name,