@instructure/ui-progress 11.7.3 → 11.7.4-pr-snapshot-1781695314229

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 (45) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE.md +1 -0
  3. package/{lib/ProgressBar/v2/props.js → babel.config.cjs} +12 -7
  4. package/es/ProgressBar/v1/index.js +5 -4
  5. package/es/ProgressBar/v2/index.js +4 -3
  6. package/es/ProgressCircle/v1/index.js +5 -4
  7. package/es/ProgressCircle/v2/index.js +4 -3
  8. package/es/exports/a.js +3 -2
  9. package/es/exports/b.js +3 -2
  10. package/package.json +13 -18
  11. package/src/ProgressBar/v1/index.tsx +4 -3
  12. package/src/ProgressBar/v2/index.tsx +3 -2
  13. package/src/ProgressCircle/v1/index.tsx +4 -3
  14. package/src/ProgressCircle/v2/index.tsx +3 -2
  15. package/src/exports/a.ts +2 -2
  16. package/src/exports/b.ts +2 -2
  17. package/tsconfig.build.tsbuildinfo +1 -1
  18. package/types/ProgressBar/v1/index.d.ts +1 -0
  19. package/types/ProgressBar/v1/index.d.ts.map +1 -1
  20. package/types/ProgressBar/v2/index.d.ts +1 -0
  21. package/types/ProgressBar/v2/index.d.ts.map +1 -1
  22. package/types/ProgressCircle/v1/index.d.ts +1 -0
  23. package/types/ProgressCircle/v1/index.d.ts.map +1 -1
  24. package/types/ProgressCircle/v2/index.d.ts +1 -0
  25. package/types/ProgressCircle/v2/index.d.ts.map +1 -1
  26. package/types/exports/a.d.ts +2 -2
  27. package/types/exports/a.d.ts.map +1 -1
  28. package/types/exports/b.d.ts +2 -2
  29. package/types/exports/b.d.ts.map +1 -1
  30. package/lib/ProgressBar/v1/index.js +0 -137
  31. package/lib/ProgressBar/v1/props.js +0 -31
  32. package/lib/ProgressBar/v1/styles.js +0 -216
  33. package/lib/ProgressBar/v1/theme.js +0 -100
  34. package/lib/ProgressBar/v2/index.js +0 -136
  35. package/lib/ProgressBar/v2/styles.js +0 -243
  36. package/lib/ProgressCircle/v1/index.js +0 -182
  37. package/lib/ProgressCircle/v1/props.js +0 -31
  38. package/lib/ProgressCircle/v1/styles.js +0 -357
  39. package/lib/ProgressCircle/v1/theme.js +0 -146
  40. package/lib/ProgressCircle/v2/index.js +0 -181
  41. package/lib/ProgressCircle/v2/props.js +0 -31
  42. package/lib/ProgressCircle/v2/styles.js +0 -357
  43. package/lib/exports/a.js +0 -19
  44. package/lib/exports/b.js +0 -19
  45. package/lib/package.json +0 -1
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- const allowedProps = exports.allowedProps = ['screenReaderLabel', 'size', 'valueMax', 'valueNow', 'formatScreenReaderValue', 'renderValue', 'color', 'meterColor', 'margin', 'elementRef', 'as', 'shouldAnimateOnMount', 'animationDelay'];
@@ -1,357 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = (componentTheme, props, _sharedTokens, state) => {
42
- const {
43
- size,
44
- color,
45
- meterColor,
46
- valueNow = 0,
47
- valueMax = 100
48
- } = props;
49
- const {
50
- shouldAnimateOnMount
51
- } = state;
52
- const getMeterColorClassName = typeof meterColor === 'function' ? meterColor({
53
- valueNow,
54
- valueMax
55
- }) : meterColor;
56
- const getCircumference = () => {
57
- const camelSize = size === 'x-small' ? 'xSmall' : size;
58
- // get the circumference of the meter circle
59
- return parseFloat(componentTheme[`${camelSize}Circumference`]);
60
- };
61
- const getRadii = () => {
62
- const camelSize = size === 'x-small' ? 'xSmall' : size;
63
- return {
64
- radius: componentTheme[`${camelSize}Radius`],
65
- borderOffsetRadius: componentTheme[`${camelSize}BorderOffset`]
66
- };
67
- };
68
- const getDashOffset = () => {
69
- // send the stroke-dashoffset to the meter circle, checking
70
- // to make sure current value doesn't exceed max value
71
- if (valueNow < valueMax) {
72
- const circumference = getCircumference();
73
- // figure out how much offset to give the stroke to show the % complete
74
- return circumference - valueNow / valueMax * circumference;
75
- } else {
76
- return 0;
77
- }
78
- };
79
-
80
- /*
81
- Using !important on the meter shouldAnimateOnMount versions
82
- to guarantee that the bars will start showing 0 if the
83
- animateOnMount prop is set
84
- */
85
- const sizeVariants = {
86
- 'x-small': {
87
- progressCircle: {
88
- width: componentTheme.xSmallSize,
89
- height: componentTheme.xSmallSize
90
- },
91
- circle: {
92
- width: componentTheme.xSmallSize,
93
- height: componentTheme.xSmallSize
94
- },
95
- value: {
96
- padding: '0.5rem'
97
- },
98
- border: {
99
- transformOrigin: `${componentTheme.xSmallTransform} ${componentTheme.xSmallTransform}`
100
- },
101
- track: {
102
- transformOrigin: `${componentTheme.xSmallTransform} ${componentTheme.xSmallTransform}`,
103
- strokeWidth: componentTheme.xSmallStrokeWidth
104
- },
105
- meter: {
106
- strokeWidth: componentTheme.xSmallStrokeWidth,
107
- strokeDasharray: componentTheme.xSmallCircumference,
108
- ...(shouldAnimateOnMount && {
109
- strokeDashoffset: `${componentTheme.xSmallCircumference} !important`
110
- })
111
- }
112
- },
113
- small: {
114
- progressCircle: {
115
- width: componentTheme.smallSize,
116
- height: componentTheme.smallSize
117
- },
118
- circle: {
119
- width: componentTheme.smallSize,
120
- height: componentTheme.smallSize
121
- },
122
- value: {},
123
- border: {
124
- transformOrigin: `${componentTheme.smallTransform} ${componentTheme.smallTransform}`
125
- },
126
- track: {
127
- transformOrigin: `${componentTheme.smallTransform} ${componentTheme.smallTransform}`,
128
- strokeWidth: componentTheme.smallStrokeWidth
129
- },
130
- meter: {
131
- strokeWidth: componentTheme.smallStrokeWidth,
132
- strokeDasharray: componentTheme.smallCircumference,
133
- ...(shouldAnimateOnMount && {
134
- strokeDashoffset: `${componentTheme.smallCircumference} !important`
135
- })
136
- }
137
- },
138
- medium: {
139
- progressCircle: {
140
- width: componentTheme.mediumSize,
141
- height: componentTheme.mediumSize
142
- },
143
- circle: {
144
- width: componentTheme.mediumSize,
145
- height: componentTheme.mediumSize
146
- },
147
- value: {},
148
- border: {
149
- transformOrigin: `${componentTheme.mediumTransform} ${componentTheme.mediumTransform}`
150
- },
151
- track: {
152
- transformOrigin: `${componentTheme.mediumTransform} ${componentTheme.mediumTransform}`,
153
- strokeWidth: componentTheme.mediumStrokeWidth
154
- },
155
- meter: {
156
- strokeWidth: componentTheme.mediumStrokeWidth,
157
- strokeDasharray: componentTheme.mediumCircumference,
158
- ...(shouldAnimateOnMount && {
159
- strokeDashoffset: `${componentTheme.mediumCircumference} !important`
160
- })
161
- }
162
- },
163
- large: {
164
- progressCircle: {
165
- width: componentTheme.largeSize,
166
- height: componentTheme.largeSize
167
- },
168
- circle: {
169
- width: componentTheme.largeSize,
170
- height: componentTheme.largeSize
171
- },
172
- value: {},
173
- border: {
174
- transformOrigin: `${componentTheme.largeTransform} ${componentTheme.largeTransform}`
175
- },
176
- track: {
177
- transformOrigin: `${componentTheme.largeTransform} ${componentTheme.largeTransform}`,
178
- strokeWidth: componentTheme.largeStrokeWidth
179
- },
180
- meter: {
181
- strokeWidth: componentTheme.largeStrokeWidth,
182
- strokeDasharray: componentTheme.largeCircumference,
183
- ...(shouldAnimateOnMount && {
184
- strokeDashoffset: `${componentTheme.largeCircumference} !important`
185
- })
186
- }
187
- }
188
- };
189
- const colorVariants = {
190
- primary: {
191
- track: {
192
- stroke: componentTheme.trackColor
193
- },
194
- value: {
195
- color: componentTheme.color
196
- },
197
- border: {
198
- stroke: componentTheme.trackBorderColor
199
- }
200
- },
201
- 'primary-inverse': {
202
- track: {
203
- stroke: componentTheme.trackColorInverse
204
- },
205
- value: {
206
- color: componentTheme.colorInverse
207
- },
208
- border: {
209
- stroke: componentTheme.trackBorderColorInverse
210
- }
211
- }
212
- };
213
- const meterColorVariants = {
214
- primary: {
215
- brand: {
216
- stroke: componentTheme.meterColorBrand
217
- },
218
- info: {
219
- stroke: componentTheme.meterColorInfo
220
- },
221
- warning: {
222
- stroke: componentTheme.meterColorWarning
223
- },
224
- danger: {
225
- stroke: componentTheme.meterColorDanger
226
- },
227
- alert: {
228
- stroke: componentTheme.meterColorAlert
229
- },
230
- success: {
231
- stroke: componentTheme.meterColorSuccess
232
- }
233
- },
234
- 'primary-inverse': {
235
- brand: {
236
- stroke: componentTheme.meterColorBrandInverse
237
- },
238
- info: {
239
- stroke: componentTheme.meterColorInfoInverse
240
- },
241
- warning: {
242
- stroke: componentTheme.meterColorWarningInverse
243
- },
244
- danger: {
245
- stroke: componentTheme.meterColorDangerInverse
246
- },
247
- alert: {
248
- stroke: componentTheme.meterColorAlertInverse
249
- },
250
- success: {
251
- stroke: componentTheme.meterColorSuccessInverse
252
- }
253
- }
254
- };
255
- return {
256
- progressCircle: {
257
- label: 'progressCircle',
258
- display: 'inline-block',
259
- verticalAlign: 'middle',
260
- position: 'relative',
261
- overflow: 'hidden',
262
- /*
263
- Seems like a good idea to reset font-size because
264
- the SVG uses ems and might inherit a container's
265
- font-size
266
- */
267
- fontSize: '1rem',
268
- fontFamily: componentTheme.fontFamily,
269
- fontWeight: componentTheme.fontWeight,
270
- lineHeight: componentTheme.lineHeight,
271
- ...sizeVariants[size].progressCircle
272
- },
273
- center: {
274
- label: 'progressCircle__center',
275
- transition: 'all 0.5s',
276
- transitionDelay: '1s',
277
- display: 'block',
278
- position: 'absolute',
279
- transform: 'translate3d(0, 0, 0)',
280
- top: 0,
281
- left: 0,
282
- height: '100%',
283
- width: '100%',
284
- borderRadius: '50%',
285
- ...(shouldAnimateOnMount && {
286
- opacity: 0,
287
- transform: 'translate3d(0, 10%, 0)'
288
- })
289
- },
290
- value: {
291
- label: 'progressCircle__value',
292
- boxSizing: 'border-box',
293
- wordWrap: 'break-word',
294
- textAlign: 'center',
295
- borderRadius: '50%',
296
- display: 'flex',
297
- alignItems: 'center',
298
- justifyContent: 'center',
299
- padding: '1.5rem',
300
- width: '100%',
301
- height: '100%',
302
- lineHeight: 1,
303
- ...sizeVariants[size].value,
304
- ...colorVariants[color].value
305
- },
306
- circle: {
307
- label: 'progressCircle__circle',
308
- transform: 'rotate(-90deg)',
309
- display: 'block',
310
- position: 'absolute',
311
- top: 0,
312
- left: 0,
313
- ...sizeVariants[size].circle
314
- },
315
- track: {
316
- label: 'progressCircle__track',
317
- fill: 'none',
318
- opacity: 1,
319
- transition: 'all 0.5s',
320
- transitionDelay: '0.2s',
321
- transform: 'translate3d(0, 0, 0)',
322
- ...sizeVariants[size].track,
323
- ...colorVariants[color].track,
324
- ...(shouldAnimateOnMount && {
325
- opacity: 0,
326
- transform: 'translate3d(0, 0, 0)'
327
- })
328
- },
329
- border: {
330
- label: 'progressCircle__border',
331
- fill: 'none',
332
- opacity: 1,
333
- transition: 'all 0.5s',
334
- transform: 'translate3d(0, 0, 0) scale(1)',
335
- ...sizeVariants[size].border,
336
- ...colorVariants[color].border,
337
- ...(shouldAnimateOnMount && {
338
- opacity: 0,
339
- transform: 'translate3d(0, 0, 0) scale(0.75)'
340
- })
341
- },
342
- meter: {
343
- label: 'progressCircle__meter',
344
- fill: 'none',
345
- transition: 'stroke-dashoffset 1s',
346
- transform: 'translate3d(0, 0, 0)',
347
- ...sizeVariants[size].meter,
348
- ...(getMeterColorClassName && meterColorVariants[color][getMeterColorClassName]),
349
- ...(shouldAnimateOnMount && {
350
- opacity: 0
351
- })
352
- },
353
- radii: getRadii(),
354
- dashOffset: getDashOffset()
355
- };
356
- };
357
- var _default = exports.default = generateStyle;
package/lib/exports/a.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ProgressBar", {
7
- enumerable: true,
8
- get: function () {
9
- return _v.ProgressBar;
10
- }
11
- });
12
- Object.defineProperty(exports, "ProgressCircle", {
13
- enumerable: true,
14
- get: function () {
15
- return _v2.ProgressCircle;
16
- }
17
- });
18
- var _v = require("../ProgressBar/v1");
19
- var _v2 = require("../ProgressCircle/v1");
package/lib/exports/b.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ProgressBar", {
7
- enumerable: true,
8
- get: function () {
9
- return _v.ProgressBar;
10
- }
11
- });
12
- Object.defineProperty(exports, "ProgressCircle", {
13
- enumerable: true,
14
- get: function () {
15
- return _v2.ProgressCircle;
16
- }
17
- });
18
- var _v = require("../ProgressBar/v2");
19
- var _v2 = require("../ProgressCircle/v2");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}