@activecollab/components 1.0.89 → 1.0.92

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.
Files changed (29) hide show
  1. package/dist/cjs/components/ProgressRing/ProgressRing.js +9 -3
  2. package/dist/cjs/components/ProgressRing/ProgressRing.js.map +1 -1
  3. package/dist/cjs/components/ToastMessage/Styles.js +60 -0
  4. package/dist/cjs/components/ToastMessage/Styles.js.map +1 -0
  5. package/dist/cjs/components/ToastMessage/ToastMessage.js +51 -0
  6. package/dist/cjs/components/ToastMessage/ToastMessage.js.map +1 -0
  7. package/dist/cjs/components/ToastMessage/index.js +19 -0
  8. package/dist/cjs/components/ToastMessage/index.js.map +1 -0
  9. package/dist/esm/components/ProgressRing/ProgressRing.d.ts +1 -0
  10. package/dist/esm/components/ProgressRing/ProgressRing.d.ts.map +1 -1
  11. package/dist/esm/components/ProgressRing/ProgressRing.js +6 -3
  12. package/dist/esm/components/ProgressRing/ProgressRing.js.map +1 -1
  13. package/dist/esm/components/ToastMessage/Styles.d.ts +10 -0
  14. package/dist/esm/components/ToastMessage/Styles.d.ts.map +1 -0
  15. package/dist/esm/components/ToastMessage/Styles.js +37 -0
  16. package/dist/esm/components/ToastMessage/Styles.js.map +1 -0
  17. package/dist/esm/components/ToastMessage/ToastMessage.d.ts +14 -0
  18. package/dist/esm/components/ToastMessage/ToastMessage.d.ts.map +1 -0
  19. package/dist/esm/components/ToastMessage/ToastMessage.js +34 -0
  20. package/dist/esm/components/ToastMessage/ToastMessage.js.map +1 -0
  21. package/dist/esm/components/ToastMessage/index.d.ts +2 -0
  22. package/dist/esm/components/ToastMessage/index.d.ts.map +1 -0
  23. package/dist/esm/components/ToastMessage/index.js +2 -0
  24. package/dist/esm/components/ToastMessage/index.js.map +1 -0
  25. package/dist/index.js +82 -80
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.min.js +1 -1
  28. package/dist/index.min.js.map +1 -1
  29. package/package.json +1 -1
@@ -11,6 +11,10 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _Styles = require("./Styles");
13
13
 
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
14
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
19
 
16
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -23,7 +27,8 @@ var ProgressRing = function ProgressRing(_ref) {
23
27
  _ref$radius = _ref.radius,
24
28
  radius = _ref$radius === void 0 ? 20 : _ref$radius,
25
29
  _ref$stroke = _ref.stroke,
26
- stroke = _ref$stroke === void 0 ? 3 : _ref$stroke;
30
+ stroke = _ref$stroke === void 0 ? 3 : _ref$stroke,
31
+ className = _ref.className;
27
32
  var normalizedRadius = (0, _react.useMemo)(function () {
28
33
  return radius - stroke;
29
34
  }, [radius, stroke]);
@@ -38,12 +43,13 @@ var ProgressRing = function ProgressRing(_ref) {
38
43
  }, [circumference, progress]);
