dce-reactkit 3.9.5 → 3.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.9.5",
3
+ "version": "3.9.6",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -46,6 +46,8 @@ type Props = {
46
46
  small?: boolean,
47
47
  // If true, show a dash in the checkbox (only relevant if unchecked)
48
48
  dashed?: boolean,
49
+ // If true, use complex formatting (tabs, newlines) in the text
50
+ useComplexFormatting?: boolean,
49
51
  };
50
52
 
51
53
  /*------------------------------------------------------------------------*/
@@ -80,6 +82,7 @@ const CheckboxButton: React.FC<Props> = (props) => {
80
82
  ),
81
83
  small,
82
84
  dashed,
85
+ useComplexFormatting,
83
86
  } = props;
84
87
 
85
88
  /*------------------------------------------------------------------------*/
@@ -121,9 +124,24 @@ const CheckboxButton: React.FC<Props> = (props) => {
121
124
  className="me-1"
122
125
  />
123
126
  </div>
124
- <div className="flex-grow-1">
125
- {text}
126
- </div>
127
+ {
128
+ useComplexFormatting
129
+ ? (
130
+ <pre
131
+ className="ps-2 text-start text-break"
132
+ style={{
133
+ whiteSpace: 'pre-wrap',
134
+ }}
135
+ >
136
+ {text}
137
+ </pre>
138
+ )
139
+ : (
140
+ <div className="flex-grow-1 text-start text-break ps-2">
141
+ {text}
142
+ </div>
143
+ )
144
+ }
127
145
  </div>
128
146
  </button>
129
147
  );