@instructure/ui-radio-input 11.7.8 → 11.7.9-snapshot-1
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,6 +3,14 @@
|
|
|
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-1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-1) (2026-10-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-radio-input
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-radio-input
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.RadioInput = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
|
|
9
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
12
11
|
var _emotion = require("@instructure/emotion");
|
|
13
12
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
14
13
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
@@ -43,7 +42,7 @@ var _dec, _dec2, _class;
|
|
|
43
42
|
category: components
|
|
44
43
|
---
|
|
45
44
|
**/
|
|
46
|
-
let RadioInput = exports.RadioInput = (_dec = (0,
|
|
45
|
+
let RadioInput = exports.RadioInput = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = class RadioInput extends _react.Component {
|
|
47
46
|
static displayName = 'RadioInput';
|
|
48
47
|
static componentId = 'RadioInput';
|
|
49
48
|
static allowedProps = _props.allowedProps;
|
|
@@ -109,7 +108,7 @@ let RadioInput = exports.RadioInput = (_dec = (0, _withDeterministicId.withDeter
|
|
|
109
108
|
return this.props.id || this._defaultId;
|
|
110
109
|
}
|
|
111
110
|
get focused() {
|
|
112
|
-
return (0,
|
|
111
|
+
return (0, _uiDomUtils.isActiveElement)(this._input);
|
|
113
112
|
}
|
|
114
113
|
get checked() {
|
|
115
114
|
return typeof this.props.checked === 'undefined' ? this.state.checked : this.props.checked;
|
|
@@ -123,7 +122,7 @@ let RadioInput = exports.RadioInput = (_dec = (0, _withDeterministicId.withDeter
|
|
|
123
122
|
name,
|
|
124
123
|
styles
|
|
125
124
|
} = this.props;
|
|
126
|
-
const props = (0,
|
|
125
|
+
const props = (0, _uiReactUtils.omitProps)(this.props, RadioInput.allowedProps);
|
|
127
126
|
return (0, _jsxRuntime.jsx)("div", {
|
|
128
127
|
css: styles?.radioInput,
|
|
129
128
|
"data-cid": "RadioInput",
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.RadioInput = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
|
|
9
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
12
11
|
var _emotion = require("@instructure/emotion");
|
|
13
12
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
14
13
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -70,7 +69,7 @@ const RadioInput = exports.RadioInput = /*#__PURE__*/(0, _react.forwardRef)((pro
|
|
|
70
69
|
const inputElementRef = (0, _react.useRef)(null);
|
|
71
70
|
|
|
72
71
|
// SSR-safe deterministic ID generation (stable across server/client render)
|
|
73
|
-
const deterministicId = (0,
|
|
72
|
+
const deterministicId = (0, _uiReactUtils.useDeterministicId)('RadioInput')();
|
|
74
73
|
const id = idProp || deterministicId;
|
|
75
74
|
|
|
76
75
|
// Computed checked value
|
|
@@ -129,7 +128,7 @@ const RadioInput = exports.RadioInput = /*#__PURE__*/(0, _react.forwardRef)((pro
|
|
|
129
128
|
inputElementRef.current?.focus();
|
|
130
129
|
},
|
|
131
130
|
get focused() {
|
|
132
|
-
return (0,
|
|
131
|
+
return (0, _uiDomUtils.isActiveElement)(inputElementRef.current);
|
|
133
132
|
},
|
|
134
133
|
get checked() {
|
|
135
134
|
return checked;
|
|
@@ -145,7 +144,7 @@ const RadioInput = exports.RadioInput = /*#__PURE__*/(0, _react.forwardRef)((pro
|
|
|
145
144
|
const handleMouseOut = () => {
|
|
146
145
|
setHovered(false);
|
|
147
146
|
};
|
|
148
|
-
const passedProps = (0,
|
|
147
|
+
const passedProps = (0, _uiReactUtils.passthroughProps)(rest);
|
|
149
148
|
return (0, _jsxRuntime.jsxs)("div", {
|
|
150
149
|
css: styles?.radioInput,
|
|
151
150
|
"data-cid": "RadioInput",
|
|
@@ -7,12 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.RadioInputGroup = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _v11_ = require("@instructure/ui-form-field/v11_6");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
13
|
-
var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
|
|
14
|
-
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
15
|
-
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
10
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
11
|
+
var _uiA11yUtils = require("@instructure/ui-a11y-utils");
|
|
16
12
|
var _index = require("../../RadioInput/v1/index.js");
|
|
17
13
|
var _emotion = require("@instructure/emotion");
|
|
18
14
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
@@ -48,7 +44,7 @@ var _dec, _dec2, _class;
|
|
|
48
44
|
category: components
|
|
49
45
|
---
|
|
50
46
|
**/
|
|
51
|
-
let RadioInputGroup = exports.RadioInputGroup = (_dec = (0,
|
|
47
|
+
let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = class RadioInputGroup extends _react.Component {
|
|
52
48
|
static displayName = 'RadioInputGroup';
|
|
53
49
|
static componentId = 'RadioInputGroup';
|
|
54
50
|
static allowedProps = _props.allowedProps;
|
|
@@ -110,10 +106,10 @@ let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _withDeterministicId
|
|
|
110
106
|
// This adds the passed in name property to each RadioInput component
|
|
111
107
|
// and checks the input whose value matches the value property
|
|
112
108
|
return _react.Children.map(children, (child, index) => {
|
|
113
|
-
if ((0,
|
|
109
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.RadioInput])) {
|
|
114
110
|
const isChecked = this.value === child.props.value;
|
|
115
111
|
const defaultFocus = !this.value && index === 0;
|
|
116
|
-
return (0,
|
|
112
|
+
return (0, _uiReactUtils.safeCloneElement)(child, {
|
|
117
113
|
name,
|
|
118
114
|
disabled: disabled || child.props.disabled,
|
|
119
115
|
variant,
|
|
@@ -142,7 +138,7 @@ let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _withDeterministicId
|
|
|
142
138
|
isRequired,
|
|
143
139
|
styles
|
|
144
140
|
} = this.props;
|
|
145
|
-
const descriptionWithRequired = (0,
|
|
141
|
+
const descriptionWithRequired = (0, _uiA11yUtils.hasVisibleChildren)(description) ? (0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
146
142
|
children: [description, isRequired && description && (0, _jsxRuntime.jsxs)("span", {
|
|
147
143
|
css: this.invalid ? styles?.invalidAsterisk : {},
|
|
148
144
|
"aria-hidden": true,
|
|
@@ -150,8 +146,8 @@ let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _withDeterministicId
|
|
|
150
146
|
})]
|
|
151
147
|
}) : description;
|
|
152
148
|
return (0, _jsxRuntime.jsx)(_v11_.FormFieldGroup, {
|
|
153
|
-
...(0,
|
|
154
|
-
...(0,
|
|
149
|
+
...(0, _uiReactUtils.omitProps)(this.props, RadioInputGroup.allowedProps),
|
|
150
|
+
...(0, _uiReactUtils.pickProps)(this.props, _v11_.FormFieldGroup.allowedProps),
|
|
155
151
|
description: descriptionWithRequired,
|
|
156
152
|
layout: layout === 'columns' && variant === 'toggle' ? 'stacked' : layout // toggles already display in cols
|
|
157
153
|
,
|
|
@@ -6,11 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.RadioInputGroup = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _latest = require("@instructure/ui-form-field/latest");
|
|
9
|
-
var
|
|
10
|
-
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
11
|
-
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
12
|
-
var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
|
|
13
|
-
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
9
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
14
10
|
var _index = require("../../RadioInput/v2/index.js");
|
|
15
11
|
var _props = require("./props.js");
|
|
16
12
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -43,7 +39,7 @@ var _dec, _class;
|
|
|
43
39
|
category: components
|
|
44
40
|
---
|
|
45
41
|
**/
|
|
46
|
-
let RadioInputGroup = exports.RadioInputGroup = (_dec = (0,
|
|
42
|
+
let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec(_class = class RadioInputGroup extends _react.Component {
|
|
47
43
|
static displayName = 'RadioInputGroup';
|
|
48
44
|
static componentId = 'RadioInputGroup';
|
|
49
45
|
static allowedProps = _props.allowedProps;
|
|
@@ -105,10 +101,10 @@ let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _withDeterministicId
|
|
|
105
101
|
// This adds the passed in name property to each RadioInput component
|
|
106
102
|
// and checks the input whose value matches the value property
|
|
107
103
|
return _react.Children.map(children, (child, index) => {
|
|
108
|
-
if ((0,
|
|
104
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.RadioInput])) {
|
|
109
105
|
const isChecked = this.value === child.props.value;
|
|
110
106
|
const defaultFocus = !this.value && index === 0;
|
|
111
|
-
return (0,
|
|
107
|
+
return (0, _uiReactUtils.safeCloneElement)(child, {
|
|
112
108
|
name,
|
|
113
109
|
disabled: disabled || child.props.disabled,
|
|
114
110
|
variant,
|
|
@@ -137,8 +133,8 @@ let RadioInputGroup = exports.RadioInputGroup = (_dec = (0, _withDeterministicId
|
|
|
137
133
|
isRequired
|
|
138
134
|
} = this.props;
|
|
139
135
|
return (0, _jsxRuntime.jsx)(_latest.FormFieldGroup, {
|
|
140
|
-
...(0,
|
|
141
|
-
...(0,
|
|
136
|
+
...(0, _uiReactUtils.omitProps)(this.props, RadioInputGroup.allowedProps),
|
|
137
|
+
...(0, _uiReactUtils.pickProps)(this.props, _latest.FormFieldGroup.allowedProps),
|
|
142
138
|
description: description,
|
|
143
139
|
layout: layout === 'columns' && variant === 'toggle' ? 'stacked' : layout // toggles already display in cols
|
|
144
140
|
,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-radio-input",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.9-snapshot-1",
|
|
4
4
|
"description": "A styled HTML input type='radio' element",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/
|
|
19
|
-
"@instructure/ui-a11y-utils": "11.7.
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
18
|
+
"@instructure/emotion": "11.7.9-snapshot-1",
|
|
19
|
+
"@instructure/ui-a11y-utils": "11.7.9-snapshot-1",
|
|
20
|
+
"@instructure/ui-dom-utils": "11.7.9-snapshot-1",
|
|
21
|
+
"@instructure/ui-form-field": "11.7.9-snapshot-1",
|
|
22
|
+
"@instructure/shared-types": "11.7.9-snapshot-1",
|
|
23
|
+
"@instructure/ui-react-utils": "11.7.9-snapshot-1",
|
|
24
|
+
"@instructure/ui-themes": "11.7.9-snapshot-1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"vitest": "^5.0.0",
|
|
28
|
-
"@instructure/ui-axe-check": "11.7.
|
|
29
|
-
"@instructure/ui-babel-preset": "11.7.
|
|
30
|
-
"@instructure/ui-color-utils": "11.7.
|
|
28
|
+
"@instructure/ui-axe-check": "11.7.9-snapshot-1",
|
|
29
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-1",
|
|
30
|
+
"@instructure/ui-color-utils": "11.7.9-snapshot-1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=18 <=19"
|