@royaloperahouse/harmonic 1.0.5-d → 1.0.5-f

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,7 @@
1
+ ## [1.0.5-e]
2
+ - PrimaryButton hover only for device detected hover functionality
3
+
4
+
1
5
  ## [1.0.5-c]
2
6
  - Harmonic :
3
7
  - Added new CustomStrategy filter
@@ -8,6 +12,8 @@
8
12
  - CastFilter: prevent duplicate screen reader announcements for actor images and ensure tapping an actor image ring toggles selection.
9
13
 
10
14
  ## [Proposed: 1.0.4]
15
+
16
+ ## [1.0.4]
11
17
  - Castfilter: fix NDVA issues
12
18
 
13
19
  ## [1.0.3]
@@ -1,4 +1,4 @@
1
- import { FunctionComponent } from 'react';
1
+ import React from 'react';
2
2
  import { TCustomStrategyTabsFilterProps } from '../../../types';
3
3
  /**
4
4
  * A horizontally scrollable tabs filter component used to display
@@ -20,7 +20,10 @@ import { TCustomStrategyTabsFilterProps } from '../../../types';
20
20
  * Optional CSS class name applied to the root scroll container.
21
21
  *
22
22
  * @param {<T>(item: TCustomStrategyTabsFilterProps['items'][number]) => T} onClick
23
- * Generic callback invoked when a tab is clicked.
23
+ * Called when a tab is clicked. Receives the full clicked item (including
24
+ * `allowedSelectedWith`). The parent is responsible for computing the next
25
+ * `items` array and passing it back down with updated `isSelected` values.
26
+ * as long as no return statement `type` is inferred automatically as void
24
27
  *
25
28
  * @param [customViewConfig]
26
29
  * Optional visual configuration used to customize:
@@ -36,42 +39,32 @@ import { TCustomStrategyTabsFilterProps } from '../../../types';
36
39
  *
37
40
  * @example
38
41
  * ```tsx
39
- * <CustomStrategyTabsFilter
40
- * items={[
41
- * {
42
- * id: 'all',
43
- * text: 'All',
44
- * isSelected: true,
45
- * allowedSelectedWith: [],
46
- * },
47
- * {
48
- * id: 'open',
49
- * text: 'Open',
50
- * isSelected: false,
51
- * },
52
- * ]}
53
- * onClick={(item) => console.log(item)}
54
- * />
55
- * ```
56
- *
57
- * @example
58
- * ```tsx
59
- * <CustomStrategyTabsFilter
60
- * items={items}
61
- * onClick={handleFilterClick}
62
- * customViewConfig={{
63
- * selectIcon: 'Check',
64
- * backgroundColor: {
65
- * select: 'primary',
66
- * unselect: 'base-white',
67
- * },
68
- * textColor: {
69
- * select: 'base-white',
70
- * unselect: 'base-black',
71
- * },
72
- * }}
73
- * />
74
- * ```
42
+ * * @example Controlled selection with custom rules
43
+ * * The component does not manage selection itself. The parent owns `items` (including
44
+ * * `isSelected`) and updates that state in `onClick`. Use `allowedSelectedWith` on each
45
+ * * item to describe which other tab IDs may stay selected when that tab is chosen.
46
+ * *
47
+ * * ```tsx
48
+ * * const [items, setItems] = useState<TCustomStrategyTabsFilterItem[]>([
49
+ * * { id: 'all', text: 'All events', isSelected: true, allowedSelectedWith: [] },
50
+ * * { id: 'opera', text: 'Opera', isSelected: false, allowedSelectedWith: ['ballet'] },
51
+ * * { id: 'ballet', text: 'Ballet', isSelected: false, allowedSelectedWith: ['opera'] },
52
+ * * ]);
53
+ * *
54
+ * * const handleClick = (clickedItem: TCustomStrategyTabsFilterItem) => {
55
+ * * setItems((current) =>
56
+ * * current.map((item) => {
57
+ * * if (item.id === clickedItem.id) {
58
+ * * return { ...item, isSelected: !item.isSelected };
59
+ * * }
60
+ * *
61
+ * * const mayStaySelected = clickedItem.allowedSelectedWith?.includes(item.id);
62
+ * * return { ...item, isSelected: mayStaySelected ? !item.isSelected : false };
63
+ * * })
64
+ * * );
65
+ * * };
66
+ * *
67
+ * * return <CustomStrategyTabsFilter items={items} onClick={handleClick} />;
75
68
  */
