@deque/cauldron-react 5.13.0-canary.301c546b → 5.13.0-canary.7b5349dc

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,7 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  label?: string;
4
- variant?: 'large' | 'small';
5
4
  }
6
5
  declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLDivElement>>;
7
6
  export default Loader;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  export interface LoaderOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
3
- variant?: 'large' | 'small';
4
3
  label?: string;
5
4
  focusOnInitialRender?: boolean;
6
5
  children?: React.ReactNode;
package/lib/index.d.ts CHANGED
@@ -19,7 +19,6 @@ export { default as Modal, ModalContent, ModalFooter } from './components/Modal'
19
19
  export { default as SkipLink } from './components/SkipLink';
20
20
  export { default as Button } from './components/Button';
21
21
  export { default as IconButton } from './components/IconButton';
22
- export { default as Pointout } from './components/Pointout';
23
22
  export { default as Toast } from './components/Toast';
24
23
  export { default as Link } from './components/Link';
25
24
  export { default as Loader } from './components/Loader';
@@ -30,7 +29,6 @@ export { default as RadioCardGroup } from './components/RadioCardGroup';
30
29
  export { default as Checkbox } from './components/Checkbox';
31
30
  export { default as Tooltip, TooltipHead, TooltipContent } from './components/Tooltip';
32
31
  export { default as TooltipTabstop } from './components/TooltipTabstop';
33
- export { default as Card, CardHeader, CardContent, CardFooter } from './components/Card';
34
32
  export { default as TextField } from './components/TextField';
35
33
  export { default as ClickOutsideListener } from './components/ClickOutsideListener';
36
34
  export { default as ExpandCollapsePanel, PanelTrigger } from './components/ExpandCollapsePanel';
@@ -45,7 +43,6 @@ export { default as Tabs, Tab, TabPanel } from './components/Tabs';
45
43
  export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails } from './components/DescriptionList';
46
44
  export { default as Stepper, Step } from './components/Stepper';
47
45
  export { default as Panel, PanelHeader, PanelContent } from './components/Panel';
48
- export { default as IssuePanel } from './components/IssuePanel';
49
46
  export { default as ProgressBar } from './components/ProgressBar';
50
47
  export { Address, AddressLine, AddressCityStateZip } from './components/Address';
51
48
  export { default as Pagination, usePagination } from './components/Pagination';
package/lib/index.js CHANGED
@@ -10,7 +10,6 @@ var keyname = require('keyname');
10
10
  var reactDom = require('react-dom');
11
11
  var FocusTrap = require('focus-trap-react');
12
12
  var reactPopper = require('react-popper');
13
- var focusable = require('focusable');
14
13
  var SyntaxHighlighter = require('react-syntax-highlighter/dist/cjs/light');
15
14
  var js = require('react-syntax-highlighter/dist/cjs/languages/hljs/javascript');
16
15
  var css = require('react-syntax-highlighter/dist/cjs/languages/hljs/css');
@@ -24,7 +23,6 @@ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
24
23
  var nextId__default = /*#__PURE__*/_interopDefaultLegacy(nextId);
25
24
  var keyname__default = /*#__PURE__*/_interopDefaultLegacy(keyname);
26
25
  var FocusTrap__default = /*#__PURE__*/_interopDefaultLegacy(FocusTrap);
27
- var focusable__default = /*#__PURE__*/_interopDefaultLegacy(focusable);
28
26
  var SyntaxHighlighter__default = /*#__PURE__*/_interopDefaultLegacy(SyntaxHighlighter);
29
27
  var js__default = /*#__PURE__*/_interopDefaultLegacy(js);
30
28
  var css__default = /*#__PURE__*/_interopDefaultLegacy(css);
@@ -1789,303 +1787,6 @@ var IconButton = React.forwardRef(function (_a, ref) {
1789
1787
  });
1790
1788
  IconButton.displayName = 'IconButton';
1791
1789
 
