@deque/cauldron-react 6.26.0 → 6.27.0-canary.ccb9880a

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.
@@ -4,6 +4,7 @@ type ProgressBarProps = {
4
4
  progress: number;
5
5
  progressMax?: number;
6
6
  progressMin?: number;
7
+ thin?: boolean;
7
8
  } & Cauldron.LabelProps & React.HTMLAttributes<HTMLDivElement>;
8
9
  declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
9
10
  export default ProgressBar;
@@ -9,7 +9,7 @@ export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElemen
9
9
  className?: string;
10
10
  radios: RadioItem[];
11
11
  defaultValue?: string;
12
- value?: any;
12
+ value?: string;
13
13
  inline?: boolean;
14
14
  onChange?: (radio: RadioItem, input: HTMLElement) => void;
15
15
  }
package/lib/index.js CHANGED
@@ -2444,7 +2444,9 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
2444
2444
  var _d = tslib.__read(React.useState(value || defaultValue || null), 2), currentValue = _d[0], setCurrentValue = _d[1];
2445
2445
  var _e = tslib.__read(React.useState(null), 2), focusIndex = _e[0], setFocusIndex = _e[1];
2446
2446
  var inputs = React.useRef([]);
2447
- var handleChange = function (value) { return setCurrentValue(value); };
2447
+ var handleChange = function (value) {
2448
+ return setCurrentValue(value !== null && value !== void 0 ? value : null);
2449
+ };
2448
2450
  var onRadioFocus = function (index) { return setFocusIndex(index); };
2449
2451
  var onRadioBlur = function () { return setFocusIndex(null); };
2450
2452
  var onRadioClick = function (index) {
@@ -2469,10 +2471,9 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
2469
2471
  return (React__default["default"].createElement("div", { className: "Radio__wrap", key: id },
2470
2472
  React__default["default"].createElement("div", { className: classNames__default["default"]('Radio is--flex-row', className) },
2471
2473
  React__default["default"].createElement("input", tslib.__assign({ type: "radio", name: name, value: radioValue, id: id, ref: function (input) {
2472
- if (!input) {
2473
- return;
2474
+ if (input) {
2475
+ inputs.current[index] = input;
2474
2476
  }
2475
- inputs.current.push(input);
2476
2477
  }, onFocus: function () { return onRadioFocus(index); }, onBlur: function () { return onRadioBlur(); }, onChange: function () {
2477
2478
  var _a;
2478
2479
  handleChange(radioValue);
@@ -2489,10 +2490,6 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
2489
2490
  'Field__labelDescription--disabled': disabled
2490
2491
  }) }, labelDescription))));
2491
2492
  });
2492
- // reset the input refs array
2493
- // refs get clobbered every re-render anyway and this supports "dynamic" radios
2494
- // (changing the number of radio buttons for example)
2495
- inputs.current = [];
2496
2493
  return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"](className, { 'Radio--inline': inline }), role: "radiogroup", ref: ref }, other), radioButtons));
2497
2494
  });
2498
2495
  RadioGroup.displayName = 'RadioGroup';
@@ -3419,9 +3416,9 @@ var Stepper = function (_a) {
3419
3416
  Stepper.displayName = 'Stepper';
3420
3417
 
3421
3418
  var ProgressBar = React.forwardRef(function (_a, ref) {
3422
- var _b = _a.progress, progress = _b === void 0 ? 0 : _b, _c = _a.progressMax, progressMax = _c === void 0 ? 100 : _c, _d = _a.progressMin, progressMin = _d === void 0 ? 0 : _d, props = tslib.__rest(_a, ["progress", "progressMax", "progressMin"]);
3419
+ var _b = _a.progress, progress = _b === void 0 ? 0 : _b, _c = _a.progressMax, progressMax = _c === void 0 ? 100 : _c, _d = _a.progressMin, progressMin = _d === void 0 ? 0 : _d, thin = _a.thin, props = tslib.__rest(_a, ["progress", "progressMax", "progressMin", "thin"]);
3423
3420
  var className = props.className, otherProps = tslib.__rest(props, ["className"]);
3424
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('ProgressBar', className), role: "progressbar", "aria-valuemin": progressMin, "aria-valuemax": progressMax, "aria-valuenow": progress, ref: ref }, otherProps),
3421
+ return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('ProgressBar', { 'ProgressBar--thin': thin }, className), role: "progressbar", "aria-valuemin": progressMin, "aria-valuemax": progressMax, "aria-valuenow": progress, ref: ref }, otherProps),
3425
3422
  React__default["default"].createElement("div", { className: "ProgressBar--fill", style: { width: "".concat(Math.min((progress / progressMax) * 100, 100), "%") } })));
3426
3423
  });
3427
3424
  ProgressBar.displayName = 'ProgressBar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "6.26.0",
3
+ "version": "6.27.0-canary.ccb9880a",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",