@deque/cauldron-react 1.0.0 → 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;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
interface BaseStepProps {
|
|
4
|
+
status: 'current' | 'complete' | 'future';
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
interface StepWithChildren extends BaseStepProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
interface StepWithTooltip extends BaseStepProps {
|
|
11
|
+
tooltip: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare type StepProps = StepWithChildren | StepWithTooltip;
|
|
14
|
+
export declare const Step: {
|
|
15
|
+
(props: StepProps): JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
propTypes: {
|
|
18
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
19
|
+
tooltip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
|
+
className: PropTypes.Requireable<string>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
interface StepperProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
declare const Stepper: {
|
|
28
|
+
({ children, className, ...other }: StepperProps): JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
propTypes: {
|
|
31
|
+
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
32
|
+
className: PropTypes.Requireable<string>;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default Stepper;
|
package/lib/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export { default as Line } from './components/Line';
|
|
|
38
38
|
export { default as Tag, TagLabel } from './components/Tag';
|
|
39
39
|
export { default as Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './components/Table';
|
|
40
40
|
export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails } from './components/DescriptionList';
|
|
41
|
+
export { default as Stepper, Step } from './components/Stepper';
|
|
41
42
|
/**
|
|
42
43
|
* Helpers / Utils
|
|
43
44
|
*/
|
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, other = tslib.__rest(_a, ["icon", "label", "tooltipPlacement", "className", "variant"]);
|
|
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
|
-
}), ref: buttonRef }, other),
|
|
1483
|
+
}), ref: buttonRef, disabled: disabled }, other),
|
|
1484
1484
|
React__default.createElement(Icon, { type: icon })),
|
|
1485
|
-
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';
|
|
@@ -7900,6 +7903,40 @@ var DescriptionDetails = function (_a) {
|
|
|
7900
7903
|
DescriptionDetails.displayName = 'DescriptionDetails';
|
|
7901
7904
|
DescriptionDetails.propTypes = commonPropTypes;
|
|
7902
7905
|
|
|
7906
|
+
var isTooltip = function (props) {
|
|
7907
|
+
return !!props.tooltip;
|
|
7908
|
+
};
|
|
7909
|
+
var Step = function (props) {
|
|
7910
|
+
var status = props.status, className = props.className, other = tslib.__rest(props, ["status", "className"]);
|
|
7911
|
+
return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--" + status, className), "aria-current": status === 'current' ? 'step' : 'false' }, other),
|
|
7912
|
+
React__default.createElement("div", { className: "Stepper__step-line" }),
|
|
7913
|
+
React__default.createElement("div", { className: "Stepper__step-content" }, isTooltip(props) ? (React__default.createElement(TooltipTabstop, { placement: "bottom", tooltip: props.tooltip,
|
|
7914
|
+
// the pseudo content (ex: "1") is conveyed
|
|
7915
|
+
// by the list item's position in the set of
|
|
7916
|
+
// list items, therefore it is safe to clobber
|
|
7917
|
+
// it with the contents of the tooltip in the
|
|
7918
|
+
// tab stop's accessible name.
|
|
7919
|
+
association: "aria-labelledby" },
|
|
7920
|
+
React__default.createElement("div", { className: "Stepper__step-indicator" }))) : (React__default.createElement(React__default.Fragment, null,
|
|
7921
|
+
React__default.createElement("div", { className: "Stepper__step-indicator" }),
|
|
7922
|
+
'children' in props && (React__default.createElement("div", { className: "Stepper__step-label" }, props.children)))))));
|
|
7923
|
+
};
|
|
7924
|
+
Step.displayName = 'Step';
|
|
7925
|
+
Step.propTypes = {
|
|
7926
|
+
children: PropTypes.node,
|
|
7927
|
+
tooltip: PropTypes.node,
|
|
7928
|
+
className: PropTypes.string
|
|
7929
|
+
};
|
|
7930
|
+
var Stepper = function (_a) {
|
|
7931
|
+
var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
|
|
7932
|
+
return (React__default.createElement("ol", tslib.__assign({ className: classNames('Stepper', className) }, other), children));
|
|
7933
|
+
};
|
|
7934
|
+
Stepper.displayName = 'Stepper';
|
|
7935
|
+
Stepper.propTypes = {
|
|
7936
|
+
children: PropTypes.node.isRequired,
|
|
7937
|
+
className: PropTypes.string
|
|
7938
|
+
};
|
|
7939
|
+
|
|
7903
7940
|
var LIGHT_THEME_CLASS = 'cauldron--theme-light';
|
|
7904
7941
|
var DARK_THEME_CLASS = 'cauldron--theme-dark';
|
|
7905
7942
|
var ThemeContext = React.createContext({});
|
|
@@ -7997,6 +8034,8 @@ exports.SideBar = SideBar;
|
|
|
7997
8034
|
exports.SideBarItem = SideBarItem;
|
|
7998
8035
|
exports.Sidebar = SideBar;
|
|
7999
8036
|
exports.SkipLink = SkipLink;
|
|
8037
|
+
exports.Step = Step;
|
|
8038
|
+
exports.Stepper = Stepper;
|
|
8000
8039
|
exports.Table = Table;
|
|
8001
8040
|
exports.TableBody = TableBody;
|
|
8002
8041
|
exports.TableCell = TableCell;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deque/cauldron-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-canary.14b73b8d",
|
|
4
4
|
"description": "Fully accessible react components library for Deque Cauldron",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -123,4 +123,4 @@
|
|
|
123
123
|
"\\.svg$": "<rootDir>/__tests__/svgMock.js"
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
}
|
|
126
|
+
}
|