76
- declare const CustomStrategyTabsFilter: FunctionComponent<TCustomStrategyTabsFilterProps>;
69
+ declare const CustomStrategyTabsFilter: ({ items, className, onClick, customViewConfig, }: TCustomStrategyTabsFilterProps) => React.JSX.Element;
77
70
  export default CustomStrategyTabsFilter;
@@ -1,6 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { ICarouselProps } from '../../../../types/carousel';
3
- declare const Carousel: FunctionComponent<ICarouselProps & Partial<{
4
- titleFontFamily: 'Victor' | 'Grey' | undefined;
5
- }>>;
3
+ declare const Carousel: FunctionComponent<ICarouselProps>;
6
4
  export default Carousel;
@@ -1,6 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { IHighlightsCarouselProps } from '../../../../types/carousel';
3
- declare const HighlightsCarousel: FunctionComponent<IHighlightsCarouselProps & Partial<{
4
- titleFontFamily: 'Victor' | 'Grey' | undefined;
5
- }>>;
3
+ declare const HighlightsCarousel: FunctionComponent<IHighlightsCarouselProps>;
6
4
  export default HighlightsCarousel;
@@ -3072,7 +3072,7 @@ var getPressedColor = function getPressedColor(_ref4) {
3072
3072
  };
3073
3073
 
3074
3074
  var _templateObject$6, _templateObject2$3;
