@elliemae/ds-circular-progress-indicator 2.3.1-rc.2 → 3.0.0-alpha.2

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 (51) hide show
  1. package/dist/cjs/DSCircularProgressIndicator.js +246 -0
  2. package/dist/cjs/DSCircularProgressIndicator.js.map +7 -0
  3. package/dist/cjs/index.js +40 -0
  4. package/dist/cjs/index.js.map +7 -0
  5. package/dist/cjs/v2/DSCircularIndeterminateIndicator.js +121 -0
  6. package/dist/cjs/v2/DSCircularIndeterminateIndicator.js.map +7 -0
  7. package/dist/cjs/v2/constants.js +65 -0
  8. package/dist/cjs/v2/constants.js.map +7 -0
  9. package/dist/cjs/v2/index.js +36 -0
  10. package/dist/cjs/v2/index.js.map +7 -0
  11. package/dist/cjs/v2/react-desc-prop-types.js +83 -0
  12. package/dist/cjs/v2/react-desc-prop-types.js.map +7 -0
  13. package/dist/cjs/v2/styled.js +137 -0
  14. package/dist/cjs/v2/styled.js.map +7 -0
  15. package/dist/esm/DSCircularProgressIndicator.js +217 -0
  16. package/dist/esm/DSCircularProgressIndicator.js.map +7 -0
  17. package/dist/esm/index.js +15 -0
  18. package/dist/esm/index.js.map +7 -0
  19. package/dist/esm/v2/DSCircularIndeterminateIndicator.js +97 -0
  20. package/dist/esm/v2/DSCircularIndeterminateIndicator.js.map +7 -0
  21. package/dist/esm/v2/constants.js +36 -0
  22. package/dist/esm/v2/constants.js.map +7 -0
  23. package/dist/esm/v2/index.js +10 -0
  24. package/dist/esm/v2/index.js.map +7 -0
  25. package/dist/esm/v2/react-desc-prop-types.js +56 -0
  26. package/dist/esm/v2/react-desc-prop-types.js.map +7 -0
  27. package/dist/esm/v2/styled.js +108 -0
  28. package/dist/esm/v2/styled.js.map +7 -0
  29. package/package.json +38 -41
  30. package/cjs/DSCircularProgressIndicator.js +0 -268
  31. package/cjs/index.js +0 -14
  32. package/cjs/v2/DSCircularIndeterminateIndicator.js +0 -113
  33. package/cjs/v2/constants.js +0 -37
  34. package/cjs/v2/index.js +0 -10
  35. package/cjs/v2/react-desc-prop-types.js +0 -39
  36. package/cjs/v2/styled.js +0 -51
  37. package/esm/DSCircularProgressIndicator.js +0 -258
  38. package/esm/index.js +0 -2
  39. package/esm/v2/DSCircularIndeterminateIndicator.js +0 -103
  40. package/esm/v2/constants.js +0 -30
  41. package/esm/v2/index.js +0 -1
  42. package/esm/v2/react-desc-prop-types.js +0 -30
  43. package/esm/v2/styled.js +0 -39
  44. package/types/DSCircularProgressIndicator.d.ts +0 -42
  45. package/types/index.d.ts +0 -2
  46. package/types/tests/DSCircularProgressIndicator.test.d.ts +0 -1
  47. package/types/v2/DSCircularIndeterminateIndicator.d.ts +0 -4
  48. package/types/v2/constants.d.ts +0 -28
  49. package/types/v2/index.d.ts +0 -1
  50. package/types/v2/react-desc-prop-types.d.ts +0 -14
  51. package/types/v2/styled.d.ts +0 -12
