@deque/cauldron-react 3.0.1-canary.e98b9d24 → 3.0.1-canary.eb6cb861

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.
@@ -18,8 +18,8 @@ function SvgArrowsAlt(props) {
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
20
  viewBox: "0 0 512 512",
21
- width: 28,
22
- height: 28
21
+ width: 24,
22
+ height: 24
23
23
  }, props), _ref);
24
24
  }
25
25
 
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import IconButton from '../IconButton';
4
+ declare const IssuePanel: {
5
+ ({ className, title, actions, children }: {
6
+ className?: string | undefined;
7
+ title?: string | undefined;
8
+ actions?: import("../../utils/polymorphic-type").ForwardRefComponent<"button", import("../IconButton").IconButtonOwnProps>[] | 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 IssuePanel;
@@ -1,16 +1,20 @@
1
- import React from 'react';
1
+ import { HTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import IconButton from '../IconButton';
3
+ interface PanelProps extends HTMLAttributes<HTMLElement> {
4
+ children: ReactNode;
5
+ heading: ReactElement<any> | {
6
+ id?: string;
7
+ text: ReactElement<any>;
8
+ level: number | undefined;
9
+ };
10
+ className?: string;
11
+ }
4
12
  declare const Panel: {
5
- ({ className, title, actions, children }: {
6
- className?: string | undefined;
7
- title?: string | undefined;
8
- actions?: import("../../utils/polymorphic-type").ForwardRefComponent<"button", import("../IconButton").IconButtonOwnProps>[] | undefined;
9
- children: React.ReactNode;
10
- }): JSX.Element;
13
+ ({ children, className, heading, ...other }: PanelProps): JSX.Element;
11
14
  displayName: string;
12
15
  propTypes: {
13
16
  children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
17
+ heading: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
14
18
  className: PropTypes.Requireable<string>;
15
19
  };
16
20
  };
@@ -17,9 +17,8 @@ function SvgFilter(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 32,
22
- height: 32
20
+ width: 24,
21
+ height: 24
23
22
  }, props), _ref);
24
23
  }
25
24
 
package/lib/index.d.ts CHANGED
@@ -42,6 +42,7 @@ export { default as Tabs, Tab, TabPanel } from './components/Tabs';
42
42
  export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails } from './components/DescriptionList';
43
43
  export { default as Stepper, Step } from './components/Stepper';
44
44
  export { default as Panel } from './components/Panel';
45
+ export { default as IssuePanel } from './components/IssuePanel';
45
46
  export { default as ProgressBar } from './components/ProgressBar';
46
47
  export { Address, AddressLine, AddressCityStateZip } from './components/Address';
47
48
  /**
package/lib/index.js CHANGED
@@ -195,7 +195,7 @@ function __variableDynamicImportRuntime0__(path) {
195
195
  case './icons/add-user.svg': return Promise.resolve().then(function () { return require('./add-user-075c63a1.js'); });
196
196
  case './icons/arrow-circle.svg': return Promise.resolve().then(function () { return require('./arrow-circle-858d89b5.js'); });
197
197
  case './icons/arrow.svg': return Promise.resolve().then(function () { return require('./arrow-36f5cb02.js'); });
198
- case './icons/arrows-alt.svg': return Promise.resolve().then(function () { return require('./arrows-alt-b91e24b7.js'); });
198
+ case './icons/arrows-alt.svg': return Promise.resolve().then(function () { return require('./arrows-alt-57b6a0ac.js'); });
199
199
  case './icons/bolt.svg': return Promise.resolve().then(function () { return require('./bolt-e44406fd.js'); });
200
200
  case './icons/caution.svg': return Promise.resolve().then(function () { return require('./caution-e048e1bf.js'); });
201
201
  case './icons/check-circle.svg': return Promise.resolve().then(function () { return require('./check-circle-8b5069b4.js'); });
@@ -213,7 +213,7 @@ function __variableDynamicImportRuntime0__(path) {
213
213
  case './icons/exchange.svg': return Promise.resolve().then(function () { return require('./exchange-1d290efb.js'); });
214
214
  case './icons/external-link.svg': return Promise.resolve().then(function () { return require('./external-link-ef122c95.js'); });
215
215
  case './icons/eye.svg': return Promise.resolve().then(function () { return require('./eye-a0d28243.js'); });
216
- case './icons/filter.svg': return Promise.resolve().then(function () { return require('./filter-d2057f4c.js'); });
216
+ case './icons/filter.svg': return Promise.resolve().then(function () { return require('./filter-b206c760.js'); });
217
217
  case './icons/flag.svg': return Promise.resolve().then(function () { return require('./flag-fb248a99.js'); });
218
218
  case './icons/gears.svg': return Promise.resolve().then(function () { return require('./gears-b9ee1585.js'); });
219
219
  case './icons/grid.svg': return Promise.resolve().then(function () { return require('./grid-ee446118.js'); });
@@ -8050,6 +8050,25 @@ Tab.propTypes = {
8050
8050
  children: PropTypes.node
8051
8051
  };
8052
8052
 
8053
+ /**
8054
+ * Hook to be used similarly to the React.Component#componentDidMount.
8055
+ * Executes the provided `effect` when `dependencies` change but does not
8056
+ * execute the effect initially (on mount) - only on update.
8057
+ *
8058
+ * @param effect {Function} function to be executed when dependencies update
8059
+ * @param dependencies {Any} any valid dependency argument to React.useEffect
8060
+ */
8061
+ var useDidUpdate = function (effect, dependencies) {
8062
+ var mounted = React__default.useRef(false);
8063
+ React__default.useEffect(function () {
8064
+ if (!mounted.current) {
8065
+ mounted.current = true;
8066
+ return;
8067
+ }
8068
+ effect();
8069
+ }, dependencies);
8070
+ };
8071
+
8053
8072
  var Tabs = function (_a) {
8054
8073
  var children = _a.children, thin = _a.thin, _b = _a.initialActiveIndex, initialActiveIndex = _b === void 0 ? 0 : _b, className = _a.className, onChange = _a.onChange, labelProp = tslib.__rest(_a, ["children", "thin", "initialActiveIndex", "className", "onChange"]);
8055
8074
  var _c = React.useState(initialActiveIndex), activeIndex = _c[0], setActiveIndex = _c[1];
@@ -8216,15 +8235,34 @@ Stepper.propTypes = {
8216
8235
  };
8217
8236
 
8218
8237
  var Panel = function (_a) {
8219
- var className = _a.className, _b = _a.title, title = _b === void 0 ? '' : _b, actions = _a.actions, children = _a.children;
8220
- return (React__default.createElement("div", { className: classNames('Panel', className) },
8221
- React__default.createElement("div", { className: "Panel__Header" },
8222
- title && React__default.createElement("div", { className: "Panel__Header-title" }, title),
8223
- actions && React__default.createElement("div", { className: "Panel__Header-actions" }, actions)),
8224
- React__default.createElement("div", { className: "Panel__Content" }, children)));
8238
+ var children = _a.children, className = _a.className, heading = _a.heading, other = tslib.__rest(_a, ["children", "className", "heading"]);
8239
+ var Heading = "h" + (typeof heading === 'object' && 'level' in heading && !!heading.level
8240
+ ? heading.level
8241
+ : 2);
8242
+ var headingId = typeof heading === 'object' && 'id' in heading ? heading.id : randomId();
8243
+ return (React__default.createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames('Panel', className) }, other),
8244
+ React__default.createElement(Heading, { id: headingId, className: "Panel__Heading" }, typeof heading === 'object' && 'text' in heading
8245
+ ? heading.text
8246
+ : heading),
8247
+ children));
8225
8248
  };
