@luminati-io/uikit 3.7.5 → 3.7.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -39018,6 +39018,7 @@ __webpack_require__.r(__webpack_exports__);
39018
39018
  /* harmony export */ ModalButton: () => (/* binding */ ModalButton),
39019
39019
  /* harmony export */ ModalFooter: () => (/* binding */ ModalFooter),
39020
39020
  /* harmony export */ ModalHeader: () => (/* binding */ ModalHeader),
39021
+ /* harmony export */ ModalSubtitle: () => (/* binding */ ModalSubtitle),
39021
39022
  /* harmony export */ ModalTitle: () => (/* binding */ ModalTitle)
39022
39023
  /* harmony export */ });
39023
39024
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
@@ -39044,12 +39045,17 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
39044
39045
 
39045
39046
 
39046
39047
 
39047
- var ModalTitle = function ModalTitle(props) {
39048
- var text = props.text;
39048
+ var ModalTitle = function ModalTitle(_ref) {
39049
+ var text = _ref.text,
39050
+ children = _ref.children;
39049
39051
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_7__.Header, {
39050
39052
  color: "gray_11_75"
39051
- }, text);
39053
+ }, children !== null && children !== void 0 ? children : text);
39052
39054
  };
39055
+ var ModalSubtitle = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_typography__WEBPACK_IMPORTED_MODULE_7__.Label).withConfig({
39056
+ displayName: "ModalSubtitle",
39057
+ componentId: "sc-1p9nv3u-0"
39058
+ })(["padding-right:", ";"], _theme__WEBPACK_IMPORTED_MODULE_6__["default"].spacing['04']);
39053
39059
  var CloseButton = function CloseButton(props) {
39054
39060
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_4__.IconButton, _extends({
39055
39061
  icon: "CloseSmall",
@@ -39061,46 +39067,41 @@ var ButtonsGroup = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_lay
39061
39067
  align_items: 'center'
39062
39068
  }).withConfig({
39063
39069
  displayName: "ButtonsGroup",
39064
- componentId: "sc-1p9nv3u-0"
39070
+ componentId: "sc-1p9nv3u-1"
39065
39071
  })([""]);
39066
39072
  var ModalButton = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_button__WEBPACK_IMPORTED_MODULE_3__.Button).attrs({
39067
39073
  size: 'sm'
39068
39074
  }).withConfig({
39069
39075
  displayName: "ModalButton",
39070
- componentId: "sc-1p9nv3u-1"
39076
+ componentId: "sc-1p9nv3u-2"
39071
39077
  })([""]);
39072
- var ModalHeader = function ModalHeader(props) {
39073
- var title = props.title,
39074
- subtitle = props.subtitle,
39075
- onCancel = props.onCancel,
39076
- cancelDisabled = props.cancelDisabled;
39078
+ var ModalHeader = function ModalHeader(_ref2) {
39079
+ var title = _ref2.title,
39080
+ subtitle = _ref2.subtitle,
39081
+ onCancel = _ref2.onCancel,
39082
+ cancelDisabled = _ref2.cancelDisabled;
39077
39083
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_layout__WEBPACK_IMPORTED_MODULE_5__.Flex, {
39078
39084
  align_items: "center",
39079
39085
  justify_content: "space-between",
39080
39086
  width: "100%"
39081
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ModalTitle, {
39082
- text: title
39083
- }), !cancelDisabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CloseButton, {
39087
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ModalTitle, null, title), !cancelDisabled ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CloseButton, {
39084
39088
  onClick: onCancel,
39085
39089
  "data-testid": "modal_header_close_button"
39086
- })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Subtitle, null, subtitle));
39090
+ }) : null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ModalSubtitle, null, subtitle));
39087
39091
  };
39088
39092
  ModalHeader.propTypes = {
39089
39093
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
39090
39094
  subtitle: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
39091
- onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
39095
+ onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
39096
+ cancelDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
39092
39097
  };
39093
- var Subtitle = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_typography__WEBPACK_IMPORTED_MODULE_7__.Label).withConfig({
39094
- displayName: "Subtitle",
39095
- componentId: "sc-1p9nv3u-2"
39096
- })(["padding-right:", ";"], _theme__WEBPACK_IMPORTED_MODULE_6__["default"].spacing['04']);
39097
- var ModalFooter = function ModalFooter(props) {
39098
- var okLabel = props.okLabel,
39099
- cancelLabel = props.cancelLabel,
39100
- onOk = props.onOk,
39101
- onCancel = props.onCancel,
39102
- okDisabled = props.okDisabled,
39103
- cancelDisabled = props.cancelDisabled;
39098
+ var ModalFooter = function ModalFooter(_ref3) {
39099
+ var okLabel = _ref3.okLabel,
39100
+ cancelLabel = _ref3.cancelLabel,
39101
+ onOk = _ref3.onOk,
39102
+ onCancel = _ref3.onCancel,
39103
+ okDisabled = _ref3.okDisabled,
39104
+ cancelDisabled = _ref3.cancelDisabled;
39104
39105
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_layout__WEBPACK_IMPORTED_MODULE_5__.Flex, {
39105
39106
  width: "100%",
39106
39107
  justify_content: "flex-end"
@@ -43940,16 +43941,26 @@ var ToastComp = function ToastComp(props) {
43940
43941
  dismissToast = toast.dismissToast,
43941
43942
  message = toast.message,
43942
43943
  dismissible = toast.dismissible,
43943
- notDismissible = toast.notDismissible;
43944
+ notDismissible = toast.notDismissible,
43945
+ onShow = toast.onShow,
43946
+ onDismiss = toast.onDismiss,
43947
+ visible = toast.visible;
43944
43948
  var _useContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_context__WEBPACK_IMPORTED_MODULE_7__.ToastContext),
43945
43949
  position = _useContext.position;
43946
43950
  var onCloseHandler = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function () {
43947
43951
  dismissToast(id);
43948
- if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_0___default()(onClose)) onClose(id);
43952
+ if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_0___default()(onClose)) onClose(toast);
43949
43953
  }, [id]);
43954
+ (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
43955
+ if (!visible) return;
43956
+ if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_0___default()(onShow)) onShow(toast);
43957
+ return function () {
43958
+ if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_0___default()(onDismiss)) onDismiss(toast);
43959
+ };
43960
+ }, [visible]);
43950
43961
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ToastAnimatedComp, {
43951
43962
  $position: toast.position || position || 'bottom-left',
43952
- $visible: toast.visible
43963
+ $visible: visible
43953
43964
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_toast__WEBPACK_IMPORTED_MODULE_6__.Toast, {
43954
43965
  onClose: onCloseHandler,
43955
43966
  type: type,
@@ -44150,7 +44161,8 @@ var _useToaster = function _useToaster() {
44150
44161
  return {
44151
44162
  enqueueToast: enqueueToast,
44152
44163
  dismissToast: dismissToast,
44153
- toast: _toast
44164
+ toast: _toast,
44165
+ toasts: toasts
44154
44166
  };
44155
44167
  };
44156
44168
  var useToaster = function useToaster() {