dce-reactkit 3.0.0-beta.2 → 3.0.0-beta.6

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.2",
3
+ "version": "3.0.0-beta.6",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -19,18 +19,28 @@
19
19
  },
20
20
  "homepage": "https://github.com/harvard-edtech/dce-reactkit#readme",
21
21
  "peerDependencies": {
22
- "react": "^18.0.0",
23
- "react-bootstrap": "^2.3.0",
24
22
  "@fortawesome/free-solid-svg-icons": "^6.1.1",
25
- "@fortawesome/react-fontawesome": "^0.1.18"
23
+ "@fortawesome/react-fontawesome": "^0.1.18",
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",
43
+ "rollup-plugin-sourcemaps": "^0.6.3",
34
44
  "typescript": "^4.6.3"
35
45
  }
36
46
  }
package/rollup.config.js CHANGED
@@ -2,6 +2,8 @@ import resolve from "@rollup/plugin-node-resolve";
2
2
  import commonjs from "@rollup/plugin-commonjs";
3
3
  import typescript from "@rollup/plugin-typescript";
4
4
  import dts from "rollup-plugin-dts";
5
+ import sourcemaps from 'rollup-plugin-sourcemaps';
6
+
5
7
 
6
8
  const packageJson = require("./package.json");
7
9
 
@@ -24,6 +26,7 @@ export default [
24
26
  resolve(),
25
27
  commonjs(),
26
28
  typescript({ tsconfig: "./tsconfig.json" }),
29
+ sourcemaps(),
27
30
  ],
28
31
  external: [
29
32
  ...Object.keys(packageJson.dependencies || {}),
@@ -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
@@ -368,14 +367,9 @@ const Modal: React.FC<Props> = (props) => {
368
367
 
369
368
  // Render the modal
370
369
  return (
371
- <BootstrapModal
372
- show={visible}
373
- size={size !== ModalSize.Medium ? size : undefined}
374
- onHide={() => {
375
- if (!dontAllowBackdropExit) {
376
- handleClose(ModalButtonType.Cancel);
377
- }
378
- }}
370
+ <div
371
+ className={`modal fade modal-${size}`}
372
+ tabIndex={-1}
379
373
  style={{
380
374
  zIndex: (
381
375
  onTopOfOtherModals
@@ -383,30 +377,39 @@ const Modal: React.FC<Props> = (props) => {
383
377
  : 5000000000
384
378
  ),
385
379
  }}
386
- backdropClassName="Modal-backdrop"
387
- centered
388
380
  >
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>
381
+ <div className="modal-dialog">
382
+ <div className="modal-content">
383
+ <div className="modal-header">
384
+ <h5 className="modal-title">
385
+ {title}
386
+ </h5>
387
+
388
+ {onClose && (
389
+ <button
390
+ type="button"
391
+ className="btn-close"
392
+ data-bs-dismiss="modal"
393
+ aria-label="Close"
394
+ onClick={() => {
395
+ handleClose(ModalButtonType.Cancel);
396
+ }}
397
+ />
398
+ )}
399
+ </div>
400
+ {children && (
401
+ <div className="modal-body">
402
+ {children}
403
+ </div>
404
+ )}
405
+ {footer && (
406
+ <div className="modal-footer">
407
+ {footer}
408
+ </div>
409
+ )}
410
+ </div>
411
+ </div>
412
+ </div>
410
413
  );
411
414
  };
412
415