@patternfly/react-core 4.211.3 → 4.211.6

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 (34) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/esm/components/Modal/Modal.d.ts +4 -0
  3. package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
  4. package/dist/esm/components/Modal/Modal.js +2 -2
  5. package/dist/esm/components/Modal/Modal.js.map +1 -1
  6. package/dist/esm/components/Modal/ModalContent.d.ts +4 -0
  7. package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
  8. package/dist/esm/components/Modal/ModalContent.js +3 -2
  9. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  10. package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
  11. package/dist/esm/helpers/Popper/Popper.js +7 -6
  12. package/dist/esm/helpers/Popper/Popper.js.map +1 -1
  13. package/dist/js/components/Modal/Modal.d.ts +4 -0
  14. package/dist/js/components/Modal/Modal.d.ts.map +1 -1
  15. package/dist/js/components/Modal/Modal.js +2 -2
  16. package/dist/js/components/Modal/Modal.js.map +1 -1
  17. package/dist/js/components/Modal/ModalContent.d.ts +4 -0
  18. package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
  19. package/dist/js/components/Modal/ModalContent.js +3 -2
  20. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  21. package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
  22. package/dist/js/helpers/Popper/Popper.js +7 -6
  23. package/dist/js/helpers/Popper/Popper.js.map +1 -1
  24. package/dist/umd/react-core.css +5 -0
  25. package/dist/umd/react-core.js +12 -10
  26. package/dist/umd/react-core.min.css +5 -0
  27. package/dist/umd/react-core.min.js +2 -2
  28. package/package.json +6 -6
  29. package/src/components/Modal/Modal.tsx +8 -0
  30. package/src/components/Modal/ModalContent.tsx +14 -1
  31. package/src/components/Modal/__tests__/Modal.test.tsx +56 -0
  32. package/src/components/Modal/examples/Modal.md +7 -0
  33. package/src/components/Modal/examples/ModalWithOverflowingContent.tsx +71 -0
  34. package/src/helpers/Popper/Popper.tsx +10 -7
@@ -3093,6 +3093,11 @@
3093
3093
  addEventListener(onPopperClick, popperElement, 'click');
3094
3094
  onDocumentClick && addEventListener(onDocumentClickCallback, document, 'click');
3095
3095
  addEventListener(onDocumentKeyDown, document, 'keydown');
3096
+ // Trigger a Popper update when content changes.
3097
+ const observer = new MutationObserver(() => {
3098
+ update && update();
3099
+ });
3100
+ popperElement && observer.observe(popperElement, { attributes: true, childList: true, subtree: true });
3096
3101
  return () => {
3097
3102
  removeEventListener(onMouseEnter, refOrTrigger, 'mouseenter');
3098
3103
  removeEventListener(onMouseLeave, refOrTrigger, 'mouseleave');
@@ -3103,6 +3108,7 @@
3103
3108
  removeEventListener(onPopperClick, popperElement, 'click');
3104
3109
  onDocumentClick && removeEventListener(onDocumentClickCallback, document, 'click');
3105
3110
  removeEventListener(onDocumentKeyDown, document, 'keydown');
3111
+ observer.disconnect();
3106
3112
  };
3107
3113
  }, [
3108
3114
  triggerElement,
@@ -3147,7 +3153,7 @@
3147
3153
  return () => { };
3148
3154
  }
3149
3155
  }), [popperMatchesTriggerWidth]);
