@deque/cauldron-react 1.0.0-canary.d3c0fb49 → 2.0.0-canary.14b73b8d
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,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { TooltipProps } from '../Tooltip';
|
|
3
|
+
interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
icon: string;
|
|
5
5
|
label: string;
|
|
6
|
-
tooltipPlacement?:
|
|
7
|
-
|
|
6
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
7
|
+
tooltipVariant?: TooltipProps['variant'];
|
|
8
|
+
tooltipPortal?: TooltipProps['portal'];
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'error';
|
|
8
10
|
}
|
|
9
11
|
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
12
|
export default IconButton;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DialogProps } from '../Dialog';
|
|
3
3
|
interface ModalProps extends Omit<DialogProps, 'forceAction'> {
|
|
4
|
+
variant?: 'info';
|
|
4
5
|
}
|
|
5
|
-
declare const Modal: ({ children, className, ...other }: ModalProps) => JSX.Element;
|
|
6
|
+
declare const Modal: ({ children, className, variant, ...other }: ModalProps) => JSX.Element;
|
|
6
7
|
declare const ModalContent: {
|
|
7
8
|
({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
8
9
|
displayName: string;
|
package/lib/index.js
CHANGED
|
@@ -472,11 +472,10 @@ var TopBar = /** @class */ (function (_super) {
|
|
|
472
472
|
}(React__default.Component));
|
|
473
473
|
|
|
474
474
|
var TopBar$1 = function (props) {
|
|
475
|
-
var children = props.children, className = props.className,
|
|
475
|
+
var children = props.children, className = props.className, other = tslib.__rest(props, ["children", "className"]);
|
|
476
476
|
return (React__default.createElement("div", tslib.__assign({ className: classNames(className, {
|
|
477
477
|
// TopBar's default style is dark mode
|
|
478
|
-
TopBar: true
|
|
479
|
-
'TopBar--light': variant === 'light'
|
|
478
|
+
TopBar: true
|
|
480
479
|
}) }, other), children));
|
|
481
480
|
};
|
|
482
481
|
|
|
@@ -1224,8 +1223,10 @@ var AlertContent = DialogContent;
|
|
|
1224
1223
|
var AlertActions = DialogFooter;
|
|
1225
1224
|
|
|
1226
1225
|
var Modal = function (_a) {
|
|
1227
|
-
var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
|
|
1228
|
-
return (React__default.createElement(Dialog, tslib.__assign({ className: classNames('Modal', className
|
|
1226
|
+
var children = _a.children, className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["children", "className", "variant"]);
|
|
1227
|
+
return (React__default.createElement(Dialog, tslib.__assign({ className: classNames('Modal', className, {
|
|
1228
|
+
'Modal--info': variant === 'info'
|
|
1229
|
+
}) }, other, { forceAction: false }), children));
|
|
1229
1230
|
};
|
|
1230
1231
|
var ModalContent = DialogContent;
|
|
1231
1232
|
var ModalFooter = DialogFooter;
|
|
@@ -1249,6 +1250,7 @@ var SkipLink = /** @class */ (function (_super) {
|
|
|
1249
1250
|
return (React__default.createElement("nav", tslib.__assign({ className: classNames('SkipLink', currentClass) }, other),
|
|
1250
1251
|
React__default.createElement("a", { href: target, className: "SkipLink__link", onClick: this.onClick, onFocus: this.onFocus, onBlur: this.onBlur },
|
|
1251
1252
|
React__default.createElement("span", { className: "SkipLink__item--first" }, skipText),
|
|
1253
|
+
"\u00A0",
|
|
1252
1254
|
React__default.createElement("span", { className: "SkipLink__item--second" }, targetText))));
|
|
1253
1255
|
};
|
|
1254
1256
|
SkipLink.prototype.onClick = function () {
|
|
@@ -1469,20 +1471,18 @@ var TooltipContent = function (_a) {
|
|
|
1469
1471
|
};
|
|
1470
1472
|
|
|
1471
1473
|
var IconButton = React.forwardRef(function (_a, ref) {
|
|
1472
|
-
var icon = _a.icon, label = _a.label, _b = _a.tooltipPlacement, tooltipPlacement = _b === void 0 ? 'auto' : _b, className = _a.className, _c = _a.variant, variant = _c === void 0 ? 'secondary' : _c, disabled = _a.disabled, other = tslib.__rest(_a, ["icon", "label", "tooltipPlacement", "className", "variant", "disabled"]);
|
|
1474
|
+
var icon = _a.icon, label = _a.label, _b = _a.tooltipPlacement, tooltipPlacement = _b === void 0 ? 'auto' : _b, tooltipVariant = _a.tooltipVariant, tooltipPortal = _a.tooltipPortal, className = _a.className, _c = _a.variant, variant = _c === void 0 ? 'secondary' : _c, disabled = _a.disabled, other = tslib.__rest(_a, ["icon", "label", "tooltipPlacement", "tooltipVariant", "tooltipPortal", "className", "variant", "disabled"]);
|
|
1473
1475
|
var buttonRef = React.useRef();
|
|
1474
1476
|
React.useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
1475
1477
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1476
1478
|
React__default.createElement("button", tslib.__assign({ type: 'button', className: classNames(className, {
|
|
1477
1479
|
IconButton: true,
|
|
1478
|
-
'IconButton--light': variant === 'light',
|
|
1479
|
-
'IconButton--dark': variant === 'dark',
|
|
1480
1480
|
'IconButton--primary': variant === 'primary',
|
|
1481
1481
|
'IconButton--secondary': variant === 'secondary',
|
|
1482
1482
|
'IconButton--error': variant === 'error'
|
|
1483
1483
|
}), ref: buttonRef, disabled: disabled }, other),
|
|
1484
1484
|
React__default.createElement(Icon, { type: icon })),
|
|
1485
|
-
!disabled && (React__default.createElement(Tooltip, { target: buttonRef, placement: tooltipPlacement, association: "aria-labelledby", hideElementOnHidden: true }, label))));
|
|
1485
|
+
!disabled && (React__default.createElement(Tooltip, { target: buttonRef, placement: tooltipPlacement, variant: tooltipVariant, portal: tooltipPortal, association: "aria-labelledby", hideElementOnHidden: true }, label))));
|
|
1486
1486
|
});
|
|
1487
1487
|
IconButton.propTypes = {
|
|
1488
1488
|
icon: PropTypes.string.isRequired,
|
|
@@ -1490,6 +1490,9 @@ IconButton.propTypes = {
|
|
|
1490
1490
|
// @ts-ignore
|
|
1491
1491
|
tooltipPlacement: PropTypes.string,
|
|
1492
1492
|
// @ts-ignore
|
|
1493
|
+
tooltipVariant: PropTypes.string,
|
|
1494
|
+
tooltipPortal: PropTypes.any,
|
|
1495
|
+
// @ts-ignore
|
|
1493
1496
|
variant: PropTypes.string
|
|
1494
1497
|
};
|
|
1495
1498
|
IconButton.displayName = 'IconButton';
|