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.
- package/.eslintrc.js +95 -0
- package/dist/cjs/index.js +138 -35643
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/AppWrapper.d.ts +1 -1
- package/dist/esm/index.js +41 -35528
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AppWrapper.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +12 -3
- package/src/components/AppWrapper.tsx +1 -1
- package/src/components/Modal.tsx +35 -80
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.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
|
-
"
|
|
25
|
-
"react
|
|
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",
|
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
|
|
@@ -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
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
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
|
-
<
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
|