dce-reactkit 1.0.18 → 2.0.0

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 (106) hide show
  1. package/.eslintrc.js +95 -0
  2. package/lib/components/LoadingSpinner.d.ts +7 -0
  3. package/lib/components/LoadingSpinner.js +39 -0
  4. package/lib/components/LoadingSpinner.js.map +1 -0
  5. package/lib/components/Modal.d.ts +69 -0
  6. package/lib/components/Modal.js +311 -0
  7. package/lib/components/Modal.js.map +1 -0
  8. package/lib/helpers/abbreviate.d.ts +9 -0
  9. package/lib/helpers/abbreviate.js +21 -0
  10. package/lib/helpers/abbreviate.js.map +1 -0
  11. package/lib/helpers/avg.d.ts +8 -0
  12. package/lib/helpers/avg.js +24 -0
  13. package/lib/helpers/avg.js.map +1 -0
  14. package/lib/helpers/ceilToNumDecimals.d.ts +9 -0
  15. package/lib/helpers/ceilToNumDecimals.js +15 -0
  16. package/lib/helpers/ceilToNumDecimals.js.map +1 -0
  17. package/lib/helpers/floorToNumDecimals.d.ts +9 -0
  18. package/lib/helpers/floorToNumDecimals.js +15 -0
  19. package/lib/helpers/floorToNumDecimals.js.map +1 -0
  20. package/lib/helpers/forceNumIntoBounds.d.ts +10 -0
  21. package/lib/helpers/forceNumIntoBounds.js +15 -0
  22. package/lib/helpers/forceNumIntoBounds.js.map +1 -0
  23. package/lib/helpers/padDecimalZeros.d.ts +10 -0
  24. package/lib/helpers/padDecimalZeros.js +30 -0
  25. package/lib/helpers/padDecimalZeros.js.map +1 -0
  26. package/lib/helpers/padZerosLeft.d.ts +9 -0
  27. package/lib/helpers/padZerosLeft.js +21 -0
  28. package/lib/helpers/padZerosLeft.js.map +1 -0
  29. package/lib/helpers/roundToNumDecimals.d.ts +9 -0
  30. package/lib/helpers/roundToNumDecimals.js +15 -0
  31. package/lib/helpers/roundToNumDecimals.js.map +1 -0
  32. package/lib/helpers/sum.d.ts +8 -0
  33. package/lib/helpers/sum.js +15 -0
  34. package/lib/helpers/sum.js.map +1 -0
  35. package/lib/helpers/waitMs.d.ts +7 -0
  36. package/lib/helpers/waitMs.js +55 -0
  37. package/lib/helpers/waitMs.js.map +1 -0
  38. package/lib/types/Variant.d.ts +15 -0
  39. package/lib/types/Variant.js +19 -0
  40. package/lib/types/Variant.js.map +1 -0
  41. package/package.json +22 -39
  42. package/src/components/LoadingSpinner.scss +50 -0
  43. package/src/components/LoadingSpinner.tsx +50 -0
  44. package/src/components/Modal.scss +48 -0
  45. package/src/components/Modal.tsx +391 -0
  46. package/src/helpers/abbreviate.tsx +23 -0
  47. package/src/helpers/avg.tsx +22 -0
  48. package/src/helpers/ceilToNumDecimals.tsx +13 -0
  49. package/src/helpers/floorToNumDecimals.tsx +13 -0
  50. package/src/helpers/forceNumIntoBounds.tsx +19 -0
  51. package/src/helpers/padDecimalZeros.tsx +32 -0
  52. package/src/helpers/padZerosLeft.tsx +21 -0
  53. package/src/helpers/roundToNumDecimals.tsx +13 -0
  54. package/src/helpers/sum.tsx +16 -0
  55. package/src/helpers/waitMs.tsx +12 -0
  56. package/src/types/Variant.tsx +16 -0
  57. package/tsconfig.json +24 -0
  58. package/Bar.js +0 -169
  59. package/Donut.js +0 -145
  60. package/DownloadButton.js +0 -81
  61. package/Histogram.js +0 -193
  62. package/Scatter.js +0 -162
  63. package/common/chart/Holder/index.js +0 -182
  64. package/common/chart/Holder/style.css +0 -41
  65. package/common/chart/colors.js +0 -12
  66. package/common/csvToString.js +0 -23
  67. package/common/isFloat.js +0 -14
  68. package/common/isInteger.js +0 -24
  69. package/common/math.js +0 -21
  70. package/common/validators.js +0 -18
  71. package/glyph/Adjust.js +0 -13
  72. package/glyph/Angle.js +0 -44
  73. package/glyph/Archive.js +0 -13
  74. package/glyph/Arrow.js +0 -49
  75. package/glyph/ArrowsHorizontal.js +0 -13
  76. package/glyph/ArrowsVertical.js +0 -13
  77. package/glyph/Award.js +0 -13
  78. package/glyph/Ban.js +0 -13
  79. package/glyph/Barcode.js +0 -13
  80. package/glyph/Bed.js +0 -13
  81. package/glyph/Bell.js +0 -35
  82. package/glyph/Bolt.js +0 -13
  83. package/glyph/Bookmark.js +0 -37
  84. package/glyph/Bug.js +0 -13
  85. package/glyph/Calendar.js +0 -13
  86. package/glyph/Check.js +0 -36
  87. package/glyph/Checkbox.js +0 -40
  88. package/glyph/Chevron.js +0 -63
  89. package/glyph/Circle.js +0 -15
  90. package/glyph/Cog.js +0 -13
  91. package/glyph/DoubleAngle.js +0 -45
  92. package/glyph/Download.js +0 -13
  93. package/glyph/Ellipsis.js +0 -36
  94. package/glyph/Envelope.js +0 -13
  95. package/glyph/File.js +0 -37
  96. package/glyph/IdCard.js +0 -13
  97. package/glyph/Menu.js +0 -13
  98. package/glyph/Minus.js +0 -13
  99. package/glyph/Move.js +0 -13
  100. package/glyph/Plus.js +0 -13
  101. package/glyph/Square.js +0 -47
  102. package/glyph/Teacher.js +0 -13
  103. package/glyph/TextAlign.js +0 -53
  104. package/glyph/Times.js +0 -36
  105. package/glyph/WarningTriangle.js +0 -13
  106. package/index.js +0 -1
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Round a number (floor) to a certain number of decimals
5
+ * @author Gabe Abrams
6
+ * @param num the number to round
7
+ * @param numDecimals the number of decimals to round to
8
+ * @returns rounded number
9
+ */
10
+ var floorToNumDecimals = function (num, numDecimals) {
11
+ var rounder = Math.pow(10, numDecimals);
12
+ return (Math.floor(num * rounder) / rounder);
13
+ };
14
+ exports.default = floorToNumDecimals;
15
+ //# sourceMappingURL=floorToNumDecimals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floorToNumDecimals.js","sourceRoot":"","sources":["../../src/helpers/floorToNumDecimals.tsx"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH,IAAM,kBAAkB,GAAG,UAAC,GAAW,EAAE,WAAmB;IAC1D,IAAM,OAAO,GAAG,SAAA,EAAE,EAAI,WAAW,CAAA,CAAC;IAClC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Force a number to stay within specific bounds
3
+ * @author Gabe Abrams
4
+ * @param num the number to move into the bounds
5
+ * @param min the minimum number in the bound
6
+ * @param max the maximum number in the bound
7
+ * @returns bounded number
8
+ */
9
+ declare const forceNumIntoBounds: (num: number, min: number, max: number) => number;
10
+ export default forceNumIntoBounds;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Force a number to stay within specific bounds
5
+ * @author Gabe Abrams
6
+ * @param num the number to move into the bounds
7
+ * @param min the minimum number in the bound
8
+ * @param max the maximum number in the bound
9
+ * @returns bounded number
10
+ */
11
+ var forceNumIntoBounds = function (num, min, max) {
12
+ return Math.max(min, Math.min(max, num));
13
+ };
14
+ exports.default = forceNumIntoBounds;
15
+ //# sourceMappingURL=forceNumIntoBounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forceNumIntoBounds.js","sourceRoot":"","sources":["../../src/helpers/forceNumIntoBounds.tsx"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,IAAM,kBAAkB,GAAG,UAAC,GAAW,EAAE,GAAW,EAAE,GAAW;IAC/D,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,EACH,IAAI,CAAC,GAAG,CACN,GAAG,EACH,GAAG,CACJ,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Pad a number's decimal with zeros on the right
3
+ * (e.g. 5.2 becomes 5.20 with 2 digit padding)
4
+ * @author Gabe Abrams
5
+ * @param num the number to pad
6
+ * @param numDigits the minimum number of digits after the decimal
7
+ * @returns padded number
8
+ */
9
+ declare const padDecimalZeros: (num: number, numDigits: number) => string;
10
+ export default padDecimalZeros;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Pad a number's decimal with zeros on the right
5
+ * (e.g. 5.2 becomes 5.20 with 2 digit padding)
6
+ * @author Gabe Abrams
7
+ * @param num the number to pad
8
+ * @param numDigits the minimum number of digits after the decimal
9
+ * @returns padded number
10
+ */
11
+ var padDecimalZeros = function (num, numDigits) {
12
+ // Skip if nothing to do
13
+ if (numDigits < 1) {
14
+ return;
15
+ }
16
+ // Convert to string
17
+ var out = String(num);
18
+ // Add a decimal point if there isn't one
19
+ if (!out.includes('.')) {
20
+ out += '.';
21
+ }
22
+ // Add zeros
23
+ while (out.split('.')[1].length < numDigits) {
24
+ out = "".concat(out, "0");
25
+ }
26
+ // Return
27
+ return out;
28
+ };
29
+ exports.default = padDecimalZeros;
30
+ //# sourceMappingURL=padDecimalZeros.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"padDecimalZeros.js","sourceRoot":"","sources":["../../src/helpers/padDecimalZeros.tsx"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,IAAM,eAAe,GAAG,UAAC,GAAW,EAAE,SAAiB;IACrD,wBAAwB;IACxB,IAAI,SAAS,GAAG,CAAC,EAAE;QACjB,OAAO;KACR;IAED,oBAAoB;IACpB,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAEtB,yCAAyC;IACzC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACtB,GAAG,IAAI,GAAG,CAAC;KACZ;IAED,YAAY;IACZ,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,SAAS,EAAE;QAC3C,GAAG,GAAG,UAAG,GAAG,MAAG,CAAC;KACjB;IAED,SAAS;IACT,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Pad a number with zeros on the left (e.g. 5 becomes 05 with 2 digit padding)
3
+ * @author Gabe Abrams
4
+ * @param num the number to pad
5
+ * @param numDigits the minimum number of digits before the decimal
6
+ * @returns padded number
7
+ */
8
+ declare const padZerosLeft: (num: number, numDigits: number) => string;
9
+ export default padZerosLeft;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Pad a number with zeros on the left (e.g. 5 becomes 05 with 2 digit padding)
5
+ * @author Gabe Abrams
6
+ * @param num the number to pad
7
+ * @param numDigits the minimum number of digits before the decimal
8
+ * @returns padded number
9
+ */
10
+ var padZerosLeft = function (num, numDigits) {
11
+ // Convert to string
12
+ var out = String(num);
13
+ // Add zeros
14
+ while (out.split('.')[0].length < numDigits) {
15
+ out = "0".concat(out);
16
+ }
17
+ // Return
18
+ return out;
19
+ };
20
+ exports.default = padZerosLeft;
21
+ //# sourceMappingURL=padZerosLeft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"padZerosLeft.js","sourceRoot":"","sources":["../../src/helpers/padZerosLeft.tsx"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH,IAAM,YAAY,GAAG,UAAC,GAAW,EAAE,SAAiB;IAClD,oBAAoB;IACpB,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAEtB,YAAY;IACZ,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,SAAS,EAAE;QAC3C,GAAG,GAAG,WAAI,GAAG,CAAE,CAAC;KACjB;IAED,SAAS;IACT,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Round a number to a certain number of decimals
3
+ * @author Gabe Abrams
4
+ * @param num the number to round
5
+ * @param numDecimals the number of decimals to round to
6
+ * @returns rounded number
7
+ */
8
+ declare const roundToNumDecimals: (num: number, numDecimals: number) => number;
9
+ export default roundToNumDecimals;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Round a number to a certain number of decimals
5
+ * @author Gabe Abrams
6
+ * @param num the number to round
7
+ * @param numDecimals the number of decimals to round to
8
+ * @returns rounded number
9
+ */
10
+ var roundToNumDecimals = function (num, numDecimals) {
11
+ var rounder = Math.pow(10, numDecimals);
12
+ return (Math.round(num * rounder) / rounder);
13
+ };
14
+ exports.default = roundToNumDecimals;
15
+ //# sourceMappingURL=roundToNumDecimals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNumDecimals.js","sourceRoot":"","sources":["../../src/helpers/roundToNumDecimals.tsx"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH,IAAM,kBAAkB,GAAG,UAAC,GAAW,EAAE,WAAmB;IAC1D,IAAM,OAAO,GAAG,SAAA,EAAE,EAAI,WAAW,CAAA,CAAC;IAClC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Sum the numbers in an array
3
+ * @author Gabe Abrams
4
+ * @param nums the numbers to sum
5
+ * @returns the sum of the numbers
6
+ */
7
+ declare const sum: (nums: number[]) => number;
8
+ export default sum;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Sum the numbers in an array
5
+ * @author Gabe Abrams
6
+ * @param nums the numbers to sum
7
+ * @returns the sum of the numbers
8
+ */
9
+ var sum = function (nums) {
10
+ return nums.reduce(function (a, b) {
11
+ return (a + b);
12
+ }, 0);
13
+ };
14
+ exports.default = sum;
15
+ //# sourceMappingURL=sum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sum.js","sourceRoot":"","sources":["../../src/helpers/sum.tsx"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,IAAM,GAAG,GAAG,UAAC,IAAc;IACzB,OAAO,IAAI,CAAC,MAAM,CAChB,UAAC,CAAS,EAAE,CAAS;QACnB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjB,CAAC,EACD,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Wait for a certain number of ms
3
+ * @author Gabe Abrams
4
+ * @param ms number of ms to wait
5
+ */
6
+ declare const waitMs: (ms?: number) => Promise<unknown>;
7
+ export default waitMs;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ /**
40
+ * Wait for a certain number of ms
41
+ * @author Gabe Abrams
42
+ * @param ms number of ms to wait
43
+ */
44
+ var waitMs = function (ms) {
45
+ if (ms === void 0) { ms = 0; }
46
+ return __awaiter(void 0, void 0, void 0, function () {
47
+ return __generator(this, function (_a) {
48
+ return [2 /*return*/, new Promise(function (resolve) {
49
+ setTimeout(resolve, ms);
50
+ })];
51
+ });
52
+ });
53
+ };
54
+ exports.default = waitMs;
55
+ //# sourceMappingURL=waitMs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitMs.js","sourceRoot":"","sources":["../../src/helpers/waitMs.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,IAAM,MAAM,GAAG,UAAO,EAAM;IAAN,mBAAA,EAAA,MAAM;;;YAC1B,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO;oBACzB,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1B,CAAC,CAAC,EAAC;;;CACJ,CAAC;AAEF,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Bootstrap variants
3
+ * @author Gabe Abrams
4
+ */
5
+ declare enum Variant {
6
+ Primary = "primary",
7
+ Secondary = "secondary",
8
+ Success = "success",
9
+ Warning = "warning",
10
+ Info = "info",
11
+ Danger = "danger",
12
+ Light = "light",
13
+ Dark = "dark"
14
+ }
15
+ export default Variant;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Bootstrap variants
5
+ * @author Gabe Abrams
6
+ */
7
+ var Variant;
8
+ (function (Variant) {
9
+ Variant["Primary"] = "primary";
10
+ Variant["Secondary"] = "secondary";
11
+ Variant["Success"] = "success";
12
+ Variant["Warning"] = "warning";
13
+ Variant["Info"] = "info";
14
+ Variant["Danger"] = "danger";
15
+ Variant["Light"] = "light";
16
+ Variant["Dark"] = "dark";
17
+ })(Variant || (Variant = {}));
18
+ exports.default = Variant;
19
+ //# sourceMappingURL=Variant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Variant.js","sourceRoot":"","sources":["../../src/types/Variant.tsx"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,IAAK,OASJ;AATD,WAAK,OAAO;IACV,8BAAmB,CAAA;IACnB,kCAAuB,CAAA;IACvB,8BAAmB,CAAA;IACnB,8BAAmB,CAAA;IACnB,wBAAa,CAAA;IACb,4BAAiB,CAAA;IACjB,0BAAe,CAAA;IACf,wBAAa,CAAA;AACf,CAAC,EATI,OAAO,KAAP,OAAO,QASX;AAED,kBAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,54 +1,37 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "1.0.18",
3
+ "version": "2.0.0",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "scripts": {
7
- "build": "rimraf common && rimraf components && rimraf glyphs && NODE_ENV=production babel src/lib --out-dir . --copy-files --ignore __tests__,spec.js,test.js,__snapshots__"
7
+ "build": "tsc --project ./tsconfig.json"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/harvard-edtech/dce-reactkit"
12
12
  },
