@salutejs/plasma-new-hope 0.243.0-dev.0 → 0.243.1-canary.1712.12884408335.0

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.
@@ -25,7 +25,6 @@ var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
25
25
  var _useToastInner = ToastProvider.useToastInner(),
26
26
  hideToast = _useToastInner.hideToast,
27
27
  isVisible = _useToastInner.isVisible,
28
- hideTimeout = _useToastInner.hideTimeout,
29
28
  animationRunTimeout = _useToastInner.animationRunTimeout;
30
29
  var toastKey = "".concat(text).concat(position);
31
30
  var showedClass = isVisible ? Toast_tokens.classes.toastShowed : Toast_tokens.classes.toastHidden;
@@ -36,9 +35,6 @@ var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
36
35
  }, rest);
37
36
  React.useEffect(function () {
38
37
  return function () {
39
- if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
40
- clearTimeout(hideTimeout.current);
41
- }
42
38
  if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
43
39
  clearTimeout(animationRunTimeout.current);
44
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ToastController.js","sources":["../../../src/components/Toast/ToastController.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport type { FC } from 'react';\n\nimport { classes } from './Toast.tokens';\nimport { ToastControllerProps, ToastProps } from './Toast.types';\nimport { StyledOverlay, StyledRoot } from './Toast.styles';\nimport { useToastInner } from './ToastProvider';\nimport { FADE_Z_INDEX, gradients } from './utils';\n\nexport const ToastControllerHoc = <T extends ToastProps>(ToastComponent: FC<T>) =>\n function ToastController(props: ToastControllerProps) {\n const { position = 'bottom', offset, fade, text, ...rest } = props;\n\n const { hideToast, isVisible, hideTimeout, animationRunTimeout } = useToastInner();\n const toastKey = `${text}${position}`;\n\n const showedClass = isVisible ? classes.toastShowed : classes.toastHidden;\n const showedFadeClass = isVisible ? classes.toastFadeShowed : classes.toastFadeHidden;\n\n const toastProps = {\n text,\n onCloseButtonClick: hideToast,\n ...rest,\n } as T;\n\n useEffect(() => {\n return () => {\n if (hideTimeout?.current) {\n clearTimeout(hideTimeout.current);\n }\n if (animationRunTimeout?.current) {\n clearTimeout(animationRunTimeout.current);\n }\n };\n }, []);\n\n if (!text) {\n return null;\n }\n\n return (\n <>\n {fade && (\n <StyledOverlay\n className={showedFadeClass}\n zIndex={FADE_Z_INDEX}\n backgroundColorProperty={gradients[position]}\n isClickable={false}\n />\n )}\n <StyledRoot\n key={toastKey}\n position={position}\n offset={offset}\n isVisible={isVisible}\n className={showedClass}\n >\n <ToastComponent {...toastProps} />\n </StyledRoot>\n </>\n );\n };\n"],"names":["ToastControllerHoc","ToastComponent","ToastController","props","_props$position","position","offset","fade","text","rest","_objectWithoutProperties","_excluded","_useToastInner","useToastInner","hideToast","isVisible","hideTimeout","animationRunTimeout","toastKey","concat","showedClass","classes","toastShowed","toastHidden","showedFadeClass","toastFadeShowed","toastFadeHidden","toastProps","_objectSpread","onCloseButtonClick","useEffect","current","clearTimeout","React","createElement","Fragment","StyledOverlay","className","zIndex","FADE_Z_INDEX","backgroundColorProperty","gradients","isClickable","StyledRoot","key"],"mappings":";;;;;;;;;;;;;;;;IASaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAA0BC,cAAqB,EAAA;AAAA,EAAA,OAC1E,SAASC,eAAeA,CAACC,KAA2B,EAAE;AAClD,IAAA,IAAAC,eAAA,GAA6DD,KAAK,CAA1DE,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,eAAA;MAAEE,MAAM,GAA0BH,KAAK,CAArCG,MAAM;MAAEC,IAAI,GAAoBJ,KAAK,CAA7BI,IAAI;MAAEC,IAAI,GAAcL,KAAK,CAAvBK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAElE,IAAA,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CAAAC,aAAA,CAACE,0BAAa,EAAA;AACVC,MAAAA,SAAS,EAAEb,eAAgB;AAC3Bc,MAAAA,MAAM,EAAEC,kBAAa;AACrBC,MAAAA,uBAAuB,EAAEC,eAAS,CAACpC,QAAQ,CAAE;AAC7CqC,MAAAA,WAAW,EAAE,KAAA;AAAM,KACtB,CACJ,eACDT,sBAAA,CAAAC,aAAA,CAACS,uBAAU,EAAA;AACPC,MAAAA,GAAG,EAAE1B,QAAS;AACdb,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,MAAM,EAAEA,MAAO;AACfS,MAAAA,SAAS,EAAEA,SAAU;AACrBsB,MAAAA,SAAS,EAAEjB,WAAAA;KAEXa,eAAAA,sBAAA,CAAAC,aAAA,CAACjC,cAAc,EAAK0B,UAAa,CACzB,CACd,CAAC,CAAA;GAEV,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"ToastController.js","sources":["../../../src/components/Toast/ToastController.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport type { FC } from 'react';\n\nimport { classes } from './Toast.tokens';\nimport { ToastControllerProps, ToastProps } from './Toast.types';\nimport { StyledOverlay, StyledRoot } from './Toast.styles';\nimport { useToastInner } from './ToastProvider';\nimport { FADE_Z_INDEX, gradients } from './utils';\n\nexport const ToastControllerHoc = <T extends ToastProps>(ToastComponent: FC<T>) =>\n function ToastController(props: ToastControllerProps) {\n const { position = 'bottom', offset, fade, text, ...rest } = props;\n\n const { hideToast, isVisible, animationRunTimeout } = useToastInner();\n const toastKey = `${text}${position}`;\n\n const showedClass = isVisible ? classes.toastShowed : classes.toastHidden;\n const showedFadeClass = isVisible ? classes.toastFadeShowed : classes.toastFadeHidden;\n\n const toastProps = {\n text,\n onCloseButtonClick: hideToast,\n ...rest,\n } as T;\n\n useEffect(() => {\n return () => {\n if (animationRunTimeout?.current) {\n clearTimeout(animationRunTimeout.current);\n }\n };\n }, []);\n\n if (!text) {\n return null;\n }\n\n return (\n <>\n {fade && (\n <StyledOverlay\n className={showedFadeClass}\n zIndex={FADE_Z_INDEX}\n backgroundColorProperty={gradients[position]}\n isClickable={false}\n />\n )}\n <StyledRoot\n key={toastKey}\n position={position}\n offset={offset}\n isVisible={isVisible}\n className={showedClass}\n >\n <ToastComponent {...toastProps} />\n </StyledRoot>\n </>\n );\n };\n"],"names":["ToastControllerHoc","ToastComponent","ToastController","props","_props$position","position","offset","fade","text","rest","_objectWithoutProperties","_excluded","_useToastInner","useToastInner","hideToast","isVisible","animationRunTimeout","toastKey","concat","showedClass","classes","toastShowed","toastHidden","showedFadeClass","toastFadeShowed","toastFadeHidden","toastProps","_objectSpread","onCloseButtonClick","useEffect","current","clearTimeout","React","createElement","Fragment","StyledOverlay","className","zIndex","FADE_Z_INDEX","backgroundColorProperty","gradients","isClickable","StyledRoot","key"],"mappings":";;;;;;;;;;;;;;;;IASaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAA0BC,cAAqB,EAAA;AAAA,EAAA,OAC1E,SAASC,eAAeA,CAACC,KAA2B,EAAE;AAClD,IAAA,IAAAC,eAAA,GAA6DD,KAAK,CAA1DE,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,eAAA;MAAEE,MAAM,GAA0BH,KAAK,CAArCG,MAAM;MAAEC,IAAI,GAAoBJ,KAAK,CAA7BI,IAAI;MAAEC,IAAI,GAAcL,KAAK,CAAvBK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAElE,IAAA,IAAAC,cAAA,GAAsDC,2BAAa,EAAE;MAA7DC,SAAS,GAAAF,cAAA,CAATE,SAAS;MAAEC,SAAS,GAAAH,cAAA,CAATG,SAAS;MAAEC,mBAAmB,GAAAJ,cAAA,CAAnBI,mBAAmB,CAAA;IACjD,IAAMC,QAAQ,MAAAC,MAAA,CAAMV,IAAI,CAAAU,CAAAA,MAAA,CAAGb,QAAQ,C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AAA,sBAAA,CAAAC,aAAA,CAAChC,cAAc,EAAKyB,UAAa,CACzB,CACd,CAAC,CAAA;GAEV,CAAA;AAAA;;;;"}
@@ -31,7 +31,6 @@ var ToastControllerHoc = exports.ToastControllerHoc = function ToastControllerHo
31
31
  var _useToastInner = (0, _ToastProvider.useToastInner)(),
32
32
  hideToast = _useToastInner.hideToast,
33
33
  isVisible = _useToastInner.isVisible,
34
- hideTimeout = _useToastInner.hideTimeout,
35
34
  animationRunTimeout = _useToastInner.animationRunTimeout;
36
35
  var toastKey = "".concat(text).concat(position);
37
36
  var showedClass = isVisible ? _Toast.classes.toastShowed : _Toast.classes.toastHidden;
@@ -42,9 +41,6 @@ var ToastControllerHoc = exports.ToastControllerHoc = function ToastControllerHo
42
41
  }, rest);
