@deque/cauldron-react 2.0.0-canary.22e43f33 → 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 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,6 +1,6 @@
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'];
@@ -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
@@ -2380,10 +2380,9 @@ var TextField = /** @class */ (function (_super) {
2380
2380
  }(React__default.Component));
2381
2381
 
2382
2382
  function PanelTrigger(_a) {
2383
- var children = _a.children, className = _a.className, open = _a.open, onClick = _a.onClick, other = tslib.__rest(_a, ["children", "className", "open", "onClick"]);
2384
- return (React__default.createElement("button", tslib.__assign({}, other, { className: classNames('ExpandCollapse__trigger', className), type: "button", "aria-expanded": open, onClick: onClick }),
2385
- typeof children === 'function' ? children({ open: !!open }) : children,
2386
- ' ',
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),
2387
2386
  React__default.createElement(Icon, { type: "chevron-" + (open ? 'down' : 'right') })));
2388
2387
  }
2389
2388
  PanelTrigger.propTypes = {
@@ -2506,7 +2505,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
2506
2505
  open: isOpen,
2507
2506
  onClick: this.handleToggle
2508
2507
  }),
2509
- 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, {
2510
2509
  'is--hidden': !isOpen && !isAnimating
2511
2510
  }), ref: this.panel }), panelElements)));
2512
2511
  };
@@ -7937,6 +7936,20 @@ Stepper.propTypes = {
7937
7936
  className: PropTypes.string
7938
7937
  };
7939
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
+
7940
7953
  var LIGHT_THEME_CLASS = 'cauldron--theme-light';
7941
7954
  var DARK_THEME_CLASS = 'cauldron--theme-dark';
7942
7955
  var ThemeContext = React.createContext({});
@@ -8025,6 +8038,7 @@ exports.OptionsMenuItem = OptionsMenuItem;
8025
8038
  exports.OptionsMenuList = OptionsMenuList;
8026
8039
  exports.OptionsMenuTrigger = OptionsMenuTrigger;
8027
8040
  exports.OptionsMenuWrapper = OptionsMenuWrapper;
8041
+ exports.Panel = Panel;
8028
8042
  exports.PanelTrigger = PanelTrigger$1;
8029
8043
  exports.Pointout = Pointout;
8030
8044
  exports.RadioGroup = RadioGroup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "2.0.0-canary.22e43f33",
3
+ "version": "2.0.0-canary.4fab7c98",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"