dce-reactkit 3.7.27 → 3.7.29

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.
@@ -5,7 +5,7 @@
5
5
  import React from 'react';
6
6
  import Variant from '../types/Variant';
7
7
  type Props = {
8
- text: string;
8
+ text: React.ReactNode;
9
9
  onChanged: (checked: boolean) => void;
10
10
  ariaLabel: string;
11
11
  title?: string;
@@ -12,6 +12,7 @@ type ModalProps = {
12
12
  type?: ModalType;
13
13
  size?: ModalSize;
14
14
  title?: React.ReactNode;
15
+ largeTitle?: boolean;
15
16
  children?: React.ReactNode;
16
17
  onClose?: (type: ModalButtonType) => void;
17
18
  dontAllowBackdropExit?: boolean;
package/dist/index.d.ts CHANGED
@@ -150,6 +150,7 @@ type ModalProps = {
150
150
  type?: ModalType;
151
151
  size?: ModalSize;
152
152
  title?: React.ReactNode;
153
+ largeTitle?: boolean;
153
154
  children?: React.ReactNode;
154
155
  onClose?: (type: ModalButtonType) => void;
155
156
  dontAllowBackdropExit?: boolean;
@@ -223,7 +224,7 @@ declare const RadioButton: React$1.FC<Props$h>;
223
224
  */
224
225
 
225
226
  type Props$g = {
226
- text: string;
227
+ text: React$1.ReactNode;
227
228
  onChanged: (checked: boolean) => void;
228
229
  ariaLabel: string;
229
230
  title?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.7.27",
3
+ "version": "3.7.29",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -23,7 +23,7 @@ import { isDarkModeOn } from '../client/initClient';
23
23
 
24
24
  type Props = {
25
25
  // Text of the button
26
- text: string,
26
+ text: React.ReactNode,
27
27
  // Handler for when this item is toggled
28
28
  onChanged: (checked: boolean) => void,
29
29
  // Aria label
@@ -17,6 +17,8 @@ type ModalProps = {
17
17
  size?: ModalSize,
18
18
  // Title of the modal (if excluded, no header)
19
19
  title?: React.ReactNode,
20
+ // If true, the title should be large
21
+ largeTitle?: boolean,
20
22
  // The body of the modal
21
23
  children?: React.ReactNode,
22
24
  // Handler to call when modal is closed (if excluded, not closable)
@@ -247,6 +247,7 @@ const Modal: React.FC<ModalProps> = (props) => {
247
247
  type = ModalType.NoButtons,
248
248
  size = ModalSize.Large,
249
249
  title,
250
+ largeTitle,
250
251
  children,
251
252
  onClose,
252
253
  dontAllowBackdropExit,
@@ -480,6 +481,11 @@ const Modal: React.FC<ModalProps> = (props) => {
480
481
  className="modal-title"
481
482
  style={{
482
483
  fontWeight: 'bold',
484
+ fontSize: (
485
+ largeTitle
486
+ ? '1.6rem'
487
+ : undefined
488
+ ),
483
489
  }}
484
490
  >
485
491
  {title}