@awell-health/ui-library 0.1.144 → 0.1.146

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/dist/index.js CHANGED
@@ -51376,8 +51376,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51376
51376
 
51377
51377
  var SingleFileInputField = function (_a) {
51378
51378
  var _b, _c, _d, _e, _f;
51379
- var id = _a.id,label = _a.label,accept = _a.accept,error = _a.error,onChange = _a.onChange,onError = _a.onError,_g = _a.className,className = _g === void 0 ? '' : _g,dataCy = _a.dataCy,onFileUpload = _a.onFileUpload,configSlug = _a.configSlug,value = _a.value,mandatory = _a.mandatory,disabled = _a.disabled;
51380
- var _h = React.useState(!lodash.exports.isNil(value) && !lodash.exports.isEmpty(value) ?
51379
+ var id = _a.id,label = _a.label,accept = _a.accept,error = _a.error,onChange = _a.onChange,onError = _a.onError,_g = _a.className,className = _g === void 0 ? '' : _g,dataCy = _a.dataCy,onFileUpload = _a.onFileUpload,configSlug = _a.configSlug,value = _a.value,mandatory = _a.mandatory,disabled = _a.disabled,_h = _a.maxFileSizeMb,maxFileSizeMb = _h === void 0 ? 30 : _h;
51380
+ var _j = React.useState(!lodash.exports.isNil(value) && !lodash.exports.isEmpty(value) ?
51381
51381
  {
51382
51382
  id: (_b = value.filename) !== null && _b !== void 0 ? _b : 'untitled',
51383
51383
  name: (_c = value.filename) !== null && _c !== void 0 ? _c : 'untitled',
@@ -51387,7 +51387,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51387
51387
  progress: 100,
51388
51388
  error: undefined } :
51389
51389
 
51390
- undefined),selectedFile = _h[0],setSelectedFile = _h[1];
51390
+ undefined),selectedFile = _j[0],setSelectedFile = _j[1];
51391
51391
  React.useEffect(function () {
51392
51392
  var _a, _b, _c, _d, _e;
51393
51393
  if (!lodash.exports.isNil(value) && !lodash.exports.isEmpty(value) && !selectedFile) {
@@ -51496,7 +51496,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51496
51496
  if (value && disabled === true) {
51497
51497
  return jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$9.file_input_field_container, " ").concat(className), "data-cy": dataCy }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), !value.url ? jsxRuntime.exports.jsx("div", { children: "No file uploaded" }) : jsxRuntime.exports.jsxs("div", __assign({ className: classes$9.read_only_file }, { children: [value.filename, " (", value.contentType, ")"] }))] }), id);
51498
51498
  }
51499
- return jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$9.file_input_field_container, " ").concat(className), "data-cy": dataCy }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), error && jsxRuntime.exports.jsx("div", __assign({ className: classes$9.error_message }, { children: error })), jsxRuntime.exports.jsx("div", __assign({ className: classes$9.file_upload_wrapper }, { children: jsxRuntime.exports.jsx(df, { onChange: handleFilesChange, onError: onError, isMultiple: false, accept: accept, error: error, maxSizeMb: 5 }) })), selectedFile && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$9.file_list_wrapper, " ").concat(classes$9.custom_file_list_container) }, { children: jsxRuntime.exports.jsx(uf, { files: [selectedFile], onDelete: function () {return handleRemoveFile();}, generalProgress: selectedFile.progress !== undefined && selectedFile.progress < 100 ?
51499
+ return jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$9.file_input_field_container, " ").concat(className), "data-cy": dataCy }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), error && jsxRuntime.exports.jsx("div", __assign({ className: classes$9.error_message }, { children: error })), jsxRuntime.exports.jsx("div", __assign({ className: classes$9.file_upload_wrapper }, { children: jsxRuntime.exports.jsx(df, { onChange: handleFilesChange, onError: onError, isMultiple: false, accept: accept, error: error, maxSizeMb: maxFileSizeMb }) })), selectedFile && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$9.file_list_wrapper, " ").concat(classes$9.custom_file_list_container) }, { children: jsxRuntime.exports.jsx(uf, { files: [selectedFile], onDelete: function () {return handleRemoveFile();}, generalProgress: selectedFile.progress !== undefined && selectedFile.progress < 100 ?
51500
51500
  selectedFile.progress :
51501
51501
  undefined }) }))] }), id);