39
44
  return /*#__PURE__*/_react.default.createElement(_Styles.StyledSvg, {
40
45
  height: radius * 2,
41
- width: radius * 2
46
+ width: radius * 2,
47
+ className: (0, _classnames.default)(className)
42
48
  }, /*#__PURE__*/_react.default.createElement(_Styles.StyledBackgroundCircle, {
43
49
  $color: backgroundColor,
44
50
  $strokeDashOffset: -strokeDashoffsetOuter,
45
51
  strokeWidth: stroke,
46
- strokeDasharray: circumference,
52
+ strokeDasharray: "".concat(circumference, " ").concat(circumference),
47
53
  r: normalizedRadius,
48
54
  cx: radius,
49
55
  cy: radius
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":["ProgressRing","backgroundColor","progressColor","progress","radius","stroke","normalizedRadius","circumference","Math","PI","strokeDashoffsetOuter","strokeDashoffsetInner","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;;;;;AAmBO,IAAMA,YAAoC,GAAG,SAAvCA,YAAuC,OAM9C;AAAA,MALJC,eAKI,QALJA,eAKI;AAAA,MAJJC,aAII,QAJJA,aAII;AAAA,2BAHJC,QAGI;AAAA,MAHJA,QAGI,8BAHO,CAGP;AAAA,yBAFJC,MAEI;AAAA,MAFJA,MAEI,4BAFK,EAEL;AAAA,yBADJC,MACI;AAAA,MADJA,MACI,4BADK,CACL;AACJ,MAAMC,gBAAgB,GAAG,oBAAQ;AAAA,WAAMF,MAAM,GAAGC,MAAf;AAAA,GAAR,EAA+B,CAACD,MAAD,EAASC,MAAT,CAA/B,CAAzB;AACA,MAAME,aAAa,GAAG,oBACpB;AAAA,WAAMD,gBAAgB,GAAG,CAAnB,GAAuBE,IAAI,CAACC,EAAlC;AAAA,GADoB,EAEpB,CAACH,gBAAD,CAFoB,CAAtB;AAIA,MAAMI,qBAAqB,GAAG,oBAC5B;AAAA,WAAMH,aAAa,GAAI,CAAC,MAAMJ,QAAP,IAAmB,GAApB,GAA2BI,aAAjD;AAAA,GAD4B,EAE5B,CAACA,aAAD,EAAgBJ,QAAhB,CAF4B,CAA9B;AAIA,MAAMQ,qBAAqB,GAAG,oBAC5B;AAAA,WAAMJ,aAAa,GAAIJ,QAAQ,GAAG,GAAZ,GAAmBI,aAAzC;AAAA,GAD4B,EAE5B,CAACA,aAAD,EAAgBJ,QAAhB,CAF4B,CAA9B;AAKA,sBACE,6BAAC,iBAAD;AAAW,IAAA,MAAM,EAAEC,MAAM,GAAG,CAA5B;AAA+B,IAAA,KAAK,EAAEA,MAAM,GAAG;AAA/C,kBACE,6BAAC,8BAAD;AACE,IAAA,MAAM,EAAEH,eADV;AAEE,IAAA,iBAAiB,EAAE,CAACS,qBAFtB;AAGE,IAAA,WAAW,EAAEL,MAHf;AAIE,IAAA,eAAe,EAAEE,aAJnB;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEF,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IADF,eAUE,6BAAC,8BAAD;AACE,IAAA,MAAM,EAAEF,aADV;AAEE,IAAA,iBAAiB,EAAES,qBAFrB;AAGE,IAAA,WAAW,EAAEN,MAHf;AAIE,IAAA,eAAe,YAAKE,aAAL,cAAsBA,aAAtB,CAJjB;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEF,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IAVF,CADF;AAsBD,CA3CM;;;AA6CPJ,YAAY,CAACY,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { FC, useMemo } from \"react\";\nimport {\n StyledBackgroundCircle,\n StyledForegroundCircle,\n StyledSvg,\n} from \"./Styles\";\n\nexport interface IProgressRingProps {\n /** Progress prop can be number. */\n progress?: number;\n /** Custom classname for styling. */\n backgroundColor?: string;\n /** Custom classname for styling. */\n progressColor?: string;\n /** Custom classname for styling. */\n radius?: number;\n /** Custom classname for styling. */\n stroke?: number;\n}\n\nexport const ProgressRing: FC<IProgressRingProps> = ({\n backgroundColor,\n progressColor,\n progress = 0,\n radius = 20,\n stroke = 3,\n}) => {\n const normalizedRadius = useMemo(() => radius - stroke, [radius, stroke]);\n const circumference = useMemo(\n () => normalizedRadius * 2 * Math.PI,\n [normalizedRadius]\n );\n const strokeDashoffsetOuter = useMemo(\n () => circumference - ((100 - progress) / 100) * circumference,\n [circumference, progress]\n );\n const strokeDashoffsetInner = useMemo(\n () => circumference - (progress / 100) * circumference,\n [circumference, progress]\n );\n\n return (\n <StyledSvg height={radius * 2} width={radius * 2}>\n <StyledBackgroundCircle\n $color={backgroundColor}\n $strokeDashOffset={-strokeDashoffsetOuter}\n strokeWidth={stroke}\n strokeDasharray={circumference}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n <StyledForegroundCircle\n $color={progressColor}\n $strokeDashOffset={strokeDashoffsetInner}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n </StyledSvg>\n );\n};\n\nProgressRing.displayName = \"ProgressRing\";\n"],"file":"ProgressRing.js"}
1
+ {"version":3,"sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":["ProgressRing","backgroundColor","progressColor","progress","radius","stroke","className","normalizedRadius","circumference","Math","PI","strokeDashoffsetOuter","strokeDashoffsetInner","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;AAKA;;;;;;;;AAiBO,IAAMA,YAAoC,GAAG,SAAvCA,YAAuC,OAO9C;AAAA,MANJC,eAMI,QANJA,eAMI;AAAA,MALJC,aAKI,QALJA,aAKI;AAAA,2BAJJC,QAII;AAAA,MAJJA,QAII,8BAJO,CAIP;AAAA,yBAHJC,MAGI;AAAA,MAHJA,MAGI,4BAHK,EAGL;AAAA,yBAFJC,MAEI;AAAA,MAFJA,MAEI,4BAFK,CAEL;AAAA,MADJC,SACI,QADJA,SACI;AACJ,MAAMC,gBAAgB,GAAG,oBAAQ;AAAA,WAAMH,MAAM,GAAGC,MAAf;AAAA,GAAR,EAA+B,CAACD,MAAD,EAASC,MAAT,CAA/B,CAAzB;AACA,MAAMG,aAAa,GAAG,oBACpB;AAAA,WAAMD,gBAAgB,GAAG,CAAnB,GAAuBE,IAAI,CAACC,EAAlC;AAAA,GADoB,EAEpB,CAACH,gBAAD,CAFoB,CAAtB;AAIA,MAAMI,qBAAqB,GAAG,oBAC5B;AAAA,WAAMH,aAAa,GAAI,CAAC,MAAML,QAAP,IAAmB,GAApB,GAA2BK,aAAjD;AAAA,GAD4B,EAE5B,CAACA,aAAD,EAAgBL,QAAhB,CAF4B,CAA9B;AAIA,MAAMS,qBAAqB,GAAG,oBAC5B;AAAA,WAAMJ,aAAa,GAAIL,QAAQ,GAAG,GAAZ,GAAmBK,aAAzC;AAAA,GAD4B,EAE5B,CAACA,aAAD,EAAgBL,QAAhB,CAF4B,CAA9B;AAKA,sBACE,6BAAC,iBAAD;AACE,IAAA,MAAM,EAAEC,MAAM,GAAG,CADnB;AAEE,IAAA,KAAK,EAAEA,MAAM,GAAG,CAFlB;AAGE,IAAA,SAAS,EAAE,yBAAWE,SAAX;AAHb,kBAKE,6BAAC,8BAAD;AACE,IAAA,MAAM,EAAEL,eADV;AAEE,IAAA,iBAAiB,EAAE,CAACU,qBAFtB;AAGE,IAAA,WAAW,EAAEN,MAHf;AAIE,IAAA,eAAe,YAAKG,aAAL,cAAsBA,aAAtB,CAJjB;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEH,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IALF,eAcE,6BAAC,8BAAD;AACE,IAAA,MAAM,EAAEF,aADV;AAEE,IAAA,iBAAiB,EAAEU,qBAFrB;AAGE,IAAA,WAAW,EAAEP,MAHf;AAIE,IAAA,eAAe,YAAKG,aAAL,cAAsBA,aAAtB,CAJjB;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEH,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IAdF,CADF;AA0BD,CAhDM;;;AAkDPJ,YAAY,CAACa,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { FC, useMemo } from \"react\";\nimport {\n StyledBackgroundCircle,\n StyledForegroundCircle,\n StyledSvg,\n} from \"./Styles\";\nimport classNames from \"classnames\";\n\nexport interface IProgressRingProps {\n /** Progress prop can be number. */\n progress?: number;\n /** Custom classname for styling. */\n backgroundColor?: string;\n /** Custom classname for styling. */\n progressColor?: string;\n /** Custom classname for styling. */\n radius?: number;\n /** Custom classname for styling. */\n stroke?: number;\n /** Applies passed classes */\n className?: string;\n}\n\nexport const ProgressRing: FC<IProgressRingProps> = ({\n backgroundColor,\n progressColor,\n progress = 0,\n radius = 20,\n stroke = 3,\n className,\n}) => {\n const normalizedRadius = useMemo(() => radius - stroke, [radius, stroke]);\n const circumference = useMemo(\n () => normalizedRadius * 2 * Math.PI,\n [normalizedRadius]\n );\n const strokeDashoffsetOuter = useMemo(\n () => circumference - ((100 - progress) / 100) * circumference,\n [circumference, progress]\n );\n const strokeDashoffsetInner = useMemo(\n () => circumference - (progress / 100) * circumference,\n [circumference, progress]\n );\n\n return (\n <StyledSvg\n height={radius * 2}\n width={radius * 2}\n className={classNames(className)}\n >\n <StyledBackgroundCircle\n $color={backgroundColor}\n $strokeDashOffset={-strokeDashoffsetOuter}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n <StyledForegroundCircle\n $color={progressColor}\n $strokeDashOffset={strokeDashoffsetInner}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n </StyledSvg>\n );\n};\n\nProgressRing.displayName = \"ProgressRing\";\n"],"file":"ProgressRing.js"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.StyledToastMessageText = exports.StyledToastMessage = exports.StyledCloseSmallIcon = void 0;
9
+
10
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+
12
+ var _Icons = require("../Icons");
13
+
14
+ var _BoxSizingStyle = require("../BoxSizingStyle");
15
+
16
+ var _FontStyle = require("../FontStyle");
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ var StyledToastMessage = _styledComponents.default.div.withConfig({
23
+ displayName: "Styles__StyledToastMessage",
24
+ componentId: "sc-7wr5ky-0"
25
+ })(["display:flex;flex-direction:row;align-items:center;height:36px;width:fit-content;max-width:100%;padding:10px 8px 10px 16px;border-radius:18px;", " ", " ", " ", " ", " ", ""], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, function (props) {
26
+ return props.$type === "error" && (0, _styledComponents.css)(["background-color:#f1a5a5;", ""], props.$dropShadow && (0, _styledComponents.css)(["box-shadow:0px 7px 12px -4px rgba(234,179,179,0.7);"]));
27
+ }, function (props) {
28
+ return props.$type === "success" && (0, _styledComponents.css)(["background-color:#afdfdb;", ""], props.$dropShadow && (0, _styledComponents.css)(["box-shadow:0px 7px 12px -4px rgba(182,218,215,0.7);"]));
29
+ }, function (props) {
30
+ return props.$type === "general" && (0, _styledComponents.css)(["background-color:#bddff6;", ""], props.$dropShadow && (0, _styledComponents.css)(["box-shadow:0px 7px 12px -4px rgba(166,199,220,0.7);"]));
31
+ }, function (props) {
32
+ return props.$type === "warning" && (0, _styledComponents.css)(["background-color:#ffffd1;", ""], props.$dropShadow && (0, _styledComponents.css)(["box-shadow:0px 7px 12px -4px rgba(242,242,208,0.7);"]));
33
+ });
34
+
35
+ exports.StyledToastMessage = StyledToastMessage;
36
+
37
+ var StyledToastMessageText = _styledComponents.default.div.withConfig({
38
+ displayName: "Styles__StyledToastMessageText",
39
+ componentId: "sc-7wr5ky-1"
40
+ })(["", " ", " ", " ", " color:rgba(48,48,55,0.65);"], {
41
+ "fontSize": "0.75rem"
42
+ }, {
43
+ "fontWeight": "700"
44
+ }, {
45
+ "overflow": "hidden",
46
+ "textOverflow": "ellipsis",
47
+ "whiteSpace": "nowrap"
48
+ }, {
49
+ "marginRight": "0.5rem"
50
+ });
51
+
52
+ exports.StyledToastMessageText = StyledToastMessageText;
53
+ var StyledCloseSmallIcon = (0, _styledComponents.default)(_Icons.CloseSmallIcon).withConfig({
54
+ displayName: "Styles__StyledCloseSmallIcon",
55
+ componentId: "sc-7wr5ky-2"
56
+ })(["fill:rgba(48,48,55,0.3);flex-shrink:0;cursor:pointer;&:hover{fill:rgba(48,48,55,0.65);}"]);
57
+ exports.StyledCloseSmallIcon = StyledCloseSmallIcon;
58
+ StyledToastMessage.displayName = "StyledToastMessage";
59
+ StyledCloseSmallIcon.displayName = "StyledCloseSmallIcon";
60
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ToastMessage/Styles.ts"],"names":["StyledToastMessage","styled","div","FontStyle","BoxSizingStyle","props","$type","css","$dropShadow","StyledToastMessageText","StyledCloseSmallIcon","CloseSmallIcon","displayName"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;AAOO,IAAMA,kBAAkB,GAAGC,0BAAOC,GAAV;AAAA;AAAA;AAAA,oLAU3BC,oBAV2B,EAW3BC,8BAX2B,EAa3B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,OAAhB,QACAC,qBADA,qCAGIF,KAAK,CAACG,WAAN,QACFD,qBADE,0DAHJ,CADA;AAAA,CAb2B,EAuB3B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,SAAhB,QACAC,qBADA,qCAGIF,KAAK,CAACG,WAAN,QACFD,qBADE,0DAHJ,CADA;AAAA,CAvB2B,EAiC3B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,SAAhB,QACAC,qBADA,qCAGIF,KAAK,CAACG,WAAN,QACFD,qBADE,0DAHJ,CADA;AAAA,CAjC2B,EA2C3B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,SAAhB,QACAC,qBADA,qCAGIF,KAAK,CAACG,WAAN,QACFD,qBADE,0DAHJ,CADA;AAAA,CA3C2B,CAAxB;;;;AAsDA,IAAME,sBAAsB,GAAGR,0BAAOC,GAAV;AAAA;AAAA;AAAA,uDAC7B;AAAA;AAAA,CAD6B,EAE7B;AAAA;AAAA,CAF6B,EAG7B;AAAA;AAAA;AAAA;AAAA,CAH6B,EAI7B;AAAA;AAAA,CAJ6B,CAA5B;;;AAQA,IAAMQ,oBAAoB,GAAG,+BAAOC,qBAAP,CAAH;AAAA;AAAA;AAAA,+FAA1B;;AAUPX,kBAAkB,CAACY,WAAnB,GAAiC,oBAAjC;AACAF,oBAAoB,CAACE,WAArB,GAAmC,sBAAnC","sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\nimport { CloseSmallIcon } from \"../Icons\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledToastMessageProps {\n $type: \"error\" | \"success\" | \"general\" | \"warning\";\n $dropShadow?: boolean;\n}\n\nexport const StyledToastMessage = styled.div<StyledToastMessageProps>`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 36px;\n width: fit-content;\n max-width: 100%;\n padding: 10px 8px 10px 16px;\n border-radius: 18px;\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${(props) =>\n props.$type === \"error\" &&\n css`\n background-color: #f1a5a5;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(234, 179, 179, 0.7);\n `}\n `}\n\n ${(props) =>\n props.$type === \"success\" &&\n css`\n background-color: #afdfdb;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(182, 218, 215, 0.7);\n `}\n `}\n\n ${(props) =>\n props.$type === \"general\" &&\n css`\n background-color: #bddff6;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(166, 199, 220, 0.7);\n `}\n `}\n\n ${(props) =>\n props.$type === \"warning\" &&\n css`\n background-color: #ffffd1;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(242, 242, 208, 0.7);\n `}\n `}\n`;\n\nexport const StyledToastMessageText = styled.div`\n ${tw`tw-text-caption-1`}\n ${tw`tw-font-bold`}\n ${tw`tw-truncate`}\n ${tw`tw-mr-2`}\n color: rgba(48, 48, 55, 0.65);\n`;\n\nexport const StyledCloseSmallIcon = styled(CloseSmallIcon)`\n fill: rgba(48, 48, 55, 0.3);\n flex-shrink: 0;\n cursor: pointer;\n\n &:hover {\n fill: rgba(48, 48, 55, 0.65);\n }\n`;\n\nStyledToastMessage.displayName = \"StyledToastMessage\";\nStyledCloseSmallIcon.displayName = \"StyledCloseSmallIcon\";\n"],"file":"Styles.js"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ToastMessage = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _Styles = require("./Styles");
13
+
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+
18
+ var ToastMessage = function ToastMessage(_ref) {
19
+ var text = _ref.text,
20
+ type = _ref.type,
21
+ onClose = _ref.onClose,
22
+ _ref$dismissable = _ref.dismissable,
23
+ dismissable = _ref$dismissable === void 0 ? false : _ref$dismissable,
24
+ _ref$dropShadow = _ref.dropShadow,
25
+ dropShadow = _ref$dropShadow === void 0 ? false : _ref$dropShadow,
26
+ _ref$timeout = _ref.timeout,
27
+ timeout = _ref$timeout === void 0 ? 0 : _ref$timeout;
28
+ var handleOnClose = (0, _react.useCallback)(function () {
29
+ if (typeof onClose === "function") {
30
+ onClose();
31
+ }
32
+ }, [onClose]);
33
+ (0, _react.useEffect)(function () {
34
+ if (timeout > 0) {
35
+ var timer = setTimeout(handleOnClose, timeout);
36
+ return function () {
37
+ return clearTimeout(timer);
38
+ };
39
+ }
40
+ }, [dismissable, timeout, handleOnClose]);
41
+ return /*#__PURE__*/_react.default.createElement(_Styles.StyledToastMessage, {
42
+ $type: type,
43
+ $dropShadow: dropShadow
44
+ }, /*#__PURE__*/_react.default.createElement(_Styles.StyledToastMessageText, null, text), dismissable ? /*#__PURE__*/_react.default.createElement(_Styles.StyledCloseSmallIcon, {
45
+ onClick: handleOnClose
46
+ }) : null);
47
+ };
48
+
49
+ exports.ToastMessage = ToastMessage;
50
+ ToastMessage.displayName = "ToastMessage";
51
+ //# sourceMappingURL=ToastMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ToastMessage/ToastMessage.tsx"],"names":["ToastMessage","text","type","onClose","dismissable","dropShadow","timeout","handleOnClose","timer","setTimeout","clearTimeout","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;;;;;AAeO,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAOH;AAAA,MANvBC,IAMuB,QANvBA,IAMuB;AAAA,MALvBC,IAKuB,QALvBA,IAKuB;AAAA,MAJvBC,OAIuB,QAJvBA,OAIuB;AAAA,8BAHvBC,WAGuB;AAAA,MAHvBA,WAGuB,iCAHT,KAGS;AAAA,6BAFvBC,UAEuB;AAAA,MAFvBA,UAEuB,gCAFV,KAEU;AAAA,0BADvBC,OACuB;AAAA,MADvBA,OACuB,6BADb,CACa;AACvB,MAAMC,aAAa,GAAG,wBAAY,YAAM;AACtC,QAAI,OAAOJ,OAAP,KAAmB,UAAvB,EAAmC;AACjCA,MAAAA,OAAO;AACR;AACF,GAJqB,EAInB,CAACA,OAAD,CAJmB,CAAtB;AAMA,wBAAU,YAAM;AACd,QAAIG,OAAO,GAAG,CAAd,EAAiB;AACf,UAAME,KAAK,GAAGC,UAAU,CAACF,aAAD,EAAgBD,OAAhB,CAAxB;AAEA,aAAO;AAAA,eAAMI,YAAY,CAACF,KAAD,CAAlB;AAAA,OAAP;AACD;AACF,GAND,EAMG,CAACJ,WAAD,EAAcE,OAAd,EAAuBC,aAAvB,CANH;AAQA,sBACE,6BAAC,0BAAD;AAAoB,IAAA,KAAK,EAAEL,IAA3B;AAAiC,IAAA,WAAW,EAAEG;AAA9C,kBACE,6BAAC,8BAAD,QAAyBJ,IAAzB,CADF,EAEGG,WAAW,gBAAG,6BAAC,4BAAD;AAAsB,IAAA,OAAO,EAAEG;AAA/B,IAAH,GAAsD,IAFpE,CADF;AAMD,CA5BM;;;AA8BPP,YAAY,CAACW,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { useEffect, useCallback } from \"react\";\nimport {\n StyledToastMessage,\n StyledToastMessageText,\n StyledCloseSmallIcon,\n} from \"./Styles\";\n\nexport interface ToastMessageProps {\n text: string;\n type: \"error\" | \"success\" | \"general\" | \"warning\";\n onClose?: () => void;\n dismissable?: boolean;\n dropShadow?: boolean;\n timeout?: number;\n}\n\nexport const ToastMessage = ({\n text,\n type,\n onClose,\n dismissable = false,\n dropShadow = false,\n timeout = 0,\n}: ToastMessageProps) => {\n const handleOnClose = useCallback(() => {\n if (typeof onClose === \"function\") {\n onClose();\n }\n }, [onClose]);\n\n useEffect(() => {\n if (timeout > 0) {\n const timer = setTimeout(handleOnClose, timeout);\n\n return () => clearTimeout(timer);\n }\n }, [dismissable, timeout, handleOnClose]);\n\n return (\n <StyledToastMessage $type={type} $dropShadow={dropShadow}>\n <StyledToastMessageText>{text}</StyledToastMessageText>\n {dismissable ? <StyledCloseSmallIcon onClick={handleOnClose} /> : null}\n </StyledToastMessage>\n );\n};\n\nToastMessage.displayName = \"ToastMessage\";\n"],"file":"ToastMessage.js"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _ToastMessage = require("./ToastMessage");
8
+
9
+ Object.keys(_ToastMessage).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _ToastMessage[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _ToastMessage[key];
16
+ }
17
+ });
18
+ });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ToastMessage/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./ToastMessage\";\n"],"file":"index.js"}
@@ -5,6 +5,7 @@ export interface IProgressRingProps {
5
5
  progressColor?: string;
6
6
  radius?: number;
7
7
  stroke?: number;
8
+ className?: string;
8
9
  }
