@royaloperahouse/harmonic 1.0.9-f → 1.0.9-h

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;
@@ -7101,7 +7101,8 @@ var CastFilters = function CastFilters(_ref) {
7101
7101
  },
7102
7102
  onKeyDown: function onKeyDown(e) {
7103
7103
  return handlePersonKeydown(e, index, personSelectionId, _onClick);
7104
- }
7104
+ },
7105
+ "data-roh": "cast-filter-person-card"
7105
7106
  }, /*#__PURE__*/React__default.createElement(PersonToggle, {
7106
7107
  isSelected: isSelected,
7107
7108
  "aria-hidden": "true"
@@ -7162,12 +7163,14 @@ var CastFilters = function CastFilters(_ref) {
7162
7163
  onClick: function onClick() {
7163
7164
  if (onApply) onApply(selectedStateIndices);
7164
7165
  if (onApplyIds) onApplyIds(selectedStateIds);
7165
- }
7166
+ },
7167
+ "data-roh": "cast-filter-apply"
7166
7168
  }, ctaText != null ? ctaText : 'Apply')), onClear && (/*#__PURE__*/React__default.createElement(TextLink, {
7167
7169
  tabIndex: 0,
7168
7170
  role: "button",
7169
7171
  onClick: onClear,
7170
- onKeyDown: handleClearKeydown
7172
+ onKeyDown: handleClearKeydown,
7173
+ "data-roh": "cast-filter-clear"
7171
7174
  }, textLinkText != null ? textLinkText : 'Clear')))))));
7172
7175
  };
7173
7176
 
@@ -7199,7 +7202,8 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7199
7202
  selectedIndices = _ref$selectedIndices === void 0 ? [] : _ref$selectedIndices,
7200
7203
  selectedIds = _ref.selectedIds,
7201
7204
  _ref$showCastFilterAp = _ref.showCastFilterApply,
7202
- showCastFilterApply = _ref$showCastFilterAp === void 0 ? false : _ref$showCastFilterAp;
7205
+ showCastFilterApply = _ref$showCastFilterAp === void 0 ? false : _ref$showCastFilterAp,
7206
+ appliedCast = _ref.appliedCast;
7203
7207
  var _useViewport = useViewport(),
7204
7208
  isMobile = _useViewport.isMobile;
7205
7209
  var castWrapperRef = React.useRef(null);
@@ -7361,6 +7365,9 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7361
7365
  _onClick = person.onClick,
7362
7366
  ariaLabel = person['aria-label'];
7363
7367
  var personSelectionId = getCastItemSelectionId(person);
7368
+ var isApplied = appliedCast.some(function (castMember) {
7369
+ return castMember.name === person.name;
7370
+ });
7364
7371
  var isSelected = isIdSelectionMode ? selectedIdsSet.has(personSelectionId) : selectedIndices.includes(index);
7365
7372
  var personImage = image || placeholderImage || defaultPlaceholderImage;
7366
7373
  return /*#__PURE__*/React__default.createElement(PersonWrapper, {
@@ -7376,7 +7383,8 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7376
7383
  },
7377
7384
  onKeyDown: function onKeyDown(e) {
7378
7385
  return handlePersonKeydown(e, index, personSelectionId, _onClick);
7379
- }
7386
+ },
7387
+ "data-roh": "cast-filter-person-card"
7380
7388
  }, /*#__PURE__*/React__default.createElement(PersonToggle, {
7381
7389
  isSelected: isSelected,
7382
7390
  "aria-hidden": "true"
@@ -7387,7 +7395,7 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7387
7395
  isDefaultPlaceholder: !(!!image || !!placeholderImage),
7388
7396
  greyscale: greyscale
7389
7397
  }), /*#__PURE__*/React__default.createElement(Decal, {
7390
- isSelected: isSelected
7398
+ isSelected: isApplied
7391
7399
  }, /*#__PURE__*/React__default.createElement(Icon, {
7392
7400
  iconName: "Confirm",
7393
7401
  color: "white"
@@ -7432,19 +7440,21 @@ var CastFiltersVariant = /*#__PURE__*/React__default.forwardRef(function (_ref,
7432
7440
  ref: swipeRef,
7433
7441
  onOverflowChange: handleOverflowChange,
7434
7442
  limitDragToNavigableRange: true
7435
- }, getPersonCards()))), showActionButtonsSection && (/*#__PURE__*/React__default.createElement(ActionButtons, null, selectedStateIndices.length === 0 && !showCastFilterApply && emptySelectionText && (/*#__PURE__*/React__default.createElement(BodyCopyHarmonic, {
7443
+ }, getPersonCards()))), showActionButtonsSection && (/*#__PURE__*/React__default.createElement(ActionButtons, null, selectedStateIndices.length === 0 && appliedCast.length === 0 && !showCastFilterApply && emptySelectionText && (/*#__PURE__*/React__default.createElement(BodyCopyHarmonic, {
7436
7444
  size: "medium",
7437
7445
  className: "mobile-only"
7438
- }, emptySelectionText)), selectedStateIndices.length === 0 && !showCastFilterApply && !emptySelectionText && (/*#__PURE__*/React__default.createElement(EmptySelectionTextSpacer, null)), showCastFilterApply && (onApply || onApplyIds) && (/*#__PURE__*/React__default.createElement(PrimaryButton, {
7446
+ }, emptySelectionText)), selectedStateIndices.length === 0 && appliedCast.length === 0 && !showCastFilterApply && !emptySelectionText && /*#__PURE__*/React__default.createElement(EmptySelectionTextSpacer, null), showCastFilterApply && (onApply || onApplyIds) && (/*#__PURE__*/React__default.createElement(PrimaryButton, {
7439
7447
  onClick: function onClick() {
7440
7448
  if (onApply) onApply(selectedStateIndices);
7441
7449
  if (onApplyIds) onApplyIds(selectedStateIds);
7442
- }
7443
- }, ctaText != null ? ctaText : 'Apply')), onClear && selectedStateIndices.length > 0 && (/*#__PURE__*/React__default.createElement(TextLink, {
7450
+ },
7451
+ "data-roh": "cast-filter-apply"
7452
+ }, ctaText != null ? ctaText : 'Apply')), onClear && appliedCast.length > 0 && (/*#__PURE__*/React__default.createElement(TextLink, {
7444
7453
  tabIndex: 0,
7445
7454
  role: "button",
7446
7455
  onClick: onClear,
7447
- onKeyDown: handleClearKeydown
7456
+ onKeyDown: handleClearKeydown,
7457
+ "data-roh": "cast-filter-clear"
7448
7458
  }, textLinkText != null ? textLinkText : 'Clear')))));
7449
7459
  });
7450
7460
  CastFiltersVariant.displayName = 'CastFiltersVariant';