51502
51502
  };
@@ -51528,7 +51528,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51528
51528
  var AUTO_PROGRESS_DELAY = 850;
51529
51529
  var QuestionData = function (_a) {
51530
51530
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
51531
- var question = _a.question,control = _a.control,getValues = _a.getValues,labels = _a.labels,_m = _a.inputAutoFocus,inputAutoFocus = _m === void 0 ? false : _m,_o = _a.submitAndMoveToNextQuestion,submitAndMoveToNextQuestion = _o === void 0 ? lodash.exports.noop : _o,_p = _a.onAnswerChange,onAnswerChange = _p === void 0 ? lodash.exports.noop : _p,_q = _a.shouldAutoProgress,shouldAutoProgress = _q === void 0 ? function () {return false;} : _q,onFileUpload = _a.onFileUpload;
51531
+ var question = _a.question,control = _a.control,getValues = _a.getValues,labels = _a.labels,_m = _a.inputAutoFocus,inputAutoFocus = _m === void 0 ? false : _m,_o = _a.submitAndMoveToNextQuestion,submitAndMoveToNextQuestion = _o === void 0 ? lodash.exports.noop : _o,_p = _a.onAnswerChange,onAnswerChange = _p === void 0 ? lodash.exports.noop : _p,_q = _a.shouldAutoProgress,shouldAutoProgress = _q === void 0 ? function () {return false;} : _q,onFileUpload = _a.onFileUpload,maxFileSizeMb = _a.maxFileSizeMb;
51532
51532
  var config = question === null || question === void 0 ? void 0 : question.questionConfig;
51533
51533
  var notifyAnswerChange = function (value) {
51534
51534
  onAnswerChange({ questionId: question.id, value: value });
@@ -51581,7 +51581,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51581
51581
  if (value !== mapped) {
51582
51582
  notifyAnswerChange(mapped);
51583
51583
  }
51584
- }, isMulti: true, options: optionsToSelectItems((_c = question.options) !== null && _c !== void 0 ? _c : []), required: config === null || config === void 0 ? void 0 : config.mandatory, isSearchable: true });
51584
+ }, isMulti: true, options: optionsToSelectItems((_c = question.options) !== null && _c !== void 0 ? _c : []), required: config === null || config === void 0 ? void 0 : config.mandatory, isSearchable: true, menuPosition: "fixed" });
51585
51585
  }
51586
51586
  return jsxRuntime.exports.jsx(MultipleChoiceQuestion, { label: question.title, options: (_d = question.options) !== null && _d !== void 0 ? _d : [], onChange: function (data) {
51587
51587
  onChange(data);
@@ -51599,7 +51599,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51599
51599
  var mapped = selectValueToSingleValue(selected);
51600
51600
  onChange(mapped);
51601
51601
  notifyAnswerChange(mapped);
51602
- }, options: optionsToSelectItems((_d = question.options) !== null && _d !== void 0 ? _d : []), required: config === null || config === void 0 ? void 0 : config.mandatory, isSearchable: true });
51602
+ }, options: optionsToSelectItems((_d = question.options) !== null && _d !== void 0 ? _d : []), required: config === null || config === void 0 ? void 0 : config.mandatory, isSearchable: true, menuPosition: "fixed" });
51603
51603
  }
