@nypl/design-system-react-components 1.4.0-rc → 1.4.0-rc3

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.
@@ -3038,8 +3038,7 @@ var CheckboxGroup = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props
3038
3038
  "data-testid": "checkbox-group",
3039
3039
  direction: [layout],
3040
3040
  spacing: spacingProp,
3041
- ref: ref,
3042
- "aria-label": !showLabel ? labelText : undefined
3041
+ ref: ref
3043
3042
  }, newChildren)), footnote && showHelperInvalidText && React__default.createElement(HelperErrorText, {
3044
3043
  id: id + "-helperErrorText",
3045
3044
  isInvalid: isInvalid,
@@ -9546,7 +9545,6 @@ var RadioGroup$1 = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props,
9546
9545
  });
9547
9546
  // Props for the `ChakraRadioGroup` component.
9548
9547
  var radioGroupProps = {
9549
- "aria-label": !showLabel ? labelText : undefined,
9550
9548
  name: name,
9551
9549
  onChange: function onChange(selected) {
9552
9550
  setValue(selected);
@@ -10044,7 +10042,7 @@ function useFeedbackBox() {
10044
10042
  };
10045
10043
  }
10046
10044
 
10047
- var _excluded$1f = ["id", "isOpen", "multiSelectId", "multiSelectLabel", "onClear", "onKeyDown", "onMenuToggle", "selectedItems"];
10045
+ var _excluded$1f = ["id", "isOpen", "multiSelectId", "multiSelectLabelText", "onClear", "onKeyDown", "onMenuToggle", "selectedItems"];
10048
10046
  var _templateObject;
10049
10047
  var grow = /*#__PURE__*/keyframes$1(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n from {width: 22px; opacity: 0; }\n to {width: 46px; opacity: 1;}\n"])));
10050
10048
  /**
@@ -10059,7 +10057,7 @@ var MultiSelectMenuButton$1 = /*#__PURE__*/forwardRef(function (props, ref) {
10059
10057
  var id = props.id,
10060
10058
  isOpen = props.isOpen,
10061
10059
  multiSelectId = props.multiSelectId,
10062
- multiSelectLabel = props.multiSelectLabel,
10060
+ multiSelectLabelText = props.multiSelectLabelText,
10063
10061
  onClear = props.onClear,
10064
10062
  onMenuToggle = props.onMenuToggle,
10065
10063
  selectedItems = props.selectedItems,
@@ -10072,7 +10070,7 @@ var MultiSelectMenuButton$1 = /*#__PURE__*/forwardRef(function (props, ref) {
10072
10070
  if (((_selectedItems$multiS = selectedItems[multiSelectId]) == null ? void 0 : _selectedItems$multiS.items.length) > 0) {
10073
10071
  getSelectedItemsCount = "" + selectedItems[multiSelectId].items.length;
10074
10072
  var itemPlural = getSelectedItemsCount === "1" ? "" : "s";
10075
- selectedItemsAriaLabel = getSelectedItemsCount + " item" + itemPlural + " selected";
10073
+ selectedItemsAriaLabel = "remove " + getSelectedItemsCount + " item" + itemPlural + " selected from " + multiSelectLabelText;
10076
10074
  }
10077
10075
  var styles = useMultiStyleConfig("MultiSelectMenuButton", {
10078
10076
  isOpen: isOpen,
@@ -10094,9 +10092,9 @@ var MultiSelectMenuButton$1 = /*#__PURE__*/forwardRef(function (props, ref) {
10094
10092
  __css: styles.menuButton
10095
10093
  }, rest), React__default.createElement(Box, {
10096
10094
  as: "span",
10097
- title: multiSelectLabel,
10095
+ title: multiSelectLabelText,
10098
10096
  __css: styles.buttonLabel
10099
- }, multiSelectLabel), React__default.createElement(Icon, {
10097
+ }, multiSelectLabelText), React__default.createElement(Icon, {
10100
10098
  id: "ms-" + multiSelectId + "-icon",
10101
10099
  name: iconType,
10102
10100
  size: "small"
@@ -10117,18 +10115,19 @@ var MultiSelectMenuButton$1 = /*#__PURE__*/forwardRef(function (props, ref) {
10117
10115
  id: "ms-" + multiSelectId + "-selected-items-count-icon",
10118
10116
  marginLeft: "xs",
10119
10117
  name: "close",
10120
- size: "xsmall"
10118
+ size: "xsmall",
10119
+ title: "Remove selected items"
10121
10120
  })));
10122
10121
  });
10123
10122
 
10124
- var _excluded$1g = ["id", "isBlockElement", "isDefaultOpen", "items", "label", "onChange", "onClear", "selectedItems", "width"];
10125
- /** MultiSelectListbox renders a non-hierarchical list of checkbox options for the `variant="listbox". It leverager downshift-js for accessiblity. */
10123
+ var _excluded$1g = ["id", "isBlockElement", "isDefaultOpen", "items", "labelText", "onChange", "onClear", "selectedItems", "width"];
10124
+ /** MultiSelectListbox renders a non-hierarchical list of checkbox options for the `type="listbox". It leverager downshift-js for accessiblity. */
10126
10125
  var MultiSelectListbox = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref) {
10127
10126
  var id = props.id,
10128
10127
  isBlockElement = props.isBlockElement,
10129
10128
  isDefaultOpen = props.isDefaultOpen,
10130
10129
  items = props.items,
10131
- label = props.label,
10130
+ labelText = props.labelText,
10132
10131
  onChange = props.onChange,
10133
10132
  onClear = props.onClear,
10134
10133
  selectedItems = props.selectedItems,
@@ -10171,18 +10170,18 @@ var MultiSelectListbox = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (
10171
10170
  isBlockElement: isBlockElement,
10172
10171
  isOpen: isOpen
10173
10172
  });
10174
- // If a item passed to the listbox variant has children,
10173
+ // If a item passed to the listbox type has children,
10175
10174
  if (items.some(function (item) {
10176
10175
  return item.children;
10177
10176
  })) {
10178
- console.warn("NYPL Reservoir MultiSelect: Only the variant 'dialog' can render nested select items.");
10177
+ console.warn("NYPL Reservoir MultiSelect: Only the type 'dialog' can render nested select items.");
10179
10178
  }
10180
10179
  return React__default.createElement(Box, Object.assign({
10181
10180
  id: id,
10182
10181
  __css: styles
10183
10182
  }, rest), React__default.createElement(MultiSelectMenuButton$1, Object.assign({
10184
10183
  multiSelectId: id,
10185
- multiSelectLabel: label,
10184
+ multiSelectLabelText: labelText,
10186
10185
  isOpen: isOpen,
10187
10186
  selectedItems: selectedItems,
10188
10187
  onClear: onClear,
@@ -10238,13 +10237,13 @@ var MultiSelectListbox = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (
10238
10237
  }
10239
10238
  });
10240
10239
 
10241
- var _excluded$1h = ["id", "isBlockElement", "isDefaultOpen", "items", "label", "onApply", "onChange", "onClear", "onMixedStateChange", "selectedItems", "width"];
10240
+ var _excluded$1h = ["id", "isBlockElement", "isDefaultOpen", "items", "labelText", "onApply", "onChange", "onClear", "onMixedStateChange", "selectedItems", "width"];
10242
10241
  var MultiSelectDialog = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref) {
10243
10242
  var id = props.id,
10244
10243
  isBlockElement = props.isBlockElement,
10245
10244
  isDefaultOpen = props.isDefaultOpen,
10246
10245
  items = props.items,
10247
- label = props.label,
10246
+ labelText = props.labelText,
10248
10247
  onApply = props.onApply,
10249
10248
  onChange = props.onChange,
10250
10249
  onClear = props.onClear,
@@ -10331,7 +10330,7 @@ var MultiSelectDialog = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (p
10331
10330
  }, React__default.createElement(MultiSelectMenuButton$1, {
10332
10331
  id: "ms-" + id + "-menu-button",
10333
10332
  multiSelectId: id,
10334
- multiSelectLabel: label,
10333
+ multiSelectLabelText: labelText,
10335
10334
  isOpen: isOpen,
10336
10335
  selectedItems: selectedItems,
10337
10336
  onMenuToggle: function onMenuToggle() {
@@ -10412,7 +10411,7 @@ var MultiSelectDialog = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (p
10412
10411
  }
10413
10412
  });
10414
10413
 
10415
- var _excluded$1i = ["id", "isBlockElement", "isDefaultOpen", "items", "label", "onApply", "onChange", "onClear", "onMixedStateChange", "selectedItems", "variant", "width"];
10414
+ var _excluded$1i = ["id", "isBlockElement", "isDefaultOpen", "items", "labelText", "onApply", "onChange", "onClear", "onMixedStateChange", "selectedItems", "type", "width"];
10416
10415
  /**
10417
10416
  * The `MultiSelect` component is a form input element that presents a list
10418
10417
  * of `Checkbox` components from which a user can make one or multiple
@@ -10427,13 +10426,13 @@ var MultiSelect$1 = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props
10427
10426
  _props$isDefaultOpen = props.isDefaultOpen,
10428
10427
  isDefaultOpen = _props$isDefaultOpen === void 0 ? false : _props$isDefaultOpen,
10429
10428
  items = props.items,
10430
- label = props.label,
10429
+ labelText = props.labelText,
10431
10430
  onApply = props.onApply,
10432
10431
  onChange = props.onChange,
10433
10432
  onClear = props.onClear,
10434
10433
  onMixedStateChange = props.onMixedStateChange,
10435
10434
  selectedItems = props.selectedItems,
10436
- variant = props.variant,
10435
+ type = props.type,
10437
10436
  _props$width = props.width,
10438
10437
  width = _props$width === void 0 ? "default" : _props$width,
10439
10438
  rest = _objectWithoutPropertiesLoose(props, _excluded$1i);
@@ -10442,20 +10441,20 @@ var MultiSelect$1 = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props
10442
10441
  isBlockElement: isBlockElement,
10443
10442
  isDefaultOpen: isDefaultOpen,
10444
10443
  items: items,
10445
- label: label,
10444
+ labelText: labelText,
10446
10445
  onClear: onClear,
10447
10446
  selectedItems: selectedItems,
10448
- variant: variant,
10447
+ type: type,
10449
10448
  width: width
10450
10449
  };
10451
- if (variant === "listbox") {
10450
+ if (type === "listbox") {
10452
10451
  var listboxOnChange = onChange;
10453
10452
  return React__default.createElement(MultiSelectListbox, Object.assign({}, commonProps, {
10454
10453
  ref: ref,
10455
10454
  onChange: listboxOnChange
10456
10455
  }, rest));
10457
10456
  }
10458
- if (variant === "dialog") {
10457
+ if (type === "dialog") {
10459
10458
  var dialogOnChange = onChange;
10460
10459
  return React__default.createElement(MultiSelectDialog, Object.assign({}, commonProps, {
10461
10460
  onChange: dialogOnChange,
@@ -10529,7 +10528,6 @@ var MultiSelectGroup = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (pr
10529
10528
  isLegendHidden: !showLabel,
10530
10529
  __css: styles
10531
10530
  }, rest), React__default.createElement(Stack, {
10532
- "aria-label": !showLabel ? labelText : undefined,
10533
10531
  className: className,
10534
10532
  columnGap: "xs",
10535
10533
  "data-testid": "multi-select-group",