@activecollab/components 1.0.87 → 1.0.88

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.
@@ -0,0 +1,63 @@
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.ProgressRing = 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 ProgressRing = function ProgressRing(_ref) {
19
+ var backgroundColor = _ref.backgroundColor,
20
+ progressColor = _ref.progressColor,
21
+ _ref$progress = _ref.progress,
22
+ progress = _ref$progress === void 0 ? 0 : _ref$progress,
23
+ _ref$radius = _ref.radius,
24
+ radius = _ref$radius === void 0 ? 20 : _ref$radius,
25
+ _ref$stroke = _ref.stroke,
26
+ stroke = _ref$stroke === void 0 ? 3 : _ref$stroke;
27
+ var normalizedRadius = (0, _react.useMemo)(function () {
28
+ return radius - stroke;
29
+ }, [radius, stroke]);
30
+ var circumference = (0, _react.useMemo)(function () {
31
+ return normalizedRadius * 2 * Math.PI;
32
+ }, [normalizedRadius]);
33
+ var strokeDashoffsetOuter = (0, _react.useMemo)(function () {
34
+ return circumference - (100 - progress) / 100 * circumference;
35
+ }, [circumference, progress]);
36
+ var strokeDashoffsetInner = (0, _react.useMemo)(function () {
37
+ return circumference - progress / 100 * circumference;
38
+ }, [circumference, progress]);
39
+ return /*#__PURE__*/_react.default.createElement(_Styles.StyledSvg, {
40
+ height: radius * 2,
41
+ width: radius * 2
42
+ }, /*#__PURE__*/_react.default.createElement(_Styles.StyledBackgroundCircle, {
43
+ $color: backgroundColor,
44
+ $strokeDashOffset: -strokeDashoffsetOuter,
45
+ strokeWidth: stroke,
46
+ strokeDasharray: circumference,
47
+ r: normalizedRadius,
48
+ cx: radius,
49
+ cy: radius
50
+ }), /*#__PURE__*/_react.default.createElement(_Styles.StyledForegroundCircle, {
51
+ $color: progressColor,
52
+ $strokeDashOffset: strokeDashoffsetInner,
53
+ strokeWidth: stroke,
54
+ strokeDasharray: "".concat(circumference, " ").concat(circumference),
55
+ r: normalizedRadius,
56
+ cx: radius,
57
+ cy: radius
58
+ }));
59
+ };
60
+
61
+ exports.ProgressRing = ProgressRing;
62
+ ProgressRing.displayName = "ProgressRing";
63
+ //# sourceMappingURL=ProgressRing.js.map
@@ -0,0 +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"}
@@ -0,0 +1,47 @@
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.StyledSvg = exports.StyledForegroundCircle = exports.StyledBackgroundCircle = void 0;
9
+
10
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+
12
+ 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); }
13
+
14
+ 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; }
15
+
16
+ var StyledSvg = _styledComponents.default.svg.withConfig({
17
+ displayName: "Styles__StyledSvg",
18
+ componentId: "sc-o6dcyu-0"
19
+ })(["transform:rotate(-90deg);"]);
20
+
21
+ exports.StyledSvg = StyledSvg;
22
+ StyledSvg.displayName = "StyledSvg";
23
+
24
+ var StyledBackgroundCircle = _styledComponents.default.circle.withConfig({
25
+ displayName: "Styles__StyledBackgroundCircle",
26
+ componentId: "sc-o6dcyu-1"
27
+ })(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", ""], function (props) {
28
+ return props.$color ? (0, _styledComponents.css)(["stroke:", ";"], props.$color) : (0, _styledComponents.css)(["stroke:var(--color-theme-300);"]);
29
+ }, function (props) {
30
+ return props.$strokeDashOffset && (0, _styledComponents.css)(["stroke-dashoffset:", ";"], props.$strokeDashOffset);
31
+ });
32
+
33
+ exports.StyledBackgroundCircle = StyledBackgroundCircle;
34
+ StyledBackgroundCircle.displayName = "StyledBackgroundCircle";
35
+
36
+ var StyledForegroundCircle = _styledComponents.default.circle.withConfig({
37
+ displayName: "Styles__StyledForegroundCircle",
38
+ componentId: "sc-o6dcyu-2"
39
+ })(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", ""], function (props) {
40
+ return props.$color ? (0, _styledComponents.css)(["stroke:", ";"], props.$color) : (0, _styledComponents.css)(["stroke:var(--color-secondary);"]);
41
+ }, function (props) {
42
+ return props.$strokeDashOffset && (0, _styledComponents.css)(["stroke-dashoffset:", ";"], props.$strokeDashOffset);
43
+ });
44
+
45
+ exports.StyledForegroundCircle = StyledForegroundCircle;
46
+ StyledForegroundCircle.displayName = "StyledForegroundCircle";
47
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ProgressRing/Styles.ts"],"names":["StyledSvg","styled","svg","displayName","StyledBackgroundCircle","circle","props","$color","css","$strokeDashOffset","StyledForegroundCircle"],"mappings":";;;;;;;;;AAAA;;;;;;AAOO,IAAMA,SAAS,GAAGC,0BAAOC,GAAV;AAAA;AAAA;AAAA,iCAAf;;;AAIPF,SAAS,CAACG,WAAV,GAAwB,WAAxB;;AAEO,IAAMC,sBAAsB,GAAGH,0BAAOI,MAAV;AAAA;AAAA;AAAA,4EAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,OACIC,qBADJ,oBAEgBF,KAAK,CAACC,MAFtB,QAIIC,qBAJJ,qCADA;AAAA,CAJ+B,EAa/B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACG,iBAAN,QACAD,qBADA,+BAEuBF,KAAK,CAACG,iBAF7B,CADA;AAAA,CAb+B,CAA5B;;;AAoBPL,sBAAsB,CAACD,WAAvB,GAAqC,wBAArC;;AAEO,IAAMO,sBAAsB,GAAGT,0BAAOI,MAAV;AAAA;AAAA;AAAA,4EAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,OACIC,qBADJ,oBAEgBF,KAAK,CAACC,MAFtB,QAIIC,qBAJJ,qCADA;AAAA,CAJ+B,EAa/B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACG,iBAAN,QACAD,qBADA,+BAEuBF,KAAK,CAACG,iBAF7B,CADA;AAAA,CAb+B,CAA5B;;;AAoBPC,sBAAsB,CAACP,WAAvB,GAAqC,wBAArC","sourcesContent":["import styled, { css } from \"styled-components\";\n\ninterface IStyledProgressRing {\n $color?: string;\n $strokeDashOffset?: number;\n}\n\nexport const StyledSvg = styled.svg`\n transform: rotate(-90deg);\n`;\n\nStyledSvg.displayName = \"StyledSvg\";\n\nexport const StyledBackgroundCircle = styled.circle<IStyledProgressRing>`\n fill: transparent;\n transition: stroke-dashoffset 0.5s linear;\n\n ${(props) =>\n props.$color\n ? css`\n stroke: ${props.$color};\n `\n : css`\n stroke: var(--color-theme-300);\n `}\n\n ${(props) =>\n props.$strokeDashOffset &&\n css`\n stroke-dashoffset: ${props.$strokeDashOffset};\n `}\n`;\n\nStyledBackgroundCircle.displayName = \"StyledBackgroundCircle\";\n\nexport const StyledForegroundCircle = styled.circle<IStyledProgressRing>`\n fill: transparent;\n transition: stroke-dashoffset 0.5s linear;\n\n ${(props) =>\n props.$color\n ? css`\n stroke: ${props.$color};\n `\n : css`\n stroke: var(--color-secondary);\n `}\n\n ${(props) =>\n props.$strokeDashOffset &&\n css`\n stroke-dashoffset: ${props.$strokeDashOffset};\n `}\n`;\n\nStyledForegroundCircle.displayName = \"StyledForegroundCircle\";\n"],"file":"Styles.js"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _ProgressRing = require("./ProgressRing");
8
+
9
+ Object.keys(_ProgressRing).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _ProgressRing[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _ProgressRing[key];
16
+ }
17
+ });
18
+ });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ProgressRing/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./ProgressRing\";\n"],"file":"index.js"}
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ export interface IProgressRingProps {
3
+ progress?: number;
4
+ backgroundColor?: string;
5
+ progressColor?: string;
6
+ radius?: number;
7
+ stroke?: number;
8
+ }
9
+ export declare const ProgressRing: FC<IProgressRingProps>;
10
+ //# sourceMappingURL=ProgressRing.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,46 @@
1
+ import React, { useMemo } from "react";
2
+ import { StyledBackgroundCircle, StyledForegroundCircle, StyledSvg } from "./Styles";
3
+ export var ProgressRing = function ProgressRing(_ref) {
4
+ var backgroundColor = _ref.backgroundColor,
5
+ progressColor = _ref.progressColor,
6
+ _ref$progress = _ref.progress,
7
+ progress = _ref$progress === void 0 ? 0 : _ref$progress,
8
+ _ref$radius = _ref.radius,
9
+ radius = _ref$radius === void 0 ? 20 : _ref$radius,
10
+ _ref$stroke = _ref.stroke,
11
+ stroke = _ref$stroke === void 0 ? 3 : _ref$stroke;
12
+ var normalizedRadius = useMemo(function () {
13
+ return radius - stroke;
14
+ }, [radius, stroke]);
15
+ var circumference = useMemo(function () {
16
+ return normalizedRadius * 2 * Math.PI;
17
+ }, [normalizedRadius]);
18
+ var strokeDashoffsetOuter = useMemo(function () {
19
+ return circumference - (100 - progress) / 100 * circumference;
20
+ }, [circumference, progress]);
21
+ var strokeDashoffsetInner = useMemo(function () {
22
+ return circumference - progress / 100 * circumference;
23
+ }, [circumference, progress]);
24
+ return /*#__PURE__*/React.createElement(StyledSvg, {
25
+ height: radius * 2,
26
+ width: radius * 2
27
+ }, /*#__PURE__*/React.createElement(StyledBackgroundCircle, {
28
+ $color: backgroundColor,
29
+ $strokeDashOffset: -strokeDashoffsetOuter,
30
+ strokeWidth: stroke,
31
+ strokeDasharray: circumference,
32
+ r: normalizedRadius,
33
+ cx: radius,
34
+ cy: radius
35
+ }), /*#__PURE__*/React.createElement(StyledForegroundCircle, {
36
+ $color: progressColor,
37
+ $strokeDashOffset: strokeDashoffsetInner,
38
+ strokeWidth: stroke,
39
+ strokeDasharray: circumference + " " + circumference,
40
+ r: normalizedRadius,
41
+ cx: radius,
42
+ cy: radius
43
+ }));
44
+ };
45
+ ProgressRing.displayName = "ProgressRing";
46
+ //# sourceMappingURL=ProgressRing.js.map
@@ -0,0 +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"}
@@ -0,0 +1,9 @@
1
+ interface IStyledProgressRing {
2
+ $color?: string;
3
+ $strokeDashOffset?: number;
4
+ }
5
+ export declare const StyledSvg: import("styled-components").StyledComponent<"svg", any, {}, never>;
6
+ export declare const StyledBackgroundCircle: import("styled-components").StyledComponent<"circle", any, IStyledProgressRing, never>;
7
+ export declare const StyledForegroundCircle: import("styled-components").StyledComponent<"circle", any, IStyledProgressRing, never>;
8
+ export {};
9
+ //# sourceMappingURL=Styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressRing/Styles.ts"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS,oEAErB,CAAC;AAIF,eAAO,MAAM,sBAAsB,wFAkBlC,CAAC;AAIF,eAAO,MAAM,sBAAsB,wFAkBlC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import styled, { css } from "styled-components";
2
+ export var StyledSvg = styled.svg.withConfig({
3
+ displayName: "Styles__StyledSvg",
4
+ componentId: "sc-o6dcyu-0"
5
+ })(["transform:rotate(-90deg);"]);
6
+ StyledSvg.displayName = "StyledSvg";
7
+ export var StyledBackgroundCircle = styled.circle.withConfig({
8
+ displayName: "Styles__StyledBackgroundCircle",
9
+ componentId: "sc-o6dcyu-1"
10
+ })(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", ""], function (props) {
11
+ return props.$color ? css(["stroke:", ";"], props.$color) : css(["stroke:var(--color-theme-300);"]);
12
+ }, function (props) {
13
+ return props.$strokeDashOffset && css(["stroke-dashoffset:", ";"], props.$strokeDashOffset);
14
+ });
15
+ StyledBackgroundCircle.displayName = "StyledBackgroundCircle";
16
+ export var StyledForegroundCircle = styled.circle.withConfig({
17
+ displayName: "Styles__StyledForegroundCircle",
18
+ componentId: "sc-o6dcyu-2"
19
+ })(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", ""], function (props) {
20
+ return props.$color ? css(["stroke:", ";"], props.$color) : css(["stroke:var(--color-secondary);"]);
21
+ }, function (props) {
22
+ return props.$strokeDashOffset && css(["stroke-dashoffset:", ";"], props.$strokeDashOffset);
23
+ });
24
+ StyledForegroundCircle.displayName = "StyledForegroundCircle";
25
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ProgressRing/Styles.ts"],"names":["styled","css","StyledSvg","svg","displayName","StyledBackgroundCircle","circle","props","$color","$strokeDashOffset","StyledForegroundCircle"],"mappings":"AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AAOA,OAAO,IAAMC,SAAS,GAAGF,MAAM,CAACG,GAAV;AAAA;AAAA;AAAA,iCAAf;AAIPD,SAAS,CAACE,WAAV,GAAwB,WAAxB;AAEA,OAAO,IAAMC,sBAAsB,GAAGL,MAAM,CAACM,MAAV;AAAA;AAAA;AAAA,4EAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,GACIP,GADJ,mBAEgBM,KAAK,CAACC,MAFtB,IAIIP,GAJJ,oCADA;AAAA,CAJ+B,EAa/B,UAACM,KAAD;AAAA,SACAA,KAAK,CAACE,iBAAN,IACAR,GADA,8BAEuBM,KAAK,CAACE,iBAF7B,CADA;AAAA,CAb+B,CAA5B;AAoBPJ,sBAAsB,CAACD,WAAvB,GAAqC,wBAArC;AAEA,OAAO,IAAMM,sBAAsB,GAAGV,MAAM,CAACM,MAAV;AAAA;AAAA;AAAA,4EAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,MAAN,GACIP,GADJ,mBAEgBM,KAAK,CAACC,MAFtB,IAIIP,GAJJ,oCADA;AAAA,CAJ+B,EAa/B,UAACM,KAAD;AAAA,SACAA,KAAK,CAACE,iBAAN,IACAR,GADA,8BAEuBM,KAAK,CAACE,iBAF7B,CADA;AAAA,CAb+B,CAA5B;AAoBPC,sBAAsB,CAACN,WAAvB,GAAqC,wBAArC","sourcesContent":["import styled, { css } from \"styled-components\";\n\ninterface IStyledProgressRing {\n $color?: string;\n $strokeDashOffset?: number;\n}\n\nexport const StyledSvg = styled.svg`\n transform: rotate(-90deg);\n`;\n\nStyledSvg.displayName = \"StyledSvg\";\n\nexport const StyledBackgroundCircle = styled.circle<IStyledProgressRing>`\n fill: transparent;\n transition: stroke-dashoffset 0.5s linear;\n\n ${(props) =>\n props.$color\n ? css`\n stroke: ${props.$color};\n `\n : css`\n stroke: var(--color-theme-300);\n `}\n\n ${(props) =>\n props.$strokeDashOffset &&\n css`\n stroke-dashoffset: ${props.$strokeDashOffset};\n `}\n`;\n\nStyledBackgroundCircle.displayName = \"StyledBackgroundCircle\";\n\nexport const StyledForegroundCircle = styled.circle<IStyledProgressRing>`\n fill: transparent;\n transition: stroke-dashoffset 0.5s linear;\n\n ${(props) =>\n props.$color\n ? css`\n stroke: ${props.$color};\n `\n : css`\n stroke: var(--color-secondary);\n `}\n\n ${(props) =>\n props.$strokeDashOffset &&\n css`\n stroke-dashoffset: ${props.$strokeDashOffset};\n `}\n`;\n\nStyledForegroundCircle.displayName = \"StyledForegroundCircle\";\n"],"file":"Styles.js"}
@@ -0,0 +1,2 @@
1
+ export * from "./ProgressRing";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressRing/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./ProgressRing";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ProgressRing/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAd","sourcesContent":["export * from \"./ProgressRing\";\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activecollab/components",
3
- "version": "1.0.87",
3
+ "version": "1.0.88",
4
4
  "description": "ActiveCollab Components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",