@lumx/react 3.7.2-alpha.0 → 3.7.3

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/index.js CHANGED
@@ -1705,7 +1705,7 @@ function useStopPropagation(handler) {
1705
1705
  }, [handler]);
1706
1706
  }
1707
1707
 
1708
- const _excluded$c = ["after", "before", "children", "className", "color", "disabled", "isClickable", "isDisabled", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href"];
1708
+ const _excluded$c = ["after", "before", "children", "className", "color", "disabled", "isClickable", "isDisabled", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href", "onKeyDown"];
1709
1709
 
1710
1710
  /**
1711
1711
  * Chip sizes.
@@ -1757,7 +1757,8 @@ const Chip = /*#__PURE__*/forwardRef((props, ref) => {
1757
1757
  onClick,
1758
1758
  size,
1759
1759
  theme,
1760
- href
1760
+ href,
1761
+ onKeyDown
1761
1762
  } = props,
1762
1763
  forwardedProps = _objectWithoutProperties(props, _excluded$c);
1763
1764
  const hasAfterClick = isFunction(onAfterClick);
@@ -1770,6 +1771,9 @@ const Chip = /*#__PURE__*/forwardRef((props, ref) => {
1770
1771
  const chipColor = color || (theme === Theme.light ? ColorPalette.dark : ColorPalette.light);
1771
1772
  const handleOnBeforeClick = useStopPropagation(onBeforeClick);
1772
1773
  const handleOnAfterClick = useStopPropagation(onAfterClick);
1774
+ const handleKeyDown = evt => {
1775
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(evt);
1776
+ };
1773
1777
  return (
1774
1778
  /*#__PURE__*/
1775
1779
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
@@ -1793,7 +1797,7 @@ const Chip = /*#__PURE__*/forwardRef((props, ref) => {
1793
1797
  })),
1794
1798
  "aria-disabled": isClickable && isDisabled || undefined,
1795
1799
  onClick: hasOnClick ? onClick : undefined,
1796
- onKeyDown: hasOnClick ? onEnterPressed(onClick) : undefined
1800
+ onKeyDown: handleKeyDown
1797
1801
  }), before &&
1798
1802
  /*#__PURE__*/
1799
1803
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
@@ -9977,7 +9981,7 @@ const WithSelectContext = (SelectElement, _ref, ref) => {
9977
9981
  }, helper));
9978
9982
  };
9979
9983
 
9980
- const _excluded$Z = ["anchorRef", "clearButtonProps", "handleKeyboardNav", "hasError", "hasInputClear", "icon", "id", "isDisabled", "isEmpty", "isRequired", "isValid", "label", "onClear", "onInputClick", "placeholder", "selectedValueRender", "theme", "value", "variant"];
9984
+ const _excluded$Z = ["anchorRef", "clearButtonProps", "handleKeyboardNav", "hasError", "hasInputClear", "icon", "id", "isDisabled", "isEmpty", "isRequired", "isValid", "label", "onClear", "onInputClick", "placeholder", "selectedValueRender", "theme", "value", "variant", "selectElementRef"];
9981
9985
 
9982
9986
  /** The display name of the component. */
9983
9987
  const COMPONENT_NAME$X = 'Select';
@@ -10014,7 +10018,8 @@ const SelectField = _ref => {
10014
10018
  selectedValueRender,
10015
10019
  theme,
10016
10020
  value,
10017
- variant
10021
+ variant,
10022
+ selectElementRef
10018
10023
  } = _ref,
10019
10024
  forwardedProps = _objectWithoutProperties(_ref, _excluded$Z);