3150
- const { styles: popperStyles, attributes, forceUpdate } = usePopper(refOrTrigger, popperElement, {
3156
+ const { styles: popperStyles, attributes, update } = usePopper(refOrTrigger, popperElement, {
3151
3157
  placement: getPlacementMemo,
3152
3158
  modifiers: [
3153
3159
  {
@@ -3175,11 +3181,6 @@
3175
3181
  sameWidthMod
3176
3182
  ]
3177
3183
  });
3178
- // force update when content changes
3179
- // https://github.com/patternfly/patternfly-react/issues/5620
3180
- React__namespace.useEffect(() => {
3181
- forceUpdate && forceUpdate();
3182
- }, [popper]);
3183
3184
  // Returns the CSS modifier class in order to place the Popper's arrow properly
3184
3185
  // Depends on the position of the Popper relative to the reference element
3185
3186
  const modifierFromPopperPosition = () => {
@@ -15334,7 +15335,7 @@
15334
15335
  ModalBoxTitle.displayName = 'ModalBoxTitle';
15335
15336
 
15336
15337
  const ModalContent = (_a) => {
15337
- var { children, className = '', isOpen = false, header = null, help = null, description = null, title = '', titleIconVariant = null, titleLabel = '', 'aria-label': ariaLabel = '', 'aria-describedby': ariaDescribedby, 'aria-labelledby': ariaLabelledby, showClose = true, footer = null, actions = [], onClose = () => undefined, variant = 'default', position, positionOffset, width = -1, boxId, labelId, descriptorId, disableFocusTrap = false, hasNoBodyWrapper = false, ouiaId, ouiaSafe = true } = _a, props = __rest$1(_a, ["children", "className", "isOpen", "header", "help", "description", "title", "titleIconVariant", "titleLabel", 'aria-label', 'aria-describedby', 'aria-labelledby', "showClose", "footer", "actions", "onClose", "variant", "position", "positionOffset", "width", "boxId", "labelId", "descriptorId", "disableFocusTrap", "hasNoBodyWrapper", "ouiaId", "ouiaSafe"]);
15338
+ var { children, className = '', isOpen = false, header = null, help = null, description = null, title = '', titleIconVariant = null, titleLabel = '', 'aria-label': ariaLabel = '', 'aria-describedby': ariaDescribedby, 'aria-labelledby': ariaLabelledby, bodyAriaLabel, bodyAriaRole, showClose = true, footer = null, actions = [], onClose = () => undefined, variant = 'default', position, positionOffset, width = -1, boxId, labelId, descriptorId, disableFocusTrap = false, hasNoBodyWrapper = false, ouiaId, ouiaSafe = true } = _a, props = __rest$1(_a, ["children", "className", "isOpen", "header", "help", "description", "title", "titleIconVariant", "titleLabel", 'aria-label', 'aria-describedby', 'aria-labelledby', "bodyAriaLabel", "bodyAriaRole", "showClose", "footer", "actions", "onClose", "variant", "position", "positionOffset", "width", "boxId", "labelId", "descriptorId", "disableFocusTrap", "hasNoBodyWrapper", "ouiaId", "ouiaSafe"]);
15338
15339
  if (!isOpen) {
15339
15340
  return null;
15340
15341
  }
@@ -15342,7 +15343,8 @@
15342
15343
  React__namespace.createElement(ModalBoxTitle, { title: title, titleIconVariant: titleIconVariant, titleLabel: titleLabel, id: labelId }),
15343
15344
  description && React__namespace.createElement(ModalBoxDescription, { id: descriptorId }, description))));
15344
15345
  const modalBoxFooter = footer ? (React__namespace.createElement(ModalBoxFooter, null, footer)) : (actions.length > 0 && React__namespace.createElement(ModalBoxFooter, null, actions));
15345
- const modalBody = hasNoBodyWrapper ? (children) : (React__namespace.createElement(ModalBoxBody, Object.assign({}, props, (!description && !ariaDescribedby && { id: descriptorId })), children));
15346
+ const defaultModalBodyAriaRole = bodyAriaLabel ? 'region' : undefined;
15347
+ const modalBody = hasNoBodyWrapper ? (children) : (React__namespace.createElement(ModalBoxBody, Object.assign({ "aria-label": bodyAriaLabel, role: bodyAriaRole || defaultModalBodyAriaRole }, props, (!description && !ariaDescribedby && { id: descriptorId })), children));
15346
15348
  const boxStyle = width === -1 ? {} : { width };
15347
15349
  const ariaLabelledbyFormatted = () => {
15348
15350
  if (ariaLabelledby === null) {
@@ -15466,12 +15468,12 @@
15466
15468
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15467
15469
  appendTo,
15468
15470
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15469
- onEscapePress, 'aria-labelledby': ariaLabelledby, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, title, titleIconVariant, titleLabel, ouiaId, ouiaSafe } = _a, props = __rest$1(_a, ["appendTo", "onEscapePress", 'aria-labelledby', 'aria-label', 'aria-describedby', "title", "titleIconVariant", "titleLabel", "ouiaId", "ouiaSafe"]);
15471
+ onEscapePress, 'aria-labelledby': ariaLabelledby, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, bodyAriaLabel, bodyAriaRole, title, titleIconVariant, titleLabel, ouiaId, ouiaSafe } = _a, props = __rest$1(_a, ["appendTo", "onEscapePress", 'aria-labelledby', 'aria-label', 'aria-describedby', "bodyAriaLabel", "bodyAriaRole", "title", "titleIconVariant", "titleLabel", "ouiaId", "ouiaSafe"]);
15470
15472
  const { container } = this.state;
15471
15473
  if (!canUseDOM || !container) {
15472
15474
  return null;
15473
15475
  }
15474
- return ReactDOM__namespace.createPortal(React__namespace.createElement(ModalContent, Object.assign({}, props, { boxId: this.boxId, labelId: this.labelId, descriptorId: this.descriptorId, title: title, titleIconVariant: titleIconVariant, titleLabel: titleLabel, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby, ouiaId: ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe: ouiaSafe })), container);
15476
+ return ReactDOM__namespace.createPortal(React__namespace.createElement(ModalContent, Object.assign({}, props, { boxId: this.boxId, labelId: this.labelId, descriptorId: this.descriptorId, title: title, titleIconVariant: titleIconVariant, titleLabel: titleLabel, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby, bodyAriaLabel: bodyAriaLabel, bodyAriaRole: bodyAriaRole, ouiaId: ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe: ouiaSafe })), container);
15475
15477
  }
15476
15478
  }
