@deque/cauldron-react 5.4.0 → 5.4.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/lib/index.js +12 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2776,7 +2776,7 @@ RadioCardGroup.propTypes = {
|
|
|
2776
2776
|
RadioCardGroup.displayName = 'RadioCardGroup';
|
|
2777
2777
|
|
|
2778
2778
|
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
2779
|
-
var id = _a.id, label = _a.label, labelDescription = _a.labelDescription, error = _a.error, checkboxRef = _a.checkboxRef, className = _a.className, onChange = _a.onChange, ariaDescribedby = _a["aria-describedby"], _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, other = tslib.__rest(_a, ["id", "label", "labelDescription", "error", "checkboxRef", "className", "onChange", 'aria-describedby', "disabled", "checked"]);
|
|
2779
|
+
var id = _a.id, label = _a.label, labelDescription = _a.labelDescription, error = _a.error, checkboxRef = _a.checkboxRef, className = _a.className, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, ariaDescribedby = _a["aria-describedby"], _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, other = tslib.__rest(_a, ["id", "label", "labelDescription", "error", "checkboxRef", "className", "onChange", "onFocus", "onBlur", 'aria-describedby', "disabled", "checked"]);
|
|
2780
2780
|
var _d = tslib.__read(React.useState(checked), 2), isChecked = _d[0], setIsChecked = _d[1];
|
|
2781
2781
|
var _e = tslib.__read(React.useState(false), 2), focused = _e[0], setFocused = _e[1];
|
|
2782
2782
|
var checkRef = React.useRef(null);
|
|
@@ -2802,7 +2802,17 @@ var Checkbox = React.forwardRef(function (_a, ref) {
|
|
|
2802
2802
|
}
|
|
2803
2803
|
return (React__default.createElement(React__default.Fragment, null,
|
|
2804
2804
|
React__default.createElement("div", { className: classNames('Checkbox is--flex-row', className) },
|
|
2805
|
-
React__default.createElement("input", tslib.__assign({ id: id, ref: typeof refProp === 'function' || !refProp ? checkRef : refProp, type: "checkbox", checked: isChecked, disabled: disabled, onFocus: function (
|
|
2805
|
+
React__default.createElement("input", tslib.__assign({ id: id, ref: typeof refProp === 'function' || !refProp ? checkRef : refProp, type: "checkbox", checked: isChecked, disabled: disabled, onFocus: function (e) {
|
|
2806
|
+
setFocused(true);
|
|
2807
|
+
if (typeof onFocus === 'function') {
|
|
2808
|
+
onFocus(e);
|
|
2809
|
+
}
|
|
2810
|
+
}, onBlur: function (e) {
|
|
2811
|
+
setFocused(false);
|
|
2812
|
+
if (typeof onBlur === 'function') {
|
|
2813
|
+
onBlur(e);
|
|
2814
|
+
}
|
|
2815
|
+
}, "aria-describedby": ariaDescribedbyId, onChange: function (e) {
|
|
2806
2816
|
setIsChecked(e.target.checked);
|
|
2807
2817
|
if (onChange) {
|
|
2808
2818
|
onChange(e);
|