@royaloperahouse/harmonic 0.8.0-a → 0.8.0-b

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.
@@ -8810,14 +8810,13 @@ var _excluded$k = ["text", "onClick"];
8810
8810
  var HotFilters = function HotFilters(_ref) {
8811
8811
  var items = _ref.items,
8812
8812
  className = _ref.className,
8813
- defaultSelectedIndex = _ref.defaultSelectedIndex;
8814
- var _useState = React.useState(defaultSelectedIndex != null ? defaultSelectedIndex : 0),
8815
- selectedIndex = _useState[0],
8816
- setSelectedIndex = _useState[1];
8817
- var handleClick = function handleClick(index, onClick) {
8818
- setSelectedIndex(index);
8813
+ _ref$selectedIndex = _ref.selectedIndex,
8814
+ selectedIndex = _ref$selectedIndex === void 0 ? 0 : _ref$selectedIndex,
8815
+ onSelect = _ref.onSelect;
8816
+ var handleClick = React__default.useCallback(function (index, onClick) {
8817
+ if (onSelect) onSelect(index);
8819
8818
  if (onClick) onClick();
8820
- };
8819
+ }, [onSelect]);
8821
8820
  return /*#__PURE__*/React__default.createElement(HotFiltersWrapper, {
8822
8821
  className: className
8823
8822
  }, /*#__PURE__*/React__default.createElement(HotFilterOptionsWrapper, null, items.map(function (item, index) {
@@ -8834,7 +8833,8 @@ var HotFilters = function HotFilters(_ref) {
8834
8833
  backgroundColor: isSelected ? 'base-black' : 'base-white',
8835
8834
  textColor: isSelected ? 'base-white' : 'base-black',
8836
8835
  hoveredColor: "base-black",
8837
- pressedColor: "black-pressed"
8836
+ pressedColor: "black-pressed",
8837
+ "aria-pressed": isSelected
8838
8838
  }, rest), text);
8839
8839
  })));
8840
8840
  };