@patternfly/react-core 4.214.2 → 4.214.3

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/esm/components/Banner/Banner.d.ts +2 -0
  3. package/dist/esm/components/Banner/Banner.d.ts.map +1 -1
  4. package/dist/esm/components/Banner/Banner.js +4 -2
  5. package/dist/esm/components/Banner/Banner.js.map +1 -1
  6. package/dist/esm/components/Chip/Chip.d.ts +5 -0
  7. package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
  8. package/dist/esm/components/Chip/Chip.js +7 -2
  9. package/dist/esm/components/Chip/Chip.js.map +1 -1
  10. package/dist/esm/components/Switch/Switch.d.ts.map +1 -1
  11. package/dist/esm/components/Switch/Switch.js +2 -3
  12. package/dist/esm/components/Switch/Switch.js.map +1 -1
  13. package/dist/js/components/Banner/Banner.d.ts +2 -0
  14. package/dist/js/components/Banner/Banner.d.ts.map +1 -1
  15. package/dist/js/components/Banner/Banner.js +4 -2
  16. package/dist/js/components/Banner/Banner.js.map +1 -1
  17. package/dist/js/components/Chip/Chip.d.ts +5 -0
  18. package/dist/js/components/Chip/Chip.d.ts.map +1 -1
  19. package/dist/js/components/Chip/Chip.js +7 -2
  20. package/dist/js/components/Chip/Chip.js.map +1 -1
  21. package/dist/js/components/Switch/Switch.d.ts.map +1 -1
  22. package/dist/js/components/Switch/Switch.js +2 -3
  23. package/dist/js/components/Switch/Switch.js.map +1 -1
  24. package/dist/umd/react-core.css +545 -545
  25. package/dist/umd/react-core.js +13 -7
  26. package/dist/umd/react-core.min.js +2 -2
  27. package/package.json +5 -5
  28. package/src/components/Banner/Banner.tsx +4 -0
  29. package/src/components/Banner/__tests__/Banner.test.tsx +5 -1
  30. package/src/components/Banner/__tests__/__snapshots__/Banner.test.tsx.snap +30 -0
  31. package/src/components/Banner/examples/BannerBasic.tsx +4 -2
  32. package/src/components/Chip/Chip.tsx +14 -0
  33. package/src/components/Chip/__tests__/Chip.test.tsx +9 -0
  34. package/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +44 -0
  35. package/src/components/Switch/Switch.tsx +7 -6
@@ -5804,8 +5804,10 @@
5804
5804
  };
5805
5805
 
5806
5806
  const Banner = (_a) => {
5807
- var { children, className, variant = 'default', isSticky = false } = _a, props = __rest$1(_a, ["children", "className", "variant", "isSticky"]);
5808
- return (React__namespace.createElement("div", Object.assign({ className: css(styles$11.banner, styles$11.modifiers[variant], isSticky && styles$11.modifiers.sticky, className) }, props), children));
5807
+ var { children, className, variant = 'default', screenReaderText, isSticky = false } = _a, props = __rest$1(_a, ["children", "className", "variant", "screenReaderText", "isSticky"]);
5808
+ return (React__namespace.createElement("div", Object.assign({ className: css(styles$11.banner, styles$11.modifiers[variant], isSticky && styles$11.modifiers.sticky, className) }, props),
5809
+ children,
5810
+ React__namespace.createElement("span", { className: "pf-u-screen-reader" }, screenReaderText || `${variant} banner`)));
5809
5811
  };
5810
5812
  Banner.displayName = 'Banner';
5811
5813
 