51604
51604
  return jsxRuntime.exports.jsx(SingleChoiceQuestion, { label: question.title, options: question.options || [], onChange: function (data) {
51605
51605
  onChange(data);
@@ -51736,7 +51736,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51736
51736
  '';
51737
51737
  onControllerChange(attachmentValue);
51738
51738
  notifyAnswerChange(attachmentValue);
51739
- }, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : undefined, configSlug: (_d = config === null || config === void 0 ? void 0 : config.file_storage) === null || _d === void 0 ? void 0 : _d.file_storage_config_slug, onFileUpload: onFileUpload, label: question.title, mandatory: config === null || config === void 0 ? void 0 : config.mandatory, error: fieldError === null || fieldError === void 0 ? void 0 : fieldError.message });
51739
+ }, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : undefined, configSlug: (_d = config === null || config === void 0 ? void 0 : config.file_storage) === null || _d === void 0 ? void 0 : _d.file_storage_config_slug, onFileUpload: onFileUpload, maxFileSizeMb: maxFileSizeMb, label: question.title, mandatory: config === null || config === void 0 ? void 0 : config.mandatory, error: fieldError === null || fieldError === void 0 ? void 0 : fieldError.message });
51740
51740
  } });
51741
51741
  case exports.UserQuestionType.Image:
51742
51742
  return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, defaultValue: [], rules: {
@@ -51758,7 +51758,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51758
51758
  '';
51759
51759
  onControllerChange(attachmentValue);
51760
51760
  notifyAnswerChange(attachmentValue);
51761
- }, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : ['image/*'], configSlug: (_d = config === null || config === void 0 ? void 0 : config.file_storage) === null || _d === void 0 ? void 0 : _d.file_storage_config_slug, onFileUpload: onFileUpload, label: question.title, mandatory: config === null || config === void 0 ? void 0 : config.mandatory, error: fieldError === null || fieldError === void 0 ? void 0 : fieldError.message });
51761
+ }, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : ['image/*'], configSlug: (_d = config === null || config === void 0 ? void 0 : config.file_storage) === null || _d === void 0 ? void 0 : _d.file_storage_config_slug, onFileUpload: onFileUpload, maxFileSizeMb: maxFileSizeMb, label: question.title, mandatory: config === null || config === void 0 ? void 0 : config.mandatory, error: fieldError === null || fieldError === void 0 ? void 0 : fieldError.message });
51762
51762
  } });
51763
51763
  case exports.UserQuestionType.Description:
51764
51764
  return jsxRuntime.exports.jsx(Description, { content: question.title });
@@ -51773,7 +51773,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51773
51773
  slider: {
51774
51774
  tooltip_guide: 'Touch to select a value' } } :
51775
51775
 
51776
- _b,_c = _a.inputAutoFocus,inputAutoFocus = _c === void 0 ? false : _c,submitAndMoveToNextQuestion = _a.submitAndMoveToNextQuestion,onAnswerChange = _a.onAnswerChange,shouldAutoProgress = _a.shouldAutoProgress,onFileUpload = _a.onFileUpload;
51776
+ _b,_c = _a.inputAutoFocus,inputAutoFocus = _c === void 0 ? false : _c,submitAndMoveToNextQuestion = _a.submitAndMoveToNextQuestion,onAnswerChange = _a.onAnswerChange,shouldAutoProgress = _a.shouldAutoProgress,onFileUpload = _a.onFileUpload,maxFileSizeMb = _a.maxFileSizeMb;
51777
51777
  var _d = React.useState(0),isVisible = _d[0],setVisible = _d[1];
51778
51778
  var style = { '--awell-question-opacity': isVisible };
51779
51779
  React.useLayoutEffect(function () {
@@ -51785,7 +51785,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51785
51785
  var id = _a.id;
51786
51786
  return id === question.id;
51787
51787
  });
