@ringcentral/juno 2.43.0 → 2.44.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.
@@ -109,7 +109,7 @@ var _NumberPicker = react_1.forwardRef(function (props, ref) {
109
109
  return 'large';
110
110
  }
111
111
  })();
112
- return (react_1.default.createElement(StyledNumberPicker_1.StyledNumberPicker, tslib_1.__assign({ tabIndex: 0, onKeyDown: handleKeyDown, "aria-live": "assertive", "aria-label": label, ref: pickerRef, "data-focusable": true }, rest),
112
+ return (react_1.default.createElement(StyledNumberPicker_1.StyledNumberPicker, tslib_1.__assign({ tabIndex: 0, onKeyDown: handleKeyDown, "aria-live": "assertive", "aria-label": label, ref: pickerRef, "data-focusable": true, role: "spinbutton" }, rest),
113
113
  react_1.default.createElement(StyledTimeIconButton_1.StyledTimeIconButton, { tabIndex: -1, size: iconSize, color: "neutral.f04", wrapperSize: size, disabled: increaseDisabled, onClick: function () {
114
114
  onUpdateValue(increaseValue);
115
115
  }, symbol: juno_icon_1.ArrowUp, "data-test-automation-id": automationId && automationId + "-prev-pagination", "aria-label": "Arrow Up" }),
@@ -14,12 +14,16 @@ var styles_1 = require("./styles");
14
14
  var utils_1 = require("./utils");
15
15
  var _RcTabList = react_1.forwardRef(function (inProps, ref) {
16
16
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTabList' });
17
- var classesProp = props.classes, childrenProp = props.children, _a = props.idPrefix, idPrefix = _a === void 0 ? '' : _a, value = props.value, rest = tslib_1.__rest(props, ["classes", "children", "idPrefix", "value"]);
17
+ var classesProp = props.classes, childrenProp = props.children, idPrefix = props.idPrefix, value = props.value, rest = tslib_1.__rest(props, ["classes", "children", "idPrefix", "value"]);
18
18
  var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcTabListClasses, classesProp); }, [classesProp]);
19
- var context = TabContext_1.useTabContext() || {
20
- value: value,
21
- idPrefix: idPrefix,
22
- };
19
+ var tabContext = TabContext_1.useTabContext();
20
+ var context = react_1.useMemo(function () { return ({
21
+ value: value !== null && value !== void 0 ? value : tabContext === null || tabContext === void 0 ? void 0 : tabContext.value,
22
+ idPrefix: idPrefix !== null && idPrefix !== void 0 ? idPrefix : tabContext === null || tabContext === void 0 ? void 0 : tabContext.idPrefix,
23
+ }); }, [value, idPrefix, tabContext]);
24
+ if (!tabContext && !context.idPrefix) {
25
+ throw new Error('[TabList] No idPrefix provided, use RcTabContext or idPrefix prop');
26
+ }
23
27
  var children = react_1.useMemo(function () {
24
28
  return react_1.default.Children.map(childrenProp, function (child) {
25
29
  var value = child.props.value;
@@ -107,7 +107,7 @@ var _NumberPicker = forwardRef(function (props, ref) {
107
107
  return 'large';
108
108
  }
109
109
  })();
110
- return (React.createElement(StyledNumberPicker, __assign({ tabIndex: 0, onKeyDown: handleKeyDown, "aria-live": "assertive", "aria-label": label, ref: pickerRef, "data-focusable": true }, rest),
110
+ return (React.createElement(StyledNumberPicker, __assign({ tabIndex: 0, onKeyDown: handleKeyDown, "aria-live": "assertive", "aria-label": label, ref: pickerRef, "data-focusable": true, role: "spinbutton" }, rest),
111
111
  React.createElement(StyledTimeIconButton, { tabIndex: -1, size: iconSize, color: "neutral.f04", wrapperSize: size, disabled: increaseDisabled, onClick: function () {
112
112
  onUpdateValue(increaseValue);
113
113
  }, symbol: ArrowUpIcon, "data-test-automation-id": automationId && automationId + "-prev-pagination", "aria-label": "Arrow Up" }),
@@ -12,12 +12,16 @@ import { TabListStyle } from './styles';
12
12
  import { RcTabListClasses } from './utils';
13
13
  var _RcTabList = forwardRef(function (inProps, ref) {
14
14
  var props = useThemeProps({ props: inProps, name: 'RcTabList' });
15
- var classesProp = props.classes, childrenProp = props.children, _a = props.idPrefix, idPrefix = _a === void 0 ? '' : _a, value = props.value, rest = __rest(props, ["classes", "children", "idPrefix", "value"]);
15
+ var classesProp = props.classes, childrenProp = props.children, idPrefix = props.idPrefix, value = props.value, rest = __rest(props, ["classes", "children", "idPrefix", "value"]);
16
16
  var classes = useMemo(function () { return combineClasses(RcTabListClasses, classesProp); }, [classesProp]);
17
- var context = useTabContext() || {
18
- value: value,
19
- idPrefix: idPrefix,
20
- };
17
+ var tabContext = useTabContext();
18
+ var context = useMemo(function () { return ({
19
+ value: value !== null && value !== void 0 ? value : tabContext === null || tabContext === void 0 ? void 0 : tabContext.value,
20
+ idPrefix: idPrefix !== null && idPrefix !== void 0 ? idPrefix : tabContext === null || tabContext === void 0 ? void 0 : tabContext.idPrefix,
21
+ }); }, [value, idPrefix, tabContext]);
22
+ if (!tabContext && !context.idPrefix) {
23
+ throw new Error('[TabList] No idPrefix provided, use RcTabContext or idPrefix prop');
24
+ }
21
25
  var children = useMemo(function () {
22
26
  return React.Children.map(childrenProp, function (child) {
23
27
  var value = child.props.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",