dce-reactkit 3.9.4-beta-prompt.1 → 3.9.4-beta-prompt.2

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.
@@ -58,9 +58,9 @@ export declare const confirm: (title: string, text: string, opts?: {
58
58
  * @param [opts.cancelButtonVariant=Variant.Secondary] the variant of the cancel button
59
59
  * @returns Promise that resolves with the input string or null if canceled
60
60
  */
61
- export declare const prompt: (title: string, text: string, currentInputFieldText: string, opts?: {
62
- placeholder?: string | undefined;
61
+ export declare const prompt: (title: string, text: string, opts?: {
63
62
  defaultText?: string | undefined;
63
+ placeholder?: string | undefined;
64
64
  confirmButtonText?: string | undefined;
65
65
  confirmButtonVariant?: Variant | undefined;
66
66
  cancelButtonText?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -77,9 +77,9 @@ declare const confirm: (title: string, text: string, opts?: {
77
77
  * @param [opts.cancelButtonVariant=Variant.Secondary] the variant of the cancel button
78
78
  * @returns Promise that resolves with the input string or null if canceled
79
79
  */
80
- declare const prompt: (title: string, text: string, currentInputFieldText: string, opts?: {
81
- placeholder?: string | undefined;
80
+ declare const prompt: (title: string, text: string, opts?: {
82
81
  defaultText?: string | undefined;
82
+ placeholder?: string | undefined;
83
83
  confirmButtonText?: string | undefined;
84
84
  confirmButtonVariant?: Variant | undefined;
85
85
  cancelButtonText?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.9.4-beta-prompt.1",
3
+ "version": "3.9.4-beta-prompt.2",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -285,10 +285,9 @@ let onPromptClosed: (result: string | null) => void;
285
285
  export const prompt = async (
286
286
  title: string,
287
287
  text: string,
288
- currentInputFieldText: string,
289
288
  opts?: {
290
- placeholder?: string,
291
289
  defaultText?: string,
290
+ placeholder?: string,
292
291
  confirmButtonText?: string,
293
292
  confirmButtonVariant?: Variant,
294
293
  cancelButtonText?: string,
@@ -352,7 +351,7 @@ export const prompt = async (
352
351
  setPromptInfo({
353
352
  title,
354
353
  text,
355
- currentInputFieldText,
354
+ currentInputFieldText: (opts?.defaultText ?? ''),
356
355
  opts: (opts ?? {}),
357
356
  });
358
357
  });
@@ -719,10 +718,11 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
719
718
  onTopOfOtherModals
720
719
  dontAllowBackdropExit
721
720
  >
722
- <div className="d-flex flex-column align-items-center">
721
+ <div className="p-3">
723
722
  <p>{promptInfo.text}</p>
724
723
  <input
725
724
  type="text"
725
+ className="form-control mb-2"
726
726
  placeholder={promptInfo.opts.placeholder}
727
727
  value={promptInfo.currentInputFieldText}
728
728
  onChange={(e) => {
@@ -733,14 +733,14 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
733
733
  }}
734
734
  />
735
735
  {minNumCharsValidationError && (
736
- <div className="text-danger bg-danger bg-opacity-25 p-2 m-1 rounded">
737
- {minNumCharsValidationError}
738
- </div>
736
+ <div className="text-danger fw-bold mt-2">
737
+ {minNumCharsValidationError}
738
+ </div>
739
739
  )}
740
740
  {customValidationError && (
741
- <div className="text-danger bg-danger bg-opacity-25 p-2 m-1 rounded">
742
- {customValidationError}
743
- </div>
741
+ <div className="text-danger fw-bold mt-2">
742
+ {customValidationError}
743
+ </div>
744
744
  )}
745
745
  </div>
746
746
  </ModalForWrapper>