1792
- var i = 0;
1793
- var randomId = function () {
1794
- var num = Math.floor(Math.random() * 10000) + 1;
1795
- return "x_".concat(i++, "_").concat(num);
1796
- };
1797
-
1798
- /*
1799
- * Recursively walks React element tree removing any id props for descendant nodes
1800
- */
1801
- function recursivelyRemoveIds(element) {
1802
- var walker = function (element) {
1803
- if (!React.isValidElement(element)) {
1804
- return element;
1805
- }
1806
- return React.cloneElement(element, {
1807
- // we can't remove attributes, but react treats undefined/null as "absent"
1808
- id: null
1809
- }, React.Children.map(element.props.children, function (childElement) {
1810
- return walker(childElement);
1811
- }));
1812
- };
1813
- return Array.isArray(element)
1814
- ? React.Children.map(element, walker)
1815
- : walker(element);
1816
- }
1817
-
1818
- var Pointout = /** @class */ (function (_super) {
1819
- tslib.__extends(Pointout, _super);
1820
- function Pointout(props) {
1821
- var _this = _super.call(this, props) || this;
1822
- // Mirror the offscreen focus to the visible content
1823
- _this.attachOffscreenListeners = function () {
1824
- var _a = _this, offscreenRef = _a.offscreenRef, offscreenContentRef = _a.offscreenContentRef, handleOffscreenFocusIn = _a.handleOffscreenFocusIn, handleOffscreenFocusOut = _a.handleOffscreenFocusOut, handleOffscreenContentFocusIn = _a.handleOffscreenContentFocusIn, handleOffscreenContentFocusOut = _a.handleOffscreenContentFocusOut;
1825
- if (offscreenRef) {
1826
- offscreenRef.removeEventListener('focusin', handleOffscreenFocusIn);
1827
- offscreenRef.addEventListener('focusin', handleOffscreenFocusIn);
1828
- offscreenRef.removeEventListener('focusout', handleOffscreenFocusOut);
1829
- offscreenRef.addEventListener('focusout', handleOffscreenFocusOut);
1830
- }
1831
- // Manually handle offscreen content since it has a -1 tab index
1832
- if (offscreenContentRef) {
1833
- offscreenContentRef.removeEventListener('focusin', handleOffscreenContentFocusIn);
1834
- offscreenContentRef.addEventListener('focusin', handleOffscreenContentFocusIn);
1835
- offscreenContentRef.removeEventListener('focusout', handleOffscreenContentFocusOut);
1836
- offscreenContentRef.addEventListener('focusout', handleOffscreenContentFocusOut);
1837
- }
1838
- };
1839
- _this.handleOffscreenContentFocusIn = function (_a) {
1840
- var target = _a.target;
1841
- if (target === _this.offscreenContentRef) {
1842
- _this.setState({ offscreenContentFocus: true });
1843
- }
1844
- };
1845
- _this.handleOffscreenContentFocusOut = function (_a) {
1846
- var target = _a.target;
1847
- if (target === _this.offscreenContentRef) {
1848
- _this.setState({ offscreenContentFocus: false });
1849
- }
1850
- };
1851
- _this.handleOffscreenFocusIn = function (_a) {
1852
- var e_1, _b;
1853
- var target = _a.target;
1854
- var _c = _this, offscreenRef = _c.offscreenRef, visibleRef = _c.visibleRef, getFocusableElements = _c.getFocusableElements;
1855
- var offscreenFocusable = getFocusableElements(offscreenRef);
1856
- var visibleFocusable = getFocusableElements(visibleRef);
1857
- var elementIndex = offscreenFocusable.findIndex(function (element) { return element === target; });
1858
- if (elementIndex === -1 || !visibleFocusable[elementIndex]) {
1859
- return;
1860
- }
1861
- try {
1862
- // Tag focusable elements
1863
- for (var visibleFocusable_1 = tslib.__values(visibleFocusable), visibleFocusable_1_1 = visibleFocusable_1.next(); !visibleFocusable_1_1.done; visibleFocusable_1_1 = visibleFocusable_1.next()) {
1864
- var element = visibleFocusable_1_1.value;
1865
- element.setAttribute('data-focusable', 'true');
1866
- element.setAttribute('tabindex', '-1');
1867
- }
1868
- }
1869
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1870
- finally {
1871
- try {
1872
- if (visibleFocusable_1_1 && !visibleFocusable_1_1.done && (_b = visibleFocusable_1.return)) _b.call(visibleFocusable_1);
1873
- }
1874
- finally { if (e_1) throw e_1.error; }
1875
- }
1876
- visibleFocusable[elementIndex].classList.add('Pointout--focus-active');
1877
- };
1878
- _this.handleOffscreenFocusOut = function (_a) {
1879
- var target = _a.target;
1880
- var _b = _this, offscreenRef = _b.offscreenRef, visibleRef = _b.visibleRef, getFocusableElements = _b.getFocusableElements;
1881
- var offscreenFocusable = getFocusableElements(offscreenRef);
1882
- var visibleFocusable = getFocusableElements(visibleRef);
1883
- var elementIndex = offscreenFocusable.findIndex(function (element) { return element === target; });
1884
- if (elementIndex === -1 || !visibleFocusable[elementIndex]) {
1885
- return;
1886
- }
1887
- visibleFocusable[elementIndex].classList.remove('Pointout--focus-active');
1888
- };
1889
- _this.positionRelativeToTarget = function () {
1890
- var _a = _this.props, target = _a.target, portal = _a.portal, arrowPosition = _a.arrowPosition, position = _a.position;
1891
- if (!target) {
1892
- return;
1893
- }
1894
- var targetNode = (target === null || target === void 0 ? void 0 : target.current) ||
1895
- target;
1896
- var portalNode = (portal === null || portal === void 0 ? void 0 : portal.current) ||
1897
- portal;
1898
- // eslint-disable-next-line prefer-const
1899
- var _b = targetNode.getBoundingClientRect(), top = _b.top, left = _b.left, width = _b.width, height = _b.height;
1900
- if (portalNode && portalNode !== document.body) {
1901
- // If the portal is not placed on document.body
1902
- // position the FTPO relative to the portal
1903
- var rect = portalNode.getBoundingClientRect();
1904
- top -= rect.top - portalNode.scrollTop;
1905
- left -= rect.left - portalNode.scrollLeft;
1906
- }
1907
- var _c = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _c[0];
1908
- var style;
1909
- switch (arrowBoxSide) {
1910
- case 'right':
1911
- style = {
1912
- left: "".concat(left, "px"),
1913
- top: "".concat(position === 'center'
1914
- ? top + height / 2
1915
- : position === 'start'
1916
- ? top
1917
- : top + height, "px")
1918
- };
1919
- break;
1920
- case 'bottom':
1921
- style = {
1922
- top: "".concat(top, "px"),
1923
- left: "".concat(position === 'center'
1924
- ? left + width / 2
1925
- : position === 'start'
1926
- ? left
1927
- : left + width, "px")
1928
- };
1929
- break;
1930
- case 'left':
1931
- style = {
1932
- left: "".concat(left + width, "px"),
1933
- top: "".concat(position === 'center'
1934
- ? top + height / 2
1935
- : position === 'start'
1936
- ? top
1937
- : top + height, "px")
1938
- };
1939
- break;
1940
- case 'top':
1941
- default:
1942
- style = {
1943
- top: "".concat(top + height, "px"),
1944
- left: "".concat(position === 'center'
1945
- ? left + width / 2
1946
- : position === 'start'
1947
- ? left
1948
- : left + width, "px")
1949
- };
1950
- break;
1951
- }
1952
- _this.setState({ style: style });
1953
- };
1954
- _this.state = { show: true, style: {} };
1955
- _this.onCloseClick = _this.onCloseClick.bind(_this);
1956
- return _this;
1957
- }
1958
- Pointout.prototype.getFocusableElements = function (root) {
1959
- return root
1960
- ? Array.from(root.querySelectorAll("".concat(focusable__default["default"], ", [data-focusable]")))
1961
- : [];
1962
- };
1963
- Pointout.prototype.componentDidMount = function () {
1964
- var _this = this;
1965
- var _a = this, positionRelativeToTarget = _a.positionRelativeToTarget, attachOffscreenListeners = _a.attachOffscreenListeners;
1966
- positionRelativeToTarget();
1967
- this.setState({ headingId: randomId() });
1968
- // debounce resize event to rAF
1969
- this.resizeDebounce = function () {
1970
- if (_this.resizeDebounceId) {
1971
- cancelAnimationFrame(_this.resizeDebounceId);
1972
- }
1973
- _this.resizeDebounceId = requestAnimationFrame(function () {
1974
- _this.positionRelativeToTarget();
1975
- });
1976
- };
1977
- window.addEventListener('resize', this.resizeDebounce);
1978
- attachOffscreenListeners();
1979
- // If the component mounts before fonts have finished loading, ensure that we
1980
- // reposition the element when all fonts are ready
1981
- if (document && document.fonts && document.fonts.ready) {
1982
- // experiemental apis aren't in typescript's lib file :(
1983
- // https://github.com/Microsoft/TypeScript/issues/30984
1984
- document.fonts.ready.then(function () { return _this.positionRelativeToTarget(); });
1985
- }
1986
- };
1987
- Pointout.prototype.forceUpdate = function () {
1988
- var _this = this;
1989
- _super.prototype.forceUpdate.call(this);
1990
- requestAnimationFrame(function () { return _this.positionRelativeToTarget(); });
1991
- };
1992
- Pointout.prototype.componentWillUnmount = function () {
1993
- var _a = this, resizeDebounce = _a.resizeDebounce, offscreenRef = _a.offscreenRef, offscreenContentRef = _a.offscreenContentRef, handleOffscreenFocusIn = _a.handleOffscreenFocusIn, handleOffscreenFocusOut = _a.handleOffscreenFocusOut, handleOffscreenContentFocusIn = _a.handleOffscreenContentFocusIn, handleOffscreenContentFocusOut = _a.handleOffscreenContentFocusOut;
1994
- if (resizeDebounce) {
1995
- window.removeEventListener('resize', resizeDebounce);
1996
- }
1997
- if (offscreenRef) {
1998
- offscreenRef.removeEventListener('focusin', handleOffscreenFocusIn);
1999
- offscreenRef.removeEventListener('focusout', handleOffscreenFocusOut);
2000
- }
2001
- if (offscreenContentRef) {
2002
- offscreenContentRef.removeEventListener('focusin', handleOffscreenContentFocusIn);
2003
- offscreenContentRef.removeEventListener('focusout', handleOffscreenContentFocusOut);
2004
- }
2005
- };
2006
- Pointout.prototype.componentDidUpdate = function (nextProps) {
2007
- var _a = this, props = _a.props, attachOffscreenListeners = _a.attachOffscreenListeners, positionRelativeToTarget = _a.positionRelativeToTarget;
2008
- if (props.arrowPosition !== nextProps.arrowPosition ||
2009
- props.portal !== nextProps.portal ||
2010
- props.target !== nextProps.target ||
2011
- props.disableOffscreenPointout !== nextProps.disableOffscreenPointout) {
2012
- attachOffscreenListeners();
2013
- positionRelativeToTarget();
2014
- }
2015
- };
2016
- Pointout.prototype.render = function () {
2017
- var _a, _b;
2018
- var _this = this;
2019
- var _c;
2020
- var _d = this.state, show = _d.show, style = _d.style, offscreenContentFocus = _d.offscreenContentFocus, headingId = _d.headingId;
2021
- var _e = this.props, heading = _e.heading, ftpoRef = _e.ftpoRef, children = _e.children, noArrow = _e.noArrow, dismissText = _e.dismissText, previousText = _e.previousText, nextText = _e.nextText, showNext = _e.showNext, showPrevious = _e.showPrevious, arrowPosition = _e.arrowPosition, position = _e.position, className = _e.className, target = _e.target, disableOffscreenPointout = _e.disableOffscreenPointout, previousButtonProps = _e.previousButtonProps, nextButtonProps = _e.nextButtonProps, closeButtonProps = _e.closeButtonProps;
2022
- if (!show || !isBrowser()) {
2023
- return null;
2024
- }
2025
- var portal = this.props.portal || document.body;
2026
- var FTPO = (React__default["default"].createElement("div", { className: classNames__default["default"](className, 'Pointout', (_a = {
2027
- 'Pointout--no-arrow': noArrow,
2028
- 'Pointout--auto': !!target
2029
- },
2030
- _a["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
2031
- _a["Pointout--".concat(position)] = !!target,
2032
- _a)), style: style, role: target ? undefined : 'region', "aria-labelledby": heading ? headingId : undefined, "aria-hidden": !!target && !disableOffscreenPointout, ref: function (el) { return (_this.visibleRef = el); } },
2033
- noArrow ? null : (React__default["default"].createElement("div", { className: classNames__default["default"]('Pointout__arrow', (_b = {},
2034
- _b["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
2035
- _b)) },
2036
- React__default["default"].createElement("div", { className: "Pointout__arrow-pointer" }))),
2037
- React__default["default"].createElement("div", { className: "Pointout__box" },
2038
- React__default["default"].createElement("button", tslib.__assign({ className: "Pointout__dismiss", type: "button", "aria-label": dismissText, onClick: this.onCloseClick, tabIndex: !!target && !disableOffscreenPointout ? -1 : 0 }, closeButtonProps),
2039
- React__default["default"].createElement(Icon, { type: "close", "aria-hidden": "true" })),
2040
- React__default["default"].createElement("div", { className: classNames__default["default"]('Pointout__content', {
2041
- 'Pointout__content--focus-active': offscreenContentFocus
2042
- }), tabIndex: !target ? -1 : undefined, ref: ftpoRef },
2043
- heading &&
2044
- React__default["default"].cloneElement(heading, {
2045
- id: target ? null : headingId,
2046
- className: classNames__default["default"]('Pointout__heading', (_c = heading.props) === null || _c === void 0 ? void 0 : _c.className)
2047
- }),
2048
- target ? recursivelyRemoveIds(children) : children),
2049
- showPrevious && (React__default["default"].createElement("button", tslib.__assign({ className: "Pointout__previous", type: "button", "aria-label": previousText, tabIndex: !!target && !disableOffscreenPointout ? -1 : 0 }, previousButtonProps),
2050
- React__default["default"].createElement(Icon, { type: "arrow-left", "aria-hidden": "true" }))),
2051
- showNext && (React__default["default"].createElement("button", tslib.__assign({ className: "Pointout__next", type: "button", "aria-label": nextText, tabIndex: !!target && !disableOffscreenPointout ? -1 : 0 }, nextButtonProps),
2052
- React__default["default"].createElement(Icon, { type: "arrow-right", "aria-hidden": "true" }))))));
2053
- if (target && portal && !disableOffscreenPointout) {
2054
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
2055
- React__default["default"].createElement("div", { className: "Offscreen", role: "region", "aria-labelledby": heading ? headingId : undefined, ref: function (el) { return (_this.offscreenRef = el); } },
2056
- React__default["default"].createElement("button", tslib.__assign({ type: "button", "aria-label": dismissText, onClick: this.onCloseClick }, closeButtonProps)),
2057
- React__default["default"].createElement("div", { className: "Pointout__content", tabIndex: -1, ref: function (el) { return (_this.offscreenContentRef = el); } },
2058
- heading &&
2059
- React__default["default"].cloneElement(heading, {
2060
- id: headingId
2061
- }),
2062
- children),
2063
- showPrevious && (React__default["default"].createElement("button", tslib.__assign({ type: "button", "aria-label": previousText }, previousButtonProps))),
2064
- showNext && (React__default["default"].createElement("button", tslib.__assign({ type: "button", "aria-label": nextText }, nextButtonProps)))),
2065
- reactDom.createPortal(FTPO, portal)));
2066
- }
2067
- return target && portal ? reactDom.createPortal(FTPO, portal) : FTPO;
2068
- };
2069
- Pointout.prototype.onCloseClick = function () {
2070
- var _a;
2071
- this.setState({ show: false });
2072
- (_a = this.props) === null || _a === void 0 ? void 0 : _a.onClose();
2073
- };
2074
- Pointout.defaultProps = {
2075
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2076
- ftpoRef: function () { },
2077
- noArrow: false,
2078
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2079
- onClose: function () { },
2080
- dismissText: 'dismiss',
2081
- previousText: 'previous',
2082
- nextText: 'next',
2083
- arrowPosition: 'top-left',
2084
- position: 'center'
2085
- };
2086
- return Pointout;
2087
- }(React__default["default"].Component));
2088
-
2089
1790
  /**
2090
1791
  * A querySelectorAll that returns a normal array rather than live node list.
2091
1792
  *
@@ -2275,7 +1976,7 @@ var Link = function (_a) {
2275
1976
  Link.displayName = 'Link';
2276
1977
 
2277
1978
  var Loader = React__default["default"].forwardRef(function (_a, ref) {
2278
- var className = _a.className, _b = _a.variant, variant = _b === void 0 ? 'small' : _b, label = _a.label, props = tslib.__rest(_a, ["className", "variant", "label"]);
1979
+ var className = _a.className, label = _a.label, props = tslib.__rest(_a, ["className", "label"]);
2279
1980
  if (label === null || label === void 0 ? void 0 : label.length) {
2280
1981
  props['role'] = 'alert';
2281
1982
  props.children = React__default["default"].createElement(Offscreen, null, label);
@@ -2283,10 +1984,16 @@ var Loader = React__default["default"].forwardRef(function (_a, ref) {
2283
1984
  else {
2284
1985
  props['aria-hidden'] = true;
2285
1986
  }
2286
- return (React__default["default"].createElement("div", tslib.__assign({ ref: ref, className: classNames__default["default"]('Loader', className, variant === 'large' && 'Loader--large', variant === 'small' && 'Loader--small') }, props)));
1987
+ return (React__default["default"].createElement("div", tslib.__assign({ ref: ref, className: classNames__default["default"]('Loader', className) }, props)));
2287
1988
  });
2288
1989
  Loader.displayName = 'Loader';
2289
1990
 
1991
+ var i = 0;
1992
+ var randomId = function () {
1993
+ var num = Math.floor(Math.random() * 10000) + 1;
1994
+ return "x_".concat(i++, "_").concat(num);
1995
+ };
1996
+
2290
1997
  /**
2291
1998
  * Adds an id to a token list attribute if its not already present in the list
2292
1999
  */
