@royaloperahouse/harmonic 1.0.7-b → 1.0.8-a

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [Proposed: 1.0.8]
2
+ - CastFilter: fix VoiceOver selection semantics and option activation (desktop/iOS).
3
+ - CastFilter: add stable id-based selection support (`selectedIds`, `onSelectId`, `onApplyIds`) with backward compatibility for legacy index-based API.
4
+ - ModalWindow: add `closeButtonAriaLabel` and set close icon `aria-hidden="true"`.
5
+
6
+ ## [1.0.7]
7
+ - CustomStrategyTabsFilter:
8
+ - Added an accessible group label and complete keyboard button behaviour
9
+ - Preserved focus across controlled selection updates
10
+ - Prevented strategy metadata from reaching the DOM
11
+ - Restricted hover-only styling to devices that support hover
12
+
1
13
  ## [1.0.6]
2
14
  - Harmonic :
3
15
  - Added new CustomStrategy filter
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import { TCustomStrategyTabsFilterProps } from '../../../types';
2
+ import type { TCustomStrategyTabsFilterProps } from '../../../types';
3
3
  /**
4
+ * A controlled filter button group that supports single- and multi-select strategies.
5
+ * The consumer owns the selection state and receives the complete clicked item.
4
6
  * A horizontally scrollable tabs filter component used to display
5
7
  * selectable strategy tabs with configurable styling and selection behavior.
6
8
  *
@@ -66,5 +68,5 @@ import { TCustomStrategyTabsFilterProps } from '../../../types';
66
68
  * *
67
69
  * * return <CustomStrategyTabsFilter items={items} onClick={handleClick} />;
68
70
  */
69
- declare const CustomStrategyTabsFilter: ({ items, className, onClick, customViewConfig, }: TCustomStrategyTabsFilterProps) => React.JSX.Element;
71
+ declare const CustomStrategyTabsFilter: ({ items, className, ariaLabel, onClick, customViewConfig, }: TCustomStrategyTabsFilterProps) => React.JSX.Element;
70
72
  export default CustomStrategyTabsFilter;
@@ -7406,10 +7406,12 @@ var HotFilters = function HotFilters(_ref) {
7406
7406
  var _templateObject$P, _templateObject2$C, _templateObject3$p;
7407
7407
  var ScrollContainer = /*#__PURE__*/styled__default.div(_templateObject$P || (_templateObject$P = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: scroll;\n\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n ::-webkit-scrollbar {\n display: none;\n }\n\n @media ", " {\n overflow-x: visible;\n }\n"])), devices.mobile);
7408
7408
  var TabsContainerWrapper = /*#__PURE__*/styled__default.div(_templateObject2$C || (_templateObject2$C = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n width: fit-content;\n min-width: 400px;\n justify-content: space-between;\n gap: 16px;\n font-family: var(--font-family-sans);\n\n @media ", " {\n width: 100%;\n min-width: 0;\n flex-wrap: wrap;\n justify-content: flex-start;\n gap: 10px;\n }\n"])), devices.mobile);
7409
- var StyledTab = /*#__PURE__*/styled__default(PrimaryButton)(_templateObject3$p || (_templateObject3$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 1px solid var(--color-base-black);\n min-width: fit-content;\n\n :hover {\n color: var(--color-base-white);\n }\n\n @media ", " {\n width: auto !important;\n min-width: fit-content;\n flex: 0 0 auto;\n }\n"])), devices.mobile);
7409
+ var StyledTab = /*#__PURE__*/styled__default(PrimaryButton)(_templateObject3$p || (_templateObject3$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 1px solid var(--color-base-black);\n min-width: fit-content;\n\n &:focus-visible {\n outline: 2px solid var(--color-base-black);\n outline-offset: 2px;\n }\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n color: var(--color-base-white);\n }\n }\n\n @media ", " {\n width: auto !important;\n min-width: fit-content;\n flex: 0 0 auto;\n }\n"])), devices.mobile);
7410
7410
 
7411
- var _excluded$j = ["text", "id", "isSelected"];
7411
+ var _excluded$j = ["text", "id", "isSelected", "allowedSelectedWith"];
7412
7412
  /**
7413
+ * A controlled filter button group that supports single- and multi-select strategies.
7414
+ * The consumer owns the selection state and receives the complete clicked item.
7413
7415
  * A horizontally scrollable tabs filter component used to display
7414
7416
  * selectable strategy tabs with configurable styling and selection behavior.
7415
7417
  *
@@ -7479,11 +7481,17 @@ var CustomStrategyTabsFilter = function CustomStrategyTabsFilter(_ref) {
7479
7481
  var _customViewConfig$bac, _customViewConfig$bac2, _customViewConfig$tex, _customViewConfig$tex2;
7480
7482
  var items = _ref.items,
7481
7483
  className = _ref.className,
7484
+ ariaLabel = _ref.ariaLabel,
7482
7485
  onClick = _ref.onClick,
7483
7486
  customViewConfig = _ref.customViewConfig;
7484
7487
  var handleClick = React__default.useCallback(function (item) {
7485
7488
  onClick(item);
7486
7489
  }, [onClick]);
7490
+ var handleKeyDown = React__default.useCallback(function (event, item) {
7491
+ if (event.key !== ' ' && event.key !== 'Spacebar') return;
7492
+ event.preventDefault();
7493
+ if (!event.repeat) handleClick(item);
7494
+ }, [handleClick]);
7487
7495
  // in case of any partially passed configuration, config defaults non defined
7488
7496
  var config = {
7489
7497
  selectIcon: (customViewConfig == null ? void 0 : customViewConfig.selectIcon) || 'Confirm',
@@ -7499,7 +7507,9 @@ var CustomStrategyTabsFilter = function CustomStrategyTabsFilter(_ref) {
7499
7507
  pressedColor: (customViewConfig == null ? void 0 : customViewConfig.pressedColor) || 'black-pressed'
7500
7508
  };
7501
7509
  return /*#__PURE__*/React__default.createElement(ScrollContainer, {
7502
- className: className
7510
+ "aria-label": ariaLabel,
7511
+ className: className,
7512
+ role: "group"
7503
7513
  }, /*#__PURE__*/React__default.createElement(TabsContainerWrapper, null, items.map(function (item) {
7504
7514
  var text = item.text,
7505
7515
  id = item.id,
@@ -7510,6 +7520,9 @@ var CustomStrategyTabsFilter = function CustomStrategyTabsFilter(_ref) {
7510
7520
  onClick: function onClick() {
7511
7521
  return handleClick(item);
7512
7522
  },
7523
+ onKeyDown: function onKeyDown(event) {
7524
+ return handleKeyDown(event, item);
7525
+ },
7513
7526
  iconName: isSelected ? config.selectIcon : undefined,
7514
7527
  backgroundColor: isSelected ? config.backgroundColor.select : config.backgroundColor.unselect,
7515
7528
  textColor: isSelected ? config.textColor.select : config.textColor.unselect,