43
42
  (0, _react.useEffect)(function () {
44
43
  return function () {
45
- if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
46
- clearTimeout(hideTimeout.current);
47
- }
48
44
  if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
49
45
  clearTimeout(animationRunTimeout.current);
50
46
  }
@@ -23,7 +23,6 @@ export var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
23
23
  var _useToastInner = useToastInner(),
24
24
  hideToast = _useToastInner.hideToast,
25
25
  isVisible = _useToastInner.isVisible,
26
- hideTimeout = _useToastInner.hideTimeout,
27
26
  animationRunTimeout = _useToastInner.animationRunTimeout;
28
27
  var toastKey = "".concat(text).concat(position);
29
28
  var showedClass = isVisible ? classes.toastShowed : classes.toastHidden;
@@ -34,9 +33,6 @@ export var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
34
33
  }, rest);
35
34
  useEffect(function () {
36
35
  return function () {
37
- if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
38
- clearTimeout(hideTimeout.current);
39
- }
40
36
  if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
41
37
  clearTimeout(animationRunTimeout.current);
42
38
  }
@@ -17,7 +17,6 @@ var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
17
17
  var _useToastInner = useToastInner(),
18
18
  hideToast = _useToastInner.hideToast,
19
19
  isVisible = _useToastInner.isVisible,
20
- hideTimeout = _useToastInner.hideTimeout,
21
20
  animationRunTimeout = _useToastInner.animationRunTimeout;
22
21
  var toastKey = "".concat(text).concat(position);
23
22
  var showedClass = isVisible ? classes.toastShowed : classes.toastHidden;
@@ -28,9 +27,6 @@ var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
28
27
  }, rest);