@@ -2422,32 +2129,51 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
2422
2129
  });
2423
2130
  RadioGroup.displayName = 'RadioGroup';
2424
2131
 
2425
- var Card = function (_a) {
2426
- var className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["className", "variant"]);
2427
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"](className, {
2428
- 'Card--simple': variant === 'simple',
2429
- Card: !variant
2430
- }) }, other)));
2431
- };
2432
- Card.displayName = 'Card';
2433
-
2434
- var CardHeader = function (_a) {
2435
- var className = _a.className, other = tslib.__rest(_a, ["className"]);
2436
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Card__header', className) }, other)));
2437
- };
2438
- CardHeader.displayName = 'CardHeader';
2132
+ var Panel = React.forwardRef(function (_a, ref) {
2133
+ var _b;
2134
+ var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, _c = _a.padding, padding = _c === void 0 ? true : _c, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading", "padding"]);
2135
+ var headingId = !heading
2136
+ ? undefined
2137
+ : typeof heading === 'object' && 'id' in heading
2138
+ ? heading.id
2139
+ : randomId();
2140
+ var Heading = function () {
2141
+ if (!headingId) {
2142
+ return null;
2143
+ }
2144
+ var HeadingComponent = "h".concat(heading &&
2145
+ typeof heading === 'object' &&
2146
+ 'level' in heading &&
2147
+ !!heading.level
2148
+ ? heading.level
2149
+ : 2);
2150
+ return (React__default["default"].createElement(HeadingComponent, { id: headingId, className: "Panel__Heading" }, heading && typeof heading === 'object' && 'text' in heading
2151
+ ? heading.text
2152
+ : heading));
2153
+ };
2154
+ return (React__default["default"].createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames__default["default"]('Panel', className, (_b = {},
2155
+ _b['Panel--collapsed'] = collapsed,
2156
+ _b['Panel--no-padding'] = !padding,
2157
+ _b)), ref: ref }, other),
2158
+ React__default["default"].createElement(Heading, null),
2159
+ children));
2160
+ });
2161
+ Panel.displayName = 'Panel';
2439
2162
 