13
- "author": "Gabriel Abrams <gabeabrams@gmail.com>",
13
+ "author": "Gabe Abrams <gabeabrams@gmail.com>",
14
14
  "license": "MIT",
15
15
  "homepage": "https://github.com/harvard-edtech/dce-reactkit#readme",
16
- "devDependencies": {
17
- "@babel/core": "^7.2.2",
18
- "babel-cli": "^6.26.0",
19
- "babel-plugin-transform-object-rest-spread": "^6.23.0",
20
- "babel-plugin-transform-react-jsx": "^6.24.1",
21
- "babel-preset-env": "^1.5.1",
22
- "babel-preset-react": "^6.24.1",
23
- "babel-preset-react-app": "^6.1.0",
24
- "eslint": "^5.12.0",
25
- "eslint-config-airbnb": "^17.1.0",
26
- "eslint-plugin-import": "^2.14.0",
27
- "eslint-plugin-jsx-a11y": "^6.1.2",
28
- "eslint-plugin-react": "^7.12.3",
29
- "react-dom": "^16.7.0",
30
- "react-scripts": "^2.1.3",
31
- "rimraf": "^2.6.3"
32
- },
33
16
  "dependencies": {
34
- "@fortawesome/fontawesome-svg-core": "^1.2.12",
35
- "@fortawesome/free-brands-svg-icons": "^5.6.3",
36
- "@fortawesome/free-regular-svg-icons": "^5.6.3",
37
- "@fortawesome/free-solid-svg-icons": "^5.6.3",
38
- "@fortawesome/react-fontawesome": "^0.1.3",
39
- "bootstrap": "^4.2.1",
40
- "caccl": "^1.0.34",
41
- "jquery": "^3.3.1",
42
- "lodash-arithmetic": "^1.0.0",
43
- "moment": "^2.23.0",
44
- "papaparse": "^4.6.3",
45
- "prop-types": "^15.6.2",
46
- "react": "^16.7.0",
47
- "react-datepicker": "^2.0.0",
48
- "react-download-link": "^2.2.0",
49
- "reactstrap": "^6.5.0",
50
- "recharts": "^1.4.2",
51
- "uuid": "^3.3.2",
52
- "validator": "^10.10.0"
17
+ "@fortawesome/fontawesome-svg-core": "^6.1.1",
18
+ "@fortawesome/free-regular-svg-icons": "^6.1.1",
19
+ "@fortawesome/free-solid-svg-icons": "^6.1.1",
20
+ "@fortawesome/react-fontawesome": "^0.1.18",
21
+ "react-bootstrap": "^2.2.3"
22
+ },
23
+ "devDependencies": {
24
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
25
+ "@typescript-eslint/parser": "^5.18.0",
26
+ "eslint": "^8.12.0",
27
+ "eslint-config-airbnb": "^19.0.4",
28
+ "eslint-config-airbnb-typescript": "^17.0.0",
29
+ "eslint-plugin-import": "^2.26.0",
30
+ "eslint-plugin-jest": "^26.1.3",
31
+ "eslint-plugin-jsx-a11y": "^6.5.1",
32
+ "eslint-plugin-react": "^7.29.4",
33
+ "eslint-plugin-react-hooks": "^4.4.0",
34
+ "sass": "^1.49.11",
35
+ "typescript": "^4.6.3"
53
36
  }