29
28
  useEffect(function () {
30
29
  return function () {
31
- if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
32
- clearTimeout(hideTimeout.current);
33
- }
34
30
  if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
35
31
  clearTimeout(animationRunTimeout.current);
36
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ToastController.js","sources":["../../../src/components/Toast/ToastController.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport type { FC } from 'react';\n\nimport { classes } from './Toast.tokens';\nimport { ToastControllerProps, ToastProps } from './Toast.types';\nimport { StyledOverlay, StyledRoot } from './Toast.styles';\nimport { useToastInner } from './ToastProvider';\nimport { FADE_Z_INDEX, gradients } from './utils';\n\nexport const ToastControllerHoc = <T extends ToastProps>(ToastComponent: FC<T>) =>\n function ToastController(props: ToastControllerProps) {\n const { position = 'bottom', offset, fade, text, ...rest } = props;\n\n const { hideToast, isVisible, hideTimeout, animationRunTimeout } = useToastInner();\n const toastKey = `${text}${position}`;\n\n const showedClass = isVisible ? classes.toastShowed : classes.toastHidden;\n const showedFadeClass = isVisible ? classes.toastFadeShowed : classes.toastFadeHidden;\n\n const toastProps = {\n text,\n onCloseButtonClick: hideToast,\n ...rest,\n } as T;\n\n useEffect(() => {\n return () => {\n if (hideTimeout?.current) {\n clearTimeout(hideTimeout.current);\n }\n if (animationRunTimeout?.current) {\n clearTimeout(animationRunTimeout.current);\n }\n };\n }, []);\n\n if (!text) {\n return null;\n }\n\n return (\n <>\n {fade && (\n <StyledOverlay\n className={showedFadeClass}\n zIndex={FADE_Z_INDEX}\n backgroundColorProperty={gradients[position]}\n isClickable={false}\n />\n )}\n <StyledRoot\n key={toastKey}\n position={position}\n offset={offset}\n isVisible={isVisible}\n className={showedClass}\n >\n <ToastComponent {...toastProps} />\n </StyledRoot>\n </>\n );\n };\n"],"names":["ToastControllerHoc","ToastComponent","ToastController","props","_props$position","position","offset","fade","text","rest","_objectWithoutProperties","_excluded","_useToastInner","useToastInner","hideToast","isVisible","hideTimeout","animationRunTimeout","toastKey","concat","showedClass","classes","toastShowed","toastHidden","showedFadeClass","toastFadeShowed","toastFadeHidden","toastProps","_objectSpread","onCloseButtonClick","useEffect","current","clearTimeout","React","createElement","Fragment","StyledOverlay","className","zIndex","FADE_Z_INDEX","backgroundColorProperty","gradients","isClickable","StyledRoot","key"],"mappings":";;;;;;;;IASaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAA0BC,cAAqB,EAAA;AAAA,EAAA,OAC1E,SAASC,eAAeA,CAACC,KAA2B,EAAE;AAClD,IAAA,IAAAC,eAAA,GAA6DD,KAAK,CAA1DE,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,eAAA;MAAEE,MAAM,GAA0BH,KAAK,CAArCG,MAAM;MAAEC,IAAI,GAAoBJ,KAAK,CAA7BI,IAAI;MAAEC,IAAI,GAAcL,KAAK,CAAvBK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,wBAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAElE,IAAA,IAAAC,cAAA,GAAmEC,aAAa,EAAE;MAA1EC,SAAS,GAAAF,cAAA,CAATE,SAAS;MAAEC,SAAS,GAAAH,cAAA,CAATG,SAAS;MAAEC,WAAW,GAAAJ,cAAA,CAAXI,WAAW;MAAEC,mBAAmB,GAAA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E,KAAA;AAAM,KACtB,CACJ,eACDT,KAAA,CAAAC,aAAA,CAACS,UAAU,EAAA;AACPC,MAAAA,GAAG,EAAE1B,QAAS;AACdb,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,MAAM,EAAEA,MAAO;AACfS,MAAAA,SAAS,EAAEA,SAAU;AACrBsB,MAAAA,SAAS,EAAEjB,WAAAA;KAEXa,eAAAA,KAAA,CAAAC,aAAA,CAACjC,cAAc,EAAK0B,UAAa,CACzB,CACd,CAAC,CAAA;GAEV,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"ToastController.js","sources":["../../../src/components/Toast/ToastController.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport type { FC } from 'react';\n\nimport { classes } from './Toast.tokens';\nimport { ToastControllerProps, ToastProps } from './Toast.types';\nimport { StyledOverlay, StyledRoot } from './Toast.styles';\nimport { useToastInner } from './ToastProvider';\nimport { FADE_Z_INDEX, gradients } from './utils';\n\nexport const ToastControllerHoc = <T extends ToastProps>(ToastComponent: FC<T>) =>\n function ToastController(props: ToastControllerProps) {\n const { position = 'bottom', offset, fade, text, ...rest } = props;\n\n const { hideToast, isVisible, animationRunTimeout } = useToastInner();\n const toastKey = `${text}${position}`;\n\n const showedClass = isVisible ? classes.toastShowed : classes.toastHidden;\n const showedFadeClass = isVisible ? classes.toastFadeShowed : classes.toastFadeHidden;\n\n const toastProps = {\n text,\n onCloseButtonClick: hideToast,\n ...rest,\n } as T;\n\n useEffect(() => {\n return () => {\n if (animationRunTimeout?.current) {\n clearTimeout(animationRunTimeout.current);\n }\n };\n }, []);\n\n if (!text) {\n return null;\n }\n\n return (\n <>\n {fade && (\n <StyledOverlay\n className={showedFadeClass}\n zIndex={FADE_Z_INDEX}\n backgroundColorProperty={gradients[position]}\n isClickable={false}\n />\n )}\n <StyledRoot\n key={toastKey}\n position={position}\n offset={offset}\n isVisible={isVisible}\n className={showedClass}\n >\n <ToastComponent {...toastProps} />\n </StyledRoot>\n </>\n );\n };\n"],"names":["ToastControllerHoc","ToastComponent","ToastController","props","_props$position","position","offset","fade","text","rest","_objectWithoutProperties","_excluded","_useToastInner","useToastInner","hideToast","isVisible","animationRunTimeout","toastKey","concat","showedClass","classes","toastShowed","toastHidden","showedFadeClass","toastFadeShowed","toastFadeHidden","toastProps","_objectSpread","onCloseButtonClick","useEffect","current","clearTimeout","React","createElement","Fragment","StyledOverlay","className","zIndex","FADE_Z_INDEX","backgroundColorProperty","gradients","isClickable","StyledRoot","key"],"mappings":";;;;;;;;IASaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAA0BC,cAAqB,EAAA;AAAA,EAAA,OAC1E,SAASC,eAAeA,CAACC,KAA2B,EAAE;AAClD,IAAA,IAAAC,eAAA,GAA6DD,KAAK,CAA1DE,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,eAAA;MAAEE,MAAM,GAA0BH,KAAK,CAArCG,MAAM;MAAEC,IAAI,GAAoBJ,KAAK,CAA7BI,IAAI;MAAEC,IAAI,GAAcL,KAAK,CAAvBK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,wBAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAElE,IAAA,IAAAC,cAAA,GAAsDC,aAAa,EAAE;MAA7DC,SAAS,GAAAF,cAAA,CAATE,SAAS;MAAEC,SAAS,GAAAH,cAAA,CAATG,SAAS;MAAEC,mBAAmB,GAAAJ,cAAA,CAAnBI,mBAAmB,CAAA;IACjD,IAAMC,QAAQ,MAAAC,MAAA,CAAMV,IAAI,CAAAU,CAAAA,MAAA,CAAGb,QAAQ,CAAE,CAAA;IAErC,IAAMc,WAAW,GAAGJ,SAAS,GAAGK,OAAO,CAACC,WAAW,GAAGD,OAAO,CAACE,WAAW,CAAA;IACzE,IAAMC,eAAe,GAAGR,SAAS,GAAGK,OAAO,CAACI,eAAe,GAAGJ,OAAO,CAACK,eAAe,CAAA;IAErF,IAA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712.12884408335.0",
4
4
  "description": "Salute Design System blueprint",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",
@@ -131,5 +131,5 @@
131
131
  "sideEffects": [
132
132
  "*.css"
133
133
  ],
134
- "gitHead": "8c09c4225897443b44daa997793c791fcc040c78"
134
+ "gitHead": "c170b267cb94dc2f47aa731b951003b467138baf"
135
135
  }
@@ -31,7 +31,6 @@ var ToastControllerHoc = exports.ToastControllerHoc = function ToastControllerHo
31
31
  var _useToastInner = (0, _ToastProvider.useToastInner)(),
32
32
  hideToast = _useToastInner.hideToast,
33
33
  isVisible = _useToastInner.isVisible,
34
- hideTimeout = _useToastInner.hideTimeout,
35
34
  animationRunTimeout = _useToastInner.animationRunTimeout;
36
35
  var toastKey = "".concat(text).concat(position);
37
36
  var showedClass = isVisible ? _Toast.classes.toastShowed : _Toast.classes.toastHidden;
@@ -42,9 +41,6 @@ var ToastControllerHoc = exports.ToastControllerHoc = function ToastControllerHo
42
41
  }, rest);
