@royaloperahouse/harmonic 1.0.9-f → 1.0.9-g

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.
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
2
  declare const CastFiltersVariant: React.ForwardRefExoticComponent<{
3
3
  showCastFilterApply?: boolean | undefined;
4
+ appliedCast: {
5
+ slug: string;
6
+ name: string;
7
+ }[];
4
8
  } & import("../../../../types/types").ICastFiltersProps & React.RefAttributes<HTMLDivElement>>;
5
9
  export default CastFiltersVariant;
@@ -7199,7 +7199,8 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7199
7199
  selectedIndices = _ref$selectedIndices === void 0 ? [] : _ref$selectedIndices,
7200
7200
  selectedIds = _ref.selectedIds,
7201
7201
  _ref$showCastFilterAp = _ref.showCastFilterApply,
7202
- showCastFilterApply = _ref$showCastFilterAp === void 0 ? false : _ref$showCastFilterAp;
7202
+ showCastFilterApply = _ref$showCastFilterAp === void 0 ? false : _ref$showCastFilterAp,
7203
+ appliedCast = _ref.appliedCast;
7203
7204
  var _useViewport = useViewport(),
7204
7205
  isMobile = _useViewport.isMobile;
7205
7206
  var castWrapperRef = React.useRef(null);
@@ -7361,6 +7362,9 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7361
7362
  _onClick = person.onClick,
7362
7363
  ariaLabel = person['aria-label'];
7363
7364
  var personSelectionId = getCastItemSelectionId(person);
7365
+ var isApplied = appliedCast.some(function (castMember) {
7366
+ return castMember.name === person.name;
7367
+ });
7364
7368
  var isSelected = isIdSelectionMode ? selectedIdsSet.has(personSelectionId) : selectedIndices.includes(index);
7365
7369
  var personImage = image || placeholderImage || defaultPlaceholderImage;
7366
7370
  return /*#__PURE__*/React__default.createElement(PersonWrapper, {
@@ -7387,7 +7391,7 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7387
7391
  isDefaultPlaceholder: !(!!image || !!placeholderImage),
7388
7392
  greyscale: greyscale
7389
7393
  }), /*#__PURE__*/React__default.createElement(Decal, {
7390
- isSelected: isSelected
7394
+ isSelected: isApplied
7391
7395
  }, /*#__PURE__*/React__default.createElement(Icon, {
7392
7396
  iconName: "Confirm",
7393
7397
  color: "white"
@@ -7432,15 +7436,15 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7432
7436
  ref: swipeRef,
7433
7437
  onOverflowChange: handleOverflowChange,
7434
7438
  limitDragToNavigableRange: true
7435
- }, getPersonCards()))), showActionButtonsSection && (/*#__PURE__*/React__default.createElement(ActionButtons, null, selectedStateIndices.length === 0 && !showCastFilterApply && emptySelectionText && (/*#__PURE__*/React__default.createElement(BodyCopyHarmonic, {
7439
+ }, getPersonCards()))), showActionButtonsSection && (/*#__PURE__*/React__default.createElement(ActionButtons, null, selectedStateIndices.length === 0 && appliedCast.length === 0 && !showCastFilterApply && emptySelectionText && (/*#__PURE__*/React__default.createElement(BodyCopyHarmonic, {
7436
7440
  size: "medium",
7437
7441
  className: "mobile-only"
7438
- }, emptySelectionText)), selectedStateIndices.length === 0 && !showCastFilterApply && !emptySelectionText && (/*#__PURE__*/React__default.createElement(EmptySelectionTextSpacer, null)), showCastFilterApply && (onApply || onApplyIds) && (/*#__PURE__*/React__default.createElement(PrimaryButton, {
7442
+ }, emptySelectionText)), selectedStateIndices.length === 0 && appliedCast.length === 0 && !showCastFilterApply && !emptySelectionText && /*#__PURE__*/React__default.createElement(EmptySelectionTextSpacer, null), showCastFilterApply && (onApply || onApplyIds) && (/*#__PURE__*/React__default.createElement(PrimaryButton, {
7439
7443
  onClick: function onClick() {
7440
7444
  if (onApply) onApply(selectedStateIndices);
7441
7445
  if (onApplyIds) onApplyIds(selectedStateIds);
7442
7446
  }
7443
- }, ctaText != null ? ctaText : 'Apply')), onClear && selectedStateIndices.length > 0 && (/*#__PURE__*/React__default.createElement(TextLink, {
7447
+ }, ctaText != null ? ctaText : 'Apply')), onClear && appliedCast.length > 0 && (/*#__PURE__*/React__default.createElement(TextLink, {
7444
7448
  tabIndex: 0,
7445
7449
  role: "button",
7446
7450
  onClick: onClear,