51788
- return jsxRuntime.exports.jsxs("div", __assign({ style: style, className: classes$b.awell_question }, { children: [jsxRuntime.exports.jsx(QuestionData, { question: question, control: control, getValues: getValues, labels: labels, inputAutoFocus: inputAutoFocus, submitAndMoveToNextQuestion: submitAndMoveToNextQuestion, onAnswerChange: onAnswerChange, shouldAutoProgress: shouldAutoProgress, onFileUpload: onFileUpload }), currentError && jsxRuntime.exports.jsx("div", __assign({ className: classes$b.error }, { children: jsxRuntime.exports.jsx(Text, __assign({ variant: "textSmall", color: "var(--awell-signalError100)" }, { children: currentError.error })) }))] }));
51788
+ return jsxRuntime.exports.jsxs("div", __assign({ style: style, className: classes$b.awell_question }, { children: [jsxRuntime.exports.jsx(QuestionData, { question: question, control: control, getValues: getValues, labels: labels, inputAutoFocus: inputAutoFocus, submitAndMoveToNextQuestion: submitAndMoveToNextQuestion, onAnswerChange: onAnswerChange, shouldAutoProgress: shouldAutoProgress, onFileUpload: onFileUpload, maxFileSizeMb: maxFileSizeMb }), currentError && jsxRuntime.exports.jsx("div", __assign({ className: classes$b.error }, { children: jsxRuntime.exports.jsx(Text, __assign({ variant: "textSmall", color: "var(--awell-signalError100)" }, { children: currentError.error })) }))] }));
51789
51789
  };
51790
51790
 
51791
51791
  var classes$8 = {"awell_attachment_list":"awell__attachmentList_awell_attachment_list"};
@@ -52861,7 +52861,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
52861
52861
  };
52862
52862
 
