@lumx/react 3.19.1-alpha.1 → 3.19.1-alpha.11

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.
Files changed (42) hide show
  1. package/index.js +99 -56
  2. package/index.js.map +1 -1
  3. package/package.json +8 -10
  4. package/src/components/alert-dialog/AlertDialog.test.tsx +3 -2
  5. package/src/components/autocomplete/Autocomplete.test.tsx +3 -3
  6. package/src/components/button/Button.test.tsx +4 -4
  7. package/src/components/checkbox/Checkbox.test.tsx +3 -3
  8. package/src/components/chip/Chip.test.tsx +19 -17
  9. package/src/components/date-picker/DatePicker.test.tsx +3 -3
  10. package/src/components/date-picker/DatePickerControlled.test.tsx +6 -6
  11. package/src/components/date-picker/DatePickerField.test.tsx +3 -3
  12. package/src/components/dialog/Dialog.test.tsx +4 -4
  13. package/src/components/dropdown/Dropdown.test.tsx +3 -3
  14. package/src/components/expansion-panel/ExpansionPanel.test.tsx +6 -5
  15. package/src/components/image-lightbox/ImageLightbox.test.tsx +11 -7
  16. package/src/components/link/Link.test.tsx +5 -5
  17. package/src/components/list/ListItem.test.tsx +8 -6
  18. package/src/components/list/ListItem.tsx +32 -19
  19. package/src/components/message/Message.test.tsx +1 -1
  20. package/src/components/mosaic/Mosaic.test.tsx +3 -3
  21. package/src/components/notification/Notification.test.tsx +4 -3
  22. package/src/components/popover-dialog/PopoverDialog.test.tsx +1 -1
  23. package/src/components/radio-button/RadioButton.test.tsx +3 -3
  24. package/src/components/select/Select.test.tsx +8 -7
  25. package/src/components/select/SelectMultiple.test.tsx +5 -5
  26. package/src/components/side-navigation/SideNavigationItem.test.tsx +2 -2
  27. package/src/components/slider/Slider.test.tsx +1 -1
  28. package/src/components/switch/Switch.test.tsx +5 -5
  29. package/src/components/table/TableCell.test.tsx +1 -1
  30. package/src/components/text-field/TextField.test.tsx +9 -8
  31. package/src/components/thumbnail/Thumbnail.test.tsx +4 -4
  32. package/src/components/thumbnail/Thumbnail.tsx +4 -3
  33. package/src/components/tooltip/Tooltip.test.tsx +14 -8
  34. package/src/components/uploader/Uploader.test.tsx +2 -2
  35. package/src/components/user-block/UserBlock.test.tsx +1 -1
  36. package/src/untypped-modules.d.ts +4 -0
  37. package/src/utils/Portal/PortalProvider.test.tsx +1 -1
  38. package/src/utils/date/getYearDisplayName.test.ts +1 -1
  39. package/src/utils/disabled/useDisableStateProps.test.tsx +2 -2
  40. package/src/utils/react/RawClickable.test.tsx +11 -11
  41. package/src/utils/react/RawClickable.tsx +1 -1
  42. package/src/utils/react/renderLink.tsx +17 -0