8226
8249
  Panel.displayName = 'Panel';
8227
8250
  Panel.propTypes = {
8251
+ children: PropTypes.node.isRequired,
8252
+ heading: PropTypes.oneOfType([PropTypes.object, PropTypes.node]).isRequired,
8253
+ className: PropTypes.string
8254
+ };
8255
+
8256
+ var IssuePanel = function (_a) {
8257
+ var className = _a.className, _b = _a.title, title = _b === void 0 ? '' : _b, actions = _a.actions, children = _a.children;
8258
+ return (React__default.createElement("div", { className: classNames('IssuePanel', className) },
8259
+ React__default.createElement("div", { className: "IssuePanel__Header" },
8260
+ title && React__default.createElement("div", { className: "IssuePanel__Header-title" }, title),
8261
+ actions && React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions)),
8262
+ React__default.createElement("div", { className: "IssuePanel__Content" }, children)));
8263
+ };
8264
+ IssuePanel.displayName = 'IssuePanel';
8265
+ IssuePanel.propTypes = {
8228
8266
  children: PropTypes.node.isRequired,
8229
8267
  className: PropTypes.string
8230
8268
  };
@@ -8269,25 +8307,6 @@ AddressCityStateZip.propTypes = {
8269
8307
  className: PropTypes.string
8270
8308
  };
8271
8309
 
8272
- /**
8273
- * Hook to be used similarly to the React.Component#componentDidMount.
8274
- * Executes the provided `effect` when `dependencies` change but does not
8275
- * execute the effect initially (on mount) - only on update.
8276
- *
8277
- * @param effect {Function} function to be executed when dependencies update
8278
- * @param dependencies {Any} any valid dependency argument to React.useEffect
8279
- */
8280
- var useDidUpdate = function (effect, dependencies) {
8281
- var mounted = React__default.useRef(false);
8282
- React__default.useEffect(function () {
8283
- if (!mounted.current) {
8284
- mounted.current = true;
8285
- return;
8286
- }
8287
- effect();
8288
- }, dependencies);
8289
- };
8290
-
8291
8310
  var LIGHT_THEME_CLASS = 'cauldron--theme-light';
8292
8311
  var DARK_THEME_CLASS = 'cauldron--theme-dark';
8293
8312
  var ThemeContext = React.createContext({});
@@ -8362,6 +8381,7 @@ exports.DialogFooter = DialogFooter;
8362
8381
  exports.ExpandCollapsePanel = ExpandCollapsePanel;
8363
8382
  exports.Icon = Icon;
8364
8383
  exports.IconButton = IconButton;
8384
+ exports.IssuePanel = IssuePanel;
8365
8385
  exports.Layout = Layout;
8366
8386
  exports.Line = Line;
8367
8387
  exports.Link = Link;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "3.0.1-canary.e98b9d24",
3
+ "version": "3.0.1-canary.eb6cb861",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"