52863
52863
  var ConversationalForm = function (_a) {
52864
- var form = _a.form,onSubmit = _a.onSubmit,buttonLabels = _a.buttonLabels,evaluateDisplayConditions = _a.evaluateDisplayConditions,errorLabels = _a.errorLabels,questionLabels = _a.questionLabels,storedAnswers = _a.storedAnswers,onAnswersChange = _a.onAnswersChange,_b = _a.autoProgress,autoProgress = _b === void 0 ? false : _b,_c = _a.autosaveAnswers,autosaveAnswers = _c === void 0 ? true : _c,_d = _a.showProgressBar,showProgressBar = _d === void 0 ? true : _d,onFileUpload = _a.onFileUpload;
52864
+ var form = _a.form,onSubmit = _a.onSubmit,buttonLabels = _a.buttonLabels,evaluateDisplayConditions = _a.evaluateDisplayConditions,errorLabels = _a.errorLabels,questionLabels = _a.questionLabels,storedAnswers = _a.storedAnswers,onAnswersChange = _a.onAnswersChange,_b = _a.autoProgress,autoProgress = _b === void 0 ? false : _b,_c = _a.autosaveAnswers,autosaveAnswers = _c === void 0 ? true : _c,_d = _a.showProgressBar,showProgressBar = _d === void 0 ? true : _d,onFileUpload = _a.onFileUpload,maxFileSizeMb = _a.maxFileSizeMb;
52865
52865
  var _e = useConversationalForm({
52866
52866
  questions: form.questions,
52867
52867
  onSubmit: onSubmit,
@@ -52889,13 +52889,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
52889
52889
  form.questions.length === 1 ||
52890
52890
  showProgressBar === false;
52891
52891
  return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [jsxRuntime.exports.jsx("main", __assign({ id: "ahp_main_content_with_scroll_hint", className: layoutClasses.main_content }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$4.awell_wizard_form, " ").concat(classes$4.container) }, { children: [!hideProgressIndicator && jsxRuntime.exports.jsx("div", __assign({ className: classes$4.form_progress }, { children: jsxRuntime.exports.jsx(ProgressIndicator, { percentageCompleted: percentageCompleted }) })), isEvaluatingQuestionVisibility ||
52892
- (currentQuestion === null || currentQuestion === void 0 ? void 0 : currentQuestion.id) === undefined ? jsxRuntime.exports.jsx("div", __assign({ className: classes$4.loadingContainer }, { children: jsxRuntime.exports.jsx(LoadActivityPlaceholder, {}) })) : jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$4.wizard_form }, { children: [jsxRuntime.exports.jsx(Question, { question: currentQuestion, control: control, getValues: getValues, errors: errors, labels: questionLabels, submitAndMoveToNextQuestion: submitAndMoveToNextQuestion, inputAutoFocus: true, shouldAutoProgress: shouldAutoProgress, onFileUpload: onFileUpload }, currentQuestion.id), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$4.trademark, " ").concat(classes$4.conversational) }, { children: form.trademark }))] })) })] })) })), jsxRuntime.exports.jsx(HostedPageFooter, { children: !isEvaluatingQuestionVisibility && jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$4.conversational_button_wrapper, " ").concat(classes$4.container) }, { children: [jsxRuntime.exports.jsx("div", { children: !isFirstQuestion && jsxRuntime.exports.jsx(Button, __assign({ variant: "tertiary", onClick: handleGoToPrevQuestion, "data-cy": "navigateToPrevQuestionButton" }, { children: buttonLabels.prev })) }), isLastQuestion ? jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit })) : jsxRuntime.exports.jsx(Button, __assign({ variant: "secondary", onClick: handleGoToNextQuestion, "data-cy": "navigateToNextQuestionButton" }, { children: buttonLabels.next }))] })) })] });
52892
+ (currentQuestion === null || currentQuestion === void 0 ? void 0 : currentQuestion.id) === undefined ? jsxRuntime.exports.jsx("div", __assign({ className: classes$4.loadingContainer }, { children: jsxRuntime.exports.jsx(LoadActivityPlaceholder, {}) })) : jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$4.wizard_form }, { children: [jsxRuntime.exports.jsx(Question, { question: currentQuestion, control: control, getValues: getValues, errors: errors, labels: questionLabels, submitAndMoveToNextQuestion: submitAndMoveToNextQuestion, inputAutoFocus: true, shouldAutoProgress: shouldAutoProgress, onFileUpload: onFileUpload, maxFileSizeMb: maxFileSizeMb }, currentQuestion.id), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$4.trademark, " ").concat(classes$4.conversational) }, { children: form.trademark }))] })) })] })) })), jsxRuntime.exports.jsx(HostedPageFooter, { children: !isEvaluatingQuestionVisibility && jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$4.conversational_button_wrapper, " ").concat(classes$4.container) }, { children: [jsxRuntime.exports.jsx("div", { children: !isFirstQuestion && jsxRuntime.exports.jsx(Button, __assign({ variant: "tertiary", onClick: handleGoToPrevQuestion, "data-cy": "navigateToPrevQuestionButton" }, { children: buttonLabels.prev })) }), isLastQuestion ? jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit })) : jsxRuntime.exports.jsx(Button, __assign({ variant: "secondary", onClick: handleGoToNextQuestion, "data-cy": "navigateToNextQuestionButton" }, { children: buttonLabels.next }))] })) })] });
52893
52893
  };
52894
52894
 
52895
52895
  function r(e) {var t,f,n = "";if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) {var o = e.length;for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);} else for (f in e) e[f] && (n && (n += " "), n += f);return n;}function clsx() {for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);return n;}
52896
52896
 