10020
10025
  return /*#__PURE__*/React.createElement(React.Fragment, null, variant === SelectVariant.input && /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement("div", {
@@ -10025,7 +10030,7 @@ const SelectField = _ref => {
10025
10030
  isRequired: isRequired,
10026
10031
  theme: theme
10027
10032
  }, label)), /*#__PURE__*/React.createElement("div", _extends({
10028
- ref: anchorRef,
10033
+ ref: mergeRefs(anchorRef, selectElementRef),
10029
10034
  id: id,
10030
10035
  className: `${CLASSNAME$U}__wrapper`,
10031
10036
  onClick: onInputClick,
@@ -10066,7 +10071,7 @@ const SelectField = _ref => {
10066
10071
  }),
10067
10072
  onAfterClick: isEmpty ? onInputClick : onClear,
10068
10073
  onClick: onInputClick,
10069
- ref: anchorRef,
10074
+ ref: mergeRefs(anchorRef, selectElementRef),
10070
10075
  theme: theme
10071
10076
  }, forwardedProps), isEmpty && /*#__PURE__*/React.createElement("span", null, label), !isEmpty && /*#__PURE__*/React.createElement("span", null, selectedValueRender === null || selectedValueRender === void 0 ? void 0 : selectedValueRender(value))));
10072
10077
  };
@@ -10096,7 +10101,7 @@ Select.className = CLASSNAME$U;
10096
10101
  Select.defaultProps = DEFAULT_PROPS$I;
10097
10102
  Select.className = CLASSNAME$U;
10098
10103
 
10099
- const _excluded$_ = ["anchorRef", "handleKeyboardNav", "hasError", "icon", "id", "isDisabled", "isEmpty", "isRequired", "isValid", "label", "onClear", "onInputClick", "placeholder", "selectedChipRender", "selectedValueRender", "theme", "value", "variant"];
10104
+ const _excluded$_ = ["anchorRef", "handleKeyboardNav", "hasError", "icon", "id", "isDisabled", "isEmpty", "isRequired", "isValid", "label", "onClear", "onInputClick", "placeholder", "selectedChipRender", "selectedValueRender", "theme", "value", "variant", "selectElementRef"];
10100
10105
 
10101
10106
  /** Defines the props of the component. */
10102
10107
 
@@ -10144,7 +10149,8 @@ const SelectMultipleField = _ref => {
10144
10149
  selectedValueRender,
10145
10150
  theme,
10146
10151
  value,
10147
- variant
10152
+ variant,
10153
+ selectElementRef
10148
10154
  } = _ref,
10149
10155
  forwardedProps = _objectWithoutProperties(_ref, _excluded$_);
10150
10156
  return /*#__PURE__*/React.createElement(React.Fragment, null, variant === SelectVariant.input && /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement("div", {
@@ -10155,7 +10161,7 @@ const SelectMultipleField = _ref => {
10155
10161
  isRequired: isRequired,
10156
10162
  theme: theme
10157
10163
  }, label)), /*#__PURE__*/React.createElement("div", _extends({
10158
- ref: anchorRef,
10164
+ ref: mergeRefs(anchorRef, selectElementRef),
10159
10165
  id: id,
10160
10166
  className: `${CLASSNAME$V}__wrapper`,
10161
10167
  onClick: onInputClick,
@@ -10190,7 +10196,7 @@ const SelectMultipleField = _ref => {
10190
10196
  }),
10191
10197
  onAfterClick: isEmpty ? onInputClick : onClear,
10192
10198
  onClick: onInputClick,
10193
- ref: anchorRef,
10199
+ ref: mergeRefs(anchorRef, selectElementRef),
10194
10200
  theme: theme
10195
10201
  }, forwardedProps), isEmpty && /*#__PURE__*/React.createElement("span", null, label), !isEmpty && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, selectedValueRender === null || selectedValueRender === void 0 ? void 0 : selectedValueRender(value[0])), value.length > 1 && /*#__PURE__*/React.createElement("span", null, "\xA0+", value.length - 1))));
10196
10202
  };
@@ -12536,7 +12542,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
12536
12542
  */
12537
12543
  const helperId = helper ? `text-field-helper-${uid()}` : undefined;
12538
12544
  const errorId = error ? `text-field-error-${uid()}` : undefined;
12539
- const describedByIds = [errorId, helperId].filter(Boolean);
12545
+ const describedByIds = [errorId, helperId, forwardedProps['aria-describedby']].filter(Boolean);
12540
12546
  const describedById = describedByIds.length === 0 ? undefined : describedByIds.join(' ');
12541
12547
  const [isFocus, setFocus] = useState(false);
12542
12548
  const {