2440
- var CardContent = function (_a) {
2441
- var className = _a.className, other = tslib.__rest(_a, ["className"]);
2442
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Card__content', className) }, other)));
2443
- };
2444
- CardContent.displayName = 'CardContent';
2163
+ var PanelContent = React.forwardRef(function (_a, ref) {
2164
+ var _b;
2165
+ var children = _a.children, className = _a.className, _c = _a.padding, padding = _c === void 0 ? true : _c, otherProps = tslib.__rest(_a, ["children", "className", "padding"]);
2166
+ return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Panel__Content', className, (_b = {},
2167
+ _b['Panel__Content--no-padding'] = !padding,
2168
+ _b)), ref: ref }, otherProps), children));
2169
+ });
2170
+ PanelContent.displayName = 'PanelContent';
2445
2171
 
2446
- var CardFooter = function (_a) {
2447
- var className = _a.className, other = tslib.__rest(_a, ["className"]);
2448
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Card__footer', className) }, other)));
2449
- };
2450
- CardFooter.displayName = 'CardFooter';
2172
+ var PanelHeader = React.forwardRef(function (_a, ref) {
2173
+ var children = _a.children, className = _a.className, otherProps = tslib.__rest(_a, ["children", "className"]);
2174
+ return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Panel__Header', className), ref: ref }, otherProps), children));
2175
+ });
2176
+ PanelHeader.displayName = 'PanelHeader';
2451
2177
 