54
37
  }
@@ -0,0 +1,50 @@
1
+ /* Blips */
2
+ .LoadingSpinner-blip-1,
3
+ .LoadingSpinner-blip-2,
4
+ .LoadingSpinner-blip-3,
5
+ .LoadingSpinner-blip-4 {
6
+ font-size: 25px;
7
+ opacity: 0.6;
8
+ margin-top: 20px;
9
+ margin-bottom: 20px;
10
+ }
11
+
12
+ /* First Blip */
13
+ .LoadingSpinner-blip-1 {
14
+ animation: LoadingSpinner-pop-animation 2s infinite;
15
+ }
16
+
17
+ /* Second Blip */
18
+ .LoadingSpinner-blip-2 {
19
+ animation: LoadingSpinner-pop-animation 2s infinite;
20
+ -webkit-animation-delay: 0.1s;
21
+ animation-delay: 0.1s;
22
+ }
23
+
24
+ /* Third Blip */
25
+ .LoadingSpinner-blip-3 {
26
+ animation: LoadingSpinner-pop-animation 2s infinite;
27
+ animation-delay: 0.2s;
28
+ }
29
+
30
+ /* Fourth Blip */
31
+ .LoadingSpinner-blip-4 {
32
+ animation: LoadingSpinner-pop-animation 2s infinite;
33
+ animation-delay: 0.3s;
34
+ }
35
+
36
+ /* Pop Animation for Each Blip */
37
+ @keyframes LoadingSpinner-pop-animation {
38
+ 0% {
39
+ transform: scale(1.0);
40
+ }
41
+ 10% {
42
+ transform: scale(1.5);
43
+ }
44
+ 30% {
45
+ transform: scale(1.0);
46
+ }
47
+ 100% {
48
+ transform: scale(1.0);
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Loading spinner/indicator
3
+ * @author Gabe Abrams
4
+ */
5
+
6
+ // Import FontAwesome Icons
7
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8
+ import { faCircle } from '@fortawesome/free-solid-svg-icons';
9
+
10
+ // Import style
11
+ import './LoadingSpinner.scss';
12
+
13
+ /*------------------------------------------------------------------------*/
14
+ /* Component */
15
+ /*------------------------------------------------------------------------*/
16
+
17
+ const LoadingSpinner = () => {
18
+ /*------------------------------------------------------------------------*/
19
+ /* Render */
20
+ /*------------------------------------------------------------------------*/
21
+
22
+ // Add all four blips to a container
23
+ return (
24
+ <div className="text-center LoadingSpinner LoadingSpinner-container">
25
+ <FontAwesomeIcon
26
+ icon={faCircle}
27
+ className="LoadingSpinner-blip-1 me-1"
28
+ />
29
+ <FontAwesomeIcon
30
+ icon={faCircle}
31
+ className="LoadingSpinner-blip-2 me-1"
32
+ />
33
+ <FontAwesomeIcon
34
+ icon={faCircle}
35
+ className="LoadingSpinner-blip-3 me-1"
36
+ />
37
+ <FontAwesomeIcon
38
+ icon={faCircle}
39
+ className="LoadingSpinner-blip-4"
40
+ />
41
+ </div>
42
+ );
43
+ };
44
+
45
+ /*------------------------------------------------------------------------*/
46
+ /* Wrap Up */
47
+ /*------------------------------------------------------------------------*/
48
+
49
+ // Export component
50
+ export default LoadingSpinner;
@@ -0,0 +1,48 @@
1
+ /* More opaque backdrop */
2
+ .Modal-backdrop {
3
+ background-color: black !important;
4
+ opacity: 0.8 !important;
5
+ z-index: 10000000 !important;
6
+ }
7
+
8
+ /* Customize the modal header and body */
9
+ .modal-header {
10
+ /* Dark theme */
11
+ background-color: #222 !important;
12
+ color: white !important;
13
+
14
+ /* Border */
15
+ border: 1px solid #545454 !important;
16
+ }
17
+ .modal-body {
18
+ /* Dark theme */
19
+ background-color: #222 !important;
20
+ color: white !important;
21
+
22
+ /* Border */
23
+ border-top: 0 !important;
24
+ border-left: 1px solid #545454 !important;
25
+ border-bottom: 1px solid #545454 !important;
26
+ border-right: 1px solid #545454 !important;
27
+ border-bottom-left-radius: 3px;
28
+ border-bottom-right-radius: 3px;
29
+ }
30
+
31
+ /* Create our own animation */
32
+ .modal-content {
33
+ animation-name: Modal-drop-in;
34
+ animation-duration: 0.4s;
35
+ animation-iteration-count: 1;
36
+ animation-fill-mode: forwards;
37
+ animation-timing-function: ease-out;
38
+ }
39
+ @keyframes Modal-drop-in {
40
+ 0% {
41
+ transform: scale(0.8);
42
+ opacity: 0.5;
43
+ }
44
+ 100% {
45
+ transform: scale(1);
46
+ opacity: 1;
47
+ }
48
+ }