@@ -0,0 +1,83 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __reExport = (target, module2, copyDefault, desc) => {
30
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
31
+ for (let key of __getOwnPropNames(module2))
32
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
33
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
34
+ }
35
+ return target;
36
+ };
37
+ var __toESM = (module2, isNodeMode) => {
38
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
39
+ };
40
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
+ return (module2, temp) => {
42
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
+ };
44
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
45
+ var react_desc_prop_types_exports = {};
46
+ __export(react_desc_prop_types_exports, {
47
+ CircularIndeterminateIndicatorPropTypes: () => CircularIndeterminateIndicatorPropTypes,
48
+ defaultProps: () => defaultProps
49
+ });
50
+ var React = __toESM(require("react"));
51
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
52
+ const CircularIndeterminateIndicatorPropTypes = __spreadProps(__spreadValues({}, import_ds_props_helpers.globalAttributesPropTypes), {
53
+ size: import_ds_props_helpers.PropTypes.oneOf(["xs", "s", "m", "l", "xl", "xxl"]).description("Size of the indicator").defaultValue("m"),
54
+ color: import_ds_props_helpers.PropTypes.oneOf(["light", "dark"]).description("Color mode for the indicator").defaultValue("dark"),
55
+ text: import_ds_props_helpers.PropTypes.string.description("Optional text to show under the indicator").defaultValue(""),
56
+ showText: import_ds_props_helpers.PropTypes.bool.description("Whether to show the optional text or not").defaultValue(true),
57
+ withTooltip: import_ds_props_helpers.PropTypes.bool.description("Whether to include a tooltip that shows the optional text on hover").defaultValue(false),
58
+ tooltipStartPlacementPreference: import_ds_props_helpers.PropTypes.oneOf([
59
+ "top-start",
60
+ "top",
61
+ "top-end",
62
+ "right-start",
63
+ "right",
64
+ "right-end",
65
+ "bottom-end",
66
+ "bottom",
67
+ "bottom-start",
68
+ "left-end",
69
+ "left",
70
+ "left-start"
71
+ ]).description("start placement preference for the tooltip").defaultValue("center")
72
+ });
73
+ const defaultProps = {
74
+ size: "m",
75
+ color: "dark",
76
+ text: "",
77
+ showText: true,
78
+ withTooltip: false,
79
+ tooltipStartPlacementPreference: "bottom",
80
+ __duration: 4
81
+ };
82
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
83
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v2/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport { WeakValidationMap } from 'react';\n\nexport declare namespace DSCircularIndeterminateIndicatorT {\n interface Props {\n size?: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n color?: 'light' | 'dark';\n text?: string;\n showText?: boolean;\n withTooltip: boolean;\n tooltipStartPlacementPreference?:\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n __duration: number;\n }\n}\n\nexport const CircularIndeterminateIndicatorPropTypes = {\n ...globalAttributesPropTypes,\n size: PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl', 'xxl']).description('Size of the indicator').defaultValue('m'),\n color: PropTypes.oneOf(['light', 'dark']).description('Color mode for the indicator').defaultValue('dark'),\n text: PropTypes.string.description('Optional text to show under the indicator').defaultValue(''),\n showText: PropTypes.bool.description('Whether to show the optional text or not').defaultValue(true),\n withTooltip: PropTypes.bool\n .description('Whether to include a tooltip that shows the optional text on hover')\n .defaultValue(false),\n tooltipStartPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preference for the tooltip')\n .defaultValue('center'),\n} as WeakValidationMap<unknown>;\n\nexport const defaultProps: DSCircularIndeterminateIndicatorT.Props = {\n size: 'm',\n color: 'dark',\n text: '',\n showText: true,\n withTooltip: false,\n tooltipStartPlacementPreference: 'bottom',\n __duration: 4,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAqD;AA2B9C,MAAM,0CAA0C,iCAClD,oDADkD;AAAA,EAErD,MAAM,kCAAU,MAAM,CAAC,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY,yBAAyB,aAAa;AAAA,EAC5G,OAAO,kCAAU,MAAM,CAAC,SAAS,SAAS,YAAY,gCAAgC,aAAa;AAAA,EACnG,MAAM,kCAAU,OAAO,YAAY,6CAA6C,aAAa;AAAA,EAC7F,UAAU,kCAAU,KAAK,YAAY,4CAA4C,aAAa;AAAA,EAC9F,aAAa,kCAAU,KACpB,YAAY,sEACZ,aAAa;AAAA,EAChB,iCAAiC,kCAAU,MAAM;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,KAEC,YAAY,8CACZ,aAAa;AAAA;AAGX,MAAM,eAAwD;AAAA,EACnE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,aAAa;AAAA,EACb,iCAAiC;AAAA,EACjC,YAAY;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,137 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var styled_exports = {};
29
+ __export(styled_exports, {
30
+ StyledCircle: () => StyledCircle,
31
+ StyledPath: () => StyledPath,
32
+ StyledRect: () => StyledRect,
33
+ StyledSvg: () => StyledSvg
34
+ });
35
+ var React = __toESM(require("react"));
36
+ var import_styled_components = __toESM(require("styled-components"));
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ const { PI } = Math;
39
+ const getArcLength = (percentage, radius) => 2 * PI * radius / 100 * percentage;
40
+ const strokeTailAnimation = (r) => {
41
+ const miniDash = `${getArcLength(0, r)} ${getArcLength(100, r)}`;
42
+ const fullDash = `${getArcLength(75, r)} ${getArcLength(25, r)}`;
43
+ return import_ds_system.kfrm`
44
+ 0% {
45
+ stroke-dasharray: ${miniDash};
46
+ }
47
+ 50% {
48
+ stroke-dasharray: ${fullDash};
49
+ }
50
+ 100% {
51
+ stroke-dasharray: ${miniDash};
52
+ }
53
+ `;
54
+ };
55
+ const rotateAnimation = import_ds_system.kfrm`
56
+ 0%, 12.5% {
57
+ transform: rotate(0);
58
+ }
59
+ 25%, 37.5% {
60
+ transform: rotate(270deg);
61
+ }
62
+ 50%, 62.5% {
63
+ transform: rotate(540deg);
64
+ }
65
+ 75%, 87.5% {
66
+ transform: rotate(810deg);
67
+ }
68
+ 100% {
69
+ transform: rotate(1080deg);
70
+ }
71
+ `;
72
+ const dashAnimation = (r) => {
73
+ const miniDash = `${getArcLength(0, r)} ${getArcLength(100, r)}`;
74
+ const fullDash = `${getArcLength(75, r)} ${getArcLength(25, r)}`;
75
+ return import_ds_system.kfrm`
76
+ 0% {
77
+ stroke-dasharray: ${miniDash};
78
+ stroke-dashoffset: 0;
79
+ }
80
+ 12.5% {
81
+ stroke-dasharray: ${fullDash};
82
+ stroke-dashoffset: 0;
83
+ }
84
+ 25% {
85
+ stroke-dasharray: ${miniDash};
86
+ stroke-dashoffset: ${getArcLength(-75, r)};
87
+ }
88
+ 37.5% {
89
+ stroke-dasharray: ${fullDash};
90
+ stroke-dashoffset: ${getArcLength(-75, r)};
91
+ }
92
+ 50% {
93
+ stroke-dasharray: ${miniDash};
94
+ stroke-dashoffset: ${getArcLength(-150, r)};
95
+ }
96
+ 62.5% {
97
+ stroke-dasharray: ${fullDash};
98
+ stroke-dashoffset: ${getArcLength(-150, r)};
99
+ }
100
+ 75% {
101
+ stroke-dasharray: ${miniDash};
102
+ stroke-dashoffset: ${getArcLength(-225, r)};
103
+ }
104
+ 87.5% {
105
+ stroke-dasharray: ${fullDash};
106
+ stroke-dashoffset: ${getArcLength(-225, r)};
107
+ }
108
+ 100% {
109
+ stroke-dasharray: ${miniDash};
110
+ stroke-dashoffset: ${getArcLength(-300, r)};
111
+ }
112
+ `;
113
+ };
114
+ const StyledSvg = import_styled_components.default.svg`
115
+ display: block;
116
+ margin: auto;
117
+ transform-origin: center center;
118
+ transform: rotate(-90deg);
119
+ `;
120
+ const StyledPath = import_styled_components.default.path`
121
+ transform-origin: center center;
122
+ animation: ${rotateAnimation} ${(props) => props.__duration}s linear infinite,
123
+ ${(props) => strokeTailAnimation(props.r)} ${(props) => props.__duration / 4}s linear infinite;
124
+ `;
125
+ const StyledRect = import_styled_components.default.rect`
126
+ transform-origin: center center;
127
+ animation: ${rotateAnimation} ${(props) => props.__duration}s linear infinite;
128
+ `;
129
+ const StyledCircle = import_styled_components.default.circle`
130
+ stroke-dashoffset: 0;
131
+ fill: none;
132
+ animation: ${(props) => dashAnimation(props.r)} ${(props) => props.__duration}s linear infinite;
133
+ clip-path: ${(props) => props.clipPath};
134
+ -webkit-clip-path: ${(props) => props.clipPath};
135
+ `;
136
+ module.exports = __toCommonJS(styled_exports);
137
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v2/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable no-underscore-dangle */\nimport styled from 'styled-components';\nimport { kfrm } from '@elliemae/ds-system';\n\nconst { PI } = Math;\n\nconst getArcLength = (percentage: number, radius: number) => ((2 * PI * radius) / 100) * percentage;\n\nconst strokeTailAnimation = (r: number) => {\n const miniDash = `${getArcLength(0, r)} ${getArcLength(100, r)}`;\n const fullDash = `${getArcLength(75, r)} ${getArcLength(25, r)}`;\n\n return kfrm`\n 0% {\n stroke-dasharray: ${miniDash};\n }\n 50% {\n stroke-dasharray: ${fullDash};\n }\n 100% {\n stroke-dasharray: ${miniDash};\n }\n`;\n};\n\nconst rotateAnimation = kfrm`\n 0%, 12.5% {\n transform: rotate(0);\n }\n 25%, 37.5% {\n transform: rotate(270deg);\n }\n 50%, 62.5% {\n transform: rotate(540deg);\n }\n 75%, 87.5% {\n transform: rotate(810deg);\n }\n 100% {\n transform: rotate(1080deg);\n }\n`;\n\nconst dashAnimation = (r: number) => {\n const miniDash = `${getArcLength(0, r)} ${getArcLength(100, r)}`;\n const fullDash = `${getArcLength(75, r)} ${getArcLength(25, r)}`;\n\n return kfrm`\n 0% {\n stroke-dasharray: ${miniDash};\n stroke-dashoffset: 0;\n }\n 12.5% {\n stroke-dasharray: ${fullDash};\n stroke-dashoffset: 0;\n }\n 25% {\n stroke-dasharray: ${miniDash};\n stroke-dashoffset: ${getArcLength(-75, r)};\n }\n 37.5% {\n stroke-dasharray: ${fullDash};\n stroke-dashoffset: ${getArcLength(-75, r)};\n }\n 50% {\n stroke-dasharray: ${miniDash};\n stroke-dashoffset: ${getArcLength(-150, r)};\n }\n 62.5% {\n stroke-dasharray: ${fullDash};\n stroke-dashoffset: ${getArcLength(-150, r)};\n }\n 75% {\n stroke-dasharray: ${miniDash};\n stroke-dashoffset: ${getArcLength(-225, r)};\n }\n 87.5% {\n stroke-dasharray: ${fullDash};\n stroke-dashoffset: ${getArcLength(-225, r)};\n }\n 100% {\n stroke-dasharray: ${miniDash};\n stroke-dashoffset: ${getArcLength(-300, r)};\n }\n`;\n};\n\nexport const StyledSvg = styled.svg`\n display: block;\n margin: auto;\n transform-origin: center center;\n transform: rotate(-90deg);\n`;\n\nexport const StyledPath = styled.path<{ __duration: number; r: number }>`\n transform-origin: center center;\n animation: ${rotateAnimation} ${(props) => props.__duration}s linear infinite,\n ${(props) => strokeTailAnimation(props.r)} ${(props) => props.__duration / 4}s linear infinite;\n`;\n\nexport const StyledRect = styled.rect<{ __duration: number }>`\n transform-origin: center center;\n animation: ${rotateAnimation} ${(props) => props.__duration}s linear infinite;\n`;\n\nexport const StyledCircle = styled.circle<{ r: number; __duration: number }>`\n stroke-dashoffset: 0;\n fill: none;\n animation: ${(props) => dashAnimation(props.r)} ${(props) => props.__duration}s linear infinite;\n clip-path: ${(props) => props.clipPath};\n -webkit-clip-path: ${(props) => props.clipPath};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAqB;AAErB,MAAM,EAAE,OAAO;AAEf,MAAM,eAAe,CAAC,YAAoB,WAAqB,IAAI,KAAK,SAAU,MAAO;AAEzF,MAAM,sBAAsB,CAAC,MAAc;AACzC,QAAM,WAAW,GAAG,aAAa,GAAG,MAAM,aAAa,KAAK;AAC5D,QAAM,WAAW,GAAG,aAAa,IAAI,MAAM,aAAa,IAAI;AAE5D,SAAO;AAAA;AAAA,4BAEmB;AAAA;AAAA;AAAA,4BAGA;AAAA;AAAA;AAAA,4BAGA;AAAA;AAAA;AAAA;AAK5B,MAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBxB,MAAM,gBAAgB,CAAC,MAAc;AACnC,QAAM,WAAW,GAAG,aAAa,GAAG,MAAM,aAAa,KAAK;AAC5D,QAAM,WAAW,GAAG,aAAa,IAAI,MAAM,aAAa,IAAI;AAE5D,SAAO;AAAA;AAAA,4BAEmB;AAAA;AAAA;AAAA;AAAA,4BAIA;AAAA;AAAA;AAAA;AAAA,4BAIA;AAAA,6BACC,aAAa,KAAK;AAAA;AAAA;AAAA,4BAGnB;AAAA,6BACC,aAAa,KAAK;AAAA;AAAA;AAAA,4BAGnB;AAAA,6BACC,aAAa,MAAM;AAAA;AAAA;AAAA,4BAGpB;AAAA,6BACC,aAAa,MAAM;AAAA;AAAA;AAAA,4BAGpB;AAAA,6BACC,aAAa,MAAM;AAAA;AAAA;AAAA,4BAGpB;AAAA,6BACC,aAAa,MAAM;AAAA;AAAA;AAAA,4BAGpB;AAAA,6BACC,aAAa,MAAM;AAAA;AAAA;AAAA;AAKzC,MAAM,YAAY,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOzB,MAAM,aAAa,iCAAO;AAAA;AAAA,eAElB,mBAAmB,CAAC,UAAU,MAAM;AAAA,MAC7C,CAAC,UAAU,oBAAoB,MAAM,MAAM,CAAC,UAAU,MAAM,aAAa;AAAA;AAGxE,MAAM,aAAa,iCAAO;AAAA;AAAA,eAElB,mBAAmB,CAAC,UAAU,MAAM;AAAA;AAG5C,MAAM,eAAe,iCAAO;AAAA;AAAA;AAAA,eAGpB,CAAC,UAAU,cAAc,MAAM,MAAM,CAAC,UAAU,MAAM;AAAA,eACtD,CAAC,UAAU,MAAM;AAAA,uBACT,CAAC,UAAU,MAAM;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,217 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { describe, PropTypes } from "react-desc";
4
+ import { convertPropToCssClassName } from "@elliemae/ds-classnames";
5
+ import DSTooltip from "@elliemae/ds-tooltip";
6
+ const { classNameBlock, classNameElement } = convertPropToCssClassName("circular-progress-indicator");
7
+ const CircularProgressIndicator = ({ size, showLabel, showTooltip, waiting, loading }) => {
8
+ const waitingLabel = "Waiting...";
9
+ const loadingLabel = "Loading...";
10
+ const currentLabel = waiting && !loading ? waitingLabel : loadingLabel;
11
+ let sizePx;
12
+ let sizeLabel;
13
+ let strokeWidth;
14
+ let trackWidth;
15
+ let markerHeight = "0.7";
16
+ let markerRefY = "4.8";
17
+ let grayArcStrokeDasharray = "45 170";
18
+ let grayArcStrokeDashoffset = "127.5";
19
+ switch (size.toUpperCase()) {
20
+ case "XS":
21
+ sizePx = 8;
22
+ sizeLabel = 12;
23
+ strokeWidth = 10;
24
+ trackWidth = 3;
25
+ markerHeight = "1";
26
+ grayArcStrokeDasharray = "46 174";
27
+ grayArcStrokeDashoffset = "133";
28
+ break;
29
+ case "S":
30
+ sizePx = 16;
31
+ sizeLabel = 12;
32
+ strokeWidth = 8;
33
+ trackWidth = 3;
34
+ markerHeight = "1";
35
+ grayArcStrokeDasharray = "46 174";
36
+ grayArcStrokeDashoffset = "133";
37
+ break;
38
+ case "M":
39
+ sizePx = 24;
40
+ sizeLabel = 12;
41
+ strokeWidth = 7;
42
+ trackWidth = 3;
43
+ markerHeight = "1";
44
+ markerRefY = "5.5";
45
+ grayArcStrokeDasharray = "46 174";
46
+ grayArcStrokeDashoffset = "133";
47
+ break;
48
+ case "L":
49
+ sizePx = 32;
50
+ sizeLabel = 13;
51
+ strokeWidth = 6;
52
+ trackWidth = 3;
53
+ markerRefY = "5";
54
+ break;
55
+ case "XL":
56
+ sizePx = 48;
57
+ sizeLabel = 14;
58
+ strokeWidth = 5;
59
+ trackWidth = 1;
60
+ break;
61
+ case "XXL":
62
+ sizePx = 56;
63
+ sizeLabel = 16;
64
+ strokeWidth = 4;
65
+ trackWidth = 1;
66
+ break;
67
+ case "XXXL":
68
+ sizePx = 64;
69
+ sizeLabel = 16;
70
+ strokeWidth = 5;
71
+ trackWidth = 2;
72
+ break;
73
+ default:
74
+ break;
75
+ }
76
+ const labelText = /* @__PURE__ */ React2.createElement("p", {
77
+ "data-testid": "circular-indicator-label",
78
+ className: classNameElement("label"),
79
+ style: { fontSize: `${sizeLabel}px` }
80
+ }, currentLabel);
81
+ const buildIndicator = (Component) => sizePx < 17 || showTooltip ? /* @__PURE__ */ React2.createElement(DSTooltip, {
82
+ containerProps: {
83
+ id: "ds-circular-progress-indicator",
84
+ "data-testid": "circular-indicator-title"
85
+ },
86
+ interactionType: "hover",
87
+ title: currentLabel,
88
+ triggerComponent: Component,
89
+ placement: "bottom"
90
+ }) : Component;
91
+ const grayTrack = /* @__PURE__ */ React2.createElement("circle", {
92
+ className: classNameElement("track"),
93
+ cx: "50%",
94
+ cy: "50%",
95
+ fill: "none",
96
+ r: "28",
97
+ strokeWidth: `${trackWidth}px`
98
+ });
99
+ const grayArc = /* @__PURE__ */ React2.createElement("circle", {
100
+ className: classNameElement("arc-gray"),
101
+ stroke: "#E0E3E8",
102
+ strokeDasharray: `${grayArcStrokeDasharray}`,
103
+ strokeDashoffset: `${grayArcStrokeDashoffset}`,
104
+ cx: "50%",
105
+ cy: "50%",
106
+ fill: "none",
107
+ r: "28",
108
+ strokeWidth: `${trackWidth}px`
109
+ });
110
+ const indicator = /* @__PURE__ */ React2.createElement("svg", {
111
+ height: `${sizePx}px`,
112
+ version: "1.1",
113
+ viewBox: "0 0 66 66",
114
+ width: `${sizePx}px`,
115
+ "data-testid": "circular-indicator"
116
+ }, /* @__PURE__ */ React2.createElement("defs", null, /* @__PURE__ */ React2.createElement("linearGradient", {
117
+ id: "grad1",
118
+ x1: "0%",
119
+ x2: "100%",
120
+ y1: "100%",
121
+ y2: "0%"
122
+ }, /* @__PURE__ */ React2.createElement("stop", {
123
+ offset: "0%",
124
+ style: { stopColor: "#E0E3E8", stopOpacity: 1 }
125
+ }), /* @__PURE__ */ React2.createElement("stop", {
126
+ offset: "89%",
127
+ style: { stopColor: "#5594e2", stopOpacity: 1 }
128
+ }), /* @__PURE__ */ React2.createElement("stop", {
129
+ offset: "100%",
130
+ style: { stopColor: "#5594e2", stopOpacity: 1 }
131
+ })), /* @__PURE__ */ React2.createElement("linearGradient", {
132
+ id: "grad2",
133
+ x1: "0%",
134
+ x2: "100%",
135
+ y1: "100%",
136
+ y2: "0%"
137
+ }, /* @__PURE__ */ React2.createElement("stop", {
138
+ offset: "0%",
139
+ style: { stopColor: "#5594e2", stopOpacity: 1 }
140
+ }), /* @__PURE__ */ React2.createElement("stop", {
141
+ offset: "11%",
142
+ style: { stopColor: "#5594e2", stopOpacity: 1 }
143
+ }), /* @__PURE__ */ React2.createElement("stop", {
144
+ offset: "100%",
145
+ style: { stopColor: "#E0E3E8", stopOpacity: 1 }
146
+ })), /* @__PURE__ */ React2.createElement("marker", {
147
+ id: "inverseL",
148
+ viewBox: "0 0 5 10",
149
+ refX: "0.5",
150
+ refY: `${markerRefY}`,
151
+ markerUnits: "strokeWidth",
152
+ markerWidth: "0.5",
153
+ markerHeight: `${markerHeight}`,
154
+ orient: "auto"
155
+ }, /* @__PURE__ */ React2.createElement("path", {
156
+ d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
157
+ fill: "#FFF"
158
+ })), /* @__PURE__ */ React2.createElement("marker", {
159
+ id: "inverseR",
160
+ viewBox: "0 0 5 10",
161
+ refX: "0",
162
+ refY: "5",
163
+ markerUnits: "strokeWidth",
164
+ markerWidth: "0.7",
165
+ markerHeight: `${markerHeight}`
166
+ }, /* @__PURE__ */ React2.createElement("path", {
167
+ d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
168
+ fill: "#FFF"
169
+ }))), grayTrack, !waiting && /* @__PURE__ */ React2.createElement("g", {
170
+ fill: "none",
171
+ fillRule: "evenodd",
172
+ stroke: "none",
173
+ strokeWidth: "1"
174
+ }, /* @__PURE__ */ React2.createElement("path", {
175
+ className: classNameElement("arc-blue"),
176
+ d: "M30,5 C17.536025,6 6,17.536027 5,31",
177
+ stroke: "#5594e2",
178
+ strokeWidth: `${strokeWidth - 0.5}px`,
179
+ strokeLinecap: "round",
180
+ "data-testid": "circular-indicator-blue-arc"
181
+ }), /* @__PURE__ */ React2.createElement("path", {
182
+ className: classNameElement("arc-white"),
183
+ d: "M33,5 C17.536027,5 5,17.536027 5,33",
184
+ stroke: "#FFF",
185
+ strokeWidth: `${strokeWidth + 2}px`,
186
+ markerStart: "url(#inverseR)",
187
+ markerEnd: "url(#inverseL)"
188
+ }), grayArc));
189
+ return /* @__PURE__ */ React2.createElement("div", {
190
+ className: classNameBlock("wrapper"),
191
+ role: "status",
192
+ "aria-hidden": waiting || loading ? "false" : "true"
193
+ }, buildIndicator(indicator), showLabel && labelText);
194
+ };
195
+ CircularProgressIndicator.defaultProps = {
196
+ size: "m",
197
+ showLabel: false,
198
+ showTooltip: false,
199
+ waiting: false,
200
+ loading: false
201
+ };
202
+ const circularProgressIndicatorProps = {
203
+ size: PropTypes.oneOf(["xs", "s", "m", "l", "xl", "xxl", "xxxl"]).description("Defines the size of the indicator").defaultValue("m"),
204
+ showLabel: PropTypes.bool.description("Wheter the indicator displays its state on a label or not").defaultValue(false),
205
+ showTooltip: PropTypes.bool.description("Wheter the indicator displays its state on a tooltip or not").defaultValue(false),
206
+ waiting: PropTypes.bool.description("Defines the state of the indicator as Waiting and only displays the gray track").defaultValue(false),
207
+ loading: PropTypes.bool.description("Defines the state of the indicator as Loading and displays a blue spinner animation").defaultValue(false)
208
+ };
209
+ CircularProgressIndicator.propTypes = circularProgressIndicatorProps;
210
+ const CircularProgressIndicatorWithSchema = describe(CircularProgressIndicator);
211
+ CircularProgressIndicatorWithSchema.propTypes = circularProgressIndicatorProps;
212
+ var DSCircularProgressIndicator_default = CircularProgressIndicator;
213
+ export {
214
+ CircularProgressIndicatorWithSchema,
215
+ DSCircularProgressIndicator_default as default
216
+ };
217
+ //# sourceMappingURL=DSCircularProgressIndicator.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSCircularProgressIndicator.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTooltip from '@elliemae/ds-tooltip';\n\nconst { classNameBlock, classNameElement } = convertPropToCssClassName('circular-progress-indicator');\n\nconst CircularProgressIndicator = ({ size, showLabel, showTooltip, waiting, loading }) => {\n const waitingLabel = 'Waiting...';\n const loadingLabel = 'Loading...';\n const currentLabel = waiting && !loading ? waitingLabel : loadingLabel;\n let sizePx;\n let sizeLabel;\n let strokeWidth;\n let trackWidth;\n let markerHeight = '0.7';\n let markerRefY = '4.8';\n let grayArcStrokeDasharray = '45 170';\n let grayArcStrokeDashoffset = '127.5';\n\n switch (size.toUpperCase()) {\n case 'XS':\n sizePx = 8;\n sizeLabel = 12;\n strokeWidth = 10;\n trackWidth = 3;\n markerHeight = '1';\n grayArcStrokeDasharray = '46 174';\n grayArcStrokeDashoffset = '133';\n break;\n case 'S':\n sizePx = 16;\n sizeLabel = 12;\n strokeWidth = 8;\n trackWidth = 3;\n markerHeight = '1';\n grayArcStrokeDasharray = '46 174';\n grayArcStrokeDashoffset = '133';\n break;\n case 'M':\n sizePx = 24;\n sizeLabel = 12;\n strokeWidth = 7;\n trackWidth = 3;\n markerHeight = '1';\n markerRefY = '5.5';\n grayArcStrokeDasharray = '46 174';\n grayArcStrokeDashoffset = '133';\n break;\n case 'L':\n sizePx = 32;\n sizeLabel = 13;\n strokeWidth = 6;\n trackWidth = 3;\n markerRefY = '5';\n break;\n case 'XL':\n sizePx = 48;\n sizeLabel = 14;\n strokeWidth = 5;\n trackWidth = 1;\n break;\n case 'XXL':\n sizePx = 56;\n sizeLabel = 16;\n strokeWidth = 4;\n trackWidth = 1;\n break;\n case 'XXXL':\n sizePx = 64;\n sizeLabel = 16;\n strokeWidth = 5;\n trackWidth = 2;\n break;\n default:\n break;\n }\n\n const labelText = (\n <p\n data-testid=\"circular-indicator-label\"\n className={classNameElement('label')}\n style={{ fontSize: `${sizeLabel}px` }}\n >\n {currentLabel}\n </p>\n );\n\n // Only adds the tooltip if sizePx < 17 or showTooltip is true\n const buildIndicator = (Component: JSX.Element) =>\n sizePx < 17 || showTooltip ? (\n <DSTooltip\n containerProps={{\n id: 'ds-circular-progress-indicator',\n 'data-testid': 'circular-indicator-title',\n }}\n interactionType=\"hover\"\n title={currentLabel}\n triggerComponent={Component}\n placement=\"bottom\"\n />\n ) : (\n Component\n );\n\n const grayTrack = (\n <circle\n className={classNameElement('track')}\n cx=\"50%\"\n cy=\"50%\"\n fill=\"none\"\n r=\"28\"\n strokeWidth={`${trackWidth}px`}\n />\n );\n\n const grayArc = (\n <circle\n className={classNameElement('arc-gray')}\n stroke=\"#E0E3E8\"\n strokeDasharray={`${grayArcStrokeDasharray}`}\n strokeDashoffset={`${grayArcStrokeDashoffset}`}\n cx=\"50%\"\n cy=\"50%\"\n fill=\"none\"\n r=\"28\"\n strokeWidth={`${trackWidth}px`}\n />\n );\n\n const indicator = (\n <svg\n height={`${sizePx}px`}\n version=\"1.1\"\n viewBox=\"0 0 66 66\"\n width={`${sizePx}px`}\n data-testid=\"circular-indicator\"\n >\n <defs>\n <linearGradient id=\"grad1\" x1=\"0%\" x2=\"100%\" y1=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" style={{ stopColor: '#E0E3E8', stopOpacity: 1 }} />\n <stop offset=\"89%\" style={{ stopColor: '#5594e2', stopOpacity: 1 }} />\n <stop offset=\"100%\" style={{ stopColor: '#5594e2', stopOpacity: 1 }} />\n </linearGradient>\n <linearGradient id=\"grad2\" x1=\"0%\" x2=\"100%\" y1=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" style={{ stopColor: '#5594e2', stopOpacity: 1 }} />\n <stop offset=\"11%\" style={{ stopColor: '#5594e2', stopOpacity: 1 }} />\n <stop offset=\"100%\" style={{ stopColor: '#E0E3E8', stopOpacity: 1 }} />\n </linearGradient>\n <marker\n id=\"inverseL\"\n viewBox=\"0 0 5 10\"\n refX=\"0.5\"\n refY={`${markerRefY}`}\n markerUnits=\"strokeWidth\"\n markerWidth=\"0.5\"\n markerHeight={`${markerHeight}`}\n orient=\"auto\"\n >\n <path d=\"M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z\" fill=\"#FFF\" />\n </marker>\n <marker\n id=\"inverseR\"\n viewBox=\"0 0 5 10\"\n refX=\"0\"\n refY=\"5\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"0.7\"\n markerHeight={`${markerHeight}`}\n >\n <path d=\"M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z\" fill=\"#FFF\" />\n </marker>\n </defs>\n {grayTrack}\n {!waiting && (\n <g fill=\"none\" fillRule=\"evenodd\" stroke=\"none\" strokeWidth=\"1\">\n <path\n className={classNameElement('arc-blue')}\n d=\"M30,5 C17.536025,6 6,17.536027 5,31\"\n stroke=\"#5594e2\"\n strokeWidth={`${strokeWidth - 0.5}px`}\n strokeLinecap=\"round\"\n data-testid=\"circular-indicator-blue-arc\"\n />\n <path\n className={classNameElement('arc-white')}\n d=\"M33,5 C17.536027,5 5,17.536027 5,33\"\n stroke=\"#FFF\"\n strokeWidth={`${strokeWidth + 2}px`}\n markerStart=\"url(#inverseR)\"\n markerEnd=\"url(#inverseL)\"\n />\n {grayArc}\n </g>\n )}\n </svg>\n );\n\n return (\n <div className={classNameBlock('wrapper')} role=\"status\" aria-hidden={waiting || loading ? 'false' : 'true'}>\n {buildIndicator(indicator)}\n {showLabel && labelText}\n </div>\n );\n};\n\nCircularProgressIndicator.defaultProps = {\n size: 'm',\n showLabel: false,\n showTooltip: false,\n waiting: false,\n loading: false,\n};\n\nconst circularProgressIndicatorProps = {\n size: PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl'])\n .description('Defines the size of the indicator')\n .defaultValue('m'),\n showLabel: PropTypes.bool\n .description('Wheter the indicator displays its state on a label or not')\n .defaultValue(false),\n showTooltip: PropTypes.bool\n .description('Wheter the indicator displays its state on a tooltip or not')\n .defaultValue(false),\n waiting: PropTypes.bool\n .description('Defines the state of the indicator as Waiting and only displays the gray track')\n .defaultValue(false),\n loading: PropTypes.bool\n .description('Defines the state of the indicator as Loading and displays a blue spinner animation')\n .defaultValue(false),\n};\n\nCircularProgressIndicator.propTypes = circularProgressIndicatorProps;\n\nconst CircularProgressIndicatorWithSchema = describe(CircularProgressIndicator);\nCircularProgressIndicatorWithSchema.propTypes = circularProgressIndicatorProps;\n\nexport { CircularProgressIndicatorWithSchema };\nexport default CircularProgressIndicator;\n"],
5
+ "mappings": "AAAA;ACGA;AACA;AACA;AACA;AAEA,MAAM,EAAE,gBAAgB,qBAAqB,0BAA0B;AAEvE,MAAM,4BAA4B,CAAC,EAAE,MAAM,WAAW,aAAa,SAAS,cAAc;AACxF,QAAM,eAAe;AACrB,QAAM,eAAe;AACrB,QAAM,eAAe,WAAW,CAAC,UAAU,eAAe;AAC1D,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,yBAAyB;AAC7B,MAAI,0BAA0B;AAE9B,UAAQ,KAAK;AAAA,SACN;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb,qBAAe;AACf,+BAAyB;AACzB,gCAA0B;AAC1B;AAAA,SACG;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb,qBAAe;AACf,+BAAyB;AACzB,gCAA0B;AAC1B;AAAA,SACG;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb,qBAAe;AACf,mBAAa;AACb,+BAAyB;AACzB,gCAA0B;AAC1B;AAAA,SACG;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb,mBAAa;AACb;AAAA,SACG;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb;AAAA,SACG;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb;AAAA,SACG;AACH,eAAS;AACT,kBAAY;AACZ,oBAAc;AACd,mBAAa;AACb;AAAA;AAEA;AAAA;AAGJ,QAAM,YACJ,qCAAC,KAAD;AAAA,IACE,eAAY;AAAA,IACZ,WAAW,iBAA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AAD;AAAA,IAAK,WAAW,eAAe;AAAA,IAAY,MAAK;AAAA,IAAS,eAAa,WAAW,UAAU,UAAU;AAAA,KAClG,eAAe,YACf,aAAa;AAAA;AAKpB,0BAA0B,eAAe;AAAA,EACvC,MAAM;AAAA,EACN,WAAW;AAAA,EACX,aAAa;AAAA,EACb,SAAS;AAAA,EACT,SAAS;AAAA;AAGX,MAAM,iCAAiC;AAAA,EACrC,MAAM,UAAU,MAAM,CAAC,MAAM,KAAK,KAAK,KAAK,MAAM,OAAO,SACtD,YAAY,qCACZ,aAAa;AAAA,EAChB,WAAW,UAAU,KAClB,YAAY,6DACZ,aAAa;AAAA,EAChB,aAAa,UAAU,KACpB,YAAY,+DACZ,aAAa;AAAA,EAChB,SAAS,UAAU,KAChB,YAAY,kFACZ,aAAa;AAAA,EAChB,SAAS,UAAU,KAChB,YAAY,uFACZ,aAAa;AAAA;AAGlB,0BAA0B,YAAY;AAEtC,MAAM,sCAAsC,SAAS;AACrD,oCAAoC,YAAY;AAGhD,IAAO,sCAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import {
3
+ default as default2,
4
+ default as default3,
5
+ CircularProgressIndicatorWithSchema
6
+ } from "./DSCircularProgressIndicator";
7
+ import { DSCircularIndeterminateIndicator, DSCircularIndeterminateIndicatorWithSchema } from "./v2";
8
+ export {
9
+ CircularProgressIndicatorWithSchema,
10
+ DSCircularIndeterminateIndicator,
11
+ DSCircularIndeterminateIndicatorWithSchema,
12
+ default3 as DSCircularProgressIndicator,
13
+ default2 as default
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/named */\nexport {\n default,\n default as DSCircularProgressIndicator,\n CircularProgressIndicatorWithSchema,\n} from './DSCircularProgressIndicator';\nexport { DSCircularIndeterminateIndicator, DSCircularIndeterminateIndicatorWithSchema } from './v2';\n"],
5
+ "mappings": "AAAA;ACCA;AAAA;AAAA;AAAA;AAAA;AAKA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,97 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import * as React from "react";
18
+ import React2, { useMemo } from "react";
19
+ import { Grid } from "@elliemae/ds-grid";
20
+ import { DSTooltipV3 } from "@elliemae/ds-tooltip";
21
+ import { describe, useGetGlobalAttributes, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
22
+ import { uid } from "uid";
23
+ import {
24
+ CircularIndeterminateIndicatorPropTypes,
25
+ defaultProps
26
+ } from "./react-desc-prop-types";
27
+ import { colorToHex, sizeToPx, sizeToTextSize, sizeToWeight } from "./constants";
28
+ import { StyledCircle, StyledPath, StyledRect, StyledSvg } from "./styled";
29
+ const DSCircularIndeterminateIndicator = (props) => {
30
+ const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
31
+ const globalAttributes = useGetGlobalAttributes(propsWithDefault);
32
+ const { size, color, text, showText, withTooltip, tooltipStartPlacementPreference, __duration } = propsWithDefault;
33
+ const Wrapper = useMemo(() => withTooltip ? DSTooltipV3 : ({ children }) => /* @__PURE__ */ React2.createElement(React2.Fragment, null, children), [withTooltip]);
34
+ const uniqueId = useMemo(() => uid(16), []);
35
+ const circleRadius = useMemo(() => (sizeToPx[size] - Number.parseInt(sizeToWeight[size], 10)) / 2, [size]);
36
+ return /* @__PURE__ */ React2.createElement(Grid, __spreadValues({
37
+ gutter: "xs",
38
+ justifyContent: "center",
39
+ role: "status"
40
+ }, globalAttributes), /* @__PURE__ */ React2.createElement(Wrapper, {
41
+ text,
42
+ textAlign: "center",
43
+ startPlacementPreference: tooltipStartPlacementPreference
44
+ }, /* @__PURE__ */ React2.createElement(StyledSvg, {
45
+ width: sizeToPx[size],
46
+ height: sizeToPx[size]
47
+ }, /* @__PURE__ */ React2.createElement("defs", null, /* @__PURE__ */ React2.createElement("clipPath", {
48
+ id: `not-gradient-clip-${uniqueId}`
49
+ }, /* @__PURE__ */ React2.createElement(StyledRect, {
50
+ x: "0%",
51
+ y: "0%",
52
+ width: "52%",
53
+ height: "100%",
54
+ __duration
55
+ })), /* @__PURE__ */ React2.createElement("linearGradient", {
56
+ id: `gradient-color-${uniqueId}`,
57
+ x1: "0%",
58
+ x2: "0%",
59
+ y1: "0%",
60
+ y2: "100%"
61
+ }, /* @__PURE__ */ React2.createElement("stop", {
62
+ offset: "10%",
63
+ stopColor: `${colorToHex[color]}00`
64
+ }), /* @__PURE__ */ React2.createElement("stop", {
65
+ offset: "90%",
66
+ stopColor: `${colorToHex[color]}FF`
67
+ }))), /* @__PURE__ */ React2.createElement(StyledCircle, {
68
+ cx: "50%",
69
+ cy: "50%",
70
+ r: circleRadius,
71
+ strokeWidth: sizeToWeight[size],
72
+ stroke: colorToHex[color],
73
+ strokeLinecap: "round",
74
+ clipPath: `url(#not-gradient-clip-${uniqueId})`,
75
+ __duration
76
+ }), /* @__PURE__ */ React2.createElement(StyledPath, {
77
+ d: `M ${sizeToPx[size] / 2} ${sizeToPx[size] / 2}
78
+ m ${circleRadius}, 0
79
+ a ${circleRadius}, ${circleRadius} 0 0, 1 -${circleRadius}, ${circleRadius}`,
80
+ strokeWidth: sizeToWeight[size],
81
+ fill: "transparent",
82
+ stroke: `url(#gradient-color-${uniqueId})`,
83
+ strokeLinecap: "round",
84
+ r: circleRadius,
85
+ __duration
86
+ })), text !== "" && showText && /* @__PURE__ */ React2.createElement("span", {
87
+ style: { color: color === "light" ? "#FFFFFF" : "#25292F99", fontSize: sizeToTextSize[size] }
88
+ }, text)));
89
+ };
90
+ DSCircularIndeterminateIndicator.propTypes = CircularIndeterminateIndicatorPropTypes;
91
+ const DSCircularIndeterminateIndicatorWithSchema = describe(DSCircularIndeterminateIndicator);
92
+ DSCircularIndeterminateIndicatorWithSchema.propTypes = CircularIndeterminateIndicatorPropTypes;
93
+ export {
94
+ DSCircularIndeterminateIndicator,
95
+ DSCircularIndeterminateIndicatorWithSchema
96
+ };
97
+ //# sourceMappingURL=DSCircularIndeterminateIndicator.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/DSCircularIndeterminateIndicator.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/naming-convention */\nimport React, { PropsWithChildren, useMemo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { describe, useGetGlobalAttributes, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport {\n DSCircularIndeterminateIndicatorT,\n CircularIndeterminateIndicatorPropTypes,\n defaultProps,\n} from './react-desc-prop-types';\nimport { colorToHex, sizeToPx, sizeToTextSize, sizeToWeight } from './constants';\nimport { StyledCircle, StyledPath, StyledRect, StyledSvg } from './styled';\n\nexport const DSCircularIndeterminateIndicator: React.ComponentType<DSCircularIndeterminateIndicatorT.Props> = (\n props,\n) => {\n const propsWithDefault = useMemoMergePropsWithDefault<Required<DSCircularIndeterminateIndicatorT.Props>>(\n props,\n defaultProps,\n );\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { size, color, text, showText, withTooltip, tooltipStartPlacementPreference, __duration } = propsWithDefault;\n\n const Wrapper: typeof DSTooltipV3 = useMemo(\n () => (withTooltip ? DSTooltipV3 : ({ children }: PropsWithChildren<unknown>) => <>{children}</>),\n [withTooltip],\n );\n\n const uniqueId = useMemo(() => uid(16), []);\n\n const circleRadius = useMemo(() => (sizeToPx[size] - Number.parseInt(sizeToWeight[size], 10)) / 2, [size]);\n\n return (\n <Grid gutter=\"xs\" justifyContent=\"center\" role=\"status\" {...globalAttributes}>\n <Wrapper text={text} textAlign=\"center\" startPlacementPreference={tooltipStartPlacementPreference}>\n <StyledSvg width={sizeToPx[size]} height={sizeToPx[size]}>\n <defs>\n <clipPath id={`not-gradient-clip-${uniqueId}`}>\n <StyledRect x=\"0%\" y=\"0%\" width=\"52%\" height=\"100%\" __duration={__duration} />\n </clipPath>\n <linearGradient id={`gradient-color-${uniqueId}`} x1=\"0%\" x2=\"0%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"10%\" stopColor={`${colorToHex[color]}00`} />\n <stop offset=\"90%\" stopColor={`${colorToHex[color]}FF`} />\n </linearGradient>\n </defs>\n <StyledCircle\n cx=\"50%\"\n cy=\"50%\"\n r={circleRadius}\n strokeWidth={sizeToWeight[size]}\n stroke={colorToHex[color]}\n strokeLinecap=\"round\"\n clipPath={`url(#not-gradient-clip-${uniqueId})`}\n __duration={__duration}\n />\n {/* \n Here we are using a path because:\n - Flexible enough to build a circle\n - When rotating, the gradient follows the rotation!!! (This is key)\n - We can use the rotation with keyframes, allowing for custom timing\n \n Using a circle does not pass point 2.\n Animating the gradient is not posible with custom timings.\n This is the best solution without using a custom library.\n */}\n <StyledPath\n d={`M ${sizeToPx[size] / 2} ${sizeToPx[size] / 2}\n m ${circleRadius}, 0\n a ${circleRadius}, ${circleRadius} 0 0, 1 -${circleRadius}, ${circleRadius}`}\n strokeWidth={sizeToWeight[size]}\n fill=\"transparent\"\n stroke={`url(#gradient-color-${uniqueId})`}\n strokeLinecap=\"round\"\n r={circleRadius}\n __duration={__duration}\n />\n </StyledSvg>\n {text !== '' && showText && (\n <span style={{ color: color === 'light' ? '#FFFFFF' : '#25292F99', fontSize: sizeToTextSize[size] }}>\n {text}\n </span>\n )}\n </Wrapper>\n </Grid>\n );\n};\n\nDSCircularIndeterminateIndicator.propTypes = CircularIndeterminateIndicatorPropTypes;\n\nexport const DSCircularIndeterminateIndicatorWithSchema = describe(DSCircularIndeterminateIndicator);\nDSCircularIndeterminateIndicatorWithSchema.propTypes = CircularIndeterminateIndicatorPropTypes;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAKA;AACA;AAEO,MAAM,mCAAiG,CAC5G,UACG;AACH,QAAM,mBAAmB,6BACvB,OACA;AAEF,QAAM,mBAAmB,uBAAuB;AAEhD,QAAM,EAAE,MAAM,OAAO,MAAM,UAAU,aAAa,iCAAiC,eAAe;AAElG,QAAM,UAA8B,QAClC,MAAO,cAAc,cAAc,CAAC,EAAE,eAA2C,4DAAG,WACpF,CAAC;AAGH,QAAM,WAAW,QAAQ,MAAM,IAAI,KAAK;AAExC,QAAM,eAAe,QAAQ,MAAO,UAAS,QAAQ,OAAO,SAAS,aAAa,OAAO,OAAO,GAAG,CAAC;AAEpG,SACE,qCAAC,MAAD;AAAA,IAAM,QAAO;AAAA,IAAK,gBAAe;AAAA,IAAS,MAAK;AAAA,KAAa,mBAC1D,qCAAC,SAAD;AAAA,IAAS;AAAA,IAAY,WAAU;AAAA,IAAS,0BAA0B;AAAA,KAChE,qCAAC,WAAD;AAAA,IAAW,OAAO,SAAS;AAAA,IAAO,QAAQ,SAAS;AAAA,KACjD,qCAAC,QAAD,MACE,qCAAC,YAAD;AAAA,IAAU,IAAI,qBAAqB;AAAA,KACjC,qCAAC,YAAD;AAAA,IAAY,GAAE;AAAA,IAAK,GAAE;AAAA,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