52897
52897
  var TraditionalForm = function (_a) {
52898
- var form = _a.form,onSubmit = _a.onSubmit,buttonLabels = _a.buttonLabels,evaluateDisplayConditions = _a.evaluateDisplayConditions,errorLabels = _a.errorLabels,storedAnswers = _a.storedAnswers,onAnswersChange = _a.onAnswersChange,_b = _a.autosaveAnswers,autosaveAnswers = _b === void 0 ? true : _b,questionLabels = _a.questionLabels,onFileUpload = _a.onFileUpload;
52898
+ var form = _a.form,onSubmit = _a.onSubmit,buttonLabels = _a.buttonLabels,evaluateDisplayConditions = _a.evaluateDisplayConditions,errorLabels = _a.errorLabels,storedAnswers = _a.storedAnswers,onAnswersChange = _a.onAnswersChange,_b = _a.autosaveAnswers,autosaveAnswers = _b === void 0 ? true : _b,questionLabels = _a.questionLabels,onFileUpload = _a.onFileUpload,maxFileSizeMb = _a.maxFileSizeMb;
52899
52899
  var _c = useTraditionalForm({
52900
52900
  questions: form.questions,
52901
52901
  onSubmit: onSubmit,
@@ -52907,7 +52907,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
52907
52907
  updateQuestionVisibility = _c.updateQuestionVisibility,submitForm = _c.submitForm,isSubmittingForm = _c.isSubmittingForm,_d = _c.formMethods,control = _d.control,getValues = _d.getValues,errors = _c.errors,questionWithVisiblity = _c.questionWithVisiblity,formHasErrors = _c.formHasErrors;
52908
52908
  return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [jsxRuntime.exports.jsx("main", __assign({ id: "ahp_main_content_with_scroll_hint", className: clsx(layoutClasses.main_content, classes$4.traditional_form) }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: clsx(classes$4.container, classes$4.traditional_container) }, { children: [!questionWithVisiblity ? jsxRuntime.exports.jsx("div", __assign({ className: classes$4.loadingContainer }, { children: jsxRuntime.exports.jsx(LoadActivityPlaceholder, {}) })) : jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx("div", { children: questionWithVisiblity.
52909
52909
  filter(function (vb) {return vb.visible;}).
52910
- map(function (visibleQuestion) {return jsxRuntime.exports.jsx("div", __assign({ className: classes$4.traditional_form_question }, { children: jsxRuntime.exports.jsx(Question, { question: visibleQuestion, control: control, getValues: getValues, errors: errors, inputAutoFocus: false, onAnswerChange: updateQuestionVisibility, labels: questionLabels, onFileUpload: onFileUpload }, visibleQuestion.id) }), visibleQuestion.id);}) }) }), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: classes$4.trademark }, { children: form.trademark }))] })) })), jsxRuntime.exports.jsx(HostedPageFooter, __assign({ fixPosition: true }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$4.traditional_button_wrapper }, { children: [formHasErrors && jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx(Text, __assign({ variant: "textSmall", color: "var(--awell-signalError100)" }, { children: errorLabels.formHasErrors })) }), jsxRuntime.exports.jsx("div", {}), jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit }))] })) }))] });
52910
+ map(function (visibleQuestion) {return jsxRuntime.exports.jsx("div", __assign({ className: classes$4.traditional_form_question }, { children: jsxRuntime.exports.jsx(Question, { question: visibleQuestion, control: control, getValues: getValues, errors: errors, inputAutoFocus: false, onAnswerChange: updateQuestionVisibility, labels: questionLabels, onFileUpload: onFileUpload, maxFileSizeMb: maxFileSizeMb }, visibleQuestion.id) }), visibleQuestion.id);}) }) }), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: classes$4.trademark }, { children: form.trademark }))] })) })), jsxRuntime.exports.jsx(HostedPageFooter, __assign({ fixPosition: true }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$4.traditional_button_wrapper }, { children: [formHasErrors && jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx(Text, __assign({ variant: "textSmall", color: "var(--awell-signalError100)" }, { children: errorLabels.formHasErrors })) }), jsxRuntime.exports.jsx("div", {}), jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit }))] })) }))] });
52911
52911
  };
52912
52912
 
52913
52913
  var WizardForm = ConversationalForm;
@@ -16,6 +16,7 @@ interface Props {
16
16
  configSlug?: string;
17
17
  value?: Array<Attachment>;
18
18
  mandatory?: boolean;
19
+ maxFileSizeMb?: number;
19
20
  }
