dce-reactkit 3.5.3 → 3.5.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.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Simple tooltip component
3
+ * @author Gabe Abrams
4
+ */
5
+ import React from 'react';
6
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
7
+ type Props = {
8
+ icon?: IconProp;
9
+ text: string;
10
+ children: React.ReactNode;
11
+ wide?: boolean;
12
+ thin?: boolean;
13
+ };
14
+ declare const Tooltip: React.FC<Props>;
15
+ export default Tooltip;
@@ -17,6 +17,7 @@ import LogReviewer from './components/LogReviewer';
17
17
  import IntelliTable from './components/IntelliTable';
18
18
  import CSVDownloadButton from './components/CSVDownloadButton';
19
19
  import DBEntryManagerPanel from './components/DBEntryManagerPanel';
20
+ import Tooltip from './components/Tooltip';
20
21
  import ErrorWithCode from './errors/ErrorWithCode';
21
22
  import MINUTE_IN_MS from './constants/MINUTE_IN_MS';
22
23
  import HOUR_IN_MS from './constants/HOUR_IN_MS';
@@ -79,4 +80,4 @@ import PickableItem from './components/ItemPicker/types/PickableItem';
79
80
  import DBEntry from './components/DBEntryManagerPanel/types/DBEntry';
80
81
  import DBEntryField from './components/DBEntryManagerPanel/types/DBEntryField';
81
82
  import DBEntryFieldType from './components/DBEntryManagerPanel/types/DBEntryFieldType';
82
- export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, initClient, visitServerEndpoint, logClientEvent, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
83
+ export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, initClient, visitServerEndpoint, logClientEvent, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
3
4
  import express from 'express';
4
5
 
5
6
  /**
@@ -23,7 +24,7 @@ declare enum Variant {
23
24
  * @author Gabe Abrams
24
25
  */
25
26
 
