@deque/cauldron-react 4.1.0-canary.4ee8aabd → 4.1.0-canary.a5dcfeed

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.
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  interface LoaderOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  variant?: 'large' | 'small';
4
4
  label?: string;
5
+ focusOnInitialRender?: boolean;
6
+ children?: React.ReactNode;
5
7
  }
6
8
  declare const LoaderOverlay: React.ForwardRefExoticComponent<LoaderOverlayProps & React.RefAttributes<HTMLDivElement>>;
7
9
  export default LoaderOverlay;
package/lib/index.js CHANGED
@@ -7979,22 +7979,39 @@ function AxeLoader() {
7979
7979
  }
7980
7980
 
7981
7981
  var LoaderOverlay = React__default.forwardRef(function (_a, ref) {
7982
- var className = _a.className, variant = _a.variant, label = _a.label, other = tslib.__rest(_a, ["className", "variant", "label"]);
7982
+ var className = _a.className, variant = _a.variant, label = _a.label, children = _a.children, focusOnInitialRender = _a.focusOnInitialRender, other = tslib.__rest(_a, ["className", "variant", "label", "children", "focusOnInitialRender"]);
7983
+ var overlayRef = typeof ref === 'function' || !ref ? React.createRef() : ref;
7984
+ React.useEffect(function () {
7985
+ if (!!focusOnInitialRender && overlayRef.current) {
7986
+ setTimeout(function () {
7987
+ var _a;
7988
+ return (_a = overlayRef.current) === null || _a === void 0 ? void 0 : _a.focus();
7989
+ });
7990
+ }
7991
+ return;
7992
+ }, [overlayRef.current]);
7993
+ React.useEffect(function () {
7994
+ if (typeof ref === 'function') {
7995
+ ref(overlayRef.current);
7996
+ }
7997
+ }, [ref]);
7983
7998
  return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader__overlay', className, variant === 'large'
7984
7999
  ? 'Loader__overlay--large'
7985
8000
  : variant === 'small'
7986
8001
  ? 'Loader__overlay--small'
7987
- : ''), ref: ref }, other),
8002
+ : ''), ref: overlayRef, tabIndex: -1 }, other),
7988
8003
  React__default.createElement("div", { className: "Loader__overlay__loader" },
7989
8004
  React__default.createElement(Loader, { variant: variant }),
7990
8005
  React__default.createElement(AxeLoader, null)),
7991
8006
  label ? React__default.createElement("span", { className: "Loader__overlay__label" }, label) : null,
7992
- other.children));
8007
+ children));
7993
8008
  });
7994
8009
  LoaderOverlay.propTypes = {
7995
8010
  className: PropTypes.string,
7996
8011
  variant: PropTypes.oneOf(['large', 'small']),
7997
- label: PropTypes.string
8012
+ label: PropTypes.string,
8013
+ focusOnInitialRender: PropTypes.bool,
8014
+ children: PropTypes.node
7998
8015
  };
7999
8016
  LoaderOverlay.displayName = 'LoaderOverlay';
8000
8017
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "4.1.0-canary.4ee8aabd",
3
+ "version": "4.1.0-canary.a5dcfeed",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"