20
21
  export declare const FileInputField: React.FC<Props>;
21
22
  export {};
@@ -16,6 +16,7 @@ interface Props {
16
16
  value?: Attachment | null;
17
17
  mandatory?: boolean;
18
18
  disabled?: boolean;
19
+ maxFileSizeMb?: number;
19
20
  }
20
21
  export declare const SingleFileInputField: React.FC<Props>;
21
22
  export {};
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { FormProps } from '../../../types/form';
3
- export declare const ConversationalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, showProgressBar, onFileUpload, }: FormProps) => JSX.Element;
3
+ export declare const ConversationalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, showProgressBar, onFileUpload, maxFileSizeMb, }: FormProps) => JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { FormProps } from '../../../types/form';
3
- export declare const TraditionalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, storedAnswers, onAnswersChange, autosaveAnswers, questionLabels, onFileUpload, }: FormProps) => JSX.Element;
3
+ export declare const TraditionalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, storedAnswers, onAnswersChange, autosaveAnswers, questionLabels, onFileUpload, maxFileSizeMb, }: FormProps) => JSX.Element;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const WizardForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, showProgressBar, onFileUpload, }: import("../../..").FormProps) => JSX.Element;
2
+ export declare const WizardForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, showProgressBar, onFileUpload, maxFileSizeMb, }: import("../../..").FormProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { QuestionDataProps, QuestionProps } from './types';
3
- export declare const QuestionData: ({ question, control, getValues, labels, inputAutoFocus, submitAndMoveToNextQuestion, onAnswerChange, shouldAutoProgress, onFileUpload, }: QuestionDataProps) => JSX.Element;
4
- export declare const Question: ({ question, control, getValues, errors, labels, inputAutoFocus, submitAndMoveToNextQuestion, onAnswerChange, shouldAutoProgress, onFileUpload, }: QuestionProps) => JSX.Element;
3
+ export declare const QuestionData: ({ question, control, getValues, labels, inputAutoFocus, submitAndMoveToNextQuestion, onAnswerChange, shouldAutoProgress, onFileUpload, maxFileSizeMb, }: QuestionDataProps) => JSX.Element;
4
+ export declare const Question: ({ question, control, getValues, errors, labels, inputAutoFocus, submitAndMoveToNextQuestion, onAnswerChange, shouldAutoProgress, onFileUpload, maxFileSizeMb, }: QuestionProps) => JSX.Element;
@@ -29,6 +29,7 @@ export interface QuestionDataProps {
29
29
  onAnswerChange?: (change?: AnswerChange) => void;
30
30
  shouldAutoProgress?: (question: Question) => boolean;
31
31
  onFileUpload?: (file: File, configSlug?: string) => Promise<string>;
32
+ maxFileSizeMb?: number;
32
33
  }
33
34
  export interface QuestionProps {
34
35
  question: Question;
@@ -41,6 +42,7 @@ export interface QuestionProps {
41
42
  onAnswerChange?: (change?: AnswerChange) => void;
42
43
  shouldAutoProgress?: (question: Question) => boolean;
43
44
  onFileUpload?: (file: File, configSlug?: string) => Promise<string>;
45
+ maxFileSizeMb?: number;
44
46
  }
45
47
  export interface Attachment {
46
48
  url?: string;
@@ -25,4 +25,5 @@ export interface FormProps {
25
25
  autosaveAnswers?: boolean;
26
26
  showProgressBar?: boolean;
27
27
  onFileUpload?: (file: File, configSlug?: string) => Promise<string>;
28
+ maxFileSizeMb?: number;
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/ui-library",
3
- "version": "0.1.144",
3
+ "version": "0.1.146",
4
4
  "description": "UI components to integrate with Awell Health",
5
5
  "repository": {
6
6
  "type": "git",