dce-reactkit 3.7.25 → 3.7.28

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;
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  type Props = {
7
+ grayBackground?: boolean;
7
8
  customBackgroundColor?: string;
8
9
  children: React.ReactNode;
9
10
  };
package/dist/index.d.ts CHANGED
@@ -223,7 +223,7 @@ declare const RadioButton: React$1.FC<Props$h>;
223
223
  */
224
224
 
225
225
  type Props$g = {
226
- text: string;
226
+ text: React$1.ReactNode;
227
227
  onChanged: (checked: boolean) => void;
228
228
  ariaLabel: string;
229
229
  title?: string;
@@ -283,6 +283,7 @@ declare const SimpleDateChooser: React$1.FC<Props$e>;
283
283
  */
284
284
 
285
285
  type Props$d = {
286
+ grayBackground?: boolean;
286
287
  customBackgroundColor?: string;
287
288
  children: React$1.ReactNode;
288
289
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.7.25",
3
+ "version": "3.7.28",
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
@@ -12,6 +12,8 @@ import React from 'react';
12
12
 
13
13
  // Props definition
14
14
  type Props = {
15
+ // If true, the background color is gray
16
+ grayBackground?: boolean,
15
17
  // Custom background color
16
18
  customBackgroundColor?: string,
17
19
  // Children to display
@@ -51,6 +53,7 @@ const Drawer: React.FC<Props> = (props) => {
51
53
 
52
54
  // Destructure all props
53
55
  const {
56
+ grayBackground,
54
57
  customBackgroundColor,
55
58
  children,
56
59
  } = props;
@@ -67,7 +70,11 @@ const Drawer: React.FC<Props> = (props) => {
67
70
  <div
68
71
  className="Drawer-container"
69
72
  style={{
70
- backgroundColor: (customBackgroundColor ?? undefined),
73
+ backgroundColor: (
74
+ grayBackground
75
+ ? '#E2E3E5'
76
+ : (customBackgroundColor ?? undefined)
77
+ ),
71
78
  }}
72
79
  >
73
80
  <style>{style}</style>