@deque/cauldron-react 1.0.0-canary.f7873643 → 2.0.0-canary.4fab7c98
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/cauldron.css +38 -0
- package/lib/components/ExpandCollapsePanel/PanelTrigger.d.ts +2 -1
- package/lib/components/IconButton/index.d.ts +2 -2
- package/lib/components/Panel/index.d.ts +17 -0
- package/lib/components/TopBar/TopBar.d.ts +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +21 -10
- package/package.json +1 -1
package/lib/cauldron.css
CHANGED
|
@@ -1,28 +1,66 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--expandcollapse-trigger-background-color: transparent;
|
|
3
|
+
--expandcollapse-trigger-color: var(--gray-90);
|
|
4
|
+
--expandcollapse-panel-background-color: transparent;
|
|
5
|
+
--expandcollapse-panel-color: var(--gray-90);
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
.ExpandCollapse__trigger {
|
|
2
9
|
font-size: inherit;
|
|
3
10
|
display: flex;
|
|
4
11
|
align-items: center;
|
|
12
|
+
background-color: var(--expandcollapse-trigger-background-color);
|
|
13
|
+
color: var(--expandcollapse-trigger-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.fullWidth {
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ExpandCollapse__trigger-title {
|
|
21
|
+
flex-grow: 1;
|
|
22
|
+
text-align: left;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ExpandCollapse__panel {
|
|
26
|
+
background-color: var(--expandcollapse-panel-background-color);
|
|
27
|
+
color: var(--expandcollapse-panel-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Dark Theme */
|
|
31
|
+
|
|
32
|
+
.cauldron--theme-dark {
|
|
33
|
+
--expandcollapse-trigger-color: var(--white);
|
|
34
|
+
--expandcollapse-panel-color: var(--accent-light);
|
|
5
35
|
}
|
|
36
|
+
|
|
6
37
|
a.Button--primary {
|
|
7
38
|
text-decoration: none;
|
|
8
39
|
padding: 9px 18px;
|
|
9
40
|
}
|
|
41
|
+
|
|
10
42
|
.Icon {
|
|
11
43
|
display: inline-block;
|
|
12
44
|
vertical-align: middle;
|
|
13
45
|
}
|
|
46
|
+
|
|
14
47
|
.Icon svg {
|
|
15
48
|
display: block;
|
|
16
49
|
}
|
|
50
|
+
|
|
17
51
|
/* Icon--right is the default orientation */
|
|
52
|
+
|
|
18
53
|
.Icon__right {
|
|
19
54
|
}
|
|
55
|
+
|
|
20
56
|
.Icon__left {
|
|
21
57
|
transform: scaleX(-1);
|
|
22
58
|
}
|
|
59
|
+
|
|
23
60
|
.Icon__up {
|
|
24
61
|
transform: rotate(-90deg);
|
|
25
62
|
}
|
|
63
|
+
|
|
26
64
|
.Icon__down {
|
|
27
65
|
transform: rotate(90deg);
|
|
28
66
|
}
|
|
@@ -5,9 +5,10 @@ export interface PanelTriggerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
5
5
|
open: boolean;
|
|
6
6
|
}) => React.ReactNode) | React.ReactNode;
|
|
7
7
|
open?: boolean;
|
|
8
|
+
fullWidth?: string;
|
|
8
9
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
10
|
}
|
|
10
|
-
declare function PanelTrigger({ children, className, open, onClick, ...other }: PanelTriggerProps): JSX.Element;
|
|
11
|
+
declare function PanelTrigger({ children, className, open, fullWidth, onClick, ...other }: PanelTriggerProps): JSX.Element;
|
|
11
12
|
declare namespace PanelTrigger {
|
|
12
13
|
var propTypes: {
|
|
13
14
|
children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TooltipProps } from '../Tooltip';
|
|
3
|
-
interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
icon: string;
|
|
5
5
|
label: string;
|
|
6
6
|
tooltipPlacement?: TooltipProps['placement'];
|
|
7
7
|
tooltipVariant?: TooltipProps['variant'];
|
|
8
8
|
tooltipPortal?: TooltipProps['portal'];
|
|
9
|
-
variant?: '
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'error';
|
|
10
10
|
}
|
|
11
11
|
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
export default IconButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import IconButton from '../IconButton';
|
|
4
|
+
declare const Panel: {
|
|
5
|
+
({ className, title, actions, children }: {
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
actions?: React.ForwardRefExoticComponent<import("../IconButton").IconButtonProps & React.RefAttributes<HTMLButtonElement>>[] | undefined;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
propTypes: {
|
|
13
|
+
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
14
|
+
className: PropTypes.Requireable<string>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default Panel;
|
package/lib/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ 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
41
|
export { default as Stepper, Step } from './components/Stepper';
|
|
42
|
+
export { default as Panel } from './components/Panel';
|
|
42
43
|
/**
|
|
43
44
|
* Helpers / Utils
|
|
44
45
|
*/
|
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
|
|
|
@@ -1478,8 +1477,6 @@ var IconButton = React.forwardRef(function (_a, ref) {
|
|
|
1478
1477
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1479
1478
|
React__default.createElement("button", tslib.__assign({ type: 'button', className: classNames(className, {
|
|
1480
1479
|
IconButton: true,
|
|
1481
|
-
'IconButton--light': variant === 'light',
|
|
1482
|
-
'IconButton--dark': variant === 'dark',
|
|
1483
1480
|
'IconButton--primary': variant === 'primary',
|
|
1484
1481
|
'IconButton--secondary': variant === 'secondary',
|
|
1485
1482
|
'IconButton--error': variant === 'error'
|
|
@@ -2383,10 +2380,9 @@ var TextField = /** @class */ (function (_super) {
|
|
|
2383
2380
|
}(React__default.Component));
|
|
2384
2381
|
|
|
2385
2382
|
function PanelTrigger(_a) {
|
|
2386
|
-
var children = _a.children, className = _a.className, open = _a.open, onClick = _a.onClick, other = tslib.__rest(_a, ["children", "className", "open", "onClick"]);
|
|
2387
|
-
return (React__default.createElement("button", tslib.__assign({}, other, { className: classNames('ExpandCollapse__trigger', className), type: "button", "aria-expanded": open, onClick: onClick }),
|
|
2388
|
-
typeof children === 'function' ? children({ open: !!open }) : children,
|
|
2389
|
-
' ',
|
|
2383
|
+
var children = _a.children, className = _a.className, open = _a.open, fullWidth = _a.fullWidth, onClick = _a.onClick, other = tslib.__rest(_a, ["children", "className", "open", "fullWidth", "onClick"]);
|
|
2384
|
+
return (React__default.createElement("button", tslib.__assign({}, other, { className: classNames('ExpandCollapse__trigger', fullWidth ? 'fullWidth' : '', className), type: "button", "aria-expanded": open, onClick: onClick }),
|
|
2385
|
+
React__default.createElement("div", { className: "ExpandCollapse__trigger-title" }, typeof children === 'function' ? children({ open: !!open }) : children),
|
|
2390
2386
|
React__default.createElement(Icon, { type: "chevron-" + (open ? 'down' : 'right') })));
|
|
2391
2387
|
}
|
|
2392
2388
|
PanelTrigger.propTypes = {
|
|
@@ -2509,7 +2505,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
|
|
|
2509
2505
|
open: isOpen,
|
|
2510
2506
|
onClick: this.handleToggle
|
|
2511
2507
|
}),
|
|
2512
|
-
React__default.createElement("div", tslib.__assign({}, other, { className: classNames(animationClass, className, {
|
|
2508
|
+
React__default.createElement("div", tslib.__assign({}, other, { className: classNames('ExpandCollapse__panel', animationClass, className, {
|
|
2513
2509
|
'is--hidden': !isOpen && !isAnimating
|
|
2514
2510
|
}), ref: this.panel }), panelElements)));
|
|
2515
2511
|
};
|
|
@@ -7940,6 +7936,20 @@ Stepper.propTypes = {
|
|
|
7940
7936
|
className: PropTypes.string
|
|
7941
7937
|
};
|
|
7942
7938
|
|
|
7939
|
+
var Panel = function (_a) {
|
|
7940
|
+
var className = _a.className, _b = _a.title, title = _b === void 0 ? '' : _b, actions = _a.actions, children = _a.children;
|
|
7941
|
+
return (React__default.createElement("div", { className: classNames('Panel', className) },
|
|
7942
|
+
React__default.createElement("div", { className: "Panel__Header" },
|
|
7943
|
+
title && React__default.createElement("div", { className: "Panel__Header-title" }, title),
|
|
7944
|
+
actions && React__default.createElement("div", { className: "Panel__Header-actions" }, actions)),
|
|
7945
|
+
React__default.createElement("div", { className: "Panel__Content" }, children)));
|
|
7946
|
+
};
|
|
7947
|
+
Panel.displayName = 'Panel';
|
|
7948
|
+
Panel.propTypes = {
|
|
7949
|
+
children: PropTypes.node.isRequired,
|
|
7950
|
+
className: PropTypes.string
|
|
7951
|
+
};
|
|
7952
|
+
|
|
7943
7953
|
var LIGHT_THEME_CLASS = 'cauldron--theme-light';
|
|
7944
7954
|
var DARK_THEME_CLASS = 'cauldron--theme-dark';
|
|
7945
7955
|
var ThemeContext = React.createContext({});
|
|
@@ -8028,6 +8038,7 @@ exports.OptionsMenuItem = OptionsMenuItem;
|
|
|
8028
8038
|
exports.OptionsMenuList = OptionsMenuList;
|
|
8029
8039
|
exports.OptionsMenuTrigger = OptionsMenuTrigger;
|
|
8030
8040
|
exports.OptionsMenuWrapper = OptionsMenuWrapper;
|
|
8041
|
+
exports.Panel = Panel;
|
|
8031
8042
|
exports.PanelTrigger = PanelTrigger$1;
|
|
8032
8043
|
exports.Pointout = Pointout;
|
|
8033
8044
|
exports.RadioGroup = RadioGroup;
|