26
- type Props$h = {
27
+ type Props$i = {
27
28
  children: React.ReactNode;
28
29
  dark?: boolean;
29
30
  };
@@ -62,7 +63,7 @@ declare const confirm: (title: string, text: string, opts?: {
62
63
  * @param [errorTitle] title of the error box
63
64
  */
64
65
  declare const showFatalError: (error: any, errorTitle?: string) => undefined;
65
- declare const AppWrapper: React.FC<Props$h>;
66
+ declare const AppWrapper: React.FC<Props$i>;
66
67
 
67
68
  /**
68
69
  * Loading spinner/indicator
@@ -75,12 +76,12 @@ declare const LoadingSpinner: () => JSX.Element;
75
76
  * @author Gabe Abrams
76
77
  */
77
78
 
78
- type Props$g = {
79
+ type Props$h = {
79
80
  error: any;
80
81
  title?: string;
81
82
  onClose?: () => void;
82
83
  };
83
- declare const ErrorBox: React.FC<Props$g>;
84
+ declare const ErrorBox: React.FC<Props$h>;
84
85
 
85
86
  /**
86
87
  * Types of buttons in the modal
@@ -131,7 +132,7 @@ declare enum ModalType {
131
132
  * @author Gabe Abrams
132
133
  */
133
134
 
134
- type Props$f = {
135
+ type Props$g = {
135
136
  type?: ModalType;
136
137
  size?: ModalSize;
137
138
  title?: React.ReactNode;
@@ -160,27 +161,27 @@ type Props$f = {
160
161
  confirmVariant?: Variant;
161
162
  onTopOfOtherModals?: boolean;
162
163
  };
163
- declare const Modal: React.FC<Props$f>;
164
+ declare const Modal: React.FC<Props$g>;
164
165
 
165
166
  /**
166
167
  * A box with a tab on the top that holds buttons and other content
167
168
  * @author Gabe Abrams
168
169
  */
169
170
 
170
- type Props$e = {
171
+ type Props$f = {
171
172
  title: React.ReactNode;
172
173
  children: React.ReactNode;
173
174
  noBottomMargin?: boolean;
174
175
  noBottomPadding?: boolean;
175
176
  };
176
- declare const TabBox: React.FC<Props$e>;
177
+ declare const TabBox: React.FC<Props$f>;
177
178
 
178
179
  /**
179
180
  * A radio selection button
180
181
  * @author Gabe Abrams
181
182
  */
182
183
 
183
- type Props$d = {
184
+ type Props$e = {
184
185
  text: string;
185
186
  onSelected: () => void;
186
187
  ariaLabel: string;
@@ -192,14 +193,14 @@ type Props$d = {
192
193
  unselectedVariant?: Variant;
193
194
  small?: boolean;
194
195
  };
195
- declare const RadioButton: React.FC<Props$d>;
196
+ declare const RadioButton: React.FC<Props$e>;
196
197
 
197
198
  /**
198
199
  * A checkbox button
199
200
  * @author Gabe Abrams
200
201
  */
201
202
 
202
- type Props$c = {
203
+ type Props$d = {
203
204
  text: string;
204
205
  onChanged: (checked: boolean) => void;
205
206
  ariaLabel: string;
@@ -213,28 +214,28 @@ type Props$c = {
213
214
  small?: boolean;
214
215
  dashed?: boolean;
215
216
  };
216
- declare const CheckboxButton: React.FC<Props$c>;
217
+ declare const CheckboxButton: React.FC<Props$d>;
217
218
 
218
219
  /**
219
220
  * Input group with a title and space for buttons
220
221
  * @author Gabe Abrams
221
222
  */
222
223
 
223
- type Props$b = {
224
+ type Props$c = {
224
225
  label: string;
225
226
  minLabelWidth?: string;
226
227
  children: React.ReactNode;
227
228
  className?: string;
228
229
  wrapButtonsAndAddGaps?: boolean;
229
230
  };
230
- declare const ButtonInputGroup: React.FC<Props$b>;
231
+ declare const ButtonInputGroup: React.FC<Props$c>;
231
232
 
232
233
  /**
233
234
  * A very simple, lightweight date chooser
234
235
  * @author Gabe Abrams
235
236
  */
236
237
 
237
- type Props$a = {
238
+ type Props$b = {
238
239
  ariaLabel: string;
239
240
  name: string;
240
241
  month: number;
@@ -250,61 +251,61 @@ type Props$a = {
250
251
  numMonthsToShow?: number;
251
252
  chooseFromPast?: boolean;
252
253
  };
253
- declare const SimpleDateChooser: React.FC<Props$a>;
254
+ declare const SimpleDateChooser: React.FC<Props$b>;
254
255
 
255
256
  /**
256
257
  * Drawer container
257
258
  * @author Gabe Abrams
258
259
  */
259
260
 
260
- type Props$9 = {
261
+ type Props$a = {
261
262
  customBackgroundColor?: string;
262
263
  children: React.ReactNode;
263
264
  };
264
- declare const Drawer: React.FC<Props$9>;
265
+ declare const Drawer: React.FC<Props$a>;
265
266
 
266
267
  /**
267
268
  * Success checkmark that pops into view
268
269
  * @author Gabe Abrams
269
270
  */
270
271
 
271
- type Props$8 = {
272
+ type Props$9 = {
272
273
  sizeRem?: number;
273
274
  circleVariant?: string;
274
275
  checkVariant?: string;
275
276
  };
276
- declare const PopSuccessMark: React.FC<Props$8>;
277
+ declare const PopSuccessMark: React.FC<Props$9>;
277
278
 
278
279
  /**
279
280
  * Failure x mark that pops into view
280
281
  * @author Gabe Abrams
281
282
  */
282
283
 
283
- type Props$7 = {
284
+ type Props$8 = {
284
285
  sizeRem?: number;
285
286
  circleVariant?: string;
286
287
  xVariant?: string;
287
288
  };
288
- declare const PopFailureMark: React.FC<Props$7>;
289
+ declare const PopFailureMark: React.FC<Props$8>;
289
290
 
290
291
  /**
291
292
  * Failure pending that pops into view
292
293
  * @author Gabe Abrams
293
294
  */
294
295
 
295
- type Props$6 = {
296
+ type Props$7 = {
296
297
  sizeRem?: number;
297
298
  circleVariant?: string;
298
299
  hourglassVariant?: string;
299
300
  };
300
- declare const PopPendingMark: React.FC<Props$6>;
301
+ declare const PopPendingMark: React.FC<Props$7>;
301
302
 
302
303
  /**
303
304
  * Copiable text box
304
305
  * @author Gabe Abrams
305
306
  */
306
307
 
307
- type Props$5 = {
308
+ type Props$6 = {
308
309
  text: string;
309
310
  maxTextWidthRem?: number;
310
311
  label?: string;
@@ -316,7 +317,7 @@ type Props$5 = {
316
317
  textAreaId?: string;
317
318
  copyButtonId?: string;
318
319
  };
319
- declare const CopiableBox: React.FC<Props$5>;
320
+ declare const CopiableBox: React.FC<Props$6>;
320
321
 
321
322
  /**
322
323
  * An item that can be chosen (for use within ItemPicker)
@@ -339,7 +340,7 @@ type PickableItem = ({
339
340
  * @author Yuen Ler Chow
340
341
  */
341
342
 
342
- type Props$4 = {
343
+ type Props$5 = {
343
344
  title: string;
344
345
  items: PickableItem[];
345
346
  /**
@@ -350,7 +351,7 @@ type Props$4 = {
350
351
  onChanged: (updatedItems: PickableItem[]) => void;
351
352
  noBottomMargin?: boolean;
352
353
  };
353
- declare const ItemPicker: React.FC<Props$4>;
354
+ declare const ItemPicker: React.FC<Props$5>;
354
355
 
355
356
  /**
356
357
  * Type of the context map in a LogMetadata file
@@ -395,11 +396,11 @@ type LogMetadataType = {
395
396
  * @author Gabe Abrams
396
397
  */
397
398
 
398
- type Props$3 = {
399
+ type Props$4 = {
399
400
  LogMetadata: LogMetadataType;
400
401
  onClose: () => void;
401
402
  };
402
- declare const LogReviewer: React.FC<Props$3>;
403
+ declare const LogReviewer: React.FC<Props$4>;
403
404
 
404
405
  /**
405
406
  * Server-side API param types
@@ -434,7 +435,7 @@ type IntelliTableColumn = {
434
435
  * @author Gabe Abrams
435
436
  */
436
437
 
437
- type Props$2 = {
438
+ type Props$3 = {
438
439
  title: string;
439
440
  id: string;
440
441
  data: {
@@ -444,14 +445,14 @@ type Props$2 = {
444
445
  columns: IntelliTableColumn[];
445
446
  csvName?: string;
446
447
  };
447
- declare const IntelliTable: React.FC<Props$2>;
448
+ declare const IntelliTable: React.FC<Props$3>;
448
449
 
449
450
  /**
450
451
  * Button for downloading a csv file
451
452
  * @author Gabe Abrams
452
453
  */
453
454
 
454
- type Props$1 = {
455
+ type Props$2 = {
455
456
  filename: string;
456
457
  csv: string;
457
458
  id?: string;
@@ -463,7 +464,7 @@ type Props$1 = {
463
464
  onClick?: () => void;
464
465
  children?: React.ReactNode;
465
466
  };
466
- declare const CSVDownloadButton: React.FC<Props$1>;
467
+ declare const CSVDownloadButton: React.FC<Props$2>;
467
468
 
468
469
  /**
469
470
  * Generic type for an object
@@ -539,7 +540,7 @@ type DBEntryField = ({
539
540
  * @author Gabe Abrams
540
541
  */
541
542
 
542
- type Props = {
543
+ type Props$1 = {
543
544
  entryFields: DBEntryField[];
544
545
  idPropName: string;
545
546
  titlePropName: string;
@@ -565,7 +566,21 @@ type Props = {
565
566
  [k: string]: any;
566
567
  };
567
568
  };
568
- declare const DBEntryManagerPanel: React.FC<Props>;
569
+ declare const DBEntryManagerPanel: React.FC<Props$1>;
570
+
571
+ /**
572
+ * Simple tooltip component
573
+ * @author Gabe Abrams
574
+ */
575
+
576
+ type Props = {
577
+ icon?: IconProp;
578
+ text: string;
579
+ children: React.ReactNode;
580
+ wide?: boolean;
581
+ thin?: boolean;
582
+ };
583
+ declare const Tooltip: React.FC<Props>;
569
584
 
570
585
  /**
571
586
  * An error with a code
@@ -1344,4 +1359,4 @@ declare const LogBuiltInMetadata: {
1344
1359
  };
1345
1360
  };
1346
1361
 
1347
- export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, Variant, abbreviate, addDBEditorEndpoints, alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
1362
+ export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, Tooltip, Variant, abbreviate, addDBEditorEndpoints, alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -29,6 +29,7 @@
29
29
  "peerDependencies": {
30
30
  "@fortawesome/free-regular-svg-icons": "^x.x.x",
31
31
  "@fortawesome/free-solid-svg-icons": "^x.x.x",
32
+ "@fortawesome/fontawesome-svg-core": "^x.x.x",
32
33
  "@fortawesome/react-fontawesome": "^x.x.x",
33
34
  "bootstrap": "^5.x.x",
34
35
  "react": "^x.x.x",
@@ -6,13 +6,14 @@
6
6
  // Import React
7
7
  import React, { useReducer } from 'react';
8
8
 
9
- // Import other reactkit functions
10
- import { alert, waitMs } from '..';
11
-
12
9
  // Import FontAwesome
13
10
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
14
11
  import { faClipboard } from '@fortawesome/free-solid-svg-icons';
15
12
 
13
+ // Import other reactkit functions
14
+ import { alert } from './AppWrapper';
15
+ import waitMs from '../helpers/waitMs';
16
+
16
17
  /*------------------------------------------------------------------------*/
17
18
  /* Types */
18
19
  /*------------------------------------------------------------------------*/
@@ -260,7 +261,7 @@ const CopiableBox: React.FC<Props> = (props) => {
260
261
  />
261
262
  )
262
263
  }
263
-
264
+
264
265
  <button
265
266
  id={copyButtonId}
266
267
  className="btn btn-secondary"