dce-reactkit 3.0.0-beta.3 → 3.0.0-beta.7

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * A wrapper for the entire React app that adds global functionality like
3
- * handling for fatal error messages
3
+ * handling for fatal error messages, adds bootstrap support
4
4
  * @author Gabe Abrams
5
5
  */
6
6
  import React from 'react';
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import React from 'react';
3
3
 
4
4
  /**
5
5
  * A wrapper for the entire React app that adds global functionality like
6
- * handling for fatal error messages
6
+ * handling for fatal error messages, adds bootstrap support
7
7
  * @author Gabe Abrams
8
8
  */
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.7",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -21,14 +21,23 @@
21
21
  "peerDependencies": {
22
22
  "@fortawesome/free-solid-svg-icons": "^6.1.1",
23
23
  "@fortawesome/react-fontawesome": "^0.1.18",
24
- "react": "^18.0.0",
25
- "react-bootstrap": "^2.3.0"
24
+ "bootstrap": "^5.1.3",
25
+ "react": "^18.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rollup/plugin-commonjs": "^22.0.0",
29
29
  "@rollup/plugin-node-resolve": "^13.2.1",
30
30
  "@rollup/plugin-typescript": "^8.3.2",
31
31
  "@types/react": "^18.0.7",
32
+ "@typescript-eslint/eslint-plugin": "^5.21.0",
33
+ "@typescript-eslint/parser": "^5.21.0",
34
+ "eslint": "^8.14.0",
35
+ "eslint-config-airbnb": "^19.0.4",
36
+ "eslint-config-airbnb-typescript": "^17.0.0",
37
+ "eslint-plugin-import": "^2.26.0",
38
+ "eslint-plugin-jsx-a11y": "^6.5.1",
39
+ "eslint-plugin-react": "^7.29.4",
40
+ "eslint-plugin-react-hooks": "^4.4.0",
32
41
  "rollup": "^2.70.2",
33
42
  "rollup-plugin-dts": "^4.2.1",
34
43
  "rollup-plugin-sourcemaps": "^0.6.3",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * A wrapper for the entire React app that adds global functionality like
3
- * handling for fatal error messages
3
+ * handling for fatal error messages, adds bootstrap support
4
4
  * @author Gabe Abrams
5
5
  */
6
6
 
@@ -7,7 +7,6 @@
7
7
  import React, { useState, useEffect } from 'react';
8
8
 
9
9
  // Import other components
10
- import BootstrapModal from 'react-bootstrap/Modal';
11
10
  import waitMs from '../helpers/waitMs';
12
11
 
13
12
  // Import types
@@ -21,54 +20,6 @@ import ModalType from '../types/ModalType';
21
20
  /*------------------------------------------------------------------------*/
22
21
 
23
22
  const style = `
24
- /* More opaque backdrop */
25
- .Modal-backdrop {
26
- background-color: black !important;
27
- opacity: 0.8 !important;
28
- z-index: 10000000 !important;
29
- }
30
-
31
- /* Customize the modal header and body */
32
- .modal-header {
33
- /* Dark theme */
34
- background-color: #222 !important;
35
- color: white !important;
36
-
37
- /* Border */
38
- border: 1px solid #545454 !important;
39
- }
40
- .modal-body {
41
- /* Dark theme */
42
- background-color: #222 !important;
43
- color: white !important;
44
-
45
- /* Border */
46
- border-top: 0 !important;
47
- border-left: 1px solid #545454 !important;
48
- border-bottom: 1px solid #545454 !important;
49
- border-right: 1px solid #545454 !important;
50
- border-bottom-left-radius: 3px;
51
- border-bottom-right-radius: 3px;
52
- }
53
-
54
- /* Create our own animation */
55
- .modal-content {
56
- animation-name: Modal-drop-in;
57
- animation-duration: 0.4s;
58
- animation-iteration-count: 1;
59
- animation-fill-mode: forwards;
60
- animation-timing-function: ease-out;
61
- }
62
- @keyframes Modal-drop-in {
63
- 0% {
64
- transform: scale(0.8);
65
- opacity: 0.5;
66
- }
67
- 100% {
68
- transform: scale(1);
69
- opacity: 1;
70
- }
71
- }
72
23
  `;
73
24
 
74
25
  /*------------------------------------------------------------------------*/
@@ -368,14 +319,9 @@ const Modal: React.FC<Props> = (props) => {
368
319
 
369
320
  // Render the modal
370
321
  return (
371
- <BootstrapModal
372
- show={visible}
373
- size={size !== ModalSize.Medium ? size : undefined}
374
- onHide={() => {
375
- if (!dontAllowBackdropExit) {
376
- handleClose(ModalButtonType.Cancel);
377
- }
378
- }}
322
+ <div
323
+ className={`modal fade modal-${size}`}
324
+ tabIndex={-1}
379
325
  style={{
380
326
  zIndex: (
381
327
  onTopOfOtherModals
@@ -383,30 +329,39 @@ const Modal: React.FC<Props> = (props) => {
383
329
  : 5000000000
384
330
  ),
385
331
  }}
386
- backdropClassName="Modal-backdrop"
387
- centered
388
332
  >
389
- <style>{style}</style>
390
- {title && (
391
- <BootstrapModal.Header
392
- closeButton={!!onClose}
393
- >
394
- <BootstrapModal.Title>
395
- {title}
396
- </BootstrapModal.Title>
397
- </BootstrapModal.Header>
398
- )}
399
- {children && (
400
- <BootstrapModal.Body>
401
- {children}
402
- </BootstrapModal.Body>
403
- )}
404
- {footer && (
405
- <BootstrapModal.Footer>
406
- {footer}
407
- </BootstrapModal.Footer>
408
- )}
409
- </BootstrapModal>
333
+ <div className="modal-dialog">
334
+ <div className="modal-content">
335
+ <div className="modal-header">
336
+ <h5 className="modal-title">
337
+ {title}
338
+ </h5>
339
+
340
+ {onClose && (
341
+ <button
342
+ type="button"
343
+ className="btn-close"
344
+ data-bs-dismiss="modal"
345
+ aria-label="Close"
346
+ onClick={() => {
347
+ handleClose(ModalButtonType.Cancel);
348
+ }}
349
+ />
350
+ )}
351
+ </div>
352
+ {children && (
353
+ <div className="modal-body">
354
+ {children}
355
+ </div>
356
+ )}
357
+ {footer && (
358
+ <div className="modal-footer">
359
+ {footer}
360
+ </div>
361
+ )}
362
+ </div>
363
+ </div>
364
+ </div>
410
365
  );
411
366
  };
412
367