@awell-health/ui-library 0.1.33
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/README.md +77 -0
- package/dist/index.css +8917 -0
- package/dist/index.js +50543 -0
- package/dist/types/atoms/button/Button.d.ts +8 -0
- package/dist/types/atoms/button/index.d.ts +2 -0
- package/dist/types/atoms/checkboxButton/CheckboxButton.d.ts +8 -0
- package/dist/types/atoms/checkboxButton/index.d.ts +2 -0
- package/dist/types/atoms/datePicker/DatePicker.d.ts +10 -0
- package/dist/types/atoms/datePicker/index.d.ts +1 -0
- package/dist/types/atoms/description/Description.d.ts +6 -0
- package/dist/types/atoms/description/index.d.ts +2 -0
- package/dist/types/atoms/index.d.ts +21 -0
- package/dist/types/atoms/inputField/InputField.d.ts +10 -0
- package/dist/types/atoms/inputField/index.d.ts +2 -0
- package/dist/types/atoms/logo/Logo.d.ts +6 -0
- package/dist/types/atoms/logo/index.d.ts +2 -0
- package/dist/types/atoms/longTextField/LongTextField.d.ts +9 -0
- package/dist/types/atoms/longTextField/index.d.ts +2 -0
- package/dist/types/atoms/messageAttachment/MessageAttachment.d.ts +8 -0
- package/dist/types/atoms/messageAttachment/index.d.ts +2 -0
- package/dist/types/atoms/modal/Modal.d.ts +11 -0
- package/dist/types/atoms/modal/index.d.ts +1 -0
- package/dist/types/atoms/phoneInputField/PhoneInputField.d.ts +22 -0
- package/dist/types/atoms/phoneInputField/helpers.d.ts +3 -0
- package/dist/types/atoms/phoneInputField/index.d.ts +3 -0
- package/dist/types/atoms/progressIndicator/ProgressIndicator.d.ts +6 -0
- package/dist/types/atoms/progressIndicator/index.d.ts +1 -0
- package/dist/types/atoms/questionLabel/QuestionLabel.d.ts +6 -0
- package/dist/types/atoms/questionLabel/index.d.ts +2 -0
- package/dist/types/atoms/radioButton/RadioButton.d.ts +9 -0
- package/dist/types/atoms/radioButton/index.d.ts +2 -0
- package/dist/types/atoms/rangeInput/RangeInput.d.ts +18 -0
- package/dist/types/atoms/rangeInput/index.d.ts +2 -0
- package/dist/types/atoms/richTextViewer/RichTextViewer.d.ts +6 -0
- package/dist/types/atoms/richTextViewer/index.d.ts +1 -0
- package/dist/types/atoms/richTextViewer/serializeHtml.d.ts +3 -0
- package/dist/types/atoms/scheduling/cal.com/CalDotComScheduling.d.ts +11 -0
- package/dist/types/atoms/scheduling/cal.com/calDotComTypes.d.ts +8 -0
- package/dist/types/atoms/scheduling/cal.com/index.d.ts +2 -0
- package/dist/types/atoms/scheduling/index.d.ts +1 -0
- package/dist/types/atoms/scrollIndicator/ScrollIndicator.d.ts +2 -0
- package/dist/types/atoms/scrollIndicator/index.d.ts +1 -0
- package/dist/types/atoms/select/Select.d.ts +22 -0
- package/dist/types/atoms/select/index.d.ts +3 -0
- package/dist/types/atoms/select/types.d.ts +1 -0
- package/dist/types/atoms/spinner/Spinner.d.ts +7 -0
- package/dist/types/atoms/spinner/index.d.ts +1 -0
- package/dist/types/atoms/themeProvider/ThemeProvider.d.ts +6 -0
- package/dist/types/atoms/themeProvider/helpers.d.ts +3 -0
- package/dist/types/atoms/themeProvider/index.d.ts +2 -0
- package/dist/types/atoms/typingCaret/TypingCaret.d.ts +8 -0
- package/dist/types/atoms/typingCaret/index.d.ts +1 -0
- package/dist/types/atoms/typography/Typography.d.ts +22 -0
- package/dist/types/atoms/typography/index.d.ts +3 -0
- package/dist/types/atoms/typography/types.d.ts +3 -0
- package/dist/types/constants/descriptionFixture.d.ts +56 -0
- package/dist/types/constants/formFixture.d.ts +3 -0
- package/dist/types/constants/messageFixture.d.ts +56 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/useAccentColor/index.d.ts +1 -0
- package/dist/types/hooks/useAccentColor/useAccentColor.d.ts +5 -0
- package/dist/types/hooks/useClickOutsideNotifier/index.d.ts +7 -0
- package/dist/types/hooks/useForm/helpers.d.ts +20 -0
- package/dist/types/hooks/useForm/index.d.ts +2 -0
- package/dist/types/hooks/useForm/types.d.ts +55 -0
- package/dist/types/hooks/useForm/useConversationalForm.d.ts +3 -0
- package/dist/types/hooks/useForm/useTraditionalForm.d.ts +3 -0
- package/dist/types/hooks/useHtmlScript.d.ts +5 -0
- package/dist/types/hooks/useScrollHint/index.d.ts +1 -0
- package/dist/types/hooks/useScrollHint/useScrollHint.d.ts +6 -0
- package/dist/types/hooks/useValidate/index.d.ts +2 -0
- package/dist/types/hooks/useValidate/types.d.ts +24 -0
- package/dist/types/hooks/useValidate/useValidate.d.ts +9 -0
- package/dist/types/hostedPages/activities/checklist/Checklist.d.ts +14 -0
- package/dist/types/hostedPages/activities/checklist/index.d.ts +2 -0
- package/dist/types/hostedPages/activities/cloudinary/CloudinarySingleFileUpload.d.ts +3 -0
- package/dist/types/hostedPages/activities/cloudinary/CloudinaryUpload.d.ts +3 -0
- package/dist/types/hostedPages/activities/cloudinary/components/CloudinaryUploadWidget.d.ts +10 -0
- package/dist/types/hostedPages/activities/cloudinary/components/index.d.ts +1 -0
- package/dist/types/hostedPages/activities/cloudinary/index.d.ts +2 -0
- package/dist/types/hostedPages/activities/cloudinary/types.d.ts +86 -0
- package/dist/types/hostedPages/activities/cloudinary/utils.d.ts +5 -0
- package/dist/types/hostedPages/activities/form/ConversationalForm.d.ts +3 -0
- package/dist/types/hostedPages/activities/form/TraditionalForm.d.ts +3 -0
- package/dist/types/hostedPages/activities/form/__testdata__/eq5d5lFixture.d.ts +51 -0
- package/dist/types/hostedPages/activities/form/__testdata__/testFormFixture.d.ts +5 -0
- package/dist/types/hostedPages/activities/form/index.d.ts +2 -0
- package/dist/types/hostedPages/activities/form/types.d.ts +20 -0
- package/dist/types/hostedPages/activities/message/Message.d.ts +3 -0
- package/dist/types/hostedPages/activities/message/index.d.ts +1 -0
- package/dist/types/hostedPages/activities/message/types.d.ts +16 -0
- package/dist/types/hostedPages/activities/scheduling/cal.com/CalDotcomActivity.d.ts +3 -0
- package/dist/types/hostedPages/activities/scheduling/cal.com/index.d.ts +1 -0
- package/dist/types/hostedPages/activities/scheduling/cal.com/types.d.ts +6 -0
- package/dist/types/hostedPages/activities/scheduling/index.d.ts +1 -0
- package/dist/types/hostedPages/activities/wizardForm/WizardForm.d.ts +2 -0
- package/dist/types/hostedPages/activities/wizardForm/__testdata__/testFormFixture.d.ts +6 -0
- package/dist/types/hostedPages/activities/wizardForm/index.d.ts +1 -0
- package/dist/types/hostedPages/index.d.ts +9 -0
- package/dist/types/hostedPages/layouts/HostedPageLayout/CloseButton/CloseButton.d.ts +6 -0
- package/dist/types/hostedPages/layouts/HostedPageLayout/CloseButton/index.d.ts +1 -0
- package/dist/types/hostedPages/layouts/HostedPageLayout/HostedPageFooter/HostedPageFooter.d.ts +6 -0
- package/dist/types/hostedPages/layouts/HostedPageLayout/HostedPageFooter/index.d.ts +1 -0
- package/dist/types/hostedPages/layouts/HostedPageLayout/HostedPageLayout.d.ts +8 -0
- package/dist/types/hostedPages/layouts/HostedPageLayout/index.d.ts +2 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/molecules/attachmentList/AttachmentList.d.ts +3 -0
- package/dist/types/molecules/attachmentList/index.d.ts +2 -0
- package/dist/types/molecules/attachmentList/types.d.ts +8 -0
- package/dist/types/molecules/avaGPT/avaGPT.d.ts +3 -0
- package/dist/types/molecules/avaGPT/index.d.ts +1 -0
- package/dist/types/molecules/avaGPT/types.d.ts +12 -0
- package/dist/types/molecules/index.d.ts +5 -0
- package/dist/types/molecules/multipleChoiceQuestion/MultipleChoiceQuestion.d.ts +11 -0
- package/dist/types/molecules/multipleChoiceQuestion/index.d.ts +1 -0
- package/dist/types/molecules/navbar/Navbar.d.ts +7 -0
- package/dist/types/molecules/navbar/index.d.ts +2 -0
- package/dist/types/molecules/question/Question.d.ts +4 -0
- package/dist/types/molecules/question/index.d.ts +1 -0
- package/dist/types/molecules/question/types.d.ts +31 -0
- package/dist/types/molecules/singleChoiceQuestion/SingleChoiceQuestion.d.ts +12 -0
- package/dist/types/molecules/singleChoiceQuestion/index.d.ts +1 -0
- package/dist/types/setupTests.d.ts +1 -0
- package/dist/types/types/form.d.ts +26 -0
- package/dist/types/types/generated/fragment-types.d.ts +0 -0
- package/dist/types/types/generated/types-orchestration.d.ts +1874 -0
- package/dist/types/types/index.d.ts +8 -0
- package/dist/types/types/message.d.ts +6 -0
- package/dist/types/types/question.d.ts +27 -0
- package/dist/types/types/richText.d.ts +7 -0
- package/package.json +194 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { AnswerInput, Question, FormError, QuestionWithVisibility } from '../../types';
|
|
3
|
+
export type { FormError, QuestionWithVisibility } from '../../types';
|
|
4
|
+
export { QuestionType, UserQuestionType } from '../../types';
|
|
5
|
+
export declare enum DataPointValueType {
|
|
6
|
+
Boolean = "BOOLEAN",
|
|
7
|
+
Date = "DATE",
|
|
8
|
+
Number = "NUMBER",
|
|
9
|
+
NumbersArray = "NUMBERS_ARRAY",
|
|
10
|
+
String = "STRING"
|
|
11
|
+
}
|
|
12
|
+
export declare type QuestionRuleResult = {
|
|
13
|
+
question_id: string;
|
|
14
|
+
rule_id: string;
|
|
15
|
+
satisfied: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type ErrorLabels = {
|
|
18
|
+
required: string;
|
|
19
|
+
sliderNotTouched: string;
|
|
20
|
+
invalidPhoneNumber: string;
|
|
21
|
+
formHasErrors: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type AnswerValue = string | number | number[];
|
|
24
|
+
export interface FormSettingsContextProps {
|
|
25
|
+
evaluateDisplayConditions: (response: Array<AnswerInput>) => Promise<Array<QuestionRuleResult>>;
|
|
26
|
+
onSubmit: (response: Array<AnswerInput>) => Promise<void> | void;
|
|
27
|
+
questions: Array<Question>;
|
|
28
|
+
errorLabels: ErrorLabels;
|
|
29
|
+
storedAnswers?: string;
|
|
30
|
+
autosaveAnswers?: boolean;
|
|
31
|
+
onAnswersChange?: (answers: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface ConversationalFormContext {
|
|
34
|
+
updateQuestionVisibility: () => void;
|
|
35
|
+
submitForm: () => void;
|
|
36
|
+
isSubmittingForm: boolean;
|
|
37
|
+
handleGoToNextQuestion: () => void;
|
|
38
|
+
handleGoToPrevQuestion: () => void;
|
|
39
|
+
formMethods: UseFormReturn;
|
|
40
|
+
currentQuestion: Question;
|
|
41
|
+
percentageCompleted: number;
|
|
42
|
+
errors: Array<FormError>;
|
|
43
|
+
isFirstQuestion: boolean;
|
|
44
|
+
isLastQuestion: boolean;
|
|
45
|
+
isEvaluatingQuestionVisibility: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface TraditionalFormContext {
|
|
48
|
+
updateQuestionVisibility: () => void;
|
|
49
|
+
submitForm: () => void;
|
|
50
|
+
isSubmittingForm: boolean;
|
|
51
|
+
formMethods: UseFormReturn;
|
|
52
|
+
errors: Array<FormError>;
|
|
53
|
+
questionWithVisiblity: Array<QuestionWithVisibility>;
|
|
54
|
+
formHasErrors: boolean;
|
|
55
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FormSettingsContextProps, ConversationalFormContext } from './types';
|
|
2
|
+
declare const useConversationalForm: ({ questions, evaluateDisplayConditions, onSubmit, errorLabels, storedAnswers, autosaveAnswers, onAnswersChange, }: FormSettingsContextProps) => ConversationalFormContext;
|
|
3
|
+
export { useConversationalForm };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FormSettingsContextProps, TraditionalFormContext } from './types';
|
|
2
|
+
declare const useTraditionalForm: ({ questions, evaluateDisplayConditions, onSubmit, errorLabels, storedAnswers, autosaveAnswers, onAnswersChange, }: FormSettingsContextProps) => TraditionalFormContext;
|
|
3
|
+
export { useTraditionalForm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useScrollHint } from './useScrollHint';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare type Region = 'america' | 'europe' | 'asia' | 'oceania' | 'africa';
|
|
2
|
+
declare type SubRegion = 'north-america' | 'south-america' | 'central-america' | 'carribean' | 'eu-union' | 'ex-ussr' | 'ex-yugos' | 'baltic' | 'middle-east' | 'north-africa';
|
|
3
|
+
export declare type CountryIso2 = 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bd' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bt' | 'bo' | 'ba' | 'bw' | 'br' | 'io' | 'bn' | 'bg' | 'bf' | 'bi' | 'kh' | 'cm' | 'ca' | 'cv' | 'bq' | 'cf' | 'td' | 'cl' | 'cn' | 'co' | 'km' | 'cd' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cw' | 'cy' | 'cz' | 'dk' | 'dj' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'gq' | 'er' | 'ee' | 'et' | 'fj' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gr' | 'gd' | 'gp' | 'gu' | 'gt' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hk' | 'hu' | 'is' | 'in' | 'id' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'ke' | 'ki' | 'xk' | 'kw' | 'kg' | 'la' | 'lv' | 'lb' | 'ls' | 'lr' | 'ly' | 'li' | 'lt' | 'lu' | 'mo' | 'mk' | 'mg' | 'mw' | 'my' | 'mv' | 'ml' | 'mt' | 'mh' | 'mq' | 'mr' | 'mu' | 'mx' | 'fm' | 'md' | 'mc' | 'mn' | 'me' | 'ma' | 'mz' | 'mm' | 'na' | 'nr' | 'np' | 'nl' | 'nc' | 'nz' | 'ni' | 'ne' | 'ng' | 'kp' | 'no' | 'om' | 'pk' | 'pw' | 'ps' | 'pa' | 'pg' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 're' | 'ro' | 'ru' | 'rw' | 'kn' | 'lc' | 'vc' | 'ws' | 'sm' | 'st' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sg' | 'sk' | 'si' | 'sb' | 'so' | 'za' | 'kr' | 'ss' | 'es' | 'lk' | 'sd' | 'sr' | 'sz' | 'se' | 'ch' | 'sy' | 'tw' | 'tj' | 'tz' | 'th' | 'tl' | 'tg' | 'to' | 'tt' | 'tn' | 'tr' | 'tm' | 'tv' | 'ug' | 'ua' | 'ae' | 'gb' | 'us' | 'uy' | 'uz' | 'vu' | 'va' | 've' | 'vn' | 'ye' | 'zm' | 'zw';
|
|
4
|
+
declare type BaseCountryData = [string, Array<Region | SubRegion>, CountryIso2, string];
|
|
5
|
+
declare type CountryDataWithFormat = [...BaseCountryData, string];
|
|
6
|
+
declare type CountryDataWithOrder = [...CountryDataWithFormat, number];
|
|
7
|
+
declare type CountryDataAreaCodes = [...CountryDataWithOrder, string[]];
|
|
8
|
+
export declare type CountryData = BaseCountryData | CountryDataWithFormat | CountryDataWithOrder | CountryDataAreaCodes;
|
|
9
|
+
export interface ParsedCountry {
|
|
10
|
+
name: CountryData[0];
|
|
11
|
+
regions: CountryData[1];
|
|
12
|
+
iso2: CountryData[2];
|
|
13
|
+
dialCode: CountryData[3];
|
|
14
|
+
format: CountryData[4];
|
|
15
|
+
priority: CountryData[5];
|
|
16
|
+
areaCodes: CountryData[6];
|
|
17
|
+
}
|
|
18
|
+
export interface ValidatePhoneReturn {
|
|
19
|
+
country: ParsedCountry | undefined;
|
|
20
|
+
isValid: boolean;
|
|
21
|
+
lengthMatch: boolean;
|
|
22
|
+
areaCodeMatch: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidatePhoneReturn, CountryIso2 } from './types';
|
|
2
|
+
export interface UseValidateHook {
|
|
3
|
+
validatePhoneNumber: (number: string, availableCountries?: CountryIso2 | Array<CountryIso2>) => ValidatePhoneReturn;
|
|
4
|
+
isValidE164Number: (number: string, availableCountries?: CountryIso2 | Array<CountryIso2>) => boolean;
|
|
5
|
+
isPossibleE164Number: (number: string) => boolean;
|
|
6
|
+
numberMatchesAvailableCountries: (number: string, availableCountries: CountryIso2 | Array<CountryIso2>) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const handleUSException: (number: string, originalValidation: ValidatePhoneReturn) => ValidatePhoneReturn;
|
|
9
|
+
export declare const useValidate: () => UseValidateHook;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, MouseEventHandler } from 'react';
|
|
2
|
+
export interface ChecklistItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ChecklistProps {
|
|
7
|
+
title: string;
|
|
8
|
+
items: Array<ChecklistItem>;
|
|
9
|
+
onSubmit: MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
submitLabel: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Checklist: FC<ChecklistProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UploadData, UploadWidgetOptions } from '../types';
|
|
3
|
+
interface CloudinaryUploadWidgetProps extends UploadWidgetOptions {
|
|
4
|
+
onFileUpload: (params: UploadData) => void;
|
|
5
|
+
text: {
|
|
6
|
+
uploadButton: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const CloudinaryUploadWidget: ({ onFileUpload: onFileUpload, text, ...widgetOptions }: CloudinaryUploadWidgetProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CloudinaryUploadWidget } from './CloudinaryUploadWidget';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AttachmentLabels } from '../../../types';
|
|
3
|
+
import { type MessageAttachment, MessageAttachmentType } from '../../../types/generated/types-orchestration';
|
|
4
|
+
export { MessageAttachment, MessageAttachmentType };
|
|
5
|
+
export declare type UploadData = {
|
|
6
|
+
publicId: string;
|
|
7
|
+
url: string;
|
|
8
|
+
original_filename: string;
|
|
9
|
+
};
|
|
10
|
+
export declare type OnFileUpload = (data: UploadData) => void;
|
|
11
|
+
export interface CloudinaryExtensionProps {
|
|
12
|
+
cloudName: string;
|
|
13
|
+
uploadPreset: string;
|
|
14
|
+
folder?: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
context?: Record<string, string>;
|
|
17
|
+
onFinish: (data: UploadData[]) => void;
|
|
18
|
+
text: {
|
|
19
|
+
subject: string;
|
|
20
|
+
fileCountHeader: (count: number) => string;
|
|
21
|
+
attachmentIcon: React.ReactNode;
|
|
22
|
+
attachmentLabels: AttachmentLabels;
|
|
23
|
+
buttonLabels: {
|
|
24
|
+
upload: string;
|
|
25
|
+
done: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface CloudinarySingleFileUploadProps extends Omit<CloudinaryExtensionProps, 'onFinish' | 'text'> {
|
|
30
|
+
onFinish: (data: UploadData | undefined) => void;
|
|
31
|
+
text: {
|
|
32
|
+
subject: string;
|
|
33
|
+
fileCountHeader: (fileUploaded: boolean) => string;
|
|
34
|
+
attachmentIcon: React.ReactNode;
|
|
35
|
+
attachmentLabels: AttachmentLabels;
|
|
36
|
+
buttonLabels: {
|
|
37
|
+
upload: string;
|
|
38
|
+
done: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export declare type CloudinaryExtensionSettings = {
|
|
43
|
+
cloudName: string;
|
|
44
|
+
uploadPreset: string;
|
|
45
|
+
folder?: string;
|
|
46
|
+
};
|
|
47
|
+
export declare enum ActionKey {
|
|
48
|
+
UPLOAD_FILES = "uploadFiles"
|
|
49
|
+
}
|
|
50
|
+
export declare type UploadFilesFields = {
|
|
51
|
+
uploadPreset?: string;
|
|
52
|
+
folder?: string;
|
|
53
|
+
tags?: string;
|
|
54
|
+
};
|
|
55
|
+
declare type ResourceType = 'auto' | 'image' | 'video' | 'raw';
|
|
56
|
+
declare type SourceType = 'local' | 'url' | 'camera' | 'dropbox' | 'image_search' | 'facebook' | 'instagram' | 'shutterstock' | 'gettyimages' | 'istock' | 'unsplash' | 'google_drive';
|
|
57
|
+
export interface UploadWidgetOptions {
|
|
58
|
+
cloudName: string;
|
|
59
|
+
uploadPreset: string;
|
|
60
|
+
multiple?: boolean;
|
|
61
|
+
maxFiles?: number;
|
|
62
|
+
folder?: string;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
sources?: SourceType[];
|
|
65
|
+
resourceType?: ResourceType;
|
|
66
|
+
clientAllowedFormats?: string[];
|
|
67
|
+
maxFileSize?: number;
|
|
68
|
+
maxImageFileSize?: number;
|
|
69
|
+
maxVideoFileSize?: number;
|
|
70
|
+
context?: Record<string, string>;
|
|
71
|
+
}
|
|
72
|
+
export interface ProductGalleryOptions {
|
|
73
|
+
cloudName: string;
|
|
74
|
+
container: string;
|
|
75
|
+
multiple?: boolean;
|
|
76
|
+
maxFiles?: number;
|
|
77
|
+
folder?: string;
|
|
78
|
+
tags?: string[];
|
|
79
|
+
sources?: SourceType[];
|
|
80
|
+
resourceType?: ResourceType;
|
|
81
|
+
clientAllowedFormats?: string[];
|
|
82
|
+
maxFileSize?: number;
|
|
83
|
+
maxImageFileSize?: number;
|
|
84
|
+
maxVideoFileSize?: number;
|
|
85
|
+
context?: Record<string, string>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormProps } from '../../../types/form';
|
|
3
|
+
export declare const ConversationalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, }: FormProps) => JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const form: {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
trademark: string;
|
|
5
|
+
questions: ({
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
dataPointValueType: string;
|
|
9
|
+
options: {
|
|
10
|
+
id: string;
|
|
11
|
+
value: number;
|
|
12
|
+
label: string;
|
|
13
|
+
__typename: string;
|
|
14
|
+
}[];
|
|
15
|
+
questionType: string;
|
|
16
|
+
userQuestionType: string;
|
|
17
|
+
questionConfig: {
|
|
18
|
+
recode_enabled: boolean;
|
|
19
|
+
mandatory: boolean;
|
|
20
|
+
use_select: null;
|
|
21
|
+
slider: null;
|
|
22
|
+
__typename: string;
|
|
23
|
+
};
|
|
24
|
+
__typename: string;
|
|
25
|
+
} | {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
dataPointValueType: string;
|
|
29
|
+
options: never[];
|
|
30
|
+
questionType: string;
|
|
31
|
+
userQuestionType: string;
|
|
32
|
+
questionConfig: {
|
|
33
|
+
recode_enabled: boolean;
|
|
34
|
+
mandatory: boolean;
|
|
35
|
+
use_select: null;
|
|
36
|
+
slider: {
|
|
37
|
+
min: number;
|
|
38
|
+
max: number;
|
|
39
|
+
step_value: number;
|
|
40
|
+
display_marks: boolean;
|
|
41
|
+
min_label: string;
|
|
42
|
+
max_label: string;
|
|
43
|
+
is_value_tooltip_on: boolean;
|
|
44
|
+
show_min_max_values: boolean;
|
|
45
|
+
__typename: string;
|
|
46
|
+
};
|
|
47
|
+
__typename: string;
|
|
48
|
+
};
|
|
49
|
+
__typename: string;
|
|
50
|
+
})[];
|
|
51
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ErrorLabels, QuestionRuleResult } from '../../../hooks/useForm/types';
|
|
2
|
+
import { QuestionLabels } from '../../../molecules/question/types';
|
|
3
|
+
import { AnswerInput, Form } from '../../../types';
|
|
4
|
+
declare type ButtonLabels = {
|
|
5
|
+
prev: string;
|
|
6
|
+
next: string;
|
|
7
|
+
submit: string;
|
|
8
|
+
start_form?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface WizardFormProps {
|
|
11
|
+
form: Form;
|
|
12
|
+
questionLabels?: QuestionLabels;
|
|
13
|
+
storedAnswers: string;
|
|
14
|
+
onAnswersChange: (answers: string) => void;
|
|
15
|
+
buttonLabels: ButtonLabels;
|
|
16
|
+
errorLabels: ErrorLabels;
|
|
17
|
+
onSubmit: (response: Array<AnswerInput>) => void;
|
|
18
|
+
evaluateDisplayConditions: (response: Array<AnswerInput>) => Promise<Array<QuestionRuleResult>>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Message } from './Message';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MessageAttachment } from '../../../types/generated/types-orchestration';
|
|
3
|
+
import { AttachmentLabels } from '../../../types';
|
|
4
|
+
export { MessageAttachmentType } from '../../../types/generated/types-orchestration';
|
|
5
|
+
export interface MessageProps {
|
|
6
|
+
onMessageRead: () => void;
|
|
7
|
+
content: string;
|
|
8
|
+
subject: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
attachments: Array<MessageAttachment>;
|
|
11
|
+
attachmentIcon: React.ReactNode;
|
|
12
|
+
attachmentLabels: AttachmentLabels;
|
|
13
|
+
buttonLabels: {
|
|
14
|
+
readMessage: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalDotcomActivity } from './CalDotcomActivity';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalDotcomActivity } from './cal.com';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Form } from '../../../../types';
|
|
2
|
+
export declare const form: Form;
|
|
3
|
+
export declare const formWithTwoRequiredSingleSelectQuestions: Form;
|
|
4
|
+
export declare const sliderQuestionForm: Form;
|
|
5
|
+
export declare const dateQuestionForm: Form;
|
|
6
|
+
export declare const formHavingOneQuestionHiddenWithDisplayCondition: Form;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WizardForm } from './WizardForm';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Checklist } from './activities/checklist';
|
|
2
|
+
export { Message } from './activities/message';
|
|
3
|
+
export { ConversationalForm, TraditionalForm } from './activities/form';
|
|
4
|
+
export { WizardForm } from './activities/wizardForm';
|
|
5
|
+
export { CalDotcomActivity } from './activities/scheduling';
|
|
6
|
+
export { CloudinaryUpload } from './activities/cloudinary';
|
|
7
|
+
export { CloudinarySingleFileUpload } from './activities/cloudinary';
|
|
8
|
+
export { HostedPageLayout } from './layouts/HostedPageLayout';
|
|
9
|
+
export { CloseButton } from './layouts/HostedPageLayout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CloseButton } from './CloseButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HostedPageFooter } from './HostedPageFooter';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
export interface HostedPageLayoutProps {
|
|
3
|
+
children: React.ReactNode | string;
|
|
4
|
+
onCloseHostedPage: () => void;
|
|
5
|
+
logo?: JSX.Element | string;
|
|
6
|
+
hideCloseButton?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const HostedPageLayout: FC<HostedPageLayoutProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Button, CheckboxButton, DatePicker, Description, InputField, QuestionLabel, Logo, LongTextField, RadioButton, RangeInput, RichTextViewer, HeadingMain, HeadingSecondary, HeadingTertiary, SubHeading, Heading5, Heading6, Text, InlineText, ExternalLink, InnerText, CircularSpinner, HorizontalSpinner, ThemeProvider, ScrollIndicator, Modal, CalDotComScheduling, type CalDotComBookingSuccessfulFunction, ProgressIndicator, TypingCaret, WithTypingCaret, } from './atoms';
|
|
2
|
+
export { MultipleChoiceQuestion, Navbar, Question, SingleChoiceQuestion, AttachmentList, } from './molecules';
|
|
3
|
+
export { Checklist, ConversationalForm, TraditionalForm, WizardForm, Message, HostedPageLayout, CloseButton, CloudinaryUpload, CloudinarySingleFileUpload, } from './hostedPages';
|
|
4
|
+
export { useClickOutsideNotifier, useScrollHint, useConversationalForm, useTraditionalForm, } from './hooks';
|
|
5
|
+
export * from './types';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MessageAttachment } from '../../types/generated/types-orchestration';
|
|
3
|
+
import { AttachmentLabels } from '../../types';
|
|
4
|
+
export interface AttachmentListProps {
|
|
5
|
+
attachments: Array<MessageAttachment>;
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
labels: AttachmentLabels;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AvaGPT } from './avaGPT';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare type State = 'indeterminate' | 'preload' | 'streaming-answer' | 'done';
|
|
2
|
+
export declare type AvaGPTProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
state: State;
|
|
5
|
+
promptPlaceholder?: string;
|
|
6
|
+
prompt?: string;
|
|
7
|
+
answer?: string;
|
|
8
|
+
onSubmit: (prompt: string) => void;
|
|
9
|
+
onPromptChange: (prompt: string) => void;
|
|
10
|
+
buttonLabel: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Option } from '../../types';
|
|
3
|
+
export interface MultipleChoiceQuestionProps {
|
|
4
|
+
questionId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
options: Array<Option>;
|
|
7
|
+
onChange: (newValue: Array<Option>) => void;
|
|
8
|
+
values: Array<Option>;
|
|
9
|
+
mandatory?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const MultipleChoiceQuestion: ({ questionId, label, options, onChange, values, mandatory, }: MultipleChoiceQuestionProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MultipleChoiceQuestion } from './MultipleChoiceQuestion';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QuestionDataProps, QuestionProps } from './types';
|
|
3
|
+
export declare const QuestionData: ({ question, control, getValues, labels, inputAutoFocus, submitAndMoveToNextQuestion, onAnswerChange, shouldAutoProgress, }: QuestionDataProps) => JSX.Element;
|
|
4
|
+
export declare const Question: ({ question, control, getValues, errors, labels, inputAutoFocus, submitAndMoveToNextQuestion, onAnswerChange, shouldAutoProgress, }: QuestionProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Question } from './Question';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FormError, Question } from '../../types';
|
|
2
|
+
import { Control, UseFormGetValues } from 'react-hook-form';
|
|
3
|
+
export interface QuestionLabels {
|
|
4
|
+
yes_label: string;
|
|
5
|
+
no_label: string;
|
|
6
|
+
select?: {
|
|
7
|
+
search_placeholder: string;
|
|
8
|
+
no_options: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface QuestionDataProps {
|
|
12
|
+
question: Question;
|
|
13
|
+
control: Control;
|
|
14
|
+
getValues: UseFormGetValues<any>;
|
|
15
|
+
labels: QuestionLabels;
|
|
16
|
+
inputAutoFocus?: boolean;
|
|
17
|
+
submitAndMoveToNextQuestion?: () => void;
|
|
18
|
+
onAnswerChange?: () => void;
|
|
19
|
+
shouldAutoProgress?: (question: Question) => boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface QuestionProps {
|
|
22
|
+
question: Question;
|
|
23
|
+
control: Control;
|
|
24
|
+
getValues: UseFormGetValues<any>;
|
|
25
|
+
errors: Array<FormError>;
|
|
26
|
+
labels?: QuestionLabels;
|
|
27
|
+
inputAutoFocus?: boolean;
|
|
28
|
+
submitAndMoveToNextQuestion?: () => void;
|
|
29
|
+
onAnswerChange?: () => void;
|
|
30
|
+
shouldAutoProgress?: (question: Question) => boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Option } from '../../types';
|
|
3
|
+
export interface SingleChoiceQuestionProps {
|
|
4
|
+
questionId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
options: Array<Option>;
|
|
7
|
+
value: Option | null;
|
|
8
|
+
onChange: (newValue: Option | null) => void;
|
|
9
|
+
mandatory?: boolean;
|
|
10
|
+
showFlickerOnSelected?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const SingleChoiceQuestion: ({ questionId, label, options, onChange, value, mandatory, showFlickerOnSelected, }: SingleChoiceQuestionProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SingleChoiceQuestion } from './SingleChoiceQuestion';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|