@activecollab/components 1.0.89 → 1.0.90
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.
- package/dist/cjs/components/ProgressRing/ProgressRing.js +8 -2
- package/dist/cjs/components/ProgressRing/ProgressRing.js.map +1 -1
- package/dist/esm/components/ProgressRing/ProgressRing.d.ts +1 -0
- package/dist/esm/components/ProgressRing/ProgressRing.d.ts.map +1 -1
- package/dist/esm/components/ProgressRing/ProgressRing.js +5 -2
- package/dist/esm/components/ProgressRing/ProgressRing.js.map +1 -1
- package/dist/index.js +81 -79
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- 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,7 +43,8 @@ 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,
|
|
@@ -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
|
|
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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AC,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}\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 +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;
|
|
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,7 +25,8 @@ 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,
|
|
@@ -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;
|
|
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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E,IAAA,eAAe,EAAEG,aAJnB;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}\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"}
|