@deque/cauldron-react 4.4.0-canary.b7911a51 → 4.4.0-canary.f8ca4e9b
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.
- package/lib/components/Loader/index.d.ts +1 -8
- package/lib/components/Panel/index.d.ts +4 -13
- package/lib/index.js +11 -12
- package/package.json +1 -1
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
label?: string;
|
|
5
4
|
variant?: 'large' | 'small';
|
|
6
5
|
}
|
|
7
|
-
declare
|
|
8
|
-
declare namespace Loader {
|
|
9
|
-
var propTypes: {
|
|
10
|
-
className: PropTypes.Requireable<string>;
|
|
11
|
-
};
|
|
12
|
-
var displayName: string;
|
|
13
|
-
}
|
|
6
|
+
declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
7
|
export default Loader;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { HTMLAttributes,
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
3
2
|
interface PanelProps extends HTMLAttributes<HTMLElement> {
|
|
4
3
|
children: ReactNode;
|
|
5
|
-
heading?:
|
|
4
|
+
heading?: ReactNode | {
|
|
6
5
|
id?: string;
|
|
7
|
-
text:
|
|
6
|
+
text: ReactNode;
|
|
8
7
|
level: number | undefined;
|
|
9
8
|
};
|
|
10
9
|
collapsed?: boolean;
|
|
11
10
|
className?: string;
|
|
12
11
|
}
|
|
13
|
-
declare const Panel:
|
|
14
|
-
({ children, collapsed, className, heading, ...other }: PanelProps): JSX.Element;
|
|
15
|
-
displayName: string;
|
|
16
|
-
propTypes: {
|
|
17
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
18
|
-
heading: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
19
|
-
className: PropTypes.Requireable<string>;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
12
|
+
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<HTMLElement>>;
|
|
22
13
|
export default Panel;
|
package/lib/index.js
CHANGED
|
@@ -2223,7 +2223,7 @@ Link.propTypes = {
|
|
|
2223
2223
|
};
|
|
2224
2224
|
Link.displayName = 'Link';
|
|
2225
2225
|
|
|
2226
|
-
|
|
2226
|
+
var Loader = React__default.forwardRef(function (_a, ref) {
|
|
2227
2227
|
var className = _a.className, _b = _a.variant, variant = _b === void 0 ? 'small' : _b, label = _a.label, props = tslib.__rest(_a, ["className", "variant", "label"]);
|
|
2228
2228
|
if (label === null || label === void 0 ? void 0 : label.length) {
|
|
2229
2229
|
props['role'] = 'alert';
|
|
@@ -2232,12 +2232,8 @@ function Loader(_a) {
|
|
|
2232
2232
|
else {
|
|
2233
2233
|
props['aria-hidden'] = true;
|
|
2234
2234
|
}
|
|
2235
|
-
return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader', className, variant === 'large'
|
|
2236
|
-
|
|
2237
|
-
: variant === 'small'
|
|
2238
|
-
? 'Loader--small'
|
|
2239
|
-
: '') }, props)));
|
|
2240
|
-
}
|
|
2235
|
+
return (React__default.createElement("div", tslib.__assign({ ref: ref, className: classNames('Loader', className, variant === 'large' && 'Loader--large', variant === 'small' && 'Loader--small') }, props)));
|
|
2236
|
+
});
|
|
2241
2237
|
Loader.propTypes = {
|
|
2242
2238
|
className: PropTypes.string
|
|
2243
2239
|
};
|
|
@@ -8391,7 +8387,7 @@ Stepper.propTypes = {
|
|
|
8391
8387
|
className: PropTypes.string
|
|
8392
8388
|
};
|
|
8393
8389
|
|
|
8394
|
-
var Panel = function (_a) {
|
|
8390
|
+
var Panel = React.forwardRef(function (_a, ref) {
|
|
8395
8391
|
var _b;
|
|
8396
8392
|
var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading"]);
|
|
8397
8393
|
var headingId = !heading
|
|
@@ -8403,19 +8399,22 @@ var Panel = function (_a) {
|
|
|
8403
8399
|
if (!headingId) {
|
|
8404
8400
|
return null;
|
|
8405
8401
|
}
|
|
8406
|
-
var HeadingComponent = "h" + (
|
|
8402
|
+
var HeadingComponent = "h" + (heading &&
|
|
8403
|
+
typeof heading === 'object' &&
|
|
8404
|
+
'level' in heading &&
|
|
8405
|
+
!!heading.level
|
|
8407
8406
|
? heading.level
|
|
8408
8407
|
: 2);
|
|
8409
|
-
return (React__default.createElement(HeadingComponent, { id: headingId, className: "Panel__Heading" }, typeof heading === 'object' && 'text' in heading
|
|
8408
|
+
return (React__default.createElement(HeadingComponent, { id: headingId, className: "Panel__Heading" }, heading && typeof heading === 'object' && 'text' in heading
|
|
8410
8409
|
? heading.text
|
|
8411
8410
|
: heading));
|
|
8412
8411
|
};
|
|
8413
8412
|
return (React__default.createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames('Panel', className, (_b = {},
|
|
8414
8413
|
_b['Panel--collapsed'] = collapsed,
|
|
8415
|
-
_b)) }, other),
|
|
8414
|
+
_b)), ref: ref }, other),
|
|
8416
8415
|
React__default.createElement(Heading, null),
|
|
8417
8416
|
children));
|
|
8418
|
-
};
|
|
8417
|
+
});
|
|
8419
8418
|
Panel.displayName = 'Panel';
|
|
8420
8419
|
Panel.propTypes = {
|
|
8421
8420
|
children: PropTypes.node.isRequired,
|