2452
2178
  var RadioCardGroup = function (_a) {
2453
2179
  var name = _a.name, radios = _a.radios, defaultValue = _a.defaultValue, value = _a.value,
@@ -2481,7 +2207,7 @@ var RadioCardGroup = function (_a) {
2481
2207
  var isChecked = currentValue === radioValue;
2482
2208
  var isFocused = focusIndex === index;
2483
2209
  return (React__default["default"].createElement("div", { className: classNames__default["default"]('RadioCard'), key: index },
2484
- React__default["default"].createElement(Card, { variant: "simple", className: classNames__default["default"]('RadioCardGroup__Card RadioCard__overlay', {
2210
+ React__default["default"].createElement(Panel, { className: classNames__default["default"]('RadioCardGroup__Card RadioCard__overlay', {
2485
2211
  'RadioCard__overlay--focused': isFocused,
2486
2212
  'RadioCard__overlay--checked': isChecked,
2487
2213
  'RadioCard__overlay--disabled': disabled
@@ -2496,7 +2222,7 @@ var RadioCardGroup = function (_a) {
2496
2222
  handleChange(radioValue);
2497
2223
  onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2498
2224
  }, disabled: disabled, checked: isChecked }, other)),
2499
- React__default["default"].createElement(CardContent, null,
2225
+ React__default["default"].createElement(PanelContent, null,
2500
2226
  React__default["default"].createElement("div", { className: classNames__default["default"]('RadioCardGroup__Checked') }, isChecked && (React__default["default"].createElement(Icon, { className: classNames__default["default"]('RadioCardGroup__Icon'), type: cardIcon }))),
2501
2227
  React__default["default"].createElement("div", { className: classNames__default["default"]('RadioCardGroup__Base') },
2502
2228
  React__default["default"].createElement("div", { className: classNames__default["default"]('RadioCardGroup__Image') }, cardImg),
@@ -2734,7 +2460,7 @@ function useSharedRef(ref) {
2734
2460
  }
2735
2461
 
2736
2462
  var LoaderOverlay = React.forwardRef(function (_a, ref) {
2737
- var className = _a.className, variant = _a.variant, label = _a.label, children = _a.children, focusOnInitialRender = _a.focusOnInitialRender, _b = _a.focusTrap, focusTrap = _b === void 0 ? false : _b, other = tslib.__rest(_a, ["className", "variant", "label", "children", "focusOnInitialRender", "focusTrap"]);
2463
+ var className = _a.className, label = _a.label, children = _a.children, focusOnInitialRender = _a.focusOnInitialRender, _b = _a.focusTrap, focusTrap = _b === void 0 ? false : _b, other = tslib.__rest(_a, ["className", "label", "children", "focusOnInitialRender", "focusTrap"]);
2738
2464
  var overlayRef = useSharedRef(ref);
2739
2465
  React.useEffect(function () {
2740
2466
  var isolator = overlayRef.current
@@ -2765,13 +2491,9 @@ var LoaderOverlay = React.forwardRef(function (_a, ref) {
2765
2491
  }
2766
2492
  : {};
2767
2493
  return (React__default["default"].createElement(Wrapper, tslib.__assign({}, wrapperProps),
2768
- React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Loader__overlay', className, variant === 'large'
2769
- ? 'Loader__overlay--large'
2770
- : variant === 'small'
2771
- ? 'Loader__overlay--small'
2772
- : ''), ref: overlayRef, tabIndex: -1 }, other),
2494
+ React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Loader__overlay', className), ref: overlayRef, tabIndex: -1 }, other),
2773
2495
  React__default["default"].createElement("div", { className: "Loader__overlay__loader" },
2774
- React__default["default"].createElement(Loader, { variant: variant }),
2496
+ React__default["default"].createElement(Loader, null),
2775
2497
  React__default["default"].createElement(AxeLoader, null)),
2776
2498
  label ? (React__default["default"].createElement("span", { className: "Loader__overlay__label" }, label)) : null,
2777
2499
  children)));
@@ -3048,62 +2770,6 @@ var Stepper = function (_a) {
3048
2770
  };
3049
2771
  Stepper.displayName = 'Stepper';
3050
2772
 
3051
- var Panel = React.forwardRef(function (_a, ref) {
3052
- var _b;
3053
- var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, _c = _a.padding, padding = _c === void 0 ? true : _c, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading", "padding"]);
3054
- var headingId = !heading
3055
- ? undefined
3056
- : typeof heading === 'object' && 'id' in heading
3057
- ? heading.id
3058
- : randomId();
3059
- var Heading = function () {
3060
- if (!headingId) {
3061
- return null;
3062
- }
3063
- var HeadingComponent = "h".concat(heading &&
3064
- typeof heading === 'object' &&
3065
- 'level' in heading &&
3066
- !!heading.level
3067
- ? heading.level
3068
- : 2);
3069
- return (React__default["default"].createElement(HeadingComponent, { id: headingId, className: "Panel__Heading" }, heading && typeof heading === 'object' && 'text' in heading
3070
- ? heading.text
3071
- : heading));
3072
- };
3073
- return (React__default["default"].createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames__default["default"]('Panel', className, (_b = {},
3074
- _b['Panel--collapsed'] = collapsed,
3075
- _b['Panel--no-padding'] = !padding,
3076
- _b)), ref: ref }, other),
3077
- React__default["default"].createElement(Heading, null),
3078
- children));
3079
- });
3080
- Panel.displayName = 'Panel';
3081
-
3082
- var PanelContent = React.forwardRef(function (_a, ref) {
3083
- var _b;
3084
- var children = _a.children, className = _a.className, _c = _a.padding, padding = _c === void 0 ? true : _c, otherProps = tslib.__rest(_a, ["children", "className", "padding"]);
3085
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Panel__Content', className, (_b = {},
3086
- _b['Panel__Content--no-padding'] = !padding,
3087
- _b)), ref: ref }, otherProps), children));
3088
- });
3089
- PanelContent.displayName = 'PanelContent';
3090
-
3091
- var PanelHeader = React.forwardRef(function (_a, ref) {
3092
- var children = _a.children, className = _a.className, otherProps = tslib.__rest(_a, ["children", "className"]);
3093
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Panel__Header', className), ref: ref }, otherProps), children));
3094
- });
3095
- PanelHeader.displayName = 'PanelHeader';
3096
-
3097
- var IssuePanel = function (_a) {
3098
- var className = _a.className, _b = _a.title, title = _b === void 0 ? '' : _b, actions = _a.actions, children = _a.children;
3099
- return (React__default["default"].createElement("div", { className: classNames__default["default"]('IssuePanel', className) },
3100
- React__default["default"].createElement("div", { className: "IssuePanel__Header" },
3101
- title && React__default["default"].createElement("div", { className: "IssuePanel__Header-title" }, title),
3102
- actions && (React__default["default"].createElement("div", { className: "IssuePanel__Header-actions" }, actions))),
3103
- React__default["default"].createElement("div", { className: "IssuePanel__Content" }, children)));
3104
- };
3105
- IssuePanel.displayName = 'IssuePanel';
3106
-
3107
2773
  var ProgressBar = React.forwardRef(function (_a, ref) {
3108
2774
  var _b = _a.progress, progress = _b === void 0 ? 0 : _b, _c = _a.progressMax, progressMax = _c === void 0 ? 100 : _c, _d = _a.progressMin, progressMin = _d === void 0 ? 0 : _d, props = tslib.__rest(_a, ["progress", "progressMax", "progressMin"]);
3109
2775
  var className = props.className, otherProps = tslib.__rest(props, ["className"]);
@@ -4270,10 +3936,6 @@ exports.Breadcrumb = Breadcrumb;
4270
3936
  exports.BreadcrumbItem = BreadcrumbItem;
4271
3937
  exports.BreadcrumbLink = BreadcrumbLink;
4272
3938
  exports.Button = Button;
4273
- exports.Card = Card;
4274
- exports.CardContent = CardContent;
4275
- exports.CardFooter = CardFooter;
4276
- exports.CardHeader = CardHeader;
4277
3939
  exports.Checkbox = Checkbox;
4278
3940
  exports.ClickOutsideListener = ClickOutsideListener;
4279
3941
  exports.Code = Code;
@@ -4296,7 +3958,6 @@ exports.ExpandCollapsePanel = ExpandCollapsePanel;
4296
3958
  exports.FieldWrap = FieldWrap;
4297
3959
  exports.Icon = Icon;
4298
3960
  exports.IconButton = IconButton;
4299
- exports.IssuePanel = IssuePanel;
4300
3961
  exports.Layout = Layout;
4301
3962
  exports.Line = Line;
4302
3963
  exports.Link = Link;
@@ -4325,7 +3986,6 @@ exports.Panel = Panel;
4325
3986
  exports.PanelContent = PanelContent;
4326
3987
  exports.PanelHeader = PanelHeader;
4327
3988
  exports.PanelTrigger = PanelTrigger$1;
4328
- exports.Pointout = Pointout;
4329
3989
  exports.Popover = Popover;
4330
3990
  exports.ProgressBar = ProgressBar;
4331
3991
  exports.RadioCardGroup = RadioCardGroup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "5.13.0-canary.301c546b",
3
+ "version": "5.13.0-canary.7b5349dc",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
3
- variant?: 'simple';
4
- }
5
- declare const Card: {
6
- ({ className, variant, ...other }: CardProps): React.JSX.Element;
7
- displayName: string;
8
- };
9
- export default Card;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {
3
- className?: string;
4
- };
5
- declare const CardContent: {
6
- ({ className, ...other }: CardContentProps): React.JSX.Element;
7
- displayName: string;
8
- };
9
- export default CardContent;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export type CardFooterProps = React.HTMLAttributes<HTMLDivElement> & {
3
- className?: string;
4
- };
5
- declare const CardFooter: {
6
- ({ className, ...other }: CardFooterProps): React.JSX.Element;
7
- displayName: string;
8
- };
9
- export default CardFooter;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export type CardHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
3
- className?: string;
4
- };
5
- declare const CardHeader: {
6
- ({ className, ...other }: CardHeaderProps): React.JSX.Element;
7
- displayName: string;
8
- };
9
- export default CardHeader;
@@ -1,4 +0,0 @@
1
- export { default } from './Card';
2
- export { default as CardHeader } from './CardHeader';
3
- export { default as CardContent } from './CardContent';
4
- export { default as CardFooter } from './CardFooter';
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import IconButton from '../IconButton';
3
- declare const IssuePanel: {
4
- ({ className, title, actions, children }: {
5
- className?: string | undefined;
6
- title?: string | undefined;
7
- actions?: import("../../utils/polymorphic-type").ForwardRefComponent<"button", import("../IconButton").IconButtonOwnProps>[] | undefined;
8
- children: React.ReactNode;
9
- }): React.JSX.Element;
10
- displayName: string;
11
- };
12
- export default IssuePanel;
@@ -1,61 +0,0 @@
1
- import React, { ButtonHTMLAttributes } from 'react';
2
- export interface PointoutProps {
3
- arrowPosition: 'top-left' | 'top-right' | 'right-top' | 'right-bottom' | 'bottom-right' | 'bottom-left' | 'left-bottom' | 'left-top';
4
- position: 'start' | 'center' | 'end';
5
- heading?: React.ReactNode;
6
- className?: string;
7
- headerId: string;
8
- children: React.ReactNode;
9
- ftpoRef: React.Ref<HTMLDivElement>;
10
- noArrow?: boolean;
11
- onClose: () => void;
12
- dismissText?: string;
13
- nextText?: string;
14
- previousText?: string;
15
- showNext?: boolean;
16
- showPrevious?: boolean;
17
- disableOffscreenPointout?: boolean;
18
- target?: React.RefObject<HTMLElement> | HTMLElement;
19
- portal?: React.RefObject<HTMLElement> | HTMLElement;
20
- previousButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
21
- nextButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
22
- closeButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
23
- }
24
- interface PointoutState {
25
- show: boolean;
26
- style: React.CSSProperties;
27
- headingId?: string;
28
- offscreenContentFocus?: boolean;
29
- }
30
- export default class Pointout extends React.Component<PointoutProps, PointoutState> {
31
- static defaultProps: {
32
- ftpoRef: () => void;
33
- noArrow: boolean;
34
- onClose: () => void;
35
- dismissText: string;
36
- previousText: string;
37
- nextText: string;
38
- arrowPosition: string;
39
- position: string;
40
- };
41
- private resizeDebounceId;
42
- private resizeDebounce;
43
- private offscreenRef;
44
- private offscreenContentRef;
45
- private visibleRef;
46
- constructor(props: PointoutProps);
47
- getFocusableElements(root: HTMLElement | null): Element[];
48
- componentDidMount(): void;
49
- forceUpdate(): void;
50
- componentWillUnmount(): void;
51
- attachOffscreenListeners: () => void;
52
- handleOffscreenContentFocusIn: ({ target }: FocusEvent) => void;
53
- handleOffscreenContentFocusOut: ({ target }: FocusEvent) => void;
54
- handleOffscreenFocusIn: ({ target }: FocusEvent) => void;
55
- handleOffscreenFocusOut: ({ target }: FocusEvent) => void;
56
- positionRelativeToTarget: () => void;
57
- componentDidUpdate(nextProps: PointoutProps): void;
58
- render(): React.JSX.Element | null;
59
- onCloseClick(): void;
60
- }
61
- export {};