43
42
  (0, _react.useEffect)(function () {
44
43
  return function () {
45
- if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
46
- clearTimeout(hideTimeout.current);
47
- }
48
44
  if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
49
45
  clearTimeout(animationRunTimeout.current);
50
46
  }
@@ -23,7 +23,6 @@ export var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
23
23
  var _useToastInner = useToastInner(),
24
24
  hideToast = _useToastInner.hideToast,
25
25
  isVisible = _useToastInner.isVisible,
26
- hideTimeout = _useToastInner.hideTimeout,
27
26
  animationRunTimeout = _useToastInner.animationRunTimeout;
28
27
  var toastKey = "".concat(text).concat(position);
29
28
  var showedClass = isVisible ? classes.toastShowed : classes.toastHidden;
@@ -34,9 +33,6 @@ export var ToastControllerHoc = function ToastControllerHoc(ToastComponent) {
34
33
  }, rest);
35
34
  useEffect(function () {
36
35
  return function () {
37
- if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
38
- clearTimeout(hideTimeout.current);
39
- }
40
36
  if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
41
37
  clearTimeout(animationRunTimeout.current);
42
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ToastController.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKjE,eAAO,MAAM,kBAAkB,iEACK,oBAAoB,uBAmDnD,CAAC"}
1
+ {"version":3,"file":"ToastController.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKjE,eAAO,MAAM,kBAAkB,iEACK,oBAAoB,uBAgDnD,CAAC"}