@elliemae/ds-circular-progress-indicator 2.0.0-alpha.0 → 2.0.0-alpha.12
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.
|
@@ -19,13 +19,14 @@ const {
|
|
|
19
19
|
classNameElement
|
|
20
20
|
} = dsClassnames.convertPropToCssClassName('circular-progress-indicator');
|
|
21
21
|
|
|
22
|
-
const CircularProgressIndicator =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const CircularProgressIndicator = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
size,
|
|
25
|
+
showLabel,
|
|
26
|
+
showTooltip,
|
|
27
|
+
waiting,
|
|
28
|
+
loading
|
|
29
|
+
} = _ref;
|
|
29
30
|
const waitingLabel = 'Waiting...';
|
|
30
31
|
const loadingLabel = 'Loading...';
|
|
31
32
|
const currentLabel = waiting && !loading ? waitingLabel : loadingLabel;
|
|
@@ -100,16 +101,16 @@ const CircularProgressIndicator = ({
|
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
const labelText = /*#__PURE__*/_jsx__default[
|
|
104
|
+
const labelText = /*#__PURE__*/_jsx__default["default"]("p", {
|
|
104
105
|
"data-testid": "circular-indicator-label",
|
|
105
106
|
className: classNameElement('label'),
|
|
106
107
|
style: {
|
|
107
|
-
fontSize:
|
|
108
|
+
fontSize: "".concat(sizeLabel, "px")
|
|
108
109
|
}
|
|
109
110
|
}, void 0, currentLabel); // Only adds the tooltip if sizePx < 17 or showTooltip is true
|
|
110
111
|
|
|
111
112
|
|
|
112
|
-
const buildIndicator = Component => sizePx < 17 || showTooltip ? /*#__PURE__*/_jsx__default[
|
|
113
|
+
const buildIndicator = Component => sizePx < 17 || showTooltip ? /*#__PURE__*/_jsx__default["default"](DSTooltip__default["default"], {
|
|
113
114
|
containerProps: {
|
|
114
115
|
id: 'ds-circular-progress-indicator',
|
|
115
116
|
'data-testid': 'circular-indicator-title'
|
|
@@ -120,126 +121,126 @@ const CircularProgressIndicator = ({
|
|
|
120
121
|
placement: "bottom"
|
|
121
122
|
}) : Component;
|
|
122
123
|
|
|
123
|
-
const grayTrack = /*#__PURE__*/_jsx__default[
|
|
124
|
+
const grayTrack = /*#__PURE__*/_jsx__default["default"]("circle", {
|
|
124
125
|
className: classNameElement('track'),
|
|
125
126
|
cx: "50%",
|
|
126
127
|
cy: "50%",
|
|
127
128
|
fill: "none",
|
|
128
129
|
r: "28",
|
|
129
|
-
strokeWidth:
|
|
130
|
+
strokeWidth: "".concat(trackWidth, "px")
|
|
130
131
|
});
|
|
131
132
|
|
|
132
|
-
const grayArc = /*#__PURE__*/_jsx__default[
|
|
133
|
+
const grayArc = /*#__PURE__*/_jsx__default["default"]("circle", {
|
|
133
134
|
className: classNameElement('arc-gray'),
|
|
134
135
|
stroke: "#E0E3E8",
|
|
135
|
-
strokeDasharray:
|
|
136
|
-
strokeDashoffset:
|
|
136
|
+
strokeDasharray: "".concat(grayArcStrokeDasharray),
|
|
137
|
+
strokeDashoffset: "".concat(grayArcStrokeDashoffset),
|
|
137
138
|
cx: "50%",
|
|
138
139
|
cy: "50%",
|
|
139
140
|
fill: "none",
|
|
140
141
|
r: "28",
|
|
141
|
-
strokeWidth:
|
|
142
|
+
strokeWidth: "".concat(trackWidth, "px")
|
|
142
143
|
});
|
|
143
144
|
|
|
144
|
-
const indicator = /*#__PURE__*/_jsx__default[
|
|
145
|
-
height:
|
|
145
|
+
const indicator = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
146
|
+
height: "".concat(sizePx, "px"),
|
|
146
147
|
version: "1.1",
|
|
147
148
|
viewBox: "0 0 66 66",
|
|
148
|
-
width:
|
|
149
|
+
width: "".concat(sizePx, "px"),
|
|
149
150
|
"data-testid": "circular-indicator"
|
|
150
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
151
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("defs", {}, void 0, /*#__PURE__*/_jsx__default["default"]("linearGradient", {
|
|
151
152
|
id: "grad1",
|
|
152
153
|
x1: "0%",
|
|
153
154
|
x2: "100%",
|
|
154
155
|
y1: "100%",
|
|
155
156
|
y2: "0%"
|
|
156
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
157
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("stop", {
|
|
157
158
|
offset: "0%",
|
|
158
159
|
style: {
|
|
159
160
|
stopColor: '#E0E3E8',
|
|
160
161
|
stopOpacity: 1
|
|
161
162
|
}
|
|
162
|
-
}), /*#__PURE__*/_jsx__default[
|
|
163
|
+
}), /*#__PURE__*/_jsx__default["default"]("stop", {
|
|
163
164
|
offset: "89%",
|
|
164
165
|
style: {
|
|
165
166
|
stopColor: '#5594e2',
|
|
166
167
|
stopOpacity: 1
|
|
167
168
|
}
|
|
168
|
-
}), /*#__PURE__*/_jsx__default[
|
|
169
|
+
}), /*#__PURE__*/_jsx__default["default"]("stop", {
|
|
169
170
|
offset: "100%",
|
|
170
171
|
style: {
|
|
171
172
|
stopColor: '#5594e2',
|
|
172
173
|
stopOpacity: 1
|
|
173
174
|
}
|
|
174
|
-
})), /*#__PURE__*/_jsx__default[
|
|
175
|
+
})), /*#__PURE__*/_jsx__default["default"]("linearGradient", {
|
|
175
176
|
id: "grad2",
|
|
176
177
|
x1: "0%",
|
|
177
178
|
x2: "100%",
|
|
178
179
|
y1: "100%",
|
|
179
180
|
y2: "0%"
|
|
180
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
181
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("stop", {
|
|
181
182
|
offset: "0%",
|
|
182
183
|
style: {
|
|
183
184
|
stopColor: '#5594e2',
|
|
184
185
|
stopOpacity: 1
|
|
185
186
|
}
|
|
186
|
-
}), /*#__PURE__*/_jsx__default[
|
|
187
|
+
}), /*#__PURE__*/_jsx__default["default"]("stop", {
|
|
187
188
|
offset: "11%",
|
|
188
189
|
style: {
|
|
189
190
|
stopColor: '#5594e2',
|
|
190
191
|
stopOpacity: 1
|
|
191
192
|
}
|
|
192
|
-
}), /*#__PURE__*/_jsx__default[
|
|
193
|
+
}), /*#__PURE__*/_jsx__default["default"]("stop", {
|
|
193
194
|
offset: "100%",
|
|
194
195
|
style: {
|
|
195
196
|
stopColor: '#E0E3E8',
|
|
196
197
|
stopOpacity: 1
|
|
197
198
|
}
|
|
198
|
-
})), /*#__PURE__*/_jsx__default[
|
|
199
|
+
})), /*#__PURE__*/_jsx__default["default"]("marker", {
|
|
199
200
|
id: "inverseL",
|
|
200
201
|
viewBox: "0 0 5 10",
|
|
201
202
|
refX: "0.5",
|
|
202
|
-
refY:
|
|
203
|
+
refY: "".concat(markerRefY),
|
|
203
204
|
markerUnits: "strokeWidth",
|
|
204
205
|
markerWidth: "0.5",
|
|
205
|
-
markerHeight:
|
|
206
|
+
markerHeight: "".concat(markerHeight),
|
|
206
207
|
orient: "auto"
|
|
207
|
-
}, void 0, _path || (_path = /*#__PURE__*/_jsx__default[
|
|
208
|
+
}, void 0, _path || (_path = /*#__PURE__*/_jsx__default["default"]("path", {
|
|
208
209
|
d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
|
|
209
210
|
fill: "#FFF"
|
|
210
|
-
}))), /*#__PURE__*/_jsx__default[
|
|
211
|
+
}))), /*#__PURE__*/_jsx__default["default"]("marker", {
|
|
211
212
|
id: "inverseR",
|
|
212
213
|
viewBox: "0 0 5 10",
|
|
213
214
|
refX: "0",
|
|
214
215
|
refY: "5",
|
|
215
216
|
markerUnits: "strokeWidth",
|
|
216
217
|
markerWidth: "0.7",
|
|
217
|
-
markerHeight:
|
|
218
|
-
}, void 0, _path2 || (_path2 = /*#__PURE__*/_jsx__default[
|
|
218
|
+
markerHeight: "".concat(markerHeight)
|
|
219
|
+
}, void 0, _path2 || (_path2 = /*#__PURE__*/_jsx__default["default"]("path", {
|
|
219
220
|
d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
|
|
220
221
|
fill: "#FFF"
|
|
221
|
-
})))), grayTrack, !waiting && /*#__PURE__*/_jsx__default[
|
|
222
|
+
})))), grayTrack, !waiting && /*#__PURE__*/_jsx__default["default"]("g", {
|
|
222
223
|
fill: "none",
|
|
223
224
|
fillRule: "evenodd",
|
|
224
225
|
stroke: "none",
|
|
225
226
|
strokeWidth: "1"
|
|
226
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
227
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
227
228
|
className: classNameElement('arc-blue'),
|
|
228
229
|
d: "M30,5 C17.536025,6 6,17.536027 5,31",
|
|
229
230
|
stroke: "#5594e2",
|
|
230
|
-
strokeWidth:
|
|
231
|
+
strokeWidth: "".concat(strokeWidth - 0.5, "px"),
|
|
231
232
|
strokeLinecap: "round",
|
|
232
233
|
"data-testid": "circular-indicator-blue-arc"
|
|
233
|
-
}), /*#__PURE__*/_jsx__default[
|
|
234
|
+
}), /*#__PURE__*/_jsx__default["default"]("path", {
|
|
234
235
|
className: classNameElement('arc-white'),
|
|
235
236
|
d: "M33,5 C17.536027,5 5,17.536027 5,33",
|
|
236
237
|
stroke: "#FFF",
|
|
237
|
-
strokeWidth:
|
|
238
|
+
strokeWidth: "".concat(strokeWidth + 2, "px"),
|
|
238
239
|
markerStart: "url(#inverseR)",
|
|
239
240
|
markerEnd: "url(#inverseL)"
|
|
240
241
|
}), grayArc));
|
|
241
242
|
|
|
242
|
-
return /*#__PURE__*/_jsx__default[
|
|
243
|
+
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
243
244
|
className: classNameBlock('wrapper'),
|
|
244
245
|
role: "status",
|
|
245
246
|
"aria-hidden": waiting || loading ? 'false' : 'true'
|
|
@@ -264,4 +265,4 @@ const CircularProgressIndicatorWithSchema = reactDesc.describe(CircularProgressI
|
|
|
264
265
|
CircularProgressIndicatorWithSchema.propTypes = circularProgressIndicatorProps;
|
|
265
266
|
|
|
266
267
|
exports.CircularProgressIndicatorWithSchema = CircularProgressIndicatorWithSchema;
|
|
267
|
-
exports[
|
|
268
|
+
exports["default"] = CircularProgressIndicator;
|
package/cjs/index.js
CHANGED
|
@@ -7,5 +7,5 @@ var DSCircularProgressIndicator = require('./DSCircularProgressIndicator.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
exports.CircularProgressIndicatorWithSchema = DSCircularProgressIndicator.CircularProgressIndicatorWithSchema;
|
|
10
|
-
exports.DSCircularProgressIndicator = DSCircularProgressIndicator[
|
|
11
|
-
exports
|
|
10
|
+
exports.DSCircularProgressIndicator = DSCircularProgressIndicator["default"];
|
|
11
|
+
exports["default"] = DSCircularProgressIndicator["default"];
|
|
@@ -10,13 +10,14 @@ const {
|
|
|
10
10
|
classNameElement
|
|
11
11
|
} = convertPropToCssClassName('circular-progress-indicator');
|
|
12
12
|
|
|
13
|
-
const CircularProgressIndicator =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const CircularProgressIndicator = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
size,
|
|
16
|
+
showLabel,
|
|
17
|
+
showTooltip,
|
|
18
|
+
waiting,
|
|
19
|
+
loading
|
|
20
|
+
} = _ref;
|
|
20
21
|
const waitingLabel = 'Waiting...';
|
|
21
22
|
const loadingLabel = 'Loading...';
|
|
22
23
|
const currentLabel = waiting && !loading ? waitingLabel : loadingLabel;
|
|
@@ -95,7 +96,7 @@ const CircularProgressIndicator = ({
|
|
|
95
96
|
"data-testid": "circular-indicator-label",
|
|
96
97
|
className: classNameElement('label'),
|
|
97
98
|
style: {
|
|
98
|
-
fontSize:
|
|
99
|
+
fontSize: "".concat(sizeLabel, "px")
|
|
99
100
|
}
|
|
100
101
|
}, void 0, currentLabel); // Only adds the tooltip if sizePx < 17 or showTooltip is true
|
|
101
102
|
|
|
@@ -117,26 +118,26 @@ const CircularProgressIndicator = ({
|
|
|
117
118
|
cy: "50%",
|
|
118
119
|
fill: "none",
|
|
119
120
|
r: "28",
|
|
120
|
-
strokeWidth:
|
|
121
|
+
strokeWidth: "".concat(trackWidth, "px")
|
|
121
122
|
});
|
|
122
123
|
|
|
123
124
|
const grayArc = /*#__PURE__*/_jsx("circle", {
|
|
124
125
|
className: classNameElement('arc-gray'),
|
|
125
126
|
stroke: "#E0E3E8",
|
|
126
|
-
strokeDasharray:
|
|
127
|
-
strokeDashoffset:
|
|
127
|
+
strokeDasharray: "".concat(grayArcStrokeDasharray),
|
|
128
|
+
strokeDashoffset: "".concat(grayArcStrokeDashoffset),
|
|
128
129
|
cx: "50%",
|
|
129
130
|
cy: "50%",
|
|
130
131
|
fill: "none",
|
|
131
132
|
r: "28",
|
|
132
|
-
strokeWidth:
|
|
133
|
+
strokeWidth: "".concat(trackWidth, "px")
|
|
133
134
|
});
|
|
134
135
|
|
|
135
136
|
const indicator = /*#__PURE__*/_jsx("svg", {
|
|
136
|
-
height:
|
|
137
|
+
height: "".concat(sizePx, "px"),
|
|
137
138
|
version: "1.1",
|
|
138
139
|
viewBox: "0 0 66 66",
|
|
139
|
-
width:
|
|
140
|
+
width: "".concat(sizePx, "px"),
|
|
140
141
|
"data-testid": "circular-indicator"
|
|
141
142
|
}, void 0, /*#__PURE__*/_jsx("defs", {}, void 0, /*#__PURE__*/_jsx("linearGradient", {
|
|
142
143
|
id: "grad1",
|
|
@@ -190,10 +191,10 @@ const CircularProgressIndicator = ({
|
|
|
190
191
|
id: "inverseL",
|
|
191
192
|
viewBox: "0 0 5 10",
|
|
192
193
|
refX: "0.5",
|
|
193
|
-
refY:
|
|
194
|
+
refY: "".concat(markerRefY),
|
|
194
195
|
markerUnits: "strokeWidth",
|
|
195
196
|
markerWidth: "0.5",
|
|
196
|
-
markerHeight:
|
|
197
|
+
markerHeight: "".concat(markerHeight),
|
|
197
198
|
orient: "auto"
|
|
198
199
|
}, void 0, _path || (_path = /*#__PURE__*/_jsx("path", {
|
|
199
200
|
d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
|
|
@@ -205,7 +206,7 @@ const CircularProgressIndicator = ({
|
|
|
205
206
|
refY: "5",
|
|
206
207
|
markerUnits: "strokeWidth",
|
|
207
208
|
markerWidth: "0.7",
|
|
208
|
-
markerHeight:
|
|
209
|
+
markerHeight: "".concat(markerHeight)
|
|
209
210
|
}, void 0, _path2 || (_path2 = /*#__PURE__*/_jsx("path", {
|
|
210
211
|
d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
|
|
211
212
|
fill: "#FFF"
|
|
@@ -218,14 +219,14 @@ const CircularProgressIndicator = ({
|
|
|
218
219
|
className: classNameElement('arc-blue'),
|
|
219
220
|
d: "M30,5 C17.536025,6 6,17.536027 5,31",
|
|
220
221
|
stroke: "#5594e2",
|
|
221
|
-
strokeWidth:
|
|
222
|
+
strokeWidth: "".concat(strokeWidth - 0.5, "px"),
|
|
222
223
|
strokeLinecap: "round",
|
|
223
224
|
"data-testid": "circular-indicator-blue-arc"
|
|
224
225
|
}), /*#__PURE__*/_jsx("path", {
|
|
225
226
|
className: classNameElement('arc-white'),
|
|
226
227
|
d: "M33,5 C17.536027,5 5,17.536027 5,33",
|
|
227
228
|
stroke: "#FFF",
|
|
228
|
-
strokeWidth:
|
|
229
|
+
strokeWidth: "".concat(strokeWidth + 2, "px"),
|
|
229
230
|
markerStart: "url(#inverseR)",
|
|
230
231
|
markerEnd: "url(#inverseL)"
|
|
231
232
|
}), grayArc));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-circular-progress-indicator",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Circular progress indicator",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -36,9 +36,13 @@
|
|
|
36
36
|
"build": "node ../../scripts/build/build.js"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
40
|
-
"@elliemae/ds-tooltip": "2.0.0-alpha.
|
|
41
|
-
"react-desc": "
|
|
39
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.12",
|
|
40
|
+
"@elliemae/ds-tooltip": "2.0.0-alpha.12",
|
|
41
|
+
"react-desc": "~4.1.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
45
|
+
"@testing-library/react": "~12.1.2"
|
|
42
46
|
},
|
|
43
47
|
"peerDependencies": {
|
|
44
48
|
"react": "^17.0.2",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const CircularProgressIndicator: {
|
|
3
4
|
({ size, showLabel, showTooltip, waiting, loading }: {
|
|
@@ -15,13 +16,33 @@ declare const CircularProgressIndicator: {
|
|
|
15
16
|
loading: boolean;
|
|
16
17
|
};
|
|
17
18
|
propTypes: {
|
|
19
|
+
size: {
|
|
20
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
showLabel: {
|
|
23
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
24
|
+
};
|
|
25
|
+
showTooltip: {
|
|
26
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
27
|
+
};
|
|
28
|
+
waiting: {
|
|
29
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
31
|
+
loading: {
|
|
32
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
declare const CircularProgressIndicatorWithSchema: {
|
|
37
|
+
(props?: {
|
|
18
38
|
size: any;
|
|
19
39
|
showLabel: any;
|
|
20
40
|
showTooltip: any;
|
|
21
41
|
waiting: any;
|
|
22
42
|
loading: any;
|
|
23
|
-
};
|
|
43
|
+
} | undefined): JSX.Element;
|
|
44
|
+
propTypes: unknown;
|
|
45
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
24
46
|
};
|
|
25
|
-
declare const CircularProgressIndicatorWithSchema: any;
|
|
26
47
|
export { CircularProgressIndicatorWithSchema };
|
|
27
48
|
export default CircularProgressIndicator;
|
package/cjs/package.json
DELETED