package/index.js CHANGED
@@ -390,7 +390,7 @@ function getBasicClass({
390
390
  return `${prefix}--${kebabCase(type)}-${value}`;
391
391
  }
392
392
 
393
- const _excluded$1t = ["prefix"];
393
+ const _excluded$1u = ["prefix"];
394
394
 
395
395
  /**
396
396
  * Enhance isEmpty method to also works with numbers.
@@ -420,7 +420,7 @@ function handleBasicClasses(_ref) {
420
420
  let {
421
421
  prefix
422
422
  } = _ref,
423
- props = _objectWithoutProperties(_ref, _excluded$1t);
423
+ props = _objectWithoutProperties(_ref, _excluded$1u);
424
424
  const otherClasses = {};
425
425
  if (!isEmpty(props)) {
426
426
  Object.keys(props).forEach(prop => {
@@ -499,7 +499,7 @@ function useId() {
499
499
  */
500
500
  const forwardRef = React__default.forwardRef;
501
501
 
502
- const _excluded$1s = ["id", "title", "className", "cancelProps", "confirmProps", "kind", "size", "dialogProps", "children"],
502
+ const _excluded$1t = ["id", "title", "className", "cancelProps", "confirmProps", "kind", "size", "dialogProps", "children"],
503
503
  _excluded2$3 = ["label", "onClick"],
504
504
  _excluded3 = ["label", "onClick"];
505
505
  /**
@@ -563,7 +563,7 @@ const AlertDialog = forwardRef((props, ref) => {
563
563
  dialogProps,
564
564
  children
565
565
  } = props,
566
- forwardedProps = _objectWithoutProperties(props, _excluded$1s);
566
+ forwardedProps = _objectWithoutProperties(props, _excluded$1t);
567
567
  const cancelButtonRef = React__default.useRef(null);
568
568
  const confirmationButtonRef = React__default.useRef(null);
569
569
  const {
@@ -690,7 +690,7 @@ function useTheme() {
690
690
  return React__default.useContext(ThemeContext);
691
691
  }
692
692
 
693
- const _excluded$1r = ["disabled", "isDisabled", "aria-disabled", "onClick", "onChange"];
693
+ const _excluded$1s = ["disabled", "isDisabled", "aria-disabled", "onClick", "onChange"];
694
694
  /**
695
695
  * Resolve disabled state from props.
696
696
  * (handles `disabled`, `isDisabled` and `aria-disabled`)
@@ -705,7 +705,7 @@ function useDisableStateProps(props) {
705
705
  onClick,
706
706
  onChange
707
707
  } = props,
708
- otherProps = _objectWithoutProperties(props, _excluded$1r);
708
+ otherProps = _objectWithoutProperties(props, _excluded$1s);
709
709
  const disabledStateContext = useDisabledStateContext();
710
710
  const disabledStateProps = {
711
711
  disabled: (disabledStateContext === null || disabledStateContext === void 0 ? void 0 : disabledStateContext.state) === 'disabled' || isDisabled,
@@ -723,7 +723,7 @@ function useDisableStateProps(props) {
723
723
  };
724
724
  }
725
725
 
726
- const _excluded$1q = ["anchorToInput", "children", "chips", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "error", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClose", "onFocus", "onInfiniteScroll", "placeholder", "placement", "shouldFocusOnClose", "theme", "value", "textFieldProps", "focusAnchorOnClose"];
726
+ const _excluded$1r = ["anchorToInput", "children", "chips", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "error", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClose", "onFocus", "onInfiniteScroll", "placeholder", "placement", "shouldFocusOnClose", "theme", "value", "textFieldProps", "focusAnchorOnClose"];
727
727
 
728
728
  /**
729
729
  * Defines the props of the component.
@@ -797,7 +797,7 @@ const Autocomplete = forwardRef((props, ref) => {
797
797
  textFieldProps = {},
798
798
  focusAnchorOnClose
799
799
  } = otherProps,
800
- forwardedProps = _objectWithoutProperties(otherProps, _excluded$1q);
800
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1r);
801
801
  const inputAnchorRef = useRef(null);
802
802
  const textFieldRef = useRef(null);
803
803
  useFocus(inputAnchorRef.current, !isOpen && shouldFocusOnClose);
@@ -845,7 +845,7 @@ Autocomplete.displayName = COMPONENT_NAME$1m;
845
845
  Autocomplete.className = CLASSNAME$1j;
846
846
  Autocomplete.defaultProps = DEFAULT_PROPS$12;
847
847
 
848
- const _excluded$1p = ["anchorToInput", "children", "chipsAlignment", "className", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClear", "onClose", "onFocus", "onInfiniteScroll", "onKeyDown", "placeholder", "placement", "selectedChipRender", "shouldFocusOnClose", "theme", "type", "value", "values"];
848
+ const _excluded$1q = ["anchorToInput", "children", "chipsAlignment", "className", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClear", "onClose", "onFocus", "onInfiniteScroll", "onKeyDown", "placeholder", "placement", "selectedChipRender", "shouldFocusOnClose", "theme", "type", "value", "values"];
849
849
 
850
850
  /**
851
851
  * Defines the props of the component.
@@ -934,7 +934,7 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
934
934
  value,
935
935
  values = DEFAULT_PROPS$11.values
936
936
  } = otherProps,
937
- forwardedProps = _objectWithoutProperties(otherProps, _excluded$1p);
937
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1q);
938
938
  return /*#__PURE__*/React__default.createElement(Autocomplete, _extends({
939
939
  ref: ref
940
940
  }, forwardedProps, {
@@ -975,7 +975,7 @@ AutocompleteMultiple.displayName = COMPONENT_NAME$1l;
975
975
  AutocompleteMultiple.className = CLASSNAME$1i;
976
976
  AutocompleteMultiple.defaultProps = DEFAULT_PROPS$11;
977
977
 
978
- const _excluded$1o = ["actions", "alt", "badge", "className", "image", "linkProps", "linkAs", "onClick", "onKeyPress", "size", "theme", "thumbnailProps"];
978
+ const _excluded$1p = ["actions", "alt", "badge", "className", "image", "linkProps", "linkAs", "onClick", "onKeyPress", "size", "theme", "thumbnailProps"];
979
979
 
980
980
  /**
981
981
  * Avatar sizes.
@@ -1025,7 +1025,7 @@ const Avatar = forwardRef((props, ref) => {
1025
1025
  theme = defaultTheme,
1026
1026
  thumbnailProps
1027
1027
  } = props,
1028
- forwardedProps = _objectWithoutProperties(props, _excluded$1o);
1028
+ forwardedProps = _objectWithoutProperties(props, _excluded$1p);
1029
1029
  return /*#__PURE__*/React__default.createElement("div", _extends({
1030
1030
  ref: ref
1031
1031
  }, forwardedProps, {
@@ -1056,7 +1056,7 @@ Avatar.displayName = COMPONENT_NAME$1k;
1056
1056
  Avatar.className = CLASSNAME$1h;
1057
1057
  Avatar.defaultProps = DEFAULT_PROPS$10;
1058
1058
 
1059
- const _excluded$1n = ["children", "className", "color"];
1059
+ const _excluded$1o = ["children", "className", "color"];
1060
1060
 
1061
1061
  /**
1062
1062
  * Defines the props of the component.
@@ -1092,7 +1092,7 @@ const Badge = forwardRef((props, ref) => {
1092
1092
  className,
1093
1093
  color = DEFAULT_PROPS$$.color
1094
1094
  } = props,
1095
- forwardedProps = _objectWithoutProperties(props, _excluded$1n);
1095
+ forwardedProps = _objectWithoutProperties(props, _excluded$1o);
1096
1096
  return /*#__PURE__*/React__default.createElement("div", _extends({
1097
1097
  ref: ref
1098
1098
  }, forwardedProps, {
@@ -1106,7 +1106,7 @@ Badge.displayName = COMPONENT_NAME$1j;
1106
1106
  Badge.className = CLASSNAME$1g;
1107
1107
  Badge.defaultProps = DEFAULT_PROPS$$;
1108
1108
 
1109
- const _excluded$1m = ["badge", "children", "className"];
1109
+ const _excluded$1n = ["badge", "children", "className"];
1110
1110
  /**
1111
1111
  * Component display name.
1112
1112
  */
@@ -1122,7 +1122,7 @@ const BadgeWrapper = forwardRef((props, ref) => {
1122
1122
  children,
1123
1123
  className
1124
1124
  } = props,
1125
- forwardedProps = _objectWithoutProperties(props, _excluded$1m);
1125
+ forwardedProps = _objectWithoutProperties(props, _excluded$1n);
1126
1126
  return /*#__PURE__*/React__default.createElement("div", _extends({
1127
1127
  ref: ref
1128
1128
  }, forwardedProps, {
@@ -1178,7 +1178,7 @@ const VISUALLY_HIDDEN = 'visually-hidden';
1178
1178
  /** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
1179
1179
  const forwardRefPolymorphic = React__default.forwardRef;
1180
1180
 
1181
- const _excluded$1l = ["children", "onClick", "disabled", "isDisabled", "aria-disabled", "as"];
1181
+ const _excluded$1m = ["children", "onClick", "disabled", "isDisabled", "aria-disabled", "as"];
1182
1182
  /**
1183
1183
  * Render clickable element (link, button or custom element)
1184
1184
  * (also does some basic disabled state handling)
@@ -1192,7 +1192,7 @@ const RawClickable = forwardRefPolymorphic((props, ref) => {
1192
1192
  'aria-disabled': ariaDisabled,
1193
1193
  as
1194
1194
  } = props,
1195
- forwardedProps = _objectWithoutProperties(props, _excluded$1l);
1195
+ forwardedProps = _objectWithoutProperties(props, _excluded$1m);
1196
1196
  const isAnyDisabled = isDisabled || ariaDisabled === 'true' || ariaDisabled === true;
1197
1197
  const Component = as;
1198
1198
  let clickableProps;
@@ -1208,7 +1208,7 @@ const RawClickable = forwardRefPolymorphic((props, ref) => {
1208
1208
  }
1209
1209
  return /*#__PURE__*/React__default.createElement(Component, _extends({
1210
1210
  ref: ref,
1211
- "aria-disabled": isAnyDisabled
1211
+ "aria-disabled": isAnyDisabled || undefined
1212
1212
  }, forwardedProps, clickableProps, {
1213
1213
  onClick: event => {
1214
1214
  if (isAnyDisabled) {
@@ -1221,7 +1221,7 @@ const RawClickable = forwardRefPolymorphic((props, ref) => {
1221
1221
  }), children);
1222
1222
  });
1223
1223
 
1224
- const _excluded$1k = ["aria-label", "children", "className", "color", "emphasis", "hasBackground", "isSelected", "isActive", "isFocused", "isHovered", "linkAs", "size", "theme", "variant", "fullWidth"];
1224
+ const _excluded$1l = ["aria-label", "children", "className", "color", "emphasis", "hasBackground", "isSelected", "isActive", "isFocused", "isHovered", "linkAs", "size", "theme", "variant", "fullWidth"];
1225
1225
 
1226
1226
  /**
1227
1227
  * Button size definition.
@@ -1292,7 +1292,7 @@ const ButtonRoot = forwardRef((props, ref) => {
1292
1292
  variant,
1293
1293
  fullWidth
1294
1294
  } = otherProps,
1295
- forwardedProps = _objectWithoutProperties(otherProps, _excluded$1k);
1295
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1l);
1296
1296
  const adaptedColor = color || emphasis !== Emphasis.high && theme === Theme.dark && ColorPalette.light || emphasis === Emphasis.high && ColorPalette.primary || ColorPalette.dark;
1297
1297
  if (hasBackground) {
1298
1298
  return renderButtonWrapper(_objectSpread2(_objectSpread2({}, props), {}, {
@@ -1327,7 +1327,7 @@ const ButtonRoot = forwardRef((props, ref) => {
1327
1327
  ButtonRoot.displayName = COMPONENT_NAME$1h;
1328
1328
  ButtonRoot.defaultProps = {};
1329
1329
 
1330
- const _excluded$1j = ["children", "className", "emphasis", "leftIcon", "rightIcon", "size", "theme"];
1330
+ const _excluded$1k = ["children", "className", "emphasis", "leftIcon", "rightIcon", "size", "theme"];
1331
1331
 
1332
1332
  /**
1333
1333
  * Button emphasis definition.
@@ -1375,7 +1375,7 @@ const Button = forwardRef((props, ref) => {
1375
1375
  size = DEFAULT_PROPS$_.size,
1376
1376
  theme = defaultTheme
1377
1377
  } = props,
1378
- forwardedProps = _objectWithoutProperties(props, _excluded$1j);
1378
+ forwardedProps = _objectWithoutProperties(props, _excluded$1k);
1379
1379
  const buttonClassName = classNames(className, getBasicClass({
1380
1380
  prefix: CLASSNAME$1e,
1381
1381
  type: 'hasLeftIcon',
@@ -1414,7 +1414,7 @@ Button.displayName = COMPONENT_NAME$1g;
1414
1414
  Button.className = CLASSNAME$1e;
1415
1415
  Button.defaultProps = DEFAULT_PROPS$_;
1416
1416
 
1417
- const _excluded$1i = ["emphasis", "image", "icon", "label", "size", "theme", "tooltipProps", "hideTooltip"];
1417
+ const _excluded$1j = ["emphasis", "image", "icon", "label", "size", "theme", "tooltipProps", "hideTooltip"];
1418
1418
  /**
1419
1419
  * Component display name.
1420
1420
  */
@@ -1452,7 +1452,7 @@ const IconButton = forwardRef((props, ref) => {
1452
1452
  tooltipProps,
1453
1453
  hideTooltip
1454
1454
  } = props,
1455
- forwardedProps = _objectWithoutProperties(props, _excluded$1i);
1455
+ forwardedProps = _objectWithoutProperties(props, _excluded$1j);
1456
1456
  return /*#__PURE__*/React__default.createElement(Tooltip, _extends({
1457
1457
  label: hideTooltip ? '' : label
1458
1458
  }, tooltipProps), /*#__PURE__*/React__default.createElement(ButtonRoot, _extends({
@@ -1478,7 +1478,7 @@ IconButton.displayName = COMPONENT_NAME$1f;
1478
1478
  IconButton.className = CLASSNAME$1d;
1479
1479
  IconButton.defaultProps = DEFAULT_PROPS$Z;
1480
1480
 
1481
- const _excluded$1h = ["children", "className"];
1481
+ const _excluded$1i = ["children", "className"];
1482
1482
 
1483
1483
  /**
1484
1484
  * Defines the props of the component
@@ -1511,7 +1511,7 @@ const ButtonGroup = forwardRef((props, ref) => {
1511
1511
  children,
1512
1512
  className
1513
1513
  } = props,
1514
- forwardedProps = _objectWithoutProperties(props, _excluded$1h);
1514
+ forwardedProps = _objectWithoutProperties(props, _excluded$1i);
1515
1515
  return /*#__PURE__*/React__default.createElement("div", _extends({
1516
1516
  ref: ref
1517
1517
  }, forwardedProps, {
@@ -1522,7 +1522,7 @@ ButtonGroup.displayName = COMPONENT_NAME$1e;
1522
1522
  ButtonGroup.className = CLASSNAME$1c;
1523
1523
  ButtonGroup.defaultProps = DEFAULT_PROPS$Y;
1524
1524
 
1525
- const _excluded$1g = ["checked", "className", "helper", "id", "inputRef", "isChecked", "label", "name", "onChange", "theme", "value", "inputProps"];
1525
+ const _excluded$1h = ["checked", "className", "helper", "id", "inputRef", "isChecked", "label", "name", "onChange", "theme", "value", "inputProps"];
1526
1526
  /**
1527
1527
  * Intermediate state of checkbox.
1528
1528
  */
@@ -1575,7 +1575,7 @@ const Checkbox = forwardRef((props, ref) => {
1575
1575
  value,
1576
1576
  inputProps = {}
1577
1577
  } = otherProps,
1578
- forwardedProps = _objectWithoutProperties(otherProps, _excluded$1g);
1578
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1h);
1579
1579
  const localInputRef = React__default.useRef(null);
1580
1580
  const generatedInputId = useId();
1581
1581
  const inputId = id || generatedInputId;
@@ -1685,6 +1685,21 @@ function onEscapePressed(handler) {
1685
1685
  };
1686
1686
  }
1687
1687
 
1688
+ /**
1689
+ * Handle button key pressed (Enter + Space).
1690
+ *
1691
+ * @param handler The handler to call.
1692
+ * @return The decorated function.
1693
+ */
1694
+ function onButtonPressed(handler) {
1695
+ return evt => {
1696
+ if (evt.key !== 'Enter' && evt.key !== ' ') {
1697
+ return;
1698
+ }
1699
+ handler(evt);
1700
+ };
1701
+ }
1702
+
1688
1703
  /**
1689
1704
  * Checks whether or not the browser support passive events.
1690
1705
  * @see https://github.com/Modernizr/Modernizr/blob/6d56d814b9682843313b16060adb25a58d83a317/feature-detects/dom/passiveeventlisteners.js
@@ -1766,7 +1781,7 @@ function detectHorizontalSwipe(touchSurface, handleSwipe) {
1766
1781
  };
1767
1782
  }
1768
1783
 
1769
- const _excluded$1f = ["after", "before", "children", "className", "color", "isClickable", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href", "onKeyDown"];
1784
+ const _excluded$1g = ["after", "before", "children", "className", "color", "isClickable", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href", "onKeyDown"];
1770
1785
 
1771
1786
  /**
1772
1787
  * Chip sizes.
@@ -1824,7 +1839,7 @@ const Chip = forwardRef((props, ref) => {
1824
1839
  href,
1825
1840
  onKeyDown
1826
1841
  } = otherProps,
1827
- forwardedProps = _objectWithoutProperties(otherProps, _excluded$1f);
1842
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1g);
1828
1843
  const hasAfterClick = isFunction(onAfterClick);
1829
1844
  const hasBeforeClick = isFunction(onBeforeClick);
1830
1845
  const hasOnClick = isFunction(props.onClick);
@@ -1941,7 +1956,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
1941
1956
  };
1942
1957
  };
1943
1958
 
1944
- const _excluded$1e = ["align", "children", "className"];
1959
+ const _excluded$1f = ["align", "children", "className"];
1945
1960
 
1946
1961
  /**
1947
1962
  * Defines the props of the component.
@@ -1975,7 +1990,7 @@ const InternalChipGroup = forwardRef((props, ref) => {
1975
1990
  children,
1976
1991
  className
1977
1992
  } = props,
1978
- forwardedProps = _objectWithoutProperties(props, _excluded$1e);
1993
+ forwardedProps = _objectWithoutProperties(props, _excluded$1f);
1979
1994
  return /*#__PURE__*/React__default.createElement("div", _extends({
1980
1995
  ref: ref
1981
1996
  }, forwardedProps, {
@@ -1989,7 +2004,7 @@ const ChipGroup = Object.assign(InternalChipGroup, {
1989
2004
  useChipGroupNavigation
1990
2005
  });
1991
2006
 
1992
- const _excluded$1d = ["actions", "avatarProps", "children", "className", "date", "fullDate", "hasActions", "headerActions", "isOpen", "isRelevant", "name", "onClick", "onMouseEnter", "onMouseLeave", "text", "theme", "variant"];
2007
+ const _excluded$1e = ["actions", "avatarProps", "children", "className", "date", "fullDate", "hasActions", "headerActions", "isOpen", "isRelevant", "name", "onClick", "onMouseEnter", "onMouseLeave", "text", "theme", "variant"];
1993
2008
  /**
1994
2009
  * Comment block variants.
1995
2010
  */
@@ -2047,7 +2062,7 @@ const CommentBlock = forwardRef((props, ref) => {
2047
2062
  theme = defaultTheme,
2048
2063
  variant = DEFAULT_PROPS$U.variant
2049
2064
  } = props,
2050
- forwardedProps = _objectWithoutProperties(props, _excluded$1d);
2065
+ forwardedProps = _objectWithoutProperties(props, _excluded$1e);
2051
2066
  const hasChildren = Children.count(children) > 0;
2052
2067
  return /*#__PURE__*/React__default.createElement("div", _extends({
2053
2068
  ref: ref,
@@ -2535,7 +2550,7 @@ const DatePickerControlled = forwardRef((props, ref) => {
2535
2550
  DatePickerControlled.displayName = COMPONENT_NAME$18;
2536
2551
  DatePickerControlled.className = CLASSNAME$17;
2537
2552
 
2538
- const _excluded$1c = ["defaultMonth", "locale", "value", "onChange"];
2553
+ const _excluded$1d = ["defaultMonth", "locale", "value", "onChange"];
2539
2554
  /**
2540
2555
  * DatePicker component.
2541
2556
  *
@@ -2550,7 +2565,7 @@ const DatePicker = forwardRef((props, ref) => {
2550
2565
  value,
2551
2566
  onChange
2552
2567
  } = props,
2553
- forwardedProps = _objectWithoutProperties(props, _excluded$1c);
2568
+ forwardedProps = _objectWithoutProperties(props, _excluded$1d);
2554
2569
  let referenceDate = value || defaultMonth || new Date();
2555
2570
  if (!isDateValid(referenceDate)) {
2556
2571
  // eslint-disable-next-line no-console
@@ -2587,7 +2602,7 @@ const useBooleanState = defaultValue => {
2587
2602
  return [booleanValue, setToFalse, setToTrue, toggleBoolean];
2588
2603
  };
2589
2604
 
2590
- const _excluded$1b = ["defaultMonth", "locale", "maxDate", "minDate", "name", "nextButtonProps", "onChange", "previousButtonProps", "value"];
2605
+ const _excluded$1c = ["defaultMonth", "locale", "maxDate", "minDate", "name", "nextButtonProps", "onChange", "previousButtonProps", "value"];
2591
2606
 
2592
2607
  /**
2593
2608
  * Defines the props of the component.
@@ -2621,7 +2636,7 @@ const DatePickerField = forwardRef((props, ref) => {
2621
2636
  previousButtonProps,
2622
2637
  value
2623
2638
  } = otherProps,
2624
- forwardedProps = _objectWithoutProperties(otherProps, _excluded$1b);
2639
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1c);
2625
2640
  const anchorRef = useRef(null);
2626
2641
  const [isOpen, close,, toggleOpen] = useBooleanState(false);
2627
2642
  const handleKeyboardNav = useCallback(evt => {
@@ -3166,7 +3181,7 @@ const useTransitionVisibility = (ref, isComponentVisible, timeout, onVisibilityC
3166
3181
  return isVisible || isComponentVisible;
3167
3182
  };
3168
3183
 
3169
- const _excluded$1a = ["children", "className", "header", "focusElement", "forceFooterDivider", "forceHeaderDivider", "footer", "isLoading", "isOpen", "onClose", "parentElement", "contentRef", "preventAutoClose", "size", "zIndex", "dialogProps", "onVisibilityChange", "disableBodyScroll", "preventCloseOnClick", "preventCloseOnEscape"];
3184
+ const _excluded$1b = ["children", "className", "header", "focusElement", "forceFooterDivider", "forceHeaderDivider", "footer", "isLoading", "isOpen", "onClose", "parentElement", "contentRef", "preventAutoClose", "size", "zIndex", "dialogProps", "onVisibilityChange", "disableBodyScroll", "preventCloseOnClick", "preventCloseOnEscape"];
3170
3185
 
3171
3186
  /**
3172
3187
  * Defines the props of the component.
@@ -3228,7 +3243,7 @@ const Dialog = forwardRef((props, ref) => {
3228
3243
  preventCloseOnClick,
3229
3244
  preventCloseOnEscape
3230
3245
  } = props,
3231
- forwardedProps = _objectWithoutProperties(props, _excluded$1a);
3246
+ forwardedProps = _objectWithoutProperties(props, _excluded$1b);
3232
3247
 
3233
3248
  // eslint-disable-next-line react-hooks/rules-of-hooks
3234
3249
  const previousOpen = React__default.useRef(isOpen);
@@ -3344,7 +3359,7 @@ Dialog.displayName = COMPONENT_NAME$16;
3344
3359
  Dialog.className = CLASSNAME$16;
3345
3360
  Dialog.defaultProps = DEFAULT_PROPS$T;
3346
3361
 
3347
- const _excluded$19 = ["className", "theme"];
3362
+ const _excluded$1a = ["className", "theme"];
3348
3363
 
3349
3364
  /**
3350
3365
  * Defines the props of the component.
@@ -3378,7 +3393,7 @@ const Divider = forwardRef((props, ref) => {
3378
3393
  className,
3379
3394
  theme = defaultTheme
3380
3395
  } = props,
3381
- forwardedProps = _objectWithoutProperties(props, _excluded$19);
3396
+ forwardedProps = _objectWithoutProperties(props, _excluded$1a);
3382
3397
  return /*#__PURE__*/React__default.createElement("hr", _extends({
3383
3398
  ref: ref
3384
3399
  }, forwardedProps, {
@@ -3392,7 +3407,7 @@ Divider.displayName = COMPONENT_NAME$15;
3392
3407
  Divider.className = CLASSNAME$15;
3393
3408
  Divider.defaultProps = DEFAULT_PROPS$S;
3394
3409
 
3395
- const _excluded$18 = ["className", "theme"];
3410
+ const _excluded$19 = ["className", "theme"];
3396
3411
 
3397
3412
  /**
3398
3413
  * Defines the props of the component.
@@ -3421,7 +3436,7 @@ const DragHandle = forwardRef((props, ref) => {
3421
3436
  className,
3422
3437
  theme = defaultTheme
3423
3438
  } = props,
3424
- forwardedProps = _objectWithoutProperties(props, _excluded$18);
3439
+ forwardedProps = _objectWithoutProperties(props, _excluded$19);
3425
3440
  return /*#__PURE__*/React__default.createElement("div", _extends({
3426
3441
  ref: ref
3427
3442
  }, forwardedProps, {
@@ -3602,6 +3617,24 @@ const useKeyboardListNavigation = (items, ref, onListItemSelected, onListItemNav
3602
3617
  };
3603
3618
  };
3604
3619
 
3620
+ const _excluded$18 = ["linkAs"];
3621
+ /**
3622
+ * Render link with default <a> HTML component or a custom one provided by `linkAs`.
3623
+ *
3624
+ * Can be used to inject the `Link` component from `react-router` and provide better a11y on LumX components.
3625
+ *
3626
+ * @param linkAs Custom link component.
3627
+ * @param children Link children.
3628
+ * @return A link.
3629
+ */
3630
+ const renderLink = (_ref, ...children) => {
3631
+ let {
3632
+ linkAs
3633
+ } = _ref,
3634
+ forwardedProps = _objectWithoutProperties(_ref, _excluded$18);
3635
+ return /*#__PURE__*/React__default.createElement(linkAs || 'a', forwardedProps, ...children);
3636
+ };
3637
+
3605
3638
  const _excluded$17 = ["after", "before", "children", "className", "isHighlighted", "isSelected", "linkAs", "linkProps", "linkRef", "onItemSelected", "size"];
3606
3639
 
3607
3640
  /**
@@ -3663,6 +3696,12 @@ const ListItem = forwardRef((props, ref) => {
3663
3696
  size = DEFAULT_PROPS$R.size
3664
3697
  } = otherProps,
3665
3698
  forwardedProps = _objectWithoutProperties(otherProps, _excluded$17);
3699
+ const role = linkAs || linkProps.href ? 'link' : 'button';
3700
+ const onKeyDown = useMemo(() => {
3701
+ if (onItemSelected && role === 'link') return onEnterPressed(onItemSelected);
3702
+ if (onItemSelected && role === 'button') return onButtonPressed(onItemSelected);
3703
+ return undefined;
3704
+ }, [role, onItemSelected]);
3666
3705
  const content = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, before && /*#__PURE__*/React__default.createElement("div", {
3667
3706
  className: `${CLASSNAME$13}__before`
3668
3707
  }, before), /*#__PURE__*/React__default.createElement("div", {
@@ -3680,21 +3719,24 @@ const ListItem = forwardRef((props, ref) => {
3680
3719
  }), isClickable({
3681
3720
  linkProps,
3682
3721
  onItemSelected
3683
- }) ?
3684
- /*#__PURE__*/
3685
- /* Clickable list item */
3686
- React__default.createElement(RawClickable, _extends({
3687
- as: linkAs || (linkProps.href ? 'a' : 'button')
3688
- }, linkProps, disabledStateProps, {
3722
+ }) ? (/* Clickable list item */
3723
+ renderLink(_objectSpread2(_objectSpread2({
3724
+ linkAs,
3725
+ tabIndex: !disabledStateProps.disabled ? 0 : undefined,
3726
+ role,
3727
+ 'aria-disabled': isAnyDisabled
3728
+ }, linkProps), {}, {
3729
+ href: isAnyDisabled ? undefined : linkProps.href,
3689
3730
  className: classNames(handleBasicClasses({
3690
3731
  prefix: `${CLASSNAME$13}__link`,
3691
3732
  isHighlighted,
3692
3733
  isSelected,
3693
3734
  isDisabled: isAnyDisabled
3694
3735
  })),
3695
- onClick: onItemSelected,
3736
+ onClick: isAnyDisabled ? undefined : onItemSelected,
3737
+ onKeyDown: isAnyDisabled ? undefined : onKeyDown,
3696
3738
  ref: linkRef
3697
- }), content) :
3739
+ }), content)) :
3698
3740
  /*#__PURE__*/
3699
3741
  /* Non clickable list item */
3700
3742
  React__default.createElement("div", {
@@ -13697,8 +13739,8 @@ const Thumbnail = forwardRef((props, ref) => {
13697
13739
  // Remove the image on custom fallback.
13698
13740
  imageErrorStyle.display = 'none';
13699
13741
  }
13700
- const isLink = (linkProps === null || linkProps === void 0 ? void 0 : linkProps.href) || linkAs;
13701
- const isClickable = !isAnyDisabled && (isLink || forwardedProps.onClick);
13742
+ const isLink = Boolean((linkProps === null || linkProps === void 0 ? void 0 : linkProps.href) || linkAs);
13743
+ const isClickable = !isAnyDisabled && Boolean(isLink || !!forwardedProps.onClick);
13702
13744
  const Wrapper = isClickable ? RawClickable : 'div';
13703
13745
  const wrapperProps = _objectSpread2({}, forwardedProps);
13704
13746
  if (isClickable) {
@@ -13707,8 +13749,9 @@ const Thumbnail = forwardRef((props, ref) => {
13707
13749
  }, disabledStateProps);
13708
13750
  if (isLink) {
13709
13751
  Object.assign(wrapperProps, linkProps);
13752
+ } else {
13753
+ wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
13710
13754
  }
13711
- wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
13712
13755
  }
13713
13756
 
13714
13757
  // If we have a loading placeholder image that is really loaded (complete)