@luminati-io/uikit 3.7.7 → 3.7.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -43776,7 +43776,7 @@ __webpack_require__.r(__webpack_exports__);
43776
43776
 
43777
43777
 
43778
43778
  /*jslint react:true*/
43779
- var _excluded = ["type", "children", "onClose", "dismissible", "notDismissible"];
43779
+ var _excluded = ["type", "children", "onClose", "dismissible", "notDismissible", "classNamePrefix"];
43780
43780
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
43781
43781
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
43782
43782
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
@@ -43795,29 +43795,38 @@ var Toast = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef
43795
43795
  onClose = props.onClose,
43796
43796
  dismissible = props.dismissible,
43797
43797
  notDismissible = props.notDismissible,
43798
+ classNamePrefix = props.classNamePrefix,
43798
43799
  rest = _objectWithoutProperties(props, _excluded);
43799
43800
  var _dismissible = dismissible || type == 'error' || type == 'warning';
43800
43801
  var _notDismissible = notDismissible;
43801
43802
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Wrapper, _extends({
43802
43803
  ref: ref,
43803
43804
  $type: type
43804
- }, (0,_util__WEBPACK_IMPORTED_MODULE_3__.getCommonProps)(rest)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ToastIcon, {
43805
- type: type
43805
+ }, (0,_util__WEBPACK_IMPORTED_MODULE_3__.getCommonProps)(rest), {
43806
+ className: classNamePrefix + 'wrapper'
43807
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ToastIcon, {
43808
+ type: type,
43809
+ classNamePrefix: classNamePrefix
43806
43810
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_6__.Paragraph, {
43807
43811
  variant: "sm",
43808
- color: "gray_11_50"
43812
+ color: "gray_11_50",
43813
+ className: classNamePrefix + 'body'
43809
43814
  }, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(RemoveButton, {
43810
43815
  onClick: onClose,
43816
+ classNamePrefix: classNamePrefix,
43811
43817
  dismissible: _dismissible && !_notDismissible
43812
43818
  }));
43813
43819
  });
43814
43820
  Toast.displayName = 'Toast';
43815
- Toast.defaultProps = {};
43821
+ Toast.defaultProps = {
43822
+ classNamePrefix: ''
43823
+ };
43816
43824
  Toast.propTypes = {
43817
43825
  type: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['success', 'error', 'warning', 'info', 'generic']),
43818
43826
  onClose: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
43819
43827
  dismissible: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
43820
- notDismissible: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
43828
+ notDismissible: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
43829
+ classNamePrefix: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
43821
43830
  };
43822
43831
  var Wrapper = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div.withConfig({
43823
43832
  displayName: "Wrapper",
@@ -43832,7 +43841,8 @@ var Wrapper = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div.withC
43832
43841
  }[props.$type] || color.gray_4;
43833
43842
  });
43834
43843
  var ToastIcon = function ToastIcon(props) {
43835
- var type = props.type;
43844
+ var type = props.type,
43845
+ classNamePrefix = props.classNamePrefix;
43836
43846
  var name = {
43837
43847
  success: 'CheckCircle',
43838
43848
  error: 'Warning',
@@ -43850,21 +43860,25 @@ var ToastIcon = function ToastIcon(props) {
43850
43860
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
43851
43861
  name: name,
43852
43862
  color: _color,
43863
+ className: classNamePrefix + 'icon',
43853
43864
  size: "xs"
43854
43865
  });
43855
43866
  };
43856
43867
  var RemoveButton = function RemoveButton(props) {
43857
43868
  var onClick = props.onClick,
43858
- dismissible = props.dismissible;
43869
+ dismissible = props.dismissible,
43870
+ classNamePrefix = props.classNamePrefix;
43859
43871
  if (!dismissible) return null;
43860
43872
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledRemoveButton, {
43861
43873
  variant: "icon",
43862
43874
  icon: "CloseSmall",
43863
- onClick: onClick
43875
+ onClick: onClick,
43876
+ className: classNamePrefix + 'dismissButton'
43864
43877
  });
43865
43878
  };
43866
43879
  RemoveButton.defaultProps = {};
43867
43880
  RemoveButton.propTypes = {
43881
+ classNamePrefix: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
43868
43882
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
43869
43883
  dismissible: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
43870
43884
  };
@@ -43946,7 +43960,11 @@ var ToastComp = function ToastComp(props) {
43946
43960
  onDismiss = toast.onDismiss,
43947
43961
  visible = toast.visible;
43948
43962
  var _useContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_context__WEBPACK_IMPORTED_MODULE_7__.ToastContext),
43949
- position = _useContext.position;
43963
+ position = _useContext.position,
43964
+ idPrefix = _useContext.idPrefix,
43965
+ classNamePrefix = _useContext.classNamePrefix;
43966
+ var classPref = toast.classNamePrefix || classNamePrefix;
43967
+ var idPref = toast.idPrefix || idPrefix;
43950
43968
  var onCloseHandler = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function () {
43951
43969
  dismissToast(id);
43952
43970
  if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_0___default()(onClose)) onClose(toast);
@@ -43960,12 +43978,15 @@ var ToastComp = function ToastComp(props) {
43960
43978
  }, [visible]);
43961
43979
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ToastAnimatedComp, {
43962
43980
  $position: toast.position || position || 'bottom-left',
43963
- $visible: visible
43981
+ $visible: visible,
43982
+ id: idPref + id,
43983
+ className: classPref + 'toast'
43964
43984
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_toast__WEBPACK_IMPORTED_MODULE_6__.Toast, {
43965
43985
  onClose: onCloseHandler,
43966
43986
  type: type,
43967
43987
  dismissible: dismissible,
43968
- notDismissible: notDismissible
43988
+ notDismissible: notDismissible,
43989
+ classNamePrefix: classPref
43969
43990
  }, (0,react_hot_toast__WEBPACK_IMPORTED_MODULE_3__.resolveValue)(message, toast)));
43970
43991
  };
43971
43992
  var ToastItem = function ToastItem() {
@@ -44012,12 +44033,16 @@ var defaultContainerStyle = {
44012
44033
  var Toaster = function Toaster(props) {
44013
44034
  var position = props.position,
44014
44035
  maxToasts = props.maxToasts,
44036
+ idPrefix = props.idPrefix,
44037
+ classNamePrefix = props.classNamePrefix,
44015
44038
  containerStyle = props.containerStyle,
44016
44039
  children = props.children;
44017
44040
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_context__WEBPACK_IMPORTED_MODULE_4__.ToastContext.Provider, {
44018
44041
  value: {
44019
44042
  maxToasts: maxToasts,
44020
- position: position
44043
+ position: position,
44044
+ idPrefix: idPrefix,
44045
+ classNamePrefix: classNamePrefix
44021
44046
  }
44022
44047
  }, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_hot_toast__WEBPACK_IMPORTED_MODULE_2__.Toaster, {
44023
44048
  position: position,
@@ -44029,7 +44054,9 @@ var Toaster = function Toaster(props) {
44029
44054
  };
44030
44055
  Toaster.defaultProps = {
44031
44056
  position: 'bottom-left',
44032
- maxToasts: 2
44057
+ maxToasts: 2,
44058
+ idPrefix: 'toast',
44059
+ classNamePrefix: 'toast'
44033
44060
  };
44034
44061
  Toaster.propTypes = {
44035
44062
  position: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(_utils__WEBPACK_IMPORTED_MODULE_3__.toastPositions),