9
10
  export declare const ProgressRing: FC<IProgressRingProps>;
10
11
  //# sourceMappingURL=ProgressRing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAO3C,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,kBAAkB,CA2C/C,CAAC"}
1
+ {"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAQ3C,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,kBAAkB,CAgD/C,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { StyledBackgroundCircle, StyledForegroundCircle, StyledSvg } from "./Styles";
3
+ import classNames from "classnames";
3
4
  export var ProgressRing = function ProgressRing(_ref) {
4
5
  var backgroundColor = _ref.backgroundColor,
5
6
  progressColor = _ref.progressColor,
@@ -8,7 +9,8 @@ export var ProgressRing = function ProgressRing(_ref) {
8
9
  _ref$radius = _ref.radius,
9
10
  radius = _ref$radius === void 0 ? 20 : _ref$radius,
10
11
  _ref$stroke = _ref.stroke,
11
- stroke = _ref$stroke === void 0 ? 3 : _ref$stroke;
12
+ stroke = _ref$stroke === void 0 ? 3 : _ref$stroke,
13
+ className = _ref.className;
12
14
  var normalizedRadius = useMemo(function () {
13
15
  return radius - stroke;
14
16
  }, [radius, stroke]);
@@ -23,12 +25,13 @@ export var ProgressRing = function ProgressRing(_ref) {
23
25
  }, [circumference, progress]);
24
26
  return /*#__PURE__*/React.createElement(StyledSvg, {
25
27
  height: radius * 2,
26
- width: radius * 2
28
+ width: radius * 2,
29
+ className: classNames(className)
27
30
  }, /*#__PURE__*/React.createElement(StyledBackgroundCircle, {
28
31
  $color: backgroundColor,
29
32
  $strokeDashOffset: -strokeDashoffsetOuter,
30
33
  strokeWidth: stroke,
31
- strokeDasharray: circumference,
34
+ strokeDasharray: circumference + " " + circumference,
32
35
  r: normalizedRadius,
33
36
  cx: radius,
34
37
  cy: radius
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":["React","useMemo","StyledBackgroundCircle","StyledForegroundCircle","StyledSvg","ProgressRing","backgroundColor","progressColor","progress","radius","stroke","normalizedRadius","circumference","Math","PI","strokeDashoffsetOuter","strokeDashoffsetInner","displayName"],"mappings":"AAAA,OAAOA,KAAP,IAAoBC,OAApB,QAAmC,OAAnC;AACA,SACEC,sBADF,EAEEC,sBAFF,EAGEC,SAHF,QAIO,UAJP;AAmBA,OAAO,IAAMC,YAAoC,GAAG,SAAvCA,YAAuC,OAM9C;AAAA,MALJC,eAKI,QALJA,eAKI;AAAA,MAJJC,aAII,QAJJA,aAII;AAAA,2BAHJC,QAGI;AAAA,MAHJA,QAGI,8BAHO,CAGP;AAAA,yBAFJC,MAEI;AAAA,MAFJA,MAEI,4BAFK,EAEL;AAAA,yBADJC,MACI;AAAA,MADJA,MACI,4BADK,CACL;AACJ,MAAMC,gBAAgB,GAAGV,OAAO,CAAC;AAAA,WAAMQ,MAAM,GAAGC,MAAf;AAAA,GAAD,EAAwB,CAACD,MAAD,EAASC,MAAT,CAAxB,CAAhC;AACA,MAAME,aAAa,GAAGX,OAAO,CAC3B;AAAA,WAAMU,gBAAgB,GAAG,CAAnB,GAAuBE,IAAI,CAACC,EAAlC;AAAA,GAD2B,EAE3B,CAACH,gBAAD,CAF2B,CAA7B;AAIA,MAAMI,qBAAqB,GAAGd,OAAO,CACnC;AAAA,WAAMW,aAAa,GAAI,CAAC,MAAMJ,QAAP,IAAmB,GAApB,GAA2BI,aAAjD;AAAA,GADmC,EAEnC,CAACA,aAAD,EAAgBJ,QAAhB,CAFmC,CAArC;AAIA,MAAMQ,qBAAqB,GAAGf,OAAO,CACnC;AAAA,WAAMW,aAAa,GAAIJ,QAAQ,GAAG,GAAZ,GAAmBI,aAAzC;AAAA,GADmC,EAEnC,CAACA,aAAD,EAAgBJ,QAAhB,CAFmC,CAArC;AAKA,sBACE,oBAAC,SAAD;AAAW,IAAA,MAAM,EAAEC,MAAM,GAAG,CAA5B;AAA+B,IAAA,KAAK,EAAEA,MAAM,GAAG;AAA/C,kBACE,oBAAC,sBAAD;AACE,IAAA,MAAM,EAAEH,eADV;AAEE,IAAA,iBAAiB,EAAE,CAACS,qBAFtB;AAGE,IAAA,WAAW,EAAEL,MAHf;AAIE,IAAA,eAAe,EAAEE,aAJnB;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEF,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IADF,eAUE,oBAAC,sBAAD;AACE,IAAA,MAAM,EAAEF,aADV;AAEE,IAAA,iBAAiB,EAAES,qBAFrB;AAGE,IAAA,WAAW,EAAEN,MAHf;AAIE,IAAA,eAAe,EAAKE,aAAL,SAAsBA,aAJvC;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEF,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IAVF,CADF;AAsBD,CA3CM;AA6CPJ,YAAY,CAACY,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { FC, useMemo } from \"react\";\nimport {\n StyledBackgroundCircle,\n StyledForegroundCircle,\n StyledSvg,\n} from \"./Styles\";\n\nexport interface IProgressRingProps {\n /** Progress prop can be number. */\n progress?: number;\n /** Custom classname for styling. */\n backgroundColor?: string;\n /** Custom classname for styling. */\n progressColor?: string;\n /** Custom classname for styling. */\n radius?: number;\n /** Custom classname for styling. */\n stroke?: number;\n}\n\nexport const ProgressRing: FC<IProgressRingProps> = ({\n backgroundColor,\n progressColor,\n progress = 0,\n radius = 20,\n stroke = 3,\n}) => {\n const normalizedRadius = useMemo(() => radius - stroke, [radius, stroke]);\n const circumference = useMemo(\n () => normalizedRadius * 2 * Math.PI,\n [normalizedRadius]\n );\n const strokeDashoffsetOuter = useMemo(\n () => circumference - ((100 - progress) / 100) * circumference,\n [circumference, progress]\n );\n const strokeDashoffsetInner = useMemo(\n () => circumference - (progress / 100) * circumference,\n [circumference, progress]\n );\n\n return (\n <StyledSvg height={radius * 2} width={radius * 2}>\n <StyledBackgroundCircle\n $color={backgroundColor}\n $strokeDashOffset={-strokeDashoffsetOuter}\n strokeWidth={stroke}\n strokeDasharray={circumference}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n <StyledForegroundCircle\n $color={progressColor}\n $strokeDashOffset={strokeDashoffsetInner}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n </StyledSvg>\n );\n};\n\nProgressRing.displayName = \"ProgressRing\";\n"],"file":"ProgressRing.js"}
1
+ {"version":3,"sources":["../../../../src/components/ProgressRing/ProgressRing.tsx"],"names":["React","useMemo","StyledBackgroundCircle","StyledForegroundCircle","StyledSvg","classNames","ProgressRing","backgroundColor","progressColor","progress","radius","stroke","className","normalizedRadius","circumference","Math","PI","strokeDashoffsetOuter","strokeDashoffsetInner","displayName"],"mappings":"AAAA,OAAOA,KAAP,IAAoBC,OAApB,QAAmC,OAAnC;AACA,SACEC,sBADF,EAEEC,sBAFF,EAGEC,SAHF,QAIO,UAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AAiBA,OAAO,IAAMC,YAAoC,GAAG,SAAvCA,YAAuC,OAO9C;AAAA,MANJC,eAMI,QANJA,eAMI;AAAA,MALJC,aAKI,QALJA,aAKI;AAAA,2BAJJC,QAII;AAAA,MAJJA,QAII,8BAJO,CAIP;AAAA,yBAHJC,MAGI;AAAA,MAHJA,MAGI,4BAHK,EAGL;AAAA,yBAFJC,MAEI;AAAA,MAFJA,MAEI,4BAFK,CAEL;AAAA,MADJC,SACI,QADJA,SACI;AACJ,MAAMC,gBAAgB,GAAGZ,OAAO,CAAC;AAAA,WAAMS,MAAM,GAAGC,MAAf;AAAA,GAAD,EAAwB,CAACD,MAAD,EAASC,MAAT,CAAxB,CAAhC;AACA,MAAMG,aAAa,GAAGb,OAAO,CAC3B;AAAA,WAAMY,gBAAgB,GAAG,CAAnB,GAAuBE,IAAI,CAACC,EAAlC;AAAA,GAD2B,EAE3B,CAACH,gBAAD,CAF2B,CAA7B;AAIA,MAAMI,qBAAqB,GAAGhB,OAAO,CACnC;AAAA,WAAMa,aAAa,GAAI,CAAC,MAAML,QAAP,IAAmB,GAApB,GAA2BK,aAAjD;AAAA,GADmC,EAEnC,CAACA,aAAD,EAAgBL,QAAhB,CAFmC,CAArC;AAIA,MAAMS,qBAAqB,GAAGjB,OAAO,CACnC;AAAA,WAAMa,aAAa,GAAIL,QAAQ,GAAG,GAAZ,GAAmBK,aAAzC;AAAA,GADmC,EAEnC,CAACA,aAAD,EAAgBL,QAAhB,CAFmC,CAArC;AAKA,sBACE,oBAAC,SAAD;AACE,IAAA,MAAM,EAAEC,MAAM,GAAG,CADnB;AAEE,IAAA,KAAK,EAAEA,MAAM,GAAG,CAFlB;AAGE,IAAA,SAAS,EAAEL,UAAU,CAACO,SAAD;AAHvB,kBAKE,oBAAC,sBAAD;AACE,IAAA,MAAM,EAAEL,eADV;AAEE,IAAA,iBAAiB,EAAE,CAACU,qBAFtB;AAGE,IAAA,WAAW,EAAEN,MAHf;AAIE,IAAA,eAAe,EAAKG,aAAL,SAAsBA,aAJvC;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEH,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IALF,eAcE,oBAAC,sBAAD;AACE,IAAA,MAAM,EAAEF,aADV;AAEE,IAAA,iBAAiB,EAAEU,qBAFrB;AAGE,IAAA,WAAW,EAAEP,MAHf;AAIE,IAAA,eAAe,EAAKG,aAAL,SAAsBA,aAJvC;AAKE,IAAA,CAAC,EAAED,gBALL;AAME,IAAA,EAAE,EAAEH,MANN;AAOE,IAAA,EAAE,EAAEA;AAPN,IAdF,CADF;AA0BD,CAhDM;AAkDPJ,YAAY,CAACa,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { FC, useMemo } from \"react\";\nimport {\n StyledBackgroundCircle,\n StyledForegroundCircle,\n StyledSvg,\n} from \"./Styles\";\nimport classNames from \"classnames\";\n\nexport interface IProgressRingProps {\n /** Progress prop can be number. */\n progress?: number;\n /** Custom classname for styling. */\n backgroundColor?: string;\n /** Custom classname for styling. */\n progressColor?: string;\n /** Custom classname for styling. */\n radius?: number;\n /** Custom classname for styling. */\n stroke?: number;\n /** Applies passed classes */\n className?: string;\n}\n\nexport const ProgressRing: FC<IProgressRingProps> = ({\n backgroundColor,\n progressColor,\n progress = 0,\n radius = 20,\n stroke = 3,\n className,\n}) => {\n const normalizedRadius = useMemo(() => radius - stroke, [radius, stroke]);\n const circumference = useMemo(\n () => normalizedRadius * 2 * Math.PI,\n [normalizedRadius]\n );\n const strokeDashoffsetOuter = useMemo(\n () => circumference - ((100 - progress) / 100) * circumference,\n [circumference, progress]\n );\n const strokeDashoffsetInner = useMemo(\n () => circumference - (progress / 100) * circumference,\n [circumference, progress]\n );\n\n return (\n <StyledSvg\n height={radius * 2}\n width={radius * 2}\n className={classNames(className)}\n >\n <StyledBackgroundCircle\n $color={backgroundColor}\n $strokeDashOffset={-strokeDashoffsetOuter}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n <StyledForegroundCircle\n $color={progressColor}\n $strokeDashOffset={strokeDashoffsetInner}\n strokeWidth={stroke}\n strokeDasharray={`${circumference} ${circumference}`}\n r={normalizedRadius}\n cx={radius}\n cy={radius}\n />\n </StyledSvg>\n );\n};\n\nProgressRing.displayName = \"ProgressRing\";\n"],"file":"ProgressRing.js"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface StyledToastMessageProps {
3
+ $type: "error" | "success" | "general" | "warning";
4
+ $dropShadow?: boolean;
5
+ }
6
+ export declare const StyledToastMessage: import("styled-components").StyledComponent<"div", any, StyledToastMessageProps, never>;
7
+ export declare const StyledToastMessageText: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const StyledCloseSmallIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "style" | "clipPath" | "filter" | "mask" | "path" | "key" | "name" | "type" | "className" | "id" | "lang" | "tabIndex" | "role" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "tw" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "height" | "max" | "media" | "method" | "min" | "target" | "width" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clip" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "display" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "end" | "exponent" | "externalResourcesRequired" | "fill" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "href" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "letterSpacing" | "lightingColor" | "limitingConeAngle" | "local" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overflow" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "transform" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan"> & import("react").RefAttributes<SVGSVGElement>>, any, {}, never>;
9
+ export {};
10
+ //# sourceMappingURL=Styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ToastMessage/Styles.ts"],"names":[],"mappings":";AAMA,UAAU,uBAAuB;IAC/B,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,yFAoD9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,oEAMlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,wqPAQhC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import styled, { css } from "styled-components";
2
+ import { CloseSmallIcon } from "../Icons";
3
+ import { BoxSizingStyle } from "../BoxSizingStyle";
4
+ import { FontStyle } from "../FontStyle";
5
+ export var StyledToastMessage = styled.div.withConfig({
6
+ displayName: "Styles__StyledToastMessage",
7
+ componentId: "sc-7wr5ky-0"
8
+ })(["display:flex;flex-direction:row;align-items:center;height:36px;width:fit-content;max-width:100%;padding:10px 8px 10px 16px;border-radius:18px;", " ", " ", " ", " ", " ", ""], FontStyle, BoxSizingStyle, function (props) {
9
+ return props.$type === "error" && css(["background-color:#f1a5a5;", ""], props.$dropShadow && css(["box-shadow:0px 7px 12px -4px rgba(234,179,179,0.7);"]));
10
+ }, function (props) {
11
+ return props.$type === "success" && css(["background-color:#afdfdb;", ""], props.$dropShadow && css(["box-shadow:0px 7px 12px -4px rgba(182,218,215,0.7);"]));
12
+ }, function (props) {
13
+ return props.$type === "general" && css(["background-color:#bddff6;", ""], props.$dropShadow && css(["box-shadow:0px 7px 12px -4px rgba(166,199,220,0.7);"]));
14
+ }, function (props) {
15
+ return props.$type === "warning" && css(["background-color:#ffffd1;", ""], props.$dropShadow && css(["box-shadow:0px 7px 12px -4px rgba(242,242,208,0.7);"]));
16
+ });
17
+ export var StyledToastMessageText = styled.div.withConfig({
18
+ displayName: "Styles__StyledToastMessageText",
19
+ componentId: "sc-7wr5ky-1"
20
+ })(["", " ", " ", " ", " color:rgba(48,48,55,0.65);"], {
21
+ "fontSize": "0.75rem"
22
+ }, {
23
+ "fontWeight": "700"
24
+ }, {
25
+ "overflow": "hidden",
26
+ "textOverflow": "ellipsis",
27
+ "whiteSpace": "nowrap"
28
+ }, {
29
+ "marginRight": "0.5rem"
30
+ });
31
+ export var StyledCloseSmallIcon = styled(CloseSmallIcon).withConfig({
32
+ displayName: "Styles__StyledCloseSmallIcon",
33
+ componentId: "sc-7wr5ky-2"
34
+ })(["fill:rgba(48,48,55,0.3);flex-shrink:0;cursor:pointer;&:hover{fill:rgba(48,48,55,0.65);}"]);
35
+ StyledToastMessage.displayName = "StyledToastMessage";
36
+ StyledCloseSmallIcon.displayName = "StyledCloseSmallIcon";
37
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ToastMessage/Styles.ts"],"names":["styled","css","CloseSmallIcon","BoxSizingStyle","FontStyle","StyledToastMessage","div","props","$type","$dropShadow","StyledToastMessageText","StyledCloseSmallIcon","displayName"],"mappings":"AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AAEA,SAASC,cAAT,QAA+B,UAA/B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,SAAT,QAA0B,cAA1B;AAOA,OAAO,IAAMC,kBAAkB,GAAGL,MAAM,CAACM,GAAV;AAAA;AAAA;AAAA,oLAU3BF,SAV2B,EAW3BD,cAX2B,EAa3B,UAACI,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,OAAhB,IACAP,GADA,oCAGIM,KAAK,CAACE,WAAN,IACFR,GADE,yDAHJ,CADA;AAAA,CAb2B,EAuB3B,UAACM,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,SAAhB,IACAP,GADA,oCAGIM,KAAK,CAACE,WAAN,IACFR,GADE,yDAHJ,CADA;AAAA,CAvB2B,EAiC3B,UAACM,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,SAAhB,IACAP,GADA,oCAGIM,KAAK,CAACE,WAAN,IACFR,GADE,yDAHJ,CADA;AAAA,CAjC2B,EA2C3B,UAACM,KAAD;AAAA,SACAA,KAAK,CAACC,KAAN,KAAgB,SAAhB,IACAP,GADA,oCAGIM,KAAK,CAACE,WAAN,IACFR,GADE,yDAHJ,CADA;AAAA,CA3C2B,CAAxB;AAsDP,OAAO,IAAMS,sBAAsB,GAAGV,MAAM,CAACM,GAAV;AAAA;AAAA;AAAA,uDAC7B;AAAA;AAAA,CAD6B,EAE7B;AAAA;AAAA,CAF6B,EAG7B;AAAA;AAAA;AAAA;AAAA,CAH6B,EAI7B;AAAA;AAAA,CAJ6B,CAA5B;AAQP,OAAO,IAAMK,oBAAoB,GAAGX,MAAM,CAACE,cAAD,CAAT;AAAA;AAAA;AAAA,+FAA1B;AAUPG,kBAAkB,CAACO,WAAnB,GAAiC,oBAAjC;AACAD,oBAAoB,CAACC,WAArB,GAAmC,sBAAnC","sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\nimport { CloseSmallIcon } from \"../Icons\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledToastMessageProps {\n $type: \"error\" | \"success\" | \"general\" | \"warning\";\n $dropShadow?: boolean;\n}\n\nexport const StyledToastMessage = styled.div<StyledToastMessageProps>`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 36px;\n width: fit-content;\n max-width: 100%;\n padding: 10px 8px 10px 16px;\n border-radius: 18px;\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${(props) =>\n props.$type === \"error\" &&\n css`\n background-color: #f1a5a5;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(234, 179, 179, 0.7);\n `}\n `}\n\n ${(props) =>\n props.$type === \"success\" &&\n css`\n background-color: #afdfdb;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(182, 218, 215, 0.7);\n `}\n `}\n\n ${(props) =>\n props.$type === \"general\" &&\n css`\n background-color: #bddff6;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(166, 199, 220, 0.7);\n `}\n `}\n\n ${(props) =>\n props.$type === \"warning\" &&\n css`\n background-color: #ffffd1;\n ${props.$dropShadow &&\n css`\n box-shadow: 0px 7px 12px -4px rgba(242, 242, 208, 0.7);\n `}\n `}\n`;\n\nexport const StyledToastMessageText = styled.div`\n ${tw`tw-text-caption-1`}\n ${tw`tw-font-bold`}\n ${tw`tw-truncate`}\n ${tw`tw-mr-2`}\n color: rgba(48, 48, 55, 0.65);\n`;\n\nexport const StyledCloseSmallIcon = styled(CloseSmallIcon)`\n fill: rgba(48, 48, 55, 0.3);\n flex-shrink: 0;\n cursor: pointer;\n\n &:hover {\n fill: rgba(48, 48, 55, 0.65);\n }\n`;\n\nStyledToastMessage.displayName = \"StyledToastMessage\";\nStyledCloseSmallIcon.displayName = \"StyledCloseSmallIcon\";\n"],"file":"Styles.js"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ export interface ToastMessageProps {
3
+ text: string;
4
+ type: "error" | "success" | "general" | "warning";
5
+ onClose?: () => void;
6
+ dismissable?: boolean;
7
+ dropShadow?: boolean;
8
+ timeout?: number;
9
+ }
10
+ export declare const ToastMessage: {
11
+ ({ text, type, onClose, dismissable, dropShadow, timeout, }: ToastMessageProps): JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //# sourceMappingURL=ToastMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/ToastMessage/ToastMessage.tsx"],"names":[],"mappings":";AAOA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY;iEAOtB,iBAAiB;;CAqBnB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import React, { useEffect, useCallback } from "react";
2
+ import { StyledToastMessage, StyledToastMessageText, StyledCloseSmallIcon } from "./Styles";
3
+ export var ToastMessage = function ToastMessage(_ref) {
4
+ var text = _ref.text,
5
+ type = _ref.type,
6
+ onClose = _ref.onClose,
7
+ _ref$dismissable = _ref.dismissable,
8
+ dismissable = _ref$dismissable === void 0 ? false : _ref$dismissable,
9
+ _ref$dropShadow = _ref.dropShadow,
10
+ dropShadow = _ref$dropShadow === void 0 ? false : _ref$dropShadow,
11
+ _ref$timeout = _ref.timeout,
12
+ timeout = _ref$timeout === void 0 ? 0 : _ref$timeout;
13
+ var handleOnClose = useCallback(function () {
14
+ if (typeof onClose === "function") {
15
+ onClose();
16
+ }
17
+ }, [onClose]);
18
+ useEffect(function () {
19
+ if (timeout > 0) {
20
+ var timer = setTimeout(handleOnClose, timeout);
21
+ return function () {
22
+ return clearTimeout(timer);
23
+ };
24
+ }
25
+ }, [dismissable, timeout, handleOnClose]);
26
+ return /*#__PURE__*/React.createElement(StyledToastMessage, {
27
+ $type: type,
28
+ $dropShadow: dropShadow
29
+ }, /*#__PURE__*/React.createElement(StyledToastMessageText, null, text), dismissable ? /*#__PURE__*/React.createElement(StyledCloseSmallIcon, {
30
+ onClick: handleOnClose
31
+ }) : null);
32
+ };
33
+ ToastMessage.displayName = "ToastMessage";
34
+ //# sourceMappingURL=ToastMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ToastMessage/ToastMessage.tsx"],"names":["React","useEffect","useCallback","StyledToastMessage","StyledToastMessageText","StyledCloseSmallIcon","ToastMessage","text","type","onClose","dismissable","dropShadow","timeout","handleOnClose","timer","setTimeout","clearTimeout","displayName"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,WAA3B,QAA8C,OAA9C;AACA,SACEC,kBADF,EAEEC,sBAFF,EAGEC,oBAHF,QAIO,UAJP;AAeA,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAe,OAOH;AAAA,MANvBC,IAMuB,QANvBA,IAMuB;AAAA,MALvBC,IAKuB,QALvBA,IAKuB;AAAA,MAJvBC,OAIuB,QAJvBA,OAIuB;AAAA,8BAHvBC,WAGuB;AAAA,MAHvBA,WAGuB,iCAHT,KAGS;AAAA,6BAFvBC,UAEuB;AAAA,MAFvBA,UAEuB,gCAFV,KAEU;AAAA,0BADvBC,OACuB;AAAA,MADvBA,OACuB,6BADb,CACa;AACvB,MAAMC,aAAa,GAAGX,WAAW,CAAC,YAAM;AACtC,QAAI,OAAOO,OAAP,KAAmB,UAAvB,EAAmC;AACjCA,MAAAA,OAAO;AACR;AACF,GAJgC,EAI9B,CAACA,OAAD,CAJ8B,CAAjC;AAMAR,EAAAA,SAAS,CAAC,YAAM;AACd,QAAIW,OAAO,GAAG,CAAd,EAAiB;AACf,UAAME,KAAK,GAAGC,UAAU,CAACF,aAAD,EAAgBD,OAAhB,CAAxB;AAEA,aAAO;AAAA,eAAMI,YAAY,CAACF,KAAD,CAAlB;AAAA,OAAP;AACD;AACF,GANQ,EAMN,CAACJ,WAAD,EAAcE,OAAd,EAAuBC,aAAvB,CANM,CAAT;AAQA,sBACE,oBAAC,kBAAD;AAAoB,IAAA,KAAK,EAAEL,IAA3B;AAAiC,IAAA,WAAW,EAAEG;AAA9C,kBACE,oBAAC,sBAAD,QAAyBJ,IAAzB,CADF,EAEGG,WAAW,gBAAG,oBAAC,oBAAD;AAAsB,IAAA,OAAO,EAAEG;AAA/B,IAAH,GAAsD,IAFpE,CADF;AAMD,CA5BM;AA8BPP,YAAY,CAACW,WAAb,GAA2B,cAA3B","sourcesContent":["import React, { useEffect, useCallback } from \"react\";\nimport {\n StyledToastMessage,\n StyledToastMessageText,\n StyledCloseSmallIcon,\n} from \"./Styles\";\n\nexport interface ToastMessageProps {\n text: string;\n type: \"error\" | \"success\" | \"general\" | \"warning\";\n onClose?: () => void;\n dismissable?: boolean;\n dropShadow?: boolean;\n timeout?: number;\n}\n\nexport const ToastMessage = ({\n text,\n type,\n onClose,\n dismissable = false,\n dropShadow = false,\n timeout = 0,\n}: ToastMessageProps) => {\n const handleOnClose = useCallback(() => {\n if (typeof onClose === \"function\") {\n onClose();\n }\n }, [onClose]);\n\n useEffect(() => {\n if (timeout > 0) {\n const timer = setTimeout(handleOnClose, timeout);\n\n return () => clearTimeout(timer);\n }\n }, [dismissable, timeout, handleOnClose]);\n\n return (\n <StyledToastMessage $type={type} $dropShadow={dropShadow}>\n <StyledToastMessageText>{text}</StyledToastMessageText>\n {dismissable ? <StyledCloseSmallIcon onClick={handleOnClose} /> : null}\n </StyledToastMessage>\n );\n};\n\nToastMessage.displayName = \"ToastMessage\";\n"],"file":"ToastMessage.js"}
@@ -0,0 +1,2 @@
1
+ export * from "./ToastMessage";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ToastMessage/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./ToastMessage";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ToastMessage/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAd","sourcesContent":["export * from \"./ToastMessage\";\n"],"file":"index.js"}