3075
- var PrimaryButtonWrapper = /*#__PURE__*/styled__default(Button)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n pointer-events: ", ";\n\n path {\n fill: ", ";\n }\n\n :hover:not(:active) {\n background-color: ", ";\n border-color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n :active {\n background-color: ", ";\n border-color: ", ";\n\n path {\n fill: ", ";\n }\n }\n"])), getTextColor$1, getBackgroundColor$1, getBackgroundColor$1, getPointerEvents, getTextColor$1, getHoveredColor, getHoveredColor, getTextColor$1, getPressedColor, getPressedColor, getTextColor$1);
3075
+ var PrimaryButtonWrapper = /*#__PURE__*/styled__default(Button)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n pointer-events: ", ";\n\n path {\n fill: ", ";\n }\n\n @media (hover: hover) and (pointer: fine) {\n :hover:not(:active) {\n background-color: ", ";\n border-color: ", ";\n\n path {\n fill: ", ";\n }\n }\n }\n\n :active {\n background-color: ", ";\n border-color: ", ";\n\n path {\n fill: ", ";\n }\n }\n"])), getTextColor$1, getBackgroundColor$1, getBackgroundColor$1, getPointerEvents, getTextColor$1, getHoveredColor, getHoveredColor, getTextColor$1, getPressedColor, getPressedColor, getTextColor$1);
3076
3076
  var AriaDescription = /*#__PURE__*/styled__default.span(_templateObject2$3 || (_templateObject2$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n"])));
3077
3077
 
3078
3078
  var _excluded$4 = ["children", "disabled", "className"];
@@ -7323,7 +7323,7 @@ var Editorial = function Editorial(_ref) {
7323
7323
  var _templateObject$O, _templateObject2$B, _templateObject3$o;
7324
7324
  var HotFiltersWrapper = /*#__PURE__*/styled__default.div(_templateObject$O || (_templateObject$O = /*#__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"])));
7325
7325
  var HotFilterOptionsWrapper = /*#__PURE__*/styled__default.div(_templateObject2$B || (_templateObject2$B = /*#__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 gap: 10px;\n }\n"])), devices.mobile);
7326
- var StyledHotFiltersButton = /*#__PURE__*/styled__default(PrimaryButton)(_templateObject3$o || (_templateObject3$o = /*#__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"])));
7326
+ var StyledHotFiltersButton = /*#__PURE__*/styled__default(PrimaryButton)(_templateObject3$o || (_templateObject3$o = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 1px solid var(--color-base-black);\n min-width: fit-content;\n\n @media (hover: hover) and (pointer: fine) {\n :hover {\n color: var(--color-base-white);\n }\n }\n"])));
7327
7327
 
7328
7328
  var _excluded$i = ["text", "onClick"];
7329
7329
  var HotFilters = function HotFilters(_ref) {
@@ -7384,7 +7384,10 @@ var _excluded$j = ["text", "id", "isSelected"];
7384
7384
  * Optional CSS class name applied to the root scroll container.
7385
7385
  *
7386
7386
  * @param {<T>(item: TCustomStrategyTabsFilterProps['items'][number]) => T} onClick
7387
- * Generic callback invoked when a tab is clicked.
7387
+ * Called when a tab is clicked. Receives the full clicked item (including
7388
+ * `allowedSelectedWith`). The parent is responsible for computing the next
7389
+ * `items` array and passing it back down with updated `isSelected` values.
7390
+ * as long as no return statement `type` is inferred automatically as void
7388
7391
  *
7389
7392
  * @param [customViewConfig]
7390
7393
  * Optional visual configuration used to customize:
@@ -7400,42 +7403,32 @@ var _excluded$j = ["text", "id", "isSelected"];
7400
7403
  *
7401
7404
  * @example
7402
7405
  * ```tsx
7403
- * <CustomStrategyTabsFilter
7404
- * items={[
7405
- * {
7406
- * id: 'all',
7407
- * text: 'All',
7408
- * isSelected: true,
7409
- * allowedSelectedWith: [],
7410
- * },
7411
- * {
7412
- * id: 'open',
7413
- * text: 'Open',
7414
- * isSelected: false,
7415
- * },
7416
- * ]}
7417
- * onClick={(item) => console.log(item)}
7418
- * />
7419
- * ```
7420
- *
7421
- * @example
7422
- * ```tsx
7423
- * <CustomStrategyTabsFilter
7424
- * items={items}
7425
- * onClick={handleFilterClick}
7426
- * customViewConfig={{
7427
- * selectIcon: 'Check',
7428
- * backgroundColor: {
7429
- * select: 'primary',
7430
- * unselect: 'base-white',
7431
- * },
7432
- * textColor: {
7433
- * select: 'base-white',
7434
- * unselect: 'base-black',
7435
- * },
7436
- * }}
7437
- * />
7438
- * ```
7406
+ * * @example Controlled selection with custom rules
7407
+ * * The component does not manage selection itself. The parent owns `items` (including
7408
+ * * `isSelected`) and updates that state in `onClick`. Use `allowedSelectedWith` on each
7409
+ * * item to describe which other tab IDs may stay selected when that tab is chosen.
7410
+ * *
7411
+ * * ```tsx
7412
+ * * const [items, setItems] = useState<TCustomStrategyTabsFilterItem[]>([
7413
+ * * { id: 'all', text: 'All events', isSelected: true, allowedSelectedWith: [] },
7414
+ * * { id: 'opera', text: 'Opera', isSelected: false, allowedSelectedWith: ['ballet'] },
7415
+ * * { id: 'ballet', text: 'Ballet', isSelected: false, allowedSelectedWith: ['opera'] },
7416
+ * * ]);
7417
+ * *
7418
+ * * const handleClick = (clickedItem: TCustomStrategyTabsFilterItem) => {
7419
+ * * setItems((current) =>
7420
+ * * current.map((item) => {
7421
+ * * if (item.id === clickedItem.id) {
7422
+ * * return { ...item, isSelected: !item.isSelected };
7423
+ * * }
7424
+ * *
7425
+ * * const mayStaySelected = clickedItem.allowedSelectedWith?.includes(item.id);
7426
+ * * return { ...item, isSelected: mayStaySelected ? !item.isSelected : false };
7427
+ * * })
7428
+ * * );
7429
+ * * };
7430
+ * *
7431
+ * * return <CustomStrategyTabsFilter items={items} onClick={handleClick} />;
7439
7432
  */
7440
7433
  var CustomStrategyTabsFilter = function CustomStrategyTabsFilter(_ref) {
7441
7434
  var _customViewConfig$bac, _customViewConfig$bac2, _customViewConfig$tex, _customViewConfig$tex2;