15477
15479
  Modal.displayName = 'Modal';
@@ -3123,6 +3123,7 @@ label.pf-c-check, .pf-c-check__label,
3123
3123
  position: relative;
3124
3124
  display: inline-flex;
3125
3125
  align-items: center;
3126
+ min-width: 0;
3126
3127
  padding: var(--pf-c-chip--PaddingTop) var(--pf-c-chip--PaddingRight) var(--pf-c-chip--PaddingBottom) var(--pf-c-chip--PaddingLeft);
3127
3128
  list-style: none;
3128
3129
  background-color: var(--pf-c-chip--BackgroundColor);
@@ -3230,6 +3231,7 @@ label.pf-c-check, .pf-c-check__label,
3230
3231
  flex: 1;
3231
3232
  flex-wrap: wrap;
3232
3233
  align-items: baseline;
3234
+ min-width: 0;
3233
3235
  }
3234
3236
 
3235
3237
  .pf-c-chip-group__list {
@@ -3242,10 +3244,13 @@ label.pf-c-check, .pf-c-check__label,
3242
3244
  display: inline-flex;
3243
3245
  flex-wrap: wrap;
3244
3246
  align-items: center;
3247
+ min-width: 0;
3248
+ max-width: 100%;
3245
3249
  }
3246
3250
 
3247
3251
  .pf-c-chip-group__list-item {
3248
3252
  display: inline-flex;
3253
+ min-width: 0;
3249
3254
  margin-right: var(--pf-c-chip-group__list-item--MarginRight);
3250
3255
  margin-bottom: var(--pf-c-chip-group__list-item--MarginBottom);
3251
3256
  }