@elliemae/ds-circular-progress-indicator 3.0.0-next.2 → 3.0.0-next.3
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/DSCircularProgressIndicator.js +246 -0
- package/dist/cjs/DSCircularProgressIndicator.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/v2/DSCircularIndeterminateIndicator.js +121 -0
- package/dist/cjs/v2/DSCircularIndeterminateIndicator.js.map +7 -0
- package/dist/cjs/v2/constants.js +65 -0
- package/dist/cjs/v2/constants.js.map +7 -0
- package/dist/cjs/v2/index.js +36 -0
- package/dist/cjs/v2/index.js.map +7 -0
- package/dist/cjs/v2/react-desc-prop-types.js +83 -0
- package/dist/cjs/v2/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/v2/styled.js +137 -0
- package/dist/cjs/v2/styled.js.map +7 -0
- package/dist/esm/DSCircularProgressIndicator.js +217 -0
- package/dist/esm/DSCircularProgressIndicator.js.map +7 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/v2/DSCircularIndeterminateIndicator.js +97 -0
- package/dist/esm/v2/DSCircularIndeterminateIndicator.js.map +7 -0
- package/dist/esm/v2/constants.js +36 -0
- package/dist/esm/v2/constants.js.map +7 -0
- package/dist/esm/v2/index.js +10 -0
- package/dist/esm/v2/index.js.map +7 -0
- package/dist/esm/v2/react-desc-prop-types.js +56 -0
- package/dist/esm/v2/react-desc-prop-types.js.map +7 -0
- package/dist/esm/v2/styled.js +108 -0
- package/dist/esm/v2/styled.js.map +7 -0
- package/package.json +42 -20
- package/cjs/DSCircularProgressIndicator.js +0 -268
- package/cjs/index.js +0 -11
- package/esm/DSCircularProgressIndicator.js +0 -258
- package/esm/index.js +0 -1
- package/types/DSCircularProgressIndicator.d.ts +0 -48
- package/types/index.d.ts +0 -1
- package/types/tests/DSCircularProgressIndicator.test.d.ts +0 -1
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { PropTypes, describe } from 'react-desc';
|
|
4
|
-
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
5
|
-
import DSTooltip from '@elliemae/ds-tooltip';
|
|
6
|
-
|
|
7
|
-
var _path, _path2;
|
|
8
|
-
const {
|
|
9
|
-
classNameBlock,
|
|
10
|
-
classNameElement
|
|
11
|
-
} = convertPropToCssClassName('circular-progress-indicator');
|
|
12
|
-
|
|
13
|
-
const CircularProgressIndicator = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
size,
|
|
16
|
-
showLabel,
|
|
17
|
-
showTooltip,
|
|
18
|
-
waiting,
|
|
19
|
-
loading
|
|
20
|
-
} = _ref;
|
|
21
|
-
const waitingLabel = 'Waiting...';
|
|
22
|
-
const loadingLabel = 'Loading...';
|
|
23
|
-
const currentLabel = waiting && !loading ? waitingLabel : loadingLabel;
|
|
24
|
-
let sizePx;
|
|
25
|
-
let sizeLabel;
|
|
26
|
-
let strokeWidth;
|
|
27
|
-
let trackWidth;
|
|
28
|
-
let markerHeight = '0.7';
|
|
29
|
-
let markerRefY = '4.8';
|
|
30
|
-
let grayArcStrokeDasharray = '45 170';
|
|
31
|
-
let grayArcStrokeDashoffset = '127.5';
|
|
32
|
-
|
|
33
|
-
switch (size.toUpperCase()) {
|
|
34
|
-
case 'XS':
|
|
35
|
-
sizePx = 8;
|
|
36
|
-
sizeLabel = 12;
|
|
37
|
-
strokeWidth = 10;
|
|
38
|
-
trackWidth = 3;
|
|
39
|
-
markerHeight = '1';
|
|
40
|
-
grayArcStrokeDasharray = '46 174';
|
|
41
|
-
grayArcStrokeDashoffset = '133';
|
|
42
|
-
break;
|
|
43
|
-
|
|
44
|
-
case 'S':
|
|
45
|
-
sizePx = 16;
|
|
46
|
-
sizeLabel = 12;
|
|
47
|
-
strokeWidth = 8;
|
|
48
|
-
trackWidth = 3;
|
|
49
|
-
markerHeight = '1';
|
|
50
|
-
grayArcStrokeDasharray = '46 174';
|
|
51
|
-
grayArcStrokeDashoffset = '133';
|
|
52
|
-
break;
|
|
53
|
-
|
|
54
|
-
case 'M':
|
|
55
|
-
sizePx = 24;
|
|
56
|
-
sizeLabel = 12;
|
|
57
|
-
strokeWidth = 7;
|
|
58
|
-
trackWidth = 3;
|
|
59
|
-
markerHeight = '1';
|
|
60
|
-
markerRefY = '5.5';
|
|
61
|
-
grayArcStrokeDasharray = '46 174';
|
|
62
|
-
grayArcStrokeDashoffset = '133';
|
|
63
|
-
break;
|
|
64
|
-
|
|
65
|
-
case 'L':
|
|
66
|
-
sizePx = 32;
|
|
67
|
-
sizeLabel = 13;
|
|
68
|
-
strokeWidth = 6;
|
|
69
|
-
trackWidth = 3;
|
|
70
|
-
markerRefY = '5';
|
|
71
|
-
break;
|
|
72
|
-
|
|
73
|
-
case 'XL':
|
|
74
|
-
sizePx = 48;
|
|
75
|
-
sizeLabel = 14;
|
|
76
|
-
strokeWidth = 5;
|
|
77
|
-
trackWidth = 1;
|
|
78
|
-
break;
|
|
79
|
-
|
|
80
|
-
case 'XXL':
|
|
81
|
-
sizePx = 56;
|
|
82
|
-
sizeLabel = 16;
|
|
83
|
-
strokeWidth = 4;
|
|
84
|
-
trackWidth = 1;
|
|
85
|
-
break;
|
|
86
|
-
|
|
87
|
-
case 'XXXL':
|
|
88
|
-
sizePx = 64;
|
|
89
|
-
sizeLabel = 16;
|
|
90
|
-
strokeWidth = 5;
|
|
91
|
-
trackWidth = 2;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const labelText = /*#__PURE__*/_jsx("p", {
|
|
96
|
-
"data-testid": "circular-indicator-label",
|
|
97
|
-
className: classNameElement('label'),
|
|
98
|
-
style: {
|
|
99
|
-
fontSize: "".concat(sizeLabel, "px")
|
|
100
|
-
}
|
|
101
|
-
}, void 0, currentLabel); // Only adds the tooltip if sizePx < 17 or showTooltip is true
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const buildIndicator = Component => sizePx < 17 || showTooltip ? /*#__PURE__*/_jsx(DSTooltip, {
|
|
105
|
-
containerProps: {
|
|
106
|
-
id: 'ds-circular-progress-indicator',
|
|
107
|
-
'data-testid': 'circular-indicator-title'
|
|
108
|
-
},
|
|
109
|
-
interactionType: "hover",
|
|
110
|
-
title: currentLabel,
|
|
111
|
-
triggerComponent: Component,
|
|
112
|
-
placement: "bottom"
|
|
113
|
-
}) : Component;
|
|
114
|
-
|
|
115
|
-
const grayTrack = /*#__PURE__*/_jsx("circle", {
|
|
116
|
-
className: classNameElement('track'),
|
|
117
|
-
cx: "50%",
|
|
118
|
-
cy: "50%",
|
|
119
|
-
fill: "none",
|
|
120
|
-
r: "28",
|
|
121
|
-
strokeWidth: "".concat(trackWidth, "px")
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const grayArc = /*#__PURE__*/_jsx("circle", {
|
|
125
|
-
className: classNameElement('arc-gray'),
|
|
126
|
-
stroke: "#E0E3E8",
|
|
127
|
-
strokeDasharray: "".concat(grayArcStrokeDasharray),
|
|
128
|
-
strokeDashoffset: "".concat(grayArcStrokeDashoffset),
|
|
129
|
-
cx: "50%",
|
|
130
|
-
cy: "50%",
|
|
131
|
-
fill: "none",
|
|
132
|
-
r: "28",
|
|
133
|
-
strokeWidth: "".concat(trackWidth, "px")
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
const indicator = /*#__PURE__*/_jsx("svg", {
|
|
137
|
-
height: "".concat(sizePx, "px"),
|
|
138
|
-
version: "1.1",
|
|
139
|
-
viewBox: "0 0 66 66",
|
|
140
|
-
width: "".concat(sizePx, "px"),
|
|
141
|
-
"data-testid": "circular-indicator"
|
|
142
|
-
}, void 0, /*#__PURE__*/_jsx("defs", {}, void 0, /*#__PURE__*/_jsx("linearGradient", {
|
|
143
|
-
id: "grad1",
|
|
144
|
-
x1: "0%",
|
|
145
|
-
x2: "100%",
|
|
146
|
-
y1: "100%",
|
|
147
|
-
y2: "0%"
|
|
148
|
-
}, void 0, /*#__PURE__*/_jsx("stop", {
|
|
149
|
-
offset: "0%",
|
|
150
|
-
style: {
|
|
151
|
-
stopColor: '#E0E3E8',
|
|
152
|
-
stopOpacity: 1
|
|
153
|
-
}
|
|
154
|
-
}), /*#__PURE__*/_jsx("stop", {
|
|
155
|
-
offset: "89%",
|
|
156
|
-
style: {
|
|
157
|
-
stopColor: '#5594e2',
|
|
158
|
-
stopOpacity: 1
|
|
159
|
-
}
|
|
160
|
-
}), /*#__PURE__*/_jsx("stop", {
|
|
161
|
-
offset: "100%",
|
|
162
|
-
style: {
|
|
163
|
-
stopColor: '#5594e2',
|
|
164
|
-
stopOpacity: 1
|
|
165
|
-
}
|
|
166
|
-
})), /*#__PURE__*/_jsx("linearGradient", {
|
|
167
|
-
id: "grad2",
|
|
168
|
-
x1: "0%",
|
|
169
|
-
x2: "100%",
|
|
170
|
-
y1: "100%",
|
|
171
|
-
y2: "0%"
|
|
172
|
-
}, void 0, /*#__PURE__*/_jsx("stop", {
|
|
173
|
-
offset: "0%",
|
|
174
|
-
style: {
|
|
175
|
-
stopColor: '#5594e2',
|
|
176
|
-
stopOpacity: 1
|
|
177
|
-
}
|
|
178
|
-
}), /*#__PURE__*/_jsx("stop", {
|
|
179
|
-
offset: "11%",
|
|
180
|
-
style: {
|
|
181
|
-
stopColor: '#5594e2',
|
|
182
|
-
stopOpacity: 1
|
|
183
|
-
}
|
|
184
|
-
}), /*#__PURE__*/_jsx("stop", {
|
|
185
|
-
offset: "100%",
|
|
186
|
-
style: {
|
|
187
|
-
stopColor: '#E0E3E8',
|
|
188
|
-
stopOpacity: 1
|
|
189
|
-
}
|
|
190
|
-
})), /*#__PURE__*/_jsx("marker", {
|
|
191
|
-
id: "inverseL",
|
|
192
|
-
viewBox: "0 0 5 10",
|
|
193
|
-
refX: "0.5",
|
|
194
|
-
refY: "".concat(markerRefY),
|
|
195
|
-
markerUnits: "strokeWidth",
|
|
196
|
-
markerWidth: "0.5",
|
|
197
|
-
markerHeight: "".concat(markerHeight),
|
|
198
|
-
orient: "auto"
|
|
199
|
-
}, void 0, _path || (_path = /*#__PURE__*/_jsx("path", {
|
|
200
|
-
d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
|
|
201
|
-
fill: "#FFF"
|
|
202
|
-
}))), /*#__PURE__*/_jsx("marker", {
|
|
203
|
-
id: "inverseR",
|
|
204
|
-
viewBox: "0 0 5 10",
|
|
205
|
-
refX: "0",
|
|
206
|
-
refY: "5",
|
|
207
|
-
markerUnits: "strokeWidth",
|
|
208
|
-
markerWidth: "0.7",
|
|
209
|
-
markerHeight: "".concat(markerHeight)
|
|
210
|
-
}, void 0, _path2 || (_path2 = /*#__PURE__*/_jsx("path", {
|
|
211
|
-
d: "M 0 0 L 6 0 A 5 5 0 0 0 6 10 L 0 10 z",
|
|
212
|
-
fill: "#FFF"
|
|
213
|
-
})))), grayTrack, !waiting && /*#__PURE__*/_jsx("g", {
|
|
214
|
-
fill: "none",
|
|
215
|
-
fillRule: "evenodd",
|
|
216
|
-
stroke: "none",
|
|
217
|
-
strokeWidth: "1"
|
|
218
|
-
}, void 0, /*#__PURE__*/_jsx("path", {
|
|
219
|
-
className: classNameElement('arc-blue'),
|
|
220
|
-
d: "M30,5 C17.536025,6 6,17.536027 5,31",
|
|
221
|
-
stroke: "#5594e2",
|
|
222
|
-
strokeWidth: "".concat(strokeWidth - 0.5, "px"),
|
|
223
|
-
strokeLinecap: "round",
|
|
224
|
-
"data-testid": "circular-indicator-blue-arc"
|
|
225
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
226
|
-
className: classNameElement('arc-white'),
|
|
227
|
-
d: "M33,5 C17.536027,5 5,17.536027 5,33",
|
|
228
|
-
stroke: "#FFF",
|
|
229
|
-
strokeWidth: "".concat(strokeWidth + 2, "px"),
|
|
230
|
-
markerStart: "url(#inverseR)",
|
|
231
|
-
markerEnd: "url(#inverseL)"
|
|
232
|
-
}), grayArc));
|
|
233
|
-
|
|
234
|
-
return /*#__PURE__*/_jsx("div", {
|
|
235
|
-
className: classNameBlock('wrapper'),
|
|
236
|
-
role: "status",
|
|
237
|
-
"aria-hidden": waiting || loading ? 'false' : 'true'
|
|
238
|
-
}, void 0, buildIndicator(indicator), showLabel && labelText);
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
CircularProgressIndicator.defaultProps = {
|
|
242
|
-
size: 'm',
|
|
243
|
-
showLabel: false,
|
|
244
|
-
showTooltip: false,
|
|
245
|
-
waiting: false,
|
|
246
|
-
loading: false
|
|
247
|
-
};
|
|
248
|
-
const circularProgressIndicatorProps = {
|
|
249
|
-
size: PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl']).description('Defines the size of the indicator').defaultValue('m'),
|
|
250
|
-
showLabel: PropTypes.bool.description('Wheter the indicator displays its state on a label or not').defaultValue(false),
|
|
251
|
-
showTooltip: PropTypes.bool.description('Wheter the indicator displays its state on a tooltip or not').defaultValue(false),
|
|
252
|
-
waiting: PropTypes.bool.description('Defines the state of the indicator as Waiting and only displays the gray track').defaultValue(false),
|
|
253
|
-
loading: PropTypes.bool.description('Defines the state of the indicator as Loading and displays a blue spinner animation').defaultValue(false)
|
|
254
|
-
};
|
|
255
|
-
const CircularProgressIndicatorWithSchema = describe(CircularProgressIndicator);
|
|
256
|
-
CircularProgressIndicatorWithSchema.propTypes = circularProgressIndicatorProps;
|
|
257
|
-
|
|
258
|
-
export { CircularProgressIndicatorWithSchema, CircularProgressIndicator as default };
|
package/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CircularProgressIndicatorWithSchema, default as DSCircularProgressIndicator, default } from './DSCircularProgressIndicator.js';
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
declare const CircularProgressIndicator: {
|
|
4
|
-
({ size, showLabel, showTooltip, waiting, loading }: {
|
|
5
|
-
size: any;
|
|
6
|
-
showLabel: any;
|
|
7
|
-
showTooltip: any;
|
|
8
|
-
waiting: any;
|
|
9
|
-
loading: any;
|
|
10
|
-
}): JSX.Element;
|
|
11
|
-
defaultProps: {
|
|
12
|
-
size: string;
|
|
13
|
-
showLabel: boolean;
|
|
14
|
-
showTooltip: boolean;
|
|
15
|
-
waiting: boolean;
|
|
16
|
-
loading: boolean;
|
|
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?: {
|
|
38
|
-
size: any;
|
|
39
|
-
showLabel: any;
|
|
40
|
-
showTooltip: any;
|
|
41
|
-
waiting: any;
|
|
42
|
-
loading: any;
|
|
43
|
-
} | undefined): JSX.Element;
|
|
44
|
-
propTypes: unknown;
|
|
45
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
46
|
-
};
|
|
47
|
-
export { CircularProgressIndicatorWithSchema };
|
|
48
|
-
export default CircularProgressIndicator;
|
package/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, default as DSCircularProgressIndicator, CircularProgressIndicatorWithSchema, } from './DSCircularProgressIndicator';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|