dce-reactkit 3.0.0-beta.3 → 3.0.0-beta.4
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/index.js +140 -35643
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/AppWrapper.d.ts +3 -1
- package/dist/esm/index.js +43 -35528
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AppWrapper.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -3
- package/src/components/AppWrapper.tsx +5 -1
- package/src/components/Modal.tsx +35 -32
|
@@ -1,9 +1,11 @@
|
|
|
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';
|
|
7
|
+
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
8
|
+
import 'bootstrap/dist/js/bootstrap.min';
|
|
7
9
|
declare type Props = {
|
|
8
10
|
children: React.ReactNode;
|
|
9
11
|
dark?: boolean;
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dce-reactkit",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"description": "Shared components for Harvard DCE apps",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -21,8 +21,7 @@
|
|
|
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
|
+
"react": "^18.0.0"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -1,12 +1,16 @@
|
|
|
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
|
// Import React
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
|
+
// Import bootstrap stylesheet and javascript
|
|
11
|
+
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
12
|
+
import 'bootstrap/dist/js/bootstrap.min';
|
|
13
|
+
|
|
10
14
|
// Import shared components
|
|
11
15
|
import ErrorBox from './ErrorBox';
|
|
12
16
|
|
package/src/components/Modal.tsx
CHANGED
|
@@ -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
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
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
|
-
<
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
|