@@ -6745,10 +6747,13 @@
6745
6747
  constructor(props) {
6746
6748
  super(props);
6747
6749
  this.span = React__namespace.createRef();
6750
+ this.setChipStyle = () => ({
6751
+ '--pf-c-chip__text--MaxWidth': this.props.textMaxWidth
6752
+ });
6748
6753
  this.renderOverflowChip = () => {
6749
6754
  const { children, className, onClick, ouiaId } = this.props;
6750
6755
  const Component = this.props.component;
6751
- return (React__namespace.createElement(Component, Object.assign({ onClick: onClick, className: css(styles$W.chip, styles$W.modifiers.overflow, className) }, (this.props.component === 'button' ? { type: 'button' } : {}), getOUIAProps('OverflowChip', ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)),
6756
+ return (React__namespace.createElement(Component, Object.assign({ onClick: onClick }, (this.props.textMaxWidth && Object.assign({ style: this.setChipStyle() }, this.props.style)), { className: css(styles$W.chip, styles$W.modifiers.overflow, className) }, (this.props.component === 'button' ? { type: 'button' } : {}), getOUIAProps('OverflowChip', ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)),
6752
6757
  React__namespace.createElement("span", { className: css(styles$W.chipText) }, children)));
6753
6758
  };
6754
6759
  this.renderChip = (randomId) => {
@@ -6771,7 +6776,9 @@
6771
6776
  renderInnerChip(id) {
6772
6777
  const { children, className, onClick, closeBtnAriaLabel, isReadOnly, component, ouiaId } = this.props;
6773
6778
  const Component = component;
6774
- return (React__namespace.createElement(Component, Object.assign({ className: css(styles$W.chip, className) }, (this.state.isTooltipVisible && { tabIndex: 0 }), getOUIAProps(Chip.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)),
6779
+ return (React__namespace.createElement(Component, Object.assign({}, (this.props.textMaxWidth && {
6780
+ style: this.setChipStyle()
6781
+ }), { className: css(styles$W.chip, className) }, (this.state.isTooltipVisible && { tabIndex: 0 }), getOUIAProps(Chip.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)),
6775
6782
  React__namespace.createElement("span", { ref: this.span, className: css(styles$W.chipText), id: id }, children),
6776
6783
  !isReadOnly && (React__namespace.createElement(Button, { onClick: onClick, variant: "plain", "aria-label": closeBtnAriaLabel, id: `remove_${id}`, "aria-labelledby": `remove_${id} ${id}`, ouiaId: ouiaId || closeBtnAriaLabel },
6777
6784
  React__namespace.createElement(TimesIcon$1, { "aria-hidden": "true" })))));
@@ -18184,10 +18191,9 @@
18184
18191
  return (React__namespace.createElement("label", Object.assign({ className: css(styles$i.switch, isReversed && styles$i.modifiers.reverse, className), htmlFor: this.id }, getOUIAProps(Switch.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)),
18185
18192
  React__namespace.createElement("input", Object.assign({ id: this.id, className: css(styles$i.switchInput), type: "checkbox", onChange: event => onChange(event.target.checked, event), checked: isChecked, disabled: isDisabled, "aria-labelledby": isAriaLabelledBy ? `${this.id}-on` : null }, props)),
18186
18193
  label !== undefined ? (React__namespace.createElement(React__namespace.Fragment, null,
18187
- React__namespace.createElement("span", { className: css(styles$i.switchToggle) }),
18194
+ React__namespace.createElement("span", { className: css(styles$i.switchToggle) }, hasCheckIcon && (React__namespace.createElement("span", { className: css(styles$i.switchToggleIcon), "aria-hidden": "true" },
18195
+ React__namespace.createElement(CheckIcon$1, { noVerticalAlign: true })))),
18188
18196
  React__namespace.createElement("span", { className: css(styles$i.switchLabel, styles$i.modifiers.on), id: isAriaLabelledBy ? `${this.id}-on` : null, "aria-hidden": "true" }, label),
18189
- hasCheckIcon && (React__namespace.createElement("div", { className: css(styles$i.switchToggleIcon), "aria-hidden": "true" },
18190
- React__namespace.createElement(CheckIcon$1, { noVerticalAlign: true }))),
18191
18197
  React__namespace.createElement("span", { className: css(styles$i.switchLabel, styles$i.modifiers.off), id: isAriaLabelledBy ? `${this.id}-off` : null, "aria-hidden": "true" }, labelOff !== undefined ? labelOff : label))) : (React__namespace.createElement("span", { className: css(styles$i.switchToggle) },
18192
18198
  React__namespace.createElement("div", { className: css(styles$i.switchToggleIcon), "aria-hidden": "true" },
18193
18199
  React__namespace.createElement(CheckIcon$1, { noVerticalAlign: true }))))));