@deque/cauldron-react 4.7.0-canary.b07c7ee0 → 4.7.0-canary.e34d0aa1

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.
@@ -8,6 +8,7 @@ export interface ToastProps {
8
8
  toastRef: React.Ref<HTMLDivElement>;
9
9
  focus?: boolean;
10
10
  show?: boolean;
11
+ dismissible?: boolean;
11
12
  children: React.ReactNode;
12
13
  }
13
14
  interface ToastState {
@@ -24,6 +25,7 @@ export default class Toast extends React.Component<ToastProps, ToastState> {
24
25
  toastRef: () => void;
25
26
  focus: boolean;
26
27
  show: boolean;
28
+ dismissible: boolean;
27
29
  };
28
30
  static propTypes: {
29
31
  children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
@@ -35,6 +37,7 @@ export default class Toast extends React.Component<ToastProps, ToastState> {
35
37
  }>>;
36
38
  focus: PropTypes.Requireable<boolean>;
37
39
  show: PropTypes.Requireable<boolean>;
40
+ dismissible: PropTypes.Requireable<boolean>;
38
41
  };
39
42
  static displayName: string;
40
43
  private el;
package/lib/index.js CHANGED
@@ -2339,7 +2339,7 @@ var Toast = /** @class */ (function (_super) {
2339
2339
  var _a = this.props, type = _a.type, children = _a.children,
2340
2340
  // prevent `onDismiss` from being passed-through to DOM
2341
2341
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2342
- onDismiss = _a.onDismiss, dismissText = _a.dismissText, toastRef = _a.toastRef, focus = _a.focus, show = _a.show, otherProps = tslib.__rest(_a, ["type", "children", "onDismiss", "dismissText", "toastRef", "focus", "show"]);
2342
+ onDismiss = _a.onDismiss, dismissText = _a.dismissText, toastRef = _a.toastRef, focus = _a.focus, show = _a.show, dismissible = _a.dismissible, otherProps = tslib.__rest(_a, ["type", "children", "onDismiss", "dismissText", "toastRef", "focus", "show", "dismissible"]);
2343
2343
  var scrim = type === 'action-needed' && show ? (React__default.createElement("div", { className: "Scrim--light Scrim--show Scrim--fade-in" })) : null;
2344
2344
  var defaultProps = {
2345
2345
  tabIndex: -1,
@@ -2356,7 +2356,7 @@ var Toast = /** @class */ (function (_super) {
2356
2356
  React__default.createElement("div", { className: "Toast__message" },
2357
2357
  React__default.createElement(Icon, { type: typeMap[type].icon }),
2358
2358
  React__default.createElement("div", { className: "Toast__message-content" }, children)),
2359
- type !== 'action-needed' && (React__default.createElement("button", { type: "button", className: 'Toast__dismiss', "aria-label": dismissText, onClick: this.dismissToast },
2359
+ type !== 'action-needed' && dismissible && (React__default.createElement("button", { type: "button", className: 'Toast__dismiss', "aria-label": dismissText, onClick: this.dismissToast },
2360
2360
  React__default.createElement(Icon, { type: "close" })))),
2361
2361
  scrim));
2362
2362
  };
@@ -2407,7 +2407,8 @@ var Toast = /** @class */ (function (_super) {
2407
2407
  // eslint-disable-next-line @typescript-eslint/no-empty-function
2408
2408
  toastRef: function () { },
2409
2409
  focus: true,
2410
- show: false
2410
+ show: false,
2411
+ dismissible: true
2411
2412
  };
2412
2413
  Toast.propTypes = {
2413
2414
  // the ui to be added as the message of the toast
@@ -2426,7 +2427,9 @@ var Toast = /** @class */ (function (_super) {
2426
2427
  // whether or not to focus the toast
2427
2428
  focus: PropTypes.bool,
2428
2429
  // whether or not to show the toast
2429
- show: PropTypes.bool
2430
+ show: PropTypes.bool,
2431
+ // whether or not the toast is dismissible
2432
+ dismissible: PropTypes.bool
2430
2433
  };
2431
2434
  Toast.displayName = 'Toast';
2432
2435
  return Toast;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "4.7.0-canary.b07c7ee0",
3
+ "version": "4.7.0-canary.e34d0aa1",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"